---
tag: S47R8TG0T3
kind: definition
name: Comonad
msc: [18C15]
defines: 97NPWM3S6E
uses: [28NQ0KRHD3, KYCPCC57FT, FF6XXA6D1A]
sources:
  - url: https://en.wikipedia.org/wiki/Monad_(category_theory)
---

## Definition

Let $\mathcal{C}$ be a category.
A *comonad* on $\mathcal{C}$ is a triple $(G, \varepsilon, \delta)$ made of these data.

1. $G \colon \mathcal{C} \to \mathcal{C}$ is a [[functor|28NQ0KRHD3]].
2. $\varepsilon \colon G \Rightarrow \mathrm{Id}_{\mathcal{C}}$ is a [[natural transformation|KYCPCC57FT]], the counit.
3. $\delta \colon G \Rightarrow G \circ G$ is a natural transformation, the comultiplication.

The data must satisfy two laws.
The coassociativity law is $G\delta \circ \delta = \delta G \circ \delta$ as natural transformations $G \Rightarrow G G G$.
The counit laws are $\varepsilon G \circ \delta = \id_G$ and $G\varepsilon \circ \delta = \id_G$.

## Remarks

A comonad on $\mathcal{C}$ is the same as a [[monad|FF6XXA6D1A]] on the opposite category $\mathcal{C}^{\mathrm{op}}$.

Example: fix a set $A$ and let $G(X) = A \times X$ on the category of sets, with $G(f) = \id_A \times f$.
Put $\varepsilon_X(a, x) = x$ and $\delta_X(a, x) = (a, (a, x))$.
Both sides of the coassociativity law send $(a, x)$ to $(a, (a, (a, x)))$.
The counit laws hold since $\varepsilon_{G(X)}(a, (a, x)) = (a, x)$ and $G(\varepsilon_X)(a, (a, x)) = (a, x)$.

Non-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))$.
Then $G(\varepsilon_X)(\delta_X(a_1, x)) = (a_0, x) \ne (a_1, x)$, so a counit law fails.

If $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}$.
