Misplaced Pages

Kleisli category

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
(Redirected from Kleisli triple) Category theory

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 Mac Lane. 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 : XTY let

f = μ Y T f . {\displaystyle f^{\sharp }=\mu _{Y}\circ Tf.}

Composition in the Kleisli category CT can then be written

g T f = g f . {\displaystyle g\circ _{T}f=g^{\sharp }\circ f.}

The extension operator satisfies the identities:

η X = i d T X f η X = f ( g f ) = g f {\displaystyle {\begin{aligned}\eta _{X}^{\sharp }&=\mathrm {id} _{TX}\\f^{\sharp }\circ \eta _{X}&=f\\(g^{\sharp }\circ f)^{\sharp }&=g^{\sharp }\circ f^{\sharp }\end{aligned}}}

where f : XTY and g : YTZ. It follows trivially from these properties that Kleisli composition is associative and that ηX is the identity.

In fact, to give a monad is to give a Kleisli tripleT, η, (–)⟩, i.e.

  • A function T : o b ( C ) o b ( C ) {\displaystyle T\colon \mathrm {ob} (C)\to \mathrm {ob} (C)} ;
  • For each object A {\displaystyle A} in C {\displaystyle C} , a morphism η A : A T ( A ) {\displaystyle \eta _{A}\colon A\to T(A)} ;
  • For each morphism f : A T ( B ) {\displaystyle f\colon A\to T(B)} in C {\displaystyle C} , a morphism f : T ( A ) T ( B ) {\displaystyle f^{\sharp }\colon T(A)\to T(B)}

such that the above three equations for extension operators are satisfied.

Kleisli adjunction

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 FC → CT by

F X = X T {\displaystyle FX=X_{T}\;}
F ( f : X Y ) = ( η Y f ) {\displaystyle F(f\colon X\to Y)=(\eta _{Y}\circ f)^{*}}

and a functor G : CTC by

G Y T = T Y {\displaystyle GY_{T}=TY\;}
G ( f : X T Y T ) = μ Y T f {\displaystyle G(f^{*}\colon X_{T}\to Y_{T})=\mu _{Y}\circ Tf\;}

One can show that F and G are indeed functors and that F is left adjoint to G. The counit of the adjunction is given by

ε Y T = ( i d T Y ) : ( T Y ) T Y T . {\displaystyle \varepsilon _{Y_{T}}=(\mathrm {id} _{TY})^{*}:(TY)_{T}\to Y_{T}.}

Finally, one can show that T = GF and μ = GεF so that ⟨T, η, μ⟩ is the monad associated to the adjunction ⟨F, G, η, ε⟩.

Showing that GF = T

For any object X in category C:

( G F ) ( X ) = G ( F ( X ) ) = G ( X T ) = T X . {\displaystyle {\begin{aligned}(G\circ F)(X)&=G(F(X))\\&=G(X_{T})\\&=TX.\end{aligned}}}

For any f : X Y {\displaystyle f:X\to Y} in category C:

( G F ) ( f ) = G ( F ( f ) ) = G ( ( η Y f ) ) = μ Y T ( η Y f ) = μ Y T η Y T f = id T Y T f = T f . {\displaystyle {\begin{aligned}(G\circ F)(f)&=G(F(f))\\&=G((\eta _{Y}\circ f)^{*})\\&=\mu _{Y}\circ T(\eta _{Y}\circ f)\\&=\mu _{Y}\circ T\eta _{Y}\circ Tf\\&={\text{id}}_{TY}\circ Tf\\&=Tf.\end{aligned}}}

Since ( G F ) ( X ) = T X {\displaystyle (G\circ F)(X)=TX} is true for any object X in C and ( G F ) ( f ) = T f {\displaystyle (G\circ F)(f)=Tf} is true for any morphism f in C, then G F = T {\displaystyle G\circ F=T} . Q.E.D.

References

  1. Mac Lane (1998). Categories for the Working Mathematician. p. 147.

External links

Category theory
Key concepts
Key concepts
Universal constructions
Limits
Colimits
Algebraic categories
Constructions on categories
A simple triangular commutative diagram
Higher category theory
Key concepts
  • Categorification
  • Enriched category
  • Higher-dimensional algebra
  • Homotopy hypothesis
  • Model category
  • Simplex category
  • String diagram
  • Topos
  • n-categories
    Weak n-categories
    Strict n-categories
    Categorified concepts
    Categories: