[step:Define the homeomorphism via the nested partitions]
Index the elements of $\mathcal{P}_n$ and $\mathcal{Q}_n$ by binary strings of length $n$: write $\mathcal{P}_n = \{P_\sigma : \sigma \in \{0,1\}^n\}$ and $\mathcal{Q}_n = \{Q_\sigma : \sigma \in \{0,1\}^n\}$, where $P_{\sigma 0}$ and $P_{\sigma 1}$ are the two children of $P_\sigma$, and similarly for $Q_\sigma$.
Define the map $f: X \to \mathcal{C}$ as follows. For $x \in X$, there is a unique infinite binary string $\sigma = (\sigma_1, \sigma_2, \ldots) \in \{0,1\}^{\mathbb{N}}$ such that $x \in P_{(\sigma_1, \ldots, \sigma_n)}$ for every $n$. Similarly, the sets $Q_{(\sigma_1, \ldots, \sigma_n)}$ form a nested sequence of nonempty compact subsets of $\mathcal{C}$ with diameters tending to $0$. By the nested compact set property, $\bigcap_{n=1}^{\infty} Q_{(\sigma_1, \ldots, \sigma_n)}$ is a single point $y \in \mathcal{C}$. Set $f(x) := y$.
**Well-definedness and bijectivity.** The map $f$ is well-defined because the intersection is a single point (diameters tend to $0$). The map is injective: if $f(x_1) = f(x_2)$, then $x_1$ and $x_2$ determine the same binary string $\sigma$, hence $x_1, x_2 \in P_{(\sigma_1, \ldots, \sigma_n)}$ for all $n$, and since $\operatorname{diam}(P_{(\sigma_1, \ldots, \sigma_n)}) \to 0$, we get $x_1 = x_2$. The map is surjective: for any $y \in \mathcal{C}$, there is a unique binary string $\sigma$ with $y \in Q_{(\sigma_1, \ldots, \sigma_n)}$ for all $n$, and the point $x = \bigcap_{n} P_{(\sigma_1, \ldots, \sigma_n)}$ satisfies $f(x) = y$.
**Continuity.** Let $x \in X$ and $\varepsilon > 0$. Choose $N$ such that $\operatorname{diam}(Q_{(\sigma_1, \ldots, \sigma_N)}) < \varepsilon$. The set $P_{(\sigma_1, \ldots, \sigma_N)}$ is a clopen neighbourhood of $x$, and $f(P_{(\sigma_1, \ldots, \sigma_N)}) \subset Q_{(\sigma_1, \ldots, \sigma_N)}$, which has diameter less than $\varepsilon$. Hence $f$ is continuous at $x$.
**$f$ is a homeomorphism.** Since $f$ is a continuous bijection from the compact space $X$ to the Hausdorff space $\mathcal{C}$, a continuous bijection from a compact space to a Hausdorff space is a homeomorphism (the same argument as in the proof of [Homeomorphism with the Product Space](/theorems/1202)).
[/step]