Compact Metric Spaces and Separability of $C(X,\mathbb{R})$ [duplicate]
Solution 1:
Let $F$ as you said. Let $\mathbb R[F]$ the $\mathbb R$-subalgebra generated by $F$.
We want to use Stone-Weierstrass theorem on the latter (rather than $F$) and show that it is dense. This will suffice for a proof that $C(X,\mathbb R)$ is separable, since $\mathbb Q[F]$ is countable and dense in $\mathbb R[F]$.
$\mathbb R[F]$ contains $1$ and it is obviously an algebra. Let's show that it separates points.
Let $x\ne y\in X$. Since $\{x_n\}_{n\in\mathbb N}$ is dense, there must exist $x_m$ such that $d(x,x_m)\le \frac13 d(x,y)$. Forcibly, it cannot hold $d(y,x_m)=d(x,x_m)$. If it held, then $$d(x,y)\le d(x,x_m)+d(y,x_m)\le \frac23 d(x,y)$$ absurd. So the function $f_m$ separates $x$ and $y$.
Stone-Weierstrass can therefore be used on $\mathbb R[F]$, completing the proof.
Precisations:
How is $\mathbb R[F]$ defined? Either the intersection of all the $\mathbb R$-subalgebras of $C(X,\mathbb R)$ which contain $F$ or, equivalently, as the $\mathbb R$-vector subspace of $C(X,\mathbb R)$ generated by the products of finitley many elements of $F$.
How is $\mathbb Q[F]$ defined? Either the intersection of all the $\mathbb Q$-subalgebras of $C(X,\mathbb R)$ that contain $F$ or, as above, the $\mathbb Q$-vector subspace of $C(X,\mathbb R)$ generated by the products of finitely many elements of $F$.
-
Why is $\mathbb Q[F]$ dense in $\mathbb R[F]$? It is rather easy, actually, but the notation is a bit tedious.
If $g\in\mathbb R[F]$, then there exist $k\in\mathbb N,\ g_1, \cdots, g_k\in F$ and a finite set $S\subseteq \mathbb N^k$ such that $$g=\sum_{(n_1,\cdots,n_k)\in S} \lambda_{n_1,\cdots,n_k}g_1^{n_1}\cdots g_k^{n_k}$$ for some $\lambda_{n_1,\cdots,n_k}\in\mathbb R$.
Now, if you approximate each $\lambda_{n_1,\cdots,n_k}$ with rationals $$\alpha_{n_1,\cdots,n_k}^{(t)}\stackrel{t\to\infty}{\longrightarrow}\lambda_{n_1,\cdots,n_k}$$ and call $$g^{(t)}=\sum_{(n_1,\cdots,n_k)\in S} \alpha^{(t)}_{n_1,\cdots,n_k}g_1^{n_1}\cdots g_k^{n_k}\in\mathbb Q[F]$$ you get $$\Vert g-g^{(t)}\Vert_\infty=\left\Vert \sum_{(n_1,\cdots,n_k)\in S} (\lambda_{n_1,\cdots,n_k}-\alpha_{n_1,\cdots,n_k}^{(t)})g_1^{n_1}\cdots g_k^{n_k}\right\Vert_\infty\le\\\le \left(\sum_{(n_1,\cdots,n_k)\in S}\Vert g_1^{n_1}\cdots g_k^{n_k}\Vert_\infty\right)\cdot\max_{(n_1,\cdots,n_k)\in S}\left\vert\lambda_{n_1,\cdots,n_k}-\alpha^{(t)}_{n_1,\cdots,n_k}\right\vert\stackrel{t\to\infty}{\longrightarrow}0$$