{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nFix $B$ with $|B| = n$. For a set $A$, let $I(A)$ be the set of [[injective|0PVG1CRAJN]] functions from $A$ to $B$. We argue by induction on $k = |A|$ that $I(A)$ is finite with $(n)_k$ elements.\n\n1. Let $k = 0$. Then $A = \\varnothing$, and the empty function is the only function from $A$ to $B$. It is injective. So $|I(A)| = 1 = (n)_0$.\n2. Suppose the claim holds for all sets with $k$ elements. Let $|A| = k + 1$, with a [[bijection|0SNQEF7Z53]] $f : \\set{1, \\dots, k+1} \\to A$.\n3. Put $a = f(k+1)$ and $A' = A \\setminus \\set{a}$. The restriction of $f$ to $\\set{1, \\dots, k}$ is a bijection onto $A'$, so $|A'| = k$.\n4. By the induction hypothesis, $I(A')$ has $N = (n)_k$ elements. Here $(n)_k$ is the [[falling factorial|0N5M924N3P]].\n5. For $\\varphi \\in I(A)$, the [[restriction|0D2MXBV21T]] $\\varphi|_{A'}$ is injective, so it lies in $I(A')$. For $\\psi \\in I(A')$, let $E_\\psi$ be the set of $\\varphi \\in I(A)$ with $\\varphi|_{A'} = \\psi$.\n6. Each $\\varphi \\in I(A)$ lies in exactly one set $E_\\psi$, namely for $\\psi = \\varphi|_{A'}$. So the sets $E_\\psi$ are pairwise disjoint, and their union is $I(A)$.\n7. Fix $\\psi \\in I(A')$ and let $C = \\psi(A')$. The map $\\psi$ is a bijection from $A'$ onto $C$. Composing a numbering of $A'$ with $\\psi$ numbers $C$, so $|C| = k$, as in the [[bijection principle|0GV2573FP4]].\n8. By the [[complement principle|03QC59M99B]], $B \\setminus C$ is finite with $n - k$ elements. In particular $k \\le n$.\n9. For $\\varphi \\in E_\\psi$, we have $\\varphi(a) \\notin C$. Otherwise $\\varphi(a) = \\psi(x) = \\varphi(x)$ for some $x \\in A'$, against injectivity, since $x \\ne a$.\n10. Conversely, for $b \\in B \\setminus C$, extend $\\psi$ by $a \\mapsto b$. The result is injective, because $\\psi$ is injective and $b$ is not a value of $\\psi$.\n11. So $\\varphi \\mapsto \\varphi(a)$ is a bijection from $E_\\psi$ to $B \\setminus C$, with the extension of step 10 as inverse. Composing a numbering of $B \\setminus C$ with this inverse shows $|E_\\psi| = n - k$.\n12. If $N = 0$, then $I(A')$ is empty, so by step 6 the set $I(A)$ is empty. Also $(n)_{k+1} = (n)_k (n - k) = 0$.\n13. If $N \\ge 1$, the [[rule of sum|0EE2V3CHFK]] applied to the $N$ sets $E_\\psi$ gives $|I(A)| = N (n - k) = (n)_k (n - k)$.\n14. By the definition of the falling factorial, $(n)_k (n - k) = (n)_{k+1}$. So $|I(A)| = (n)_{k+1}$, and the induction is complete.\n\n## Idea\n\nBuild an injection one point at a time.\nThe new point may go to any element of $B$ that is not already used, and exactly $k$ are used.\nSo each step multiplies the count by the number of unused values, which gives the falling factorial.\n",
  "commit": "68a8c3dc73fd55004b2796431c607c30960d1a85",
  "front": {
    "kind": "proof",
    "methods": [
      "0ASJVEFA9J"
    ],
    "msc": [
      "05A05"
    ],
    "name": "Proof of the number of injections",
    "proves": "0X0N833FF8",
    "sources": [
      {
        "url": "https://proofwiki.org/wiki/Cardinality_of_Set_of_Injections"
      }
    ],
    "tag": "E1TQVD7TVM",
    "uses": [
      "05099E1NMJ",
      "0PVG1CRAJN",
      "0N5M924N3P",
      "0D2MXBV21T",
      "0SNQEF7Z53",
      "03QC59M99B",
      "0EE2V3CHFK",
      "0GV2573FP4"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/E1TQVD7TVM/",
  "links": [
    {
      "field": "proves",
      "target": "0X0N833FF8"
    },
    {
      "field": "uses",
      "target": "05099E1NMJ"
    },
    {
      "field": "uses",
      "target": "0PVG1CRAJN"
    },
    {
      "field": "uses",
      "target": "0N5M924N3P"
    },
    {
      "field": "uses",
      "target": "0D2MXBV21T"
    },
    {
      "field": "uses",
      "target": "0SNQEF7Z53"
    },
    {
      "field": "uses",
      "target": "03QC59M99B"
    },
    {
      "field": "uses",
      "target": "0EE2V3CHFK"
    },
    {
      "field": "uses",
      "target": "0GV2573FP4"
    },
    {
      "field": "methods",
      "target": "0ASJVEFA9J"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/E1TQVD7TVM.md",
  "msc": [
    "05A05"
  ],
  "name": "Proof of the number of injections",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/E1T/E1TQVD7TVM.md",
  "status": null,
  "tag": "E1TQVD7TVM",
  "uri": "m2://E1TQVD7TVM",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-number-of-injections/",
  "writing": {
    "tag": "E1TQVD7TVM",
    "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
      }
    ]
  }
}
