{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $T$ be a [[theory|92SWXST1ZM]] in the language of arithmetic that contains [[Robinson arithmetic|3K1AKGXF8A]] $\\mathsf{Q}$.\nFix a [[Gödel numbering|MFJXPAF0R0]], and let $\\ulcorner \\psi \\urcorner$ be the numeral of the code of $\\psi$.\nFor every [[formula|HYJ10AF6RT]] $\\varphi(x)$ with exactly one free variable $x$, there is a [[sentence|DKFGQTRYZE]] $\\psi$ such that\n$$T \\vdash \\psi \\leftrightarrow \\varphi(\\ulcorner \\psi \\urcorner).$$\n\n## Remarks\n\nProof idea: the diagonal function $d$, which sends the code of a formula $\\theta(x)$ to the code of $\\theta(\\ulcorner \\theta \\urcorner)$, is computable.\nSo it is represented in $\\mathsf{Q}$ by a formula $D(x, y)$.\nLet $\\theta(x)$ be $\\exists y\\, (D(x, y) \\wedge \\varphi(y))$ and let $\\psi$ be $\\theta(\\ulcorner \\theta \\urcorner)$.\nThen $\\psi$ says that $\\varphi$ holds of $d(\\ulcorner \\theta \\urcorner)$, which is the code of $\\psi$, and $\\mathsf{Q}$ proves this equivalence.\n\nExample: with $\\varphi(x) = \\neg \\mathrm{Prov}_T(x)$, the lemma gives a sentence that says of itself \"I am not provable in $T$\", the Gödel sentence of [[Gödel's incompleteness theorems|X9WYNYE29C]].\nNo consistency assumption on $T$ is needed.\n\n## Explanations\n\n### L1 human\n\nThe lemma says that arithmetic can build sentences that talk about themselves.\nFor any property of sentences that arithmetic can express, there is a sentence that says \"I have this property\".\nThis self-reference is the engine behind the incompleteness theorems.\n\n### L2 human\n\nThe diagonal lemma is the common core of [[Gödel's incompleteness theorems|X9WYNYE29C]], [[Tarski's undefinability theorem|YRV6SYK2BY]] and [[Löb's theorem|3HD30YG3DG]].\nEach of them applies the lemma to a well-chosen formula: unprovability, falsity, or a provability implication.\nIt is an arithmetic version of [[Kleene's recursion theorem|F3Z30M606H]], which lets a program refer to its own code.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "about": [
      "MFJXPAF0R0"
    ],
    "kind": "statement",
    "msc": [
      "03F40"
    ],
    "name": "Diagonal lemma",
    "role": "lemma",
    "same_as": {
      "wikidata": "Q2904195",
      "wikipedia": "Diagonal lemma"
    },
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Diagonal_lemma"
      }
    ],
    "tag": "3PRW76471J",
    "uses": [
      "3K1AKGXF8A",
      "MFJXPAF0R0",
      "HYJ10AF6RT",
      "DKFGQTRYZE",
      "92SWXST1ZM"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/3PRW76471J/",
  "links": [
    {
      "field": "about",
      "target": "MFJXPAF0R0"
    },
    {
      "field": "uses",
      "target": "3K1AKGXF8A"
    },
    {
      "field": "uses",
      "target": "MFJXPAF0R0"
    },
    {
      "field": "uses",
      "target": "HYJ10AF6RT"
    },
    {
      "field": "uses",
      "target": "DKFGQTRYZE"
    },
    {
      "field": "uses",
      "target": "92SWXST1ZM"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/3PRW76471J.md",
  "msc": [
    "03F40"
  ],
  "name": "Diagonal lemma",
  "prov": null,
  "role": "lemma",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/3PR/3PRW76471J.md",
  "status": null,
  "tag": "3PRW76471J",
  "uri": "m2://3PRW76471J",
  "url": "https://math2.tamnd.com/wiki/diagonal-lemma/",
  "writing": {
    "tag": "3PRW76471J",
    "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
      }
    ]
  }
}
