@@ -5,7 +5,7 @@ Authors: Joël Riou
55-/
66module
77
8- public import Mathlib.AlgebraicTopology.SimplicialSet.Basic
8+ public import Mathlib.AlgebraicTopology.SimplicialSet.CompStruct
99public import Mathlib.CategoryTheory.ComposableArrows.Basic
1010
1111/-!
@@ -31,19 +31,21 @@ universe v u
3131namespace CategoryTheory
3232
3333/-- The nerve of a category -/
34- @[simps]
34+ @[simps -isSimp ]
3535def nerve (C : Type u) [Category.{v} C] : SSet.{max u v} where
3636 obj Δ := ComposableArrows C (Δ.unop.len)
3737 map f x := x.whiskerLeft (SimplexCategory.toCat.map f.unop)
3838 -- `aesop` can prove these but is slow, help it out:
3939 map_id _ := rfl
4040 map_comp _ _ := rfl
4141
42+ attribute [simp] nerve_obj
43+
4244instance {C : Type*} [Category C] {Δ : SimplexCategoryᵒᵖ} : Category ((nerve C).obj Δ) :=
4345 (inferInstance : Category (ComposableArrows C (Δ.unop.len)))
4446
4547/-- Given a functor `C ⥤ D`, we obtain a morphism `nerve C ⟶ nerve D` of simplicial sets. -/
46- @[simps]
48+ @[simps -isSimp ]
4749def nerveMap {C D : Type u} [Category.{v} C] [Category.{v} D] (F : C ⥤ D) : nerve C ⟶ nerve D :=
4850 { app := fun _ => (F.mapComposableArrows _).obj }
4951
@@ -54,9 +56,9 @@ def nerveFunctor : Cat.{v, u} ⥤ SSet where
5456 map F := nerveMap F
5557
5658/-- The 0-simplices of the nerve of a category are equivalent to the objects of the category. -/
57- def nerveEquiv ( C : Type u) [Category.{v} C] : nerve C _⦋ 0 ⦌ ≃ C where
59+ def nerveEquiv { C : Type u} [Category.{v} C] : ComposableArrows C 0 ≃ C where
5860 toFun f := f.obj ⟨0 , by omega⟩
59- invFun f := (Functor.const _).obj f
61+ invFun f := ComposableArrows.mk₀ f
6062 left_inv f := ComposableArrows.ext₀ rfl
6163
6264namespace nerve
@@ -71,17 +73,17 @@ def representableBy {n : ℕ} (α : Type u) [Preorder α] (e : α ≃o Fin (n +
7173 right_inv F := Functor.ext (fun x ↦ by simp) }
7274 homEquiv_comp _ _ := rfl
7375
74- variable {C : Type * } [Category C] {n : ℕ}
76+ variable {C : Type u } [Category.{v} C] {n : ℕ}
7577
76- lemma δ_obj {n : ℕ} (i : Fin (n + 2 )) (x : (nerve C) _⦋ n + 1 ⦌ ) (j : Fin (n + 1 )) :
78+ lemma δ_obj {n : ℕ} (i : Fin (n + 2 )) (x : ComposableArrows C ( n + 1 ) ) (j : Fin (n + 1 )) :
7779 ((nerve C).δ i x).obj j = x.obj (i.succAbove j) :=
7880 rfl
7981
80- lemma σ_obj {n : ℕ} (i : Fin (n + 1 )) (x : (nerve C) _⦋n⦌ ) (j : Fin (n + 2 )) :
82+ lemma σ_obj {n : ℕ} (i : Fin (n + 1 )) (x : ComposableArrows C n ) (j : Fin (n + 2 )) :
8183 ((nerve C).σ i x).obj j = x.obj (i.predAbove j) :=
8284 rfl
8385
84- lemma δ₀_eq {x : nerve C _⦋ n + 1 ⦌ } : (nerve C).δ (0 : Fin (n + 2 )) x = x.δ₀ := rfl
86+ lemma δ₀_eq {x : ComposableArrows C ( n + 1 ) } : (nerve C).δ (0 : Fin (n + 2 )) x = x.δ₀ := rfl
8587
8688lemma σ₀_mk₀_eq (x : C) : (nerve C).σ (0 : Fin 1 ) (.mk₀ x) = .mk₁ (𝟙 x) :=
8789 ComposableArrows.ext₁ rfl rfl (by simp; rfl)
@@ -107,6 +109,115 @@ lemma ext_of_isThin [Quiver.IsThin C] {n : SimplexCategoryᵒᵖ} {x y : (nerve
107109 x = y :=
108110 ComposableArrows.ext (by simp [h]) (by subsingleton)
109111
112+ open SSet
113+
114+ @[simp]
115+ lemma left_edge {x y : ComposableArrows C 0 } (e : (nerve C).Edge x y) :
116+ ComposableArrows.left (n := 1 ) e.edge = nerveEquiv x := by
117+ simp only [← e.src_eq]
118+ rfl
119+
120+ @[simp]
121+ lemma right_edge {x y : ComposableArrows C 0 } (e : (nerve C).Edge x y) :
122+ ComposableArrows.right (n := 1 ) e.edge = nerveEquiv y := by
123+ simp only [← e.tgt_eq]
124+ rfl
125+
126+ lemma δ₂_two (x : ComposableArrows C 2 ) :
127+ (nerve C).δ 2 x = .mk₁ (x.map' 0 1 ) :=
128+ ComposableArrows.ext₁ rfl rfl (by cat_disch)
129+
130+ lemma δ₂_zero (x : ComposableArrows C 2 ) :
131+ (nerve C).δ 0 x = .mk₁ (x.map' 1 2 ) :=
132+ ComposableArrows.ext₁ rfl rfl (by cat_disch)
133+
134+ section
135+
136+ attribute [local ext (iff := false)] ComposableArrows.ext₀ ComposableArrows.ext₁
137+
138+ /-- Bijection between edges in the nerve of category and morphisms in the category. -/
139+ def homEquiv {x y : ComposableArrows C 0 } :
140+ (nerve C).Edge x y ≃ (nerveEquiv x ⟶ nerveEquiv y) where
141+ toFun e := eqToHom (by simp) ≫ e.edge.hom ≫ eqToHom (by simp)
142+ invFun f := .mk (ComposableArrows.mk₁ f) (ComposableArrows.ext₀ rfl) (ComposableArrows.ext₀ rfl)
143+ left_inv e := by cat_disch
144+ right_inv f := by simp
145+
146+ lemma mk₁_homEquiv_apply {x y : ComposableArrows C 0 } (e : (nerve C).Edge x y) :
147+ ComposableArrows.mk₁ (homEquiv e) = ComposableArrows.mk₁ e.edge.hom := by
148+ simp [homEquiv, ComposableArrows.mk₁_eqToHom_comp, ComposableArrows.mk₁_comp_eqToHom]
149+
150+ /-- Constructor for edges in the nerve of a category. (See also `homEquiv`.) -/
151+ def edgeMk {x y : C} (f : x ⟶ y) : (nerve C).Edge (nerveEquiv.symm x) (nerveEquiv.symm y) :=
152+ Edge.mk (ComposableArrows.mk₁ f)
153+
154+ @[simp]
155+ lemma edgeMk_edge {x y : C} (f : x ⟶ y) : (edgeMk f).edge = ComposableArrows.mk₁ f := rfl
156+
157+ lemma edgeMk_surjective {x y : C} :
158+ Function.Surjective (edgeMk : (x ⟶ y) → _) :=
159+ fun e ↦ ⟨eqToHom (by simp) ≫ homEquiv e ≫ eqToHom (by simp), by cat_disch⟩
160+
161+ @[simp]
162+ lemma homEquiv_edgeMk {x y : C} (f : x ⟶ y) :
163+ homEquiv (edgeMk f) = f :=
164+ homEquiv.symm.injective (by cat_disch)
165+
166+ lemma homEquiv_id (x : ComposableArrows C 0 ) :
167+ homEquiv (Edge.id x) = 𝟙 _ := by
168+ obtain ⟨x, rfl⟩ := nerveEquiv.symm.surjective x
169+ dsimp [homEquiv]
170+ cat_disch
171+
172+ lemma nonempty_compStruct_iff {x₀ x₁ x₂ : C}
173+ (f₀₁ : x₀ ⟶ x₁) (f₁₂ : x₁ ⟶ x₂) (f₀₂ : x₀ ⟶ x₂) :
174+ Nonempty (Edge.CompStruct (edgeMk f₀₁) (edgeMk f₁₂) (edgeMk f₀₂)) ↔
175+ f₀₁ ≫ f₁₂ = f₀₂ := by
176+ let h' : Edge.CompStruct (edgeMk f₀₁) (edgeMk f₁₂) (edgeMk (f₀₁ ≫ f₁₂)) :=
177+ Edge.CompStruct.mk (ComposableArrows.mk₂ f₀₁ f₁₂)
178+ (by cat_disch) (by cat_disch) (by cat_disch)
179+ refine ⟨fun ⟨h⟩ ↦ ?_, fun h ↦ ⟨by rwa [← h]⟩⟩
180+ rw [← Arrow.mk_inj]
181+ apply ComposableArrows.arrowEquiv.symm.injective
182+ convert_to (nerve C).δ 1 h'.simplex = (nerve C).δ 1 h.simplex
183+ · exact (h'.d₁).symm
184+ · exact (h.d₁).symm
185+ · have h₀ := h.d₀
186+ have h₂ := h.d₂
187+ have h'₀ := h'.d₀
188+ have h'₂ := h'.d₂
189+ simp only [δ₂_zero, δ₂_two, edgeMk_edge] at h₀ h₂ h'₀ h'₂
190+ exact congr_arg _ (ComposableArrows.ext₂_of_arrow
191+ (ComposableArrows.arrowEquiv.symm.injective
192+ (by simp [-Edge.CompStruct.d₂, h'₂, ← h₂]))
193+ (ComposableArrows.arrowEquiv.symm.injective
194+ (by simp [-Edge.CompStruct.d₀, h'₀, ← h₀])))
195+
196+ lemma homEquiv_comp {x₀ x₁ x₂ : ComposableArrows C 0 }
197+ {e₀₁ : (nerve C).Edge x₀ x₁}
198+ {e₁₂ : (nerve C).Edge x₁ x₂} {e₀₂ : (nerve C).Edge x₀ x₂}
199+ (h : Edge.CompStruct e₀₁ e₁₂ e₀₂) :
200+ homEquiv e₀₁ ≫ homEquiv e₁₂ = homEquiv e₀₂ := by
201+ obtain ⟨x₀, rfl⟩ := nerveEquiv.symm.surjective x₀
202+ obtain ⟨x₁, rfl⟩ := nerveEquiv.symm.surjective x₁
203+ obtain ⟨x₂, rfl⟩ := nerveEquiv.symm.surjective x₂
204+ obtain ⟨f₀₁, rfl⟩ := edgeMk_surjective e₀₁
205+ obtain ⟨f₁₂, rfl⟩ := edgeMk_surjective e₁₂
206+ obtain ⟨f₀₂, rfl⟩ := edgeMk_surjective e₀₂
207+ convert (nerve.nonempty_compStruct_iff _ _ _).1 ⟨h⟩ <;> apply homEquiv_edgeMk
208+
209+ lemma σ_zero_nerveEquiv_symm (x : C) :
210+ (nerve C).σ 0 (nerveEquiv.symm x) = ComposableArrows.mk₁ (𝟙 x) := by
211+ cat_disch
212+
213+ @[simp]
214+ lemma homEquiv_edgeMk_map_nerveMap {D : Type u} [Category.{v} D] {x y : C}
215+ (f : x ⟶ y) (F : C ⥤ D) :
216+ homEquiv ((edgeMk f).map (nerveMap F)) = F.map f := by
217+ simp [homEquiv, nerveMap_app]
218+
219+ end
220+
110221end nerve
111222
112223end CategoryTheory
0 commit comments