Every countable metrizable spaces can be embedded in reals

general-topologymetric-spacessolution-verification

I want to prove that every countable metrizable spaces can be embedded in reals, using that the irrational numbers $\mathbb{P}$ are homeomorphic to the Baire space $\omega^\omega$. Let $(X, d)$ be a countable metric space. Fix an enumeration $(x_n)$ of $X$. Since $A := \{d(x, y) \mid x, y \in X\} \cup \mathbb{Q}$ and $\mathbb{Q} + \pi \subset \mathbb{P}$ are unbounded countable dense linearly ordered sets, we can find an order isomorphism $f\colon A \to \mathbb{Q} + \pi$ which can be extended to a unique homeomorphism $F\colon \mathbb{R} \to \mathbb{R}$. Let $g_n\colon X \to \mathbb{I}$ be defined as $g_n(x) = F(d(x, x_n))$. $\{g_n\}$ separates points from closed sets and $X$ is $T_0$, so $g\colon X \to \mathbb{P}^\omega$ defined as $[g(x)](n) = g_n(x)$ is a homeomorphic embedding. Since $\mathbb{P}^\omega \sim (\omega^\omega)^\omega \sim \omega^\omega \sim \mathbb{P} \subset \mathbb{R}$, we are done. Is this right?

Best Answer

A countable metric space embeds into $2^\omega=\{0,1\}^\omega$ via a countable clopen base (use the characteristic functions of the countable clopen base). And $2^\omega$ trivially embeds into $\Bbb P \simeq \omega^\omega$ and $\Bbb R$ (middle third set).