{
  "aliases": null,
  "backlinks": [
    {
      "field": "uses",
      "target": "01FPXMTBX1"
    },
    {
      "field": "uses",
      "target": "02486SD328"
    },
    {
      "field": "uses",
      "target": "05NK26G0DR"
    },
    {
      "field": "uses",
      "target": "07EH4R3RVQ"
    },
    {
      "field": "uses",
      "target": "0DDPZAG5ER"
    },
    {
      "field": "uses",
      "target": "0FF2FJ8CH2"
    },
    {
      "field": "uses",
      "target": "0J6AKYZQT8"
    },
    {
      "field": "uses",
      "target": "0M6W4XNST6"
    }
  ],
  "body": "\n## Definition\n\nLet $f \\colon A \\to B$ and $g \\colon B \\to C$ be [[functions|0XHDTE5YMZ]].\nThe composition of $g$ and $f$ is the function $g \\circ f \\colon A \\to C$ with\n$$(g \\circ f)(a) = g(f(a))$$\nfor each $a \\in A$.\n\n## Remarks\n\nRead $g \\circ f$ as \"$g$ after $f$\": $f$ acts first.\nIn general $g \\circ f \\neq f \\circ g$. For $f(x) = x + 1$ and $g(x) = 2x$ on $\\mathbb{R}$, $(g \\circ f)(x) = 2x + 2$ and $(f \\circ g)(x) = 2x + 1$.\nComposition is associative. See [[associativity of composition|0J6AKYZQT8]].\n\n## Explanations\n\n### L1 human\n\nComposition chains two machines: the output of $f$ goes into $g$.\nFor $g \\circ f$ to make sense, the values of $f$ must lie in the domain of $g$.\n",
  "commit": "f591989ed15704e9d8755a7a5a6426d73de7a3ae",
  "front": {
    "defines": "0THBK9V825",
    "kind": "definition",
    "msc": [
      "03E20"
    ],
    "name": "Function composition",
    "sources": [
      {
        "locator": "lead section",
        "url": "https://en.wikipedia.org/wiki/Function_composition"
      }
    ],
    "tag": "07HF9YCWPP",
    "uses": [
      "0XHDTE5YMZ"
    ]
  },
  "kind": "definition",
  "link": "https://math2.tamnd.com/node/07HF9YCWPP/",
  "links": [
    {
      "field": "defines",
      "target": "0THBK9V825"
    },
    {
      "field": "uses",
      "target": "0XHDTE5YMZ"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/07HF9YCWPP.md",
  "msc": [
    "03E20"
  ],
  "name": "Function composition",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/07H/07HF9YCWPP.md",
  "status": null,
  "tag": "07HF9YCWPP",
  "uri": "m2://07HF9YCWPP",
  "url": "https://math2.tamnd.com/wiki/function-composition-definition/",
  "writing": {
    "tag": "07HF9YCWPP",
    "kind": "definition",
    "level": "W1",
    "next": [
      {
        "what": "edge instance_of in",
        "note": "one example",
        "have": 0,
        "want": 1
      },
      {
        "what": "edge not_instance_of in",
        "note": "one non-example that fails one clause",
        "have": 0,
        "want": 1
      }
    ]
  }
}
