Post · 7 min read· pp. 89–96

Stone Weierstrass Theorem

Let XX be a topological space and let C(X,R)C(X,\mathbb{R}) denote the set of all continous functions f:X→Rf:X\to\mathbb{R}.

‍

A family F\mathscr{F} of functions is an algebra if for every f,g∈Ff,g\in\mathscr{F} and any c∈Rc\in \mathbb{R}, we have f+g,fg,cf∈Ff+g,fg, cf\in\mathscr{F}.

  • ex: C([a,b],R)C([a,b],\mathbb{R}) is an algebra for any closed interval [a,b]⊂R[a,b]\subset\mathbb{R}.

An algbera A\mathscr{A} of functions f:X→Rf:X\to \mathbb{R} separates points if for every x,y∈Xx,y\in X there is a function f∈Af\in \mathscr{A} such that f(x)≠f(y)f(x)\neq f(y).

  • ex: Let P⊂C([a,b],R)\mathscr{P}\subset C([a,b],\mathbb{R}) denote the set of polynomials on [a,b][a,b]. Then P\mathscr{P} is a subalgebra which separates points since it contains the polynomial f(x)=xf(x)=x.

An algbera A\mathscr{A} of functions f:X→Rf:X\to \mathbb{R} vanishes nowhere if for every x∈Xx\in X there is a function f∈Af\in\mathscr{A} such that f(x)≠0f(x)\neq 0.

  • ex: Let P⊂C([a,b],R)\mathscr{P}\subset C([a,b], \mathbb{R}) denote the set of polynomials on [a,b][a,b]. Then P\mathscr{P} is a subalgebra that separates points since it contains the polynomial f(x)=xf(x)=x.

‍

‍

These definitions come together in today's theorem:

‍

‍

In English, this just says that any continuous, real-valued function on a compact set can be approximated (with respect to the supremum norm) by some function in your algebra A\mathscr{A}. In other words, choose any continuous function f:X→Rf:X\to \mathbb{R} where XX is compact. Then for every ϵ>0\epsilon >0, we can find a function g∈Ag\in \mathscr{A} such that

∥f−g∥=sup⁡x∈X{∣f(x)−g(x)∣}<ϵ.\|f-g\|=\sup_{x\in X}\{|f(x)-g(x)|\}<\epsilon.
Here's an example: take X=[a,b]X=[a,b] to be a closed interval in R\mathbb{R} and let A\mathscr{A} be the set of all polynomials on [a,b][a,b]. Then for any continuous f:[a,b]→Rf:[a,b]\to\mathbb{R} and any ϵ>0\epsilon>0, we can find a polynomial p:[a,b]→Rp:[a,b]\to\mathbb{R} such that ∥f−p∥<ϵ\|f-p\|< \epsilon. This is the familar Weierstrass Approximation Theorem! Any continous function on a closed interval can be approximated - as close as you want - by a polynomial. The Stone Weierstrass Theorem says that this result is still true if we replace [a,b][a,b] by any compact set XX, and if we replace the set of polynomials by any subalgebra of C(X,R)C(X,\mathbb{R}) which separates points and vanishes nowhere.

Now you might ask, "Why do we need XX to be compact?" and "Why must A\mathscr{A} separate points and vanish nowhere?" Today we'll see why these hypotheses are necessary. Next time we'll work through an exercise from Rudin's Principal of Mathematical Analysis (a.k.a. "Baby Rudin") to see the theorem in action.

Why do we need compactness?

‍

‍

‍

The best way to answer this question is to look at a counterexample. So let's consider X=RX=\mathbb{R} and let A\mathscr{A} be the subalgebra of all poynomials on R\mathbb{R}. Then A\mathscr{A} separates points and vanishes nowhere, but XX is not compact. In this case, the theorem fails since the function f(x)=exf(x)=e^x cannot be approximated by any polynomial! This is because any polynomial pp is dominated by its largest term, say xnx^n, and exe^x tends to ∞\infty much faster than does xnx^n (even if nn is very large). As a result, the distance between exe^x and xnx^n cannot be made arbitrarily small as xx ranges over all of R\mathbb{R}.

‍

‍

‍

But if we restrict ourselves to a closed and bounded interval, the smaller terms in pp have more weight, and this allows us to approximate exe^x by p(x)p(x) with as much accuracy as we want. And this is exactly what we've all done in undergraduate calculus! You remember those problems. The nnth degree Taylor polynomial of exe^x centered at 0 is  

ex≈∑k=0nxkk!,e^x\approx \sum_{k=0}^n\frac{x^k}{k!},
and a typical homework question might've been something like, "For what values of xx is this approximation accurate to within 0.00001?". The answer would be ∣x∣<δ|x|<\delta for some constant δ\delta which you could find using Taylor's Inequality. This [−δ,δ][-\delta,\delta] is precisely the compact set we need to restrict to in order to obtain a good approximation.

‍

Why must the algebra separate points?

Again we'll consider a counterexample. This time let X=[a,b]⊂RX=[a,b]\subset\mathbb{R} and take A\mathscr{A} to be the collection of all polynomials p:[a,b]→Rp:[a,b]\to\mathbb{R} such that p(a)=p(b)p(a)=p(b). It's easy to check that this forms an algebra, and it clearly does not separate points. To see where the Stone Weierstrass Theorem fails, simply choose any continuous function f:[a,b]→Rf:[a,b]\to\mathbb{R} such that f(a),f(b)≠p(a),p(b)f(a),f(b)\neq p(a),p(b). Then we cannot approximate ff by any polynomial p∈Ap\in\mathscr{A} because we can always find an ϵ\epsilon such that  ∥f−p∥≥ϵ.\|f-p\|\geq \epsilon. In fact, ϵ=∣f(b)−f(a)∣/2\epsilon=|f(b)-f(a)|/2 does the job.

‍

This isn't too hard to show. Let M=max⁡{∣f(a)−p(a)∣,∣f(b)−p(b)∣}M=\max\{|f(a)-p(a)|,|f(b)-p(b)|\} and observe from the picture above that ∥f−p∥≥M\|f-p\|\geq M. We want to show*

∥f−p∥≥M≥∣f(b)−f(a)∣2.\|f-p\|\geq M\geq \frac{|f(b)-f(a)|}{2}.
To see this, let mm denote the common value p(a)=p(b)p(a)=p(b), assume WLOG f(a)≤f(b)f(a)\leq f(b), and suppose f(a)<m<f(b)f(a)< m < f(b). If, for instance, m=∣f(a)+f(b)∣/2m=|f(a)+f(b)|/2, then M=∣f(a)+f(b)∣/2M=|f(a)+f(b)|/2 and the claim is true.

Otherwise, if, say, mm lies in-between ∣f(a)+f(b)∣/2|f(a)+f(b)|/2 and f(b)f(b) (see insert on the left), then M=∣f(a)−m∣M=|f(a)-m| which is greater than ∣f(a)−f(b)∣/2|f(a)-f(b)|/2 as claimed. And if m<f(a)m< f(a) or m>f(b)m>f(b), then MM is even larger and again the claim holds.

‍

‍

‍

Alternatively we could also choose A\mathscr{A} to be the set of constant functions on [a,b][a,b] (this definitley does not separate points). Then, for example, the function f(x)=exf(x)=e^x can't be approximated by any constant cc since ∥ex−c∥\|e^x-c\| is bounded below by ∣eb−ea∣2\frac{|e^b-e^a|}{2} (using the same argument as above).

‍

‍

‍

Why must the algebra vanish nowhere?

‍

‍

‍

Suppose X=[0,1]X=[0,1] and let's take A\mathscr{A} to be the set of all continuous functions p:[0,1]→Rp:[0,1]\to\mathbb{R} such that p(0)=0p(0)=0 (one easily checks that this is an algebra). Then any continuous function ff which is not zero at zero can't be approximated by any p∈Ap\in\mathscr{A}! The supremum of ∣f(x)−p(x)∣|f(x)-p(x)| for xx in [0,1][0,1] is bounded below by ∣f(0)−p(0)∣=∣f(0)∣.|f(0)-p(0)|=|f(0)|.  For instance take f(x)=x+3f(x)=x+3. Then ∥f−p∥\|f-p\| is at least 3.

‍

‍

So there you go! Each of the conditions in the Stone Weierstrass Theorem is indeed necessary. Next week we'll use the theorem to solve this exercise from Baby Rudin:

  • (Rudin, PMA #7.20) If ff is continuous on [0,1][0,1] and if ∫01f(x)xn  dx=0\int_0^1f(x)x^n\;dx=0 for all n=0,1,2,…,n=0,1,2,\ldots, prove that f(x)=0f(x)=0 on [0,1][0,1].

‍

‍

Footnote:

* We don't want to let M=max⁡{∣f(a)−p(a)∣,∣f(b)−p(b)∣}M=\max\{|f(a)-p(a)|,|f(b)-p(b)|\} be our ϵ\epsilon since we need ϵ\epsilon to be independent of the polynomial pp. (The negation of the Stone-Weierstrass Theorem says that if XX is not compact or if A\mathscr{A} is an algebra which does not separate points or does not vanish nowhere, then there exists a function f∈C(X,R)f\in C(X,\mathbb{R}) and there exists ϵ>0\epsilon>0 such that ∥f−p∥≥ϵ\|f-p\|\geq \epsilon for all p∈Ap\in\mathscr{A}. The wording implies that ϵ\epsilon depends on ff only.)