l3lab/ntp-mathlib huggingface dataset:
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · 

Proof state:
case pos
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
i' : ι
x : A ⟶ X K i'
hx : k = x ≫ d K i' i
h : ComplexShape.Rel c i' i
⊢ liftCycles K k j hj (_ : k ≫ d K i j = 0) ≫ homologyπ K i = 0

Next tactic:
obtain rfl := c.prev_eq' h
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · obtain rfl := c.prev_eq' h
    

Proof state:
case pos
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
x : A ⟶ X K (ComplexShape.prev c i)
hx : k = x ≫ d K (ComplexShape.prev c i) i
h : ComplexShape.Rel c (ComplexShape.prev c i) i
⊢ liftCycles K k j hj (_ : k ≫ d K i j = 0) ≫ homologyπ K i = 0

Next tactic:
exact (K.sc i).liftCycles_homologyπ_eq_zero_of_boundary _ x hx
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · obtain rfl := c.prev_eq' h
    exact (K.sc i).liftCycles_homologyπ_eq_zero_of_boundary _ x hx
  · 

Proof state:
case neg
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
i' : ι
x : A ⟶ X K i'
hx : k = x ≫ d K i' i
h : ¬ComplexShape.Rel c i' i
⊢ liftCycles K k j hj (_ : k ≫ d K i j = 0) ≫ homologyπ K i = 0

Next tactic:
have : liftCycles K k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) = 0 := by
      rw [K.shape _ _ h, comp_zero] at hx
      rw [← cancel_mono (K.iCycles i), zero_comp, liftCycles_i, hx]
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · obtain rfl := c.prev_eq' h
    exact (K.sc i).liftCycles_homologyπ_eq_zero_of_boundary _ x hx
  · have : liftCycles K k j hj (by 

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
i' : ι
x : A ⟶ X K i'
hx : k = x ≫ d K i' i
h : ¬ComplexShape.Rel c i' i
⊢ k ≫ d K i j = 0

Next tactic:
rw [hx, assoc, K.d_comp_d, comp_zero]
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · obtain rfl := c.prev_eq' h
    exact (K.sc i).liftCycles_homologyπ_eq_zero_of_boundary _ x hx
  · have : liftCycles K k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) = 0 := by
      

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
i' : ι
x : A ⟶ X K i'
hx : k = x ≫ d K i' i
h : ¬ComplexShape.Rel c i' i
⊢ liftCycles K k j hj (_ : k ≫ d K i j = 0) = 0

Next tactic:
rw [K.shape _ _ h, comp_zero] at hx
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · obtain rfl := c.prev_eq' h
    exact (K.sc i).liftCycles_homologyπ_eq_zero_of_boundary _ x hx
  · have : liftCycles K k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) = 0 := by
      rw [K.shape _ _ h, comp_zero] at hx
      

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
i' : ι
x : A ⟶ X K i'
hx✝ : k = x ≫ d K i' i
hx : k = 0
h : ¬ComplexShape.Rel c i' i
⊢ liftCycles K k j hj (_ : k ≫ d K i j = 0) = 0

Next tactic:
rw [← cancel_mono (K.iCycles i), zero_comp, liftCycles_i, hx]
@[reassoc]
lemma liftCycles_homologyπ_eq_zero_of_boundary {A : C} (k : A ⟶ K.X i) (j : ι)
    (hj : c.next i = j) {i' : ι} (x : A ⟶ K.X i') (hx : k = x ≫ K.d i' i) :
    K.liftCycles k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) ≫ K.homologyπ i = 0 := by
  by_cases h : c.Rel i' i
  · obtain rfl := c.prev_eq' h
    exact (K.sc i).liftCycles_homologyπ_eq_zero_of_boundary _ x hx
  · have : liftCycles K k j hj (by rw [hx, assoc, K.d_comp_d, comp_zero]) = 0 := by
      rw [K.shape _ _ h, comp_zero] at hx
      rw [← cancel_mono (K.iCycles i), zero_comp, liftCycles_i, hx]
    

Proof state:
case neg
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
i' : ι
x : A ⟶ X K i'
hx : k = x ≫ d K i' i
h : ¬ComplexShape.Rel c i' i
this : liftCycles K k j hj (_ : k ≫ d K i j = 0) = 0
⊢ liftCycles K k j hj (_ : k ≫ d K i j = 0) ≫ homologyπ K i = 0

Next tactic:
rw [this, zero_comp]
@[reassoc (attr := simp)]
lemma toCycles_comp_homologyπ [K.HasHomology j] :
    K.toCycles i j ≫ K.homologyπ j = 0 :=
  K.liftCycles_homologyπ_eq_zero_of_boundary (K.d i j) (c.next j) rfl (𝟙 _) (by 

Proof state:
C : Type u_1
inst✝³ : Category.{u_3, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology K j
⊢ d K i j = 𝟙 (X K i) ≫ d K i j

Next tactic:
simp
/-- `K.homology j` is the cokernel of `K.toCycles i j : K.X i ⟶ K.cycles j`
when `c.prev j = i`. -/
noncomputable def homologyIsCokernel (hi : c.prev j = i) [K.HasHomology j] :
    IsColimit (CokernelCofork.ofπ (K.homologyπ j) (K.toCycles_comp_homologyπ i j)) := by
  

Proof state:
C : Type u_1
inst✝³ : Category.{?u.50903, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝¹ : HasHomology K i
hi : ComplexShape.prev c j = i
inst✝ : HasHomology K j
⊢ IsColimit (CokernelCofork.ofπ (homologyπ K j) (_ : toCycles K i j ≫ homologyπ K j = 0))

Next tactic:
subst hi
/-- `K.homology j` is the cokernel of `K.toCycles i j : K.X i ⟶ K.cycles j`
when `c.prev j = i`. -/
noncomputable def homologyIsCokernel (hi : c.prev j = i) [K.HasHomology j] :
    IsColimit (CokernelCofork.ofπ (K.homologyπ j) (K.toCycles_comp_homologyπ i j)) := by
  subst hi
  

Proof state:
C : Type u_1
inst✝³ : Category.{?u.50903, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
j k : ι
inst✝¹ : HasHomology K j
inst✝ : HasHomology K (ComplexShape.prev c j)
⊢ IsColimit (CokernelCofork.ofπ (homologyπ K j) (_ : toCycles K (ComplexShape.prev c j) j ≫ homologyπ K j = 0))

Next tactic:
exact ((K.sc j).homologyIsCokernel)
/-- The morphism from `K.opcycles i` that is induced by an "opcycle", i.e. a morphism
from `K.X i` whose precomposition with the differential is zero. -/
noncomputable def descOpcycles {A : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) : K.opcycles i ⟶ A :=
  (K.sc i).descOpcycles k (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.53470, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d K j i ≫ k = 0
⊢ (sc K i).f ≫ k = 0

Next tactic:
subst hj
/-- The morphism from `K.opcycles i` that is induced by an "opcycle", i.e. a morphism
from `K.X i` whose precomposition with the differential is zero. -/
noncomputable def descOpcycles {A : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) : K.opcycles i ⟶ A :=
  (K.sc i).descOpcycles k (by subst hj; 

Proof state:
C : Type u_1
inst✝² : Category.{?u.53470, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
hk : d K (ComplexShape.prev c i) i ≫ k = 0
⊢ (sc K i).f ≫ k = 0

Next tactic:
exact hk
@[reassoc (attr := simp)]
lemma p_descOpcycles {A : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) : K.pOpcycles i ≫ K.descOpcycles k j hj hk = k := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d K j i ≫ k = 0
⊢ pOpcycles K i ≫ descOpcycles K k j hj hk = k

Next tactic:
dsimp [descOpcycles, pOpcycles]
@[reassoc (attr := simp)]
lemma p_descOpcycles {A : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) : K.pOpcycles i ≫ K.descOpcycles k j hj hk = k := by
  dsimp [descOpcycles, pOpcycles]
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d K j i ≫ k = 0
⊢ ShortComplex.pOpcycles (sc K i) ≫ ShortComplex.descOpcycles (sc K i) k (_ : (sc K i).f ≫ k = 0) = k

Next tactic:
simp
@[reassoc (attr := simp)]
lemma d_pOpcycles [K.HasHomology j] : K.d i j ≫ K.pOpcycles j = 0 := by
  

Proof state:
C : Type u_1
inst✝³ : Category.{u_3, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology K j
⊢ d K i j ≫ pOpcycles K j = 0

Next tactic:
by_cases hij : c.Rel i j
@[reassoc (attr := simp)]
lemma d_pOpcycles [K.HasHomology j] : K.d i j ≫ K.pOpcycles j = 0 := by
  by_cases hij : c.Rel i j
  · 

Proof state:
case pos
C : Type u_1
inst✝³ : Category.{u_3, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology K j
hij : ComplexShape.Rel c i j
⊢ d K i j ≫ pOpcycles K j = 0

Next tactic:
obtain rfl := c.prev_eq' hij
@[reassoc (attr := simp)]
lemma d_pOpcycles [K.HasHomology j] : K.d i j ≫ K.pOpcycles j = 0 := by
  by_cases hij : c.Rel i j
  · obtain rfl := c.prev_eq' hij
    

Proof state:
case pos
C : Type u_1
inst✝³ : Category.{u_3, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
j k : ι
inst✝¹ : HasHomology K j
inst✝ : HasHomology K (ComplexShape.prev c j)
hij : ComplexShape.Rel c (ComplexShape.prev c j) j
⊢ d K (ComplexShape.prev c j) j ≫ pOpcycles K j = 0

Next tactic:
exact (K.sc j).f_pOpcycles
@[reassoc (attr := simp)]
lemma d_pOpcycles [K.HasHomology j] : K.d i j ≫ K.pOpcycles j = 0 := by
  by_cases hij : c.Rel i j
  · obtain rfl := c.prev_eq' hij
    exact (K.sc j).f_pOpcycles
  · 

Proof state:
case neg
C : Type u_1
inst✝³ : Category.{u_3, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology K j
hij : ¬ComplexShape.Rel c i j
⊢ d K i j ≫ pOpcycles K j = 0

Next tactic:
rw [K.shape _ _ hij, zero_comp]
/-- `K.opcycles j` is the cokernel of `K.d i j` when `c.prev j = i`. -/
noncomputable def opcyclesIsCokernel (hi : c.prev j = i) [K.HasHomology j] :
    IsColimit (CokernelCofork.ofπ (K.pOpcycles j) (K.d_pOpcycles i j)) := by
  

Proof state:
C : Type u_1
inst✝³ : Category.{?u.58377, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝¹ : HasHomology K i
hi : ComplexShape.prev c j = i
inst✝ : HasHomology K j
⊢ IsColimit (CokernelCofork.ofπ (pOpcycles K j) (_ : d K i j ≫ pOpcycles K j = 0))

Next tactic:
obtain rfl := hi
/-- `K.opcycles j` is the cokernel of `K.d i j` when `c.prev j = i`. -/
noncomputable def opcyclesIsCokernel (hi : c.prev j = i) [K.HasHomology j] :
    IsColimit (CokernelCofork.ofπ (K.pOpcycles j) (K.d_pOpcycles i j)) := by
  obtain rfl := hi
  

Proof state:
C : Type u_1
inst✝³ : Category.{?u.58377, u_1} C
inst✝² : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
j k : ι
inst✝¹ : HasHomology K j
inst✝ : HasHomology K (ComplexShape.prev c j)
⊢ IsColimit (CokernelCofork.ofπ (pOpcycles K j) (_ : d K (ComplexShape.prev c j) j ≫ pOpcycles K j = 0))

Next tactic:
exact (K.sc j).opcyclesIsCokernel
instance : Epi (K.pOpcycles i) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{?u.60570, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝ : HasHomology K i
⊢ Epi (pOpcycles K i)

Next tactic:
dsimp only [pOpcycles]
instance : Epi (K.pOpcycles i) := by
  dsimp only [pOpcycles]
  

Proof state:
C : Type u_1
inst✝² : Category.{?u.60570, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝ : HasHomology K i
⊢ Epi (ShortComplex.pOpcycles (sc K i))

Next tactic:
infer_instance
instance : Mono (K.homologyι i) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{?u.61172, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝ : HasHomology K i
⊢ Mono (homologyι K i)

Next tactic:
dsimp only [homologyι]
instance : Mono (K.homologyι i) := by
  dsimp only [homologyι]
  

Proof state:
C : Type u_1
inst✝² : Category.{?u.61172, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝ : HasHomology K i
⊢ Mono (ShortComplex.homologyι (sc K i))

Next tactic:
infer_instance
@[reassoc (attr := simp)]
lemma fromOpcycles_d :
    K.fromOpcycles i j ≫ K.d j k = 0 := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j k : ι
inst✝ : HasHomology K i
⊢ fromOpcycles K i j ≫ d K j k = 0

Next tactic:
simp only [← cancel_epi (K.pOpcycles i), p_fromOpcycles_assoc, d_comp_d, comp_zero]
@[reassoc]
lemma descOpcycles_comp {A A' : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) (α : A ⟶ A') :
    K.descOpcycles k j hj hk ≫ α = K.descOpcycles (k ≫ α) j hj
      (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.63383, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A A' : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d K j i ≫ k = 0
α : A ⟶ A'
⊢ d K j i ≫ k ≫ α = 0

Next tactic:
rw [reassoc_of% hk, zero_comp]
@[reassoc]
lemma descOpcycles_comp {A A' : C} (k : K.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : K.d j i ≫ k = 0) (α : A ⟶ A') :
    K.descOpcycles k j hj hk ≫ α = K.descOpcycles (k ≫ α) j hj
      (by rw [reassoc_of% hk, zero_comp]) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A A' : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d K j i ≫ k = 0
α : A ⟶ A'
⊢ descOpcycles K k j hj hk ≫ α = descOpcycles K (k ≫ α) j hj (_ : d K j i ≫ k ≫ α = 0)

Next tactic:
simp only [← cancel_epi (K.pOpcycles i), p_descOpcycles_assoc, p_descOpcycles]
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.65647, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx : k = d K i i' ≫ x
⊢ d K j i ≫ k = 0

Next tactic:
rw [hx, K.d_comp_d_assoc, zero_comp]
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx : k = d K i i' ≫ x
⊢ homologyι K i ≫ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
by_cases h : c.Rel i i'
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  by_cases h : c.Rel i i'
  · 

Proof state:
case pos
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx : k = d K i i' ≫ x
h : ComplexShape.Rel c i i'
⊢ homologyι K i ≫ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
obtain rfl := c.next_eq' h
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  by_cases h : c.Rel i i'
  · obtain rfl := c.next_eq' h
    

Proof state:
case pos
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
x : X K (ComplexShape.next c i) ⟶ A
hx : k = d K i (ComplexShape.next c i) ≫ x
h : ComplexShape.Rel c i (ComplexShape.next c i)
⊢ homologyι K i ≫ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
exact (K.sc i).homologyι_descOpcycles_eq_zero_of_boundary _ x hx
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  by_cases h : c.Rel i i'
  · obtain rfl := c.next_eq' h
    exact (K.sc i).homologyι_descOpcycles_eq_zero_of_boundary _ x hx
  · 

Proof state:
case neg
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx : k = d K i i' ≫ x
h : ¬ComplexShape.Rel c i i'
⊢ homologyι K i ≫ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
have : K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
      rw [K.shape _ _ h, zero_comp] at hx
      rw [← cancel_epi (K.pOpcycles i), comp_zero, p_descOpcycles, hx]
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  by_cases h : c.Rel i i'
  · obtain rfl := c.next_eq' h
    exact (K.sc i).homologyι_descOpcycles_eq_zero_of_boundary _ x hx
  · have : K.descOpcycles k j hj (by 

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx : k = d K i i' ≫ x
h : ¬ComplexShape.Rel c i i'
⊢ d K j i ≫ k = 0

Next tactic:
rw [hx, K.d_comp_d_assoc, zero_comp]
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  by_cases h : c.Rel i i'
  · obtain rfl := c.next_eq' h
    exact (K.sc i).homologyι_descOpcycles_eq_zero_of_boundary _ x hx
  · have : K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
      

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx : k = d K i i' ≫ x
h : ¬ComplexShape.Rel c i i'
⊢ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
rw [K.shape _ _ h, zero_comp] at hx
@[reassoc]
lemma homologyι_descOpcycles_eq_zero_of_boundary {A : C} (k : K.X i ⟶ A) (j : ι)
    (hj : c.prev i = j) {i' : ι} (x : K.X i' ⟶ A) (hx : k = K.d i i' ≫ x) :
    K.homologyι i ≫ K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
  by_cases h : c.Rel i i'
  · obtain rfl := c.next_eq' h
    exact (K.sc i).homologyι_descOpcycles_eq_zero_of_boundary _ x hx
  · have : K.descOpcycles k j hj (by rw [hx, K.d_comp_d_assoc, zero_comp]) = 0 := by
      rw [K.shape _ _ h, zero_comp] at hx
      

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i j✝ k✝ : ι
inst✝ : HasHomology K i
A : C
k : X K i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
i' : ι
x : X K i' ⟶ A
hx✝ : k = d K i i' ≫ x
hx : k = 0
h : ¬ComplexShape.Rel c i i'
⊢ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
rw [← cancel_epi (K.pOpcycles i), comp_zero, p_descOpcycles, hx]