Distributive laws for Lawvere theories

Distributive laws give a way of combining two algebraic structures expressed as monads; in this paper we propose a theory of distributive laws for combining algebraic structures expressed as Lawvere theories. We propose four approaches, involving profunctors, monoidal profunctors, an extension of the free finite-product category 2-monad from Cat to Prof, and factorisation systems respectively. We exhibit comparison functors between CAT and each of these new frameworks to show that the distributive laws between the Lawvere theories correspond in a suitable way to distributive laws between their associated finitary monads. The different but equivalent formulations then provide, between them, a framework conducive to generalisation, but also an explicit description of the composite theories arising from distributive laws.


Introduction
Lawvere theories were introduced in [11] and were a great breakthrough in the understanding of algebraic theories. They give a different viewpoint from that of monads in how they implement the notion of arity. One practical advantage of Lawvere theories over monads highlighted in [8] is that Lawvere theories allow us to study models in different categories, starting from the same Lawvere theory. For example, topological groups and ordinary groups both arise as models for the Lawvere theory for groups, whereas using monads we have to construct a monad on Set for groups and a different (albeit related) monad on Top for topological groups.
Distributive laws give us a way of combining algebraic theories expressed as monads. The classic example combines the monad for Abelian groups and the monad for monoids (both monads being on Set) to yield the monad for rings as the "composite" algebraic theory: the distributive law makes the composite of the two monads into a new monad. The theory for combining three or more monads is developed in [5].
It is well-known that Lawvere theories and monads are related-Lawvere theories correspond to finitary monads on Set. This should not be thought of as a statement that Lawvere theories are "merely" a special case of monads; the above comments about models shows one way in which Lawvere theories are of importance in their own right.
A natural question then arises-is there a notion of distributive law for Lawvere theories? Of course, given the above correspondence with finitary monads on Set, one could simply say "a distributive law for Lawvere theories is a distributive law between the associated finitary monads on Set." However, we seek a formulation that is "native" to the framework of Lawvere theories. In this paper we will provide four equivalent formulations at varying levels of abstraction. As usual we expect the most abstract one to be more useful for theorising, and expect the most concrete one to be more useful for applications. Thus their equivalence should not be taken to mean that any of the definitions is redundant.
Our three most abstract formulations will come from observing that Lawvere theories may themselves be thought of as monads inside some other bicategory. Having expressed Lawvere theories in this way it is natural to define distributive laws for Lawvere theories as distributive laws between the monads in these bicategories. The bicategories in question are 1. Prof-categories, profunctors and natural transformations.
2. Prof(Mon)-as above but internal to monoids. 3. Prof F -the Kleisli bicategory for the free finite-product category 2-monad extended from Cat to Prof.
The advantage of (1) is that the bicategory Prof is well-known and quite easy to understand; however not all monads in here are Lawvere theories even if we restrict to the correct underlying 0-cell. The approach using (2) is in some ways more naturally-arising than (1) and in fact helps us understand it. Also, it is closely related to Lack's work on distributive laws for PROPs [10].
The advantage of (3) is that, once we restrict to the correct underlying 0-cell, all monads are Lawvere theories. It is this that enables us to prove that the composite monad in each of these three frameworks is also a Lawvere theory-it is immediate in (3) and then by the equivalence of the three definitions, the result will follow for (1) and (2).
Another advantage of (3) is that although (or because) this bicategory is very much harder to work with, it affords not only the most precision but also greater flexibility. We will see that monads on other 0-cells may be thought of as "typed" Lawvere theories, and the setting also opens the possibility for changing the 2-monad F to study different types of theory; this insight is all gained from Hyland [7].
For the most concrete formulation, we unravel (1) and express it in terms of factorisation systems. The notions are equivalent, but the framework feels quite different from the above abstractions and therefore provides different insights. For example, distributive laws for monads seem suited to considering composition of monads, whereas factorisation systems seem suited to considering decompositions.
Note that it is quite easy to make a wrong definition of distributive law for Lawvere theories along the above lines, by working in an ill-chosen bicategory. For example, every Lawvere theory is a monad in Span (which is, after all, related to Prof), but considering distributive laws in this bicategory gives the wrong notion, as we will show in Section 4.
As evidence that our definitions do give the correct notion, we prove that all our definitions of distributive law for Lawvere theories correspond suitably to distributive laws between the associated finitary monads, with the composite Lawvere theories corresponding to the composite monads. En passant, we shed some more, abstract, light on the monad/Lawvere theory correspondence.
Note that the tensor product of Lawvere theories is a way of combining Lawvere theories that is different from distributive laws. The tensor product of two Lawvere theories always exists, whereas there is not always a distributive law of a given Lawvere theory over another. It is said that in the tensor product "all the operations of one theory commute with all the operations of the other" but this must be understood in a particular sense: given an m-ary operation f of the first theory and an n-ary operation g of the second, in the tensor product n copies of f followed by g is the same as m copies of g followed by f , as (nm)-ary operations. This neither implies nor is implied by a distributive law. For example, the theory of rings is not the tensor product of the theory of Abelian groups and the theory of monoids; the monad for rings is the composite of the monad for Abelian groups and the monad for monoids. While this can be thought of as a type of commutativity between the group operation and the monoid operations, this is in a very different sense from the type of commutativity in the tensor product of Lawvere theories.
The paper is organised as follows. In Section 1 we briefly recall the definition of Lawvere theory and the correspondence with finitary monads on Set. In Section 2 we briefly recall the notion of distributive law between monads inside a bicategory. Experts can skip both these sections with impunity. In Sections 3-6 we present our four different approaches to distributive laws for Lawvere theories and in Section 7 we provide the comparison. We finish in Section 8 with some brief comments about the possibilities for future work.

Lawvere theories
In this section we recall the basic definitions and results about Lawvere theories that we will need in the rest of this paper. Nothing in this section is new. Lawvere theories were introduced in [11]; we find that [8] gives a useful exposition.
The idea of a Lawvere theory is to encapsulate an algebraic theory as a category L where • the objects of L are the natural numbers, the "arities", • a morphism k 1 is an operation of arity k, and • a morphism k m is m operations of arity k.
Let F denote a skeleton of FinSet, the category of finite sets and all functions between them. So in particular the objects of F are the natural numbers (including 0).

Definition 1.1.
A Lawvere theory is a small category L with (necessarily strictly associative) finite products, equipped with a strict product-preserving identity-on-objects functor A morphism of Lawvere theories from L to L ′ is a functor making the obvious triangle commute; note that such a functor necessarily strictly preserves finite products. Lawvere theories and their morphisms form a category Law.

Remark 1.2.
It is worth making the structure of F a little more explicit here as we will rely on this heavily later, especially when we consider the free finite-product category monad F in Section 6. Since FinSet is equivalent to the free finite coproduct category on 1, F op is equivalent to the free finite product category on 1. Finite products are given by addition of natural numbers, and so a morphism α : k m ∈ F is given by, for each i ∈ [m], a choice of projection k 1. Hence α is precisely a function [m] [k] where we write [k] for a set of k elements. (We will sometimes omit the square brackets if confusion is unlikely.) The idea for Lawvere theories is that F op encapsulates the operations that must generically exist in any algebraic theory: forgetting and repeating variables. For each m ∈ F op we have: • the ith product projection m 1 corresponding to forgetting all m variables except the ith one, and Note that as a result of forgetting variables we have many different possible arities for the "same" operation. For example starting with a 3-ary operation abc, say, we may precompose with variable-forgetting morphisms to express abc as a k-ary operation where all variables apart from a, b, c are forgotten: As a 5-ary operation, for example, this might take the variables a, b, c, d, e and return the operation abc. 1. An alternate definition says that a Lawvere theory is any category with finite products in which every object is isomorphic to a finite cartesian power x n of a generic object x; this is then invariant under equivalence of categories.
2. Many-sorted theories: writing F for the 2-monad for strictly associative products on the 2-category Cat of small categories, and observing that F1 ≃ F op , we could instead use FA for non-terminal categories A to get Lawvere theories with sorts given by A.
3. Sometimes Lawvere Theories are known as finite-product theories, but sometimes finiteproduct theory is used to mean any small category C with finite products. In fact this notion of finite-product theory can be regarded as a special case of many-sorted theories in which the sorts are given by the objects of C.
Example 1.7. Let L be the Lawvere theory for monoids, and C = Set. Consider a finite-product preserving functor F : L C.
Writing F (1) = A, we must have F (k) = A k . Then given any k-ary operation, that is, morphism k 1 in L, we get a function A k A.
Functoriality and preservation of products ensures that this is precisely a monoid as expected.
Putting C = Top gives an underlying space A with multiplication given by continuous maps, so we get topological monoids as expected.
We now discuss the correspondence between Lawvere theories and monads, which was hinted at in Example 1.4. This was originally analysed by Linton [12]. Note that this has finite products because Set has coproducts. Now as we have only used finite sets, we cannot hope to have captured all the behaviour of a general monad on Set-only the finitary part. Recall that a finitary functor is one that preserves filtered colimits; on Set this amounts to being entirely determined by its action on finite sets as follows. This paper can be seen as providing several equivalent definitions of distributive law for Lawvere theory that extend the above correspondence.

Distributive laws for monads
In this work we will be thinking of distributive laws in two ways: 1. a way of combining algebraic theories to provide a composite theory, and 2. more generally: an abstract structure giving a way of composing monads to produce a composite monad inside any bicategory B.
In this section we will simply recall the basic definitions. None of the material in this section is new. We first recall the classical theory of distributive laws, stated with respect to monads on categories.
The main theorem about distributive laws tells us about new monads that arise canonically as a result of the distributive law. In this work we will mostly be interested in the composite monad. Theorem 2.2 (Beck,[2]). The following are equivalent: • A distributive law of S over T .
• A lifting of the monad T to a monad T ′ on S-Alg.
• An extension of the monad S to a monadS on Kl(T ).
It follows that T S canonically acquires the structure of a monad, whose category of algebras coincides with that of the lifted monad T ′ , and whose Kleisli category coincides with that ofS.

Example 2.3. (Rings)
C = Set S = free monoid monad T = free abelian group monad λ = the usual distributive law for multiplication and addition e.g.
Then the composite monad T S is the free ring monad. λ is given by the interchange law e.g.
The main theorem of [5] generalises the notion of distributive law to the case when we have more than two monads interacting with each other, as follows.
• for all i > j > k the "Yang-Baxter" equation given by the commutativity of the following diagram Then for all 1 ≤ i < n we have canonical monads given by the obvious composites of the λ ij . Moreover, all the induced monad structures on T 1 T 2 · · · T n are the same.
Definition 2.6. A distributive series of n monads is a system of monads and distributive laws as in Theorem 2.5.
Example 2.7. Rings can be constructed from the following distributive series of 3 monads on Set. A = monad for associative non-unital binary multiplication × B = monad for pointed sets i.e. X → X {1} C = free additive abelian group monad Example 2.8. Strict n-categories can be constructed from a distributive series of n monads on n-globular sets, as a generalisation of the 2-category case. Here there is a monad T i for each 0 ≤ i ≤ n − 1 giving "composition along bounding n-cells.
In his classic paper The formal theory of monads [17] Street defines for any 2-category B a 2-category Mnd(B) of monads in B. Then distributive laws arise as monads in Mnd(B). While we will not use that particular, and appealing, fact, we will certainly be looking at monads and distributive laws inside various 2-categories and in fact bicategories, which can be done by invoking appropriate coherence conditions and results.
Accepted in Compositionality on 2019-12-18. Click on the title to verify.
In this section we give the most straightforward but perhaps least intuitive definition of distributive laws for Lawvere theories. We start to make use of the notion of a monad in a bicategory. We use the bicategory Prof of profunctors, and simply observe that all Lawvere theories are monads on F op in Prof (though not all monads on F op are Lawvere theories); this result and those leading up to it are standard. We can thus simply look at distributive laws between these monads. It is not immediately obvious why this should be the right definition and we will defer this justification to the last section.
First we set our notational conventions.
Definition 3.1. We write Prof for the bicategory given as follows.
and is only weakly associative and unital.
Profunctors turn out to be the same as bimodules internal to the bicategory of spans. This fact will be useful to us both technically and conceptually in Section 4.

Definition 3.2.
We write Span for the bicategory of spans given as follows.

Definition 3.3. Given any bicategory K and monads
satisfying the usual bimodule axioms: λ is compatible with the structure of X, ρ with the structure of Y and λ and ρ with each other.
Provided K has enough structure, bimodules are the 1-cells of a bicategory as follows.

Definition 3.4. Let K be a bicategory with coequalisers of 2-cells that are preserved by left and right composition with 1-cells. We write Mod(K)
for the bicategory of bimodules in K, given as follows.
• Composition of 1-cells is by coequaliser: given Combining these two constructions gives another way of thinking of profunctors, with some care over dualities.
Example 3.5. The bicategory Mod(Span) is given as follows.
• 0-cells are monads in Span that is, small categories.
• Given categories X, Y with underlying spans Y has underlying span of the form The elements of A can be thought of as arrows with source in X and target in Y . The left Y -action is a map of spans giving us a way of post-composing arrows in A with those of Y ; the module axioms tell us that this respects composition in Y . Similarly for the left X-action. The left-right compatibility then gives us associativity for composing three arrows Accepted in Compositionality on 2019-12-18. Click on the title to verify.
In [3] Bénabou first defines profunctors ("distributeurs") directly as functors D op × C Set. He then defines profunctors internal to a bicategory E as bimodules in the bicategory Span E of spans internal to E as follows.
Definition 3.6. [3] Let E be a category with pullbacks and coequalisers that commute.
• Write Span E for the bicategory of spans in E.
• Define Prof E to be the bicategory Mod(Span E) op . Thus 0-cells are monads in Span E, that is, categories internal to E.
1. We need pullbacks to define composition of spans, and we need the coequaliser condition to define composition of profunctors.
2. We need to take the dual here for reasons that will become clear later..
Thus according to this approach profunctors in Set are bimodules in Span by definition. Although not stated it seems clear that the intention is for profunctors in E to be a generalisation of basic profunctors in the sense that the notions coincide in the case E = Set. This is the content of the following proposition. The 0-cells on both sides are small categories, thus we set the action of the functor on 0-cells to be the identity.
For the action on 1-cells, we start with a profunctor Y F X, that is a functor X op × Y F Set, and construct a bimodule X Y , that is, a (Y, X)-bimodule, as follows. First take the underlying span X Y to be: The left Y -and right X-actions are given by the actions of F on morphisms as follows. For the Y -action we need a map of spans . x,y so we define the action by The X-action is constructed similarly.
Accepted in Compositionality on 2019-12-18. Click on the title to verify.

Now we construct a functor Mod(Span) Prof op
which again is the identity on 0-cells. Given categories X, Y and a bimodule X , that is, the pre-image in A 1 of the pair (x, y). Functoriality comes from the left and right actions. It is routine to check that this gives a biequivalence of bicategories. ✷ Remark 3.9. Note that when we discuss factorisation systems in Section 4 it is useful to think in terms of spans, but for the comparison in Section 7 it is useful to think in terms of profunctors.
We are going to show that Lawvere theories arise as certain monads in Prof. In fact the monads in Prof are any identity-on-objects functors. This is fairly easy to prove directly, but it is also a special case of the following standard result. For the right hand side we 1. take the monoidal category of 1-cells x x in K, 2. take the category of monoids in this monoidal category, and 3. slice this category under X.

Corollary 3.11. A monad in Mod(Span) on X consists of a category A and an identity-onobjects functor X A.
Proof. X is a 0-cell of Mod(Span) so is a monad in Span that is, a small category with object set x, say. Now a monad in Mod(Span) on X is a monoid in Mod((Span)(X, X)) by definition, so by Theorem 3.10 it is an object of X/Mon (Span(x, x)). Now • a monoid in Span(x, x) is a category with the same objects as X, and • a morphism of monoids in Span(x, x) is an identity-on-objects functor.
So the objects of X/Mon(Span(x, x)) are precisely identity-on-objects functors X A. ✷ Corollary 3.12. A monad in Prof op on X consists of a category A and an identity-on-objects functor X A.

Remark 3.13.
It is illuminating to sketch a direct proof of this result. A monad X X in Mod(Span) is an (X, X)-bimodule that is also a monad. That is, it has a left and right Xaction but also a unit and multiplication of its own. Note that X is itself a monad in Span, with underlying span say. So for the monad X X we have a span on the same objects as X, say

Essentially
• the monad structure makes this into a category A, say, • the left/right X-actions tell us how to map X 1 to A 1 , • the way composition of bimodules works ensures that the composition of A is compatible with that of X, that is, that we have a functor X A.
Similarly we can sketch a direct proof of the result in Prof op : given a monad A : C op × C Set we get a category A by setting A(a, b) = A(a, b) and using the unit and multiplication of the monad to give identities and composition. To construct an identity-on-objects functor C A we use the functoriality of A which has the effect of producing left and right actions of the morphisms of C on the morphisms of A; taking the action on identities then gives the functor. Although not every monad on F op in Prof op is a Lawvere theory, given two Lawvere theories expressed in this way, we can define distributive laws between them. Note that the issue here is finite products-a priori our distributive law makes BA into a monad on F op in Prof, that is, an identity-on-objects functor F op BA; for this to be a Lawvere theory we need to prove that BA has finite products and that the functor preserves them. We defer this proof, and further justification of the definition, until Section 7 (Corollary 7.8), as the comparison proceeds via the definitions that we will introduce in subsequent sections.
In the next section we give a more explicit characterisation of such a distributive law, using the language of factorisation systems.

Factorisation systems
We will use a notion of factorisation system as given by Rosebrugh and Wood in [16], but slightly more general. Some stages of generalisation of notions of factorisation system can be seen as follows: 1. Strict factorisation systems on a category C.

Orthogonal factorisation systems on C.
3. Factorisation systems over I where I is a subgroupoid of C [16]; orthogonal factorisation systems are a special case. 4. Factorisation systems over J where J is a subcategory of C.
We include some basic definitions here as the terminology in the literature is not entirely uniform.
There are also many equivalent formulations; a helpful exposition can be found in [15] Definition 4.1. A strict factorisation system on a category C is a pair (L, R) of subcategories of C, with the same objects as C (lluf), such that every morphism of C can be factorised uniquely as a composite l r with l ∈ L and r ∈ R.

Remarks 4.2.
1. The uniqueness implies that the intersection of L and R must contain only the identities.   There are many naturally-arising factorisation systems that are not strict, but the following characterisation by Rosebrugh and Wood [16] makes the strict ones of abstract interest. Another way of putting this is that a strict factorisation system on a category C is a decomposition of C as a monad in Span into a composite BA via a distributive law. where the first operation adds in a redundant operation abc and the second one forgets it. Now the two are related via a projection in F op making the following diagram commute, in the sense that the left-hand triangle commutes in A and the right-hand triangle commutes in B. x + y x + x ?
We will now show that there is no single morphism in F op in either direction (3 1 or 1 3) that makes the diagram commute.
• For morphisms 3 1, the only such morphisms are the three projections. These will clearly not make the resulting right-hand triangle commute.
• For morphisms 1 3, the only such map is the diagonal {x, x, x}. This will not make the resulting left-hand triangle commute.
So in fact we need a zigzag: where ∆ denotes the diagonal.

Remark 4.9.
Here is a useful way of thinking about this example that points us in the direction we need. The idea is that our original pullback BA .
ignored the fact that F op is in both A and B. So in fact we want a coequaliser where the parallel maps are derived from  respectively. To form this coequaliser we put an equivalence relation on the morphisms of BA; this is encapsulated in the following definition, which is a generalisation of the definition of a factorisation system over a groupoid given in [16]. 1. If J is a groupoid, we get a factorisation system over J as in [16]. (The authors stop just short of making this definition although they have all the machinery in place to make it-they have other uses in mind and make the following construction instead.) 2. If J is the groupoid of all isomorphisms in C, we get an orthogonal factorisation system in the usual sense.
3. If J is all identities we get a strict factorisation system. 4. Weak factorisation systems are not in general an example, for in a weak factorisation system factorisations are unique up to diagonal fillers, or "solutions" of certain lifting problems, but these diagonal fillers are not necessarily in L or R; to be a factorisation system over J these fillers would need to be in J and hence in both L and R.  Given any category C with a factorisation system over F op given by (A, B), if A and B are Lawvere theories then C is also a Lawvere theory.
As before (for the definition in Prof op ), we need to check the necessary facts about finite products. Again we defer this proof until later (Corollary 7.8).
Remark 4.14. Note that the natural way of stating this definition involved starting with a category C and "decomposing it" via a factorisation system over F op , rather than starting with Lawvere theories A and B and "combining them" as in other definitions. This different viewpoint could shed light on the question of when an algebraic theory can can be expressed as a composite of simpler ones, as opposed to when it is "irreducible".
In any case the formulation as a coequaliser gives us a good abstract formalism. Effectively we have taken the monoidal category Span(F op , F op ), put a new tensor product ⊗ F op on it, and taken distributive laws with respect to this. This is more elegantly described using bimodules.
Then ⊗ F op described above is just bimodule composition. Thus the above definition of distributive law amounts to regarding A and B as monads in Mod(Span) and taking distributive laws between them. But we know Mod(Span) ≃ Prof op , so we have proved the following theorem. We will state this more precisely later in terms of comparison functors, but the idea is that Definition 4.12 "FS" can be taken as an explicit characterisation of Definition 3.16 "PROF".

Remarks 4.17.
1. This definition generalises the definition of "distributive law with respect to J" given in [16] although there it is expressed quite differently. J is required to be a groupoid in order to yield an equivalence relation on the morphisms of BA. Effectively, this is to get unique factorisations up to plain morphisms in J rather than zigzags (see [16,Section 5.4]). In fact the authors do not actually mention factorisation systems over general groupoids-their aim is to give a bicategory in which orthogonal factorisation systems are distributive laws, so once they have this general notion of distributive law in place, they set J to be the groupoid of all isomorphisms for the purposes of the factorisation system. [10,Sections 4.2,4.3]. He is mostly concerned with PROPs, so only mentions this in passing, and again only in the case where J is a groupoid. However, his subsequent sections study distributive laws in Prof(Mon), which is also the subject of our next section.

Monads in monoidal profunctors
In this section we give an approach that deals a little more explicitly with the finite products, by taking profunctors in monoidal categories. These are defined using the definition of profunctors in E (Definition 3.6) and taking E = Mon, the category of monoids and monoid homomorphisms. Note that a 0-cell in Prof(Mon) is an internal category in Mon, that is, a strict monoidal category.

Proposition 5.1. A monad in Prof(Mon) op on a monoidal category X consists of a strict monoidal category A and an identity-on-objects strict monoidal functor X A.
Proof. Follows from Theorem 3.10. Put K = Span(Mon), and x = ob X, so a monoid in K(x, x) in this case is a strict monoidal category with the same objects as X. A morphism of such monoids is a strict monoidal identity-on-objects functor. ✷ The following result is analogous to Corollary 3.14. Comparing this situation with that of monads in plain Prof op we see that the monoidal framework is slightly "better": monads in Prof(Mon) op are slightly closer to being Lawvere theories in the sense that we only need to check a condition on A and the condition on α A is then automatic. In the next section we will give an even "better" framework in which all the conditions are automatic. A and B, a distributive law of A  1. An immediate question is whether or not this gives the same thing as distributive laws in plain Prof.

Definition 5.3. ("PROFMON") Given Lawvere theories
The perhaps surprising answer is that they are indeed the same, as when the monoidal structure is product, natural transformations are automatically monoidal. We will discuss this in Section 7.
2. This approach is closely related to Lack's approach to distributive laws for PROPs in [10]. For PROPs, instead of F we use P, a skeleton of the the category of finite sets and bijections. The rest of the formalism is the same.
As before, we defer the proof that the composite is a Lawvere theory until Section 7, but it is instructive to compare the question to the analogous question in Prof op . There, the issue was both whether the composite had finite products and whether the identity-on-objects functor preserved them. This time, we know the identity-on-objects functor must preserve the monoidal structure of the composite, so we only need to check that this monoidal structure is given by finite products.
There are (at least) two ways to prove this. A direct hands-on method might be possible, but a more abstract approach uses a free finite-product category 2-monad. This is the subject of the next section.

Monads in a Kleisli bicategory of profunctors
In this section we follow [7] and use a bicategory in which monads are precisely Lawvere theories. (This statement allows for types-for untyped Lawvere theories we will restrict to the 0-cell 1.) The idea in in [7] is to consider notions of algebraic theory determined by 2-monads S on the 2-category Cat of small categories. If S extends to a pseudo-monad S P on Prof in a suitable way, then many-sorted S-algebraic theories arise as monads in Kl (S P ). One example is when S is the 2-monad for strictly associative products, in which case the S-algebraic theories in this sense are (many-sorted) Lawvere theories.
Suitable extensions of S to Prof are given by a generalisation of distributive laws for monads. The idea is that the presheaf functor sending a small category C to [C op , Set] is almost a pseudomonad other than size issues, as it is in fact a pseudofunctor Cat CAT, from small categories to locally small categories. The bicategory Prof is essentially the Kleisli bicategory for this not-quite monad.
Hyland makes this precise by defining a notion of Kleisli structure on an inclusion of bicategories. The idea builds from the Kleisli formulation of a monad given in [13]. This has the advantage of being applicable even when structure is only defined on a subcollection of objects, giving rise to the relative monads of [1]. Kleisli structures are a 2-dimensional version of relative monads.
The presheaf construction is a key example. For a small category A write P A = [A op , Set]. The following results are all from [7]. Proposition 6.1. (Hyland [7]) The presheaf construction P gives a Kleisli structure on the inclusion Cat CAT and the resulting Kleisli bicategory Kl (P ) ∼ = Prof.
We will not need any details about Kleisli structures; we just need the following results.
Proposition 6.2. (Hyland [7]) Let F be the monad for strictly associative products on Cat. This extends to a pseudomonad F P on Prof.
By abuse of notation we will also write the extended pseudomonad as F; this should not cause ambiguity as we will never need to use the original monad on Cat.

Remarks 6.3.
It is useful to take a moment to make some of the structure of F explicit; we will need this in the proof of Proposition 6.6.
1. First we make explicit the structure of FA where A is any category. Objects in FA are finite strings of objects in A. Since these are to be products, a morphism (a 1 , . . . , a n ) is given by • for each index on the right a choice of projection from the left; that is a function α : [m] [n], and In the proof of Proposition 6.6 we will need the morphisms of F 2 1. An object in this category is a string of natural numbers. We see that in this case a morphism (a 1 , . . . , a n ) is given by The profunctor FF is defined by   FF (b 1 , . . . , b n ; a 1 , . . . , a n ) =
For the unit we have η : 1 F1 i.e. Monads in Prof F are then many-sorted Lawvere theories; we only need the following special case. In fact we have a more precise result involving an equivalence of categories (Theorem 6.8). Before we prove that, the following proposition provides a functor that will evaluate a monad in Prof op F at the corresponding Lawvere theory expressed in Prof op . Recall that the forgetful functor from the Kleisli category of any monad to its underlying category is given on morphisms by applying the monad and postcomposing with µ. The following proposition evaluates this for F. Proposition 6.6. For any profunctor 1 F F1, the composite Proof. By definition this composite is We aim to show that in computing this coend we only need to consider m = 1. We use the fact that in general in a coend cocone for Q : .
Choose U, V ∈ F 2 1 as follows Note that U is a 1-ary string. We then define f : U V ∈ F 2 1 as follows. Recall that a morphism Here we have n = 1 so α is trivial, thus to define f we just need to give, for all i ∈ [m] a map β i : k i k 1 + · · · + k m ∈ Set and we set these to be the canonical coproduct insertions. Now note that and moreover the isomorphism is given by Q(1, f ). So we can disregard all vertices in the coend for which m = 1.
Thus the coend becomes as required. ✷ Remark 6.7. Note that this profunctor will be calledF in Section 7 and it will give us the comparison between the profunctor approach and the monad approach; note that if F is a finitary monad,F is its associated Lawvere theory.
Write [Set, Set] f for the monoidal category of finitary endofunctors on Set and natural transformations, with the monoidal structure given by composition. Note that this is the only case in which it is immediate that the composite monad is a Lawvere theory; however the result for the other definitions will follow. First, we can immediately deduce from the preceding results that these distributive laws correspond precisely to distributive laws between finitary monads in Set. Remark 6.11. In fact since distributive laws in a 2-category K are the 0-cells of Mnd(Mnd K) we could express this as a biequivalence between the "bicategories of distributive laws", and then iterate the construction to get a notion of iterated distributive law for Lawvere theory, as in Definition 2.5.

Comparison
We now have four definitions of distributive law for Lawvere theory in place: • KL is equivalent to the monad approach (Corollary 6.10).
In this section we will complete the programme of equivalences by showing that PROF is equivalent to both PROFMON and the monad approach. The following diagram shows comparison functors we will construct; so far we have exhibited θ: First we make explicit the functor φ as follows.

Set(m, Gn)
Later we will show that this is a monoidal functor, but now we concentrate on other properties. We aim to show that β is in fact of the formᾱ for some α as above. Now, given any n ∈ F we define putative components α n to be the components β n,1 as shown.
β n,1 :F (n, 1)Ḡ(n, 1) This is true for all i ∈ m, so β m,n (f ) and α n • f agree everywhere, hence β =ᾱ as required and the functor φ is indeed full. ✷

Proof.
We use the definition of Prof(Mon) op as Mod(Span(Mon)), and Prof op as Mod(Span). We write the underlying span of F op as Now consider a finitary functor F : Set Set. Now the image of F under φ isF , whose underlying span ofF as an F op -bimodule is The claim is that this is automatically a bimodule in Mod(Span), although it is a priori just a bimodule in Span. So we need to put a monoid structure on A such that the left and right F-actions respect this. Note that the monoid structure in F 0 is given by addition. So given we construct a function

Now by coproduct in Set we certainly have
and we call this f 1 ⊕ f 2 . We also need e : 0 F 0 such that This is the unique map. Then f ⊕ 0 is the following map:

Set(k, F n)
and we need to check that Accepted in Compositionality on 2019-12-18. Click on the title to verify.
The left and right hand sides of the equation we want then just correspond to the middle dotted composite of this diagram associated either way round, so the result follows by associativity. For the right action, given n f k in Set we have

Set(m, F k)
and we need to check that The result then follows by a straightforward diagram chase involving diagrams similar to the previous one. This completes the result on objects.
We must now check the result on morphisms, that is, given a natural transformation between finitary functors α : F G we must show thatᾱ is a monoid map as So we need to show that given This follows from a straightforward diagram chase and naturality of α. ✷

Corollary 7.3. It follows immediately that
is full as well as faithful, and likewise the forgetful functor is also full and faithful on the image of ψ. Thus distributive laws according to "PROFMON" correspond to distributive laws according to "PROF".
Proof. Follows from φ being full (Proposition 7.1). ✷ Proof. As the forgetful functor U θ is a 1-object restriction of a pseudo-functor, it must be monoidal. Thus the functor φ must be monoidal, and we have already shown that it is full and faithful. Thus distributive laws according to PROF are equivalent to those according to the monad approach. ✷ Remark 7.7. Since θ is an equivalence and φ is full and faithful, the forgetful functor must also be full and faithful, giving a direct comparison between the KLEISLI and PROF approaches.
This completes the suite of equivalences. Proof. For monads in Prof op we know can write A and B as φS and φT for some finitary monads S and T by Corollary 7.4. Then by fullness of φ the 2-cell σ giving the distributive law must be of the form φ(λ) for some natural transformation λ : ST T S; by faithfulness the axioms for λ to be a distributive law follow from those for σ. Thus the composite BA is isomorphic to φ(T S) thus is a Lawvere theory. The result for factorisation systems immediately follows, and that for monads in Prof(Mon) op follows in the same way ✷ Although we have now completed the equivalences, we include one further characterisation as we find it illuminating. It is well known that there are two canonical identity-on-objects pseudofunctors relating Cat and Prof. Given a functor C F D in CAT the two functors act as follows. F.
The following proposition shows that on monads this gives us the (opposite of) the associated Lawvere theory. Proof. This is a routine coend calculation, using the fact that F * I * = (F I) * :

F.
We simply calculate the coends. The first gives as G is finitary.

Future work
This new theory of distributive laws for Lawvere theories, with its four different viewpoints, opens up various possibilities for further study. We conclude by briefly mentioning a few. Some work in this direction has been undertaken in [4].
• We could seek more concrete ways of expressing distributive laws over F op using the (quite special) properties of F op . We could seek "canonical forms" for operations in the composite theory.
• We could study the question of when an algebraic theory can be decomposed into simpler ones, and when it is "irreducible", • We could further study iterated distibutive laws in the context of Lawvere theories.
• We could extend the theory to any of the generalised versions of Lawvere theory.