Chapter 06 — Sequences of Functions
Proofs omitted. Hover over highlighted terms to see their Lean types.
Reading sections
6.1 — Pointwise and Uniform Convergence
Lean authors: Zichen Wang, Zaiwen Wen.
Definition 6.1.1: A sequence of functions fₙ : S → ℝ converges pointwise to f : S → ℝ if for every x ∈ S, the real sequence fₙ x converges to f x (this is the default meaning of "converges" for sequences of functions unless specified otherwise).
universe u
open Filter
open scoped Topology
open scoped BigOperators
def pointwiseConverges {S : Type u} (f : ℕ → S → ℝ) (g : S → ℝ) : Prop :=
∀ x, Tendsto (fun n => f n x) atTop (𝓝 (g x))
Proposition 6.1.5: A sequence of functions fₙ : S → ℝ converges pointwise to f : S → ℝ if and only if for every x ∈ S and every ε > 0 there exists N such that |fₙ x - f x| < ε for all n ≥ N.
universe u
open Filter
open scoped Topology
open scoped BigOperators
theorem pointwiseConverges_iff_abs_sub_lt {S : Type u} (f : ℕ → S → ℝ)
(g : S → ℝ) :
pointwiseConverges f g ↔
∀ x : S, ∀ ε > (0 : ℝ), ∃ N : ℕ, ∀ n ≥ N, |f n x - g x| < ε
Example 6.1.2: On [-1,1], the sequence fₙ x := x^(2 n) converges pointwise to the function that is 1 at x = -1 and x = 1, and 0 everywhere else in the closed interval. Outside [-1,1] the powers x^(2 n) do not converge.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma pointwiseConverges_pow_even :
∀ x ∈ Set.Icc (-1 : ℝ) 1,
Tendsto (fun n : ℕ => x ^ (2 * n)) atTop
(𝓝 (if x = 1 ∨ x = -1 then (1 : ℝ) else 0))
Example 6.1.3: For x ∈ (-1, 1) the partial sums of the geometric series fₙ(x) = \sum_{k=0}^n x^k converge to 1 / (1 - x), so the function \sum_{k=0}^\infty x^k is defined on (-1, 1) as this limit.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma tendsto_partialSums_geometric_of_abs_lt_one :
∀ x ∈ Set.Ioo (-1 : ℝ) 1,
Tendsto (fun n : ℕ =>
Finset.sum (Finset.range (n + 1)) (fun k => x ^ k)) atTop
(𝓝 (1 / (1 - x)))
Example 6.1.4: The sequence of functions fₙ(x) = \sin (n x) does not converge pointwise to any function on any interval, even though it converges at isolated points such as x = 0 or x = π.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma tendsto_sin_nat_mul_zero :
Tendsto (fun n : ℕ => Real.sin ((n : ℝ) * 0)) atTop (𝓝 0)
A concrete convergent point for fₙ(x) = \sin (n x) is x = π, where the sequence is constantly zero.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma tendsto_sin_nat_mul_pi :
Tendsto (fun n : ℕ => Real.sin ((n : ℝ) * Real.pi)) atTop (𝓝 0)
In any nontrivial interval, we can choose x with x / (2π) irrational.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma exists_irrational_div_two_pi_in_Icc {a b : ℝ} (h : a < b) :
∃ x ∈ Set.Icc a b, Irrational (x / (2 * Real.pi))
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma not_tendsto_sin_nat_mul_of_irrational {x : ℝ}
(hx : Irrational (x / (2 * Real.pi))) :
¬ ∃ l : ℝ, Tendsto (fun n : ℕ => Real.sin ((n : ℝ) * x)) atTop (𝓝 l)
For any interval [a, b] there is a point where the sequence fₙ(x) = \sin (n x) fails to converge.
universe u
open Filter
open scoped Topology
open scoped BigOperators
theorem exists_nonconvergent_sin_nat_mul (a b : ℝ) (h : a < b) :
∃ x ∈ Set.Icc a b,
¬ ∃ l : ℝ, Tendsto (fun n : ℕ => Real.sin ((n : ℝ) * x)) atTop (𝓝 l)
Definition 6.1.6: A sequence of functions fₙ : S → ℝ converges uniformly to f : S → ℝ if for every ε > 0 there exists N such that for all n ≥ N and all x ∈ S, we have |fₙ x - f x| < ε.
universe u
open Filter
open scoped Topology
open scoped BigOperators
def uniformConverges {S : Type u} (f : ℕ → S → ℝ) (g : S → ℝ) : Prop :=
∀ ε > (0 : ℝ), ∃ N : ℕ, ∀ n ≥ N, ∀ x : S, |f n x - g x| < ε
Proposition 6.1.7: If a sequence of functions fₙ : S → ℝ converges uniformly to f : S → ℝ, then it converges pointwise to f.
universe u
open Filter
open scoped Topology
open scoped BigOperators
theorem uniformConverges.pointwiseConverges {S : Type u} (f : ℕ → S → ℝ)
(g : S → ℝ) (h : uniformConverges f g) : pointwiseConverges f g
Example 6.1.8: The sequence of even powers fₙ(x) = x^(2 n) converges pointwise on [-1,1] to the function that is 1 at the endpoints and 0 elsewhere, but this convergence is not uniform on the whole interval.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma not_uniformConverges_pow_even_on_unit_interval :
¬ uniformConverges
(fun n : ℕ => fun x : {x // x ∈ Set.Icc (-1 : ℝ) 1} => (x : ℝ) ^ (2 * n))
(fun x : {x // x ∈ Set.Icc (-1 : ℝ) 1} =>
if (x : ℝ) = 1 ∨ (x : ℝ) = -1 then (1 : ℝ) else 0)
Example 6.1.8 (continued): If we restrict to [-a, a] with 0 < a < 1, then the even powers fₙ(x) = x^(2 n) converge uniformly to 0 on that smaller interval.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma uniformConverges_pow_even_on_subinterval {a : ℝ} (ha_pos : 0 < a)
(ha_lt_one : a < 1) :
uniformConverges
(fun n : ℕ => fun x : {x // x ∈ Set.Icc (-a : ℝ) a} => (x : ℝ) ^ (2 * n))
(fun _ => 0)
Definition 6.1.9: For a bounded function f : S → ℝ, the uniform norm is the supremum of the absolute value of f over the set S; this coincides with the usual sup (or infinity) norm.
universe u
open Filter
open scoped Topology
open scoped BigOperators
noncomputable def uniformNormOn {S : Type u} (A : Set S) (f : S → ℝ) : ℝ :=
sSup ((fun x => |f x|) '' A)
Proposition 6.1.10: A sequence of bounded functions fₙ : S → ℝ converges uniformly to f : S → ℝ if and only if the uniform norms of the difference fₙ - f converge to 0.
universe u
open Filter
open scoped Topology
open scoped BigOperators
theorem uniformConverges_iff_uniformNormOn_tendsto_zero {S : Type u}
(f : ℕ → S → ℝ) (g : S → ℝ)
(hbounded : ∀ n, BddAbove ((fun x => |f n x - g x|) '' (Set.univ : Set S))) :
uniformConverges f g ↔
Tendsto (fun n => uniformNormOn (Set.univ : Set S) (fun x => f n x - g x))
atTop (𝓝 0)
Example 6.1.11: For fₙ(x) = (n x + \sin (n x^2)) / n on [0,1], the sequence converges uniformly to the identity function x ↦ x.
universe u
open Filter
open scoped Topology
open scoped BigOperators
theorem uniformConverges_nat_mul_add_sin_div_nat :
uniformConverges
(fun n : ℕ => fun x : {x // x ∈ Set.Icc (0 : ℝ) 1} =>
(((Nat.succ n : ℝ) * (x : ℝ) +
Real.sin ((Nat.succ n : ℝ) * (x : ℝ) ^ (2 : ℕ))) /
(Nat.succ n : ℝ)))
(fun x : {x // x ∈ Set.Icc (0 : ℝ) 1} => (x : ℝ))
Definition 6.1.12: A sequence of bounded functions fₙ : S → ℝ is uniformly Cauchy (Cauchy in the uniform norm) if for every ε > 0 there exists N such that for all m, k ≥ N, the uniform norm of fₘ - fₖ on S is less than ε.
universe u
open Filter
open scoped Topology
open scoped BigOperators
def uniformlyCauchy {S : Type u} (f : ℕ → S → ℝ) : Prop :=
∀ ε > (0 : ℝ), ∃ N : ℕ, ∀ m ≥ N, ∀ k ≥ N,
uniformNormOn (Set.univ : Set S) (fun x => f m x - f k x) < ε
Proposition 6.1.13: For bounded functions fₙ : S → ℝ, the sequence is uniformly Cauchy (Cauchy in the uniform norm) if and only if there exists a function f : S → ℝ such that fₙ converges uniformly to f.
universe u
open Filter
open scoped Topology
open scoped BigOperators
theorem uniformlyCauchy_iff_exists_uniformLimit {S : Type u} (f : ℕ → S → ℝ)
(hbounded : ∀ n, BddAbove ((fun x => |f n x|) '' (Set.univ : Set S))) :
uniformlyCauchy f ↔ ∃ g : S → ℝ, uniformConverges f g
Helper for Example 6.1.8: for any N there is x ∈ (-1,1) with x^(2N) > 1/2.
universe u
open Filter
open scoped Topology
open scoped BigOperators
lemma exists_x_pow_even_ge_half (N : ℕ) :
∃ x ∈ Set.Ioo (-1 : ℝ) 1, x ^ (2 * N) > (1 / 2 : ℝ)6.2 — Interchange of Limits
Lean authors: Zichen Wang, Zaiwen Wen.
Example 6.2.1: For each n, define fₙ : [0,1] → ℝ by fₙ(x) = 1 - n x when x < 1 / n and fₙ(x) = 0 when x ≥ 1 / n. Each fₙ is continuous, the pointwise limit is the function that is 1 at 0 and 0 for x > 0, and this limit is not continuous at 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_1_fn (n : ℕ) (x : ℝ) : ℝ :=
if x < (1 : ℝ) / (Nat.succ n) then 1 - (Nat.succ n : ℝ) * x else 0
The pointwise limit function in Example 6.2.1, equal to 1 at 0 and 0 elsewhere.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_1_limit (x : ℝ) : ℝ :=
if x = 0 then 1 else 0
The sequence example6_2_1_fn n consists of continuous functions.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_1_fn_continuous (n : ℕ) :
Continuous fun x : ℝ => example6_2_1_fn n x
For any x > 0, the sequence example6_2_1_fn n x converges to 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma tendsto_example6_2_1_fn_of_pos {x : ℝ} (hx : 0 < x) :
Tendsto (fun n : ℕ => example6_2_1_fn n x) atTop (𝓝 0)
At x = 0, the sequence example6_2_1_fn n 0 converges to 1.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma tendsto_example6_2_1_fn_zero :
Tendsto (fun n : ℕ => example6_2_1_fn n 0) atTop (𝓝 1)
The pointwise limit of example6_2_1_fn on [0, 1] is the function that is 1 at 0 and 0 elsewhere, and this limit function is not continuous at 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_1_limit_not_continuous :
(Tendsto (fun n : ℕ => example6_2_1_fn n 0) atTop
(𝓝 (example6_2_1_limit 0)))
∧ (∀ x > 0,
Tendsto (fun n : ℕ => example6_2_1_fn n x) atTop
(𝓝 (example6_2_1_limit x)))
∧ ¬ ContinuousAt example6_2_1_limit 0
Theorem 6.2.2: If fₙ : S → ℝ is a sequence of continuous functions that converges uniformly to f : S → ℝ, then f is continuous.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem continuous_of_uniformLimit {S : Set ℝ} {f : S → ℝ} {fSeq : ℕ → S → ℝ}
(hcont : ∀ n, Continuous (fSeq n))
(hlim : TendstoUniformly fSeq f atTop) :
Continuous f
Example 6.2.3: The sequence of piecewise linear functions fₙ : [0,1] → ℝ given by fₙ(0) = 0, fₙ(x) = (n + 1) - (n + 1)² x for 0 < x < 1 / (n + 1), and fₙ(x) = 0 for x ≥ 1 / (n + 1) is Riemann integrable with integral 1 / 2. The pointwise limit on [0,1] is the zero function, so lim_{n → ∞} ∫₀¹ fₙ = 1/2 while ∫₀¹ (lim_{n → ∞} fₙ) = 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_3_fn (n : ℕ) (x : ℝ) : ℝ :=
if x = 0 then 0
else
if x < (1 : ℝ) / (Nat.succ n) then
(Nat.succ n : ℝ) - (Nat.succ n : ℝ) ^ 2 * x
else 0
Each example6_2_3_fn n has integral 1/2 on the interval (0, 1].
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_3_integral_half (n : ℕ) :
∫ x in (0)..1, example6_2_3_fn n x = (1 : ℝ) / 2
For any x ∈ [0,1], the sequence example6_2_3_fn n x converges to 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_3_pointwise_limit_zero {x : ℝ}
(hx : x ∈ Set.Icc (0 : ℝ) 1) :
Tendsto (fun n : ℕ => example6_2_3_fn n x) atTop (𝓝 0)
The integrals of example6_2_3_fn n converge to 1/2, while the integral of the pointwise limit is 0, showing that pointwise convergence alone does not allow interchanging limit and integral.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_3_integral_limit_ne_limit_integral :
Tendsto (fun n : ℕ => ∫ x in (0)..1, example6_2_3_fn n x)
atTop (𝓝 ((1 : ℝ) / 2))
∧ (∀ x ∈ Set.Icc (0 : ℝ) 1,
Tendsto (fun n : ℕ => example6_2_3_fn n x) atTop (𝓝 0))
∧ ((1 : ℝ) / 2 ≠ (∫ _ in (0)..1, (0 : ℝ)))
Theorem 6.2.4: If fₙ : [a, b] → ℝ is a sequence of Riemann integrable functions converging uniformly to f : [a, b] → ℝ, then f is Riemann integrable and the integral of the limit equals the limit of the integrals.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem integral_interval_tendsto_of_uniform_limit {a b : ℝ}
{f : ℝ → ℝ} {fSeq : ℕ → ℝ → ℝ}
(hint : ∀ n, IntervalIntegrable (fSeq n) volume a b)
(hlim : TendstoUniformlyOn fSeq f atTop (Set.Icc a b))
(hab : a ≤ b) :
IntervalIntegrable f volume a b
∧ Tendsto (fun n : ℕ => ∫ x in a..b, fSeq n x) atTop (𝓝 (∫ x in a..b, f x))
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_5_abs_diff_le (n : ℕ) (x : ℝ) :
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_5_tendsto_uniformlyOn :
TendstoUniformlyOn
(fun n : ℕ => fun x : ℝ =>
((Nat.succ n : ℝ) * x + Real.sin ((Nat.succ n : ℝ) * x ^ 2)) /
(Nat.succ n : ℝ))
(fun x : ℝ => x) atTop (Set.Icc (0 : ℝ) 1)
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_5_intervalIntegrable (n : ℕ) :
IntervalIntegrable
(fun x : ℝ =>
((Nat.succ n : ℝ) * x + Real.sin ((Nat.succ n : ℝ) * x ^ 2)) /
(Nat.succ n : ℝ))
volume 0 1
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_5_integral_id :
∫ x in (0 : ℝ)..1, x = (1 : ℝ) / 2
Example 6.2.5: For fₙ(x) = ((n x) + sin (n x²)) / n on [0,1], the functions converge uniformly to x, so the integrals converge to the integral of the limit. Therefore lim_{n → ∞} ∫₀¹ ((n x + sin (n x²)) / n) = 1 / 2.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_5_integral_limit :
Tendsto (fun n : ℕ =>
∫ x in (0)..1,
((Nat.succ n : ℝ) * x + Real.sin ((Nat.succ n : ℝ) * x ^ 2))
/ (Nat.succ n : ℝ))
atTop (𝓝 ((1 : ℝ) / 2))
Example 6.2.6: The functions fₙ : [0, 1] → ℝ are 1 at rationals whose reduced denominator is at most n and 0 otherwise. Each fₙ is Riemann integrable with integral 0, the sequence converges pointwise to the Dirichlet function that is 1 on ℚ and 0 on irrationals, and this limit is not Riemann integrable.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_6_fn (n : ℕ) (x : ℝ) : ℝ
The pointwise limit in Example 6.2.6 is the Dirichlet function, equal to 1 on rational points and 0 on irrational points.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_6_limit (x : ℝ) : ℝ
Each function in the sequence from Example 6.2.6 is Riemann integrable on [0, 1] with integral 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_6_fn_riemann_integral (n : ℕ) :
∃ hf : RiemannIntegrableOn (example6_2_6_fn n) 0 1,
riemannIntegral (example6_2_6_fn n) 0 1 hf = 0
The sequence example6_2_6_fn n converges pointwise to the Dirichlet function on [0, 1].
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_6_tendsto_dirichlet (x : ℝ) :
Tendsto (fun n : ℕ => example6_2_6_fn n x) atTop (𝓝 (example6_2_6_limit x))
The Dirichlet function on [0, 1] is not Riemann integrable.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_6_dirichlet_not_riemann_integrable :
¬ RiemannIntegrableOn example6_2_6_limit 0 1
Example 6.2.7: The functions fₙ : [0,1] → ℝ are given by fₙ(x) = 0 for x < 1 / (n + 1) and fₙ(x) = 1 / x otherwise. Each fₙ is bounded on [0, 1] by n + 1, but the pointwise limit f(x) = 0 for x = 0 and f(x) = 1 / x otherwise is unbounded.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_7_fn (n : ℕ) (x : ℝ) : ℝ :=
if x < (1 : ℝ) / (Nat.succ n) then 0 else 1 / x
The pointwise limit function in Example 6.2.7, equal to 0 at 0 and 1 / x for x ≠ 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_7_limit (x : ℝ) : ℝ :=
if x = 0 then 0 else 1 / x
Each function from Example 6.2.7 is bounded on [0, 1] by n + 1.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_7_fn_bounded (n : ℕ) :
∀ x ∈ Set.Icc (0 : ℝ) 1, |example6_2_7_fn n x| ≤ (Nat.succ n : ℝ)
The sequence in Example 6.2.7 converges pointwise on [0, 1] to the function that is 0 at 0 and 1 / x elsewhere.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_7_tendsto {x : ℝ} (hx : x ∈ Set.Icc (0 : ℝ) 1) :
Tendsto (fun n : ℕ => example6_2_7_fn n x) atTop (𝓝 (example6_2_7_limit x))
The pointwise limit in Example 6.2.7 is unbounded on [0, 1].
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_7_limit_unbounded :
¬ ∃ C : ℝ, ∀ x ∈ Set.Icc (0 : ℝ) 1, |example6_2_7_limit x| ≤ C
Example 6.2.8: The functions fₙ(x) = sin ((n + 1) x) / (n + 1) converge uniformly to 0, whose derivative is 0. The derivatives fₙ'(x) = cos ((n + 1) x) do not converge pointwise: at π they oscillate between 1 and -1, and at 0 they are constantly 1, not approaching 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_8_fn (n : ℕ) (x : ℝ) : ℝ :=
Real.sin ((Nat.succ n : ℝ) * x) / (Nat.succ n : ℝ)
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_8_abs_le (n : ℕ) (x : ℝ) :
The sequence from Example 6.2.8 converges uniformly to the zero function.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_8_uniform_tendsto_zero :
TendstoUniformly (fun n : ℕ => fun x : ℝ => example6_2_8_fn n x)
(fun _ : ℝ => 0) atTop
The derivative of the uniform limit in Example 6.2.8 is identically zero.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_8_deriv_limit (x : ℝ) :
deriv (fun _ : ℝ => (0 : ℝ)) x = 0
Each function in Example 6.2.8 has derivative cos ((n + 1) x).
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_8_deriv (n : ℕ) (x : ℝ) :
deriv (fun y : ℝ => example6_2_8_fn n y) x =
Real.cos ((Nat.succ n : ℝ) * x)
At π, the derivatives in Example 6.2.8 oscillate and do not converge.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_8_deriv_not_tendsto_at_pi :
¬ Tendsto (fun n : ℕ => deriv (fun y : ℝ => example6_2_8_fn n y) Real.pi)
atTop (𝓝 0)
At 0, the derivatives in Example 6.2.8 are constantly 1, so the sequence does not approach 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_8_deriv_at_zero :
Tendsto (fun n : ℕ => deriv (fun y : ℝ => example6_2_8_fn n y) 0) atTop (𝓝 1)
Example 6.2.9: Let fₙ(x) = 1 / (1 + n x²). For x ≠ 0, fₙ(x) converges to 0, while fₙ(0) converges to 1, so the pointwise limit is not continuous at 0. The derivatives are fₙ'(x) = - 2 n x / (1 + n x²)², which converge pointwise to 0 but not uniformly on any interval containing 0. The limit function fails to be differentiable at 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_9_fn (n : ℕ) (x : ℝ) : ℝ :=
1 / (1 + (Nat.succ n : ℝ) * x ^ 2)
Pointwise limit function in Example 6.2.9, equal to 1 at 0 and 0 elsewhere.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_9_limit (x : ℝ) : ℝ :=
if x = 0 then 1 else 0
For x ≠ 0, example6_2_9_fn n x converges to 0 as n → ∞.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_9_tendsto_of_ne_zero {x : ℝ} (hx : x ≠ 0) :
Tendsto (fun n : ℕ => example6_2_9_fn n x) atTop (𝓝 0)
At x = 0, the sequence example6_2_9_fn n 0 converges to 1.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_9_tendsto_zero :
Tendsto (fun n : ℕ => example6_2_9_fn n 0) atTop (𝓝 1)
The pointwise limit of Example 6.2.9 is not continuous at 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_9_limit_not_continuous :
¬ ContinuousAt example6_2_9_limit 0
Derivative formula for the functions in Example 6.2.9.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_9_deriv (n : ℕ) (x : ℝ) :
deriv (fun y : ℝ => example6_2_9_fn n y) x =
(-2 * (Nat.succ n : ℝ) * x) / (1 + (Nat.succ n : ℝ) * x ^ 2) ^ 2
For every x, the derivatives in Example 6.2.9 converge pointwise to 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_9_deriv_tendsto_zero (x : ℝ) :
Tendsto (fun n : ℕ => deriv (fun y : ℝ => example6_2_9_fn n y) x) atTop (𝓝 0)
The derivatives from Example 6.2.9 do not converge uniformly on any interval containing 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_9_deriv_not_uniform :
¬ ∃ a b : ℝ, a < 0 ∧ 0 < b ∧
TendstoUniformlyOn (fun n : ℕ => fun x : ℝ => deriv (fun y : ℝ => example6_2_9_fn n y) x)
(fun _ : ℝ => 0) atTop (Set.Icc a b)
The pointwise limit in Example 6.2.9 is not differentiable at 0.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem example6_2_9_limit_not_differentiable :
¬ DifferentiableAt ℝ example6_2_9_limit 0
Theorem 6.2.10: Let I be a bounded interval and let fₙ : I → ℝ be continuously differentiable functions. If the derivatives fₙ' converge uniformly on I to g and the sequence of values fₙ(c) converges for some c ∈ I, then fₙ converges uniformly on I to a continuously differentiable function f with derivative f' = g.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem uniform_limit_of_uniform_deriv
{a b : ℝ} (fSeq : ℕ → ℝ → ℝ) (g : ℝ → ℝ) (c : ℝ)
(hcont : ∀ n, ContDiffOn ℝ 1 (fSeq n) (Set.Icc a b))
(hderiv : TendstoUniformlyOn
(fun n x => derivWithin (fSeq n) (Set.Icc a b) x) g atTop (Set.Icc a b))
(hc : c ∈ Set.Icc a b) (hval : ∃ l, Tendsto (fun n => fSeq n c) atTop (𝓝 l)) :
∃ f : ℝ → ℝ,
ContDiffOn ℝ 1 f (Set.Icc a b) ∧
TendstoUniformlyOn fSeq f atTop (Set.Icc a b) ∧
∀ x ∈ Set.Icc a b, derivWithin f (Set.Icc a b) x = g x
Proposition 6.2.11: A power series ∑ cₙ (x - a)^n with radius of convergence ρ > 0 converges uniformly on [a - r, a + r] for every 0 < r < ρ. As a consequence, the sum defines a continuous function on the open interval where the series converges (or on all of ℝ if ρ = ∞).
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem powerSeries_uniform_on_compact {a : ℝ} {c : ℕ → ℝ} {ρ r : ℝ}
(hr : 0 < r) (hrρ : r < ρ)
(hconv : ∀ x ∈ Set.Icc (a - ρ) (a + ρ),
Summable fun n => c n * (x - a) ^ n) :
TendstoUniformlyOn
(fun N x => Finset.sum (Finset.range N) (fun n => c n * (x - a) ^ n))
(fun x => tsum fun n => c n * (x - a) ^ n) atTop (Set.Icc (a - r) (a + r))
A convergent power series ∑ cₙ (x - a)^n defines a continuous function on the open interval of convergence, or on all of ℝ when the radius is infinite.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem powerSeries_sum_continuous {a : ℝ} {c : ℕ → ℝ} {ρ : ℝ}
(hconv : ∀ x ∈ Set.Ioo (a - ρ) (a + ρ),
Summable fun n => c n * (x - a) ^ n) :
ContinuousOn (fun x => tsum fun n => c n * (x - a) ^ n) (Set.Ioo (a - ρ) (a + ρ))
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
@[simp] lemma abs_nat_succ_real (n : ℕ) : |(Nat.succ n : ℝ)| = (Nat.succ n : ℝ)
Corollary 6.2.12: For a convergent power series ∑_{n=0}^∞ cₙ (x - a)^n with radius of convergence ρ > 0, if I is the interval (a - ρ, a + ρ) (or ℝ when ρ = ∞) and f denotes the limit, then for every x ∈ I one has ∫ₐˣ f = ∑_{n=1}^∞ (c_{n-1} / n) (x - a)^n, and the radius of convergence of the latter series is at least ρ.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem integral_powerSeries_eq_series {a ρ : ℝ} {c : ℕ → ℝ}
(hρ : 0 < ρ)
(hconv : ∀ x ∈ Set.Ioo (a - ρ) (a + ρ),
Summable fun n => c n * (x - a) ^ n) :
∀ x ∈ Set.Ioo (a - ρ) (a + ρ),
(∫ t in a..x, tsum fun n => c n * (t - a) ^ n) =
tsum fun n => (c n) / (Nat.succ n : ℝ) * (x - a) ^ (Nat.succ n)
Corollary 6.2.13: For a convergent power series ∑_{n=0}^∞ cₙ (x - a)^n with radius of convergence ρ > 0, let I = (a - ρ, a + ρ). If f is its sum on I, then f is differentiable on I and f' (x) = ∑_{n=0}^∞ (n + 1) c_{n+1} (x - a)^n, whose radius of convergence is also ρ.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
theorem deriv_powerSeries_eq_series {a ρ : ℝ} {c : ℕ → ℝ}
(hconv : ∀ x ∈ Set.Ioo (a - ρ) (a + ρ),
Summable fun n => c n * (x - a) ^ n) :
∀ x ∈ Set.Ioo (a - ρ) (a + ρ),
DifferentiableAt ℝ (fun y : ℝ => tsum fun n => c n * (y - a) ^ n) x ∧
deriv (fun y : ℝ => tsum fun n => c n * (y - a) ^ n) x =
(tsum fun n => (Nat.succ n : ℝ) * c (Nat.succ n) * (x - a) ^ n) ∧
Summable fun n => (Nat.succ n : ℝ) * c (Nat.succ n) * (x - a) ^ n
Example 6.2.14: The power series ∑ x^n / n! has infinite radius of convergence, so it defines a function f(x) = ∑ x^n / n! on all real numbers. It satisfies f(0) = 1, differentiates term by term to give f' = f, and coincides with the usual exponential function.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
def example6_2_14_series (x : ℝ) : ℝ :=
∑' n : ℕ, x ^ n / (Nat.factorial n)
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_14_summable (x : ℝ) :
Summable fun n : ℕ => x ^ n / (Nat.factorial n)
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
@[simp] lemma example6_2_14_series_zero : example6_2_14_series 0 = 1
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_14_deriv (x : ℝ) :
HasDerivAt example6_2_14_series (example6_2_14_series x) x
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_14_series_eq_real_exp (x : ℝ) :
example6_2_14_series x = Real.exp x
Example 6.2.15: For x ∈ (-1, 1), the series ∑_{n=1}^∞ n x^n converges to x / (1 - x)^2, obtained by differentiating the geometric series and multiplying by x.
open Filter
open MeasureTheory
open BigOperators
open scoped Topology BigOperators
lemma example6_2_15_series_closed_form {x : ℝ} (hx : x ∈ Set.Ioo (-1 : ℝ) 1) :
(∑' n : ℕ, (Nat.succ n : ℝ) * x ^ (Nat.succ n)) = x / (1 - x) ^ 26.3 — Picard's Theorem
Lean authors: Zichen Wang, Zaiwen Wen.
Definition 6.3.1: For a set U ⊆ ℝ², a function F : U → ℝ is continuous at (x, y) ∈ U if for every sequence (xₙ, yₙ) of points of U with xₙ → x and yₙ → y, we have F (xₙ, yₙ) → F (x, y). It is continuous if it is continuous at every point of U.
open Filter
open scoped Topology
def sequentialContinuousAt (U : Set (ℝ × ℝ)) (F : U → ℝ) (p : U) : Prop :=
∀ s : ℕ → U,
Tendsto (fun n => (s n).1.1) atTop (𝓝 p.1.1) →
Tendsto (fun n => (s n).1.2) atTop (𝓝 p.1.2) →
Tendsto (fun n => F (s n)) atTop (𝓝 (F p))
Sequential continuity on U means sequential continuity at every point of U.
open Filter
open scoped Topology
def sequentialContinuous (U : Set (ℝ × ℝ)) (F : U → ℝ) : Prop :=
∀ p : U, sequentialContinuousAt U F p
-- Coordinatewise convergence for a sequence in a subtype of `ℝ × ℝ`.
open Filter
open scoped Topology
lemma tendsto_subtype_coord_iff {U : Set (ℝ × ℝ)} {p : U} {s : ℕ → U} :
Tendsto s atTop (𝓝 p) ↔
Tendsto (fun n => (s n).1.1) atTop (𝓝 p.1.1) ∧
Tendsto (fun n => (s n).1.2) atTop (𝓝 p.1.2)
On ℝ × ℝ, sequential continuity at a point agrees with the usual notion of continuity at that point.
open Filter
open scoped Topology
theorem sequentialContinuousAt_iff {U : Set (ℝ × ℝ)} {F : U → ℝ} {p : U} :
sequentialContinuousAt U F p ↔ ContinuousAt F p
Sequential continuity on U is equivalent to the usual notion of continuity.
open Filter
open scoped Topology
theorem sequentialContinuous_iff {U : Set (ℝ × ℝ)} {F : U → ℝ} :
sequentialContinuous U F ↔ Continuous F
Theorem 6.3.2 (Picard's theorem on existence and uniqueness). Let I = [a,b] and J = [c,d] be closed bounded intervals with interiors (a,b) and (c,d), and take (x₀, y₀) ∈ (a,b) × (c,d). If F : ℝ → ℝ → ℝ is continuous on I × J and Lipschitz in the second variable with constant L ≥ 0, meaning |F x y - F x z| ≤ L * |y - z| for all x ∈ I and y z ∈ J, then there is h > 0 with [x₀ - h, x₀ + h] ⊆ I and a unique differentiable function f : ℝ → ℝ with values in J satisfying f x₀ = y₀ and f' x = F x (f x) on [x₀ - h, x₀ + h].
open Filter
open scoped Topology
theorem picard_existence_uniqueness
{a b c d : ℝ} {x₀ : ℝ} (hx₀ : x₀ ∈ Set.Ioo a b)
{y₀ : ℝ} (hy₀ : y₀ ∈ Set.Ioo c d) (F : ℝ → ℝ → ℝ)
(hcont :
ContinuousOn (fun p : ℝ × ℝ => F p.1 p.2)
(Set.Icc a b ×ˢ Set.Icc c d))
(hLip :
∃ L, 0 ≤ L ∧ ∀ x ∈ Set.Icc a b, ∀ y ∈ Set.Icc c d, ∀ z ∈ Set.Icc c d,
|F x y - F x z| ≤ L * |y - z|) :
∃ h, 0 < h ∧ Set.Icc (x₀ - h) (x₀ + h) ⊆ Set.Icc a b ∧
∃ f : ℝ → ℝ,
ContinuousOn f (Set.Icc (x₀ - h) (x₀ + h)) ∧
(∀ x ∈ Set.Icc (x₀ - h) (x₀ + h), f x ∈ Set.Icc c d) ∧
(∀ x ∈ Set.Ioo (x₀ - h) (x₀ + h), HasDerivAt f (F x (f x)) x) ∧
f x₀ = y₀ ∧
∀ g : ℝ → ℝ,
ContinuousOn g (Set.Icc (x₀ - h) (x₀ + h)) →
(∀ x ∈ Set.Icc (x₀ - h) (x₀ + h), g x ∈ Set.Icc c d) →
(∀ x ∈ Set.Ioo (x₀ - h) (x₀ + h), HasDerivAt g (F x (g x)) x) →
g x₀ = y₀ →
Set.EqOn g f (Set.Icc (x₀ - h) (x₀ + h))
Example 6.3.3: Applying Picard's theorem to the initial value problem f' = f with f 0 = 1 (that is, F x y = y) produces some h > 0 with h < 1/2 and a function f : ℝ → ℝ defined on [-h, h] such that f' x = f x on that interval and f 0 = 1, and any other solution with the same initial value agrees with f on [-h, h]. The function extends globally as exp, so the exponential is the unique global solution with that initial value.
open Filter
open scoped Topology
lemma picard_exponential_example :
∃ h, 0 < h ∧ h < (1 / 2 : ℝ) ∧
∃ f : ℝ → ℝ,
(∀ x ∈ Set.Icc (-h) h, HasDerivAt f (f x) x) ∧ f 0 = 1 ∧
∀ g : ℝ → ℝ,
(∀ x ∈ Set.Icc (-h) h, HasDerivAt g (g x) x) ∧ g 0 = 1 →
Set.EqOn g f (Set.Icc (-h) h)
The exponential is the unique globally defined solution of the ODE f' = f satisfying f 0 = 1.
open Filter
open scoped Topology
lemma exp_unique_solution :
∃! f : ℝ → ℝ,
(∀ x : ℝ, HasDerivAt f (f x) x) ∧ f 0 = 1
open Filter
open scoped Topology
lemma one_sub_ne_zero_of_lt {x : ℝ} (hx : x < 1) : (1 - x) ≠ 0
open Filter
open scoped Topology
lemma hasDerivAt_inv_one_sub {x : ℝ} (hx : x < 1) :
HasDerivAt (fun x : ℝ => (1 - x)⁻¹) ((1 - x) ^ 2)⁻¹ x
Example 6.3.4: For the ODE f' = f ^ 2 with initial condition f 0 = 1, the solution is f x = (1 - x)⁻¹, defined on the interval (-∞, 1). The nonlinearity y ↦ y^2 is not globally Lipschitz, so the guaranteed existence interval from Picard's theorem shrinks as the initial value approaches x = 1.
open Filter
open scoped Topology
lemma quadratic_ode_example :
∃ f : ℝ → ℝ,
(∀ x, x < (1 : ℝ) → HasDerivAt f ((f x) ^ 2) x) ∧
f 0 = 1 ∧ ∀ x, x < (1 : ℝ) → f x = (1 - x)⁻¹
Example 6.3.5: For the initial value problem f' x = 2 * √|f x| with f 0 = 0, the right-hand side F x y = 2 * √|y| is continuous but not Lipschitz in y, so uniqueness can fail. The piecewise function f x = x^2 for x ≥ 0 and f x = -x^2 for x < 0 is a solution, while the zero function is another, so a solution exists but is not unique.
open Filter
open scoped Topology
lemma sqrt_abs_ode_nonunique :
∃ f g : ℝ → ℝ,
f ≠ g ∧ f 0 = 0 ∧ g 0 = 0 ∧
(∀ x, HasDerivAt f (2 * Real.sqrt (|f x|)) x) ∧
(∀ x, HasDerivAt g (2 * Real.sqrt (|g x|)) x)
Example 6.3.6: Let φ x = 0 when x is rational and φ x = 1 otherwise. The ODE y' = φ has no solution for any initial condition, since the right-hand side is discontinuous and derivatives have the Darboux property, so no differentiable function can have φ as its derivative.
open Filter
open scoped Topology
noncomputable def dirichletPhi : ℝ → ℝ
open Filter
open scoped Topology
lemma dirichletPhi_value_rational {x : ℝ}
(hx : x ∈ Set.range (fun r : ℚ => (r : ℝ))) :
dirichletPhi x = 0
open Filter
open scoped Topology
lemma dirichletPhi_value_irrational {x : ℝ}
(hx : x ∉ Set.range (fun r : ℚ => (r : ℝ))) :
dirichletPhi x = 1
open Filter
open scoped Topology
lemma deriv_eq_dirichletPhi_of_hasDerivAt {f : ℝ → ℝ} {x : ℝ}
(h : HasDerivAt f (dirichletPhi x) x) :
deriv f x = dirichletPhi x
open Filter
open scoped Topology
lemma exists_irrational_in_Ioo_0_1 : ∃ b, 0 < b ∧ b < 1 ∧ Irrational b
No differentiable function can solve the discontinuous ODE y' = φ where φ is the Dirichlet function. In particular, there is no solution satisfying any prescribed initial value.
open Filter
open scoped Topology
lemma no_solution_dirichlet_ode :
¬ ∃ f : ℝ → ℝ, Differentiable ℝ f ∧ ∀ x, HasDerivAt f (dirichletPhi x) x