{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Statement\n\nLet $A \\colon \\N \\times \\N \\to \\N$ be the [[Ackermann function|N470JF7ZJX]], given by $A(0, n) = n + 1$, $A(m + 1, 0) = A(m, 1)$ and $A(m + 1, n + 1) = A(m, A(m + 1, n))$.\nThen $A$ is a total [[computable function|KZSB5E471K]] that is not [[primitive recursive|5NVA2JRHPV]].\n\n## Remarks\n\nThe key lemma is a domination result.\nFor every primitive recursive $f \\colon \\N^k \\to \\N$ there is $m \\in \\N$ such that $f(\\bar x) \u003c A(m, \\max \\bar x)$ for all $\\bar x \\in \\N^k$.\nIt is proved by induction on the construction of $f$, using that $A$ is increasing in each argument.\nIf $A$ were primitive recursive, so would be $g(n) = A(n, n)$.\nThen some $m$ would give $A(n, n) \u003c A(m, n)$ for all $n$, which fails at $n = m$.\n\nThe theorem shows that the class of primitive recursive functions is strictly smaller than the class of total computable functions.\nComputability of $A$ follows from the fact that the recursion decreases the pair $(m, n)$ in the lexicographic order.\n\n## Explanations\n\n### L1 human\n\nPrimitive recursive functions are those computed by programs whose loops have bounds fixed before they start.\nThe Ackermann function can be computed, but it grows so fast that no such program keeps up with it.\nSo bounded loops are not enough to compute everything computable.\n\n### L2 human\n\nEach primitive recursive function is dominated by one level $n \\mapsto A(m, n)$ of the Ackermann function.\nThe diagonal $n \\mapsto A(n, n)$ escapes every level, so it is outside the class.\nThis is a diagonal argument, like the one that shows that no effective list of total computable functions contains all of them.\nTo reach all computable functions one adds unbounded search, which gives the [[general recursive functions|HBK5QHC1GC]].\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "about": [
      "N470JF7ZJX",
      "5NVA2JRHPV"
    ],
    "kind": "statement",
    "msc": [
      "03D20"
    ],
    "name": "Ackermann function is not primitive recursive",
    "role": "theorem",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Ackermann_function"
      }
    ],
    "tag": "97QF3KHSBY",
    "uses": [
      "5NVA2JRHPV",
      "KZSB5E471K"
    ]
  },
  "kind": "statement",
  "link": "https://math2.tamnd.com/node/97QF3KHSBY/",
  "links": [
    {
      "field": "about",
      "target": "N470JF7ZJX"
    },
    {
      "field": "about",
      "target": "5NVA2JRHPV"
    },
    {
      "field": "uses",
      "target": "5NVA2JRHPV"
    },
    {
      "field": "uses",
      "target": "KZSB5E471K"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/97QF3KHSBY.md",
  "msc": [
    "03D20"
  ],
  "name": "Ackermann function is not primitive recursive",
  "prov": null,
  "role": "theorem",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/97Q/97QF3KHSBY.md",
  "status": null,
  "tag": "97QF3KHSBY",
  "uri": "m2://97QF3KHSBY",
  "url": "https://math2.tamnd.com/wiki/ackermann-function-is-not-primitive-recursive/",
  "writing": {
    "tag": "97QF3KHSBY",
    "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
      }
    ]
  }
}
