Skip to content

Commit 19f3ff9

Browse files
committed
chore: deprecate monoidalOfHasFiniteProducts (#30684)
Over the summer, this was replaced everywhere with `CartesianMonoidalCategory.ofHasFiniteProducts`, but hadn't been deprecated.
1 parent 2628d8c commit 19f3ff9

File tree

1 file changed

+92
-92
lines changed

1 file changed

+92
-92
lines changed

Mathlib/CategoryTheory/Monoidal/OfHasFiniteProducts.lean

Lines changed: 92 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2019 Kim Morrison. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Kim Morrison, Simon Hudon
55
-/
6-
import Mathlib.CategoryTheory.Monoidal.Braided.Basic
6+
import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic
77
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.BinaryProducts
88
import Mathlib.CategoryTheory.Limits.Preserves.Shapes.Terminal
99

@@ -21,8 +21,8 @@ we don't set up either construct as an instance.
2121
2222
## TODO
2323
24-
Replace `monoidalOfHasFiniteProducts` and `symmetricOfHasFiniteProducts`
25-
with `CartesianMonoidalCategory.ofHasFiniteProducts`.
24+
Once we have cocartesian-monoidal categories, replace `monoidalOfHasFiniteCoproducts` and
25+
`symmetricOfHasFiniteCoproducts` with `CocartesianMonoidalCategory.ofHasFiniteCoproducts`.
2626
-/
2727

2828

@@ -39,21 +39,11 @@ open CategoryTheory.Limits
3939
section
4040

4141
/-- A category with a terminal object and binary products has a natural monoidal structure. -/
42+
@[deprecated CartesianMonoidalCategory.ofHasFiniteProducts (since := "2025-10-19")]
4243
def monoidalOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : MonoidalCategory C :=
43-
letI : MonoidalCategoryStruct C := {
44-
tensorObj := fun X Y ↦ X ⨯ Y
45-
whiskerLeft := fun _ _ _ g ↦ Limits.prod.map (𝟙 _) g
46-
whiskerRight := fun {_ _} f _ ↦ Limits.prod.map f (𝟙 _)
47-
tensorHom := fun f g ↦ Limits.prod.map f g
48-
tensorUnit := ⊤_ C
49-
associator := prod.associator
50-
leftUnitor := fun P ↦ Limits.prod.leftUnitor P
51-
rightUnitor := fun P ↦ Limits.prod.rightUnitor P
52-
}
53-
.ofTensorHom
54-
(pentagon := prod.pentagon)
55-
(triangle := prod.triangle)
56-
(associator_naturality := @prod.associator_naturality _ _ _)
44+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
45+
let +nondep : CartesianMonoidalCategory C := .ofHasFiniteProducts
46+
inferInstance
5747

5848
end
5949

@@ -65,76 +55,72 @@ attribute [local instance] monoidalOfHasFiniteProducts
6555

6656
open scoped MonoidalCategory
6757

68-
@[ext] theorem unit_ext {X : C} (f g : X ⟶ 𝟙_ C) : f = g := terminal.hom_ext f g
58+
@[deprecated CartesianMonoidalCategory.toUnit_unique (since := "2025-10-19")]
59+
theorem unit_ext {X : C} (f g : X ⟶ 𝟙_ C) : f = g := terminal.hom_ext f g
6960

70-
@[ext] theorem tensor_ext {X Y Z : C} (f g : X ⟶ Y ⊗ Z)
61+
@[deprecated CartesianMonoidalCategory.hom_ext (since := "2025-10-19")]
62+
theorem tensor_ext {X Y Z : C} (f g : X ⟶ Y ⊗ Z)
7163
(w₁ : f ≫ prod.fst = g ≫ prod.fst) (w₂ : f ≫ prod.snd = g ≫ prod.snd) : f = g :=
7264
Limits.prod.hom_ext w₁ w₂
7365

74-
@[simp] theorem tensorUnit : 𝟙_ C = ⊤_ C := rfl
66+
@[deprecated "This is an implementation detail." (since := "2025-10-19"), simp]
67+
theorem tensorUnit : 𝟙_ C = ⊤_ C := rfl
7568

76-
@[simp]
69+
@[deprecated "This is an implementation detail." (since := "2025-10-19"), simp]
7770
theorem tensorObj (X Y : C) : X ⊗ Y = (X ⨯ Y) :=
7871
rfl
7972

80-
@[simp]
81-
theorem tensorHom {W X Y Z : C} (f : W ⟶ X) (g : Y ⟶ Z) : f ⊗ₘ g = Limits.prod.map f g :=
82-
rfl
83-
84-
@[simp]
85-
theorem whiskerLeft (X : C) {Y Z : C} (f : Y ⟶ Z) : X ◁ f = Limits.prod.map (𝟙 X) f :=
86-
rfl
87-
88-
@[simp]
89-
theorem whiskerRight {X Y : C} (f : X ⟶ Y) (Z : C) : f ▷ Z = Limits.prod.map f (𝟙 Z) :=
90-
rfl
91-
92-
@[simp]
73+
@[deprecated CartesianMonoidalCategory.leftUnitor_hom (since := "2025-10-19"), simp]
9374
theorem leftUnitor_hom (X : C) : (λ_ X).hom = Limits.prod.snd :=
9475
rfl
9576

96-
@[simp]
97-
theorem leftUnitor_inv (X : C) : (λ_ X).inv = prod.lift (terminal.from X) (𝟙 _) :=
98-
rfl
99-
100-
@[simp]
77+
@[deprecated CartesianMonoidalCategory.rightUnitor_hom (since := "2025-10-19"), simp]
10178
theorem rightUnitor_hom (X : C) : (ρ_ X).hom = Limits.prod.fst :=
10279
rfl
10380

104-
@[simp]
105-
theorem rightUnitor_inv (X : C) : (ρ_ X).inv = prod.lift (𝟙 _) (terminal.from X) :=
106-
rfl
107-
108-
-- We don't mark this as a simp lemma, even though in many particular
109-
-- categories the right-hand side will simplify significantly further.
110-
-- For now, we'll plan to create specialised simp lemmas in each particular category.
81+
@[deprecated "Use the `CartesianMonoidalCategory.associator_hom_...` lemmas"
82+
(since := "2025-10-19"), simp]
11183
theorem associator_hom (X Y Z : C) :
11284
(α_ X Y Z).hom =
11385
prod.lift (Limits.prod.fst ≫ Limits.prod.fst)
11486
(prod.lift (Limits.prod.fst ≫ Limits.prod.snd) Limits.prod.snd) :=
11587
rfl
11688

89+
@[deprecated "Use the `CartesianMonoidalCategory.associator_inv_...` lemmas"
90+
(since := "2025-10-19")]
11791
theorem associator_inv (X Y Z : C) :
11892
(α_ X Y Z).inv =
11993
prod.lift (prod.lift prod.fst (prod.snd ≫ prod.fst)) (prod.snd ≫ prod.snd) :=
12094
rfl
12195

122-
@[reassoc] theorem associator_hom_fst (X Y Z : C) :
96+
set_option linter.deprecated false in
97+
@[deprecated CartesianMonoidalCategory.associator_hom_fst (since := "2025-10-19")]
98+
theorem associator_hom_fst (X Y Z : C) :
12399
(α_ X Y Z).hom ≫ prod.fst = prod.fst ≫ prod.fst := by simp [associator_hom]
124100

125-
@[reassoc] theorem associator_hom_snd_fst (X Y Z : C) :
101+
set_option linter.deprecated false in
102+
@[deprecated CartesianMonoidalCategory.associator_hom_snd_fst (since := "2025-10-19")]
103+
theorem associator_hom_snd_fst (X Y Z : C) :
126104
(α_ X Y Z).hom ≫ prod.snd ≫ prod.fst = prod.fst ≫ prod.snd := by simp [associator_hom]
127105

128-
@[reassoc] theorem associator_hom_snd_snd (X Y Z : C) :
106+
set_option linter.deprecated false in
107+
@[deprecated CartesianMonoidalCategory.associator_hom_snd_snd (since := "2025-10-19")]
108+
theorem associator_hom_snd_snd (X Y Z : C) :
129109
(α_ X Y Z).hom ≫ prod.snd ≫ prod.snd = prod.snd := by simp [associator_hom]
130110

131-
@[reassoc] theorem associator_inv_fst_fst (X Y Z : C) :
111+
set_option linter.deprecated false in
112+
@[deprecated CartesianMonoidalCategory.associator_inv_fst_fst (since := "2025-10-19")]
113+
theorem associator_inv_fst_fst (X Y Z : C) :
132114
(α_ X Y Z).inv ≫ prod.fst ≫ prod.fst = prod.fst := by simp [associator_inv]
133115

134-
@[reassoc] theorem associator_inv_fst_snd (X Y Z : C) :
116+
set_option linter.deprecated false in
117+
@[deprecated CartesianMonoidalCategory.associator_inv_fst_snd (since := "2025-10-19")]
118+
theorem associator_inv_fst_snd (X Y Z : C) :
135119
(α_ X Y Z).inv ≫ prod.fst ≫ prod.snd = prod.snd ≫ prod.fst := by simp [associator_inv]
136120

137-
@[reassoc] theorem associator_inv_snd (X Y Z : C) :
121+
set_option linter.deprecated false in
122+
@[deprecated CartesianMonoidalCategory.associator_inv_snd (since := "2025-10-19")]
123+
theorem associator_inv_snd (X Y Z : C) :
138124
(α_ X Y Z).inv ≫ prod.snd = prod.snd ≫ prod.snd := by simp [associator_inv]
139125

140126
end monoidalOfHasFiniteProducts
@@ -145,16 +131,15 @@ attribute [local instance] monoidalOfHasFiniteProducts
145131

146132
open MonoidalCategory
147133

134+
set_option linter.deprecated false in
148135
/-- The monoidal structure coming from finite products is symmetric.
149136
-/
150-
@[simps]
151-
def symmetricOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : SymmetricCategory C where
152-
braiding X Y := Limits.prod.braiding X Y
153-
braiding_naturality_left f X := by simp
154-
braiding_naturality_right X _ _ f := by simp
155-
hexagon_forward X Y Z := by dsimp [monoidalOfHasFiniteProducts.associator_hom]; simp
156-
hexagon_reverse X Y Z := by dsimp [monoidalOfHasFiniteProducts.associator_inv]; simp
157-
symmetry X Y := by simp
137+
@[deprecated CartesianMonoidalCategory.toSymmetricCategory (since := "2025-10-19"), simps!]
138+
def symmetricOfHasFiniteProducts [HasTerminal C] [HasBinaryProducts C] : SymmetricCategory C :=
139+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
140+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
141+
let +nondep : BraidedCategory C := .ofCartesianMonoidalCategory
142+
inferInstance
158143

159144
end
160145

@@ -256,54 +241,69 @@ end
256241

257242
namespace monoidalOfHasFiniteProducts
258243

259-
attribute [local instance] monoidalOfHasFiniteProducts
260-
261244
variable {C}
262245
variable {D : Type*} [Category D] (F : C ⥤ D)
263246
[HasTerminal C] [HasBinaryProducts C]
264247
[HasTerminal D] [HasBinaryProducts D]
265248

249+
set_option linter.deprecated false in
266250
attribute [local simp] associator_hom_fst
267-
instance : F.OplaxMonoidal where
268-
η := terminalComparison F
269-
δ X Y := prodComparison F X Y
270-
δ_natural_left _ _ := by simp [prodComparison_natural]
271-
δ_natural_right _ _ := by simp [prodComparison_natural]
272-
oplax_associativity _ _ _ := by
273-
dsimp
274-
ext
275-
· dsimp
276-
simp only [Category.assoc, prod.map_fst, Category.comp_id, prodComparison_fst, ←
277-
Functor.map_comp]
278-
erw [associator_hom_fst, associator_hom_fst]
279-
simp
280-
· dsimp
281-
simp only [Category.assoc, prod.map_snd, prodComparison_snd_assoc, prodComparison_fst,
282-
← Functor.map_comp]
283-
erw [associator_hom_snd_fst, associator_hom_snd_fst]
284-
simp
285-
· dsimp
286-
simp only [Category.assoc, prod.map_snd, prodComparison_snd_assoc, prodComparison_snd, ←
287-
Functor.map_comp]
288-
erw [associator_hom_snd_snd, associator_hom_snd_snd]
289-
simp
290-
oplax_left_unitality _ := by ext; simp [← Functor.map_comp]
291-
oplax_right_unitality _ := by ext; simp [← Functor.map_comp]
251+
@[deprecated Functor.OplaxMonoidal.ofChosenFiniteProducts (since := "2025-10-19")]
252+
instance :
253+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
254+
have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal
255+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
256+
let : CartesianMonoidalCategory D := .ofHasFiniteProducts
257+
F.OplaxMonoidal := by extract_lets; exact .ofChosenFiniteProducts F
292258

293259
open Functor.OplaxMonoidal
294260

295-
lemma η_eq : η F = terminalComparison F := rfl
296-
lemma δ_eq (X Y : C) : δ F X Y = prodComparison F X Y := rfl
261+
@[deprecated "No replacement" (since := "2025-10-19")]
262+
lemma η_eq :
263+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
264+
have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal
265+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
266+
let : CartesianMonoidalCategory D := .ofHasFiniteProducts
267+
η F = terminalComparison F := rfl
268+
269+
@[deprecated "No replacement" (since := "2025-10-19")]
270+
lemma δ_eq (X Y : C) :
271+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
272+
have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal
273+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
274+
let : CartesianMonoidalCategory D := .ofHasFiniteProducts
275+
δ F X Y = prodComparison F X Y := rfl
297276

298277
variable [PreservesLimit (Functor.empty.{0} C) F]
299278
[PreservesLimitsOfShape (Discrete WalkingPair) F]
300279

301-
instance : IsIso (η F) := by dsimp [η_eq]; infer_instance
302-
instance (X Y : C) : IsIso (δ F X Y) := by dsimp [δ_eq]; infer_instance
280+
set_option linter.deprecated false in
281+
@[deprecated inferInstance (since := "2025-10-19")]
282+
instance :
283+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
284+
have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal
285+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
286+
let : CartesianMonoidalCategory D := .ofHasFiniteProducts
287+
IsIso (η F) := by dsimp [η_eq]; infer_instance
288+
289+
set_option linter.deprecated false in
290+
@[deprecated inferInstance (since := "2025-10-19")]
291+
instance (X Y : C) :
292+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
293+
have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal
294+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
295+
let : CartesianMonoidalCategory D := .ofHasFiniteProducts
296+
IsIso (δ F X Y) := by dsimp [δ_eq]; infer_instance
303297

304298
/-- Promote a functor that preserves finite products to a monoidal functor between
305299
categories equipped with the monoidal category structure given by finite products. -/
306-
instance : F.Monoidal := .ofOplaxMonoidal F
300+
@[deprecated Functor.Monoidal.ofChosenFiniteProducts (since := "2025-10-19")]
301+
instance :
302+
have : HasFiniteProducts C := hasFiniteProducts_of_has_binary_and_terminal
303+
have : HasFiniteProducts D := hasFiniteProducts_of_has_binary_and_terminal
304+
let : CartesianMonoidalCategory C := .ofHasFiniteProducts
305+
let : CartesianMonoidalCategory D := .ofHasFiniteProducts
306+
F.Monoidal := by extract_lets; exact .ofOplaxMonoidal F
307307

308308
end monoidalOfHasFiniteProducts
309309

0 commit comments

Comments
 (0)