{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nA partial function $f \\colon \\N^k \\rightharpoonup \\N$ is a function from a subset of $\\N^k$ to $\\N$, where $\\N$ is the set of [[natural numbers|0MWKJ44V5A]].\nFor a partial function $g \\colon \\N^{k+1} \\rightharpoonup \\N$, the *minimisation* $\\mu g \\colon \\N^k \\rightharpoonup \\N$ is defined as follows.\nThe value $\\mu g(\\bar x)$ is the least $y$ such that $g(y, \\bar x) = 0$ and $g(z, \\bar x)$ is defined for all $z \u003c y$.\nIf no such $y$ exists, then $\\mu g(\\bar x)$ is undefined.\n\nThe class of *partial recursive functions*, or *$\\mu$-recursive functions*, is the smallest class of partial functions $\\N^k \\rightharpoonup \\N$ with these properties.\n\n1. It contains the zero function, the successor function and the projections, as for [[primitive recursive functions|5NVA2JRHPV]].\n2. It is closed under composition and primitive recursion, where a value is defined only when all values used to compute it are defined.\n3. It is closed under minimisation.\n\nA *general recursive function* is a partial recursive function that is total, that is, defined at every point of $\\N^k$.\n\n## Remarks\n\nExample: let $g(y, x) = x \\mathbin{\\dot-} y \\cdot y$, where $a \\mathbin{\\dot-} b = \\max(a - b, 0)$.\nThe function $g$ is primitive recursive, and $g(y, x) = 0$ exactly when $y^2 \\ge x$.\nSo $\\mu g(x) = \\ceil{\\sqrt x}$, which is defined for all $x$, and $\\mu g$ is general recursive.\n\nNon-example: let $g(y, x) = y + 1$, which is never $0$.\nThen $\\mu g$ is the empty function, which is partial recursive but not total, so it is not general recursive.\n\nTerminology varies: some authors use \"general recursive\" for all partial recursive functions.\nEvery primitive recursive function is general recursive, and the [[Ackermann function|N470JF7ZJX]] shows that the converse fails.\n",
  "commit": "547b6eddb8f2feb8d579f2d633d22a27b7e132fc",
  "front": {
    "defines": "HBK5QHC1GC",
    "kind": "definition",
    "msc": [
      "03D20"
    ],
    "name": "General recursive function",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/General_recursive_function"
      }
    ],
    "tag": "4DQGSSWREK",
    "uses": [
      "5NVA2JRHPV",
      "0MWKJ44V5A"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/4DQGSSWREK/",
  "links": [
    {
      "field": "defines",
      "target": "HBK5QHC1GC"
    },
    {
      "field": "uses",
      "target": "5NVA2JRHPV"
    },
    {
      "field": "uses",
      "target": "0MWKJ44V5A"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/4DQGSSWREK.md",
  "msc": [
    "03D20"
  ],
  "name": "General recursive function",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/4DQ/4DQGSSWREK.md",
  "status": null,
  "tag": "4DQGSSWREK",
  "uri": "m2://4DQGSSWREK",
  "url": "https://math2.tamnd.com/wiki/general-recursive-function-definition/",
  "writing": {
    "tag": "4DQGSSWREK",
    "kind": "definition",
    "level": "W0",
    "next": [
      {
        "what": "a source with a locator",
        "have": 0,
        "want": 1
      }
    ]
  }
}
