Skip to content

Commit 4dd34c0

Browse files
committed
feat(CategoryTheory/Limits/MorphismProperty): dualise lemmas on limits (#30127)
We also add the object properties induced by morphism properties for `Comma`, `CostructuredArrow` and `StructuredArrow` and use them accordingly.
1 parent e4f93e7 commit 4dd34c0

File tree

2 files changed

+75
-9
lines changed

2 files changed

+75
-9
lines changed

Mathlib/CategoryTheory/Limits/MorphismProperty.lean

Lines changed: 38 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ variable (D : J ⥤ P.Comma L R ⊤ ⊤)
2828
/-- If `P` is closed under limits of shape `J` in `Comma L R`, then when `D` has
2929
a limit in `Comma L R`, the forgetful functor creates this limit. -/
3030
noncomputable def forgetCreatesLimitOfClosed
31-
(h : ClosedUnderLimitsOfShape J (fun f : Comma L R ↦ P f.hom))
31+
(h : ClosedUnderLimitsOfShape J (P.commaObj L R))
3232
[HasLimit (D ⋙ forget L R P ⊤ ⊤)] :
3333
CreatesLimit D (forget L R P ⊤ ⊤) :=
3434
createsLimitOfFullyFaithfulOfIso
@@ -38,22 +38,51 @@ noncomputable def forgetCreatesLimitOfClosed
3838
/-- If `Comma L R` has limits of shape `J` and `Comma L R` is closed under limits of shape
3939
`J`, then `forget L R P ⊤ ⊤` creates limits of shape `J`. -/
4040
noncomputable def forgetCreatesLimitsOfShapeOfClosed [HasLimitsOfShape J (Comma L R)]
41-
(h : ClosedUnderLimitsOfShape J (fun f : Comma L R ↦ P f.hom)) :
41+
(h : ClosedUnderLimitsOfShape J (P.commaObj L R)) :
4242
CreatesLimitsOfShape J (forget L R P ⊤ ⊤) where
4343
CreatesLimit := forgetCreatesLimitOfClosed _ _ h
4444

4545
lemma hasLimit_of_closedUnderLimitsOfShape
46-
(h : ClosedUnderLimitsOfShape J (fun f : Comma L R ↦ P f.hom))
46+
(h : ClosedUnderLimitsOfShape J (P.commaObj L R))
4747
[HasLimit (D ⋙ forget L R P ⊤ ⊤)] :
4848
HasLimit D :=
4949
haveI : CreatesLimit D (forget L R P ⊤ ⊤) := forgetCreatesLimitOfClosed _ D h
5050
hasLimit_of_created D (forget L R P ⊤ ⊤)
5151

5252
lemma hasLimitsOfShape_of_closedUnderLimitsOfShape [HasLimitsOfShape J (Comma L R)]
53-
(h : ClosedUnderLimitsOfShape J (fun f : Comma L R ↦ P f.hom)) :
53+
(h : ClosedUnderLimitsOfShape J (P.commaObj L R)) :
5454
HasLimitsOfShape J (P.Comma L R ⊤ ⊤) where
5555
has_limit _ := hasLimit_of_closedUnderLimitsOfShape _ _ h
5656

57+
/-- If `P` is closed under colimits of shape `J` in `Comma L R`, then when `D` has
58+
a colimit in `Comma L R`, the forgetful functor creates this colimit. -/
59+
noncomputable def forgetCreatesColimitOfClosed
60+
(h : ClosedUnderColimitsOfShape J (P.commaObj L R))
61+
[HasColimit (D ⋙ forget L R P ⊤ ⊤)] :
62+
CreatesColimit D (forget L R P ⊤ ⊤) :=
63+
createsColimitOfFullyFaithfulOfIso
64+
(⟨colimit (D ⋙ forget L R P ⊤ ⊤), h.colimit fun j ↦ (D.obj j).prop⟩)
65+
(Iso.refl _)
66+
67+
/-- If `Comma L R` has colimits of shape `J` and `Comma L R` is closed under colimits of shape
68+
`J`, then `forget L R P ⊤ ⊤` creates colimits of shape `J`. -/
69+
noncomputable def forgetCreatesColimitsOfShapeOfClosed [HasColimitsOfShape J (Comma L R)]
70+
(h : ClosedUnderColimitsOfShape J (P.commaObj L R)) :
71+
CreatesColimitsOfShape J (forget L R P ⊤ ⊤) where
72+
CreatesColimit := forgetCreatesColimitOfClosed _ _ h
73+
74+
lemma hasColimit_of_closedUnderColimitsOfShape
75+
(h : ClosedUnderColimitsOfShape J (P.commaObj L R))
76+
[HasColimit (D ⋙ forget L R P ⊤ ⊤)] :
77+
HasColimit D :=
78+
haveI : CreatesColimit D (forget L R P ⊤ ⊤) := forgetCreatesColimitOfClosed _ D h
79+
hasColimit_of_created D (forget L R P ⊤ ⊤)
80+
81+
lemma hasColimitsOfShape_of_closedUnderColimitsOfShape [HasColimitsOfShape J (Comma L R)]
82+
(h : ClosedUnderColimitsOfShape J (P.commaObj L R)) :
83+
HasColimitsOfShape J (P.Comma L R ⊤ ⊤) where
84+
has_colimit _ := hasColimit_of_closedUnderColimitsOfShape _ _ h
85+
5786
end MorphismProperty.Comma
5887

5988
section
@@ -63,13 +92,13 @@ variable {A : Type*} [Category A] {L : A ⥤ T}
6392
lemma CostructuredArrow.closedUnderLimitsOfShape_discrete_empty [L.Faithful] [L.Full] {Y : A}
6493
[P.ContainsIdentities] [P.RespectsIso] :
6594
ClosedUnderLimitsOfShape (Discrete PEmpty.{1})
66-
(fun f : CostructuredArrow L (L.obj Y) ↦ P f.hom) := by
95+
(P.costructuredArrowObj L (X := L.obj Y)) := by
6796
rintro D c hc -
6897
have : D = Functor.empty _ := Functor.empty_ext' _ _
6998
subst this
7099
let e : c.pt ≅ CostructuredArrow.mk (𝟙 (L.obj Y)) :=
71100
hc.conePointUniqueUpToIso CostructuredArrow.mkIdTerminal
72-
rw [P.costructuredArrow_iso_iff e]
101+
rw [P.costructuredArrowObj_iff, P.costructuredArrow_iso_iff e]
73102
simpa using P.id_mem (L.obj Y)
74103

75104
end
@@ -79,7 +108,7 @@ section
79108
variable {X : T}
80109

81110
lemma Over.closedUnderLimitsOfShape_discrete_empty [P.ContainsIdentities] [P.RespectsIso] :
82-
ClosedUnderLimitsOfShape (Discrete PEmpty.{1}) (fun f : Over X ↦ P f.hom) :=
111+
ClosedUnderLimitsOfShape (Discrete PEmpty.{1}) (P.overObj (X := X)) :=
83112
CostructuredArrow.closedUnderLimitsOfShape_discrete_empty P
84113

85114
/-- Let `P` be stable under composition and base change. If `P` satisfies cancellation on the right,
@@ -89,12 +118,12 @@ Without the cancellation property, this does not in general. Consider for exampl
89118
`P = Function.Surjective` on `Type`. -/
90119
lemma Over.closedUnderLimitsOfShape_pullback [HasPullbacks T]
91120
[P.IsStableUnderComposition] [P.IsStableUnderBaseChange] [P.HasOfPostcompProperty P] :
92-
ClosedUnderLimitsOfShape WalkingCospan (fun f : Over X ↦ P f.hom) := by
121+
ClosedUnderLimitsOfShape WalkingCospan (P.overObj (X := X)) := by
93122
intro D c hc hf
94123
have h : IsPullback (c.π.app .left).left (c.π.app .right).left (D.map WalkingCospan.Hom.inl).left
95124
(D.map WalkingCospan.Hom.inr).left := IsPullback.of_isLimit_cone <|
96125
Limits.isLimitOfPreserves (CategoryTheory.Over.forget X) hc
97-
rw [show c.pt.hom = (c.π.app .left).left ≫ (D.obj .left).hom by simp]
126+
rw [P.overObj_iff, show c.pt.hom = (c.π.app .left).left ≫ (D.obj .left).hom by simp]
98127
apply P.comp_mem _ _ (P.of_isPullback h.flip ?_) (hf _)
99128
exact P.of_postcomp _ (D.obj WalkingCospan.one).hom (hf .one) (by simpa using hf .right)
100129

Mathlib/CategoryTheory/MorphismProperty/Comma.lean

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,37 @@ section
5454

5555
variable {W : MorphismProperty T} {X : T}
5656

57+
/-- The object property on `Comma L R` induced by a morphism property. -/
58+
def commaObj (W : MorphismProperty T) : ObjectProperty (Comma L R) :=
59+
fun f ↦ W f.hom
60+
61+
@[simp] lemma commaObj_iff (Y : Comma L R) : W.commaObj L R Y ↔ W Y.hom := .rfl
62+
63+
instance [W.RespectsIso] : (W.commaObj L R).IsClosedUnderIsomorphisms where
64+
of_iso {X Y} e h := by
65+
rwa [commaObj_iff, ← W.cancel_left_of_respectsIso (L.map e.hom.left), e.hom.w,
66+
W.cancel_right_of_respectsIso]
67+
68+
/-- The object property on `CostructuredArrow L X` induced by a morphism property. -/
69+
def costructuredArrowObj (W : MorphismProperty T) : ObjectProperty (CostructuredArrow L X) :=
70+
fun f ↦ W f.hom
71+
72+
@[simp] lemma costructuredArrowObj_iff (Y : CostructuredArrow L X) :
73+
W.costructuredArrowObj L Y ↔ W Y.hom := .rfl
74+
75+
instance [W.RespectsIso] : (W.costructuredArrowObj L (X := X)).IsClosedUnderIsomorphisms :=
76+
inferInstanceAs <| (W.commaObj _ _).IsClosedUnderIsomorphisms
77+
78+
/-- The object property on `StructuredArrow X R` induced by a morphism property. -/
79+
def structuredArrowObj (W : MorphismProperty T) : ObjectProperty (StructuredArrow X R) :=
80+
fun f ↦ W f.hom
81+
82+
@[simp] lemma structuredArrowObj_iff (Y : StructuredArrow X R) :
83+
W.structuredArrowObj R Y ↔ W Y.hom := .rfl
84+
85+
instance [W.RespectsIso] : (W.structuredArrowObj L (X := X)).IsClosedUnderIsomorphisms :=
86+
inferInstanceAs <| (W.commaObj _ _).IsClosedUnderIsomorphisms
87+
5788
/-- The morphism property on `Over X` induced by a morphism property on `C`. -/
5889
def over (W : MorphismProperty T) {X : T} : MorphismProperty (Over X) := fun _ _ f ↦ W f.left
5990

@@ -69,11 +100,17 @@ def overObj (W : MorphismProperty T) {X : T} : ObjectProperty (Over X) := fun f
69100

70101
@[simp] lemma overObj_iff (Y : Over X) : W.overObj Y ↔ W Y.hom := .rfl
71102

103+
instance [W.RespectsIso] : (W.overObj (X := X)).IsClosedUnderIsomorphisms :=
104+
inferInstanceAs <| (W.commaObj _ _).IsClosedUnderIsomorphisms
105+
72106
/-- The object property on `Under X` induced by a morphism property. -/
73107
def underObj (W : MorphismProperty T) {X : T} : ObjectProperty (Under X) := fun f ↦ W f.hom
74108

75109
@[simp] lemma underObj_iff (Y : Under X) : W.underObj Y ↔ W Y.hom := .rfl
76110

111+
instance [W.RespectsIso] : (W.underObj (X := X)).IsClosedUnderIsomorphisms :=
112+
inferInstanceAs <| (W.commaObj _ _).IsClosedUnderIsomorphisms
113+
77114
end
78115

79116
variable (P : MorphismProperty T) (Q : MorphismProperty A) (W : MorphismProperty B)

0 commit comments

Comments
 (0)