Showing this function on the Cantor set is onto [0,1]

The excerpt below is taken from Rosenthal's A First Look at Rigorous Probability. $K$ refers to the cantor set. My question refers to the statement "It is easily checked that $f(K) =[0,1]$. I am thinking that this can by proved by taking any number in $[0,1]$, writing the binary expansion for it (that is, write it of the form $\sum_{n=1}^\infty b_n\cdot2^{-n},\ b_n\in \{0,1\}$ and then show that there is a point in the cantor set that will give $d_n = b_n \forall n$. How would I do this last step? That is, how would I show that such a point exists in the cantor set, $K$?

To state the question again: how I would show that there is a $y\in K$ which corresponds to some point in $[0,1]$?

A secondary question is: Can we show that $f(K) = [0,1]$, where $f$ is as in the attached image, without explicitly using binary/ternary expansions, and preferably also not using compactness? It is not important that this secondary question is answered: if the first question is answered and this one is not, I will select an answer for the question and then probably just create a separate question eventually for this and add a bounty if necessary.

Thank you.

Note: This question is technically addressed here, but the answers seems to say to me "here is a function, it is a surjection, without explaining why it is a surjection.

• I think that the author assumes that the reader is familiar with binary expansions. – Akiva Weinberger Dec 17 '15 at 20:07
• @AkivaWeinberger That is very possible. I have changed the original question to reflect that fact, and (arguably) make it easier to answer. – majmun Dec 17 '15 at 20:15
• The map $(a_n) \to \sum a_n/3^n$ is a bijection from the set of binary sequences onto $K.$ That seems to be an easier way to see the uncountability of $K.$ Just sayin … – zhw. Dec 17 '15 at 21:35
• @zhw. Perhaps the author assumes that the reader knows $[0,1]$ is uncountable but doesn't want to assume they know that the set of binary sequences is uncountable. Which would be odd, since the proofs are nearly identical. – Akiva Weinberger Dec 17 '15 at 22:51
• @AkivaWeinberger In fact the uncountability of the binary sequences is a cleaner easier proof. – zhw. Dec 17 '15 at 22:55

The quoted argument is probably intended to be filled in as follows. Let $x\in[0,1]$; then $x$ has a binary expansion

$$x=\sum_{k\ge 1}\frac{b_k}{2^k}\;,$$

where each $b_k\in\{0,1\}$. The sequence $\langle b_k:k\in\Bbb Z^+\rangle$ now defines a nest of closed intervals as follows.

Let $I_0=[0,1]$. Given $I_k$ for some $k\in\Bbb N$, let $I_{k+1}$ be the closed left third of $I_k$ if $b_{k+1}=0$, and let $I_{k+1}$ be the right closed third of $I_k$ if $b_{k+1}=1$. The sequence $\langle I_k:k\in\Bbb N\rangle$ is a decreasing nest of closed intervals, so $\bigcap_{k\in\Bbb N}I_k\ne\varnothing$. On the other hand, the length of $I_k$ is $3^{-k}$, so the diameter of $\bigcap_{k\in\Bbb N}I_k$ is $0$, and it follows that there is a unique $y\in\bigcap_{k\in\Bbb N}I_k$.

All that remains is to verify that $x=f(y)$, which can be done by showing that $b_k=d_k(y)$ for each $k\in\Bbb Z^+$. But this is clear from the construction of the intervals $I_k$: for each $k\in\Bbb N$ we have $d_{k+1}(y)=0$ iff $y$ is to the left of the nearest open interval removed at step $k+1$ iff $I_{k+1}$ is the closed left third of $I_k$ iff $b_{k+1}=0$.

• Thank you. This is what I was looking for, as it is much cleaner than what I was working on. One thing I wish to point out for anyone else looking at this is that $\cap_{k\in\mathbb{N}}I_k \not = \varnothing$ is Cantor's Intersection Theorem, I believe. – majmun Dec 18 '15 at 14:54
• @majmun: You're welcome. – Brian M. Scott Dec 18 '15 at 16:11
• sorry, you may have made a typo? $d_k(y)=0$ iff $y$ is to the left of the nearest open interval removed at step $k$ iff $I_k$ is the closed left third of $I_{k-1}$ iff $b_k = 0$? Or, easier correction, $d_{k+1} = 0$ iff ... (what is in your post). – majmun Dec 28 '15 at 0:10
• @majmun: Yes, that was supposed to be $d_{k+1}(y)$; thanks. – Brian M. Scott Dec 29 '15 at 20:20