# Formal Characterization of the Cantor Function on its Constant Intervals

Setting: Recall that one way of viewing the Cantor Set $C$ is the resulting set of what's left over by starting with the real closed interval $[0,1]$ and repeatedly removing open intervals of form

$$\left(\frac{3k+1}{3^m}, \frac{3k+2}{3^m} \right) \text{ for all } m = 1,2, \ldots \text{ and for each m all }k \in \{0,1,2,\ldots, 3^{m-1}-1\}$$

(except in case $m = 1$, in which case we let $k$ just be $0$).

Furthermore, recall the Cantor Function $F: [0,1] \rightarrow [0,1]$ (the "devil's staircase" function).

Question 1: Suppose $x \in \left(\frac{3k+1}{3^m}, \frac{3k+2}{3^m} \right) \subseteq [0,1]$ s.t. $m$ is the minimal integer for which a suitable $k$ can be chosen so that this membership relationship holds. Is the following characterization of the Cantor Function correct?

$$F(x) = \frac{\frac{3k}{2} +1}{2^m}$$

I've only seen it stated in other texts what values $F$ takes on in the first few intervals that are removed from $[0,1]$ (i.e., $(\frac{1}{3}, \frac{2}{3})$, $(\frac{1}{9}, \frac{2}{9})$, etc.) but not a formal characterization of how to express these values beyond the first few terms. Does mine capture it correctly (it seems to work for the first few terms)?

Question 2: Also, how do we know that

$$F(x) = \frac{\frac{3k}{2} +1}{2^m} \in [0,1]?$$

In an extreme case, it doesn't seem obvious to me that for $k = 3^{m-1} - 1$

$$\frac{\frac{3(3^{m-1} - 1)}{2} +1}{2^m} \in [0,1]$$

• Please don't use tags that are unrelated to your questions. In particular, this question has nothing to do with algebraic-topology. – Ayman Hourieh Feb 25 '14 at 20:23

An alternative way to view it: the Cantor set are all points $x \in [0,1]$ that have a ternary (base 3) expansion that contains only $0$'s and $2$'s, i.e. $x = \sum_{n \ge 1} \frac{a_n(x)}{3^n}$, where all $a_n \in \{0,2\}$. If such a ternary expansion exists, it is unique.
The Cantor Function $F$ maps $x$, defined by its expansion $(a_n(x))_n$ as above, to $F(x) = \sum_{n \ge 1} \frac{a_n(x)/2}{2^n}$, which is a well-defined binary expansion of a point in $[0,1]$.
The function $F$ defined this way is clearly increasing, onto $[0,1]$ and continuous.