uor-foundation 0.2.0

UOR Foundation — typed Rust traits for the complete ontology. Import and implement.
Documentation
// @generated by uor-crate from uor-ontology — do not edit manually

//! `division/` namespace — The four normed division algebras R, C, H, O and the Cayley-Dickson construction..
//!
//! Space: Kernel

use crate::Primitives;

/// An algebra over R that is a division ring with multiplicative norm. Exactly four exist (Hurwitz theorem): R, C, H, O.
pub trait NormedDivisionAlgebra<P: Primitives> {
    /// The dimension of this division algebra (1, 2, 4, or 8).
    fn algebra_dimension(&self) -> P::NonNegativeInteger;
    /// Whether multiplication in this algebra is commutative.
    fn is_commutative(&self) -> P::Boolean;
    /// Whether multiplication in this algebra is associative.
    fn is_associative(&self) -> P::Boolean;
    /// The basis elements of this division algebra.
    fn basis_elements(&self) -> &P::String;
    /// Associated type for `MultiplicationTable`.
    type MultiplicationTable: MultiplicationTable<P>;
    /// The multiplication table for this algebra.
    fn algebra_multiplication_table(&self) -> &Self::MultiplicationTable;
}

/// The doubling construction that builds each division algebra from the previous: R → C → H → O.
pub trait CayleyDicksonConstruction<P: Primitives> {
    /// Associated type for `NormedDivisionAlgebra`.
    type NormedDivisionAlgebra: NormedDivisionAlgebra<P>;
    /// The source algebra of the Cayley-Dickson doubling.
    fn cayley_dickson_source(&self) -> &Self::NormedDivisionAlgebra;
    /// The target algebra of the Cayley-Dickson doubling.
    fn cayley_dickson_target(&self) -> &Self::NormedDivisionAlgebra;
    /// The new basis element adjoined by this doubling step.
    fn adjoined_element(&self) -> &P::String;
    /// The conjugation and multiplication rule for the adjoined element.
    fn conjugation_rule(&self) -> &P::String;
}

/// The explicit product rules for a division algebra’s basis elements.
pub trait MultiplicationTable<P: Primitives> {}

/// The commutator \[a,b\] = ab − ba. Zero for R and C; non-zero for H and O.
pub trait AlgebraCommutator<P: Primitives> {}

/// The associator \[a,b,c\] = (ab)c − a(bc). Zero for R, C, H; non-zero for O.
pub trait AlgebraAssociator<P: Primitives> {}

/// The real numbers R: dimension 1, commutative, associative.
pub mod real_algebra {
    /// `algebraDimension`
    pub const ALGEBRA_DIMENSION: i64 = 1;
    /// `basisElements`
    pub const BASIS_ELEMENTS: &str = "{1}";
    /// `isAssociative`
    pub const IS_ASSOCIATIVE: bool = true;
    /// `isCommutative`
    pub const IS_COMMUTATIVE: bool = true;
}

/// The complex numbers C: dimension 2, commutative, associative.
pub mod complex_algebra {
    /// `algebraDimension`
    pub const ALGEBRA_DIMENSION: i64 = 2;
    /// `basisElements`
    pub const BASIS_ELEMENTS: &str = "{1, i}";
    /// `isAssociative`
    pub const IS_ASSOCIATIVE: bool = true;
    /// `isCommutative`
    pub const IS_COMMUTATIVE: bool = true;
}

/// The quaternions H: dimension 4, non-commutative, associative.
pub mod quaternion_algebra {
    /// `algebraDimension`
    pub const ALGEBRA_DIMENSION: i64 = 4;
    /// `basisElements`
    pub const BASIS_ELEMENTS: &str = "{1, i, j, k}";
    /// `isAssociative`
    pub const IS_ASSOCIATIVE: bool = true;
    /// `isCommutative`
    pub const IS_COMMUTATIVE: bool = false;
}

/// The octonions O: dimension 8, non-commutative, non-associative.
pub mod octonion_algebra {
    /// `algebraDimension`
    pub const ALGEBRA_DIMENSION: i64 = 8;
    /// `basisElements`
    pub const BASIS_ELEMENTS: &str = "{1, i, j, k, l, il, jl, kl}";
    /// `isAssociative`
    pub const IS_ASSOCIATIVE: bool = false;
    /// `isCommutative`
    pub const IS_COMMUTATIVE: bool = false;
}

/// Cayley-Dickson doubling R → C: adjoin i with i² = −1.
pub mod cayley_dickson_r_to_c {
    /// `adjoinedElement`
    pub const ADJOINED_ELEMENT: &str = "i";
    /// `cayleyDicksonSource` -> `RealAlgebra`
    pub const CAYLEY_DICKSON_SOURCE: &str = "https://uor.foundation/division/RealAlgebra";
    /// `cayleyDicksonTarget` -> `ComplexAlgebra`
    pub const CAYLEY_DICKSON_TARGET: &str = "https://uor.foundation/division/ComplexAlgebra";
    /// `conjugationRule`
    pub const CONJUGATION_RULE: &str = "i² = −1";
}

/// Cayley-Dickson doubling C → H: adjoin j with j² = −1, ij = k, ji = −k.
pub mod cayley_dickson_c_to_h {
    /// `adjoinedElement`
    pub const ADJOINED_ELEMENT: &str = "j";
    /// `cayleyDicksonSource` -> `ComplexAlgebra`
    pub const CAYLEY_DICKSON_SOURCE: &str = "https://uor.foundation/division/ComplexAlgebra";
    /// `cayleyDicksonTarget` -> `QuaternionAlgebra`
    pub const CAYLEY_DICKSON_TARGET: &str = "https://uor.foundation/division/QuaternionAlgebra";
    /// `conjugationRule`
    pub const CONJUGATION_RULE: &str = "ij = k, ji = −k";
}

/// Cayley-Dickson doubling H → O: adjoin l, non-associative Fano plane products.
pub mod cayley_dickson_h_to_o {
    /// `adjoinedElement`
    pub const ADJOINED_ELEMENT: &str = "l";
    /// `cayleyDicksonSource` -> `QuaternionAlgebra`
    pub const CAYLEY_DICKSON_SOURCE: &str = "https://uor.foundation/division/QuaternionAlgebra";
    /// `cayleyDicksonTarget` -> `OctonionAlgebra`
    pub const CAYLEY_DICKSON_TARGET: &str = "https://uor.foundation/division/OctonionAlgebra";
    /// `conjugationRule`
    pub const CONJUGATION_RULE: &str = "non-associative Fano plane products";
}