nLab
monad

Contents

Idea

A monad is an endomorphism in a 2-category equipped with the structure of a monoid: a 2-morphism from the composite of the morphism to itself, and one from the identity endomorphism to it, satisfying associativity and uniticity.

In the same spirit there is a notion of module over a monad.

Monads are often considered in the 2-category Cat where they are given by endofunctors with a monoid structure on them. Modules over monads in Cat and on Set encode algebraic structures on sets. Therefore modules over a monad are also called algebras overa monad.

In this way, 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 is an algebraic theory (e.g. the theory of groups), a T-structure on a set tells us how to interpret various terms (e.g. (ac)) formed from elements of the set, subject to certain axioms (e.g. (a(bc))=((ab)c)). A monad collects this up into a functor T. For a set X, TX is the set of all terms of the theory formed from elements of X, with terms identified if axioms force them to be equal. For groups, TX is thus the (underlying set of the) free group of formal words abs from X; the fact that 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:XTX recording how each aX gives a trivial term a, and a map μ X:TTXTX recording how further terms built from terms are already present as terms in TX. The axioms satisfied by these maps turn out to have a striking formal relation to the axioms for a monoid.

Definition

In Cat

A monad in Cat on a category C is a monoid in the strict monoidal category End(C) of endofunctors in C (where the tensor product of natural transformations is the horizontal composition?).

More explicitly a monad on C consists of

  • an endofunctor T:CC, and

  • a pair of natural transformations η:1 CT (the unit of T) and μ:T 2T (the multiplication), such that

  • there exists η which is a unit for μ, i.e. μ(ηT)=1 C=μ(Tη), and

  • μ is associative, i.e. μ(Tμ)=μ(μT).

If we consider C as an object in the 2-category Cat of categories, functors and natural transformations, then we see that (C,T,μ,η) is a 4-tuple of a 0-cell, 1-cell and two 2-cells satisfying some diagrams.
Thus this makes sense in arbitrary 2-category and even a bicategory. If is a bicategory, a monad on an object C of consists of a 1-cell T:CC together with 2-cells η,μ satisfying axioms as before, but with associativity coherences taken into account (monad with underlying object C in is the same as a monoid in the monoidal category Hom (C,C)=(C,C)).

In a general 2-category

More generally, for an object C in any 2-category a monad on C is a monoid in the monoidal category End (C).

In string diagrams

These data and axioms can be expressed graphically in string diagrams. The data CTC, 1 CηT, TTμT appear as:

String diagrams of the monad data (for "Monad")

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

String diagrams of the monad data, unlabeled (for "Monad")

The axioms μ(ηT)=1 C=μ(Tη) and μ(Tμ)=μ(μT) then appear as:

String diagrams of the monad axioms, unlabeled (for "Monad")

As monoids

The name “monad” and the terms “unit”, “multiplication” and “associativity” come from a clear analogy with monoids. Indeed, one can define a monad on an object C of a bicategory as just a monoid in its endomorphism category (C,C).

Alternatively, monads can be taken as more fundamental, and a monoid in a monoidal category C can be defined as a monad in C, viewing C as a one-object bicategory.

As lax functors

Yet another definition, slick and mysterious:

A monad in is a lax functor from the terminal bicategory 1 to .

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.

Peter LeFanu Lumsdaine?: I did the diagrams with the monad called (T,η,μ) and have only just noticed that that disagrees with what’s used in the preceding description. Was there a particular principled reason for calling it (A,i,μ) above? I can change the diagrams to agree if so, but if not, might it be easier on newcomers to use (T,η,μ) throughout? Pretty much all the references I know use that as the generic name for a monad. —Peter

Mike Shulman: I like T as the name for a monad. (I also think that as a matter of exposition, this page should start out with monads in Cat and introduce the more general version later, but I don’t have time to implement that right now.)

Peter LeFanu Lumsdaine?: I’d been thinking the same; so I’ve re-organised things as you suggest, and added an “idea” section. I think that probably goes into too much detail now, especially since “generalised algebraic theory” is only one of many ideas of what a monad is, but someone else can probably cut it down more dispassionately than I can :-)

Mike Shulman: I don’t think it needs any cutting down. If anything, one could add more description of all the other things that a monad is.

Zoran Škoda: I do not like the idea section. It describes a very special case of monad theory as the principal motivation, namely of monads in the category of sets. I know lots of heavy monad users, including mine, who almost never use monads to describe algebraic theories. For Jon Beck the principal motivation is cohomology theory, for some is the descent theory, for some generalized module theory, for some equivariance, for some relativizing affiness in algebraic geometry…

Remarks

  • Monads in Cat are sometimes, mostly in older literature, also called triples (alluding to the triple of data (A,μ,i)). In even older literature, they are also referred to as standard constructions, from Beck’s discovery of them as a unifying description of the constructions of various homology theories.

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

Examples

Monads on posets are particularly simple. 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.

Every algebraic theory with a notion of free algebra defines a monad on Set. For example, the operation taking a set S to the underlying set of the free monoid on S may be extended to a monad, the list monad.

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

Algebras/modules over a monad

Given that a monad in a bicategory is nothing but a monoid in a hom-category (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) but can be in (b,a) (for left modules) or (a,c) (for right modules).

In a Cat-like bicategory, left modules over a monad are usually called 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.

Monads in higher category theory

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

in section 3 of

References

  • R. Street, The formal theory of monads, J. of Pure and Applied Algebra 2 (1972), 149–168; R. Street, S. Lack, The formal theory of monads II, J. Pure Appl. Algebra 175 (2002), No. 1-3, 243–265.

  • F. Borceux, Handbook of categorical algebra, vol. 2, Ch. 4 “Monads”

An early collection of articles is

Book (recall that monads are also called ‘triples’):