{
  "aliases": [
    "recursive-definition",
    "inductive-definition"
  ],
  "backlinks": [
    {
      "field": "uses",
      "target": "0JRC32D6K2"
    },
    {
      "field": "uses",
      "target": "0W5DSDFQ4G"
    }
  ],
  "body": "\n## Summary\n\nA definition by recursion defines a function on the [[natural numbers|0MWKJ44V5A]] in two parts.\nIt gives the value at $0$, and a rule that gives the value at $n + 1$ from the value at $n$.\nThe recursion theorem says that such a definition always gives exactly one function.\nPrecisely, let $X$ be a set, let $a$ be an element of $X$ and let $g \\colon \\mathbb{N} \\times X \\to X$ be a function.\nThen there is exactly one function $f \\colon \\mathbb{N} \\to X$ with $f(0) = a$ and $f(n + 1) = g(n, f(n))$ for each $n$ in $\\mathbb{N}$.\n\n## Remarks\n\nThe factorial is an example: $0! = 1$ and $(n + 1)! = (n + 1) \\cdot n!$.\nThe [[addition|0W5DSDFQ4G]] and the [[multiplication|0JRC32D6K2]] of natural numbers have definitions by recursion.\nThe proof of the recursion theorem uses the [[principle of mathematical induction|0ASJVEFA9J]].\n\n## Explanations\n\n### L1 human\n\nA recursive definition tells you where to start and how to take one step.\nFor the factorial, you start with $0! = 1$, and each step multiplies by the next number.\nStep by step, this gives $1! = 1$, $2! = 2$, $3! = 6$ and $4! = 24$.\n",
  "commit": "6ac761d40018146541484a9e8b9eafd6ecc303dc",
  "front": {
    "aliases": [
      "recursive-definition",
      "inductive-definition"
    ],
    "kind": "concept",
    "msc": [
      "03E20"
    ],
    "name": "Definition by recursion",
    "same_as": {
      "wikidata": "Q2466486",
      "wikipedia": "Recursive definition"
    },
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Recursive_definition"
      },
      {
        "locator": "Principle of recursive definition",
        "url": "https://en.wikipedia.org/wiki/Recursive_definition"
      }
    ],
    "tag": "0DSHAVH45F"
  },
  "kind": "concept",
  "link": "https://math2.tamnd.com/node/0DSHAVH45F/",
  "links": null,
  "markdown": "https://math2.tamnd.com/node/0DSHAVH45F.md",
  "msc": [
    "03E20"
  ],
  "name": "Definition by recursion",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/0DS/0DSHAVH45F.md",
  "status": null,
  "tag": "0DSHAVH45F",
  "uri": "m2://0DSHAVH45F",
  "url": "https://math2.tamnd.com/wiki/definition-by-recursion/",
  "writing": {
    "tag": "0DSHAVH45F",
    "kind": "concept",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
