statement
stringlengths
1
2.93k
proof
stringlengths
0
19.2k
type
stringclasses
13 values
symbolic_name
stringlengths
1
131
library
stringlengths
4
62
filename
stringlengths
20
95
imports
listlengths
0
10
deps
listlengths
0
64
docstring
stringlengths
0
4.95k
source_url
stringclasses
1 value
commit
stringclasses
1 value
discr {R : Type*} [Ring R] (P : Cubic R) : R
P.b ^ 2 * P.c ^ 2 - 4 * P.a * P.c ^ 3 - 4 * P.b ^ 3 * P.d - 27 * P.a ^ 2 * P.d ^ 2 + 18 * P.a * P.b * P.c * P.d
def
Cubic.discr
Algebra
Mathlib/Algebra/CubicDiscriminant.lean
[]
[ "Cubic", "Ring" ]
The discriminant of a cubic polynomial.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
discr_eq_prod_three_roots (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) : φ P.discr = (φ P.a * φ P.a * (x - y) * (x - z) * (y - z)) ^ 2
by simp only [discr, RingHom.map_add, map_sub, map_mul, map_pow, map_ofNat] rw [b_eq_three_roots ha h3, c_eq_three_roots ha h3, d_eq_three_roots ha h3] ring1
theorem
Cubic.discr_eq_prod_three_roots
Algebra
Mathlib/Algebra/CubicDiscriminant.lean
[]
[ "RingHom.map_add", "map_mul", "map_ofNat", "map_pow" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
discr_ne_zero_iff_roots_ne (ha : P.a ≠ 0) (h3 : (map φ P).roots = {x, y, z}) : P.discr ≠ 0 ↔ x ≠ y ∧ x ≠ z ∧ y ≠ z
by rw [← map_ne_zero φ, discr_eq_prod_three_roots ha h3, pow_two] simp_rw [mul_ne_zero_iff, sub_ne_zero, _root_.map_ne_zero, and_self_iff, and_iff_right ha, and_assoc]
theorem
Cubic.discr_ne_zero_iff_roots_ne
Algebra
Mathlib/Algebra/CubicDiscriminant.lean
[]
[ "map_ne_zero", "mul_ne_zero_iff", "pow_two" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
discr_ne_zero_iff_roots_nodup (ha : P.a ≠ 0) (hP : (P.toPoly.map φ).Splits) : P.discr ≠ 0 ↔ (map φ P).roots.Nodup
by have ⟨x, y, z, h3⟩ := (splits_iff_roots_eq_three ha).mp hP rw [discr_ne_zero_iff_roots_ne ha h3, h3] change _ ↔ (x ::ₘ y ::ₘ {z}).Nodup rw [nodup_cons, nodup_cons, mem_cons, mem_singleton, mem_singleton] simp only [nodup_singleton] tauto
theorem
Cubic.discr_ne_zero_iff_roots_nodup
Algebra
Mathlib/Algebra/CubicDiscriminant.lean
[]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
card_roots_of_discr_ne_zero [DecidableEq K] (ha : P.a ≠ 0) (h3 : (P.toPoly.map φ).Splits) (hd : P.discr ≠ 0) : (map φ P).roots.toFinset.card = 3
by rwa [toFinset_card_of_nodup <| (discr_ne_zero_iff_roots_nodup ha h3).mp hd, ← splits_iff_card_roots ha]
theorem
Cubic.card_roots_of_discr_ne_zero
Algebra
Mathlib/Algebra/CubicDiscriminant.lean
[]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
DualNumber (R : Type*) : Type _
TrivSqZeroExt R R
abbrev
DualNumber
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "TrivSqZeroExt" ]
The type of dual numbers, numbers of the form $a + bε$ where $ε^2 = 0$. `R[ε]` is notation for `DualNumber R`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
DualNumber.eps [Zero R] [One R] : DualNumber R
TrivSqZeroExt.inr 1 @[inherit_doc] scoped[DualNumber] notation "ε" => DualNumber.eps @[inherit_doc] scoped[DualNumber] postfix:1024 "[ε]" => DualNumber
def
DualNumber.eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "DualNumber", "TrivSqZeroExt.inr" ]
The unit element $ε$ that squares to zero, with notation `ε`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
fst_eps [Zero R] [One R] : fst ε = (0 : R)
rfl
theorem
DualNumber.fst_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
snd_eps [Zero R] [One R] : snd ε = (1 : R)
rfl
theorem
DualNumber.snd_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
snd_mul [Semiring R] (x y : R[ε]) : snd (x * y) = fst x * snd y + snd x * fst y
rfl
theorem
DualNumber.snd_mul
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Semiring" ]
A version of `TrivSqZeroExt.snd_mul` with `*` instead of `•`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
eps_mul_eps [Semiring R] : (ε * ε : R[ε]) = 0
inr_mul_inr _ _ _
theorem
DualNumber.eps_mul_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Semiring" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
eps_pow_two [Semiring R] : (ε : R[ε]) ^ 2 = 0
by simp [pow_two]
lemma
DualNumber.eps_pow_two
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Semiring", "pow_two" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
inv_eps [DivisionRing R] : (ε : R[ε])⁻¹ = 0
TrivSqZeroExt.inv_inr 1
theorem
DualNumber.inv_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "DivisionRing", "TrivSqZeroExt.inv_inr" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
inr_eq_smul_eps [MulZeroOneClass R] (r : R) : inr r = (r • ε : R[ε])
ext (mul_zero r).symm (mul_one r).symm
theorem
DualNumber.inr_eq_smul_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "MulZeroOneClass", "mul_one", "symm" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
commute_eps_left [Semiring R] (x : DualNumber R) : Commute ε x
by ext <;> simp
theorem
DualNumber.commute_eps_left
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Commute", "DualNumber", "Semiring" ]
`ε` commutes with every element of the algebra.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
commute_eps_right [Semiring R] (x : DualNumber R) : Commute x ε
(commute_eps_left x).symm
theorem
DualNumber.commute_eps_right
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Commute", "DualNumber", "Semiring", "symm" ]
`ε` commutes with every element of the algebra.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
algHom_ext' ⦃f g : A[ε] →ₐ[R] B⦄ (hinl : f.comp (inlAlgHom _ _ _) = g.comp (inlAlgHom _ _ _)) (hinr : f.toLinearMap ∘ₗ (LinearMap.toSpanSingleton A A[ε] ε).restrictScalars R = g.toLinearMap ∘ₗ (LinearMap.toSpanSingleton A A[ε] ε).restrictScalars R) : f = g
algHom_ext' hinl (by ext a change f (inr a) = g (inr a) simpa only [inr_eq_smul_eps] using! DFunLike.congr_fun hinr a)
theorem
DualNumber.algHom_ext'
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "DFunLike.congr_fun", "LinearMap.toSpanSingleton" ]
For two `R`-algebra morphisms out of `A[ε]` to agree, it suffices for them to agree on the elements of `A` and the `A`-multiples of `ε`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
algHom_ext ⦃f g : R[ε] →ₐ[R] A⦄ (hε : f ε = g ε) : f = g
by ext dsimp simp only [one_smul, hε]
theorem
DualNumber.algHom_ext
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "one_smul" ]
For two `R`-algebra morphisms out of `R[ε]` to agree, it suffices for them to agree on `ε`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
ringHom_ext {R' : Type*} [CommSemiring R'] {f g : R[ε] →+* R'} (h₀ : f.comp (algebraMap R R[ε]) = g.comp (algebraMap R R[ε])) (hε : f ε = g ε) : f = g
by letI : Algebra R R' := by letI := f.toAlgebra exact Algebra.compHom _ (algebraMap R R[ε]) let f' : R[ε] →ₐ[R] R' := { toRingHom := f commutes' _ := rfl } let g' : R[ε] →ₐ[R] R' := { toRingHom := g commutes' r := (DFunLike.congr_fun h₀ r).symm } exact congr_arg AlgHom.toRingHom (sh...
lemma
DualNumber.ringHom_ext
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Algebra", "Algebra.compHom", "CommSemiring", "DFunLike.congr_fun", "symm" ]
A ring morphism `R[ε] →+* R'` is determined by its restriction on `R` and its value on `ε`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift : {fe : (A →ₐ[R] B) × B // fe.2 * fe.2 = 0 ∧ ∀ a, Commute fe.2 (fe.1 a)} ≃ (A[ε] →ₐ[R] B)
by refine Equiv.trans ?_ TrivSqZeroExt.liftEquiv exact { toFun := fun fe => ⟨ (fe.val.1, MulOpposite.op fe.val.2 • fe.val.1.toLinearMap), fun x y => show (fe.val.1 x * fe.val.2) * (fe.val.1 y * fe.val.2) = 0 by rw [(fe.prop.2 _).mul_mul_mul_comm, fe.prop.1, mul_zero], fun r x => show f...
def
DualNumber.lift
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Commute", "Equiv.trans", "LinearMap.ext", "MulOpposite.op", "TrivSqZeroExt.liftEquiv", "map_mul", "map_one", "mul_assoc", "mul_mul_mul_comm", "mul_one", "one_mul", "op_smul_eq_mul", "smul_eq_mul" ]
A universal property of the dual numbers, providing a unique `A[ε] →ₐ[R] B` for every map `f : A →ₐ[R] B` and a choice of element `e : B` which squares to `0` and commutes with the range of `f`. This isomorphism is named to match the similar `Complex.lift`. Note that when `f : R →ₐ[R] B := Algebra.ofId R B`, the commu...
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_apply_apply (fe : {_fe : (A →ₐ[R] B) × B // _}) (a : A[ε]) : lift fe a = fe.val.1 a.fst + fe.val.1 a.snd * fe.val.2
rfl
theorem
DualNumber.lift_apply_apply
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
coe_lift_symm_apply (F : A[ε] →ₐ[R] B) : (lift.symm F).val = (F.comp (inlAlgHom _ _ _), F ε)
rfl
theorem
DualNumber.coe_lift_symm_apply
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_apply_inl (fe : {_fe : (A →ₐ[R] B) × B // _}) (a : A) : lift fe (inl a : A[ε]) = fe.val.1 a
by rw [lift_apply_apply, fst_inl, snd_inl, map_zero, zero_mul, add_zero]
theorem
DualNumber.lift_apply_inl
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[]
When applied to `inl`, `DualNumber.lift` applies the map `f : A →ₐ[R] B`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_comp_inlHom (fe : {_fe : (A →ₐ[R] B) × B // _}) : (lift fe).comp (inlAlgHom R A A) = fe.val.1
AlgHom.ext <| lift_apply_inl fe
theorem
DualNumber.lift_comp_inlHom
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "AlgHom.ext" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_smul (fe : {_fe : (A →ₐ[R] B) × B // _}) (a : A) (ad : A[ε]) : lift fe (a • ad) = fe.val.1 a * lift fe ad
by rw [← inl_mul_eq_smul, map_mul, lift_apply_inl]
theorem
DualNumber.lift_smul
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "map_mul" ]
Scaling on the left is sent by `DualNumber.lift` to multiplication on the left
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_op_smul (fe : {_fe : (A →ₐ[R] B) × B // _}) (a : A) (ad : A[ε]) : lift fe (MulOpposite.op a • ad) = lift fe ad * fe.val.1 a
by rw [← mul_inl_eq_op_smul, map_mul, lift_apply_inl]
theorem
DualNumber.lift_op_smul
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "MulOpposite.op", "map_mul" ]
Scaling on the right is sent by `DualNumber.lift` to multiplication on the right
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_apply_eps (fe : {fe : (A →ₐ[R] B) × B // fe.2 * fe.2 = 0 ∧ ∀ a, Commute fe.2 (fe.1 a)}) : lift fe (ε : A[ε]) = fe.val.2
by simp only [lift_apply_apply, fst_eps, map_zero, snd_eps, map_one, one_mul, zero_add]
theorem
DualNumber.lift_apply_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Commute", "map_one", "one_mul" ]
When applied to `ε`, `DualNumber.lift` produces the element of `B` that squares to 0.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_inlAlgHom_eps : lift ⟨(inlAlgHom _ _ _, ε), eps_mul_eps, fun _ => commute_eps_left _⟩ = AlgHom.id R A[ε]
lift.apply_symm_apply <| AlgHom.id R A[ε]
theorem
DualNumber.lift_inlAlgHom_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "AlgHom.id" ]
Lifting `DualNumber.eps` itself gives the identity.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
range_inlAlgHom_sup_adjoin_eps : (inlAlgHom R A A).range ⊔ Algebra.adjoin R {ε} = ⊤
by refine top_unique fun x hx => ?_; clear hx rw [← x.inl_fst_add_inr_snd_eq, inr_eq_smul_eps, ← inl_mul_eq_smul] refine add_mem ?_ (mul_mem ?_ ?_) · exact le_sup_left (α := Subalgebra R _) <| Set.mem_range_self x.fst · exact le_sup_left (α := Subalgebra R _) <| Set.mem_range_self x.snd · refine le_sup_righ...
theorem
DualNumber.range_inlAlgHom_sup_adjoin_eps
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "Algebra.adjoin", "Set.mem_range_self", "Set.mem_singleton", "Subalgebra", "le_sup_left", "le_sup_right", "top_unique" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
range_lift (fe : {fe : (A →ₐ[R] B) × B // fe.2 * fe.2 = 0 ∧ ∀ a, Commute fe.2 (fe.1 a)}) : (lift fe).range = fe.1.1.range ⊔ R[fe.1.2]
by simp_rw [← Algebra.map_top, ← range_inlAlgHom_sup_adjoin_eps, Algebra.map_sup, AlgHom.map_adjoin, ← AlgHom.range_comp, Set.image_singleton, lift_apply_eps, lift_comp_inlHom, Algebra.map_top]
theorem
DualNumber.range_lift
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "AlgHom.map_adjoin", "AlgHom.range_comp", "Algebra.map_sup", "Algebra.map_top", "Commute", "Set.image_singleton" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
instRepr [Repr R] : Repr (DualNumber R)
where reprPrec f p := (if p > 65 then (Std.Format.bracket "(" · ")") else (·)) <| reprPrec f.fst 65 ++ " + " ++ reprPrec f.snd 70 ++ "*ε"
instance
DualNumber.instRepr
Algebra
Mathlib/Algebra/DualNumber.lean
[]
[ "DualNumber" ]
Show DualNumber with values x and y as an `"x + y*ε"` string
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
dualNumberEquiv : Quaternion (DualNumber R) ≃ₐ[R] DualNumber (Quaternion R)
where toFun q := (⟨q.re.fst, q.imI.fst, q.imJ.fst, q.imK.fst⟩, ⟨q.re.snd, q.imI.snd, q.imJ.snd, q.imK.snd⟩) invFun d := ⟨(d.fst.re, d.snd.re), (d.fst.imI, d.snd.imI), (d.fst.imJ, d.snd.imJ), (d.fst.imK, d.snd.imK)⟩ map_mul' := by intros ext : 1 · rfl · dsimp congr 1 <;> simp <;> ring...
def
Quaternion.dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
The dual quaternions can be equivalently represented as a quaternion with dual coefficients, or as a dual number with quaternion coefficients. See also `Matrix.dualNumberEquiv` for a similar result.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
re_fst_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).fst.re = q.re.fst
rfl
theorem
Quaternion.re_fst_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
imI_fst_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).fst.imI = q.imI.fst
rfl
theorem
Quaternion.imI_fst_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
imJ_fst_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).fst.imJ = q.imJ.fst
rfl
theorem
Quaternion.imJ_fst_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
imK_fst_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).fst.imK = q.imK.fst
rfl
theorem
Quaternion.imK_fst_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
re_snd_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).snd.re = q.re.snd
rfl
theorem
Quaternion.re_snd_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
imI_snd_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).snd.imI = q.imI.snd
rfl
theorem
Quaternion.imI_snd_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
imJ_snd_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).snd.imJ = q.imJ.snd
rfl
theorem
Quaternion.imJ_snd_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
imK_snd_dualNumberEquiv (q : Quaternion (DualNumber R)) : (dualNumberEquiv q).snd.imK = q.imK.snd
rfl
theorem
Quaternion.imK_snd_dualNumberEquiv
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
fst_re_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).re.fst = d.fst.re
rfl
theorem
Quaternion.fst_re_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
fst_imI_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).imI.fst = d.fst.imI
rfl
theorem
Quaternion.fst_imI_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
fst_imJ_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).imJ.fst = d.fst.imJ
rfl
theorem
Quaternion.fst_imJ_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
fst_imK_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).imK.fst = d.fst.imK
rfl
theorem
Quaternion.fst_imK_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
snd_re_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).re.snd = d.snd.re
rfl
theorem
Quaternion.snd_re_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
snd_imI_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).imI.snd = d.snd.imI
rfl
theorem
Quaternion.snd_imI_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
snd_imJ_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).imJ.snd = d.snd.imJ
rfl
theorem
Quaternion.snd_imJ_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
snd_imK_dualNumberEquiv_symm (d : DualNumber (Quaternion R)) : (dualNumberEquiv.symm d).imK.snd = d.snd.imK
rfl
theorem
Quaternion.snd_imK_dualNumberEquiv_symm
Algebra
Mathlib/Algebra/DualQuaternion.lean
[]
[ "DualNumber", "Quaternion" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
Expr.instOne {u : Lean.Level} (α : Q(Type u)) (_ : Q(One $α)) : One Q($α)
where one := q(1 : $α)
def
Expr.instOne
Algebra
Mathlib/Algebra/Expr.lean
[]
[]
Produce a `One` instance for `Q($α)` such that `1 : Q($α)` is `q(1 : $α)`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
Expr.instZero {u : Lean.Level} (α : Q(Type u)) (_ : Q(Zero $α)) : Zero Q($α)
where zero := q(0 : $α)
def
Expr.instZero
Algebra
Mathlib/Algebra/Expr.lean
[]
[]
Produce a `Zero` instance for `Q($α)` such that `0 : Q($α)` is `q(0 : $α)`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
Expr.instMul {u : Lean.Level} (α : Q(Type u)) (_ : Q(Mul $α)) : Mul Q($α)
where mul x y := q($x * $y)
def
Expr.instMul
Algebra
Mathlib/Algebra/Expr.lean
[]
[]
Produce a `Mul` instance for `Q($α)` such that `x * y : Q($α)` is `q($x * $y)`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
Expr.instAdd {u : Lean.Level} (α : Q(Type u)) (_ : Q(Add $α)) : Add Q($α)
where add x y := q($x + $y)
def
Expr.instAdd
Algebra
Mathlib/Algebra/Expr.lean
[]
[]
Produce an `Add` instance for `Q($α)` such that `x + y : Q($α)` is `q($x + $y)`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
surjective_of_surjective_of_surjective_of_injective (hi₁ : Function.Surjective i₁) (hi₃ : Function.Surjective i₃) (hi₄ : Function.Injective i₄) : Function.Surjective i₂
by intro x obtain ⟨y, hy⟩ := hi₃ (g₂ x) obtain ⟨a, rfl⟩ : y ∈ Set.range f₂ := (hf₂ _).mp <| by simpa [hy, hg₂.apply_apply_eq_one, map_eq_one_iff _ hi₄] using (DFunLike.congr_fun hc₃ y).symm obtain ⟨b, hb⟩ : x / i₂ a ∈ Set.range g₁ := (hg₁ _).mp <| by simp [← hy, show g₂ (i₂ a) = i₃ (f₂ a) by simpa using...
lemma
MonoidHom.surjective_of_surjective_of_surjective_of_injective
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "DFunLike.congr_fun", "Set.range", "f₁", "f₂", "map_eq_one_iff", "symm" ]
One four lemma in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
surjective_of_surjective_of_injective_of_left_exact (hi₂ : Function.Surjective i₂) (hi₃ : Function.Injective i₃) (hg₀ : Function.Injective g₁) : Function.Surjective i₁
by refine surjective_of_surjective_of_surjective_of_injective (1 : Unit →* M₁) f₁ f₂ (1 : Unit →* N₁) g₁ g₂ 1 i₁ i₂ i₃ (by simp) hc₁ hc₂ hf₁ (fun y ↦ ?_) hg₁ (fun | .unit => ⟨0, rfl⟩) hi₂ hi₃ simp only [Set.mem_range, one_apply, exists_const] exact ⟨fun h ↦ (hg₀ ((map_one _).trans h.symm)), fun h ↦ h ▸ (map_o...
lemma
MonoidHom.surjective_of_surjective_of_injective_of_left_exact
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "Set.mem_range", "f₁", "f₂", "map_one", "trans" ]
A special case of one four lemma such that the left-most term is one in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
injective_of_surjective_of_injective_of_injective (hi₁ : Function.Surjective i₁) (hi₂ : Function.Injective i₂) (hi₄ : Function.Injective i₄) : Function.Injective i₃
by rw [injective_iff_map_eq_one] intro m hm obtain ⟨x, rfl⟩ := (hf₂ m).mp <| by suffices h : i₄ (f₃ m) = 1 by rwa [map_eq_one_iff _ hi₄] at h simp [← show g₃ (i₃ m) = i₄ (f₃ m) by simpa using DFunLike.congr_fun hc₃ m, hm] obtain ⟨y, hy⟩ := (hg₁ _).mp <| by rwa [show g₂ (i₂ x) = i₃ (f₂ x) by simpa us...
lemma
MonoidHom.injective_of_surjective_of_injective_of_injective
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "DFunLike.congr_fun", "f₁", "f₂", "injective_iff_map_eq_one", "map_eq_one_iff" ]
One four lemma in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
injective_of_surjective_of_injective_of_right_exact (hi₁ : Function.Surjective i₁) (hi₂ : Function.Injective i₂) (hf₂ : Function.Surjective f₂) : Function.Injective i₃
injective_of_surjective_of_injective_of_injective f₁ f₂ (1 : M₃ →* Unit) g₁ g₂ (1 : N₃ →* Unit) i₁ i₂ i₃ 1 hc₁ hc₂ (by simp) hf₁ (fun y ↦ by simpa using hf₂ y) hg₁ hi₁ hi₂ (fun | .unit => by simp) include hf₁ hf₂ hf₃ hg₁ hg₂ hg₃ hc₁ hc₂ hc₃ hc₄ in
lemma
MonoidHom.injective_of_surjective_of_injective_of_right_exact
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "f₁", "f₂" ]
A special case of one four lemma such that the right-most term is one in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
bijective_of_surjective_of_bijective_of_bijective_of_injective (hi₁ : Function.Surjective i₁) (hi₂ : Function.Bijective i₂) (hi₄ : Function.Bijective i₄) (hi₅ : Function.Injective i₅) : Function.Bijective i₃
⟨injective_of_surjective_of_injective_of_injective f₁ f₂ f₃ g₁ g₂ g₃ i₁ i₂ i₃ i₄ hc₁ hc₂ hc₃ hf₁ hf₂ hg₁ hi₁ hi₂.1 hi₄.1, surjective_of_surjective_of_surjective_of_injective f₂ f₃ f₄ g₂ g₃ g₄ i₂ i₃ i₄ i₅ hc₂ hc₃ hc₄ hf₃ hg₂ hg₃ hi₂.2 hi₄.2 hi₅⟩ include hf₁ hg₁ hc₁ hc₂ in
lemma
MonoidHom.bijective_of_surjective_of_bijective_of_bijective_of_injective
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "Function.Bijective", "f₁", "f₂" ]
The five lemma in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
bijective_of_bijective_of_injective_of_left_exact (hi₂ : Function.Bijective i₂) (hi₃ : Function.Injective i₃) (hf₀ : Function.Injective f₁) (hg₀ : Function.Injective g₁) : Function.Bijective i₁
⟨fun {x y} h ↦ (hf₀ (hi₂.1 (congr($hc₁ x).symm.trans (congr(g₁ $h).trans congr($hc₁ y))))), surjective_of_surjective_of_injective_of_left_exact f₁ f₂ g₁ g₂ i₁ i₂ i₃ hc₁ hc₂ hf₁ hg₁ hi₂.2 hi₃ hg₀⟩ include hf₁ hg₁ hc₁ hc₂ in
lemma
MonoidHom.bijective_of_bijective_of_injective_of_left_exact
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "Function.Bijective", "f₁", "f₂", "trans" ]
A special case of the five lemma in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
bijective_of_surjective_of_bijective_of_right_exact (hi₁ : Function.Surjective i₁) (hi₂ : Function.Bijective i₂) (hf₂ : Function.Surjective f₂) (hg₂ : Function.Surjective g₂) : Function.Bijective i₃
by refine ⟨injective_of_surjective_of_injective_of_right_exact f₁ f₂ g₁ g₂ i₁ i₂ i₃ hc₁ hc₂ hf₁ hg₁ hi₁ hi₂.1 hf₂, fun y ↦ ?_⟩ obtain ⟨y, rfl⟩ := hg₂ y obtain ⟨y, rfl⟩ := hi₂.2 y exact ⟨f₂ y, congr($hc₂ y).symm⟩
lemma
MonoidHom.bijective_of_surjective_of_bijective_of_right_exact
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "Function.Bijective", "f₁", "f₂" ]
A special case of the five lemma in terms of groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
surjective_of_surjective_of_surjective_of_injective (hi₁ : Function.Surjective i₁) (hi₃ : Function.Surjective i₃) (hi₄ : Function.Injective i₄) : Function.Surjective i₂
AddMonoidHom.surjective_of_surjective_of_surjective_of_injective f₁.toAddMonoidHom f₂.toAddMonoidHom f₃.toAddMonoidHom g₁.toAddMonoidHom g₂.toAddMonoidHom g₃.toAddMonoidHom i₁.toAddMonoidHom i₂.toAddMonoidHom i₃.toAddMonoidHom i₄.toAddMonoidHom (AddMonoidHom.ext fun x ↦ DFunLike.congr_fun hc₁ x) (AddMon...
lemma
LinearMap.surjective_of_surjective_of_surjective_of_injective
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "DFunLike.congr_fun" ]
One four lemma in terms of modules. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
surjective_of_surjective_of_injective_of_left_exact (hi₂ : Function.Surjective i₂) (hi₃ : Function.Injective i₃) (hg₀ : Function.Injective g₁) : Function.Surjective i₁
by refine surjective_of_surjective_of_surjective_of_injective (0 : Unit →ₗ[R] M₁) f₁ f₂ (0 : Unit →ₗ[R] N₁) g₁ g₂ 0 i₁ i₂ i₃ (by simp) hc₁ hc₂ hf₁ (fun y ↦ ?_) hg₁ (fun | .unit => ⟨0, rfl⟩) hi₂ hi₃ simp only [Set.mem_range, zero_apply, exists_const] exact ⟨fun h ↦ (hg₀ ((map_zero _).trans h.symm)), fun h ...
lemma
LinearMap.surjective_of_surjective_of_injective_of_left_exact
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "Set.mem_range", "f₁", "f₂", "trans" ]
A special case of one four lemma such that the left-most term is zero in terms of modules. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
injective_of_surjective_of_injective_of_injective (hi₁ : Function.Surjective i₁) (hi₂ : Function.Injective i₂) (hi₄ : Function.Injective i₄) : Function.Injective i₃
AddMonoidHom.injective_of_surjective_of_injective_of_injective f₁.toAddMonoidHom f₂.toAddMonoidHom f₃.toAddMonoidHom g₁.toAddMonoidHom g₂.toAddMonoidHom g₃.toAddMonoidHom i₁.toAddMonoidHom i₂.toAddMonoidHom i₃.toAddMonoidHom i₄.toAddMonoidHom (AddMonoidHom.ext fun x ↦ DFunLike.congr_fun hc₁ x) (AddMonoi...
lemma
LinearMap.injective_of_surjective_of_injective_of_injective
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "DFunLike.congr_fun" ]
One four lemma in terms of modules. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
injective_of_surjective_of_injective_of_right_exact (hi₁ : Function.Surjective i₁) (hi₂ : Function.Injective i₂) (hf₂ : Function.Surjective f₂) : Function.Injective i₃
injective_of_surjective_of_injective_of_injective f₁ f₂ (0 : M₃ →ₗ[R] Unit) g₁ g₂ (0 : N₃ →ₗ[R] Unit) i₁ i₂ i₃ 0 hc₁ hc₂ (by simp) hf₁ (fun y ↦ by simpa using hf₂ y) hg₁ hi₁ hi₂ (fun | .unit => by simp) include hf₁ hf₂ hf₃ hg₁ hg₂ hg₃ hc₁ hc₂ hc₃ hc₄ in
lemma
LinearMap.injective_of_surjective_of_injective_of_right_exact
Algebra
Mathlib/Algebra/FiveLemma.lean
[]
[ "f₁", "f₂" ]
A special case of one four lemma such that the right-most term is zero in terms of (additive) groups. For a diagram explaining the variables, see the module docstring.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeAddMagma (α : Type u) : Type u | of : α → FreeAddMagma α | add : FreeAddMagma α → FreeAddMagma α → FreeAddMagma α deriving DecidableEq compile_inductive% FreeAddMagma
inductive
FreeAddMagma
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
If `α` is a type, then `FreeAddMagma α` is the free additive magma generated by `α`. This is an additive magma equipped with a function `FreeAddMagma.of : α → FreeAddMagma α` which has the following universal property: if `M` is any magma, and `f : α → M` is any function, then this function is the composite of `FreeAdd...
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeMagma (α : Type u) : Type u | of : α → FreeMagma α | mul : FreeMagma α → FreeMagma α → FreeMagma α deriving DecidableEq compile_inductive% FreeMagma
inductive
FreeMagma
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
If `α` is a type, then `FreeMagma α` is the free magma generated by `α`. This is a magma equipped with a function `FreeMagma.of : α → FreeMagma α` which has the following universal property: if `M` is any magma, and `f : α → M` is any function, then this function is the composite of `FreeMagma.of` and a unique multipli...
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
mul_eq (x y : FreeMagma α) : mul x y = x * y
rfl
theorem
FreeMagma.mul_eq
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
recOnMul {C : FreeMagma α → Sort l} (x) (ih1 : ∀ x, C (of x)) (ih2 : ∀ x y, C x → C y → C (x * y)) : C x
FreeMagma.recOn x ih1 ih2
def
FreeMagma.recOnMul
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
Recursor for `FreeMagma` using `x * y` instead of `FreeMagma.mul x y`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
hom_ext {β : Type v} [Mul β] {f g : FreeMagma α →ₙ* β} (h : f ∘ of = g ∘ of) : f = g
(DFunLike.ext _ _) fun x ↦ recOnMul x (congr_fun h) <| by intros; simp only [map_mul, *]
theorem
FreeMagma.hom_ext
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "DFunLike.ext", "FreeMagma", "map_mul" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeMagma.liftAux {α : Type u} {β : Type v} [Mul β] (f : α → β) : FreeMagma α → β
| FreeMagma.of x => f x | x * y => liftAux f x * liftAux f y
def
FreeMagma.liftAux
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
Lifts a function `α → β` to a magma homomorphism `FreeMagma α → β` given a magma `β`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeAddMagma.liftAux {α : Type u} {β : Type v} [Add β] (f : α → β) : FreeAddMagma α → β
| FreeAddMagma.of x => f x | x + y => liftAux f x + liftAux f y
def
FreeAddMagma.liftAux
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeAddMagma" ]
Lifts a function `α → β` to an additive magma homomorphism `FreeAddMagma α → β` given an additive magma `β`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift : (α → β) ≃ (FreeMagma α →ₙ* β)
where toFun f := { toFun := liftAux f map_mul' := fun _ _ ↦ rfl } invFun F := F ∘ of
def
FreeMagma.lift
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
The universal property of the free magma expressing its adjointness.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_of (x) : lift f (of x) = f x
rfl
theorem
FreeMagma.lift_of
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_comp_of : lift f ∘ of = f
rfl
theorem
FreeMagma.lift_comp_of
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
lift_comp_of' (f : FreeMagma α →ₙ* β) : lift (f ∘ of) = f
lift.apply_symm_apply f
theorem
FreeMagma.lift_comp_of'
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
map (f : α → β) : FreeMagma α →ₙ* FreeMagma β
lift (of ∘ f)
def
FreeMagma.map
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
The unique magma homomorphism `FreeMagma α →ₙ* FreeMagma β` that sends each `of x` to `of (f x)`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
map_of (x) : map f (of x) = of (f x)
rfl
theorem
FreeMagma.map_of
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
recOnPure {C : FreeMagma α → Sort l} (x) (ih1 : ∀ x, C (pure x)) (ih2 : ∀ x y, C x → C y → C (x * y)) : C x
FreeMagma.recOnMul x ih1 ih2
def
FreeMagma.recOnPure
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma", "FreeMagma.recOnMul" ]
Recursor on `FreeMagma` using `pure` instead of `of`.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
map_pure (f : α → β) (x) : (f <$> pure x : FreeMagma β) = pure (f x)
rfl
theorem
FreeMagma.map_pure
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
map_mul' (f : α → β) (x y : FreeMagma α) : f <$> (x * y) = f <$> x * f <$> y
rfl
theorem
FreeMagma.map_mul'
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
pure_bind (f : α → FreeMagma β) (x) : pure x >>= f = f x
rfl
theorem
FreeMagma.pure_bind
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
mul_bind (f : α → FreeMagma β) (x y : FreeMagma α) : x * y >>= f = (x >>= f) * (y >>= f)
rfl
theorem
FreeMagma.mul_bind
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
pure_seq {α β : Type u} {f : α → β} {x : FreeMagma α} : pure f <*> x = f <$> x
rfl
theorem
FreeMagma.pure_seq
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
mul_seq {α β : Type u} {f g : FreeMagma (α → β)} {x : FreeMagma α} : f * g <*> x = (f <*> x) * (g <*> x)
rfl
theorem
FreeMagma.mul_seq
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
instLawfulMonad : LawfulMonad FreeMagma.{u}
LawfulMonad.mk' (pure_bind := fun _ _ ↦ rfl) (bind_assoc := fun x f g ↦ FreeMagma.recOnPure x (fun _ ↦ rfl) fun x y ih1 ih2 ↦ by rw [mul_bind, mul_bind, mul_bind, ih1, ih2]) (id_map := fun x ↦ FreeMagma.recOnPure x (fun _ ↦ rfl) fun x y ih1 ih2 ↦ by rw [map_mul', ih1, ih2])
instance
FreeMagma.instLawfulMonad
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma.recOnPure" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeMagma.traverse {m : Type u → Type u} [Applicative m] {α β : Type u} (F : α → m β) : FreeMagma α → m (FreeMagma β)
| FreeMagma.of x => FreeMagma.of <$> F x | x * y => (· * ·) <$> x.traverse F <*> y.traverse F
def
FreeMagma.traverse
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
`FreeMagma` is traversable.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeAddMagma.traverse {m : Type u → Type u} [Applicative m] {α β : Type u} (F : α → m β) : FreeAddMagma α → m (FreeAddMagma β)
| FreeAddMagma.of x => FreeAddMagma.of <$> F x | x + y => (· + ·) <$> x.traverse F <*> y.traverse F
def
FreeAddMagma.traverse
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeAddMagma" ]
`FreeAddMagma` is traversable.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
traverse_pure (x) : traverse F (pure x : FreeMagma α) = pure <$> F x
rfl
theorem
FreeMagma.traverse_pure
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
traverse_pure' : traverse F ∘ pure = fun x ↦ (pure <$> F x : m (FreeMagma β))
rfl
theorem
FreeMagma.traverse_pure'
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
traverse_mul (x y : FreeMagma α) : traverse F (x * y) = (· * ·) <$> traverse F x <*> traverse F y
rfl
theorem
FreeMagma.traverse_mul
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
traverse_mul' : Function.comp (traverse F) ∘ (HMul.hMul : FreeMagma α → FreeMagma α → FreeMagma α) = fun x y ↦ (· * ·) <$> traverse F x <*> traverse F y
rfl
theorem
FreeMagma.traverse_mul'
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
traverse_eq (x) : FreeMagma.traverse F x = traverse F x
rfl
theorem
FreeMagma.traverse_eq
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma.traverse" ]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeMagma.repr {α : Type u} [Repr α] : FreeMagma α → Lean.Format
| FreeMagma.of x => repr x | x * y => "( " ++ x.repr ++ " * " ++ y.repr ++ " )"
def
FreeMagma.repr
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
Representation of an element of a free magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeAddMagma.repr {α : Type u} [Repr α] : FreeAddMagma α → Lean.Format
| FreeAddMagma.of x => repr x | x + y => "( " ++ x.repr ++ " + " ++ y.repr ++ " )"
def
FreeAddMagma.repr
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeAddMagma" ]
Representation of an element of a free additive magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeMagma.length {α : Type u} : FreeMagma α → ℕ
| FreeMagma.of _x => 1 | x * y => x.length + y.length
def
FreeMagma.length
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
Length of an element of a free magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeAddMagma.length {α : Type u} : FreeAddMagma α → ℕ
| FreeAddMagma.of _x => 1 | x + y => x.length + y.length
def
FreeAddMagma.length
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeAddMagma" ]
Length of an element of a free additive magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
FreeMagma.length_pos {α : Type u} (x : FreeMagma α) : 0 < x.length
match x with | FreeMagma.of _ => Nat.succ_pos 0 | mul y z => Nat.add_pos_left (length_pos y) z.length
lemma
FreeMagma.length_pos
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[ "FreeMagma" ]
The length of an element of a free magma is positive.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
AddMagma.AssocRel (α : Type u) [Add α] : α → α → Prop | intro : ∀ x y z, AddMagma.AssocRel α (x + y + z) (x + (y + z)) | left : ∀ w x y z, AddMagma.AssocRel α (w + (x + y + z)) (w + (x + (y + z)))
inductive
AddMagma.AssocRel
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
Associativity relations for an additive magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
Magma.AssocRel (α : Type u) [Mul α] : α → α → Prop | intro : ∀ x y z, Magma.AssocRel α (x * y * z) (x * (y * z)) | left : ∀ w x y z, Magma.AssocRel α (w * (x * y * z)) (w * (x * (y * z)))
inductive
Magma.AssocRel
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
Associativity relations for a magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
AssocQuotient (α : Type u) [Mul α] : Type u
Quot <| AssocRel α
def
Magma.AssocQuotient
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
Semigroup quotient of a magma.
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319
quot_mk_assoc (x y z : α) : Quot.mk (AssocRel α) (x * y * z) = Quot.mk _ (x * (y * z))
Quot.sound (AssocRel.intro _ _ _)
theorem
Magma.AssocQuotient.quot_mk_assoc
Algebra
Mathlib/Algebra/Free.lean
[ "Mathlib.Tactic.Attr.Register" ]
[]
https://github.com/leanprover-community/mathlib4
b9f14353520df73472ae3825fb53f86559a01319