# Every metric compact set can be embedded in the Hilbert cube

Every metric compact space $X$ can be embedded in the space $Q=\prod_{n\in \mathbb{N}}[0,1]_n$. ($Q$ is given the product topology).

Let $\mathcal{B}=\{B_1, B_2,\ldots\}$ a countable basis for $X$ and let $A=\{(U,V)\in \mathcal{B}\times \mathcal{B}\mid Cl(U)\subset V\}$. Then $A$ is countable. Let $(U,V)\in A$ arbitrary. $Cl(U)$ and $X\setminus V$ sare closed in $X$ and $Cl(U)\cap X\setminus V=\emptyset$, by Urysohn's Lemma, there exists $f_{(U,V)}:X\to [0,1]$ continuous such that $$f(Cl(U))\subset \{0\} \text{ and}$$ $$f(X\setminus V)\subset \{1\}.$$ We ennumerate the elements of $A$ and take for each $n\in \mathbb{N}$ $f_n:X\to [0,1]$ defines as before. Let $F:X\to Q$ defined as follows: $$F(x)=(f_1(x), f_2(x), \ldots).$$ Then $F$ is continuous. It remains to see that $F$ is injective. Let $a,b\in X$ $a\neq b$. Because $X$ is metric, $\{a\}$ y $\{b\}$ are closed, there exists $M$ and $N$ open such that $$\{a\}\subset M\subset Cl(M)\subset X\setminus \{b\}, \text{ and}$$ $$\{b\}\subset N\subset Cl(N)\subset X\setminus \{a\}.$$ So we can find basic sets $B_i$ and $B_j$ such that $$\{a\}\subset B_i\subset M\subset Cl(M)\subset X\setminus \{b\}, \text{ y}$$ $$\{b\}\subset B_j \subset N\subset Cl(N)\subset X\setminus \{a\}.$$

I can't seem to conclude from this that $F$ is injective.

$a$ and $b$ are distinct so we can find a base element $B_1$ such that $a \in B_1 \subseteq X\setminus \{b\}$. By regularity find an open set $O$ such that $a \in O \subseteq \overline{O} \subseteq B_1$. Inside $O$ find another basic element $B_2$ such that $a \in B_2 \subseteq O$.
Then the pairs $(B_2, B_1)$ is in $A$ (as $\overline{B_2} \subseteq \overline{O} \subseteq B_1$). And $a \in B_2$ and $b \in X\setminus B_2$ (from $B_2 \subseteq X\setminus\{b\}$) so the $f_n$ corresponding to this pair has $f_n(a) = 0 \neq 1 = f_n(b)$ by construction, hence $F(a) \neq F(b)$
We can do this argument in any $T_3$ second countable space (which paves the way for Urysohn's metrisation theorem)
• @416333 with compactness given you're done showing $F$ is an embedding. But it is in fact always an embedding (for second countable $T_3$ spaces) showing all such spaces are homeomorphic to a subspace of the metric space $Q$, and thus metrisable. This is a bit more of an argument. You need that the $f_n$ separates points from closed sets: for every closed $C \subset X$ and $x \notin C$ there is some $n$ such that $f_n(x) \notin \overline{f_n[C]}$ .This can be shown to hold with a similar argument. – Henno Brandsma Apr 14 '17 at 4:53
I recall a similar approach to the one you're giving using the fact that a compact metric space is separable. (A proof here). Let $A=\{a_1,a_2,...\}$ be a countable dense subset of $X$. You can always bound a metric in a metric space such that it is bounded by 1 mantaining the same topology on $X$ (A discussion of this fact here). Then define the following map. $$f: X \to Q\\ f(x) = (d'(x,a_n))_{n\in\mathbb{N}} \quad\text{where d' is the bounded metric.}$$ By the same argument you gave $f$ is continuous. Injectivity here is easier. Suppose $x \neq y$ then there exists a $N\in\mathbb{N}$ (why?) such that $d'(x,a_N) \neq d'(y,a_N)$ thus $f(x)\neq f(y)$.