{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe compare the two functions at each point.\n\n1. Let $f \\colon A \\to B$, $g \\colon B \\to C$ and $h \\colon C \\to D$ be [[functions|0XHDTE5YMZ]].\n2. By the definition of [[composition|07HF9YCWPP]], $g \\circ f \\colon A \\to C$ and $h \\circ g \\colon B \\to D$. So $h \\circ (g \\circ f)$ and $(h \\circ g) \\circ f$ are both functions from $A$ to $D$.\n3. Let $a \\in A$. By the definition of composition, applied twice, $(h \\circ (g \\circ f))(a) = h((g \\circ f)(a)) = h(g(f(a)))$.\n4. Also $((h \\circ g) \\circ f)(a) = (h \\circ g)(f(a)) = h(g(f(a)))$.\n5. By steps 3 and 4, the two functions take the same value at each $a \\in A$.\n6. A function $u \\colon A \\to D$ is the set of pairs $(a, u(a))$ with $a \\in A$. By step 5, both functions are the same set of pairs.\n7. Two [[sets|0SJ3RX9TXA]] with the same elements are equal, by the [[axiom of extensionality|0TB16T2C97]]. Hence $h \\circ (g \\circ f) = (h \\circ g) \\circ f$.\n\n## Idea\n\nBoth ways of grouping send $a$ to $h(g(f(a)))$: first apply $f$, then $g$, then $h$. Functions that agree at every point are equal.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "03E20"
    ],
    "name": "Proof of the associativity of composition",
    "proves": "0J6AKYZQT8",
    "sources": [
      {
        "url": "https://proofwiki.org/wiki/Composition_of_Mappings_is_Associative"
      }
    ],
    "tag": "KC5B2GHS8R",
    "uses": [
      "07HF9YCWPP",
      "0XHDTE5YMZ",
      "0SJ3RX9TXA",
      "0TB16T2C97"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/KC5B2GHS8R/",
  "links": [
    {
      "field": "proves",
      "target": "0J6AKYZQT8"
    },
    {
      "field": "uses",
      "target": "07HF9YCWPP"
    },
    {
      "field": "uses",
      "target": "0XHDTE5YMZ"
    },
    {
      "field": "uses",
      "target": "0SJ3RX9TXA"
    },
    {
      "field": "uses",
      "target": "0TB16T2C97"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/KC5B2GHS8R.md",
  "msc": [
    "03E20"
  ],
  "name": "Proof of the associativity of composition",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/KC5/KC5B2GHS8R.md",
  "status": null,
  "tag": "KC5B2GHS8R",
  "uri": "m2://KC5B2GHS8R",
  "url": "https://math2.tamnd.com/wiki/proof-of-the-associativity-of-composition/",
  "writing": {
    "tag": "KC5B2GHS8R",
    "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
      }
    ]
  }
}
