nLab
Kleisli category

Context

2-Category theory

Higher algebra

Kleisli category

Idea

Given a monad T on some category 𝒞, the Kleisli category of T has as objects the objects of 𝒞, but a morphism XY in the Kleisli category is a morphism XT(Y) in 𝒞. The monad structure induces a natural composition of such ”T-shifted” morphisms.

Equivalently, the Kleisli category is the full subcategory of the Eilenberg–Moore category of T on the free T-algebras (the free Tmodules).

Definition

Let T=(T,μ,η) be a monad in Cat, where T:CC is an endofunctor with multiplication μ:TTT and unit η:Id CT.

In terms of free algebras

Definition

A free T-algebra over a monad (or free T-module) is a T-algebra (module) of the form (T(M),μ M), where the action is the component of multiplication transformation μ M:T(T(M))T(M).

Definition

The Kleisli category C T of the monad T the subcategory of the Eilenberg–Moore category C T on the free T-algebras.

Remark

If U:C TC is the forgetful functor and F:CC T is the free algebra functor F:M(TM,μ M), then the Kleisli category is simply the full subcategory of C T containing those objects in the image of F.

In terms of Kleisli morphisms

As another way of looking at this, we can keep the same objects as in C but redefine the morphisms. This was the original Kleisli construction:

Definition

The Kleisli category C T has as objects the objects of C, and as morphisms MN the elements of the hom-set C(M,T(N)), in other words morphisms of the form MT(N) in C, called Kleisli morphisms.

Composition is given by the Kleisli composition rule g Kleislif=μ PT(g)f (as in the Grothendieck construction (here MfNgP).

Remark

More explicitly, this means that the Kleisli-composite of f:xTy with g:yTz is the morphism

xfTyTgTTzμzTz.x \stackrel{f}{\to} T y \stackrel{T g}{\to} T T z \stackrel{\mu z}{\to} T z \,.
Remark

This Kleisli composition plays an important role in computer science; for this, see the article at monad (in computer science).

Properties

Universal properties

In more general 2-categories the universal properties of Kleisli objects are dual to the universal properties of Eilenberg–Moore objects?.

In functional programming

In typed functional programming Kleisli composition is used to model functions with side-effects and computation. See at monad (in computer science) for more on this.

References

  • Jenö Szigeti, On limits and colimits in the Kleisli category, Cahiers de Topologie et Géométrie Différentielle Catégoriques, 24 no. 4 (1983), p. 381-391 (NUMDAM)

Discussion of cases where the inclusion of the Kleisli category into the Eilenberg-Moore category is a reflective subcategory is in

  • Marcelo Fiore and Matias Menni, Reflective Kleisli subcategories of the category of Eilenberg-Moore algebras for factorization monads, Theory and Applications of Categories, Vol. 15, CT2004, No. 2, pp 40-65. (TAC)

Discussion in internal category theory is in

  • Tomasz Brzeziński, Adrian Vazquez-Marquez, Internal Kleisli categories, Journal of Pure and Applied Algebra Volume 215, Issue 9, September 2011, Pages 2135–2147 (arXiv:0911.4048)

Discussion of Kleisli categories in type theory is in

  • Alex Simpson, Recursive types in Kleisli Categories (pdf)

Revised on April 17, 2013 05:51:57 by Anonymous Coward (187.199.150.217)