l3lab/ntp-mathlib huggingface dataset:
lemma exact_iff_of_epi_of_isIso_of_mono (φ : S₁ ⟶ S₂) [Epi φ.τ₁] [IsIso φ.τ₂] [Mono φ.τ₃] :
    S₁.Exact ↔ S₂.Exact := by
  constructor
  · rintro ⟨h₁, z₁⟩
    exact ⟨HomologyData.ofEpiOfIsIsoOfMono φ h₁, z₁⟩
  · rintro ⟨h₂, z₂⟩
    

Proof state:
case mpr.mk.intro
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{?u.12305, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
φ : S₁ ⟶ S₂
inst✝² : Epi φ.τ₁
inst✝¹ : IsIso φ.τ₂
inst✝ : Mono φ.τ₃
h₂ : HomologyData S₂
z₂ : IsZero h₂.left.H
⊢ Exact S₁

Next tactic:
exact ⟨HomologyData.ofEpiOfIsIsoOfMono' φ h₂, z₂⟩
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
⊢ Exact S ↔ h.left.i ≫ h.right.p = 0

Next tactic:
haveI := HasHomology.mk' h
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  haveI := HasHomology.mk' h
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
this : HasHomology S
⊢ Exact S ↔ h.left.i ≫ h.right.p = 0

Next tactic:
rw [h.left.exact_iff, ← h.comm]
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  haveI := HasHomology.mk' h
  rw [h.left.exact_iff, ← h.comm]
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
this : HasHomology S
⊢ IsZero h.left.H ↔ h.left.π ≫ h.iso.hom ≫ h.right.ι = 0

Next tactic:
constructor
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  haveI := HasHomology.mk' h
  rw [h.left.exact_iff, ← h.comm]
  constructor
  · 

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
this : HasHomology S
⊢ IsZero h.left.H → h.left.π ≫ h.iso.hom ≫ h.right.ι = 0

Next tactic:
intro z
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  haveI := HasHomology.mk' h
  rw [h.left.exact_iff, ← h.comm]
  constructor
  · intro z
    

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
this : HasHomology S
z : IsZero h.left.H
⊢ h.left.π ≫ h.iso.hom ≫ h.right.ι = 0

Next tactic:
rw [IsZero.eq_of_src z h.iso.hom 0, zero_comp, comp_zero]
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  haveI := HasHomology.mk' h
  rw [h.left.exact_iff, ← h.comm]
  constructor
  · intro z
    rw [IsZero.eq_of_src z h.iso.hom 0, zero_comp, comp_zero]
  · 

Proof state:
case mpr
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
this : HasHomology S
⊢ h.left.π ≫ h.iso.hom ≫ h.right.ι = 0 → IsZero h.left.H

Next tactic:
intro eq
lemma HomologyData.exact_iff_i_p_zero (h : S.HomologyData) :
    S.Exact ↔ h.left.i ≫ h.right.p = 0 := by
  haveI := HasHomology.mk' h
  rw [h.left.exact_iff, ← h.comm]
  constructor
  · intro z
    rw [IsZero.eq_of_src z h.iso.hom 0, zero_comp, comp_zero]
  · intro eq
    

Proof state:
case mpr
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.14124, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
this : HasHomology S
eq : h.left.π ≫ h.iso.hom ≫ h.right.ι = 0
⊢ IsZero h.left.H

Next tactic:
simp only [IsZero.iff_id_eq_zero, ← cancel_mono h.iso.hom, id_comp, ← cancel_mono h.right.ι,
      ← cancel_epi h.left.π, eq, zero_comp, comp_zero]
lemma exact_iff_kernel_ι_comp_cokernel_π_zero [S.HasHomology]
    [HasKernel S.g] [HasCokernel S.f] :
    S.Exact ↔ kernel.ι S.g ≫ cokernel.π S.f = 0 := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{?u.17794, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝² : HasHomology S
inst✝¹ : HasKernel S.g
inst✝ : HasCokernel S.f
⊢ Exact S ↔ kernel.ι S.g ≫ cokernel.π S.f = 0

Next tactic:
haveI := HasLeftHomology.hasCokernel S
lemma exact_iff_kernel_ι_comp_cokernel_π_zero [S.HasHomology]
    [HasKernel S.g] [HasCokernel S.f] :
    S.Exact ↔ kernel.ι S.g ≫ cokernel.π S.f = 0 := by
  haveI := HasLeftHomology.hasCokernel S
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{?u.17794, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝² : HasHomology S
inst✝¹ : HasKernel S.g
inst✝ : HasCokernel S.f
this : HasCokernel (kernel.lift S.g S.f (_ : S.f ≫ S.g = 0))
⊢ Exact S ↔ kernel.ι S.g ≫ cokernel.π S.f = 0

Next tactic:
haveI := HasRightHomology.hasKernel S
lemma exact_iff_kernel_ι_comp_cokernel_π_zero [S.HasHomology]
    [HasKernel S.g] [HasCokernel S.f] :
    S.Exact ↔ kernel.ι S.g ≫ cokernel.π S.f = 0 := by
  haveI := HasLeftHomology.hasCokernel S
  haveI := HasRightHomology.hasKernel S
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{?u.17794, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝² : HasHomology S
inst✝¹ : HasKernel S.g
inst✝ : HasCokernel S.f
this✝ : HasCokernel (kernel.lift S.g S.f (_ : S.f ≫ S.g = 0))
this : HasKernel (cokernel.desc S.f S.g (_ : S.f ≫ S.g = 0))
⊢ Exact S ↔ kernel.ι S.g ≫ cokernel.π S.f = 0

Next tactic:
exact S.exact_iff_i_p_zero (LeftHomologyData.ofHasKernelOfHasCokernel S)
    (RightHomologyData.ofHasCokernelOfHasKernel S)
/-- The notion of exactness given by `ShortComplex.Exact` is equivalent to
the one given by the previous API `CategoryTheory.Exact` in the case of
abelian categories. -/
lemma _root_.CategoryTheory.exact_iff_shortComplex_exact
    {A : Type*} [Category A] [Abelian A] (S : ShortComplex A) :
    CategoryTheory.Exact S.f S.g ↔ S.Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁵ : Category.{?u.18908, u_1} C
inst✝⁴ : Category.{?u.18912, u_2} D
inst✝³ : HasZeroMorphisms C
inst✝² : HasZeroMorphisms D
S✝ S₁ S₂ : ShortComplex C
A : Type u_3
inst✝¹ : Category.{u_4, u_3} A
inst✝ : Abelian A
S : ShortComplex A
⊢ CategoryTheory.Exact S.f S.g ↔ Exact S

Next tactic:
simp only [Abelian.exact_iff, S.zero,
    S.exact_iff_kernel_ι_comp_cokernel_π_zero, true_and]
lemma Exact.op (h : S.Exact) : S.op.Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.21367, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
⊢ Exact (ShortComplex.op S)

Next tactic:
obtain ⟨h, z⟩ := h
lemma Exact.op (h : S.Exact) : S.op.Exact := by
  obtain ⟨h, z⟩ := h
  

Proof state:
case mk.intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.21367, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : HomologyData S
z : IsZero h.left.H
⊢ Exact (ShortComplex.op S)

Next tactic:
exact ⟨⟨h.op, (IsZero.of_iso z h.iso.symm).op⟩⟩
lemma Exact.unop {S : ShortComplex Cᵒᵖ} (h : S.Exact) : S.unop.Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.21920, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S✝ S₁ S₂ : ShortComplex C
S : ShortComplex Cᵒᵖ
h : Exact S
⊢ Exact (ShortComplex.unop S)

Next tactic:
obtain ⟨h, z⟩ := h
lemma Exact.unop {S : ShortComplex Cᵒᵖ} (h : S.Exact) : S.unop.Exact := by
  obtain ⟨h, z⟩ := h
  

Proof state:
case mk.intro
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.21920, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S✝ S₁ S₂ : ShortComplex C
S : ShortComplex Cᵒᵖ
h : HomologyData S
z : IsZero h.left.H
⊢ Exact (ShortComplex.unop S)

Next tactic:
exact ⟨⟨h.unop, (IsZero.of_iso z h.iso.symm).unop⟩⟩
lemma Exact.map_of_preservesLeftHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesLeftHomologyOf F S
inst✝ : HasHomology (map S F)
⊢ Exact (map S F)

Next tactic:
have := h.hasHomology
lemma Exact.map_of_preservesLeftHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact := by
  have := h.hasHomology
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesLeftHomologyOf F S
inst✝ : HasHomology (map S F)
this : HasHomology S
⊢ Exact (map S F)

Next tactic:
rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero] at h
lemma Exact.map_of_preservesLeftHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact := by
  have := h.hasHomology
  rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero] at h
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesLeftHomologyOf F S
inst✝ : HasHomology (map S F)
this : HasHomology S
h : 𝟙 (leftHomologyData S).H = 0
⊢ Exact (map S F)

Next tactic:
rw [S.leftHomologyData.exact_map_iff F, IsZero.iff_id_eq_zero,
    ← F.map_id, h, F.map_zero]
lemma Exact.map_of_preservesRightHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesRightHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : HasHomology (map S F)
⊢ Exact (map S F)

Next tactic:
have : S.HasHomology := h.hasHomology
lemma Exact.map_of_preservesRightHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesRightHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact := by
  have : S.HasHomology := h.hasHomology
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : HasHomology (map S F)
this : HasHomology S
⊢ Exact (map S F)

Next tactic:
rw [S.rightHomologyData.exact_iff, IsZero.iff_id_eq_zero] at h
lemma Exact.map_of_preservesRightHomologyOf (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesRightHomologyOf S]
    [(S.map F).HasHomology] : (S.map F).Exact := by
  have : S.HasHomology := h.hasHomology
  rw [S.rightHomologyData.exact_iff, IsZero.iff_id_eq_zero] at h
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : HasHomology (map S F)
this : HasHomology S
h : 𝟙 (rightHomologyData S).H = 0
⊢ Exact (map S F)

Next tactic:
rw [S.rightHomologyData.exact_map_iff F, IsZero.iff_id_eq_zero,
    ← F.map_id, h, F.map_zero]
lemma Exact.map (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] : (S.map F).Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesLeftHomologyOf F S
inst✝ : Functor.PreservesRightHomologyOf F S
⊢ Exact (ShortComplex.map S F)

Next tactic:
have := h.hasHomology
lemma Exact.map (h : S.Exact) (F : C ⥤ D)
    [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] : (S.map F).Exact := by
  have := h.hasHomology
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁶ : Category.{u_3, u_1} C
inst✝⁵ : Category.{u_4, u_2} D
inst✝⁴ : HasZeroMorphisms C
inst✝³ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
F : C ⥤ D
inst✝² : Functor.PreservesZeroMorphisms F
inst✝¹ : Functor.PreservesLeftHomologyOf F S
inst✝ : Functor.PreservesRightHomologyOf F S
this : HasHomology S
⊢ Exact (ShortComplex.map S F)

Next tactic:
exact h.map_of_preservesLeftHomologyOf F
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
⊢ Exact (map S F) ↔ Exact S

Next tactic:
constructor
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · 

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
⊢ Exact (map S F) → Exact S

Next tactic:
intro h
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · intro h
    

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
h : Exact (map S F)
⊢ Exact S

Next tactic:
rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero]
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · intro h
    rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero]
    

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
h : Exact (map S F)
⊢ 𝟙 (leftHomologyData S).H = 0

Next tactic:
rw [(S.leftHomologyData.map F).exact_iff, IsZero.iff_id_eq_zero,
      LeftHomologyData.map_H] at h
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · intro h
    rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero]
    rw [(S.leftHomologyData.map F).exact_iff, IsZero.iff_id_eq_zero,
      LeftHomologyData.map_H] at h
    

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
h : 𝟙 (F.obj (leftHomologyData S).H) = 0
⊢ 𝟙 (leftHomologyData S).H = 0

Next tactic:
apply F.map_injective
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · intro h
    rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero]
    rw [(S.leftHomologyData.map F).exact_iff, IsZero.iff_id_eq_zero,
      LeftHomologyData.map_H] at h
    apply F.map_injective
    

Proof state:
case mp.a
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
h : 𝟙 (F.obj (leftHomologyData S).H) = 0
⊢ F.map (𝟙 (leftHomologyData S).H) = F.map 0

Next tactic:
rw [F.map_id, F.map_zero, h]
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · intro h
    rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero]
    rw [(S.leftHomologyData.map F).exact_iff, IsZero.iff_id_eq_zero,
      LeftHomologyData.map_H] at h
    apply F.map_injective
    rw [F.map_id, F.map_zero, h]
  · 

Proof state:
case mpr
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
⊢ Exact S → Exact (map S F)

Next tactic:
intro h
lemma exact_map_iff_of_faithful [S.HasHomology]
    (F : C ⥤ D) [F.PreservesZeroMorphisms] [F.PreservesLeftHomologyOf S]
    [F.PreservesRightHomologyOf S] [Faithful F] :
    (S.map F).Exact ↔ S.Exact := by
  constructor
  · intro h
    rw [S.leftHomologyData.exact_iff, IsZero.iff_id_eq_zero]
    rw [(S.leftHomologyData.map F).exact_iff, IsZero.iff_id_eq_zero,
      LeftHomologyData.map_H] at h
    apply F.map_injective
    rw [F.map_id, F.map_zero, h]
  · intro h
    

Proof state:
case mpr
C : Type u_1
D : Type u_2
inst✝⁸ : Category.{u_3, u_1} C
inst✝⁷ : Category.{u_4, u_2} D
inst✝⁶ : HasZeroMorphisms C
inst✝⁵ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
inst✝⁴ : HasHomology S
F : C ⥤ D
inst✝³ : Functor.PreservesZeroMorphisms F
inst✝² : Functor.PreservesLeftHomologyOf F S
inst✝¹ : Functor.PreservesRightHomologyOf F S
inst✝ : Faithful F
h : Exact S
⊢ Exact (map S F)

Next tactic:
exact h.map F
@[reassoc]
lemma Exact.comp_eq_zero (h : S.Exact) {X Y : C} {a : X ⟶ S.X₂} (ha : a ≫ S.g = 0)
    {b : S.X₂ ⟶ Y} (hb : S.f ≫ b = 0) : a ≫ b = 0 := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.32461, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
X Y : C
a : X ⟶ S.X₂
ha : a ≫ S.g = 0
b : S.X₂ ⟶ Y
hb : S.f ≫ b = 0
⊢ a ≫ b = 0

Next tactic:
have := h.hasHomology
@[reassoc]
lemma Exact.comp_eq_zero (h : S.Exact) {X Y : C} {a : X ⟶ S.X₂} (ha : a ≫ S.g = 0)
    {b : S.X₂ ⟶ Y} (hb : S.f ≫ b = 0) : a ≫ b = 0 := by
  have := h.hasHomology
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.32461, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
X Y : C
a : X ⟶ S.X₂
ha : a ≫ S.g = 0
b : S.X₂ ⟶ Y
hb : S.f ≫ b = 0
this : HasHomology S
⊢ a ≫ b = 0

Next tactic:
have eq := h
@[reassoc]
lemma Exact.comp_eq_zero (h : S.Exact) {X Y : C} {a : X ⟶ S.X₂} (ha : a ≫ S.g = 0)
    {b : S.X₂ ⟶ Y} (hb : S.f ≫ b = 0) : a ≫ b = 0 := by
  have := h.hasHomology
  have eq := h
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.32461, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
X Y : C
a : X ⟶ S.X₂
ha : a ≫ S.g = 0
b : S.X₂ ⟶ Y
hb : S.f ≫ b = 0
this : HasHomology S
eq : Exact S
⊢ a ≫ b = 0

Next tactic:
rw [exact_iff_iCycles_pOpcycles_zero] at eq
@[reassoc]
lemma Exact.comp_eq_zero (h : S.Exact) {X Y : C} {a : X ⟶ S.X₂} (ha : a ≫ S.g = 0)
    {b : S.X₂ ⟶ Y} (hb : S.f ≫ b = 0) : a ≫ b = 0 := by
  have := h.hasHomology
  have eq := h
  rw [exact_iff_iCycles_pOpcycles_zero] at eq
  

Proof state:
C : Type u_1
D : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Category.{?u.32461, u_2} D
inst✝¹ : HasZeroMorphisms C
inst✝ : HasZeroMorphisms D
S S₁ S₂ : ShortComplex C
h : Exact S
X Y : C
a : X ⟶ S.X₂
ha : a ≫ S.g = 0
b : S.X₂ ⟶ Y
hb : S.f ≫ b = 0
this : HasHomology S
eq : iCycles S ≫ pOpcycles S = 0
⊢ a ≫ b = 0

Next tactic:
rw [← S.liftCycles_i a ha, ← S.p_descOpcycles b hb, assoc, reassoc_of% eq,
    zero_comp, comp_zero]
lemma exact_iff_mono [HasZeroObject C] (hf : S.f = 0) :
    S.Exact ↔ Mono S.g := by
  

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{?u.36174, u_2} D
inst✝² : Preadditive C
inst✝¹ : Preadditive D
S : ShortComplex C
inst✝ : HasZeroObject C
hf : S.f = 0
⊢ Exact S ↔ Mono S.g

Next tactic:
constructor
lemma exact_iff_mono [HasZeroObject C] (hf : S.f = 0) :
    S.Exact ↔ Mono S.g := by
  constructor
  · 

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{?u.36174, u_2} D
inst✝² : Preadditive C
inst✝¹ : Preadditive D
S : ShortComplex C
inst✝ : HasZeroObject C
hf : S.f = 0
⊢ Exact S → Mono S.g

Next tactic:
intro h
lemma exact_iff_mono [HasZeroObject C] (hf : S.f = 0) :
    S.Exact ↔ Mono S.g := by
  constructor
  · intro h
    

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{?u.36174, u_2} D
inst✝² : Preadditive C
inst✝¹ : Preadditive D
S : ShortComplex C
inst✝ : HasZeroObject C
hf : S.f = 0
h : Exact S
⊢ Mono S.g

Next tactic:
have := h.hasHomology
lemma exact_iff_mono [HasZeroObject C] (hf : S.f = 0) :
    S.Exact ↔ Mono S.g := by
  constructor
  · intro h
    have := h.hasHomology
    

Proof state:
case mp
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{u_3, u_1} C
inst✝³ : Category.{?u.36174, u_2} D
inst✝² : Preadditive C
inst✝¹ : Preadditive D
S : ShortComplex C
inst✝ : HasZeroObject C
hf : S.f = 0
h : Exact S
this : HasHomology S
⊢ Mono S.g

Next tactic:
simp only [exact_iff_isZero_homology] at h