Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

Commit dac1da3

Browse files
committed
feat(analysis/special_functions/bernstein): Weierstrass' theorem: polynomials are dense in C([0,1]) (#6497)
# Bernstein approximations and Weierstrass' theorem We prove that the Bernstein approximations ``` ∑ k : fin (n+1), f (k/n : ℝ) * n.choose k * x^k * (1-x)^(n-k) ``` for a continuous function `f : C([0,1], ℝ)` converge uniformly to `f` as `n` tends to infinity. Our proof follows Richard Beals' *Analysis, an introduction*, §7D. The original proof, due to Bernstein in 1912, is probabilistic, and relies on Bernoulli's theorem, which gives bounds for how quickly the observed frequencies in a Bernoulli trial approach the underlying probability. The proof here does not directly rely on Bernoulli's theorem, but can also be given a probabilistic account. * Consider a weighted coin which with probability `x` produces heads, and with probability `1-x` produces tails. * The value of `bernstein n k x` is the probability that such a coin gives exactly `k` heads in a sequence of `n` tosses. * If such an appearance of `k` heads results in a payoff of `f(k / n)`, the `n`-th Bernstein approximation for `f` evaluated at `x` is the expected payoff. * The main estimate in the proof bounds the probability that the observed frequency of heads differs from `x` by more than some `δ`, obtaining a bound of `(4 * n * δ^2)⁻¹`, irrespective of `x`. * This ensures that for `n` large, the Bernstein approximation is (uniformly) close to the payoff function `f`. (You don't need to think in these terms to follow the proof below: it's a giant `calc` block!) This result proves Weierstrass' theorem that polynomials are dense in `C([0,1], ℝ)`, although we defer an abstract statement of this until later. Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
1 parent f2984d5 commit dac1da3

File tree

11 files changed

+449
-8
lines changed

11 files changed

+449
-8
lines changed

docs/references.bib

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,23 @@ @Book{ axler2015
8080
publisher = {Springer}
8181
}
8282

83+
@Book{ beals2004,
84+
author = {Richard Beals},
85+
title = {Analysis. An introduction},
86+
publisher = {Cambridge University Press},
87+
isbn = {0521600472},
88+
year = {2004},
89+
}
90+
91+
@article{ bernstein1912,
92+
author = {Bernstein, S.},
93+
year = {1912},
94+
title = {Démonstration du théorème de Weierstrass fondée sur le calcul des probabilités},
95+
journal = {Comm. Kharkov Math. Soc.},
96+
volume = {13},
97+
number = {1–2},
98+
}
99+
83100
@Book{ borceux-vol1,
84101
title = {Handbook of Categorical Algebra: Volume 1, Basic Category
85102
Theory},

src/algebra/big_operators/order.lean

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ end
4343

4444
/-- Let `{x | p x}` be an additive subsemigroup of an additive commutative monoid `M`. Let `f : M →
4545
N` be a map subadditive on `{x | p x}`, i.e., `p x → p y → f (x + y) ≤ f x + f y`. Let `g i`, `i ∈
46-
s`, be a nonempty finite family of elements of `M` such that `∀ i ∈ s, p (g i)`. Then
46+
s`, be a nonempty finite family of elements of `M` such that `∀ i ∈ s, p (g i)`. Then
4747
`f (∑ i in s, g i) ≤ ∏ i in s, f (g i)`. -/
4848
add_decl_doc le_sum_nonempty_of_subadditive_on_pred
4949

@@ -136,6 +136,11 @@ calc (∏ i in s, f i) ≤ (∏ i in t \ s, f i) * (∏ i in s, f i) :
136136
lemma prod_mono_set_of_one_le' (hf : ∀ x, 1 ≤ f x) : monotone (λ s, ∏ x in s, f x) :=
137137
λ s t hst, prod_le_prod_of_subset_of_one_le' hst $ λ x _ _, hf x
138138

139+
@[to_additive sum_le_univ_sum_of_nonneg]
140+
lemma prod_le_univ_prod_of_one_le' [fintype ι] {s : finset ι} (w : ∀ x, 1 ≤ f x) :
141+
∏ x in s, f x ≤ ∏ x, f x :=
142+
prod_le_prod_of_subset_of_one_le' (subset_univ s) (λ a _ _, w a)
143+
139144
@[to_additive sum_eq_zero_iff_of_nonneg]
140145
lemma prod_eq_one_iff_of_one_le' : (∀ i ∈ s, 1 ≤ f i) → (∏ i in s, f i = 1 ↔ ∀ i ∈ s, f i = 1) :=
141146
begin

src/algebra/group_power/basic.lean

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -690,11 +690,11 @@ by simpa only [sqr_abs] using pow_lt_pow_of_lt_left h (abs_nonneg x) (1:ℕ).suc
690690
theorem sqr_lt_sqr' (h1 : -y < x) (h2 : x < y) : x ^ 2 < y ^ 2 :=
691691
sqr_lt_sqr (abs_lt.mpr ⟨h1, h2⟩)
692692

693-
theorem sqr_le_sqr (h : abs x ≤ y) : x ^ 2 ≤ y ^ 2 :=
693+
theorem sqr_le_sqr (h : abs x ≤ abs y) : x ^ 2 ≤ y ^ 2 :=
694694
by simpa only [sqr_abs] using pow_le_pow_of_le_left (abs_nonneg x) h 2
695695

696696
theorem sqr_le_sqr' (h1 : -y ≤ x) (h2 : x ≤ y) : x ^ 2 ≤ y ^ 2 :=
697-
sqr_le_sqr (abs_le.mpr ⟨h1, h2⟩)
697+
sqr_le_sqr (le_trans (abs_le.mpr ⟨h1, h2⟩) (le_abs_self _))
698698

699699
theorem abs_lt_abs_of_sqr_lt_sqr (h : x^2 < y^2) : abs x < abs y :=
700700
lt_of_pow_lt_pow 2 (abs_nonneg y) $ by rwa [← sqr_abs x, ← sqr_abs y] at h

src/algebra/group_with_zero/basic.lean

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,14 @@ calc a⁻¹ * a = (a⁻¹ * a) * a⁻¹ * a⁻¹⁻¹ : by simp [inv_ne_zero h]
392392
... = a⁻¹ * a⁻¹⁻¹ : by simp [h]
393393
... = 1 : by simp [inv_ne_zero h]
394394

395+
lemma group_with_zero.mul_left_injective {x : G₀} (h : x ≠ 0) :
396+
function.injective (λ y, x * y) :=
397+
λ y y' w, by simpa only [←mul_assoc, inv_mul_cancel h, one_mul] using congr_arg (λ y, x⁻¹ * y) w
398+
399+
lemma group_with_zero.mul_right_injective {x : G₀} (h : x ≠ 0) :
400+
function.injective (λ y, y * x) :=
401+
λ y y' w, by simpa only [mul_assoc, mul_inv_cancel h, mul_one] using congr_arg (λ y, y * x⁻¹) w
402+
395403
@[simp] lemma inv_mul_cancel_right' {b : G₀} (h : b ≠ 0) (a : G₀) :
396404
(a * b⁻¹) * b = a :=
397405
calc (a * b⁻¹) * b = a * (b⁻¹ * b) : mul_assoc _ _ _

src/algebra/group_with_zero/power.lean

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,17 @@ lemma monoid_with_zero_hom.map_fpow {G₀ G₀' : Type*} [group_with_zero G₀]
267267
∀ n : ℤ, f (x ^ n) = f x ^ n
268268
| (n : ℕ) := f.to_monoid_hom.map_pow x n
269269
| -[1+n] := (f.map_inv' _).trans $ congr_arg _ $ f.to_monoid_hom.map_pow x _
270+
271+
-- I haven't been able to find a better home for this:
272+
-- it belongs with other lemmas on `linear_ordered_field`, but
273+
-- we need to wait until `fpow` has been defined in this file.
274+
section
275+
variables {R : Type*} [linear_ordered_field R] {a : R}
276+
277+
lemma pow_minus_two_nonneg : 0 ≤ a^(-2 : ℤ) :=
278+
begin
279+
simp only [inv_nonneg, fpow_neg],
280+
apply pow_two_nonneg,
281+
end
282+
283+
end

src/algebra/ordered_monoid.lean

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,9 @@ instance canonically_ordered_monoid.has_exists_mul_of_le (α : Type u)
820820

821821
end canonically_ordered_monoid
822822

823+
lemma pos_of_gt {M : Type*} [canonically_ordered_add_monoid M] {n m : M} (h : n < m) : 0 < m :=
824+
lt_of_le_of_lt (zero_le _) h
825+
823826
/-- A canonically linear-ordered additive monoid is a canonically ordered additive monoid
824827
whose ordering is a linear order. -/
825828
@[protect_proj, ancestor canonically_ordered_add_monoid linear_order]

src/algebra/ordered_ring.lean

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ calc
8282
a * b ≤ c * b : mul_le_mul_of_nonneg_right hac nn_b
8383
... ≤ c * d : mul_le_mul_of_nonneg_left hbd nn_c
8484

85+
lemma mul_nonneg_le_one_le {α : Type*} [ordered_semiring α] {a b c : α}
86+
(h₁ : 0 ≤ c) (h₂ : a ≤ c) (h₃ : 0 ≤ b) (h₄ : b ≤ 1) : a * b ≤ c :=
87+
by simpa only [mul_one] using mul_le_mul h₂ h₄ h₃ h₁
88+
8589
lemma mul_nonneg (ha : 0 ≤ a) (hb : 0 ≤ b) : 0 ≤ a * b :=
8690
have h : 0 * b ≤ a * b, from mul_le_mul_of_nonneg_right ha hb,
8791
by rwa [zero_mul] at h

0 commit comments

Comments
 (0)