# Map From the Cantor Set to the Unit Interval

Let $f: C \rightarrow I$ map each point of the middle third Cantor set $C$, expressed as a ternary number which contains only digits $0$ and $2$, to the set of real numbers in $I=[0,1]$ expressed in base $2$ according the the rule:

$0.a_1a_2a_3...\rightarrow 0.b_1b_2b_3...$

where $b_i = \frac{a_i}{2}$.

How do I prove this map is continuous?

• Wikipedia claims, Cantor set is a metric space equipped with inherited topology, and you can easily show, it is a Lipschitz with a constant $\frac{1}{2}$. – dEmigOd Apr 24 '18 at 7:59
• @dEmigOd Your claim is not correct, because $f(1)-f(0)=1$. In fact, the map sends hollow intervals of $C$ of length $3^{-k}$ to full intervals of length $2^{-k}$, giving for each of those an "expansion factor" of at least $\frac{2^{-k}}{3^{-k}}=1.5^k$. So, the map is not Lipschitz. Perhaps it might be Holder, I don't know. – user228113 Apr 24 '18 at 8:24
• My previous comment is wrong (since this is not decimal expansions!). But I don't see how you take something like $0.0222..._3$ and $0.2_3$ and send it to something of length $2^{-1}$ and not 0? – dEmigOd Apr 24 '18 at 10:05
• @G.Sassatelli It should be Holder-continuous with exponent $\log 2/\log 3$. – Erick Wong Apr 24 '18 at 17:20

## 2 Answers

Fix a ternary expansion $$x = \frac{a_1}{3} + \frac{a_2}{3^2} + \frac{a_3}{3^3} + \ldots,$$ where $a_n = 0, 2$ for all $n$. Further, fix $\varepsilon > 0$. Choose an $m \in \mathbb{N}$ such that $2^{-m} < \varepsilon$. Note that two binary expansions are within $2^{-m}$ if they agree up to their $m$th bit. That is, necessarily, $$\left|\left(\frac{b_1}{2} + \ldots + \frac{b_m}{2^m} + \frac{b_{m+1}}{2^{m+1}}+\ldots\right) - \left(\frac{b_1}{2} + \ldots + \frac{b_m}{2^m} + \frac{b'_{m+1}}{2^{m+1}}+\ldots\right)\right| < 2^{-m} < \varepsilon.$$ Consider another ternary expansion $$y = \frac{b_1}{3} + \frac{b_2}{3^2} + \frac{b_3}{3^3} + \ldots.$$ If $x \neq y$, then the ternary expansions must differ (note: this is not true in general, but true in our case since we are taking only ternary expansions with $0$ and $2$ trits). Let $k$ be the first digit that differs, that is, $b_k \neq a_k$, but $b_n = a_n$ for $n < k$. Then $|a_k - b_k| = 2$, and \begin{align*} |x - y| &\ge \frac{|a_k - b_k|}{3^k} - \frac{|a_2 - b_2|}{3^{k+1}} - \frac{|a_3 - b_3|}{3^{k+2}} - \ldots \\ &\ge \frac{2}{3^k} - \frac{2}{3^{k+1}} - \frac{2}{3^{k+2}} - \ldots = \frac{1}{3^k}. \end{align*} Therefore, if we set $\delta = 3^{-m}$, then $|y - x| < \delta$ implies that the ternary expansion agrees at least to $m$ trits. Thus, $f(y) - f(x)$ agree to $m$ bits, hence $|f(y) - f(x)| < 2^{-m} < \varepsilon$. This proves continuity.

For $x\in C$ and $\epsilon >0$, take $n\in \Bbb N$ with $2^{-n}<\epsilon$ and let $\delta=3^{-n}.$

If $x\ne y\in C$ let the $k$th digit-place be the least place (to the right of the decimal point) where their digits of $x,y$ in base-$3$ are unequal. Then $|x-y|\ge 2\cdot 3^{-k}-(0\cdot 3^{-k}+\sum_{j=1}^{\infty}2\cdot 3^{-k-j})=3^{-k}.$

So if $y\in (-\delta+x,\delta+x)\cap C$ then $k\geq n,$ so $f(x),f(y)$ have the same first $n$ digits in base-$2$, so $|f(x)-f(y)|\leq 2^{-n}<\epsilon.$

• The graph of $f$ has been called the Devil's Staircase because it is differentiable with derivative $0,$ except on $C$ (a set of measure $0$) yet $f$ is not constant. – DanielWainfleet Apr 24 '18 at 17:17