l3lab/ntp-mathlib huggingface dataset:
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
⊢ { l // opcyclesMap S.g i ≫ l = k }

Next tactic:
have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      dsimp
      rw [← p_opcyclesMap_assoc, hk, comp_zero])
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
⊢ (ShortComplex.map S (eval C c i)).f ≫ pOpcycles S.X₂ i ≫ k = 0

Next tactic:
dsimp
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      dsimp
      

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
⊢ Hom.f S.f i ≫ pOpcycles S.X₂ i ≫ k = 0

Next tactic:
rw [← p_opcyclesMap_assoc, hk, comp_zero]
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      dsimp
      rw [← p_opcyclesMap_assoc, hk, comp_zero])
    

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
H :
  { l //
    Cofork.π
          (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
            (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0)) ≫
        l =
      pOpcycles S.X₂ i ≫ k }
⊢ { l // opcyclesMap S.g i ≫ l = k }

Next tactic:
dsimp at H
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      dsimp
      rw [← p_opcyclesMap_assoc, hk, comp_zero])
    dsimp at H
    

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
H : { l // Hom.f S.g i ≫ l = pOpcycles S.X₂ i ≫ k }
⊢ { l // opcyclesMap S.g i ≫ l = k }

Next tactic:
refine' ⟨S.X₃.descOpcycles H.1 _ rfl _, _⟩
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      dsimp
      rw [← p_opcyclesMap_assoc, hk, comp_zero])
    dsimp at H
    refine' ⟨S.X₃.descOpcycles H.1 _ rfl _, _⟩
    · 

Proof state:
case refine'_1
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
H : { l // Hom.f S.g i ≫ l = pOpcycles S.X₂ i ≫ k }
⊢ d S.X₃ (ComplexShape.prev c i) i ≫ ↑H = 0

Next tactic:
rw [← cancel_epi (S.g.f (c.prev i)), comp_zero, Hom.comm_assoc, H.2,
        d_pOpcycles_assoc, zero_comp]
/-- If `X₁ ⟶ X₂ ⟶ X₃ ⟶ 0` is an exact sequence of homological complexes, then
`X₁.opcycles i ⟶ X₂.opcycles i ⟶ X₃.opcycles i ⟶ 0` is exact. This lemma states
the exactness at `X₂.opcycles i`, while the fact that `X₂.opcycles i ⟶ X₃.opcycles i`
is an epi is an instance. -/
lemma opcycles_right_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Epi S.g]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (opcyclesMap S.f i) (opcyclesMap S.g i)
      (by rw [← opcyclesMap_comp, S.zero, opcyclesMap_zero])).Exact := by
  have : Epi (ShortComplex.map S (eval C c i)).g := by dsimp; infer_instance
  have hj := (hS.map (HomologicalComplex.eval C c i)).gIsCokernel
  apply ShortComplex.exact_of_g_is_cokernel
  refine' CokernelCofork.IsColimit.ofπ' _ _  (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := CokernelCofork.IsColimit.desc' hj (S.X₂.pOpcycles i ≫ k) (by
      dsimp
      rw [← p_opcyclesMap_assoc, hk, comp_zero])
    dsimp at H
    refine' ⟨S.X₃.descOpcycles H.1 _ rfl _, _⟩
    · rw [← cancel_epi (S.g.f (c.prev i)), comp_zero, Hom.comm_assoc, H.2,
        d_pOpcycles_assoc, zero_comp]
    · 

Proof state:
case refine'_2
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Epi S.g
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Epi (ShortComplex.map S (eval C c i)).g
hj :
  IsColimit
    (CokernelCofork.ofπ (ShortComplex.map S (eval C c i)).g
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : opcycles S.X₂ i ⟶ A
hk : opcyclesMap S.f i ≫ k = 0
H : { l // Hom.f S.g i ≫ l = pOpcycles S.X₂ i ≫ k }
⊢ opcyclesMap S.g i ≫
      descOpcycles S.X₃ (↑H) (ComplexShape.prev c i) (_ : ComplexShape.prev c i = ComplexShape.prev c i)
        (_ : d S.X₃ (ComplexShape.prev c i) i ≫ ↑H = 0) =
    k

Next tactic:
rw [← cancel_epi (S.X₂.pOpcycles i), opcyclesMap_comp_descOpcycles, p_descOpcycles, H.2]
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by 

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{?u.122120, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
⊢ cyclesMap S.f i ≫ cyclesMap S.g i = 0

Next tactic:
rw [← cyclesMap_comp, S.zero, cyclesMap_zero]
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
⊢ ShortComplex.Exact (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0))

Next tactic:
have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; infer_instance
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by 

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
⊢ Mono (ShortComplex.map S (eval C c i)).f

Next tactic:
dsimp
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; 

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
⊢ Mono (Hom.f S.f i)

Next tactic:
infer_instance
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; infer_instance
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Mono (ShortComplex.map S (eval C c i)).f
⊢ ShortComplex.Exact (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0))

Next tactic:
have hi := (hS.map (HomologicalComplex.eval C c i)).fIsKernel
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; infer_instance
  have hi := (hS.map (HomologicalComplex.eval C c i)).fIsKernel
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Mono (ShortComplex.map S (eval C c i)).f
hi :
  IsLimit
    (KernelFork.ofι (ShortComplex.map S (eval C c i)).f
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
⊢ ShortComplex.Exact (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0))

Next tactic:
apply ShortComplex.exact_of_f_is_kernel
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; infer_instance
  have hi := (hS.map (HomologicalComplex.eval C c i)).fIsKernel
  apply ShortComplex.exact_of_f_is_kernel
  

Proof state:
case hS
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Mono (ShortComplex.map S (eval C c i)).f
hi :
  IsLimit
    (KernelFork.ofι (ShortComplex.map S (eval C c i)).f
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
⊢ IsLimit
    (KernelFork.ofι (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0)).f
      (_ :
        (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0)).f ≫
            (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0)).g =
          0))

Next tactic:
exact KernelFork.IsLimit.ofι' _ _ (fun {A} k hk => by
    dsimp at k hk ⊢
    have H := KernelFork.IsLimit.lift' hi (k ≫ S.X₂.iCycles i) (by
      dsimp
      rw [assoc, ← cyclesMap_i, reassoc_of% hk, zero_comp])
    dsimp at H
    refine' ⟨S.X₁.liftCycles H.1 _ rfl _, _⟩
    · rw [← cancel_mono (S.f.f _), assoc, zero_comp, ← Hom.comm, reassoc_of% H.2,
        iCycles_d, comp_zero]
    · rw [← cancel_mono (S.X₂.iCycles i), liftCycles_comp_cyclesMap, liftCycles_i, H.2])
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; infer_instance
  have hi := (hS.map (HomologicalComplex.eval C c i)).fIsKernel
  apply ShortComplex.exact_of_f_is_kernel
  exact KernelFork.IsLimit.ofι' _ _ (fun {A} k hk => by
    

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Mono (ShortComplex.map S (eval C c i)).f
hi :
  IsLimit
    (KernelFork.ofι (ShortComplex.map S (eval C c i)).f
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : A ⟶ (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0)).X₂
hk : k ≫ (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0)).g = 0
⊢ { l // l ≫ (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i) (_ : cyclesMap S.f i ≫ cyclesMap S.g i = 0)).f = k }

Next tactic:
dsimp at k hk ⊢
/-- If `0 ⟶ X₁ ⟶ X₂ ⟶ X₃` is an exact sequence of homological complex, then
`0 ⟶ X₁.cycles i ⟶ X₂.cycles i ⟶ X₃.cycles i` is exact. This lemma states
the exactness at `X₂.cycles i`, while the fact that `X₁.cycles i ⟶ X₂.cycles i`
is a mono is an instance. -/
lemma cycles_left_exact (S : ShortComplex (HomologicalComplex C c)) (hS : S.Exact) [Mono S.f]
    (i : ι) [S.X₁.HasHomology i] [S.X₂.HasHomology i] [S.X₃.HasHomology i] :
    (ShortComplex.mk (cyclesMap S.f i) (cyclesMap S.g i)
      (by rw [← cyclesMap_comp, S.zero, cyclesMap_zero])).Exact := by
  have : Mono (ShortComplex.map S (eval C c i)).f := by dsimp; infer_instance
  have hi := (hS.map (HomologicalComplex.eval C c i)).fIsKernel
  apply ShortComplex.exact_of_f_is_kernel
  exact KernelFork.IsLimit.ofι' _ _ (fun {A} k hk => by
    dsimp at k hk ⊢
    

Proof state:
C : Type u_1
ι : Type u_2
inst✝⁵ : Category.{u_3, u_1} C
inst✝⁴ : Abelian C
c : ComplexShape ι
S : ShortComplex (HomologicalComplex C c)
hS : ShortComplex.Exact S
inst✝³ : Mono S.f
i : ι
inst✝² : HasHomology S.X₁ i
inst✝¹ : HasHomology S.X₂ i
inst✝ : HasHomology S.X₃ i
this : Mono (ShortComplex.map S (eval C c i)).f
hi :
  IsLimit
    (KernelFork.ofι (ShortComplex.map S (eval C c i)).f
      (_ : (ShortComplex.map S (eval C c i)).f ≫ (ShortComplex.map S (eval C c i)).g = 0))
A : C
k : A ⟶ cycles S.X₂ i
hk : k ≫ cyclesMap S.g i = 0
⊢ { l // l ≫ cyclesMap S.f i = k }

Next tactic:
have H := KernelFork.IsLimit.lift' hi (k ≫ S.X₂.iCycles i) (by
      dsimp
      rw [assoc, ← cyclesMap_i, reassoc_of% hk, zero_comp])