Skip to content

Commit aee7df5

Browse files
authored
feat: bump to Lean v4.28.0-rc1 (#36)
1 parent 914d9b7 commit aee7df5

12 files changed

Lines changed: 52 additions & 58 deletions

File tree

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

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,6 @@ lemma homMk_comp'_assoc {X Y Z W : T} (f : X ⟶ Y) (g : Y ⟶ Z) (h : Z ⟶ W)
3535
lemma homMk_id {X B : T} (f : X ⟶ B) (h : 𝟙 X ≫ f = f) : homMk (𝟙 X) h = 𝟙 (mk f) :=
3636
rfl
3737

38-
@[simp]
39-
theorem mkIdTerminal_from_left {B : T} (U : Over B) : (mkIdTerminal.from U).left = U.hom := by
40-
simp [mkIdTerminal, CostructuredArrow.mkIdTerminal, Limits.IsTerminal.from, Functor.preimage]
41-
4238
/-- `Over.Sigma Y U` is a shorthand for `(Over.map Y.hom).obj U`.
4339
This is a category-theoretic analogue of `Sigma` for types. -/
4440
abbrev Sigma {X : T} (Y : Over X) (U : Over (Y.left)) : Over X :=

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

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import Mathlib.CategoryTheory.Limits.Constructions.Over.Basic
99
import Mathlib.CategoryTheory.Monad.Products
1010
import Poly.ForMathlib.CategoryTheory.Comma.Over.Basic
1111
import Poly.ForMathlib.CategoryTheory.NatTrans
12-
import Poly.ForMathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq
12+
import Poly.ForMathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
1313

1414
noncomputable section
1515

@@ -19,7 +19,7 @@ namespace CategoryTheory
1919

2020
open Category Limits Comonad MonoidalCategory CartesianMonoidalCategory
2121

22-
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
22+
attribute [local instance] CartesianMonoidalCategory.ofHasFiniteProducts
2323

2424
variable {C : Type u₁} [Category.{v₁} C]
2525

@@ -211,7 +211,7 @@ lemma star_map [HasBinaryProducts C] {X : C} {Y Z : C} (f : Y ⟶ Z) :
211211
instance [HasBinaryProducts C] (X : C) : (forget X).IsLeftAdjoint :=
212212
⟨_, ⟨forgetAdjStar X⟩⟩
213213

214-
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
214+
attribute [local instance] CartesianMonoidalCategory.ofHasFiniteProducts
215215

216216
lemma whiskerLeftProdMapId [HasFiniteLimits C] {X : C} {A A' : C} {g : A ⟶ A'} :
217217
X ◁ g = prod.map (𝟙 X) g := by
@@ -298,12 +298,6 @@ def starIsoToOverTerminal [HasTerminal C] [HasBinaryProducts C] :
298298

299299
variable {C}
300300

301-
/-- A natural isomorphism between the functors `star X` and `star Y ⋙ pullback f`
302-
for any morphism `f : X ⟶ Y`. -/
303-
def starPullbackIsoStar [HasBinaryProducts C] [HasPullbacks C] {X Y : C} (f : X ⟶ Y) :
304-
star Y ⋙ pullback f ≅ star X :=
305-
conjugateIsoEquiv ((mapPullbackAdj f).comp (forgetAdjStar Y)) (forgetAdjStar X) (mapForget f)
306-
307301
/-- The functor `Over.pullback f : Over Y ⥤ Over X` is naturally isomorphic to
308302
`Over.star : Over Y ⥤ Over (Over.mk f)` post-composed with the
309303
iterated slice equivlanece `Over (Over.mk f) ⥤ Over X`. -/

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

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variable {C : Type u₁} [Category.{v₁} C]
2828

2929
attribute [local instance] hasBinaryProducts_of_hasTerminal_and_pullbacks
3030
attribute [local instance] hasFiniteProducts_of_has_binary_and_terminal
31-
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
31+
attribute [local instance] CartesianMonoidalCategory.ofHasFiniteProducts
3232

3333
section
3434

@@ -69,11 +69,11 @@ end
6969

7070
variable [HasTerminal C] [HasPullbacks C]
7171

72-
variable (I : C) [Exponentiable I]
72+
variable (I : C) [Closed I]
7373

7474
/-- The first leg of a cospan constructing a pullback diagram in `C` used to define `sections` . -/
7575
def curryId : ⊤_ C ⟶ (I ⟹ I) :=
76-
CartesianClosed.curry (fst I (⊤_ C))
76+
MonoidalClosed.curry (fst I (⊤_ C))
7777

7878
variable {I}
7979

@@ -90,14 +90,14 @@ pullback diagram:
9090
⊤_ C ----> I ⟹ I
9191
```-/
9292
abbrev sectionsObj (X : Over I) : C :=
93-
Limits.pullback (curryId I) ((exp I).map X.hom)
93+
Limits.pullback (curryId I) ((ihom I).map X.hom)
9494

9595
/-- The functoriality of `sectionsObj`. -/
9696
def sectionsMap {X X' : Over I} (u : X ⟶ X') :
9797
sectionsObj X ⟶ sectionsObj X' := by
9898
fapply pullback.map
9999
· exact 𝟙 _
100-
· exact (exp I).map u.left
100+
· exact (ihom I).map u.left
101101
· exact 𝟙 _
102102
· simp only [comp_id, id_comp]
103103
· simp only [comp_id, ← Functor.map_comp, w]
@@ -130,29 +130,30 @@ variable {I}
130130
in `C`. See `sectionsCurry`. -/
131131
def sectionsCurryAux {X : Over I} {A : C} (u : (star I).obj A ⟶ X) :
132132
A ⟶ (I ⟹ X.left) :=
133-
CartesianClosed.curry (u.left)
133+
MonoidalClosed.curry (u.left)
134134

135135
/-- The currying operation `Hom ((star I).obj A) X → Hom A (I ⟹ X.left)`. -/
136136
def sectionsCurry {X : Over I} {A : C} (u : (star I).obj A ⟶ X) :
137137
A ⟶ (sections I).obj X := by
138138
apply pullback.lift (terminal.from A)
139-
(CartesianClosed.curry ((prodIsoTensorObj _ _).inv ≫ u.left)) (uncurry_injective _)
140-
rw [uncurry_natural_left]
141-
simp [curryId, uncurry_natural_right, uncurry_curry]
139+
(MonoidalClosed.curry ((prodIsoTensorObj _ _).inv ≫ u.left))
140+
(MonoidalClosed.uncurry_injective _)
141+
rw [MonoidalClosed.uncurry_natural_left]
142+
simp [curryId, MonoidalClosed.uncurry_natural_right, MonoidalClosed.uncurry_curry]
142143

143144
/-- The uncurrying operation `Hom A (section X) → Hom ((star I).obj A) X`. -/
144145
def sectionsUncurry {X : Over I} {A : C} (v : A ⟶ (sections I).obj X) :
145146
(star I).obj A ⟶ X := by
146147
let v₂ : A ⟶ (I ⟹ X.left) := v ≫ pullback.snd ..
147-
have w : terminal.from A ≫ (curryId I) = v₂ ≫ (exp I).map X.hom := by
148+
have w : terminal.from A ≫ (curryId I) = v₂ ≫ (ihom I).map X.hom := by
148149
rw [IsTerminal.hom_ext terminalIsTerminal (terminal.from A ) (v ≫ (pullback.fst ..))]
149150
simp [v₂, pullback.condition]
150151
dsimp [curryId] at w
151152
have w' := homEquiv_naturality_right_square (F := MonoidalCategory.tensorLeft I)
152-
(adj := exp.adjunction I) _ _ _ _ w
153-
simp [CartesianClosed.curry] at w'
154-
refine Over.homMk ((prodIsoTensorObj I A).hom ≫ CartesianClosed.uncurry v₂) ?_
155-
· dsimp [CartesianClosed.uncurry] at *
153+
(adj := ihom.adjunction I) _ _ _ _ w
154+
simp [MonoidalClosed.curry] at w'
155+
refine Over.homMk ((prodIsoTensorObj I A).hom ≫ MonoidalClosed.uncurry v₂) ?_
156+
· dsimp [MonoidalClosed.uncurry] at *
156157
rw [Category.assoc, ← w']
157158
simp [star_obj_hom]
158159

@@ -188,13 +189,13 @@ def coreHomEquiv : CoreHomEquiv (star I) (sections I) where
188189
simp only [star_map]
189190
rw [← Over.homMk_comp] -- note: in a newer version of mathlib this is `Over.homMk_eta`
190191
congr 1
191-
simp [CartesianClosed.uncurry_natural_left]
192+
simp [MonoidalClosed.uncurry_natural_left]
192193
homEquiv_naturality_right := by
193194
intro A X' X u g
194195
dsimp [sectionsCurry, sectionsUncurry, curryId]
195196
apply pullback.hom_ext (IsTerminal.hom_ext terminalIsTerminal _ _)
196197
simp [sectionsMap, curryId]
197-
rw [← CartesianClosed.curry_natural_right, Category.assoc]
198+
rw [← MonoidalClosed.curry_natural_right, Category.assoc]
198199

199200
variable (I)
200201

Poly/ForMathlib/CategoryTheory/Limits/Shapes/Pullback/CommSq.lean renamed to Poly/ForMathlib/CategoryTheory/Limits/Shapes/Pullback/IsPullback/Basic.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2025 Wojciech Nawrocki. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Wojciech Nawrocki
55
-/
6-
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq
6+
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
77
import Poly.ForMathlib.CategoryTheory.CommSq
88

99
namespace CategoryTheory.Functor

Poly/ForMathlib/CategoryTheory/LocallyCartesianClosed/Basic.lean

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ open CategoryTheory Category MonoidalCategory CartesianMonoidalCategory Limits F
6767

6868
variable {C : Type u} [Category.{v} C]
6969

70-
attribute [local instance] CartesianMonoidalCategory.ofFiniteProducts
70+
attribute [local instance] CartesianMonoidalCategory.ofHasFiniteProducts
7171

7272
/-- A morphism `f : I ⟶ J` is exponentiable if the pullback functor `Over J ⥤ Over I`
7373
has a right adjoint. -/
@@ -179,7 +179,7 @@ instance isMultiplicative : (ExponentiableMorphism (C:= C)).IsMultiplicative whe
179179
/-- A morphism with a pushforward is an exponentiable object in the slice category. -/
180180
def exponentiableOverMk [HasFiniteWidePullbacks C] {X I : C} (f : X ⟶ I)
181181
[ExponentiableMorphism f] :
182-
Exponentiable (Over.mk f) where
182+
Closed (Over.mk f) where
183183
rightAdj := pullback f ⋙ pushforward f
184184
adj := by
185185
apply ofNatIsoLeft _ _
@@ -192,7 +192,7 @@ morphism `X.hom`.
192192
Here the pushforward functor along a morphism `f : I ⟶ J` is defined using the section functor
193193
`Over (Over.mk f) ⥤ Over J`.
194194
-/
195-
def ofOverExponentiable [HasFiniteWidePullbacks C] {I : C} (X : Over I) [Exponentiable X] :
195+
def ofOverExponentiable [HasFiniteWidePullbacks C] {I : C} (X : Over I) [Closed X] :
196196
ExponentiableMorphism X.hom :=
197197
⟨X.iteratedSliceEquiv.inverse ⋙ sections X, ⟨by
198198
refine ofNatIsoLeft (Adjunction.comp ?_ ?_) (starIteratedSliceForwardIsoPullback X.hom)
@@ -217,7 +217,7 @@ variable {C} [HasFiniteWidePullbacks C] [HasPushforwards C]
217217
/-- In a category where pushforwards exists along all morphisms, every slice category `Over I` is
218218
cartesian closed. -/
219219
instance cartesianClosedOver (I : C) :
220-
CartesianClosed (Over I) where
220+
MonoidalClosed (Over I) where
221221
closed X := @exponentiableOverMk _ _ _ _ _ _ X.hom (HasPushforwards.exponentiable X.hom)
222222

223223
end HasPushforwards
@@ -226,13 +226,13 @@ namespace CartesianClosedOver
226226

227227
open Over Reindex IsIso CartesianClosed HasPushforwards ExponentiableMorphism
228228

229-
variable {C} [HasFiniteWidePullbacks C] {I J : C} [CartesianClosed (Over J)]
229+
variable {C} [HasFiniteWidePullbacks C] {I J : C} [MonoidalClosed (Over J)]
230230

231231
instance (f : I ⟶ J) : ExponentiableMorphism f :=
232232
ExponentiableMorphism.ofOverExponentiable (Over.mk f)
233233

234234
/-- A category with cartesian closed slices has pushforwards along all morphisms. -/
235-
instance hasPushforwards [Π (I : C), CartesianClosed (Over I)] : HasPushforwards C where
235+
instance hasPushforwards [Π (I : C), MonoidalClosed (Over I)] : HasPushforwards C where
236236
exponentiable f := ExponentiableMorphism.ofOverExponentiable (Over.mk f)
237237

238238
end CartesianClosedOver
@@ -242,7 +242,7 @@ is exponentiable and all the slices are cartesian closed. -/
242242
class LocallyCartesianClosed [HasFiniteWidePullbacks C] extends
243243
HasPushforwards C where
244244
/-- every slice category `Over I` is cartesian closed. This is filled in by default. -/
245-
cartesianClosedOver : Π (I : C), CartesianClosed (Over I) := HasPushforwards.cartesianClosedOver
245+
cartesianClosedOver : Π (I : C), MonoidalClosed (Over I) := HasPushforwards.cartesianClosedOver
246246

247247
namespace LocallyCartesianClosed
248248

@@ -256,7 +256,7 @@ attribute [scoped instance] hasFiniteLimits_of_hasTerminal_and_pullbacks
256256
instance mkOfHasPushforwards [HasPushforwards C] : LocallyCartesianClosed C where
257257

258258
/-- A category with cartesian closed slices is locally cartesian closed. -/
259-
instance mkOfCartesianClosedOver [Π (I : C), CartesianClosed (Over I)] :
259+
instance mkOfCartesianClosedOver [Π (I : C), MonoidalClosed (Over I)] :
260260
LocallyCartesianClosed C where
261261

262262
variable [LocallyCartesianClosed C]
@@ -282,15 +282,16 @@ abbrev ev' {I : C} (X : Over I) (Y : Over X.left) : Reindex X (Pi X Y) ⟶ Y :=
282282
adj X.hom |>.counit.app Y
283283

284284
/-- A locally cartesian closed category with a terminal object is cartesian closed. -/
285-
def cartesianClosed [HasTerminal C] :
286-
CartesianClosed C := cartesianClosedOfEquiv <| equivOverTerminal C
285+
def monoidalClosed [HasTerminal C] :
286+
MonoidalClosed C := cartesianClosedOfEquiv <| equivOverTerminal C
287287

288288
/-- The slices of a locally cartesian closed category are locally cartesian closed. -/
289289
def overLocallyCartesianClosed (I : C) : LocallyCartesianClosed (Over I) := by
290290
apply (config := { allowSynthFailures:= true}) mkOfCartesianClosedOver
291291
intro X
292292
exact cartesianClosedOfEquiv (C := Over (X.left)) X.iteratedSliceEquiv.symm
293293

294+
open CartesianClosed in
294295
/-- The exponential `X^^A` in the slice category `Over I` is isomorphic to the pushforward of the
295296
pullback of `X` along `A`. -/
296297
def expIso {I : C} (A X : Over I) : Pi A (Reindex A X) ≅ A ⟹ X := Iso.refl _

Poly/ForMathlib/CategoryTheory/LocallyCartesianClosed/BeckChevalley.lean

Lines changed: 1 addition & 1 deletion
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, Emily Riehl
55
-/
66
import Poly.ForMathlib.CategoryTheory.LocallyCartesianClosed.Basic
7-
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq
7+
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
88

99
/-!
1010
# Beck-Chevalley natural transformations and natural isomorphisms

Poly/ForMathlib/CategoryTheory/LocallyCartesianClosed/Presheaf.lean

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,10 @@ 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] CartesianMonoidalCategory.ofFiniteProducts
25+
attribute [local instance] CartesianMonoidalCategory.ofHasFiniteProducts
2626

27-
instance cartesianClosedOver {C : Type u} [Category.{max u v} C] (P : Psh C) :
28-
CartesianClosed (Over P) :=
27+
instance monoidalClosedOver {C : Type u} [Category.{max u v} C] (P : Psh C) :
28+
MonoidalClosed (Over P) :=
2929
cartesianClosedOfEquiv (overEquivPresheafCostructuredArrow P).symm
3030

3131
instance locallyCartesianClosed : LocallyCartesianClosed (Psh C) := by

Poly/ForMathlib/CategoryTheory/NatTrans.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Authors: Sina Hazratpour
66

77
import Mathlib.CategoryTheory.NatTrans
88
import Mathlib.CategoryTheory.Functor.TwoSquare
9-
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq
9+
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
1010

1111
open CategoryTheory Limits IsPullback
1212

Poly/ForMathlib/CategoryTheory/PartialProduct.lean

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Copyright (c) 2025 Sina Hazratpour. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Sina Hazratpour
55
-/
6-
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.CommSq
6+
import Mathlib.CategoryTheory.Limits.Shapes.Pullback.IsPullback.Basic
77
import Mathlib.CategoryTheory.Comma.Over.Pullback
88
import Poly.ForMathlib.CategoryTheory.Comma.Over.Pullback
99
import Mathlib.CategoryTheory.Monoidal.Closed.Cartesian
@@ -100,6 +100,8 @@ structure Fan.Hom (c c' : Fan s X) where
100100

101101
attribute [reassoc (attr := simp)] Fan.Hom.w_left Fan.Hom.w_right
102102

103+
-- TODO: this is taking ages to check since 4.28.0-rc1.
104+
set_option maxHeartbeats 0 in
103105
@[simps]
104106
instance : Category (Fan s X) where
105107
Hom := Fan.Hom

Poly/Type/Univariate.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ def Obj.iget [DecidableEq P.B] {X} [Inhabited X] (x : P X) (i : P.Total) : X :=
189189
@[simp]
190190
theorem iget_map [DecidableEq P.B] [Inhabited X] [Inhabited Y] (x : P X)
191191
(f : X → Y) (i : P.Total) (h : i.1 = x.1) : (P.map f x).iget i = f (x.iget i) := by
192-
simp only [Obj.iget, fst_map, *, dif_pos, eq_self_iff_true]
192+
simp only [Obj.iget, fst_map, *, dif_pos]
193193
cases x
194194
rfl
195195

0 commit comments

Comments
 (0)