The countable dense subset of every compact metric space

Show that any compact metric space has a countable dense subset.

I am having problem with finishing the proof after a few steps. This is how I am going :

So, let $$X$$ be the compact metric space . For every $$n\in \Bbb N$$,consider the $$1\over n$$ balls of the points of $$X$$.Since compact , finitely many such balls would cover $$X.$$ So , let for a fixed $$n,$$ $$X\subset B\left({x_1}_n,{1\over n}\right)\cup B\left({x_2}_n,{1\over n}\right)\cup B\left({x_3}_n,{1\over n}\right).....B\left({x_k}_n,{1\over n}\right)$$

Now set $$\mathcal S=\{{x_i}_n|n\in\Bbb N;i=1,2,...,k; \text{where k_n balls as above are required to cover X}\}$$

Since every $$k_n$$ is finite,the set $$\mathcal S$$ being countable union of finite sets is countable. So $$|\mathcal S|=\aleph_0.$$ My guess is that this $$\mathcal S$$ is the required *countable dense set. $$[$$ Because finite number of balls with them $$\{x_{i_n} \}$$ with centers will cover the whole space and every point will be in some or the other ball so they have to have at least one of them in any of their neighborhoods. $$]$$ But I'm struggling to write down the rest of the proof.

Like if I take any point $$z\in X$$ and any $$1\over n$$ ball centered at $$z$$ , how do I show that one of the $$\{{x_n}_i\}$$ is in that ball $$?$$ That will prove the density of the set $$\mathcal S$$ , right $$?$$

Please help. Thanks.

• The distance is symmetric. So $x_{ni} \in B(z,1/n) \iff z \in B(x_{ni},1/n)$. – Daniel Fischer Nov 26 '15 at 15:05
• @DanielFischer : Thanks. Now that looks really easy. – user118494 Nov 26 '15 at 15:08

1 Answer

From what Daniel Fischer wrote ,distance is symmetric .

So, when you choose any arbitrary point $z\in X$ and choose an arbitrary nbd $\mathcal N$ of $z$ . then $\exists$ $n$ such that $B(z,{1\over n})\subset \mathcal N$ . Now take the $1\over n$ balls of $X$ that cover $X$. $z$ must be in one of the balls , say $B({x_i}_n,{1\over n})$ Then notice that $d({x_i}_n,z)\lt {1\over n}$ which implies that $${x_i}_n\in B(z,{1\over n})$$. Thus proving that every point $z$ of $X$ is a limit point of the set $\mathcal S$ , i.e. $\mathcal S$ is dense in $X$.

So , we have our countable dense subset .