Skip to main content

Challenge 27: If aₙ → L and M is a lower bound of aₙ, then M ≤ L

Prove that if the sequence \(a_n\) converges to \(L\) and \(M\) is a lower bound of \(a_n\) (that is, \(M \leq a_n\) for all n), then \(M \leq L\).

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| < ε

variable {a : ℕ → ℝ}
variable {L M : ℝ}

example
  (ha : SeqLim a L)
  (hM : ∀ n, M ≤ a n)
  : M ≤ L :=
by sorry

1. Proof in natural language

We argue by contradiction. Assume that \[ M > L \tag{1} \] and we will reach the contradiction \(M > M\).

From (1) we have \[ M - L > 0 \] and, applying the convergence of \(a_n\) with this quantity, we obtain some \(k\) such that \[ \forall n \geq k, |a_n - L| < M - L \tag{2} \] In particular, for \(n = k\) (which satisfies \(k \geq k\)), (2) gives \[ |a_k - L| < M - L \tag{3} \] Moreover, \[ a_k - L \leq |a_k - L| \tag{4} \] since \(x \leq |x|\) for every real number \(x\).

Finally, \[ \begin{array}{llll} M &= L + (M - L) \\ &> L + |a_k - L| &&\text{[by (3)]} \\ &\geq L + (a_k - L) &&\text{[by (4)]} \\ &= a_k \\ &\geq M &&\text{[since \(M\) is a lower bound of \(a_n\)]} \end{array} \] Hence, \(M > M\), which is a contradiction.

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| < ε

variable {a : ℕ → ℝ}
variable {L M : ℝ}

-- Solution 1
-- ==========

example
  (ha : SeqLim a L)
  (hM : ∀ n, M ≤ a n)
  : M ≤ L :=
by
  by_contra hL
  -- hL : ¬M ≤ L
  -- ⊢ False
  apply lt_irrefl M
  -- ⊢ M < M
  obtain ⟨k, hk⟩ := ha (M - L) (by grind)
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - L| < M - L
  calc M
       > a k := by grind
     _ ≥ M   := hM k

-- Solution 2
-- ==========

example
  (ha : SeqLim a L)
  (hM : ∀ n, M ≤ a n)
  : M ≤ L :=
by
  by_contra hL
  -- hL : ¬M ≤ L
  -- ⊢ False
  apply lt_irrefl M
  -- ⊢ M < M
  have h1 : M > L := not_le.mp hL
  have h2 : M - L > 0 := sub_pos.mpr h1
  obtain ⟨k, hk⟩ := ha (M - L) h2
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - L| < M - L
  calc M
       = L + (M - L)    := by grind
     _ > L + |a k - L|  := by grind
     _ ≥ L + (a k - L)  := by grind
     _ = a k            := by grind
     _ ≥ M              := hM k

-- Solution 3
-- ==========

example
  (ha : SeqLim a L)
  (hM : ∀ n, M ≤ a n)
  : M ≤ L :=
by
  by_contra hL
  -- hL : ¬M ≤ L
  -- ⊢ False
  apply lt_irrefl M
  -- ⊢ M < M
  have h1 : M - L > 0 := sub_pos.mpr (not_le.mp hL)
  obtain ⟨k, hk⟩ := ha (M - L) h1
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - L| < M - L
  have h2 : |a k - L| < M - L := hk k (le_refl k)
  have h3 : a k - L ≤ |a k - L| := le_abs_self (a k - L)
  calc M
       = L + (M - L)    := by ring
     _ > L + |a k - L|  := add_lt_add_right h2 L
     _ ≥ L + (a k - L)  := by gcongr
     _ = a k            := by ring
     _ ≥ M              := hM k

-- Solution 4
-- ==========

example
  (ha : SeqLim a L)
  (hM : ∀ n, M ≤ a n)
  : M ≤ L :=
by
  by_contra hL
  -- hL : ¬M ≤ L
  -- ⊢ False
  apply lt_irrefl M
  -- ⊢ M < M
  obtain ⟨k, hk⟩ := ha (M - L) (sub_pos.mpr (not_le.mp hL))
  -- k : ℕ
  -- hk : ∀ n ≥ k, |a n - L| < M - L
  have h1 : |a k - L| < M - L := hk k (le_refl k)
  have h2 : a k - L ≤ |a k - L| := le_abs_self (a k - L)
  calc M
       = L + (M - L)    := (add_sub_cancel L M).symm
     _ > L + |a k - L|  := add_lt_add_right h1 L
     _ ≥ L + (a k - L)  := (add_le_add_iff_left L).mpr h2
     _ = a k            := add_sub_cancel L (a k)
     _ ≥ M              := hM k

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

3. Collaborative solutions

How can you post your solution?

  • 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
```
  • During the week you will be able to compare your approach with those of other participants. The official solution will be published on Monday 16 November 2026.

Comments