{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe build the bijection piece by piece: it follows $f$ on one part of $A$ and $g^{-1}$ on the rest.\n\n1. Let $f \\colon A \\to B$ and $g \\colon B \\to A$ be [[injective functions|0PVG1CRAJN]].\n2. By [[definition by recursion|0DSHAVH45F]], define subsets $C_n \\subseteq A$ by $C_0 = A \\setminus g(B)$ and $C_{n+1} = g(f(C_n))$. Here $g(f(C_n))$ is the [[image|0Q3F20XB0A]] of $C_n$ under $g \\circ f$.\n3. Let $C = \\bigcup_{n \\in \\N} C_n$ be their [[union|05GK32H72H]].\n4. Let $x \\in A \\setminus C$. Then $x \\notin C_0$, so $x \\in g(B)$. Since $g$ is injective, exactly one $y \\in B$ has $g(y) = x$. Write $g^{-1}(x) = y$.\n5. Define $h \\colon A \\to B$ by $h(x) = f(x)$ if $x \\in C$, and $h(x) = g^{-1}(x)$ if $x \\notin C$.\n6. We show that $h$ is injective. Let $x, x' \\in A$ with $h(x) = h(x')$.\n7. If $x, x' \\in C$, then $f(x) = f(x')$, so $x = x'$ because $f$ is injective.\n8. If $x, x' \\notin C$, then $g^{-1}(x) = g^{-1}(x')$. Applying $g$ gives $x = x'$.\n9. Suppose $x \\in C$ and $x' \\notin C$. Then $f(x) = g^{-1}(x')$, so $x' = g(f(x))$.\n10. In step 9, $x \\in C_n$ for some $n$, so $x' \\in g(f(C_n)) = C_{n+1} \\subseteq C$. This contradicts $x' \\notin C$. The case $x \\notin C$, $x' \\in C$ is the same with the roles exchanged.\n11. So $h$ is injective. We show that $h$ is [[surjective|0XKH881BZ7]]. Let $y \\in B$ and put $x = g(y)$.\n12. If $x \\notin C$, then $g^{-1}(x) = y$ by step 4, so $h(x) = y$.\n13. If $x \\in C$, then $x \\in C_n$ for some $n$. Since $x \\in g(B)$, $x \\notin C_0$, so $n \\ge 1$.\n14. So $x \\in C_n = g(f(C_{n-1}))$, and $x = g(f(z))$ for some $z \\in C_{n-1} \\subseteq C$.\n15. Then $g(y) = g(f(z))$, so $y = f(z)$ because $g$ is injective. Since $z \\in C$, $h(z) = f(z) = y$.\n16. Thus $h$ is injective and surjective, so $h \\colon A \\to B$ is a [[bijective function|0SNQEF7Z53]].\n\n## Idea\n\nThe points of $A$ outside $g(B)$ have no preimage under $g$, so they must be sent by $f$. Following them under $g \\circ f$ gives the set $C$ where we use $f$. Everywhere else, $g$ can be undone, and the two pieces fit together without overlap or gaps.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "03E10"
    ],
    "name": "Proof of the Schröder–Bernstein theorem",
    "proves": "0A9V6RKQG6",
    "sources": [
      {
        "url": "https://arxiv.org/abs/1409.1755"
      }
    ],
    "tag": "AT0KGMD056",
    "uses": [
      "0PVG1CRAJN",
      "0SNQEF7Z53",
      "0XKH881BZ7",
      "0Q3F20XB0A",
      "0DSHAVH45F",
      "05GK32H72H"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/AT0KGMD056/",
  "links": [
    {
      "field": "proves",
      "target": "0A9V6RKQG6"
    },
    {
      "field": "uses",
      "target": "0PVG1CRAJN"
    },
    {
      "field": "uses",
      "target": "0SNQEF7Z53"
    },
    {
      "field": "uses",
      "target": "0XKH881BZ7"
    },
    {
      "field": "uses",
      "target": "0Q3F20XB0A"
    },
    {
      "field": "uses",
      "target": "0DSHAVH45F"
    },
    {
      "field": "uses",
      "target": "05GK32H72H"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/AT0KGMD056.md",
  "msc": [
    "03E10"
  ],
  "name": "Proof of the Schröder–Bernstein theorem",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/AT0/AT0KGMD056.md",
  "status": null,
  "tag": "AT0KGMD056",
  "uri": "m2://AT0KGMD056",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-schroder-bernstein-theorem/",
  "writing": {
    "tag": "AT0KGMD056",
    "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
      }
    ]
  }
}
