-- 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
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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
⊢ (composableArrows₃ K i j).Exact

Tactic:
let T' := ShortComplex.mk (K.toCycles i j) (K.homologyπ 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) ⋯
ι : S ⟶ S' := { τ₁ := 𝟙 S.X₁, τ₂ := 𝟙 S.X₂, τ₃ := K.iCycles j, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hS : S.Exact
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ 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₂₃ := ⋯ }
hS : S.Exact
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
⊢ K.toCycles i j ≫ K.homologyπ j = 0

Tactic:
simp

Result:
no goals

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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ j) ⋯
π : T' ⟶ T := { τ₁ := K.pOpcycles i, τ₂ := 𝟙 T'.X₂, τ₃ := 𝟙 T'.X₃, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hT : T.Exact
⊢ (composableArrows₃ K i j).Exact

Tactic:
apply ComposableArrows.exact_of_δ₀

Result:
case h
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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ j) ⋯
π : T' ⟶ T := { τ₁ := K.pOpcycles i, τ₂ := 𝟙 T'.X₂, τ₃ := 𝟙 T'.X₃, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hT : T.Exact
⊢ (ComposableArrows.mk₂ ((composableArrows₃ K i j).map' 0 1 ⋯ ⋯) ((composableArrows₃ K i j).map' 1 2 ⋯ ⋯)).Exact

case h₀
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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ j) ⋯
π : T' ⟶ T := { τ₁ := K.pOpcycles i, τ₂ := 𝟙 T'.X₂, τ₃ := 𝟙 T'.X₃, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hT : T.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) ⋯
S' : ShortComplex C := ShortComplex.mk (K.homologyι i) (K.fromOpcycles i j) ⋯
ι : S ⟶ S' := { τ₁ := 𝟙 S.X₁, τ₂ := 𝟙 S.X₂, τ₃ := K.iCycles j, comm₁₂ := ⋯, comm₂₃ := ⋯ }
⊢ S'.Exact

Tactic:
exact S'.exact_of_f_is_kernel (K.homologyIsKernel i j (c.next_eq' hij))

Result:
no goals

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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ j) ⋯
⊢ (composableArrows₃ K i j).Exact

Tactic:
let π : T' ⟶ T :=
  { τ₁ := K.pOpcycles i
    τ₂ := 𝟙 _
    τ₃ := 𝟙 _ }

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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ j) ⋯
π : T' ⟶ T := { τ₁ := K.pOpcycles i, τ₂ := 𝟙 T'.X₂, τ₃ := 𝟙 T'.X₃, comm₁₂ := ⋯, comm₂₃ := ⋯ }
⊢ (composableArrows₃ K i j).Exact

Proof state:
case h
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
T : ShortComplex C := ShortComplex.mk (K.opcyclesToCycles i j) (K.homologyπ j) ⋯
T' : ShortComplex C := ShortComplex.mk (K.toCycles i j) (K.homologyπ j) ⋯
π : T' ⟶ T := { τ₁ := K.pOpcycles i, τ₂ := 𝟙 T'.X₂, τ₃ := 𝟙 T'.X₃, comm₁₂ := ⋯, comm₂₃ := ⋯ }
hT : T.Exact
⊢ (ComposableArrows.mk₂ ((composableArrows₃ K i j).map' 0 1 ⋯ ⋯) ((composableArrows₃ K i j).map' 1 2 ⋯ ⋯)).Exact

Tactic:
exact hS.exact_toComposableArrows

Result:
no goals