Skip to content

Commit 2882c81

Browse files
committed
(Coalgebra/Monoid): more tinkering
1 parent a42f51f commit 2882c81

File tree

1 file changed

+43
-37
lines changed

1 file changed

+43
-37
lines changed

FLT/for_mathlib/Coalgebra/Monoid.lean

+43-37
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ open TensorProduct BigOperators LinearMap
3636
section Coalgebra
3737

3838
-- Note that using an `abbrev` here creates a diamond in the case `A = L`, when there
39-
-- is already a multiplication on `A →ₗ[R] A`
40-
-- a multiplication, defined by composition.
39+
-- is already a multiplication on `A →ₗ[R] A`, defined by composition.
40+
4141
/--
4242
Let `A` be an `R`-coalgebra and `L` an `R`-algebra. An `L`-linear point of `A`
4343
is an `R`-linear map from `A` to `L`.
@@ -61,46 +61,47 @@ If `comul x = ∑ aᵢ ⊗ bᵢ`, then `(φ ⋆ ψ)(x) = ∑ φ(aᵢ) × ψ(bᵢ
6161
noncomputable def mul : LinearPoint R A L :=
6262
LinearMap.mul' _ _ ∘ₗ TensorProduct.map φ ψ ∘ₗ Coalgebra.comul
6363

64+
noncomputable instance : Mul (LinearPoint R A L) where
65+
mul := mul
66+
67+
lemma mul_def (φ ψ : LinearPoint R A L) :
68+
φ * ψ = LinearMap.mul' _ _ ∘ₗ TensorProduct.map φ ψ ∘ₗ Coalgebra.comul := rfl
69+
6470
lemma mul_repr' {ι : Type* } (a : A) (ℐ : Finset ι) (Δ₁ Δ₂ : ι → A)
6571
(repr : Coalgebra.comul (R := R) a = ∑ i in ℐ, Δ₁ i ⊗ₜ Δ₂ i) :
6672
φ.mul ψ a = ∑ i in ℐ, φ (Δ₁ i) * ψ (Δ₂ i) := by
6773
simp only [mul, comp_apply, repr, map_sum, map_tmul, mul'_apply]
6874

69-
/--
70-
`A --counit--> R --algebraMap--> L` is the unit with respect to convolution product.
71-
-/
72-
def one : LinearPoint R A L :=
73-
Algebra.linearMap R L ∘ₗ Coalgebra.counit
74-
75-
instance : One (LinearPoint R A L) where
76-
one := one
77-
78-
lemma one_def : (1 : LinearPoint R A L) = Algebra.linearMap R L ∘ₗ Coalgebra.counit := rfl
79-
80-
noncomputable instance : Mul (LinearPoint R A L) where
81-
mul := mul
82-
8375
lemma mul_repr {ι : Type* } (a : A) (ℐ : Finset ι) (Δ₁ Δ₂ : ι → A)
8476
(repr : Coalgebra.comul (R := R) a = ∑ i in ℐ, Δ₁ i ⊗ₜ Δ₂ i) :
8577
(φ * ψ) a = ∑ i in ℐ, φ (Δ₁ i) * ψ (Δ₂ i) :=
8678
mul_repr' _ _ a ℐ Δ₁ Δ₂ repr
8779

8880
lemma mul_assoc' : φ * ψ * χ = φ * (ψ * χ) := LinearMap.ext fun x ↦ by
89-
simp only [show
90-
(φ * ψ) * χ =
81+
rw [show (φ * ψ) * χ =
9182
LinearMap.mul' _ _ ∘ₗ
9283
(LinearMap.mul' _ _).rTensor _ ∘ₗ
9384
(map (map _ _) _) ∘ₗ Coalgebra.comul.rTensor _ ∘ₗ Coalgebra.comul
94-
by simp only [← comp_assoc, map_comp_rTensor, rTensor_comp_map]; rfl,
95-
mul', comp_apply, Coalgebra.comul_repr, map_sum, rTensor_tmul, sum_tmul, map_tmul, lift.tmul,
96-
mul_apply', mul_assoc,
97-
show
98-
φ * (ψ * χ) =
85+
by simp only [← comp_assoc, map_comp_rTensor, rTensor_comp_map]; rfl]
86+
rw [show φ * (ψ * χ) =
9987
LinearMap.mul' _ _ ∘ₗ
10088
(LinearMap.mul' _ _).lTensor _ ∘ₗ
10189
(map _ (map _ _)) ∘ₗ Coalgebra.comul.lTensor _ ∘ₗ Coalgebra.comul
102-
by simp only [← comp_assoc, map_comp_lTensor, lTensor_comp_map]; rfl,
103-
← Coalgebra.coassoc, LinearEquiv.coe_coe, assoc_tmul, lTensor_tmul]
90+
by simp only [← comp_assoc, map_comp_lTensor, lTensor_comp_map]; rfl]
91+
simp only [mul', comp_apply, Coalgebra.comul_repr, map_sum, rTensor_tmul, sum_tmul, map_tmul,
92+
lift.tmul, mul_apply', mul_assoc, ← Coalgebra.coassoc, LinearEquiv.coe_coe, assoc_tmul,
93+
lTensor_tmul]
94+
95+
/--
96+
`A --counit--> R --algebraMap--> L` is the unit with respect to convolution product.
97+
-/
98+
def one : LinearPoint R A L :=
99+
Algebra.linearMap R L ∘ₗ Coalgebra.counit
100+
101+
instance : One (LinearPoint R A L) where
102+
one := one
103+
104+
lemma one_def : (1 : LinearPoint R A L) = Algebra.linearMap R L ∘ₗ Coalgebra.counit := rfl
104105

105106
lemma mul_one' : φ * 1 = φ := show mul φ one = φ from LinearMap.ext fun _ ↦ by
106107
simp [show φ.mul one =
@@ -159,6 +160,23 @@ If `comul x = ∑ aᵢ ⊗ bᵢ`, then `(φ ⋆ ψ)(x) = ∑ φ(aᵢ) × ψ(bᵢ
159160
noncomputable def mul : AlgHomPoint R A L :=
160161
Algebra.TensorProduct.lmul' R (S := L) |>.comp <|
161162
Algebra.TensorProduct.map φ ψ |>.comp <| Bialgebra.comulAlgHom R A
163+
164+
noncomputable instance : Mul (AlgHomPoint R A L) where
165+
mul := mul
166+
167+
lemma mul_def (φ ψ : AlgHomPoint R A L) :
168+
φ * ψ = (Algebra.TensorProduct.lmul' R (S := L) |>.comp <|
169+
Algebra.TensorProduct.map φ ψ |>.comp <| Bialgebra.comulAlgHom R A) := rfl
170+
171+
lemma mul_repr {ι : Type* } (a : A) (ℐ : Finset ι) (Δ₁ Δ₂ : ι → A)
172+
(repr : Coalgebra.comul (R := R) a = ∑ i in ℐ, Δ₁ i ⊗ₜ Δ₂ i) :
173+
(φ * ψ) a = ∑ i in ℐ, φ (Δ₁ i) * ψ (Δ₂ i) :=
174+
LinearPoint.mul_repr _ _ a ℐ Δ₁ Δ₂ repr
175+
176+
lemma mul_assoc' : φ * ψ * χ = φ * (ψ * χ) := by
177+
ext
178+
exact congr($(mul_assoc φ.toLinearPoint ψ.toLinearPoint χ.toLinearPoint) _)
179+
162180
/--
163181
`A -counit-> R -algebraMap-> L` is the unit with respect to convolution product.
164182
-/
@@ -171,13 +189,6 @@ noncomputable instance : One (AlgHomPoint R A L) where
171189
lemma one_def : (1 : AlgHomPoint R A L) = (Algebra.ofId R L).comp (Bialgebra.counitAlgHom R A) :=
172190
rfl
173191

174-
noncomputable instance : Mul (AlgHomPoint R A L) where
175-
mul := mul
176-
177-
lemma mul_assoc' : φ * ψ * χ = φ * (ψ * χ) := by
178-
ext
179-
exact congr($(mul_assoc φ.toLinearPoint ψ.toLinearPoint χ.toLinearPoint) _)
180-
181192
lemma mul_one' : φ * 1 = φ := by
182193
ext; exact congr($(mul_one φ.toLinearPoint) _)
183194

@@ -189,11 +200,6 @@ noncomputable instance instMonoid : Monoid (AlgHomPoint R A L) where
189200
one_mul := one_mul'
190201
mul_one := mul_one'
191202

192-
lemma mul_repr {ι : Type* } (a : A) (ℐ : Finset ι) (Δ₁ Δ₂ : ι → A)
193-
(repr : Coalgebra.comul (R := R) a = ∑ i in ℐ, Δ₁ i ⊗ₜ Δ₂ i) :
194-
(φ * ψ) a = ∑ i in ℐ, φ (Δ₁ i) * ψ (Δ₂ i) :=
195-
LinearPoint.mul_repr _ _ a ℐ Δ₁ Δ₂ repr
196-
197203
attribute [deprecated] mul_assoc' mul_one' one_mul'
198204

199205
section commutative_bialgebra

0 commit comments

Comments
 (0)