# All separable zero-dimensional metric spaces can be embedded into the Cantor set

In this question, the answerers prove that every separable zero-dimensional metric space can be topologically embedded into $$\mathbb{N}^\mathbb{N}$$, but I think more is true. I think I have a proof that a topological space can be topologically embedded into the Cantor set (or rather, its topological equivalent $$\{0,1\}^\mathbb{N}$$) if and only if it is a separable zero-dimensional metrizable space.

First every subspace of the Cantor set is clearly a separable zero-dimensional metrizable space. Conversely, let $$X$$ be any separable zero-dimensional metrizable space. Then $$X$$ has a basis consisting of clopen sets $$\mathscr{B}$$. Since $$X$$ is separable and metrizable, it is second-countable, so $$\mathscr{B}$$ has a countable subset $$\{B_0,B_1,\ldots\}$$ which is also a basis (see here or here).

Define a function $$f:X\to\{0,1\}^\mathbb{N}$$ by $$f(x)=(a_i)_{i\in\mathbb{N}}$$ where $$a_i=1$$ if and only if $$x\in B_i$$. To see that $$f$$ is continuous, it is sufficient to check product topology prebasis elements. Indeed, if $$\pi_j:\{0,1\}^\mathbb{N}\to\{0,1\}$$ is the $$j$$th projection map, then $$f^{-1}(\pi_j^{-1}(\{1\}))=B_j$$ and $$f^{-1}(\pi_j^{-1}(\{0\}))=X\setminus B_j$$ which are both open. Finally, to see that $$f$$ is a topological embedding, simply note that $$f(B_j)=\pi_j^{-1}(\{1\})\cap f(X)$$ which is open in $$f(X)$$.

My proof feels remarkably simpler than the ones I saw in the first question I linked, so I am left to wonder if I made an error somewhere. Additionally, being metrizable only seemed necessary in my proof to guarantee second-countability, so I think the "separable zero-dimensional metrizable" condition could be replaced with "second-countable zero-dimensional".

Is my reasoning correct?

• If you already know that every zero-dimensional separable metric space is embeddable in $\mathbb N^\mathbb N$, then all you need for your generalization is to show that $\mathbb N^\mathbb N$ is embeddable in the Cantor set $\{0,1\}^\mathbb N$. In fact you just have to show that $\mathbb N$ is embeddable in $\{0,1\}^\mathbb N$, because then $\mathbb N^\mathbb N$ is embeddable in $(\{0,1\}^\mathbb N)^\mathbb N=\{0,1\}^{\mathbb N\times\mathbb N}=\{0,1\}^\mathbb N$. – bof May 14 at 23:13
• @bof Ah, great point. I wasn't even thinking about the fact that $\mathbb{N}^\mathbb{N}$ embeds into $\{0,1\}^\mathbb{N}$. Thank you! – Anonymous May 15 at 3:10

A second countable zero-dimensional Hausdorff space is metrisable and embeddable so it's not really a win in generality to replace separable metrisable zero-dimensional by that the former condition. The Hausdorff I added because it's needed anyway to embed into the (Hausdorff!) Cantor cube $$\{0,1\}^{\Bbb N}$$. You could even use the fact that a space as I described in the first line embeds into it (and so must be metrisable) as a proof for the first statement.
The continuity of $$f$$ is clear because $$\pi_n \circ f$$ is just the characteristic function of a clopen set $$B_n$$ (so is continuous). $$f$$ is 1-1 and an embedding because the family of those characteristic functions separates point, and points and closed sets, which is the general argument for such a product map to be an embedding; no special need for a zero-dimensional version of the old argument. In your proof you don't mention (though it's true) that $$f$$ is 1-1. You should expand your argument why $$f[B_j]= \pi_j^{-1}[\{1\}] \cap f[X]$$ to have a full self-contained proof, not just claim it; it's not very hard though.
• I see where I made an error in my proof: As you said, I didn't show that $f$ was injective, but indeed this follows if $X$ is at least $T_0$ as all metric spaces are. Thus, I see now why I can't replace "separable zero-dimensional metrizable" with "second-countable metrizable", but I could replace it with "second-countable zero-dimensional $T_0$" and the proof should go through. Thanks! – Anonymous May 15 at 3:08
• @Anonymous zero-dimensional $T_0$ implies $T_2$, so that's a minor generalisation, only if you want the "bare minimum" on demands: all are necessary conditions to be a subspace of the Cantor cube of countable weight, and combined they are sufficient. – Henno Brandsma May 15 at 4:56
• @Anonymous It depends on whether you include $T_1$ into regular or not (if you do it's often called $T_3$). It's true that for zero-dimensional spaces all conditions $T_0, T_1, T_2, T_3, T_{3\frac12}$ are mutually equivalent, so if you strive for minimalism you state $T_0$ otherwise one of the others. I chose Hausdorff because that's most directly linked to the point-separation property that gives injectivity. Point remains, and we all agree on that: a separation axiom is needed. – Henno Brandsma May 15 at 9:08
• @Anonymous yes, $T_0$ gives injective $f$. So we have an embedding and thus $T_{3\frac12}$ too, which implies all the lower ones. QED. – Henno Brandsma May 15 at 9:58