Contents

This entry is about the notion of monad in category theory. For other notions see monad (disambiguation).

Contents

The entry is about monads in the sense of category theory, for another concept see also monad in nonstandard analysis.

Idea

A monad is a structure that is a lot like a monoid, but that lives in a bicategory rather than a monoidal category. In other words, the concept of a monad is a vertical categorification of that of a monoid.

Monads are among the most pervasive structures in category theory and its applications: for example, they are central to the category-theoretic account of universal algebra, as well as underlying the theory of simplicial objects and thus, via the Dold-Kan correspondence, much of homological algebra.

Definition

Monads

A monad in a bicategory K K is given by

an object a a , together with

an endomorphism t : a → a t \colon a \to a , and

2-cells η : 1 a → t \eta \colon 1_a \to t (the unit of t t ) and μ : t ∘ t → t \mu \colon t \circ t \to t (the multiplication)

such that the diagrams

t → η t t t ← t η t ↘ ↓ μ ↙ t t t t → μ t t t t μ ↓ ↓ μ t t → μ t \array{ t & \stackrel{\eta t}{\to} & t t & \stackrel{t \eta}{\leftarrow} & t \\ & \searrow & \downarrow \mathrlap{\mu} & \swarrow & \\ & & t & & } \qquad \qquad \array{ t t t & \stackrel{\mu t}{\to} & t t \\ \mathllap{t \mu} \downarrow & & \downarrow \mathrlap{\mu} \\ t t & \stackrel{\mu}{\to} & t }

commute (where certain coherence isomorphisms have been omitted).

The name “monad” and the terms “unit”, “multiplication” and “associativity” bear a clear analogy with monoids (but see also at monad (disambiguation)). Indeed, one can define a monad on an object a a of a bicategory K K as just a monoid object in the endomorphism category K ( a , a ) K(a,a) . Alternatively, monads can be taken as more fundamental, and a monoid in a monoidal category C C can be defined as a monad in B C \mathbf{B} C , the one-object bicategory corresponding to C C .

A third and somewhat less obvious definition says that a monad in K K is a lax 2-functor from the terminal bicategory 1 1 to K K : the unique object * \ast of 1 1 is sent to the object a a , the morphism 1 a 1_a becomes t t , and η \eta and μ \mu arise from the coherent 2-cells expressing lax functoriality. This in turn is equivalent to saying that a monad is a category enriched in a bicategory with a single object and single morphism. Among higher-category theorists, it’s tempting to suggest that this is the most fundamental definition, and the most basic reason for the ubiquity and importance of monads. Regardless of this, however, the earlier more elementary definitions are both practically and pedagogically essential.

Finally, a monad can be defined in terms of the “Kleisli operation” taking any map a → T b a \to T b to a map T a → T b T a \to T b ; see extension system.

We can picture a monad in K K as an image of the third oriental in K K . See the remarks at monoidal category.

The data of and axioms for a monad can be expressed graphically as string diagrams. Writing T : C → C , η , μ T \colon C \to C, \eta, \mu for the monad in question (this notation being the standard one when K = Cat K = Cat ), these data can be represented as

Thanks to the distinctive shapes, one can usually omit the labels:

The axioms then appear as:

Monads in Cat Cat are sometimes, mostly in older literature, also called triples (alluding to the triple of data ( A , μ , i ) (A,\mu,i) ), following Eilenberg and Moore. In even older literature, they are also referred to as standard constructions, the original term used by Godement when he introduced the idea. For terminological remarks by Ross Street see category-list here.

The bicategory of monads

Given the equivalence between monads in K K and lax functors 1 → K 1 \to K it is straightforward to define the bicategory Mnd ( K ) Mnd(K) of monads in K K to be the lax functor category [ 1 , K ] ℓ [1,K]_\ell , which consists of lax functors, lax transformations and modifications.

Spelling this out, we see that an object of Mnd ( K ) Mnd(K) is a monad ( a , t , η , μ ) (a,t,\eta,\mu) in K K . A morphism of monads ( a , t ) → ( b , s ) (a,t) \to (b,s) is given by 1-cell x : a → b x \colon a \to b together with a 2-cell λ : s x → x t \lambda \colon s x \to x t satisfying

x → η s x s x x η t ↓ ↓ λ x t → 1 x t s s x → s λ s x t → λ t x t t μ s x ↓ ↓ x μ t s x → λ x t \array{ x & \stackrel{\eta^s x}{\to} & s x \\ \mathllap{x \eta^t} \downarrow & & \downarrow \mathrlap{\lambda} \\ x t & \stackrel{1}{\to} & x t }\qquad \qquad \array{ s s x & \stackrel{s \lambda}{\to} & s x t & \stackrel{\lambda t}{\to} & x t t \\ \mathllap{\mu^s x} \downarrow & & & & \downarrow \mathrlap{x \mu^t} \\ s x & & \stackrel{\lambda}{\to} & & x t }

Finally, a 2-cell ( x , λ ) ⇒ ( y , κ ) (x,\lambda) \Rightarrow (y, \kappa) is given by a 2-cell m : x ⇒ y m \colon x \Rightarrow y satisfying

s x → s m s y λ ↓ ↓ κ x t → m t y t \array{ s x & \stackrel{s m}{\to} & s y \\ \mathllap{\lambda} \downarrow & & \downarrow \mathrlap{\kappa} \\ x t & \stackrel{m t}{\to} & y t }

Algebras/modules over a monad

Given that a monad in a bicategory ℬ \mathcal{B} is nothing but a monoid object in a hom-category ℬ ( a , a ) \mathcal{B}(a,a) , it is natural to consider a module over this monoid: a module for a monad. This notion of module is more general than a module in a monoidal category, however, since it need not live in ℬ ( a , a ) \mathcal{B}(a,a) but can be in ℬ ( b , a ) \mathcal{B}(b,a) (for left modules) or ℬ ( a , c ) \mathcal{B}(a,c) (for right modules).

In a Cat-like bicategory, left modules over a monad are usually known as algebras over the monad. This terminology is confusing from the point of view of monads as monoids, but is justified because in Cat itself, such algebras with domain 1 are just algebras for a monad in the classical sense. Such algebras are a powerful tool to encode general algebraic structures; this is the topic of universal algebra. The algebras over a monad form its Eilenberg-Moore category, which is characterized by a universal property.

Some monads arise from operads, in which case algebras for the monad are the same as algebras for the operad. A Lawvere theory is another special sort of monad in Cat Cat .

Properties

Relation to adjunctions and monadicity

Every adjunction ( L ⊣ R ) (L \dashv R) induces a monad R ∘ L R \circ L and a comonad L ∘ R L \circ R . There is in general more than one adjunction which gives rise to a given monad this way, in fact there is a category of adjunctions for a given monad. The initial object in that category is the adjunction over the Kleisli category of the monad and the terminal object is that over the Eilenberg-Moore category of algebras. (e.g. Borceux, vol. 2, prop. 4.2.2) The latter is called the monadic adjunction.

Moreover, passing from adjunctions to monads and back to their monadic adjunctions constitutes itself an adjunction between adjunctions and monads, called the semantics-structure adjunction.

Examples

Monads in Set Set

Many of these monads also have standard usages as monads in computer science.

Example The free-forgetful adjunction between pointed sets and sets induces an endofunctor ( − ) * : Set → Set (-)_* : Set \to Set which adds a new disjoint point. This is called the maybe monad in computer science.

Example The free-forgetful adjunction between monoids and sets induces an endofunctor T : Set → Set T : Set \to Set defined by TA : = ⨆ n ≥ 0 A n TA := \bigsqcup_{n \ge 0} A^n giving the free monoid monad. This also goes by the name list monad or Kleene-Star? in computer science. The components of the unit η A : A → T A \eta_A : A \to T A give inclusions sending each element of A A to the corresponding singleton list. The components of the multiplication μ A : T 2 A → T A \mu_A : T^2 A \to T A are the concatenation functions, sending a list of lists to the corresponding list (Known as flattening in computer science). This monad can be defined in any monoidal category with coproducts that distribute over the monoidal product.

Example For a fixed set of “states” S S , the ( S × − ⊣ ( − ) S S \times - \dashv (-)^S )-adjunction induces a monad ( S × − ) S (S \times -)^S on Set Set called the state monad. This is a commonly used monad in computer science. In functional programming languages such as Haskell, states can be used to model “side effects” of computations.

Example The contravariant power set functor is its own right adjoint, giving Set ( A , P B ) ≅ Set ( B , P A ) \Set(A,P B) \cong \Set (B, P A) . Note that hom ( A , P B ) = hom ( A , hom ( B , Ω ) ≅ hom ( A × B , Ω ) = P ( A × B ) \hom(A, P B) = \hom(A, \hom(B,\Omega) \cong \hom( A \times B, \Omega) = P(A \times B) inducing a double power set monad taking a set A A to P 2 A P^2 A . The components of the unit are the principle ultrafilter functions η A : A → P 2 A \eta_A : A \to P^2 A which send an element a a to the set of subsets of A A that contain a a . The components of the multiplication μ A \mu_A is the inverse image function for the map η P A : P A → P 3 A \eta_{P A} : P A \to P^3 A . Which can be painfully stated as: the function taking a set of sets of sets of subsets to the set of subsets of A A with the property that one of the sets of sets of subsets is the set of all sets of subsets of A A that include that particular subset as an element. Replacing the two element power object Ω \Omega with any other set gives similar monads. In computer science contexts these are known as continuation monads. This construction can also be generalised for any other cartesian closed category. For example there is a similar double dual monad* on Vect k \Vect_k .

Example function monad

Example necessity possibility

Algebra

Example The free-forgetful adjunction between sets and the category of R R -modules. This induces the free R R -module monad R [ − ] : Set → Set R[-] : Set \to Set . The free abelian group monad and free vector speace monad are special cases.

Example The free-forgetful adjunction between sets and the category of groups gives the free group monad F : Set → Set F : Set \to Set that sends A A to the set F ( A ) F(A) of finite words in the letters a ∈ A a \in A together with inverses a − 1 a^{-1} .

Topology

Example There is a forgetful functor U : Top → Set U : \Top \to \Set taking a topological space to its underlying set. It is right adjoint to the discrete space functor D : Set → Top D: \Set \to \Top taking a set to its discrete topology. There is also an adjoint pair β ⊣ U ′ \beta \dashv U' between the category of compact Hausdorff topological spaces and the category of topological spaces, where β \beta is the Stone-Cech compactification. The composites of these two adjoint pairs gives a monad β : Set → Set \beta : \Set \to \Set sending a set to its underlying set of the Stone-Cech compactification of its discrete space. It is also known as the ultrafilter monad as β \beta can be thought of as the functor taking a set to its set of ultrafilters.

Monads in Cat

Monads are often considered in the 2-category Cat where they are given by endofunctors with a monoid structure on them. In particular, monads in Cat on Set are equivalent to the equational theories studied in universal algebra. In this context, a monad abstracts the concept of an algebraic theory (such as “group” or “ring”), giving a general notion of extra structure on an object of a category.

Classically, if T \mathbf{T} is an algebraic theory (e.g. the theory of groups), a T \mathbf{T} -structure on a set tells us how to interpret various terms (e.g. ( a ⋅ c ) (a\cdot c) ) formed from elements of the set, subject to certain axioms (e.g. ( a ⋅ ( b ⋅ c ) ) = ( ( a ⋅ b ) ⋅ c ) (a\cdot (b\cdot c))=((a\cdot b)\cdot c) ). A monad collects this up into a functor T T . For a set X X , T X T X is the set of all terms of the theory formed from elements of X X , with terms identified if axioms force them to be equal. For groups, T X T X is thus the (underlying set of the) free group of formal words a ⋅ b ⋅ ⋯ ⋅ s a \cdot b \cdot \cdots \cdot s from X X ; the fact that T T gives free structures turns out to be typical.

To capture the theory fully, we need to include a little more data: a natural map η X : X → T X \eta_X : X \to T X recording how each a ∈ X a \in X gives a trivial term a a , and a map μ X : T T X → T X \mu_X:T T X \to T X recording how further terms built from terms are already present as terms in T X T X .

Given a monad in Cat on a category C C , one can always produce a canonical resolution of any object of C C .

Other examples

Monads on posets are particularly simple (in particular, they are always idempotent). In fact, monads on power sets are extremely common throughout mathematics; they are known in less categorially-inclined circles as Moore closures, and there are many examples there.

An internal monad on the subobject classifier of a topos E E is a Lawvere-Tierney topology on E E .

If C C is a category with finite limits, then a monad in the bicategory of spans in C C is the same thing as an internal category in C C .

A monad in the bicategory Prof of profunctors on a category A A can be identified with an identity-on-objects functor A → B A\to B .

Monads in higher category theory

There is a vertical categorification of monads to (∞,1)-categories. See (∞,1)-monad.

in section 3 of

Jacob Lurie, Noncommutative algebra (arXiv)

Related concepts

References

Introductions:

Detailed accounts:

Relation to universal algebra:

Martin Hyland and John Power, The category theoretic understanding of universal algebra: Lawvere theories and monads (pdf).

Anthony Voutas, The basic theory of monads and their connection to universal algebra (pdf)

In higher category theory: