{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe show that the image $f(K)$ contains its supremum and its infimum.\n\n1. Let $S = f(K) \\subseteq \\R$. Since $K$ is nonempty, $S$ is nonempty.\n2. The [[continuous image of a compact set is compact|0K9AAJ8G51]]. So $S$ is compact in $\\R$.\n3. Give $\\R$ the [[Euclidean metric|0E1MMCAY5B]] $d(s, t) = \\abs{s - t}$. By the [[Heine–Borel theorem|07PFYV65MB]] with $n = 1$, the set $S$ is [[closed|0G5AV9Q4RR]] and [[bounded|0P953MG05E]].\n4. By step 3 there is a real $M$ with $\\abs{s - t} \\le M$ for all $s, t \\in S$. Fix $t_0 \\in S$. Then $t_0 - M \\le s \\le t_0 + M$ for each $s \\in S$.\n5. So $S$ is bounded above and below. By the [[completeness axiom|0AXWET80YW]], $S$ has a [[supremum|0BTMQ04556]] $\\beta$. By the [[existence of the infimum|0EDH403M21]], $S$ has an [[infimum|04KFTA34C5]] $\\alpha$.\n6. Suppose $\\beta \\notin S$. Then $\\beta$ lies in $\\R \\setminus S$, which is open because $S$ is closed.\n7. By the definition of the [[metric topology|0A6YRNZB2R]], there is $\\varepsilon \u003e 0$ with $(\\beta - \\varepsilon, \\beta + \\varepsilon) \\cap S = \\varnothing$.\n8. Let $s \\in S$. Then $s \\le \\beta$, and $s \\notin (\\beta - \\varepsilon, \\beta]$ by step 7. So $s \\le \\beta - \\varepsilon$.\n9. Thus $\\beta - \\varepsilon$ is an upper bound of $S$ that is smaller than $\\beta$. This contradicts the definition of the supremum. Hence $\\beta \\in S$.\n10. In the same way, suppose $\\alpha \\notin S$. Then some $\\varepsilon \u003e 0$ gives $(\\alpha - \\varepsilon, \\alpha + \\varepsilon) \\cap S = \\varnothing$.\n11. Each $s \\in S$ has $s \\ge \\alpha$ and $s \\notin [\\alpha, \\alpha + \\varepsilon)$, so $s \\ge \\alpha + \\varepsilon$. Then $\\alpha + \\varepsilon$ is a lower bound larger than $\\alpha$, a contradiction. Hence $\\alpha \\in S$.\n12. By steps 9 and 11, there are $a, b \\in K$ with $f(a) = \\alpha$ and $f(b) = \\beta$.\n13. For each $x \\in K$, $f(x) \\in S$, so $\\alpha \\le f(x) \\le \\beta$. That is, $f(a) \\le f(x) \\le f(b)$ for all $x \\in K$.\n\n## Idea\n\nCompactness passes from $K$ to the image $f(K)$, and a compact subset of $\\R$ is closed and bounded. A bounded set has a supremum and an infimum. Because the set is closed, these two numbers cannot sit outside it, so they are values of $f$.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "54C30"
    ],
    "name": "Proof that a continuous real function on a compact set attains its bounds",
    "proves": "0V4DET59NW",
    "sources": [
      {
        "locator": "Generalization to metric and topological spaces",
        "url": "https://en.wikipedia.org/wiki/Extreme_value_theorem"
      }
    ],
    "tag": "RKQWD3FMKV",
    "uses": [
      "0K9AAJ8G51",
      "07PFYV65MB",
      "0E1MMCAY5B",
      "0P953MG05E",
      "0AXWET80YW",
      "0EDH403M21",
      "0BTMQ04556",
      "04KFTA34C5",
      "0G5AV9Q4RR",
      "0A6YRNZB2R"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/RKQWD3FMKV/",
  "links": [
    {
      "field": "proves",
      "target": "0V4DET59NW"
    },
    {
      "field": "uses",
      "target": "0K9AAJ8G51"
    },
    {
      "field": "uses",
      "target": "07PFYV65MB"
    },
    {
      "field": "uses",
      "target": "0E1MMCAY5B"
    },
    {
      "field": "uses",
      "target": "0P953MG05E"
    },
    {
      "field": "uses",
      "target": "0AXWET80YW"
    },
    {
      "field": "uses",
      "target": "0EDH403M21"
    },
    {
      "field": "uses",
      "target": "0BTMQ04556"
    },
    {
      "field": "uses",
      "target": "04KFTA34C5"
    },
    {
      "field": "uses",
      "target": "0G5AV9Q4RR"
    },
    {
      "field": "uses",
      "target": "0A6YRNZB2R"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/RKQWD3FMKV.md",
  "msc": [
    "54C30"
  ],
  "name": "Proof that a continuous real function on a compact set attains its bounds",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/RKQ/RKQWD3FMKV.md",
  "status": null,
  "tag": "RKQWD3FMKV",
  "uri": "m2://RKQWD3FMKV",
  "url": "https://math2.tamnd.com/wiki/proof-that-a-continuous-real-function-on-a-compact-set-attains-its-bounds/",
  "writing": {
    "tag": "RKQWD3FMKV",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
