---
tag: 542SG6445R
kind: proof
name: Proof that the Cantor set is homeomorphic to the space of binary sequences
msc: [54F65]
proves: 0RQ8DHHR8V
uses: [0BXNDZFQME, 0S2TEHX4E1, 04S9HX3GAP, 05GZ11PWRY, 0JTRSJKCFB, 0430ETCMKD, 0QPHW703PV, 0MXB4CKHFW, 0D5YHQGDJY, 0A26X79RTB, 0SY9ECQ19Q, 04Z5G0THN6, 01X5CVV1Q5]
sources:
  - url: https://en.wikipedia.org/wiki/Cantor_space
    locator: Examples
---

## Proof

We describe the intervals of each stage by binary words, show that $\varphi$ is a continuous bijection, and conclude by compactness.

1. For a word $w = (w_1, \ldots, w_n) \in \{0, 1\}^n$, let $\sigma(w) = \sum_{k=1}^{n} 2 w_k / 3^k$ and $I_w = [\sigma(w), \sigma(w) + 3^{-n}]$. For $n = 0$, the empty word gives $I = [0, 1]$.
2. Removing the open middle third of $I_w$ leaves $[\sigma(w), \sigma(w) + 3^{-n-1}] = I_{w0}$ and $[\sigma(w) + 2 \cdot 3^{-n-1}, \sigma(w) + 3^{-n}] = I_{w1}$. Here $w0$ and $w1$ are $w$ followed by $0$ or $1$.
3. By induction on $n$ and the construction of the [[Cantor set|0BXNDZFQME]], the closed intervals of $C_n$ are the $I_w$ with $w \in \{0, 1\}^n$.
4. By step 2, $I_{wv} \subseteq I_w$ for each extension $wv$ of $w$.
5. Distinct words $w \neq w'$ of length $n$ give disjoint intervals. Let $k$ be the first index with $w_k \neq w'_k$, say $w_k = 0$ and $w'_k = 1$, and let $u$ be the common first $k - 1$ letters.
6. By step 4, $I_w \subseteq I_{u0} = [\sigma(u), \sigma(u) + 3^{-k}]$ and $I_{w'} \subseteq I_{u1} = [\sigma(u) + 2 \cdot 3^{-k}, \sigma(u) + 3^{-k+1}]$. These two intervals are disjoint.
7. For $a = (a_n)_{n \ge 1} \in \{0, 1\}^{\mathbb{N}}$, write $a|n = (a_1, \ldots, a_n)$. The series for $\varphi(a)$ has nonnegative terms bounded by $2/3^k$, so it converges by the [[comparison test|04Z5G0THN6]] and the [[geometric series|01X5CVV1Q5]]. Also $\sigma(a|n) \le \varphi(a) \le \sigma(a|n) + \sum_{k > n} 2/3^k = \sigma(a|n) + 3^{-n}$.
8. So $\varphi(a) \in I_{a|n} \subseteq C_n$ for each $n$, and $\varphi(a) \in C$. Thus $\varphi$ maps into $C$.
9. $\varphi$ is injective. If $a \neq b$, let $n$ be an index with $a_n \neq b_n$. Then $a|n \neq b|n$, and $\varphi(a) \in I_{a|n}$, $\varphi(b) \in I_{b|n}$, which are disjoint by step 5.
10. $\varphi$ is surjective. Let $x \in C$. For each $n$, $x \in C_n$, so by steps 3 and 5 there is exactly one word $w^{(n)}$ of length $n$ with $x \in I_{w^{(n)}}$.
11. The first $n$ letters of $w^{(n+1)}$ form a word $v$ with $x \in I_{w^{(n+1)}} \subseteq I_v$, by step 4. By uniqueness, $v = w^{(n)}$.
12. So there is one sequence $a$ with $a|n = w^{(n)}$ for all $n$. Then $x$ and $\varphi(a)$ both lie in $I_{a|n}$, so $|x - \varphi(a)| \le 3^{-n}$ for all $n$. Hence $x = \varphi(a)$.
13. $\varphi$ is continuous. Give $C$ the [[subspace topology|0D5YHQGDJY]]. Let $O \subseteq \mathbb{R}$ be open and $a \in \varphi^{-1}(C \cap O)$. By [[the ball criterion|0A26X79RTB]], some $(\varphi(a) - \varepsilon, \varphi(a) + \varepsilon)$ lies in $O$.
14. Choose $N$ with $3^{-N} < \varepsilon$. Let $W$ be the set of $b$ with $b_k = a_k$ for $1 \le k \le N$. Then $W = \bigcap_{k=1}^{N} \pi_k^{-1}(\{a_k\})$, where $\pi_k(b) = b_k$ is the $k$-th projection.
15. Each $\{a_k\}$ is open in the [[discrete topology|0S2TEHX4E1]], so $W$ is a finite intersection of open sets of the [[product topology|04S9HX3GAP]]. So $W$ is open, and $a \in W$.
16. For $b \in W$, $\varphi(a)$ and $\varphi(b)$ both lie in $I_{a|N}$, so $|\varphi(b) - \varphi(a)| \le 3^{-N} < \varepsilon$. So $W \subseteq \varphi^{-1}(C \cap O)$.
17. Thus $\varphi^{-1}(C \cap O)$ is a union of open sets, hence open, and $\varphi$ is [[continuous|0SY9ECQ19Q]].
18. The space $\{0, 1\}$ is [[compact|0QPHW703PV]]: from an open cover, one member containing $0$ and one containing $1$ form a finite subcover. By [[Tychonoff's theorem|0JTRSJKCFB]], $\{0, 1\}^{\mathbb{N}}$ is compact.
19. $C$ is [[Hausdorff|0MXB4CKHFW]]. For $x \neq y$ in $C$, let $r = |x - y| / 2$. Then $C \cap (x - r, x + r)$ and $C \cap (y - r, y + r)$ are disjoint open sets of $C$ that contain $x$ and $y$.
20. So $\varphi$ is a continuous bijection from a compact space to a Hausdorff space. By [[this theorem|0430ETCMKD]], it is a [[homeomorphism|05GZ11PWRY]] onto $C$.

## Idea

The binary word $a_1 \ldots a_n$ records which of the $2^n$ intervals of the $n$-th stage contains $\varphi(a)$. Distinct words give disjoint intervals, which makes $\varphi$ a bijection, and agreeing on many first terms means being in the same tiny interval, which gives continuity. Compactness of the sequence space then makes the inverse continuous for free.
