Back to Home

Monads and adjunctions: factorization via Kleisli and Eilenberg-Moore

A monad can be represented as a composition of adjoint functors through an intermediate category. The Kleisli adjunction and the Eilenberg-Moore adjunction are the initial and terminal objects in the category of all adjunctions generating the given monad.

Monads: two polar adjunctions — Kleisli and Eilenberg-Moore
Advertisement 728x90

Monads and Adjunctions: Factorization via Kleisli and Eilenberg-Moore Adjunctions

A monad in a category can be represented as a composition of adjoint functors passing through an intermediate category. This approach reveals the internal structure of a monad and allows analyzing it through two extreme adjunctions: the initial Kleisli adjunction and the terminal Eilenberg-Moore adjunction. Each demonstrates a unique way of organizing information lost or recovered by the functors.

Forgetful and Free Functors

Adjunctions between functors are often described in terms of their roles: the right adjoint is typically "forgetful," while the left adjoint is "free." A forgetful functor loses part of the structure from the original category, collapsing distinct objects into one. The free functor, which is left-adjoint to it, attempts to recover as much information as possible, constructing the "most general" object in the intermediate category.

The example of monoids illustrates this: the forgetful functor U maps the category of monoids Mon(Set) to the category of sets Set, erasing the multiplication operation and associativity laws. The free functor F, left-adjoint to U, constructs for any set a the free monoid Fa — a structure with the most general binary operation, allowing any other monoid to be obtained via morphisms.

Google AdInline article slot

These roles are not strict mathematical definitions but help understand how adjunction organizes information:

  • The right adjoint forgets distinctions, collapsing objects.
  • The left adjoint freely reconstructs structure, creating the most general objects.

Category of Monad Adjunctions

For a monad T on an endofunctor, one can construct a category Adj_T whose objects are all possible adjunctions (D, F, U) that generate T = U∘F. Morphisms between adjunctions are functors K: D → D' satisfying K∘F = F' and U'∘K = U.

This category contains all information about possible realizations of the monad T. A key result: Adj_T has both an initial and a terminal object, representing two extreme ways of factoring the monad.

Google AdInline article slot

Kleisli Adjunction

The Kleisli adjunction is the initial object in Adj_T. The intermediate category here is the category of free T-algebras. Objects are simply objects from the original category C, but morphisms are organized via the monad's operation.

The Kleisli adjunction's functor F sends object a to the free T-algebra (Ta, μ_a), where μ_a is the monad's multiplication. The forgetful functor U simply returns the algebra's object back to the original category, forgetting the multiplication structure.

Key characteristics of the Kleisli adjunction:

Google AdInline article slot
  • The intermediate category has minimal structure; objects correspond directly to those in C.
  • Morphisms reflect the action of the monad through its operation.
  • This adjunction is maximally "free," adding no extra constraints.

Eilenberg-Moore Adjunction

The Eilenberg-Moore adjunction is the terminal object in Adj_T. Its intermediate category is the category of all T-algebras, where objects are pairs (a, h: Ta → a) satisfying the algebra laws.

Here, the functor F sends object a to the free algebra (Ta, μ_a), just as in the Kleisli adjunction. However, the forgetful functor U now maps the algebra (a, h) simply to object a, forgetting not only the multiplication structure but also the specific morphism h.

The Eilenberg-Moore adjunction represents the maximally "forgetful" approach:

  • The intermediate category contains all possible algebras, with rich structure.
  • The forgetful functor loses more information, reducing algebras to their underlying objects.
  • This adjunction shows how a monad can be represented through the complete category of its algebras.

Switching Between Adjunctions

Morphisms in Adj_T allow transitions between different adjunctions. A functor K: D → D', satisfying the adjunction conditions, effectively transforms one representation of the monad into another.

Transitioning from the Kleisli adjunction to the Eilenberg-Moore adjunction is achieved via a functor sending free algebras into the category of all algebras. This functor preserves structure but expands the context.

Key points about switching:

  • Any adjunction generating monad T can be connected to the Kleisli and Eilenberg-Moore adjunctions via morphisms in Adj_T.
  • Transitions reflect varying levels of "forgetting" and "reconstruction" of structure.
  • This enables analyzing the monad across the spectrum of its possible realizations.

Example: Option Monad

Consider the Option monad in the context of filtering. The Option monad's operation can be represented via the Kleisli adjunction, where the intermediate category consists of objects with the possibility of "missing value."

In the Eilenberg-Moore adjunction, Option-algebras are objects equipped with an operation h: Option a → a that "resolves" the missing value, returning a concrete element or executing alternative logic.

Comparison of the two approaches for Option:

  • The Kleisli adjunction focuses on the monad's operation itself, with minimal structure.
  • The Eilenberg-Moore adjunction accounts for all possible ways to handle missing values through algebras.
  • The transition between adjunctions shows how an abstract monadic operation becomes concretized through different handling implementations.

What Matters

  • A monad can be factored through adjoint functors passing through an intermediate category.
  • The category of all adjunctions generating a given monad has initial and terminal objects — the Kleisli and Eilenberg-Moore adjunctions.
  • The Kleisli adjunction represents the maximally free approach, with minimal intermediate structure.
  • The Eilenberg-Moore adjunction demonstrates the maximally forgetful approach, with a rich category of algebras.
  • Transitions between adjunctions via morphisms in Adj_T reveal the full spectrum of possible monad realizations.

— Editorial Team

Advertisement 728x90

Read Next