Simple application of Stone-Weierstrass I was looking for a simple application of the Stone-Weierstrass theorem.
First I thought that if $X$ is any compact measure space then Stone-Weierstrass implies that $C_c(X)$ is dense in $L^p$.
But I have to assume that $X$ is compact otherwise I don't have $1$ in $C_c(X)$. That of course makes it a boring example since then $C_c(X) = C(X)$. Can someone show me a slightly more interesting but still simple example? Thank you.
 A: This is an example I learned only recently from one of my professors (I don't know much about probability, so I'm not sure whether this is an old hat): 
We can use Stone-Weierstrass to prove the Kolmogorov extension theorem (or a version thereof). Namely, given a collection $X = \{\mu_\alpha\}_{\alpha}$ of probability measures on $[0,1]$, there exists a probability measure $\mu$ on $\prod_{\alpha} [0,1]$ such that $$\mu(\pi_{\alpha_1}^{-1}(A_1) \cap \dots\cap  \pi_{\alpha_n}^{-1}(A_n) ) = \prod_{i=1}^n \mu_{\alpha_i}(A_i)$$
for all $\alpha_1, \dots, \alpha_n$, where $\pi_\alpha: X \to [0,1]$ denotes projection.
Sketch of proof: The set $Q \subset C(X)$ of continuous maps, which depend only on "finitely many components", i.e. those $f\in C(X)$ which can be written in the form $$f(x) = g(\pi_{\alpha_1}(x), \dots, \pi_{\alpha_n}(x)) \qquad \text{ for some }\alpha_1, \dots, \alpha_n,\,  n\in \mathbb N \text{ and } g\in C([0,1]^n)$$
is a unital algebra which separates points. By Tychonoff's theorem we know that $X$ is compact, so $Q$ is dense by Stone-Weierstrass.
We can now define a continuous linear functional $I: C(X) \to \mathbb R$ as follows: Given $f(x) = g(\pi_{\alpha_1}(x), \dots, \pi_{\alpha_n}(x)) \in Q$ as above, we define
$$I(f) = \int_{[0,1]^n} g(x_1, \dots, x_n) \, dx_1 \dots dx_n$$
Then $I$ is well-defined and is a bounded linear functional on the dense subspace $Q\subset C(X)$. Therefore it can be extended uniquely to a bounded linear functional on all of $C(X)$.
Finally, Riesz' representation theorem for compact Hausdorff spaces shows that to every such functional $I$ there corresponds a unique Radon measure $\mu$ such that $I(f) = \int_X f\, d\mu$.
It is now not hard to show that this $\mu$ satisfies $\mu(\pi_{\alpha_1}^{-1}(A_1) \cap \dots\cap  \pi_{\alpha_n}^{-1}(A_n) ) = \prod_{i=1}^n \mu_{\alpha_i}(A_i)$ by finding a suitable sequence of continuous functions approximating the indicator function of $\pi_{\alpha_1}^{-1}(A_1) \cap \dots\cap  \pi_{\alpha_n}^{-1}(A_n) $. $\square$
I had seen other proofs of this extension theorem (which I didn't like too much, because I couldn't easily see what's going on), so I was really amazed when I first heard of the above argument. I especially like how various big theorems suddenly pop up and fit together so well! =)
A: Some examples:


*

*if $(K,d)$ is a compact metric space, then $C(K)$ endowed with the supremum norm is separable. To see this, take $\{x_n\}$ a countable dense subset, and consider the algebra generated by the maps $f_{m,n}:=\max\{1/n,d(x,x_m)\}$. 

*the set of trigonometric polynomials is dense in $C[0,2\pi]$ endowed with the supremum norm.

*Consider two compact metric spaces $(K_1,d_1)$, $(K_2,d_2)$. The set of maps of the form 
$$f(x,y):=\sum_{k=1}^nf_k(x)g_k(y),$$
$n\in\Bbb N$, $f_k\in C(K_1), g_k\in C(K_2)$, $1\leq k\leq n$, is dense in $C(K_1\times K_2)$. 

A: *

*Given that $C[0,1]$ is $\|.\|_{L^2}$-dense in $L^2[0,1]$, Stone-Weierstrass easily implies that the trigonometric polynomials are as well.

*Look at this question (but not the answer).

*Take a functional analysis book (e.g. Conway) and look at the exercises following Stone-Weierstrass.

*Try to formulate and deduce a similar statement about $C_c(X)$ for $X$ not necessarily compact. As you noticed, it need not contain $1$, so think about how to modify this condition. (If you get stuck, consult wikipedia or again a functional analysis book.)

