Skip to main content

Section 11.7 The Stone–Weierstrass theorem

Note: 3 lectures

Subsection 11.7.1 Weierstrass approximation

Perhaps surprisingly, even a very badly behaved continuous function is a uniform limit of polynomials. And we cannot really get any “nicer” functions than polynomials. The idea of the proof is a very common approximation or “smoothing” idea (convolution with an approximate delta function) that has applications far beyond pure mathematics.


For \(x \in [0,1]\) define

\begin{equation*} g(x) := f\bigl((b-a)x+a\bigr)-f(a) - x\bigl(f(b)-f(a)\bigr) . \end{equation*}

If we prove the theorem for \(g\) and find the sequence \(\{ p_n \}\) for \(g\text{,}\) it is proved for \(f\) as we simply composed with an invertible affine function and added an affine function to \(f\text{:}\) We reverse the process and apply that to our \(p_n\text{,}\) to obtain polynomials approximating \(f\text{.}\)

The function \(g\) is defined on \([0,1]\) and \(g(0)=g(1)=0\text{.}\) For simplicity, assume that \(g\) is defined on the whole real line by letting \(g(x) := 0\) if \(x < 0\) or \(x > 1\text{.}\) This extended \(g\) is continuous.


\begin{equation*} c_n := {\left( \int_{-1}^1 {(1-x^2)}^n\,dx \right)}^{-1} , \qquad q_n(x) := c_n (1-x^2)^n . \end{equation*}

The choice of \(c_n\) is so that \(\int_{-1}^1 q_n(x)\,dx = 1\text{.}\) See Figure 11.8.

Figure 11.8. Plot of the approximate delta functions \(q_n\) on \([-1,1]\) for \(n=5,10,15,20,\ldots,100\) with higher \(n\) in lighter shade.

The functions \(q_n\) are peaks around 0 (ignoring what happens outside of \([-1,1]\)) that get narrower and taller as \(n\) increases, while the area underneath is always 1. A classic approximation idea is to do a convolution integral with peaks like this: For for \(x \in [0,1]\text{,}\) let

\begin{equation*} p_n(x) := \int_{0}^1 g(t)q_n(x-t) \,dt \quad \left( = \int_{-\infty}^\infty g(t)q_n(x-t) \,dt \right) . \end{equation*}

The idea of this convolution is that we do a “weighted average” of the function \(g\) around the point \(x\) using \(q_n\) as the weight. See Figure 11.9.

Figure 11.9. For \(x=0.3\text{,}\) the plot of \(q_{100}(x-t)\) (light gray peak centered at \(x\)), some continuous function \(g(t)\) (the jagged line) and the product \(g(t)q_{100}(x-t)\) (the bold line).

As \(q_n\) is a narrow peak, the integral mostly sees the values of \(g\) that are close to \(x\) and it does the weighted average of them. When the peak gets narrower, we compute this average closer to \(x\) and we expect the result to get closer to the value of \(g(x)\text{.}\) Really we are approximating what is called a delta function 1  (don't worry if you have not heard of this concept), and functions like \(q_n\) are often called approximate delta functions. We could do this with any set of polynomials that look like narrower and narrower peaks near zero. These just happen to be the simplest ones. We only need this behavior on \([-1,1]\) as the convolution sees nothing further than this as \(g\) is zero outside \([0,1]\text{.}\)

Because \(q_n\) is a polynomial we write

\begin{equation*} q_n(x-t) = a_0(t) + a_1(t)\,x + \cdots + a_{2n}(t)\, x^{2n} , \end{equation*}

where \(a_k(t)\) are polynomials in \(t\text{,}\) in particular continuous and hence integrable functions. So

\begin{equation*} \begin{split} p_n(x) & = \int_{0}^1 g(t)q_n(x-t) \,dt \\ &= \left( \int_0^1 g(t) a_0(t)\,dt \right) + \left( \int_0^1 g(t) a_1(t)\,dt \right) \, x + \cdots + \left( \int_0^1 g(t) a_{2n}(t)\,dt \right) \, x^{2n} . \end{split} \end{equation*}

In other words, \(p_n\) is a polynomial 2  in \(x\text{.}\) If \(g(t)\) is real-valued, then the functions \(g(t)a_j(t)\) are real-valued and hence \(p_n\) has real coefficients, proving the “furthermore” part of the theorem.

We still need to prove that \(\{ p_n \}\) converges to \(g\text{.}\) First let us get some handle on the size of \(c_n\text{.}\) For \(x \in [0,1]\text{,}\) we have that \(1-x \leq 1-x^2\text{.}\) We estimate

\begin{equation*} \begin{split} c_n^{-1} = \int_{-1}^1 {(1-x^2)}^n \, dx & = 2\int_0^1 {(1-x^2)}^n \, dx \\ & \geq 2\int_0^{1} {(1-x)}^n \, dx = \frac{2}{n+1} . \end{split} \end{equation*}

So \(c_n \leq \frac{n+1}{2} \leq n\text{.}\)

Let us see how small \(q_n\) is, if we ignore some small interval around the origin, which is where the peak is. Given any \(\delta > 0\text{,}\) \(\delta < 1\text{,}\) for \(x\) such that \(\delta \leq \sabs{x} \leq 1\text{,}\) we have

\begin{equation*} q_n(x) \leq c_n {(1-\delta^2)}^n \leq n{(1-\delta^2)}^n , \end{equation*}

because \(q_n\) is increasing on \([-1,0]\) and decreasing on \([0,1]\text{.}\) By the ratio test, \(n{(1-\delta^2)}^n\) goes to 0 as \(n\) goes to infinity.

The function \(q_n\) is even, \(q_n(t) = q_n(-t)\text{,}\) and \(g\) is zero outside of \([0,1]\text{.}\) So for \(x \in [0,1]\text{,}\)

\begin{equation*} p_n(x) = \int_{0}^1 g(t)q_n(x-t) \, dt = \int_{-x}^{1-x} g(x+t)q_n(-t) \, dt = \int_{-1}^{1} g(x+t)q_n(t) \, dt . \end{equation*}

Let \(\epsilon > 0\) be given. As \([-1,2]\) is compact and \(g\) is continuous on \([-1,2]\text{,}\) we have that \(g\) is uniformly continuous. Pick \(0 < \delta < 1\) such that if \(\sabs{x-y} < \delta\) (and \(x,y \in [-1,2]\)), then

\begin{equation*} \sabs{g(x)-g(y)} < \frac{\epsilon}{2} . \end{equation*}

Let \(M\) be such that \(\sabs{g(x)} \leq M\) for all \(x\text{.}\) Let \(N\) be such that for all \(n \geq N\text{,}\)

\begin{equation*} 4M n{(1-\delta^2)}^n < \frac{\epsilon}{2} . \end{equation*}

Note that \(\int_{-1}^1 q_n(t) \, dt = 1\) and \(q_n(t) \geq 0\) on \([-1,1]\text{.}\) So for \(n \geq N\) and every \(x \in [0,1]\text{,}\)

\begin{equation*} \begin{split} \sabs{p_n(x)-g(x)} & = \abs{\int_{-1}^1 g(x+t)q_n(t) \, dt -g(x)\int_{-1}^1 q_n(t) \, dt} \\ & = \abs{\int_{-1}^1 \bigl(g(x+t)-g(x)\bigr)q_n(t) \, dt} \\ & \leq \int_{-1}^1 \sabs{g(x+t)-g(x)} q_n(t) \, dt \\ & = \int_{-1}^{-\delta} \sabs{g(x+t)-g(x)} q_n(t) \, dt \quad + \int_{-\delta}^{\delta} \sabs{g(x+t)-g(x)} q_n(t) \, dt \\ & \phantom{\leq} + \int_{\delta}^1 \sabs{g(x+t)-g(x)} q_n(t) \, dt \\ & \leq 2M \int_{-1}^{-\delta} q_n(t) \, dt \quad + \quad \frac{\epsilon}{2} \int_{-\delta}^{\delta} q_n(t) \, dt \quad + \quad 2M \int_{\delta}^1 q_n(t) \, dt \\ & \leq 2M n{(1-\delta^2)}^n(1-\delta) \quad + \quad \frac{\epsilon}{2} \quad + \quad 2M n{(1-\delta^2)}^n(1-\delta) \\ & < 4M n{(1-\delta^2)}^n + \frac{\epsilon}{2} < \epsilon . \qedhere \end{split} \end{equation*}

A convolution often inherits some property of the functions we are convolving. In our case the convolution \(p_n\) inherited the property of being a polynomial from \(q_n\text{.}\) The same idea of the proof is often used to get other properties. If \(q_n\) or \(g\) is infinitely differentiable, so is \(p_n\text{.}\) If \(q_n\) or \(g\) is a solution to a linear differential equation, so is \(p_n\text{.}\) Etc.

Let us note an immediate application of the Weierstrass theorem. We have already seen that countable dense subsets can be very useful.


Without loss of generality suppose that we are dealing with \(C([a,b],\R)\) (why?). The real polynomials are dense in \(C([a,b],\R)\) by Weierstrass. If we show that every real polynomial can be approximated by polynomials with rational coefficients, we are done. This is because there are only countably many rational numbers and so there are only countably many polynomials with rational coefficients (a countable union of countable sets is still countable).

Further without loss of generality, suppose \([a,b]=[0,1]\text{.}\) Let

\begin{equation*} p(x) := \sum_{k=0}^n a_k\, x^k \end{equation*}

be a polynomial of degree \(n\) where \(a_k \in \R\text{.}\) Given \(\epsilon > 0\text{,}\) pick \(b_k \in \Q\) such that \(\sabs{a_k-b_k} < \frac{\epsilon}{n+1}\text{.}\) Then if we let

\begin{equation*} q(x) := \sum_{k=0}^n b_k \, x^k , \end{equation*}

we have

\begin{equation*} \sabs{p(x)-q(x)} = \abs{\sum_{k=0}^n (a_k-b_k) x^k} \leq \sum_{k=0}^n \sabs{a_k-b_k} x^k \leq \sum_{k=0}^n \sabs{a_k-b_k} < \sum_{k=0}^n \frac{\epsilon}{n+1} = \epsilon . \qedhere \end{equation*}

Remark 11.7.3.

While we will not prove this, the corollary above implies that \(C([a,b],\C)\) has the same cardinality as \(\R\text{,}\) which may be a bit surprising. The set of all functions \([a,b] \to \C\) has cardinality that is strictly greater than the cardinality of \(\R\text{,}\) it has the cardinality of the power set of \(\R\text{.}\) So the set of continuous functions is a very tiny subset of the set of all functions.

Warning! The fact that every continuous function \(f \colon [-1,1] \to \C\) (or any interval \([a,b]\)) can be uniformly approximated by polynomials

\begin{equation*} \sum_{k=0}^n a_k\, x^k \end{equation*}

does not mean that every continuous \(f\) is analytic, that is, equal to a power series

\begin{equation*} \sum_{k=0}^\infty c_k\, x^k . \end{equation*}

An analytic function is infinitely differentiable, so the function \(\sabs{x}\) provides a counterexample.

The key distinction is that the polynomials coming from the Weierstrass theorem are not the partial sums of a power series. For each one, the coefficients \(a_k\) above can be completely different—they do not need to come from a single sequence \(\{ c_k \}\text{.}\)

Subsection 11.7.2 Stone–Weierstrass approximation

We want to abstract away what is not really necessary and prove a general version of the Weierstrass theorem. The polynomials are dense in the space of continuous functions on a compact interval. What other kind of families of functions are also dense? And if the domain is an arbitrary metric space, then we no longer have polynomials to begin with.

The theorem we will prove is the Stone–Weierstrass theorem 3 . First, we need a very special case of the Weierstrass theorem though.


As \(f(x) := \sabs{x}\) is continuous and real-valued on \([-a,a]\text{,}\) the Weierstrass theorem gives a sequence of real polynomials \(\{ \widetilde{p}_n \}\) that converges to \(f\) uniformly on \([-a,a]\text{.}\) Let

\begin{equation*} p_n(x) := \widetilde{p}_n(x) - \widetilde{p}_n(0) . \end{equation*}

Obviously \(p_n(0) = 0\text{.}\)

Given \(\epsilon > 0\text{,}\) let \(N\) be such that for \(n \geq N\text{,}\) we have \(\bigl\lvert\widetilde{p}_n(x)-\sabs{x}\big\rvert < \nicefrac{\epsilon}{2}\) for all \(x \in [-a,a]\text{.}\) In particular, \(\sabs{\widetilde{p}_n(0)} < \nicefrac{\epsilon}{2}\text{.}\) Then for \(n \geq N\text{,}\)

\begin{equation*} \bigl\lvert p_n(x)-\sabs{x} \bigr\rvert = \bigl\lvert \widetilde{p}_n(x) - \widetilde{p}_n(0) - \sabs{x} \bigr\rvert \leq \bigl\lvert \widetilde{p}_n(x) - \sabs{x} \bigr\rvert + \sabs{\widetilde{p}_n(0)} < \nicefrac{\epsilon}{2} + \nicefrac{\epsilon}{2} = \epsilon . \qedhere \end{equation*}

Generalizing the corollary, we can always make the polynomials from the Weierstrass theorem be equal to our target function at one point, not just for \(\sabs{x}\text{,}\) but that's the one we will need.

Definition 11.7.5.

A set \(\sA\) of complex-valued functions \(f \colon X \to \C\) is said to be an algebra (sometimes complex algebra or algebra over \(\C\)) if for all \(f, g \in \sA\) and \(c \in \C\text{,}\) we have

  1. \(f+g \in \sA\text{.}\)

  2. \(fg \in \sA\text{.}\)

  3. \(cg \in \sA\text{.}\)

A real algebra or an algebra over \(\R\) is a set of real-valued functions that satisfies the three properties above for \(c \in \R\text{.}\)

We are interested in the case when \(X\) is a compact metric space. Then \(C(X,\C)\) and \(C(X,\R)\) are metric spaces. Given a set \(\sA \subset C(X,\C)\text{,}\) the set of all uniform limits is the metric space closure \(\widebar{\sA}\text{.}\) When we talk about closure of an algebra from now on we mean the closure in \(C(X,\C)\) as a metric space. Same for \(C(X,\R)\text{.}\)

The set \(\sP\) of all polynomials is an algebra in \(C([a,b],\C)\text{,}\) and we have shown that its closure \(\widebar{\sP} = C([a,b],\C)\text{.}\) That is, it is dense. That is the sort of result that we wish to prove.

We leave the following proposition as an exercise.

Let us distill the properties of polynomials that are sufficient for an approximation theorem.

Definition 11.7.7.

Let \(\sA\) be a set of complex-valued functions defined on a set \(X\text{.}\)

  1. \(\sA\) separates points if for every \(x,y \in X\text{,}\) with \(x \not= y\) there is a function \(f \in \sA\) such that \(f(x) \not= f(y)\text{.}\)

  2. \(\sA\) vanishes at no point if for every \(x \in X\) there is an \(f \in \sA\) such that \(f(x) \not= 0\text{.}\)

Example 11.7.8.

The set \(\sP\) of polynomials separates points and vanishes at no point on \(\R\text{.}\) That is, \(1 \in \sP\) so it vanishes at no point. And for \(x,y \in \R\text{,}\) \(x\not= y\text{,}\) take \(f(t) := t\text{.}\) Then \(f(x) = x \not= y = f(y)\text{.}\) So \(\sP\) separates points.

Example 11.7.9.

The set of functions of the form

\begin{equation*} f(t) = a_0 + \sum_{n=1}^k a_n \cos(nt) \end{equation*}

is an algebra, which follows by the identity \(\cos(mt)\cos(nt) = \frac{\cos((n+m) t)}{2}+ \frac{\cos((n-m) t)}{2}\text{.}\) The algebra does not separate points if the domain is an interval of the form \([-a,a]\text{,}\) because \(f(-t) = f(t)\) for all \(t\text{.}\) It does separate points if the domain is \([0,\pi]\text{,}\) as \(\cos(t)\) is one-to-one on that set.

Example 11.7.10.

The set of polynomials with no constant term vanishes at the origin.


There must exist an \(g,h,k \in \sA\) such that

\begin{equation*} g(x) \not= g(y), \quad h(x) \not= 0, \quad k(y) \not= 0 . \end{equation*}


\begin{equation*} f := c \frac{\bigl(g - g(y)\bigr)h}{\bigl(g(x)-g(y)\bigr)h(x) } + d \frac{\bigl(g - g(x)\bigr)k}{\bigl(g(y)-g(x)\bigr)k(y)} = c \frac{gh - g(y)h}{g(x)h(x)-g(y)h(x) } + d \frac{gk - g(x)k}{g(y)k(y)-g(x)k(y)} . \end{equation*}

Do note that we are not dividing by zero (clear from the first formula). Also from the first formula we see that \(f(x) = c\) and \(f(y) = d\text{.}\) By the second formula we see that \(f \in \sA\) (as \(\sA\) is an algebra).

The proof is divided into several claims.

Claim 1: If \(f \in \widebar{\sA}\text{,}\) then \(\sabs{f} \in \widebar{\sA}\text{.}\)


The function \(f\) is bounded (continuous on a compact set), so there is an \(M\) such that \(\sabs{f(x)} \leq M\) for all \(x \in X\text{.}\)

Let \(\epsilon > 0\) be given. By the corollary to the Weierstrass theorem there exists a real polynomial \(c_1 y + c_2 y^2 + \cdots+ c_n y^n\) (vanishing at \(y=0\)) such that

\begin{equation*} \abs{\sabs{y} - \sum_{j=1}^N c_j y^j} < \epsilon \end{equation*}

for all \(y \in [-M,M]\text{.}\) Because \(\widebar{\sA}\) is an algebra and because there is no constant term in the polynomial,

\begin{equation*} \sum_{j=1}^N c_j f^j \in \widebar{\sA} . \end{equation*}

As \(\sabs{f(x)} \leq M\text{,}\) then for all \(x \in X\)

\begin{equation*} \abs{\sabs{f(x)} - \sum_{j=1}^N c_j {\bigl(f(x)\bigr)}^j} < \epsilon . \end{equation*}

So \(\sabs{f}\) is in the closure of \(\widebar{\sA}\text{,}\) which is closed. In other words, \(\sabs{f} \in \widebar{\sA}\text{.}\)

Claim 2: If \(f \in \widebar{\sA}\) and \(g \in \widebar{\sA}\text{,}\) then \(\max(f,g) \in \widebar{\sA}\) and \(\min(f,g) \in \widebar{\sA}\text{,}\) where

\begin{equation*} \bigl(\max(f,g)\bigr) (x) := \max \bigl\{ f(x), g(x) \bigr\} , \qquad \text{and} \qquad \bigl(\min(f,g)\bigr) (x) := \min \bigl\{ f(x), g(x) \bigr\} . \end{equation*}



\begin{equation*} \max(f,g) = \frac{f+g}{2} + \frac{\sabs{f-g}}{2} , \end{equation*}


\begin{equation*} \min(f,g) = \frac{f+g}{2} - \frac{\sabs{f-g}}{2} . \end{equation*}

As \(\widebar{\sA}\) is an algebra we are done.

The claim is true for the minimum or maximum of every finite collection of functions as well.

Claim 3: Given \(f \in C(X,\R)\text{,}\) \(x \in X\) and \(\epsilon > 0\) there exists a \(g_x \in \widebar{\sA}\) with \(g_x(x) = f(x)\) and

\begin{equation*} g_x(t) > f(t)-\epsilon \qquad \text{for all } t \in X. \end{equation*}


Fix \(f\text{,}\) \(x\text{,}\) and \(\epsilon\text{.}\) By Proposition 11.7.11, for every \(y \in X\) we find an \(h_y \in \sA\) such that

\begin{equation*} h_y(x) = f(x), \qquad h_y(y)=f(y) . \end{equation*}

As \(h_y\) and \(f\) are continuous, the function \(h_y-f\) is continuous, and the set

\begin{equation*} U_y := \bigl\{ t \in X : h_y(t) > f(t) -\epsilon \bigr\} = {(h_y-f)}^{-1} \bigl( (-\epsilon,\infty) \bigr) \end{equation*}

is open (it is the inverse image of an open set by a continuous function). Furthermore \(y \in U_y\text{.}\) So the sets \(U_y\) cover \(X\text{.}\)

The space \(X\) is compact so there exist finitely many points \(y_1,y_2,\ldots,y_n\) in \(X\) such that

\begin{equation*} X = \bigcup_{j=1}^n U_{y_j} . \end{equation*}


\begin{equation*} g_x := \max(h_{y_1},h_{y_2},\ldots,h_{y_n}) . \end{equation*}

By Claim 2, \(g_x \in \widebar{\sA}\text{.}\) Furthermore,

\begin{equation*} g_x(t) > f(t) -\epsilon \end{equation*}

for all \(t \in X\text{,}\) since for every \(t\text{,}\) there is a \(y_j\) such that \(t \in U_{y_j}\text{,}\) and so \(h_{y_j}(t) > f(t) -\epsilon\text{.}\)

Finally \(h_y(x) = f(x)\) for all \(y \in X\text{,}\) so \(g_x(x) = f(x)\text{.}\)

Claim 4: If \(f \in C(X,\R)\) and \(\epsilon > 0\) is given, then there exists an \(\varphi \in \widebar{\sA}\) such that

\begin{equation*} \sabs{f(x) - \varphi(x)} < \epsilon . \end{equation*}


For every \(x\) find the function \(g_x\) as in Claim 3.


\begin{equation*} V_x := \bigl\{ t \in X : g_x(t) < f(t) + \epsilon \bigr\}. \end{equation*}

The sets \(V_x\) are open as \(g_x\) and \(f\) are continuous. As \(g_x(x) = f(x)\text{,}\) then \(x \in V_x\text{.}\) So the sets \(V_x\) cover \(X\text{.}\) By compactness of \(X\text{,}\) there are finitely many points \(x_1,x_2,\ldots,x_k\) such that

\begin{equation*} X = \bigcup_{j=1}^k V_{x_j} . \end{equation*}


\begin{equation*} \varphi := \min(g_{x_1},g_{x_2},\ldots,g_{x_k}) . \end{equation*}

By Claim 2, \(\varphi \in \widebar{\sA}\text{.}\) Similarly as before (same argument as in Claim 3), for all \(t \in X\text{,}\)

\begin{equation*} \varphi(t) < f(t) + \epsilon . \end{equation*}

Since all the \(g_x\) satisfy \(g_x(t) > f(t) - \epsilon\) for all \(t \in X\text{,}\) \(\varphi(t) > f(t) - \epsilon\) as well. Therefore, for all \(t\text{,}\)

\begin{equation*} -\epsilon < \varphi(t) - f(t) < \epsilon , \end{equation*}

which is the desired conclusion.

The proof of the theorem follows from Claim 4. The claim states that an arbitrary continuous function is in the closure of \(\widebar{\sA}\text{,}\) which itself is closed. So the theorem is proved.

Example 11.7.13.

The functions of the form

\begin{equation*} f(t) = \sum_{j=1}^n c_j \, e^{jt}, \end{equation*}

for \(c_j \in \R\text{,}\) are dense in \(C([a,b],\R)\text{.}\) We need to note that such functions are a real algebra, which follows from \(e^{jt} e^{kt} = e^{(j+k)t}\text{.}\) They separate points as \(e^t\) is one-to-one, and \(e^t > 0\) for all \(t\) so the algebra does not vanish at any point.

In general if we have a set of functions that separates points and does not vanish at any point, we can let these functions generate an algebra by considering all the linear combinations of arbitrary multiples of such functions. That is, we consider all real polynomials without constant term of such functions. In the example above, the algebra is generated by \(e^t\text{.}\) We consider polynomials in \(e^t\) without constant term.

Example 11.7.14.

We mentioned that the set of all functions of the form

\begin{equation*} a_0 + \sum_{n=1}^N a_n \cos(nt) \end{equation*}

is an algebra. When considered on \([0,\pi]\text{,}\) it separates points and vanishes nowhere so Stone–Weierstrass applies. As for polynomials, you do not want to conclude that every continuous function on \([0,\pi]\) has a uniformly convergent Fourier cosine series, that is, that every continuous function can be written as

\begin{equation*} a_0 + \sum_{n=1}^\infty a_n \cos(nt) . \end{equation*}

That is not true! There exist continuous functions whose Fourier series does not converge even pointwise let alone uniformly.

To obtain Stone–Weierstrass for complex algebras, we must make an extra assumption.

Definition 11.7.15.

An algebra \(\sA\) is self-adjoint if for all \(f \in \sA\text{,}\) the function \(\bar{f}\) defined by \(\bar{f}(x) := \overline{f(x)}\) is in \(\sA\text{,}\) where by the bar we mean the complex conjugate.


Suppose \(\sA_\R \subset \sA\) is the set of the real-valued elements of \(\sA\text{.}\) For \(f \in \sA\text{,}\) write \(f = u+iv\) where \(u\) and \(v\) are real-valued. Then

\begin{equation*} u = \frac{f+\bar{f}}{2}, \qquad v = \frac{f-\bar{f}}{2i} . \end{equation*}

So \(u, v \in \sA\) as \(\sA\) is a self-adjoint algebra, and since they are real-valued \(u, v \in \sA_\R\text{.}\)

If \(x \not= y\text{,}\) then find an \(f \in \sA\) such that \(f(x) \not= f(y)\text{.}\) If \(f = u+iv\text{,}\) then it is obvious that either \(u(x) \not= u(y)\) or \(v(x) \not= v(y)\text{.}\) So \(\sA_\R\) separates points.

Similarly, for every \(x\) find \(f \in \sA\) such that \(f(x) \not= 0\text{.}\) If \(f = u+iv\text{,}\) then either \(u(x) \not= 0\) or \(v(x) \not= 0\text{.}\) So \(\sA_\R\) vanishes at no point.

The set \(\sA_\R\) is a real algebra, and satisfies the hypotheses of the real Stone–Weierstrass theorem. Given any \(f = u+iv \in C(X,\C)\text{,}\) we find \(g,h \in \sA_\R\) such that \(\sabs{u(t)-g(t)} < \nicefrac{\epsilon}{2}\) and \(\sabs{v(t)-h(t)} < \nicefrac{\epsilon}{2}\) for all \(t \in X\text{.}\) Next, \(g+i h \in \sA\text{,}\) and

\begin{multline*} \abs{f(t) - \bigl(g(t)+ih(t)\bigr)} = \abs{u(t)+iv(t) - \bigl(g(t)+ih(t)\bigr)} \\ \leq \sabs{u(t)-g(t)}+\sabs{v(t)-h(t)} < \nicefrac{\epsilon}{2} + \nicefrac{\epsilon}{2} = \epsilon \end{multline*}

for all \(t \in X\text{.}\) So \(\widebar{\sA} = C(X,\C)\text{.}\)

The self-adjoint requirement is necessary although it is not so obvious to see it. For an example see Exercise 11.7.9.

Here is an interesting application. When working with functions of two variables, it may be useful to work with functions of the form \(f(x)g(y)\) rather than \(F(x,y)\text{.}\) For example, they are easier to integrate. We have the following.

Example 11.7.17.

Any continuous function \(F \colon [0,1] \times [0,1] \to \C\) can be approximated uniformly by functions of the form

\begin{equation*} \sum_{j=1}^n f_j(x) g_j(y) , \end{equation*}

where \(f_j \colon [0,1] \to \C\) and \(g_j \colon [0,1] \to \C\) are continuous.

Proof: It is not hard to see that the functions of the above form are a complex algebra. It is equally easy to show that they vanish nowhere, separate points, and the algebra is self-adjoint. As \([0,1] \times [0,1]\) is compact we apply Stone–Weierstrass to obtain the result.

Subsection 11.7.3 Exercises

Exercise 11.7.1.

Prove Proposition 11.7.6. Hint: If \(\{ f_n \}\) is a sequence in \(C(X,\R)\) converging to \(f\text{,}\) then as \(f\) is bounded, you can show that \(f_n\) is uniformly bounded, that is, there exists a single bound for all \(f_n\) (and \(f\)).

Exercise 11.7.2.

Suppose \(X := \R\) (not compact in particular). Show that \(f(t) := e^t\) is not possible to uniformly approximate by polynomials on \(X\text{.}\) Hint: Consider \(\abs{\frac{e^t}{t^n}}\) as \(t \to \infty\text{.}\)

Exercise 11.7.3.

Suppose \(f \colon [0,1] \to \C\) is a uniform limit of a sequence of polynomials of degree at most \(d\text{,}\) then the limit is a polynomial of degree at most \(d\text{.}\) Conclude that to approximate a function which is not a polynomial, we need the degree of the approximations to go to infinity.
Hint: First prove that if a sequence of polynomials of degree \(d\) converges uniformly to the zero function, then the coefficients converge to zero. One way to do this is linear algebra: Consider a polynomial \(p\) evaluated at \(d+1\) points to be a linear operator taking the coefficients of \(p\) to the values of \(p\) (an operator in \(L(\R^{d+1})\)).

Exercise 11.7.4.

Suppose \(f \colon [0,1] \to \R\) is continuous and \(\int_0^1 f(x) x^n \, dx = 0\) for all \(n = 0,1,2,\ldots\text{.}\) Show that \(f(x) = 0\) for all \(x \in [0,1]\text{.}\) Hint: Approximate by polynomials to show that \(\int_0^1 {\bigl( f(x) \bigr)}^2 \, dx = 0\text{.}\)

Exercise 11.7.5.

Suppose \(I \colon C([0,1],\R) \to \R\) is a linear continuous function such that \(I(x^n) = \frac{1}{n+1}\) for all \(n=0,1,2,3,\ldots\text{.}\) Prove that \(I(f) = \int_0^1 f\) for all \(f \in C([0,1],\R)\text{.}\)

Exercise 11.7.6.

Let \(\sA\) be the collection of real polynomials in \(x^2\text{,}\) that is polynomials of the form \(c_0 + c_1 x^2 + c_2 x^4 + \cdots + c_d x^{2d}\text{.}\)

  1. Show that every \(f \in C([0,1],\R)\) is a uniform limit of polynomials from \(\sA\text{.}\)

  2. Find an \(f \in C([-1,1],\R)\) that is not a uniform limit of polynomials from \(\sA\text{.}\)

  3. Which hypothesis of the real Stone–Weierstrass is not satisfied for the domain \([-1,1]\text{?}\)

Exercise 11.7.7.

Let \(\sabs{z}=1\) define the unit circle \(S^1 \subset \C\text{.}\)

  1. Show that functions of the form

    \begin{equation*} \sum_{k=-n}^n c_k\, z^k \end{equation*}

    are dense in \(C(S^1,\C)\text{.}\) Notice the negative powers.

  2. Show that functions of the form

    \begin{equation*} c_0 + \sum_{k=1}^n c_k \, z^k + \sum_{k=1}^n c_{-k}\, \bar{z}^k \end{equation*}

    are dense in \(C(S^1,\C)\text{.}\) These are so-called harmonic polynomials, and this approximation leads to, for example, the solution of the steady state heat problem.

Hint: A good way to write the equation for \(S^1\) is \(z \bar{z} = 1\text{.}\)

Exercise 11.7.8.

Show that for complex numbers \(c_j\text{,}\) the set of functions of \(x\) on \([-\pi,\pi]\) of the form

\begin{equation*} \sum_{k=-n}^n c_k \, e^{ik x} \end{equation*}

satisfies the hypotheses of the complex Stone–Weierstrass theorem and therefore such functions are dense in the \(C([-\pi,\pi],\C)\text{.}\)

Exercise 11.7.9.

Let \(S^1 \subset \C\) be the unit circle, that is the set where \(\sabs{z} = 1\text{.}\) Orient this set counterclockwise. Let \(\gamma(t) := e^{it}\text{.}\) For the one-form \(f(z)\,dz\) we write 6 

\begin{equation*} \int_{S^1} f(z) \,dz := \int_0^{2\pi} f(e^{it}) \, i e^{it} \, dt . \end{equation*}
  1. Prove that for all nonnegative integers \(k = 0,1,2,3,\ldots\text{,}\) we have \(\int_{S^1} z^k \, dz = 0\text{.}\)

  2. Prove that if \(P(z) = \sum_{k=0}^n c_k z^k\) is a polynomial in \(z\text{,}\) then \(\int_{S^1} P(z) \, dz = 0\text{.}\)

  3. Prove \(\int_{S^1} \bar{z} \, dz \not= 0\text{.}\)

  4. Conclude that polynomials in \(z\) (this algebra of functions is not self-adjoint) are not dense in \(C(S^1,\C)\text{.}\)

Exercise 11.7.10.

Let \((X,d)\) be a compact metric space and suppose \(\sA \subset C(X,\R)\) is a real algebra that separates points, but such that for some \(x_0\text{,}\) \(f(x_0) = 0\) for all \(f \in \sA\text{.}\) Prove that every function \(g \in C(X,\R)\) such that \(g(x_0) = 0\) is a uniform limit of functions from \(\sA\text{.}\)

Exercise 11.7.11.

Let \((X,d)\) be a compact metric space and suppose \(\sA \subset C(X,\R)\) is a real algebra. Suppose that for each \(y \in X\) the closure \(\widebar{\sA}\) contains the function \(\varphi_y(x) := d(y,x)\text{.}\) Then \(\widebar{\sA} = C(X,\R)\text{.}\)

Exercise 11.7.12.

  1. Suppose \(f \colon [a,b] \to \C\) is continuously differentiable. Show that there exists a sequence of polynomials \(\{ p_n \}\) that converges in the \(C^1\) norm to \(f\text{,}\) that is \(\snorm{f - p_n}_u + \snorm{f'-p_n'}_u \to 0\) as \(n \to \infty\text{.}\)

  2. Suppose \(f \colon [a,b] \to \C\) is \(k\) times continuously differentiable. Show that there exists a sequence of polynomials \(\{ p_n \}\) that converges in the \(C^k\) norm to \(f\text{,}\) that is,

    \begin{equation*} \sum_{j=0}^k \snorm{f^{(j)} - p_n^{(j)}}_u \to 0 \qquad \text{as} \qquad n \to \infty. \end{equation*}

Exercise 11.7.13.

  1. Show that an even function \(f \colon [-1,1] \to \R\) is a uniform limit of polynomials with even powers only, that is, polynomials of the form \(a_0 + a_1 x^2 + a_2 x^4 + \cdots + a_k x^{2k}\text{.}\)

  2. Show that an odd function \(f \colon [-1,1] \to \R\) is a uniform limit of polynomials with odd powers only, that is, polynomials of the form \(b_1 x + b_2 x^3 + b_3 x^5 + \cdots + b_k x^{2k-1}\text{.}\)

The delta function is not actually a function, it is a “thing” that supposed to give “\(\int_{-\infty}^\infty g(x) \delta(x-t) \, dt = g(x)\text{.}\)
Do note that the functions \(a_j\) depend on \(n\text{,}\) so the coefficients of \(p_n\) change as \(n\) changes.
Named after the American mathematician Marshall Harvey Stone 4  (1903–1989), and the German mathematician Karl Theodor Wilhelm Weierstrass 5  (1815–1897).
One could also define \(dz := dx + i \, dy\) and then extend the path integral from Chapter 9 to complex-valued one-forms.
For a higher quality printout use the PDF versions: or