{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Example\n\nA *space-filling curve* is a [[continuous|0X3WGX95FE]] [[surjection|01RVCMSN5N]] from $[0, 1]$ onto the square $[0, 1]^2$.\nHere is one, due to Lebesgue.\nEach point $x$ of the [[Cantor set|0BXNDZFQME]] $C$ has a unique expansion $x = \\sum_{n \\ge 1} 2 a_n 3^{-n}$ with digits $a_n \\in \\set{0, 1}$.\nSet\n$$f(x) = \\left( \\sum_{n \\ge 1} a_{2n-1} 2^{-n}, \\ \\sum_{n \\ge 1} a_{2n} 2^{-n} \\right).$$\nOn each open interval removed in the construction of $C$, extend $f$ linearly between its values at the two ends.\n\nThe check has three steps.\nThe map $f$ is onto.\nTake binary expansions of both coordinates of a point of $[0, 1]^2$; interleaving their digits gives a point of $C$ that $f$ sends to it.\nThe map $f$ is continuous on $C$.\nTwo points of $C$ less than $3^{-2m}$ apart share their first $2m$ digits, so their images differ by at most $2^{-m}$ in each coordinate.\nThe two ends of a removed interval of length $3^{-k}$ share their first $k - 1$ digits.\nSo short removed intervals carry small linear pieces, and the extended map is continuous.\n\n## Remarks\n\nNo space-filling curve is injective.\nA continuous bijection $[0, 1] \\to [0, 1]^2$ would be a homeomorphism, since $[0, 1]$ is compact and the square is Hausdorff.\nThat is impossible: removing an inner point disconnects $[0, 1]$, but removing a point does not disconnect the square.\nThe first space-filling curve was found by Peano, and Hilbert gave another one.\n\n## Explanations\n\n### L1 human\n\nA space-filling curve is a pencil line drawn without lifting the pencil, in a finite time, that passes through every point of a filled square.\nIt comes as the limit of ever finer zigzag paths.\nThe curve must cross itself: it passes through some points more than once.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "illustrates": [
      "Q5QFYKD004"
    ],
    "kind": "example",
    "msc": [
      "54C05",
      "54F15"
    ],
    "name": "Space-filling curve",
    "same_as": {
      "wikidata": "Q567843",
      "wikipedia": "Space-filling curve"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Space-filling_curve"
      }
    ],
    "tag": "QPRHC4DZ20",
    "uses": [
      "0X3WGX95FE",
      "01RVCMSN5N",
      "0BXNDZFQME"
    ]
  },
  "kind": "example",
  "link": "https://math2.tamnd.com/node/QPRHC4DZ20/",
  "links": [
    {
      "field": "illustrates",
      "target": "Q5QFYKD004"
    },
    {
      "field": "uses",
      "target": "0X3WGX95FE"
    },
    {
      "field": "uses",
      "target": "01RVCMSN5N"
    },
    {
      "field": "uses",
      "target": "0BXNDZFQME"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/QPRHC4DZ20.md",
  "msc": [
    "54C05",
    "54F15"
  ],
  "name": "Space-filling curve",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/QPR/QPRHC4DZ20.md",
  "status": null,
  "tag": "QPRHC4DZ20",
  "uri": "m2://QPRHC4DZ20",
  "url": "https://math2.tamnd.com/wiki/space-filling-curve/",
  "writing": {
    "tag": "QPRHC4DZ20",
    "kind": "example",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
