# Proving the continuity of the Cantor Function

Consider the Cantor Set $$C=\{0,1\}^{\omega}$$, that is, the space of all sequences $$(b_1,b_2,...)$$ with each $$b_i\in\{0,1\}$$. Define $$g:C\rightarrow[0,1]$$ by $$g(b_1,b_2,...)=\sum\limits_{i=1}^{\infty}\dfrac{b_i}{2^i}$$ In other words, $$g(b_1,b_2,...)$$ is the real number whose digits in base 2 are $$0.b_1b_2...$$

Prove that $$g$$ is continuous.

Here is my attempt:

Let sequences $$(a_n)_{n\in\mathbb{N}}$$ and $$(b_n)_{n\in\mathbb{N}}$$ be elements of the Cantor Set $$C.$$ For fixed $$n\in\mathbb{N}$$ let $$A_n=(a_1,a_2,...,a_n)$$ and $$B_n=(b_1,b_2,...,b_n)$$ be the first $$n$$ terms in each of those sequences. If $$A_n\neq B_n$$, then $$\exists m=min\{k\in\{1,2,...,n\}:a_k\neq b_k\}$$ and the following holds: $$\begin{array}{c} \left|\sum\limits_{k=1}^n\dfrac{a_k}{2^k}-\sum\limits_{k=1}^n\dfrac{b_k}{2^k}\right|=\left|\sum\limits_{k=1}^n\dfrac{a_k}{2^k}-\dfrac{b_k}{2^k}\right|\geq\dfrac{|a_m-b_m|}{2^m}-\left|\sum\limits_{k=m+1}^n\dfrac{a_k}{2^k}-\dfrac{b_k}{2^k}\right|\geq\\ \geq\dfrac{|a_m-b_m|}{2^m}-\sum\limits_{k=m+1}^n\dfrac{|a_k-b_k|}{2^k} \\ \text{where |a_m-b_m|=1 and}\\ \sum\limits_{k=m+1}^n\dfrac{|a_k-b_k|}{2^k}\leq \sum\limits_{k=m+1}^n\dfrac{1}{2^k}=\dfrac{1}{2^m}\\ \text{Now,}\\ \left|\sum\limits_{k=n+1}^{\infty}\dfrac{a_k}{2^k}-\sum\limits_{k=n+1}^{\infty}\dfrac{b_k}{2^k}\right|=\left|\sum\limits_{k=n+1}^{\infty}\dfrac{a_k-b_k}{2^k}\right|\leq\\ \leq\sum\limits_{k=n+1}^{\infty}\dfrac{|a_k-b_k|}{2^k}\leq\sum\limits_{k=n+1}^{\infty}\dfrac{1}{2^k}=\dfrac{1}{2^n}\\ \text{Therefore, if A_n\neq B_n, then}\\ \left|f(a)-f(b)\right|=\left|\sum\limits_{k=1}^{\infty}\dfrac{a_k-b_k}{2^k}\right|=\left|\sum\limits_{k=1}^{n}\dfrac{a_k-b_k}{2^k}+\sum\limits_{k=n+1}^{\infty}\dfrac{a_k-b_k}{2^k}\right|\geq\\ \geq\left|\sum\limits_{k=1}^{n}\dfrac{a_k-b_k}{2^k}\right|-\left|\sum\limits_{k=n+1}^{\infty}\dfrac{a_k-b_k}{2^k}\right|\geq\dfrac{1}{2^n}-\dfrac{1}{2^n}=0 \end{array}$$

I think I must have done something wrong because I wanted $$|f(a)-f(b)|$$ to be greater than or equal to something in terms of $$m$$ or $$n$$ so that I can say choose $$n$$ (or $$m$$) such that (something like) $$\dfrac{1}{2^n}<\varepsilon$$, but I just got 0 instead. How can I improve my proof so that I can achieve this?

• What topology are you putting on the set of sequences (as an aside I don't think I have ever seen that set called the Cantor set before). – Tobias Kildetoft Dec 1 '18 at 22:50
• The question didn't specify a specific topology, sorry. – 111 Dec 1 '18 at 23:12

Your method of proof will work. Taking your idea, I think we can streamline it, in the following way:

Let $$\epsilon>0$$ be given and let $$(\epsilon_k)$$ be the binary sequence representing $$\epsilon.$$ Take the ternary sequence for the $$\delta$$ (that we will show to work) to be $$\delta_k=2\epsilon_k$$.

Now, let $$N$$ be the first non-zero digit of $$\delta$$ and $$\epsilon.$$ Then, if $$|x-y|<\delta$$, it must be the case that $$x$$ and $$y$$ agree on the first $$N-1$$ digits. Hence, the first $$N-1$$ digits of $$g(x)$$ and $$g(y)$$ are the same, as well, by definition of $$g$$. But then, $$|g(x)-g(y)|<\epsilon.$$

• Thank you for your help. Should I omit the calculation in my proof that's says that $|f(a)-f(b)|\geq0$? This calculation does not seem to help me at all – 111 Dec 2 '18 at 2:56
• Yes, you can delete it, because all you have proven there is that if two numbers are not equal, then the absolute value of their difference is positive, which is, of course, true. Your basic idea is good, though. – Matematleta Dec 2 '18 at 3:02

You can prove a homeomorphism from $$[0,1]^\omega$$ with the product topology to the same set with the dictionary topology, and then use the fact that the functions from $$[0,1]^\omega$$ to $$[0,1]$$ are continuous as open sets in $$[0,1]$$ will give an open preimage in the dictionary order.

• I don't think $g$ is injective, is it? – 111 Dec 1 '18 at 23:37
• (1,0,0,...) and (0,1,1,...) will give the same number, so it isn't. – NL1992 Dec 1 '18 at 23:40