l3lab/ntp-mathlib huggingface dataset:
@[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
      rw [← cancel_epi (K.pOpcycles i), comp_zero, p_descOpcycles, 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'
this : descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0
⊢ homologyι K i ≫ descOpcycles K k j hj (_ : d K j i ≫ k = 0) = 0

Next tactic:
rw [this, comp_zero]
@[reassoc (attr := simp)]
lemma homologyι_comp_fromOpcycles :
    K.homologyι i ≫ K.fromOpcycles i j = 0 :=
  K.homologyι_descOpcycles_eq_zero_of_boundary (K.d i 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
⊢ d K i j = d K i j ≫ 𝟙 (X K j)

Next tactic:
simp
/-- `K.homology i` is the kernel of `K.fromOpcycles i j : K.opcycles i ⟶ K.X j`
when `c.next i = j`. -/
noncomputable def homologyIsKernel (hi : c.next i = j) :
    IsLimit (KernelFork.ofι (K.homologyι i) (K.homologyι_comp_fromOpcycles i j)) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{?u.79280, 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.next c i = j
⊢ IsLimit (KernelFork.ofι (homologyι K i) (_ : homologyι K i ≫ fromOpcycles K i j = 0))

Next tactic:
subst hi
/-- `K.homology i` is the kernel of `K.fromOpcycles i j : K.opcycles i ⟶ K.X j`
when `c.next i = j`. -/
noncomputable def homologyIsKernel (hi : c.next i = j) :
    IsLimit (KernelFork.ofι (K.homologyι i) (K.homologyι_comp_fromOpcycles i j)) := by
  subst hi
  

Proof state:
C : Type u_1
inst✝² : Category.{?u.79280, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K L M : HomologicalComplex C c
φ : K ⟶ L
ψ : L ⟶ M
i k : ι
inst✝ : HasHomology K i
⊢ IsLimit (KernelFork.ofι (homologyι K i) (_ : homologyι K i ≫ fromOpcycles K i (ComplexShape.next c i) = 0))

Next tactic:
exact (K.sc i).homologyIsKernel
@[reassoc]
lemma homologyMap_comp : homologyMap (φ ≫ ψ) i = homologyMap φ i ≫ homologyMap ψ i := 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 L i
inst✝ : HasHomology M i
⊢ homologyMap (φ ≫ ψ) i = homologyMap φ i ≫ homologyMap ψ i

Next tactic:
dsimp [homologyMap]
@[reassoc]
lemma homologyMap_comp : homologyMap (φ ≫ ψ) i = homologyMap φ i ≫ homologyMap ψ i := by
  dsimp [homologyMap]
  

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 L i
inst✝ : HasHomology M i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (φ ≫ ψ)) =
    ShortComplex.homologyMap ((shortComplexFunctor C c i).map φ) ≫
      ShortComplex.homologyMap ((shortComplexFunctor C c i).map ψ)

Next tactic:
rw [Functor.map_comp, ShortComplex.homologyMap_comp]
@[reassoc]
lemma cyclesMap_comp : cyclesMap (φ ≫ ψ) i = cyclesMap φ i ≫ cyclesMap ψ i := 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 L i
inst✝ : HasHomology M i
⊢ cyclesMap (φ ≫ ψ) i = cyclesMap φ i ≫ cyclesMap ψ i

Next tactic:
dsimp [cyclesMap]
@[reassoc]
lemma cyclesMap_comp : cyclesMap (φ ≫ ψ) i = cyclesMap φ i ≫ cyclesMap ψ i := by
  dsimp [cyclesMap]
  

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 L i
inst✝ : HasHomology M i
⊢ ShortComplex.cyclesMap ((shortComplexFunctor C c i).map (φ ≫ ψ)) =
    ShortComplex.cyclesMap ((shortComplexFunctor C c i).map φ) ≫
      ShortComplex.cyclesMap ((shortComplexFunctor C c i).map ψ)

Next tactic:
rw [Functor.map_comp, ShortComplex.cyclesMap_comp]
@[reassoc]
lemma opcyclesMap_comp : opcyclesMap (φ ≫ ψ) i = opcyclesMap φ i ≫ opcyclesMap ψ i := 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 L i
inst✝ : HasHomology M i
⊢ opcyclesMap (φ ≫ ψ) i = opcyclesMap φ i ≫ opcyclesMap ψ i

Next tactic:
dsimp [opcyclesMap]
@[reassoc]
lemma opcyclesMap_comp : opcyclesMap (φ ≫ ψ) i = opcyclesMap φ i ≫ opcyclesMap ψ i := by
  dsimp [opcyclesMap]
  

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 L i
inst✝ : HasHomology M i
⊢ ShortComplex.opcyclesMap ((shortComplexFunctor C c i).map (φ ≫ ψ)) =
    ShortComplex.opcyclesMap ((shortComplexFunctor C c i).map φ) ≫
      ShortComplex.opcyclesMap ((shortComplexFunctor C c i).map ψ)

Next tactic:
rw [Functor.map_comp, ShortComplex.opcyclesMap_comp]
@[reassoc (attr := simp)]
lemma opcyclesMap_comp_descOpcycles {A : C} (k : L.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : L.d j i ≫ k = 0) (φ : K ⟶ L) :
    opcyclesMap φ i ≫ L.descOpcycles k j hj hk = K.descOpcycles (φ.f i ≫ k) j hj
      (by 

Proof state:
C : Type u_1
inst✝⁴ : Category.{?u.107877, 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 L i
inst✝ : HasHomology M i
A : C
k : X L i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d L j i ≫ k = 0
φ : K ⟶ L
⊢ d K j i ≫ Hom.f φ i ≫ k = 0

Next tactic:
rw [← φ.comm_assoc, hk, comp_zero]
@[reassoc (attr := simp)]
lemma opcyclesMap_comp_descOpcycles {A : C} (k : L.X i ⟶ A) (j : ι) (hj : c.prev i = j)
    (hk : L.d j i ≫ k = 0) (φ : K ⟶ L) :
    opcyclesMap φ i ≫ L.descOpcycles k j hj hk = K.descOpcycles (φ.f i ≫ k) j hj
      (by rw [← φ.comm_assoc, hk, comp_zero]) := 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 L i
inst✝ : HasHomology M i
A : C
k : X L i ⟶ A
j : ι
hj : ComplexShape.prev c i = j
hk : d L j i ≫ k = 0
φ : K ⟶ L
⊢ opcyclesMap φ i ≫ descOpcycles L k j hj hk = descOpcycles K (Hom.f φ i ≫ k) j hj (_ : d K j i ≫ Hom.f φ i ≫ k = 0)

Next tactic:
simp only [← cancel_epi (K.pOpcycles i), p_opcyclesMap_assoc, p_descOpcycles]
@[reassoc (attr := simp)]
lemma liftCycles_comp_cyclesMap {A : C} (k : A ⟶ K.X i) (j : ι) (hj : c.next i = j)
    (hk : k ≫ K.d i j = 0) (φ : K ⟶ L) :
    K.liftCycles k j hj hk ≫ cyclesMap φ i = L.liftCycles (k ≫ φ.f i) j hj
      (by 

Proof state:
C : Type u_1
inst✝⁴ : Category.{?u.110309, 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 L i
inst✝ : HasHomology M i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
hk : k ≫ d K i j = 0
φ : K ⟶ L
⊢ (k ≫ Hom.f φ i) ≫ d L i j = 0

Next tactic:
rw [assoc, φ.comm, reassoc_of% hk, zero_comp]
@[reassoc (attr := simp)]
lemma liftCycles_comp_cyclesMap {A : C} (k : A ⟶ K.X i) (j : ι) (hj : c.next i = j)
    (hk : k ≫ K.d i j = 0) (φ : K ⟶ L) :
    K.liftCycles k j hj hk ≫ cyclesMap φ i = L.liftCycles (k ≫ φ.f i) j hj
      (by rw [assoc, φ.comm, 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
inst✝¹ : HasHomology L i
inst✝ : HasHomology M i
A : C
k : A ⟶ X K i
j : ι
hj : ComplexShape.next c i = j
hk : k ≫ d K i j = 0
φ : K ⟶ L
⊢ liftCycles K k j hj hk ≫ cyclesMap φ i = liftCycles L (k ≫ Hom.f φ i) j hj (_ : (k ≫ Hom.f φ i) ≫ d L i j = 0)

Next tactic:
simp only [← cancel_mono (L.iCycles i), assoc, cyclesMap_i, liftCycles_i_assoc, liftCycles_i]
lemma isIso_iCycles : IsIso (K.iCycles i) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
hj : ComplexShape.next c i = j
h : d K i j = 0
inst✝ : HasHomology K i
⊢ IsIso (iCycles K i)

Next tactic:
subst hj
lemma isIso_iCycles : IsIso (K.iCycles i) := by
  subst hj
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i k : ι
inst✝ : HasHomology K i
h : d K i (ComplexShape.next c i) = 0
⊢ IsIso (iCycles K i)

Next tactic:
exact ShortComplex.isIso_iCycles _ h
lemma isIso_homologyι : IsIso (K.homologyι i) :=
  ShortComplex.isIso_homologyι _ (by 

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
hj : ComplexShape.next c i = j
h : d K i j = 0
inst✝ : HasHomology K i
⊢ (sc K i).g = 0

Next tactic:
aesop_cat
lemma isIso_pOpcycles : IsIso (K.pOpcycles j) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
hi : ComplexShape.prev c j = i
h : d K i j = 0
inst✝ : HasHomology K j
⊢ IsIso (pOpcycles K j)

Next tactic:
obtain rfl := hi
lemma isIso_pOpcycles : IsIso (K.pOpcycles j) := by
  obtain rfl := hi
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
j k : ι
inst✝ : HasHomology K j
h : d K (ComplexShape.prev c j) j = 0
⊢ IsIso (pOpcycles K j)

Next tactic:
exact ShortComplex.isIso_pOpcycles _ h
lemma isIso_homologyπ : IsIso (K.homologyπ j) :=
  ShortComplex.isIso_homologyπ _ (by 

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
hi : ComplexShape.prev c j = i
h : d K i j = 0
inst✝ : HasHomology K j
⊢ (sc K j).f = 0

Next tactic:
aesop_cat
lemma exactAt_iff :
    K.ExactAt i ↔ (K.sc i).Exact := by 

Proof state:
C : Type u_1
inst✝¹ : Category.{u_3, u_1} C
inst✝ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
⊢ ExactAt K i ↔ ShortComplex.Exact (sc K i)

Next tactic:
rfl
lemma exactAt_iff_isZero_homology [K.HasHomology i] :
    K.ExactAt i ↔ IsZero (K.homology i) := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
inst✝ : HasHomology K i
⊢ ExactAt K i ↔ IsZero (homology K i)

Next tactic:
dsimp [homology]
lemma exactAt_iff_isZero_homology [K.HasHomology i] :
    K.ExactAt i ↔ IsZero (K.homology i) := by
  dsimp [homology]
  

Proof state:
C : Type u_1
inst✝² : Category.{u_3, u_1} C
inst✝¹ : HasZeroMorphisms C
ι : Type u_2
c : ComplexShape ι
K : HomologicalComplex C c
i j k : ι
inst✝ : HasHomology K i
⊢ ExactAt K i ↔ IsZero (ShortComplex.homology (sc K i))

Next tactic:
rw [exactAt_iff, ShortComplex.exact_iff_isZero_homology]
instance isIso_homologyι₀ :
    IsIso (K.homologyι 0) :=
  K.isIso_homologyι 0 _ rfl (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.155878, u_1} C
inst✝¹ : HasZeroMorphisms C
K L : ChainComplex C ℕ
φ : K ⟶ L
inst✝ : HomologicalComplex.HasHomology K 0
⊢ HomologicalComplex.d K 0 (ComplexShape.next (ComplexShape.down ℕ) 0) = 0

Next tactic:
simp
/-- The canonical isomorphism `K.homology 0 ≅ K.opcycles 0` for a chain complex `K`
indexed by `ℕ`. -/
noncomputable abbrev isoHomologyι₀ :
  K.homology 0 ≅ K.opcycles 0 := K.isoHomologyι 0 _ rfl (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.157135, u_1} C
inst✝¹ : HasZeroMorphisms C
K L : ChainComplex C ℕ
φ : K ⟶ L
inst✝ : HomologicalComplex.HasHomology K 0
⊢ HomologicalComplex.d K 0 (ComplexShape.next (ComplexShape.down ℕ) 0) = 0

Next tactic:
simp
@[reassoc (attr := simp)]
lemma isoHomologyι₀_inv_naturality [L.HasHomology 0] :
    K.isoHomologyι₀.inv ≫ HomologicalComplex.homologyMap φ 0 =
      HomologicalComplex.opcyclesMap φ 0 ≫ L.isoHomologyι₀.inv := by
  

Proof state:
C : Type u_1
inst✝³ : Category.{u_2, u_1} C
inst✝² : HasZeroMorphisms C
K L : ChainComplex C ℕ
φ : K ⟶ L
inst✝¹ : HomologicalComplex.HasHomology K 0
inst✝ : HomologicalComplex.HasHomology L 0
⊢ (isoHomologyι₀ K).inv ≫ HomologicalComplex.homologyMap φ 0 =
    HomologicalComplex.opcyclesMap φ 0 ≫ (isoHomologyι₀ L).inv

Next tactic:
simp only [assoc, ← cancel_mono (L.homologyι 0),
    HomologicalComplex.homologyι_naturality, HomologicalComplex.isoHomologyι_inv_hom_id_assoc,
    HomologicalComplex.isoHomologyι_inv_hom_id, comp_id]
instance isIso_homologyπ₀ :
    IsIso (K.homologyπ 0) :=
  K.isIso_homologyπ _ 0 rfl (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.161113, u_1} C
inst✝¹ : HasZeroMorphisms C
K L : CochainComplex C ℕ
φ : K ⟶ L
inst✝ : HomologicalComplex.HasHomology K 0
⊢ HomologicalComplex.d K (ComplexShape.prev (ComplexShape.up ℕ) 0) 0 = 0

Next tactic:
simp
/-- The canonical isomorphism `K.cycles 0 ≅ K.homology 0` for a cochain complex `K`
indexed by `ℕ`. -/
noncomputable abbrev isoHomologyπ₀ :
  K.cycles 0 ≅ K.homology 0 := K.isoHomologyπ _ 0 rfl (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.162372, u_1} C
inst✝¹ : HasZeroMorphisms C
K L : CochainComplex C ℕ
φ : K ⟶ L
inst✝ : HomologicalComplex.HasHomology K 0
⊢ HomologicalComplex.d K (ComplexShape.prev (ComplexShape.up ℕ) 0) 0 = 0

Next tactic:
simp
@[reassoc (attr := simp)]
lemma isoHomologyπ₀_inv_naturality [L.HasHomology 0] :
    HomologicalComplex.homologyMap φ 0 ≫ L.isoHomologyπ₀.inv =
      K.isoHomologyπ₀.inv ≫ HomologicalComplex.cyclesMap φ 0 := by
  

Proof state:
C : Type u_1
inst✝³ : Category.{u_2, u_1} C
inst✝² : HasZeroMorphisms C
K L : CochainComplex C ℕ
φ : K ⟶ L
inst✝¹ : HomologicalComplex.HasHomology K 0
inst✝ : HomologicalComplex.HasHomology L 0
⊢ HomologicalComplex.homologyMap φ 0 ≫ (isoHomologyπ₀ L).inv = (isoHomologyπ₀ K).inv ≫ HomologicalComplex.cyclesMap φ 0

Next tactic:
simp only [← cancel_epi (K.homologyπ 0), HomologicalComplex.homologyπ_naturality_assoc,
    HomologicalComplex.isoHomologyπ_hom_inv_id, comp_id,
    HomologicalComplex.isoHomologyπ_hom_inv_id_assoc]
@[simp]
lemma homologyMap_neg : homologyMap (-φ) i = -homologyMap φ i := by
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ homologyMap (-φ) i = -homologyMap φ i

Next tactic:
dsimp [homologyMap]
@[simp]
lemma homologyMap_neg : homologyMap (-φ) i = -homologyMap φ i := by
  dsimp [homologyMap]
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (-φ)) =
    -ShortComplex.homologyMap ((shortComplexFunctor C c i).map φ)

Next tactic:
rw [← ShortComplex.homologyMap_neg]
@[simp]
lemma homologyMap_neg : homologyMap (-φ) i = -homologyMap φ i := by
  dsimp [homologyMap]
  rw [← ShortComplex.homologyMap_neg]
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (-φ)) =
    ShortComplex.homologyMap (-(shortComplexFunctor C c i).map φ)

Next tactic:
rfl
@[simp]
lemma homologyMap_add : homologyMap (φ + ψ) i = homologyMap φ i + homologyMap ψ i := by
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ homologyMap (φ + ψ) i = homologyMap φ i + homologyMap ψ i

Next tactic:
dsimp [homologyMap]
@[simp]
lemma homologyMap_add : homologyMap (φ + ψ) i = homologyMap φ i + homologyMap ψ i := by
  dsimp [homologyMap]
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (φ + ψ)) =
    ShortComplex.homologyMap ((shortComplexFunctor C c i).map φ) +
      ShortComplex.homologyMap ((shortComplexFunctor C c i).map ψ)

Next tactic:
rw [← ShortComplex.homologyMap_add]
@[simp]
lemma homologyMap_add : homologyMap (φ + ψ) i = homologyMap φ i + homologyMap ψ i := by
  dsimp [homologyMap]
  rw [← ShortComplex.homologyMap_add]
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (φ + ψ)) =
    ShortComplex.homologyMap ((shortComplexFunctor C c i).map φ + (shortComplexFunctor C c i).map ψ)

Next tactic:
rfl
@[simp]
lemma homologyMap_sub : homologyMap (φ - ψ) i = homologyMap φ i - homologyMap ψ i := by
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ homologyMap (φ - ψ) i = homologyMap φ i - homologyMap ψ i

Next tactic:
dsimp [homologyMap]
@[simp]
lemma homologyMap_sub : homologyMap (φ - ψ) i = homologyMap φ i - homologyMap ψ i := by
  dsimp [homologyMap]
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (φ - ψ)) =
    ShortComplex.homologyMap ((shortComplexFunctor C c i).map φ) -
      ShortComplex.homologyMap ((shortComplexFunctor C c i).map ψ)

Next tactic:
rw [← ShortComplex.homologyMap_sub]
@[simp]
lemma homologyMap_sub : homologyMap (φ - ψ) i = homologyMap φ i - homologyMap ψ i := by
  dsimp [homologyMap]
  rw [← ShortComplex.homologyMap_sub]
  

Proof state:
C : Type u_1
ι : Type u_2
inst✝³ : Category.{u_3, u_1} C
inst✝² : Preadditive C
c : ComplexShape ι
K L : HomologicalComplex C c
f g φ ψ : K ⟶ L
i : ι
inst✝¹ : HasHomology K i
inst✝ : HasHomology L i
⊢ ShortComplex.homologyMap ((shortComplexFunctor C c i).map (φ - ψ)) =
    ShortComplex.homologyMap ((shortComplexFunctor C c i).map φ - (shortComplexFunctor C c i).map ψ)

Next tactic:
rfl
lemma isIso_liftCycles_iff (K : CochainComplex C ℕ) {X : C} (φ : X ⟶ K.X 0)
    [K.HasHomology 0] (hφ : φ ≫ K.d 0 1 = 0) :
    IsIso (K.liftCycles φ 1 (by 

Proof state:
C : Type u_1
inst✝² : Category.{?u.173930, u_1} C
inst✝¹ : Abelian C
K : CochainComplex C ℕ
X : C
φ : X ⟶ HomologicalComplex.X K 0
inst✝ : HomologicalComplex.HasHomology K 0
hφ : φ ≫ HomologicalComplex.d K 0 1 = 0
⊢ ComplexShape.next (ComplexShape.up ℕ) 0 = 1

Next tactic:
simp
lemma isIso_liftCycles_iff (K : CochainComplex C ℕ) {X : C} (φ : X ⟶ K.X 0)
    [K.HasHomology 0] (hφ : φ ≫ K.d 0 1 = 0) :
    IsIso (K.liftCycles φ 1 (by simp) hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ := by
  

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
inst✝¹ : Abelian C
K : CochainComplex C ℕ
X : C
φ : X ⟶ HomologicalComplex.X K 0
inst✝ : HomologicalComplex.HasHomology K 0
hφ : φ ≫ HomologicalComplex.d K 0 1 = 0
⊢ IsIso (HomologicalComplex.liftCycles K φ 1 (_ : ComplexShape.next (ComplexShape.up ℕ) 0 = 1) hφ) ↔
    ShortComplex.Exact (ShortComplex.mk φ (HomologicalComplex.d K 0 1) hφ) ∧ Mono φ

Next tactic:
suffices ∀ (i : ℕ) (hx : (ComplexShape.up ℕ).next 0 = i)
    (hφ : φ ≫ K.d 0 i = 0), IsIso (K.liftCycles φ i hx hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ from this 1 (by simp) hφ
lemma isIso_liftCycles_iff (K : CochainComplex C ℕ) {X : C} (φ : X ⟶ K.X 0)
    [K.HasHomology 0] (hφ : φ ≫ K.d 0 1 = 0) :
    IsIso (K.liftCycles φ 1 (by simp) hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ := by
  suffices ∀ (i : ℕ) (hx : (ComplexShape.up ℕ).next 0 = i)
    (hφ : φ ≫ K.d 0 i = 0), IsIso (K.liftCycles φ i hx hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ from this 1 (by 

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
inst✝¹ : Abelian C
K : CochainComplex C ℕ
X : C
φ : X ⟶ HomologicalComplex.X K 0
inst✝ : HomologicalComplex.HasHomology K 0
hφ : φ ≫ HomologicalComplex.d K 0 1 = 0
this :
  ∀ (i : ℕ) (hx : ComplexShape.next (ComplexShape.up ℕ) 0 = i) (hφ : φ ≫ HomologicalComplex.d K 0 i = 0),
    IsIso (HomologicalComplex.liftCycles K φ i hx hφ) ↔
      ShortComplex.Exact (ShortComplex.mk φ (HomologicalComplex.d K 0 i) hφ) ∧ Mono φ
⊢ ComplexShape.next (ComplexShape.up ℕ) 0 = 1

Next tactic:
simp
lemma isIso_liftCycles_iff (K : CochainComplex C ℕ) {X : C} (φ : X ⟶ K.X 0)
    [K.HasHomology 0] (hφ : φ ≫ K.d 0 1 = 0) :
    IsIso (K.liftCycles φ 1 (by simp) hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ := by
  suffices ∀ (i : ℕ) (hx : (ComplexShape.up ℕ).next 0 = i)
    (hφ : φ ≫ K.d 0 i = 0), IsIso (K.liftCycles φ i hx hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ from this 1 (by simp) hφ
  

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
inst✝¹ : Abelian C
K : CochainComplex C ℕ
X : C
φ : X ⟶ HomologicalComplex.X K 0
inst✝ : HomologicalComplex.HasHomology K 0
hφ : φ ≫ HomologicalComplex.d K 0 1 = 0
⊢ ∀ (i : ℕ) (hx : ComplexShape.next (ComplexShape.up ℕ) 0 = i) (hφ : φ ≫ HomologicalComplex.d K 0 i = 0),
    IsIso (HomologicalComplex.liftCycles K φ i hx hφ) ↔
      ShortComplex.Exact (ShortComplex.mk φ (HomologicalComplex.d K 0 i) hφ) ∧ Mono φ

Next tactic:
rintro _ rfl hφ
lemma isIso_liftCycles_iff (K : CochainComplex C ℕ) {X : C} (φ : X ⟶ K.X 0)
    [K.HasHomology 0] (hφ : φ ≫ K.d 0 1 = 0) :
    IsIso (K.liftCycles φ 1 (by simp) hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ := by
  suffices ∀ (i : ℕ) (hx : (ComplexShape.up ℕ).next 0 = i)
    (hφ : φ ≫ K.d 0 i = 0), IsIso (K.liftCycles φ i hx hφ) ↔
      (ShortComplex.mk _ _ hφ).Exact ∧ Mono φ from this 1 (by simp) hφ
  rintro _ rfl hφ
  

Proof state:
C : Type u_1
inst✝² : Category.{u_2, u_1} C
inst✝¹ : Abelian C
K : CochainComplex C ℕ
X : C
φ : X ⟶ HomologicalComplex.X K 0
inst✝ : HomologicalComplex.HasHomology K 0
hφ✝ : φ ≫ HomologicalComplex.d K 0 1 = 0
hφ : φ ≫ HomologicalComplex.d K 0 (ComplexShape.next (ComplexShape.up ℕ) 0) = 0
⊢ IsIso
      (HomologicalComplex.liftCycles K φ (ComplexShape.next (ComplexShape.up ℕ) 0)
        (_ : ComplexShape.next (ComplexShape.up ℕ) 0 = ComplexShape.next (ComplexShape.up ℕ) 0) hφ) ↔
    ShortComplex.Exact (ShortComplex.mk φ (HomologicalComplex.d K 0 (ComplexShape.next (ComplexShape.up ℕ) 0)) hφ) ∧
      Mono φ

Next tactic:
let α : ShortComplex.mk (0 : X ⟶ X) (0 : X ⟶ X) (by simp) ⟶ K.sc 0 :=
    { τ₁ := 0
      τ₂ := φ
      τ₃ := 0 }