{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe prove the two directions separately. Only the second direction uses the axiom of choice.\n\n1. Let $f \\colon A \\to B$ be a [[function|0XHDTE5YMZ]].\n2. First suppose that $f$ has a [[right inverse|0DDPZAG5ER]] $h \\colon B \\to A$. So $f(h(b)) = b$ for each $b \\in B$.\n3. Let $b \\in B$ and put $a = h(b) \\in A$. By step 2, $f(a) = b$. So $f$ is [[surjective|0XKH881BZ7]].\n4. Now suppose that $f$ is surjective. For $b \\in B$, let $F_b = f^{-1}(\\set{b}) = \\set{a \\in A \\mid f(a) = b}$ be the [[preimage|0FGCFY1AZX]] of $\\set{b}$.\n5. Since $f$ is surjective, each $F_b$ is nonempty. Let $X = \\set{F_b \\mid b \\in B}$. Then $X$ is a set of nonempty sets.\n6. By the [[axiom of choice|0HTGB13FE2]], there is a [[choice function|0YXEQWRGP0]] $c \\colon X \\to \\bigcup X$ with $c(S) \\in S$ for each $S \\in X$.\n7. Each $F_b$ is a subset of $A$, so $\\bigcup X \\subseteq A$. Define $h \\colon B \\to A$ by $h(b) = c(F_b)$.\n8. Let $b \\in B$. By step 6, $h(b) = c(F_b) \\in F_b$. By the definition of $F_b$, this says $f(h(b)) = b$.\n9. By step 8, $f \\circ h = \\mathrm{id}_B$, where $\\mathrm{id}_B$ is the [[identity function|0FSNQ0GNCC]] and $\\circ$ is [[composition|07HF9YCWPP]]. So $h$ is a right inverse of $f$.\n10. By steps 3 and 9, $f$ is surjective if and only if $f$ has a right inverse.\n\n## Idea\n\nA right inverse must pick, for each $b$, one point of $A$ that $f$ sends to $b$. Surjectivity says such points exist, and the axiom of choice lets us pick one for every $b$ at once. Conversely, the picked point $h(b)$ shows that $b$ is hit.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "03E20"
    ],
    "name": "Proof that a function is surjective iff it has a right inverse",
    "proves": "0TYQNHVB4C",
    "sources": [
      {
        "locator": "Proof 1",
        "url": "https://proofwiki.org/wiki/Surjection_iff_Right_Inverse"
      }
    ],
    "tag": "A2A69H6MM4",
    "uses": [
      "0XKH881BZ7",
      "0DDPZAG5ER",
      "0HTGB13FE2",
      "0YXEQWRGP0",
      "0FGCFY1AZX",
      "0XHDTE5YMZ",
      "07HF9YCWPP",
      "0FSNQ0GNCC"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/A2A69H6MM4/",
  "links": [
    {
      "field": "proves",
      "target": "0TYQNHVB4C"
    },
    {
      "field": "uses",
      "target": "0XKH881BZ7"
    },
    {
      "field": "uses",
      "target": "0DDPZAG5ER"
    },
    {
      "field": "uses",
      "target": "0HTGB13FE2"
    },
    {
      "field": "uses",
      "target": "0YXEQWRGP0"
    },
    {
      "field": "uses",
      "target": "0FGCFY1AZX"
    },
    {
      "field": "uses",
      "target": "0XHDTE5YMZ"
    },
    {
      "field": "uses",
      "target": "07HF9YCWPP"
    },
    {
      "field": "uses",
      "target": "0FSNQ0GNCC"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/A2A69H6MM4.md",
  "msc": [
    "03E20"
  ],
  "name": "Proof that a function is surjective iff it has a right inverse",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/A2A/A2A69H6MM4.md",
  "status": null,
  "tag": "A2A69H6MM4",
  "uri": "m2://A2A69H6MM4",
  "url": "https://math2.tamnd.com/wiki/proof-that-a-function-is-surjective-iff-it-has-a-right-inverse/",
  "writing": {
    "tag": "A2A69H6MM4",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
