# nLab distributive law

Distributive laws

### Context

#### Categorical algebra

internalization and categorical algebra

universal algebra

categorical semantics

#### 2-Category theory

2-category theory

Definitions

Transfors between 2-categories

Morphisms in 2-categories

Structures in 2-categories

Limits in 2-categories

Structures on 2-categories

# Distributive laws

## Idea

Sometimes in mathematics we want to consider objects equipped with two different types of extra structure which interact in a suitable way. For instance, a ring is a set equipped with both (1) the structure of an (additive) abelian group and (2) the structure of a (multiplicative) monoid, which satisfy the distributive laws $a\cdot (b+c) = a\cdot b + a\cdot c$ and $a\cdot 0 = 0$.

Abstractly, there are two monads on the category Set, one (call it $\mathbf{T}$) whose algebras are abelian groups, and one (call it $\mathbf{S}$) whose algebras are monoids, and so we might ask “can we construct, from these two monads, a third monad whose algebras are rings?” Such a monad would assign to each set $X$ the free ring on that set, which consists of formal sums of formal products of elements of $X$—in other words, it can be identified with $T(S(X))$. Thus the question becomes “given two monads $\mathbf{T}$ and $\mathbf{S}$, what further structure is required to make the composite $T S$ into a monad?”

It is easy to give $T S$ a unit, as the composite $Id \xrightarrow{\eta^S} S \xrightarrow{\eta^T S} T S$, but to give it a multiplication we need a transformation from $T S T S$ to $T S$. We naturally want to use the multiplications $\mu^T\colon T T \to T$ and $\mu^S\colon S S \to S$, but in order to do this we first need to switch the order of $T$ and $S$. However, if we have a transformation $\lambda\colon S T \to T S$, then we can define $\mu^{T S}$ to be the composite $T S T S \xrightarrow{\lambda} T T S S \xrightarrow{\mu^T\mu^S} T S$.

Such a transformation, satisfying suitable axioms to make $T S$ into a monad, is called a distributive law, because of the motivating example relating addition to multiplication in a ring. In that case, $S T X$ is a formal product of formal sums such as $(x_1 + x_2 + x_3)\cdot (x_4 + x_5)$, and the distributive law $\lambda$ is given by multiplying out such an expression formally, resulting in a formal sum of formal products such as $x_1\cdot x_4 + x_1 \cdot x_5 + x_2 \cdot x_4 + x_2 \cdot x_5 + x_3\cdot x_4 + x_3 \cdot x_5$.

## Big picture

Monads in any 2-category $C$ make themselves a 2-category $\mathrm{Mnd}$ in which 1-morphisms are either lax or colax homomorphisms of monads.

By formal duality the analogue is true for comonads.

Monads internal to the 2-category of monads are called distributive laws. In particular, distributive laws themselves make a 2-category. There are other variants like distributive laws between a monad and an endofunctor, “mixed” distributive laws between a monad and a comonad (the variants for algebras and coalgebras called entwining structures), distributive laws between actions of two different monoidal categories on the same category, for PROPs and so on. Having a distributive law $l$ from one monad to another enables to define the composite monad $\mathbf T\circ_l\mathbf P$. This correspondence extends to a 2-functor $\mathrm{comp}:\mathrm{Mnd}(\mathrm{Mnd}(C))\to\mathrm{Mnd}(C)$. An analogue of this 2-functor in the mixed setup is a homomorphism of bicategories from the bicategory of entwinings to a bicategory of corings.

## Explicit definition

A distributive law from a monad $\mathbf{T} = (T, \mu^T, \eta^T)$ in $A$ to an endofunctor $P$ is a 2-cell $l : T P \Rightarrow P T$ such that $l \circ (\eta^T)_P = P(\eta^T)$ and $l \circ (\mu^T)_P = P(\mu^T) \circ l_T \circ T(l)$. In diagrams:

Distributive laws from the monad $\mathbf{T}$ to the endofunctor $P$ are in a canonical bijection with lifts of $P$ to an endofunctor $P^{\mathbf T}$ in the Eilenberg-Moore category $A^{\mathbf T}$, satisfying $U^{\mathbf T} P^{\mathbf T} = P U^{\mathbf T}$. Indeed, the endofunctor $P^{\mathbf T}$ is given by $(M,\nu) \mapsto (P M,P(\nu)\circ l_M)$.

A distributive law from a monad $\mathbf{T} = (T, \mu^T, \eta^T)$ to a monad $\mathbf{P} = (P, \mu^P, \eta^P)$ in $A$ (or of $\mathbf T$ over $\mathbf P$) is a distributive law from $\mathbf T$ to the endofunctor $P$, compatible with $\mu^P,\eta^P$ in the sense that $l \circ T(\eta^P) = (\eta^P)_T$ and $l \circ T(\mu^P) = (\mu^P)_T \circ P(l) \circ l_P$. In diagrams:

The correspondence between distributive laws and endofunctor liftings extends to a correspondence between distributive laws and monad liftings. That is, distributive laws $l : T P \Rightarrow P T$ from the monad $\mathbf{T}$ to the monad $\mathbf{P}$ are in a canonical bijection with lifts of the monad $\mathbf{P}$ to a monad $\mathbf{P}^{\mathbf T}$ in the Eilenberg-Moore category $A^{\mathbf T}$, such that $U^{\mathbf T} : A^{\mathbf T}\to A$ preserves the monad structure.

Thus all together a distributive law from a monad to a monad is a 2-cell for which 2 triangles and 2 pentagons commute. In the entwining case, Brzeziński and Majid combined the 4 diagrams into one picture which they call the bow-tie diagram.

Similarly, there are definitions of distributive law of a comonad over a comonad, a monad over a comonad (sometimes called a mixed distributive law), and so on.

## Examples

### Products distributing over coproducts

In a distributive category products distribute over coproducts.

### In Cat

• There is a distributive law of the monad (on Set) for monoids over the monad for abelian groups, whose composite is the monad for rings. This is the canonical example which gives the name to the whole concept.

#### Tensor products distributing over direct sums

For many standard choices of tensor products in the presence of direct sums the former distribute over the latter. See at tensor product of abelian groups and tensor product of modules.

## Literature

On distributive laws for relative monads:

Last revised on August 20, 2023 at 12:50:52. See the history of this page for a list of all contributions to it.