[proofplan]
For each positive integer $n$, the assumed finite-net form of [total boundedness](/page/Total%20Boundedness) supplies a finite $1/n$-net $F_n \subset M$. The union $D := \bigcup_{n=1}^{\infty} F_n$ is countable because it is parametrised by countably many finite lists. Finally, for every point $x \in M$ and every radius $r > 0$, choosing $n$ with $1/n < r$ gives a point of $F_n \subset D$ inside $B(x,r)$, so every nonempty open ball meets $D$ and hence $D$ is dense.
[/proofplan]
custom_env
admin
[step:Handle the empty space separately]
If $M = \varnothing$, then $D := \varnothing$ is countable and $\overline{D} = \varnothing = M$. Thus $(M,d)$ is separable.
For the remainder of the proof, assume $M \neq \varnothing$.
[/step]
custom_env
admin
[step:Choose finite nets at every reciprocal scale]For each $n \in \mathbb{N}$, define $\varepsilon_n := 1/n$. By the finite-net hypothesis in the theorem statement, there exists a finite set $F_n \subset M$ such that
\begin{align*}
M \subset \bigcup_{a \in F_n} B(a,\varepsilon_n).
\end{align*}
Equivalently, for every $x \in M$ there exists $a \in F_n$ such that $d(x,a) < \varepsilon_n$.
Because $M \neq \varnothing$, no such $F_n$ is empty: if $F_n = \varnothing$, then the union on the right would be empty, contradicting $M \neq \varnothing$.[/step]
custom_env
admin
[guided]The purpose of this step is to extract approximating points at all scales. For each $n \in \mathbb{N}$, define the positive radius $\varepsilon_n := 1/n$. The finite-net hypothesis in the theorem statement says precisely that for this radius there is a finite set of centres whose open $\varepsilon_n$-balls cover the whole space. Thus there exists a finite set $F_n \subset M$ satisfying
\begin{align*}
M \subset \bigcup_{a \in F_n} B(a,\varepsilon_n).
\end{align*}
Unpacking the meaning of this cover gives the pointwise form we will use later: for every $x \in M$, there is some $a \in F_n$ with $x \in B(a,\varepsilon_n)$, which means
\begin{align*}
d(x,a) < \varepsilon_n.
\end{align*}
Since the metric is symmetric, this is the same as saying $a \in B(x,\varepsilon_n)$.
We also record that $F_n$ cannot be empty. If $F_n = \varnothing$, then $\bigcup_{a \in F_n} B(a,\varepsilon_n) = \varnothing$, so the displayed inclusion would force $M = \varnothing$, contrary to the standing assumption in this part of the proof.[/guided]
custom_env
admin
[step:Form a countable candidate dense set]
Define
\begin{align*}
D := \bigcup_{n=1}^{\infty} F_n.
\end{align*}
We prove that $D$ is countable.
For each $n \in \mathbb{N}$, since $F_n$ is finite and nonempty, let $m_n \in \mathbb{N}$ be its cardinality and choose a bijection
\begin{align*}
\phi_n: \{1,\dots,m_n\} \to F_n.
\end{align*}
Define the index set
\begin{align*}
E := \{(n,j) \in \mathbb{N} \times \mathbb{N} : 1 \leq j \leq m_n\}.
\end{align*}
Define the map
\begin{align*}
\Phi: E \to D
\end{align*}
by $\Phi(n,j) := \phi_n(j)$.
The map $\Phi$ is surjective: if $x \in D$, then $x \in F_n$ for some $n \in \mathbb{N}$, so $x = \phi_n(j)$ for some $j \in \{1,\dots,m_n\}$, and therefore $x = \Phi(n,j)$. Since $E \subset \mathbb{N} \times \mathbb{N}$ and $\mathbb{N} \times \mathbb{N}$ is countable, $E$ is countable. A surjective image of a [countable set](/page/Countable%20Set) is countable, hence $D$ is countable.
[/step]
custom_env
admin
[step:Show every open ball meets the candidate set]Let $x \in M$ and let $r > 0$. Choose $n \in \mathbb{N}$ such that $n > 1/r$; then
\begin{align*}
\frac{1}{n} < r.
\end{align*}
From the defining property of $F_n$, there exists $a \in F_n$ such that
\begin{align*}
d(x,a) < \frac{1}{n}.
\end{align*}
Since $F_n \subset D$, we have $a \in D$, and the preceding inequality gives
\begin{align*}
d(x,a) < r.
\end{align*}
Thus $a \in B(x,r) \cap D$, so every open ball centred at a point of $M$ with positive radius intersects $D$.[/step]
custom_env
admin
[guided]To prove density, we must show that $D$ comes arbitrarily close to every point of $M$. Fix a point $x \in M$ and a radius $r > 0$. The finite nets were chosen at the radii $1/n$, so we choose a reciprocal scale smaller than $r$. Choose $n \in \mathbb{N}$ such that $n > 1/r$; then
\begin{align*}
\frac{1}{n} < r.
\end{align*}
The set $F_n$ is a $1/n$-net for $M$. Therefore, applied to the particular point $x$, there is some point $a \in F_n$ satisfying
\begin{align*}
d(x,a) < \frac{1}{n}.
\end{align*}
Because $F_n$ is one of the sets used to build $D$, we have $F_n \subset D$, and hence $a \in D$. Combining the two inequalities gives
\begin{align*}
d(x,a) < r.
\end{align*}
This means $a \in B(x,r) \cap D$. Since $x \in M$ and $r > 0$ were arbitrary, every open ball in $M$ with positive radius meets $D$.[/guided]
custom_env
admin
[step:Conclude that the metric space is separable]
The previous step shows that every open ball in $M$ intersects $D$. Therefore every point $x \in M$ lies in the closure $\overline{D}$, so $\overline{D} = M$. Since $D$ is countable, $D$ is a countable [dense subset](/page/Dense%20Subset) of $M$. Hence $(M,d)$ is separable.
[/step]