__The Cantor Set__

Consider the closed interval [0,1]. The first stage of the construction
is to subdivide [0,1] into thirds and remove the interior of the middle
third; that is, remove the open interval (1/3,2/3). Each successive step
of the construction is then essentially the same. Thus, at the second stage,
we subdivide each of the remaining two intervals [0,1/3] and [2/3,1] into
thirds and remove their interiors (1/9,2/9) and (7/9,8/9), of their middle
thirds. We continue the construction for each of the remaining intervals. The general recursion which describes the construction can be summarized as: C_{n}=C_{n-1}/3∪(2/3+C_{n-1}/3).

The subset of [0,1] which remains after infinitely many such operations
is called the *Cantor set C*: thus, if C_{k} denotes the union
of the intervals left at the k-th stage, then C=∩_{k->∞}
C_{k}.

Since each C_{k} is closed, it follows that C is closed. Note
that C_{k} consists of 2^{k} closed intervals, each of
length 3^{-k}, and that C contains the endpoints of all these intervals.
Any point of C belongs to an interval in C_{k} for all k and is
therefore a limit point of the endpoints of the intervals. Thus C is perfect.
Finally, since C is covered by the intervals in any C_{k}, we have
|C|_{e}<=2^{k}3^{-k} for each k. =>|C|_{e}=0.

__The Cantor Function__

If D_{k}=[0,1]-C_{k}, then D_{k} consists of
the 2^{k}-1 intervals I_{j}^{k} (ordered from left
to right) removed in the k stages of construction of the Cantor set. Let
f_{k} be the continuous function on [0,1] which satisfies:

- f
_{k}(0)=0. - f
_{k}(1)=1. - f
_{k}(x)=j*2^{-k}on I_{j}^{k}, j=1,...,2^{k}-1. - is linear on each interval of C
_{k}.

By construction, each f_{k} is monotone increasing, f_{k+1}=f_{k}
on I_{j}^{k}, j=1,2,...2^{k}-1, and |f_{k}-f_{k+1}|<2^{-k}.
Hence, ∑(f_{k}-f_{k+1}) converges uniformly on [0,1]
and therefore, {f_{k}} converges uniformly on [0,1]. Let f=lim_{k->∞}f_{k}.
Then f is monotone increasing and continuous on [0,1] and f(0)=0 and f(1)=1.
Furthermore, f is constant on every interval removed in constructing C.
This f is called the *Cantor-Lebesgue function*.

Here are graphs of the Cantor Function, produced with the following Maple code:

> CF:=proc(a,b,c,d,n,x)

> option remember;

> if n=0 then

> solve((d-c)/(b-a)=(y-c)/(x-a),y);

> else #n>0

> piecewise(a<=x and x<=a+1/3*abs(a-b),CF(a,a+1/3*abs(a-b),c,c+1/2*abs(c-d),n-1,x),

b-1/3*abs(a-b)<=x and x<=b, CF(b-1/3*abs(a-b),b,d-1/2*abs(c-d),d,n-1,x),

c+1/2*abs(c-d));

> fi;

> end:

> for n from 0 to 5 do

> plot(CF(0,1,0,1,n,x),x=0..1,numpoints=300);

> od;

n=0

n=1

n=2

n=3

n=4

n=5

One can now construct some code to test whether values x in the interval [0,1] belong to the Cantor Set. For example, consider this modified Maple code, based on proc CF, above:

> CS:=proc(a,b,n,x)

> option remember;

> if n=0 then

> 1;

> else

> piecewise(a<=x and x<=a+1/3*abs(a-b),CS(a,a+1/3*abs(a-b),n-1,x),

b-1/3*abs(a-b)<=x and x<=b,CS(b-1/3*abs(a-b),b,n-1,x),

0);

> fi;

> end:

CS is the characteristic function of the Cantor Set, hence CS(0,1,n,x)=1 iff x belongs to the set, and 0 iff x does not belong. Let us test some values:

> CS(0,1,10,1/3);

1

Now let us make the investigation a bit more interesting. We know that the Cantor Set contains only ternary decimals consisting entirely of 0's and 2's. Let us check it directly with the Cantor Set characteristic function:

> b3tob10:=proc(L)

> local s;

> s:=sum(L[nops(L)-i+1]*3^(-i),i=1..nops(L));

> end:

> x:=b3tob10([2,0,0,2,0,2,0,0,0,0,0]); # this is 0.00000202002_{3}

> CS(0,1,10,x);

1 #bingo! In Cantor Set

> x:=b3tob10([2,2,2,2,2]); # this is 0.22222_{3}

> CS(0,1,10,x);

1 #bingo again!

Check a ternary with at least one 1 in its expansion:

> x:=b3tob10([2,2,2,1,2,0,0]); # this is 0.0021222_{3}

> CS(0,1,10,x);

0 # not in Cantor Set

__Problems__

- Construct a Maple graph of the Cantor Set based on the code for CS, above.
- If f(x) denotes the Cantor function on [0,1], show that ∫
_{0}^{1}f(x)dx=1/2. Hints: First way: Use the Cantor function identity: f(x)=1-f(1-x), which you should first prove. Second way:*stare*at the graphs!

"Dr.Liebermann, head of the mathematics department, orders the installation of new staircases everywhere in the department", Athens, 2009, pen on paper

- From Cartoons.