Prove if $X$ is a compact metric space, then $X$ is separable.

Solution 1:

One approach is to prove that if $X$ is a compact metric space then $X$ is totally bounded. This means that for every $\varepsilon > 0$ there is a finite number, say $n(\varepsilon)$, of points, call them $x_1,\dots,x_{n(\varepsilon)}$, such that the balls $B_\varepsilon(x_1),\dots,B_\varepsilon(x_{n(\varepsilon)})$ cover $X$. This is actually quite simple to prove, because if $X$ is a compact metric space, then given $\varepsilon > 0$, the cover $\{ B_{\varepsilon}(x) : x \in X \}$ has a finite subcover of the desired form.

From there, cover $X$ with finitely many balls of radius $1$; extract the center of each. Now every point is within $1$ of a point in your (finite) set. Cover $X$ with finitely many balls of radius $1/2$; extract the center from each. Now every point is within $1/2$ of a point in your (still finite) set. Repeat for each $1/m$ for $m \in \mathbb{N}$ and take the countable union. A countable union of finite sets is countable, so you have your countable dense subset.

Solution 2:

Hint: For $\delta$, we see that $\{ B_{\delta}(x) : x \in X \}$ is an open cover of $X$. There is a finite subcover of this cover since $X$ is compact, so there is a finite set $E_\delta$ such that $\{B_\delta(x) : x \in E_\delta\}$ is an open cover of $X$. In particular, this means that for any $y \in X$, there exists a $x \in E_\delta$ such that $d(x,y) < \delta$.

Find a countable union of such $E_\delta$ to construct a dense subset of $X$.