In category theory, a Kleisli category is a category naturally associated to any monad T. It is equivalent to the category of free T-algebras. The Kleisli category is one of two extremal solutions to the question: "Does every monad arise from an adjunction?" The other extremal solution is the Eilenberg–Moore category. Kleisli categories are named for the mathematician Heinrich Kleisli.
Let 〈T, η, μ〉 be a monad over a category C. The Kleisli category of C is the category CT whose objects and morphisms are given by
\begin{align}Obj({l{C}T})&=Obj({l{C}}),\\ Homl{CT}(X,Y)&=Homl{C
g\circTf=\muZ\circTg\circf:X\toTY\toT2Z\toTZ
idX=ηX
An alternative way of writing this, which clarifies the category in which each object lives, is used by Mac Lane.[1] We use very slightly different notation for this presentation. Given the same monad and category
C
X
C
XT
f\colonX\toTY
C
f*\colonXT\toYT
CT
*\circ | |
g | |
T |
f*=(\muZ\circTg\circf)*.
CT
id | |
XT |
=
*. | |
(η | |
X) |
Composition of Kleisli arrows can be expressed succinctly by means of the extension operator (–)# : Hom(X, TY) → Hom(TX, TY). Given a monad 〈T, η, μ〉 over a category C and a morphism f : X → TY let
f\sharp=\muY\circTf.
g\circTf=g\sharp\circf.
\sharp | |
\begin{align}η | |
X |
&=idTX
\sharp\circη | |
\\ f | |
X |
&=f\\ (g\sharp\circf)\sharp&=g\sharp\circf\sharp\end{align}
In fact, to give a monad is to give a Kleisli triple 〈T, η, (–)#〉, i.e.
T\colonob(C)\toob(C)
A
C
ηA\colonA\toT(A)
f\colonA\toT(B)
C
f\sharp\colonT(A)\toT(B)
Kleisli categories were originally defined in order to show that every monad arises from an adjunction. That construction is as follows.
Let 〈T, η, μ〉 be a monad over a category C and let CT be the associated Kleisli category. Using Mac Lane's notation mentioned in the “Formal definition” section above, define a functor F: C → CT by
FX=XT
F(f\colonX\toY)=(ηY\circf)*
GYT=TY
G(f*\colonXT\toYT)=\muY\circTf
\varepsilon | |
YT |
=(idTY)*:(TY)T\toYT.
For any object X in category C:
\begin{align} (G\circF)(X)&=G(F(X))\\ &=G(XT)\\ &=TX. \end{align}
For any
f:X\toY
\begin{align} (G\circF)(f)&=G(F(f))\\ &=G((ηY\circf)*)\\ &=\muY\circT(ηY\circf)\\ &=\muY\circTηY\circTf\\ &=idTY\circTf\\ &=Tf. \end{align}
(G\circF)(X)=TX
(G\circF)(f)=Tf
G\circF=T
. Saunders Mac Lane . . 2nd . . 5 . Springer . 1998 . 0-387-98403-8 . 0906.18001 .
. Category Theory in Context. Emily Riehl. Dover Publications. 2016. 978-0-486-80903-8. 1006743127.