Peano Curve

This scene builds the Peano curve, one line filling a square. Watch the approximations grow denser at every stage.

The curve folds like a snake, filling the gaps. More folds mean more points touched. In the limit it passes through every point of the square. But it must visit some points twice. So no injective filling exists.

For example, color a whole sheet with a ✏️ pencil, never lifting it. Zigzag densely back and forth, and eventually every point is touched. One line fills an entire surface.

γn→γ uniformly,γ:[0,1]→[0,1]2 continuous and onto\gamma_n \to \gamma \text{ uniformly},\quad \gamma : [0,1] \to [0,1]^2 \text{ continuous and onto}
No continuous bijection [0,1]→[0,1]2 exists\text{No continuous bijection } [0,1] \to [0,1]^2 \text{ exists}

Examples & Exercises

Show that the order-kk approximants pk:[0,1]→[0,1]2p_k: [0,1] \to [0,1]^2 (the recursive subdivision of the snake polyline through the 9 subsquares) are uniformly Cauchy, and prove completely that the uniform limit pp is continuous.

∥pk+1−pk∥∞≤23k→0\|p_{k+1} - p_k\|_\infty \le \frac{\sqrt{2}}{3^k} \to 0
Order k=1k = 1: 9 segments snake through the 9 subsquare centers — this pattern repeats recursively inside each subsquare.
Show proof
  1. Each pkp_k is a polyline, hence continuous. The parametrization is: pkp_k traverses each interval [(j−1)/9k, j/9k][(j-1)/9^k,\, j/9^k] inside the jj-th level-kk subsquare Qj(k)Q_j^{(k)} (side 3−k3^{-k}), in snake order.

  2. pk+1p_{k+1} refines pkp_k: on [(j−1)/9k, j/9k][(j-1)/9^k,\, j/9^k] it traverses the 9 level-(k+1)(k+1) subsquares inside the same Qj(k)Q_j^{(k)} (the recursion applies the same pattern within each QjQ_j). Hence for every tt, pk(t)p_k(t) and pk+1(t)p_{k+1}(t) both lie in Qj(k)Q_j^{(k)}, so ∣pk+1(t)−pk(t)∣≤diam Qj(k)=2 3−k|p_{k+1}(t) - p_k(t)| \le \mathrm{diam}\, Q_j^{(k)} = \sqrt{2}\, 3^{-k}.

    Sum the tail: for m>nm > n, the triangle inequality gives ∣pm(t)−pn(t)∣≤∑j=nm−1∣pj+1(t)−pj(t)∣≤∑j=nm−12 3−j=2 3−n 1−3−(m−n)1−1/3≤322 3−n|p_m(t) - p_n(t)| \le \sum_{j=n}^{m-1} |p_{j+1}(t) - p_j(t)| \le \sum_{j=n}^{m-1} \sqrt{2}\, 3^{-j} = \sqrt{2}\, 3^{-n}\, \frac{1 - 3^{-(m-n)}}{1 - 1/3} \le \frac{3\sqrt{2}}{2}\, 3^{-n}. The right side tends to 0 as n→∞n \to \infty, independently of tt and mm, so (pk)(p_k) is uniformly Cauchy. Since R2\mathbb{R}^2 is complete, pk(t)p_k(t) converges for each tt, and uniform Cauchyness makes the convergence uniform — call the limit pp.

  3. A uniform limit of continuous functions is continuous: from ∣p(s)−p(t)∣≤∣p(s)−pk(s)∣+∣pk(s)−pk(t)∣+∣pk(t)−p(t)∣|p(s) - p(t)| \le |p(s) - p_k(s)| + |p_k(s) - p_k(t)| + |p_k(t) - p(t)|, make the first and third terms small by uniform convergence, then the middle term small by continuity of the fixed pkp_k (the ε/3\varepsilon/3 argument). Hence p:[0,1]→[0,1]2p: [0,1] \to [0,1]^2 is a continuous limit curve.

Prove completely that the limit curve p:[0,1]→[0,1]2p: [0,1] \to [0,1]^2 from the problem above is surjective.

p([0,1])=[0,1]2p([0,1]) = [0,1]^2
Order k=2k = 2: 81 segments visit every cell of the 9×99 \times 9 grid — the square fills up as the order grows.
Show proof
  1. Take any y∈[0,1]2y \in [0,1]^2. At each level kk, yy lies in some level-kk subsquare Q(k)Q^{(k)} (side 3−k3^{-k}).

    Since pkp_k visits every level-kk subsquare, there is tkt_k with pk(tk)∈Q(k)p_k(t_k) \in Q^{(k)}.

  2. Since (tk)(t_k) lies in [0,1][0,1], compactness gives a convergent subsequence tkj→tt_{k_j} \to t. By continuity, p(tkj)→p(t)p(t_{k_j}) \to p(t).

    But ∣p(tkj)−y∣≤∣p(tkj)−pkj(tkj)∣+∣pkj(tkj)−y∣|p(t_{k_j}) - y| \le |p(t_{k_j}) - p_{k_j}(t_{k_j})| + |p_{k_j}(t_{k_j}) - y|: the first term is at most 322 3−kj\frac{3\sqrt{2}}{2}\, 3^{-k_j} by the uniform tail estimate proved in peano-uniform-limit (∣pm−pn∣≤322 3−n|p_m - p_n| \le \frac{3\sqrt{2}}{2}\, 3^{-n} for m>nm > n; let m→∞m \to \infty), and the second is at most 2 3−kj\sqrt{2}\, 3^{-k_j} because both points lie in the same Q(kj)Q^{(k_j)} of diameter 2 3−kj\sqrt{2}\, 3^{-k_j}. Both tend to 00, hence p(t)=yp(t) = y.

  3. Since yy was arbitrary, pp passes through every point of [0,1]2[0,1]^2 — a continuous surjection p:[0,1]→[0,1]2p: [0,1] \to [0,1]^2. That a 1-dimensional interval can "fill" a 2-dimensional square was Peano's 1890 discovery.

Prove completely that no continuous bijection [0,1]→[0,1]2[0,1] \to [0,1]^2 exists (Netto's theorem). Hence the Peano curve above cannot be injective.

no continuous bijection [0,1]→[0,1]2\text{no continuous bijection } [0,1] \to [0,1]^2
Order k=3k = 3: 729 segments — the curve crosses itself countless times, visibly ruling out injectivity.
Show proof
  1. Two lemmas first. (A) The continuous image of a compact set is compact: if KK is compact and ff continuous, an open cover {Ui}\{U_i\} of f(K)f(K) pulls back to an open cover {f−1(Ui)}\{f^{-1}(U_i)\} of KK, which has a finite subcover whose images cover f(K)f(K).

    (B) A compact subset of a Hausdorff space is closed: if K⊆YK \subseteq Y is compact and y∉Ky \notin K, each x∈Kx \in K has disjoint neighborhoods Ux∋xU_x \ni x, Vx∋yV_x \ni y (Hausdorff); finitely many UxiU_{x_i} cover KK, so ⋂Vxi\bigcap V_{x_i} is a neighborhood of yy missing KK.

  2. Netto's theorem: a continuous bijection from a compact space to a Hausdorff space is a homeomorphism. Indeed, if F⊆KF \subseteq K is closed then FF is compact — a closed subset of a compact set is compact (for K=[0,1]K = [0,1] this is Heine–Borel) — so f(F)f(F) is compact by (A) and closed in YY by (B) — i.e. ff is a closed map.

    A closed bijection is a homeomorphism ((f−1)−1(F)=f(F)(f^{-1})^{-1}(F) = f(F) is closed, so f−1f^{-1} is continuous).

  3. If f:[0,1]→[0,1]2f: [0,1] \to [0,1]^2 were a continuous bijection, it would be a homeomorphism. Removing an interior point c∈(0,1)c \in (0,1) disconnects the interval: [0,1]∖{c}=[0,c)∪(c,1][0,1] \setminus \{c\} = [0,c) \cup (c,1] is a separation into disjoint nonempty opens.

    In contrast, [0,1]2[0,1]^2 minus the corresponding point r:=f(c)r := f(c) is path-connected, shown here with explicit formulas.

  4. Take two points p,q≠rp, q \ne r. If p=qp = q, the constant path γ(t)≡p\gamma(t) \equiv p works. If p≠qp \ne q, look at the line L(t)=(1−t)p+tqL(t) = (1-t)p + tq (t∈[0,1]t \in [0,1]). If r∉L([0,1])r \notin L([0,1]), then γ=L\gamma = L is the desired path.

    If r∈L([0,1])r \in L([0,1]), there is a unique t0∈(0,1)t_0 \in (0,1) with r=L(t0)r = L(t_0) (since r≠p,qr \ne p, q). Set the midpoint m=p+q2m = \frac{p+q}{2}, direction d=q−pd = q - p, unit normal n=(−d2,d1)∣d∣n = \frac{(-d_2, d_1)}{|d|}, and pick the detour point s=m+εns = m + \varepsilon n (ε≠0\varepsilon \ne 0, chosen explicitly below). The path is two segments joined: γ(t)=(1−2t)p+2ts\gamma(t) = (1-2t)p + 2ts (0≤t≤120 \le t \le \frac12), γ(t)=(2−2t)s+(2t−1)q\gamma(t) = (2-2t)s + (2t-1)q (12≤t≤1\frac12 \le t \le 1).

  5. Check that rr is avoided. Points xx on the line pqpq satisfy n⋅(x−m)=0n \cdot (x - m) = 0 (since n⊥dn \perp d), and rr lies on it, so n⋅(r−m)=0n \cdot (r - m) = 0. For a point (1−u)p+us=(1−u2)p+u2q+uεn(1-u)p + us = (1-\frac{u}{2})p + \frac{u}{2}q + u\varepsilon n on [p,s][p,s], n⋅(x−m)=uεn \cdot (x - m) = u\varepsilon; equaling rr forces uε=0u\varepsilon = 0, i.e. u=0u = 0 — only the point p≠rp \ne r.

    For a point (1−u)s+uq=1−u2p+1+u2q+(1−u)εn(1-u)s + uq = \frac{1-u}{2}p + \frac{1+u}{2}q + (1-u)\varepsilon n on [s,q][s,q], n⋅(y−m)=(1−u)εn \cdot (y - m) = (1-u)\varepsilon, so (1−u)ε=0(1-u)\varepsilon = 0 gives u=1u = 1 — only the point q≠rq \ne r. Hence γ\gamma never passes through rr.

  6. Explicit choice of ε\varepsilon (forcing s∈[0,1]2s \in [0,1]^2): mm cannot be a corner (a corner mm would give p=q=mp = q = m, contradicting p≠qp \ne q). Put δ=min⁡(m1,1−m1,m2,1−m2)≥0\delta = \min(m_1, 1-m_1, m_2, 1-m_2) \ge 0. If δ>0\delta > 0 (mm interior), take ε=δ/2\varepsilon = \delta/2: ∣s−m∣=δ/2<δ|s - m| = \delta/2 < \delta, so ss is interior.

    If δ=0\delta = 0, then mm lies on an edge but is not a corner. For instance with m=(m1,0)m = (m_1, 0), m1∈(0,1)m_1 \in (0,1) (the other three edges are identical via symmetries like (x,y)↦(x,1−y)(x,y) \mapsto (x,1-y)), put η=12min⁡(m1,1−m1)>0\eta = \frac12\min(m_1, 1-m_1) > 0 and take s=m+ηns = m + \eta n if n2≥0n_2 \ge 0, s=m−ηns = m - \eta n if n2<0n_2 < 0. Then s2=η∣n2∣∈[0,η]⊂[0,1]s_2 = \eta|n_2| \in [0,\eta] \subset [0,1] and ∣s1−m1∣≤η≤12min⁡(m1,1−m1)|s_1 - m_1| \le \eta \le \frac12\min(m_1, 1-m_1), so s1∈(0,1)s_1 \in (0,1) — i.e. s∈[0,1]2s \in [0,1]^2. With s∈[0,1]2s \in [0,1]^2, convexity keeps both segments [p,s][p,s], [s,q][s,q] inside [0,1]2[0,1]^2.

  7. Thus any two points of [0,1]2∖{r}[0,1]^2 \setminus \{r\} are joined by an explicit path avoiding rr — path-connected, hence connected. A homeomorphism restricts to a homeomorphism of the punctured spaces — contradiction. So no continuous bijection exists, and the Peano surjection cannot be injective.

5. Topology