{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe assign a different rational number to each discontinuity that is not an endpoint of $I$.\n\n1. First let $f$ be increasing: $x \\le y$ implies $f(x) \\le f(y)$. Let $D$ be the set of points of $I$ where $f$ is not continuous.\n2. Call $c \\in I$ an inner point if $I$ has a point $p \u003c c$ and a point $q \u003e c$. Then $(p, q) \\subseteq I$, since $I$ is an [[interval|0TK8Y3J5RW]].\n3. Let $c$ be an inner point. Apply the [[existence of one-sided limits|0KJXHN0TW0]] to $f$ restricted to $(p, q)$. Write $c^-$ and $c^+$ for its left and right limits at $c$.\n4. That result gives $c^- = \\sup_{p \u003c x \u003c c} f(x) \\le f(c) \\le \\inf_{c \u003c x \u003c q} f(x) = c^+$.\n5. Claim: $c^+ \\le f(t)$ for each $t \\in I$ with $t \u003e c$. Choose $s$ with $c \u003c s \u003c \\min(t, q)$. Then $c^+ \\le f(s) \\le f(t)$ by step 4 and monotonicity.\n6. In the same way, $f(t) \\le c^-$ for each $t \\in I$ with $t \u003c c$.\n7. Claim: if $c$ is an inner point in $D$, then $c^- \u003c c^+$. Suppose instead $c^- = c^+$. Then step 4 gives $c^- = f(c) = c^+$.\n8. Let $\\varepsilon \u003e 0$. By the definition of [[one-sided limits|0909PWZR62]], there are $\\delta_1, \\delta_2 \u003e 0$ with these properties. We have $\\abs{f(x) - f(c)} \u003c \\varepsilon$ for $x \\in (p, q)$ with $c - \\delta_1 \u003c x \u003c c$, and also for $x \\in (p, q)$ with $c \u003c x \u003c c + \\delta_2$.\n9. Let $\\delta = \\min(\\delta_1, \\delta_2, c - p, q - c)$. Each $x \\in I$ with $\\abs{x - c} \u003c \\delta$ lies in $(p, q)$, so $\\abs{f(x) - f(c)} \u003c \\varepsilon$ by step 8.\n10. By the [[epsilon-delta form of continuity|0W8YHHGCJG]], $f$ is continuous at $c$. This contradicts $c \\in D$, which proves the claim of step 7.\n11. Let $D_0$ be the set of inner points in $D$. For $c \\in D_0$, the [[density of the rationals|0STX0WRDNG]] gives a rational $r(c)$ with $c^- \u003c r(c) \u003c c^+$.\n12. Let $c \u003c e$ be two points of $D_0$. Put $t = \\frac{c + e}{2}$, so $t \\in I$ and $c \u003c t \u003c e$. Steps 5 and 6 give $c^+ \\le f(t) \\le e^-$.\n13. So $r(c) \u003c c^+ \\le e^- \u003c r(e)$. Hence $r \\colon D_0 \\to \\Q$ is [[injective|0PVG1CRAJN]].\n14. By [[the rationals are countable|0DS9KWFDK2]], there is a bijection $\\N \\to \\Q$. Its inverse $j \\colon \\Q \\to \\N$ is injective. By [[composition of injections|01FPXMTBX1]], $\\varphi = j \\circ r \\colon D_0 \\to \\N$ is injective.\n15. A point of $D$ that is not inner is the least element or the greatest element of $I$. So $D \\setminus D_0$ has at most two points.\n16. Define $\\psi \\colon D \\to \\N$ by $\\psi(c) = \\varphi(c) + 2$ for $c \\in D_0$. Send the least element of $I$ to $0$, if it lies in $D$. Send the greatest element to $1$, if it lies in $D$ and differs from the least.\n17. The map $\\psi$ is injective, since $\\varphi$ is injective and its shifted values are at least $2$. So $D$ is [[countable|0ZG61TFBES]].\n18. Now let $f$ be decreasing, and put $g = -f$. Then $g$ is increasing. Also $\\abs{g(x) - g(c)} = \\abs{f(x) - f(c)}$, so $f$ and $g$ have the same points of continuity.\n19. By steps 1 to 17 applied to $g$, the set of discontinuities of $f$ is countable.\n\n## Idea\n\nAt each discontinuity inside $I$, an increasing function jumps over an open gap between its left and right limits. Gaps at different points do not overlap, because $f$ increases between them. Picking a rational in each gap gives an injection into $\\Q$, and the two endpoints of $I$ add at most two more points.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "26A48"
    ],
    "name": "Proof that a monotone function has countably many discontinuities",
    "proves": "0WYTM4C9QG",
    "sources": [
      {
        "locator": "Corollary 3.6.4",
        "url": "https://www.jirka.org/ra/html/sec_monotonefunc.html"
      }
    ],
    "tag": "855HEQHXC5",
    "uses": [
      "0KJXHN0TW0",
      "0TK8Y3J5RW",
      "0W8YHHGCJG",
      "0909PWZR62",
      "0STX0WRDNG",
      "0DS9KWFDK2",
      "0ZG61TFBES",
      "0PVG1CRAJN",
      "01FPXMTBX1"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/855HEQHXC5/",
  "links": [
    {
      "field": "proves",
      "target": "0WYTM4C9QG"
    },
    {
      "field": "uses",
      "target": "0KJXHN0TW0"
    },
    {
      "field": "uses",
      "target": "0TK8Y3J5RW"
    },
    {
      "field": "uses",
      "target": "0W8YHHGCJG"
    },
    {
      "field": "uses",
      "target": "0909PWZR62"
    },
    {
      "field": "uses",
      "target": "0STX0WRDNG"
    },
    {
      "field": "uses",
      "target": "0DS9KWFDK2"
    },
    {
      "field": "uses",
      "target": "0ZG61TFBES"
    },
    {
      "field": "uses",
      "target": "0PVG1CRAJN"
    },
    {
      "field": "uses",
      "target": "01FPXMTBX1"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/855HEQHXC5.md",
  "msc": [
    "26A48"
  ],
  "name": "Proof that a monotone function has countably many discontinuities",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/855/855HEQHXC5.md",
  "status": null,
  "tag": "855HEQHXC5",
  "uri": "m2://855HEQHXC5",
  "url": "https://math2.tamnd.com/wiki/proof-that-a-monotone-function-has-countably-many-discontinuities/",
  "writing": {
    "tag": "855HEQHXC5",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
