Metric Space is Separable iff Second-Countable

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

Then $M$ be separable iff $M$ is second-countable.

Sufficient Condition
We have from Second-Countable Space is Separable that second-countability implies separability in all topological spaces regardless of whether they are metric spaces or not.

Necessary Condition
Let $M$ be a separable space.

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 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$.

From Open Ball is Open Set, 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)$.

From Subset Relation is Transitive, we have $B_{2/n} \left({y}\right) \subseteq U$.

By the definition of everywhere 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)$.

From Subset Relation is Transitive, we have $y \in B_{1/n} \left({x}\right) \subseteq U$.

Hence the result.