\section{The Stone-Weierstrass Theorem} \label{section:stone-weierstrass} \begin{theorem}[Korovkin] \label{theorem:korovkin-convergence} For each $x \in [0, 1]$, let $g_x(t) = (t - x)^2$, then \begin{enumerate} \item For each $f \in C([0, 1]; \complex)$ and $\eps > 0$, there exists $C > 0$ such that \[ |f(t) - f(x)| \le \eps + Cg_x(t) \] for all $x, t \in [0, 1]$. \item Let $f \in C([0, 1]; \complex)$ and $\eps > 0$, then there exists $C > 0$ such that for any positive map $\phi: C([0, 1]; \complex) \to C([0, 1]; \complex)$ and $x \in [0, 1]$, \[ -\eps\norm{\phi(1)}_u - C\phi(g_x)(x) \le \phi(f)(x) - f(x) \le \eps\norm{\phi(1)}_u + C\phi(g_x)(x) \] and \[ \norm{\phi(f) - f}_u \le \eps \norm{\phi(1)}_u + C\sup_{x \in [0, 1]}|\phi(g_x)(x)| \] \item For each $n \in \natp$, let $\phi_n: C([0, 1]; \complex) \to C([0, 1]; \complex)$ be a positive map. If $\phi_n(1) \to 1$, $\phi_n(t) \to t$, and $\phi_n(t^2) \to t^2$ uniformly as $n \to \infty$, then $\phi_n(f) \to f$ uniformly as $n \to \infty$ for all $f \in C([0, 1]; \complex)$. \end{enumerate} \end{theorem} \begin{proof}[Proof, {{\cite[Exercise 2.20]{Paulsen}}}. ] (1): By \autoref{proposition:uniform-continuous-compact}, there exists $\delta > 0$ such that $|f(t) - f(x)| < \eps$ for all $x, t \in [0, 1]$ with $|x - t| < \delta$. Thus for each $x, t \in [0, 1]$, \[ |f(t) - f(x)| \le \eps \left\lceil \abs{\frac{x - t}{\delta}} \right\rceil \] Let $C = \eps/\delta^2$, then for each $s \ge 0$, \[ \eps + Cs^2 = \eps + \eps\paren{\frac{s}{\delta}}^2 \ge \eps + \eps\left\lfloor \abs{\frac{s}{\delta}} \right\rfloor \ge \eps\left\lceil \abs{\frac{s}{\delta}} \right\rceil \] so \[ |f(t) - f(x)| \le \eps \left\lceil \abs{\frac{x - t}{\delta}} \right\rceil \le \eps + C(x - t)^2 = \eps + Cg_x(t) \] (3): Let $f \in C([0, 1]; \complex)$ and $\eps > 0$. By (2), there exists $C > 0$ such that \[ \norm{\phi_n(f) - f}_u \le \eps \norm{\phi_n(1)}_u + C\sup_{x \in [0, 1]}|\phi_n(g_x)(x)| \] for all $n \in \natp$, where \begin{align*} \sup_{x \in [0, 1]}|\phi_n(g_x)(x)| &\le \sup_{x \in [0, 1]}|\phi_n(t^2 - 2tx + x^2)(x)| \\ &\le \sup_{x \in [0, 1]}|\phi_n(t^2)(x) - 2\phi_n(tx)(x) + x^2| \\ &\le \normn{\phi_n(t^2) - t^2}_u + 2\sup_{x \in [0, 1]}\normn{\phi_n(xt) - xt}_u \end{align*} which tends to $0$ as $n \to \infty$. Thus \[ \limsup_{n \to \infty}\norm{\phi_n(f) - f}_u \le \eps \] As the above holds for all $\eps > 0$, $\phi_n(f) \to f$ uniformly. \end{proof} \begin{theorem}[Weierstrass Approximation Theorem] \label{theorem:weierstrass-bernstein-polynomial} For each $n \in \natz$, let \[ \phi_n: C([0, 1]; \real) \to C([0, 1]; \real) \quad \phi_n(f)(t) = \sum_{k = 0}^n {n \choose k}f\paren{\frac{k}{n}}t^k(1-t)^{n-k} \] then: \begin{enumerate} \item For every $n \in \natp$, $\phi_n$ is a positive map. \item For every $n \in \natp$, \[ \phi_n(1) = 1 \quad \phi_n(t) = t \quad \phi_n(t^2) = t^2 + \frac{t - t^2}{n} \] \item For every $f \in C([0, 1]; \real)$, $\phi_n(f) \to f$ uniformly as $n \to \infty$. \item $\real[t]$ is dense in $C([0, 1]; \real)$. \end{enumerate} \end{theorem} \begin{proof} (1): For each $n \in \natz$ and $0 \le k \le n$, $t^k(1 - t)^{n-k} \ge 0$ on $[0, 1]$. (2): Let $n \in \natp$, then by the Binomial formula, \[ \phi_n(1) = \sum_{k = 0}^n{n \choose k}t^k(1 - t)^{n-k} = (t + (1 - t))^n = 1 \] and \begin{align*} \phi_n(t) &= \sum_{k = 1}^n\frac{n!}{k!(n-k)!}\frac{k}{n}t^k(1 - t)^{n-k} \\ &= \sum_{k = 1}^n\frac{(n-1)!}{(k-1)!(n-k)!}t^k(1 - t)^{n-k} \\ &= t\sum_{k = 0}^{n-1}\frac{(n-1)!}{k!(n-k-1)!}t^{k}(1 - t)^{n-k-1} = t \end{align*} Finally, \begin{align*} \phi_n(t^2) &= \sum_{k = 1}^n \frac{n!}{k!(n-k)!}\frac{k^2}{n^2}t^k(1 - t)^{n-k} \\ &= \sum_{k = 1}^n \frac{(n-1)!}{(k-1)!(n-k)!}\frac{k}{n}t^k(1 - t)^{n-k} \\ &= t \sum_{k = 0}^{n-1} \frac{(n-1)!}{(k-1)!(n-k-1)!}\frac{k+1}{n}t^k(1 - t)^{n-k} \\ &= t \phi_{n-1}\paren{\frac{(n-1)t + 1}{n}} = t^2 + \frac{t - t^2}{n} \end{align*} (3): Since $\seq{\phi_n}$ are positive with $\phi_n(1) \to 1$, $\phi_n(t) \to t$, and $\phi_n(t^2) \to t^2$ uniformly as $n \to \infty$, $\phi_n \to \text{Id}$ pointwise by \hyperref[Korovkin's Theorem]{theorem:korovkin-convergence}. \end{proof} \begin{lemma} \label{lemma:sqrt-polynomial} There exists a sequence of polynomials $\seq{p_n} \subset \real[x]$ such that $p_n(x) \upto \sqrt{x}$ uniformly on $[0, 1]$ as $n \to \infty$. \end{lemma} \begin{proof} Let $p_1 = 0$. For each $n \in \natp$ and $x \in [0, 1]$, define \[ p_{n+1}(x) = p_n(x) + \frac{x - p_n(x)^2}{2} \] Assume inductively that $0 \le p_n \le \sqrt{t}$, then \[ p_{n+1}(x) = p_n(x) + \frac{x - p_n(x)^2}{2} \ge p_n(x) \ge 0 \] and \begin{align*} \sqrt{x} - p_{n+1}(x) &= \sqrt{x} - p_n(x) - \frac{x - p_n(x)^2}{2} \\ &= \sqrt{x} - p_n(x) - \frac{1}{2}(\sqrt{x} - p_n(x))(\sqrt{x} + p_n(x)) \\ &= (\sqrt{x} - p_n(x))\paren{1 - \frac{\sqrt{x} + p_n(x)}{2}} \ge 0 \end{align*} for any $x \in [0, 1]$. Since $\seq{p_n} \subset \real[x]$ is increasing on $[0, 1]$ with $p_n(x) \le \sqrt{x}$ for all $x \in [0, 1]$ and $n \in \natp$, there exists $f: [0, 1] \to [0, 1]$ such that $p_n \to f$ pointwise as $n \to \infty$. For each $x \in [0, 1]$, \[ f(x) = \limv{n}p_{n+1}(x) = \limv{n}p_n(x) + \frac{x - p_n(x)^2}{2} = f(x) + \frac{x - f(x)^2}{2} \] so $f(x) = \sqrt{x}$. Since $p_n \upto f$ pointwise, $p_n \upto f$ uniformly as $n \to \infty$ by \hyperref[Dini's Theorem]{theorem:dini}. \end{proof} \begin{proposition} \label{proposition:algebra-lattice} Let $X$ be a compact Hausdorff space and $A \subset C(X; \real)$ be a closed subalgebra, then $A$ is a lattice. \end{proposition} \begin{proof} For each $f, g \in C(X; \real)$, \[ f \vee g = \frac{f + g + |f - g|}{2} \quad f \wedge g = \frac{f + g - |f - g|}{2} \] so it is sufficient to show that for each $f \in A$, $|f| \in A$. Let $f \in A$ and assume without loss of generality that $\norm{f}_u \le 1$. By \autoref{lemma:sqrt-polynomial}, there exists $\seq{p_n} \subset \real[x]$ such that $p_n(x) \to \sqrt{x}$ uniformly on $[0, 1]$ as $n \to \infty$. In which case, $p_n(f^2) \in A$ and $p_n(f^2) \to \sqrt{f^2} = |f|$ uniformly as $n \to \infty$. Since $A$ is closed, $|f| \in A$. \end{proof} \begin{proposition} \label{proposition:lattice-copy} Let $X$ be a compact Hausdorff space, $A \subset C(X; \real)$ be a closed lattice, and $f \in C(X; \real)$. If \begin{enumerate} \item[(C)] For any $x, y \in X$, there exists $g_{xy} \in A$ such that $g_{xy}(x) = f(x)$ and $g_{xy}(y) = f(y)$. \end{enumerate} then $f \in A$. \end{proposition} \begin{proof}[Proof, {{\cite[Lemma 4.49]{Folland}}}. ] Fix $\eps > 0$. Let $x \in X$, then for each $y \in Y$, $\bracs{g_{xy} > f - \eps} \in \cn_X(y)$. By compactness of $X$, there exists $Y_x \subset Y$ finite such that $X = \bigcup_{y \in Y_x}\bracs{g_{xy} > f - \eps}$. In which case, let $g_x = \bigvee_{y \in Y_x}g_{xy}$, then $g \in A$ and $g_x(x) = f(x)$ and $g > f - \eps$. Similarly, for each $x \in X$, $\bracs{g_x < f + \eps} \in \cn_X(x)$. By compactness of $X$, there exists $X_0 \subset X$ finite such that $X = \bigcup_{x \in X_0}\bracs{g_x < f + \eps}$. Let $g = \bigwedge_{x \in X_0}g_x$, then $g \in A$ and $\norm{f - g}_u < \eps$. \end{proof} \begin{lemma} \label{lemma:algebra-r2} Let $A \subset \real^2$ be an algebra. If \begin{enumerate} \item[(S)] There exists $(x, y) \in A$ such that $x \ne y$. \end{enumerate} then $A$ is one of the following: \begin{enumerate} \item $\real^2$. \item $\text{span}\bracs{(0, 1)}$. \item $\text{span}\bracs{(1, 0)}$. \end{enumerate} \end{lemma} % Proof omitted because it is obvious. \begin{theorem}[Stone-Weierstrass] \label{theorem:stone-weierstrass} Let $X$ be a compact Hausdorff space and $A \subset C(X; \real)$ be a closed subalgebra. If \begin{enumerate} \item[(S)] For each $x, y \in X$, there exists $f \in A$ such that $f(x) \ne f(y)$. \end{enumerate} then exactly one of the following holds: \begin{enumerate} \item There exists $x_0 \in X$ such that $A = \bracs{f \in C(X; \real)| f(x_0) = 0}$. \item $A = C(X; \real)$. \end{enumerate} \end{theorem} \begin{proof}[Proof, {{\cite[Theorem 4.45]{Folland}}}. ] For each $x, y \in X$ with $x \ne y$, the mapping \[ \pi_{xy}: A \to \real^2 \quad f \mapsto (f(x), f(y)) \] is an algebra homomorphism, and $\pi_{xy}(A)$ is a subalgebra of $\real^2$. By (S) and \autoref{lemma:algebra-r2}, there exists no $x, y \in X$ with $x \ne y$ such that $\pi_{xy}(A) = \bracs{0}$, so exactly one of the following holds: \begin{enumerate} \item There exists $x_0 \in X$ such that $f(x_0) = 0$ for all $f \in A$. \item For all $x, y \in X$ with $x \ne y$, $\pi_{xy}(A) = \real^2$. \end{enumerate} If (1) holds, let $B = \bracs{f \in C(X; \real)| f(x_0) = 0}$. If (2) holds, let $B = C(X; \real)$. By \autoref{proposition:algebra-lattice}, $A$ is a lattice. In both cases, $A$ satisfies condition (C) of \autoref{proposition:lattice-copy} for all $f \in B$, therefore $A = B$. \end{proof} \begin{theorem}[Stone-Weierstrass (Complex)] \label{theorem:complex-stone-weierstrass} Let $X$ be a compact Hausdorff space and $A \subset C(X; \complex)$ be a closed subalgebra. If \begin{enumerate} \item[(S)] For each $x, y \in X$, there exists $f \in A$ such that $f(x) \ne f(y)$. \item[(*)] For each $f \in A$, the complex conjugate $\ol f$ is also in $A$. \end{enumerate} then exactly one of the following holds: \begin{enumerate} \item There exists $x_0 \in X$ such that $A = \bracs{f \in C(X; \complex)| f(x_0) = 0}$. \item $A = C(X; \complex)$. \end{enumerate} \end{theorem} \begin{proof}[Proof, {{\cite[Theorem 4.51]{Folland}}}. ] By (*), for each $f \in A$, $\text{Re}(f), \text{Im}(f) \in A$ as well. Let $A_{sa} = A \cap C(X; \real)$, then $A_{sa} \subset C(X; \real)$ satisfies (S) of the \hyperref[Stone-Weierstrass Theorem]{theorem:stone-weierstrass}, so exactly one of the following holds: \begin{enumerate} \item There exists $x_0 \in X$ such that $A = \bracs{f \in C(X; \real)| f(x_0) = 0}$. \item $A = C(X; \real)$. \end{enumerate} If (1) holds, let $B = \bracs{f \in C(X; \real)| f(x_0) = 0}$. If (2) holds, let $B = C(X; \real)$. For any $f \in B$, $f = \text{Re}(f) + \text{Im}(f)$, where $\text{Re}(f), \text{Im}(f) \in A_{sa} \subset A$. Therefore $f \in A$, and $A = B$. \end{proof}