{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe first treat two sets, and then argue by induction on $k$.\n\n1. Let $m = |A|$ and $n = |B|$. By the definition of [[cardinality|05099E1NMJ]], there are [[bijections|0SNQEF7Z53]] $f : \\set{1, \\dots, m} \\to A$ and $g : \\set{1, \\dots, n} \\to B$.\n2. Define $h : \\set{1, \\dots, m + n} \\to A \\cup B$ by $h(i) = f(i)$ for $i \\le m$ and $h(i) = g(i - m)$ for $m \u003c i \\le m + n$.\n3. The map $h$ is surjective. An element of $A$ is $f(i) = h(i)$ for some $i \\le m$. An element of $B$ is $g(j) = h(m + j)$ for some $j \\le n$.\n4. The map $h$ is injective. Let $h(i) = h(i')$. If $i, i' \\le m$, then $f(i) = f(i')$, so $i = i'$ because $f$ is injective.\n5. If $i, i' \u003e m$, then $g(i - m) = g(i' - m)$, so $i = i'$ because $g$ is injective.\n6. If $i \\le m \u003c i'$, then $h(i) \\in A$ and $h(i') \\in B$. This is impossible, because $A$ and $B$ are [[disjoint|0W4RPA8QH3]]. The case $i' \\le m \u003c i$ is the same.\n7. So $h$ is a bijection, $A \\cup B$ is finite, and $|A \\cup B| = m + n = |A| + |B|$.\n8. Now let $A_1, \\dots, A_k$ be pairwise disjoint finite sets. For $k = 0$ the union is empty and both sides are $0$. For $k = 1$ the formula $|A_1| = |A_1|$ holds.\n9. Suppose the formula holds for $k$ sets, and let $A_1, \\dots, A_{k+1}$ be pairwise disjoint finite sets. Put $U = A_1 \\cup \\dots \\cup A_k$.\n10. By the induction hypothesis, $U$ is finite and $|U| = |A_1| + \\dots + |A_k|$.\n11. The sets $U$ and $A_{k+1}$ are disjoint. Indeed, an element of both would lie in $A_i \\cap A_{k+1}$ for some $i \\le k$, and this set is empty.\n12. By steps 1 to 7, $|U \\cup A_{k+1}| = |U| + |A_{k+1}| = |A_1| + \\dots + |A_{k+1}|$. This completes the induction.\n\n## Idea\n\nNumber the elements of $A$ first and then continue the numbering through the elements of $B$.\nBecause no element is in both sets, no element gets two numbers. So the numbers $1$ to $|A| + |B|$ count the union exactly once.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "methods": [
      "0ASJVEFA9J"
    ],
    "msc": [
      "05A05"
    ],
    "name": "Proof of the rule of sum",
    "proves": "0EE2V3CHFK",
    "sources": [
      {
        "url": "https://proofwiki.org/wiki/Sum_Rule_for_Counting"
      }
    ],
    "tag": "QAA80GMKNM",
    "uses": [
      "05099E1NMJ",
      "0SNQEF7Z53",
      "0W4RPA8QH3"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/QAA80GMKNM/",
  "links": [
    {
      "field": "proves",
      "target": "0EE2V3CHFK"
    },
    {
      "field": "uses",
      "target": "05099E1NMJ"
    },
    {
      "field": "uses",
      "target": "0SNQEF7Z53"
    },
    {
      "field": "uses",
      "target": "0W4RPA8QH3"
    },
    {
      "field": "methods",
      "target": "0ASJVEFA9J"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/QAA80GMKNM.md",
  "msc": [
    "05A05"
  ],
  "name": "Proof of the rule of sum",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/QAA/QAA80GMKNM.md",
  "status": null,
  "tag": "QAA80GMKNM",
  "uri": "m2://QAA80GMKNM",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-rule-of-sum/",
  "writing": {
    "tag": "QAA80GMKNM",
    "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
      }
    ]
  }
}
