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.
Formal definition 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
O b j ( C T ) = O b j ( C ) , H o m C T ( X , Y ) = H o m C ( X , T Y ) . {\displaystyle {\begin{aligned}\mathrm {Obj} ({{\mathcal {C}}_{T}})&=\mathrm {Obj} ({\mathcal {C}}),\\\mathrm {Hom} _{{\mathcal {C}}_{T}}(X,Y)&=\mathrm {Hom} _{\mathcal {C}}(X,TY).\end{aligned}}}
That is, every morphism f: X → T Y in C (with codomain TY) can also be regarded as a morphism in CT (but with codomain Y). Composition of morphisms in CT is given by
g ∘ T f = μ Z ∘ T g ∘ f : X → T Y → T 2 Z → T Z {\displaystyle g\circ _{T}f=\mu _{Z}\circ Tg\circ f:X\to TY\to T^{2}Z\to TZ}
where f: X → T Y and g: Y → T Z. The identity morphism is given by the monad unit η:
i d X = η X {\displaystyle \mathrm {id} _{X}=\eta _{X}} . An alternative way of writing this, which clarifies the category in which each object lives, is used by MacLane. We use very slightly different notation for this presentation. Given the same monad and category C {\displaystyle C} as above, we associate with each object X {\displaystyle X} in C {\displaystyle C} a new object X T {\displaystyle X_{T}} , and for each morphism f : X → T Y {\displaystyle f\colon X\to TY} in C {\displaystyle C} a morphism f ∗ : X T → Y T {\displaystyle f^{*}\colon X_{T}\to Y_{T}} . Together, these objects and morphisms form our category C T {\displaystyle C_{T}} , where we define composition, also called Kleisli composition, by
g ∗ ∘ T f ∗ = ( μ Z ∘ T g ∘ f ) ∗ . {\displaystyle g^{*}\circ _{T}f^{*}=(\mu _{Z}\circ Tg\circ f)^{*}.}
Then the identity morphism in C T {\displaystyle C_{T}} , the Kleisli identity, is
i d X T = ( η X ) ∗ . {\displaystyle \mathrm {id} _{X_{T}}=(\eta _{X})^{*}.}
Extension operators and Kleisli triples 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
… excerpt ends here. Continue reading the full article.
