l3lab/ntp-mathlib huggingface dataset:
/-- Homotopic maps induce the same map on homology.
-/
theorem homology'_map_eq_of_homotopy (h : Homotopy f g) (i : ι) :
    (homology'Functor V c i).map f = (homology'Functor V c i).map g := by
  dsimp [homology'Functor]
  apply eq_of_sub_eq_zero
  ext
  simp only [homology'.π_map, comp_zero, Preadditive.comp_sub]
  dsimp [kernelSubobjectMap]
  simp_rw [h.comm i]
  simp only [zero_add, zero_comp, dNext_eq_dFrom_fromNext, kernelSubobject_arrow_comp_assoc,
    Preadditive.comp_add]
  rw [← Preadditive.sub_comp]
  

Proof state:
case h.p
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
h : Homotopy f g
i : ι
⊢ (Subobject.factorThru (kernelSubobject (dFrom D i))
          (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (prevD i) h.hom +
            Subobject.arrow (kernelSubobject (dFrom C i)) ≫ Hom.f g i)
          (_ :
            Subobject.Factors (kernelSubobject (dFrom D i))
              (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (prevD i) h.hom +
                Subobject.arrow (kernelSubobject (dFrom C i)) ≫ Hom.f g i)) -
        Subobject.factorThru (kernelSubobject (dFrom D i)) (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ Hom.f g i)
          (_ :
            Subobject.Factors (kernelSubobject (dFrom D i))
              (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (Hom.sqFrom g i).left))) ≫
      homology'.π (dTo D i) (dFrom D i) (_ : dTo D i ≫ dFrom D i = 0) =
    0

Next tactic:
simp only [CategoryTheory.Subobject.factorThru_add_sub_factorThru_right]
/-- Homotopic maps induce the same map on homology.
-/
theorem homology'_map_eq_of_homotopy (h : Homotopy f g) (i : ι) :
    (homology'Functor V c i).map f = (homology'Functor V c i).map g := by
  dsimp [homology'Functor]
  apply eq_of_sub_eq_zero
  ext
  simp only [homology'.π_map, comp_zero, Preadditive.comp_sub]
  dsimp [kernelSubobjectMap]
  simp_rw [h.comm i]
  simp only [zero_add, zero_comp, dNext_eq_dFrom_fromNext, kernelSubobject_arrow_comp_assoc,
    Preadditive.comp_add]
  rw [← Preadditive.sub_comp]
  simp only [CategoryTheory.Subobject.factorThru_add_sub_factorThru_right]
  

Proof state:
case h.p
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
h : Homotopy f g
i : ι
⊢ Subobject.factorThru (kernelSubobject (dFrom D i)) (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (prevD i) h.hom)
        (_ :
          Subobject.Factors (kernelSubobject (dFrom D i))
            (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (prevD i) h.hom)) ≫
      homology'.π (dTo D i) (dFrom D i) (_ : dTo D i ≫ dFrom D i = 0) =
    0

Next tactic:
erw [Subobject.factorThru_ofLE (D.boundaries_le_cycles' i)]
/-- Homotopic maps induce the same map on homology.
-/
theorem homology'_map_eq_of_homotopy (h : Homotopy f g) (i : ι) :
    (homology'Functor V c i).map f = (homology'Functor V c i).map g := by
  dsimp [homology'Functor]
  apply eq_of_sub_eq_zero
  ext
  simp only [homology'.π_map, comp_zero, Preadditive.comp_sub]
  dsimp [kernelSubobjectMap]
  simp_rw [h.comm i]
  simp only [zero_add, zero_comp, dNext_eq_dFrom_fromNext, kernelSubobject_arrow_comp_assoc,
    Preadditive.comp_add]
  rw [← Preadditive.sub_comp]
  simp only [CategoryTheory.Subobject.factorThru_add_sub_factorThru_right]
  erw [Subobject.factorThru_ofLE (D.boundaries_le_cycles' i)]
  · 

Proof state:
case h.p
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
h : Homotopy f g
i : ι
⊢ (Subobject.factorThru (boundaries D i) (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (prevD i) h.hom) ?h.p ≫
        Subobject.ofLE (boundaries D i) (cycles' D i) (_ : boundaries D i ≤ cycles' D i)) ≫
      homology'.π (dTo D i) (dFrom D i) (_ : dTo D i ≫ dFrom D i = 0) =
    0

Next tactic:
simp
/-- Homotopic maps induce the same map on homology.
-/
theorem homology'_map_eq_of_homotopy (h : Homotopy f g) (i : ι) :
    (homology'Functor V c i).map f = (homology'Functor V c i).map g := by
  dsimp [homology'Functor]
  apply eq_of_sub_eq_zero
  ext
  simp only [homology'.π_map, comp_zero, Preadditive.comp_sub]
  dsimp [kernelSubobjectMap]
  simp_rw [h.comm i]
  simp only [zero_add, zero_comp, dNext_eq_dFrom_fromNext, kernelSubobject_arrow_comp_assoc,
    Preadditive.comp_add]
  rw [← Preadditive.sub_comp]
  simp only [CategoryTheory.Subobject.factorThru_add_sub_factorThru_right]
  erw [Subobject.factorThru_ofLE (D.boundaries_le_cycles' i)]
  · simp
  · 

Proof state:
case h.p
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
h : Homotopy f g
i : ι
⊢ Subobject.Factors (boundaries D i) (Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (prevD i) h.hom)

Next tactic:
rw [prevD_eq_toPrev_dTo, ← assoc]
/-- Homotopic maps induce the same map on homology.
-/
theorem homology'_map_eq_of_homotopy (h : Homotopy f g) (i : ι) :
    (homology'Functor V c i).map f = (homology'Functor V c i).map g := by
  dsimp [homology'Functor]
  apply eq_of_sub_eq_zero
  ext
  simp only [homology'.π_map, comp_zero, Preadditive.comp_sub]
  dsimp [kernelSubobjectMap]
  simp_rw [h.comm i]
  simp only [zero_add, zero_comp, dNext_eq_dFrom_fromNext, kernelSubobject_arrow_comp_assoc,
    Preadditive.comp_add]
  rw [← Preadditive.sub_comp]
  simp only [CategoryTheory.Subobject.factorThru_add_sub_factorThru_right]
  erw [Subobject.factorThru_ofLE (D.boundaries_le_cycles' i)]
  · simp
  · rw [prevD_eq_toPrev_dTo, ← assoc]
    

Proof state:
case h.p
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
h : Homotopy f g
i : ι
⊢ Subobject.Factors (boundaries D i) ((Subobject.arrow (kernelSubobject (dFrom C i)) ≫ (toPrev i) h.hom) ≫ dTo D i)

Next tactic:
apply imageSubobject_factors_comp_self
/-- Homotopy equivalent complexes have isomorphic homologies. -/
def homologyObjIsoOfHomotopyEquiv (f : HomotopyEquiv C D) (i : ι) :
    (homology'Functor V c i).obj C ≅ (homology'Functor V c i).obj D where
  hom := (homology'Functor V c i).map f.hom
  inv := (homology'Functor V c i).map f.inv
  hom_inv_id := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g : C ⟶ D
h k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
f : HomotopyEquiv C D
i : ι
⊢ (homology'Functor V c i).map f.hom ≫ (homology'Functor V c i).map f.inv = 𝟙 ((homology'Functor V c i).obj C)

Next tactic:
rw [← Functor.map_comp, homology'_map_eq_of_homotopy f.homotopyHomInvId,
      CategoryTheory.Functor.map_id]
/-- Homotopy equivalent complexes have isomorphic homologies. -/
def homologyObjIsoOfHomotopyEquiv (f : HomotopyEquiv C D) (i : ι) :
    (homology'Functor V c i).obj C ≅ (homology'Functor V c i).obj D where
  hom := (homology'Functor V c i).map f.hom
  inv := (homology'Functor V c i).map f.inv
  hom_inv_id := by
    rw [← Functor.map_comp, homology'_map_eq_of_homotopy f.homotopyHomInvId,
      CategoryTheory.Functor.map_id]
  inv_hom_id := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g : C ⟶ D
h k : D ⟶ E
i✝ : ι
inst✝³ : HasEqualizers V
inst✝² : HasCokernels V
inst✝¹ : HasImages V
inst✝ : HasImageMaps V
f : HomotopyEquiv C D
i : ι
⊢ (homology'Functor V c i).map f.inv ≫ (homology'Functor V c i).map f.hom = 𝟙 ((homology'Functor V c i).obj D)

Next tactic:
rw [← Functor.map_comp, homology'_map_eq_of_homotopy f.homotopyInvHomId,
      CategoryTheory.Functor.map_id]
/-- An additive functor takes homotopies to homotopies. -/
@[simps]
def Functor.mapHomotopy (F : V ⥤ W) [F.Additive] {f g : C ⟶ D} (h : Homotopy f g) :
    Homotopy ((F.mapHomologicalComplex c).map f) ((F.mapHomologicalComplex c).map g) where
  hom i j := F.map (h.hom i j)
  zero i j w := by 

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g✝ : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
W : Type u_2
inst✝² : Category.{?u.642396, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
f g : C ⟶ D
h : Homotopy f g
i j : ι
w : ¬ComplexShape.Rel c j i
⊢ (fun i j => F.map (Homotopy.hom h i j)) i j = 0

Next tactic:
dsimp
/-- An additive functor takes homotopies to homotopies. -/
@[simps]
def Functor.mapHomotopy (F : V ⥤ W) [F.Additive] {f g : C ⟶ D} (h : Homotopy f g) :
    Homotopy ((F.mapHomologicalComplex c).map f) ((F.mapHomologicalComplex c).map g) where
  hom i j := F.map (h.hom i j)
  zero i j w := by dsimp; 

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g✝ : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
W : Type u_2
inst✝² : Category.{?u.642396, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
f g : C ⟶ D
h : Homotopy f g
i j : ι
w : ¬ComplexShape.Rel c j i
⊢ F.map (Homotopy.hom h i j) = 0

Next tactic:
rw [h.zero i j w, F.map_zero]
/-- An additive functor takes homotopies to homotopies. -/
@[simps]
def Functor.mapHomotopy (F : V ⥤ W) [F.Additive] {f g : C ⟶ D} (h : Homotopy f g) :
    Homotopy ((F.mapHomologicalComplex c).map f) ((F.mapHomologicalComplex c).map g) where
  hom i j := F.map (h.hom i j)
  zero i j w := by dsimp; rw [h.zero i j w, F.map_zero]
  comm i := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g✝ : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
W : Type u_2
inst✝² : Category.{?u.642396, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
f g : C ⟶ D
h : Homotopy f g
i : ι
⊢ Hom.f ((mapHomologicalComplex F c).map f) i =
    (((dNext i) fun i j => F.map (Homotopy.hom h i j)) + (prevD i) fun i j => F.map (Homotopy.hom h i j)) +
      Hom.f ((mapHomologicalComplex F c).map g) i

Next tactic:
have H := h.comm i
/-- An additive functor takes homotopies to homotopies. -/
@[simps]
def Functor.mapHomotopy (F : V ⥤ W) [F.Additive] {f g : C ⟶ D} (h : Homotopy f g) :
    Homotopy ((F.mapHomologicalComplex c).map f) ((F.mapHomologicalComplex c).map g) where
  hom i j := F.map (h.hom i j)
  zero i j w := by dsimp; rw [h.zero i j w, F.map_zero]
  comm i := by
    have H := h.comm i
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g✝ : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
W : Type u_2
inst✝² : Category.{?u.642396, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
f g : C ⟶ D
h : Homotopy f g
i : ι
H : Hom.f f i = (dNext i) h.hom + (prevD i) h.hom + Hom.f g i
⊢ Hom.f ((mapHomologicalComplex F c).map f) i =
    (((dNext i) fun i j => F.map (Homotopy.hom h i j)) + (prevD i) fun i j => F.map (Homotopy.hom h i j)) +
      Hom.f ((mapHomologicalComplex F c).map g) i

Next tactic:
dsimp [dNext, prevD] at H ⊢
/-- An additive functor takes homotopies to homotopies. -/
@[simps]
def Functor.mapHomotopy (F : V ⥤ W) [F.Additive] {f g : C ⟶ D} (h : Homotopy f g) :
    Homotopy ((F.mapHomologicalComplex c).map f) ((F.mapHomologicalComplex c).map g) where
  hom i j := F.map (h.hom i j)
  zero i j w := by dsimp; rw [h.zero i j w, F.map_zero]
  comm i := by
    have H := h.comm i
    dsimp [dNext, prevD] at H ⊢
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f✝ g✝ : C ⟶ D
h✝ k : D ⟶ E
i✝ : ι
W : Type u_2
inst✝² : Category.{?u.642396, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
f g : C ⟶ D
h : Homotopy f g
i : ι
H :
  Hom.f f i =
    d C i (ComplexShape.next c i) ≫ Homotopy.hom h (ComplexShape.next c i) i +
        Homotopy.hom h i (ComplexShape.prev c i) ≫ d D (ComplexShape.prev c i) i +
      Hom.f g i
⊢ F.map (Hom.f f i) =
    F.map (d C i (ComplexShape.next c i)) ≫ F.map (Homotopy.hom h (ComplexShape.next c i) i) +
        F.map (Homotopy.hom h i (ComplexShape.prev c i)) ≫ F.map (d D (ComplexShape.prev c i) i) +
      F.map (Hom.f g i)

Next tactic:
simp [H]
/-- An additive functor preserves homotopy equivalences. -/
@[simps]
def Functor.mapHomotopyEquiv (F : V ⥤ W) [F.Additive] (h : HomotopyEquiv C D) :
    HomotopyEquiv ((F.mapHomologicalComplex c).obj C) ((F.mapHomologicalComplex c).obj D) where
  hom := (F.mapHomologicalComplex c).map h.hom
  inv := (F.mapHomologicalComplex c).map h.inv
  homotopyHomInvId := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i : ι
W : Type u_2
inst✝² : Category.{?u.649192, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
h : HomotopyEquiv C D
⊢ Homotopy ((mapHomologicalComplex F c).map h.hom ≫ (mapHomologicalComplex F c).map h.inv)
    (𝟙 ((mapHomologicalComplex F c).obj C))

Next tactic:
rw [← (F.mapHomologicalComplex c).map_comp, ← (F.mapHomologicalComplex c).map_id]
/-- An additive functor preserves homotopy equivalences. -/
@[simps]
def Functor.mapHomotopyEquiv (F : V ⥤ W) [F.Additive] (h : HomotopyEquiv C D) :
    HomotopyEquiv ((F.mapHomologicalComplex c).obj C) ((F.mapHomologicalComplex c).obj D) where
  hom := (F.mapHomologicalComplex c).map h.hom
  inv := (F.mapHomologicalComplex c).map h.inv
  homotopyHomInvId := by
    rw [← (F.mapHomologicalComplex c).map_comp, ← (F.mapHomologicalComplex c).map_id]
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i : ι
W : Type u_2
inst✝² : Category.{?u.649192, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
h : HomotopyEquiv C D
⊢ Homotopy ((mapHomologicalComplex F c).map (h.hom ≫ h.inv)) ((mapHomologicalComplex F c).map (𝟙 C))

Next tactic:
exact F.mapHomotopy h.homotopyHomInvId
/-- An additive functor preserves homotopy equivalences. -/
@[simps]
def Functor.mapHomotopyEquiv (F : V ⥤ W) [F.Additive] (h : HomotopyEquiv C D) :
    HomotopyEquiv ((F.mapHomologicalComplex c).obj C) ((F.mapHomologicalComplex c).obj D) where
  hom := (F.mapHomologicalComplex c).map h.hom
  inv := (F.mapHomologicalComplex c).map h.inv
  homotopyHomInvId := by
    rw [← (F.mapHomologicalComplex c).map_comp, ← (F.mapHomologicalComplex c).map_id]
    exact F.mapHomotopy h.homotopyHomInvId
  homotopyInvHomId := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i : ι
W : Type u_2
inst✝² : Category.{?u.649192, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
h : HomotopyEquiv C D
⊢ Homotopy ((mapHomologicalComplex F c).map h.inv ≫ (mapHomologicalComplex F c).map h.hom)
    (𝟙 ((mapHomologicalComplex F c).obj D))

Next tactic:
rw [← (F.mapHomologicalComplex c).map_comp, ← (F.mapHomologicalComplex c).map_id]
/-- An additive functor preserves homotopy equivalences. -/
@[simps]
def Functor.mapHomotopyEquiv (F : V ⥤ W) [F.Additive] (h : HomotopyEquiv C D) :
    HomotopyEquiv ((F.mapHomologicalComplex c).obj C) ((F.mapHomologicalComplex c).obj D) where
  hom := (F.mapHomologicalComplex c).map h.hom
  inv := (F.mapHomologicalComplex c).map h.inv
  homotopyHomInvId := by
    rw [← (F.mapHomologicalComplex c).map_comp, ← (F.mapHomologicalComplex c).map_id]
    exact F.mapHomotopy h.homotopyHomInvId
  homotopyInvHomId := by
    rw [← (F.mapHomologicalComplex c).map_comp, ← (F.mapHomologicalComplex c).map_id]
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c : ComplexShape ι
C D E : HomologicalComplex V c
f g : C ⟶ D
h✝ k : D ⟶ E
i : ι
W : Type u_2
inst✝² : Category.{?u.649192, u_2} W
inst✝¹ : Preadditive W
F : V ⥤ W
inst✝ : Additive F
h : HomotopyEquiv C D
⊢ Homotopy ((mapHomologicalComplex F c).map (h.inv ≫ h.hom)) ((mapHomologicalComplex F c).map (𝟙 D))

Next tactic:
exact F.mapHomotopy h.homotopyInvHomId
/-- A homotopy between morphisms of homological complexes `K ⟶ L` induces a homotopy
between morphisms of short complexes `K.sc i ⟶ L.sc i`. -/
noncomputable def Homotopy.toShortComplex (ho : Homotopy f g) (i : ι) :
    ShortComplex.Homotopy ((shortComplexFunctor C c i).map f)
      ((shortComplexFunctor C c i).map g) where
  h₀ :=
    if c.Rel (c.prev i) i
    then ho.hom _ (c.prev (c.prev i)) ≫ L.d _ _
    else f.f _ - g.f _ - K.d _ i ≫ ho.hom i _
  h₁ := ho.hom _ _
  h₂ := ho.hom _ _
  h₃ :=
    if c.Rel i (c.next i)
    then K.d _ _ ≫ ho.hom (c.next (c.next i)) _
    else f.f _ - g.f _ - ho.hom _ i ≫ L.d _ _
  h₀_f := by
    

Proof state:
ι✝ : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c✝ : ComplexShape ι✝
C✝ D E : HomologicalComplex V c✝
f✝ g✝ : C✝ ⟶ D
h k : D ⟶ E
i✝ : ι✝
C : Type u_2
inst✝² : Category.{?u.652022, u_2} C
inst✝¹ : Preadditive C
ι : Type ?u.652040
c : ComplexShape ι
inst✝ : DecidableRel c.Rel
K L : HomologicalComplex C c
f g : K ⟶ L
ho : Homotopy f g
i : ι
⊢ (if ComplexShape.Rel c (ComplexShape.prev c i) i then
        hom ho (ComplexShape.prev c i) (ComplexShape.prev c (ComplexShape.prev c i)) ≫
          d L (ComplexShape.prev c (ComplexShape.prev c i)) (ComplexShape.prev c i)
      else
        Hom.f f (ComplexShape.prev c i) - Hom.f g (ComplexShape.prev c i) -
          d K (ComplexShape.prev c i) i ≫ hom ho i (ComplexShape.prev c i)) ≫
      ((shortComplexFunctor C c i).obj L).f =
    0

Next tactic:
split_ifs with h
/-- A homotopy between morphisms of homological complexes `K ⟶ L` induces a homotopy
between morphisms of short complexes `K.sc i ⟶ L.sc i`. -/
noncomputable def Homotopy.toShortComplex (ho : Homotopy f g) (i : ι) :
    ShortComplex.Homotopy ((shortComplexFunctor C c i).map f)
      ((shortComplexFunctor C c i).map g) where
  h₀ :=
    if c.Rel (c.prev i) i
    then ho.hom _ (c.prev (c.prev i)) ≫ L.d _ _
    else f.f _ - g.f _ - K.d _ i ≫ ho.hom i _
  h₁ := ho.hom _ _
  h₂ := ho.hom _ _
  h₃ :=
    if c.Rel i (c.next i)
    then K.d _ _ ≫ ho.hom (c.next (c.next i)) _
    else f.f _ - g.f _ - ho.hom _ i ≫ L.d _ _
  h₀_f := by
    split_ifs with h
    · 

Proof state:
case pos
ι✝ : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c✝ : ComplexShape ι✝
C✝ D E : HomologicalComplex V c✝
f✝ g✝ : C✝ ⟶ D
h✝ k : D ⟶ E
i✝ : ι✝
C : Type u_2
inst✝² : Category.{?u.652022, u_2} C
inst✝¹ : Preadditive C
ι : Type ?u.652040
c : ComplexShape ι
inst✝ : DecidableRel c.Rel
K L : HomologicalComplex C c
f g : K ⟶ L
ho : Homotopy f g
i : ι
h : ComplexShape.Rel c (ComplexShape.prev c i) i
⊢ (hom ho (ComplexShape.prev c i) (ComplexShape.prev c (ComplexShape.prev c i)) ≫
        d L (ComplexShape.prev c (ComplexShape.prev c i)) (ComplexShape.prev c i)) ≫
      ((shortComplexFunctor C c i).obj L).f =
    0

Next tactic:
dsimp
/-- A homotopy between morphisms of homological complexes `K ⟶ L` induces a homotopy
between morphisms of short complexes `K.sc i ⟶ L.sc i`. -/
noncomputable def Homotopy.toShortComplex (ho : Homotopy f g) (i : ι) :
    ShortComplex.Homotopy ((shortComplexFunctor C c i).map f)
      ((shortComplexFunctor C c i).map g) where
  h₀ :=
    if c.Rel (c.prev i) i
    then ho.hom _ (c.prev (c.prev i)) ≫ L.d _ _
    else f.f _ - g.f _ - K.d _ i ≫ ho.hom i _
  h₁ := ho.hom _ _
  h₂ := ho.hom _ _
  h₃ :=
    if c.Rel i (c.next i)
    then K.d _ _ ≫ ho.hom (c.next (c.next i)) _
    else f.f _ - g.f _ - ho.hom _ i ≫ L.d _ _
  h₀_f := by
    split_ifs with h
    · dsimp
      

Proof state:
case pos
ι✝ : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c✝ : ComplexShape ι✝
C✝ D E : HomologicalComplex V c✝
f✝ g✝ : C✝ ⟶ D
h✝ k : D ⟶ E
i✝ : ι✝
C : Type u_2
inst✝² : Category.{?u.652022, u_2} C
inst✝¹ : Preadditive C
ι : Type ?u.652040
c : ComplexShape ι
inst✝ : DecidableRel c.Rel
K L : HomologicalComplex C c
f g : K ⟶ L
ho : Homotopy f g
i : ι
h : ComplexShape.Rel c (ComplexShape.prev c i) i
⊢ (hom ho (ComplexShape.prev c i) (ComplexShape.prev c (ComplexShape.prev c i)) ≫
        d L (ComplexShape.prev c (ComplexShape.prev c i)) (ComplexShape.prev c i)) ≫
      d L (ComplexShape.prev c i) i =
    0

Next tactic:
simp only [assoc, d_comp_d, comp_zero]
/-- A homotopy between morphisms of homological complexes `K ⟶ L` induces a homotopy
between morphisms of short complexes `K.sc i ⟶ L.sc i`. -/
noncomputable def Homotopy.toShortComplex (ho : Homotopy f g) (i : ι) :
    ShortComplex.Homotopy ((shortComplexFunctor C c i).map f)
      ((shortComplexFunctor C c i).map g) where
  h₀ :=
    if c.Rel (c.prev i) i
    then ho.hom _ (c.prev (c.prev i)) ≫ L.d _ _
    else f.f _ - g.f _ - K.d _ i ≫ ho.hom i _
  h₁ := ho.hom _ _
  h₂ := ho.hom _ _
  h₃ :=
    if c.Rel i (c.next i)
    then K.d _ _ ≫ ho.hom (c.next (c.next i)) _
    else f.f _ - g.f _ - ho.hom _ i ≫ L.d _ _
  h₀_f := by
    split_ifs with h
    · dsimp
      simp only [assoc, d_comp_d, comp_zero]
    · 

Proof state:
case neg
ι✝ : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c✝ : ComplexShape ι✝
C✝ D E : HomologicalComplex V c✝
f✝ g✝ : C✝ ⟶ D
h✝ k : D ⟶ E
i✝ : ι✝
C : Type u_2
inst✝² : Category.{?u.652022, u_2} C
inst✝¹ : Preadditive C
ι : Type ?u.652040
c : ComplexShape ι
inst✝ : DecidableRel c.Rel
K L : HomologicalComplex C c
f g : K ⟶ L
ho : Homotopy f g
i : ι
h : ¬ComplexShape.Rel c (ComplexShape.prev c i) i
⊢ (Hom.f f (ComplexShape.prev c i) - Hom.f g (ComplexShape.prev c i) -
        d K (ComplexShape.prev c i) i ≫ hom ho i (ComplexShape.prev c i)) ≫
      ((shortComplexFunctor C c i).obj L).f =
    0

Next tactic:
dsimp
/-- A homotopy between morphisms of homological complexes `K ⟶ L` induces a homotopy
between morphisms of short complexes `K.sc i ⟶ L.sc i`. -/
noncomputable def Homotopy.toShortComplex (ho : Homotopy f g) (i : ι) :
    ShortComplex.Homotopy ((shortComplexFunctor C c i).map f)
      ((shortComplexFunctor C c i).map g) where
  h₀ :=
    if c.Rel (c.prev i) i
    then ho.hom _ (c.prev (c.prev i)) ≫ L.d _ _
    else f.f _ - g.f _ - K.d _ i ≫ ho.hom i _
  h₁ := ho.hom _ _
  h₂ := ho.hom _ _
  h₃ :=
    if c.Rel i (c.next i)
    then K.d _ _ ≫ ho.hom (c.next (c.next i)) _
    else f.f _ - g.f _ - ho.hom _ i ≫ L.d _ _
  h₀_f := by
    split_ifs with h
    · dsimp
      simp only [assoc, d_comp_d, comp_zero]
    · dsimp
      

Proof state:
case neg
ι✝ : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : Preadditive V
c✝ : ComplexShape ι✝
C✝ D E : HomologicalComplex V c✝
f✝ g✝ : C✝ ⟶ D
h✝ k : D ⟶ E
i✝ : ι✝
C : Type u_2
inst✝² : Category.{?u.652022, u_2} C
inst✝¹ : Preadditive C
ι : Type ?u.652040
c : ComplexShape ι
inst✝ : DecidableRel c.Rel
K L : HomologicalComplex C c
f g : K ⟶ L
ho : Homotopy f g
i : ι
h : ¬ComplexShape.Rel c (ComplexShape.prev c i) i
⊢ (Hom.f f (ComplexShape.prev c i) - Hom.f g (ComplexShape.prev c i) -
        d K (ComplexShape.prev c i) i ≫ hom ho i (ComplexShape.prev c i)) ≫
      d L (ComplexShape.prev c i) i =
    0

Next tactic:
rw [L.shape _ _ h, comp_zero]