Skip to content

Commit 32af1e5

Browse files
committed
feat(Algebra/Homology/SpectralObject): kernel and cokernel of differentials (#35359)
1 parent 0daeda2 commit 32af1e5

3 files changed

Lines changed: 315 additions & 39 deletions

File tree

Mathlib.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -662,6 +662,7 @@ public import Mathlib.Algebra.Homology.ShortComplex.SnakeLemma
662662
public import Mathlib.Algebra.Homology.Single
663663
public import Mathlib.Algebra.Homology.SingleHomology
664664
public import Mathlib.Algebra.Homology.SpectralObject.Basic
665+
public import Mathlib.Algebra.Homology.SpectralObject.Cycles
665666
public import Mathlib.Algebra.Homology.SpectralSequence.Basic
666667
public import Mathlib.Algebra.Homology.SpectralSequence.ComplexShape
667668
public import Mathlib.Algebra.Homology.Square

Mathlib/Algebra/Homology/SpectralObject/Basic.lean

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,17 @@ variable {C ι} (X : SpectralObject C ι)
5959

6060
section
6161

62-
variable (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁) {i j k : ι} (f : i ⟶ j) (g : j ⟶ k)
63-
6462
/-- The connecting homomorphism of the spectral object. -/
65-
def δ : (X.H n₀).obj (mk₁ g) ⟶ (X.H n₁).obj (mk₁ f) :=
63+
def δ {i j k : ι} (f : i ⟶ j) (g : j ⟶ k) (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
64+
(X.H n₀).obj (mk₁ g) ⟶ (X.H n₁).obj (mk₁ f) :=
6665
(X.δ' n₀ n₁ hn₁).app (mk₂ f g)
6766

6867
@[reassoc]
69-
lemma δ_naturality {i' j' k' : ι} (f' : i' ⟶ j') (g' : j' ⟶ k')
70-
(α : mk₁ f ⟶ mk₁ f') (β : mk₁ g ⟶ mk₁ g') (hαβ : α.app 1 = β.app 0 := by cat_disch) :
71-
(X.H n₀).map β ≫ X.δ n₀ n₁ hn₁ f' g' = X.δ n₀ n₁ hn₁ f g ≫ (X.H n₁).map α := by
68+
lemma δ_naturality {i j k : ι} (f : i ⟶ j) (g : j ⟶ k)
69+
{i' j' k' : ι} (f' : i' ⟶ j') (g' : j' ⟶ k')
70+
(α : mk₁ f ⟶ mk₁ f') (β : mk₁ g ⟶ mk₁ g')
71+
(n₀ n₁ : ℤ) (hαβ : α.app 1 = β.app 0 := by cat_disch) (hn₁ : n₀ + 1 = n₁ := by lia) :
72+
(X.H n₀).map β ≫ X.δ f' g' n₀ n₁ hn₁ = X.δ f g n₀ n₁ hn₁ ≫ (X.H n₁).map α := by
7273
have h := (X.δ' n₀ n₁ hn₁).naturality
7374
(homMk₂ (α.app 0) (α.app 1) (β.app 1) (naturality' α 0 1)
7475
(by simpa only [hαβ] using naturality' β 0 1) : mk₂ f g ⟶ mk₂ f' g')
@@ -79,90 +80,94 @@ end
7980

8081
section
8182

82-
variable (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁) {i j k : ι} (f : i ⟶ j) (g : j ⟶ k)
83+
variable {i j k : ι} (f : i ⟶ j) (g : j ⟶ k)
8384
(fg : i ⟶ k) (h : f ≫ g = fg)
8485

8586
@[reassoc (attr := simp)]
86-
lemma zero₁ :
87-
X.δ n₀ n₁ hn₁ f g ≫ (X.H n₁).map (twoδ₂Toδ₁ f g fg h) = 0 := by
87+
lemma zero₁ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
88+
X.δ f g n₀ n₁ hn₁ ≫ (X.H n₁).map (twoδ₂Toδ₁ f g fg h) = 0 := by
8889
subst h
8990
exact (X.exact₁' n₀ n₁ hn₁ (mk₂ f g)).zero 0
9091

9192
@[reassoc (attr := simp)]
92-
lemma zero₂ (fg : i ⟶ k) (h : f ≫ g = fg) :
93+
lemma zero₂ (fg : i ⟶ k) (h : f ≫ g = fg) (n₀ : ℤ) :
9394
(X.H n₀).map (twoδ₂Toδ₁ f g fg h) ≫ (X.H n₀).map (twoδ₁Toδ₀ f g fg h) = 0 := by
9495
subst h
9596
exact (X.exact₂' n₀ (mk₂ f g)).zero 0
9697

9798
@[reassoc (attr := simp)]
98-
lemma zero₃ :
99-
(X.H n₀).map (twoδ₁Toδ₀ f g fg h) ≫ X.δ n₀ n₁ hn₁ f g = 0 := by
99+
lemma zero₃ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
100+
(X.H n₀).map (twoδ₁Toδ₀ f g fg h) ≫ X.δ f g n₀ n₁ hn₁ = 0 := by
100101
subst h
101102
exact (X.exact₃' n₀ n₁ hn₁ (mk₂ f g)).zero 0
102103

103104
/-- The (exact) short complex `H^n₀(g) ⟶ H^n₁(f) ⟶ H^n₁(fg)` of a
104105
spectral object, when `f ≫ g = fg` and `n₀ + 1 = n₁`. -/
105106
@[simps]
106-
def sc₁ : ShortComplex C :=
107-
ShortComplex.mk _ _ (X.zero₁ n₀ n₁ hn₁ f g fg h)
107+
def sc₁ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) : ShortComplex C :=
108+
ShortComplex.mk _ _ (X.zero₁ f g fg h n₀ n₁ hn₁)
108109

109110
/-- The (exact) short complex `H^n₀(f) ⟶ H^n₀(fg) ⟶ H^n₀(g)` of a
110111
spectral object, when `f ≫ g = fg`. -/
111112
@[simps]
112-
def sc₂ : ShortComplex C :=
113-
ShortComplex.mk _ _ (X.zero₂ n₀ f g fg h)
113+
def sc₂ (n₀ : ℤ) : ShortComplex C :=
114+
ShortComplex.mk _ _ (X.zero₂ f g fg h n₀)
114115

115116
/-- The (exact) short complex `H^n₀(fg) ⟶ H^n₀(g) ⟶ H^n₁(f)`
116117
of a spectral object, when `f ≫ g = fg` and `n₀ + 1 = n₁`. -/
117118
@[simps]
118-
def sc₃ : ShortComplex C :=
119-
ShortComplex.mk _ _ (X.zero₃ n₀ n₁ hn₁ f g fg h)
119+
def sc₃ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) : ShortComplex C :=
120+
ShortComplex.mk _ _ (X.zero₃ f g fg h n₀ n₁ hn₁)
120121

121-
lemma exact₁ : (X.sc₁ n₀ n₁ hn₁ f g fg h).Exact := by
122+
lemma exact₁ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
123+
(X.sc₁ f g fg h n₀ n₁ hn₁ ).Exact := by
122124
subst h
123125
exact (X.exact₁' n₀ n₁ hn₁ (mk₂ f g)).exact 0
124126

125-
lemma exact₂ : (X.sc₂ n₀ f g fg h).Exact := by
127+
lemma exact₂ (n₀ : ℤ) :
128+
(X.sc₂ f g fg h n₀).Exact := by
126129
subst h
127130
exact (X.exact₂' n₀ (mk₂ f g)).exact 0
128131

129-
lemma exact₃ : (X.sc₃ n₀ n₁ hn₁ f g fg h).Exact := by
132+
lemma exact₃ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
133+
(X.sc₃ f g fg h n₀ n₁ hn₁).Exact := by
130134
subst h
131135
exact ((X.exact₃' n₀ n₁ hn₁ (mk₂ f g))).exact 0
132136

133137
/-- The (exact) sequence
134138
`H^n₀(f) ⟶ H^n₀(fg) ⟶ H^n₀(g) ⟶ H^n₁(f) ⟶ H^n₁(fg) ⟶ H^n₁(g)`
135139
of a spectral object, when `f ≫ g = fg` and `n₀ + 1 = n₁`. -/
136-
abbrev composableArrows₅ : ComposableArrows C 5 :=
140+
abbrev composableArrows₅ (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
141+
ComposableArrows C 5 :=
137142
mk₅ ((X.H n₀).map (twoδ₂Toδ₁ f g fg h)) ((X.H n₀).map (twoδ₁Toδ₀ f g fg h))
138-
(X.δ n₀ n₁ hn₁ f g) ((X.H n₁).map (twoδ₂Toδ₁ f g fg h))
143+
(X.δ f g n₀ n₁ hn₁) ((X.H n₁).map (twoδ₂Toδ₁ f g fg h))
139144
((X.H n₁).map (twoδ₁Toδ₀ f g fg h))
140145

141-
lemma composableArrows₅_exact :
142-
(X.composableArrows₅ n₀ n₁ hn₁ f g fg h).Exact :=
143-
exact_of_δ₀ (X.exact₂ n₀ _ _ _ h).exact_toComposableArrows
144-
(exact_of_δ₀ (X.exact₃ n₀ n₁ hn₁ _ _ _ h).exact_toComposableArrows
145-
(exact_of_δ₀ (X.exact₁ n₀ n₁ hn₁ _ _ _ h).exact_toComposableArrows
146-
((X.exact₂ n₁ _ _ _ h).exact_toComposableArrows)))
146+
lemma composableArrows₅_exact (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) :
147+
(X.composableArrows₅ f g fg h n₀ n₁ hn₁).Exact :=
148+
exact_of_δ₀ (X.exact₂ _ _ _ h n₀).exact_toComposableArrows
149+
(exact_of_δ₀ (X.exact₃ _ _ _ h n₀ n₁ hn₁).exact_toComposableArrows
150+
(exact_of_δ₀ (X.exact₁ _ _ _ h n₀ n₁ hn₁).exact_toComposableArrows
151+
((X.exact₂ _ _ _ h n₁).exact_toComposableArrows)))
147152

148153
end
149154

150155
@[reassoc (attr := simp)]
151-
lemma δ (n₀ n₁ n₂ : ℤ) (hn₁ : n₀ + 1 = n₁) (hn₂ : n₁ + 1 = n₂)
152-
{i j k l : ι} (f : i ⟶ j) (g : j ⟶ k) (h : k ⟶ l) :
153-
X.δ n₀ n₁ hn₁ g h ≫ X.δ n₁ n₂ hn₂ f g = 0 := by
154-
have eq := X.δ_naturality n₁ n₂ hn₂ f g f (g ≫ h) (𝟙 _) (twoδ₂Toδ₁ g h _ rfl)
156+
lemma δ {i j k l : ι} (f : i ⟶ j) (g : j ⟶ k) (h : k ⟶ l)
157+
(n₀ n₁ n₂ : ℤ) (hn₁ : n₀ + 1 = n₁ := by lia) (hn₂ : n₁ + 1 = n₂ := by lia) :
158+
X.δ g h n₀ n₁ hn₁ ≫ X.δ f g n₁ n₂ hn₂ = 0 := by
159+
have eq := X.δ_naturality f g f (g ≫ h) (𝟙 _) (twoδ₂Toδ₁ g h _ rfl) n₁ n₂
155160
rw [Functor.map_id, comp_id] at eq
156-
rw [← eq, X.zero₁_assoc n₀ n₁ hn₁ g h _ rfl, zero_comp]
161+
rw [← eq, X.zero₁_assoc g h _ rfl n₀ n₁ hn₁, zero_comp]
157162

158163
/-- The type of morphisms between spectral objects in abelian categories. -/
159164
@[ext]
160165
structure Hom (X' : SpectralObject C ι) where
161166
/-- The natural transformation that is part of a morphism between spectral objects. -/
162167
hom (n : ℤ) : X.H n ⟶ X'.H n
163168
comm (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁) {i j k : ι} (f : i ⟶ j) (g : j ⟶ k) :
164-
X.δ n₀ n₁ hn₁ f g ≫ (hom n₁).app (mk₁ f) =
165-
(hom n₀).app (mk₁ g) ≫ X'.δ n₀ n₁ hn₁ f g := by cat_disch
169+
X.δ f g n₀ n₁ hn₁ ≫ (hom n₁).app (mk₁ f) =
170+
(hom n₀).app (mk₁ g) ≫ X'.δ f g n₀ n₁ hn₁ := by cat_disch
166171

167172
attribute [reassoc (attr := simp)] Hom.comm
168173

@@ -183,7 +188,7 @@ lemma isZero_H_map_mk₁_of_isIso (n : ℤ) {i₀ i₁ : ι} (f : i₀ ⟶ i₁)
183188
constructor <;> dsimp [φ] <;> infer_instance
184189
rw [IsZero.iff_id_eq_zero]
185190
rw [← cancel_mono ((X.H n).map φ), Category.id_comp, zero_comp,
186-
← X.zero₂ n f (inv f) (𝟙 _) (by simp), ← Functor.map_comp]
191+
← X.zero₂ f (inv f) (𝟙 _) (by simp), ← Functor.map_comp]
187192

188193
section
189194

@@ -193,11 +198,11 @@ variable (n₀ n₁ : ℤ) (hn₁ : n₀ + 1 = n₁) {i₀ i₁ i₂ : ι}
193198

194199
include h₁ in
195200
lemma mono_H_map_twoδ₁Toδ₀ : Mono ((X.H n₀).map (twoδ₁Toδ₀ f g fg hfg)) :=
196-
(X.exact₂ n₀ f g fg hfg).mono_g (h₁.eq_of_src _ _)
201+
(X.exact₂ f g fg hfg n₀).mono_g (h₁.eq_of_src _ _)
197202

198203
include h₂ hn₁ in
199204
lemma epi_H_map_twoδ₁Toδ₀ : Epi ((X.H n₀).map (twoδ₁Toδ₀ f g fg hfg)) :=
200-
(X.exact₃ n₀ n₁ hn₁ f g fg hfg).epi_f (h₂.eq_of_tgt _ _)
205+
(X.exact₃ f g fg hfg n₀ n₁ hn₁).epi_f (h₂.eq_of_tgt _ _)
201206

202207
include h₁ h₂ hn₁ in
203208
lemma isIso_H_map_twoδ₁Toδ₀ : IsIso ((X.H n₀).map (twoδ₁Toδ₀ f g fg hfg)) := by

0 commit comments

Comments
 (0)