\[ \require{mathtools} \let\DeclarePairedDelimiter\DeclarePairedDelimiters % MathJax typo % sup \newcommand{\op}{^\mathrm{op}} \newcommand{\inv}{^{-1}} % rm \newcommand{\Kl}{\mathrm{Kl}} % symbol \newcommand{\xto}{\xrightarrow} \newcommand{\toot}{\rightleftarrows} \newcommand{\comma}{\downarrow} \newcommand{\incl}{\hookrightarrow} \newcommand{\mono}{\rightarrowtail} \newcommand{\epi}{\twoheadrightarrow} \newcommand{\iso}{\cong} \newcommand{\nat}{\Rightarrow} \newcommand{\adj}{\dashv} % delimiter \DeclarePairedDelimiter{\parens}{(}{)} % parentheses ( ) \DeclarePairedDelimiter{\bracks}{[}{]} % brackets [ ] \DeclarePairedDelimiter{\braces}{\{}{\}} % braces { } \DeclarePairedDelimiter{\angles}{\langle}{\rangle} % angles \newcommand{\set}{\braces} % operator \DeclareMathOperator{\Obj}{Obj} \DeclareMathOperator{\Hom}{Hom} \DeclareMathOperator{\Eq}{Eq} \DeclareMathOperator{\Coeq}{Coeq} \DeclareMathOperator{\Pull}{Pull} \DeclareMathOperator{\Push}{Push} \DeclareMathOperator{\Lan}{Lan} \DeclareMathOperator{\Ran}{Ran} \DeclareMathOperator{\Lift}{Lift} \DeclareMathOperator{\Rift}{Rift} \DeclareMathOperator{\id}{id} \DeclareMathOperator{\act}{act} \DeclareMathOperator{\colim}{colim} \DeclareMathOperator{\partf}{partial} \DeclareMathOperator{\curry}{curry} \DeclareMathOperator{\zero}{zero} \DeclareMathOperator{\succ}{succ} \DeclareMathOperator{\nil}{nil} \DeclareMathOperator{\cons}{cons} \DeclareMathOperator{\copy}{copy} \DeclareMathOperator{\del}{del} % sets \newcommand{\N}{\mathbb{N}} % natural numbers \newcommand{\Z}{\mathbb{Z}} % integers \newcommand{\Q}{\mathbb{Q}} % rational numbers \newcommand{\R}{\mathbb{R}} % real numbers % category \newcommand{\catf}[1]{{\mathbf{#1}}} \newcommand{\cA}{\catf{A}} \newcommand{\cB}{\catf{B}} \newcommand{\cC}{\catf{C}} \newcommand{\cD}{\catf{D}} \newcommand{\cE}{\catf{E}} \newcommand{\cI}{\catf{I}} \newcommand{\cJ}{\catf{J}} \newcommand{\cS}{\catf{S}} \newcommand{\cT}{\catf{T}} \newcommand{\cV}{\catf{V}} \newcommand{\cZero}{\catf{0}} \newcommand{\cOne}{\catf{1}} \newcommand{\cTwo}{\catf{2}} % \newcommand{\cArr}{\catf{Arr}} % arrow \newcommand{\cPSh}{\catf{PSh}} % presheaf \newcommand{\cCone}{\catf{Cone}} % cone \newcommand{\cCocone}{\catf{Cocone}} % cocone % \newcommand{\cSet}{\catf{Set}} % sets \newcommand{\cFinSet}{\catf{FinSet}} % finite sets \newcommand{\cRel}{\catf{Rel}} % relations \newcommand{\cPos}{\catf{Pos}} % posets \newcommand{\cMon}{\catf{Mon}} % monoids \newcommand{\cGrp}{\catf{Grp}} % groups \newcommand{\cAb}{\catf{Ab}} % Abelian groups \newcommand{\cVect}{\catf{Vect}} % vector spaces \newcommand{\cCat}{\catf{Cat}} % categories % logic \newcommand{\lfal}{\bot} \newcommand{\ltru}{\top} \]
A monad is a structure that describes generalized objects and morphisms.
1 Monad
A monad in a category \(\cC\) is an endofunctor \(T: \cC \to \cC\) equipped with two natural transformations:
- composition \(\mu: TT \nat T\)
- unit \(\eta: \id_\cC \nat T\)
subject to
- associativity: \(\mu (T \mu) = \mu (\mu T)\)
- identity: \(\mu (T \eta) = \mu (\eta T) = \id_T\)
2 T-algebra
For a monad \((T, \mu, \eta)\), an algebra over a monad (T-algebra) is a left M-module \((A, \alpha_A: TA \to A)\) over the monad in the category of endofunctors.
Thus, a T-algebra is compatible with
- monad composition: \(\alpha_A \circ T \alpha_A = \alpha_A \circ \mu_A\)
- monad unit: \(\alpha_A \circ \eta_A = \id_A\)
A T-algebra homomorphism is an F-algebra homomorphism.
3 Kleisli category
For a monad \((T, \mu, \eta)\) in a category \(\cC\), the Kleisli category \(\cC_T\) is a category whose
- objects are \(\cC\)-objects
- morphisms are Kleisli morphisms \(A \xto{f_\Kl} TB\)
- composition is the Kleisli composition \(g_\Kl \circ_\Kl f_\Kl := \mu \circ Tg_\Kl \circ f_\Kl\)
4 Eilenberg–Moore category
For a monad \((T, \mu, \eta)\) in a category \(\cC\), the Eilenberg–Moore category \(\cC^T\) is a category of T-algebras and T-algebra homomorphisms.
5 Monadic adjunction
5.1 Adjunction to monad
An adjunction
\[(F: \cC \toot \cD: G, \epsilon: FG \nat \id_\cD, \eta: \id_\cC \nat GF)\]
give rise to a monad
\[(GF: \cC \to \cC, G \epsilon F: GFGF \nat GF, \eta: \id_\cC \nat GF)\]
and a comonad
\[(FG: \cD \to \cD, F \eta G: FG \nat FGFG, \epsilon: FG \nat \id_\cD)\]
5.2 Monad to adjunction
6 Monoidal monad
A monoidal monad is a monad in the 2-category of monoidal categories, lax monoidal functors, and monoidal natural transformations.
7 Monoidal Kleisli category
For a monoidal monad \((T, \mu_T, \eta_T, \mu, \eta)\) in \((\cC, \otimes, I)\), the Kleisli category \(\cC_T\) inherits the monoidal structure from \(\cC\), whose
monoidal multiplication \(\otimes_\Kl\) on objects is the monoidal multiplication \(\otimes\) on \(\cC\)
monoidal multiplication \(\otimes_\Kl\) on morphisms is obtained by \(f_\Kl \otimes_\Kl g_\Kl := \mu (f_\Kl \otimes g_\Kl)\)
\[(A \xto{f_\Kl} TB) \otimes_\Kl (C \xto{g_\Kl} TD) = A \otimes C \xto{f_\Kl \otimes_\Kl g_\Kl} T(B\otimes D) = A \otimes C \xto{f_\Kl \otimes g_\Kl} TB \otimes TD \xto{\mu_{B, D}} T(B \otimes D)\]
monoidal unit, associator, and left/right unitors are those of \(\cC\)