Quaternions #
In this file we define quaternions ℍ[R]
over a commutative ring R
, and define some
algebraic structures on ℍ[R]
.
Main definitions #
QuaternionAlgebra R a b
,ℍ[R, a, b]
: quaternion algebra with coefficientsa
,b
Quaternion R
,ℍ[R]
: the space of quaternions, a.k.a.QuaternionAlgebra R (-1) (-1)
;Quaternion.normSq
: square of the norm of a quaternion;
We also define the following algebraic structures on ℍ[R]
:
Ring ℍ[R, a, b]
,StarRing ℍ[R, a, b]
, andAlgebra R ℍ[R, a, b]
: for any commutative ringR
;Ring ℍ[R]
,StarRing ℍ[R]
, andAlgebra R ℍ[R]
: for any commutative ringR
;IsDomain ℍ[R]
: for a linear ordered commutative ringR
;DivisionRing ℍ[R]
: for a linear ordered fieldR
.
Notation #
The following notation is available with open Quaternion
or open scoped Quaternion
.
ℍ[R, c₁, c₂]
:QuaternionAlgebra R c₁ c₂
ℍ[R]
: quaternions overR
.
Implementation notes #
We define quaternions over any ring R
, not just ℝ
to be able to deal with, e.g., integer
or rational quaternions without using real numbers. In particular, all definitions in this file
are computable.
Tags #
quaternion
The equivalence between a quaternion algebra over R
and R × R × R × R
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
The equivalence between a quaternion algebra over R
and Fin 4 → R
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- (_ : Subsingleton (QuaternionAlgebra R c₁ c₂)) = (_ : Subsingleton (QuaternionAlgebra R c₁ c₂))
Equations
- (_ : Nontrivial (QuaternionAlgebra R c₁ c₂)) = (_ : Nontrivial (QuaternionAlgebra R c₁ c₂))
The imaginary part of a quaternion.
Equations
- QuaternionAlgebra.im x = { re := 0, imI := x.imI, imJ := x.imJ, imK := x.imK }
Instances For
Coercion R → ℍ[R,c₁,c₂]
.
Equations
- ↑x = { re := x, imI := 0, imJ := 0, imK := 0 }
Instances For
Equations
- QuaternionAlgebra.instCoeTCQuaternionAlgebra = { coe := QuaternionAlgebra.coe }
Equations
- QuaternionAlgebra.instZeroQuaternionAlgebra = { zero := { re := 0, imI := 0, imJ := 0, imK := 0 } }
Equations
- QuaternionAlgebra.instInhabitedQuaternionAlgebra = { default := 0 }
Equations
- QuaternionAlgebra.instOneQuaternionAlgebra = { one := { re := 1, imI := 0, imJ := 0, imK := 0 } }
Multiplication is given by
1 * x = x * 1 = x
;i * i = c₁
;j * j = c₂
;i * j = k
,j * i = -k
;k * k = -c₁ * c₂
;i * k = c₁ * j
,k * i = -c₁ * j
;j * k = -c₂ * i
,k * j = c₂ * i
.
Equations
- One or more equations did not get rendered due to their size.
Equations
- (_ : IsScalarTower S T (QuaternionAlgebra R c₁ c₂)) = (_ : IsScalarTower S T (QuaternionAlgebra R c₁ c₂))
Equations
- (_ : SMulCommClass S T (QuaternionAlgebra R c₁ c₂)) = (_ : SMulCommClass S T (QuaternionAlgebra R c₁ c₂))
Equations
- One or more equations did not get rendered due to their size.
Equations
- QuaternionAlgebra.instAddCommGroupWithOneQuaternionAlgebra = AddCommGroupWithOne.mk
Equations
- QuaternionAlgebra.instRing = let src := inferInstanceAs (AddCommGroupWithOne (QuaternionAlgebra R c₁ c₂)); Ring.mk SubNegMonoid.zsmul (_ : ∀ (a : QuaternionAlgebra R c₁ c₂), -a + a = 0)
Equations
- One or more equations did not get rendered due to their size.
Equations
- (_ : NoZeroSMulDivisors R (QuaternionAlgebra R c₁ c₂)) = (_ : NoZeroSMulDivisors R (QuaternionAlgebra R c₁ c₂))
QuaternionAlgebra.re
as a LinearMap
Equations
- One or more equations did not get rendered due to their size.
Instances For
QuaternionAlgebra.imI
as a LinearMap
Equations
- One or more equations did not get rendered due to their size.
Instances For
QuaternionAlgebra.imJ
as a LinearMap
Equations
- One or more equations did not get rendered due to their size.
Instances For
QuaternionAlgebra.imK
as a LinearMap
Equations
- One or more equations did not get rendered due to their size.
Instances For
QuaternionAlgebra.equivTuple
as a linear equivalence.
Equations
- One or more equations did not get rendered due to their size.
Instances For
ℍ[R, c₁, c₂]
has a basis over R
given by 1
, i
, j
, and k
.
Equations
Instances For
Equations
- (_ : Module.Finite R (QuaternionAlgebra R c₁ c₂)) = (_ : Module.Finite R (QuaternionAlgebra R c₁ c₂))
Equations
- (_ : Module.Free R (QuaternionAlgebra R c₁ c₂)) = (_ : Module.Free R (QuaternionAlgebra R c₁ c₂))
There is a natural equivalence when swapping the coefficients of a quaternion algebra.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Quaternion conjugate.
Equations
- QuaternionAlgebra.instStarQuaternionAlgebra = { star := fun (a : QuaternionAlgebra R c₁ c₂) => { re := a.re, imI := -a.imI, imJ := -a.imJ, imK := -a.imK } }
Equations
- QuaternionAlgebra.instStarRing = StarRing.mk (_ : ∀ (a b : QuaternionAlgebra R c₁ c₂), star (a + b) = star a + star b)
Equations
- (_ : IsStarNormal a) = (_ : IsStarNormal a)
Quaternion conjugate as an AlgEquiv
to the opposite ring.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Space of quaternions over a type. Implemented as a structure with four fields:
re
, im_i
, im_j
, and im_k
.
Equations
- Quaternion R = QuaternionAlgebra R (-1) (-1)
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
The equivalence between the quaternions over R
and R × R × R × R
.
Equations
- Quaternion.equivProd R = QuaternionAlgebra.equivProd (-1) (-1)
Instances For
The equivalence between the quaternions over R
and Fin 4 → R
.
Equations
- Quaternion.equivTuple R = QuaternionAlgebra.equivTuple (-1) (-1)
Instances For
Equations
- (_ : Subsingleton (Quaternion R)) = (_ : Subsingleton (QuaternionAlgebra R (-1) (-1)))
Equations
- (_ : Nontrivial (Quaternion R)) = (_ : Nontrivial (QuaternionAlgebra R (-1) (-1)))
Equations
- Quaternion.instCoeTCQuaternionToOneToSemiringToCommSemiringToNegToRing = { coe := Quaternion.coe }
Equations
- Quaternion.instRing = QuaternionAlgebra.instRing
Equations
- Quaternion.instInhabitedQuaternionToOneToSemiringToCommSemiringToNegToRing = inferInstanceAs (Inhabited (QuaternionAlgebra R (-1) (-1)))
Equations
- Quaternion.instSMulQuaternionToOneToSemiringToCommSemiringToNegToRing = inferInstanceAs (SMul S (QuaternionAlgebra R (-1) (-1)))
Equations
- (_ : IsScalarTower S T (Quaternion R)) = (_ : IsScalarTower S T (QuaternionAlgebra R (-1) (-1)))
Equations
- (_ : SMulCommClass S T (Quaternion R)) = (_ : SMulCommClass S T (QuaternionAlgebra R (-1) (-1)))
Equations
- Quaternion.algebra = inferInstanceAs (Algebra S (QuaternionAlgebra R (-1) (-1)))
Equations
- Quaternion.instStarQuaternionToOneToSemiringToCommSemiringToNegToRing = QuaternionAlgebra.instStarQuaternionAlgebra
Equations
- Quaternion.instStarRingQuaternionToOneToSemiringToCommSemiringToNegToRingToNonUnitalNonAssocSemiringToNonUnitalNonAssocRingToNonAssocRingInstRing = QuaternionAlgebra.instStarRing
Equations
- (_ : IsStarNormal a) = (_ : IsStarNormal a)
The imaginary part of a quaternion.
Equations
Instances For
Equations
- (_ : Module.Finite R (Quaternion R)) = (_ : Module.Finite R (QuaternionAlgebra R (-1) (-1)))
Equations
- (_ : Module.Free R (Quaternion R)) = (_ : Module.Free R (QuaternionAlgebra R (-1) (-1)))
Square of the norm.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- (_ : Nontrivial (Quaternion R)) = (_ : Nontrivial (Quaternion R))
Equations
- (_ : NoZeroDivisors (Quaternion R)) = (_ : NoZeroDivisors (Quaternion R))
Equations
- (_ : IsDomain (Quaternion R)) = (_ : IsDomain (Quaternion R))
Equations
- Quaternion.instInv = { inv := fun (a : Quaternion R) => (Quaternion.normSq a)⁻¹ • star a }
Equations
- Quaternion.instGroupWithZero = let src := (_ : Nontrivial (Quaternion R)); let src_1 := inferInstance; GroupWithZero.mk zpowRec (_ : 0⁻¹ = 0) (_ : ∀ (a : Quaternion R), a ≠ 0 → a * a⁻¹ = 1)
Equations
- One or more equations did not get rendered due to their size.
Equations
- One or more equations did not get rendered due to their size.
The cardinality of a quaternion algebra, as a type.
The cardinality of a quaternion algebra, as a set.
The cardinality of the quaternions, as a type.
The cardinality of the quaternions, as a set.