{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Definition\n\nLet $\\mathcal{C}$ be a category.\nA *comonad* on $\\mathcal{C}$ is a triple $(G, \\varepsilon, \\delta)$ made of these data.\n\n1. $G \\colon \\mathcal{C} \\to \\mathcal{C}$ is a [[functor|28NQ0KRHD3]].\n2. $\\varepsilon \\colon G \\Rightarrow \\mathrm{Id}_{\\mathcal{C}}$ is a [[natural transformation|KYCPCC57FT]], the counit.\n3. $\\delta \\colon G \\Rightarrow G \\circ G$ is a natural transformation, the comultiplication.\n\nThe data must satisfy two laws.\nThe coassociativity law is $G\\delta \\circ \\delta = \\delta G \\circ \\delta$ as natural transformations $G \\Rightarrow G G G$.\nThe counit laws are $\\varepsilon G \\circ \\delta = \\id_G$ and $G\\varepsilon \\circ \\delta = \\id_G$.\n\n## Remarks\n\nA comonad on $\\mathcal{C}$ is the same as a [[monad|FF6XXA6D1A]] on the opposite category $\\mathcal{C}^{\\mathrm{op}}$.\n\nExample: fix a set $A$ and let $G(X) = A \\times X$ on the category of sets, with $G(f) = \\id_A \\times f$.\nPut $\\varepsilon_X(a, x) = x$ and $\\delta_X(a, x) = (a, (a, x))$.\nBoth sides of the coassociativity law send $(a, x)$ to $(a, (a, (a, x)))$.\nThe counit laws hold since $\\varepsilon_{G(X)}(a, (a, x)) = (a, x)$ and $G(\\varepsilon_X)(a, (a, x)) = (a, x)$.\n\nNon-example: let $A$ have two elements $a_0 \\ne a_1$, and keep $G$ and $\\varepsilon$ but put $\\delta_X(a, x) = (a_0, (a, x))$.\nThen $G(\\varepsilon_X)(\\delta_X(a_1, x)) = (a_0, x) \\ne (a_1, x)$, so a counit law fails.\n\nIf $F \\colon \\mathcal{C} \\to \\mathcal{D}$ is left adjoint to $U \\colon \\mathcal{D} \\to \\mathcal{C}$ with counit $\\varepsilon$ and unit $\\eta$, then $(F U, \\varepsilon, F \\eta U)$ is a comonad on $\\mathcal{D}$.\n",
  "commit": "ff8a40749dc16545e3d2fc637f6b0196e81d0bfa",
  "front": {
    "defines": "97NPWM3S6E",
    "kind": "definition",
    "msc": [
      "18C15"
    ],
    "name": "Comonad",
    "sources": [
      {
        "url": "https://en.wikipedia.org/wiki/Monad_(category_theory)"
      }
    ],
    "tag": "S47R8TG0T3",
    "uses": [
      "28NQ0KRHD3",
      "KYCPCC57FT",
      "FF6XXA6D1A"
    ]
  },
  "kind": "definition",
  "link": "https://tamnd.github.io/math2/node/S47R8TG0T3/",
  "links": [
    {
      "field": "defines",
      "target": "97NPWM3S6E"
    },
    {
      "field": "uses",
      "target": "28NQ0KRHD3"
    },
    {
      "field": "uses",
      "target": "KYCPCC57FT"
    },
    {
      "field": "uses",
      "target": "FF6XXA6D1A"
    }
  ],
  "markdown": "https://tamnd.github.io/math2/node/S47R8TG0T3.md",
  "msc": [
    "18C15"
  ],
  "name": "Comonad",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/S47/S47R8TG0T3.md",
  "status": null,
  "tag": "S47R8TG0T3",
  "uri": "m2://S47R8TG0T3",
  "url": "https://tamnd.github.io/math2/wiki/comonad-definition/",
  "writing": {
    "tag": "S47R8TG0T3",
    "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
      }
    ]
  }
}
