forked from leanprover-community/mathlib4
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAlternatingFaceMapComplex.lean
More file actions
348 lines (283 loc) · 12.8 KB
/
Copy pathAlternatingFaceMapComplex.lean
File metadata and controls
348 lines (283 loc) · 12.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
/-
Copyright (c) 2021 Joël Riou. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Joël Riou, Adam Topaz, Johan Commelin
-/
module
public import Mathlib.Algebra.Homology.Additive
public import Mathlib.AlgebraicTopology.MooreComplex
public import Mathlib.Algebra.BigOperators.Fin
public import Mathlib.CategoryTheory.Idempotents.FunctorCategories
public import Mathlib.CategoryTheory.Limits.FunctorCategory.EpiMono
public import Mathlib.CategoryTheory.Preadditive.Opposite
/-!
# The alternating face map complex of a simplicial object in a preadditive category
We construct the alternating face map complex, as a
functor `alternatingFaceMapComplex : SimplicialObject C ⥤ ChainComplex C ℕ`
for any preadditive category `C`. For any simplicial object `X` in `C`,
this is the homological complex `... → X_2 → X_1 → X_0`
where the differentials are alternating sums of faces.
The dual version `alternatingCofaceMapComplex : CosimplicialObject C ⥤ CochainComplex C ℕ`
is also constructed.
We also construct the natural transformation
`inclusionOfMooreComplex : normalizedMooreComplex A ⟶ alternatingFaceMapComplex A`
when `A` is an abelian category.
## References
* https://stacks.math.columbia.edu/tag/0194
* https://ncatlab.org/nlab/show/Moore+complex
-/
@[expose] public section
open CategoryTheory CategoryTheory.Limits CategoryTheory.Subobject
open CategoryTheory.Preadditive CategoryTheory.Category CategoryTheory.Idempotents
open Opposite
open Simplicial
noncomputable section
namespace AlgebraicTopology
namespace AlternatingFaceMapComplex
/-!
## Construction of the alternating face map complex
-/
variable {C : Type*} [Category* C] [Preadditive C]
variable (X : SimplicialObject C)
variable (Y : SimplicialObject C)
/-- The differential on the alternating face map complex is the alternate
sum of the face maps -/
@[simp]
def objD (n : ℕ) : X _⦋n + 1⦌ ⟶ X _⦋n⦌ :=
∑ i : Fin (n + 2), (-1 : ℤ) ^ (i : ℕ) • X.δ i
/-!
## The chain complex relation `d ≫ d`
-/
theorem d_squared (n : ℕ) : objD X (n + 1) ≫ objD X n = 0 := by
-- we start by expanding d ≫ d as a double sum
dsimp
simp only [comp_sum, sum_comp, ← Finset.sum_product']
-- then, we decompose the index set P into a subset S and its complement Sᶜ
let P := Fin (n + 2) × Fin (n + 3)
let S : Finset P := {ij : P | (ij.2 : ℕ) ≤ (ij.1 : ℕ)}
rw [Finset.univ_product_univ, ← Finset.sum_add_sum_compl S, ← eq_neg_iff_add_eq_zero,
← Finset.sum_neg_distrib]
/- we are reduced to showing that two sums are equal, and this is obtained
by constructing a bijection φ : S -> Sᶜ, which maps (i,j) to (j,i+1),
and by comparing the terms -/
let φ : ∀ ij : P, ij ∈ S → P := fun ij hij =>
(Fin.castLT ij.2 (lt_of_le_of_lt (Finset.mem_filter.mp hij).right (Fin.is_lt ij.1)), ij.1.succ)
apply Finset.sum_bij φ
· -- φ(S) is contained in Sᶜ
intro ij hij
simp_rw [S, φ, Finset.compl_filter, Finset.mem_filter_univ, Fin.val_succ,
Fin.val_castLT] at hij ⊢
lia
· -- φ : S → Sᶜ is injective
rintro ⟨i, j⟩ hij ⟨i', j'⟩ hij' h
rw [Prod.mk_inj]
exact ⟨by simpa [φ] using! congr_arg Prod.snd h,
by simpa [φ, Fin.castSucc_castLT] using! congr_arg Fin.castSucc (congr_arg Prod.fst h)⟩
· -- φ : S → Sᶜ is surjective
rintro ⟨i', j'⟩ hij'
simp_rw [S, Finset.compl_filter, Finset.mem_filter_univ, not_le] at hij'
refine ⟨(j'.pred <| ?_, Fin.castSucc i'), ?_, ?_⟩
· rintro rfl
simp only [Fin.val_zero, not_lt_zero] at hij'
· simpa [S] using! Nat.le_sub_one_of_lt hij'
· simp only [φ, Fin.castLT_castSucc, Fin.succ_pred]
· -- identification of corresponding terms in both sums
rintro ⟨i, j⟩ hij
dsimp
simp only [zsmul_comp, comp_zsmul, smul_smul, ← neg_smul]
congr 1
· simp only [φ, Fin.val_succ, pow_add, pow_one, mul_neg, neg_neg, mul_one]
apply mul_comm
· rw [CategoryTheory.SimplicialObject.δ_comp_δ'']
simpa [S] using! hij
/-!
## Construction of the alternating face map complex functor
-/
/-- The alternating face map complex, on objects -/
def obj : ChainComplex C ℕ :=
ChainComplex.of (fun n => X _⦋n⦌) (objD X) (d_squared X)
@[simp]
theorem obj_X (X : SimplicialObject C) (n : ℕ) : (AlternatingFaceMapComplex.obj X).X n = X _⦋n⦌ :=
rfl
@[simp]
theorem obj_d_eq (X : SimplicialObject C) (n : ℕ) :
(AlternatingFaceMapComplex.obj X).d (n + 1) n
= ∑ i : Fin (n + 2), (-1 : ℤ) ^ (i : ℕ) • X.δ i := by
simp [obj]
variable {X} {Y}
/-- The alternating face map complex, on morphisms -/
def map (f : X ⟶ Y) : obj X ⟶ obj Y :=
ChainComplex.ofHom (fun n => f.app (op ⦋n⦌)) fun n => by
simp only [obj, ChainComplex.of_d, objD, Int.reduceNeg]
rw [comp_sum, sum_comp]
refine Finset.sum_congr rfl fun _ _ => ?_
rw [comp_zsmul, zsmul_comp]
congr 1
symm
apply f.naturality
@[simp]
theorem map_f (f : X ⟶ Y) (n : ℕ) : (map f).f n = f.app (op ⦋n⦌) :=
rfl
end AlternatingFaceMapComplex
variable (C : Type*) [Category* C] [Preadditive C]
/-- The alternating face map complex, as a functor -/
def alternatingFaceMapComplex : SimplicialObject C ⥤ ChainComplex C ℕ where
obj := AlternatingFaceMapComplex.obj
map f := AlternatingFaceMapComplex.map f
variable {C}
@[simp]
theorem alternatingFaceMapComplex_obj_X (X : SimplicialObject C) (n : ℕ) :
((alternatingFaceMapComplex C).obj X).X n = X _⦋n⦌ :=
rfl
@[simp]
theorem alternatingFaceMapComplex_obj_d (X : SimplicialObject C) (n : ℕ) :
((alternatingFaceMapComplex C).obj X).d (n + 1) n = AlternatingFaceMapComplex.objD X n := by
simp [alternatingFaceMapComplex]
@[simp]
theorem alternatingFaceMapComplex_map_f {X Y : SimplicialObject C} (f : X ⟶ Y) (n : ℕ) :
((alternatingFaceMapComplex C).map f).f n = f.app (op ⦋n⦌) :=
rfl
set_option backward.defeqAttrib.useBackward true in
set_option backward.isDefEq.respectTransparency false in
theorem map_alternatingFaceMapComplex {D : Type*} [Category* D] [Preadditive D] (F : C ⥤ D)
[F.Additive] :
alternatingFaceMapComplex C ⋙ F.mapHomologicalComplex _ =
(SimplicialObject.whiskering C D).obj F ⋙ alternatingFaceMapComplex D := by
apply CategoryTheory.Functor.ext
· intro X Y f
ext n
simp only [Functor.comp_map, HomologicalComplex.comp_f, alternatingFaceMapComplex_map_f,
Functor.mapHomologicalComplex_map_f, HomologicalComplex.eqToHom_f, eqToHom_refl, comp_id,
id_comp, SimplicialObject.whiskering_obj_map_app]
· intro X
apply HomologicalComplex.ext
· rintro i j (rfl : j + 1 = i)
dsimp only [Functor.comp_obj]
simp only [Functor.mapHomologicalComplex_obj_d, alternatingFaceMapComplex_obj_d,
eqToHom_refl, id_comp, comp_id, AlternatingFaceMapComplex.objD, Functor.map_sum,
Functor.map_zsmul]
rfl
· ext n
rfl
instance : (alternatingFaceMapComplex C).Additive where
instance [Limits.HasPullbacks C] : (alternatingFaceMapComplex C).PreservesMonomorphisms where
preserves _ _ := HomologicalComplex.mono_of_mono_f _ fun _ ↦ by dsimp; infer_instance
theorem karoubi_alternatingFaceMapComplex_d (P : Karoubi (SimplicialObject C)) (n : ℕ) :
((AlternatingFaceMapComplex.obj (KaroubiFunctorCategoryEmbedding.obj P)).d (n + 1) n).f =
P.p.app (op ⦋n + 1⦌) ≫ (AlternatingFaceMapComplex.obj P.X).d (n + 1) n := by
dsimp
simp only [AlternatingFaceMapComplex.obj_d_eq, Karoubi.sum_hom, Preadditive.comp_sum,
Karoubi.zsmul_hom, Preadditive.comp_zsmul]
rfl
namespace AlternatingFaceMapComplex
set_option backward.defeqAttrib.useBackward true in
set_option backward.isDefEq.respectTransparency false in
/-- The natural transformation which gives the augmentation of the alternating face map
complex attached to an augmented simplicial object. -/
def ε [Limits.HasZeroObject C] :
SimplicialObject.Augmented.drop ⋙ AlgebraicTopology.alternatingFaceMapComplex C ⟶
SimplicialObject.Augmented.point ⋙ ChainComplex.single₀ C where
app X := by
refine (ChainComplex.toSingle₀Equiv _ _).symm ?_
refine ⟨X.hom.app (op ⦋0⦌), ?_⟩
dsimp
rw [alternatingFaceMapComplex_obj_d, objD, Fin.sum_univ_two, Fin.val_zero,
pow_zero, one_smul, Fin.val_one, pow_one, neg_smul, one_smul, add_comp,
neg_comp, SimplicialObject.δ_naturality, SimplicialObject.δ_naturality]
apply add_neg_cancel
naturality X Y f := by
apply HomologicalComplex.to_single_hom_ext
#adaptation_note /-- This proof broke at nightly-2026-04-28. It used to be:
```
dsimp
simp [ChainComplex.toSingle₀Equiv, SimplicialObject.Augmented.w₀]
```
The proof below is an emergency repair, and I've asked the authors of this file to review.
-/
change f.left.app _ ≫ _ = _ ≫ ((ChainComplex.single₀ _).map f.right).f 0
rw [ChainComplex.toSingle₀Equiv_symm_apply_f_zero,
ChainComplex.toSingle₀Equiv_symm_apply_f_zero,
ChainComplex.single₀_map_f_zero]
exact SimplicialObject.Augmented.w₀ f
@[simp]
lemma ε_app_f_zero [Limits.HasZeroObject C] (X : SimplicialObject.Augmented C) :
(ε.app X).f 0 = X.hom.app (op ⦋0⦌) :=
ChainComplex.toSingle₀Equiv_symm_apply_f_zero _ _
@[simp]
lemma ε_app_f_succ [Limits.HasZeroObject C] (X : SimplicialObject.Augmented C) (n : ℕ) :
(ε.app X).f (n + 1) = 0 := rfl
end AlternatingFaceMapComplex
/-!
## Construction of the natural inclusion of the normalized Moore complex
-/
variable {A : Type*} [Category* A] [Abelian A]
/-- The inclusion map of the Moore complex in the alternating face map complex -/
def inclusionOfMooreComplexMap (X : SimplicialObject A) :
(normalizedMooreComplex A).obj X ⟶ (alternatingFaceMapComplex A).obj X :=
ChainComplex.ofHom (fun n => (NormalizedMooreComplex.objX X n).arrow) <| fun i ↦ by
/- we have to show the compatibility of the differentials on the alternating
face map complex with those defined on the normalized Moore complex:
we first get rid of the terms of the alternating sum that are obviously
zero on the normalized_Moore_complex -/
simp only [normalizedMooreComplex, NormalizedMooreComplex.obj, alternatingFaceMapComplex,
AlternatingFaceMapComplex.obj, ChainComplex.of_d, AlternatingFaceMapComplex.objD, comp_sum]
rw [Fin.sum_univ_succ, Fintype.sum_eq_zero]
swap
· intro j
rw [NormalizedMooreComplex.objX_add_one, comp_zsmul,
← factorThru_arrow _ _ (finset_inf_arrow_factors Finset.univ _ _ (Finset.mem_univ j)),
Category.assoc, kernelSubobject_arrow_comp, comp_zero, smul_zero]
-- finally, we study the remaining term which is induced by X.δ 0
rw [add_zero, Fin.val_zero, pow_zero, one_zsmul]
dsimp [NormalizedMooreComplex.objD, NormalizedMooreComplex.objX]
cases i <;> simp
@[simp]
theorem inclusionOfMooreComplexMap_f (X : SimplicialObject A) (n : ℕ) :
(inclusionOfMooreComplexMap X).f n = (NormalizedMooreComplex.objX X n).arrow := by
dsimp [inclusionOfMooreComplexMap]
variable (A)
set_option backward.defeqAttrib.useBackward true in
/-- The inclusion map of the Moore complex in the alternating face map complex,
as a natural transformation -/
@[simps]
def inclusionOfMooreComplex : normalizedMooreComplex A ⟶ alternatingFaceMapComplex A where
app := inclusionOfMooreComplexMap
namespace AlternatingCofaceMapComplex
variable (X Y : CosimplicialObject C)
/-- The differential on the alternating coface map complex is the alternate
sum of the coface maps -/
@[simp]
def objD (n : ℕ) : X.obj ⦋n⦌ ⟶ X.obj ⦋n + 1⦌ :=
∑ i : Fin (n + 2), (-1 : ℤ) ^ (i : ℕ) • X.δ i
theorem d_eq_unop_d (n : ℕ) :
objD X n =
(AlternatingFaceMapComplex.objD ((cosimplicialSimplicialEquiv C).functor.obj (op X))
n).unop := by
simp only [objD, AlternatingFaceMapComplex.objD, unop_sum, unop_zsmul]
rfl
set_option backward.isDefEq.respectTransparency false in
theorem d_squared (n : ℕ) : objD X n ≫ objD X (n + 1) = 0 := by
simp only [d_eq_unop_d, ← unop_comp, AlternatingFaceMapComplex.d_squared, unop_zero]
/-- The alternating coface map complex, on objects -/
def obj : CochainComplex C ℕ :=
CochainComplex.of (fun n => X.obj ⦋n⦌) (objD X) (d_squared X)
variable {X} {Y}
/-- The alternating face map complex, on morphisms -/
@[simp]
def map (f : X ⟶ Y) : obj X ⟶ obj Y :=
CochainComplex.ofHom (fun n => f.app ⦋n⦌) fun n => by
simp only [obj, CochainComplex.of_d, objD, Int.reduceNeg]
rw [comp_sum, sum_comp]
refine Finset.sum_congr rfl fun x _ => ?_
rw [comp_zsmul, zsmul_comp]
congr 1
symm
apply f.naturality
end AlternatingCofaceMapComplex
variable (C)
/-- The alternating coface map complex, as a functor -/
@[simps]
def alternatingCofaceMapComplex : CosimplicialObject C ⥤ CochainComplex C ℕ where
obj := AlternatingCofaceMapComplex.obj
map f := AlternatingCofaceMapComplex.map f
end AlgebraicTopology