Distributive laws are a fundamental concept in monad theory. They allow us to form well-behaved composite monads, lift monads to Kleisli and Eilenberg-Moore categories, and play key roles in various computer science applications.
As with any worthwhile mathematical object, it is useful to have multiple perspectives to clarify the underlying idea. This post aims to show how we might rediscover the notion of distributive from an enriched category theory point of view.
Monads and Enrichment
For a monoidal category , we can:
- Define
-enriched categories, more concisely referred to as
-categories.
- Define
-functors between
-categories.
- If
is a symmetric monoidal category, we can define a tensor product of
-categories
and
, denoted
, generalising product categories from ordinary category theory.
We considered monads from an enriched point of view in a previous post. For our current discussion, we slightly vary the emphasis, and consider monads on a fixed category (or more generally object in a 2-category). We enrich over the endofunctor category
with functor composition as the monoidal structure.
In this setting:
- A monad
is a one object
-category, which we shall denote
. The unit and multiplication of the monad encode the identities and composition of the category, and the monad axioms ensure they behave as expected.
- A monad map is the same things as a
-functor, encoding the functor action on the hom object, with the monad map axioms enforcing preservation of identities and commuting with composition.
- The monoidal category
is clearly not symmetric. How do we get an analog of the tensor product of enriched categories?
The tensor product of categories has objects pairs of objects from the components categories, and hom objects given by the tensor product of the component homs:
In order to define the composition maps
from the composition maps in the component categories, we need the assumption is symmetric to allow us to wire things up in the right order.
Now if we consider our case of interest, monads
viewed as one-object -categories, if we could form the tensor product of these categories,
it would have a single hom object
As we have no symmetry, we need to figure out how to form a composition map
using the composition maps (monad multiplications) in the component categories. Following the standard tensor product construction, we need a natural transformation
to swap the middle two components of the domain as follows:
Not any old natural transformation will do, in order to prove the resulting composition map is unital and associative, we will need some equational axioms. In fact, what we need is a distributive law!
Summary
This post stems from a simple line of reasoning:
- Monads are special enriched categories
- There are standard ways of composing monads and composing enriched categories, are these also related?
I would be very interested to understand if there is a well-known construction on enriched categories of which the perspective on distributive laws above is a special case?