Skip to content

Commit 630d515

Browse files
committed
chore(CategoryTheory): fix hasLimitOfIso (#22514)
`hasLimitOfIso` is renamed `hasLimit_of_iso`. A new lemma `hasLimit_iff_of_iso` is added.
1 parent 7dac5d0 commit 630d515

File tree

32 files changed

+86
-79
lines changed

32 files changed

+86
-79
lines changed

Mathlib/Algebra/Category/ModuleCat/Sheaf/Colimits.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@ instance [HasColimitsOfShape K (PresheafOfModules.{v} R.val)] :
3030
has_colimit F := by
3131
let e : F ≅ (F ⋙ forget R) ⋙ PresheafOfModules.sheafification (𝟙 R.val) :=
3232
isoWhiskerLeft F (asIso (PresheafOfModules.sheafificationAdjunction (𝟙 R.val)).counit).symm
33-
exact hasColimitOfIso e
33+
exact hasColimit_of_iso e
3434

3535
end SheafOfModules

Mathlib/Algebra/Homology/HomologicalComplexBiprod.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ instance (i : ι) : HasBinaryBiproduct ((eval C c i).obj K) ((eval C c i).obj L)
2727

2828
instance (i : ι) : HasLimit ((pair K L) ⋙ (eval C c i)) := by
2929
have e : _ ≅ pair (K.X i) (L.X i) := diagramIsoPair (pair K L ⋙ eval C c i)
30-
exact hasLimitOfIso e.symm
30+
exact hasLimit_of_iso e.symm
3131

3232
instance (i : ι) : HasColimit ((pair K L) ⋙ (eval C c i)) := by
3333
have e : _ ≅ pair (K.X i) (L.X i) := diagramIsoPair (pair K L ⋙ eval C c i)
34-
exact hasColimitOfIso e
34+
exact hasColimit_of_iso e
3535

3636
instance : HasBinaryBiproduct K L := HasBinaryBiproduct.of_hasBinaryProduct _ _
3737

Mathlib/Algebra/Homology/ShortComplex/LeftHomology.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ lemma hasCokernel [S.HasLeftHomology] [HasKernel S.g] :
10091009
let e : parallelPair (kernel.lift S.g S.f S.zero) 0 ≅ parallelPair h.f' 0 :=
10101010
parallelPair.ext (Iso.refl _) (IsLimit.conePointUniqueUpToIso (kernelIsKernel S.g) h.hi)
10111011
(by aesop_cat) (by simp)
1012-
exact hasColimitOfIso e
1012+
exact hasColimit_of_iso e
10131013

10141014
end HasLeftHomology
10151015

Mathlib/Algebra/Homology/ShortComplex/RightHomology.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1288,7 +1288,7 @@ lemma hasKernel [S.HasRightHomology] [HasCokernel S.f] :
12881288
let e : parallelPair (cokernel.desc S.f S.g S.zero) 0 ≅ parallelPair h.g' 0 :=
12891289
parallelPair.ext (IsColimit.coconePointUniqueUpToIso (colimit.isColimit _) h.hp)
12901290
(Iso.refl _) (coequalizer.hom_ext (by simp)) (by simp)
1291-
exact hasLimitOfIso e.symm
1291+
exact hasLimit_of_iso e.symm
12921292

12931293
end HasRightHomology
12941294

Mathlib/AlgebraicGeometry/OpenImmersion.lean

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,8 @@ instance forget_map_isOpenImmersion : LocallyRingedSpace.IsOpenImmersion ((forge
437437

438438
instance hasLimit_cospan_forget_of_left :
439439
HasLimit (cospan f g ⋙ Scheme.forgetToLocallyRingedSpace) := by
440-
apply @hasLimitOfIso _ _ _ _ _ _ ?_ (diagramIsoCospan.{u} _).symm
441-
change HasLimit (cospan ((forget).map f) ((forget).map g))
442-
infer_instance
440+
rw [hasLimit_iff_of_iso (diagramIsoCospan _)]
441+
exact inferInstanceAs (HasLimit (cospan ((forget).map f) ((forget).map g)))
443442

444443
open CategoryTheory.Limits.WalkingCospan
445444

@@ -448,9 +447,8 @@ instance hasLimit_cospan_forget_of_left' :
448447
show HasLimit (cospan ((forget).map f) ((forget).map g)) from inferInstance
449448

450449
instance hasLimit_cospan_forget_of_right : HasLimit (cospan g f ⋙ forget) := by
451-
apply @hasLimitOfIso _ _ _ _ _ _ ?_ (diagramIsoCospan.{u} _).symm
452-
change HasLimit (cospan ((forget).map g) ((forget).map f))
453-
infer_instance
450+
rw [hasLimit_iff_of_iso (diagramIsoCospan _)]
451+
exact inferInstanceAs (HasLimit (cospan ((forget).map g) ((forget).map f)))
454452

455453
instance hasLimit_cospan_forget_of_right' :
456454
HasLimit (cospan ((cospan g f ⋙ forget).map Hom.inl) ((cospan g f ⋙ forget).map Hom.inr)) :=

Mathlib/CategoryTheory/Adjunction/Limits.lean

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,10 @@ theorem hasColimit_comp_equivalence (E : C ⥤ D) [E.IsEquivalence] [HasColimit
146146
isColimit := isColimitOfPreserves _ (colimit.isColimit K) }
147147

148148
theorem hasColimit_of_comp_equivalence (E : C ⥤ D) [E.IsEquivalence] [HasColimit (K ⋙ E)] :
149-
HasColimit K :=
150-
@hasColimitOfIso _ _ _ _ (K ⋙ E ⋙ E.inv) K
151-
(@hasColimit_comp_equivalence _ _ _ _ _ _ (K ⋙ E) E.inv _ _)
152-
((Functor.rightUnitor _).symm ≪≫ isoWhiskerLeft K E.asEquivalence.unitIso)
149+
HasColimit K := by
150+
rw [hasColimit_iff_of_iso
151+
((Functor.rightUnitor _).symm ≪≫ isoWhiskerLeft K E.asEquivalence.unitIso)]
152+
exact hasColimit_comp_equivalence (K ⋙ E) E.inv
153153

154154
/-- Transport a `HasColimitsOfShape` instance across an equivalence. -/
155155
theorem hasColimitsOfShape_of_equivalence (E : C ⥤ D) [E.IsEquivalence] [HasColimitsOfShape J D] :
@@ -265,10 +265,10 @@ theorem hasLimit_comp_equivalence (E : D ⥤ C) [E.IsEquivalence] [HasLimit K] :
265265
isLimit := isLimitOfPreserves _ (limit.isLimit K) }
266266

267267
theorem hasLimit_of_comp_equivalence (E : D ⥤ C) [E.IsEquivalence] [HasLimit (K ⋙ E)] :
268-
HasLimit K :=
269-
@hasLimitOfIso _ _ _ _ (K ⋙ E ⋙ E.inv) K
270-
(@hasLimit_comp_equivalence _ _ _ _ _ _ (K ⋙ E) E.inv _ _)
271-
(isoWhiskerLeft K E.asEquivalence.unitIso.symm ≪≫ Functor.rightUnitor _)
268+
HasLimit K := by
269+
rw [← hasLimit_iff_of_iso
270+
(isoWhiskerLeft K E.asEquivalence.unitIso.symm ≪≫ Functor.rightUnitor _)]
271+
exact hasLimit_comp_equivalence (K ⋙ E) E.inv
272272

273273
/-- Transport a `HasLimitsOfShape` instance across an equivalence. -/
274274
theorem hasLimitsOfShape_of_equivalence (E : D ⥤ C) [E.IsEquivalence] [HasLimitsOfShape J C] :

Mathlib/CategoryTheory/Functor/KanExtension/Adjunction.lean

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ lemma leftKanExtensionUnit_leftKanExtensionObjIsoColimit_hom (X : C) :
106106
@[instance]
107107
theorem hasColimit_map_comp_ι_comp_grotendieckProj {X Y : D} (f : X ⟶ Y) :
108108
HasColimit ((functor L).map f ⋙ Grothendieck.ι (functor L) Y ⋙ grothendieckProj L ⋙ F) :=
109-
hasColimitOfIso (isoWhiskerRight (mapCompιCompGrothendieckProj L f) F)
109+
hasColimit_of_iso (isoWhiskerRight (mapCompιCompGrothendieckProj L f) F)
110110

111111
/-- The left Kan extension of `F : C ⥤ H` along a functor `L : C ⥤ D` is isomorphic to the
112112
fiberwise colimit of the projection functor on the Grothendieck construction of the costructured
@@ -115,8 +115,9 @@ arrow category composed with `F`. -/
115115
noncomputable def leftKanExtensionIsoFiberwiseColimit [HasLeftKanExtension L F] :
116116
leftKanExtension L F ≅ fiberwiseColimit (grothendieckProj L ⋙ F) :=
117117
letI : ∀ X, HasColimit (Grothendieck.ι (functor L) X ⋙ grothendieckProj L ⋙ F) :=
118-
fun X => hasColimitOfIso <| Iso.symm <| isoWhiskerRight (eqToIso ((functor L).map_id X)) _ ≪≫
119-
Functor.leftUnitor (Grothendieck.ι (functor L) X ⋙ grothendieckProj L ⋙ F)
118+
fun X => hasColimit_of_iso <| Iso.symm <|
119+
isoWhiskerRight (eqToIso ((functor L).map_id X)) _ ≪≫
120+
Functor.leftUnitor (Grothendieck.ι (functor L) X ⋙ grothendieckProj L ⋙ F)
120121
Iso.symm <| NatIso.ofComponents
121122
(fun X => HasColimit.isoOfNatIso (isoWhiskerRight (ιCompGrothendieckProj L X) F) ≪≫
122123
(leftKanExtensionObjIsoColimit L F X).symm)

Mathlib/CategoryTheory/GlueData.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ attribute [local instance] hasColimit_multispan_comp
284284
variable [∀ i j k, PreservesLimit (cospan (D.f i j) (D.f i k)) F]
285285

286286
theorem hasColimit_mapGlueData_diagram : HasMulticoequalizer (D.mapGlueData F).diagram :=
287-
hasColimitOfIso (D.diagramIso F).symm
287+
hasColimit_of_iso (D.diagramIso F).symm
288288

289289
attribute [local instance] hasColimit_mapGlueData_diagram
290290

Mathlib/CategoryTheory/GradedObject.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ variable {X Y} in
310310
lemma hasMap_of_iso (e : X ≅ Y) (p: I → J) [HasMap X p] : HasMap Y p := fun j => by
311311
have α : Discrete.functor (X.mapObjFun p j) ≅ Discrete.functor (Y.mapObjFun p j) :=
312312
Discrete.natIso (fun ⟨i, _⟩ => (GradedObject.eval i).mapIso e)
313-
exact hasColimitOfIso α.symm
313+
exact hasColimit_of_iso α.symm
314314

315315
section
316316
variable [X.HasMap p] [Y.HasMap p]

Mathlib/CategoryTheory/Limits/Constructions/FiniteProductsOfBinaryProducts.lean

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,10 @@ private theorem hasProduct_fin : ∀ (n : ℕ) (f : Fin n → C), HasProduct f
9999

100100
/-- If `C` has a terminal object and binary products, then it has finite products. -/
101101
theorem hasFiniteProducts_of_has_binary_and_terminal : HasFiniteProducts C :=
102-
fun n => ⟨fun K =>
103-
let this := hasProduct_fin n fun n => K.obj ⟨n⟩
102+
fun n => ⟨fun K => by
104103
let that : (Discrete.functor fun n => K.obj ⟨n⟩) ≅ K := Discrete.natIso fun ⟨_⟩ => Iso.refl _
105-
@hasLimitOfIso _ _ _ _ _ _ this that⟩⟩
104+
rw [← hasLimit_iff_of_iso that]
105+
apply hasProduct_fin⟩⟩
106106

107107

108108
end
@@ -231,10 +231,10 @@ private theorem hasCoproduct_fin : ∀ (n : ℕ) (f : Fin n → C), HasCoproduct
231231

232232
/-- If `C` has an initial object and binary coproducts, then it has finite coproducts. -/
233233
theorem hasFiniteCoproducts_of_has_binary_and_initial : HasFiniteCoproducts C :=
234-
fun n => ⟨fun K =>
235-
letI := hasCoproduct_fin n fun n => K.obj ⟨n⟩
234+
fun n => ⟨fun K => by
236235
let that : K ≅ Discrete.functor fun n => K.obj ⟨n⟩ := Discrete.natIso fun ⟨_⟩ => Iso.refl _
237-
@hasColimitOfIso _ _ _ _ _ _ this that⟩⟩
236+
rw [hasColimit_iff_of_iso that]
237+
apply hasCoproduct_fin⟩⟩
238238

239239
end
240240

0 commit comments

Comments
 (0)