Skip to main content

Challenge 32: Successor criterion for extraction functions

A subsequence is obtained by applying an extraction function to the original sequence; that is, a strictly increasing function \(\varphi : \mathbb{N} \to \mathbb{N}\). For example, the subsequence \[ u_0, u_2, u_4, u_6, \dots \] is obtained with the extraction function \(\varphi\) defined by \(\varphi(n) = 2n\).

Prove that if \[ \forall n, \varphi(n) < \varphi (n+1), \] then \(\varphi\) is an extraction function.

To do so, complete the following Lean 4 theory:

import Mathlib.Basic.Real.Basic

def IsExtraction (φ : ℕ → ℕ) : Prop :=
  StrictMono φ

variable (φ : ℕ → ℕ)

example
  (hφ : ∀ n, φ n < φ (n + 1))
  : IsExtraction φ :=
by
  sorry

Read more…

Challenge 31: The identity sequence has no convergent subsequences

Let \(a_n\) be the identity sequence; that is, \(a_n = n\) for all \(n\). Prove that \(a_n\) has no convergent subsequences.

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 SeqConv (a : ℕ → ℝ) : Prop :=
  ∃ L, SeqLim a L

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

def IsExtraction (φ : ℕ → ℕ) : Prop :=
  StrictMono φ

def Subseq (v u : ℕ → ℝ) : Prop :=
  ∃ φ, IsExtraction φ ∧ v = u ∘ φ

variable (a : ℕ → ℝ)

example
  (ha : ∀ n, a n = n)
  : ¬ ∃ b, Subseq b a ∧ SeqConv b :=
by sorry

Read more…

Challenge 30: Cauchy sequences are bounded

Prove that if a sequence \(a_n\) is Cauchy, then \(a_n\) is bounded; that is, there exists \(M \in \mathbb{R}\) such that for all \(n \in \mathbb{N}\), \(|a_n| \leq M\).

To do so, complete the following theory

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

def IsCauchy (a : ℕ → ℝ) : Prop :=
  ∀ (ε : ℝ), 0 < ε → ∃ N : ℕ, ∀ n ≥ N, ∀ m ≥ N, |a m - a n| < ε

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

open Finset

variable (a : ℕ → ℝ)
example
  (ha : IsCauchy a)
  : SeqBdd a :=
by sorry

Read more…

Challenge 29: If aₙ and bₙ are Cauchy sequences, then so is aₙ+bₙ

Prove that if \(a_n\) and \(b_n\) are Cauchy sequences, then so is their sum \(a_n + b_n\).

To do this, complete the following theory

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

def IsCauchy (a : ℕ → ℝ) : Prop :=
  ∀ (ε : ℝ), 0 < ε → ∃ N : ℕ, ∀ n ≥ N, ∀ m ≥ N, |a m - a n| < ε

variable {a b : ℕ → ℝ}

example
  (ha : IsCauchy a)
  (hb : IsCauchy b)
  : IsCauchy (a + b) :=
by sorry

Read more…

Challenge 28: The sequence aₙ = n is unbounded

Prove that the sequence \(a_{n} = n\) is unbounded.

To do this, complete the following theory in Lean 4

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

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

variable {a : ℕ → ℝ}

example
  (ha : ∀ n, a n = n)
  : ¬ SeqBdd a :=
by sorry

Read more…

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

Read more…

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

Read more…

Challenge 25: If the interleaving of two sequences converges to L, then both converge to L

Suppose that the sequence \(c_n\) is an interleaving of the sequences \(a_n\) and \(b_n\); that is, that \[ (c_0, c_1, c_2, \dots) = (a_0, b_0, a_1, b_1, a_2, b_2, \dots) \]

Prove that if \(c_n\) converges to \(L\), then \(a_n\) and \(b_n\) converge to \(L\).

To do so, complete the following theory

import Mathlib.Tactic

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

example
  (hc : ∀ n, c n = if Even n
                   then a (n / 2)
                   else b ((n - 1) / 2))
  (hL : SeqLim c L)
  : SeqLim a L ∧ SeqLim b L :=
by sorry

Read more…

Challenge 24: The sequence 1, -1, 1, -1,... is not convergent (2nd version)

Using Challenge 22 (which states that if a sequence has two subsequences that converge to different limits, then the sequence is not convergent), prove that the sequence defined by 1, -1, 1, -1, ... is not convergent.

To do so, complete the following theory:

import Mathlib.Tactic

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

-- The sequence a is convergent
def SeqConv (a : ℕ → ℝ) : Prop :=
  ∃ L, SeqLim a L

-- φ is an extraction function.
def IsExtraction (φ : ℕ → ℕ) : Prop :=
  StrictMono φ

-- b is a subsequence of a.
def Subseq (b a : ℕ → ℝ) : Prop :=
  ∃ φ, IsExtraction φ ∧ b = a ∘ φ

variable {a : ℕ → ℝ}

example
  (ha : ∀ n, a n = (-1)^n)
  : ¬SeqConv a :=
by sorry

Read more…

Challenge 23: The constant sequence aₙ = L converges to L

Prove that the constant sequence \(a_{n} = L\) converges to \(L\).

To do so, complete the following theory:

import Mathlib.Tactic

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

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

example
  (h : ∀ n, a n = L)
  : SeqLim a L :=
by sorry

Read more…