l3lab/ntp-mathlib huggingface dataset:
lemma finite_hasEigenvalue : Set.Finite f.HasEigenvalue := by
  have h : minpoly K f ≠ 0 := minpoly.ne_zero f.isIntegral
  convert (minpoly K f).rootSet_finite K
  ext μ
  

Proof state:
case h.e'_2.h
K : Type v
V : Type w
inst✝³ : Field K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : End K V
μ✝ : K
h : minpoly K f ≠ 0
μ : K
⊢ μ ∈ HasEigenvalue f ↔ μ ∈ rootSet (minpoly K f) K

Next tactic:
change f.HasEigenvalue μ ↔ _
lemma finite_hasEigenvalue : Set.Finite f.HasEigenvalue := by
  have h : minpoly K f ≠ 0 := minpoly.ne_zero f.isIntegral
  convert (minpoly K f).rootSet_finite K
  ext μ
  change f.HasEigenvalue μ ↔ _
  

Proof state:
case h.e'_2.h
K : Type v
V : Type w
inst✝³ : Field K
inst✝² : AddCommGroup V
inst✝¹ : Module K V
inst✝ : FiniteDimensional K V
f : End K V
μ✝ : K
h : minpoly K f ≠ 0
μ : K
⊢ HasEigenvalue f μ ↔ μ ∈ rootSet (minpoly K f) K

Next tactic:
rw [hasEigenvalue_iff_isRoot, mem_rootSet_of_ne h, IsRoot, coe_aeval_eq_eval]
lemma additive_of_iso {G : C ⥤ D} (e : F ≅ G) : G.Additive := by
  

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_4, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.33265, u_3} E
inst✝³ : Preadditive C
inst✝² : Preadditive D
inst✝¹ : Preadditive E
F : C ⥤ D
inst✝ : Additive F
G : C ⥤ D
e : F ≅ G
⊢ Additive G

Next tactic:
constructor
lemma additive_of_iso {G : C ⥤ D} (e : F ≅ G) : G.Additive := by
  constructor
  

Proof state:
case map_add
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_4, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.33265, u_3} E
inst✝³ : Preadditive C
inst✝² : Preadditive D
inst✝¹ : Preadditive E
F : C ⥤ D
inst✝ : Additive F
G : C ⥤ D
e : F ≅ G
⊢ autoParam (∀ {X Y : C} {f g : X ⟶ Y}, G.map (f + g) = G.map f + G.map g) _auto✝

Next tactic:
intro X Y f g
lemma additive_of_iso {G : C ⥤ D} (e : F ≅ G) : G.Additive := by
  constructor
  intro X Y f g
  

Proof state:
case map_add
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁶ : Category.{u_4, u_1} C
inst✝⁵ : Category.{u_5, u_2} D
inst✝⁴ : Category.{?u.33265, u_3} E
inst✝³ : Preadditive C
inst✝² : Preadditive D
inst✝¹ : Preadditive E
F : C ⥤ D
inst✝ : Additive F
G : C ⥤ D
e : F ≅ G
X Y : C
f g : X ⟶ Y
⊢ G.map (f + g) = G.map f + G.map g

Next tactic:
simp only [← NatIso.naturality_1 e (f + g), map_add, Preadditive.add_comp,
    NatTrans.naturality, Preadditive.comp_add, Iso.inv_hom_id_app_assoc]
lemma additive_of_full_essSurj_comp [Full F] [EssSurj F] (G : D ⥤ E)
    [(F ⋙ G).Additive] : G.Additive where
  map_add {X Y f g} := by
    

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F : C ⥤ D
inst✝³ : Additive F
inst✝² : Full F
inst✝¹ : EssSurj F
G : D ⥤ E
inst✝ : Additive (F ⋙ G)
X Y : D
f g : X ⟶ Y
⊢ G.map (f + g) = G.map f + G.map g

Next tactic:
obtain ⟨f', hf'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ f ≫
      (F.objObjPreimageIso Y).inv)
lemma additive_of_full_essSurj_comp [Full F] [EssSurj F] (G : D ⥤ E)
    [(F ⋙ G).Additive] : G.Additive where
  map_add {X Y f g} := by
    obtain ⟨f', hf'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ f ≫
      (F.objObjPreimageIso Y).inv)
    

Proof state:
case intro
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F : C ⥤ D
inst✝³ : Additive F
inst✝² : Full F
inst✝¹ : EssSurj F
G : D ⥤ E
inst✝ : Additive (F ⋙ G)
X Y : D
f g : X ⟶ Y
f' : objPreimage F X ⟶ objPreimage F Y
hf' : F.map f' = (objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv
⊢ G.map (f + g) = G.map f + G.map g

Next tactic:
obtain ⟨g', hg'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ g ≫
      (F.objObjPreimageIso Y).inv)
lemma additive_of_full_essSurj_comp [Full F] [EssSurj F] (G : D ⥤ E)
    [(F ⋙ G).Additive] : G.Additive where
  map_add {X Y f g} := by
    obtain ⟨f', hf'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ f ≫
      (F.objObjPreimageIso Y).inv)
    obtain ⟨g', hg'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ g ≫
      (F.objObjPreimageIso Y).inv)
    

Proof state:
case intro.intro
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F : C ⥤ D
inst✝³ : Additive F
inst✝² : Full F
inst✝¹ : EssSurj F
G : D ⥤ E
inst✝ : Additive (F ⋙ G)
X Y : D
f g : X ⟶ Y
f' : objPreimage F X ⟶ objPreimage F Y
hf' : F.map f' = (objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv
g' : objPreimage F X ⟶ objPreimage F Y
hg' : F.map g' = (objObjPreimageIso F X).hom ≫ g ≫ (objObjPreimageIso F Y).inv
⊢ G.map (f + g) = G.map f + G.map g

Next tactic:
simp only [← cancel_mono (G.map (F.objObjPreimageIso Y).inv),
      ← cancel_epi (G.map (F.objObjPreimageIso X).hom),
      Preadditive.add_comp, Preadditive.comp_add, ← Functor.map_comp]
lemma additive_of_full_essSurj_comp [Full F] [EssSurj F] (G : D ⥤ E)
    [(F ⋙ G).Additive] : G.Additive where
  map_add {X Y f g} := by
    obtain ⟨f', hf'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ f ≫
      (F.objObjPreimageIso Y).inv)
    obtain ⟨g', hg'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ g ≫
      (F.objObjPreimageIso Y).inv)
    simp only [← cancel_mono (G.map (F.objObjPreimageIso Y).inv),
      ← cancel_epi (G.map (F.objObjPreimageIso X).hom),
      Preadditive.add_comp, Preadditive.comp_add, ← Functor.map_comp]
    

Proof state:
case intro.intro
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F : C ⥤ D
inst✝³ : Additive F
inst✝² : Full F
inst✝¹ : EssSurj F
G : D ⥤ E
inst✝ : Additive (F ⋙ G)
X Y : D
f g : X ⟶ Y
f' : objPreimage F X ⟶ objPreimage F Y
hf' : F.map f' = (objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv
g' : objPreimage F X ⟶ objPreimage F Y
hg' : F.map g' = (objObjPreimageIso F X).hom ≫ g ≫ (objObjPreimageIso F Y).inv
⊢ G.map
      ((objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv +
        (objObjPreimageIso F X).hom ≫ g ≫ (objObjPreimageIso F Y).inv) =
    G.map ((objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv) +
      G.map ((objObjPreimageIso F X).hom ≫ g ≫ (objObjPreimageIso F Y).inv)

Next tactic:
erw [← hf', ← hg', ← (F ⋙ G).map_add]
lemma additive_of_full_essSurj_comp [Full F] [EssSurj F] (G : D ⥤ E)
    [(F ⋙ G).Additive] : G.Additive where
  map_add {X Y f g} := by
    obtain ⟨f', hf'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ f ≫
      (F.objObjPreimageIso Y).inv)
    obtain ⟨g', hg'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ g ≫
      (F.objObjPreimageIso Y).inv)
    simp only [← cancel_mono (G.map (F.objObjPreimageIso Y).inv),
      ← cancel_epi (G.map (F.objObjPreimageIso X).hom),
      Preadditive.add_comp, Preadditive.comp_add, ← Functor.map_comp]
    erw [← hf', ← hg', ← (F ⋙ G).map_add]
    

Proof state:
case intro.intro
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F : C ⥤ D
inst✝³ : Additive F
inst✝² : Full F
inst✝¹ : EssSurj F
G : D ⥤ E
inst✝ : Additive (F ⋙ G)
X Y : D
f g : X ⟶ Y
f' : objPreimage F X ⟶ objPreimage F Y
hf' : F.map f' = (objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv
g' : objPreimage F X ⟶ objPreimage F Y
hg' : F.map g' = (objObjPreimageIso F X).hom ≫ g ≫ (objObjPreimageIso F Y).inv
⊢ G.map (F.map f' + F.map g') = (F ⋙ G).map (f' + g')

Next tactic:
dsimp
lemma additive_of_full_essSurj_comp [Full F] [EssSurj F] (G : D ⥤ E)
    [(F ⋙ G).Additive] : G.Additive where
  map_add {X Y f g} := by
    obtain ⟨f', hf'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ f ≫
      (F.objObjPreimageIso Y).inv)
    obtain ⟨g', hg'⟩ := F.map_surjective ((F.objObjPreimageIso X).hom ≫ g ≫
      (F.objObjPreimageIso Y).inv)
    simp only [← cancel_mono (G.map (F.objObjPreimageIso Y).inv),
      ← cancel_epi (G.map (F.objObjPreimageIso X).hom),
      Preadditive.add_comp, Preadditive.comp_add, ← Functor.map_comp]
    erw [← hf', ← hg', ← (F ⋙ G).map_add]
    dsimp
    

Proof state:
case intro.intro
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F : C ⥤ D
inst✝³ : Additive F
inst✝² : Full F
inst✝¹ : EssSurj F
G : D ⥤ E
inst✝ : Additive (F ⋙ G)
X Y : D
f g : X ⟶ Y
f' : objPreimage F X ⟶ objPreimage F Y
hf' : F.map f' = (objObjPreimageIso F X).hom ≫ f ≫ (objObjPreimageIso F Y).inv
g' : objPreimage F X ⟶ objPreimage F Y
hg' : F.map g' = (objObjPreimageIso F X).hom ≫ g ≫ (objObjPreimageIso F Y).inv
⊢ G.map (F.map f' + F.map g') = G.map (F.map (f' + g'))

Next tactic:
rw [F.map_add]
lemma additive_of_comp_faithful
    (F : C ⥤ D) (G : D ⥤ E) [G.Additive] [(F ⋙ G).Additive] [Faithful G] :
    F.Additive where
  map_add {_ _ f₁ f₂} := G.map_injective (by
    

Proof state:
C : Type u_1
D : Type u_2
E : Type u_3
inst✝⁹ : Category.{u_4, u_1} C
inst✝⁸ : Category.{u_5, u_2} D
inst✝⁷ : Category.{u_6, u_3} E
inst✝⁶ : Preadditive C
inst✝⁵ : Preadditive D
inst✝⁴ : Preadditive E
F✝ : C ⥤ D
inst✝³ : Additive F✝
F : C ⥤ D
G : D ⥤ E
inst✝² : Additive G
inst✝¹ : Additive (F ⋙ G)
inst✝ : Faithful G
x✝¹ x✝ : C
f₁ f₂ : x✝¹ ⟶ x✝
⊢ G.map (F.map (f₁ + f₂)) = G.map (F.map f₁ + F.map f₂)

Next tactic:
rw [← Functor.comp_map, G.map_add, (F ⋙ G).map_add, Functor.comp_map, Functor.comp_map]
instance (priority := 100) preservesFiniteBiproductsOfAdditive [Additive F] :
    PreservesFiniteBiproducts F where
  preserves :=
    { preserves :=
      { preserves := fun hb =>
          isBilimitOfTotal _ (by
            

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : Preadditive C
inst✝² : Preadditive D
F : C ⥤ D
inst✝¹ : Additive F
J✝ : Type
inst✝ : Fintype J✝
f✝ : J✝ → C
b✝ : Bicone f✝
hb : Bicone.IsBilimit b✝
⊢ (Finset.sum Finset.univ fun j => Bicone.π (mapBicone F b✝) j ≫ Bicone.ι (mapBicone F b✝) j) = 𝟙 (mapBicone F b✝).pt

Next tactic:
simp_rw [F.mapBicone_π, F.mapBicone_ι, ← F.map_comp]
instance (priority := 100) preservesFiniteBiproductsOfAdditive [Additive F] :
    PreservesFiniteBiproducts F where
  preserves :=
    { preserves :=
      { preserves := fun hb =>
          isBilimitOfTotal _ (by
            simp_rw [F.mapBicone_π, F.mapBicone_ι, ← F.map_comp]
            

Proof state:
C : Type u₁
D : Type u₂
inst✝⁵ : Category.{v₁, u₁} C
inst✝⁴ : Category.{v₂, u₂} D
inst✝³ : Preadditive C
inst✝² : Preadditive D
F : C ⥤ D
inst✝¹ : Additive F
J✝ : Type
inst✝ : Fintype J✝
f✝ : J✝ → C
b✝ : Bicone f✝
hb : Bicone.IsBilimit b✝
⊢ (Finset.sum Finset.univ fun x => F.map (Bicone.π b✝ x ≫ Bicone.ι b✝ x)) = 𝟙 (mapBicone F b✝).pt

Next tactic:
erw [← F.map_sum, ← F.map_id, IsBilimit.total hb]
theorem additive_of_preservesBinaryBiproducts [HasBinaryBiproducts C] [PreservesZeroMorphisms F]
    [PreservesBinaryBiproducts F] : Additive F where
  map_add {X Y f g} := by
    

Proof state:
C : Type u₁
D : Type u₂
inst✝⁶ : Category.{v₁, u₁} C
inst✝⁵ : Category.{v₂, u₂} D
inst✝⁴ : Preadditive C
inst✝³ : Preadditive D
F : C ⥤ D
inst✝² : HasBinaryBiproducts C
inst✝¹ : PreservesZeroMorphisms F
inst✝ : PreservesBinaryBiproducts F
X Y : C
f g : X ⟶ Y
⊢ F.map (f + g) = F.map f + F.map g

Next tactic:
rw [biprod.add_eq_lift_id_desc, F.map_comp, ← biprod.lift_mapBiprod,
      ← biprod.mapBiprod_hom_desc, Category.assoc, Iso.inv_hom_id_assoc, F.map_id,
      biprod.add_eq_lift_id_desc]
instance inverse_additive (e : C ≌ D) [e.functor.Additive] : e.inverse.Additive where
  map_add {f g} := e.functor.map_injective (by 

Proof state:
C : Type u_1
D : Type u_2
inst✝⁴ : Category.{?u.55276, u_1} C
inst✝³ : Category.{?u.55280, u_2} D
inst✝² : Preadditive C
inst✝¹ : Preadditive D
e : C ≌ D
inst✝ : Functor.Additive e.functor
f g : D
f✝ g✝ : f ⟶ g
⊢ e.functor.map (e.inverse.map (f✝ + g✝)) = e.functor.map (e.inverse.map f✝ + e.inverse.map g✝)

Next tactic:
simp
theorem cycles_eq_top {i} (h : ¬c.Rel i (c.next i)) : C.cycles' i = ⊤ := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝² : Category.{v, u} V
inst✝¹ : HasZeroMorphisms V
c : ComplexShape ι
C : HomologicalComplex V c
inst✝ : HasKernels V
i : ι
h : ¬ComplexShape.Rel c i (ComplexShape.next c i)
⊢ cycles' C i = ⊤

Next tactic:
rw [eq_top_iff]
theorem cycles_eq_top {i} (h : ¬c.Rel i (c.next i)) : C.cycles' i = ⊤ := by
  rw [eq_top_iff]
  

Proof state:
ι : Type u_1
V : Type u
inst✝² : Category.{v, u} V
inst✝¹ : HasZeroMorphisms V
c : ComplexShape ι
C : HomologicalComplex V c
inst✝ : HasKernels V
i : ι
h : ¬ComplexShape.Rel c i (ComplexShape.next c i)
⊢ ⊤ ≤ cycles' C i

Next tactic:
apply le_kernelSubobject
theorem cycles_eq_top {i} (h : ¬c.Rel i (c.next i)) : C.cycles' i = ⊤ := by
  rw [eq_top_iff]
  apply le_kernelSubobject
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝² : Category.{v, u} V
inst✝¹ : HasZeroMorphisms V
c : ComplexShape ι
C : HomologicalComplex V c
inst✝ : HasKernels V
i : ι
h : ¬ComplexShape.Rel c i (ComplexShape.next c i)
⊢ Subobject.arrow ⊤ ≫ dFrom C i = 0

Next tactic:
rw [C.dFrom_eq_zero h, comp_zero]
theorem boundaries_eq_bot [HasZeroObject V] {j} (h : ¬c.Rel (c.prev j) j) : C.boundaries j = ⊥ := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
c : ComplexShape ι
C : HomologicalComplex V c
inst✝¹ : HasImages V
inst✝ : HasZeroObject V
j : ι
h : ¬ComplexShape.Rel c (ComplexShape.prev c j) j
⊢ boundaries C j = ⊥

Next tactic:
rw [eq_bot_iff]
theorem boundaries_eq_bot [HasZeroObject V] {j} (h : ¬c.Rel (c.prev j) j) : C.boundaries j = ⊥ := by
  rw [eq_bot_iff]
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
c : ComplexShape ι
C : HomologicalComplex V c
inst✝¹ : HasImages V
inst✝ : HasZeroObject V
j : ι
h : ¬ComplexShape.Rel c (ComplexShape.prev c j) j
⊢ boundaries C j ≤ ⊥

Next tactic:
refine' imageSubobject_le _ 0 _
theorem boundaries_eq_bot [HasZeroObject V] {j} (h : ¬c.Rel (c.prev j) j) : C.boundaries j = ⊥ := by
  rw [eq_bot_iff]
  refine' imageSubobject_le _ 0 _
  

Proof state:
ι : Type u_1
V : Type u
inst✝³ : Category.{v, u} V
inst✝² : HasZeroMorphisms V
c : ComplexShape ι
C : HomologicalComplex V c
inst✝¹ : HasImages V
inst✝ : HasZeroObject V
j : ι
h : ¬ComplexShape.Rel c (ComplexShape.prev c j) j
⊢ 0 ≫ Subobject.arrow ⊥ = dTo C j

Next tactic:
rw [C.dTo_eq_zero h, zero_comp]
/-- The `j`th homology of a homological complex (as kernel of 'the differential from `Cⱼ`' modulo
the image of 'the differential to `Cⱼ`') is isomorphic to the kernel of `d : Cⱼ → Cₖ` modulo
the image of `d : Cᵢ → Cⱼ` when `Rel i j` and `Rel j k`. -/
def homology'Iso (C : HomologicalComplex V c) {i j k : ι} (hij : c.Rel i j) (hjk : c.Rel j k) :
    C.homology' j ≅ _root_.homology' (C.d i j) (C.d j k) (C.d_comp_d i j k) :=
  homology'.mapIso _ _
    (Arrow.isoMk (C.xPrevIso hij) (Iso.refl _) <| by 

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝² : HasKernels V
inst✝¹ : HasImages V
inst✝ : HasCokernels V
C : HomologicalComplex V c
i j k : ι
hij : ComplexShape.Rel c i j
hjk : ComplexShape.Rel c j k
⊢ (xPrevIso C hij).hom ≫ (Arrow.mk (d C i j)).hom = (Arrow.mk (dTo C j)).hom ≫ (Iso.refl (Arrow.mk (dTo C j)).right).hom

Next tactic:
dsimp
/-- The `j`th homology of a homological complex (as kernel of 'the differential from `Cⱼ`' modulo
the image of 'the differential to `Cⱼ`') is isomorphic to the kernel of `d : Cⱼ → Cₖ` modulo
the image of `d : Cᵢ → Cⱼ` when `Rel i j` and `Rel j k`. -/
def homology'Iso (C : HomologicalComplex V c) {i j k : ι} (hij : c.Rel i j) (hjk : c.Rel j k) :
    C.homology' j ≅ _root_.homology' (C.d i j) (C.d j k) (C.d_comp_d i j k) :=
  homology'.mapIso _ _
    (Arrow.isoMk (C.xPrevIso hij) (Iso.refl _) <| by dsimp; 

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝² : HasKernels V
inst✝¹ : HasImages V
inst✝ : HasCokernels V
C : HomologicalComplex V c
i j k : ι
hij : ComplexShape.Rel c i j
hjk : ComplexShape.Rel c j k
⊢ (xPrevIso C hij).hom ≫ d C i j = dTo C j ≫ 𝟙 (X C j)

Next tactic:
rw [C.dTo_eq hij, Category.comp_id]
/-- The `j`th homology of a homological complex (as kernel of 'the differential from `Cⱼ`' modulo
the image of 'the differential to `Cⱼ`') is isomorphic to the kernel of `d : Cⱼ → Cₖ` modulo
the image of `d : Cᵢ → Cⱼ` when `Rel i j` and `Rel j k`. -/
def homology'Iso (C : HomologicalComplex V c) {i j k : ι} (hij : c.Rel i j) (hjk : c.Rel j k) :
    C.homology' j ≅ _root_.homology' (C.d i j) (C.d j k) (C.d_comp_d i j k) :=
  homology'.mapIso _ _
    (Arrow.isoMk (C.xPrevIso hij) (Iso.refl _) <| by dsimp; rw [C.dTo_eq hij, Category.comp_id])
    (Arrow.isoMk (Iso.refl _) (C.xNextIso hjk) <| by
      

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝² : HasKernels V
inst✝¹ : HasImages V
inst✝ : HasCokernels V
C : HomologicalComplex V c
i j k : ι
hij : ComplexShape.Rel c i j
hjk : ComplexShape.Rel c j k
⊢ (Iso.refl (Arrow.mk (dFrom C j)).left).hom ≫ (Arrow.mk (d C j k)).hom =
    (Arrow.mk (dFrom C j)).hom ≫ (xNextIso C hjk).hom

Next tactic:
dsimp
/-- The `j`th homology of a homological complex (as kernel of 'the differential from `Cⱼ`' modulo
the image of 'the differential to `Cⱼ`') is isomorphic to the kernel of `d : Cⱼ → Cₖ` modulo
the image of `d : Cᵢ → Cⱼ` when `Rel i j` and `Rel j k`. -/
def homology'Iso (C : HomologicalComplex V c) {i j k : ι} (hij : c.Rel i j) (hjk : c.Rel j k) :
    C.homology' j ≅ _root_.homology' (C.d i j) (C.d j k) (C.d_comp_d i j k) :=
  homology'.mapIso _ _
    (Arrow.isoMk (C.xPrevIso hij) (Iso.refl _) <| by dsimp; rw [C.dTo_eq hij, Category.comp_id])
    (Arrow.isoMk (Iso.refl _) (C.xNextIso hjk) <| by
      dsimp
      

Proof state:
ι : Type u_1
V : Type u
inst✝⁴ : Category.{v, u} V
inst✝³ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝² : HasKernels V
inst✝¹ : HasImages V
inst✝ : HasCokernels V
C : HomologicalComplex V c
i j k : ι
hij : ComplexShape.Rel c i j
hjk : ComplexShape.Rel c j k
⊢ 𝟙 (X C j) ≫ d C j k = dFrom C j ≫ (xNextIso C hjk).hom

Next tactic:
rw [C.dFrom_comp_xNextIso hjk, Category.id_comp]
/-- The 0th homology of a chain complex is isomorphic to the cokernel of `d : C₁ ⟶ C₀`. -/
def ChainComplex.homology'ZeroIso [HasKernels V] [HasImages V] [HasCokernels V]
    (C : ChainComplex V ℕ) [Epi (factorThruImage (C.d 1 0))] :
    C.homology' 0 ≅ cokernel (C.d 1 0) :=
  (homology'.mapIso _ _
      (Arrow.isoMk (C.xPrevIso rfl) (Iso.refl _) <| by
        

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝³ : HasKernels V
inst✝² : HasImages V
inst✝¹ : HasCokernels V
C : ChainComplex V ℕ
inst✝ : Epi (factorThruImage (HomologicalComplex.d C 1 0))
⊢ (HomologicalComplex.xPrevIso C (_ : 0 + 1 = 0 + 1)).hom ≫ (Arrow.mk (HomologicalComplex.d C 1 0)).hom =
    (Arrow.mk (HomologicalComplex.dTo C 0)).hom ≫ (Iso.refl (Arrow.mk (HomologicalComplex.dTo C 0)).right).hom

Next tactic:
rw [C.dTo_eq rfl]
/-- The 0th homology of a chain complex is isomorphic to the cokernel of `d : C₁ ⟶ C₀`. -/
def ChainComplex.homology'ZeroIso [HasKernels V] [HasImages V] [HasCokernels V]
    (C : ChainComplex V ℕ) [Epi (factorThruImage (C.d 1 0))] :
    C.homology' 0 ≅ cokernel (C.d 1 0) :=
  (homology'.mapIso _ _
      (Arrow.isoMk (C.xPrevIso rfl) (Iso.refl _) <| by
        rw [C.dTo_eq rfl]
        

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝³ : HasKernels V
inst✝² : HasImages V
inst✝¹ : HasCokernels V
C : ChainComplex V ℕ
inst✝ : Epi (factorThruImage (HomologicalComplex.d C 1 0))
⊢ (HomologicalComplex.xPrevIso C (_ : 0 + 1 = 0 + 1)).hom ≫ (Arrow.mk (HomologicalComplex.d C 1 0)).hom =
    (Arrow.mk ((HomologicalComplex.xPrevIso C (_ : 0 + 1 = 0 + 1)).hom ≫ HomologicalComplex.d C (0 + 1) 0)).hom ≫
      (Iso.refl
          (Arrow.mk
              ((HomologicalComplex.xPrevIso C (_ : 0 + 1 = 0 + 1)).hom ≫ HomologicalComplex.d C (0 + 1) 0)).right).hom

Next tactic:
exact (Category.comp_id _).symm
/-- The 0th homology of a chain complex is isomorphic to the cokernel of `d : C₁ ⟶ C₀`. -/
def ChainComplex.homology'ZeroIso [HasKernels V] [HasImages V] [HasCokernels V]
    (C : ChainComplex V ℕ) [Epi (factorThruImage (C.d 1 0))] :
    C.homology' 0 ≅ cokernel (C.d 1 0) :=
  (homology'.mapIso _ _
      (Arrow.isoMk (C.xPrevIso rfl) (Iso.refl _) <| by
        rw [C.dTo_eq rfl]
        exact (Category.comp_id _).symm : Arrow.mk (C.dTo 0) ≅ Arrow.mk (C.d 1 0))
      (Arrow.isoMk (Iso.refl _) (Iso.refl _) <| by
        

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝³ : HasKernels V
inst✝² : HasImages V
inst✝¹ : HasCokernels V
C : ChainComplex V ℕ
inst✝ : Epi (factorThruImage (HomologicalComplex.d C 1 0))
⊢ (Iso.refl (Arrow.mk (HomologicalComplex.dFrom C 0)).left).hom ≫ (Arrow.mk 0).hom =
    (Arrow.mk (HomologicalComplex.dFrom C 0)).hom ≫ (Iso.refl (Arrow.mk (HomologicalComplex.dFrom C 0)).right).hom

Next tactic:
simp [C.dFrom_eq_zero fun h : _ = _ =>
          one_ne_zero <| by rwa [ChainComplex.next_nat_zero, Nat.zero_add] at h]
/-- The 0th homology of a chain complex is isomorphic to the cokernel of `d : C₁ ⟶ C₀`. -/
def ChainComplex.homology'ZeroIso [HasKernels V] [HasImages V] [HasCokernels V]
    (C : ChainComplex V ℕ) [Epi (factorThruImage (C.d 1 0))] :
    C.homology' 0 ≅ cokernel (C.d 1 0) :=
  (homology'.mapIso _ _
      (Arrow.isoMk (C.xPrevIso rfl) (Iso.refl _) <| by
        rw [C.dTo_eq rfl]
        exact (Category.comp_id _).symm : Arrow.mk (C.dTo 0) ≅ Arrow.mk (C.d 1 0))
      (Arrow.isoMk (Iso.refl _) (Iso.refl _) <| by
        simp [C.dFrom_eq_zero fun h : _ = _ =>
          one_ne_zero <| by 

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝³ : HasKernels V
inst✝² : HasImages V
inst✝¹ : HasCokernels V
C : ChainComplex V ℕ
inst✝ : Epi (factorThruImage (HomologicalComplex.d C 1 0))
h : ComplexShape.next (ComplexShape.down ℕ) ?m.19399 + 1 = ?m.19399
⊢ 1 = 0

Next tactic:
rwa [ChainComplex.next_nat_zero, Nat.zero_add] at h
/-- The 0th cohomology of a cochain complex is isomorphic to the kernel of `d : C₀ → C₁`. -/
def CochainComplex.homology'ZeroIso [HasZeroObject V] [HasKernels V] [HasImages V] [HasCokernels V]
    (C : CochainComplex V ℕ) : C.homology' 0 ≅ kernel (C.d 0 1) :=
  (homology'.mapIso _ _
      (Arrow.isoMk (C.xPrevIsoSelf (by 

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝³ : HasZeroObject V
inst✝² : HasKernels V
inst✝¹ : HasImages V
inst✝ : HasCokernels V
C : CochainComplex V ℕ
⊢ ¬ComplexShape.Rel (ComplexShape.up ℕ) (ComplexShape.prev (ComplexShape.up ℕ) 0) 0

Next tactic:
rw [CochainComplex.prev_nat_zero]
/-- The 0th cohomology of a cochain complex is isomorphic to the kernel of `d : C₀ → C₁`. -/
def CochainComplex.homology'ZeroIso [HasZeroObject V] [HasKernels V] [HasImages V] [HasCokernels V]
    (C : CochainComplex V ℕ) : C.homology' 0 ≅ kernel (C.d 0 1) :=
  (homology'.mapIso _ _
      (Arrow.isoMk (C.xPrevIsoSelf (by rw [CochainComplex.prev_nat_zero]; 

Proof state:
ι : Type u_1
V : Type u
inst✝⁵ : Category.{v, u} V
inst✝⁴ : HasZeroMorphisms V
c : ComplexShape ι
C✝ : HomologicalComplex V c
inst✝³ : HasZeroObject V
inst✝² : HasKernels V
inst✝¹ : HasImages V
inst✝ : HasCokernels V
C : CochainComplex V ℕ
⊢ ¬ComplexShape.Rel (ComplexShape.up ℕ) 0 0

Next tactic:
exact one_ne_zero