{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $(T, \\eta, \\mu)$ be a [[monad|FF6XXA6D1A]] on a category $\\mathcal{C}$.\nA *$T$-algebra* is a pair $(A, a)$ of an object $A$ of $\\mathcal{C}$ and a morphism $a \\colon T(A) \\to A$ with these two properties.\n\n1. Unit law: $a \\circ \\eta_A = \\id_A$.\n2. Associativity law: $a \\circ T(a) = a \\circ \\mu_A$ as morphisms $T(T(A)) \\to A$.\n\nA *morphism of $T$-algebras* $f \\colon (A, a) \\to (B, b)$ is a morphism $f \\colon A \\to B$ of $\\mathcal{C}$ with $f \\circ a = b \\circ T(f)$.\n\n## Remarks\n\nExample: let $T$ be the list monad on sets, so $T(X)$ is the [[free monoid|CV013KHVJG]] of finite words in $X$.\nFor a [[monoid|0N6R902FG1]] $M$, let $a$ send a word $(m_1, \\dots, m_n)$ to the product $m_1 m_2 \\cdots m_n$ in $M$, with the empty word sent to the identity.\nThe unit law holds since a one-letter word $m$ evaluates to $m$.\nThe associativity law holds since multiplying the blocks of a word of words and then multiplying the results gives the product of the concatenated word.\nEvery $T$-algebra arises in this way, so $T$-algebras are the same as monoids.\n\nNon-example: for the same monad, let $a \\colon T(\\N) \\to \\N$ send a word to its length.\nThen $a(\\eta_{\\N}(5)) = 1 \\ne 5$, so the unit law fails.\n\nFor every object $X$, the pair $(T(X), \\mu_X)$ is a $T$-algebra, the free $T$-algebra on $X$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "QG1ZXRC8EH",
    "kind": "definition",
    "msc": [
      "18C20",
      "18C15"
    ],
    "name": "Algebra over a monad",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Monad_(category_theory)"
      }
    ],
    "tag": "CZWDNA1HA7",
    "uses": [
      "FF6XXA6D1A",
      "CV013KHVJG",
      "0N6R902FG1"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/CZWDNA1HA7/",
  "links": [
    {
      "field": "defines",
      "target": "QG1ZXRC8EH"
    },
    {
      "field": "uses",
      "target": "FF6XXA6D1A"
    },
    {
      "field": "uses",
      "target": "CV013KHVJG"
    },
    {
      "field": "uses",
      "target": "0N6R902FG1"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/CZWDNA1HA7.md",
  "msc": [
    "18C20",
    "18C15"
  ],
  "name": "Algebra over a monad",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/CZW/CZWDNA1HA7.md",
  "status": null,
  "tag": "CZWDNA1HA7",
  "uri": "m2://CZWDNA1HA7",
  "url": "https://tamnd.github.io/math2/wiki/algebra-over-a-monad-definition/",
  "writing": {
    "tag": "CZWDNA1HA7",
    "kind": "definition",
    "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
      }
    ]
  }
}
