Skip to content

Commit 30dfca1

Browse files
juliankompre-commit-ci-lite[bot]joelriou
committed
feat(AlgebraicTopology/Quasicategory): define the homotopy category of a 2-truncated quasicategory (#31630)
The homotopy category `HomotopyCategory₂ A` of a 2-truncated quasicategory `A` has: * objects given by the vertices of `A` * morphisms given by (left) homotopy classes of edges between two vertices. From: https://github.com/emilyriehl/infinity-cosmos Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Co-authored-by: Joël Riou <37772949+joelriou@users.noreply.github.com>
1 parent a746252 commit 30dfca1

File tree

1 file changed

+173
-12
lines changed

1 file changed

+173
-12
lines changed

Mathlib/AlgebraicTopology/Quasicategory/TwoTruncated.lean

Lines changed: 173 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/-
22
Copyright (c) 2025 Julian Komaromy. All rights reserved.
33
Released under Apache 2.0 license as described in the file LICENSE.
4-
Authors: Julian Komaromy
4+
Authors: Julian Komaromy, Joël Riou
55
-/
66
module
77

@@ -18,6 +18,15 @@ and the left and right homotopy relations `HomotopicL` and `HomotopicR` on the e
1818
We prove that for 2-truncated quasicategories, both homotopy relations are equivalence
1919
relations, and that the left and right homotopy relations coincide.
2020
21+
For a 2-truncated quasicategory `A`, we define a category `HomotopyCategory₂ A` whose
22+
morphisms are given by (left) homotopy classes of edges. The construction of this category
23+
is different from `HomotopyCategory A` in `AlgebraicTopology.SimplicialSet.HomotopyCat`:
24+
* `HomotopyCategory₂ A` has morphisms given by homotopy classes of edges
25+
* `HomotopyCategory A` has morphisms given by equivalence classes of paths in the underlying
26+
reflexive quiver of `A`.
27+
28+
The two constructions agree for 2-truncated quasicategories (TODO: handled by future PR).
29+
2130
## Implementation notes
2231
2332
Throughout this file, we make use of `Edge` and `CompStruct` to conveniently deal with
@@ -63,15 +72,15 @@ class Quasicategory₂ (X : Truncated 2) where
6372

6473
/--
6574
Two edges `f` and `g` are left homotopic if there is a `CompStruct` with
66-
(0, 1)-edge `f`, (1, 2)-edge `id` and (0, 2)-edge `g`. We use `Nonempty` to
75+
(0, 1)-edge `f`, (1, 2)-edge `Edge.id` and (0, 2)-edge `g`. We use `Nonempty` to
6776
have a `Prop` valued `HomotopicL`.
6877
-/
6978
abbrev HomotopicL {X : Truncated 2} {x y : X _⦋0⦌₂} (f g : Edge x y) :=
7079
Nonempty (CompStruct f (id y) g)
7180

7281
/--
7382
Two edges `f` and `g` are right homotopic if there is a `CompStruct` with
74-
(0, 1)-edge `id`, (1, 2)-edge `f`, and (0, 2)-edge `g`. We use `Nonempty` to
83+
(0, 1)-edge `Edge.id`, (1, 2)-edge `f`, and (0, 2)-edge `g`. We use `Nonempty` to
7584
have a `Prop` valued `HomotopicR`.
7685
-/
7786
abbrev HomotopicR {X : Truncated 2} {x y : X _⦋0⦌₂} (f g : Edge x y) :=
@@ -81,20 +90,20 @@ section homotopy_eqrel
8190
variable {X : Truncated 2}
8291

8392
/--
84-
Left homotopy relation is reflexive
93+
The left homotopy relation is reflexive.
8594
-/
8695
lemma HomotopicL.refl {x y : X _⦋0⦌₂} {f : Edge x y} : HomotopicL f f := ⟨compId f⟩
8796

8897
/--
89-
Left homotopy relation is symmetric
98+
The left homotopy relation is symmetric.
9099
-/
91100
lemma HomotopicL.symm [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g : Edge x y} (hfg : HomotopicL f g) :
92101
HomotopicL g f := by
93102
rcases hfg with ⟨hfg⟩
94103
exact Quasicategory₂.fill31 hfg (idComp (id y)) (compId f)
95104

96105
/--
97-
Left homotopy relation is transitive
106+
The left homotopy relation is transitive.
98107
-/
99108
lemma HomotopicL.trans [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g h : Edge x y} (hfg : HomotopicL f g)
100109
(hgh : HomotopicL g h) : HomotopicL f h := by
@@ -103,20 +112,20 @@ lemma HomotopicL.trans [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g h : Edge
103112
exact Quasicategory₂.fill32 hfg (idComp (id y)) hgh
104113

105114
/--
106-
Right homotopy relation is reflexive
115+
The right homotopy relation is reflexive.
107116
-/
108117
lemma HomotopicR.refl {x y : X _⦋0⦌₂} {f : Edge x y} : HomotopicR f f := ⟨idComp f⟩
109118

110119
/--
111-
Right homotopy relation is symmetric
120+
The right homotopy relation is symmetric.
112121
-/
113122
lemma HomotopicR.symm [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g : Edge x y} (hfg : HomotopicR f g) :
114123
HomotopicR g f := by
115124
rcases hfg with ⟨hfg⟩
116125
exact Quasicategory₂.fill32 (idComp (id x)) hfg (idComp f)
117126

118127
/--
119-
Right homotopy relation is transitive
128+
The right homotopy relation is transitive.
120129
-/
121130
lemma HomotopicR.trans [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g h : Edge x y} (hfg : HomotopicR f g)
122131
(hgh : HomotopicR g h) : HomotopicR f h := by
@@ -125,28 +134,180 @@ lemma HomotopicR.trans [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g h : Edge
125134
exact Quasicategory₂.fill31 (idComp (id x)) hfg hgh
126135

127136
/--
128-
In a 2-truncated quasicategory, left homotopy implies right homotopy
137+
In a 2-truncated quasicategory, left homotopy implies right homotopy.
129138
-/
130139
lemma HomotopicL.homotopicR [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g : Edge x y}
131140
(h : HomotopicL f g) : HomotopicR f g := by
132141
rcases h with ⟨h⟩
133142
exact Quasicategory₂.fill32 (idComp f) (compId f) h
134143

135144
/--
136-
In a 2-truncated quasicategory, right homotopy implies left homotopy
145+
In a 2-truncated quasicategory, right homotopy implies left homotopy.
137146
-/
138147
lemma HomotopicR.homotopicL [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g : Edge x y}
139148
(h : HomotopicR f g) : HomotopicL f g := by
140149
rcases h with ⟨h⟩
141150
exact Quasicategory₂.fill31 (idComp f) (compId f) h
142151

143152
/--
144-
In a 2-truncated quasicategory, the right and left homotopy relations coincide
153+
In a 2-truncated quasicategory, the right and left homotopy relations coincide.
145154
-/
146155
theorem homotopicL_iff_homotopicR [Quasicategory₂ X] {x y : X _⦋0⦌₂} {f g : Edge x y} :
147156
HomotopicL f g ↔ HomotopicR f g :=
148157
⟨HomotopicL.homotopicR, HomotopicR.homotopicL⟩
149158

150159
end homotopy_eqrel
151160

161+
section homotopy_category
162+
163+
variable {A : Truncated 2} [Quasicategory₂ A] {x y z : A _⦋0⦌₂}
164+
165+
/--
166+
Given `CompStruct f g h` and `CompStruct f' g' h'` with the same vertices and edges such
167+
that `f` ≃ `f'` and `g` ≃ `g'`, then the long diagonal edges `h` and `h'` are also homotopic.
168+
-/
169+
lemma Edge.CompStruct.comp_unique {f f' : Edge x y} {g g' : Edge y z} {h h' : Edge x z}
170+
(s : CompStruct f g h) (s' : CompStruct f' g' h')
171+
(hf : HomotopicL f f') (hg : HomotopicL g g') : HomotopicL h h' := by
172+
rcases hg.homotopicR with ⟨hg⟩
173+
rcases hf with ⟨hf⟩
174+
let ⟨s₁⟩ := Quasicategory₂.fill32 hf (idComp g') s'
175+
let ⟨s₂⟩ := Quasicategory₂.fill31 (compId f) hg s₁
176+
exact Quasicategory₂.fill31 s (compId g) s₂
177+
178+
/--
179+
Given two consecutive edges `f`, `g` in a 2-truncated quasicategory, nonconstructively choose
180+
an edge that is the diagonal of a 2-simplex with spine given by `f` and `g`. The `CompStruct`
181+
witnessing this property is given by `Edge.composeStruct`.
182+
-/
183+
noncomputable def Edge.comp (f : Edge x y) (g : Edge y z) : Edge x z :=
184+
(Quasicategory₂.fill21 f g).some.1
185+
186+
/--
187+
See `Edge.comp`
188+
-/
189+
noncomputable def Edge.compStruct (f : Edge x y) (g : Edge y z) : CompStruct f g (f.comp g) :=
190+
(Quasicategory₂.fill21 f g).some.2
191+
192+
/--
193+
The homotopy category of a 2-truncated quasicategory `A` has as objects the vertices of `A`
194+
-/
195+
structure HomotopyCategory₂ (A : Truncated 2) where
196+
/-- An object of the homotopy category is a vertex of `A`. -/
197+
pt : A _⦋0⦌₂
198+
199+
/--
200+
Left homotopy is an equivalence relation on the edges of `A`.
201+
Remark: We could have equivalently chosen right homotopy, as shown by `homotopicL_iff_homotopicR`.
202+
-/
203+
instance instSetoidEdge (x y : A _⦋0⦌₂) : Setoid (Edge x y) where
204+
r := HomotopicL
205+
iseqv := ⟨fun _ ↦ HomotopicL.refl, HomotopicL.symm, HomotopicL.trans⟩
206+
207+
namespace HomotopyCategory₂
208+
209+
/--
210+
The morphisms between two vertices `x`, `y` in `HomotopyCategory₂ A` are homotopy classes
211+
of edges between `x` and `y`.
212+
-/
213+
def Hom (x y : HomotopyCategory₂ A) := Quotient (instSetoidEdge x.pt y.pt)
214+
215+
/--
216+
Composition of morphisms in `HomotopyCategory₂ A` is given by lifting the edge
217+
chosen by `composeEdges`.
218+
-/
219+
noncomputable
220+
instance : CategoryStruct (HomotopyCategory₂ A) where
221+
Hom x y := Hom x y
222+
id x := Quotient.mk' (Edge.id x.pt)
223+
comp := Quotient.lift₂ (fun f g ↦ ⟦comp f g⟧)
224+
(fun _ _ _ _ hf hg ↦ Quotient.sound
225+
(Edge.CompStruct.comp_unique (compStruct _ _) (compStruct _ _) hf hg))
226+
227+
omit [A.Quasicategory₂] in
228+
/--
229+
The function `HomotopyCategory₂.mk` taking a vertex of `A` and sending it to the corresponding
230+
object of `HomotopyCategory₂ A` is surjective.
231+
-/
232+
lemma mk_surjective : Function.Surjective (mk : A _⦋0⦌₂ → _) :=
233+
fun ⟨x⟩ ↦ ⟨x, rfl⟩
234+
235+
/--
236+
Any edge in the 2-truncated simplicial set `A` defines a morphism in the homotopy category
237+
by taking its equivalence class.
238+
-/
239+
def homMk (f : Edge x y) : mk x ⟶ mk y := ⟦f⟧
240+
241+
/--
242+
Every morphism in the homotopy category `HomotopyCategory₂ A` is the equivalence class of
243+
an edge of `A`.
244+
-/
245+
lemma homMk_surjective : Function.Surjective (homMk : Edge x y → _) := Quotient.mk_surjective
246+
247+
/--
248+
The trivial (degenerate) edge at a vertex `x` is a representative for the
249+
identity morphism `x ⟶ x`.
250+
-/
251+
@[simp]
252+
lemma homMk_id (x : HomotopyCategory₂ A) : homMk (Edge.id x.pt) = 𝟙 x := rfl
253+
254+
end HomotopyCategory₂
255+
256+
open HomotopyCategory₂
257+
258+
/--
259+
Left homotopic edges represent the same morphism in the homotopy category.
260+
-/
261+
lemma HomotopicL.congr_homotopyCategory₂HomMk {f g : Edge x y} (h : HomotopicL f g) :
262+
homMk f = homMk g := Quotient.sound h
263+
264+
/--
265+
Right homotopic edges represent the same morphism in the homotopy category.
266+
-/
267+
lemma HomotopicR.congr_homotopyCategory₂HomMk {f g : Edge x y} (h : HomotopicR f g) :
268+
homMk f = homMk g := Quotient.sound h.homotopicL
269+
270+
/--
271+
A `CompStruct f g h` is a witness for the fact that the morphisms represented by
272+
`f` and `g` compose to the morphism represented by `h`.
273+
-/
274+
lemma Edge.CompStruct.homotopyCategory₂_fac {f : Edge x y} {g : Edge y z} {h : Edge x z}
275+
(s : CompStruct f g h) : homMk f ≫ homMk g = homMk h :=
276+
(comp_unique (compStruct _ _) s .refl .refl).congr_homotopyCategory₂HomMk
277+
278+
/--
279+
If we have a factorization `homMk f ≫ homMk g = homMk h`, this is the choice
280+
of a structure `CompStruct f g h`.
281+
-/
282+
noncomputable def Edge.CompStruct.ofHomotopyCategory₂Fac
283+
{f : Edge x y} {g : Edge y z} {h : Edge x z}
284+
(fac : homMk f ≫ homMk g = homMk h) : CompStruct f g h := by
285+
dsimp [homMk, CategoryStruct.comp] at fac
286+
rw [Quotient.eq_iff_equiv] at fac
287+
exact (Quasicategory₂.fill32 (compStruct f g) (compId g) fac.some).some
288+
289+
/--
290+
Given edges `f`, `g` and `h` of a `2`-truncated quasicategory,
291+
there exists a structure `CompStruct f g h` iff
292+
`homMk f ≫ homMk g = homMk h` holds in the homotopy category.
293+
-/
294+
lemma Edge.CompStruct.nonempty_iff {f : Edge x y} {g : Edge y z} {h : Edge x z} :
295+
Nonempty (CompStruct f g h) ↔ homMk f ≫ homMk g = homMk h :=
296+
fun ⟨h⟩ ↦ h.homotopyCategory₂_fac, fun h ↦ ⟨.ofHomotopyCategory₂Fac h⟩⟩
297+
298+
noncomputable
299+
instance : Category (HomotopyCategory₂ A) where
300+
id_comp := by
301+
rintro _ _ ⟨f⟩
302+
exact ((compStruct _ f).comp_unique (idComp _) .refl .refl).congr_homotopyCategory₂HomMk
303+
comp_id := by
304+
rintro _ _ ⟨f⟩
305+
exact ((compStruct _ _).comp_unique (compId _) .refl .refl).congr_homotopyCategory₂HomMk
306+
assoc := by
307+
rintro _ _ _ _ ⟨f⟩ ⟨g⟩ ⟨h⟩
308+
exact (Quasicategory₂.fill31 (compStruct f g) (compStruct g h)
309+
(compStruct _ _)).some.homotopyCategory₂_fac
310+
311+
end homotopy_category
312+
152313
end SSet.Truncated

0 commit comments

Comments
 (0)