Skip to content

Commit 180a3c4

Browse files
committed
refactor(CategoryTheory/ObjectProperty): IsClosedUnderLimitsOfShape (#29881)
This PR renames `ClosedUnderLimitsOfShape` as `ObjectProperty.IsClosedUnderLimitsOfShape`, and make it a typeclass. The stability condition of a property `P` by (co)limits of shape `J` is now expressed as `P.colimitsOfShape J ≤ P`. This facilitates the connection with the relatively new API `ColimitPresentation` #29382 (and the related `ObjectProperty.ColimitOfShape`). By using a typeclass for the stability condition, it will be possible to add instances `HasLimitsOfShape` instances for fullsubcategories. This also makes the design more parallel to what we have for the stability under (co)limits of `MorphismProperty`.
1 parent 453ea3b commit 180a3c4

File tree

8 files changed

+253
-179
lines changed

8 files changed

+253
-179
lines changed

Mathlib/CategoryTheory/Limits/FullSubcategory.lean

Lines changed: 38 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@ Copyright (c) 2022 Markus Himmel. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Markus Himmel
55
-/
6-
import Mathlib.CategoryTheory.Limits.Creates
7-
import Mathlib.CategoryTheory.ObjectProperty.ClosedUnderIsomorphisms
6+
import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape
7+
import Mathlib.CategoryTheory.ObjectProperty.ColimitsOfShape
88

99
/-!
1010
# Limits in full subcategories
1111
12-
We introduce the notion of a property closed under taking limits and show that if `P` is closed
13-
under taking limits, then limits in `FullSubcategory P` can be constructed from limits in `C`.
12+
If a property of objects `P` is closed under taking limits,
13+
then limits in `FullSubcategory P` can be constructed from limits in `C`.
1414
More precisely, the inclusion creates such limits.
1515
1616
-/
@@ -24,46 +24,6 @@ open CategoryTheory
2424

2525
namespace CategoryTheory.Limits
2626

27-
/-- We say that a property is closed under limits of shape `J` if whenever all objects in a
28-
`J`-shaped diagram have the property, any limit of this diagram also has the property. -/
29-
def ClosedUnderLimitsOfShape {C : Type u} [Category.{v} C] (J : Type w) [Category.{w'} J]
30-
(P : ObjectProperty C) : Prop :=
31-
∀ ⦃F : J ⥤ C⦄ ⦃c : Cone F⦄ (_hc : IsLimit c), (∀ j, P (F.obj j)) → P c.pt
32-
33-
/-- We say that a property is closed under colimits of shape `J` if whenever all objects in a
34-
`J`-shaped diagram have the property, any colimit of this diagram also has the property. -/
35-
def ClosedUnderColimitsOfShape {C : Type u} [Category.{v} C] (J : Type w) [Category.{w'} J]
36-
(P : ObjectProperty C) : Prop :=
37-
∀ ⦃F : J ⥤ C⦄ ⦃c : Cocone F⦄ (_hc : IsColimit c), (∀ j, P (F.obj j)) → P c.pt
38-
39-
section
40-
41-
variable {C : Type u} [Category.{v} C] {J : Type w} [Category.{w'} J] {P : ObjectProperty C}
42-
43-
theorem closedUnderLimitsOfShape_of_limit [P.IsClosedUnderIsomorphisms]
44-
(h : ∀ {F : J ⥤ C} [HasLimit F], (∀ j, P (F.obj j)) → P (limit F)) :
45-
ClosedUnderLimitsOfShape J P := by
46-
intro F c hc hF
47-
have : HasLimit F := ⟨_, hc⟩
48-
exact P.prop_of_iso ((limit.isLimit _).conePointUniqueUpToIso hc) (h hF)
49-
50-
theorem closedUnderColimitsOfShape_of_colimit [P.IsClosedUnderIsomorphisms]
51-
(h : ∀ {F : J ⥤ C} [HasColimit F], (∀ j, P (F.obj j)) → P (colimit F)) :
52-
ClosedUnderColimitsOfShape J P := by
53-
intro F c hc hF
54-
have : HasColimit F := ⟨_, hc⟩
55-
exact P.prop_of_iso ((colimit.isColimit _).coconePointUniqueUpToIso hc) (h hF)
56-
57-
protected lemma ClosedUnderLimitsOfShape.limit (h : ClosedUnderLimitsOfShape J P) {F : J ⥤ C}
58-
[HasLimit F] : (∀ j, P (F.obj j)) → P (limit F) :=
59-
h (limit.isLimit _)
60-
61-
protected lemma ClosedUnderColimitsOfShape.colimit (h : ClosedUnderColimitsOfShape J P) {F : J ⥤ C}
62-
[HasColimit F] : (∀ j, P (F.obj j)) → P (colimit F) :=
63-
h (colimit.isColimit _)
64-
65-
end
66-
6727
section
6828

6929
variable {J : Type w} [Category.{w'} J] {C : Type u} [Category.{v} C] {P : ObjectProperty C}
@@ -97,47 +57,49 @@ def createsColimitFullSubcategoryInclusion (F : J ⥤ P.FullSubcategory)
9757
CreatesColimit F P.ι :=
9858
createsColimitFullSubcategoryInclusion' F (colimit.isColimit _) h
9959

60+
variable (P J)
61+
10062
/-- If `P` is closed under limits of shape `J`, then the inclusion creates such limits. -/
101-
def createsLimitFullSubcategoryInclusionOfClosed (h : ClosedUnderLimitsOfShape J P)
63+
def createsLimitFullSubcategoryInclusionOfClosed [P.IsClosedUnderLimitsOfShape J]
10264
(F : J ⥤ P.FullSubcategory) [HasLimit (F ⋙ P.ι)] :
10365
CreatesLimit F P.ι :=
104-
createsLimitFullSubcategoryInclusion F (h.limit fun j => (F.obj j).property)
66+
createsLimitFullSubcategoryInclusion F (P.prop_limit _ fun j => (F.obj j).property)
10567

10668
/-- If `P` is closed under limits of shape `J`, then the inclusion creates such limits. -/
107-
def createsLimitsOfShapeFullSubcategoryInclusion (h : ClosedUnderLimitsOfShape J P)
69+
instance createsLimitsOfShapeFullSubcategoryInclusion [P.IsClosedUnderLimitsOfShape J]
10870
[HasLimitsOfShape J C] : CreatesLimitsOfShape J P.ι where
109-
CreatesLimit := @fun F => createsLimitFullSubcategoryInclusionOfClosed h F
71+
CreatesLimit := @fun F => createsLimitFullSubcategoryInclusionOfClosed J P F
11072

111-
theorem hasLimit_of_closedUnderLimits (h : ClosedUnderLimitsOfShape J P)
73+
theorem hasLimit_of_closedUnderLimits [P.IsClosedUnderLimitsOfShape J]
11274
(F : J ⥤ P.FullSubcategory) [HasLimit (F ⋙ P.ι)] : HasLimit F :=
11375
have : CreatesLimit F P.ι :=
114-
createsLimitFullSubcategoryInclusionOfClosed h F
76+
createsLimitFullSubcategoryInclusionOfClosed J P F
11577
hasLimit_of_created F P.ι
11678

117-
theorem hasLimitsOfShape_of_closedUnderLimits (h : ClosedUnderLimitsOfShape J P)
79+
instance hasLimitsOfShape_of_closedUnderLimits [P.IsClosedUnderLimitsOfShape J]
11880
[HasLimitsOfShape J C] : HasLimitsOfShape J P.FullSubcategory :=
119-
{ has_limit := fun F => hasLimit_of_closedUnderLimits h F }
81+
{ has_limit := fun F => hasLimit_of_closedUnderLimits J P F }
12082

12183
/-- If `P` is closed under colimits of shape `J`, then the inclusion creates such colimits. -/
122-
def createsColimitFullSubcategoryInclusionOfClosed (h : ClosedUnderColimitsOfShape J P)
84+
def createsColimitFullSubcategoryInclusionOfClosed [P.IsClosedUnderColimitsOfShape J]
12385
(F : J ⥤ P.FullSubcategory) [HasColimit (F ⋙ P.ι)] :
12486
CreatesColimit F P.ι :=
125-
createsColimitFullSubcategoryInclusion F (h.colimit fun j => (F.obj j).property)
87+
createsColimitFullSubcategoryInclusion F (P.prop_colimit _ fun j => (F.obj j).property)
12688

12789
/-- If `P` is closed under colimits of shape `J`, then the inclusion creates such colimits. -/
128-
def createsColimitsOfShapeFullSubcategoryInclusion (h : ClosedUnderColimitsOfShape J P)
90+
instance createsColimitsOfShapeFullSubcategoryInclusion [P.IsClosedUnderColimitsOfShape J]
12991
[HasColimitsOfShape J C] : CreatesColimitsOfShape J P.ι where
130-
CreatesColimit := @fun F => createsColimitFullSubcategoryInclusionOfClosed h F
92+
CreatesColimit := @fun F => createsColimitFullSubcategoryInclusionOfClosed J P F
13193

132-
theorem hasColimit_of_closedUnderColimits (h : ClosedUnderColimitsOfShape J P)
94+
theorem hasColimit_of_closedUnderColimits [P.IsClosedUnderColimitsOfShape J]
13395
(F : J ⥤ P.FullSubcategory) [HasColimit (F ⋙ P.ι)] : HasColimit F :=
13496
have : CreatesColimit F P.ι :=
135-
createsColimitFullSubcategoryInclusionOfClosed h F
97+
createsColimitFullSubcategoryInclusionOfClosed J P F
13698
hasColimit_of_created F P.ι
13799

138-
theorem hasColimitsOfShape_of_closedUnderColimits (h : ClosedUnderColimitsOfShape J P)
100+
instance hasColimitsOfShape_of_closedUnderColimits [P.IsClosedUnderColimitsOfShape J]
139101
[HasColimitsOfShape J C] : HasColimitsOfShape J P.FullSubcategory :=
140-
{ has_colimit := fun F => hasColimit_of_closedUnderColimits h F }
102+
{ has_colimit := fun F => hasColimit_of_closedUnderColimits J P F }
141103

142104
end
143105

@@ -147,19 +109,23 @@ variable {D : Type u₂} [Category.{v₂} D]
147109
variable (F : C ⥤ D)
148110

149111
/-- The essential image of a functor is closed under the limits it preserves. -/
150-
protected lemma ClosedUnderLimitsOfShape.essImage [HasLimitsOfShape J C]
151-
[PreservesLimitsOfShape J F] [F.Full] [F.Faithful] :
152-
ClosedUnderLimitsOfShape J F.essImage := fun G _c hc hG ↦
153-
⟨limit (Functor.essImage.liftFunctor G F hG),
154-
⟨IsLimit.conePointsIsoOfNatIso (isLimitOfPreserves F (limit.isLimit _)) hc
155-
(Functor.essImage.liftFunctorCompIso _ _ _)⟩⟩
112+
instance [HasLimitsOfShape J C] [PreservesLimitsOfShape J F] [F.Full] [F.Faithful] :
113+
F.essImage.IsClosedUnderLimitsOfShape J :=
114+
.mk' (by
115+
rintro _ ⟨G, hG⟩
116+
exact ⟨limit (Functor.essImage.liftFunctor G F hG),
117+
⟨IsLimit.conePointsIsoOfNatIso
118+
(isLimitOfPreserves F (limit.isLimit _)) (limit.isLimit _)
119+
(Functor.essImage.liftFunctorCompIso _ _ _)⟩⟩)
156120

157121
/-- The essential image of a functor is closed under the colimits it preserves. -/
158-
protected lemma ClosedUnderColimitsOfShape.essImage [HasColimitsOfShape J C]
159-
[PreservesColimitsOfShape J F] [F.Full] [F.Faithful] :
160-
ClosedUnderColimitsOfShape J F.essImage := fun G _c hc hG ↦
161-
⟨colimit (Functor.essImage.liftFunctor G F hG),
162-
⟨IsColimit.coconePointsIsoOfNatIso (isColimitOfPreserves F (colimit.isColimit _)) hc
163-
(Functor.essImage.liftFunctorCompIso _ _ _)⟩⟩
122+
instance [HasColimitsOfShape J C] [PreservesColimitsOfShape J F] [F.Full] [F.Faithful] :
123+
F.essImage.IsClosedUnderColimitsOfShape J :=
124+
.mk' (by
125+
rintro _ ⟨G, hG⟩
126+
exact ⟨colimit (Functor.essImage.liftFunctor G F hG),
127+
⟨IsColimit.coconePointsIsoOfNatIso
128+
(isColimitOfPreserves F (colimit.isColimit _)) (colimit.isColimit _)
129+
(Functor.essImage.liftFunctorCompIso _ _ _)⟩⟩)
164130

165131
end CategoryTheory.Limits

Mathlib/CategoryTheory/Limits/Indization/Category.lean

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -113,23 +113,29 @@ noncomputable def Ind.yonedaCompInclusion : Ind.yoneda ⋙ Ind.inclusion C ≅ C
113113
isoWhiskerLeft (ObjectProperty.lift _ _ _)
114114
(isoWhiskerRight (Ind.equivalence C).counitIso (ObjectProperty.ι _))
115115

116+
noncomputable instance {J : Type v} [SmallCategory J] [IsFiltered J] :
117+
ObjectProperty.IsClosedUnderColimitsOfShape (IsIndObject (C := C)) J :=
118+
.mk' (by
119+
rintro _ ⟨F, hF⟩
120+
exact isIndObject_colimit _ _ hF)
121+
116122
noncomputable instance {J : Type v} [SmallCategory J] [IsFiltered J] :
117123
CreatesColimitsOfShape J (Ind.inclusion C) :=
118-
letI _ : CreatesColimitsOfShape J (ObjectProperty.ι (IsIndObject (C := C))) :=
119-
createsColimitsOfShapeFullSubcategoryInclusion (closedUnderColimitsOfShape_of_colimit
120-
(isIndObject_colimit _ _))
121124
inferInstanceAs <|
122125
CreatesColimitsOfShape J ((Ind.equivalence C).functor ⋙ ObjectProperty.ι _)
123126

124127
instance : HasFilteredColimits (Ind C) where
125128
HasColimitsOfShape _ _ _ :=
126129
hasColimitsOfShape_of_hasColimitsOfShape_createsColimitsOfShape (Ind.inclusion C)
127130

131+
noncomputable instance {J : Type v} [HasLimitsOfShape (Discrete J) C] :
132+
ObjectProperty.IsClosedUnderLimitsOfShape (IsIndObject (C := C)) (Discrete J) :=
133+
.mk' (by
134+
rintro _ ⟨F, hF⟩
135+
exact isIndObject_limit_of_discrete_of_hasLimitsOfShape _ hF)
136+
128137
noncomputable instance {J : Type v} [HasLimitsOfShape (Discrete J) C] :
129138
CreatesLimitsOfShape (Discrete J) (Ind.inclusion C) :=
130-
letI _ : CreatesLimitsOfShape (Discrete J) (ObjectProperty.ι (IsIndObject (C := C))) :=
131-
createsLimitsOfShapeFullSubcategoryInclusion (closedUnderLimitsOfShape_of_limit
132-
(isIndObject_limit_of_discrete_of_hasLimitsOfShape _))
133139
inferInstanceAs <|
134140
CreatesLimitsOfShape (Discrete J) ((Ind.equivalence C).functor ⋙ ObjectProperty.ι _)
135141

@@ -139,10 +145,6 @@ instance {J : Type v} [HasLimitsOfShape (Discrete J) C] :
139145

140146
noncomputable instance [HasLimitsOfShape WalkingParallelPair C] :
141147
CreatesLimitsOfShape WalkingParallelPair (Ind.inclusion C) :=
142-
letI _ : CreatesLimitsOfShape WalkingParallelPair
143-
(ObjectProperty.ι (IsIndObject (C := C))) :=
144-
createsLimitsOfShapeFullSubcategoryInclusion
145-
(closedUnderLimitsOfShape_walkingParallelPair_isIndObject)
146148
inferInstanceAs <|
147149
CreatesLimitsOfShape WalkingParallelPair
148150
((Ind.equivalence C).functor ⋙ ObjectProperty.ι _)

Mathlib/CategoryTheory/Limits/Indization/Equalizers.lean

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ Released under Apache 2.0 license as described in the file LICENSE.
44
Authors: Markus Himmel
55
-/
66
import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits
7-
import Mathlib.CategoryTheory.Limits.FullSubcategory
87
import Mathlib.CategoryTheory.Limits.Indization.ParallelPair
8+
import Mathlib.CategoryTheory.ObjectProperty.LimitsOfShape
99

1010
/-!
1111
# Equalizers of ind-objects
@@ -63,17 +63,21 @@ end
6363
6464
This is Proposition 6.1.17(i) in [Kashiwara2006].
6565
-/
66-
theorem closedUnderLimitsOfShape_walkingParallelPair_isIndObject [HasEqualizers C] :
67-
ClosedUnderLimitsOfShape WalkingParallelPair (IsIndObject (C := C)) := by
68-
apply closedUnderLimitsOfShape_of_limit
69-
intro F hF h
70-
obtain ⟨P⟩ := nonempty_indParallelPairPresentation (h WalkingParallelPair.zero)
71-
(h WalkingParallelPair.one) (F.map WalkingParallelPairHom.left)
72-
(F.map WalkingParallelPairHom.right)
73-
exact IsIndObject.map
74-
(HasLimit.isoOfNatIso (P.parallelPairIsoParallelPairCompYoneda.symm ≪≫
75-
(diagramIsoParallelPair _).symm)).hom
76-
(isIndObject_limit_comp_yoneda_comp_colim (parallelPair P.φ P.ψ)
77-
(fun i => isIndObject_limit_comp_yoneda _))
66+
instance isClosedUnderLimitsOfShape_isIndObject_walkingParallelPair [HasEqualizers C] :
67+
ObjectProperty.IsClosedUnderLimitsOfShape (IsIndObject (C := C)) WalkingParallelPair :=
68+
.mk' (by
69+
rintro _ ⟨F, h⟩
70+
obtain ⟨P⟩ := nonempty_indParallelPairPresentation (h WalkingParallelPair.zero)
71+
(h WalkingParallelPair.one) (F.map WalkingParallelPairHom.left)
72+
(F.map WalkingParallelPairHom.right)
73+
exact IsIndObject.map
74+
(HasLimit.isoOfNatIso (P.parallelPairIsoParallelPairCompYoneda.symm ≪≫
75+
(diagramIsoParallelPair _).symm)).hom
76+
(isIndObject_limit_comp_yoneda_comp_colim (parallelPair P.φ P.ψ)
77+
(fun i => isIndObject_limit_comp_yoneda _)))
78+
79+
@[deprecated (since := "2025-09-22")]
80+
alias closedUnderLimitsOfShape_walkingParallelPair_isIndObject :=
81+
isClosedUnderLimitsOfShape_isIndObject_walkingParallelPair
7882

7983
end CategoryTheory.Limits

0 commit comments

Comments
 (0)