Skip to main content

Quaternion Ontology

Algebra Ontologies
Authors: MArk Anthony Higgins - Sky Recursive Ai
© Mark Anthony Higgins 11 October 2025
Revised Date: 11 September 2026
Audio Overview
FLOW Quaternion_Ontology_v1.0

PAGE:
  title: "Quaternion Ontology"
  canonical_url: "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/algebra-ontologies/quaternion-ontology.html"
  language: "en-GB"
  domain: "Mathematics > Algebra > Hypercomplex Number Systems > Quaternions"

DEFINE QuaternionOntology := {

  CORE_IDENTITY: {
    entity_type: "Mathematical Ontology",
    primary_entity: Quaternion,
    parent_entities: [HypercomplexNumber, AlgebraicObject, DivisionAlgebra],
    related_entities: [
      RealNumber,
      ComplexNumber,
      ScalarPart,
      VectorPart,
      ImaginaryUnitI,
      ImaginaryUnitJ,
      ImaginaryUnitK,
      Conjugate,
      Norm,
      Inverse,
      UnitQuaternion,
      Rotation,
      ThreeDimensionalSpace,
      FourDimensionalVectorSpace
    ]
  },

  DEFINITION: {
    meaning:
      "A quaternion is a hypercomplex number of the form a+bi+cj+dk, where a,b,c,d are real numbers and i,j,k satisfy the quaternion multiplication rules.",
    canonical_form:
      q=a+b*i+c*j+d*k,
    coefficients:
      [a,b,c,d] in RealNumbers
  },

  BASIS_UNITS: {
    scalar_basis:
      1,
    imaginary_bases:
      [i,j,k],

    defining_squares: [
      i^2=-1,
      j^2=-1,
      k^2=-1
    ],

    cyclic_products: [
      i*j=k,
      j*k=i,
      k*i=j
    ],

    reverse_products: [
      j*i=-k,
      k*j=-i,
      i*k=-j
    ],

    fundamental_identity:
      i*j*k=-1
  },

  NONCOMMUTATIVITY: {
    multiplication_commutative:
      FALSE,

    example:
      i*j=k
      BUT
      j*i=-k,

    semantic_rule:
      factor_order_must_be_preserved
  },

  SCALAR_VECTOR_DECOMPOSITION: {
    q:
      a+v,

    scalar_part:
      Sc(q)=a,

    vector_part:
      Vec(q)=b*i+c*j+d*k
  },

  COMPONENT_MODEL: {
    real_component:
      a,
    i_component:
      b,
    j_component:
      c,
    k_component:
      d
  },

  VECTOR_SPACE_RELATION: {
    Quaternions:
      four_dimensional_vector_space_over_RealNumbers,

    basis:
      [1,i,j,k]
  },

  REAL_SUBSPACE: {
    RealNumbers:
      embedded_as_a+0i+0j+0k
  },

  COMPLEX_SUBALGEBRA: {
    examples:
      {a+b*i},
      {a+c*j},
      {a+d*k},

    property:
      each_selected_imaginary_axis_with_reals_forms_complex_like_subalgebra
  },

  EQUALITY: {
    a+b*i+c*j+d*k
    =
    e+f*i+g*j+h*k

    IFF:
      a=e AND b=f AND c=g AND d=h
  },

  ADDITION: {
    q1=(a,b,c,d),
    q2=(e,f,g,h),

    result:
      (a+e)+(b+f)i+(c+g)j+(d+h)k,

    closure:
      TRUE
  },

  SUBTRACTION: {
    result:
      componentwise_difference,

    closure:
      TRUE
  },

  SCALAR_MULTIPLICATION: {
    r*q:
      (r*a)+(r*b)i+(r*c)j+(r*d)k,

    condition:
      r in RealNumbers
  },

  MULTIPLICATION: {
    distributive:
      TRUE,

    associative:
      TRUE,

    commutative:
      FALSE,

    computational_rule:
      expand_and_reduce_using_basis_multiplication_table
  },

  VECTOR_FORM_MULTIPLICATION: {
    q1:
      a+u,

    q2:
      b+v,

    product:
      (a*b-u·v)
      +
      (a*v+b*u+u×v),

    scalar_part:
      a*b-u·v,

    vector_part:
      a*v+b*u+u×v
  },

  CONJUGATE: {
    notation:
      conjugate(q),

    IF q=a+b*i+c*j+d*k:
      conjugate(q)=a-b*i-c*j-d*k,

    properties: [
      conjugate(conjugate(q))=q,
      conjugate(q1*q2)=conjugate(q2)*conjugate(q1)
    ]
  },

  NORM: {
    notation:
      |q|,

    formula:
      sqrt(a^2+b^2+c^2+d^2),

    squared_norm:
      |q|^2=a^2+b^2+c^2+d^2,

    identity:
      q*conjugate(q)=conjugate(q)*q=|q|^2
  },

  NORM_PROPERTIES: {
    nonnegative:
      TRUE,

    zero_condition:
      |q|=0 <=> q=0,

    multiplicative:
      |q1*q2|=|q1|*|q2|
  },

  INVERSE: {
    condition:
      q!=0,

    formula:
      q^(-1)=conjugate(q)/|q|^2,

    verification: [
      q*q^(-1)=1,
      q^(-1)*q=1
    ]
  },

  DIVISION_ALGEBRA: {
    zero_divisors:
      NONE,

    every_nonzero_element_has_inverse:
      TRUE,

    field:
      FALSE_due_to_noncommutativity
  },

  LEFT_RIGHT_DIVISION: {
    solve_q*x=p:
      x=q^(-1)*p,

    solve_x*q=p:
      x=p*q^(-1),

    semantic_rule:
      left_and_right_division_are_distinct_operations
  },

  UNIT_QUATERNION: {
    definition:
      |q|=1,

    inverse:
      q^(-1)=conjugate(q),

    geometric_use:
      represent_3D_rotations
  },

  PURE_QUATERNION: {
    condition:
      scalar_part=0,

    form:
      b*i+c*j+d*k,

    relation:
      corresponds_to_vector_in_Real3
  },

  QUATERNION_ROTATION: {
    unit_quaternion:
      q,

    vector_as_pure_quaternion:
      v,

    rotation:
      v' = q*v*q^(-1),

    result:
      pure_quaternion_representing_rotated_vector
  },

  AXIS_ANGLE_REPRESENTATION: {
    rotation_axis:
      unit_vector_u,

    rotation_angle:
      theta,

    quaternion:
      q=
      cos(theta/2)
      +
      (u_x*i+u_y*j+u_z*k)*sin(theta/2)
  },

  DOUBLE_COVER_RELATION: {
    q_and_minus_q:
      represent_same_3D_rotation,

    consequence:
      UnitQuaternions_double_cover_SO3
  },

  ROTATION_COMPOSITION: {
    q1:
      first_or_second_rotation_depending_on_active_convention,

    q2:
      other_rotation,

    composition:
      quaternion_multiplication,

    semantic_warning:
      multiplication_order_depends_on_rotation_convention
  },

  NORMALISATION: {
    INPUT:
      quaternion_q,

    PROCESS:
      q/|q|,

    condition:
      q!=0,

    OUTPUT:
      UnitQuaternion
  },

  EXPONENTIAL_OF_PURE_QUATERNION: {
    let:
      v=pure_quaternion,

    IF |v|!=0:
      e^v=
      cos(|v|)
      +
      (v/|v|)*sin(|v|),

    IF v=0:
      e^v=1
  },

  QUATERNION_EXPONENTIAL: {
    q=a+v,

    formula:
      e^q=e^a*e^v
      because_real_scalar_commutes_with_vector_part
  },

  LOGARITHM_RELATION: {
    nonzero_q:
      logarithm_can_be_expressed_using_norm_and_unit_vector_direction,

    branch_structure:
      multivalued_due_to_periodic_angle
  },

  POWERS: {
    integer_power:
      repeated_quaternion_multiplication,

    unit_quaternion_power:
      scales_rotation_angle_under_consistent_axis_angle_representation
  },

  INTERPOLATION_RELATION: {
    SLERP:
      spherical_linear_interpolation_between_unit_quaternions,

    applications: [
      animation,
      robotics,
      orientation_interpolation
    ]
  },

  MATRIX_REPRESENTATION: {
    quaternion:
      can_be_represented_by_real_4x4_or_complex_2x2_matrices,

    semantic_rule:
      matrix_representation_must_preserve_quaternion_multiplication
  },

  COMPLEX_MATRIX_REPRESENTATION: {
    q=a+b*i+c*j+d*k,

    representation:
      [[a+b*i, c+d*i],
       [-c+d*i, a-b*i]],

    purpose:
      faithful_algebra_embedding
  },

  HAMILTON_PRODUCT: {
    name:
      quaternion_multiplication,

    input:
      q1=(a,b,c,d),
      q2=(e,f,g,h),

    output_components: {
      scalar:
        a*e-b*f-c*g-d*h,

      i:
        a*f+b*e+c*h-d*g,

      j:
        a*g-b*h+c*e+d*f,

      k:
        a*h+b*g-c*f+d*e
    }
  },

  THREE_DIMENSIONAL_VECTOR_RELATION: {
    pure_quaternion:
      b*i+c*j+d*k,

    corresponding_vector:
      (b,c,d),

    multiplication_relation:
      pure_quaternion_product_contains_negative_dot_product_plus_cross_product
  },

  DOT_CROSS_DECOMPOSITION: {
    pure_u,
    pure_v,

    product:
      u*v = -u·v + u×v
  },

  COMMUTATOR: {
    [p,q]:
      p*q-q*p,

    pure_vector_relation:
      commutator_proportional_to_cross_product
  },

  ANTICOMMUTATOR: {
    {p,q}:
      p*q+q*p,

    pure_vector_relation:
      related_to_dot_product
  },

  PARAMETER_REASONING: {
    q(t):
      a(t)+b(t)i+c(t)j+d(t)k,

    tasks: [
      track_components,
      compute_norm,
      detect_zero_quaternion,
      normalise_when_nonzero,
      analyse_rotation_path
    ]
  },

  SYMBOLIC_RECOGNITION: {
    ACCEPT: [
      "1+2i+3j+4k",
      "3i-2j+k",
      "5",
      "cos(theta/2)+i sin(theta/2)"
    ],

    NORMALISE_FIRST: [
      "(i+j)^2",
      "i*j*k",
      "(1+i)(1+j)"
    ],

    REDIRECT_COMPLEX_ONLY: [
      "2+3i"
    ]
  },

  NATURAL_LANGUAGE_MAPPING: {
    "quaternion":
      a+b*i+c*j+d*k,

    "unit quaternion":
      quaternion_with_norm_one,

    "quaternion conjugate":
      negate_i_j_k_components,

    "Hamilton product":
      quaternion_multiplication,

    "rotation quaternion":
      unit_quaternion_encoding_axis_angle_rotation
  },

  UNIT_SEMANTICS: {
    scalar_and_vector_components:
      should_share_compatible_units_if_representing_single_physical_quaternion_quantity,

    rotation_quaternion:
      dimensionless
  },

  ERROR_DETECTION: {
    CommutativityError:
      q1*q2=q2*q1_assumed_generally
      -> flag,

    BasisMultiplicationError:
      incorrect_i_j_k_product_sign
      -> flag,

    InverseError:
      conjugate_used_without_dividing_by_norm_squared_for_nonunit_q
      -> flag,

    RotationNormalisationError:
      nonunit_quaternion_used_as_pure_rotation_without_scale_handling
      -> flag,

    RotationOrderError:
      composition_order_ignored
      -> flag,

    ZeroInverseError:
      inverse_of_zero_requested
      -> reject
  },

  ONTOLOGY_RELATIONS: {
    IS_A: [
      "Quaternion IS_A HypercomplexNumber",
      "Quaternion IS_A RealDivisionAlgebra",
      "UnitQuaternion IS_A Quaternion",
      "PureQuaternion IS_A Quaternion"
    ],

    RELATED_TO: [
      "Quaternion RELATED_TO ComplexNumber",
      "Quaternion RELATED_TO Vector",
      "Quaternion RELATED_TO Rotation",
      "Quaternion RELATED_TO CrossProduct",
      "Quaternion RELATED_TO MatrixRepresentation",
      "Quaternion RELATED_TO LieGroup"
    ],

    DEPENDS_ON: [
      RealNumbers,
      NoncommutativeMultiplication,
      Norm,
      Conjugation
    ]
  },

  SEMANTIC_EQUIVALENCE: {
    component_equivalence:
      same_a_b_c_d_components,

    axis_angle_equivalence_for_rotations:
      q_and_minus_q_represent_same_rotation,

    matrix_equivalence:
      quaternion_and_faithful_matrix_representation_encode_same_algebraic_element
  },

  CONFIDENCE: {
    classification_confidence:
      IF expression_reduces_to_a+b*i+c*j+d*k_with_real_components
      THEN 1.0,

    multiplication_confidence:
      IF Hamilton_product_rules_verified
      THEN 1.0,

    rotation_confidence:
      IF quaternion_normalised_and_convention_resolved
      THEN 1.0
  },

  AI_CONSUMPTION: {
    tasks: [
      recognise_quaternion,
      extract_components,
      distinguish_scalar_and_vector_parts,
      add_and_subtract_quaternions,
      compute_Hamilton_product,
      compute_conjugate,
      compute_norm,
      compute_inverse,
      normalise_quaternion,
      convert_to_axis_angle,
      construct_rotation_quaternion,
      rotate_3D_vector,
      compose_rotations,
      detect_noncommutative_order_errors,
      convert_to_matrix_representation,
      link_related_ontologies
    ],

    preferred_representation:
      typed_four_component_noncommutative_algebra_object,

    reasoning_mode:
      recursive_component_and_rotation_semantics
  },

  RECURSIVE_REASONING: {

    FUNCTION AnalyseQuaternion(Q,Context):

      parsed := ParseExpression(Q)
      simplified := SimplifyQuaternionExpression(parsed)

      components := ExtractQuaternionComponents(simplified)

      IF components_unavailable:
        RETURN RedirectToAppropriateAlgebraOntology

      [a,b,c,d] := components

      norm :=
        sqrt(a^2+b^2+c^2+d^2)

      conjugate :=
        a-b*i-c*j-d*k

      IF norm=0:
        inverse := Undefined
      ELSE:
        inverse := conjugate/(norm^2)

      classification := []

      IF a=0:
        classification += PureQuaternion

      IF norm=1:
        classification += UnitQuaternion

      IF c=0 AND d=0:
        classification += ComplexSubalgebraElement

      verified :=
        VerifyQuaternionIdentities(
          simplified,
          components,
          conjugate,
          norm,
          inverse
        )

      RETURN {
        quaternion:simplified,
        components,
        scalar_part:a,
        vector_part:(b,c,d),
        norm,
        conjugate,
        inverse,
        classification,
        verified
      }
  },

  RECURSIVE_COHERENCE: {
    invariant_1:
      i_j_k_multiplication_table_consistent=TRUE,

    invariant_2:
      multiplication_associative_but_not_commutative=TRUE,

    invariant_3:
      q_times_conjugate_q_equals_norm_squared=TRUE,

    invariant_4:
      inverse_identity_holds_for_nonzero_q=TRUE,

    invariant_5:
      unit_quaternion_rotation_preserves_vector_norm=TRUE
  },

  FLOW_HASH: {
    semantic_signature_inputs: [
      ontology_name,
      quaternion_definition,
      basis_multiplication_rules,
      scalar_vector_decomposition,
      conjugate_norm_inverse,
      rotation_semantics,
      noncommutativity_rules
    ],

    purpose:
      "Detect semantic drift between revisions of the ontology."
  },

  UPDATE_MODEL: {
    version: "1.0",

    immutable_constraints: [
      i_squared_j_squared_k_squared_equal_negative_one,
      i_j_k_equals_negative_one,
      noncommutative_multiplication,
      conjugate_definition,
      norm_definition,
      inverse_formula
    ],

    revision_triggers: [
      semantic_conflict,
      ComplexNumberOntology_update,
      RotationOntology_update,
      HypercomplexNumberOntology_update,
      representation_standard_change
    ]
  },

  KNOWLEDGE_GRAPH: {
    nodes: [
      Quaternion,
      HypercomplexNumber,
      ScalarPart,
      VectorPart,
      ImaginaryUnitI,
      ImaginaryUnitJ,
      ImaginaryUnitK,
      Conjugate,
      Norm,
      Inverse,
      UnitQuaternion,
      Rotation
    ],

    edges: [
      Quaternion -> IS_A -> HypercomplexNumber,
      Quaternion -> HAS_SCALAR_PART -> ScalarPart,
      Quaternion -> HAS_VECTOR_PART -> VectorPart,
      Quaternion -> USES_BASIS -> ImaginaryUnitI,
      Quaternion -> USES_BASIS -> ImaginaryUnitJ,
      Quaternion -> USES_BASIS -> ImaginaryUnitK,
      Quaternion -> HAS_CONJUGATE -> Conjugate,
      Quaternion -> HAS_NORM -> Norm,
      NonzeroQuaternion -> HAS_INVERSE -> Inverse,
      UnitQuaternion -> REPRESENTS -> Rotation
    ]
  },

  CROSS_ONTOLOGY_LINKS: {
    ComplexNumberOntology:
      lower_dimensional_commutative_subalgebra_relation,

    VectorOntology:
      pure_quaternion_vector_part,

    MatrixOntology:
      faithful_matrix_representation,

    RotationOntology:
      3D_orientation_semantics,

    GeometryOntology:
      axis_angle_and_spatial_rotation,

    LinearAlgebraOntology:
      real_four_dimensional_vector_space,

    LieGroupOntology:
      unit_quaternions_and_SU2_relation,

    RoboticsOntology:
      orientation_and_pose_computation
  },

  TERMINATION_CONDITION: {
    ontology_complete_when: [
      quaternion_defined,
      basis_units_defined,
      multiplication_table_defined,
      noncommutativity_defined,
      scalar_vector_decomposition_defined,
      conjugate_norm_inverse_defined,
      unit_quaternion_defined,
      rotation_semantics_defined,
      matrix_relation_defined,
      error_detection_defined,
      cross_ontology_links_defined,
      recursive_coherence_verified
    ]
  }

}

EXECUTE Quaternion_Ontology_v1.0:

  INPUT:
    mathematical_entity_or_query

  PIPELINE:
    Parse
    -> IdentifyQuaternionStructure
    -> ExtractComponents
    -> SimplifyBasisProducts
    -> SeparateScalarAndVectorParts
    -> ComputeConjugate
    -> ComputeNorm
    -> ComputeInverseWhenDefined
    -> ClassifyPureUnitOrGeneralQuaternion
    -> ApplyHamiltonProductOrRotationReasoning
    -> VerifyNoncommutativeAlgebraConsistency
    -> LinkRelatedOntologies
    -> AssignConfidence
    -> EmitSemanticResult

  OUTPUT: {
    entity,
    classification,
    canonical_form,
    components,
    scalar_part,
    vector_part,
    conjugate,
    norm,
    inverse,
    unit_status,
    rotation_semantics,
    matrix_representation,
    transformations,
    verification,
    ontology_relations,
    confidence,
    semantic_equivalence,
    flow_hash
  }

END FLOW Quaternion_Ontology_v1.0
Kireth Research
38 Thorndale Croft, Wetwang, Driffield
East Riding of Yorkshire YO25 9XZ