l3lab/ntp-mathlib huggingface dataset:
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by 

Proof state:
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
⊢ 0 < 2

Next tactic:
norm_num
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
⊢ ∃ i, ∀ j ≥ i, abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) i) < ε

Next tactic:
exists max n i
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
⊢ ∀ j ≥ max n i, abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
intro j ji
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
have hi₁ := hi j (le_trans (le_max_right n i) ji)
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
have hi₂ := hi (max n i) (le_max_right n i)
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
hi₂ : abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) < ε / 2
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
hi₂ : abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) < ε / 2
sub_le :
  abs' (∑ k in range j, g k - ∑ k in range (max n i), g k) ≤
    abs' (∑ k in range j, g k - ∑ k in range i, g k) + abs' (∑ k in range i, g k - ∑ k in range (max n i), g k)
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
have := add_lt_add hi₁ hi₂
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
hi₂ : abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) < ε / 2
sub_le :
  abs' (∑ k in range j, g k - ∑ k in range (max n i), g k) ≤
    abs' (∑ k in range j, g k - ∑ k in range i, g k) + abs' (∑ k in range i, g k - ∑ k in range (max n i), g k)
this :
  abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) +
      abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) <
    ε / 2 + ε / 2
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
hi₂ : abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) < ε / 2
sub_le :
  abs' (∑ k in range j, g k - ∑ k in range (max n i), g k) ≤
    abs' (∑ k in range j, g k - ∑ k in range i, g k) + abs' (∑ k in range i, g k - ∑ k in range (max n i), g k)
this :
  abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) +
      abs' ((fun n => ∑ i in range n, g i) i - ∑ k in range (max n i), g k) <
    ε
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) < ε

Next tactic:
refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
hi₂ : abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) < ε / 2
sub_le :
  abs' (∑ k in range j, g k - ∑ k in range (max n i), g k) ≤
    abs' (∑ k in range j, g k - ∑ k in range i, g k) + abs' (∑ k in range i, g k - ∑ k in range (max n i), g k)
this :
  abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) +
      abs' ((fun n => ∑ i in range n, g i) i - ∑ k in range (max n i), g k) <
    ε
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) ≤
    ∑ k in range j, g k - ∑ k in range (max n i), g k

Next tactic:
generalize hk : j - max n i = k
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
hg : IsCauSeq abs' fun n => ∑ i in range n, g i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) < ε / 2
hi₂ : abs' ((fun n => ∑ i in range n, g i) (max n i) - (fun n => ∑ i in range n, g i) i) < ε / 2
sub_le :
  abs' (∑ k in range j, g k - ∑ k in range (max n i), g k) ≤
    abs' (∑ k in range j, g k - ∑ k in range i, g k) + abs' (∑ k in range i, g k - ∑ k in range (max n i), g k)
this :
  abs' ((fun n => ∑ i in range n, g i) j - (fun n => ∑ i in range n, g i) i) +
      abs' ((fun n => ∑ i in range n, g i) i - ∑ k in range (max n i), g k) <
    ε
k : ℕ
hk : j - max n i = k
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) ≤
    ∑ k in range j, g k - ∑ k in range (max n i), g k

Next tactic:
clear this hi₂ hi₁ hi ε0 ε hg sub_le
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j - max n i = k
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) ≤
    ∑ k in range j, g k - ∑ k in range (max n i), g k

Next tactic:
rw [tsub_eq_iff_eq_add_of_le ji] at hk
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j = k + max n i
⊢ abv ((fun n => ∑ i in range n, f i) j - (fun n => ∑ i in range n, f i) (max n i)) ≤
    ∑ k in range j, g k - ∑ k in range (max n i), g k

Next tactic:
rw [hk]
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  rw [hk]
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j = k + max n i
⊢ abv ((fun n => ∑ i in range n, f i) (k + max n i) - (fun n => ∑ i in range n, f i) (max n i)) ≤
    ∑ k in range (k + max n i), g k - ∑ k in range (max n i), g k

Next tactic:
dsimp only
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  rw [hk]
  dsimp only
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j = k + max n i
⊢ abv (∑ i in range (k + max n i), f i - ∑ i in range (max n i), f i) ≤
    ∑ k in range (k + max n i), g k - ∑ k in range (max n i), g k

Next tactic:
clear hk ji j
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  rw [hk]
  dsimp only
  clear hk ji j
  

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i k : ℕ
⊢ abv (∑ i in range (k + max n i), f i - ∑ i in range (max n i), f i) ≤
    ∑ k in range (k + max n i), g k - ∑ k in range (max n i), g k

Next tactic:
induction' k with k' hi
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  rw [hk]
  dsimp only
  clear hk ji j
  induction' k with k' hi
  · 

Proof state:
case intro.zero
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i : ℕ
⊢ abv (∑ i in range (Nat.zero + max n i), f i - ∑ i in range (max n i), f i) ≤
    ∑ k in range (Nat.zero + max n i), g k - ∑ k in range (max n i), g k

Next tactic:
simp [abv_zero abv]
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  rw [hk]
  dsimp only
  clear hk ji j
  induction' k with k' hi
  · simp [abv_zero abv]
  · 

Proof state:
case intro.succ
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i k' : ℕ
hi :
  abv (∑ i in range (k' + max n i), f i - ∑ i in range (max n i), f i) ≤
    ∑ k in range (k' + max n i), g k - ∑ k in range (max n i), g k
⊢ abv (∑ i in range (Nat.succ k' + max n i), f i - ∑ i in range (max n i), f i) ≤
    ∑ k in range (Nat.succ k' + max n i), g k - ∑ k in range (max n i), g k

Next tactic:
simp only [Nat.succ_add, Nat.succ_eq_add_one, Finset.sum_range_succ_comm]
theorem isCauSeq_series_of_abv_le_of_isCauSeq {f : ℕ → β} {g : ℕ → α} (n : ℕ) :
    (∀ m, n ≤ m → abv (f m) ≤ g m) →
      (IsCauSeq abs fun n => ∑ i in range n, g i) → IsCauSeq abv fun n => ∑ i in range n, f i := by
  intro hm hg ε ε0
  cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
  exists max n i
  intro j ji
  have hi₁ := hi j (le_trans (le_max_right n i) ji)
  have hi₂ := hi (max n i) (le_max_right n i)
  have sub_le :=
    abs_sub_le (∑ k in range j, g k) (∑ k in range i, g k) (∑ k in range (max n i), g k)
  have := add_lt_add hi₁ hi₂
  rw [abs_sub_comm (∑ k in range (max n i), g k), add_halves ε] at this
  refine' lt_of_le_of_lt (le_trans (le_trans _ (le_abs_self _)) sub_le) this
  generalize hk : j - max n i = k
  clear this hi₂ hi₁ hi ε0 ε hg sub_le
  rw [tsub_eq_iff_eq_add_of_le ji] at hk
  rw [hk]
  dsimp only
  clear hk ji j
  induction' k with k' hi
  · simp [abv_zero abv]
  · simp only [Nat.succ_add, Nat.succ_eq_add_one, Finset.sum_range_succ_comm]
    

Proof state:
case intro.succ
α : Type u_1
β : Type u_2
inst✝² : Ring β
inst✝¹ : LinearOrderedField α
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
g : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ g m
i k' : ℕ
hi :
  abv (∑ i in range (k' + max n i), f i - ∑ i in range (max n i), f i) ≤
    ∑ k in range (k' + max n i), g k - ∑ k in range (max n i), g k
⊢ abv (f (k' + max n i) + ∑ x in range (k' + max n i), f x - ∑ x in range (max n i), f x) ≤
    g (k' + max n i) + ∑ x in range (k' + max n i), g x - ∑ x in range (max n i), g x

Next tactic:
simp only [add_assoc, sub_eq_add_neg]