# Show that if $X$ is compact metrizable then $C(X)$ is separable.

Let $$X$$ be a metrizable compact space. I want to show that $$C(X, \mathbb{C})$$ is separable in the uniform topology.

Attempt: By our assumption, $$X$$ is separable, so we can pick a countable dense subset $$\{x_n:n \geq 1\}$$. Let $$d$$ be a metric inducing the topology on $$X$$. Define for $$n \geq 1$$

$$d_n: X \to \mathbb{R}: x \mapsto d(x,x_n)$$

Let $$\mathcal{A}= \bigcup_{n=1}^\infty \mathbb{C}[d_1, \dots, d_n]$$ where $$\mathbb{C}[d_1, \dots, d_n]$$ is the set of complex polynomials in the functions $$d_1, \dots, d_n$$.

It is easily checked that $$\mathcal{A}$$ is a subalgebra of $$C(X, \mathbb{C})$$, since $$\mathcal{A}$$ is closed under addition, multiplication and scalar multiplication. Moreover, $$1 \in \mathbb{C}[d_1]\subseteq \mathcal{A}$$ so the algebra is unital. Clearly $$\mathcal{A}$$ is closed under complex conjugation, since the functions $$d_1, d_2, \dots$$ are all real-valued. We know that $$\mathcal{A}$$ separates the functions of $$C(X, \mathbb{C})$$:

If $$x \neq y$$ with $$x, y \in X$$. Use density to choose $$n \geq 1$$ with $$d(x_n,x) < d(x,y)/2$$. Then we have $$d(x_n,x) \neq d(x_n,y)$$. Otherwise $$d(x_n,x) = d(x_n,y)$$ and we get $$d(x,y) \leq d(x,x_n) + d(x_n,y) = 2d(x,x_n) which is impossible. Thus $$d_n(x) \neq d_n(y)$$ so our algebra separates the points.

By Stone-Weierstrass, $$\mathcal{A}$$ is dense in $$C(X, \mathbb{C})$$. Let $$D$$ be a countable dense subset of $$\mathbb{C}$$, for example $$D= \mathbb{Q}+ i \mathbb{Q}$$. Any element of $$\mathcal{A}$$ can be approximated by an element in $$\mathcal{B}:= \bigcup_{n=1}^\infty D[d_1, \dots, d_n]$$ and we conclude that $$\mathcal{B}$$ is dense in $$C(X, \mathbb{C})$$. Clearly $$\mathcal{B}$$ is countable, and thus we conclude the proof. $$\quad \square$$

Is this proof correct?

• I think that I did not carefully read your proof. Sorry. I will delete my comment. – Stinking Bishop May 22 at 21:52
• No worries. Your help is appreciated anyway! – user745578 May 22 at 21:54
• Stone-Weierstraß is not the only way.. but if it's an allowed tool, go for it. – Henno Brandsma May 22 at 23:59
• @HennoBrandsma Are there maybe other approaches that are easier/more elementary? – user745578 May 23 at 8:20

The idea of the proof is fine, and standard, I think. Maybe you might want to add details about why your $$\mathcal{B}$$ is dense, so why replacing the coefficients of the members of the algebra by a dense subset is OK. Maybe you're relying on an earlier lemma? The countability might warrant a few words too, depending on the target audience (how much set theory do they know)?
• Well, take a polynomial $p = \sum_{i_1, \dots, i_n} a_{i_1, \dots, i_n} d_1^{i_1}\dots d_n^{i_n}$ in $d_1, \dots, d_n$. We approximate this with an element in $\mathcal{B}$. Let $m$ be the amount of terms in this polynomial. Given $\epsilon > 0$, choose elements $b_{i_1, \dots, i_n} \in D$ with $|b_{i_1, \dots, i_n}-a_{i_1, \dots, i_n}| < \epsilon/m$. Then $|\sum a_{i_1, \dots, i_n} d_1^{i_1}\dots d_n^{i_n}- \sum b_{i_1, \dots, i_n} d_1^{i_1}\dots d_n^{i_n}| < \epsilon$ and this shows that an element of $\mathcal{A}$ can be approximated by an element in $\mathcal{B}$. – user745578 May 23 at 8:08
• Since an element in $C(X)$ can be approximated by an element in $\mathcal{A}$ and an $\epsilon/2$-argument, we see that $\mathcal{B}$ is dense in $C(X)$. Countability of $\mathcal{B}$ is obvious (countable union of countable sets is countable) – user745578 May 23 at 8:09
• @user745578 In the sup norm (the $d_i$ are functions so we have to estimate for all $x \in X$)) we need uniform continuity (which is true, but shows the argument is not yet complete).. – Henno Brandsma May 23 at 8:11
• $X$ is compact so uniform continuity is garantueed? – user745578 May 23 at 8:12