-- Mathlib/Algebra/Homology/HomologySequence.lean
/-- The diagram `K.homology i ⟶ K.opcycles i ⟶ K.cycles j ⟶ K.homology j` is exact
when `c.Rel i j`. -/
lemma composableArrows₃_exact [CategoryWithHomology C] :
    (composableArrows₃ K i j).Exact

Proof state:
C : Type u_1
ι : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι
K : HomologicalComplex C c
i j : ι
hij : c.Rel i j
inst✝ : CategoryWithHomology C
⊢ (composableArrows₃ K i j).Exact

Tactic:
let S := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) (by simp)

Result:
C : Type u_1
ι : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι
K : HomologicalComplex C c
i j : ι
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
⊢ (composableArrows₃ K i j).Exact

Proof state:
C : Type u_1
ι✝ : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι✝
K : HomologicalComplex C c
i j : ι✝
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
ι : S ⟶ S' := { τ₁ := 𝟙 S.X₁, τ₂ := 𝟙 S.X₂, τ₃ := K.iCycles j, comm₁₂ := ⋯, comm₂₃ := ⋯ }
⊢ (composableArrows₃ K i j).Exact

Tactic:
have hS : S.Exact := by
  rw [ShortComplex.exact_iff_of_epi_of_isIso_of_mono ι]
  exact S'.exact_of_f_is_kernel (K.homologyIsKernel i j (c.next_eq' hij))

Result:
C : Type u_1
ι✝ : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι✝
K : HomologicalComplex C c
i j : ι✝
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
ι : S ⟶ S' := { τ₁ := 𝟙 S.X₁, τ₂ := 𝟙 S.X₂, τ₃ := K.iCycles j, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hS : S.Exact
⊢ (composableArrows₃ K i j).Exact

Proof state:
C : Type u_1
ι : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι
K : HomologicalComplex C c
i j : ι
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
⊢ (composableArrows₃ K i j).Exact

Tactic:
let S' := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) (by simp)

Result:
C : Type u_1
ι : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι
K : HomologicalComplex C c
i j : ι
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
⊢ (composableArrows₃ K i j).Exact

Proof state:
C : Type u_1
ι : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι
K : HomologicalComplex C c
i j : ι
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
⊢ (composableArrows₃ K i j).Exact

Tactic:
let ι : S ⟶ S' :=
  { τ₁ := 𝟙 _
    τ₂ := 𝟙 _
    τ₃ := K.iCycles j }

Result:
C : Type u_1
ι✝ : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι✝
K : HomologicalComplex C c
i j : ι✝
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
ι : S ⟶ S' := { τ₁ := 𝟙 S.X₁, τ₂ := 𝟙 S.X₂, τ₃ := K.iCycles j, comm₁₂ := ⋯, comm₂₃ := ⋯ }
⊢ (composableArrows₃ K i j).Exact

Proof state:
C : Type u_1
ι✝ : Type u_2
inst✝² : Category.{u_3, u_1} C
inst✝¹ : Preadditive C
c : ComplexShape ι✝
K : HomologicalComplex C c
i j : ι✝
hij : c.Rel i j
inst✝ : CategoryWithHomology C
S : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.opcyclesToCycles i j) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
ι : S ⟶ S' := { τ₁ := 𝟙 S.X₁, τ₂ := 𝟙 S.X₂, τ₃ := K.iCycles j, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hS : S.Exact
⊢ K.opcyclesToCycles i j ≫ K.homologyπ j = 0

Tactic:
simp

Result:
no goals