On space-filling curves

Ok. So this is my first attempt to go through this topic. This might be wrong and comments/corrections are appreciated.

Yesterday, I read the book Basic Topology by M. A. Armstrong on the second chapter. The section introduced the concept of Peano curves, or more commonly known, space-filling curves.

The section introduced a sequence of function that maps [0,1][0, 1] to Δ\Delta (Δ\Delta is the equilateral triangle with side length 11), which is recursively defined (in a weird way that I don't know how to explain).

Now, I want to go through the theory of space-filling curves once again, but rigorously prove that "The Hilbert curve maps [0,1][0, 1] to [1,1]×[1,1][-1, 1] \times [-1, 1] continuously with respect to the Euclidean norm in 1D and 2D".

Ahhh... Defining the Hilbert curve rigorously will be a pain, but I gonna give it a try.

Definition. (Hilbert curves of order nn) Let us denote nn-th order Hilbert curve as HnH_n, which we define as a function from [0,1][0, 1] to [1,1]×[1,1][-1, 1] \times [-1, 1]. We define H1H_1 as

H1(t)={(12,123t)if t<13(3t32,12)if 13t<23(12,3t52)if 23t H_1(t) = \begin{cases} \left(-\frac{1}{2}, \frac{1}{2} - 3t\right) & \text{if } t < \frac{1}{3} \\ \left(3t - \frac{3}{2}, -\frac{1}{2}\right) & \text{if } \frac{1}{3} \leq t < \frac{2}{3} \\ \left(\frac{1}{2}, 3t - \frac{5}{2}\right) & \text{if } \frac{2}{3} \leq t \end{cases}

for all t[0,1]t \in [0, 1]. Now we inductively define HnH_n for n>1n > 1 as

Hn(t)={12R(Hn1(1t4n14n11))+(1,1)if t<4n114n1(1+12n,12n12n1(t4n114n1)(4n1))if 4n114n1t<4n14n112Hn1((t24n14n1)4n14n11)+(1,1)if 4n14n1t<24n114n1(12n+12n1(t24n114n1)(4n1),12n)if 24n114n1t<24n14n1(12Hn1((t24n14n1)4n14n11))+(1,1)if 24n14n1t<34n114n1(112n,12n+12n1(t34n114n1)(4n1))if 34n114n1t<34n14n112R3(Hn1(1(t34n14n1)4n14n11)+(1,1))+(0,1)if 4n4n1t H_n(t) = \begin{cases} \frac{1}{2} R(H_{n-1}(1 - t \frac{4^n - 1}{4^{n-1} - 1})) + \left(1, 1\right) & \text{if } t < \frac{4^{n-1}-1}{4^n - 1} \\ \left(-1 + \frac{1}{2^n}, \frac{1}{2^n} - \frac{1}{2^{n-1}} \left(t - \frac{4^{n-1}-1}{4^n-1}\right)(4^n - 1)\right) & \text{if } \frac{4^{n-1}-1}{4^n-1} \leq t < \frac{4^{n-1}}{4^n - 1} \\ \frac{1}{2} H_{n-1}\left(\left(t - \frac{2\cdot 4^{n-1}}{4^n-1}\right)\frac{4^n-1}{4^{n-1}-1}\right) + (-1, -1) & \text{if } \frac{4^{n-1}}{4^n -1} \leq t < \frac{2 \cdot 4^{n-1} - 1}{4^n - 1} \\ \left(-\frac{1}{2^n} + \frac{1}{2^{n-1}} \left(t - \frac{2\cdot 4^{n-1} - 1}{4^n - 1}\right) (4^n - 1), -\frac{1}{2^n}\right) & \text{if } \frac{2 \cdot 4^{n-1} - 1}{4^n-1} \leq t < \frac{2 \cdot 4^{n-1}}{4^n - 1} \\ \left(\frac{1}{2} H_{n-1}\left(\left(t - \frac{2 \cdot 4^{n-1}}{4^n - 1}\right)\frac{4^n - 1}{4^{n-1}-1}\right)\right) + (1, -1) & \text{if } \frac{2\cdot 4^{n-1}}{4^n - 1} \leq t < \frac{3 \cdot 4^{n-1}-1}{4^n - 1} \\ \left(1 - \frac{1}{2^n}, -\frac{1}{2^n} + \frac{1}{2^{n-1}} \left(t - \frac{3 \cdot 4^{n-1} - 1}{4^n - 1}\right) (4^n - 1)\right) & \text{if } \frac{3 \cdot 4^{n-1} - 1}{4^n - 1} \leq t < \frac{3 \cdot 4^{n-1}}{4^n - 1} \\ \frac{1}{2} R^3\left(H_{n-1}\left(1 - \left(t - \frac{3\cdot4^{n-1}}{4^n - 1}\right) \frac{4^n - 1}{4^{n-1} - 1}\right) + (1, 1)\right) + (0, 1) & \text{if } \frac{4^n}{4^n - 1} \leq t \end{cases}

for all 0t10 \leq t \leq 1. Where R=(0110)R = \begin{pmatrix}0 & -1\\1 & 0\end{pmatrix} is the (90°90\degree counter-clockwise) rotation matrix, and each point is viewed as a column vector when multiplied by this matrix.

Now, we have the curves defined as in the following figure:

The uniform convergence

Recall the definition of uniform convergence (from the course I'm studying: MAA207)

Defintion. For a sequence of functions (fn)n(f_n)_n where each function is defined on a subset SRS \subseteq \mathbb{R} to R\mathbb{R} is said to be:

It is proved in the course that if a sequence of functions (fn)n(f_n)_n uniformly converges to ff then it converges pointwise to ff also.

Now, I'm going to extend the notion of uniform convergence from "functions from a subset of reals to reals" to "functions from a subset of normed vector space to normed vector space".

Definition. Let (E,NE)(E, N_E) be a normed vector space, and let (F,NF)(F, N_F) be another normed vector space. We say that a sequence of functions (fn)n(f_n)_n where each function is defined from a subset ΩE\Omega \subseteq E to FF is said to be uniformly convergent if for all ε>0\varepsilon > 0 there exists NNN \in \mathbb{N} such that for all nNn \geq N, for all xΩx \in \Omega, NF(fn(x)f(x))<εN_F(f_n(x) - f(x)) < \varepsilon. In other words, supxΩNF(fn(x)f(x))n0 \sup_{x \in \Omega} N_F(f_n(x) - f(x)) \xrightarrow[n \to \infty]{} 0

Back to our case of Hilbert curves, we've already defined the sequence (Hn)n(H_n)_n where Hn ⁣:[0,1][1,1]×[1,1]H_n \colon [0, 1] \to [-1, 1] \times [-1, 1] for all n1n \geq 1.

Now, let us define a norm on [1,1]×[1,1][-1, 1] \times [-1, 1]. For the sake of simplicity, let us take the Euclidean norm 2\|\cdot\|_2 defined by (x,y)2=x2+y2\|(x, y)\|_2 = \sqrt{x^2 + y^2}. It is not hard to see that this is a norm, because

Now, let us recall another important tool (from MAA207 but extended here, with some help from MAA202) to help with proving the uniform convergence.

Lemma. (Uniform Cauchy Criterion) Let (E,NE)(E, N_E) and (F,NF)(F, N_F) be normed vector spaces where FF is complete, and let (fn)n(f_n)_n be a sequence of functions from ΩE\Omega \subseteq E to FF. If for all ε>0\varepsilon > 0 there exists NNN \in \mathbb{N} such that for all n,mNn, m \geq N, supxΩNF(fn(x)fm(x))<ε\sup_{x \in \Omega} N_F(f_n(x) - f_m(x)) < \varepsilon then (fn)n(f_n)_n uniformly converges. The converse is also true.

Proof. ()(\Rightarrow) Suppose the sequence is Cauchy, i.e. for all ε>0\varepsilon > 0 there exists NNN \in \mathbb{N} such that for all n,nNn, n \geq N, supxΩNF(fn(x)fm(x))<ε\sup_{x \in \Omega} N_F(f_n(x) - f_m(x)) < \varepsilon, then we have that for any xΩx \in \Omega, the numerical sequence (fn(x))n(f_n(x))_n is also Cauchy. Since (F,NF)(F, N_F) is complete, the numerical sequence converges to something in FF, let us define f(x)f(x) to this convergent limit, then we have the pointwise convergence of (fn)n(f_n)_n to ff. Now, let us prove the uniform convergence. By the Cauchy assumption, we have that for any ε>0\varepsilon > 0, there exists NNN \in \mathbb{N} such that for all xΩx \in \Omega, NF(fn(x)fm(x))<ε2N_F(f_n(x) - f_m(x)) < \frac{\varepsilon}{2} for any n,mNn, m \geq N. By the pointwise convergence at xx, there exists NNN' \in \mathbb{N} such that for all mNm \geq N', NF(fm(x)f(x))<ε2N_F(f_m(x) - f(x)) < \frac{\varepsilon}{2}. Fix nn and let mmax(N,N)m \geq \max(N', N) then NF(fn(x)f(x))NF(fn(x)fm(x))+NF(fm(x)f(x))<ε2+ε2=εN_F(f_n(x) - f(x)) \leq N_F(f_n(x) - f_m(x)) + N_F(f_m(x) - f(x)) < \frac{\varepsilon}{2} + \frac{\varepsilon}{2} = \varepsilon Note that NN' depends on xx but not for NN ! This means we can safely say that for any ε>0\varepsilon > 0 there exists NNN \in \mathbb{N} such that for all nNn \geq N for all xΩx \in \Omega, NF(fn(x)f(x))<εN_F(f_n(x) - f(x)) < \varepsilon. Hence, uniformly convergent. This completes the first half of the proof.

()(\Leftarrow) Suppose (fn)n(f_n)_n uniformly converges to ff. Then let us prove that for all ε>0\varepsilon > 0 there exists NNN \in \mathbb{N} such that for all n,mNn, m \geq N, for all xΩx \in \Omega, NF(fn(x)fm(x))<εN_F(f_n(x) - f_m(x)) < \varepsilon. Let ε>0\varepsilon > 0 be given, then by the uniform convergence, we can find NNN \in \mathbb{N} such that for all nNn \geq N, for all xΩx \in \Omega, NF(fn(x)f(x))<ε2N_F(f_n(x) - f(x)) < \frac{\varepsilon}{2}. The rest is easy because for any n,mNn, m \geq N we have NF(fn(x)fm(x))NF(fn(x)f(x))+NF(f(x)fm(x))<ε2+ε2=εN_F(f_n(x) - f_m(x)) \leq N_F(f_n(x) - f(x)) + N_F(f(x) - f_m(x)) < \frac{\varepsilon}{2} +\frac{\varepsilon}{2} = \varepsilon for any xΩx \in \Omega. This completes the proof. \square

Now, the last piece of the jigsaw is to prove that F=[1,1]×[1,1]F = [-1, 1] \times [-1, 1] equipped with NF=2N_F = \|\cdot\|_2 is a complete normed vector space, then for the rest of this piece of text, we will consider E=[0,1],NE=E = [0, 1], N_E = |\cdot| and F=[1,1]×[1,1],NF=2F = [-1, 1] \times [-1, 1], N_F = \|\cdot\|_2 as our normed vector spaces.

Before that, consider the following lemma.

Lemma. ((xn,yn))n([1,1]×[1,1])N((x_n, y_n))_n \in ([-1, 1] \times [-1, 1])^{\mathbb{N}} with respect to the norm 2\|\cdot\|_2 is convergent if and only if (xn)n(x_n)_n and (yn)n(y_n)_n are both convergent in (R,)(\mathbb{R}, |\cdot|). Moreover, limn(xn,yn)=(limnxn,limnyn)\lim_{n \to \infty} (x_n, y_n) = \left(\lim_{n \to \infty} x_n, \lim_{n \to \infty} y_n\right)

Proof. ()(\Rightarrow) Suppose ((xn,yn))n((x_n, y_n))_n converges to ((x,y))((x_\star, y_\star)) then for any ε>0\varepsilon > 0 there exists NNN \in \mathbb{N} such that for all nNn \geq N, (xn,yn)(x,y)2<ε\|(x_n, y_n) - (x_\star, y_\star)\|_2 < \varepsilon. This means (xnx)2+(yny)2<ε2(x_n - x_\star)^2 + (y_n - y_\star)^2 < \varepsilon^2. So (xnx)2<ε2(x_n - x_\star)^2 < \varepsilon^2 and (yny)2<ε2(y_n - y_\star)^2 < \varepsilon^2. Hence, xnx<ε|x_n - x_\star| < \varepsilon and yny<ε|y_n - y_\star| < \varepsilon. This means (xn)n(x_n)_n and (yn)n(y_n)_n both converges to xx_\star and yy_\star respectively, in (R,)(\mathbb{R}, |\cdot|).

()(\Leftarrow) Suppose (xn)n(x_n)_n converges to xx_\star and (yn)n(y_n)_n converges to yy_\star, in (R,)(\mathbb{R}, |\cdot|). Then for any ε>0\varepsilon > 0 there exists Nx,NyNN_x, N_y \in \mathbb{N} such that for all nNxn \geq N_x, xnx<ε2|x_n - x_\star| < \frac{\varepsilon}{\sqrt{2}} and for all nNyn \geq N_y, yny<ε2|y_n - y_\star| < \frac{\varepsilon}{\sqrt{2}}. This is enough to deduce that (xn,yn)(x,y)2=(xnx)2+(yny)2<ε22+ε22=ε\|(x_n, y_n) - (x_\star, y_\star)\|_2 = \sqrt{(x_n - x_\star)^2 + (y_n - y_\star)^2} < \sqrt{\frac{\varepsilon^2}{2} + \frac{\varepsilon^2}{2}} = \varepsilon. Hence, ((xn,yn))n((x_n, y_n))_n converges to (x,y)(x_\star, y_\star) in ([1,1]×[1,1],2)([-1, 1] \times [-1, 1], \|\cdot\|_2) \square

Now, the completeness of ([1,1]×[1,1],2)([-1, 1] \times [-1,1], \|\cdot\|_2) follows directly.

Theorem. ([1,1]×[1,1],2)([-1, 1] \times [-1,1], \|\cdot\|_2) is a complete normed vector space.

Proof. Suppose a sequence ((xn,yn))n([1,1]×[1,1])N((x_n, y_n))_n \in ([-1, 1] \times [-1, 1])^{\mathbb{N}} is Cauchy. That is, for all ε>0\varepsilon > 0, there exists NNN \in \mathbb{N} such that for all n,mNn, m \geq N, (xn,yn)(xm,ym)2<ε\|(x_n, y_n) - (x_m, y_m)\|_2 < \varepsilon. This means (xnxm)2+(ynym)2<ε2(x_n - x_m)^2 + (y_n - y_m)^2 < \varepsilon^2, and so, xnxm<ε|x_n - x_m| < \varepsilon and ynym<ε|y_n - y_m| < \varepsilon. This means (xn)n(x_n)_n and (yn)n(y_n)_n are both Cauchy, but (R,)(\mathbb{R}, |\cdot|) is complete, so they converge. By the previous lemma, we deduce that ((xn,yn))n((x_n, y _n))_n also converges in ([1,1]×[1,1],2)([-1, 1] \times [-1,1], \|\cdot\|_2). This concludes that all Cauchy sequences converge. Hence ([1,1]×[1,1],2)([-1, 1] \times [-1,1], \|\cdot\|_2) is complete. \square

Phew... that was quite long. What we've proved so far is that ([1,1]×[1,1],2)([-1, 1] \times [-1,1], \|\cdot\|_2) is complete and so we can use the uniform Cauchy criterion to prove uniform continuity for any sequence of functions.

This, but now, the sequence of Hilbert curves

Lemma. For all x[0,1]x \in [0, 1], for any nN2n \in \N_{\geq 2}, Hn(x)Hn+1(x)12n1\|H_n(x) - H_{n+1}(x)\| \leq \frac{1}{2^{n-1}}

Proof. Now, this, in order to make a rigorous enough proof, is the real tedious process. Recall the definition of HnH_n (let's not rewrite it here otherwise it will be a big mess), we see that there are 77 cases, depending on nn, we have the partition of [0,1][0, 1] into 77 subsegments with the following 88 endpoints:

0,4n114n1,4n14n1,24n114n1,24n14n1,34n114n1,34n14n1,10, \frac{4^{n-1}-1}{4^n-1}, \frac{4^{n-1}}{4^n-1}, \frac{2 \cdot 4^{n-1}-1}{4^n-1}, \frac{2\cdot 4^{n-1}}{4^n-1}, \frac{3\cdot 4^{n-1}-1}{4^n-1}, \frac{3\cdot 4^{n-1}}{4^n-1}, 1

The following figure is a visualization of the subsegments. Row y=iy = i shows the subsegments of HiH_i. Hence, in each row, there are 77 color bars. However, the connectors (orange, red and brown) become shorter rapidly.

Now, we observe easily that for a fixed nn, any t[0,1]t \in [0, 1]. If tt is inside the blue, green, purple or pink subsegment of HnH_n, then it is also in the same colored subsegment of Hn+1H_{n+1}. In mathematical terms, this is equivalent to saying that

[0,4n114n1)[0,4n14n+11)[4n14n1,24n114n1)[4n4n+11,24n14n+11)[24n14n1,34n114n1)[24n4n+11,34n14n+11)[34n14n1,1)[34n4n+11,1) \left.\left[0, \frac{4^{n-1}-1}{4^n-1}\right.\right) \subseteq \left.\left[0, \frac{4^{n}-1}{4^{n+1}-1}\right.\right) \\ \left.\left[\frac{4^{n-1}}{4^n-1}, \frac{2 \cdot 4^{n-1}-1}{4^n-1}\right.\right) \subseteq \left.\left[\frac{4^n}{4^{n+1}-1}, \frac{2 \cdot 4^{n}-1}{4^{n+1}-1}\right.\right) \\ \left.\left[\frac{2\cdot 4^{n-1}}{4^n-1}, \frac{3\cdot 4^{n-1}-1}{4^n-1}\right.\right) \subseteq \left.\left[\frac{2\cdot 4^{n}}{4^{n+1}-1}, \frac{3\cdot 4^{n}-1}{4^{n+1}-1}\right.\right) \\ \left.\left[\frac{3\cdot 4^{n-1}}{4^n-1}, 1\right.\right) \subseteq \left.\left[\frac{3\cdot 4^{n}}{4^{n+1}-1}, 1\right.\right)

The same goes (but in the other direction) with the orange, red and brown subsegments. i.e.

[4n14n+11,4n4n+11)[4n114n1,4n14n1)[24n14n+11,24n4n+11)[24n114n1,24n14n1)[34n14n+11,34n4n+11)[34n114n1,34n14n1) \left.\left[\frac{4^{n}-1}{4^{n+1}-1}, \frac{4^{n}}{4^{n+1}-1}\right.\right) \subseteq \left.\left[\frac{4^{n-1}-1}{4^n-1}, \frac{4^{n-1}}{4^n-1}\right.\right) \\ \left.\left[\frac{2 \cdot 4^{n}-1}{4^{n+1}-1}, \frac{2 \cdot 4^{n}}{4^{n+1}-1}\right.\right) \subseteq \left.\left[\frac{2 \cdot 4^{n-1}-1}{4^n-1}, \frac{2 \cdot 4^{n-1}}{4^n-1}\right.\right) \\ \left.\left[\frac{3 \cdot 4^{n}-1}{4^{n+1}-1}, \frac{3 \cdot 4^{n}}{4^{n+1}-1}\right.\right) \subseteq \left.\left[\frac{3 \cdot 4^{n-1}-1}{4^n-1}, \frac{3 \cdot 4^{n-1}}{4^n-1}\right.\right)

Now we consider two cases of t[0,1]t \in [0, 1]:

  1. tt lies in the orange, red or brown subsegment of Hn+1H_{n+1}. It follows immediately that Hn(t)Hn+1(t)212n1\|H_n(t) - H_{n+1}(t)\|_2 \leq \frac{1}{2^{n-1}} because the length of the subsegment of the same color in HnH_n is 12n1\frac{1}{2^{n-1}}.
  2. tt lies in the other subsegments of Hn+1H_{n+1}. This is harder. Take a look at the following figure, which shows H3H_3 and H4H_4 in the same plane.

We color the first quadrant with the "colorful" (same palette as before) and color the rest with gold and gray. Observe that any other tt that is not in the orange, red nor brown subsegments of Hn+1H_{n+1} must be in the blue, green, purple or pink subsegment. This subsegment, in turn, is actually HnH_n but transformed. Using this process, we descend from comparing between Hn(t)H_n(t) and Hn+1(t)H_{n+1}(t) to 12Hn1(t)\frac{1}{2}H_{n-1}(t') and 12Hn(t)\frac{1}{2}H_n(t'). If it satisfies the first case, the distance must also be bounded by 12n1\frac{1}{2^{n-1}}.

Deducing these cases (let us call these "case 2.1") where it recursively matches some orange, red or brown subsegment, we are left with only simple cases (let us call these "case 2.2").

The points with the same color are clearly within Euclidean distance 11. Hence, by zooming from HnH_n vs Hn+1H_{n+1}, the distance is bounded by 12n1\frac{1}{2^{n-1}}. \square

Theorem. (Hn)n(H_n)_n with Hn ⁣:[0,1][1,1]×[1,1]H_n \colon [0, 1] \to [-1, 1] \times [-1, 1] for each nN>0n \in \mathbb{N}_{>0} is uniformly Cauchy with respect to 2\|\cdot\|_2 norm.

Proof. Let ε>0\varepsilon > 0 be given, then take N1+log2(4ε)N \geq 1+\log_2 \left(4\varepsilon\right). We have that for all m>nNm > n \geq N,

Hn(x)Hm(x)k=nm1Hk(x)Hk+1(x)k=nm112k1=k=n1m212k=k=n1m22m2k2m2=k=0mn12k2m2=2mn12m2=42n12m242N<ε \left\|H_n(x) - H_m(x)\right\| \leq \sum_{k=n}^{m-1}{\left\|H_k(x) - H_{k+1}(x)\right\|} \\ \leq \sum_{k=n}^{m-1} \frac{1}{2^{k-1}} \\ = \sum_{k=n-1}^{m-2} \frac{1}{2^k} \\ = \sum_{k=n-1}^{m-2} \frac{2^{m-2-k}}{2^{m-2}} \\ = \frac{\sum_{k=0}^{m-n-1} 2^k}{2^{m-2}} \\ = \frac{2^{m-n} - 1}{2^{m-2}} \\ = \frac{4}{2^n} - \frac{1}{2^{m-2}} \\ \leq \frac{4}{2^N} \\ < \varepsilon holds for all x[0,1]x \in [0, 1]. This completes the uniform Cauchy criterion and hence (Hn)n(H_n)_n is uniformly Cauchy. \square

Proposition. This is an easy observation, but HnH_n is continuous for all nN>0n \in \mathbb{N}_{>0}.

Proof. Check that the endpoints are continuous, then since each piece is continuous, the function is continuous. \square

Now this is easy. A uniformly convergent sequence of continuous functions is also continuous. We can recall this theorem but let us reprove it here.

Theorem. Let (fn)n(f_n)_n be a uniformly convergent sequence of continuous functions from ΩE\Omega \subseteq E to FF where we equip EE with NEN_E and FF with NFN_F as their corresponding norms (and the continuity is with respect to the norms). Suppose (fn)n(f_n)_n converges to ff then ff is continuous.

Proof. Let us show that for any x0Ωx_0 \in \Omega, limxx0f(x)=f(x0)\lim_{x \to x_0} f(x) = f(x_0). In other words, for any ε>0\varepsilon > 0 there exists δ>0\delta > 0 such that for all xΩx \in \Omega with NE(xx0)<δN_E(x - x_0) < \delta, NF(f(x)f(x0))<εN_F(f(x) - f(x_0)) < \varepsilon. Take ε>0\varepsilon > 0 to be any given value. Then, by uniform continuity, there exists NNN \in \mathbb{N} such that supxΩNF(fN(x)f(x))<ε2\sup_{x \in \Omega} N_F(f_N(x) - f(x)) < \frac{\varepsilon}{2}. By continuity of fNf_N, we have that for ε2\frac{\varepsilon}{2}, there exists δ>0\delta > 0 such that for all xΩx \in \Omega with NE(xx0)<δN_E(x - x_0) < \delta, NF(fN(x)fN(x0))<ε2N_F(f_N(x) - f_N(x_0)) < \frac{\varepsilon}{2}.

Now, consider any xΩx \in \Omega with NE(xx0)<δN_E(x - x_0) < \delta, then NF(f(x)f(x0))NF(f(x)fN(x))+NF(fN(x)fN(x0))N_F(f(x) - f(x_0)) \leq N_F(f(x) - f_N(x)) + N_F(f_N(x) - f_N(x_0)) by the triangle inequality. But by uniform continuity, NF(f(x)fN(x))<ε2N_F(f(x) - f_N(x)) < \frac{\varepsilon}{2}. And by continuity of fNf_N, NF(fN(x)fN(x0))<ε2N_F(f_N(x) - f_N(x_0)) < \frac{\varepsilon}{2}. This bounds NF(f(x)f(x0))N_F(f(x) - f(x_0)) strictly under ε\varepsilon, hence completes the proof. \square

The mission is done

Since the final Hilbert curve is defined to be the limit of HnH_n as nn tends to infinity, the goal (which is "The Hilbert curve maps [0,1][0, 1] to [1,1]×[1,1][-1, 1] \times [-1, 1] continuously with respect to the Euclidean norm in 1D and 2D") is done.

Now, onto the bonus (pun intended).

Corollary. The final Hilbert curve is surjective from [0,1][0, 1] to [1,1]×[1,1][-1, 1] \times [-1, 1].

Proof. Let (x,y)[1,1]×[1,1](x, y) \in [-1, 1] \times [-1, 1], then we will show that a preimage t[0,1]t \in [0, 1] exists, such that H(t)=(x,y)H(t) = (x, y).

Let (rn)n1(r_n)_{n \geq 1} be the sequence defined by rn:=sup{dHn([0,1])(z) ⁣:z[1,1]×[1,1]}r_n := \sup \{ d_{H_n([0, 1])}(z) \colon z \in [-1, 1] \times [-1, 1] \} where dSd_S is defined as dS ⁣:zinfzSzz2d_S \colon z \mapsto \inf_{z' \in S} \|z - z'\|_2. Observe that dSd_S is well-defined and continuous when SS is compact. Furthermore, since both Hn([0,1])H_n([0, 1]) and [1,1]×[1,1][-1, 1] \times [-1, 1] are compact, the image of [1,1]×[1,1][-1, 1] \times [-1, 1] by dHn([0,1])d_{H_n([0, 1])} is compact and so its supremum is well-defined. So rn0r_n \geq 0 is well-defined.

Now, it is enough to show that rnr_n tends to 00 as nn tends to \infty, since (along with axiom of choice) this implies for any (x,y)[1,1]×[1,1](x, y) \in [-1, 1] \times [-1, 1], one can select a sequence of points (zn)n(z_n)_n such that zn(x,y)2=rn\|z_n - (x, y)\|_2 = r_n and znHn([0,1])z_n \in H_n([0, 1]) for all n1n \geq 1. This, by definition, says that (zn)(z_n) converges to (x,y)(x, y). Since HnH_n is injective by definition, and znHn([0,1])z_n \in H_n([0, 1]), the preimage wn[0,1]w_n \in [0, 1] such that Hn(wn)=znH_n(w_n) = z_n is uniquely well-defined. Now, since (wn)n(w_n)_n is bounded, by Bolzano-Weierstrass theorem, it has a convergent subsequence. This means that there exists a strictly increasing function ϕ ⁣:NN>0\phi \colon \mathbb{N} \to \mathbb{N}_{>0} such that (wϕ(n))n(w_{\phi(n)})_n converges to t[0,1]t_\star \in [0, 1]. Since HH is continuous, then (H(wϕ(n)))n(H(w_{\phi(n)}))_n converges to H(t)H(t_\star). But H(wϕ(n))=zϕ(n)H(w_{\phi(n)}) = z_{\phi(n)} is a subsequence of (zn)n(z_n)_n that converges to (x,y)(x, y) already. So H(t)=(x,y)H(t_\star) = (x, y). i.e. there exists tt_\star as a preimage of (x,y)(x, y) for any (x,y)[1,1]×[1,1](x, y) \in [-1, 1] \times [-1, 1].

The remaining part is easy to see, hard to prove formally. Observe that any point on [1,1]×[1,1][-1, 1] \times [-1, 1] has distance from HnH_n no more than 22n\frac{\sqrt{2}}{2^n}. This is because each curve HnH_n is defined with offset 12n\frac{1}{2^n} to the walls [1,1]×{1,1}{1,1}×[1,1][-1, 1] \times \{-1, 1\} \cup \{-1, 1\} \times [-1, 1]. By the squeeze theorem, since 0rn22n0 \leq r_n \leq \frac{\sqrt{2}}{2^n} for all nN>0n \in \mathbb{N}_{>0} and limn22n=0\lim_{n \to \infty} \frac{\sqrt{2}}{2^n} = 0, we conclude that rnn0r_n \xrightarrow[n \to \infty]{} 0. This completes the proof. \square

Conclusion

Corollary. There exists a continuous and onto function from any compact interval to any convex and compact subset of R2\mathbb{R}^2

Proof. (The case of empty domain is trivial and useless. Now consider the rest.) Any nonempty compact interval [a,b][a, b] can be mapped into [0,1][0, 1] using the function f1 ⁣:xxabaf_1 \colon x \mapsto \frac{x-a}{b-a}. Now, any convex and compact subset can be mapped into from the unit circle. Pick a point (x0,y0)(x_0, y_0) from the convex and compact subset. Then, for each point on the boundary of the convex and compact subset, draw a line segment joining from (x0,y0)(x_0, y_0) to that point. Assign a "progress bar" to the line segment, giving a continuous, "uniform" and bijective map from [0,1][0, 1] to the line segment. Take the inverse of this map, and union all of them into a function gg from the convex and compact subset to [0,1][0, 1]. Then (x,y)(g(x,y),atan2(y,x))(x, y) \mapsto (g(x, y), \texttt{atan2}(y, x)) is a continuous and bijective mapping from the convex and compact subset to the polar coordinates [0,1]×[0,2π)[0, 1] \times [0, 2\pi) describing the unit disk. Call the inverse of this map f3f_3. The rest is easy. We map the filled square [1,1]×[1,1][-1, 1] \times [-1, 1] to the unit disk using the inverse of [another map similar to f3f_3] defined using the same method, and rename this map to f2f_2. Then f3f2Hf1f_3 \circ f_2 \circ H \circ f_1 is a continuous and onto function from the compact interval to the convex and compact subset of R2\mathbb{R}^2. \square

Next steps

How about a continuous and onto function from [0,1][0, 1] to S2={(x,y,z)R3 ⁣:x2+y2+z2=1}S^2 = \{(x, y, z) \in \mathbb{R}^3 \colon x^2 + y^2 + z^2 = 1\}? How to construct this? (Ref: Basic Topology by M. A. Armstrong)

Note that Gun Kongarttagarn commented a solution, but I'll read study this later.