# Kleisli category

Last updated

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

{\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

${\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 η:

${\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. [1] We use very slightly different notation for this presentation. Given the same monad and category ${\displaystyle C}$ as above, we associate with each object ${\displaystyle X}$ in ${\displaystyle C}$ a new object ${\displaystyle X_{T}}$, and for each morphism ${\displaystyle f\colon X\to TY}$ in ${\displaystyle C}$ a morphism ${\displaystyle f^{*}\colon X_{T}\to Y_{T}}$. Together, these objects and morphisms form our category ${\displaystyle C_{T}}$, where we define

${\displaystyle g^{*}\circ _{T}f^{*}=(\mu _{Z}\circ Tg\circ f)^{*}.}$

Then the identity morphism in ${\displaystyle C_{T}}$ is

${\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

${\displaystyle f^{*}=\mu _{Y}\circ Tf.}$

Composition in the Kleisli category CT can then be written

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

The extension operator satisfies the identities:

{\displaystyle {\begin{aligned}\eta _{X}^{*}&=\mathrm {id} _{TX}\\f^{*}\circ \eta _{X}&=f\\(g^{*}\circ f)^{*}&=g^{*}\circ f^{*}\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 ${\displaystyle T\colon \mathrm {ob} (C)\to \mathrm {ob} (C)}$;
• For each object ${\displaystyle A}$ in ${\displaystyle C}$, a morphism ${\displaystyle \eta _{A}\colon A\to T(A)}$;
• For each morphism ${\displaystyle f\colon A\to T(B)}$ in ${\displaystyle C}$, a morphism ${\displaystyle f^{*}\colon T(A)\to T(B)}$

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

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

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

and a functor G : CTC by

${\displaystyle GY_{T}=TY\;}$
${\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

${\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:

${\displaystyle (G\circ F)(X)=G(F(X))}$
${\displaystyle \qquad =G(X_{T})}$
${\displaystyle \qquad =TX}$.

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

${\displaystyle (G\circ F)(f)=G(F(f))}$
${\displaystyle \qquad =G((\eta _{Y}\circ f)^{*})}$
${\displaystyle \qquad =\mu _{Y}\circ T(\eta _{Y}\circ f)}$
${\displaystyle \qquad =\mu _{Y}\circ T\eta _{Y}\circ Tf}$
${\displaystyle \qquad ={\text{id}}_{TY}\circ Tf}$
${\displaystyle \qquad =Tf}$.

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

## Related Research Articles

In mathematics, specifically category theory, a functor is a map between categories. Functors were first considered in algebraic topology, where algebraic objects are associated to topological spaces, and maps between these algebraic objects are associated to continuous maps between spaces. Nowadays, functors are used throughout modern mathematics to relate various categories. Thus, functors are important in all areas within mathematics to which category theory is applied.

In mathematics, the Yoneda lemma is arguably the most important result in category theory. It is an abstract result on functors of the type morphisms into a fixed object. It is a vast generalisation of Cayley's theorem from group theory. It allows the embedding of any category into a category of functors defined on that category. It also clarifies how the embedded category, of representable functors and their natural transformations, relates to the other objects in the larger functor category. It is an important tool that underlies several modern developments in algebraic geometry and representation theory. It is named after Nobuo Yoneda.

In category theory, a branch of mathematics, a natural transformation provides a way of transforming one functor into another while respecting the internal structure of the categories involved. Hence, a natural transformation can be considered to be a "morphism of functors". Indeed, this intuition can be formalized to define so-called functor categories. Natural transformations are, after categories and functors, one of the most fundamental notions of category theory and consequently appear in the majority of its applications.

In mathematics, specifically category theory, adjunction is a relationship that two functors may have. Two functors that stand in this relationship are known as adjoint functors, one being the left adjoint and the other the right adjoint. Pairs of adjoint functors are ubiquitous in mathematics and often arise from constructions of "optimal solutions" to certain problems, such as the construction of a free group on a set in algebra, or the construction of the Stone–Čech compactification of a topological space in topology.

In the context of abstract algebra or universal algebra, a monomorphism is an injective homomorphism. A monomorphism from X to Y is often denoted with the notation X ↪ Y.

In category theory, an epimorphism is a morphism f : XY that is right-cancellative in the sense that, for all objects Z and all morphisms g1, g2: YZ,

In category theory, a branch of mathematics, a monad is an endofunctor, together with two natural transformations required to fulfill certain coherence conditions. Monads are used in the theory of pairs of adjoint functors, and they generalize closure operators on partially ordered sets to arbitrary categories.

In category theory, a branch of mathematics, a functor category is a category where the objects are the functors and the morphisms are natural transformations between the functors. Functor categories are of interest for two main reasons:

Fibred categories are abstract entities in mathematics used to provide a general framework for descent theory. They formalise the various situations in geometry and algebra in which inverse images of objects such as vector bundles can be defined. As an example, for each topological space there is the category of vector bundles on the space, and for every continuous map from a topological space X to another topological space Y is associated the pullback functor taking bundles on Y to bundles on X. Fibred categories formalise the system consisting of these categories and inverse image functors. Similar setups appear in various guises in mathematics, in particular in algebraic geometry, which is the context in which fibred categories originally appeared. Fibered categories are used to define stacks, which are fibered categories with "descent". Fibrations also play an important role in categorical semantics of type theory, and in particular that of dependent type theories.

In mathematics, specifically in category theory, an exponential object or map object is the categorical generalization of a function space in set theory. Categories with all finite products and exponential objects are called cartesian closed categories. Categories without adjoined products may still have an exponential law.

In category theory, monoidal functors are functors between monoidal categories which preserve the monoidal structure. More specifically, a monoidal functor between two monoidal categories consists of a functor between the categories, along with two coherence maps—a natural transformation and a morphism that preserve monoidal multiplication and unit, respectively. Mathematicians require these coherence maps to satisfy additional properties depending on how strictly they want to preserve the monoidal structure; each of these properties gives rise to a slightly different definition of monoidal functors

In category theory, a monoidal monad is a monad on a monoidal category such that the functor is a lax monoidal functor and the natural transformations and are monoidal natural transformations. In other words, is equipped with coherence maps and satisfying certain properties, and the unit and multiplication are monoidal natural transformations. By monoidality of , the morphisms and are necessarily equal.

The covariant formulation of classical electromagnetism refers to ways of writing the laws of classical electromagnetism in a form that is manifestly invariant under Lorentz transformations, in the formalism of special relativity using rectilinear inertial coordinate systems. These expressions both make it simple to prove that the laws of classical electromagnetism take the same form in any inertial coordinate system, and also provide a way to translate the fields and forces from one frame to another. However, this is not as general as Maxwell's equations in curved spacetime or non-rectilinear coordinate systems.

In category theory, a branch of mathematics, a presheaf on a category is a functor . If is the poset of open sets in a topological space, interpreted as a category, then one recovers the usual notion of presheaf on a topological space.

In category theory, a branch of mathematics, a dagger category is a category equipped with a certain structure called dagger or involution. The name dagger category was coined by Peter Selinger.

In mathematics, especially homological algebra, a differential graded category, often shortened to dg-category or DG category, is a category whose morphism sets are endowed with the additional structure of a differential graded -module.

In mathematics, the tensor-hom adjunction is that the tensor product and hom-functor form an adjoint pair:

In category theory, a branch of mathematics, a rigid category is a monoidal category where every object is rigid, that is, has a dual X* and a morphism 1XX* satisfying natural conditions. The category is called right rigid or left rigid according to whether it has right duals or left duals. They were first defined by Neantro Saavedra-Rivano in his thesis on Tannakian categories.

In mathematics, weak bialgebras are a generalization of bialgebras that are both algebras and coalgebras but for which the compatibility conditions between the two structures have been "weakened". In the same spirit, weak Hopf algebras are weak bialgebras together with a linear map S satisfying specific conditions; they are generalizations of Hopf algebras.

In category theory, an abstract mathematical discipline, a nodal decomposition of a morphism is a representation of as a product , where is a strong epimorphism, a bimorphism, and a strong monomorphism.

## References

1. Mac Lane(1998) p.147
• Mac Lane, Saunders (1998). Categories for the Working Mathematician . Graduate Texts in Mathematics. 5 (2nd ed.). New York, NY: Springer-Verlag. ISBN   0-387-98403-8. Zbl   0906.18001.
• Pedicchio, Maria Cristina; Tholen, Walter, eds. (2004). Categorical foundations. Special topics in order, topology, algebra, and sheaf theory. Encyclopedia of Mathematics and Its Applications. 97. Cambridge: Cambridge University Press. ISBN   0-521-83414-7. Zbl   1034.18001.
• Jacques Riguet & Rene Guitart (1992) Enveloppe Karoubienne et categorie de Kleisli, Cahiers de Topologie et Géométrie Différentielle Catégoriques 33(3) : 261–6, via Numdam.org