# Is there a bijection from $[0,1]$ to the Cantor set $C$?

Does there exist a bijective function $\phi$ from the unit interval $[0,1]$ to the Cantor set $C$? If so, how can it be constructed? I could then proceed to build a measure space ($C$, $\mathcal{M}_\phi$, $m_\phi$) where $m_\phi(E)$ = $m(\phi^{-1}(E))$ for $E \subset C$. How would $m_\phi(C) = 1$?

-
Questions of this kind are almost always easier to answer using Cantor-Bernstein-Schroeder than anything else. – Qiaochu Yuan May 21 '11 at 16:00
Sure, there's a bijective function, since the sets have the same cardinality, but it cannot be continuous, since $C$ is not connected. Is there some additional property that you want $\phi$ to have? – Thomas Andrews May 21 '11 at 16:01
You can identify the Cantor set with $\{0,1\}^{\mathbb{N}}$. Equipping it with the product measure $(\frac{1}{2} + \frac{1}{2})^{\mathbb{N}}$, it is "essentially the same" (i.e. isomorphic up to null-sets) to $[0,1]$ with the Lebesgue measure. The isomorphism is obtained by sending a $\{0,1\}$-sequence to a number having this binary expansion. This isn't a bijection, but almost. This seems to me the most natural thing to do. – t.b. May 21 '11 at 16:14
@all: Please have look at this recent question of the OP which should clarify the motivation. – t.b. May 21 '11 at 16:23
In my first comment I meant $(\frac{1}{2} \delta_{0} + \frac{1}{2}\delta_{1})^{\mathbb{N}}$. Sorry about that unfortunate typo. – t.b. May 21 '11 at 16:39

We look only at the less interesting part of the question, that of finding an explicit bijection from $[0,1]$ to the Cantor set $C$.

Certainly Cantor-Bernstein-Schroeder is perfectly constructive, and can be used to give an explicit, albeit messy, bijection.

But the "near-bijection" described by @mixedmath can be tweaked to produce an explicit bijection.

For any real number $x$ in $[0,1]$, let the canonical representation of $x$ be defined as follows. If $x$ is not a dyadic rational (that is, if $x$ does not have an eventually constant binary representation), the canonical representation of $x$ is the ordinary binary representation. If $x\ne 1$, and $x$ is a dyadic rational, the canonical representation of $x$ is the one that is eventually $0$'s. Finally, the canonical representation of $1$ is the representation with all $1$'s.

Now we define the bijection. If $x$ is not a dyadic rational, map $x$ to the number $y$ whose ternary representation replaces the $1$'s in the binary representation of $x$ by $2$'s, and leaves the $0$'s unchanged.

Suppose now that $x$ is a dyadic rational. Write down its canonical representation.

Let $x$ be a dyadic rational whose canonical representation begins with $0$. Remove the $0$, move the remaining bits one to the left. Then replace the $1$'s by $2$'s. Call the number which has this ternary representation $y$, and map $x$ to $y$.

Let $x$ be a dyadic rational whose canonical representation begins with $1$. Represent it in the "non-terminating form" that is, after a certain point all $1$'s. Remove the initial $1$, move all bits one to the left. Then replace the $1$'s by $2$'s. Call the number which has this ternary representation $y$, and map $x$ to $y$.

-
Okay, that seems to work. But as you're only changing the map on a countable set anyway, the measure won't be affected, so why bother? – t.b. May 21 '11 at 20:00
@Theo Buehler: For the fun of it. – André Nicolas May 21 '11 at 20:03
Fair enough :) – t.b. May 21 '11 at 20:16
Way cool! fillerfillerfiller – mixedmath May 23 '11 at 14:41

There happens to be a very simple near-bijection between the two. In short, consider the binary decimal representation of all the numbers in $[0,1]$ and consider the ternary representation of all the elements of the Cantor Set. Since the Cantor Set can be attained by removing the middle third repeatedly, the elements of the Cantor Set are exactly those whose ternary representations have only 0s and 2s.

Then a number such as $0.202202...$ in the Cantor set could be associated with the number $0.101101...$ in $[0,1]$. So the function is simply to send $c \to (\frac{c}{2})$, taking account of the obvious change of base of course.

There is a problem with double-representation, as pointed out by Q. Yuan. Namely, both $0.0222...$ and $0.2$ (in ternary) get sent to $0.1$ (in binary). But perhaps there is a quick work-around here.

However, this does not complete the second half of your question. And, in addition, this is not in the least continuous.

-
$c \mapsto \frac{c}{2}$ is not a correct description of this map, and it is also not a bijection; $0.0222...$ and $0.2$ are both sent to $0.1$. (That's why you should use Cantor-Bernstein-Schroeder to do these kinds of things.) – Qiaochu Yuan May 21 '11 at 16:15
@mixedmath: It's not $c\mapsto c/2$ because your formula mixes binary and ternary. – Grumpy Parsnip May 21 '11 at 16:31
@mixedmath: I don't think the OP really wants a bijection at all (but I might be wrong). See my comments to the question for more details about my interpretation (where you also have an interpretation of the measure that you should put on the Cantor set). Thus, I basically agree with your idea. – t.b. May 21 '11 at 16:39
@Theo, @Qiaochu: Ah! I believe you - this seems reasonable. Well, in that case I should apologize to Qiaochu - it seems he was right after all. (I note that I have confidence in Qiaochu to read the second @hisname even though it doesn't notify him - per meta standards ;p). – mixedmath May 21 '11 at 16:42
@mixedmath: I just pointed it out because it confused me at first. Btw I didn't downvote. – Grumpy Parsnip May 21 '11 at 17:12