Metric Space is Separable iff Second-Countable

Theorem
Let $M = \left({X, d}\right)$ be a metric space.

Let $M$ be separable.

Then $M$ is second-countable.

Proof
By the definition of separability, we can choose a subset $S \subseteq X$ that is countable and everywhere dense.

Define:
 * $\mathcal B = \left\{{B_{1/n} \left({x}\right): x \in S, \, n \in \N_{>0}}\right\}$

where $B_{\epsilon} \left({x}\right)$ denotes the open $\epsilon$-ball of $x$ in $M$.

We have that the cartesian product of countable sets is countable.

Hence, by Mapping Image of Countable Set is Countable, it follows that $\mathcal B$ is countable.

Let $\tau$ denote the topology on $X$ induced by the metric $d$.

It suffices to show that $\mathcal B$ is an analytic basis for $\tau$.

Since an open ball is open, we have that $\mathcal B \subseteq \tau$.

We use Equivalent Definitions of Analytic Basis.

Let $y \in U \in \tau$.

By the definition of an open set, there exists a strictly positive real number $\epsilon$ such that $B_{\epsilon} \left({y}\right) \subseteq U$.

By the Archimedean principle, there exists a natural number $\displaystyle n > \frac 2 \epsilon$.

That is, $\displaystyle \frac 2 n < \epsilon$, and so $B_{2/n} \left({y}\right) \subseteq B_{\epsilon} \left({y}\right)$.

Since $\subseteq$ is a transitive relation, we have $B_{2/n} \left({y}\right) \subseteq U$.

By the definition of denseness, and by Equivalence of Definitions of Adherent Point, there exists an $x \in S \cap B_{1/n} \left({y}\right)$.

By axiom $\left({M3}\right)$ for a metric, it follows that $y \in B_{1/n} \left({x}\right)$.

For all $z \in B_{1/n} \left({x}\right)$, we have:

That is, $B_{1/n} \left({x}\right) \subseteq B_{2/n} \left({y}\right)$.

Since $\subseteq$ is a transitive relation, we have $y \in B_{1/n} \left({x}\right) \subseteq U$.

Hence the result.