l3lab/ntp-mathlib huggingface dataset:
theorem LinearMap.continuousAt_zero_of_locally_bounded (f : E →ₛₗ[σ] F)
    (hf : ∀ s, IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (f '' s)) : ContinuousAt f 0 := by
  -- Assume that f is not continuous at 0
  by_contra h
  -- We use a decreasing balanced basis for 0 : E and a balanced basis for 0 : F
  -- and reformulate non-continuity in terms of these bases
  rcases (nhds_basis_balanced 𝕜 E).exists_antitone_subbasis with ⟨b, bE1, bE⟩
  simp only [id.def] at bE
  have bE' : (𝓝 (0 : E)).HasBasis (fun x : ℕ => x ≠ 0) fun n : ℕ => (n : 𝕜)⁻¹ • b n := by
    refine' bE.1.to_hasBasis _ _
    · intro n _
      use n + 1
      simp only [Ne.def, Nat.succ_ne_zero, not_false_iff, Nat.cast_add, Nat.cast_one, true_and_iff]
      -- `b (n + 1) ⊆ b n` follows from `Antitone`.
      have h : b (n + 1) ⊆ b n := bE.2 (by simp)
      refine' _root_.trans _ h
      rintro y ⟨x, hx, hy⟩
      -- Since `b (n + 1)` is balanced `(n+1)⁻¹ b (n + 1) ⊆ b (n + 1)`
      rw [← hy]
      refine' (bE1 (n + 1)).2.smul_mem _ hx
      have h' : 0 < (n : ℝ) + 1 := n.cast_add_one_pos
      rw [norm_inv, ← Nat.cast_one, ← Nat.cast_add, IsROrC.norm_natCast, Nat.cast_add, Nat.cast_one,
        inv_le h' zero_lt_one]
      simp
    intro n hn
    -- The converse direction follows from continuity of the scalar multiplication
    have hcont : ContinuousAt (fun x : E => (n : 𝕜) • x) 0 :=
      (continuous_const_smul (n : 𝕜)).continuousAt
    simp only [ContinuousAt, map_zero, smul_zero] at hcont
    rw [bE.1.tendsto_left_iff] at hcont
    rcases hcont (b n) (bE1 n).1 with ⟨i, _, hi⟩
    refine' ⟨i, trivial, fun x hx => ⟨(n : 𝕜) • x, hi hx, _⟩⟩
    simp [← mul_smul, hn]
  rw [ContinuousAt, map_zero, bE'.tendsto_iff (nhds_basis_balanced 𝕜' F)] at h
  push_neg at h
  rcases h with ⟨V, ⟨hV, -⟩, h⟩
  simp only [id.def, forall_true_left] at h
  -- There exists `u : ℕ → E` such that for all `n : ℕ` we have `u n ∈ n⁻¹ • b n` and `f (u n) ∉ V`
  choose! u hu hu' using h
  -- The sequence `(fun n ↦ n • u n)` converges to `0`
  have h_tendsto : Tendsto (fun n : ℕ => (n : 𝕜) • u n) atTop (𝓝 (0 : E)) := by
    apply bE.tendsto
    intro n
    by_cases h : n = 0
    · rw [h, Nat.cast_zero, zero_smul]
      refine' mem_of_mem_nhds (bE.1.mem_of_mem <| by triv)
    

Proof state:
case neg
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
F : Type u_4
inst✝¹¹ : AddCommGroup E
inst✝¹⁰ : UniformSpace E
inst✝⁹ : UniformAddGroup E
inst✝⁸ : AddCommGroup F
inst✝⁷ : UniformSpace F
inst✝⁶ : FirstCountableTopology E
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : Module 𝕜 E
inst✝³ : ContinuousSMul 𝕜 E
inst✝² : IsROrC 𝕜'
inst✝¹ : Module 𝕜' F
inst✝ : ContinuousSMul 𝕜' F
σ : 𝕜 →+* 𝕜'
f : E →ₛₗ[σ] F
hf : ∀ (s : Set E), IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (⇑f '' s)
b : ℕ → Set E
bE1 : ∀ (i : ℕ), b i ∈ 𝓝 0 ∧ Balanced 𝕜 (b i)
bE : HasAntitoneBasis (𝓝 0) fun i => b i
bE' : HasBasis (𝓝 0) (fun x => x ≠ 0) fun n => (↑n)⁻¹ • b n
V : Set F
hV : V ∈ 𝓝 0
u : ℕ → E
hu : ∀ (ia : ℕ), ia ≠ 0 → u ia ∈ (↑ia)⁻¹ • b ia
hu' : ∀ (ia : ℕ), ia ≠ 0 → f (u ia) ∉ V
n : ℕ
h : ¬n = 0
⊢ ↑n • u n ∈ b n

Next tactic:
rcases hu n h with ⟨y, hy, hu1⟩
theorem LinearMap.continuousAt_zero_of_locally_bounded (f : E →ₛₗ[σ] F)
    (hf : ∀ s, IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (f '' s)) : ContinuousAt f 0 := by
  -- Assume that f is not continuous at 0
  by_contra h
  -- We use a decreasing balanced basis for 0 : E and a balanced basis for 0 : F
  -- and reformulate non-continuity in terms of these bases
  rcases (nhds_basis_balanced 𝕜 E).exists_antitone_subbasis with ⟨b, bE1, bE⟩
  simp only [id.def] at bE
  have bE' : (𝓝 (0 : E)).HasBasis (fun x : ℕ => x ≠ 0) fun n : ℕ => (n : 𝕜)⁻¹ • b n := by
    refine' bE.1.to_hasBasis _ _
    · intro n _
      use n + 1
      simp only [Ne.def, Nat.succ_ne_zero, not_false_iff, Nat.cast_add, Nat.cast_one, true_and_iff]
      -- `b (n + 1) ⊆ b n` follows from `Antitone`.
      have h : b (n + 1) ⊆ b n := bE.2 (by simp)
      refine' _root_.trans _ h
      rintro y ⟨x, hx, hy⟩
      -- Since `b (n + 1)` is balanced `(n+1)⁻¹ b (n + 1) ⊆ b (n + 1)`
      rw [← hy]
      refine' (bE1 (n + 1)).2.smul_mem _ hx
      have h' : 0 < (n : ℝ) + 1 := n.cast_add_one_pos
      rw [norm_inv, ← Nat.cast_one, ← Nat.cast_add, IsROrC.norm_natCast, Nat.cast_add, Nat.cast_one,
        inv_le h' zero_lt_one]
      simp
    intro n hn
    -- The converse direction follows from continuity of the scalar multiplication
    have hcont : ContinuousAt (fun x : E => (n : 𝕜) • x) 0 :=
      (continuous_const_smul (n : 𝕜)).continuousAt
    simp only [ContinuousAt, map_zero, smul_zero] at hcont
    rw [bE.1.tendsto_left_iff] at hcont
    rcases hcont (b n) (bE1 n).1 with ⟨i, _, hi⟩
    refine' ⟨i, trivial, fun x hx => ⟨(n : 𝕜) • x, hi hx, _⟩⟩
    simp [← mul_smul, hn]
  rw [ContinuousAt, map_zero, bE'.tendsto_iff (nhds_basis_balanced 𝕜' F)] at h
  push_neg at h
  rcases h with ⟨V, ⟨hV, -⟩, h⟩
  simp only [id.def, forall_true_left] at h
  -- There exists `u : ℕ → E` such that for all `n : ℕ` we have `u n ∈ n⁻¹ • b n` and `f (u n) ∉ V`
  choose! u hu hu' using h
  -- The sequence `(fun n ↦ n • u n)` converges to `0`
  have h_tendsto : Tendsto (fun n : ℕ => (n : 𝕜) • u n) atTop (𝓝 (0 : E)) := by
    apply bE.tendsto
    intro n
    by_cases h : n = 0
    · rw [h, Nat.cast_zero, zero_smul]
      refine' mem_of_mem_nhds (bE.1.mem_of_mem <| by triv)
    rcases hu n h with ⟨y, hy, hu1⟩
    

Proof state:
case neg.intro.intro
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
F : Type u_4
inst✝¹¹ : AddCommGroup E
inst✝¹⁰ : UniformSpace E
inst✝⁹ : UniformAddGroup E
inst✝⁸ : AddCommGroup F
inst✝⁷ : UniformSpace F
inst✝⁶ : FirstCountableTopology E
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : Module 𝕜 E
inst✝³ : ContinuousSMul 𝕜 E
inst✝² : IsROrC 𝕜'
inst✝¹ : Module 𝕜' F
inst✝ : ContinuousSMul 𝕜' F
σ : 𝕜 →+* 𝕜'
f : E →ₛₗ[σ] F
hf : ∀ (s : Set E), IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (⇑f '' s)
b : ℕ → Set E
bE1 : ∀ (i : ℕ), b i ∈ 𝓝 0 ∧ Balanced 𝕜 (b i)
bE : HasAntitoneBasis (𝓝 0) fun i => b i
bE' : HasBasis (𝓝 0) (fun x => x ≠ 0) fun n => (↑n)⁻¹ • b n
V : Set F
hV : V ∈ 𝓝 0
u : ℕ → E
hu : ∀ (ia : ℕ), ia ≠ 0 → u ia ∈ (↑ia)⁻¹ • b ia
hu' : ∀ (ia : ℕ), ia ≠ 0 → f (u ia) ∉ V
n : ℕ
h : ¬n = 0
y : E
hy : y ∈ b n
hu1 : (fun x => (↑n)⁻¹ • x) y = u n
⊢ ↑n • u n ∈ b n

Next tactic:
convert hy
theorem LinearMap.continuousAt_zero_of_locally_bounded (f : E →ₛₗ[σ] F)
    (hf : ∀ s, IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (f '' s)) : ContinuousAt f 0 := by
  -- Assume that f is not continuous at 0
  by_contra h
  -- We use a decreasing balanced basis for 0 : E and a balanced basis for 0 : F
  -- and reformulate non-continuity in terms of these bases
  rcases (nhds_basis_balanced 𝕜 E).exists_antitone_subbasis with ⟨b, bE1, bE⟩
  simp only [id.def] at bE
  have bE' : (𝓝 (0 : E)).HasBasis (fun x : ℕ => x ≠ 0) fun n : ℕ => (n : 𝕜)⁻¹ • b n := by
    refine' bE.1.to_hasBasis _ _
    · intro n _
      use n + 1
      simp only [Ne.def, Nat.succ_ne_zero, not_false_iff, Nat.cast_add, Nat.cast_one, true_and_iff]
      -- `b (n + 1) ⊆ b n` follows from `Antitone`.
      have h : b (n + 1) ⊆ b n := bE.2 (by simp)
      refine' _root_.trans _ h
      rintro y ⟨x, hx, hy⟩
      -- Since `b (n + 1)` is balanced `(n+1)⁻¹ b (n + 1) ⊆ b (n + 1)`
      rw [← hy]
      refine' (bE1 (n + 1)).2.smul_mem _ hx
      have h' : 0 < (n : ℝ) + 1 := n.cast_add_one_pos
      rw [norm_inv, ← Nat.cast_one, ← Nat.cast_add, IsROrC.norm_natCast, Nat.cast_add, Nat.cast_one,
        inv_le h' zero_lt_one]
      simp
    intro n hn
    -- The converse direction follows from continuity of the scalar multiplication
    have hcont : ContinuousAt (fun x : E => (n : 𝕜) • x) 0 :=
      (continuous_const_smul (n : 𝕜)).continuousAt
    simp only [ContinuousAt, map_zero, smul_zero] at hcont
    rw [bE.1.tendsto_left_iff] at hcont
    rcases hcont (b n) (bE1 n).1 with ⟨i, _, hi⟩
    refine' ⟨i, trivial, fun x hx => ⟨(n : 𝕜) • x, hi hx, _⟩⟩
    simp [← mul_smul, hn]
  rw [ContinuousAt, map_zero, bE'.tendsto_iff (nhds_basis_balanced 𝕜' F)] at h
  push_neg at h
  rcases h with ⟨V, ⟨hV, -⟩, h⟩
  simp only [id.def, forall_true_left] at h
  -- There exists `u : ℕ → E` such that for all `n : ℕ` we have `u n ∈ n⁻¹ • b n` and `f (u n) ∉ V`
  choose! u hu hu' using h
  -- The sequence `(fun n ↦ n • u n)` converges to `0`
  have h_tendsto : Tendsto (fun n : ℕ => (n : 𝕜) • u n) atTop (𝓝 (0 : E)) := by
    apply bE.tendsto
    intro n
    by_cases h : n = 0
    · rw [h, Nat.cast_zero, zero_smul]
      refine' mem_of_mem_nhds (bE.1.mem_of_mem <| by triv)
    rcases hu n h with ⟨y, hy, hu1⟩
    convert hy
    

Proof state:
case h.e'_4
𝕜 : Type u_1
𝕜' : Type u_2
E : Type u_3
F : Type u_4
inst✝¹¹ : AddCommGroup E
inst✝¹⁰ : UniformSpace E
inst✝⁹ : UniformAddGroup E
inst✝⁸ : AddCommGroup F
inst✝⁷ : UniformSpace F
inst✝⁶ : FirstCountableTopology E
inst✝⁵ : IsROrC 𝕜
inst✝⁴ : Module 𝕜 E
inst✝³ : ContinuousSMul 𝕜 E
inst✝² : IsROrC 𝕜'
inst✝¹ : Module 𝕜' F
inst✝ : ContinuousSMul 𝕜' F
σ : 𝕜 →+* 𝕜'
f : E →ₛₗ[σ] F
hf : ∀ (s : Set E), IsVonNBounded 𝕜 s → IsVonNBounded 𝕜' (⇑f '' s)
b : ℕ → Set E
bE1 : ∀ (i : ℕ), b i ∈ 𝓝 0 ∧ Balanced 𝕜 (b i)
bE : HasAntitoneBasis (𝓝 0) fun i => b i
bE' : HasBasis (𝓝 0) (fun x => x ≠ 0) fun n => (↑n)⁻¹ • b n
V : Set F
hV : V ∈ 𝓝 0
u : ℕ → E
hu : ∀ (ia : ℕ), ia ≠ 0 → u ia ∈ (↑ia)⁻¹ • b ia
hu' : ∀ (ia : ℕ), ia ≠ 0 → f (u ia) ∉ V
n : ℕ
h : ¬n = 0
y : E
hy : y ∈ b n
hu1 : (fun x => (↑n)⁻¹ • x) y = u n
⊢ ↑n • u n = y

Next tactic:
rw [← hu1, ← mul_smul]
instance (priority := 100) quasiIso'_of_iso (f : C ⟶ D) [IsIso f] : QuasiIso' f where
  isIso i := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁷ : Category.{v, u} V
inst✝⁶ : HasZeroMorphisms V
inst✝⁵ : HasZeroObject V
inst✝⁴ : HasEqualizers V
inst✝³ : HasImages V
inst✝² : HasImageMaps V
inst✝¹ : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
f : C ⟶ D
inst✝ : IsIso f
i : ι
⊢ IsIso ((homology'Functor V c i).map f)

Next tactic:
change IsIso ((homology'Functor V c i).mapIso (asIso f)).hom
instance (priority := 100) quasiIso'_of_iso (f : C ⟶ D) [IsIso f] : QuasiIso' f where
  isIso i := by
    change IsIso ((homology'Functor V c i).mapIso (asIso f)).hom
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁷ : Category.{v, u} V
inst✝⁶ : HasZeroMorphisms V
inst✝⁵ : HasZeroObject V
inst✝⁴ : HasEqualizers V
inst✝³ : HasImages V
inst✝² : HasImageMaps V
inst✝¹ : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
f : C ⟶ D
inst✝ : IsIso f
i : ι
⊢ IsIso ((homology'Functor V c i).mapIso (asIso f)).hom

Next tactic:
infer_instance
instance quasiIso'_comp (f : C ⟶ D) [QuasiIso' f] (g : D ⟶ E) [QuasiIso' g] :
    QuasiIso' (f ≫ g) where
  isIso i := by
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁸ : Category.{v, u} V
inst✝⁷ : HasZeroMorphisms V
inst✝⁶ : HasZeroObject V
inst✝⁵ : HasEqualizers V
inst✝⁴ : HasImages V
inst✝³ : HasImageMaps V
inst✝² : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
f : C ⟶ D
inst✝¹ : QuasiIso' f
g : D ⟶ E
inst✝ : QuasiIso' g
i : ι
⊢ IsIso ((homology'Functor V c i).map (f ≫ g))

Next tactic:
rw [Functor.map_comp]
instance quasiIso'_comp (f : C ⟶ D) [QuasiIso' f] (g : D ⟶ E) [QuasiIso' g] :
    QuasiIso' (f ≫ g) where
  isIso i := by
    rw [Functor.map_comp]
    

Proof state:
ι : Type u_1
V : Type u
inst✝⁸ : Category.{v, u} V
inst✝⁷ : HasZeroMorphisms V
inst✝⁶ : HasZeroObject V
inst✝⁵ : HasEqualizers V
inst✝⁴ : HasImages V
inst✝³ : HasImageMaps V
inst✝² : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
f : C ⟶ D
inst✝¹ : QuasiIso' f
g : D ⟶ E
inst✝ : QuasiIso' g
i : ι
⊢ IsIso ((homology'Functor V c i).map f ≫ (homology'Functor V c i).map g)

Next tactic:
infer_instance
/-- A homotopy equivalence is a quasi-isomorphism. -/
theorem toQuasiIso' {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) : QuasiIso' e.hom :=
  ⟨fun i => by
    

Proof state:
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ IsIso ((homology'Functor W c i).map e.hom)

Next tactic:
refine' ⟨⟨(homology'Functor W c i).map e.inv, _⟩⟩
/-- A homotopy equivalence is a quasi-isomorphism. -/
theorem toQuasiIso' {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) : QuasiIso' e.hom :=
  ⟨fun i => by
    refine' ⟨⟨(homology'Functor W c i).map e.inv, _⟩⟩
    

Proof state:
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ (homology'Functor W c i).map e.hom ≫ (homology'Functor W c i).map e.inv = 𝟙 ((homology'Functor W c i).obj C) ∧
    (homology'Functor W c i).map e.inv ≫ (homology'Functor W c i).map e.hom = 𝟙 ((homology'Functor W c i).obj D)

Next tactic:
simp only [← Functor.map_comp, ← (homology'Functor W c i).map_id]
/-- A homotopy equivalence is a quasi-isomorphism. -/
theorem toQuasiIso' {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) : QuasiIso' e.hom :=
  ⟨fun i => by
    refine' ⟨⟨(homology'Functor W c i).map e.inv, _⟩⟩
    simp only [← Functor.map_comp, ← (homology'Functor W c i).map_id]
    

Proof state:
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ (homology'Functor W c i).map (e.hom ≫ e.inv) = (homology'Functor W c i).map (𝟙 C) ∧
    (homology'Functor W c i).map (e.inv ≫ e.hom) = (homology'Functor W c i).map (𝟙 D)

Next tactic:
constructor
/-- A homotopy equivalence is a quasi-isomorphism. -/
theorem toQuasiIso' {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) : QuasiIso' e.hom :=
  ⟨fun i => by
    refine' ⟨⟨(homology'Functor W c i).map e.inv, _⟩⟩
    simp only [← Functor.map_comp, ← (homology'Functor W c i).map_id]
    constructor <;> 

Proof state:
case left
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ (homology'Functor W c i).map (e.hom ≫ e.inv) = (homology'Functor W c i).map (𝟙 C)

Next tactic:
apply homology'_map_eq_of_homotopy
/-- A homotopy equivalence is a quasi-isomorphism. -/
theorem toQuasiIso' {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) : QuasiIso' e.hom :=
  ⟨fun i => by
    refine' ⟨⟨(homology'Functor W c i).map e.inv, _⟩⟩
    simp only [← Functor.map_comp, ← (homology'Functor W c i).map_id]
    constructor <;> 

Proof state:
case right
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ (homology'Functor W c i).map (e.inv ≫ e.hom) = (homology'Functor W c i).map (𝟙 D)

Next tactic:
apply homology'_map_eq_of_homotopy
/-- A homotopy equivalence is a quasi-isomorphism. -/
theorem toQuasiIso' {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) : QuasiIso' e.hom :=
  ⟨fun i => by
    refine' ⟨⟨(homology'Functor W c i).map e.inv, _⟩⟩
    simp only [← Functor.map_comp, ← (homology'Functor W c i).map_id]
    constructor <;> apply homology'_map_eq_of_homotopy
    

Proof state:
case left.h
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ Homotopy (e.hom ≫ e.inv) (𝟙 C)
case right.h
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ Homotopy (e.inv ≫ e.hom) (𝟙 D)

Next tactic:
exacts [e.homotopyHomInvId, e.homotopyInvHomId]
theorem toQuasiIso'_inv {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) (i : ι) :
    (@asIso _ _ _ _ _ (e.toQuasiIso'.1 i)).inv = (homology'Functor W c i).map e.inv := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ (asIso ((homology'Functor W c i).map e.hom)).inv = (homology'Functor W c i).map e.inv

Next tactic:
symm
theorem toQuasiIso'_inv {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) (i : ι) :
    (@asIso _ _ _ _ _ (e.toQuasiIso'.1 i)).inv = (homology'Functor W c i).map e.inv := by
  symm
  

Proof state:
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
⊢ (homology'Functor W c i).map e.inv = (asIso ((homology'Functor W c i).map e.hom)).inv

Next tactic:
haveI := e.toQuasiIso'.1 i
theorem toQuasiIso'_inv {C D : HomologicalComplex W c} (e : HomotopyEquiv C D) (i : ι) :
    (@asIso _ _ _ _ _ (e.toQuasiIso'.1 i)).inv = (homology'Functor W c i).map e.inv := by
  symm
  haveI := e.toQuasiIso'.1 i -- Porting note: Added this to get `asIso_hom` to work.
  

Proof state:
ι : Type u_1
V : Type u
inst✝¹³ : Category.{v, u} V
inst✝¹² : HasZeroMorphisms V
inst✝¹¹ : HasZeroObject V
inst✝¹⁰ : HasEqualizers V
inst✝⁹ : HasImages V
inst✝⁸ : HasImageMaps V
inst✝⁷ : HasCokernels V
c : ComplexShape ι
C✝ D✝ E : HomologicalComplex V c
W : Type u_2
inst✝⁶ : Category.{u_3, u_2} W
inst✝⁵ : Preadditive W
inst✝⁴ : HasCokernels W
inst✝³ : HasImages W
inst✝² : HasEqualizers W
inst✝¹ : HasZeroObject W
inst✝ : HasImageMaps W
C D : HomologicalComplex W c
e : HomotopyEquiv C D
i : ι
this : IsIso ((homology'Functor W c i).map e.hom)
⊢ (homology'Functor W c i).map e.inv = (asIso ((homology'Functor W c i).map e.hom)).inv

Next tactic:
simp only [← Iso.hom_comp_eq_id, asIso_hom, ← Functor.map_comp,
    ← (homology'Functor W c i).map_id, homology'_map_eq_of_homotopy e.homotopyHomInvId _]
theorem toSingle₀CokernelAtZeroIso_hom_eq [hf : QuasiIso' f] :
    f.toSingle₀CokernelAtZeroIso.hom =
      cokernel.desc (X.d 1 0) (f.f 0) (by 

Proof state:
ι : Type u_1
V : Type u
inst✝⁸ : Category.{v, u} V
inst✝⁷ : HasZeroMorphisms V
inst✝⁶ : HasZeroObject V
inst✝⁵ : HasEqualizers V
inst✝⁴ : HasImages V
inst✝³ : HasImageMaps V
inst✝² : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
W : Type u_2
inst✝¹ : Category.{?u.25051, u_2} W
inst✝ : Abelian W
X : ChainComplex W ℕ
Y : W
f : X ⟶ (ChainComplex.single₀ W).obj Y
hf✝ hf : QuasiIso' f
⊢ d X 1 0 ≫ HomologicalComplex.Hom.f f 0 = 0

Next tactic:
rw [← f.2 1 0 rfl]
theorem toSingle₀CokernelAtZeroIso_hom_eq [hf : QuasiIso' f] :
    f.toSingle₀CokernelAtZeroIso.hom =
      cokernel.desc (X.d 1 0) (f.f 0) (by rw [← f.2 1 0 rfl]; 

Proof state:
ι : Type u_1
V : Type u
inst✝⁸ : Category.{v, u} V
inst✝⁷ : HasZeroMorphisms V
inst✝⁶ : HasZeroObject V
inst✝⁵ : HasEqualizers V
inst✝⁴ : HasImages V
inst✝³ : HasImageMaps V
inst✝² : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
W : Type u_2
inst✝¹ : Category.{?u.25051, u_2} W
inst✝ : Abelian W
X : ChainComplex W ℕ
Y : W
f : X ⟶ (ChainComplex.single₀ W).obj Y
hf✝ hf : QuasiIso' f
⊢ HomologicalComplex.Hom.f f 1 ≫ d ((ChainComplex.single₀ W).obj Y) 1 0 = 0

Next tactic:
exact comp_zero
theorem toSingle₀CokernelAtZeroIso_hom_eq [hf : QuasiIso' f] :
    f.toSingle₀CokernelAtZeroIso.hom =
      cokernel.desc (X.d 1 0) (f.f 0) (by rw [← f.2 1 0 rfl]; exact comp_zero) := by
  

Proof state:
ι : Type u_1
V : Type u
inst✝⁸ : Category.{v, u} V
inst✝⁷ : HasZeroMorphisms V
inst✝⁶ : HasZeroObject V
inst✝⁵ : HasEqualizers V
inst✝⁴ : HasImages V
inst✝³ : HasImageMaps V
inst✝² : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
W : Type u_2
inst✝¹ : Category.{u_3, u_2} W
inst✝ : Abelian W
X : ChainComplex W ℕ
Y : W
f : X ⟶ (ChainComplex.single₀ W).obj Y
hf✝ hf : QuasiIso' f
⊢ (toSingle₀CokernelAtZeroIso f).hom =
    cokernel.desc (d X 1 0) (HomologicalComplex.Hom.f f 0) (_ : d X 1 0 ≫ HomologicalComplex.Hom.f f 0 = 0)

Next tactic:
ext
theorem toSingle₀CokernelAtZeroIso_hom_eq [hf : QuasiIso' f] :
    f.toSingle₀CokernelAtZeroIso.hom =
      cokernel.desc (X.d 1 0) (f.f 0) (by rw [← f.2 1 0 rfl]; exact comp_zero) := by
  ext
  

Proof state:
case h
ι : Type u_1
V : Type u
inst✝⁸ : Category.{v, u} V
inst✝⁷ : HasZeroMorphisms V
inst✝⁶ : HasZeroObject V
inst✝⁵ : HasEqualizers V
inst✝⁴ : HasImages V
inst✝³ : HasImageMaps V
inst✝² : HasCokernels V
c : ComplexShape ι
C D E : HomologicalComplex V c
W : Type u_2
inst✝¹ : Category.{u_3, u_2} W
inst✝ : Abelian W
X : ChainComplex W ℕ
Y : W
f : X ⟶ (ChainComplex.single₀ W).obj Y
hf✝ hf : QuasiIso' f
⊢ coequalizer.π (d X 1 0) 0 ≫ (toSingle₀CokernelAtZeroIso f).hom =
    coequalizer.π (d X 1 0) 0 ≫
      cokernel.desc (d X 1 0) (HomologicalComplex.Hom.f f 0) (_ : d X 1 0 ≫ HomologicalComplex.Hom.f f 0 = 0)

Next tactic:
dsimp only [toSingle₀CokernelAtZeroIso, ChainComplex.homology'ZeroIso, homology'OfZeroRight,
    homology'.mapIso, ChainComplex.homology'Functor0Single₀, cokernel.map]