import Mathlib.Tactic
import Mathlib.LinearAlgebra.CliffordAlgebra.Basic
import Mathlib.LinearAlgebra.ExteriorAlgebra.Basic
import Mathlib.Data.Matrix.Notation
import Mathlib.Algebra.Free
-- set_option trace.Meta.synthInstance true
-- set_option synthInstance.checkSynthOrder false
#check Monoid.mk. {u} {M : Type u} [toSemigroup : Semigroup M] [toOne : One M] (one_mul : β (a : M), 1 * a = a)
(mul_one : β (a : M), a * 1 = a) (npow : β β M β M) (npow_zero : β (x : M), npow 0 x = 1 := by intros; rfl)
(npow_succ : β (n : β) (x : M), npow (n + 1 ) x = npow n x * x := by intros; rfl) : Monoid M Monoid.mk : {M : Type u} β
[toSemigroup : Semigroup M] β
[toOne : One M] β
(β (a : M), 1 * a = a) β
(β (a : M), a * 1 = a) β
(npow : β β M β M) β
autoParam (β (x : M), npow 0 x = 1) _autoβ β
autoParam (β (n : β) (x : M), npow (n + 1) x = npow n x * x) _autoβΒΉ β Monoid M
Monoid.mk
whatsnew in
example : β {Ξ± : Type} [inst : Monoid Ξ±] (a b : Ξ±), a * b = a * b
example { Ξ± : Type } [ Monoid Ξ± ] ( a b : Ξ± ) : a * b = a * b := by rfl
# synth Module : (R M : Type) β [inst : Semiring R] β [inst : AddCommMonoid M] β Type
Module β€ β€ AddCommGroup.toIntModule β€
#check RingHomClass.mk. {u_5, u_6, u_7} {F : Type u_5} {Ξ± : outParam (Type u_6)} {Ξ² : outParam (Type u_7)} [NonAssocSemiring Ξ±]
[NonAssocSemiring Ξ²] [FunLike F Ξ± Ξ²] [toMonoidHomClass : MonoidHomClass F Ξ± Ξ²]
[toAddMonoidHomClass : AddMonoidHomClass F Ξ± Ξ²] : RingHomClass F Ξ± Ξ² RingHomClass.mk : β {F : Type u_5} {Ξ± : outParam (Type u_6)} {Ξ² : outParam (Type u_7)} [inst : NonAssocSemiring Ξ±]
[inst_1 : NonAssocSemiring Ξ²] [inst_2 : FunLike F Ξ± Ξ²] [toMonoidHomClass : MonoidHomClass F Ξ± Ξ²]
[toAddMonoidHomClass : AddMonoidHomClass F Ξ± Ξ²], RingHomClass F Ξ± Ξ²
RingHomClass.mk -- map_add, map_zero, toMonoidHomClass
#check MonoidHomClass.mk. {u_10, u_11, u_12} {F : Type u_10} {M : outParam (Type u_11)} {N : outParam (Type u_12)}
[MulOneClass M] [MulOneClass N] [FunLike F M N] [toMulHomClass : MulHomClass F M N]
[toOneHomClass : OneHomClass F M N] : MonoidHomClass F M N MonoidHomClass.mk : β {F : Type u_10} {M : outParam (Type u_11)} {N : outParam (Type u_12)} [inst : MulOneClass M] [inst_1 : MulOneClass N]
[inst_2 : FunLike F M N] [toMulHomClass : MulHomClass F M N] [toOneHomClass : OneHomClass F M N], MonoidHomClass F M N
MonoidHomClass.mk -- map_one, toMulHomClass
#check MulHomClass.mk. {u_10, u_11, u_12} {F : Type u_10} {M : outParam (Type u_11)} {N : outParam (Type u_12)} [Mul M] [Mul N]
[FunLike F M N] (map_mul : β (f : F) (x y : M), f (x * y) = f x * f y) : MulHomClass F M N MulHomClass.mk : β {F : Type u_10} {M : outParam (Type u_11)} {N : outParam (Type u_12)} [inst : Mul M] [inst_1 : Mul N]
[inst_2 : FunLike F M N], (β (f : F) (x y : M), f (x * y) = f x * f y) β MulHomClass F M N
MulHomClass.mk -- map_mul, toFunLike
#check FunLike. {u_1, u_2, u_3} (F : Sort u_1) (Ξ± : Sort u_2) (Ξ² : Sort u_3) : Sort (max (max (max 1 u_1) u_2) u_3) FunLike : Sort u_1 β Sort u_2 β Sort u_3 β Sort (max (max (max 1 u_1) u_2) u_3)
FunLike
-- #check FunLike.mk -- coe, coe_injective'
#check RingHom.mk. {u_5, u_6} {Ξ± : Type u_5} {Ξ² : Type u_6} [NonAssocSemiring Ξ±] [NonAssocSemiring Ξ²] (toMonoidHom : Ξ± β* Ξ²)
(map_zero' : (β toMonoidHom). toFun 0 = 0 )
(map_add' : β (x y : Ξ±), (β toMonoidHom). toFun (x + y) = (β toMonoidHom). toFun x + (β toMonoidHom). toFun y) : Ξ± β+* Ξ² RingHom.mk : {Ξ± : Type u_5} β
{Ξ² : Type u_6} β
[inst : NonAssocSemiring Ξ±] β
[inst_1 : NonAssocSemiring Ξ²] β
(toMonoidHom : Ξ± β* Ξ²) β
(βtoMonoidHom).toFun 0 = 0 β
(β (x y : Ξ±), (βtoMonoidHom).toFun (x + y) = (βtoMonoidHom).toFun x + (βtoMonoidHom).toFun y) β Ξ± β+* Ξ²
RingHom.mk -- map_zero', map_add', toMonoidHom
#check MonoidHom.mk. {u_10, u_11} {M : Type u_10} {N : Type u_11} [MulOneClass M] [MulOneClass N] (toOneHom : OneHom M N)
(map_mul' : β (x y : M), toOneHom.toFun (x * y) = toOneHom.toFun x * toOneHom.toFun y) : M β* N MonoidHom.mk : {M : Type u_10} β
{N : Type u_11} β
[inst : MulOneClass M] β
[inst_1 : MulOneClass N] β
(toOneHom : OneHom M N) β (β (x y : M), toOneHom.toFun (x * y) = toOneHom.toFun x * toOneHom.toFun y) β M β* N
MonoidHom.mk -- map_mul', toOneHom
#check OneHom.mk. {u_10, u_11} {M : Type u_10} {N : Type u_11} [One M] [One N] (toFun : M β N) (map_one' : toFun 1 = 1 ) :
OneHom M N OneHom.mk : {M : Type u_10} β {N : Type u_11} β [inst : One M] β [inst_1 : One N] β (toFun : M β N) β toFun 1 = 1 β OneHom M N
OneHom.mk -- map_one', toFun
#check Algebra.mk. {u, v} {R : Type u} {A : Type v} [CommSemiring R] [Semiring A] [toSMul : SMul R A] (toRingHom : R β+* A)
(commutes' : β (r : R) (x : A), toRingHom r * x = x * toRingHom r)
(smul_def' : β (r : R) (x : A), r β’ x = toRingHom r * x) : Algebra R A Algebra.mk : {R : Type u} β
{A : Type v} β
[inst : CommSemiring R] β
[inst_1 : Semiring A] β
[toSMul : SMul R A] β
(toRingHom : R β+* A) β
(β (r : R) (x : A), toRingHom r * x = x * toRingHom r) β
(β (r : R) (x : A), r β’ x = toRingHom r * x) β Algebra R A
Algebra.mk -- toSMul, toRingHom, commutes', smul_def'
#check FreeAlgebra.Rel. {u_1, u_2} (R : Type u_1) [CommSemiring R] (X : Type u_2) :
FreeAlgebra.Pre R X β FreeAlgebra.Pre R X β Prop FreeAlgebra.Rel : (R : Type u_1) β [inst : CommSemiring R] β (X : Type u_2) β FreeAlgebra.Pre R X β FreeAlgebra.Pre R X β Prop
FreeAlgebra.Rel
example : β {R : Type u_1} {A : Type u_2} [inst : CommSemiring R] [inst_1 : Semiring A] [inst : Algebra R A] (a b : A),
a + b = b + a
example Warning: declaration uses ' sorry ' [ CommSemiring : Type u_1 β Type u_1
CommSemiring R ] [ Semiring : Type u_2 β Type u_2
Semiring A ] [ Algebra : (R : Type u_1) β (A : Type u_2) β [inst : CommSemiring R] β [inst : Semiring A] β Type (max u_1 u_2)
Algebra R A ] ( a b : A ): a + b = b + a := by
ring_nf Warning: ' ring_nf' tactic does nothing
note: this linter can be disabled with `set_option linter.unusedTactic false` R : Type u_1A : Type u_2instβΒ² : CommSemiring R instβΒΉ : Semiring A instβ : Algebra R A a, b : A
a + b = b + a
sorry
#check CliffordAlgebra.ΞΉ. {u_1, u_2} {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M]
(Q : QuadraticForm R M) : M ββ [R] CliffordAlgebra Q CliffordAlgebra.ΞΉ : {R : Type u_1} β
[inst : CommRing R] β
{M : Type u_2} β
[inst_1 : AddCommGroup M] β [inst_2 : Module R M] β (Q : QuadraticForm R M) β M ββ[R] CliffordAlgebra Q
CliffordAlgebra.ΞΉ
#check CliffordAlgebra.lift. {u_1, u_2, u_3} {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M]
(Q : QuadraticForm R M) {A : Type u_3} [Semiring A] [Algebra R A] :
{ f // β (m : M), f m * f m = (algebraMap R A) (Q m) } β (CliffordAlgebra Q ββ [R] A) CliffordAlgebra.lift : {R : Type u_1} β
[inst : CommRing R] β
{M : Type u_2} β
[inst_1 : AddCommGroup M] β
[inst_2 : Module R M] β
(Q : QuadraticForm R M) β
{A : Type u_3} β
[inst_3 : Semiring A] β
[inst_4 : Algebra R A] β
{ f // β (m : M), f m * f m = (algebraMap R A) (Q m) } β (CliffordAlgebra Q ββ[R] A)
CliffordAlgebra.lift
#check algebraMap. {u, v} (R : Type u) (A : Type v) [CommSemiring R] [Semiring A] [Algebra R A] : R β+* A algebraMap : (R : Type u) β (A : Type v) β [inst : CommSemiring R] β [inst_1 : Semiring A] β [inst_2 : Algebra R A] β R β+* A
algebraMap
#check AlgHom. {u, v, w} (R : Type u) (A : Type v) (B : Type w) [CommSemiring R] [Semiring A] [Semiring B] [Algebra R A]
[Algebra R B] : Type (max v w) AlgHom : (R : Type u) β
(A : Type v) β
(B : Type w) β
[inst : CommSemiring R] β
[inst_1 : Semiring A] β [inst_2 : Semiring B] β [inst_3 : Algebra R A] β [inst : Algebra R B] β Type (max v w)
AlgHom
#check CliffordAlgebra.ΞΉ_comp_lift. {u_1, u_2, u_3} {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M]
{Q : QuadraticForm R M} {A : Type u_3} [Semiring A] [Algebra R A] (f : M ββ [R] A)
(cond : β (m : M), f m * f m = (algebraMap R A) (Q m)) :
((CliffordAlgebra.lift Q) β¨f, condβ©). toLinearMap ββ CliffordAlgebra.ΞΉ Q = f CliffordAlgebra.ΞΉ_comp_lift : β {R : Type u_1} [inst : CommRing R] {M : Type u_2} [inst_1 : AddCommGroup M] [inst_2 : Module R M]
{Q : QuadraticForm R M} {A : Type u_3} [inst_3 : Semiring A] [inst_4 : Algebra R A] (f : M ββ[R] A)
(cond : β (m : M), f m * f m = (algebraMap R A) (Q m)),
((CliffordAlgebra.lift Q) β¨f, condβ©).toLinearMap ββ CliffordAlgebra.ΞΉ Q = f
CliffordAlgebra.ΞΉ_comp_lift
-- #check fβ ββ fβ
#check CliffordAlgebra.lift_unique. {u_1, u_2, u_3} {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M]
{Q : QuadraticForm R M} {A : Type u_3} [Semiring A] [Algebra R A] (f : M ββ [R] A)
(cond : β (m : M), f m * f m = (algebraMap R A) (Q m)) (g : CliffordAlgebra Q ββ [R] A) :
g.toLinearMap ββ CliffordAlgebra.ΞΉ Q = f β g = (CliffordAlgebra.lift Q) β¨f, condβ© CliffordAlgebra.lift_unique : β {R : Type u_1} [inst : CommRing R] {M : Type u_2} [inst_1 : AddCommGroup M] [inst_2 : Module R M]
{Q : QuadraticForm R M} {A : Type u_3} [inst_3 : Semiring A] [inst_4 : Algebra R A] (f : M ββ[R] A)
(cond : β (m : M), f m * f m = (algebraMap R A) (Q m)) (g : CliffordAlgebra Q ββ[R] A),
g.toLinearMap ββ CliffordAlgebra.ΞΉ Q = f β g = (CliffordAlgebra.lift Q) β¨f, condβ©
CliffordAlgebra.lift_unique
#check ExteriorAlgebra. {u1, u2} (R : Type u1) [CommRing R] (M : Type u2) [AddCommGroup M] [Module R M] : Type (max u2 u1) ExteriorAlgebra : (R : Type u1) β [inst : CommRing R] β (M : Type u2) β [inst_1 : AddCommGroup M] β [inst : Module R M] β Type (max u2 u1)
ExteriorAlgebra
#check TensorAlgebra.toClifford. {u_1, u_2} {R : Type u_1} [CommRing R] {M : Type u_2} [AddCommGroup M] [Module R M]
{Q : QuadraticForm R M} : TensorAlgebra R M ββ [R] CliffordAlgebra Q TensorAlgebra.toClifford : {R : Type u_1} β
[inst : CommRing R] β
{M : Type u_2} β
[inst_1 : AddCommGroup M] β
[inst_2 : Module R M] β {Q : QuadraticForm R M} β TensorAlgebra R M ββ[R] CliffordAlgebra Q
TensorAlgebra.toClifford
#check Module.Dual. {uR, uM} (R : Type uR) (M : Type uM) [CommSemiring R] [AddCommMonoid M] [Module R M] : Type (max uM uR) Module.Dual : (R : Type uR) β
(M : Type uM) β [inst : CommSemiring R] β [inst_1 : AddCommMonoid M] β [inst : Module R M] β Type (max uM uR)
Module.Dual
#check Module.Free. {u, v} (R : Type u) (M : Type v) [Semiring R] [AddCommMonoid M] [Module R M] : Prop Module.Free : (R : Type u) β (M : Type v) β [inst : Semiring R] β [inst_1 : AddCommMonoid M] β [inst : Module R M] β Prop
Module.Free
#check Module.Finite. {u_1, u_4} (R : Type u_1) (M : Type u_4) [Semiring R] [AddCommMonoid M] [Module R M] : Prop Module.Finite : (R : Type u_1) β (M : Type u_4) β [inst : Semiring R] β [inst_1 : AddCommMonoid M] β [inst : Module R M] β Prop
Module.Finite
#check LinearMap.module. {u_1, u_3, u_5, u_8, u_10} {R : Type u_1} {Rβ : Type u_3} {S : Type u_5} {M : Type u_8}
{Mβ : Type u_10} [Semiring R] [Semiring Rβ] [AddCommMonoid M] [AddCommMonoid Mβ] [Module R M] [Module Rβ Mβ]
{Οββ : R β+* Rβ} [Semiring S] [Module S Mβ] [SMulCommClass Rβ S Mβ] : Module S (M βββ [Οββ] Mβ) LinearMap.module : {R : Type u_1} β
{Rβ : Type u_3} β
{S : Type u_5} β
{M : Type u_8} β
{Mβ : Type u_10} β
[inst : Semiring R] β
[inst_1 : Semiring Rβ] β
[inst_2 : AddCommMonoid M] β
[inst_3 : AddCommMonoid Mβ] β
[inst_4 : Module R M] β
[inst_5 : Module Rβ Mβ] β
{Οββ : R β+* Rβ} β
[inst_6 : Semiring S] β
[inst_7 : Module S Mβ] β [inst_8 : SMulCommClass Rβ S Mβ] β Module S (M βββ[Οββ] Mβ)
LinearMap.module
#check Star.star. {u} {R : Type u} [self : Star R] : R β R star : {R : Type u} β [self : Star R] β R β R
star
postfix : max "α" => star : {R : Type u} β [self : Star R] β R β R
star
-- https://leanprover.zulipchat.com/#narrow/stream/113489-new-members/topic/.E2.9C.94.20How.20to.20find.20the.20detailed.20definition.20of.20a.20.22notation.22.20.3F
universe u v
variable ( n2 : Type u) ( Ξ±2 : Type v) [ DivisionMonoid : Type (max v u) β Type (max v u)
DivisionMonoid ( Matrix : Type u β Type u β Type v β Type (max u v)
Matrix n2 n2 Ξ±2 )] ( A B : Matrix : Type u β Type u β Type v β Type (max u v)
Matrix n2 n2 Ξ±2 )
/-
[Meta.synthInstance] β
HMul (Matrix n2 n2 Ξ±2) (Matrix n2 n2 Ξ±2) (Matrix n2 n2 Ξ±2) βΌ
[] new goal HMul (Matrix n2 n2 Ξ±2) (Matrix n2 n2 Ξ±2) _tc.0 βΌ
[instances] #[@instHMul, @Matrix.instHMulMatrixMatrixMatrix]
-/
#check A * B
theorem mul_inv_rev2 : (A * B)β»ΒΉ = Bβ»ΒΉ * Aβ»ΒΉ
mul_inv_rev2 Warning: declaration uses ' sorry ' : ( A * B )β»ΒΉ = B β»ΒΉ * A β»ΒΉ := by sorry
#check Prop
#check Bool
-- TOD: PR
#check QuadraticMap.associated_left_inverse. {u_1, u_3, u_4} (S : Type u_1) {R : Type u_3} {M : Type u_4} [CommRing R]
[AddCommGroup M] [Module R M] [CommSemiring S] [Algebra S R] [Invertible 2 ] {Bβ : LinearMap.BilinMap R M R}
(h : LinearMap.IsSymm Bβ) : (QuadraticMap.associatedHom S) Bβ.toQuadraticMap = Bβ QuadraticMap.associated_left_inverse : β (S : Type u_1) {R : Type u_3} {M : Type u_4} [inst : CommRing R] [inst_1 : AddCommGroup M] [inst_2 : Module R M]
[inst_3 : CommSemiring S] [inst_4 : Algebra S R] [inst_5 : Invertible 2] {Bβ : LinearMap.BilinMap R M R},
LinearMap.IsSymm Bβ β (QuadraticMap.associatedHom S) Bβ.toQuadraticMap = Bβ
QuadraticMap.associated_left_inverse
#check QuadraticMap.associated_rightInverse. {u_1, u_3, u_4} (S : Type u_1) {R : Type u_3} {M : Type u_4} [CommRing R]
[AddCommGroup M] [Module R M] [CommSemiring S] [Algebra S R] [Invertible 2 ] :
Function.RightInverse (β (QuadraticMap.associatedHom S)) LinearMap.BilinMap.toQuadraticMap QuadraticMap.associated_rightInverse : β (S : Type u_1) {R : Type u_3} {M : Type u_4} [inst : CommRing R] [inst_1 : AddCommGroup M] [inst_2 : Module R M]
[inst_3 : CommSemiring S] [inst_4 : Algebra S R] [inst_5 : Invertible 2],
Function.RightInverse (β(QuadraticMap.associatedHom S)) LinearMap.BilinMap.toQuadraticMap
QuadraticMap.associated_rightInverse
#check FreeMagma.rec. {u_1, u} {Ξ± : Type u} {motive : FreeMagma Ξ± β Sort u_1} (of : (a : Ξ±) β motive (FreeMagma.of a))
(mul : (a a_1 : FreeMagma Ξ±) β motive a β motive a_1 β motive (a.mul a_1)) (t : FreeMagma Ξ±) : motive t FreeMagma.rec : {Ξ± : Type u} β
{motive : FreeMagma Ξ± β Sort u_1} β
((a : Ξ±) β motive (FreeMagma.of a)) β
((a a_1 : FreeMagma Ξ±) β motive a β motive a_1 β motive (a.mul a_1)) β (t : FreeMagma Ξ±) β motive t
FreeMagma.rec
#check FreeMonoid. {u_6} (Ξ± : Type u_6) : Type u_6 FreeMonoid : Type u_6 β Type u_6
FreeMonoid
#check FreeSemigroup. {u} (Ξ± : Type u) : Type u FreeSemigroup : Type u β Type u
FreeSemigroup
#check FreeRing. {u} (Ξ± : Type u) : Type u FreeRing : Type u β Type u
FreeRing
--#check FreeModule
#check FreeAlgebra.Rel. {u_1, u_2} (R : Type u_1) [CommSemiring R] (X : Type u_2) :
FreeAlgebra.Pre R X β FreeAlgebra.Pre R X β Prop FreeAlgebra.Rel : (R : Type u_1) β [inst : CommSemiring R] β (X : Type u_2) β FreeAlgebra.Pre R X β FreeAlgebra.Pre R X β Prop
FreeAlgebra.Rel
example : β {Ξ± : Type u_1} {R A : Type} [inst : Monoid Ξ±] (a b : Ξ±), a * b = a * b
example { R Warning: unused variable `R `
note: this linter can be disabled with `set_option linter.unusedVariables false` A Warning: unused variable `A `
note: this linter can be disabled with `set_option linter.unusedVariables false` : Type } [ Monoid : Type u_1 β Type u_1
Monoid Ξ± ] ( a b : Ξ± ) : a * b = a * b := by rfl
#check RingQuot.mk. {uR} {R : Type uR} [Semiring R] {r : R β R β Prop } (toQuot : Quot (RingQuot.Rel r)) : RingQuot r RingQuot.mk : {R : Type uR} β [inst : Semiring R] β {r : R β R β Prop} β Quot (RingQuot.Rel r) β RingQuot r
RingQuot.mk
#check RingQuot.Rel. {uR} {R : Type uR} [Semiring R] (r : R β R β Prop ) : R β R β Prop RingQuot.Rel : {R : Type uR} β [inst : Semiring R] β (R β R β Prop) β R β R β Prop
RingQuot.Rel
#check Ideal. {u} (R : Type u) [Semiring R] : Type u Ideal : (R : Type u) β [inst : Semiring R] β Type u
Ideal
#check TensorAlgebra. {u_1, u_2} (R : Type u_1) [CommSemiring R] (M : Type u_2) [AddCommMonoid M] [Module R M] :
Type (max u_1 u_2) TensorAlgebra : (R : Type u_1) β
[inst : CommSemiring R] β (M : Type u_2) β [inst_1 : AddCommMonoid M] β [inst : Module R M] β Type (max u_1 u_2)
TensorAlgebra
-- chore(Algebra/FreeAlgebra): fix comments