Prove: Every compact metric space is separable

Solution 1:

Hint: Consider the countable family of coverings $\mathcal U_n=\left\{B\left(x,\frac1n\right)\mid x\in X\right\}$ for all $n$, use compactness to distill a countable family of points, and show it is dense.

Solution 2:

Recall that every infinite subset $E$ of a compact metric space $X$ has a limit point in $X$. Now define a recursive process as follows: Fix some $\delta > 0$ and pick an $x_1 \in X$. Now having defined $x_1,\ldots,x_n$, if possible choose $x_{n+1}$ such that $d(x_{n+1},x_i) \geq \delta$ for all $1 \leq i \leq n$. Now we claim that this process must terminate. For suppose it does not. Consider $$E = \{x_1,x_2,x_3,\ldots \}.$$

Now by assumption of $X$ being compact, $E$ has a limit point $a \in X$ say. But then $B_\frac{\delta}{2}(a)$ can only contain at most one point of $E$, a contradiction. It follows that $X$ can be covered by finitely many neighbourhoods of radius $\delta$ about some points $x_1,\ldots,x_n$. Now what happens if you consider all balls of radius $\frac{1}{m}$ about each $x_i$ for $1 \leq i \leq n$? This will be countable, but why will it be dense in $X$? $m$ by the way runs through all positive integers.