{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "VA6BNNY2YC"
    }
  ],
  "body": "\n## Statement\n\nFix a [[Gödel numbering|MFJXPAF0R0]] $e \\mapsto M_e$ of all [[Turing machines|758EYCN27B]] with input and output in the natural numbers.\nLet $H = \\set{(e, x) \\in \\N^2 : M_e \\text{ halts on input } x}$.\nThen $H$ is not a [[computable set|PPGD5KW8JC]]: no Turing machine halts on every input $(e, x)$ and outputs $1$ if $(e, x) \\in H$ and $0$ otherwise.\n\n## Remarks\n\nSuppose a machine $D$ decides $H$.\nBuild a machine $N$ that, on input $e$, runs $D$ on $(e, e)$, loops forever if the answer is $1$, and halts if the answer is $0$.\nLet $n$ be a number of $N$.\nThen $N$ halts on $n$ if and only if $(n, n) \\notin H$, that is, if and only if $N$ does not halt on $n$, a contradiction.\n\nThe set $H$ is computably enumerable, since a universal machine halts on $(e, x)$ exactly when $M_e$ halts on $x$.\nSo $H$ is an example of a computably enumerable set that is not computable.\nBy the same argument, the diagonal set $K = \\set{e : M_e \\text{ halts on input } e}$ is not computable.\n\n## Explanations\n\n### L1 human\n\nThere is no general method to tell, for an arbitrary program and input, whether the program will eventually stop.\nOne can run the program and wait, but if it has not stopped yet one never knows whether it will.\nThe proof imagines a perfect halting tester and builds a program that does the opposite of what the tester predicts about itself.\n\n### L2 human\n\nThis result goes back to Turing's paper of 1936, and it is the standard first example of an undecidable problem.\nMost other undecidability results are proved by reducing the halting problem to them.\nExamples are [[Rice's theorem|AKDR5YBBE2]], the undecidability of first-order validity, and the negative solution of [[Hilbert's tenth problem|X8TVJSVTD4]].\nIn the [[arithmetical hierarchy|7CVJCQKY41]], $H$ is $\\Sigma^0_1$-complete.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "about": [
      "758EYCN27B",
      "PPGD5KW8JC"
    ],
    "kind": "statement",
    "msc": [
      "03D10",
      "03D25"
    ],
    "name": "Undecidability of the halting problem",
    "role": "theorem",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Halting_problem"
      }
    ],
    "tag": "Z7TN2B35B0",
    "uses": [
      "758EYCN27B",
      "PPGD5KW8JC",
      "MFJXPAF0R0"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/Z7TN2B35B0/",
  "links": [
    {
      "field": "about",
      "target": "758EYCN27B"
    },
    {
      "field": "about",
      "target": "PPGD5KW8JC"
    },
    {
      "field": "uses",
      "target": "758EYCN27B"
    },
    {
      "field": "uses",
      "target": "PPGD5KW8JC"
    },
    {
      "field": "uses",
      "target": "MFJXPAF0R0"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/Z7TN2B35B0.md",
  "msc": [
    "03D10",
    "03D25"
  ],
  "name": "Undecidability of the halting problem",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/Z7T/Z7TN2B35B0.md",
  "status": null,
  "tag": "Z7TN2B35B0",
  "uri": "m2://Z7TN2B35B0",
  "url": "https://math2.tamnd.com/wiki/undecidability-of-the-halting-problem/",
  "writing": {
    "tag": "Z7TN2B35B0",
    "kind": "statement",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      },
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
