fact
stringlengths
6
3.84k
type
stringclasses
11 values
library
stringclasses
32 values
imports
listlengths
1
14
filename
stringlengths
20
95
symbolic_name
stringlengths
1
90
docstring
stringlengths
7
20k
PreEnvelGroupRel'.rel {R : Type u} [Rack R] {a b : PreEnvelGroup R} : PreEnvelGroupRel' R a b → PreEnvelGroupRel R a b := PreEnvelGroupRel.rel @[refl]
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
PreEnvelGroupRel'.rel
A quick way to convert a `PreEnvelGroupRel'` to a `PreEnvelGroupRel`.
PreEnvelGroupRel.refl {R : Type u} [Rack R] {a : PreEnvelGroup R} : PreEnvelGroupRel R a a := PreEnvelGroupRel.rel PreEnvelGroupRel'.refl @[symm]
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
PreEnvelGroupRel.refl
null
PreEnvelGroupRel.symm {R : Type u} [Rack R] {a b : PreEnvelGroup R} : PreEnvelGroupRel R a b → PreEnvelGroupRel R b a | ⟨r⟩ => r.symm.rel @[trans]
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
PreEnvelGroupRel.symm
null
PreEnvelGroupRel.trans {R : Type u} [Rack R] {a b c : PreEnvelGroup R} : PreEnvelGroupRel R a b → PreEnvelGroupRel R b c → PreEnvelGroupRel R a c | ⟨rab⟩, ⟨rbc⟩ => (rab.trans rbc).rel
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
PreEnvelGroupRel.trans
null
PreEnvelGroup.setoid (R : Type*) [Rack R] : Setoid (PreEnvelGroup R) where r := PreEnvelGroupRel R iseqv := by constructor · apply PreEnvelGroupRel.refl · apply PreEnvelGroupRel.symm · apply PreEnvelGroupRel.trans
instance
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
PreEnvelGroup.setoid
null
EnvelGroup (R : Type*) [Rack R] := Quotient (PreEnvelGroup.setoid R)
def
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
EnvelGroup
The universal enveloping group for the rack R.
EnvelGroup.inhabited (R : Type*) [Rack R] : Inhabited (EnvelGroup R) := ⟨1⟩
instance
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
EnvelGroup.inhabited
null
toEnvelGroup (R : Type*) [Rack R] : R →◃ Quandle.Conj (EnvelGroup R) where toFun x := ⟦incl x⟧ map_act' := @fun x y => Quotient.sound (PreEnvelGroupRel'.act_incl x y).symm.rel
def
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
toEnvelGroup
The canonical homomorphism from a rack to its enveloping group. Satisfies universal properties given by `toEnvelGroup.map` and `toEnvelGroup.univ`.
toEnvelGroup.mapAux {R : Type*} [Rack R] {G : Type*} [Group G] (f : R →◃ Quandle.Conj G) : PreEnvelGroup R → G | .unit => 1 | .incl x => f x | .mul a b => toEnvelGroup.mapAux f a * toEnvelGroup.mapAux f b | .inv a => (toEnvelGroup.mapAux f a)⁻¹
def
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
toEnvelGroup.mapAux
The preliminary definition of the induced map from the enveloping group. See `toEnvelGroup.map`.
well_def {R : Type*} [Rack R] {G : Type*} [Group G] (f : R →◃ Quandle.Conj G) : ∀ {a b : PreEnvelGroup R}, PreEnvelGroupRel' R a b → toEnvelGroup.mapAux f a = toEnvelGroup.mapAux f b | _, _, PreEnvelGroupRel'.refl => rfl | _, _, PreEnvelGroupRel'.symm h => (well_def f h).symm | _, _, PreEnvelGroupRel'.trans hac hcb => Eq.trans (well_def f hac) (well_def f hcb) | _, _, PreEnvelGroupRel'.congr_mul ha hb => by simp [toEnvelGroup.mapAux, well_def f ha, well_def f hb] | _, _, congr_inv ha => by simp [toEnvelGroup.mapAux, well_def f ha] | _, _, assoc a b c => by apply mul_assoc | _, _, PreEnvelGroupRel'.one_mul a => by simp [toEnvelGroup.mapAux] | _, _, PreEnvelGroupRel'.mul_one a => by simp [toEnvelGroup.mapAux] | _, _, PreEnvelGroupRel'.inv_mul_cancel a => by simp [toEnvelGroup.mapAux] | _, _, act_incl x y => by simp [toEnvelGroup.mapAux]
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
well_def
Show that `toEnvelGroup.mapAux` sends equivalent expressions to equal terms.
toEnvelGroup.map {R : Type*} [Rack R] {G : Type*} [Group G] : (R →◃ Quandle.Conj G) ≃ (EnvelGroup R →* G) where toFun f := { toFun := fun x => Quotient.liftOn x (toEnvelGroup.mapAux f) fun _ _ ⟨hab⟩ => toEnvelGroup.mapAux.well_def f hab map_one' := by change Quotient.liftOn ⟦Rack.PreEnvelGroup.unit⟧ (toEnvelGroup.mapAux f) _ = 1 simp only [Quotient.lift_mk, mapAux] map_mul' := fun x y => Quotient.inductionOn₂ x y fun x y => by change Quotient.liftOn ⟦mul x y⟧ (toEnvelGroup.mapAux f) _ = _ simp [toEnvelGroup.mapAux] } invFun F := (Quandle.Conj.map F).comp (toEnvelGroup R) right_inv F := MonoidHom.ext fun x => Quotient.inductionOn x fun x => by induction x with | unit => exact F.map_one.symm | incl => rfl | mul x y ih_x ih_y => have hm : ⟦x.mul y⟧ = @Mul.mul (EnvelGroup R) _ ⟦x⟧ ⟦y⟧ := rfl simp only [MonoidHom.coe_mk, OneHom.coe_mk, Quotient.lift_mk] suffices ∀ x y, F (Mul.mul x y) = F (x) * F (y) by simp_all only [MonoidHom.coe_mk, OneHom.coe_mk, Quotient.lift_mk] rw [← ih_x, ← ih_y, mapAux] exact F.map_mul | inv x ih_x => have hm : ⟦x.inv⟧ = @Inv.inv (EnvelGroup R) _ ⟦x⟧ := rfl rw [hm, F.map_inv, MonoidHom.map_inv, ih_x]
def
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
toEnvelGroup.map
Given a map from a rack to a group, lift it to being a map from the enveloping group. More precisely, the `EnvelGroup` functor is left adjoint to `Quandle.Conj`.
toEnvelGroup.univ (R : Type*) [Rack R] (G : Type*) [Group G] (f : R →◃ Quandle.Conj G) : (Quandle.Conj.map (toEnvelGroup.map f)).comp (toEnvelGroup R) = f := toEnvelGroup.map.symm_apply_apply f
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
toEnvelGroup.univ
Given a homomorphism from a rack to a group, it factors through the enveloping group.
toEnvelGroup.univ_uniq (R : Type*) [Rack R] (G : Type*) [Group G] (f : R →◃ Quandle.Conj G) (g : EnvelGroup R →* G) (h : f = (Quandle.Conj.map g).comp (toEnvelGroup R)) : g = toEnvelGroup.map f := h.symm ▸ (toEnvelGroup.map.apply_symm_apply g).symm
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
toEnvelGroup.univ_uniq
The homomorphism `toEnvelGroup.map f` is the unique map that fits into the commutative triangle in `toEnvelGroup.univ`.
envelAction {R : Type*} [Rack R] : EnvelGroup R →* R ≃ R := toEnvelGroup.map (toConj R) @[simp]
def
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
envelAction
The induced group homomorphism from the enveloping group into bijections of the rack, using `Rack.toConj`. Satisfies the property `envelAction_prop`. This gives the rack `R` the structure of an augmented rack over `EnvelGroup R`.
envelAction_prop {R : Type*} [Rack R] (x y : R) : envelAction (toEnvelGroup R x) y = x ◃ y := rfl
theorem
Algebra
[ "Mathlib.Algebra.Group.End", "Mathlib.Data.ZMod.Defs", "Mathlib.Tactic.Ring" ]
Mathlib/Algebra/Quandle.lean
envelAction_prop
null
@[ext] QuaternionAlgebra (R : Type*) (a b c : R) where /-- Real part of a quaternion. -/ re : R /-- First imaginary part (i) of a quaternion. -/ imI : R /-- Second imaginary part (j) of a quaternion. -/ imJ : R /-- Third imaginary part (k) of a quaternion. -/ imK : R initialize_simps_projections QuaternionAlgebra (as_prefix re, as_prefix imI, as_prefix imJ, as_prefix imK) @[inherit_doc] scoped[Quaternion] notation "ℍ[" R "," a "," b "," c "]" => QuaternionAlgebra R a b c @[inherit_doc] scoped[Quaternion] notation "ℍ[" R "," a "," b "]" => QuaternionAlgebra R a 0 b
structure
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
QuaternionAlgebra
Quaternion algebra over a type with fixed coefficients where $i^2 = a + bi$ and $j^2 = c$, denoted as `ℍ[R,a,b]`. Implemented as a structure with four fields: `re`, `imI`, `imJ`, and `imK`.
@[simps] equivProd {R : Type*} (c₁ c₂ c₃ : R) : ℍ[R,c₁,c₂,c₃] ≃ R × R × R × R where toFun a := ⟨a.1, a.2, a.3, a.4⟩ invFun a := ⟨a.1, a.2.1, a.2.2.1, a.2.2.2⟩
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
equivProd
The equivalence between a quaternion algebra over `R` and `R × R × R × R`.
@[simps symm_apply] equivTuple {R : Type*} (c₁ c₂ c₃ : R) : ℍ[R,c₁,c₂,c₃] ≃ (Fin 4 → R) where toFun a := ![a.1, a.2, a.3, a.4] invFun a := ⟨a 0, a 1, a 2, a 3⟩ right_inv _ := by ext ⟨_, _ | _ | _ | _ | _ | ⟨⟩⟩ <;> rfl @[simp]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
equivTuple
The equivalence between a quaternion algebra over `R` and `Fin 4 → R`.
equivTuple_apply {R : Type*} (c₁ c₂ c₃ : R) (x : ℍ[R,c₁,c₂,c₃]) : equivTuple c₁ c₂ c₃ x = ![x.re, x.imI, x.imJ, x.imK] := rfl @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
equivTuple_apply
null
mk.eta {R : Type*} {c₁ c₂ c₃} (a : ℍ[R,c₁,c₂,c₃]) : mk a.1 a.2 a.3 a.4 = a := rfl variable {S T R : Type*} {c₁ c₂ c₃ : R} (r x y : R) (a b : ℍ[R,c₁,c₂,c₃])
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
mk.eta
null
im (x : ℍ[R,c₁,c₂,c₃]) : ℍ[R,c₁,c₂,c₃] := ⟨0, x.imI, x.imJ, x.imK⟩ @[simp]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im
The imaginary part of a quaternion. Note that unless `c₂ = 0`, this definition is not particularly well-behaved; for instance, `QuaternionAlgebra.star_im` only says that the star of an imaginary quaternion is imaginary under this condition.
re_im : a.im.re = 0 := rfl @[deprecated (since := "2025-08-31")] alias im_re := re_im @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
re_im
null
imI_im : a.im.imI = a.imI := rfl @[deprecated (since := "2025-08-31")] alias im_imI := imI_im @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imI_im
null
imJ_im : a.im.imJ = a.imJ := rfl @[deprecated (since := "2025-08-31")] alias im_imJ := imJ_im @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imJ_im
null
imK_im : a.im.imK = a.imK := rfl @[deprecated (since := "2025-08-31")] alias im_imK := imK_im @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imK_im
null
im_idem : a.im.im = a.im := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_idem
null
@[coe] coe (x : R) : ℍ[R,c₁,c₂,c₃] := ⟨x, 0, 0, 0⟩
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe
Coercion `R → ℍ[R,c₁,c₂,c₃]`.
@[simp, norm_cast] re_coe : (x : ℍ[R,c₁,c₂,c₃]).re = x := rfl @[deprecated (since := "2025-08-31")] alias coe_re := re_coe @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
re_coe
null
imI_coe : (x : ℍ[R,c₁,c₂,c₃]).imI = 0 := rfl @[deprecated (since := "2025-08-31")] alias coe_imI := imI_coe @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imI_coe
null
imJ_coe : (x : ℍ[R,c₁,c₂,c₃]).imJ = 0 := rfl @[deprecated (since := "2025-08-31")] alias coe_imJ := imJ_coe @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imJ_coe
null
imK_coe : (x : ℍ[R,c₁,c₂,c₃]).imK = 0 := rfl @[deprecated (since := "2025-08-31")] alias coe_imK := imK_coe
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imK_coe
null
coe_injective : Function.Injective (coe : R → ℍ[R,c₁,c₂,c₃]) := fun _ _ h => congr_arg re h @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_injective
null
coe_inj {x y : R} : (x : ℍ[R,c₁,c₂,c₃]) = y ↔ x = y := coe_injective.eq_iff @[simps]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_inj
null
@[scoped simp] im_zero : (0 : ℍ[R,c₁,c₂,c₃]).im = 0 := rfl @[deprecated (since := "2025-08-31")] alias zero_im := im_zero @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_zero
null
coe_zero : ((0 : R) : ℍ[R,c₁,c₂,c₃]) = 0 := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_zero
null
@[scoped simp] im_one : (1 : ℍ[R,c₁,c₂,c₃]).im = 0 := rfl @[deprecated (since := "2025-08-31")] alias one_im := im_one @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_one
null
coe_one : ((1 : R) : ℍ[R,c₁,c₂,c₃]) = 1 := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_one
null
@[simp] mk_add_mk (a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R) : (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂,c₃]) + mk b₁ b₂ b₃ b₄ = mk (a₁ + b₁) (a₂ + b₂) (a₃ + b₃) (a₄ + b₄) := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
mk_add_mk
null
@[simp] im_add : (a + b).im = a.im + b.im := QuaternionAlgebra.ext (zero_add _).symm rfl rfl rfl @[deprecated (since := "2025-08-31")] alias add_im := im_add @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_add
null
coe_add : ((x + y : R) : ℍ[R,c₁,c₂,c₃]) = x + y := by ext <;> simp
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_add
null
@[simp] neg_mk (a₁ a₂ a₃ a₄ : R) : -(mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂,c₃]) = ⟨-a₁, -a₂, -a₃, -a₄⟩ := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
neg_mk
null
@[simp] im_neg : (-a).im = -a.im := QuaternionAlgebra.ext neg_zero.symm rfl rfl rfl @[deprecated (since := "2025-08-31")] alias neg_im := im_neg @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_neg
null
coe_neg : ((-x : R) : ℍ[R,c₁,c₂,c₃]) = -x := by ext <;> simp @[simps]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_neg
null
@[simp] im_sub : (a - b).im = a.im - b.im := QuaternionAlgebra.ext (sub_zero _).symm rfl rfl rfl @[deprecated (since := "2025-08-31")] alias sub_im := im_sub @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_sub
null
mk_sub_mk (a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R) : (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂,c₃]) - mk b₁ b₂ b₃ b₄ = mk (a₁ - b₁) (a₂ - b₂) (a₃ - b₃) (a₄ - b₄) := rfl @[simp, norm_cast]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
mk_sub_mk
null
im_coe : (x : ℍ[R,c₁,c₂,c₃]).im = 0 := rfl @[deprecated (since := "2025-08-31")] alias coe_im := im_coe @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_coe
null
re_add_im : ↑a.re + a.im = a := QuaternionAlgebra.ext (add_zero _) (zero_add _) (zero_add _) (zero_add _) @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
re_add_im
null
sub_im_self : a - a.im = a.re := QuaternionAlgebra.ext (sub_zero _) (sub_self _) (sub_self _) (sub_self _) @[deprecated (since := "2025-08-31")] alias sub_self_im := sub_im_self @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
sub_im_self
null
sub_re_self : a - a.re = a.im := QuaternionAlgebra.ext (sub_self _) (sub_zero _) (sub_zero _) (sub_zero _) @[deprecated (since := "2025-08-31")] alias sub_self_re := sub_re_self
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
sub_re_self
null
@[simps] reₗ : ℍ[R,c₁,c₂,c₃] →ₗ[R] R where toFun := re map_add' _ _ := rfl map_smul' _ _ := rfl
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
reₗ
Multiplication is given by * `1 * x = x * 1 = x`; * `i * i = c₁ + c₂ * i`; * `j * j = c₃`; * `i * j = k`, `j * i = c₂ * j - k`; * `k * k = - c₁ * c₃`; * `i * k = c₁ * j + c₂ * k`, `k * i = -c₁ * j`; * `j * k = c₂ * c₃ - c₃ * i`, `k * j = c₃ * i`. -/ @[simps] instance : Mul ℍ[R,c₁,c₂,c₃] := ⟨fun a b => ⟨a.1 * b.1 + c₁ * a.2 * b.2 + c₃ * a.3 * b.3 + c₂ * c₃ * a.3 * b.4 - c₁ * c₃ * a.4 * b.4, a.1 * b.2 + a.2 * b.1 + c₂ * a.2 * b.2 - c₃ * a.3 * b.4 + c₃ * a.4 * b.3, a.1 * b.3 + c₁ * a.2 * b.4 + a.3 * b.1 + c₂ * a.3 * b.2 - c₁ * a.4 * b.2, a.1 * b.4 + a.2 * b.3 + c₂ * a.2 * b.4 - a.3 * b.2 + a.4 * b.1⟩⟩ @[simp] theorem mk_mul_mk (a₁ a₂ a₃ a₄ b₁ b₂ b₃ b₄ : R) : (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂,c₃]) * mk b₁ b₂ b₃ b₄ = mk (a₁ * b₁ + c₁ * a₂ * b₂ + c₃ * a₃ * b₃ + c₂ * c₃ * a₃ * b₄ - c₁ * c₃ * a₄ * b₄) (a₁ * b₂ + a₂ * b₁ + c₂ * a₂ * b₂ - c₃ * a₃ * b₄ + c₃ * a₄ * b₃) (a₁ * b₃ + c₁ * a₂ * b₄ + a₃ * b₁ + c₂ * a₃ * b₂ - c₁ * a₄ * b₂) (a₁ * b₄ + a₂ * b₃ + c₂ * a₂ * b₄ - a₃ * b₂ + a₄ * b₁) := rfl end Ring section SMul variable [SMul S R] [SMul T R] (s : S) @[simps] instance : SMul S ℍ[R,c₁,c₂,c₃] where smul s a := ⟨s • a.1, s • a.2, s • a.3, s • a.4⟩ instance [SMul S T] [IsScalarTower S T R] : IsScalarTower S T ℍ[R,c₁,c₂,c₃] where smul_assoc s t x := by ext <;> exact smul_assoc _ _ _ instance [SMulCommClass S T R] : SMulCommClass S T ℍ[R,c₁,c₂,c₃] where smul_comm s t x := by ext <;> exact smul_comm _ _ _ @[simp] theorem im_smul {S} [CommRing R] [SMulZeroClass S R] (s : S) : (s • a).im = s • a.im := QuaternionAlgebra.ext (smul_zero s).symm rfl rfl rfl @[deprecated (since := "2025-08-31")] alias smul_im := im_smul @[simp] theorem smul_mk (re im_i im_j im_k : R) : s • (⟨re, im_i, im_j, im_k⟩ : ℍ[R,c₁,c₂,c₃]) = ⟨s • re, s • im_i, s • im_j, s • im_k⟩ := rfl end SMul @[simp, norm_cast] theorem coe_smul [Zero R] [SMulZeroClass S R] (s : S) (r : R) : (↑(s • r) : ℍ[R,c₁,c₂,c₃]) = s • (r : ℍ[R,c₁,c₂,c₃]) := QuaternionAlgebra.ext rfl (smul_zero _).symm (smul_zero _).symm (smul_zero _).symm instance [AddCommGroup R] : AddCommGroup ℍ[R,c₁,c₂,c₃] := (equivProd c₁ c₂ c₃).injective.addCommGroup _ rfl (fun _ _ ↦ rfl) (fun _ ↦ rfl) (fun _ _ ↦ rfl) (fun _ _ ↦ rfl) (fun _ _ ↦ rfl) section AddCommGroupWithOne variable [AddCommGroupWithOne R] instance : AddCommGroupWithOne ℍ[R,c₁,c₂,c₃] where natCast n := ((n : R) : ℍ[R,c₁,c₂,c₃]) natCast_zero := by simp natCast_succ := by simp intCast n := ((n : R) : ℍ[R,c₁,c₂,c₃]) intCast_ofNat _ := congr_arg coe (Int.cast_natCast _) intCast_negSucc n := by change coe _ = -coe _ rw [Int.cast_negSucc, coe_neg] @[simp, norm_cast] theorem re_natCast (n : ℕ) : (n : ℍ[R,c₁,c₂,c₃]).re = n := rfl @[deprecated (since := "2025-08-31")] alias natCast_re := re_natCast @[simp, norm_cast] theorem imI_natCast (n : ℕ) : (n : ℍ[R,c₁,c₂,c₃]).imI = 0 := rfl @[deprecated (since := "2025-08-31")] alias natCast_imI := imI_natCast @[simp, norm_cast] theorem imJ_natCast (n : ℕ) : (n : ℍ[R,c₁,c₂,c₃]).imJ = 0 := rfl @[deprecated (since := "2025-08-31")] alias natCast_imJ := imJ_natCast @[simp, norm_cast] theorem imK_natCast (n : ℕ) : (n : ℍ[R,c₁,c₂,c₃]).imK = 0 := rfl @[deprecated (since := "2025-08-31")] alias natCast_imK := imK_natCast @[simp, norm_cast] theorem im_natCast (n : ℕ) : (n : ℍ[R,c₁,c₂,c₃]).im = 0 := rfl @[deprecated (since := "2025-08-31")] alias natCast_im := im_natCast @[norm_cast] theorem coe_natCast (n : ℕ) : ↑(n : R) = (n : ℍ[R,c₁,c₂,c₃]) := rfl @[simp, norm_cast] theorem re_intCast (z : ℤ) : (z : ℍ[R,c₁,c₂,c₃]).re = z := rfl @[deprecated (since := "2025-08-31")] alias intCast_re := re_intCast @[scoped simp] theorem re_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : ℍ[R,c₁,c₂,c₃]).re = ofNat(n) := rfl @[deprecated (since := "2025-08-31")] alias ofNat_re := re_ofNat @[scoped simp] theorem imI_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : ℍ[R,c₁,c₂,c₃]).imI = 0 := rfl @[deprecated (since := "2025-08-31")] alias ofNat_imI := imI_ofNat @[scoped simp] theorem imJ_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : ℍ[R,c₁,c₂,c₃]).imJ = 0 := rfl @[deprecated (since := "2025-08-31")] alias ofNat_imJ := imJ_ofNat @[scoped simp] theorem imK_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : ℍ[R,c₁,c₂,c₃]).imK = 0 := rfl @[deprecated (since := "2025-08-31")] alias ofNat_imK := imK_ofNat @[scoped simp] theorem im_ofNat (n : ℕ) [n.AtLeastTwo] : (ofNat(n) : ℍ[R,c₁,c₂,c₃]).im = 0 := rfl @[deprecated (since := "2025-08-31")] alias ofNat_im := im_ofNat @[simp, norm_cast] theorem imI_intCast (z : ℤ) : (z : ℍ[R,c₁,c₂,c₃]).imI = 0 := rfl @[deprecated (since := "2025-08-31")] alias intCast_imI := imI_intCast @[simp, norm_cast] theorem imJ_intCast (z : ℤ) : (z : ℍ[R,c₁,c₂,c₃]).imJ = 0 := rfl @[deprecated (since := "2025-08-31")] alias intCast_imJ := imJ_intCast @[simp, norm_cast] theorem imK_intCast (z : ℤ) : (z : ℍ[R,c₁,c₂,c₃]).imK = 0 := rfl @[deprecated (since := "2025-08-31")] alias intCast_imK := imK_intCast @[simp, norm_cast] theorem im_intCast (z : ℤ) : (z : ℍ[R,c₁,c₂,c₃]).im = 0 := rfl @[deprecated (since := "2025-08-31")] alias intCast_im := im_intCast @[norm_cast] theorem coe_intCast (z : ℤ) : ↑(z : R) = (z : ℍ[R,c₁,c₂,c₃]) := rfl end AddCommGroupWithOne -- For the remainder of the file we assume `CommRing R`. variable [CommRing R] instance instRing : Ring ℍ[R,c₁,c₂,c₃] where __ := inferInstanceAs (AddCommGroupWithOne ℍ[R,c₁,c₂,c₃]) left_distrib _ _ _ := by ext <;> simp <;> ring right_distrib _ _ _ := by ext <;> simp <;> ring zero_mul _ := by ext <;> simp mul_zero _ := by ext <;> simp mul_assoc _ _ _ := by ext <;> simp <;> ring one_mul _ := by ext <;> simp mul_one _ := by ext <;> simp @[norm_cast, simp] theorem coe_mul : ((x * y : R) : ℍ[R,c₁,c₂,c₃]) = x * y := by ext <;> simp @[norm_cast, simp] lemma coe_ofNat {n : ℕ} [n.AtLeastTwo] : ((ofNat(n) : R) : ℍ[R,c₁,c₂,c₃]) = (ofNat(n) : ℍ[R,c₁,c₂,c₃]) := rfl -- TODO: add weaker `MulAction`, `DistribMulAction`, and `Module` instances (and repeat them -- for `ℍ[R]`) instance [CommSemiring S] [Algebra S R] : Algebra S ℍ[R,c₁,c₂,c₃] where smul := (· • ·) algebraMap := { toFun s := coe (algebraMap S R s) map_one' := by simp only [map_one, coe_one] map_zero' := by simp only [map_zero, coe_zero] map_mul' x y := by simp only [map_mul, coe_mul] map_add' x y := by simp only [map_add, coe_add] } smul_def' s x := by ext <;> simp [Algebra.smul_def] commutes' s x := by ext <;> simp [Algebra.commutes] theorem algebraMap_eq (r : R) : algebraMap R ℍ[R,c₁,c₂,c₃] r = ⟨r, 0, 0, 0⟩ := rfl theorem algebraMap_injective : (algebraMap R ℍ[R,c₁,c₂,c₃] : _ → _).Injective := fun _ _ ↦ by simp [algebraMap_eq] instance [NoZeroDivisors R] : NoZeroSMulDivisors R ℍ[R,c₁,c₂,c₃] := ⟨by rintro t ⟨a, b, c, d⟩ h rw [or_iff_not_imp_left] intro ht simpa [QuaternionAlgebra.ext_iff, ht] using h⟩ section variable (c₁ c₂ c₃) /-- `QuaternionAlgebra.re` as a `LinearMap`
@[simps] imIₗ : ℍ[R,c₁,c₂,c₃] →ₗ[R] R where toFun := imI map_add' _ _ := rfl map_smul' _ _ := rfl
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imIₗ
`QuaternionAlgebra.imI` as a `LinearMap`
@[simps] imJₗ : ℍ[R,c₁,c₂,c₃] →ₗ[R] R where toFun := imJ map_add' _ _ := rfl map_smul' _ _ := rfl
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imJₗ
`QuaternionAlgebra.imJ` as a `LinearMap`
@[simps] imKₗ : ℍ[R,c₁,c₂,c₃] →ₗ[R] R where toFun := imK map_add' _ _ := rfl map_smul' _ _ := rfl
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imKₗ
`QuaternionAlgebra.imK` as a `LinearMap`
linearEquivTuple : ℍ[R,c₁,c₂,c₃] ≃ₗ[R] Fin 4 → R := LinearEquiv.symm -- proofs are not `rfl` in the forward direction { (equivTuple c₁ c₂ c₃).symm with toFun := (equivTuple c₁ c₂ c₃).symm invFun := equivTuple c₁ c₂ c₃ map_add' := fun _ _ => rfl map_smul' := fun _ _ => rfl } @[simp]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
linearEquivTuple
`QuaternionAlgebra.equivTuple` as a linear equivalence.
coe_linearEquivTuple : ⇑(linearEquivTuple c₁ c₂ c₃) = equivTuple c₁ c₂ c₃ := rfl @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_linearEquivTuple
null
coe_linearEquivTuple_symm : ⇑(linearEquivTuple c₁ c₂ c₃).symm = (equivTuple c₁ c₂ c₃).symm := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_linearEquivTuple_symm
null
noncomputable basisOneIJK : Basis (Fin 4) R ℍ[R,c₁,c₂,c₃] := .ofEquivFun <| linearEquivTuple c₁ c₂ c₃ @[simp]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
basisOneIJK
`ℍ[R, c₁, c₂, c₃]` has a basis over `R` given by `1`, `i`, `j`, and `k`.
coe_basisOneIJK_repr (q : ℍ[R,c₁,c₂,c₃]) : ((basisOneIJK c₁ c₂ c₃).repr q) = ![q.re, q.imI, q.imJ, q.imK] := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_basisOneIJK_repr
null
rank_eq_four [StrongRankCondition R] : Module.rank R ℍ[R,c₁,c₂,c₃] = 4 := by rw [rank_eq_card_basis (basisOneIJK c₁ c₂ c₃), Fintype.card_fin] norm_num
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
rank_eq_four
null
finrank_eq_four [StrongRankCondition R] : Module.finrank R ℍ[R,c₁,c₂,c₃] = 4 := by rw [Module.finrank, rank_eq_four, Cardinal.toNat_ofNat]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
finrank_eq_four
null
@[simps] swapEquiv : ℍ[R,c₁,0,c₃] ≃ₐ[R] ℍ[R,c₃,0,c₁] where toFun t := ⟨t.1, t.3, t.2, -t.4⟩ invFun t := ⟨t.1, t.3, t.2, -t.4⟩ left_inv _ := by simp right_inv _ := by simp map_mul' _ _ := by ext <;> simp <;> ring map_add' _ _ := by ext <;> simp [add_comm] commutes' _ := by simp [algebraMap_eq]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
swapEquiv
There is a natural equivalence when swapping the first and third coefficients of a quaternion algebra if `c₂` is 0.
@[norm_cast, simp] coe_sub : ((x - y : R) : ℍ[R,c₁,c₂,c₃]) = x - y := (algebraMap R ℍ[R,c₁,c₂,c₃]).map_sub x y @[norm_cast, simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_sub
null
coe_pow (n : ℕ) : (↑(x ^ n) : ℍ[R,c₁,c₂,c₃]) = (x : ℍ[R,c₁,c₂,c₃]) ^ n := (algebraMap R ℍ[R,c₁,c₂,c₃]).map_pow x n
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_pow
null
coe_commutes : ↑r * a = a * r := Algebra.commutes r a
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_commutes
null
coe_commute : Commute (↑r) a := coe_commutes r a
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_commute
null
coe_mul_eq_smul : ↑r * a = r • a := (Algebra.smul_def r a).symm
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_mul_eq_smul
null
mul_coe_eq_smul : a * r = r • a := by rw [← coe_commutes, coe_mul_eq_smul] @[norm_cast, simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
mul_coe_eq_smul
null
coe_algebraMap : ⇑(algebraMap R ℍ[R,c₁,c₂,c₃]) = coe := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_algebraMap
null
smul_coe : x • (y : ℍ[R,c₁,c₂,c₃]) = ↑(x * y) := by rw [coe_mul, coe_mul_eq_smul]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
smul_coe
null
instStarQuaternionAlgebra : Star ℍ[R,c₁,c₂,c₃] where star a := ⟨a.1 + c₂ * a.2, -a.2, -a.3, -a.4⟩ @[simp] theorem re_star : (star a).re = a.re + c₂ * a.imI := rfl @[simp]
instance
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
instStarQuaternionAlgebra
Quaternion conjugate.
imI_star : (star a).imI = -a.imI := rfl @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imI_star
null
imJ_star : (star a).imJ = -a.imJ := rfl @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imJ_star
null
imK_star : (star a).imK = -a.imK := rfl @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
imK_star
null
im_star : (star a).im = -a.im := QuaternionAlgebra.ext neg_zero.symm rfl rfl rfl @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
im_star
null
star_mk (a₁ a₂ a₃ a₄ : R) : star (mk a₁ a₂ a₃ a₄ : ℍ[R,c₁,c₂,c₃]) = ⟨a₁ + c₂ * a₂, -a₂, -a₃, -a₄⟩ := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_mk
null
instStarRing : StarRing ℍ[R,c₁,c₂,c₃] where star_involutive x := by simp [Star.star] star_add a b := by ext <;> simp [add_comm] ; ring star_mul a b := by ext <;> simp <;> ring
instance
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
instStarRing
null
self_add_star' : a + star a = ↑(2 * a.re + c₂ * a.imI) := by ext <;> simp [two_mul]; ring
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
self_add_star'
null
self_add_star : a + star a = 2 * a.re + c₂ * a.imI := by simp [self_add_star']
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
self_add_star
null
star_add_self' : star a + a = ↑(2 * a.re + c₂ * a.imI) := by rw [add_comm, self_add_star']
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_add_self'
null
star_add_self : star a + a = 2 * a.re + c₂ * a.imI := by rw [add_comm, self_add_star]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_add_self
null
star_eq_two_re_sub : star a = ↑(2 * a.re + c₂ * a.imI) - a := eq_sub_iff_add_eq.2 a.star_add_self'
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_eq_two_re_sub
null
comm (r : R) (x : ℍ[R,c₁,c₂,c₃]) : r * x = x * r := by ext <;> simp [mul_comm]
lemma
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
comm
null
@[simp, norm_cast] star_coe : star (x : ℍ[R,c₁,c₂,c₃]) = x := by ext <;> simp @[simp] theorem star_im : star a.im = -a.im + c₂ * a.imI := by ext <;> simp @[simp]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_coe
null
star_smul [Monoid S] [DistribMulAction S R] [SMulCommClass S R R] (s : S) (a : ℍ[R,c₁,c₂,c₃]) : star (s • a) = s • star a := QuaternionAlgebra.ext (by simp [mul_smul_comm]) (smul_neg _ _).symm (smul_neg _ _).symm (smul_neg _ _).symm
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_smul
null
star_smul' [Monoid S] [DistribMulAction S R] (s : S) (a : ℍ[R,c₁,0,c₃]) : star (s • a) = s • star a := QuaternionAlgebra.ext (by simp) (smul_neg _ _).symm (smul_neg _ _).symm (smul_neg _ _).symm
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_smul'
A version of `star_smul` for the special case when `c₂ = 0`, without `SMulCommClass S R R`.
eq_re_of_eq_coe {a : ℍ[R,c₁,c₂,c₃]} {x : R} (h : a = x) : a = a.re := by rw [h, re_coe]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
eq_re_of_eq_coe
null
eq_re_iff_mem_range_coe {a : ℍ[R,c₁,c₂,c₃]} : a = a.re ↔ a ∈ Set.range (coe : R → ℍ[R,c₁,c₂,c₃]) := ⟨fun h => ⟨a.re, h.symm⟩, fun ⟨_, h⟩ => eq_re_of_eq_coe h.symm⟩
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
eq_re_iff_mem_range_coe
null
@[simp] star_eq_self {c₁ c₂ : R} {a : ℍ[R,c₁,c₂,c₃]} : star a = a ↔ a = a.re := by simp_all [QuaternionAlgebra.ext_iff, neg_eq_iff_add_eq_zero, add_self_eq_zero]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_eq_self
null
star_eq_neg {c₁ : R} {a : ℍ[R,c₁,0,c₃]} : star a = -a ↔ a.re = 0 := by simp [QuaternionAlgebra.ext_iff, eq_neg_iff_add_eq_zero]
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_eq_neg
null
star_mul_eq_coe : star a * a = (star a * a).re := by ext <;> simp <;> ring
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
star_mul_eq_coe
null
mul_star_eq_coe : a * star a = (a * star a).re := by rw [← star_comm_self'] exact a.star_mul_eq_coe open MulOpposite
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
mul_star_eq_coe
null
starAe : ℍ[R,c₁,c₂,c₃] ≃ₐ[R] ℍ[R,c₁,c₂,c₃]ᵐᵒᵖ := { starAddEquiv.trans opAddEquiv with toFun := op ∘ star invFun := star ∘ unop map_mul' := fun x y => by simp commutes' := fun r => by simp } @[simp]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
starAe
Quaternion conjugate as an `AlgEquiv` to the opposite ring.
coe_starAe : ⇑(starAe : ℍ[R,c₁,c₂,c₃] ≃ₐ[R] _) = op ∘ star := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe_starAe
null
Quaternion (R : Type*) [Zero R] [One R] [Neg R] := QuaternionAlgebra R (-1) (0) (-1) @[inherit_doc] scoped[Quaternion] notation "ℍ[" R "]" => Quaternion R open Quaternion
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
Quaternion
Space of quaternions over a type, denoted as `ℍ[R]`. Implemented as a structure with four fields: `re`, `im_i`, `im_j`, and `im_k`.
@[simps!] Quaternion.equivProd (R : Type*) [Zero R] [One R] [Neg R] : ℍ[R] ≃ R × R × R × R := QuaternionAlgebra.equivProd _ _ _
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
Quaternion.equivProd
The equivalence between the quaternions over `R` and `R × R × R × R`.
@[simps! symm_apply] Quaternion.equivTuple (R : Type*) [Zero R] [One R] [Neg R] : ℍ[R] ≃ (Fin 4 → R) := QuaternionAlgebra.equivTuple _ _ _ @[simp]
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
Quaternion.equivTuple
The equivalence between the quaternions over `R` and `Fin 4 → R`.
Quaternion.equivTuple_apply (R : Type*) [Zero R] [One R] [Neg R] (x : ℍ[R]) : Quaternion.equivTuple R x = ![x.re, x.imI, x.imJ, x.imK] := rfl
theorem
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
Quaternion.equivTuple_apply
null
@[coe] coe : R → ℍ[R] := QuaternionAlgebra.coe
def
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
coe
Coercion `R → ℍ[R]`.
instRing : Ring ℍ[R] := QuaternionAlgebra.instRing
instance
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
instRing
null
protected algebra [CommSemiring S] [Algebra S R] : Algebra S ℍ[R] := inferInstanceAs <| Algebra S ℍ[R,-1,0,-1]
instance
Algebra
[ "Mathlib.Algebra.Star.SelfAdjoint", "Mathlib.LinearAlgebra.Dimension.StrongRankCondition", "Mathlib.LinearAlgebra.FreeModule.Finite.Basic" ]
Mathlib/Algebra/Quaternion.lean
algebra
null