Theorem: IsCauSeq.of_abv_le
File: Mathlib/Algebra/Order/CauSeq/BigOperators.lean

tactic: intro hg ε ε0
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
⊢ (IsCauSeq abs fun n => ∑ i ∈ range n, a i) → IsCauSeq abv fun n => ∑ i ∈ range n, f i
state_after: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
⊢ ∃ i, ∀ j ≥ i, abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) i) < ε

tactic: cases' hg (ε / 2) (div_pos ε0 (by norm_num)) with i hi
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
⊢ ∃ i, ∀ j ≥ i, abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) i) < ε
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
⊢ ∃ i, ∀ j ≥ i, abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) i) < ε

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

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

tactic: have hi₁ := hi j (le_trans (le_max_right n i) ji)
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
j : ℕ
ji : j ≥ max n i
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) < ε
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) < ε

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

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

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

tactic: rw [abs_sub_comm (∑ k ∈ range (max n i), a k), add_halves ε] at this
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
hi₂ : |(fun n => ∑ i ∈ range n, a i) (max n i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (max n i), a k|
this :
  |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| +
      |(fun n => ∑ i ∈ range n, a i) (max n i) - (fun n => ∑ i ∈ range n, a i) i| <
    ε / 2 + ε / 2
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) < ε
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
hi₂ : |(fun n => ∑ i ∈ range n, a i) (max n i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (max n i), a k|
this :
  |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| +
      |(fun n => ∑ i ∈ range n, a i) i - ∑ k ∈ range (max n i), a k| <
    ε
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) < ε

tactic: refine lt_of_le_of_lt (le_trans (le_trans ?_ (le_abs_self _)) sub_le) this
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
hi₂ : |(fun n => ∑ i ∈ range n, a i) (max n i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (max n i), a k|
this :
  |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| +
      |(fun n => ∑ i ∈ range n, a i) i - ∑ k ∈ range (max n i), a k| <
    ε
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) < ε
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
i : ℕ
hi : ∀ j ≥ i, |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
j : ℕ
ji : j ≥ max n i
hi₁ : |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
hi₂ : |(fun n => ∑ i ∈ range n, a i) (max n i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (max n i), a k|
this :
  |(fun n => ∑ i ∈ range n, a i) j - (fun n => ∑ i ∈ range n, a i) i| +
      |(fun n => ∑ i ∈ range n, a i) i - ∑ k ∈ range (max n i), a k| <
    ε
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k

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

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

tactic: rw [tsub_eq_iff_eq_add_of_le ji] at hk
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j - max n i = k
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j = k + max n i
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k

tactic: rw [hk]
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j = k + max n i
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (max n i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (max n i), a k
state_after: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i j : ℕ
ji : j ≥ max n i
k : ℕ
hk : j = k + max n i
⊢ abv ((fun n => ∑ i ∈ range n, f i) (k + max n i) - (fun n => ∑ i ∈ range n, f i) (max n i)) ≤
    ∑ k ∈ range (k + max n i), a k - ∑ k ∈ range (max n i), a k

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

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

tactic: induction' k with k' hi
state_before: case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k : ℕ
⊢ abv (∑ i ∈ range (k + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k + max n i), a k - ∑ k ∈ range (max n i), a k
state_after: case intro.zero
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i : ℕ
⊢ abv (∑ i ∈ range (0 + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (0 + max n i), a k - ∑ k ∈ range (max n i), a k

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

tactic: simp only [Nat.succ_add, Nat.succ_eq_add_one, Finset.sum_range_succ_comm]
state_before: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (∑ i ∈ range (k' + 1 + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + 1 + max n i), a k - ∑ k ∈ range (max n i), a k
state_after: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i) + ∑ x ∈ range (k' + max n i), f x - ∑ x ∈ range (max n i), f x) ≤
    a (k' + max n i) + ∑ x ∈ range (k' + max n i), a x - ∑ x ∈ range (max n i), a x

tactic: simp only [add_assoc, sub_eq_add_neg]
state_before: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i) + ∑ x ∈ range (k' + max n i), f x - ∑ x ∈ range (max n i), f x) ≤
    a (k' + max n i) + ∑ x ∈ range (k' + max n i), a x - ∑ x ∈ range (max n i), a x
state_after: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i) + (∑ x ∈ range (k' + max n i), f x + -∑ x ∈ range (max n i), f x)) ≤
    a (k' + max n i) + (∑ x ∈ range (k' + max n i), a x + -∑ x ∈ range (max n i), a x)

tactic: refine le_trans (abv_add _ _ _) ?_
state_before: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i) + (∑ x ∈ range (k' + max n i), f x + -∑ x ∈ range (max n i), f x)) ≤
    a (k' + max n i) + (∑ x ∈ range (k' + max n i), a x + -∑ x ∈ range (max n i), a x)
state_after: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i)) + abv (∑ x ∈ range (k' + max n i), f x + -∑ x ∈ range (max n i), f x) ≤
    a (k' + max n i) + (∑ x ∈ range (k' + max n i), a x + -∑ x ∈ range (max n i), a x)

tactic: simp only [sub_eq_add_neg] at hi
state_before: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k - ∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i)) + abv (∑ x ∈ range (k' + max n i), f x + -∑ x ∈ range (max n i), f x) ≤
    a (k' + max n i) + (∑ x ∈ range (k' + max n i), a x + -∑ x ∈ range (max n i), a x)
state_after: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i + -∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k + -∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i)) + abv (∑ x ∈ range (k' + max n i), f x + -∑ x ∈ range (max n i), f x) ≤
    a (k' + max n i) + (∑ x ∈ range (k' + max n i), a x + -∑ x ∈ range (max n i), a x)

tactic: exact add_le_add (hm _ (le_add_of_nonneg_of_le (Nat.zero_le _) (le_max_left _ _))) hi
state_before: case intro.succ
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i k' : ℕ
hi :
  abv (∑ i ∈ range (k' + max n i), f i + -∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (k' + max n i), a k + -∑ k ∈ range (max n i), a k
⊢ abv (f (k' + max n i)) + abv (∑ x ∈ range (k' + max n i), f x + -∑ x ∈ range (max n i), f x) ≤
    a (k' + max n i) + (∑ x ∈ range (k' + max n i), a x + -∑ x ∈ range (max n i), a x)
state_after: no goals

tactic: norm_num
state_before: α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
hg : IsCauSeq abs fun n => ∑ i ∈ range n, a i
ε : α
ε0 : ε > 0
⊢ 0 < 2
state_after: no goals

tactic: simp [abv_zero abv]
state_before: case intro.zero
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f g : ℕ → β
a : ℕ → α
n : ℕ
hm : ∀ (m : ℕ), n ≤ m → abv (f m) ≤ a m
i : ℕ
⊢ abv (∑ i ∈ range (0 + max n i), f i - ∑ i ∈ range (max n i), f i) ≤
    ∑ k ∈ range (0 + max n i), a k - ∑ k ∈ range (max n i), a k
state_after: no goals