Skip to content

Commit 17cb523

Browse files
authored
feat: bump to v4.22.0-rc3 (#30)
* feat: bump to v4.21.0-rc3 Main difference: ChosenFiniteProducts is now CartesianMonoidalCategory. * feat: bump to v4.22.0-rc2 * chore: obey unused simp arg linter * chore: bump to Lean v4.22.0-rc3 * chore: banish `by rfl`
1 parent 0f1a598 commit 17cb523

18 files changed

Lines changed: 81 additions & 143 deletions

Poly/Bifunctor/Basic.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,13 @@ scoped [CategoryTheory] infixr:80 " ⋙₂ " => Functor.comp₂
2727
@[simp]
2828
theorem comp_comp₂ {𝒟'' : Type*} [Category 𝒟'']
2929
(F : 𝒟'' ⥤ 𝒟') (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
30-
(F ⋙ G) ⋙₂ P = F ⋙₂ (G ⋙₂ P) := by
31-
rfl
30+
(F ⋙ G) ⋙₂ P = F ⋙₂ (G ⋙₂ P) := rfl
3231

3332
/-- Composition with `F,G` ordered like the arguments of `P` is considered `simp`ler. -/
3433
@[simp]
3534
theorem comp₂_comp {𝒞' : Type*} [Category 𝒞']
3635
(F : 𝒞' ⥤ 𝒞) (G : 𝒟' ⥤ 𝒟) (P : 𝒞 ⥤ 𝒟 ⥤ ℰ) :
37-
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := by
38-
rfl
36+
G ⋙₂ (F ⋙ P) = F ⋙ (G ⋙₂ P) := rfl
3937

4038
@[simps!]
4139
def comp₂_iso {F₁ F₂ : 𝒟' ⥤ 𝒟} {P₁ P₂ : 𝒞 ⥤ 𝒟 ⥤ ℰ}

Poly/ForMathlib/CategoryTheory/Comma/Over/Basic.lean

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ variable {T : Type u₁} [Category.{v₁} T]
1717
namespace Over
1818

1919
@[simp]
20-
theorem mk_eta {X : T} (U : Over X) : mk U.hom = U := by
21-
rfl
20+
theorem mk_eta {X : T} (U : Over X) : mk U.hom = U := rfl
2221

2322
/-- A variant of `homMk_comp` that can trigger in `simp`. -/
2423
@[simp]
@@ -30,8 +29,7 @@ lemma homMk_comp' {X Y Z W : T} (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ W) (fgh_c
3029
@[simp]
3130
lemma homMk_comp'_assoc {X Y Z W : T} (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ W) (fgh_comp) :
3231
homMk (U := mk ((f ≫ g) ≫ h)) (f ≫ g) fgh_comp =
33-
homMk f ≫ homMk (U := mk (g ≫ h)) (V := mk h) g := by
34-
rfl
32+
homMk f ≫ homMk (U := mk (g ≫ h)) (V := mk h) g := rfl
3533

3634
@[simp]
3735
lemma homMk_id {X B : T} (f : X ⟶ B) (h : 𝟙 X ≫ f = f) : homMk (𝟙 X) h = 𝟙 (mk f) :=
@@ -57,8 +55,7 @@ lemma map_left {Y : Over X} {Z Z' : Over (Y.left)} {g : Z ⟶ Z'} :
5755
((Over.map Y.hom).map g).left = g.left := Over.map_map_left
5856

5957
lemma map_homMk_left {Y : Over X} {Z Z' : Over (Y.left)} {g : Z ⟶ Z'} :
60-
map g = (Over.homMk g.left : Sigma Y Z ⟶ Sigma Y Z') := by
61-
rfl
58+
map g = (Over.homMk g.left : Sigma Y Z ⟶ Sigma Y Z') := rfl
6259

6360
/-- The first projection of the sigma object. -/
6461
@[simps!]

Poly/ForMathlib/CategoryTheory/Comma/Over/Pullback.lean

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Sina Hazratpour
55
-/
66
import Mathlib.CategoryTheory.Comma.Over.Pullback
7-
import Mathlib.CategoryTheory.ChosenFiniteProducts
7+
import Mathlib.CategoryTheory.Monoidal.Cartesian.Basic
88
import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic
99
import Mathlib.CategoryTheory.Monad.Products
1010
import Poly.ForMathlib.CategoryTheory.Comma.Over.Basic
@@ -16,7 +16,9 @@ universe v₁ v₂ u₁ u₂
1616

1717
namespace CategoryTheory
1818

19-
open Category Limits Comonad MonoidalCategory
19+
open Category Limits Comonad MonoidalCategory CartesianMonoidalCategory
20+
21+
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
2022

2123
variable {C : Type u₁} [Category.{v₁} C]
2224

@@ -32,8 +34,7 @@ namespace Reindex
3234
variable [HasPullbacks C] {X : C}
3335

3436
lemma hom {Y : Over X} {Z : Over X} :
35-
(Reindex Y Z).hom = pullback.snd Z.hom Y.hom := by
36-
rfl
37+
(Reindex Y Z).hom = pullback.snd Z.hom Y.hom := rfl
3738

3839
/-- `Reindex` is symmetric in its first and second arguments up to an isomorphism. -/
3940
def symmetryObjIso (Y Z : Over X) :
@@ -57,7 +58,7 @@ lemma symmetry_hom {Y Z : Over X} :
5758
def fstProj (Y Z : Over X) : Sigma Y (Reindex Y Z) ⟶ Y :=
5859
Over.homMk (pullback.snd Z.hom Y.hom) (by simp)
5960

60-
lemma fstProj_sigma_fst (Y Z : Over X) : fstProj Y Z = Sigma.fst (Reindex Y Z) := by rfl
61+
lemma fstProj_sigma_fst (Y Z : Over X) : fstProj Y Z = Sigma.fst (Reindex Y Z) := rfl
6162

6263
/-- The second projection out of the reindexed sigma object. -/
6364
def sndProj (Y Z : Over X) : Sigma Y (Reindex Y Z) ⟶ Z :=
@@ -87,7 +88,7 @@ end Reindex
8788

8889
section BinaryProduct
8990

90-
open ChosenFiniteProducts Sigma Reindex
91+
open Sigma Reindex
9192

9293
variable [HasFiniteWidePullbacks C] {X : C}
9394

@@ -106,8 +107,6 @@ def isBinaryProductSigmaReindex (Y Z : Over X) :
106107
· exact congr_arg CommaMorphism.left (h ⟨ .right⟩)
107108
· exact congr_arg CommaMorphism.left (h ⟨ .left ⟩)
108109

109-
attribute [local instance] ChosenFiniteProducts.ofFiniteProducts
110-
111110
/-- The object `(Sigma Y) (Reindex Y Z)` is isomorphic to the binary product `Y × Z`
112111
in `Over X`. -/
113112
@[simps!]
@@ -122,12 +121,12 @@ def sigmaReindexIsoProdMk {Y : C} (f : Y ⟶ X) (Z : Over X) :
122121
sigmaReindexIsoProd (Over.mk f) _
123122

124123
lemma sigmaReindexIsoProd_hom_comp_fst {Y Z : Over X} :
125-
(sigmaReindexIsoProd Y Z).hom ≫ (fst Y Z) = (π_ Y Z) :=
124+
(sigmaReindexIsoProd Y Z).hom ≫ fst Y Z = (π_ Y Z) :=
126125
IsLimit.conePointUniqueUpToIso_hom_comp
127126
(isBinaryProductSigmaReindex Y Z) (Limits.prodIsProd Y Z) ⟨.left⟩
128127

129128
lemma sigmaReindexIsoProd_hom_comp_snd {Y Z : Over X} :
130-
(sigmaReindexIsoProd Y Z).hom ≫ (snd Y Z) = (μ_ Y Z) :=
129+
(sigmaReindexIsoProd Y Z).hom ≫ snd Y Z = (μ_ Y Z) :=
131130
IsLimit.conePointUniqueUpToIso_hom_comp
132131
(isBinaryProductSigmaReindex Y Z) (Limits.prodIsProd Y Z) ⟨.right⟩
133132

@@ -137,10 +136,7 @@ end Over
137136

138137
section TensorLeft
139138

140-
open MonoidalCategory Over Functor ChosenFiniteProducts
141-
142-
attribute [local instance] ChosenFiniteProducts.ofFiniteProducts
143-
attribute [local instance] monoidalOfChosenFiniteProducts
139+
open Over Functor
144140

145141
variable [HasFiniteWidePullbacks C] {X : C}
146142

@@ -150,16 +146,16 @@ def Over.sigmaReindexNatIsoTensorLeft (Y : Over X) :
150146
(pullback Y.hom) ⋙ (map Y.hom) ≅ tensorLeft Y := by
151147
fapply NatIso.ofComponents
152148
· intro Z
153-
simp only [const_obj_obj, Functor.id_obj, comp_obj, tensorLeft_obj, tensorObj, Over.pullback]
149+
simp only [const_obj_obj, Functor.id_obj, comp_obj, Over.pullback]
154150
exact sigmaReindexIsoProd Y Z
155151
· intro Z Z' f
156-
simp
152+
dsimp
157153
ext1 <;> simp_rw [assoc]
158-
· simp_rw [whiskerLeft_fst]
154+
· rw [whiskerLeft_fst]
159155
iterate rw [sigmaReindexIsoProd_hom_comp_fst]
160156
ext
161157
simp
162-
· simp_rw [whiskerLeft_snd]
158+
· rw [whiskerLeft_snd]
163159
iterate rw [sigmaReindexIsoProd_hom_comp_snd, ← assoc, sigmaReindexIsoProd_hom_comp_snd]
164160
ext
165161
simp [Reindex.sndProj]
@@ -187,7 +183,7 @@ def equivOverTerminal [HasTerminal C] : Over (⊤_ C) ≌ C :=
187183

188184
namespace Over
189185

190-
open MonoidalCategory
186+
open CartesianMonoidalCategory
191187

192188
variable {C}
193189

@@ -201,15 +197,14 @@ lemma star_map [HasBinaryProducts C] {X : C} {Y Z : C} (f : Y ⟶ Z) :
201197
instance [HasBinaryProducts C] (X : C) : (forget X).IsLeftAdjoint :=
202198
⟨_, ⟨forgetAdjStar X⟩⟩
203199

204-
attribute [local instance] ChosenFiniteProducts.ofFiniteProducts
205-
attribute [local instance] monoidalOfChosenFiniteProducts
200+
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
206201

207202
lemma whiskerLeftProdMapId [HasFiniteLimits C] {X : C} {A A' : C} {g : A ⟶ A'} :
208203
X ◁ g = prod.map (𝟙 X) g := by
209204
ext
210-
· simp only [ChosenFiniteProducts.whiskerLeft_fst]
205+
· simp only [whiskerLeft_fst]
211206
exact (Category.comp_id _).symm.trans (prod.map_fst (𝟙 X) g).symm
212-
· simp only [ChosenFiniteProducts.whiskerLeft_snd]
207+
· simp only [whiskerLeft_snd]
213208
exact (prod.map_snd (𝟙 X) g).symm
214209

215210
def starForgetIsoTensorLeft [HasFiniteLimits C] (X : C) :

Poly/ForMathlib/CategoryTheory/Comma/Over/Sections.lean

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,49 +21,48 @@ universe v₁ v₂ u₁ u₂
2121

2222
namespace CategoryTheory
2323

24-
open Category Limits MonoidalCategory CartesianClosed Adjunction Over
24+
open Category Limits MonoidalCategory CartesianMonoidalCategory CartesianClosed Adjunction Over
2525

2626
variable {C : Type u₁} [Category.{v₁} C]
2727

2828
attribute [local instance] hasBinaryProducts_of_hasTerminal_and_pullbacks
2929
attribute [local instance] hasFiniteProducts_of_has_binary_and_terminal
30-
attribute [local instance] ChosenFiniteProducts.ofFiniteProducts
31-
attribute [local instance] monoidalOfChosenFiniteProducts
30+
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
3231

3332
section
3433

3534
variable [HasFiniteProducts C]
3635

3736
/-- The isomorphism between `X ⨯ Y` and `X ⊗ Y` for objects `X` and `Y` in `C`.
3837
This is tautological by the definition of the cartesian monoidal structure on `C`.
39-
This isomorphism provides an interface between `prod.fst` and `ChosenFiniteProducts.fst`
38+
This isomorphism provides an interface between `prod.fst` and `CartesianMonoidalCategory.fst`
4039
as well as between `prod.map` and `tensorHom`. -/
4140
def prodIsoTensorObj (X Y : C) : X ⨯ Y ≅ X ⊗ Y := Iso.refl _
4241

4342
@[reassoc (attr := simp)]
4443
theorem prodIsoTensorObj_inv_fst {X Y : C} :
45-
(prodIsoTensorObj X Y).inv ≫ prod.fst = ChosenFiniteProducts.fst X Y :=
44+
(prodIsoTensorObj X Y).inv ≫ prod.fst = fst X Y :=
4645
Category.id_comp _
4746

4847
@[reassoc (attr := simp)]
4948
theorem prodIsoTensorObj_inv_snd {X Y : C} :
50-
(prodIsoTensorObj X Y).inv ≫ prod.snd = ChosenFiniteProducts.snd X Y :=
49+
(prodIsoTensorObj X Y).inv ≫ prod.snd = snd X Y :=
5150
Category.id_comp _
5251

5352
@[reassoc (attr := simp)]
5453
theorem prodIsoTensorObj_hom_fst {X Y : C} :
55-
(prodIsoTensorObj X Y).hom ≫ ChosenFiniteProducts.fst X Y = prod.fst :=
54+
(prodIsoTensorObj X Y).hom ≫ fst X Y = prod.fst :=
5655
Category.id_comp _
5756

5857
@[reassoc (attr := simp)]
5958
theorem prodIsoTensorObj_hom_snd {X Y : C} :
60-
(prodIsoTensorObj X Y).hom ≫ ChosenFiniteProducts.snd X Y = prod.snd :=
59+
(prodIsoTensorObj X Y).hom ≫ snd X Y = prod.snd :=
6160
Category.id_comp _
6261

6362
@[reassoc (attr := simp)]
6463
theorem prodMap_comp_prodIsoTensorObj_hom {X Y Z W : C} (f : X ⟶ Y) (g : Z ⟶ W) :
65-
prod.map f g ≫ (prodIsoTensorObj _ _).hom = (prodIsoTensorObj _ _).hom ≫ (f ⊗ g) := by
66-
apply ChosenFiniteProducts.hom_ext <;> simp
64+
prod.map f g ≫ (prodIsoTensorObj _ _).hom = (prodIsoTensorObj _ _).hom ≫ (f ⊗ g) := by
65+
apply hom_ext <;> simp
6766

6867
end
6968

@@ -73,7 +72,7 @@ variable (I : C) [Exponentiable I]
7372

7473
/-- The first leg of a cospan constructing a pullback diagram in `C` used to define `sections` . -/
7574
def curryId : ⊤_ C ⟶ (I ⟹ I) :=
76-
CartesianClosed.curry (ChosenFiniteProducts.fst I (⊤_ C))
75+
CartesianClosed.curry (fst I (⊤_ C))
7776

7877
variable {I}
7978

Poly/ForMathlib/CategoryTheory/Elements.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ theorem map_homMk_id {X : 𝒞} (a : F.obj X) (eq : F.map (𝟙 X) a = a) :
2222
theorem map_homMk_comp {X Y Z : 𝒞} (f : X ⟶ Y) (g : Y ⟶ Z) (a : F.obj X) eq :
2323
G.map (Y := ⟨Z, F.map g (F.map f a)⟩) (Subtype.mk (α := X ⟶ Z) (f ≫ g) eq) =
2424
G.map (X := ⟨X, a⟩) (Y := ⟨Y, F.map f a⟩) (Subtype.mk (α := X ⟶ Y) f rfl) ≫
25-
G.map (Subtype.mk (α := Y ⟶ Z) g (by rfl)) := by
25+
G.map (Subtype.mk (α := Y ⟶ Z) g (rfl)) := by
2626
set X : F.Elements := ⟨X, a⟩
2727
set Y : F.Elements := ⟨Y, F.map f a⟩
2828
set Z : F.Elements := ⟨Z, F.map g (F.map f a)⟩

Poly/ForMathlib/CategoryTheory/LocallyCartesianClosed/Basic.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,12 @@ universe v u
6262

6363
namespace CategoryTheory
6464

65-
open CategoryTheory Category MonoidalCategory Limits Functor Adjunction Over
65+
open CategoryTheory Category MonoidalCategory CartesianMonoidalCategory Limits Functor Adjunction
66+
Over
6667

6768
variable {C : Type u} [Category.{v} C]
6869

69-
attribute [local instance] ChosenFiniteProducts.ofFiniteProducts
70+
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
7071

7172
/-- A morphism `f : I ⟶ J` is exponentiable if the pullback functor `Over J ⥤ Over I`
7273
has a right adjoint. -/
@@ -223,7 +224,7 @@ end HasPushforwards
223224

224225
namespace CartesianClosedOver
225226

226-
open Over Reindex IsIso ChosenFiniteProducts CartesianClosed HasPushforwards ExponentiableMorphism
227+
open Over Reindex IsIso CartesianClosed HasPushforwards ExponentiableMorphism
227228

228229
variable {C} [HasFiniteWidePullbacks C] {I J : C} [CartesianClosed (Over J)]
229230

Poly/ForMathlib/CategoryTheory/LocallyCartesianClosed/Distributivity.lean

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -129,8 +129,6 @@ def paste : cartesian (pasteCell f u) := by
129129
· unfold pasteCell2
130130
apply cartesian.whiskerRight (cellLeftCartesian f u)
131131

132-
#check pushforwardPullbackTwoSquare
133-
134132
-- use `pushforwardPullbackTwoSquare` to construct this iso.
135133
def pentagonIso : map u ⋙ pushforward f ≅
136134
pullback (e f u) ⋙ pushforward (g f u) ⋙ map (v f u) := by

Poly/ForMathlib/CategoryTheory/LocallyCartesianClosed/Presheaf.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ abbrev Psh (C : Type u) [Category.{v} C] : Type (max u (v + 1)) := Cᵒᵖ ⥤ T
2222

2323
variable {C : Type*} [SmallCategory C] [HasTerminal C]
2424

25-
attribute [local instance] ChosenFiniteProducts.ofFiniteProducts
25+
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
2626

2727
instance cartesianClosedOver {C : Type u} [Category.{max u v} C] (P : Psh C) :
2828
CartesianClosed (Over P) :=

Poly/ForMathlib/CategoryTheory/NatTrans.lean

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ variable {K : Type*} [Category K] {D : Type*} [Category D]
1818

1919
namespace NatTrans
2020

21+
open Functor
22+
2123
/-- A natural transformation is cartesian if every commutative square of the following form is
2224
a pullback.
2325
```

Poly/ForMathlib/CategoryTheory/PartialProduct.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ structure Fan where
5353
snd : pullback fst s ⟶ X
5454

5555
theorem Fan.fst_mk {pt : C} (f : pt ⟶ B) (g : pullback f s ⟶ X) :
56-
Fan.fst (Fan.mk f g) = f := by
57-
rfl
56+
Fan.fst (Fan.mk f g) = f := rfl
5857

5958
variable {s X}
6059

@@ -84,8 +83,7 @@ def pullbackMap {c' c : Fan s X} (f : c'.pt ⟶ c.pt)
8483
((Over.pullback s).map (Over.homMk f (by aesop) : Over.mk (c'.fst) ⟶ Over.mk c.fst)).left
8584

8685
theorem pullbackMap_comparison {P} {c : Fan s X} (f : P ⟶ c.pt) :
87-
pullbackMap (c' := Fan.mk (f ≫ c.fst) (comparison f ≫ c.snd)) (c := c) f = comparison f := by
88-
rfl
86+
pullbackMap (c' := Fan.mk (f ≫ c.fst) (comparison f ≫ c.snd)) (c := c) f = comparison f := rfl
8987

9088
/-- A map to the apex of a partial product cone induces a partial product cone by precomposition. -/
9189
@[simps]

0 commit comments

Comments
 (0)