# Prove that $C_0(X)$ is separable given that X is locally compact metric space

I'm struggling to prove the following fact:

Suppose that $$X$$ is locally compact metric space. Let us denote with $$C_0(X)$$ the space of functions vanishing at infinity (i.e., $$\forall f \in C_0(X)$$ $$\forall \varepsilon > 0$$ $$\exists \, E\subset X$$ s.t. $$E$$ is compact and $$|f(x)|<\varepsilon$$ for $$x \in X\setminus E$$). Then $$C_0(X)$$ is separable.

I've proven that $$C_0(X)$$ equipped with a supremum norm is a Banach space, and that $$C_c(X)$$ (functions with compact support) are dense in $$C_0(X)$$, so my guess would be to somehow use those facts to prove that $$C_0(X)$$ is separable. However, I can't exactly see how. I've seen the cases for compact spaces or using the assumption of $$\sigma$$-compactness. Any help is highly appreciated.

• Can you use the Stone-Weierstrass theorem and construct a countable subalgebra that separates points? – Matthew Leingang Sep 6 '19 at 14:12
• @MatthewLeingang wouldn't you need it to contain some non-zero constant function? But it wouldn't vanish at infinity – GSofer Sep 6 '19 at 14:18
• @GSofer My question wasn't a hint; it was a guess. ;^) – Matthew Leingang Sep 6 '19 at 14:52
• Are you missing a separability assumption? As written I think this is false. For example, let $X$ be an uncountable set with the discrete metric. Then for each $x \in X$, define $f_x(x) = 1$ and $f_x(y) = 0$ for $y \neq x$. Then $\{f_x: x \in X\} \subseteq C_0(X)$ and $\|f_x - f_y\|_\infty = 1$ for $y \neq x$ which means that $C_0(X)$ has an uncountable discrete subset and so isn't separable. With the added assumption of separability of $X$ this is true since you can e.g. embed $C_0(X)$ into $C(\tilde{X})$ where $\tilde{X}$ is the one-point compactification of $X$. – Rhys Steele Sep 6 '19 at 15:26
• en.wikipedia.org/wiki/… does not require any constant functions. So you can try to modify the C(X) proof, but that requires that $X$ is separable. Let $D\subset X$ be dense and countable. Set $d_x(y):=1/(1+d(x,y))\ (x\in D)$. Let $A$ be the subalgebra of $C_0(X)$ generated by the functions $d_x\in C_0$,* i.e., the set of linear combinations of their products. Let $A'$ be the subset with rational coefficients. Then $A'$ is countable and dense in $A$. But $A$ separates points and vanishes nowhere. So we are done if * is true. Is it? – user3810316 Jun 10 at 20:34

As Rhys Steele mentions, this is not true unless you assume $$X$$ to be second countable (or, equivalently for metric spaces, separable). Rhys gives a counterexample showing the theorem can fail without this assumption, but more is true: it always fails without this assumption.
Proposition. Let $$X$$ be a locally compact Hausdorff space. If $$C_0(X)$$ is separable then $$X$$ is second countable.
Proof. Let $$\{f_n\}$$ be a countable dense subset of $$C_0(X)$$, and for each $$n$$ let $$U_n = \{x \in X: f_n(x) > 1/2\}$$, which is an open subset of $$X$$. I claim that $$\{U_n\}$$ is a countable base for the topology of $$X$$. For let $$x \in X$$ and let $$V$$ be an open neighborhood of $$x$$. Then by Urysohn's lemma for locally compact Hausdorff spaces, there exists a function $$f$$ compactly supported inside $$V$$ with $$f(x) = 1$$. In particular $$f \in C_c(X) \subset C_0(X)$$, so by density, we can find some $$f_n$$ with $$\|f-f_n\|_\infty < 1/2$$. Then we have $$f_n(x) > 1/2$$ so $$x \in U_n$$. Moreover, if $$y \in U_n$$ then $$f_n(y) > 1/2$$ and so $$f(y) > 0$$, which implies $$y \in V$$. Therefore $$U_n \subset V$$. This proves that $$\{U_n\}$$ is a base.
Now, supposing that $$X$$ is second countable, you can proceed in a similar way to the compact case, applying the locally compact version of Stone-Weierstrass. Using the second countability and local compactness, you should be able to construct a countable family $$f_n$$ of compactly supported functions which separates points and vanishes nowhere. Then consider the algebra $$\mathcal{A}_0$$ generated over $$\mathbb{Q}$$ by the $$f_n$$; i.e. all functions consisting of finite rational linear combinations of finite products of the $$f_n$$. Show that $$\mathcal{A}_0$$ is countable, and that the closure of $$\mathcal{A}_0$$ is a closed algebra over $$\mathbb{R}$$. Stone-Weierstrass then implies that the closure of $$\mathcal{A}_0$$ equals $$C_0(X)$$, so $$C_0(X)$$ is separable.
In the case of $$X = \mathbb{R}$$. Consider the (countable) set of function $$G = \{(P I_n) * \eta_m: P \in \mathbb{Q}(x), m, n \in \mathbb{N}\} \subset C_0(X),$$ where $$I_n (x) = \mathbf{1}_{[-n, n]}(x)$$ and $$\eta_m = \frac{1}{m} \eta(\frac{x}{m})$$, $$\eta$$ is a mollifier and $$*$$ means convolution. For arbitray $$f \in C_0(X)$$, assuming it is supported on $$[-N, N]$$, by Weiterstrass theorem we can find a sequence of $$P_n \in \mathbb{Q}(x)$$ such that $$P_n(x) I_N (x)$$ approximates $$f(x)$$ uniformly. Using the property of mollifier, we conlcude $$G$$ is dense in $$C_0(X)$$. Therefore, $$C_0(X)$$ is separable.