Proof (Stone-Weierstrass)

Over $\R$

Lemma (approximating absolute value with polynomials) open_in_new

For any $ε>0$, there exists a real polynomial $p$ such that $$ \begin{align*} \bigl||t| - p(t)\bigr| < ε \qquad \forall t\in [-1,1]. \end{align*} $$

Proof

Lemma (closed subalgebra of C(K) is a lattice) open_in_new

Let $K$ be a topological space.

If $A$ is a closed subalgebra of $C^\R(K)$, then $A$ is a lattice, i.e. if $f,g\in A$, then $\max\set{f,g}, \min\set{f,g}\in A$.

Proof

Let $A$ be an subalgebra of $C^\R(K)$ that strongly separates points of $K$. We want to show $\overline{A} = C^\R(K)$.

Fix $f\in C^\R(K)$ and $ε>0$.

Agreeing with $f$ at two points

Let $x,y\in K$ be distinct. We want to find $f_{xy}\in A$ such that $f_{xy}(x) = f(x)$ and $f_{xy}(y) = f(y)$.

As $A$ separates points of $K$, find $g\in A$ such that $g(x) \neq g(y)$.

In either case, $(g(x), g(y)), (h(x), h(y))\in \R^2$ are linearly independent. Therefore there are $λ,μ\in \R$ such that $f_{xy} := λg + μh\in A$ equals $f(x)$ at $x$ and equals $f(y)$ at $y$.

Approximating $f$ on one side

For each $x\in K$, we will find $f_x\in \overline{A}$ such that $f_x(x) = f(x)$ and $f_x < f + ε$.

Define $$ \begin{align*} U_{xy} = \sb{z\in K}{f_{xy}(z) < f(z) + ε}, \end{align*} $$ which is open by the continuity of $f_{xy} - f$. Since $f_{xy}(y) = f(y)$, we have $y\in U_{xy}$, so $\sb{U_{xy}}{y\in K}$ is an open cover of $K$. Apply compactness to find $y_1, \ldots, y_n\in K$ such that $K = \bigcup_{i=1}^{n} U_{xy_i}$.

As $\overline{A}$ is a lattice, $$ \begin{align*} f_x := \min\set{f_{xy_1}, \ldots, f_{xy_n}} \in \overline{A}, \end{align*} $$ Check that $f_x$ works:

This proves the claim.

Approximating $f$ on both sides

Now define $$ \begin{align*} V_x = \sb{z\in K}{f_x(z) > f(z) - ε}, \end{align*} $$ which is open by continuity of $f_x - f$. Since $f_x(x) = f(x)$, $\sb{V_x}{x\in K}$ is an open cover of $K$. By compactness, let $x_1, \ldots, x_m\in K$ such that $K = \bigcup_{i=1}^{m} V_{x_i}$.

Since $\overline{A}$ is a lattice, $$ \begin{align*} g := \max\set{f_{x_1}, \ldots, f_{x_m}} \in \overline{A}. \end{align*} $$

Hence $\|g - f\|_\infty < ε$. This shows $f\in \overline{A}$.

Over $\C$

Let $A$ be a subalgebra of $C^\C(K)$ that strongly separates points of $K$ and is closed under complex conjugation.

Let $A^\R = A \cap C^\R(K)$, a subalgebra of $C^\R(K)$. $A^\R$ still strongly separates points of $K$: for any $f\in A$, since $\overline{f}\in A$, we have $\Re f = \frac{1}{2}(f + \overline{f})\in A^\R$ and $\Im f = \frac{1}{2i}(f - \overline{f})\in A^\R$.

Therefore $\overline{A^\R} = C^\R(K)$ by our result over $\R$, so $C^\R(K) \subseteq \bar A$. Then $C^\C(K) = C^\R(K) + iC^\R(K) \subseteq \bar A$, as required.