A commutative monad is a monoid in the category of lax symmetric monoidal endofunctors

We have seen the standard result that monad on a category \mathcal{C} is a monoid in the endofunctor category

([𝒞,𝒞],,𝖨𝖽)([\mathcal{C},\mathcal{C}],\otimes, \mathsf{Id})

We also discussed a similar result that a strong monad is a monoid in the category of strong endofunctors. That result allowed us to very directly read off what a distributive law of strong monads should be. The aim of this post is to continue this pattern for commutative monads, with the aim of recovering the definition of distributive law of commutative monads. This will turn out to take a bit more effort.

What we are not going to do

The first thing we should note is that we are not heading towards a result of the form:

A commutative monad is a commutative monoid in…

Unfortunately the term commutative monad hints at the wrong intuition in this regard.

Commutative Monads are Monoidal Monads

Now we have avoided a potential banana skin, onto the main story.

For a strong monad

(𝕋:𝒞𝒞,η,μ,𝗌𝗍:X𝕋(Y)𝕋(XY))(\mathbb{T} : \mathcal{C} \rightarrow \mathcal{C}, \eta, \mu, \mathsf{st} : X \otimes \mathbb{T}(Y) \rightarrow \mathbb{T}(X \otimes Y))

on a symmetric monoidal category

(𝒞,,I)(\mathcal{C}, \otimes, I)

if the monad is commutative, the induced double strength

𝖽𝗌𝗍:𝕋(X)𝕋(Y)𝕋(XY)\mathsf{dst} : \mathbb{T}(X) \otimes \mathbb{T}(Y) \rightarrow \mathbb{T}(X \otimes Y)

gives our monad a symmetric monoidal structure. That is, \mathbb{T} is a lax symmetric monoidal functor, and the unit and multiplication are monoidal natural transformations. In fact, we can also go in the other direction, given a symmetric monoidal monad with coherence map

φ:𝕋(X)𝕋(X)𝕋(XY)\varphi : \mathbb{T}(X) \otimes \mathbb{T}(X) \rightarrow \mathbb{T}(X \otimes Y)

we can recover a corresponding left and right strength as the composites:

φ(𝗂𝖽η):𝕋(X)Y𝕋(XY)andφ(η𝗂𝖽):X𝕋(Y)𝕋(XY)\varphi \cdot (\mathsf{id} \otimes \eta) : \mathbb{T}(X) \otimes Y \rightarrow \mathbb{T}(X \otimes Y)\quad\text{and}\quad \varphi \cdot (\eta \otimes \mathsf{id}) : X \otimes \mathbb{T}(Y) \rightarrow \mathbb{T}(X \otimes Y)

and we can travel back and forth between these two points of view. That is, a commutative monad is the same thing as a symmetric monoidal monad. Rephrasing again, for a symmetric monoidal category:

A commutative monad is a monoid in the category of lax symmetric monoidal endofunctors.

Distributive Laws of Commutative Monads

With the above observation in mind, a distributive law of commutative monads should be an ordinary distributive law

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

which is also a monoidal natural transformation. Concretely, this means

𝕋𝖽𝗌𝗍𝕊𝖽𝗌𝗍𝕋λλ=λ𝕊𝖽𝗌𝗍𝕋𝖽𝗌𝗍𝕊\mathbb{T} \mathsf{dst}^{\mathbb{S}} \cdot \mathsf{dst}^{\mathbb{T}} \cdot \lambda \otimes \lambda = \lambda \cdot \mathbb{S} \mathsf{dst}^{\mathbb{T}} \cdot \mathsf{dst}^{\mathbb{S}}

The definition of a distributive law of commutative monads appearing in the literature in independent work of Wolff and Jacobs is a distributive law of strong monads, satisfying the additional equation

λ𝕊𝗌𝗍𝕋𝗌𝗍𝕊=𝕋𝗌𝗍𝕊𝗌𝗍𝕋\lambda \cdot \mathbb{S}\mathsf{st’}^{\mathbb{T}} \cdot \mathsf{st}^{\mathbb{S}} = \mathbb{T}\mathsf{st}^{\mathbb{S} \cdot \mathsf{st’}^{\mathbb{T}}}

which involves a slightly odd combination of left and right strengths. Its not immediately obvious how the equation we have derived relates to the Wolff Jacobs conditions. So we have work to do.

A reasonably straightforward direct calculation shows that our equation implies the Wolff Jacobs conditions. Trying to proceed directly in the other direction proves significantly more painful.

Instead, we proceed indirectly. It is not too hard to show that composing two commutative monads using a distributive law of commutative monads result in a commutative monad. This is not a big shock, as it is their very purpose. By an observation of Beck, we can recover a distributive law from its composite monad by suitably precomposing the composite multiplication with the units of the component monads. We then note

  • The component monads are commutative by assumption, and so their units are monoidal.
  • The composite monad is commutative as a result of the Wolff Jacobs conditions, and so its multiplication is monoidal.
  • Becks composite recovering the distributive law combines only monoidal components.

Therefore, a distributive law satisfying the Wolff Jacobs conditions is a monoidal natural transformation.

Summing up, a distributive law of commutative monads is an ordinary distributive law that equivalently either:

  1. Satisfies the Wolff Jacobs equations directly involving strength, or
  2. Is a monoidal natural transformation

Summary

Monads and their distributive laws are 2-categorical phenomena, and so the correct definition of distributive law should be inevitable.

In a previous post we saw that the notion of distributive of strong monads appearing in the literature drops out directly from the abstract framework. In this post we moved on to look at the accepted notion of distributive law of commutative monads. The situation was more subtle, but it is reassuring that after a bit of massaging, instantiating the abstract definition yields the same construction.

Distributive laws of commutative monads appear in:

  • Wolff “Commutative Distributive Laws”
  • Jacobs “Semantics of weakening and contraction”

Leave a comment