An Introduction to Space-Filling Curves
1407493
1
Contents
1 Introduction
1.1 Notation and Definitions . . . . . . . . . . . . . . . . . . . . . . .
3
4
2 Peano’s Space-Filling Curve
2.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5
5
5
3 Hilbert’s Space-Filling Curve
3.1 Definition . . . . . . . . . . . . . . . . .
3.2 Properties . . . . . . . . . . . . . . . . .
3.3 Complex and Arithmetic Represenation
3.4 Generalisation to 3-Dimensions . . . . .
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
12
13
13
14
16
4 Lebesgue’s Space-Filling Curve
17
4.1 Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2 Properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
2
Abstract
This paper should be interpreted as an introduction to the concept
of space filling curves. Looking at examples created by Peano, Hilbert
and Lebesgue. Such curves have motivation in computer science as an
efficient way to traverse multi-dimensional data. The contents throughout
is heavily influenced by what is one of the only books to really study the
subject, Han’s Sagan’s Space Filling Curves [1].
1
Introduction
We start with a definition fundamental to geometry.
Definition 1. [2] An n-dimensional manifold is a topological space M for
which every point x ∈ M has a neighbourhood homeomorphic to Euclidean
space En .
That is for each point in M we can find a neighbourhood X such that there
exist’s a continuous mapping
f : X → En
Where the inverse f −1 is also continuous.
The following description adapted from Wikipedia [3] I believe helps understand the idea.If we describe these invertible maps from En to each of our
subspaces X as a chart, with the collection of them being an atlas. We can
consider the transition maps betwen any two charts, i.e. the composition of one
chart with the inverse of another. If the transition maps for every chart are differentiable then the manifold M is said to be a differentiable manifold, further
specialisation of this idea is the smooth manifold for which every transition map
is C ∞ (the derivatives of all orders exist). Examples of such smooth manifolds
are the closed unit-hypercubes (the n-dimensional analogue of the unit square),
the Möbius Strip, or even circles and lines in 2 dimensions.
In 1878 the German mathematician George Cantor proved that for any two
finite-dimensional smooth manifolds there exists a bijective mapping from one
to the other. That is the cardinalities of any two finite-dimensional smooth
manifolds are equal. This has a rather remarkable consequence that the interval
[0, 1] can be mapped bijectively onto the square [0, 1] × [0, 1]. This can be
demonstrated easily as I’ve done below. A more in depth construction can be
found at [4, p. 3]
Theorem 1. There exists a bijection f : [0, 1] → [0, 1]2
Proof. We represent (x, y) ∈ [0, 1]2 \{(0, 0)} by it’s unique infinite decimal expansion.
(x, y) = (0.x1 x2 x3 . . . , 0.y1 y2 y3 . . .)
Such that we dont end in a string of infinite zeros, i.e ∀N ∈ N, ∃ p, q >
N such that xp 6= 0 and yp 6= 0. In this way 0.36 would be represented 0.359999 . . ..
Then consider the function
(
0
if (x,y)=(0,0)
f (x, y) =
0, x1 y1 x2 y2 x3 y3 . . . otherwise
3
Then clearly as each decimal expansion is unique this is an injective function
which by the Schröeder-Bernstein theorem implies that |[0, 1]2 | ≤ |[0, 1]|, but as
[0, 1] ⊂ [0, 1]2 then we also have that |[0, 1]| ≤ |[0, 1]2 |. Hence |[0, 1]| = |[0, 1]2 |
and so there must exist a bijection from [0, 1] → [0, 1]2
The immediate question after this result is whether such a mapping can be
continuous , it was Netto in 1879 who showed this couldn’t be so.
Theorem 2 (Netto). [1, p. 6] If f represents a bijective map from an mdimensional smooth manifold µm onto an n-dimensional smooth manifold µn
and m 6= n then f is necessarily discontinuous.
The next progression was to consider whether it would be possible to find
a continuous surjective mapping(losing the condition of injectivity). In 1890
Peano constructed the first such curve, these curves are now refered to as space
filling curves.
1.1
Notation and Definitions
The following notation has been used as to mimic Sagan [1].
For the purpose of this text we will use the following letters to denote common subsets of Rn
I = [0, 1] the closed unit interval
Q = [0, 1]2 the closed unit square
W = [0, 1]3 the closed unit cube
We denote binaries by
02̇ b1 b2 b3 . . . = b1 /2 + b2 /22 + b3 /23 + . . . ,
bj = 0 or 1
,ternaries by
03̇ t1 t2 t3 . . . = t1 /3 + t2 /32 + t3 /33 + . . . ,
tj = 0, 1 or 2
and quaternaries by
04̇ q1 q2 q3 . . . = q1 /4 + q2 /42 + q3 /43 + . . . ,
qj = 0, 1, 2 or 3
Definition 2. [1, p. 4] If f : I → En is continuous then the image of f , f (I) is
called a curve. f (0) is called the beginning point of the curve and f (1) is called
its endpoint.
Note that here we have used the domain of I, we could have used any closed
interval on the real line, however for our purposes this is the only example we
will be discussing.
An important concept for the definition of a space filling curve is that of
Jordan content, this is simply a measure of size generalised to n-dimensional
space, e.g. area for n=2, volume for n=3. Then we can define an SFC
Definition 3. [1, p. 5] If f : I → En , n ≥ 2, is continuous and its image f (I)
has strictly positive Jordan content then f (I) is called a space-filling curve.
4
This definition can be rewritten in what I believe to be a more intuitive way
using the idea of surjectivity from Bader [5, p. 17].
Definition 4 (Alternative SFC Definition). If f : I → En , n ≥ 2, is continuous
and is surjective on some region A ⊂ En with positive jordan content then f [I]
is called a space-filling curve.
It can clearly be seen that in this case surjectivity is a sufficient condition
for positive jordan content. The curves we are studying have the image [0, 1]2
clearly a region with positive Jordan content so any surjective and continuous
map onto it is space-filling.
2
Peano’s Space-Filling Curve
This definition is the one found in Valgaerts [6, p. 7]
2.1
Definition
It was Giuseppe Peano in 1890 who found the first such curve defined using
ternaries and the operator
ktj = 2 − tj (tj = 0, 1, 2)
Where k v is the v th iterate of k, that is k composed with itself v times.
He then defined fp : I → Q as
03̇ t1 (k t2 t3 )(k t2 +t4 t5 ) . . .
fp (03̇ t1 t2 t3 t4 . . .) =
03̇ (k t1 t2 )(k t1 +t3 t4 ) . . .
2.2
Properties
1
From this definition we can check that this does in fact follow the definition of
an SFC, using the alternative definition we can first show that fp is surjective:
Theorem 3. [1, p. 30] fp as defined above is surjective
Proof. Consider
(03̇ α1 α2 α3 . . . , 03̇ β1 β2 β3 . . .) ∈ Q
Then we want to find t = 03̇ t1 t2 t3 t4 . . . ∈ I such that
03̇ α1 α2 α3 . . .
fp (t) =
03̇ β1 β2 β3 . . .
By our definition of fp through comparing each ternary place we can see
that
αn = k t0 +t2 +...+t2n−2 t2n−1 ,
βn = k t1 +t3 +...+t2n−1 t2n
Then noting the fact that clearly by its definition k is its own inverse we get.
1 Throught §2.2 I follow very closely Sagans writing on the properties and geometric interpretation of the Hilbert Curve
5
t2n−1 = k t0 +t2 +...+t2n−2 αn ,
t2n = k t1 +t3 +...+t2n−1 βn
Which we can solve iteratively for each ti .
This original definition by Peano gave no geometric representation of the
curve, it wasn’t in fact until Hilbert devised his curve that any sort of geometric
interpretation was given for a space filling curve. Through Hilbert’s generating
principle however we can derive such a visualisation for Peano’s original curve
now, and in doing so the proof that the map is in fact continuous will become
much simpler.
If we consider any ternary of the form
1
t = 03̇ 00t3 t4 t5 ∈ 0,
9
Then by its definition
fp (t) =
03̇ 0ξ2 ξ3 ξ4 . . .
03̇ 0η2 η3 η4 . . .
2
i.e. fp (t) ∈ 0, 31 the subsquare labelled 1 in figure 1 below.
Figure 1: Ordering of the peano curve
Similarly
fp (03̇ 01t3 t4 t5 . . .) =
6
03̇ 0ξ2′ ξ3′ ξ4′ . . .
03̇ 1η2′ η3′ η4′ . . .
so the interval 19 , 92 is mapped into the second subsquare 0, 13 × 31 , 23 contin
j
uing in this way we note that the interval j−1
9 , 9 , j = 1, 2, 3, . . . , 9 is mapped
into the subsquare j. In fact if we subdivide I into 32n congruent subintervals
then we can map them each into 32n subsquares of Q in the order we have
described below.
Figure 2: Generated Peano curves of order 1 and 2
Figure 3: Generated Peano curve of order 3
Then this maps adjacent intervals to adjacent subsquares sharing an edge,
and each iteration preserves the previous one. By Hilberts generating process
7
this suggests that the mapping we’ve just defined does in fact represent an SFC,
in fact it represents the peano curve. The proof of this is a rather simple but
tedious induction which I have opted to ommit for the sake of brevity, it can be
found in Sagan [1, p. 37]
Knowing that these maps are in fact equivalent makes the proof that the
Peano curve is continuous much simpler.
Theorem 4. The Peano curve is continuous
Proof. 2 Considering the nth iteration in the generation of the Peano curve,
denoted fn we’ve seen that I is subdivided into 32n subintervals. So if we
1
that is the length of one of
consider x1 , x2 ∈ I such that |x1 − x2 | < 32n
these subintervals then the interval [x1 , x2 ] will intersect at most 2 subintervals
and hence its image will be contained in 2 adjacent subsquares of side length
√1
= 31n
32n
√
5
3n
1
3n
2
3n
Then the greatest distance between f (x1 ) and f (x2 ) is the diagonal of the
rectangle formed by adjoining the two squares as shown above. So by Pythagoras
√
5
|fn (x1 ) − fn (x2 )| < n
3
We have seen that
fp (x) = lim fn (x)
n→∞
then
|fp (x1 ) − fp (x2 )| = lim |fn (x1 ) − fn (x2 )| = lim
n→∞
n→∞
√
5
3n
=0
hence the Peano curve is continuous.
And so finally we have shown that the Peano curve is both surjective and
continuous and hence is a Space Filling Curve.
We can now investigate further properties of the curve. It is possible, with
not too much thought, to alter the definition of differentiability given in MA131
Analysis II [7] to involve sequences as below.
Definition 5 (Condition for Non-Differentiability). Let f : I → R. If there are
two sequences {an }, {bn } with 0 < an ≤ t < bn < 1, and {an } → t, {bn } → t ,
such that
f (an ) − f (bn )
lim
n→∞
a n − bn
2 This proof is adapted from the one Sagan used to show continuity of the Hilvert Curve. [1,
p. 12]
8
does not exist, then f is not differentiable at t.
With this definition in mind it is quite simple to show that the Peano curve
is non-differentiable everywhere, the proof follows Sagan [1]
Theorem 5. The Peano curve is nowhere differentiable.
Proof. Consider t = 03̇ t1 t2 t3 . . . t2n t2n+1 t2n+2 . . . ∈ [0, 1]. Then define tn =
03̇ t1 t2 t3 . . . t2n τ2n+1 t2n+2 . . ., where τ2n+1 = t2n+1 + 1(mod 2) We now have two
sequences {t} and {tn } satisfying the coniditions in the definition given above.
1
Note that |t − tn | = 32n+1
. Consider now
ϕp (t) = 03̇ t1 (k t2 t3 )(k t2 +t4 t5 ) . . .
Then ϕp (t) and ϕp (tn ) only differ in the (n + 1)-th ternary place and so,
|ϕp (t) − ϕp (tn )| = |k t2 +...+t2 n t2n+1 − k t2 +...+t2 n τ2n+1 |/3n+1 =
1
3n+1
then clearly
|ϕp (t) − ϕp (tn )|
= 3n
|t − tn |
And so as limn→∞ 3n doesn’t exist ϕp is nowhere differentiable. We can then
consider ψp (t) = 03̇ (k t1 t2 )(k t1 +t3 t4 ) . . . Then it isn’t hard to convince yourself
that ψp (t) = 3ϕ( 3t ) and so ψp is also nowhere differentiable. From these two
results we can note that
ϕp (t)
fp (t) =
ψp (t)
and so the Peano curve is nowhere differentiable.
Now we have a geomtric definition of Peano’s curve it will be a useful exercise
to formalise this in terms of transformations in the complex plane. Doing this
we can easily create figures as those above and when we come to study the
Hilbert curve it will give is a means to actually calculate the image of a point.
The first thing we have to notice is that the geometric curve described above has
it’s start point at (0, 0) and then concludes at the corner of Q, (1, 1). This fact
will dictate the orientation of our subsquares as the exit point for each subsquare
must coalesce with the entry point on the proceeding subsquare. This idea is
illustrated below using the ordering from earlier.
9
From this we can start to come up with the transformations that will map
the square [0, 1] × [0, i] to the subsqures described in the figure The reason we
can describe this in the complex plane is due to the isomorphism that exists
between C and R2 , and so [0, 1] × [0, i] is isomorphic to Q. I include a second
copy of figure to act as reference of the ordering.
We first see that subsquares 1,3,7, and 9 are simply obtained by scaling Q
by a factor of 31 about the origin and translating accordingly so no reorientation
is necessary. Subsquare 5 can derived by a similar scaling and translation and
also a rotation of 180◦ . Subsquares 2 and 8 require a reflection in the imaginary
axis along with the scale and translation, and similarly 4 and 6 are obtained
via a reflection in the real axis ,scaling and translation. We can now summarise
these transformations below where Bi represents the transformation necessary
to acquire subsquare i + 1 from [0, 1] × [0, i]. The reason for this mismatched
labelling of our transformations to our subsquares should become apparent soon.
1
z
3
1
1
B3 z = z̄ + i +
3
3
1
2
B6 z = z +
3
3
B0 z =
1
i
1
B1 z = − z̄ + +
3
3 3
2 2i
1
B4 z = − z + +
3
3
3
1
i
B7 z = − z̄ + 1 +
3
3
2i
1
z+
3
3
1
i
1
B5 z = z̄ + +
3
3 3
1
2 2i
B8 z = z + +
3
3
3
B2 z =
From this what we can notice that if we consider the nonary form of t
(the base 9 form of t) that is t = 09̇ q1 q2 q3 . . . then in the first iteration of
the geometric Peano curve t lies in the (q1 − 1)th subsquare and in the second
iteration it will lie in the (q2 − 1)th subsquare of the (q1 − 1)th subsquare of
the first iteration. Whilst this may seem confusing at first hopefully an example
should clear it up.
1
= 09̇ 03
27
Then q1 = 0, q2 = 3
Consider t =
And so f1 (t) lies in the 1st subsquare in figure and then f2 (t) will lie in the 4th
subsquare in the figure below.
10
With this remark in mind we can see that
fp (t) = lim Bq1 Bq2 Bq3 . . . Bqn Q
n→∞
We can in fact modify this further to keep in line with our ternary representation
we have been using by noting that
t = 03̇ t1 t2 t3 . . . t2n−1 t2n . . . = 09̇ (3t1 + t2 )(3t3 + t4 ) . . . (3t2n−1 + t2 n) . . .
and so
fp (t) = lim B3t1 +t2 B3t3 +t4 B3t5 +t6 . . . B3t2n−1 +t2 n Q
n→∞
We can also notice that if we only consider the decimal of a ternary to a finite
place then
fp (03̇ t1 t2 t3 . . . t2n−1 t2n ) = B3t1 +t2 B3t3 +t4 B3t5 +t6 . . . B3t2n−1 +t2 n B0 B0 B0 . . . Q
0
fp (03̇ t1 t2 t3 . . . t2n−1 t2n ) = B3t1 +t2 B3t3 +t4 B3t5 +t6 . . . B3t2n−1 +t2 n
0
As the B0 transformation only involves scaling.
So we have found an alternative way for computing the image in the Peano
curve of any point in I in fact this method is what allows us to create the
plots as seen throughout this text. Matlab does better than most programming
language when it comes to the manipulation of complex numbers and so it is
quite a trivial task to write a program which will produce such a plot as seen
below.
11
z = 0.5+0.5i; %our initial point for transforming, the chosen value
%just insures that our line goes through the centre of each subsquare
iteration level = 4; %which iteration we want to plot
for k = 1:iteration level
w = conj(z); %The conjugate value of z, for brevity in further code
z = [z;
-w+1+i;
z+2i;
w+3i+1;
-z+2+2i;
w+1+i;
z+2;
-w+3+i;
z+2+2i]/3;
end
plot(z, 'clipping', 'off','color','black')
axis([0 1 0 i])
axis equal
This sort of program allows us very quickly to see the space filling nature of the
Peano curve for example if we run this with our iteration_level variable set
to a higher value for example 7 gives the result below.3
3
Hilbert’s Space-Filling Curve
We now come to what is probably the most famous of the space filling curves4 .
It was Hilbert who first gave space filling curves formulated by a geometric
recursion. This generating process can in fact be applied in any dimension ,
constructing a whole class of SFC’s.
3 The fact this plot seems like an almost black square demonstrates the space filling nature
of the curve.
4 This fact is probably due to its geometric definition allowing it to be easily visualised.
12
3.1
Definition
Following the thought process illustrated in sagan [1] we first consider the fact
that the unit interval I can be mapped continuously onto the unit square Q,
then by partitioning I into 4 congruent subintervals it should be true that we
can continuously map each subinterval into similarly partitioned subsquares of
Q. If we extend this process to the infinite recursion level then at each stage
both I and Q are partitioned into 22n congruent duplicates , n = 1, 2, 3, . . .
When performing a recursion like this ad infinitum we have to make sure that to
preserve continuity adjacent subintervals are mapped to adjacent subsquares, it
was Hilbert that showed such an arrangement of the subsquares is possible. We
also require that inclusions remain through further iterations, that is if a square
corresponds to some interval then its subsquares correspond to subintervals
of that interval. The arrangement that Hilbert discovered also satisfies this
property. The first 3 iterations of this ordering are shown below.
(a)
(b)
(c)
Figure 5: First 3 iterations of the Hilbert curve
We then give the formal definition of the Hilbert curve
Definition 6. [1, p. 11] Every t ∈ I is uniquely determined by a sequence of
nested closed intervals (that are generated by our successive paritioning), the
lengths of which shrink to 0. With this sequence corresponds a unique sequence
of nested closed squares, the diagonals of which shrink into a point, and which
define a unique point in Q, the image fh (t) of t. We call fh (I) the Hilbert
Curve.5
In the figure above we have joined the midpoints of each interval to show the
convergence to the hilbert curve. From this definition we can now realise why it
is important for adjacent intervals to be mapped to adjacent squares. Consider
any point t ∈ I, t 6= 0, 1 that is the endpoint of one of the subintervals, then
t belongs to two sequences of nested intervals, so the adjacency of the squares
these intervals are mapped to implies that the images will be the same.
3.2
Properties
Theorem 6. The Hilbert Curve is surjective.
Proof. Any point in Q will lie in at least one sequence of nested closed subsquares, then each of these sequences corresponds to a sequence of nested subintervals which tend to some point in I and so the curve is indeed surjective.
5I
find this definition to be quite vague however was unable to find a more succinct version.
13
It is also quite trivial to confirm Netto’s Theorem for the Hilbert Curve that
it cannot be injective. Consider any point on the corner of a square in Q then
that point will belong to at least two squares (due to their closed nature) that
do not correspond to adjacent intervals and so will have two or more distinct
preimages in I.
Finally to show the Hilbert curve does in fact fall in the class of an SFC we
must show it to be continuous, to do this we can follow the same procedure as
for the Peano curve.
Theorem 7. The Hilbert Curve is continuous.
Proof. I emit this proof for the sake of not repeating myself, as with the Peano
curve it is an identical argument using Pyhtagoras to calculate the maximum
distance between any two points in adjacent squares. It can be found in Sagan [1,
p. 12].
From these properties we can in fact say that the Hilbert Curve does represent an SFC. As with the Peano curve we can also show that the Hilbert curve
isn’t a differentiable function, and so fh (I) = Q.
Theorem 8. The Hilbert Curve is nowhere differentiable.
Proof. For n ≥ 3 and any t ∈ I we can choose a tn ∈ I such that |t−tn | ≤ 10/22n
and that the coordinates of t and tn under the image of the Hilbert curve are
seperated by at least a square of sidelength 1/2n (This can be clearly seen to be
always possible by inspecting the figure showing iterations of the Hilbert Curve
above.)
3.3
Complex and Arithmetic Represenation
6
This definition of the Hilbert curve has allowed us to consider all properties
of the curve but doesnt give us an explicit computation to calculate the image
of any point t ∈ I. To do this we will need to do come up with a set of
transformations which will allow us to compute such an image. It was the
German mathematician W.Wunderlich who first came up with the idea of such
a procedure with space filling curves7 . We start as we did with the Peano curve
and produce a complex representation , with Q now denoting the complex unit
square we first shrink it in the ratio 2 : 1 towards the origin , we rotate the
resulting square 90◦ about the origin and then reflect in the imaginary axis ,
the composition of these transformations produces the subsquare [0, 0.5]×[0, 0.5]
and will be named
1
H0 z = z̄i
2
The subsquare [0, 0.5] × [0.5, 1] comes from the similar scaling of Q shifted
half a unit upwards. This time rotation and reflection is not neccesary as the
orientation of this subsquare is the same as that of Q in the original ordering.
The transformation which produces this is
H1 z =
i
1
z+
2
2
6 §3.3 is again almost straight out of Sagan [1] with a few modifications to explain some of
the ideas in greater detail
7 Whilst Wunderlich had the idea it was Hilbert who formalised it with his curve and applied
it to others
14
The top right subsquare [0.5, 1] × [0.5, 1] is produced similarly, no rotation necessary.
1
i
1
H2 z = z + +
2
2 2
The final lower right subsquare require a similar rotation to the first to preserve
the neccessary orientation of the entry and exit points and so we obtain the
transformation
i
1
H3 z = − z̄ + + 1
2
2
Then applying these transformations to Figure 5(a) will result in Figure 5(b)
and application to Figure 5(b) will give Figure 5(c) etc. So if we consider a
point t ∈ I in its quaternary form
t = 04̇ q1 q2 q3 . . .
,
qj = 0, 1, 2, 3
Then we have the property that in the first iteration t will lie in the (q1 + 1)th
subinterval of I and so its image will lie in the (q1 + 1)th subsquare in the first
partitioning of Q, i.e f (t) ∈ Hq1 Q. Then in the second iteration f (t) will lie in
the (q2 +1)th subsquare of the (q1 +1)th subsquare from the first iteration, so in
terms of transformations f (t) ∈ Hq1 Hq2 Q (This is referred to as the localisation
property). Continuing this sort of reasoning we can deduce that
Re
fh (t) =
lim H H H . . . Hqn Q
Im n→∞ q1 q2 q3
This is progress but still doesn’t allow us to find the image without having
omniscient knowledge of the inifnite expansion of a quaternary. However there
are points in our curve where we have such knowledge. The points which lie at
the beginning or end of any of the subtintervals when partitioning I will have
a finite quarternary expansion. Consider such a t
t = 04̇ q1 q2 q3 . . . qn = 04̇ q1 q2 q3 . . . qn 000 . . .
and so from out previous formulation we have
Re
Hq 1 Hq2 Hq3 . . . Hq k H0 H0 H0 . . . Q
f (t) =
Im
Then it seems natural to think that H0 H0 H0 . . . Q would simply be 0 as we discussed above it is effectively a scale towards the origin along with reorientation
, and indeed
(
iz̄
if n is even
1
=0
H0 H0 H0 . . . z = lim Hn = lim n
n→∞
n→∞ 2
z
if n is odd
and so for such points we have
Re
f (t) =
Hq 1 Hq 2 Hq 3 . . . Hq k 0
Im
It then becomes a trivial task to compute the images of any such points and
indeed very close approximations to those points not at the endpoint of an interval through a programming language such as MATLAB. For example consider
the point t = 04̇ 203 = 0.546875
q1 = 2, q2 = 0, q3 = 3
15
So we have the image
f (04̇ 203) =
=
=
=
=
3.4
Re
Im
Re
Im
Re
Im
Re
Im
Re
Im
H2 H0 H3 0
i
H2 H0
+1
2
i
1
+
H2
4 2
i
i
1
1
+ + +
8 4 2 2
5 3i
+
8
4
Generalisation to 3-Dimensions
The construction of the 3-D Hilbert curve is very similar to its 2-dimensional
counterpart however instead of dividing the unit interval I into 22 n congruent
subintervals we divide into 23 n smaller intervals, and alongside this we divide
W the unit cube into 23 n congruent subcubes. We then desire an arrangement
of such subcubes similar to that of the subsquares in the original Hilbert curve.
The figure below shows such an arrangement for the first iteration.
16
Then this arrangement described in Sagan [1] satisfies the condition we place
of adjacent subintervals mapping to adjacent subcubes. Continuing as we did
with the 2-D Hilbert curve iterating within nested intervals this defines a space
filling curve. Below the 2nd and 3rd itterations of the 3-D Hilbert curve can be
seen.
4
Lebesgue’s Space-Filling Curve
We’ve now seen two examples of space filling curves with what have been very
similar properties, both were defined in terms of an ordering of subdivisions
in the unit interval , both were nowhere differentiable, both had ta fractal
nature. To contrast these we will now briefly discuss an example which is none
of these things8 . Proofs will be ommitted as this example is just to illustrate
the variation in SFC’s9 .
8 Another interesting SFC is the Sierpinski curve which actually maps to the triangle with
vertices (0, 0), (2, 0), (1, 1) instead of Q
9 The proofs of these can be found in Kupers [p. 3-4]kupers
17
4.1
Definition
Before we go on to define Lebesgue’s curve we must first introduce a very famous
example in mathematics, Cantors set. In 1833 Cantor introduced as an example
of a perfect set which is not dense on any interval the set of all points which
can be written in the form
2t1
2t2
2t3
+ 2 + 3 ...
3
3
3
Using our knowledge of ternaries we notice this can be written as in the following
definiton
Definition 7 (Cantor set of excluded middle thirds). [1, p. 69]
Γ = {03̇ (2t1 )(2t2 )(2t3 ) . . . : ti = 0 or 1}
The reason for the name is how the set can be constructed. If you first start
with the unit interval I then remove the inner third i.e. the interval ( 13 , 23 ) you
result in the two closed intervals [0, 13 ], [ 32 , 1]. Repeating the process on these
two new intervals removing the inner thirds , now the intervals ( 91 , 92 ), ( 79 , 98 ),
leaves us with the set of closed intervals [0, 19 ], [ 29 , 31 ], [ 32 , 79 ], [ 98 , 1]. Carrying this
removing process on ad infinitum will then result in the set defined above.
It can then be shown that the mapping
0.t1 t3 t5 . . .
f (03̇ (2t1 )(2t2 )(2t3 ) . . .) =
0.t2 t4 t6 . . .
is a continuous, surjective mapping f : Γ → Q. Lebesgue’s addition to this
already studied map was its extension to Γc (I \ Γ) through linear interpolation.
He did so as follows
Definition 8 (Lebesgue’s Space filling Curve).
[8, p. 3] If (an , bn ) is an interval removed from I in the nth step in constructing
Γ then define fl : Γ ∪ Γc = I → Q
f (t)
if t ∈ Γ
fl (t) =
n
+ f (an ) if t ∈ (an , bn ) ⊂ Γc
(f (bn ) − f (an )) bt−a
n −an
Where f is the function defined above. The figure below shows respectively the
1st , 2nd and 4th iterations in generating the Lebesgue SFC.
18
4.2
Properties
As expected the function we just defined does in fact follow the definition of
a space filling curve, i.e it is both continuous and surjective. The fun of the
Lebesgue SFC comes when we consider differentiability. Whilst the other two
curves studied in this paper have both been nowhere differentiable the Lebesgue
SFC is almost everywhere differentiable, in fact everywhere on Γc it is differentiable and is nowhere differentiable on Γ.
Theorem 9. Lebesgue’s space filling curve is differentiable on Γc and is nowhere
differentiable on Γ
Seeing this fact poses the question ”Is it possible to find a space filling curve
differentiable everywhere?” the answer to this was given, only quite recently in
1980 , by Polish mathematician Michal Morayne when he proved in fact that
there are no differentiable space filling curves.
The other notable comparison that can be made between the Lebesgue SFC and
the earlier examples is whats known as the fractal nature of the curves, that
is every part of the earlier curves was itself a space filling curve. For example
considering the Hilbert curve, if we take the interval π = [(k − 1)/22n , k/22n ] ⊂
I, n = 1, 2, 3, . . . , k = 1, 2, 3, . . . , 22n then applying the hilbert curve fh : π → Q
results in an exact copy of the Hilbert curve scaled in the ratio 2n : 1. This
property can be seen to be lacking in the Lebesgue SFC simply by the amount
in jumps across the unit square. The absence of this property changes some of
the applications for which the Lebesgue SFC can be used.
References
[1] Space Filling Curves , Hans Sagan, Springer 1994 1st edition.
[2] The Definition of a Manifold and First Examples, Jenny Wilson,
http://web.stanford.edu/~jchw/WOMPtalk-Manifolds.pdf
[3] Wikipedia, Online encyclopedia, https://en.wikipedia.org/wiki/Differentiable\_manifold
[4] Building Cantors Bijection, Samuel Nicolay , Laurent Simons 2014 ,
http://arxiv.org/pdf/1409.1755.pdf
[5] Space-Filling Curves: An Introduction with Applications in Scientific Computing , Michael Bader, Springer 2012.
[6] Space-Filling curves an Introduction, Levi Valgaerts, Department of Informatics, Technical University Munich
[7]
MA131
Analysis
II
Lecture
notes,
James
Robinson,
http://www2.warwick.ac.uk/fac/sci/maths/undergrad/ughandbook/lecturers/ma131t2/analysis
[8] On Space-Filling Curves and the Hahn-Mazurikewicz theorem, A.P.M Kupers, http://web.stanford.edu/~kupers/spacefillingcurves.pdf.
19