Skip to content

Commit afd713f

Browse files
committed
feat: equalizers and coequalizers in the category of ind-objects (#21139)
We study parallel pairs of morphisms in `Ind C`, discover that they are always induced by natural transformations in a suitable indexing category, and deduce that ind-objects are closed under equalizers and the category of ind-objects has coequalizers. Huge thanks to @javra and @datokrat. If they had not spent countless hours tirelessly PRing properties of comma categories and the Grothendieck construction to mathlib this PR would not have been possible, even though you can't see any of their results used in the PR (since they are applied by instance synthesis). Co-authored-by: Markus Himmel <markus@lean-fro.org>
1 parent abcae08 commit afd713f

File tree

4 files changed

+232
-10
lines changed

4 files changed

+232
-10
lines changed

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1932,6 +1932,7 @@ import Mathlib.CategoryTheory.Limits.Indization.Equalizers
19321932
import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits
19331933
import Mathlib.CategoryTheory.Limits.Indization.IndObject
19341934
import Mathlib.CategoryTheory.Limits.Indization.LocallySmall
1935+
import Mathlib.CategoryTheory.Limits.Indization.ParallelPair
19351936
import Mathlib.CategoryTheory.Limits.Indization.Products
19361937
import Mathlib.CategoryTheory.Limits.IsConnected
19371938
import Mathlib.CategoryTheory.Limits.IsLimit

Mathlib/CategoryTheory/Limits/Indization/Category.lean

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import Mathlib.CategoryTheory.Functor.Flat
77
import Mathlib.CategoryTheory.Limits.Constructions.Filtered
88
import Mathlib.CategoryTheory.Limits.FullSubcategory
99
import Mathlib.CategoryTheory.Limits.Indization.LocallySmall
10+
import Mathlib.CategoryTheory.Limits.Indization.ParallelPair
1011
import Mathlib.CategoryTheory.Limits.Indization.FilteredColimits
1112
import Mathlib.CategoryTheory.Limits.Indization.Products
1213

@@ -30,7 +31,8 @@ Adopting the theorem numbering of [Kashiwara2006], we show that
3031
* if `C` has finite coproducts, then `Ind C` has small coproducts (6.1.18(ii)),
3132
* if `C` has products indexed by `α`, then `Ind C` has products indexed by `α`, and the functor
3233
`Ind C ⥤ Cᵒᵖ ⥤ Type v` creates such products (6.1.17)
33-
* the functor `C ⥤ Ind C` preserves small limits.
34+
* the functor `C ⥤ Ind C` preserves small limits,
35+
* if `C` has coequalizers, then `Ind C` has coequalizers (6.1.18(i)).
3436
3537
More limit-colimit properties will follow.
3638
@@ -43,7 +45,7 @@ Note that:
4345
* [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Chapter 6
4446
-/
4547

46-
universe v u
48+
universe w v u
4749

4850
namespace CategoryTheory
4951

@@ -180,14 +182,14 @@ noncomputable def Ind.limCompInclusion {I : Type v} [SmallCategory I] [IsFiltere
180182
_ ≅ (whiskeringRight _ _ _).obj yoneda ⋙ colim :=
181183
isoWhiskerRight ((whiskeringRight _ _ _).mapIso (Ind.yonedaCompInclusion)) colim
182184

183-
instance {α : Type v} [SmallCategory α] [FinCategory α] [HasLimitsOfShape α C] {I : Type v}
185+
instance {α : Type w} [SmallCategory α] [FinCategory α] [HasLimitsOfShape α C] {I : Type v}
184186
[SmallCategory I] [IsFiltered I] :
185187
PreservesLimitsOfShape α (Ind.lim I : (I ⥤ C) ⥤ _) :=
186188
haveI : PreservesLimitsOfShape α (Ind.lim I ⋙ Ind.inclusion C) :=
187189
preservesLimitsOfShape_of_natIso Ind.limCompInclusion.symm
188190
preservesLimitsOfShape_of_reflects_of_preserves _ (Ind.inclusion C)
189191

190-
instance {α : Type v} [SmallCategory α] [FinCategory α] [HasColimitsOfShape α C] {I : Type v}
192+
instance {α : Type w} [SmallCategory α] [FinCategory α] [HasColimitsOfShape α C] {I : Type v}
191193
[SmallCategory I] [IsFiltered I] :
192194
PreservesColimitsOfShape α (Ind.lim I : (I ⥤ C) ⥤ _) :=
193195
inferInstanceAs (PreservesColimitsOfShape α (_ ⋙ colim))
@@ -209,11 +211,43 @@ instance {α : Type v} [Finite α] [HasColimitsOfShape (Discrete α) C] :
209211
-- ```
210212
-- from the fact that finite limits commute with filtered colimits and from the fact that
211213
-- `Ind.yoneda` preserves finite colimits.
212-
apply hasColimitOfIso iso.symm
214+
exact hasColimitOfIso iso.symm
213215

214216
instance [HasFiniteCoproducts C] : HasCoproducts.{v} (Ind C) :=
215217
have : HasFiniteCoproducts (Ind C) :=
216218
fun _ => hasColimitsOfShape_of_equivalence (Discrete.equivalence Equiv.ulift)⟩
217219
hasCoproducts_of_finite_and_filtered
218220

221+
/-- Given an `IndParallelPairPresentation f g`, we can understand the parallel pair `(f, g)` as
222+
the colimit of `(P.φ, P.ψ)` in `Ind C`. -/
223+
noncomputable def IndParallelPairPresentation.parallelPairIsoParallelPairCompIndYoneda
224+
{A B : Ind C} {f g : A ⟶ B}
225+
(P : IndParallelPairPresentation ((Ind.inclusion _).map f) ((Ind.inclusion _).map g)) :
226+
parallelPair f g ≅ parallelPair P.φ P.ψ ⋙ Ind.lim P.I :=
227+
((whiskeringRight WalkingParallelPair _ _).obj (Ind.inclusion C)).preimageIso <|
228+
diagramIsoParallelPair _ ≪≫
229+
P.parallelPairIsoParallelPairCompYoneda ≪≫
230+
isoWhiskerLeft (parallelPair _ _) Ind.limCompInclusion.symm
231+
232+
instance [HasColimitsOfShape WalkingParallelPair C] :
233+
HasColimitsOfShape WalkingParallelPair (Ind C) := by
234+
refine ⟨fun F => ?_⟩
235+
obtain ⟨P⟩ := nonempty_indParallelPairPresentation (F.obj WalkingParallelPair.zero).2
236+
(F.obj WalkingParallelPair.one).2 (Ind.inclusion _ |>.map <| F.map WalkingParallelPairHom.left)
237+
(Ind.inclusion _ |>.map <| F.map WalkingParallelPairHom.right)
238+
exact hasColimitOfIso (diagramIsoParallelPair _ ≪≫ P.parallelPairIsoParallelPairCompIndYoneda)
239+
240+
/-- A way to understand morphisms in `Ind C`: every morphism is induced by a natural transformation
241+
of diagrams. -/
242+
theorem Ind.exists_nonempty_arrow_mk_iso_ind_lim {A B : Ind C} {f : A ⟶ B} :
243+
∃ (I : Type v) (_ : SmallCategory I) (_ : IsFiltered I) (F G : I ⥤ C) (φ : F ⟶ G),
244+
Nonempty (Arrow.mk f ≅ Arrow.mk ((Ind.lim _).map φ)) := by
245+
obtain ⟨P⟩ := nonempty_indParallelPairPresentation A.2 B.2
246+
(Ind.inclusion _ |>.map f) (Ind.inclusion _ |>.map f)
247+
refine ⟨P.I, inferInstance, inferInstance, P.F₁, P.F₂, P.φ, ⟨Arrow.isoMk ?_ ?_ ?_⟩⟩
248+
· exact P.parallelPairIsoParallelPairCompIndYoneda.app WalkingParallelPair.zero
249+
· exact P.parallelPairIsoParallelPairCompIndYoneda.app WalkingParallelPair.one
250+
· simpa using
251+
(P.parallelPairIsoParallelPairCompIndYoneda.hom.naturality WalkingParallelPairHom.left).symm
252+
219253
end CategoryTheory

Mathlib/CategoryTheory/Limits/Indization/Equalizers.lean

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,15 @@ 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
8+
import Mathlib.CategoryTheory.Limits.Indization.ParallelPair
79

810
/-!
911
# Equalizers of ind-objects
1012
11-
The eventual goal of this file is to show that if a category `C` has equalizers, then ind-objects
12-
are closed under equalizers. For now, it contains one of the main prerequisites, namely we show
13-
that under sufficient conditions the limit of a diagram in `I ⥤ C` taken in `Cᵒᵖ ⥤ Type v` is an
14-
ind-object.
13+
We show that if a category `C` has equalizers, then ind-objects are closed under equalizers.
1514
16-
## References
15+
# References
1716
* [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Section 6.1
1817
-/
1918

@@ -60,4 +59,21 @@ theorem isIndObject_limit_comp_yoneda_comp_colim
6059

6160
end
6261

62+
/-- If `C` has equalizers. then ind-objects are closed under equalizers.
63+
64+
This is Proposition 6.1.17(i) in [Kashiwara2006].
65+
-/
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 _))
78+
6379
end CategoryTheory.Limits
Lines changed: 171 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,171 @@
1+
/-
2+
Copyright (c) 2025 Markus Himmel. All rights reserved.
3+
Released under Apache 2.0 license as described in the file LICENSE.
4+
Authors: Markus Himmel
5+
-/
6+
import Mathlib.CategoryTheory.Comma.Final
7+
import Mathlib.CategoryTheory.Limits.Indization.IndObject
8+
9+
/-!
10+
# Parallel pairs of natural transformations between ind-objects
11+
12+
We show that if `A` and `B` are ind-objects and `f` and `g` are natural transformations between
13+
`A` and `B`, then there is a small filtered category `I` such that `A`, `B`, `f` and `g` are
14+
commonly presented by diagrams and natural transformations in `I ⥤ C`.
15+
16+
17+
## References
18+
* [M. Kashiwara, P. Schapira, *Categories and Sheaves*][Kashiwara2006], Proposition 6.1.15 (though
19+
our proof is more direct).
20+
-/
21+
22+
universe v₁ v₂ v₃ u₁ u₂ u₃
23+
24+
namespace CategoryTheory
25+
26+
open Limits
27+
28+
variable {C : Type u₁} [Category.{v₁} C]
29+
30+
/-- Structure containing data exhibiting two parallel natural transformations `f` and `g` between
31+
presheaves `A` and `B` as induced by a natural transformation in a functor category exhibiting
32+
`A` and `B` as ind-objects. -/
33+
structure IndParallelPairPresentation {A B : Cᵒᵖ ⥤ Type v₁} (f g : A ⟶ B) where
34+
/-- The indexing category. -/
35+
I : Type v₁
36+
/-- Category instance on the indexing category. -/
37+
[ℐ : SmallCategory I]
38+
[hI : IsFiltered I]
39+
/-- The diagram presenting `A`. -/
40+
F₁ : I ⥤ C
41+
/-- The diagram presenting `B`. -/
42+
F₂ : I ⥤ C
43+
/-- The cocone on `F₁` with apex `A`. -/
44+
ι₁ : F₁ ⋙ yoneda ⟶ (Functor.const I).obj A
45+
/-- The cocone on `F₁` with apex `A` is a colimit cocone. -/
46+
isColimit₁ : IsColimit (Cocone.mk A ι₁)
47+
/-- The cocone on `F₂` with apex `B`. -/
48+
ι₂ : F₂ ⋙ yoneda ⟶ (Functor.const I).obj B
49+
/-- The cocone on `F₂` with apex `B` is a colimit cocone. -/
50+
isColimit₂ : IsColimit (Cocone.mk B ι₂)
51+
/-- The natural transformation presenting `f`. -/
52+
φ : F₁ ⟶ F₂
53+
/-- The natural transformation presenting `g`. -/
54+
ψ : F₁ ⟶ F₂
55+
/-- `f` is in fact presented by `φ`. -/
56+
hf : f = IsColimit.map isColimit₁ (Cocone.mk B ι₂) (whiskerRight φ yoneda)
57+
/-- `g` is in fact presented by `ψ`. -/
58+
hg : g = IsColimit.map isColimit₁ (Cocone.mk B ι₂) (whiskerRight ψ yoneda)
59+
60+
instance {A B : Cᵒᵖ ⥤ Type v₁} {f g : A ⟶ B} (P : IndParallelPairPresentation f g) :
61+
SmallCategory P.I := P.ℐ
62+
instance {A B : Cᵒᵖ ⥤ Type v₁} {f g : A ⟶ B} (P : IndParallelPairPresentation f g) :
63+
IsFiltered P.I := P.hI
64+
65+
namespace NonemptyParallelPairPresentationAux
66+
67+
variable {A B : Cᵒᵖ ⥤ Type v₁} (f g : A ⟶ B) (P₁ : IndObjectPresentation A)
68+
(P₂ : IndObjectPresentation B)
69+
70+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
71+
abbrev K : Type v₁ :=
72+
Comma ((P₁.toCostructuredArrow ⋙ CostructuredArrow.map f).prod'
73+
(P₁.toCostructuredArrow ⋙ CostructuredArrow.map g))
74+
(P₂.toCostructuredArrow.prod' P₂.toCostructuredArrow)
75+
76+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
77+
abbrev F₁ : K f g P₁ P₂ ⥤ C := Comma.fst _ _ ⋙ P₁.F
78+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
79+
abbrev F₂ : K f g P₁ P₂ ⥤ C := Comma.snd _ _ ⋙ P₂.F
80+
81+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
82+
abbrev ι₁ : F₁ f g P₁ P₂ ⋙ yoneda ⟶ (Functor.const (K f g P₁ P₂)).obj A :=
83+
whiskerLeft (Comma.fst _ _) P₁.ι
84+
85+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
86+
noncomputable abbrev isColimit₁ : IsColimit (Cocone.mk A (ι₁ f g P₁ P₂)) :=
87+
(Functor.Final.isColimitWhiskerEquiv _ _).symm P₁.isColimit
88+
89+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
90+
abbrev ι₂ : F₂ f g P₁ P₂ ⋙ yoneda ⟶ (Functor.const (K f g P₁ P₂)).obj B :=
91+
whiskerLeft (Comma.snd _ _) P₂.ι
92+
93+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
94+
noncomputable abbrev isColimit₂ : IsColimit (Cocone.mk B (ι₂ f g P₁ P₂)) :=
95+
(Functor.Final.isColimitWhiskerEquiv _ _).symm P₂.isColimit
96+
97+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
98+
def ϕ : F₁ f g P₁ P₂ ⟶ F₂ f g P₁ P₂ where
99+
app h := h.hom.1.left
100+
naturality _ _ h := by
101+
have := h.w
102+
simp only [Functor.prod'_obj, Functor.comp_obj, prod_Hom, Functor.prod'_map, Functor.comp_map,
103+
prod_comp, Prod.mk.injEq, CostructuredArrow.hom_eq_iff, CostructuredArrow.map_obj_left,
104+
IndObjectPresentation.toCostructuredArrow_obj_left, CostructuredArrow.comp_left,
105+
CostructuredArrow.map_map_left, IndObjectPresentation.toCostructuredArrow_map_left] at this
106+
exact this.1
107+
108+
theorem hf : f = IsColimit.map (isColimit₁ f g P₁ P₂)
109+
(Cocone.mk B (ι₂ f g P₁ P₂)) (whiskerRight (ϕ f g P₁ P₂) yoneda) := by
110+
refine (isColimit₁ f g P₁ P₂).hom_ext (fun i => ?_)
111+
rw [IsColimit.ι_map]
112+
simpa using i.hom.1.w.symm
113+
114+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
115+
def ψ : F₁ f g P₁ P₂ ⟶ F₂ f g P₁ P₂ where
116+
app h := h.hom.2.left
117+
naturality _ _ h := by
118+
have := h.w
119+
simp only [Functor.prod'_obj, Functor.comp_obj, prod_Hom, Functor.prod'_map, Functor.comp_map,
120+
prod_comp, Prod.mk.injEq, CostructuredArrow.hom_eq_iff, CostructuredArrow.map_obj_left,
121+
IndObjectPresentation.toCostructuredArrow_obj_left, CostructuredArrow.comp_left,
122+
CostructuredArrow.map_map_left, IndObjectPresentation.toCostructuredArrow_map_left] at this
123+
exact this.2
124+
125+
theorem hg : g = IsColimit.map (isColimit₁ f g P₁ P₂)
126+
(Cocone.mk B (ι₂ f g P₁ P₂)) (whiskerRight (ψ f g P₁ P₂) yoneda) := by
127+
refine (isColimit₁ f g P₁ P₂).hom_ext (fun i => ?_)
128+
rw [IsColimit.ι_map]
129+
simpa using i.hom.2.w.symm
130+
131+
attribute [local instance] Comma.isFiltered_of_final in
132+
/-- Implementation; see `nonempty_indParallelPairPresentation`. -/
133+
noncomputable def presentation : IndParallelPairPresentation f g where
134+
I := K f g P₁ P₂
135+
F₁ := F₁ f g P₁ P₂
136+
F₂ := F₂ f g P₁ P₂
137+
ι₁ := ι₁ f g P₁ P₂
138+
isColimit₁ := isColimit₁ f g P₁ P₂
139+
ι₂ := ι₂ f g P₁ P₂
140+
isColimit₂ := isColimit₂ f g P₁ P₂
141+
φ := ϕ f g P₁ P₂
142+
ψ := ψ f g P₁ P₂
143+
hf := hf f g P₁ P₂
144+
hg := hg f g P₁ P₂
145+
146+
end NonemptyParallelPairPresentationAux
147+
148+
theorem nonempty_indParallelPairPresentation {A B : Cᵒᵖ ⥤ Type v₁} (hA : IsIndObject A)
149+
(hB : IsIndObject B) (f g : A ⟶ B) : Nonempty (IndParallelPairPresentation f g) :=
150+
⟨NonemptyParallelPairPresentationAux.presentation f g hA.presentation hB.presentation⟩
151+
152+
namespace IndParallelPairPresentation
153+
154+
/-- Given an `IndParallelPairPresentation f g`, we can understand the parallel pair `(f, g)`
155+
as the colimit of `(P.φ, P.ψ)` in `Cᵒᵖ ⥤ Type v`. -/
156+
noncomputable def parallelPairIsoParallelPairCompYoneda {A B : Cᵒᵖ ⥤ Type v₁} {f g : A ⟶ B}
157+
(P : IndParallelPairPresentation f g) :
158+
parallelPair f g ≅ parallelPair P.φ P.ψ ⋙ (whiskeringRight _ _ _).obj yoneda ⋙ colim :=
159+
parallelPair.ext
160+
(P.isColimit₁.coconePointUniqueUpToIso (colimit.isColimit _))
161+
(P.isColimit₂.coconePointUniqueUpToIso (colimit.isColimit _))
162+
(P.isColimit₁.hom_ext (fun j => by
163+
simp [P.hf, P.isColimit₁.ι_map_assoc, P.isColimit₁.comp_coconePointUniqueUpToIso_hom_assoc,
164+
P.isColimit₂.comp_coconePointUniqueUpToIso_hom]))
165+
(P.isColimit₁.hom_ext (fun j => by
166+
simp [P.hg, P.isColimit₁.ι_map_assoc, P.isColimit₁.comp_coconePointUniqueUpToIso_hom_assoc,
167+
P.isColimit₂.comp_coconePointUniqueUpToIso_hom]))
168+
169+
end IndParallelPairPresentation
170+
171+
end CategoryTheory

0 commit comments

Comments
 (0)