[Math] Separable implies second countable

general-topologysecond-countableseparable-spaces

We have $(X,d)$ a metric space. The problem I want to prove is quite long so I'll just put what I need to get it:

  • if $X$ is compact then is separable
  • if $X$ is separable then is second countable

I've already proved the first one, but I'm having a trouble trying to prove the second. What I've been doing is, we take a dense set $A\subset X$, and because of the hypothesis we know is countable, I want to build the countable base from it. Lets take $p\in A$ fixed and an open set $U$ given by the topology induced by the metric $d$ and $p\in U$. But now things get confusing for me, on the one hand the topology given by $d$ is generated in terms of a base, on the second hand we have the countability of $A$, but I can't work this in a proper way. Is my approach wrong? Something tells me there is an easier way.

Best Answer

If $A$ is a countable dense set of $X$, take $C$ to be the collection of all balls with rational radius around points in $A$. Clearly $C$ is countable.

It is also a basis for the topology of $X$: Any neighborhood of any point $p\in X$ contains a ball $B$ of radius $3\epsilon$ if $\epsilon$ is small enough. Using the density of $A$, there is a point $q\in A$ with $d(p,q)<\epsilon$. There is a rational number $\delta$ between $\epsilon$ and $2\epsilon$. Then the $\delta$-ball around $q$ lies in $C$, contains $p$, and is itself contained in the ball $B$ by the triangle inequality.