Distributive Laws and Tensor Products of Enriched Categories

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 (\mathcal{V}, \otimes, I), we can:

  1. Define \mathcal{V}-enriched categories, more concisely referred to as \mathcal{V}-categories.
  2. Define \mathcal{V}-functors between \mathcal{V}-categories.
  3. If \mathcal{V} is a symmetric monoidal category, we can define a tensor product of \mathcal{V}-categories \mathcal{C} and \mathcal{D}, denoted \mathcal{C} \otimes \mathcal{D}, 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 \mathcal{C} (or more generally object in a 2-category). We enrich over the endofunctor category [\mathcal{C},\mathcal{C}] with functor composition as the monoidal structure.

In this setting:

  1. A monad (\mathbb{T} : \mathcal{C} \rightarrow \mathcal{C}, \eta, \mu) is a one object [\mathcal{C}, \mathcal{C}]-category, which we shall denote \mathbb{T}. The unit and multiplication of the monad encode the identities and composition of the category, and the monad axioms ensure they behave as expected.
  2. A monad map is the same things as a [\mathcal{C}, \mathcal{C}]-functor, encoding the functor action on the hom object, with the monad map axioms enforcing preservation of identities and commuting with composition.
  3. The monoidal category ([\mathcal{C}, \mathcal{C}], \otimes, \mathsf{Id}) is clearly not symmetric. How do we get an analog of the tensor product of enriched categories?

The tensor product of \mathcal{V} categories has objects pairs of objects from the components categories, and hom objects given by the tensor product of the component homs:

(𝒞𝒟)((c1,d1),(c2,d2))=𝒞(c1,c2)𝒟(d1,d2)(\mathcal{C} \otimes \mathcal{D})((c_1, d_1), (c_2, d_2)) = \mathcal{C}(c_1,c_2) \otimes \mathcal{D}(d_1,d_2)

In order to define the composition maps

(𝒞𝒟)((c2,d2),(c3,d3))(𝒞𝒟)((c1,d1),(c2,d2))(𝒞𝒟)((c1,d1),(c3,d3))(\mathcal{C} \otimes \mathcal{D})((c_2,d_2),(c_3, d_3)) \otimes (\mathcal{C} \otimes \mathcal{D})((c_1,d_1),(c_2,d_2)) \rightarrow (\mathcal{C} \otimes \mathcal{D})((c_1,d_1),(c_3,d_3))

from the composition maps in the component categories, we need the assumption \mathcal{V} is symmetric to allow us to wire things up in the right order.

Now if we consider our case of interest, monads

(𝕊,η,μ)and(𝕋,η,μ)(\mathbb{S}, \eta, \mu) \quad\text{and}\quad(\mathbb{T},\eta,\mu)

viewed as one-object [\mathcal{C}, \mathcal{C}]-categories, if we could form the tensor product of these categories,

𝕋𝕊\mathbb{T} \otimes \mathbb{S}

it would have a single hom object

𝕋𝕊\mathbb{T} \circ \mathbb{S}

As we have no symmetry, we need to figure out how to form a composition map

𝕋𝕊𝕋𝕊𝕋𝕊\mathbb{T} \circ \mathbb{S} \circ \mathbb{T} \circ \mathbb{S} \Rightarrow \mathbb{T} \circ \mathbb{S}

using the composition maps (monad multiplications) in the component categories. Following the standard tensor product construction, we need a natural transformation

λ:𝕊𝕋𝕋𝕊\lambda : \mathbb{S} \circ \mathbb{T} \Rightarrow \mathbb{T} \circ \mathbb{S}

to swap the middle two components of the domain as follows:

𝕋𝕊𝕋𝕊𝕋λ𝕊𝕋𝕋𝕊𝕊\mathbb{T} \circ \mathbb{S} \circ \mathbb{T} \circ \mathbb{S} \xRightarrow{\mathbb{T} \circ \lambda \circ \mathbb{S}} \mathbb{T} \circ \mathbb{T} \circ \mathbb{S} \circ \mathbb{S}

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?

Bicategories, monoids, internal and enriched categories

Last time, we introduced a more general definition of monads, in the setting of (strict) 2-categories. Unfortunately this strictness is often a bit too rigid to incorporate natural mathematical objects, and this is certainly true for monad theory. This time, we will push our definition of monads beyond this strict setting, into the wider world of bicategories.

Generalising to Bicategories

A bicategory \mathbf{C} consists of:

  1. A collection of 0-cells A,B,\ldots
  2. Between every pair of 0-cells A,B, a category \mathbf{C}(A,B). The objects of these categories are termed 1-cells, and the morphisms 2-cells. Composition of 2-cells is called vertical composition.
  3. For every triple of 0-cells, A,B,C a bifunctor \circ : \mathbf{C}(B,C) \times \mathbf{C}(A,B) \rightarrow \mathbf{C}(A,B), referred to as horizontal composition. For every 0-cell A, there are identity 1-cells \mathsf{Id}_A in \mathbf{C}(A,A).

Horizontal composition is associative and unital up to isomorphism. That is, there are natural isomorphisms:

  1. A left unitor \lambda : \mathsf{Id} \circ (-) \Rightarrow (-).
  2. A right unitor \rho : (-) \circ \mathsf{Id} \Rightarrow (-).
  3. An associator \alpha : (-) \circ ((-) \circ (-)) \Rightarrow ((-) \circ (-)) \circ (-), between the two different orders in which we can apply horizontal composition twice.

As you might expect, this structure is subject to some coherence equations, entirely analogous to those for a monoidal category.

Example: A (strict) 2-category is a bicategory in which the unitors and associators are identities, so horizontal composition is unital and associative on the nose.

Example: A monoidal category is “the same thing” as a bicategory with one 0-cell. This is often phrased as “A monoidal category is a one object bicategory”.

Considering one direction in more detail, in a bicategory \mathbf{C} with one 1-cell A consists of a single category \mathbf{C}(A,A). We also have:

  1. A horizontal composition bifunctor \mathbf{C}(A,A) \times \mathbf{C}(A,A) \rightarrow \mathbf{C}(A,A). We consider this to be the tensor product of our monoidal category.
  2. The identity 1-cell \mathsf{Id}_A will serve as the monoidal unit.

The coherence axioms for a bicategory is this simple case are exactly those of a monoidal category. Going in the other direction is similar.

We also introduce a couple of more complex bicategories that will be important in subsequent examples.

Example: A span of type X \rightarrow Y in a category \mathcal{C} is a pair of \mathcal{C}-morphisms of the form:

X \xleftarrow{f} A \xrightarrow{g} Y.

If \mathcal{C} has pullbacks, we can form the composite of a span X \xleftarrow{f} A \xrightarrow{g} Y with a span Y \xleftarrow{h} B \xrightarrow{k} Z as:

X \xleftarrow{f \circ \pi_1} A \times_{Y} B \xrightarrow{g \circ \pi_2} Z

where \pi_1, \pi_2 are the two projection maps given by forming the pullback of g along h.

Given two spans X \xleftarrow{f_1} A_1 \xrightarrow{g_1} Y and X \xleftarrow{f_2} A_2 \xrightarrow{g_2} Y a morphism of spans between them is a \mathcal{C}-morphism h : A_1 \rightarrow A_2 such that:

f_2 \circ h = f_1 \quad\text{and}\quad g_2 \circ h = g_1

In fact, for a category \mathcal{C} with pullbacks, there is a bicategory \mathbf{Span}(\mathcal{C}) with:

  1. 0-cells the objects of \mathcal{C}.
  2. \mathbf{Span}(\mathcal{C})(X,Y) consists of all spans of type X \rightarrow Y, and span morphisms between them.
  3. The universal property of pullbacks means composition of spans extends to a bifunctor, which we take to be our horizontal composition.

We are skimming over a size issue here. Readers with the necessary background may want to consider how such questions might creep in to the definition above.

Example: Let \mathcal{V} be a monoidal category with coproducts. For sets A,B, we can consider \mathcal{V}-valued matrices of type A \rightarrow B to be functions:

M : A \times B \rightarrow \mathsf{obj}(\mathcal{V})

Given a pair of matrices M : A \rightarrow B and N : B \rightarrow C, we can form their composite as follows:

(N \circ M)(a,c) = \coprod_{b \in B} M(a,b) \otimes N(b,c)

Given a pair of matrices M_1, M_2 : A \rightarrow B, a morphism of matrices is a family of \mathcal{V} morphisms:

f_{a,b} : M_1(a,b) \rightarrow M_2(a,b)

This data can be combined into a bicategory \mathbf{Mat}(\mathcal{V}) with:

  1. 0-cells sets.
  2. The category \mathbf{Mat}(\mathcal{V})(A,B) consists of matrices of type A \rightarrow B and morphisms between then.
  3. Horizontal composition is given by composition of matrices, as described above.

The two previous examples are typical for bicategories, in that horizontal composition involves either limits or colimits. In such cases, if we form iterated horizontal composites in different orders, the universal properties involved will ensure they agree up to isomorphism. Insisting that composites formed in different orders agree on the nose would lead to unrealistic requirements on our choice of (co)limits, so the bicategorical rather than strict 2-categorical setting is more natural.

Now we’ve seen a few different bicategories, it’s time to get back to our main motivation, monads. A monad in a bicategory \mathbf{C} consists of:

  1. A 0-cell \mathcal{C}.
  2. A 1-cell \mathbb{T} : \mathcal{C} \rightarrow \mathcal{C}.
  3. A unit 2-cell \eta: \mathsf{Id}_{\mathcal{C}} \Rightarrow \mathbb{T}.
  4. A multiplication 2-cell \mu: \mathbb{T} \circ \mathbb{T} \Rightarrow \mathbb{T}.

As before, our notation is suggestive of that for “ordinary” monads on categories. Notice the data above is no different to that which we encountered in the strict 2-categorical setting. Things get more interesting when we consider the coherence equations that need to hold, as now we must account for the fact that horizontal composition is not unital or associative on the nose, but only up to isomorphism. The required equations are:

  1. \mu \cdot (\eta \circ \mathsf{id}_{\mathbb{T}}) = \lambda.
  2. \mu \cdot (\mathsf{id}_{\mathbb{T}} \circ \eta) = \rho.
  3. \mu \cdot (\mu \circ \mathsf{id}_{\mathbb{T}}) = \mu \cdot (\mathsf{id}_{\mathbb{T}} \circ \mu) \cdot \alpha.

Firstly, we see that this really does generalise our previous definition.

Example: As we would expect, a monad in a 2-category is a special case of a monad in a bicategory. The unitors and associators are identities, and the equations above collapse to those of the 2-categorical case.

We also find a fun simple source of monads that would not have made sense before:

Example: We can view any monoidal category \mathcal{V} as a one object bicategory. A monoid in \mathcal{V} is the same thing as a monad in this one object bicategory. For example, every group or monoid can be seen as a monad. There is a certain symmetry here:

  1. In a bicategory \mathbf{C}, every monad on \mathcal{A} is a monoid in the monoidal category \mathbf{C}(\mathcal{A},\mathcal{A}).
  2. A monoid in a monoidal category is a monad in the corresponding one object bicategory.

We now move on to some more interesting examples, which really highlight the benefits afforded by the more liberal bicategorical definition.

Example: A (small) category consists of a set of objects O and a set of morphisms M. There are two functions giving the source and target of a given morphism, forming a span:

O \xleftarrow{s} M \xrightarrow{t} O

The identities induce a morphism from the identity span to this span. If we form the pullback of s along t, the object M \times_O M consists of all composable pairs of morphisms, and there is a span morphism from the resulting span to the one defined above, given by the function maps composable pairs to their composite.

Given a category \mathcal{C} with pullbacks, we can define an internal category in \mathcal{C} to consists of the analogous structure. A (small) category is then an internal category in \mathsf{Set}.

The key observation for our purposes is that an internal category in \mathcal{C} is the same thing as a monad in \mathbf{Span}(\mathcal{C}). The monad unit and multiplication correspond to the identities and composition respectively. The rest is “just” an exercise in unravelling definitions.

Example: For a monoidal category \mathcal{V} with coproducts, a \mathcal{V}-enriched category \mathcal{A} consists of:

  1. A set of objects O.
  2. For each pair of objects o_1, o_2 a hom-object in \mathcal{V}. We can view this as a \mathcal{V}-valued matrix A : O \rightarrow O.
  3. Morphisms j_o : \mathcal{I} \rightarrow A(o,o) picking out the identities. These form a morphism of matrices from the identity matrix to A.
  4. Composition morphisms m_{o_1, o_2, o_3} : A(o_2,o_3) \otimes A(o_1,o_2) \rightarrow A(o_1, o_3), which via the universal property of coproducts induce a morphism \coprod_{o_2 \in O} A(o_1, o_2) \otimes A(o_2, o_3) \rightarrow A(o_1,o_3). Together, these form a morphism of matrices of type A \circ A \rightarrow A.

A more careful unpacking of the definitions following these intuitions shows that a \mathcal{V}-category is the same thing as a monad in \mathbf{Mat}(\mathcal{V}).

As a special case of this construction, the Booleans can be considered as a thin two object monoidal category \mathcal{B}. The category \mathbf{Mat}(\mathcal{B}) is equivalent to the bicategory of relations \mathbf{Rel} we encountered last time. The Boolean enriched categories are then exactly preorders.

Conclusion

By considering a further generalisation of the notion of monad to the weak setting of bicategories, many new interesting examples become possible. The examples of internal and enriched categories are well-known, and provide the intuitions for other, more elaborate constructions.

A categorically minded reader should be asking themselves the following question. We have identified internal and enriched categories as monads in certain bicategories, what about the morphisms between them? Do internal and enriched functors correspond to an obvious notion of morphism between these monads? The answer to this question is a bit more subtle than one might hope. We may return to this point in a later post.

More background on bicategories, and the monads corresponding to internal and enriched categories can be found in Lack’s “A 2-Categories Companion”, which is highly recommended reading.

Strong Monads

Strong monads, the topic of this post, are a somewhat technical looking topic at first glance, requiring more definitions and machinery than we have seen up until now. Unfortunately, they are key to some more interesting topics, both mathematically and in terms of computer science application. As usual when dealing with new abstract ideas, it is useful to focus on intuitions and examples to get a feeling for the formal definitions. This post is longer than might be ideal, but there are plenty of examples.

For those interested in the technical details I skip, some recommended reading:

  • Monoidal categories: “Categories for the Working Mathematician” by Mac Lane has a very readable account of monoidal categories, despite its reputation for requiring a lot of mathematical background.
  • Enriched categories: Both volume 2 of Borceux’s “Handbook of Categorical Algebra”, and Riehl’s “Categorical Homotopy Theory” have brief introductions to monoidal categories, to set up a concise introduction to enriched category theory. The standard reference for enriched category theory is Kelly’s “Basic Concepts of Enriched Category Theory”, which also contains the necessary background on monoidal categories. This book can be difficult in places, but the material we require is covered at a reasonable pace.

Monoidal Categories

A monoidal category is a category \mathcal{V} with a monoidal product bifunctor, typically denoted \otimes, and a unit object, I. Intuitively, this is a generalization of the notion of monoid from sets to categories. There are isomorphisms

\lambda : I \otimes A \rightarrow A \qquad \rho : A \otimes I \rightarrow A,

natural in A, and referred to as the left and right unitor respectively. These encode that I acts as a unit for the multiplication, up to isomorphism. There are also associator isomorphisms:

\alpha : (A \otimes B) \otimes C \rightarrow A \otimes (B \otimes C),

natural in A, B, C, encoding associativity up to isomorphism. The unitors and associator are required to satisfy some compatibility equations (referred to as coherence conditions). We won’t need the details, but they can be found in any standard category theory reference.

A symmetric monoidal category is a monoidal category with a further symmetry isomorphisms encoding commutativity up to isomorphism:

\sigma : A \otimes B \rightarrow B \otimes A

natural in A,B. Again, the symmetry is required to satisfy some coherence conditions (equations) with respect to the other structure. Finally, a (symmetric) monoidal closed category is a (symmetric) monoidal category such that for each object A, there is an adjunction:

(-) \otimes A \dashv A \multimap (-)

Example: Any category \mathcal{C} with products is a symmetric monoidal category, with

A \otimes B = A \times B \qquad I = 1

The left and right unitors, associator and symmetry are the “obvious” canonical maps induced by the universal property of products. If \mathcal{C} is Cartesian closed, then it is symmetric monoidal closed, with A \multimap (-) given by the exponential A \Rightarrow (-).

In particular, the category \mathsf{Set} is symmetric monoidal closed with monoidal product given by Cartesian products, and A \multimap (-) given by the function space functor A \Rightarrow (-). This is the motivating example for much of what follows, and of practical interest in algebraic examples we shall see later. When working with \mathsf{Set}, if not otherwise stated the monoidal structure is taken to be the Cartesian product structure.

Strength

For a monoidal category \mathcal{V}, and endofunctor T: \mathcal{V} \rightarrow \mathcal{V}, a strength (sometimes referred to as a tensorial strength) for T is a natural transformation

\mathsf{st}_{A,B} : A \otimes T(B) \rightarrow T(A \otimes B)

which satisfies two coherence conditions with respect to the monoidal structure. A strong functor is a functor with a chosen strength. A strong monad is monad \mathbb{T} with a strong underlying endofunctor, satisfying additional coherence conditions with respect to the monad unit and multiplication. Again, the actual coherence conditions can be found in standard sources, we shall focus on examples and intuitions.

Example: The list and powerset monads are both strong in a unique way, with strengths:

(a, [b_1,\ldots,b_n]) \mapsto [(a,b_1),\ldots,(a,b_n)]

(a, \{ b_1,\ldots, b_n \}) \mapsto \{ (a,b_1), \ldots, (a,b_n) \}

We shall shortly see that form (and uniqueness) of the strengths for the \mathsf{Set} monads in the previous example are in no way special.

So a crude first sketch of a strength is that it is a well-behaved way of commuting an endofunctor and a monoidal product. You may notice that there are other ways you might imagine commuting an endofunctor with a monoidal product. We shall return to that thought in later posts.

To get a more principled mathematical perspective on strength, unfortunately we need to introduce further abstract machinery.

Enriched Categories

Enriched category theory is a large and potentially complex topic. Fortunately we will only need a few of the basic definitions, and no deep theory. The idea of an enriched category is that often for a category \mathcal{C}, the homsets \mathcal{C}(A,B) carry additional mathematical structure, and this structure interacts well with composition. For example:

Example: The homsets in the category \mathsf{Pre} of preorders and monotone maps actually carry a natural pointwise order:

f \leq g \Leftrightarrow \forall a. f(a) \leq g(a).

This structure satisfies:

f_1 \leq f_2 \;\wedge\; g_1 \leq g_2 \quad\Rightarrow\quad g_1 \circ f_1 \leq g_2 \leq f_2

when the composites are well-defined. So the homsets are actually \mathsf{Pre}-objects, and the composition maps are \mathsf{Pre}-morphisms

\mathsf{Pre}(B,C) \times \mathsf{Pre}(A,B) \rightarrow \mathsf{Pre}(A,B)

A close relative of the previous example is the following:

Example: The homsets of the category of all (small) categories \mathsf{Cat} are themselves categories, with morphisms the natural transformations. Furthermore, the composition maps are bifunctors

\mathsf{Set}(B,C) \times \mathsf{Set}(A,B) \rightarrow \mathsf{Set}(A,C)

An important trivial example is the following:

Example: The homsets of the category \mathsf{Set} are \mathsf{Set}-objects, and the composition maps are \mathsf{Set}-morphisms

\mathsf{Set}(B,C) \times \mathsf{(Set}(A,B) \rightarrow \mathsf{Set}(A,B)

Finally, a slightly different example, which motivates the level of generalization of the formal definition.

Example: The homsets of the category of Abelian groups \mathsf{Ab} can be given the structure of Abelian groups pointwise. With this structure, the composition maps satisfy:

(g_1 + g_2) \circ f = (g_1 \circ f) + (g_2 \circ f) \qquad 0 \circ f = 0

and the dual conditions for precomposition. This is not the same as saying the composition maps are \mathsf{Ab} morphisms:

\mathsf{Ab}(B,C) \times \mathsf{Ab}(A,B) \rightarrow \mathbb{Ab}(A,C)

This temporarily breaks the pattern with the previous examples. However, there is a monoidal structure on \mathsf{Ab} such that the composition maps are \mathsf{Ab}-morphisms

\mathsf{Ab}(B,C) \otimes \mathsf{Ab}(A,B) \rightarrow \mathsf{Ab}(A,C)

In fact this monoidal structure arises via some rather beautiful monad theory, which we will hopefully get to in later posts.

The final example motivates defining enriched categories so that the hom objects can live in monoidal categories.

For a monoidal category \mathcal{V}, a \mathcal{V}-enriched category \mathcal{C} has:

  • A collection of objects A,B,\ldots
  • For each pair of objects A,B, a hom object \mathcal{C}(A,B) in \mathcal{V}.
  • For each object A, a morphism j_A : I \rightarrow \mathcal{C}(A,A). Intuitively, these encode the the identities in the category.
  • For each triple of objects A,B,C, a morphism m_{A,B,C} : \mathcal{C}(B,C)\otimes \mathcal{C}(A,B) \rightarrow \mathcal{C}(A,C). These encode composition of morphisms with the enriched category.

This data must satisfy some axioms, ensuring that composition is associative and has units the identities. In fact, some mathematical structures that are far away from our motivating examples are also enriched categories. The original surprising example was that a mild generalization of metric spaces can be seen as enriched categories, as shown by Lawvere.

Example: For any monoidal closed category \mathcal{V}, we can regard \mathcal{V} as a \mathcal{V}-category, with hom objects

\mathcal{V}(A,B) = A \multimap B

The identity and composition maps are derived in a reasonably routine way, and can be found in standard sources. This is usually described as \mathcal{V} being canonically enriched over itself.

To connect the worlds of ordinary and enriched categories, note that any \mathcal{V}-category \mathcal{C}, has an underlying ordinary category \mathcal{C}_0, with the same objects, and homsets:

\mathcal{C}_0(A,B) = \mathcal{V}(I, \mathcal{C}(A,B))

Composition and identities in \mathcal{V}_0 are defined in a natural way. Strictly speaking, to give an enrichment for an ordinary category \mathcal{C} is to give a \mathcal{V}-category \mathcal{C}', and a specified isomorphism \mathcal{C} \cong \mathcal{C}'_0. Generally, this isomorphism is ignored when there is a natural choice.

Once we’ve defined a new class of objects, we should consider the morphisms between them. A \mathcal{V}-functor F : \mathcal{C} \rightarrow \mathcal{D} consists of:

  • A mapping F from \mathcal{C}-objects to \mathcal{D}-objects.
  • For each pair of \mathcal{C}-objects, a \mathcal{V}-morphism \varphi_{A,B} : \mathcal{C}(A,B) \rightarrow \mathcal{D}(F(A),F(B)). Intuitively, these describe the action on morphisms of the functor.

The morphism \varphi_{A,B} are required to satisfy axioms generalizing the usual idea that identities and composition are preserved.

Example: For the constructions we have seen previous:

  • A \mathsf{Pre}-enriched functor is a functor which is monotone, in that f \leq g \;\Rightarrow\; F(f) \leq F(g).
  • A \mathsf{Cat}-enriched functor is a (strict) 2-functor.
  • A \mathsf{Set}-functor is an ordinary functor.
  • A \mathsf{Ab}-functor is a functor such that F(0) = 0 and F(f + g) = F(f) + F(g).

Again, it is helpful to connect back to the world of ordinary category theory. A \mathcal{V}-functor F : \mathcal{V} \rightarrow \mathcal{D} induces an ordinary functor F_0 : \mathcal{C}_0 \rightarrow \mathcal{D}_0 that agrees with F on objects. Morphisms f : A \rightarrow B in \mathcal{C}_0 are \mathcal{V}-morphisms \hat{f} : I \rightarrow \mathcal{C}(A,B). Then F_0(f) is given by:

I \xrightarrow{\hat{f}} \mathcal{C}(A,B) \xrightarrow{\varphi_{A,B}} \mathcal{D}(F(A),F(B)).

A \mathcal{V}-functor F : \mathcal{C} \rightarrow \mathcal{D} is said to an enrichment of ordinary functor F'  : \mathcal{C}_0 \rightarrow \mathcal{D}_0 if F' = F_0.

Finally, a \mathcal{V}-natural transformation \alpha : F \Rightarrow G is a family of \mathcal{V}-morphisms \alpha_A : I \rightarrow \mathcal{D}(F(A),G(A)) satisfying an axiom generalizing the usual notion of naturality to the enriched setting.

Strength and Enrichment

Finally, we are in a position to relate strength and enrichment. If \mathcal{V} is a monoidal closed category, and T : \mathcal{V} \rightarrow \mathcal{V} an ordinary endofunctor, giving a strength for T is “the same thing as” giving a structure for T as a \mathcal{V}-functor.

Lets unpack this a bit. As described above, we view \mathcal{V} as being canonically enriched over itself. Giving an enriched structure, sometimes referred to as a functorial strength, for T is to give a natural family of morphisms:

\varphi_{A,B} : A \multimap B \rightarrow T(A) \multimap T(B)

compatible with the identity and composition maps. That these maps are natural in the sense of ordinary category is equivalent to being an enrichment of the ordinary functor T is an important point that is often skimmed over.

To build such a family given a strength

\mathsf{st}_{A,B} : A \otimes T(B) \rightarrow T(A \otimes B)

we form the composite:

A \multimap B \otimes T(A) \xrightarrow{\mathsf{st}_{A \multimap B, A}} T(A \multimap B \otimes A) \xrightarrow{T(\epsilon)} T(B)

where \epsilon is the counit of the adjunction, which can be seen as an evaluation morphism for function spaces. Taking the transpose of this morphism gives a map:

A \multimap B \rightarrow T(A) \multimap T(B)

It takes some checking, but these form the components of an enrichment for T as required. In the other direction, given an enrichment, we can form the composite:

A \xrightarrow{\eta} B \multimap (A \otimes B) \xrightarrow{\varphi_{B, A \otimes B}} T(B) \multimap T(A \otimes B)

where \eta is the unit of the adjunction. Taking the transpose of this morphism gives a map:

A \otimes T(B) \rightarrow T(A \otimes B)

Again, after a bit of checking, it can be seen that this results in a strength for T. The passages in the two directions are mutually inverse, so for monoidal closed category \mathcal{V} to give a strength for T is equivalent to giving an enrichment for T. This dealt with the endofunctor component, but we are really interested in monads. Here, to give a strength for a monad \mathbb{T} on monoidal closed \mathcal{V} is equivalent to giving an enrichment for \mathbb{T}.

Example: As a special case of this result, as every \mathsf{Set} monad is (trivially) enriched over \mathsf{Set} in a unique way. Therefore, given the observations above, every \mathsf{Set} monad has a unique strength. This has a concrete description as:

\mathsf{st}_{A,B}(a,t) = \mathbb{T}(\lambda b. (a,b))(t)

This formula can seem slightly magical if given without context, but it is arrived at by unravelling the strength derived from the unique enrichment. Here we use \lambda notion to define a simple function. The strengths given for the list and powerset monads in the earlier example arise via this construction.

As usual, it is useful to think about algebra examples. For a monad \mathbb{T} given by some equational presentation (\Sigma,E), the unique strength is given on representatives by:

\mathsf{st}_{A,B}(a, [t]) = [t[(a,b) / b \mid b \in \mathsf{var}(t)]]

where \mathsf{var}(t) is the set of variables appearing in the representative term t. As usual, square brackets are somewhat overloaded, denoting both equivalence classes and the substitution operation. In words – we replace each variable b appearing in the representative term t with the variable (a,b).