Skip to content

Commit db52f09

Browse files
perf(CategoryTheory/Monoidal): change notations for tensor product of (iso)morphisms (#25922)
Discussions in #22698 made apparent that overloading notations was having a performance hit. We obtain a small performance boost simply by changing notation for the tensor product of morphisms in monoidal categories from `⊗` to `⊗ₘ`, and the tensor product of isomorphisms from `⊗` to `⊗ᵢ`. Co-authored-by: Yaël Dillies <[email protected]> Co-authored-by: Yaël Dillies <[email protected]>
1 parent 1f40b9f commit db52f09

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+372
-366
lines changed

Mathlib/Algebra/Category/CoalgCat/ComonEquivalence.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ theorem tensorObj_comul (K L : CoalgCat R) :
134134
rfl
135135

136136
theorem tensorHom_toLinearMap (f : M →ₗc[R] N) (g : P →ₗc[R] Q) :
137-
(CoalgCat.ofHom f ⊗ CoalgCat.ofHom g).1.toLinearMap
137+
(CoalgCat.ofHom f ⊗ CoalgCat.ofHom g).1.toLinearMap
138138
= TensorProduct.map f.toLinearMap g.toLinearMap := rfl
139139

140140
theorem associator_hom_toLinearMap :

Mathlib/Algebra/Category/ModuleCat/Monoidal/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ namespace MonoidalCategory
175175

176176
@[simp]
177177
theorem tensorHom_tmul {K L M N : ModuleCat.{u} R} (f : K ⟶ L) (g : M ⟶ N) (k : K) (m : M) :
178-
(f ⊗ g) (k ⊗ₜ m) = f k ⊗ₜ g m :=
178+
(f ⊗ g) (k ⊗ₜ m) = f k ⊗ₜ g m :=
179179
rfl
180180

181181
@[simp]

Mathlib/Algebra/Category/ModuleCat/Monoidal/Symmetric.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ namespace MonoidalCategory
2828

2929
@[simp]
3030
theorem braiding_naturality {X₁ X₂ Y₁ Y₂ : ModuleCat.{u} R} (f : X₁ ⟶ Y₁) (g : X₂ ⟶ Y₂) :
31-
(f ⊗ g) ≫ (Y₁.braiding Y₂).hom = (X₁.braiding X₂).hom ≫ (g ⊗ f) := by
31+
(f ⊗ g) ≫ (Y₁.braiding Y₂).hom = (X₁.braiding X₂).hom ≫ (g ⊗ f) := by
3232
ext : 1
3333
apply TensorProduct.ext'
3434
intro x y

Mathlib/Algebra/Category/ModuleCat/Presheaf/Monoidal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ lemma tensorObj_map_tmul {X Y : Cᵒᵖ} (f : X ⟶ Y) (m₁ : M₁.obj X) (m₂
7272
/-- The tensor product of two morphisms of presheaves of modules. -/
7373
@[simps]
7474
noncomputable def tensorHom (f : M₁ ⟶ M₂) (g : M₃ ⟶ M₄) : tensorObj M₁ M₃ ⟶ tensorObj M₂ M₄ where
75-
app X := f.app X ⊗ g.app X
75+
app X := f.app X ⊗ g.app X
7676
naturality {X Y} φ := ModuleCat.MonoidalCategory.tensor_ext (fun m₁ m₃ ↦ by
7777
dsimp
7878
rw [tensorObj_map_tmul]

Mathlib/AlgebraicTopology/SimplicialSet/Monoidal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ lemma rightUnitor_inv_app_apply (K : SSet.{u}) {Δ : SimplexCategoryᵒᵖ} (x :
4747
@[simp]
4848
lemma tensorHom_app_apply {K K' L L' : SSet.{u}} (f : K ⟶ K') (g : L ⟶ L')
4949
{Δ : SimplexCategoryᵒᵖ} (x : (K ⊗ L).obj Δ) :
50-
(f ⊗ g).app Δ x = ⟨f.app Δ x.1, g.app Δ x.2⟩ := rfl
50+
(f ⊗ g).app Δ x = ⟨f.app Δ x.1, g.app Δ x.2⟩ := rfl
5151

5252
@[simp]
5353
lemma whiskerLeft_app_apply (K : SSet.{u}) {L L' : SSet.{u}} (g : L ⟶ L')

Mathlib/CategoryTheory/Action/Monoidal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ theorem tensorUnit_ρ {g : G} :
4747

4848
@[simp]
4949
theorem tensor_ρ {X Y : Action V G} {g : G} :
50-
@DFunLike.coe (G →* End (X.V ⊗ Y.V)) _ _ _ (X ⊗ Y).ρ g = X.ρ g ⊗ Y.ρ g :=
50+
@DFunLike.coe (G →* End (X.V ⊗ Y.V)) _ _ _ (X ⊗ Y).ρ g = X.ρ g ⊗ Y.ρ g :=
5151
rfl
5252

5353
/-- Given an object `X` isomorphic to the tensor unit of `V`, `X` equipped with the trivial action

Mathlib/CategoryTheory/Closed/Cartesian.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ theorem uncurry_pre (f : B ⟶ A) [Exponentiable B] (X : C) :
242242

243243
theorem coev_app_comp_pre_app (f : B ⟶ A) [Exponentiable B] :
244244
(exp.coev A).app X ≫ (pre f).app (A ⊗ X) =
245-
(exp.coev B).app X ≫ (exp B).map (f ⊗ 𝟙 _) := by
245+
(exp.coev B).app X ≫ (exp B).map (f ⊗ 𝟙 _) := by
246246
rw [tensorHom_id]
247247
exact unit_conjugateEquiv _ _ ((tensoringLeft _).map f) X
248248

Mathlib/CategoryTheory/Closed/Functor.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ theorem frobeniusMorphism_mate (h : L ⊣ F) (A : C) :
153153
unfold prodComparison
154154
have ηlemma : (h.unit.app (F.obj A ⊗ F.obj B) ≫
155155
lift ((L ⋙ F).map (fst _ _)) ((L ⋙ F).map (snd _ _))) =
156-
(h.unit.app (F.obj A)) ⊗ (h.unit.app (F.obj B)) := by
156+
(h.unit.app (F.obj A)) ⊗ (h.unit.app (F.obj B)) := by
157157
ext <;> simp
158158
slice_lhs 1 2 => rw [ηlemma]
159159
simp only [Functor.id_obj, Functor.comp_obj, assoc, ← whisker_exchange, ← tensorHom_def']

Mathlib/CategoryTheory/Closed/Monoidal.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ lemma curry'_ihom_map {X Y Z : C} [Closed X] (f : X ⟶ Y) (g : Y ⟶ Z) :
496496
simp only [curry', ← curry_natural_right, Category.assoc]
497497

498498
lemma curry'_comp {X Y Z : C} [Closed X] [Closed Y] (f : X ⟶ Y) (g : Y ⟶ Z) :
499-
curry' (f ≫ g) = (λ_ (𝟙_ C)).inv ≫ (curry' f ⊗ curry' g) ≫ comp X Y Z := by
499+
curry' (f ≫ g) = (λ_ (𝟙_ C)).inv ≫ (curry' f ⊗ curry' g) ≫ comp X Y Z := by
500500
rw [tensorHom_def_assoc, whiskerLeft_curry'_comp, MonoidalCategory.whiskerRight_id,
501501
Category.assoc, Category.assoc, Iso.inv_hom_id_assoc, ← unitors_equal,
502502
Iso.inv_hom_id_assoc, curry'_ihom_map]

Mathlib/CategoryTheory/Closed/Zero.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def uniqueHomsetOfInitialIsoUnit [HasInitial C] (i : ⊥_ C ≅ 𝟙_ C) (X Y :
3838
Equiv.unique <|
3939
calc
4040
(X ⟶ Y) ≃ (X ⊗ 𝟙_ C ⟶ Y) := Iso.homCongr (rightUnitor _).symm (Iso.refl _)
41-
_ ≃ (X ⊗ ⊥_ C ⟶ Y) := (Iso.homCongr ((Iso.refl _) ⊗ i.symm) (Iso.refl _))
41+
_ ≃ (X ⊗ ⊥_ C ⟶ Y) := (Iso.homCongr ((Iso.refl _) ⊗ i.symm) (Iso.refl _))
4242
_ ≃ (⊥_ C ⟶ Y ^^ X) := (exp.adjunction _).homEquiv _ _
4343

4444
open scoped ZeroObject

0 commit comments

Comments
 (0)