Skip to content

Commit 2c51483

Browse files
committed
chore(RingTheory/TensorProduct): make Algebra.TensorProduct.assoc more linear (leanprover-community#34947)
We also remove two unused `aux` lemmas that can be recovered by the multiplicative properties of `Algebra.TensorProduct.assoc`.
1 parent bcd0d3b commit 2c51483

5 files changed

Lines changed: 21 additions & 32 deletions

File tree

Mathlib/Algebra/Category/AlgCat/Monoidal.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ instance : MonoidalCategoryStruct (AlgCat.{u} R) where
5353
whiskerRight {X₁ X₂} (f : X₁ ⟶ X₂) Y := tensorHom f (𝟙 Y)
5454
tensorHom := tensorHom
5555
tensorUnit := of R R
56-
associator X Y Z := (Algebra.TensorProduct.assoc R R X Y Z).toAlgebraIso
56+
associator X Y Z := (Algebra.TensorProduct.assoc R R R X Y Z).toAlgebraIso
5757
leftUnitor X := (Algebra.TensorProduct.lid R X).toAlgebraIso
5858
rightUnitor X := (Algebra.TensorProduct.rid R R X).toAlgebraIso
5959

@@ -86,11 +86,11 @@ theorem hom_inv_rightUnitor {M : AlgCat.{u} R} :
8686
rfl
8787

8888
theorem hom_hom_associator {M N K : AlgCat.{u} R} :
89-
(α_ M N K).hom.hom = (Algebra.TensorProduct.assoc R R M N K).toAlgHom :=
89+
(α_ M N K).hom.hom = (Algebra.TensorProduct.assoc R R R M N K).toAlgHom :=
9090
rfl
9191

9292
theorem hom_inv_associator {M N K : AlgCat.{u} R} :
93-
(α_ M N K).inv.hom = (Algebra.TensorProduct.assoc R R M N K).symm.toAlgHom :=
93+
(α_ M N K).inv.hom = (Algebra.TensorProduct.assoc R R R M N K).symm.toAlgHom :=
9494
rfl
9595

9696
noncomputable instance instMonoidalCategory : MonoidalCategory (AlgCat.{u} R) :=

Mathlib/Algebra/Category/CommAlgCat/Monoidal.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ instance : MonoidalCategory (CommAlgCat.{u} R) where
5858
whiskerRight f T := ofHom (map f.hom (.id _ _))
5959
tensorHom f g := ofHom (map f.hom g.hom)
6060
tensorUnit := .of R R
61-
associator _ _ _ := isoMk (assoc R R _ _ _)
61+
associator _ _ _ := isoMk (assoc R R R _ _ _)
6262
leftUnitor _ := isoMk (lid R _)
6363
rightUnitor _ := isoMk (rid R R _)
6464

@@ -77,10 +77,10 @@ variable (C) in
7777
@[simp] lemma whiskerLeft_hom (f : A ⟶ B) : (C ◁ f).hom = map (.id _ _) f.hom := rfl
7878

7979
variable (A B C) in
80-
@[simp] lemma associator_hom_hom : (α_ A B C).hom.hom = (assoc R R A B C).toAlgHom := rfl
80+
@[simp] lemma associator_hom_hom : (α_ A B C).hom.hom = (assoc R R R A B C).toAlgHom := rfl
8181

8282
variable (A B C) in
83-
@[simp] lemma associator_inv_hom : (α_ A B C).inv.hom = (assoc R R A B C).symm.toAlgHom := rfl
83+
@[simp] lemma associator_inv_hom : (α_ A B C).inv.hom = (assoc R R R A B C).symm.toAlgHom := rfl
8484

8585
instance : BraidedCategory (CommAlgCat.{u} R) where
8686
braiding S T := isoMk (comm R _ _)

Mathlib/RingTheory/Bialgebra/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ then `Bialgebra.ofAlgHom` consumes the counit and comultiplication
177177
as algebra homomorphisms that satisfy the coalgebra axioms to define
178178
a bialgebra structure on `A`. -/
179179
abbrev ofAlgHom (comul : A →ₐ[R] (A ⊗[R] A)) (counit : A →ₐ[R] R)
180-
(h_coassoc : (Algebra.TensorProduct.assoc R R A A A).toAlgHom.comp
180+
(h_coassoc : (Algebra.TensorProduct.assoc R R R A A A).toAlgHom.comp
181181
((Algebra.TensorProduct.map comul (.id R A)).comp comul)
182182
= (Algebra.TensorProduct.map (.id R A) comul).comp comul)
183183
(h_rTensor : (Algebra.TensorProduct.map counit (.id R A)).comp comul

Mathlib/RingTheory/Bialgebra/TensorProduct.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ variable (R S A C D) in
9090
/-- The associator for tensor products of R-bialgebras, as a bialgebra equivalence. -/
9191
protected noncomputable def assoc :
9292
(A ⊗[S] C) ⊗[R] D ≃ₐc[S] A ⊗[S] (C ⊗[R] D) :=
93-
{ Coalgebra.TensorProduct.assoc R S A C D, Algebra.TensorProduct.assoc R S A C D with }
93+
{ Coalgebra.TensorProduct.assoc R S A C D, Algebra.TensorProduct.assoc R S S A C D with }
9494

9595
@[simp]
9696
theorem assoc_tmul (x : A) (y : C) (z : D) :
@@ -110,7 +110,7 @@ theorem assoc_toCoalgEquiv :
110110
@[simp]
111111
theorem assoc_toAlgEquiv :
112112
(Bialgebra.TensorProduct.assoc R S A C D : _ ≃ₐ[S] _) =
113-
Algebra.TensorProduct.assoc R S A C D := rfl
113+
Algebra.TensorProduct.assoc R S S A C D := rfl
114114

115115
variable (R B) in
116116
/-- The base ring is a left identity for the tensor product of bialgebras, up to

Mathlib/RingTheory/TensorProduct/Maps.lean

Lines changed: 12 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ This file provides results about maps between tensor products of `R`-algebras.
2121
* `Algebra.TensorProduct.lid : R ⊗[R] A ≃ₐ[R] A`
2222
* `Algebra.TensorProduct.rid : A ⊗[R] R ≃ₐ[S] A` (usually used with `S = R` or `S = A`)
2323
* `Algebra.TensorProduct.comm : A ⊗[R] B ≃ₐ[R] B ⊗[R] A`
24-
* `Algebra.TensorProduct.assoc : ((A ⊗[R] B) ⊗[R] C) ≃ₐ[R] (A ⊗[R] (B ⊗[R] C))`
24+
* `Algebra.TensorProduct.assoc : ((A ⊗[S] C) ⊗[R] D) ≃ₐ[T] (A ⊗[S] (C ⊗[R] D))`
2525
- `Algebra.TensorProduct.liftEquiv`: a universal property for the tensor product of algebras.
2626
2727
## References
@@ -368,39 +368,28 @@ end
368368

369369
section
370370

371-
variable {R A}
372-
373-
unseal mul in
374-
theorem assoc_aux_1 (a₁ a₂ : A) (b₁ b₂ : B) (c₁ c₂ : C) :
375-
(TensorProduct.assoc R A B C) ((a₁ * a₂) ⊗ₜ[R] (b₁ * b₂) ⊗ₜ[R] (c₁ * c₂)) =
376-
(TensorProduct.assoc R A B C) (a₁ ⊗ₜ[R] b₁ ⊗ₜ[R] c₁) *
377-
(TensorProduct.assoc R A B C) (a₂ ⊗ₜ[R] b₂ ⊗ₜ[R] c₂) :=
378-
rfl
379-
380-
theorem assoc_aux_2 : (TensorProduct.assoc R A B C) (1 ⊗ₜ[R] 1 ⊗ₜ[R] 1) = 1 :=
381-
rfl
382-
383-
variable (R A C D)
371+
variable [CommSemiring T] [Algebra R T] [Algebra S T]
372+
[Algebra T A] [IsScalarTower R T A] [IsScalarTower S T A]
384373

374+
variable (T C D) in
385375
/-- The associator for tensor product of R-algebras, as an algebra isomorphism. -/
386-
protected def assoc : A ⊗[S] C ⊗[R] D ≃ₐ[S] A ⊗[S] (C ⊗[R] D) :=
376+
protected def assoc : (A ⊗[S] C) ⊗[R] D ≃ₐ[T] A ⊗[S] (C ⊗[R] D) :=
387377
AlgEquiv.ofLinearEquiv
388-
(AlgebraTensorModule.assoc R S S A C D)
378+
(AlgebraTensorModule.assoc R S T A C D)
389379
(by simp [Algebra.TensorProduct.one_def])
390380
((LinearMap.map_mul_iff _).mpr <| by ext; simp)
391381

382+
variable (T C D) in
392383
@[simp] theorem assoc_toLinearEquiv :
393-
(TensorProduct.assoc R S A C D).toLinearEquiv = AlgebraTensorModule.assoc R S S A C D := rfl
394-
395-
variable {A C D}
384+
(TensorProduct.assoc R S T A C D).toLinearEquiv = AlgebraTensorModule.assoc R S T A C D := rfl
396385

397386
@[simp]
398387
theorem assoc_tmul (a : A) (b : C) (c : D) :
399-
TensorProduct.assoc R S A C D ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c) := rfl
388+
TensorProduct.assoc R S T A C D ((a ⊗ₜ b) ⊗ₜ c) = a ⊗ₜ (b ⊗ₜ c) := rfl
400389

401390
@[simp]
402391
theorem assoc_symm_tmul (a : A) (b : C) (c : D) :
403-
(TensorProduct.assoc R S A C D).symm (a ⊗ₜ (b ⊗ₜ c)) = (a ⊗ₜ b) ⊗ₜ c := rfl
392+
(TensorProduct.assoc R S T A C D).symm (a ⊗ₜ (b ⊗ₜ c)) = (a ⊗ₜ b) ⊗ₜ c := rfl
404393

405394
end
406395

@@ -541,8 +530,8 @@ variable (R A B C) in
541530
542531
This is the algebra version of `TensorProduct.leftComm`. -/
543532
def leftComm : A ⊗[R] (B ⊗[R] C) ≃ₐ[R] B ⊗[R] (A ⊗[R] C) :=
544-
(Algebra.TensorProduct.assoc R R A B C).symm.trans <|
545-
(congr (Algebra.TensorProduct.comm R A B) .refl).trans <| TensorProduct.assoc R R B A C
533+
(Algebra.TensorProduct.assoc R R R A B C).symm.trans <|
534+
(congr (Algebra.TensorProduct.comm R A B) .refl).trans <| TensorProduct.assoc R R R B A C
546535

547536
@[simp]
548537
theorem leftComm_tmul (m : A) (n : B) (p : C) :

0 commit comments

Comments
 (0)