Skip to main content

Challenge 26: Product of a sequence converging to zero and a bounded sequence

Prove that if the sequence \(a_n\) converges to \(0\) and the sequence \(b_n\) is bounded (not necessarily convergent), then the sequence \(a_n·b_n\) converges to \(0\).

To do so, complete the following theory

import Mathlib.Basic.Real.Basic
import Mathlib.Tactic

def SeqLim (a : ℕ → ℝ) (L : ℝ) : Prop :=
  ∀ ε > 0, ∃ k : ℕ, ∀ n ≥ k, |a n - L| < ε

def SeqBdd (a : ℕ → ℝ) : Prop :=
  ∃ M > 0, ∀ n, |a n| ≤ M

variable (a b : ℕ → ℝ)

example
  (ha : SeqLim a 0)
  (hb : SeqBdd b)
  : SeqLim (a * b) 0 :=
by sorry

1. Proof in natural language

Let \(\varepsilon \in \mathbb{R}\) be such that \[ \varepsilon > 0 \tag{1} \] We have to prove that there exists \(k \in \mathbb{N}\) such that \[ \forall n \geq k, |a_n \cdot b_n - 0| < \varepsilon \tag{2} \] Since \(b_n\) is bounded, there exists \(M \in \mathbb{R}\) such that \[ M > 0 \tag{3} \] \[ \forall n, |b_n| ≤ M. \tag{4} \] By (1) and (3), \[ \dfrac{\varepsilon}{M} > 0 \] and, since \(a_n\) converges to \(0\), there exists \(k \in \mathbb{N}\) such that \[ \forall n \geq k, |a_n| < \dfrac{\varepsilon}{M} \tag{5} \] Let us show that (2) holds for this \(k\). To that end, let \(n \in \mathbb{N}\) be such that \[ n \geq k \tag{6} \] Then \[ \begin{array}{llll} |a_n \cdot b_n - 0| &= |a_n \cdot b_n| \\ &= |a_n| \cdot |b_n| \\ &≤ |a_n| \cdot M &&\text{[by (4)]} \\ &< \left(\dfrac{\varepsilon}{M}\right) \cdot M &&\text{[by (5), (6) and (3)]} \\ &= \varepsilon \end{array} \] Therefore, \(a_n \cdot b_n\) converges to \(0\).

2. Proofs in Lean 4

import Mathlib.Basic.Real.Basic
import Mathlib.Tactic

def SeqLim (a : ℕ → ℝ) (L : ℝ) : Prop :=
  ∀ ε > 0, ∃ k : ℕ, ∀ n ≥ k, |a n - L| < ε

def SeqBdd (a : ℕ → ℝ) : Prop :=
  ∃ M > 0, ∀ n, |a n| ≤ M

variable (a b : ℕ → ℝ)

-- Proof 1
-- =======

example
  (ha : SeqLim a 0)
  (hb : SeqBdd b)
  : SeqLim (a * b) 0 :=
by
  intro ε hε
  -- ε : ℝ
  -- hε : ε > 0
  -- ⊢ ∃ k, ∀ n ≥ k, |(a * b) n - 0| < ε
  obtain ⟨M, hM, hbM⟩ := hb
  -- M : ℝ
  -- hM : M > 0
  -- hbM : ∀ (n : ℕ), |b n| ≤ M
  obtain ⟨k, hk⟩ := ha (ε / M) (by positivity)
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - 0| < ε / M
  use k
  -- ⊢ ∀ n ≥ k, |(a * b) n - 0| < ε
  intro n hn
  -- n : ℕ
  -- hn : n ≥ k
  -- ⊢ |(a * b) n - 0| < ε
  have h1 : |a n| < ε / M := by grind
  calc |(a * b) n - 0|
       = |(a * b) n|    := by grind
     _ = |a n * b n|    := by rfl
     _ = |a n| * |b n|  := by grind
     _ ≤ |a n| * M      := by bound
     _ < ε / M * M      := by bound
     _ = ε              := by grind

-- Proof 2
-- =======

example
  (ha : SeqLim a 0)
  (hb : SeqBdd b)
  : SeqLim (a * b) 0 :=
by
  intro ε hε
  -- ε : ℝ
  -- hε : ε > 0
  -- ⊢ ∃ k, ∀ n ≥ k, |(a * b) n - 0| < ε
  obtain ⟨M, hM, hbM⟩ := hb
  -- M : ℝ
  -- hM : M > 0
  -- hbM : ∀ (n : ℕ), |b n| ≤ M
  obtain ⟨k, hk⟩ := ha (ε / M) (by positivity)
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - 0| < ε / M
  use k
  -- ⊢ ∀ n ≥ k, |(a * b) n - 0| < ε
  intro n hn
  -- n : ℕ
  -- hn : n ≥ k
  -- ⊢ |(a * b) n - 0| < ε
  have h1 : |a n| < ε / M := by
    calc |a n|
         = |a n - 0| := by rw [sub_zero]
       _ < ε / M     := hk n hn
  calc |(a * b) n - 0|
       = |(a * b) n|    := by rw [sub_zero]
     _ = |a n * b n|    := by rw [Pi.mul_apply]
     _ = |a n| * |b n|  := by rw [abs_mul]
     _ ≤ |a n| * M      := by bound
     _ < ε / M * M      := by bound
     _ = ε              := by field_simp

-- Proof 3
-- =======

example
  (ha : SeqLim a 0)
  (hb : SeqBdd b)
  : SeqLim (a * b) 0 :=
by
  intro ε hε
  -- ε : ℝ
  -- hε : ε > 0
  -- ⊢ ∃ k, ∀ n ≥ k, |(a * b) n - 0| < ε
  obtain ⟨M, hM, hbM⟩ := hb
  -- M : ℝ
  -- hM : M > 0
  -- hbM : ∀ (n : ℕ), |b n| ≤ M
  obtain ⟨k, hk⟩ := ha (ε / M) (div_pos hε hM)
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - 0| < ε / M
  use k
  -- ⊢ ∀ n ≥ k, |(a * b) n - 0| < ε
  intro n hn
  -- n : ℕ
  -- hn : n ≥ k
  -- ⊢ |(a * b) n - 0| < ε
  have h1 : |a n| < ε / M := by
    calc |a n|
         = |a n - 0| := by rw [sub_zero]
       _ < ε / M     := hk n hn
  calc |(a * b) n - 0|
       = |(a * b) n|    := by congr; exact sub_zero ((a * b) n)
     _ = |a n * b n|    := by congr
     _ = |a n| * |b n|  := abs_mul (a n) (b n)
     _ ≤ |a n| * M      := by rel [hbM n]
     _ < ε / M * M      := by rel [h1]
     _ = ε              := div_mul_cancel₀ ε hM.ne'

-- Proof 4
-- =======

example
  (ha : SeqLim a 0)
  (hb : SeqBdd b)
  : SeqLim (a * b) 0 :=
by
  intro ε hε
  -- ε : ℝ
  -- hε : ε > 0
  -- ⊢ ∃ k, ∀ n ≥ k, |(a * b) n - 0| < ε
  obtain ⟨M, hM, hbM⟩ := hb
  -- M : ℝ
  -- hM : M > 0
  -- hbM : ∀ (n : ℕ), |b n| ≤ M
  obtain ⟨k, hk⟩ := ha (ε / M) (div_pos hε hM)
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - 0| < ε / M
  use k
  -- ⊢ ∀ n ≥ k, |(a * b) n - 0| < ε
  intro n hn
  -- n : ℕ
  -- hn : n ≥ k
  -- ⊢ |(a * b) n - 0| < ε
  have h1 : |a n| < ε / M := by
    calc |a n|
         = |a n - 0| := congrArg abs (sub_zero (a n)).symm
       _ < ε / M     := hk n hn
  calc |(a * b) n - 0|
       = |(a * b) n|    := congrArg abs (sub_zero ((a * b) n))
     _ = |a n * b n|    := congrArg abs (Pi.mul_apply a b n)
     _ = |a n| * |b n|  := abs_mul (a n) (b n)
     _ ≤ |a n| * M      := mul_le_mul_of_nonneg_left (hbM n) (abs_nonneg (a n))
     _ < ε / M * M      := mul_lt_mul_of_pos_right h1 hM
     _ = ε              := div_mul_cancel₀ ε hM.ne'

You can inspect, modify and run the code of these proofs interactively in Lean 4 Web.

3. Collaborative solutions

Have you found a proof different from the published ones? You can share it in the comments below by following these steps:

  • Write your proof in live.lean-lang.org and check that it compiles without errors.
  • Copy the code and post it in the comments of this entry, inside a Lean code block:
```lean
   -- your proof
```

Comments