From Ternary Digits to Binary Values
The middle-thirds Cantor set is built by repeatedly deleting open middle thirds from the interval. Its points can be described by ternary expansions using only the digits 0 and 2. Replacing each ternary digit by half its value turns such a point into a binary expansion. This digit rule gives a continuous map from the Cantor set onto the whole interval, even though the Cantor set itself has no connected subsets containing more than one point.
We use the standard topology on \(\mathbb{R}\), and give every subset of \(\mathbb{R}\) its subspace topology. Write the Cantor set as
Thus the \(n\)th ternary digit is \(2a_n\), where \(a_n\) is either 0 or 1. We define the map \(f:C\to[0,1]\) by
Here that uniqueness holds. If two different digit sequences first differ at position \(k\), their contributions at that position differ by \(2/3^k\). The sum of all possible later contributions is at most \(\sum_{j>k}2/3^j=1/3^k\), which is strictly smaller. The two sequences therefore cannot give the same real number. In particular, the definition of \(f\) assigns exactly one value to each \(x\in C\).
Worked Example: The Ternary Digits 202
Take \(x=0.202000\ldots{}_3\), where the subscript indicates a ternary expansion. Its digits correspond to \(a_1=1\), \(a_2=0\), \(a_3=1\), and \(a_n=0\) for \(n\ge4\). Hence
Check: The binary digits \(101000\ldots{}_2\) have value \(1/2+0/4+1/8=4/8+1/8=5/8\), as specified by the formula for \(f\).
Why the Map Is Onto
To show that \(f\) is onto, we must show that every \(y\in[0,1]\) has a binary expansion \(\sum_{n=1}^{\infty}b_n/2^n\), with each \(b_n\in\{0,1\}\). We give a construction, including a separate choice for the endpoint \(y=1\).
Proof. First suppose \(0\le y<1\). For \(n\ge0\), let \(q_n=\lfloor 2^n y\rfloor\), where \(\lfloor t\rfloor\) is the greatest integer at most \(t\). In particular, \(q_0=0\). For \(n\ge1\), set \(b_n=q_n-2q_{n-1}\). To see that \(b_n\in\{0,1\}\), write \(2^{n-1}y=q_{n-1}+r\), where \(0\le r<1\). Then \(2^n y=2q_{n-1}+2r\), so its floor is either \(2q_{n-1}\) or \(2q_{n-1}+1\). This gives the claimed two possibilities for \(b_n\).
The partial sums telescope:
Since \(0\le y-q_n/2^n<1/2^n\), these partial sums converge to \(y\). Thus \(y=\sum_{n=1}^{\infty}b_n/2^n\). The point \(x=\sum_{n=1}^{\infty}2b_n/3^n\) belongs to \(C\), and the definition gives \(f(x)=y\). For \(y=1\), choose \(b_n=1\) for every \(n\). Then \(\sum_{n=1}^{\infty}b_n/2^n=1\), and \(x=\sum_{n=1}^{\infty}2/3^n=1\) belongs to \(C\), with \(f(x)=1\). Every point of \([0,1]\) is therefore in the image of \(f\). \(\square\)
Worked Example: Finding a Preimage of \(5/8\)
The binary expansion \(5/8=1/2+0/4+1/8\) has digits \(101000\ldots{}_2\). Replace these digits by ternary digits \(202000\ldots{}_3\). The resulting point is
It belongs to \(C\) because its ternary digits are all 0 or 2. Applying the map gives \(f(x)=1/2+0/4+1/8=4/8+1/8=5/8\). This verifies directly that \(20/27\) is a preimage of \(5/8\).
Binary Endpoint Ambiguities
Some numbers have two binary expansions. For example, a terminating expansion can be replaced by one that has a 1 in the preceding position and then only 0s, or by an expansion with a 0 in that position and then only 1s. The two digit sequences give the same sum. This does not make \(f\) ambiguous: the map is defined from the unique ternary digit sequence of its input, and different inputs in \(C\) are allowed to have the same image.
Worked Example: Two Cantor-Set Points Map to \(1/2\)
The binary expansions \(0.1000\ldots{}_2\) and \(0.0111\ldots{}_2\) both have value \(1/2\). The first gives the Cantor-set point with ternary expansion \(0.2000\ldots{}_3\), so its value is \(2/3\). The second gives \(0.0222\ldots{}_3\), whose value is
Both points lie in \(C\), and the map sends them to \(1/2\): the first has binary value \(1/2\), and the second has value \(\sum_{n=2}^{\infty}1/2^n=(1/4)/(1-1/2)=1/2\). So \(f\) is not one-to-one. For dyadic values below 1, the floor construction in the proof selects the terminating expansion; at \(y=1\), the chosen expansion is \(0.111\ldots{}_2\).
Worked Example: A Preimage of \(3/4\)
Use the binary expansion \(3/4=0.11000\ldots{}_2\). Its digits correspond to ternary digits \(22000\ldots{}_3\), giving
Then \(f(8/9)=1/2+1/4=2/4+1/4=3/4\). The alternative binary expansion \(0.10111\ldots{}_2\) also has value \(3/4\); its corresponding Cantor-set point is a different preimage.
Continuity from Initial Digits
Continuity follows because nearby points of \(C\) must share many initial ternary digits. For a finite word \(w=(2a_1,\ldots,2a_n)\), the points of \(C\) beginning with that word lie in the interval
The interval length \(1/3^n\) is the maximum possible contribution of the remaining ternary digits. If two points of \(C\) first differ at position \(k\), the difference between them is at least \(1/3^k\): the digit difference is \(2/3^k\), and later digits can offset it by at most \(\sum_{j>k}2/3^j=1/3^k\).
Proof. Let \(x,z\in C\), and suppose their first \(n\) ternary digits agree. Their corresponding binary digits then agree through position \(n\). The difference between their images is bounded by the largest possible difference in the tails:
Now let \(x\in C\) and let \(\varepsilon>0\). Choose \(n\ge1\) with \(2^{-n}<\varepsilon\), and set \(\delta=3^{-n}\). If \(z\in C\) satisfies \(|x-z|<\delta\), its first \(n\) ternary digits must agree with those of \(x\). Otherwise, if the first difference were at a position \(k\le n\), the preceding bound on differences would give \(|x-z|\ge3^{-k}\ge3^{-n}=\delta\), a contradiction. Therefore \(|f(x)-f(z)|\le2^{-n}<\varepsilon\). This is continuity at \(x\), and \(x\) was arbitrary. \(\square\)
A Totally Disconnected Domain and a Connected Image
A space is connected if it cannot be written as the union of two disjoint, nonempty sets that are open in the space. A space is totally disconnected if every connected subset contains at most one point. The Cantor set is totally disconnected: points with different digit sequences can be separated by sets determined by a finite initial string.
To see why those sets separate points, fix a length \(n\). For each word \(w\) of \(n\) ternary digits from \(\{0,2\}\), let \(C_w\) be the set of points of \(C\) beginning with \(w\). It lies in a closed interval of length \(3^{-n}\). The intervals for distinct words are separated by gaps: at the first differing digit, one lies in the left third of the corresponding interval and the other in the right third. There are only finitely many words of length \(n\), so each \(C_w\) and its complement in \(C\) are relatively open as well as relatively closed.
Proof. Let \(D\subseteq C\) contain distinct points \(x\) and \(z\). Their ternary digit sequences differ at some position \(n\). Take the length-\(n\) word shared by \(x\) and its preceding digits, and let \(C_w\) be its cylinder set. Then \(x\in C_w\) and \(z\notin C_w\). The set \(D\cap C_w\) is nonempty and proper in \(D\), and both it and its complement in \(D\) are relatively open because \(C_w\) and its complement are open in \(C\). Thus \(D\) is not connected. No connected subset of \(C\) can contain two distinct points, which proves the claim. \(\square\)
The interval \([0,1]\) is connected. For completeness, suppose it were the union of disjoint nonempty relatively open sets \(U\) and \(V\). Choose one point from each, and relabel the sets if necessary so that \(a\in U\), \(b\in V\), and \(a<b\). Let \(c=\sup(U\cap[a,b])\), which exists by completeness of \(\mathbb{R}\). If \(c\in U\), then \(c\ne b\), and relative openness of \(U\) gives points of \(U\cap[a,b]\) greater than \(c\), contradicting the definition of the supremum. If \(c\in V\), then \(c>a\), and relative openness of \(V\) gives a neighborhood of \(c\) in \([0,1]\) contained in \(V\). The supremum property gives a point of \(U\cap[a,b]\) in that neighborhood below \(c\), contradicting \(U\cap V=\varnothing\). Both cases are impossible, so the interval is connected.
Consequently, the continuous surjection \(f:C\to[0,1]\) exhibits a connected continuous image of a totally disconnected space. The essential point is that continuity preserves connectedness of an image when the domain is connected; it does not say that every continuous image of a totally disconnected space must remain totally disconnected.
Common pitfall. A tempting but false claim is that a continuous image of a totally disconnected space is always totally disconnected. The map constructed here is a counterexample: its domain \(C\) is totally disconnected, but its image is all of \([0,1]\), which is connected and contains distinct points. The map is not a homeomorphism, since it is not one-to-one; in particular, the two distinct points \(1/3\) and \(2/3\) both map to \(1/2\).
Check Your Understanding
Use the digit rule and the definitions of connectedness and continuity to answer the following.
- Find a point of \(C\) that maps to \(1/4\), and check its image by summing the binary digits.
- What point of \(C\) maps to \(0\), and what point maps to \(1\)?
- Explain why two distinct binary expansions of the same number do not make the definition of \(f\) ambiguous.
- Why does agreement of the first \(n\) ternary digits imply that the images differ by at most \(2^{-n}\)?
- Identify the connected subset of the image that demonstrates that \(f(C)\) is not totally disconnected.