## Monad

### Collection

context | ${\bf C}$ … category |

definiendum | $\langle T,\eta,\mu\rangle$ in $\mathrm{it}$ |

inclusion | $T$ in ${\bf C}^{\bf C}$ |

inclusion | $\eta:1_{\bf C}\xrightarrow{\bullet}T$ |

inclusion | $\mu:TT\xrightarrow{\bullet}T$ |

postulate | $\mu\circ T\mu=\mu\circ\mu T$ |

postulate | $\mu\circ T\eta=\mu\circ\eta T=1_T$ |

#### Discussion

A monad is functor together with two natural transformations that fulfill some algebraic relations.

#### Elaboration

Written out in component form, the postulates read

- $\mu_X\circ T(\mu_X)=\mu_X\circ\mu_{TX}$

- $\mu_X\circ T(\eta_X)=\mu_X\circ\eta_{TX}=1_{TX}$.

Picture the following chain of objects and notice that the axioms merely say the following: All ways ending up at $TX$ must be the same.

$X \overset{\eta_X}{\rightarrow} TX \overset{T(\eta_{TX})\ \text{or}\ \eta_{TX}}{\rightarrow}\ \ \overset{\mu_X}{\leftarrow} TTX \overset{T(\mu_X)\ \text{or}\ \mu_{TX}}{\leftarrow} TTTX$

#### Alternative definition

##### From adjunctions

All monads arise by transferring some co-unit into the other category: Set $T:=GF$ and $\mu_Y:=G(\varepsilon_{FY})$ and you got yourself a monad $\langle T,\eta,\mu\rangle$.

#### Terminology/Notation

The forward arrows $\eta_X$ are called „unit“ or, in programmer circles, „return“. The backwards arrows $\mu_X$ are called „join“ and from the counit-unit adjunction perspective, they are the arrow images of the functor applied to the „co-unit“ components.

##### Algebraic characterization

Recall that $\bf{Set}$ can be equipped with a monoidal structure where units are singletons (= final objects in $\bf{Set}$, e.g. $1:=\{0\}$) and the product $\otimes$ can be taken to be the Cartesian product $M\otimes N:=M\times N$ (= categorical product for $\bf{Set}$). Here, a monoid object is a triple given by

$M$,

$e:1\to M$,

$*:M\times M\to M$.

Now a monad is given by

$T$,

$\eta:1_{\bf C}\xrightarrow{\bullet}T$,

$\mu:TT\xrightarrow{\bullet}T$

and is also a monoid object, namely in the category of endofunctors ${\bf C}^{\bf C}$, with the monoidal product $\otimes$ (not the categorical product) given by concatenation of functors $S\otimes T:= ST$.

#### Reference

Wikipedia: Monad (category theory), Monade (Informatik)