{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\n1. Let $I$ be a [[countable|0ZG61TFBES]] set, and let $(A_i)_{i \\in I}$ be a [[family of sets|05Q6G4EH2G]] with each $A_i$ countable. Let $U = \\bigcup_{i \\in I} A_i$ be their [[union|05GK32H72H]].\n2. Since $I$ is countable, there is an [[injective function|0PVG1CRAJN]] $e \\colon I \\to \\N$.\n3. For each $i \\in I$, let $J_i$ be the set of injective functions from $A_i$ to $\\N$. Each $J_i$ is nonempty, because $A_i$ is countable.\n4. Let $X = \\{J_i : i \\in I\\}$, a set of nonempty sets. By the [[axiom of choice|0HTGB13FE2]], there is a [[choice function|0YXEQWRGP0]] $c$ on $X$.\n5. For $i \\in I$, put $g_i = c(J_i)$. Then $g_i \\colon A_i \\to \\N$ is injective.\n6. Let $x \\in U$. The set $N_x = \\{e(i) : i \\in I,\\ x \\in A_i\\}$ is a nonempty subset of $\\N$.\n7. By the [[well-ordering principle|01BX15HSRR]], $N_x$ has a least element $m_x$. Since $e$ is injective, exactly one $i \\in I$ has $e(i) = m_x$. Call it $i(x)$. Then $x \\in A_{i(x)}$.\n8. Define $\\phi \\colon U \\to \\N \\times \\N$ by $\\phi(x) = (e(i(x)),\\ g_{i(x)}(x))$.\n9. The map $\\phi$ is injective. Suppose $\\phi(x) = \\phi(y)$. Then $e(i(x)) = e(i(y))$, so $i(x) = i(y)$, because $e$ is injective. Call this index $i$.\n10. Then $g_i(x) = g_i(y)$ with $x, y \\in A_i$. Since $g_i$ is injective, $x = y$.\n11. The set $\\N$ is countable, through the identity map. By the [[product of countable sets is countable|08G4XH86JC]], there is an injective function $\\psi \\colon \\N \\times \\N \\to \\N$.\n12. The composite $\\psi \\circ \\phi \\colon U \\to \\N$ is [[injective|01FPXMTBX1]], as a composition of injections. So $U$ is countable.\n\n## Idea\n\nEach element of the union gets two labels: the label of the first set that contains it, and its label inside that set. Two labels make a pair of natural numbers, and pairs of natural numbers can be coded as single natural numbers. The axiom of choice is used to fix one labelling of each set $A_i$ at once.\n",
  "commit": "68a8c3dc73fd55004b2796431c607c30960d1a85",
  "front": {
    "kind": "proof",
    "msc": [
      "03E10"
    ],
    "name": "Proof that a countable union of countable sets is countable",
    "proves": "0Z8FM54P86",
    "sources": [
      {
        "locator": "Proof 1",
        "url": "https://proofwiki.org/wiki/Countable_Union_of_Countable_Sets_is_Countable"
      }
    ],
    "tag": "87T5JN3P1Q",
    "uses": [
      "0HTGB13FE2",
      "0YXEQWRGP0",
      "0ZG61TFBES",
      "05Q6G4EH2G",
      "05GK32H72H",
      "0PVG1CRAJN",
      "01BX15HSRR",
      "08G4XH86JC",
      "01FPXMTBX1"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/87T5JN3P1Q/",
  "links": [
    {
      "field": "proves",
      "target": "0Z8FM54P86"
    },
    {
      "field": "uses",
      "target": "0HTGB13FE2"
    },
    {
      "field": "uses",
      "target": "0YXEQWRGP0"
    },
    {
      "field": "uses",
      "target": "0ZG61TFBES"
    },
    {
      "field": "uses",
      "target": "05Q6G4EH2G"
    },
    {
      "field": "uses",
      "target": "05GK32H72H"
    },
    {
      "field": "uses",
      "target": "0PVG1CRAJN"
    },
    {
      "field": "uses",
      "target": "01BX15HSRR"
    },
    {
      "field": "uses",
      "target": "08G4XH86JC"
    },
    {
      "field": "uses",
      "target": "01FPXMTBX1"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/87T5JN3P1Q.md",
  "msc": [
    "03E10"
  ],
  "name": "Proof that a countable union of countable sets is countable",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/87T/87T5JN3P1Q.md",
  "status": null,
  "tag": "87T5JN3P1Q",
  "uri": "m2://87T5JN3P1Q",
  "url": "https://math2.tamnd.com/wiki/proof-that-a-countable-union-of-countable-sets-is-countable/",
  "writing": {
    "tag": "87T5JN3P1Q",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
