{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nFix $B$ with $|B| = n$. We argue by induction on $m = |A|$ that $B^A$ is finite with $n^m$ elements.\n\n1. Let $m = 0$. Then $A = \\varnothing$. A [[function|0XHDTE5YMZ]] from $\\varnothing$ to $B$ has the empty graph, so there is exactly one. Thus $|B^A| = 1 = n^0$.\n2. Suppose the claim holds for all sets with $m$ elements. Let $|A| = m + 1$, with a [[bijection|0SNQEF7Z53]] $f : \\set{1, \\dots, m+1} \\to A$.\n3. Put $a = f(m+1)$ and $A' = A \\setminus \\set{a}$. The restriction of $f$ to $\\set{1, \\dots, m}$ is a bijection onto $A'$. So $|A'| = m$.\n4. Define $\\Phi : B^A \\to B^{A'} \\times B$ by $\\Phi(\\varphi) = (\\varphi|_{A'}, \\varphi(a))$, where $\\varphi|_{A'}$ is the [[restriction|0D2MXBV21T]] of $\\varphi$ to $A'$.\n5. Define $\\Psi : B^{A'} \\times B \\to B^A$ as follows. For $\\psi : A' \\to B$ and $b \\in B$, let $\\Psi(\\psi, b)$ send each $x \\in A'$ to $\\psi(x)$ and send $a$ to $b$.\n6. This defines a function on $A$, because each element of $A$ is either in $A'$ or equal to $a$, and not both.\n7. The maps are mutually inverse. Indeed, $\\Psi(\\Phi(\\varphi))$ agrees with $\\varphi$ on $A'$ and at $a$, and $\\Phi(\\Psi(\\psi, b)) = (\\psi, b)$.\n8. By the induction hypothesis, $|B^{A'}| = n^m$. By the [[rule of product|0VPK4X73Q0]], $B^{A'} \\times B$ is finite with $n^m \\cdot n = n^{m+1}$ elements.\n9. The map $\\Psi$ is a bijection onto $B^A$. Composing it with a numbering of $B^{A'} \\times B$ gives a bijection from $\\set{1, \\dots, n^{m+1}}$ to $B^A$.\n10. A composite of bijections is a bijection, since [[injections compose|01FPXMTBX1]] and [[surjections compose|07EH4R3RVQ]]. So $|B^A| = n^{m+1}$, as the [[bijection principle|0GV2573FP4]] also states. This completes the induction.\n\n## Idea\n\nA function on $A$ is the same as a function on $A$ minus one point, together with the value at that point.\nSo adding one point to the domain multiplies the count by $n$, the number of possible values.\nStarting from the single empty function, we get $n^m$.\n",
  "commit": "68a8c3dc73fd55004b2796431c607c30960d1a85",
  "front": {
    "kind": "proof",
    "methods": [
      "0ASJVEFA9J"
    ],
    "msc": [
      "05A05"
    ],
    "name": "Proof of the number of functions between finite sets",
    "proves": "08QQH9F7G0",
    "sources": [
      {
        "url": "https://proofwiki.org/wiki/Cardinality_of_Set_of_All_Mappings"
      }
    ],
    "tag": "CRRWPKG6KN",
    "uses": [
      "05099E1NMJ",
      "0XHDTE5YMZ",
      "0D2MXBV21T",
      "0SNQEF7Z53",
      "0VPK4X73Q0",
      "0GV2573FP4",
      "01FPXMTBX1",
      "07EH4R3RVQ"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/CRRWPKG6KN/",
  "links": [
    {
      "field": "proves",
      "target": "08QQH9F7G0"
    },
    {
      "field": "uses",
      "target": "05099E1NMJ"
    },
    {
      "field": "uses",
      "target": "0XHDTE5YMZ"
    },
    {
      "field": "uses",
      "target": "0D2MXBV21T"
    },
    {
      "field": "uses",
      "target": "0SNQEF7Z53"
    },
    {
      "field": "uses",
      "target": "0VPK4X73Q0"
    },
    {
      "field": "uses",
      "target": "0GV2573FP4"
    },
    {
      "field": "uses",
      "target": "01FPXMTBX1"
    },
    {
      "field": "uses",
      "target": "07EH4R3RVQ"
    },
    {
      "field": "methods",
      "target": "0ASJVEFA9J"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/CRRWPKG6KN.md",
  "msc": [
    "05A05"
  ],
  "name": "Proof of the number of functions between finite sets",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/CRR/CRRWPKG6KN.md",
  "status": null,
  "tag": "CRRWPKG6KN",
  "uri": "m2://CRRWPKG6KN",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-number-of-functions-between-finite-sets/",
  "writing": {
    "tag": "CRRWPKG6KN",
    "kind": "proof",
    "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
      }
    ]
  }
}
