Skip to content

Commit 8a40b52

Browse files
committed
feat(CategoryTheory/Monoidal): replace šŸ™ X āŠ— f with X ◁ f (#10912)
We set `id_tensorHom` and `tensorHom_id` as simp lemmas. Partially extracted from #6307.
1 parent 008d6e9 commit 8a40b52

26 files changed

+248
-391
lines changed

ā€ŽMathlib/Algebra/Category/AlgebraCat/Monoidal.leanā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ noncomputable instance instMonoidalCategory : MonoidalCategory (AlgebraCat.{u} R
8585
leftUnitor_eq := fun X => by
8686
dsimp only [forgetā‚‚_module_obj, forgetā‚‚_module_map, Iso.refl_symm, Iso.trans_hom,
8787
Iso.refl_hom, tensorIso_hom]
88-
simp only [MonoidalCategory.leftUnitor_conjugation, Category.id_comp, Iso.hom_inv_id]
88+
erw [Category.id_comp, MonoidalCategory.tensor_id, Category.id_comp]
8989
rfl
9090
rightUnitor_eq := fun X => by
9191
dsimp

ā€ŽMathlib/CategoryTheory/Bicategory/SingleObj.leanā€Ž

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,6 @@ protected def star : MonoidalSingleObj C :=
6868
PUnit.unit
6969
#align category_theory.monoidal_single_obj.star CategoryTheory.MonoidalSingleObj.star
7070

71-
attribute [local simp] id_tensorHom tensorHom_id in
72-
7371
/-- The monoidal functor from the endomorphisms of the single object
7472
when we promote a monoidal category to a single object bicategory,
7573
to the original monoidal category.

ā€ŽMathlib/CategoryTheory/Closed/Monoidal.leanā€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ def unitClosed : Closed (šŸ™_ C) where
7272
right_inv := by aesop_cat }
7373
homEquiv_naturality_left_symm := fun f g => by
7474
dsimp
75-
rw [leftUnitor_naturality'_assoc]
75+
rw [leftUnitor_naturality_assoc]
7676
-- This used to be automatic before leanprover/lean4#2644
7777
homEquiv_naturality_right := by -- aesop failure
7878
dsimp

ā€ŽMathlib/CategoryTheory/Enriched/Basic.leanā€Ž

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ class EnrichedCategory (C : Type u₁) where
5353
Hom : C → C → V
5454
id (X : C) : šŸ™_ V ⟶ Hom X X
5555
comp (X Y Z : C) : Hom X Y āŠ— Hom Y Z ⟶ Hom X Z
56-
id_comp (X Y : C) : (Ī»_ (Hom X Y)).inv ≫ (id X āŠ— šŸ™ _) ≫ comp X X Y = šŸ™ _ := by aesop_cat
57-
comp_id (X Y : C) : (ρ_ (Hom X Y)).inv ≫ (šŸ™ _ āŠ— id Y) ≫ comp X Y Y = šŸ™ _ := by aesop_cat
58-
assoc (W X Y Z : C) : (α_ _ _ _).inv ≫ (comp W X Y āŠ— šŸ™ _) ≫ comp W Y Z =
59-
(šŸ™ _ āŠ— comp X Y Z) ≫ comp W X Z := by aesop_cat
56+
id_comp (X Y : C) : (Ī»_ (Hom X Y)).inv ≫ id X ā–· _ ≫ comp X X Y = šŸ™ _ := by aesop_cat
57+
comp_id (X Y : C) : (ρ_ (Hom X Y)).inv ≫ _ ◁ id Y ≫ comp X Y Y = šŸ™ _ := by aesop_cat
58+
assoc (W X Y Z : C) : (α_ _ _ _).inv ≫ comp W X Y ā–· _ ≫ comp W Y Z =
59+
_ ◁ comp X Y Z ≫ comp W X Z := by aesop_cat
6060
#align category_theory.enriched_category CategoryTheory.EnrichedCategory
6161

6262
notation X " ⟶[" V "] " Y:10 => (EnrichedCategory.Hom X Y : V)
@@ -78,20 +78,20 @@ def eComp (X Y Z : C) : ((X ⟶[V] Y) āŠ— Y ⟶[V] Z) ⟶ X ⟶[V] Z :=
7878
-- We don't just use `restate_axiom` here; that would leave `V` as an implicit argument.
7979
@[reassoc (attr := simp)]
8080
theorem e_id_comp (X Y : C) :
81-
(Ī»_ (X ⟶[V] Y)).inv ≫ (eId V X āŠ— šŸ™ _) ≫ eComp V X X Y = šŸ™ (X ⟶[V] Y) :=
81+
(Ī»_ (X ⟶[V] Y)).inv ≫ eId V X ā–· _ ≫ eComp V X X Y = šŸ™ (X ⟶[V] Y) :=
8282
EnrichedCategory.id_comp X Y
8383
#align category_theory.e_id_comp CategoryTheory.e_id_comp
8484

8585
@[reassoc (attr := simp)]
8686
theorem e_comp_id (X Y : C) :
87-
(ρ_ (X ⟶[V] Y)).inv ≫ (šŸ™ _ āŠ— eId V Y) ≫ eComp V X Y Y = šŸ™ (X ⟶[V] Y) :=
87+
(ρ_ (X ⟶[V] Y)).inv ≫ _ ◁ eId V Y ≫ eComp V X Y Y = šŸ™ (X ⟶[V] Y) :=
8888
EnrichedCategory.comp_id X Y
8989
#align category_theory.e_comp_id CategoryTheory.e_comp_id
9090

9191
@[reassoc (attr := simp)]
9292
theorem e_assoc (W X Y Z : C) :
93-
(α_ _ _ _).inv ≫ (eComp V W X Y āŠ— šŸ™ _) ≫ eComp V W Y Z =
94-
(šŸ™ _ āŠ— eComp V X Y Z) ≫ eComp V W X Z :=
93+
(α_ _ _ _).inv ≫ eComp V W X Y ā–· _ ≫ eComp V W Y Z =
94+
_ ◁ eComp V X Y Z ≫ eComp V W X Z :=
9595
EnrichedCategory.assoc W X Y Z
9696
#align category_theory.e_assoc CategoryTheory.e_assoc
9797

@@ -114,18 +114,23 @@ instance (F : LaxMonoidalFunctor V W) : EnrichedCategory W (TransportEnrichment
114114
id := fun X : C => F.ε ≫ F.map (eId V X)
115115
comp := fun X Y Z : C => F.μ _ _ ≫ F.map (eComp V X Y Z)
116116
id_comp X Y := by
117-
rw [comp_tensor_id, Category.assoc, ← F.toFunctor.map_id, F.μ_natural_assoc,
118-
F.toFunctor.map_id, F.left_unitality_inv_assoc, ← F.toFunctor.map_comp, ←
119-
F.toFunctor.map_comp, e_id_comp, F.toFunctor.map_id]
117+
simp only [comp_whiskerRight, Category.assoc, LaxMonoidalFunctor.μ_natural_left_assoc,
118+
LaxMonoidalFunctor.left_unitality_inv_assoc]
119+
simp_rw [← F.map_comp]
120+
convert F.map_id _
121+
simp
120122
comp_id X Y := by
121-
rw [id_tensor_comp, Category.assoc, ← F.toFunctor.map_id, F.μ_natural_assoc,
122-
F.toFunctor.map_id, F.right_unitality_inv_assoc, ← F.toFunctor.map_comp, ←
123-
F.toFunctor.map_comp, e_comp_id, F.toFunctor.map_id]
123+
simp only [MonoidalCategory.whiskerLeft_comp, Category.assoc,
124+
LaxMonoidalFunctor.μ_natural_right_assoc,
125+
LaxMonoidalFunctor.right_unitality_inv_assoc]
126+
simp_rw [← F.map_comp]
127+
convert F.map_id _
128+
simp
124129
assoc P Q R S := by
125-
rw [comp_tensor_id, Category.assoc, ← F.toFunctor.map_id, F.μ_natural_assoc,
126-
F.toFunctor.map_id, ← F.associativity_inv_assoc, ← F.toFunctor.map_comp, ←
127-
F.toFunctor.map_comp, e_assoc, id_tensor_comp, Category.assoc, ← F.toFunctor.map_id,
128-
F.μ_natural_assoc, F.toFunctor.map_comp]
130+
rw [comp_whiskerRight, Category.assoc, F.μ_natural_left_assoc,
131+
← F.associativity_inv_assoc, ← F.map_comp, ← F.map_comp, e_assoc,
132+
F.map_comp, MonoidalCategory.whiskerLeft_comp, Category.assoc,
133+
LaxMonoidalFunctor.μ_natural_right_assoc]
129134

130135
end
131136

ā€ŽMathlib/CategoryTheory/Monoidal/Bimod.leanā€Ž

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ theorem one_act_left' : (R.one ā–· _) ≫ actLeft P Q = (Ī»_ _).hom := by
255255
slice_lhs 2 3 => rw [whiskerLeft_Ļ€_actLeft]
256256
slice_lhs 1 2 => rw [associator_inv_naturality_left]
257257
slice_lhs 2 3 => rw [← comp_whiskerRight, one_actLeft]
258-
slice_rhs 1 2 => rw [leftUnitor_naturality']
258+
slice_rhs 1 2 => rw [leftUnitor_naturality]
259259
coherence
260260
set_option linter.uppercaseLean3 false in
261261
#align Bimod.tensor_Bimod.one_act_left' Bimod.TensorBimod.one_act_left'
@@ -668,7 +668,7 @@ theorem hom_inv_id : hom P ≫ inv P = šŸ™ _ := by
668668
dsimp only [hom, inv, TensorBimod.X]
669669
ext; dsimp
670670
slice_lhs 1 2 => rw [coequalizer.Ļ€_desc]
671-
slice_lhs 1 2 => rw [leftUnitor_inv_naturality']
671+
slice_lhs 1 2 => rw [leftUnitor_inv_naturality]
672672
slice_lhs 2 3 => rw [whisker_exchange]
673673
slice_lhs 3 3 => rw [← Iso.inv_hom_id_assoc (α_ R.X R.X P.X) (R.X ◁ P.actLeft)]
674674
slice_lhs 4 6 => rw [← Category.assoc, ← coequalizer.condition]
@@ -736,7 +736,7 @@ theorem hom_inv_id : hom P ≫ inv P = šŸ™ _ := by
736736
dsimp only [hom, inv, TensorBimod.X]
737737
ext; dsimp
738738
slice_lhs 1 2 => rw [coequalizer.Ļ€_desc]
739-
slice_lhs 1 2 => rw [rightUnitor_inv_naturality']
739+
slice_lhs 1 2 => rw [rightUnitor_inv_naturality]
740740
slice_lhs 2 3 => rw [← whisker_exchange]
741741
slice_lhs 3 4 => rw [coequalizer.condition]
742742
slice_lhs 2 3 => rw [associator_naturality_right]
@@ -858,7 +858,7 @@ theorem id_whiskerLeft_bimod {X Y : Mon_ C} {M N : Bimod X Y} (f : M ⟶ N) :
858858
slice_rhs 1 2 => rw [coequalizer.Ļ€_desc]
859859
dsimp [LeftUnitorBimod.inv]
860860
slice_rhs 1 2 => rw [Hom.left_act_hom]
861-
slice_rhs 2 3 => rw [leftUnitor_inv_naturality']
861+
slice_rhs 2 3 => rw [leftUnitor_inv_naturality]
862862
slice_rhs 3 4 => rw [whisker_exchange]
863863
slice_rhs 4 4 => rw [← Iso.inv_hom_id_assoc (α_ X.X X.X N.X) (X.X ◁ N.actLeft)]
864864
slice_rhs 5 7 => rw [← Category.assoc, ← coequalizer.condition]
@@ -918,7 +918,7 @@ theorem whiskerRight_id_bimod {X Y : Mon_ C} {M N : Bimod X Y} (f : M ⟶ N) :
918918
slice_rhs 1 2 => rw [coequalizer.Ļ€_desc]
919919
dsimp [RightUnitorBimod.inv]
920920
slice_rhs 1 2 => rw [Hom.right_act_hom]
921-
slice_rhs 2 3 => rw [rightUnitor_inv_naturality']
921+
slice_rhs 2 3 => rw [rightUnitor_inv_naturality]
922922
slice_rhs 3 4 => rw [← whisker_exchange]
923923
slice_rhs 4 5 => rw [coequalizer.condition]
924924
slice_rhs 3 4 => rw [associator_naturality_right]

ā€ŽMathlib/CategoryTheory/Monoidal/Braided.leanā€Ž

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -206,37 +206,37 @@ def braidedCategoryOfFaithful {C D : Type*} [Category C] [Category D] [MonoidalC
206206
intros
207207
apply F.map_injective
208208
refine (cancel_epi (F.μ ?_ ?_)).1 ?_
209-
rw [Functor.map_comp, ← LaxMonoidalFunctor.μ_natural_left'_assoc, w, Functor.map_comp,
210-
reassoc_of% w, braiding_naturality_left_assoc, LaxMonoidalFunctor.μ_natural_right']
209+
rw [Functor.map_comp, ← LaxMonoidalFunctor.μ_natural_left_assoc, w, Functor.map_comp,
210+
reassoc_of% w, braiding_naturality_left_assoc, LaxMonoidalFunctor.μ_natural_right]
211211
braiding_naturality_right := by
212212
intros
213213
apply F.map_injective
214214
refine (cancel_epi (F.μ ?_ ?_)).1 ?_
215-
rw [Functor.map_comp, ← LaxMonoidalFunctor.μ_natural_right'_assoc, w, Functor.map_comp,
216-
reassoc_of% w, braiding_naturality_right_assoc, LaxMonoidalFunctor.μ_natural_left']
215+
rw [Functor.map_comp, ← LaxMonoidalFunctor.μ_natural_right_assoc, w, Functor.map_comp,
216+
reassoc_of% w, braiding_naturality_right_assoc, LaxMonoidalFunctor.μ_natural_left]
217217
hexagon_forward := by
218218
intros
219219
apply F.map_injective
220220
refine (cancel_epi (F.μ _ _)).1 ?_
221221
refine (cancel_epi (F.μ _ _ ā–· _)).1 ?_
222222
rw [Functor.map_comp, Functor.map_comp, Functor.map_comp, Functor.map_comp, ←
223-
LaxMonoidalFunctor.μ_natural_left'_assoc, ← comp_whiskerRight_assoc, w,
224-
comp_whiskerRight_assoc, LaxMonoidalFunctor.associativity'_assoc,
225-
LaxMonoidalFunctor.associativity'_assoc, ← LaxMonoidalFunctor.μ_natural_right', ←
223+
LaxMonoidalFunctor.μ_natural_left_assoc, ← comp_whiskerRight_assoc, w,
224+
comp_whiskerRight_assoc, LaxMonoidalFunctor.associativity_assoc,
225+
LaxMonoidalFunctor.associativity_assoc, ← LaxMonoidalFunctor.μ_natural_right, ←
226226
MonoidalCategory.whiskerLeft_comp_assoc, w, MonoidalCategory.whiskerLeft_comp_assoc,
227227
reassoc_of% w, braiding_naturality_right_assoc,
228-
LaxMonoidalFunctor.associativity', hexagon_forward_assoc]
228+
LaxMonoidalFunctor.associativity, hexagon_forward_assoc]
229229
hexagon_reverse := by
230230
intros
231231
apply F.toFunctor.map_injective
232232
refine (cancel_epi (F.μ _ _)).1 ?_
233233
refine (cancel_epi (_ ◁ F.μ _ _)).1 ?_
234234
rw [Functor.map_comp, Functor.map_comp, Functor.map_comp, Functor.map_comp, ←
235-
LaxMonoidalFunctor.μ_natural_right'_assoc, ← MonoidalCategory.whiskerLeft_comp_assoc, w,
236-
MonoidalCategory.whiskerLeft_comp_assoc, LaxMonoidalFunctor.associativity_inv'_assoc,
237-
LaxMonoidalFunctor.associativity_inv'_assoc, ← LaxMonoidalFunctor.μ_natural_left',
235+
LaxMonoidalFunctor.μ_natural_right_assoc, ← MonoidalCategory.whiskerLeft_comp_assoc, w,
236+
MonoidalCategory.whiskerLeft_comp_assoc, LaxMonoidalFunctor.associativity_inv_assoc,
237+
LaxMonoidalFunctor.associativity_inv_assoc, ← LaxMonoidalFunctor.μ_natural_left,
238238
← comp_whiskerRight_assoc, w, comp_whiskerRight_assoc, reassoc_of% w,
239-
braiding_naturality_left_assoc, LaxMonoidalFunctor.associativity_inv', hexagon_reverse_assoc]
239+
braiding_naturality_left_assoc, LaxMonoidalFunctor.associativity_inv, hexagon_reverse_assoc]
240240
#align category_theory.braided_category_of_faithful CategoryTheory.braidedCategoryOfFaithful
241241

242242
/-- Pull back a braiding along a fully faithful monoidal functor. -/
@@ -290,7 +290,7 @@ theorem braiding_leftUnitor_auxā‚‚ (X : C) :
290290
_ = (α_ _ _ _).hom ≫ (_ ◁ (Ī»_ _).hom) ≫ (β_ _ _).hom ≫ (β_ X _).inv :=
291291
by (slice_lhs 2 3 => rw [← braiding_naturality_right]); simp only [assoc]
292292
_ = (α_ _ _ _).hom ≫ (_ ◁ (Ī»_ _).hom) := by rw [Iso.hom_inv_id, comp_id]
293-
_ = (ρ_ X).hom ā–· šŸ™_ C := by rw [triangle']
293+
_ = (ρ_ X).hom ā–· šŸ™_ C := by rw [triangle]
294294

295295
#align category_theory.braiding_left_unitor_auxā‚‚ CategoryTheory.braiding_leftUnitor_auxā‚‚
296296

@@ -323,7 +323,7 @@ theorem braiding_rightUnitor_auxā‚‚ (X : C) :
323323
_ = (α_ _ _ _).inv ≫ ((ρ_ _).hom ā–· _) ≫ (β_ _ X).hom ≫ (β_ _ _).inv :=
324324
by (slice_lhs 2 3 => rw [← braiding_naturality_left]); simp only [assoc]
325325
_ = (α_ _ _ _).inv ≫ ((ρ_ _).hom ā–· _) := by rw [Iso.hom_inv_id, comp_id]
326-
_ = šŸ™_ C ◁ (Ī»_ X).hom := by rw [triangle_assoc_comp_right']
326+
_ = šŸ™_ C ◁ (Ī»_ X).hom := by rw [triangle_assoc_comp_right]
327327

328328
#align category_theory.braiding_right_unitor_auxā‚‚ CategoryTheory.braiding_rightUnitor_auxā‚‚
329329

@@ -552,8 +552,6 @@ theorem tensor_μ_natural {X₁ Xā‚‚ Y₁ Yā‚‚ U₁ Uā‚‚ V₁ Vā‚‚ : C} (f₁ :
552552
simp only [assoc]
553553
#align category_theory.tensor_μ_natural CategoryTheory.tensor_μ_natural
554554

555-
attribute [local simp] id_tensorHom tensorHom_id
556-
557555
@[reassoc]
558556
theorem tensor_μ_natural_left {X₁ Xā‚‚ Y₁ Yā‚‚ : C} (f₁: X₁ ⟶ Y₁) (fā‚‚ : Xā‚‚ ⟶ Yā‚‚) (Z₁ Zā‚‚ : C) :
559557
(f₁ āŠ— fā‚‚) ā–· (Z₁ āŠ— Zā‚‚) ≫ tensor_μ C (Y₁, Yā‚‚) (Z₁, Zā‚‚) =
@@ -737,11 +735,10 @@ monoidal opposite, upgraded to a braided functor. -/
737735
@[simps!] def mopBraidedFunctor : BraidedFunctor C Cᓹᵒᵖ where
738736
μ X Y := (β_ (mop X) (mop Y)).hom
739737
ε := šŸ™ (šŸ™_ Cᓹᵒᵖ)
740-
-- `id_tensorHom`, `tensorHom_id` should be simp lemmas when #6307 is merged
741-
-- we could then make this fully automated if we mark `yang_baxter` as simp
738+
-- we could make this fully automated if we mark `← yang_baxter_assoc` as simp
742739
-- should it be marked as such?
743740
associativity X Y Z := by
744-
simp [id_tensorHom, tensorHom_id, ← yang_baxter_assoc]
741+
simp [← yang_baxter_assoc]
745742
__ := mopFunctor C
746743

747744
/-- The identity functor on `C`, viewed as a functor from the
@@ -750,7 +747,7 @@ monoidal opposite of `C` to `C`, upgraded to a braided functor. -/
750747
μ X Y := (β_ (unmop X) (unmop Y)).hom
751748
ε := šŸ™ (šŸ™_ C)
752749
associativity X Y Z := by
753-
simp [id_tensorHom, tensorHom_id, ← yang_baxter_assoc]
750+
simp [← yang_baxter_assoc]
754751
__ := unmopFunctor C
755752

756753
end MonoidalOpposite

0 commit comments

Comments
Ā (0)