{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "1Y4N1DDQNR"
    }
  ],
  "body": "\n## Counterexample\n\nLet $C \\subseteq [0, 1]$ be the [[Cantor set|0BXNDZFQME]].\nFor $x \\in [0, 1]$, write $x$ in base $3$ as $x = 0.a_1 a_2 a_3 \\ldots$ with $a_k \\in \\set{0, 1, 2}$.\nIf some digit equals $1$, delete all digits after the first $1$.\nThen replace each digit $2$ by $1$, and read the result $0.b_1 b_2 b_3 \\ldots$ in base $2$.\nThe value is $c(x) = \\sum_k b_k 2^{-k}$, and it does not depend on the choice of the base-$3$ expansion.\n\nThe function $c \\colon [0, 1] \\to [0, 1]$ is [[continuous|0P27W9RW0G]] and nondecreasing, with $c(0) = 0$ and $c(1) = 1$.\nIt is constant on each open interval removed in the construction of $C$, for example $c(x) = 1/2$ on $(1/3, 2/3)$.\nSo $c'(x) = 0$ at every point of $[0, 1] \\setminus C$.\nThe Cantor set is a [[null set|VQQM4Y550T]], so $c' = 0$ [[almost everywhere|RARTMA0ZEC]].\nBut $c$ is not constant.\n\n## Remarks\n\nThe function refutes the claim that a continuous function with derivative $0$ almost everywhere is constant.\nIt also shows that the [[fundamental theorem of calculus|0NHGY0N0JB]] in the form $\\int_0^1 f' = f(1) - f(0)$ can fail for a continuous [[monotone function|0WFF6AZPBP]] differentiable almost everywhere.\nHere $\\int_0^1 c'(x) \\, dx = 0$, while $c(1) - c(0) = 1$.\nSo $c$ is not [[absolutely continuous|ZT6F4C2YHK]]; it is the standard example of a [[singular function|P5AWRD2793]].\nIt maps the null set $C$ onto all of $[0, 1]$.\nIts graph is often called the devil's staircase.\n\n## Explanations\n\n### L1 human\n\nThe Cantor function climbs from $0$ to $1$ without jumps, yet it is flat almost everywhere.\nAll its growth happens on the Cantor set, a dust of points with total length zero.\nOn the middle third it sits at height $1/2$, on the next two middle thirds at heights $1/4$ and $3/4$, and so on.\nSo knowing that the derivative is zero almost everywhere does not tell you the function is constant.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "kind": "counterexample",
    "msc": [
      "26A30",
      "26A48"
    ],
    "name": "Cantor function",
    "same_as": {
      "wikidata": "Q938883",
      "wikipedia": "Cantor function"
    },
    "sources": [
      {
        "locator": "Definition",
        "url": "https://en.wikipedia.org/wiki/Cantor_function"
      }
    ],
    "tag": "NPBYYK63FE",
    "uses": [
      "0BXNDZFQME",
      "0WFF6AZPBP",
      "0P27W9RW0G",
      "0F1WR9C83K",
      "ZT6F4C2YHK",
      "P5AWRD2793",
      "0NHGY0N0JB"
    ]
  },
  "kind": "counterexample",
  "link": "https://math2.tamnd.com/node/NPBYYK63FE/",
  "links": [
    {
      "field": "uses",
      "target": "0BXNDZFQME"
    },
    {
      "field": "uses",
      "target": "0WFF6AZPBP"
    },
    {
      "field": "uses",
      "target": "0P27W9RW0G"
    },
    {
      "field": "uses",
      "target": "0F1WR9C83K"
    },
    {
      "field": "uses",
      "target": "ZT6F4C2YHK"
    },
    {
      "field": "uses",
      "target": "P5AWRD2793"
    },
    {
      "field": "uses",
      "target": "0NHGY0N0JB"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/NPBYYK63FE.md",
  "msc": [
    "26A30",
    "26A48"
  ],
  "name": "Cantor function",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/NPB/NPBYYK63FE.md",
  "status": null,
  "tag": "NPBYYK63FE",
  "uri": "m2://NPBYYK63FE",
  "url": "https://math2.tamnd.com/wiki/cantor-function/",
  "writing": {
    "tag": "NPBYYK63FE",
    "kind": "counterexample",
    "level": "W0",
    "next": [
      {
        "what": "edge refutes or not_instance_of out",
        "have": 0,
        "want": 1
      }
    ]
  }
}
