Skip to content

Commit 69b0864

Browse files
committed
refactor(CategoryTheory/Limits): split MultispanIndex into two structures (#20988)
Before this PR, multiequalizers were defined for a structure `MulticospanIndex C` which contained information about the shape of the diagram, and the diagram itself (objects and maps in a category `C`). In this PR, we introduce the shape `MulticospanShape` which consists of two types and two maps between these types. If `J : MulticospanShape` and `C` is a category, we now have `MultispanIndex J C` which contains the information about the multiequalizer diagram. If `I : MulticospanIndex J C`, we now have a functor `I.multicospan : WalkingMulticospan J ⥤ C`. This refactor will ease the study of multiequalizers. For example, if `I` and `I'` are two terms in `MulticospanIndex J C`, it makes sense to show that the associated functors `WalkingMulticospan J ⥤ C` are isomorphic, etc.
1 parent 6084680 commit 69b0864

File tree

13 files changed

+212
-176
lines changed

13 files changed

+212
-176
lines changed

Mathlib/CategoryTheory/GlueData.lean

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -122,32 +122,12 @@ def sigmaOpens [HasCoproduct D.U] : C :=
122122
∐ D.U
123123

124124
/-- (Implementation) The diagram to take colimit of. -/
125-
def diagram : MultispanIndex C where
126-
L := D.J × D.J
127-
R := D.J
128-
fstFrom := _root_.Prod.fst
129-
sndFrom := _root_.Prod.snd
125+
def diagram : MultispanIndex (.prod D.J) C where
130126
left := D.V
131127
right := D.U
132128
fst := fun ⟨i, j⟩ => D.f i j
133129
snd := fun ⟨i, j⟩ => D.t i j ≫ D.f j i
134130

135-
@[simp]
136-
theorem diagram_l : D.diagram.L = (D.J × D.J) :=
137-
rfl
138-
139-
@[simp]
140-
theorem diagram_r : D.diagram.R = D.J :=
141-
rfl
142-
143-
@[simp]
144-
theorem diagram_fstFrom (i j : D.J) : D.diagram.fstFrom ⟨i, j⟩ = i :=
145-
rfl
146-
147-
@[simp]
148-
theorem diagram_sndFrom (i j : D.J) : D.diagram.sndFrom ⟨i, j⟩ = j :=
149-
rfl
150-
151131
@[simp]
152132
theorem diagram_fst (i j : D.J) : D.diagram.fst ⟨i, j⟩ = D.f i j :=
153133
rfl

Mathlib/CategoryTheory/Limits/Shapes/ConcreteCategory.lean

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -249,9 +249,10 @@ section Multiequalizer
249249

250250
variable [HasForget.{max w w' v} C]
251251

252-
theorem multiequalizer_ext {I : MulticospanIndex.{w, w'} C} [HasMultiequalizer I]
252+
theorem multiequalizer_ext {J : MulticospanShape.{w, w'}}
253+
{I : MulticospanIndex J C} [HasMultiequalizer I]
253254
[PreservesLimit I.multicospan (forget C)] (x y : ↑(multiequalizer I))
254-
(h : ∀ t : I.L, Multiequalizer.ι I t x = Multiequalizer.ι I t y) : x = y := by
255+
(h : ∀ t : J.L, Multiequalizer.ι I t x = Multiequalizer.ι I t y) : x = y := by
255256
apply Concrete.limit_ext
256257
rintro (a | b)
257258
· apply h
@@ -260,9 +261,9 @@ theorem multiequalizer_ext {I : MulticospanIndex.{w, w'} C} [HasMultiequalizer I
260261
simp [h]
261262

262263
/-- An auxiliary equivalence to be used in `multiequalizerEquiv` below. -/
263-
def multiequalizerEquivAux (I : MulticospanIndex.{w, w'} C) :
264+
def multiequalizerEquivAux {J : MulticospanShape.{w, w'}} (I : MulticospanIndex J C) :
264265
(I.multicospan ⋙ forget C).sections ≃
265-
{ x : ∀ i : I.L, I.left i // ∀ i : I.R, I.fst i (x _) = I.snd i (x _) } where
266+
{ x : ∀ i : J.L, I.left i // ∀ i : J.R, I.fst i (x _) = I.snd i (x _) } where
266267
toFun x :=
267268
fun _ => x.1 (WalkingMulticospan.left _), fun i => by
268269
have a := x.2 (WalkingMulticospan.Hom.fst i)
@@ -293,19 +294,21 @@ def multiequalizerEquivAux (I : MulticospanIndex.{w, w'} C) :
293294

294295
/-- The equivalence between the noncomputable multiequalizer and
295296
the concrete multiequalizer. -/
296-
noncomputable def multiequalizerEquiv (I : MulticospanIndex.{w, w'} C) [HasMultiequalizer I]
297+
noncomputable def multiequalizerEquiv {J : MulticospanShape.{w, w'}}
298+
(I : MulticospanIndex J C) [HasMultiequalizer I]
297299
[PreservesLimit I.multicospan (forget C)] :
298300
(multiequalizer I : C) ≃
299-
{ x : ∀ i : I.L, I.left i // ∀ i : I.R, I.fst i (x _) = I.snd i (x _) } :=
301+
{ x : ∀ i : J.L, I.left i // ∀ i : J.R, I.fst i (x _) = I.snd i (x _) } :=
300302
letI h1 := limit.isLimit I.multicospan
301303
letI h2 := isLimitOfPreserves (forget C) h1
302304
letI E := h2.conePointUniqueUpToIso (Types.limitConeIsLimit.{max w w', v} _)
303305
Equiv.trans E.toEquiv (Concrete.multiequalizerEquivAux I)
304306

305307
@[simp]
306-
theorem multiequalizerEquiv_apply (I : MulticospanIndex.{w, w'} C) [HasMultiequalizer I]
307-
[PreservesLimit I.multicospan (forget C)] (x : ↑(multiequalizer I)) (i : I.L) :
308-
((Concrete.multiequalizerEquiv I) x : ∀ i : I.L, I.left i) i = Multiequalizer.ι I i x :=
308+
theorem multiequalizerEquiv_apply {J : MulticospanShape.{w, w'}}
309+
(I : MulticospanIndex J C) [HasMultiequalizer I]
310+
[PreservesLimit I.multicospan (forget C)] (x : ↑(multiequalizer I)) (i : J.L) :
311+
((Concrete.multiequalizerEquiv I) x : ∀ i : J.L, I.left i) i = Multiequalizer.ι I i x :=
309312
rfl
310313

311314
end Multiequalizer

Mathlib/CategoryTheory/Limits/Shapes/End.lean

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,19 @@ namespace Limits
3232
variable {J : Type u} [Category.{v} J] {C : Type u'} [Category.{v'} C]
3333
(F : Jᵒᵖ ⥤ J ⥤ C)
3434

35-
/-- Given `F : Jᵒᵖ ⥤ J ⥤ C`, this is the multicospan index which shall be used
36-
to define the end of `F`. -/
35+
variable (J) in
36+
/-- The shape of multiequalizer diagrams involved in the definition of ends. -/
3737
@[simps]
38-
def multicospanIndexEnd : MulticospanIndex C where
38+
def multicospanShapeEnd : MulticospanShape where
3939
L := J
4040
R := Arrow J
41-
fstTo f := f.left
42-
sndTo f := f.right
41+
fst f := f.left
42+
snd f := f.right
43+
44+
/-- Given `F : Jᵒᵖ ⥤ J ⥤ C`, this is the multicospan index which shall be used
45+
to define the end of `F`. -/
46+
@[simps]
47+
def multicospanIndexEnd : MulticospanIndex (multicospanShapeEnd J) C where
4348
left j := (F.obj (op j)).obj j
4449
right f := (F.obj (op f.left)).obj f.right
4550
fst f := (F.obj (op f.left)).map f.hom

0 commit comments

Comments
 (0)