Prove that totally bounded metric spaces are separable

analysisreal-analysissolution-verification

Prove that a totally bounded metric space $M$ is separable.

Please help me complete my proof, I think I'm almost there.


Since $M$ is totally bounded, for every $1/n$, there exists a finite set $D_n$ for which $$M \subset \bigcup_{x\in D_n} B\left(x,\frac{1}{n}\right)$$
Let $$D = \bigcup_{n=1}^\infty D_n$$
Since all $D_n$ are finite, $D$ is countable. Showing that $D$ is also dense will complete the proof. We know that $D\subset M$ is dense iff $\overline D = M$. So we must show $\overline D \supset M$. In other words, $x\in M\implies x\in \overline D$. We also know that $x\in\overline D$ iff $\forall\epsilon >0$, $B(x,\epsilon)\cap D\ne \varnothing$.

Suppose $x\in M$. For a contradiction, assume that there exists some $\epsilon > 0$ such that $B(x,\epsilon) \cap D = \varnothing$. I'm unable to find a contradiction from here, and would appreciate any help! Thank you.

Best Answer

Choose $n$ such that $\frac 1n <\epsilon$. Then $x \in B(d,\frac 1n)$ for some $d \in D_n \subseteq D$. This implies that $d \in B(x,\epsilon) \cap D$ so $B(x,\epsilon) \cap D$ is not empty.