It’s common to think of monads as generalized algebraic theories; the most familiar examples, such as the monads on encoding groups, rings, and so forth, have this flavor. However, this intuition is really only appropriate for certain monads (e.g. finitary monads on , which are the same thing as Lawvere theories).
It’s also common to think of monads as generalized monoids; previously we discussed why this was a reasonable thing to do.
Today we’ll discuss a different intuition: monads are (loosely) categorifications of idempotents.
As previously, in this post compositions will be done in diagrammatic order, so if and are two morphisms, their composite will be denoted , or sometimes (which is independent of, but strongly suggests, the diagrammatic order).
This will end up switching the role of “left” and “right” in a few statements relative to the usual order of composition. For example, it will switch which adjoint goes first when constructing a monad out of an adjunction, so be careful when matching up statements in this post to statements elsewhere. But as we’ll see this convention has nice properties.
It will also force us to use the following curious-looking notation: if is a functor and is an object, we’ll denote the value of on by (thinking of as a morphism ). Read this in your head the same way you would read “c squared.”
Several different kinds of composition throughout this post will be denoted by concatenation, and it should hopefully be clear from the types of the objects involved what kind of composition is meant. For example, if is a 2-morphism and is a 1-morphism such that the compositions are defined, then denotes the vertical composition of with the identity .
Monads in a 2-category
Like the definition of adjoints, the definition of monads is purely 2-categorically equational, so makes sense in any 2-category and is preserved by any 2-functor, and we’ll introduce it at this level of generality.
In short, a monad on an object in a 2-category is a monoid in the monoidal category of endomorphisms of . More explicitly, a monad is a 1-morphism from an object to itself together with a unit 2-morphism and a multiplication 2-morphism satisfying the following compatibilities. The first compatibility (associativity) says that the two ways of using to write down a 2-morphism agree; explicitly,
The second compatibility (unit) says that
Dually, a comonad is a monad in the 1-opposite 2-category (reversing the order of composition of 1-morphisms): it still starts out as a 1-morphism but has a counit and a comultiplication .
Our favorite way of producing monads and comonads will be via adjunctions, as follows. Let be an adjunction, so is the left adjoint and is the right. Let
denote the unit of the adjunction, and let
denote the counit. (This is a place where diagrammatic order matters.)
Proposition: is a monad on , with unit the unit of the adjunction and multiplication the map
Dually, is a comonad on , with counit the counit of the adjunction and comultiplication derived from the unit.
This can be thought of as a categorification of the usual method of producing an idempotent from a section-retraction pair, namely a pair of morphisms and such that . (This is another place where diagrammatic order matters. is the retraction and is the section.) This condition means that satisfies , which categorifies to the above.
Example. Let be the one-object 2-category corresponding to a monoidal category . Then a monad in is just a monoid in , and a comonad in is a comonoid in . (Working backwards, if monads and comonads in a 2-category categorify idempotent morphisms in a category, then monoids and comonoids in a monoidal category categorify idempotent elements of a monoid.)
An adjoint pair in is a dual pair of objects of (here indicates the right dual of ). So the construction above specializes to the observation that the tensor product has a natural monoid structure, which should be familiar from the case of vector spaces, where it is a matrix algebra. (What might be less familiar is the dual statement that has a natural comonoid structure.)
More generally, if is a closed symmetric monoidal category with internal hom , then
so by the Yoneda lemma we conclude that for a dualizable object , the tensor product is canonically isomorphic to the internal endomorphism object (and a little more work shows that this is even an isomorphism of monoid objects).
In general, we get that is a monoid in which naturally acts on from the left, and on from the right. Furthermore,
where denotes the monoidal unit, so the “points” of (the result of applying ) are endomorphisms of .
Example. Let be the 2-category of posets. Then a monad in is a closure operator on a poset .
Explicitly, must first of all be a morphism of posets, so implies . Next, the unit becomes the condition , and finally, multiplication becomes the condition . Since implies , we have . (So all monads on posets are genuinely idempotents.)
The construction of monads from adjunctions specializes here to the construction of closure operators from adjunctions between posets, also known as Galois connections. This reproduces various familiar closure operators in mathematics, such as Zariski closure.
Example. Let be the Morita 2-category of algebras, bimodules, and bimodule homomorphisms over a commutative ring . Then a monad in is an algebra object in -bimodules over , where is some -algebra; we’ll call this an -algebra for short, although note that even if is commutative it doesn’t reduce to the usual notion of algebra over a commutative ring.
An adjoint pair in is, as we saw previously, a pair consisting of an -bimodule which is f.g. projective as a right -module (the left adjoint) and its -linear dual regarded as a -bimodule (the right adjoint). The notation is meant to again evoke the special case of vector spaces, which we recover when is a field. The corresponding monad is the -algebra , which can be thought of as the algebra of -linear endomorphisms of (acting on the left) or of (acting on the right).
Left and right modules
Just like monoids, monads have modules over them. A right module over a monad is an object , a 1-morphism , and an action 2-morphism
satisfying the associativity condition
and the unit condition
Dually, a left module is an object , a 1-morphism , and an action 2-morphism satisfying the obvious duals of the above conditions.
Our favorite way of producing modules is again via adjunctions. If is an adjunction giving rise to , then the left adjoint is naturally a left module over , and dually the right adjoint is naturally a right module over . (If we had stuck to compositions in the usual rather than diagrammatic order this would be reversed.) In fact the two together form a kind of bimodule over .
Classically, in , what is usually called a module or algebra for a monad is an object together with an action map satisfying the same axioms as above. This is a special kind of right module where is the terminal category. More generally, in a right module can be interpreted as a family of -algebras parameterized by . It’s less clear what a left module is.
Thinking of monads as idempotents , right modules categorify morphisms such that , or equivalently that equalize and , and dually left modules categorify morphisms such that , or equivalently that coequalize and . These are used to state the universal property of the equalizer and coequalizer of and respectively, which can be thought of as the object of invariants (fixed points) or the object of coinvariants (orbits), respectively, under the action of , and (because is an idempotent) which are canonically isomorphic.
This categorifies as follows. The categorification of invariants is the Eilenberg-Moore object of a monad . This is, if it exists, the universal right module over : that is, it is equipped with a 1-morphism and an action 2-morphism making it a right module, and any other right module uniquely factors through it. Said another way, right module structures on an object are equivalent to 1-morphisms .
Dually, the categorification of coinvariants is the Kleisli object . This is, if it exists, the universal left module over : that is, it is equipped with a 1-morphism and an action 2-map making it a left module, and any other left module uniquely factors through it. Said another way, left module structures on an object are equivalent to 1-morphisms .
Example. In , the Eilenberg-Moore category of a monad on a category turns out to be the category of -algebras (categorifying how the invariants of an idempotent endomorphism of a set is the set of its fixed points). The right module structure on has 1-morphism the forgetful functor given by forgetting the -algebra structure and action 2-morphism the natural transformation whose components are given by the action maps
of the -algebras .
The universal property of says that a right module structure on a category is a functor , or in other words a family of -algebras parameterized by , which at least makes sense at the level of objects.
The Kleisli category turns out to have the same objects as , but where a morphism from to is a Kleisli morphism, namely a morphism . Composition is as follows: if and are two Kleisli morphisms, then their composite is
The left module structure on has 1-morphism the functor which is the identity on objects and which sends an ordinary morphism to the Kleisli morphism
Its action 2-morphism is the natural transformation whose components are the identity , regarded as a Kleisli morphism from to .
The universal property of says that a left module structure on a category is a functor . It’s less clear to me what this means.
Adjunctions from monads
A splitting of an idempotent is a pair of morphisms (a section-retraction pair) such that and ; we say that splits (or, in the terminology we used earlier, is a split idempotent) if it admits a splitting. Under very mild hypotheses (e.g. the existence of either equalizers or coequalizers), every idempotent admits a unique (up to unique isomorphism) splitting, where is simultaneously both the object of invariants and the object of coinvariants of . To exhibit this isomorphism we start by writing down a map from coinvariants to invariants (when they both exist), and this map exists because an idempotent both equalizes and coequalizes itself.
This categorifies as follows. (All of the terminology I’m about to introduce is nonstandard.) A splitting of a monad is a pair of adjoint 1-morphisms together with an isomorphism of monads; we say that splits (or is a split monad) if it admits a splitting.
Example. As above, let be the one-object 2-category corresponding to a monoidal category . A monad in is a monoid in , and a monoid splits iff there is a right dualizable object such that as monoids.
Specializing to the case that is the symmetric monoidal category of modules over a commutative ring , a monad in is a -algebra , and an algebra splits iff there is a f.g. projective -module such that as -algebras, or equivalently iff
Such a need not either exist or be unique. Lack of existence is clear; for example, when is a field the above condition says that is a matrix algebra, and there are plenty of non-matrix algebras. To see lack of uniqueness we can observe that if then we can take to be any invertible -module, so need not be unique if the Picard group is nontrivial.
(There’s something interesting to say here even when is a field. It’s possible for a -algebra not to split over but to split over a finite extension of ; such algebras correspond to nontrivial classes in the Brauer group . Incidentally, in this area there’s an existing definition of “split,” and it’s a happy accident as far as I can tell that the two uses coincide in this special case.)
We’ve learned that in general, splittings of monads neither exist nor are unique. However, it’s true that the Eilenberg-Moore object and Kleisli object (when they exist) both give rise to splittings, as follows. In particular, all monads in split (so arise from adjunctions).
A monad is naturally both a left and a right module over itself. Because is a right module over itself, admits a factorization
through the universal right module . The pair of 1-morphisms are in fact adjoint: the unit of the adjunction comes from the unit of , while the counit comes from the action 2-morphism , as follows. Part of the definition of a right module implies that the action 2-morphism is in fact a morphism of right -modules, and so by the universal property of the Eilenberg-Moore object it factors through , giving a 2-morphism which is our counit.
The verification of the zigzag identities isn’t hard but is annoying without good notation, so we’ll omit it. One of them follows from the unit condition for the right -module structure on , and the other one follows from the unit condition for the monad structure on , together with the same factoring-through- argument as above.
Hence whenever the Eilenberg-Moore object exists, it exhibits a splitting of . Dually (by reversing 1-morphisms), whenever the Kleisli object exists, it also exhibits a splitting of . (Hence Eilenberg-Moore and Kleisli objects can’t always exist in 2-categories with monads that aren’t split.)
But we can say more than this. The left adjoint now admits a natural left -module structure (since it’s the left adjoint of an adjunction that splits ), so by the universal property of the Kleisli object (if it exists), we get a further factorization
of . If our situation were exactly analogous to the case of idempotents, the middle morphism would be an equivalence. This isn’t true, but it’s very close, and it’s true if in addition is an idempotent monad (meaning that the multiplication 2-morphism is an isomorphism). In these arise from reflective subcategories, for example the adjunction between and .
Example. In the case of , let be a monad on a category . Then, as we saw above, the Eilenberg-Moore category is the category of -algebras, so objects equipped with action maps satisfying unit and associativity conditions. There’s an obvious forgetful functor given by forgetting the action map, and its left adjoint acts on objects as
This exhibits as the free -algebra on (categorifying how, if is an idempotent endomorphism of a set, then for every , the element is a fixed point of ). The -algebra structure on comes from the right -module structure on itself; explicitly, the action map is
and unit and associativity for it reduce to unit and associativity for . The claim that is the free -algebra says concretely that if is an -algebra (with action map ), then we have a natural bijection
This bijection is, explicitly, the following. The natural map from the LHS to the RHS sends an -algebra morphism to the composite
The natural map from the RHS to the LHS sends a morphism to the composite
The verification that these two maps are inverses to each other is purely equational. In one direction (starting from an -algebra morphism ), we need the identity
which we can prove as follows. being an -algebra morphism means, by definition, that
The identity we need then becomes
which follows from the unit condition on .
In the other direction (starting from a morphism ), we need the identity
The naturality of means precisely that
so the identity we need becomes
which follows from the unit condition on the -algebra structure on .
According to our abstract argument above, the left adjoint of the forgetful functor from the Eilenberg-Moore category should naturally factor through the Kleisli category . This factorization can be described as follows. There is a natural functor
sending an object to the free -algebra , and sending a Kleisli morphism to the composite
The free -algebra functor factors through this functor in the obvious way. In fact more is true: because we know that is the free -algebra on , we have
from which it follows that in fact the functor from the Kleisli category to the Eilenberg-Moore category is fully faithful: it exhibits the Kleisli category as the full subcategory of free -algebras among all -algebras.
Subexample. If is a poset, so that is a closure operator, then both the Eilenberg-Moore and Kleisli posets can be identified with the poset of -closed elements of (those elements such that ), and the natural map is an equivalence. This reflects the fact that closure operators are idempotent, so every closed element is a “free” closed element .