# mathlibdocumentation

algebra.homology.homological_complex

# Homological complexes. #

A homological_complex V c with a "shape" controlled by c : complex_shape ι has chain groups X i (objects in V) indexed by i : ι, and a differential d i j whenever c.rel i j.

We in fact ask for differentials d i j for all i j : ι, but have a field shape' requiring that these are zero when not allowed by c. This avoids a lot of dependent type theory hell!

The composite of any two differentials d i j ≫ d j k must be zero.

We provide chain_complex V α for α-indexed chain complexes in which d i j ≠ 0 only if j + 1 = i, and similarly cochain_complex V α, with i = j + 1.

There is a category structure, where morphisms are chain maps.

For C : homological_complex V c, we define C.X_next i, which is either C.X j for some arbitrarily chosen j such that c.r i j, or the zero object if there is no such j. Similarly we have C.X_prev j. Defined in terms of these we have C.d_from i : C.X i ⟶ C.X_next i and C.d_to j : C.X_prev j ⟶ C.X j, which are either defined as C.d i j, or zero, as needed.

structure homological_complex {ι : Type u_1} (V : Type u) (c : complex_shape ι) :
Type (max u u_1 v)
• X : ι → V
• d : Π (i j : ι), self.X i self.X j
• shape' : (∀ (i j : ι), ¬c.rel i jself.d i j = 0) . "obviously"
• d_comp_d' : (∀ (i j k : ι), c.rel i jc.rel j kself.d i j self.d j k = 0) . "obviously"

A homological_complex V c with a "shape" controlled by c : complex_shape ι has chain groups X i (objects in V) indexed by i : ι, and a differential d i j whenever c.rel i j.

We in fact ask for differentials d i j for all i j : ι, but have a field shape' requiring that these are zero when not allowed by c. This avoids a lot of dependent type theory hell!

The composite of any two differentials d i j ≫ d j k must be zero.

@[simp]
theorem homological_complex.shape {ι : Type u_1} {V : Type u} {c : complex_shape ι} (self : c) (i j : ι) :
¬c.rel i jself.d i j = 0
@[simp]
theorem homological_complex.d_comp_d {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (i j k : ι) :
C.d i j C.d j k = 0
@[simp]
theorem homological_complex.d_comp_d_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (i j k : ι) {X' : V} (f' : C.X k X') :
C.d i j C.d j k f' = 0 f'
def chain_complex (V : Type u) (α : Type u_1) [has_one α] :
Type (max u u_1 v)

An α-indexed chain complex is a homological_complex in which d i j ≠ 0 only if j + 1 = i.

def cochain_complex (V : Type u) (α : Type u_1) [has_one α] :
Type (max u u_1 v)

An α-indexed cochain complex is a homological_complex in which d i j ≠ 0 only if i + 1 = j.

@[simp]
theorem chain_complex.prev (α : Type u_1) [has_one α] (i : α) :
i = some i + 1, _⟩
@[simp]
theorem chain_complex.next (α : Type u_1) [add_group α] [has_one α] (i : α) :
i = some i - 1, _⟩
@[simp]
@[simp]
theorem chain_complex.next_nat_succ (i : ) :
(i + 1) = some i, _⟩
@[simp]
theorem cochain_complex.prev (α : Type u_1) [add_group α] [has_one α] (i : α) :
.prev i = some i - 1, _⟩
@[simp]
theorem cochain_complex.next (α : Type u_1) [has_one α] (i : α) :
.next i = some i + 1, _⟩
@[simp]
theorem cochain_complex.prev_nat_succ (i : ) :
(i + 1) = some i, _⟩
theorem homological_complex.hom.ext {ι : Type u_1} {V : Type u} {_inst_1 : category_theory.category V} {_inst_2 : category_theory.limits.has_zero_morphisms V} {c : complex_shape ι} {A B : c} (x y : A.hom B) (h : x.f = y.f) :
x = y
theorem homological_complex.hom.ext_iff {ι : Type u_1} {V : Type u} {_inst_1 : category_theory.category V} {_inst_2 : category_theory.limits.has_zero_morphisms V} {c : complex_shape ι} {A B : c} (x y : A.hom B) :
x = y x.f = y.f
@[ext]
structure homological_complex.hom {ι : Type u_1} {V : Type u} {c : complex_shape ι} (A B : c) :
Type (max u_1 v)
• f : Π (i : ι), A.X i B.X i
• comm' : (∀ (i j : ι), c.rel i jself.f i B.d i j = A.d i j self.f j) . "obviously"

A morphism of homological complexes consists of maps between the chain groups, commuting with the differentials.

@[simp]
theorem homological_complex.hom.comm_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} {A B : c} (f : A.hom B) (i j : ι) {X' : V} (f' : B.X j X') :
f.f i B.d i j f' = A.d i j f.f j f'
@[simp]
theorem homological_complex.hom.comm {ι : Type u_1} {V : Type u} {c : complex_shape ι} {A B : c} (f : A.hom B) (i j : ι) :
f.f i B.d i j = A.d i j f.f j
@[instance]
def homological_complex.hom.inhabited {ι : Type u_1} {V : Type u} {c : complex_shape ι} (A B : c) :
Equations
def homological_complex.id {ι : Type u_1} {V : Type u} {c : complex_shape ι} (A : c) :
A.hom A

Identity chain map.

Equations
def homological_complex.comp {ι : Type u_1} {V : Type u} {c : complex_shape ι} (A B C : c) (φ : A.hom B) (ψ : B.hom C) :
A.hom C

Composition of chain maps.

Equations
@[instance]
def homological_complex.category_theory.category {ι : Type u_1} {V : Type u} {c : complex_shape ι} :
Equations
@[simp]
theorem homological_complex.id_f {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (i : ι) :
(𝟙 C).f i = 𝟙 (C.X i)
@[simp]
theorem homological_complex.comp_f {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ C₃ : c} (f : C₁ C₂) (g : C₂ C₃) (i : ι) :
(f g).f i = f.f i g.f i
theorem homological_complex.hom_f_injective {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} :
function.injective (λ (f : C₁.hom C₂), f.f)
@[instance]
Equations
@[simp]
theorem homological_complex.zero_apply {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C D : c) (i : ι) :
0.f i = 0
@[instance]
Equations
@[instance]
def homological_complex.inhabited {ι : Type u_1} {V : Type u} {c : complex_shape ι}  :
Equations
theorem homological_complex.congr_hom {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C D : c} {f g : C D} (w : f = g) (i : ι) :
f.f i = g.f i
@[simp]
theorem homological_complex.eval_map {ι : Type u_1} (V : Type u) (c : complex_shape ι) (i : ι) (C D : c) (f : C D) :
i).map f = f.f i
@[simp]
theorem homological_complex.eval_obj {ι : Type u_1} (V : Type u) (c : complex_shape ι) (i : ι) (C : c) :
i).obj C = C.X i
def homological_complex.eval {ι : Type u_1} (V : Type u) (c : complex_shape ι) (i : ι) :
V

The functor picking out the i-th object of a complex.

Equations
@[simp]
theorem homological_complex.forget_obj {ι : Type u_1} (V : Type u) (c : complex_shape ι) (C : c) (ᾰ : ι) :
C = C.X
@[simp]
theorem homological_complex.forget_map {ι : Type u_1} (V : Type u) (c : complex_shape ι) (_x _x_1 : c) (f : _x _x_1) (i : ι) :
f i = f.f i
def homological_complex.forget {ι : Type u_1} (V : Type u) (c : complex_shape ι) :

The functor forgetting the differential in a complex, obtaining a graded object.

Equations
def homological_complex.forget_eval {ι : Type u_1} (V : Type u) (c : complex_shape ι) (i : ι) :

Forgetting the differentials than picking out the i-th object is the same as just picking out the i-th object.

Equations
@[simp]
theorem homological_complex.forget_eval_inv_app {ι : Type u_1} (V : Type u) (c : complex_shape ι) (i : ι) (X : c) :
.inv.app X = 𝟙 (X.X i)
@[simp]
theorem homological_complex.forget_eval_hom_app {ι : Type u_1} (V : Type u) (c : complex_shape ι) (i : ι) (X : c) :
.hom.app X = 𝟙 (X.X i)
@[simp]
theorem homological_complex.d_comp_eq_to_hom {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j j' : ι} (rij : c.rel i j) (rij' : c.rel i j') :
C.d i j' = C.d i j

If C.d i j and C.d i j' are both allowed, then we must have j = j', and so the differentials only differ by an eq_to_hom.

@[simp]
theorem homological_complex.eq_to_hom_comp_d {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i i' j : ι} (rij : c.rel i j) (rij' : c.rel i' j) :
C.d i' j = C.d i j

If C.d i j and C.d i' j are both allowed, then we must have i = i', and so the differentials only differ by an eq_to_hom.

theorem homological_complex.kernel_eq_kernel {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j j' : ι} (r : c.rel i j) (r' : c.rel i j') :
theorem homological_complex.image_eq_image {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i i' j : ι} (r : c.rel i j) (r' : c.rel i' j) :
def homological_complex.X_prev {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (j : ι) :
V

Either C.X i, if there is some i with c.rel i j, or the zero object.

Equations
• C.X_prev j = homological_complex.X_prev._match_1 C j (c.prev j)
• homological_complex.X_prev._match_1 C j (some i, _x⟩) = C.X i
• homological_complex.X_prev._match_1 C j none = 0
def homological_complex.X_prev_iso {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
C.X_prev j C.X i

If c.rel i j, then C.X_prev j is isomorphic to C.X i.

Equations
def homological_complex.X_prev_iso_zero {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {j : ι} (h : c.prev j = none) :
C.X_prev j 0

If there is no i so c.rel i j, then C.X_prev j is isomorphic to 0.

Equations
def homological_complex.X_next {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (i : ι) :
V

Either C.X j, if there is some j with c.rel i j, or the zero object.

Equations
• C.X_next i = homological_complex.X_next._match_1 C i (c.next i)
• homological_complex.X_next._match_1 C i (some j, _x⟩) = C.X j
• homological_complex.X_next._match_1 C i none = 0
def homological_complex.X_next_iso {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
C.X_next i C.X j

If c.rel i j, then C.X_next i is isomorphic to C.X j.

Equations
def homological_complex.X_next_iso_zero {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i : ι} (h : c.next i = none) :
C.X_next i 0

If there is no j so c.rel i j, then C.X_next i is isomorphic to 0.

Equations
def homological_complex.d_to {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (j : ι) :
C.X_prev j C.X j

The differential mapping into C.X j, or zero if there isn't one.

Equations
• C.d_to j = homological_complex.d_to._match_1 C j (c.prev j)
• homological_complex.d_to._match_1 C j (some i, w⟩) = (C.X_prev_iso w).hom C.d i j
• homological_complex.d_to._match_1 C j none = 0
def homological_complex.d_from {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (i : ι) :
C.X i C.X_next i

The differential mapping out of C.X i, or zero if there isn't one.

Equations
• C.d_from i = homological_complex.d_from._match_1 C i (c.next i)
• homological_complex.d_from._match_1 C i (some j, w⟩) = C.d i j (C.X_next_iso w).inv
• homological_complex.d_from._match_1 C i none = 0
theorem homological_complex.d_to_eq {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
C.d_to j = (C.X_prev_iso r).hom C.d i j
@[simp]
theorem homological_complex.d_to_eq_zero {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {j : ι} (h : c.prev j = none) :
C.d_to j = 0
theorem homological_complex.d_from_eq {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
C.d_from i = C.d i j (C.X_next_iso r).inv
@[simp]
theorem homological_complex.d_from_eq_zero {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i : ι} (h : c.next i = none) :
C.d_from i = 0
@[simp]
theorem homological_complex.X_prev_iso_comp_d_to {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
(C.X_prev_iso r).inv C.d_to j = C.d i j
@[simp]
theorem homological_complex.X_prev_iso_comp_d_to_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) {X' : V} (f' : C.X j X') :
(C.X_prev_iso r).inv C.d_to j f' = C.d i j f'
@[simp]
theorem homological_complex.X_prev_iso_zero_comp_d_to {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {j : ι} (h : c.prev j = none) :
@[simp]
theorem homological_complex.X_prev_iso_zero_comp_d_to_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {j : ι} (h : c.prev j = none) {X' : V} (f' : C.X j X') :
(C.X_prev_iso_zero h).inv C.d_to j f' = 0 f'
@[simp]
theorem homological_complex.d_from_comp_X_next_iso_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) {X' : V} (f' : C.X j X') :
C.d_from i (C.X_next_iso r).hom f' = C.d i j f'
@[simp]
theorem homological_complex.d_from_comp_X_next_iso {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
C.d_from i (C.X_next_iso r).hom = C.d i j
@[simp]
theorem homological_complex.d_from_comp_X_next_iso_zero {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i : ι} (h : c.next i = none) :
@[simp]
theorem homological_complex.d_from_comp_X_next_iso_zero_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i : ι} (h : c.next i = none) {X' : V} (f' : 0 X') :
C.d_from i (C.X_next_iso_zero h).hom f' = 0 f'
@[simp]
theorem homological_complex.d_to_comp_d_from {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) (j : ι) :
C.d_to j C.d_from j = 0
theorem homological_complex.kernel_from_eq_kernel {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
theorem homological_complex.image_to_eq_image {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C : c) {i j : ι} (r : c.rel i j) :
def homological_complex.hom.iso_app {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁ C₂) (i : ι) :
C₁.X i C₂.X i

The i-th component of an isomorphism of chain complexes.

Equations
@[simp]
theorem homological_complex.hom.iso_app_inv {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁ C₂) (i : ι) :
= f.inv.f i
@[simp]
theorem homological_complex.hom.iso_app_hom {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁ C₂) (i : ι) :
= f.hom.f i
@[simp]
theorem homological_complex.hom.iso_of_components_hom_f {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : Π (i : ι), C₁.X i C₂.X i) (hf : ∀ (i j : ι), c.rel i j(f i).hom C₂.d i j = C₁.d i j (f j).hom) (i : ι) :
= (f i).hom
@[simp]
theorem homological_complex.hom.iso_of_components_inv_f {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : Π (i : ι), C₁.X i C₂.X i) (hf : ∀ (i j : ι), c.rel i j(f i).hom C₂.d i j = C₁.d i j (f j).hom) (i : ι) :
= (f i).inv
def homological_complex.hom.iso_of_components {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : Π (i : ι), C₁.X i C₂.X i) (hf : ∀ (i j : ι), c.rel i j(f i).hom C₂.d i j = C₁.d i j (f j).hom) :
C₁ C₂

Construct an isomorphism of chain complexes from isomorphism of the objects which commute with the differentials.

Equations
@[simp]
theorem homological_complex.hom.iso_of_components_app {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : Π (i : ι), C₁.X i C₂.X i) (hf : ∀ (i j : ι), c.rel i j(f i).hom C₂.d i j = C₁.d i j (f j).hom) (i : ι) :

Lemmas relating chain maps and d_to/d_from.

def homological_complex.hom.prev {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (j : ι) :
C₁.X_prev j C₂.X_prev j

f.prev j is f.f i if there is some r i j, and zero otherwise.

Equations
theorem homological_complex.hom.prev_eq {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) {i j : ι} (w : c.rel i j) :
f.prev j = (C₁.X_prev_iso w).hom f.f i (C₂.X_prev_iso w).inv
def homological_complex.hom.next {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (i : ι) :
C₁.X_next i C₂.X_next i

f.next i is f.f j if there is some r i j, and zero otherwise.

Equations
theorem homological_complex.hom.next_eq {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) {i j : ι} (w : c.rel i j) :
f.next i = (C₁.X_next_iso w).hom f.f j (C₂.X_next_iso w).inv
@[simp]
theorem homological_complex.hom.comm_from_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (i : ι) {X' : V} (f' : C₂.X_next i X') :
f.f i C₂.d_from i f' = C₁.d_from i f.next i f'
@[simp]
theorem homological_complex.hom.comm_from {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (i : ι) :
f.f i C₂.d_from i = C₁.d_from i f.next i
@[simp]
theorem homological_complex.hom.comm_to_assoc {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (j : ι) {X' : V} (f' : C₂.X j X') :
f.prev j C₂.d_to j f' = C₁.d_to j f.f j f'
@[simp]
theorem homological_complex.hom.comm_to {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (j : ι) :
f.prev j C₂.d_to j = C₁.d_to j f.f j
def homological_complex.hom.sq_from {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (i : ι) :

A morphism of chain complexes induces a morphism of arrows of the differentials out of each object.

Equations
@[simp]
theorem homological_complex.hom.sq_from_left {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (i : ι) :
(f.sq_from i).left = f.f i
@[simp]
theorem homological_complex.hom.sq_from_right {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (i : ι) :
(f.sq_from i).right = f.next i
@[simp]
theorem homological_complex.hom.sq_from_id {ι : Type u_1} {V : Type u} {c : complex_shape ι} (C₁ : c) (i : ι) :
@[simp]
theorem homological_complex.hom.sq_from_comp {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ C₃ : c} (f : C₁ C₂) (g : C₂ C₃) (i : ι) :
def homological_complex.hom.sq_to {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (j : ι) :

A morphism of chain complexes induces a morphism of arrows of the differentials into each object.

Equations
@[simp]
theorem homological_complex.hom.sq_to_left {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (j : ι) :
(f.sq_to j).left = f.prev j
@[simp]
theorem homological_complex.hom.sq_to_right {ι : Type u_1} {V : Type u} {c : complex_shape ι} {C₁ C₂ : c} (f : C₁.hom C₂) (j : ι) :
(f.sq_to j).right = f.f j
def chain_complex.of {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X (n + 1) X n) (sq : ∀ (n : α), d (n + 1) d n = 0) :

Construct an α-indexed chain complex from a dependently-typed differential.

Equations
@[simp]
theorem chain_complex.of_X {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X (n + 1) X n) (sq : ∀ (n : α), d (n + 1) d n = 0) (n : α) :
d sq).X n = X n
@[simp]
theorem chain_complex.of_d {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X (n + 1) X n) (sq : ∀ (n : α), d (n + 1) d n = 0) (j : α) :
d sq).d (j + 1) j = d j
theorem chain_complex.of_d_ne {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X (n + 1) X n) (sq : ∀ (n : α), d (n + 1) d n = 0) {i j : α} (h : i j + 1) :
d sq).d i j = 0
def chain_complex.of_hom {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d_X : Π (n : α), X (n + 1) X n) (sq_X : ∀ (n : α), d_X (n + 1) d_X n = 0) (Y : α → V) (d_Y : Π (n : α), Y (n + 1) Y n) (sq_Y : ∀ (n : α), d_Y (n + 1) d_Y n = 0) (f : Π (i : α), X i Y i) (comm : ∀ (i : α), f (i + 1) d_Y i = d_X i f i) :
d_X sq_X d_Y sq_Y

A constructor for chain maps between α-indexed chain complexes built using chain_complex.of, from a dependently typed collection of morphisms.

Equations
• d_X sq_X Y d_Y sq_Y f comm = {f := f, comm' := _}
@[simp]
theorem chain_complex.of_hom_f {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d_X : Π (n : α), X (n + 1) X n) (sq_X : ∀ (n : α), d_X (n + 1) d_X n = 0) (Y : α → V) (d_Y : Π (n : α), Y (n + 1) Y n) (sq_Y : ∀ (n : α), d_Y (n + 1) d_Y n = 0) (f : Π (i : α), X i Y i) (comm : ∀ (i : α), f (i + 1) d_Y i = d_X i f i) (i : α) :
d_X sq_X Y d_Y sq_Y f comm).f i = f i
@[nolint]
structure chain_complex.mk_struct (V : Type u)  :
Type (max u v)

Auxiliary structure for setting up the recursion in mk. This is purely an implementation detail: for some reason just using the dependent 6-tuple directly results in mk_aux taking much longer (well over the -T100000 limit) to elaborate.

def chain_complex.mk_struct.flat {V : Type u} (t : chain_complex.mk_struct V) :
Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0

Flatten to a tuple.

Equations
def chain_complex.mk_aux {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) (n : ) :

Auxiliary definition for mk.

Equations
def chain_complex.mk {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) :

A inductive constructor for ℕ-indexed chain complexes.

You provide explicitly the first two differentials, then a function which takes two differentials and the fact they compose to zero, and returns the next object, its differential, and the fact it composes appropiately to zero.

See also mk', which only sees the previous differential in the inductive step.

Equations
@[simp]
theorem chain_complex.mk_X_0 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) :
X₁ X₂ d₀ d₁ s succ).X 0 = X₀
@[simp]
theorem chain_complex.mk_X_1 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) :
X₁ X₂ d₀ d₁ s succ).X 1 = X₁
@[simp]
theorem chain_complex.mk_X_2 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) :
X₁ X₂ d₀ d₁ s succ).X 2 = X₂
@[simp]
theorem chain_complex.mk_d_1_0 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) :
X₁ X₂ d₀ d₁ s succ).d 1 0 = d₀
@[simp]
theorem chain_complex.mk_d_2_0 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁) (s : d₁ d₀ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₁ X₀) (d₁ : X₂ X₁), d₁ d₀ = 0), Σ' (X₃ : V) (d₂ : X₃ t.snd.snd.fst), d₂ t.snd.snd.snd.snd.fst = 0) :
X₁ X₂ d₀ d₁ s succ).d 2 1 = d₁
def chain_complex.mk' {V : Type u} (X₀ X₁ : V) (d : X₁ X₀) (succ' : Π (t : Σ (X₀ X₁ : V), X₁ X₀), Σ' (X₂ : V) (d : X₂ t.snd.fst), d t.snd.snd = 0) :

A simpler inductive constructor for ℕ-indexed chain complexes.

You provide explicitly the first differential, then a function which takes a differential, and returns the next object, its differential, and the fact it composes appropriately to zero.

Equations
@[simp]
theorem chain_complex.mk'_X_0 {V : Type u} (X₀ X₁ : V) (d₀ : X₁ X₀) (succ' : Π (t : Σ (X₀ X₁ : V), X₁ X₀), Σ' (X₂ : V) (d : X₂ t.snd.fst), d t.snd.snd = 0) :
X₁ d₀ succ').X 0 = X₀
@[simp]
theorem chain_complex.mk'_X_1 {V : Type u} (X₀ X₁ : V) (d₀ : X₁ X₀) (succ' : Π (t : Σ (X₀ X₁ : V), X₁ X₀), Σ' (X₂ : V) (d : X₂ t.snd.fst), d t.snd.snd = 0) :
X₁ d₀ succ').X 1 = X₁
@[simp]
theorem chain_complex.mk'_d_1_0 {V : Type u} (X₀ X₁ : V) (d₀ : X₁ X₀) (succ' : Π (t : Σ (X₀ X₁ : V), X₁ X₀), Σ' (X₂ : V) (d : X₂ t.snd.fst), d t.snd.snd = 0) :
X₁ d₀ succ').d 1 0 = d₀
def chain_complex.mk_hom_aux {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : one Q.d 1 0 = P.d 1 0 zero) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f' Q.d (n + 1) n = P.d (n + 1) n f), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), f'' Q.d (n + 2) (n + 1) = P.d (n + 2) (n + 1) p.snd.fst) (n : ) :
Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f' Q.d (n + 1) n = P.d (n + 1) n f

An auxiliary construction for mk_hom.

Here we build by induction a family of commutative squares, but don't require at the type level that these successive commutative squares actually agree. They do in fact agree, and we then capture that at the type level (i.e. by constructing a chain map) in mk_hom.

Equations
def chain_complex.mk_hom {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : one Q.d 1 0 = P.d 1 0 zero) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f' Q.d (n + 1) n = P.d (n + 1) n f), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), f'' Q.d (n + 2) (n + 1) = P.d (n + 2) (n + 1) p.snd.fst) :
P Q

A constructor for chain maps between ℕ-indexed chain complexes, working by induction on commutative squares.

You need to provide the components of the chain map in degrees 0 and 1, show that these form a commutative square, and then give a construction of each component, and the fact that it forms a commutative square with the previous component, using as an inductive hypothesis the data (and commutativity) of the previous two components.

Equations
@[simp]
theorem chain_complex.mk_hom_f_0 {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : one Q.d 1 0 = P.d 1 0 zero) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f' Q.d (n + 1) n = P.d (n + 1) n f), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), f'' Q.d (n + 2) (n + 1) = P.d (n + 2) (n + 1) p.snd.fst) :
(P.mk_hom Q zero one one_zero_comm succ).f 0 = zero
@[simp]
theorem chain_complex.mk_hom_f_1 {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : one Q.d 1 0 = P.d 1 0 zero) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f' Q.d (n + 1) n = P.d (n + 1) n f), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), f'' Q.d (n + 2) (n + 1) = P.d (n + 2) (n + 1) p.snd.fst) :
(P.mk_hom Q zero one one_zero_comm succ).f 1 = one
@[simp]
theorem chain_complex.mk_hom_f_succ_succ {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : one Q.d 1 0 = P.d 1 0 zero) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f' Q.d (n + 1) n = P.d (n + 1) n f), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), f'' Q.d (n + 2) (n + 1) = P.d (n + 2) (n + 1) p.snd.fst) (n : ) :
(P.mk_hom Q zero one one_zero_comm succ).f (n + 2) = (succ n (P.mk_hom Q zero one one_zero_comm succ).f n, (P.mk_hom Q zero one one_zero_comm succ).f (n + 1), _⟩⟩).fst
def cochain_complex.of {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X n X (n + 1)) (sq : ∀ (n : α), d n d (n + 1) = 0) :

Construct an α-indexed cochain complex from a dependently-typed differential.

Equations
@[simp]
theorem cochain_complex.of_X {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X n X (n + 1)) (sq : ∀ (n : α), d n d (n + 1) = 0) (n : α) :
sq).X n = X n
@[simp]
theorem cochain_complex.of_d {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X n X (n + 1)) (sq : ∀ (n : α), d n d (n + 1) = 0) (j : α) :
sq).d j (j + 1) = d j
theorem cochain_complex.of_d_ne {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d : Π (n : α), X n X (n + 1)) (sq : ∀ (n : α), d n d (n + 1) = 0) {i j : α} (h : i + 1 j) :
sq).d i j = 0
@[simp]
theorem cochain_complex.of_hom_f {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d_X : Π (n : α), X n X (n + 1)) (sq_X : ∀ (n : α), d_X n d_X (n + 1) = 0) (Y : α → V) (d_Y : Π (n : α), Y n Y (n + 1)) (sq_Y : ∀ (n : α), d_Y n d_Y (n + 1) = 0) (f : Π (i : α), X i Y i) (comm : ∀ (i : α), f i d_Y i = d_X i f (i + 1)) (i : α) :
d_X sq_X Y d_Y sq_Y f comm).f i = f i
def cochain_complex.of_hom {V : Type u} {α : Type u_2} [has_one α] [decidable_eq α] (X : α → V) (d_X : Π (n : α), X n X (n + 1)) (sq_X : ∀ (n : α), d_X n d_X (n + 1) = 0) (Y : α → V) (d_Y : Π (n : α), Y n Y (n + 1)) (sq_Y : ∀ (n : α), d_Y n d_Y (n + 1) = 0) (f : Π (i : α), X i Y i) (comm : ∀ (i : α), f i d_Y i = d_X i f (i + 1)) :
d_X sq_X d_Y sq_Y

A constructor for chain maps between α-indexed cochain complexes built using cochain_complex.of, from a dependently typed collection of morphisms.

Equations
• sq_X Y d_Y sq_Y f comm = {f := f, comm' := _}
@[nolint]
structure cochain_complex.mk_struct (V : Type u)  :
Type (max u v)

Auxiliary structure for setting up the recursion in mk. This is purely an implementation detail: for some reason just using the dependent 6-tuple directly results in mk_aux taking much longer (well over the -T100000 limit) to elaborate.

def cochain_complex.mk_struct.flat {V : Type u}  :
Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0

Flatten to a tuple.

Equations
def cochain_complex.mk_aux {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) (n : ) :

Auxiliary definition for mk.

Equations
def cochain_complex.mk {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) :

A inductive constructor for ℕ-indexed cochain complexes.

You provide explicitly the first two differentials, then a function which takes two differentials and the fact they compose to zero, and returns the next object, its differential, and the fact it composes appropiately to zero.

See also mk', which only sees the previous differential in the inductive step.

Equations
@[simp]
theorem cochain_complex.mk_X_0 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) :
X₁ X₂ d₀ d₁ s succ).X 0 = X₀
@[simp]
theorem cochain_complex.mk_X_1 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) :
X₁ X₂ d₀ d₁ s succ).X 1 = X₁
@[simp]
theorem cochain_complex.mk_X_2 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) :
X₁ X₂ d₀ d₁ s succ).X 2 = X₂
@[simp]
theorem cochain_complex.mk_d_1_0 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) :
X₁ X₂ d₀ d₁ s succ).d 0 1 = d₀
@[simp]
theorem cochain_complex.mk_d_2_0 {V : Type u} (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂) (s : d₀ d₁ = 0) (succ : Π (t : Σ' (X₀ X₁ X₂ : V) (d₀ : X₀ X₁) (d₁ : X₁ X₂), d₀ d₁ = 0), Σ' (X₃ : V) (d₂ : t.snd.snd.fst X₃), t.snd.snd.snd.snd.fst d₂ = 0) :
X₁ X₂ d₀ d₁ s succ).d 1 2 = d₁
def cochain_complex.mk' {V : Type u} (X₀ X₁ : V) (d : X₀ X₁) (succ' : Π (t : Σ (X₀ X₁ : V), X₀ X₁), Σ' (X₂ : V) (d : t.snd.fst X₂), t.snd.snd d = 0) :

A simpler inductive constructor for ℕ-indexed cochain complexes.

You provide explicitly the first differential, then a function which takes a differential, and returns the next object, its differential, and the fact it composes appropriately to zero.

Equations
@[simp]
theorem cochain_complex.mk'_X_0 {V : Type u} (X₀ X₁ : V) (d₀ : X₀ X₁) (succ' : Π (t : Σ (X₀ X₁ : V), X₀ X₁), Σ' (X₂ : V) (d : t.snd.fst X₂), t.snd.snd d = 0) :
X₁ d₀ succ').X 0 = X₀
@[simp]
theorem cochain_complex.mk'_X_1 {V : Type u} (X₀ X₁ : V) (d₀ : X₀ X₁) (succ' : Π (t : Σ (X₀ X₁ : V), X₀ X₁), Σ' (X₂ : V) (d : t.snd.fst X₂), t.snd.snd d = 0) :
X₁ d₀ succ').X 1 = X₁
@[simp]
theorem cochain_complex.mk'_d_1_0 {V : Type u} (X₀ X₁ : V) (d₀ : X₀ X₁) (succ' : Π (t : Σ (X₀ X₁ : V), X₀ X₁), Σ' (X₂ : V) (d : t.snd.fst X₂), t.snd.snd d = 0) :
X₁ d₀ succ').d 0 1 = d₀
def cochain_complex.mk_hom_aux {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : zero Q.d 0 1 = P.d 0 1 one) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f Q.d n (n + 1) = P.d n (n + 1) f'), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), p.snd.fst Q.d (n + 1) (n + 2) = P.d (n + 1) (n + 2) f'') (n : ) :
Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f Q.d n (n + 1) = P.d n (n + 1) f'

An auxiliary construction for mk_hom.

Here we build by induction a family of commutative squares, but don't require at the type level that these successive commutative squares actually agree. They do in fact agree, and we then capture that at the type level (i.e. by constructing a chain map) in mk_hom.

Equations
def cochain_complex.mk_hom {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : zero Q.d 0 1 = P.d 0 1 one) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f Q.d n (n + 1) = P.d n (n + 1) f'), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), p.snd.fst Q.d (n + 1) (n + 2) = P.d (n + 1) (n + 2) f'') :
P Q

A constructor for chain maps between ℕ-indexed cochain complexes, working by induction on commutative squares.

You need to provide the components of the chain map in degrees 0 and 1, show that these form a commutative square, and then give a construction of each component, and the fact that it forms a commutative square with the previous component, using as an inductive hypothesis the data (and commutativity) of the previous two components.

Equations
@[simp]
theorem cochain_complex.mk_hom_f_0 {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : zero Q.d 0 1 = P.d 0 1 one) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f Q.d n (n + 1) = P.d n (n + 1) f'), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), p.snd.fst Q.d (n + 1) (n + 2) = P.d (n + 1) (n + 2) f'') :
(P.mk_hom Q zero one one_zero_comm succ).f 0 = zero
@[simp]
theorem cochain_complex.mk_hom_f_1 {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : zero Q.d 0 1 = P.d 0 1 one) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f Q.d n (n + 1) = P.d n (n + 1) f'), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), p.snd.fst Q.d (n + 1) (n + 2) = P.d (n + 1) (n + 2) f'') :
(P.mk_hom Q zero one one_zero_comm succ).f 1 = one
@[simp]
theorem cochain_complex.mk_hom_f_succ_succ {V : Type u} (P Q : ) (zero : P.X 0 Q.X 0) (one : P.X 1 Q.X 1) (one_zero_comm : zero Q.d 0 1 = P.d 0 1 one) (succ : Π (n : ) (p : Σ' (f : P.X n Q.X n) (f' : P.X (n + 1) Q.X (n + 1)), f Q.d n (n + 1) = P.d n (n + 1) f'), Σ' (f'' : P.X (n + 2) Q.X (n + 2)), p.snd.fst Q.d (n + 1) (n + 2) = P.d (n + 1) (n + 2) f'') (n : ) :
(P.mk_hom Q zero one one_zero_comm succ).f (n + 2) = (succ n (P.mk_hom Q zero one one_zero_comm succ).f n, (P.mk_hom Q zero one one_zero_comm succ).f (n + 1), _⟩⟩).fst