Weierstrass Approximation Theorem
Statement
Let be continuous. For every there exists a polynomial such that
Equivalently, the polynomials are dense in with the uniform norm .
Visualization
Bernstein polynomials approximate on uniformly. Explicitly, reparameterizing to with :
| | | | | | |-----|------------|-------|-------|--------| | 0.0 | 0.000 | 0.375 | 0.273 | 0.196 | | 0.2 | 0.200 | 0.261 | 0.231 | 0.214 | | 0.5 | 0.500 | 0.500 | 0.500 | 0.500 | | 0.8 | 0.800 | 0.761 | 0.781 | 0.791 | | 1.0 | 1.000 | 1.000 | 1.000 | 1.000 |
(Values computed for on , so .)
The uniform error for Lipschitz ; higher-degree polynomials converge to everywhere.
Approximation of |x| by polynomials on [-1,1]
1 |* * ← |x|
| *\ /*
| *\ /* ← B₄ (smoothed corners)
| *\ /* ← B₈
0 |----*------ ← x=0, f(0)=0, B_n(0)→0
| /* \*
| / \* ← converging to |x|
-1 1
Proof Sketch
- Bernstein polynomials: For define .
- Probabilistic identity: where . By the law of large numbers , so .
- Uniform convergence: Continuity on the compact set implies uniform continuity. The estimate (where is the modulus of continuity) gives uniform convergence by choosing .
- General : Apply the result after the affine reparameterization .
Connections
- Extreme Value TheoremExtreme Value TheoremA continuous function on a compact set attains its maximum and minimum valuesRead more → — is uniformly continuous on (since it is compact) — this is the key regularity that makes the Bernstein approximation converge
- Heine-Borel Theorem — the compact domain is essential; the theorem fails for all of (polynomials cannot uniformly approximate )
- Intermediate Value TheoremIntermediate Value TheoremA continuous function on a closed interval hits every value between its endpointsRead more → — the density of polynomials in is the analytic analogue of the IVT: every continuous function is a limit of explicit elementary ones
- Stone–Weierstrass TheoremStone–Weierstrass TheoremA subalgebra of continuous functions on a compact space that separates points is dense in the sup-normRead more → — the functional-analysis generalization: any subalgebra of that separates points and contains constants is dense; Weierstrass is the case where the subalgebra is on
Lean4 Proof
import Mathlib.Topology.ContinuousMap.Weierstrass
/-- Weierstrass Approximation Theorem: polynomials are dense in C([a,b]).
Wraps Mathlib's `polynomialFunctions_closure_eq_top`. -/
theorem weierstrass_approximation (a b : ℝ) :
(polynomialFunctions (Set.Icc a b)).topologicalClosure = ⊤ :=
polynomialFunctions_closure_eq_top a b