-- Mathlib/Algebra/Order/CauSeq/BigOperators.lean
lemma of_abv_le (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

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (n ⊔ i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (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 (n ⊔ i), a k| <
    ε
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (n ⊔ i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k

Tactic:
generalize hk : j - max n i = k

Result:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (n ⊔ i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (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 (n ⊔ i), a k| <
    ε
k : ℕ
hk : j - n ⊔ i = k
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (n ⊔ i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ n ⊔ i
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (n ⊔ i)) < ε

Tactic:
have hi₁ := hi j (le_trans (le_max_right n i) ji)

Result:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (n ⊔ i)) < ε

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (n ⊔ i)) < ε

Tactic:
have hi₂ := hi (max n i) (le_max_right n i)

Result:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (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) (n ⊔ i)) < ε

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

Tactic:
rw [tsub_eq_iff_eq_add_of_le ji] at hk

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

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

Tactic:
simp [abv_zero abv]

Result:
no goals

Proof state:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (n ⊔ i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (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 (n ⊔ i), a k| <
    ε
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (n ⊔ i)) < ε

Tactic:
refine lt_of_le_of_lt (le_trans (le_trans ?_ (le_abs_self _)) sub_le) this

Result:
case intro
α : Type u_1
β : Type u_2
inst✝² : LinearOrderedField α
inst✝¹ : Ring β
abv : β → α
inst✝ : IsAbsoluteValue abv
f : ℕ → β
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 ≥ 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) (n ⊔ i) - (fun n => ∑ i ∈ range n, a i) i| < ε / 2
sub_le :
  |∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k| ≤
    |∑ k ∈ range j, a k - ∑ k ∈ range i, a k| + |∑ k ∈ range i, a k - ∑ k ∈ range (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 (n ⊔ i), a k| <
    ε
⊢ abv ((fun n => ∑ i ∈ range n, f i) j - (fun n => ∑ i ∈ range n, f i) (n ⊔ i)) ≤
    ∑ k ∈ range j, a k - ∑ k ∈ range (n ⊔ i), a k