Skip to content

Commit 034d7b7

Browse files
committed
feat(Algebra/Homology): more API for the HomComplex from a single cochain complex (#32461)
1 parent 36df19c commit 034d7b7

File tree

3 files changed

+98
-3
lines changed

3 files changed

+98
-3
lines changed

Mathlib/Algebra/Homology/HomotopyCategory/HomComplex.lean

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -599,7 +599,7 @@ instance : Coe (Cocycle F G n) (Cochain F G n) where
599599
coe x := x.1
600600

601601
@[ext]
602-
lemma ext (z₁ z₂ : Cocycle F G n) (h : (z₁ : Cochain F G n) = z₂) : z₁ = z₂ :=
602+
lemma ext {z₁ z₂ : Cocycle F G n} (h : (z₁ : Cochain F G n) = z₂) : z₁ = z₂ :=
603603
Subtype.ext h
604604

605605
instance : SMul R (Cocycle F G n) where

Mathlib/Algebra/Homology/HomotopyCategory/HomComplexCohomology.lean

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ def coboundaries : AddSubgroup (Cocycle K L n) where
5353
rintro α ⟨m, hm, β, hβ⟩
5454
exact ⟨m, hm, -β, by aesop⟩
5555

56+
variable {K L n} in
57+
lemma mem_coboundaries_iff (α : Cocycle K L n) (m : ℤ) (hm : m + 1 = n) :
58+
α ∈ coboundaries K L n ↔ ∃ (β : Cochain K L m), δ m n β = α := by
59+
simp only [coboundaries, exists_prop, AddSubgroup.mem_mk, AddSubmonoid.mem_mk,
60+
AddSubsemigroup.mem_mk, Set.mem_setOf_eq]
61+
constructor
62+
· rintro ⟨m', hm', β, hβ⟩
63+
obtain rfl : m = m' := by lia
64+
exact ⟨β, hβ⟩
65+
· rintro ⟨β, hβ⟩
66+
exact ⟨m, hm, β, hβ⟩
67+
5668
/-- The type of cohomology classes of degree `n` in the complex of morphisms
5769
from `K` to `L`. -/
5870
def CohomologyClass : Type v := Cocycle K L n ⧸ coboundaries K L n
@@ -146,6 +158,7 @@ lemma toHom_mk_eq_zero_iff (x : Cocycle K L n) :
146158
· rw [← mk_eq_zero_iff] at h
147159
rw [h, map_zero]
148160

161+
variable (K L n) in
149162
lemma toHom_bijective : Function.Bijective (toHom : CohomologyClass K L n → _) := by
150163
refine ⟨fun x y h ↦ ?_, fun f ↦ ?_⟩
151164
· obtain ⟨x, rfl⟩ := x.mk_surjective
@@ -160,7 +173,7 @@ lemma toHom_bijective : Function.Bijective (toHom : CohomologyClass K L n → _)
160173
noncomputable def homAddEquiv :
161174
CohomologyClass K L n ≃+
162175
((HomotopyCategory.quotient C _).obj K ⟶ (HomotopyCategory.quotient C _).obj (L⟦n⟧)) :=
163-
AddEquiv.ofBijective toHom toHom_bijective
176+
AddEquiv.ofBijective toHom (toHom_bijective _ _ _)
164177

165178
end CohomologyClass
166179

Mathlib/Algebra/Homology/HomotopyCategory/HomComplexSingle.lean

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Authors: Joël Riou
55
-/
66
module
77

8-
public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplex
8+
public import Mathlib.Algebra.Homology.HomotopyCategory.HomComplexCohomology
99
public import Mathlib.Algebra.Homology.HomotopyCategory.SingleFunctors
1010

1111
/-!
@@ -68,6 +68,40 @@ lemma δ_fromSingleMk {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
6868
· simp [δ_shape n n' (by lia), HomologicalComplex.shape K q q' (by simp; lia),
6969
fromSingleMk]
7070

71+
/-- Cochains of degree `n` from `(singleFunctor C p).obj X` to `K` identify
72+
to `X ⟶ K.X q` when `p + n = q`. -/
73+
noncomputable def fromSingleEquiv {p q n : ℤ} (h : p + n = q) :
74+
Cochain ((singleFunctor C p).obj X) K n ≃+ (X ⟶ K.X q) where
75+
toFun α := (HomologicalComplex.singleObjXSelf (.up ℤ) p X).inv ≫ α.v p q h
76+
invFun f := fromSingleMk f h
77+
left_inv α := by
78+
ext p' q' hpq'
79+
by_cases hp : p' = p
80+
· aesop
81+
· exact (HomologicalComplex.isZero_single_obj_X _ _ _ _ hp).eq_of_src _ _
82+
right_inv f := by simp
83+
map_add' := by simp
84+
85+
@[simp]
86+
lemma fromSingleMk_add {p q : ℤ} (f g : X ⟶ K.X q) {n : ℤ} (h : p + n = q) :
87+
fromSingleMk (f + g) h = fromSingleMk f h + fromSingleMk g h :=
88+
(fromSingleEquiv h).symm.map_add _ _
89+
90+
@[simp]
91+
lemma fromSingleMk_sub {p q : ℤ} (f g : X ⟶ K.X q) {n : ℤ} (h : p + n = q) :
92+
fromSingleMk (f - g) h = fromSingleMk f h - fromSingleMk g h :=
93+
(fromSingleEquiv h).symm.map_sub _ _
94+
95+
@[simp]
96+
lemma fromSingleMk_neg {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q) :
97+
fromSingleMk (-f) h = -fromSingleMk f h :=
98+
(fromSingleEquiv h).symm.map_neg _
99+
100+
lemma fromSingleMk_surjective {p n : ℤ} (α : Cochain ((singleFunctor C p).obj X) K n)
101+
(q : ℤ) (h : p + n = q) :
102+
∃ (f : X ⟶ K.X q), fromSingleMk f h = α :=
103+
(fromSingleEquiv h).symm.surjective α
104+
71105
/-- Constructor for cochains to a single complex. -/
72106
@[nolint unusedArguments]
73107
noncomputable def toSingleMk {p q : ℤ} (f : K.X p ⟶ X) {n : ℤ} (_ : p + n = q) :
@@ -113,6 +147,54 @@ noncomputable def fromSingleMk {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p +
113147
rw [Cochain.δ_fromSingleMk _ _ _ q' (by lia), hf]
114148
simp)
115149

150+
lemma fromSingleMk_surjective {p n : ℤ} (α : Cocycle ((singleFunctor C p).obj X) K n)
151+
(q : ℤ) (h : p + n = q) (q' : ℤ) (hq' : q + 1 = q') :
152+
∃ (f : X ⟶ K.X q) (hf : f ≫ K.d q q' = 0), fromSingleMk f h q' hq' hf = α := by
153+
obtain ⟨f, hf⟩ := Cochain.fromSingleMk_surjective α.1 q h
154+
have hα := α.δ_eq_zero (n + 1)
155+
rw [← hf, Cochain.δ_fromSingleMk _ _ _ q' (by lia)] at hα
156+
replace hα := Cochain.congr_v hα p q' (by lia)
157+
exact ⟨f, by simpa using hα, by ext : 1; assumption⟩
158+
159+
lemma fromSingleMk_add {p q : ℤ} (f g : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
160+
(q' : ℤ) (hq' : q + 1 = q') (hf : f ≫ K.d q q' = 0) (hg : g ≫ K.d q q' = 0) :
161+
fromSingleMk (f + g) h q' hq' (by simp [hf, hg]) =
162+
fromSingleMk f h q' hq' hf + fromSingleMk g h q' hq' hg := by
163+
cat_disch
164+
165+
lemma fromSingleMk_sub {p q : ℤ} (f g : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
166+
(q' : ℤ) (hq' : q + 1 = q') (hf : f ≫ K.d q q' = 0) (hg : g ≫ K.d q q' = 0) :
167+
fromSingleMk (f - g) h q' hq' (by simp [hf, hg]) =
168+
fromSingleMk f h q' hq' hf - fromSingleMk g h q' hq' hg := by
169+
cat_disch
170+
171+
lemma fromSingleMk_neg {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
172+
(q' : ℤ) (hq' : q + 1 = q') (hf : f ≫ K.d q q' = 0) :
173+
fromSingleMk (-f) h q' hq' (by simp [hf]) = - fromSingleMk f h q' hq' hf := by
174+
cat_disch
175+
176+
variable (X K) in
177+
@[simp]
178+
lemma fromSingleMk_zero {p q : ℤ} {n : ℤ} (h : p + n = q)
179+
(q' : ℤ) (hq' : q + 1 = q') :
180+
fromSingleMk (0 : X ⟶ K.X q) h q' hq' (by simp) = 0 := by
181+
cat_disch
182+
183+
lemma fromSingleMk_mem_coboundaries_iff {p q : ℤ} (f : X ⟶ K.X q) {n : ℤ} (h : p + n = q)
184+
(q' : ℤ) (hq' : q + 1 = q') (hf : f ≫ K.d q q' = 0)
185+
(q'' : ℤ) (hq'' : q'' + 1 = q) :
186+
fromSingleMk f h q' hq' hf ∈ coboundaries _ _ _ ↔
187+
∃ (g : X ⟶ K.X q''), g ≫ K.d q'' q = f := by
188+
rw [mem_coboundaries_iff _ (n - 1) (by simp)]
189+
constructor
190+
· rintro ⟨α, hα⟩
191+
obtain ⟨g, hg⟩ := Cochain.fromSingleMk_surjective α q'' (by lia)
192+
refine ⟨g, ?_⟩
193+
rw [← hg, fromSingleMk_coe, Cochain.δ_fromSingleMk _ _ _ _ h] at hα
194+
exact (Cochain.fromSingleEquiv h).symm.injective hα
195+
· rintro ⟨g, rfl⟩
196+
exact ⟨Cochain.fromSingleMk g (by lia), Cochain.δ_fromSingleMk _ _ _ _ h⟩
197+
116198
/-- Constructor for cocycles to a single complex. -/
117199
@[simps!]
118200
noncomputable def toSingleMk {p q : ℤ} (f : K.X p ⟶ X) {n : ℤ} (h : p + n = q)

0 commit comments

Comments
 (0)