aa r X i v : . [ m a t h . C T ] D ec Distributive laws for Lawvere theories
Eugenia ChengSchool of Mathematics and Statistics, University of SheffieldE-mail: e.cheng@sheffield.ac.ukDecember 27, 2018
Abstract
Distributive laws give a way of combining two algebraic structures ex-pressed as monads; in this paper we propose a theory of distributive lawsfor combining algebraic structures expressed as Lawvere theories. Wepropose four approaches, involving profunctors, monoidal profunctors, anextension of the free finite-product category 2-monad from
Cat to Prof ,and factorisation systems respectively. We exhibit comparison functorsbetween
CAT and each of these new frameworks to show that the dis-tributive laws between the Lawvere theories correspond in a suitable wayto distributive laws between their associated finitary monads. The differ-ent but equivalent formulations then provide, between them, a frameworkconducive to generalisation, but also an explicit description of the com-posite theories arising from distributive laws.
Contents
Introduction 21 Lawvere theories 42 Distributive laws for monads 73 Monads in profunctors 94 Factorisation systems 155 Monads in monoidal profunctors 216 Monads in a Kleisli bicategory of profunctors 227 Comparison 278 Future work 36 ntroduction Lawvere theories were introduced in [10] and were a great breakthrough in theunderstanding of algebraic theories. They give a different viewpoint from that ofmonads in how they implement the notion of arity. One practical advantage ofLawvere theories over monads highlighted in [7] is that Lawvere theories allow usto study models in different categories, starting from the same Lawvere theory.For example, topological groups and ordinary groups both arise as models forthe Lawvere theory for groups, whereas using monads we have to construct amonad on
Set for groups and a different (albeit related) monad on
Top fortopological groups.Distributive laws give us a way of combining algebraic theories expressed asmonads. The classic example combines the monad for Abelian groups and themonad for monoids (both monads being on
Set ) to yield the monad for ringsas the “composite” algebraic theory: the distributive law makes the compositeof the two monads into a new monad. The theory for combining three or moremonads is developed in [4].It is well-known that Lawvere theories and monads are related—Lawveretheories correspond to finitary monads on
Set . This should not be thought ofas a statement that Lawvere theories are “merely” a special case of monads; theabove comments about models shows one way in which Lawvere theories are ofimportance in their own right.A natural question then arises—is there a notion of distributive law forLawvere theories? Of course, given the above correspondence with finitarymonads on
Set , one could simply say “a distributive law for Lawvere theoriesis a distributive law between the associated finitary monads on
Set .”However, we seek a formulation that is “native” to the framework of Lawveretheories. In this paper we will provide four equivalent formulations at varyinglevels of abstraction. As usual we expect the most abstract one to be moreuseful for theorising, and expect the most concrete one to be more useful forapplications. Thus their equivalence should not be taken to mean that any ofthe definitions is redundant.Our three most abstract formulations will come from observing that Lawveretheories may themselves be thought of as monads inside some other bicategory.Having expressed Lawvere theories in this way it is natural to define distributivelaws for Lawvere theories as distributive laws between the monads in thesebicategories. The bicategories in question are1.
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-monadextended from Cat to Prof .The advantage of (1) is that the bicategory
Prof is well-known and quite easyto understand; however not all monads in here are Lawvere theories even if werestrict to the correct underlying 0-cell.The approach using (2) is in some ways more naturally-arising than (1) andin fact helps us understand it. Also, it is closely related to Lack’s work ondistributive laws for PROPs [9]. 2he 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 thecomposite 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, theresult will follow for (1) and (2).Another advantage of (3) is that although (or because) this bicategory isvery much harder to work with, it affords not only the most precision but alsogreater flexibility. We will see that monads on other 0-cells may be thoughtof as “typed” Lawvere theories, and the setting also opens the possibility forchanging the 2-monad F to study different types of theory; this insight is allgained from Hyland [6].For the most concrete formulation, we unravel (1) and express it in terms offactorisation systems. The notions are equivalent, but the framework feels quitedifferent from the above abstractions and therefore provides different insights.For example, this distributive laws for monads seem suited to considering com-position of monads, whereas factorisation systems seem suited to considering decompositions .Note that it is quite easy to make a wrong definition of distributive law forLawvere 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 thewrong notion, as we will show in Section 4.As evidence that our definitions do give the correct notion, we prove thatall our definitions of distributive law for Lawvere theories correspond suitablyto distributive laws between the associated finitary monads, with the compositeLawvere theories corresponding to the composite monads.
En passant , we shedsome more, abstract, light on the monad/Lawvere theory correspondence.Note that the tensor product of Lawvere theories is a way of combining Law-vere theories that is different from distributive laws. The tensor product of twoLawvere theories always exists, whereas there is not always a distributive law ofa given Lawvere theory over another. It is said that in the tensor product “allthe operations of one theory commute with all the operations of the other” butthis must be understood in a particular sense: given an m -ary operation f ofthe 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 )-aryoperations. This neither implies nor is implied by a distributive law. For exam-ple, the theory of rings is not the tensor product of the theory of Abelian groupsand the theory of monoids; the monad for rings is the composite of the monadfor Abelian groups and the monad for monoids. While this can be thought ofas a type of commutativity between the group operation and the monoid oper-ations, this is in a very different sense from the type of commutativity in thetensor product of Lawvere theories.The paper is organised as follows. In Section 1 we briefly recall the definitionof Lawvere theory and the correspondence with finitary monads on Set . InSection 2 we briefly recall the notion of distributive law between monads inside abicategory. Experts can skip both these sections with impunity. In Sections 3–6we present our four different approaches to distributive laws for Lawvere theoriesand in Section 7 we provide the comparison. We finish in Section 8 with somebrief comments about the possibilities for future work.3 cknowledgements
This work was launched by a question posed to me by Jean B´enabou at the89th PSSL in Louvain-la-Neuve, for which I am grateful. Its progress was thendramatically catalysed by invitations I received to speak at the 4th Scottish Cat-egory Seminar and at “Category Theory, Algebra and Geometry” in Louvain-la-Neuve in May 2011, and I wish to express my thanks to the organisers ofthese events, especially Tom Leinster, Marino Gran and Enrico Vitale.
In this section we recall the basic definitions and results about Lawvere the-ories that we will need in the rest of this paper. Nothing in this section isnew. Lawvere theories were introduced in [10]; we find that [7] gives a usefulexposition.The idea of a Lawvere theory is to encapsulate an algebraic theory as acategory L where • the objects of L are the natural numbers, the “arities”, • a morphism k 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 func-tions 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 (necessarilystrictly associative) finite products, equipped with a strict product-preservingidentity-on-objects functor α L : F op L . A morphism of Lawvere theories from L to L ′ is a functor making theobvious triangle commute; note that such a functor necessarily strictly preservesfinite 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 hereas 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 thefree finite coproduct category on 1, F op is equivalent to the free finite productcategory on 1. Finite products are given by addition of natural numbers, andso a morphism α : k m ∈ F is given by, for each i ∈ [ m ], a choice of projection k
1. Hence α is preciselya function [ m ] [ k ] where we write [ k ] for a set of k elements. (We willsometimes omit the square brackets if confusion is unlikely.)The idea for Lawvere theories is that F op encapsulates the operations thatmust generically exist in any algebraic theory: forgetting and repeating vari-ables. For each m ∈ F op we have: • the i th product projection m m vari-ables except the i th one, and 4 the diagonal 1 m corresponding to repeating a variable m times. Definition 1.3.
The morphisms in L are called operations . Example 1.4.
In the Lawvere theory for monoids, the 2-ary operations, thatis, morphisms 2 1, include the operations ab, a, a , b, b , aba, ab a , . . . that is, everything in the free monoid on a 2-element set. This could be seenas a different notion of arity from the one used to express algebraic theories viaoperads—in the operad for monoids the only 2-ary operation is ab ; it could alsobe seen as a different notion of operation.A morphism 3 2 is given by two 3-ary operations, eg { abc, ab c } , { bc a, ababc } , . . . A typical composite looks like3 { abc,ab c } { x y } abc · abc · ab c .Note that as a result of forgetting variables we have many different possiblearities 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:13456 · · · abc As a 5-ary operation, for example, this might take the variables a, b, c, d, e andreturn the operation abc . Remark 1.5.
There are many natural ways to generalise the notion of Lawveretheory. Here are some examples.1. We could use
FinSet instead of the skeleton F .2. Many-sorted theories: writing F for the 2-monad for strictly associativeproducts on the 2-category Cat of small categories, and observing that F ≃ F op , we could instead use F A for non-terminal categories A to getLawvere theories with sorts given by A .3. Unsorted theories: we could just say that a Lawvere theory is any finite-product category C ; in fact this can be regarded as a special case ofmany-sorted theories in which the sorts are given by the objects of C .4. Enriched theories: we could use enriched categories, and get a notion ofenriched Lawvere theory, and higher-dimensional Lawvere theory; see [13].5. Φ-theories: we could use some other class Φ of limits than finite products,such as small products or finite limits; see [8].5hile Lawvere theories enable us to study, say, the theory of groups as amathematical object in its own right, models for Lawvere theories take us backto individual groups as mathematical objects. Definition 1.6. A model for a Lawvere theory L in a finite-product category C is a finite-product preserving functor L C. A map of models is a natural transformation between them. These form acategory
Mod ( L , C ). Example 1.7.
Let L be the Lawvere theory for monoids, and C = Set . Con-sider 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 L , we get a function A k A. Functoriality and preservation of products ensures that this is precisely a monoidas expected. Putting C = Top gives an underlying space A with multiplicationgiven 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[11]. Proposition 1.8.
Given a monad T on Set we can construct a Lawvere theory L T as the full subcategory of Kl T op whose objects are those of F . Moreover if T is finitary Mod ( L T , Set ) ≃ Alg T. Remark 1.9.
It is worth unravelling this a bit. Recall in Example 1.4 we sawthat the morphisms 2 1 in the Lawvere theory for monoids were given byall the elements of T [2], where T is the free monoid monad and [2] is a 2-elementset.So we see that L T (2 ,
1) =
Set (1 , T [2])= Kl T (1 , Kl T op (2 , . More generally a morphism k m is “ m operations of arity k ” ie L T ( k, m ) = Set ([ m ] , T [ k ])= Kl T ([ m ] , [ k ])= Kl T op ([ k ] , [ m ]) . Note that this has finite products because
Set has coproducts. Now as we haveonly used finite sets, we cannot hope to have captured all the behaviour of ageneral monad on
Set —only the finitary part. Recall that a finitary functoris one that preserves filtered colimits; on
Set this amounts to being entirelydetermined by its action on finite sets as follows.6 roposition 1.10.
Let F be a functor Set Set . Then F is finitary if andonly if F X = [ n ] ∈ FinSet Z F [ n ] × X n . This indicates how we can construct a monad from a Lawvere theory.
Proposition 1.11. (Linton [11]) Given a Lawvere theory L we can constructa finitary monad T L on Set by T L X = [ n ] ∈ FinSet Z L ( n, × X n . This gives us a correspondence between Lawvere theories and finitary monadson
Set . Theorem 1.12.
The constructions T L T and L T L extend to functorsexhibiting Law as a full coreflective subcategory of
Mnd , the category of monadson
Set . Moreover, the essential image of the functor
Law Mnd is given by the finitary monads, that is, the functor becomes an equivalence
Law ≃ Mnd f where Mnd f denotes the full subcategory of finitary monads on Set . This paper can be seen as providing several equivalent definitions of dis-tributive law for Lawvere theory that extend the above correspondence.
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, and2. more generally: an abstract structure giving a way of composing monadsto produce a composite monad inside any bicategory B .In this section we will simply recall the basic definitions. None of the materialin this section is new. We first recall the classical theory of distributive laws. Definition 2.1. (Beck [2])
Let S and T be monads on a category C . A dis-tributive law of S over T consists of a natural transformation λ : ST ⇒ T S such that the following diagrams commute.
ST T ST λη S T T η S S T ST S T S ST T S
Sλ λSµ S T T µ S λ T T SS λSη T η T S ST T ST T SST T S λT T λSµ T µ T Sλ The main theorem about distributive laws tells us about new monads thatarise canonically as a result of the distributive law. In this work we will mostlybe 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 monad ˜ S on Kl( T ) .It follows that T S canonically acquires the structure of a monad, whose categoryof algebras coincides with that of the lifted monad T ′ , and whose Kleisli categorycoincides with that of ˜ S . 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.( a + b )( c + d ) ac + bc + ad + bd. Then the composite monad
T S is the free ring monad.
Example 2.4. (2-categories) C = , the category of 2-globular sets. S = monad for vertical composition of 2-cells (1- and 0-cells are unchanged) T = monad for horizontal composition of 2-cells and 1-cells (0-cells are un-changed) λ is given by the interchange law e.g. ST T S · · ·· · · · · · ·
The main theorem of [4] generalises the notion of distributive law to the casewhen we have more than two monads interacting with each other, as follows.
Theorem 2.5.
Fix n ≥ . Let T , . . . , T n be monads on a category C , equippedwith • for all i > j a distributive law λ ij : T i T j ⇒ T j T i , satisfying for all i > j > k the “Yang-Baxter” equation given by the commutativityof the following diagram T i T j T k T j T i T k T j T k T i T k T j T i T i T k T j T k T i T jλ ij T k T j λ ik λ jk T i T i λ jk λ ik T j T k λ ij (1) Then for all ≤ i < n we have canonical monads T T · · · T i and T i +1 T i +2 · · · T n together with a distributive law of T i +1 T i +2 · · · T n over T T · · · T i i.e. ( T i +1 T i +2 · · · T n )( T T · · · T i ) ⇒ ( T T · · · T i )( T i +1 T i +2 · · · T n ) given by the obvious composites of the λ ij . Moreover, all the induced monadstructures on T T · · · T n are the same. Definition 2.6. A distributive series of n monads is a system of monadsand distributive laws as in Theorem 2.5. Example 2.7.
Rings can be constructed from the following distributive seriesof 3 monads on
Set . A = monad for associative non-unital binary multiplication × B = monad for pointed sets i.e. X X ` { } C = free additive abelian group monad Example 2.8.
Strict n -categories can be constructed from a distributive seriesof n monads on n -globular sets, as a generalisation of the 2-category case. Herethere is a monad T i for each 0 ≤ i ≤ n − n -cells.In his classic paper The formal theory of monads [16] Street defines for any2-category B a 2-category Mnd ( B ) of monads in B . Then distributive laws ariseas 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 various2-categories and in fact bicategories, which can be done by invoking appropriatecoherence conditions and results. In this section we give the most straightforward but perhaps least intuitivedefinition of distributive laws for Lawvere theories. We use the bicategory
Prof of profunctors and simply observe that all Lawvere theories are monads on F op Prof (though not all monads on F op are Lawvere theories); this result andthose leading up to it are standard. We can thus simply look at distributivelaws between these monads. It is not immediately obvious why this should bethe 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. • • a 1-cell C F D is a functor D op × C Set , • C F D G E is by the usual coend formula( G ◦ F )( e, c ) = d ∈ D Z G ( e, d ) × F ( d, c )and is only weakly associative and unital.Profunctors turn out to be the same as bimodules internal to the bicategoryof spans. This fact will be useful to us both technically and conceptually inSection 4. Definition 3.2.
We write
Span for the bicategory of spans given as follows. • • a 1-cell C X D is a span XC D s t • C X D Y E we have Y ◦ XX YDC E
Definition 3.3.
Given any bicategory K and monads X, Y inside it, a (
Y, X )-bimodule A is given by a 1-cell x A y in K equipped with 2-cell actions x x y y X A Yρ λAA satisfying the usual bimodule axioms: λ is compatible with the structure of X , ρ with the structure of Y and λ and ρ with each other.10rovided K has enough structure, bimodules are the 1-cells of a bicategory asfollows. Definition 3.4.
Let K be a bicategory with coequalisers of 2-cells that arepreserved by left and right composition with 1-cells. We write Mod ( K ) for thebicategory of bimodules in K , given as follows. • K , • a 1-cell X A Y is a ( Y, X )-bimodule (note direction). • • Composition of 1-cells is by coequaliser: given X A Y B Z given by 1-cells x X x A y Y y B z Z z we take the coequaliser B ◦ Y ◦ A B ◦ A B ⊗ Y Aρ ◦ AB ◦ λB ⊗ Y A is then the composite ( Z, X )-bimodule required.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. • Span that is, small categories. • Given categories
X, Y with underlying spans X X X s t Y Y Y s t a 1-cell X A Y has underlying span of the form A X Y s t The elements of A can be thought of as arrows with source in X and targetin Y . The left Y -action is a map of spans .A Y X Y Y s t s t A X Y s t A with those of Y ; the mod-ule axioms tell us that this respects composition in Y . Similarly for theleft X -action. The left-right compatibility then gives us associativity forcomposing three arrows ∈ X ∈ A ∈ Y . In [3] B´enabou first defines profunctors (“distributeurs”) directly as functors D op × C Set . He then defines profunctors internal to a bicategory E asbimodules 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 thatcommute. • Write
Span E for the bicategory of spans in E . • Define
Prof E to be the bicategory Mod ( Span E ) op . Thus 0-cells aremonads in Span E , that is, categories internal to E . Remarks 3.7.
1. We need pullbacks to define composition of spans, and we need the co-equaliser 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 pro-functors in E to be a generalisation of basic profunctors in the sense that thenotions coincide in the case E = Set . This is the content of the following propo-sition.
Proposition 3.8.
There is a biequivalence of bicategories
Prof op ≃ Mod ( Span ) . Proof. (Sketch.) First we construct a functor
Prof op Mod ( Span ) . The 0-cells on both sides are small categories, thus we set the action of thefunctor on 0-cells to be the identity.For the action on 1-cells, we start with a profunctor Y F X , that isa 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: a x,y F ( x, y ) X Y s t The left Y - and right X -actions are given by the actions of F on morphisms asfollows. For the Y -action we need a map of spans12 a x,y F ( x, y ) Y X Y Y s t s t a x,y F ( x, y ) X Y . s t An element in the pullback is a pair ( α ∈ F ( x, y ) , f ∈ Y ( y, y ′ )). Now we have F f : F ( x, y ) F ( x, y ′ )so we define the action by ( α, f ) F f ( α ) . The X -action is constructed similarly.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 A Y , that is, a ( Y, X )-bimodule with underlying span A X Y , s t say, we construct a profunctor Y X , that is, a functor X op × Y F Set , by F ( x, y ) = A ( x, y ), that is, the pre-image in A of the pair ( x, y ). Functorialitycomes from the left and right actions. It is routine to check that this gives abiequivalence of bicategories. Remark 3.9.
Note that when we discuss factorisation systems in Section 4it is useful to think in terms of spans, but for the comparison in Section 7 it isuseful 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 fairlyeasy to prove directly, but it is also a special case of the following standardresult.
Theorem 3.10.
Let K be a bicategory, x a 0-cell, and X a monad on x . Thenthere is an equivalence of categories Mon (cid:0) ( Mod K )( X, X ) (cid:1) ≃ X/ Mon (cid:0) K ( x, x ) (cid:1) . Note that here we write
Mon V for the category of monoids in a monoidal cat-egory V , and B ( b, b ) for the monoidal category of 1-cells b b in a bicategory B . Thus on the left hand side we 13. form the bicategory of bimodules in K ,2. take the monoidal category of 1-cells X X in this bicategory, and3. take the category of monoids in this monoidal category.For the right hand side we1. take the monoidal category of 1-cells x x in K ,2. take the category of monoids in this monoidal category, and3. slice this category under X . Corollary 3.11.
A monad in
Mod ( Span ) on X consists of a category A andan identity-on-objects functor X A . Proof. X is a 0-cell of Mod ( Span ) so is a monad in
Span that is, a smallcategory with object set x , say. Now a monad in Mod ( Span ) on X is a monoidin 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 anidentity-on-objects functor X A . Remark 3.13.
It is illuminating to sketch a direct proof of this result. Amonad
X X in Mod ( Span ) is an (
X, X )-bimodule that is also a monad.That is, it has a left and right X -action but also a unit and multiplication ofits own. Note that X is itself a monad in Span , with underlying span X X X say. So for the monad X X we have a span on the same objects as X , say A X X .Essentially • the monad structure makes this into a category A , say, • the left/right X -actions tell us how to map X to A , • 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 .14imilarly 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 usingthe unit and multiplication of the monad to give identities and composition. Toconstruct 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. Corollary 3.14.
Every Lawvere theory F op α A A is a monad on F op in Prof op .Conversely a monad F op in Prof op is a category A equipped with an identity-on-objects functor F op α A A ; it is a Lawvere theory precisely if the category A has finite products and the functor α A preserves them. Remark 3.15.
At this point it might seem that we should have started withthe opposite (dual) definition of
Prof , which is also standard (and equivalent).However, in Section 6 we cannot use that version.Although not every monad on F op in Prof op is a Lawvere theory, given twoLawvere theories expressed in this way, we can define distributive laws betweenthem. Definition 3.16. ( “prof” ) Given Lawvere theories A and B , a distributivelaw of A over B is a distributive law of A over B expressed as monads in Prof op .Iterated distributive laws are defined likewise, as in Theorem 2.5. Proposition 3.17.
The resulting composite monad BA is also a Lawvere the-ory. 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 productsand that functor preserves them. We defer this proof, and further justificationof the definition, until Section 7 (Corollary 7.6), as the comparison proceeds viathe definitions that we will introduce in subsequent sections.In the next section we give a more explicit characterisation of such a dis-tributive law, using the language of factorisation systems. We will use a notion of factorisation system as given by Rosebrugh and Woodin [15], but slightly more general. Some stages of generalisation of notions offactorisation system can be seen as follows:1. Strict factorisation systems on a category C .2. Orthogonal factorisation systems on C .3. Factorisation systems over I where I is a subgroupoid of C [15]; orthogonalfactorisation 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 isnot entirely uniform. There are also many equivalent formulations; a helpfulexposition can be found in [14] 15 efinition 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 everymorphism 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 onlythe identities.2. It follows that L ⊥ R . (That is, every map in L has the unique left liftingproperty against every map in R , and every map in R has the unique rightlifting property against every map in L ; this means that lifts exist and areunique.) Definition 4.3. An orthogonal factorisation system or simply factori-sation system on a category C is a pair ( L, R ) of lluf subcategories of C containing all isomorphisms, such that every morphism of C can be factorisedas a composite l r with l ∈ L and r ∈ R , uniquely up to unique isomorphism. Remarks 4.4. L ∩ R must contain all isomorphisms, so if C contains non-trivial isomor-phisms, a strict factorisation system on it is not an orthogonal factorisationsystem.2. It follows that L ⊥ R and in fact L = ⊥ R = ⋔ R and R = L ⊥ = L ⋔ .Here we write L ⋔ for the collection of maps with the right lifting propertyagainst all those in L , and L ⊥ for the collection of maps with the unique right lifting property against all those in L . Similarly for L = ⊥ R and ⋔ R for left liftings. Examples 4.5.
1. The pair ( { epi } , { mono } ) is an orthogonal factorisation system on Set .2. The pair ( { bijective-on-objects } , { full and faithful } ) is an orthogonal fac-torisation system on Cat .3. The pair ( { bijective-on-objects and full } , { faithful } ) is another orthogonalfactorisation system on Cat .There are many naturally-arising factorisation systems that are not strict, butthe following characterisation by Rosebrugh and Wood [15] makes the strictones of abstract interest.
Theorem 4.6.
Strict factorisation systems are precisely distributive laws in
Span . That is, given a (small) category C , a strict factorisation system ( A, B ) on it is precisely a pair of monads A and B in Span together with a distributivelaw of A over B such that the composite monad BA is the category C . C is a decomposition of C as a monad in Span into a composite BA via adistributive law. Remark 4.7.
It is worth unravelling this a bit. The composite BA is a pull-back. Writing the underlying spans of A and B as A X X and B X X the composite BA is the pullback .A B XX X and is not a priori a category. It consists of pairs of composable morphisms ∈ A ∈ B . The distributive law
AB BA tells us how to re-express a composite ∈ B ∈ A as one in the “canonical form” ∈ A ∈ B . This makes BA into a category as we can now compose its morphisms: a com-posable pair in BA will be a composable quadruple ∈ A −→ ∈ B ∈ A ∈ B and its composite is obtained by using the distributive law to re-express themiddle pair to get a string ∈ A −→ ∈ A ∈ B ∈ B and then composing in A and in B separately to get a morphism in BA .Note that morphisms in BA are uniquely expressible in the form ∈ A ∈ B by construction, as these are precisely the morphisms in the pullback. Example 4.8. (Non-example)
It is instructive to note that this is not thenotion we want for distributive laws of Lawvere theories. Let α : F op A be the Lawvere theory for (multiplicative) monoids and β : F op B
17e the Lawvere theory for (additive) Abelian groups. Thus X = ob F in thespan notation of the previous remark. We will now see that BA does not giveus the composite theory we want, namely, the theory of rings.Consider the 3-ary operation ab + c in the theory of rings. This certainlycan be expressed as a composite ∈ A ∈ B via 3 { ab,c } x + y . However, this factorisation is not unique; for example we could also have3 { ab,c,abc } x + y . where the first operation adds in a redundant operation abc and the second oneforgets it. Now the two are related via a projection in F op making the followingdiagram commute, in the sense that the left-hand triangle commutes in A andthe right-hand triangle commutes in B .33 12 ab, c, abcab, c x + yx + yp , p However the projection is not an isomorphism, so the factorisation is not uniqueup to isomorphism. The lesson is that we only want factorisations to be uniqueup to morphisms in F op somehow—in fact they are only unique up to zigzagsin F op . For example the following two factorisations of the operation a + a cannot be related by a single morphism in F op :31 11 a , a , aa x + yx + 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 } . Thiswill not make the resulting left-hand triangle commute.So in fact we need a zigzag: 31 11 a , a , aa x + yx + x a , a x + yp , p ∆ Remark 4.9.
Here is a useful way of thinking about this example that pointsus in the direction we need. The idea is that our original pullback
BA.A B XX X ignored the fact that F op is in both A and B . So in fact we want a coequaliser B ◦ F op ◦ A B ◦ A B ⊗ F op A where the parallel maps are derived from F op α A , and F op β B respectively. To form this coequaliser we put an equivalence relation on themorphisms of BA ; this is encapsulated in the following definition, which is ageneralisation of the definition of a factorisation system over a groupoid givenin [15]. Definition 4.10.
Let C be a category, J a subcategory with the same objectsas C (lluf). A factorisation system over J on C consists of • a lluf subcategory L of C containing J , and • a lluf subcategory R of C containing J such that every morphism in C can be expressed as ∈ L ∈ R uniquely up to zigzags in J as shown in the following diagram, where the mor-phisms on the left hand half of the diagram are all in L , those on the right areall in R , and the vertical dotted morphisms are in J . The triangles on the leftcommute in L and those on the right commute in R . . ........ ... ∈ L ∈ R xamples 4.11.
1. If J is a groupoid, we get a factorisation system over J as in [15]. (Theauthors stop just short of making this definition although they have all themachinery in place to make it—they have other uses in mind and makethe following construction instead.)2. If J is the groupoid of all isomorphisms in C , we get an orthogonal fac-torisation 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 weakfactorisation system factorisations are unique up to diagonal fillers, or“solutions” of certain lifting problems, but these diagonal fillers are notnecessarily in L or R ; to be a factorisation system over J these fillerswould need to be in J and hence in both L and R . Definition 4.12. ( “fs” ) Let A , B and C be Lawvere theories. Then we say C is a composite of A and B if ( A, B ) forms a factorisation system over F op on C . In this case we say we have a distributive law of A over B . Proposition 4.13.
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 Lawveretheory. As before (for the definition in
Prof op ), we need to check the necessary factsabout finite products. Again we defer this proof until later (Corollary 7.6). Remark 4.14.
Note that the natural way of stating this definition involvedstarting with a category C and “decomposing it” via a factorisation systemover F op , rather than starting with Lawvere theories A and B and “combiningthem” as in other definitions. This different viewpoint could shed light on thequestion of when an algebraic theory can can be expressed as a composite ofsimpler 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 newtensor product ⊗ F op on it, and taken distributive laws with respect to this.This is more elegantly described using bimodules. Proposition 4.15.
A Lawvere theory F op α A is an ( F op , F op ) -bimodule in Span . Then ⊗ F op described above is just bimodule composition. Thus the above defini-tion 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. Theorem 4.16.
Distributive laws as in Definition 4.12 “fs” are equivalent todistributive laws as in Definition 3.16 “prof” .
20e will state this more precisely later in terms of comparison functors, but theidea is that Definition 4.12 “fs” can be taken as an explicit characterisation ofDefinition 3.16 “prof” . Remarks 4.17.
1. This definition generalises the definition of “distributive law with respectto J ” given in [15] although there it is expressed quite differently. J isrequired to be a groupoid in order to yield an equivalence relation onthe morphisms of BA . Effectively, this is to get unique factorisationsup to plain morphisms in J rather than zigzags (see [15, Section 5.4]).In fact the authors do not actually mention factorisation systems overgeneral groupoids—their aim is to give a bicategory in which orthogonalfactorisation systems are distributive laws, so once they have this generalnotion of distributive law in place, they set J to be the groupoid of allisomorphisms for the purposes of the factorisation system.2. Lack discusses a version of this in [9, Sections 4.2, 4.3]. He is mostlyconcerned with PROPs, so only mentions this in passing, and again onlyin the case where J is a groupoid. However, his subsequent sections studydistributive laws in Prof ( Mon ), which is also the subject of our nextsection.
In this section we give an approach that deals a little more explicitly with thefinite products, by taking profunctors in monoidal categories. These are definedusing 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 con-sists of a strict monoidal category A and an identity-on-objects strict monoidalfunctor X A . Proof.
Follows from Theorem 3.10. Put K = Span ( Mon ), and x = ob X , soa monoid in K ( x, x ) in this case is a strict monoidal category with the sameobjects as X . A morphism of such monoids is a strict monoidal identity-on-objects functor. The following result is analogous to Corollary 3.14.
Corollary 5.2.
Every Lawvere theory is a monad in
Prof ( Mon ) op on the 0-cell F op regarded as a monoidal category with respect to product. Converselya monad in Prof ( Mon ) op on the 0-cell F op is a strict monoidal category A equipped with an identity-on-objects, strict monoidal functor F op α A A ; it isa Lawvere theory precisely if the monoidal structure on A is given by finiteproducts. Comparing this situation with that of monads in plain
Prof op we see that themonoidal framework is slightly “better”: monads in Prof ( Mon ) op are slightlycloser to being Lawvere theories in the sense that we only need to check a21ondition on A and the condition on α A is then automatic. In the next section wewill give an even “better” framework in which all the conditions are automatic. Definition 5.3. ( “profmon” ) Given Lawvere theories A and B , a distribu-tive law of A over B is a distributive law of A over B expressed as monads in Prof ( Mon ) op . The iterated version is defined likewise, as in Theorem 2.5. Proposition 5.4.
The resulting composite monad B ⊗ F op A is also a Lawveretheory. Remarks 5.5.
1. An immediate question is whether or not this gives the same thing asdistributive laws in plain
Prof . The perhaps surprising answer is thatthey are indeed the same, as when the monoidal structure is product,natural transformations are automatically monoidal. We will discuss thisin Section 7.2. This approach is closely related to Lack’s approach to distributive lawsfor PROPs in [9]. For PROPs, instead of F we use P , a skeleton of thethe category of finite sets and bijections . The rest of the formalism is thesame.As before, we defer the proof that the composite is a Lawvere theory untilSection 7, but it is instructive to compare the question to the analogous questionin Prof op . There, the issue was both whether the composite had finite productsand whether the identity-on-objects functor preserved them. This time, weknow the identity-on-objects functor must preserve the monoidal structure ofthe composite, so we only need to check that this monoidal structure is givenby finite products.There are (at least) two ways to prove this. A direct hands-on method mightbe possible, but a more abstract approach uses a free finite-product category2-monad. This is the subject of the next section. In this section we follow Hyland and use a bicategory in which monads are pre-cisely Lawvere theories. (This statement allows for types—for untyped Lawveretheories we will restrict to the 0-cell 1.)The idea in [6] 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 theoriesarise as monads in Kl ( S P ). One example is when S is the 2-monad for strictlyassociative 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 distributivelaws for monads. The idea is that the presheaf functor sending a small cate-gory C to [ C op , Set ] is almost a pseudomonad other than size issues, as it isin fact a pseudofunctor
Cat CAT , from small categories to locally smallcategories. The bicategory
Prof is essentially the Kleisli bicategory for thisnot-quite monad. 22yland makes this precise by defining a notion of Kleisli structure on aninclusion of bicategories. The idea builds from the Kleisli formulation of amonad given in [12]. This has the advantage of being applicable even whenstructure is only defined on a subcollection of objects, giving rise to the relativemonads 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 [6].
Proposition 6.1. (Hyland [6])
The presheaf construction P gives a Kleislistructure 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 followingresults.
Proposition 6.2. (Hyland [6])
Let F be the monad for strictly associativeproducts on Cat . This extends to a pseudomonad F P on Prof . By abuse of notation we will also write the extended pseudomonad as F ; thisshould 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 F A where A is any category. Ob-jects in F A are finite strings of objects in A . Since these are to be products,a morphism ( a , . . . , a n ) ( b , . . . b m )is given by • for each index on the right a choice of projection from the left; thatis a function α : [ m ] [ n ], and • for each i ∈ [ m ] a morphism a α ( i ) b i in A .In the proof of Proposition 6.6 we will need the morphisms of F
1. Anobject in this category is a string of natural numbers. We see that in thiscase a morphism ( a , . . . , a n ) ( b , . . . b m )is given by • a function α : [ m ] [ n ], and • for each i ∈ [ m ] a function [ b i ] [ a α ( i ) ].2. Next we give the action of F on morphisms. Given a profunctor F : A B i.e. B op × A Set we need a profunctor F F : P A F B i.e. F B op × F A Set . F F is defined by F F ( b , . . . , b n ; a , . . . , a n ) = a α ∈ Set ( m,n ) Y j ∈ [ m ] F ( b α j , a j )= Y j ∈ [ m ] a i ∈ [ n ] F ( b i , a j )= Y j ∈ [ m ] a i ∈ [ n ] F ( b i , a j ) m
3. Next we give the monad structure. For multiplication we have µ : F F F op × F Set given by µ ( n ; k , . . . , k m ) = F n, k + · · · + k m ) . For the unit we have η : 1 F F op Set given by η ( k ) = F k,
1) =
Set (1 , [ k ]) . Definition 6.4.
From henceforth we shall write
Prof F for the Kl ( F P ), theKleisli bicategory of F extended to Prof .Monads in
Prof F are then many-sorted Lawvere theories; we only need thefollowing special case. Theorem 6.5. (Hyland)
Monads on 1 in
Prof F are precisely un-typed Law-vere theories. Proof. (Sketch.)
A 1-cell
A B in Kl ( F P ) is a profunctor A F B ,i.e. a functor F B op × A Set . So a monad on 1 has an underlying functor cF op × Set , i.e. a functor
FinSet Set or equivalently a finitaryfunctor
Set Set ; the monad structure then makes this into a finitary monadon
Set . In fact we have a more precise result involving an equivalence of categories (The-orem 6.8). Before we prove that, the following proposition provides a functorthat will evaluate a monad in
Prof op F at the corresponding Lawvere theory ex-pressed in Prof op . Recall that the forgetful functor from the Kleisli categoryof any monad to its underlying category is given on morphisms by applying themonad and postcomposing with µ . The following proposition evaluates this for F . Proposition 6.6.
For any profunctor F F , the composite F F F F µ F is given by F op × F Set ( j, n ) Set ( n, F j ) . roof. By definition this composite is( j, l ) ( k ,...,k m ) ∈ F Z µ ( j ; k + · · · + k m ) × F F ( k , . . . , k m ; l )= ( k ,...,k m ) ∈ F Z F j, k + · · · + k m ) × a i ∈ [ m ] F ( k i ) l 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 : I op × I Set Q ( U, U ) Q ( V, U ) .Q ( V, V ) Q ( f, Q (1 , f ) for f : U V in I , if Q (1 , f ) is surjective we can ignore Q ( V, V ) as no furtherinformation is contributed by it.Choose
U, V ∈ F U = ( k + · · · + k m ) = ( k ) , say V = ( k , . . . , k m ) . Note that U is a 1-ary string. We then define f : U V ∈ F a , . . . , a n ) ( b , . . . , b m )in F • a map α : m n in Set , and • for all i ∈ [ m ], a map β i : b i a α ( i ) in Set .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 + · · · + k m ∈ Set and we set these to be the canonical coproduct insertions.Now note that Q ( V, U ) = F j, k + · · · + km ) × a i ∈ [ m ] F ( k i ) l ∼ = Q ( V, V )and moreover the isomorphism is given by Q (1 , f ). So we can disregard allvertices in the coend for which m = 1.25hus the coend becomes k ∈ F Z F j, k ) × (cid:0) F ( k ) (cid:1) l ∼ = Set ( n, F j )as required. Remark 6.7.
Note that this profunctor will be called ¯ F in Section 7 and itwill give us the comparison between the profunctor approach and the monadapproach; 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 andnatural transformations, with the monoidal structure given by composition.
Theorem 6.8.
There is a monoidal equivalence of categories [ Set , Set ] f ≃ Prof op F (1 , . Proof.
Recall that a finitary functor F : Set Set is entirely determined byits restriction to
FinSet , by the formula
F X = [ n ] ∈ FinSet Z F [ n ] × X n . We define a functor [
Set , Set ] f θ Prof op F (1 , F : Set Set we restrict it as F op ≃ FinSet F Set which can be regarded as a profunctor 1 θF F F op FinSet giving the equivalence.) Onmorphisms we also take the restriction of natural transformations to
FinSet .The interesting part is the monoidal structure, which is given by composition.Consider finitary functors
Set F Set G Set . Then the composite θG ◦ θF in Prof F is given by the profunctor composite1 θF F F ( θG ) F µ F F op Set . Now, using the formula for µ and the action of F on morphisms as given inRemarks 6.3 we see that the composite is given by m j ∈ F Z Set ( j, θG ( m )) × θF ( j ) by Proposition 6.6= j ∈ F Z Set ( j, Gm ) × F ( j )= F G ( m ) by standard density= θ ( F G )( m ) 26ull and faithfulness is clear; essential surjectivity of θ follows from the fact thata finitary functor F is determined uniquely up to isomorphism by its restrictionto FinSet . Definition 6.9. “kleisli”
Given Lawvere theories A and B , a distributivelaw of A over B is a distributive law of A over B expressed as monads on 1 in Prof op F via Theorem 6.5. The composite monad BA is automatically a Lawveretheory, and is called the composite Lawvere theory . The iterated version isdefined likewise, as in Theorem 2.5. Note that this is the only case in which it is immediate that the composite monadis a Lawvere theory; however the result for the other definitions will follow. First,we can immediately deduce from the preceding results that these distributivelaws correspond precisely to distributive laws between finitary monads in
Set . Corollary 6.10.
Let S and T be finitary monads on Set with associated Law-vere theories θ ( S ) = L S θ ( T ) = L T expressed as monads on 1 in Prof op F . Let λ : ST T S be a distributive law of S over T . Then θ ( λ ) : θ ( ST ) θ ( T S ) gives a distributive law of L S over L T in Prof op F as θ ( ST ) ∼ = L S L T θ ( T S ) ∼ = L T L S . Furthermore since L T S = θ ( T S ) ∼ = L T L S we see that the composite Lawveretheory is the Lawvere theory associated to the composite monad. Converselysince θ is an equivalence, every distributive law of Lawvere theories arises inthis way. 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 anotion of iterated distributive law for Lawvere theory, as in Definition 2.5. We now have four definitions of distributive law for Lawvere theory in place:1. prof : Distributive laws in
Prof op .2. fs : Factorisation systems over F op .3. profmon : Distributive laws in Prof ( Mon ) op .27. kl : Distributive laws in Prof op F .So far we have shown that • prof and fs are equivalent (Theorem 4.16). • 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. We will havethe following diagram summing up our comparisons[ Set , Set ] f Prof op F (1 , Prof op ( F , F ≃ Prof op ( F op , F op ) Prof ( Mon ) op ( F op , F op ) θ equivalence φ f+f U θ forgetful U ψ forgetful ψ f+f We sum up our strategy (including results we have already proved) as follows.1. We construct a functor φ : [ Set , Set ] f Prof op ( F op , F op )sending finitary monads to their associated Lawvere theories, which is fulland faithful. This will be done in this section.2. This functor factors through Prof ( Mon ) op .[ Set , Set ] f Prof op ( F op , F op ) Prof ( Mon ) op ( F op , F op ) φψ U ψ The factor ψ must therefore also be full, and is obviously faithful. Thusthe forgetful functor U ψ must also be full and faithful on the image of ψ .This shows that prof is equivalent to profmon .3. We have already exhibited a monoidal equivalence θ : [ Set , Set ] f ≃ Prof op F (1 , kl is equivalent to the monad approach (Theorem 6.8 andCorollary 6.10). 28. Proposition 6.6 shows that the canonical Kleisli forgetful functor U θ makesthe following triangle commute (up to isomorphism)[ Set , Set ] f Prof op ( F op , F op ) Prof op F (1 , φθ As the forgetful functor U θ is a 1-object restriction of a pseudo-functor, itmust be monoidal. Thus the functor φ must be monoidal. This completesthe proof that prof is equivalent to the monad approach.5. Since θ is an equivalence and φ is full and faithful, the forgetful functormust also be full and faithful, giving a direct comparison between the kleisli and prof approaches.This will complete the suite of equivalences; it remains to complete the partswe have not already proved.First we define a functor φ : [ Set , Set ] f Prof op ( F op , F op ) F ¯ F : F × F op Set ¯ F ( n, m ) = Set ( m, F n ) α : F G F × F op Set ¯ α ¯ F ¯ G α n : F n Gn ¯ α n,m : ¯ F ( n, m ) ¯ G ( n, m ) Set ( m, F n ) α n ◦ Set ( m, Gn )Later we will show that this is a monoidal functor, but now we concentrate onother properties. Proposition 7.1.
The functor φ is clearly faithful (by Yoneda). It is also full. Note that this result is perhaps surprising. Even if we consider only the monadson each side, we find that monads on the left give a particular kind of monadon the right—those identity-on-objects functors α : F op A where A has finite products and α preserves finite products. Now maps betweenmonads on the left only give maps on the right τ : A A ′ that preserve finite products, but this turns out to be all of them. This is theessential content of the following proof.29 roof. Suppose we have a natural transformation F × F op Set . β ¯ F ¯ G We aim to show that β is in fact of the form ¯ α for some α as above. Now,given any n ∈ F we have β n, : ¯ F ( n,
1) ¯ G ( n, Set (1 , F n ) Set (1 , Gn ) = = F n Gn
Call this α n .We claim1. These α n are the components of a natural transformation α : F G ,and2. β = ¯ α .For the first part we need to check that for all f : n K ∈ F the followingnaturality square commutes F n GnF k Gk α n α k F f Gf
Now by naturality of β we have Set ( F n, F n ) Set ( F n, Gn ) Set ( F n, F k ) Set ( F n, Gk ) α n ◦ α k ◦ F f ◦ Gf ◦ so starting with the identity in the top left we have1 F n α n F f Gf ◦ α n = α k ◦ F f.
Now we need to show that β n,m : ¯ F ( n, m ) ¯ G ( n, m )30s α n ◦ , that is, β n, ◦ . Now given f : m F n and i : 1 m we have Set ( m, F n ) Set ( m, Gn ) Set (1 , F n ) Set (1 , Gn ) β m,n β n, = α n ◦◦ i ◦ i f β m,n ( f ) f ◦ i ( β m,n ( f ))( i ) = ( α n ◦ f )( i ) . 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. Proposition 7.2.
The functor φ : [ Set , Set ] f Prof op ( F op , F op ) factorsthrough Prof ( Mon ) op ( F op , F op ) . 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 F F F t s Now consider a finitary functor F : Set Set . Now the image of F under φ is ¯ F , whose underlying span of ¯ F as an F op -bimodule is A = a m,n Set ( m, F n ) F F The claim is that this is automatically a bimodule in
Mod ( Span ), althoughit is a priori just a bimodule in
Span . So we need to put a monoid structureon A such that the left and right F -actions respect this. Note that the monoidstructure in F is given by addition. So given f : m F n f : m F n we construct a function f ⊕ f : m + m F ( n + n ) . Now by coproduct in
Set we certainly have m + m f + f F n + F n canonical F ( n + n )31nd we call this f ⊕ f . We also need e : 0 F f ⊕ ⊕ f = f. This is the unique map. Then f ⊕ m = m + 0 f +! F n + F F ( n + 0) = F n which is the same as f by a straightforward diagram chase.Now we must check actions. These are given by pre- and post-composition.For the left action, given k f m in Set we have
Set ( m, F n ) ◦ f Set ( k, F n )and we need to check that( g ⊕ g ) ◦ ( f + f ) = ( g ◦ f ) ⊕ ( g ◦ f ) .m m ′ F n m + m m ′ + m ′ F n + F n F ( n + n ) m m ′ F n f g f g f + f g + g The left and right hand sides of the equation we want then just correspond tothe middle dotted composite of this diagram associated either way round, sothe result follows by associativity.For the right action, given n f k in Set we have
Set ( m, F n ) F f ◦ Set ( m, F k )and we need to check that F ( f + f ) ◦ ( g ⊕ g ) = ( F f ◦ g ) ⊕ ( F f ◦ g ) . The result then follows by a straightforward diagram chase involving diagramssimilar to the previous one. This completes the result on objects.32e must now check the result on morphisms, that is, given a natural trans-formation between finitary functors α : F G we must show that ¯ α is amonoid map as a m,n Set ( m, F n ) a m,n Set ( m, Gn ) . So we need to show that given f : m F n f : m F n we have α n + n ◦ ( f ⊕ f ) = ( α n ◦ f ) ⊕ ( α n ◦ f ) . This follows from a straightforward diagram chase and naturality of α . Corollary 7.3.
It follows immediately that [ Set , Set ] f ψ Prof ( Mon ) op ( F op , F op ) is full as well as faithful, and likewise the forgetful functor Prof ( Mon ) op ( F op , F op ) U ψ −→ Prof op ( F op , F op ) is also full and faithful on the image of ψ . Proof.
Follows from φ being full (Proposition 7.1). Corollary 7.4.
1. When F is a monoid in [ Set , Set ] f (i.e. a finitary monad on Set ), ψF is a monad in Prof ( Mon ) op given by an identity-on-objects functor α : F op A where the monoidal structure of A is given by products. Conversely anysuch monad in Prof ( Mon ) op arises in this way.2. When F is a monoid in [ Set , Set ] f , φF is a monad in Prof op given byan identity-on-objects functor α : F op A where A has finite products and α preserves finite products. Converselyany such monad in Prof op arises in this way. Remark 7.5.
Note that this is not much more than the standard correspon-dence between finitary monads and Lawvere theories.
Proof.
Regarding φF = ¯ F as a category, we have ¯ F ( n, m ) = Set ( m, F n ). Weneed to check that n + k is the categorical product in ¯ F , that is, there is anatural isomorphism ¯ F ( p, n ) × ¯ F ( p, k ) ∼ = ¯ F ( p, n + k )33hat is Set ( n, F p ) × Set ( k, F p ) ∼ = Set ( n + k, F p )which is true by definition of coproduct in Set . This proves both parts. Corollary 7.6.
Let A and B be Lawvere theories expressed according to any ofDefinitions 3.16 “ prof ”, 4.12 “ fs ” or 5.3 “ profmon ”, and let σ : AB BA be a distributive law of A over B according to the same definition. Then thecomposite monad BA is also a Lawvere theory. Proof.
For monads in
Prof op we know can write A and B as φS and φT forsome 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 transfor-mation λ : ST T S ; by faithfulness the axioms for λ to be a distributive lawfollow from those for σ . Thus the composite BA is isomorphic to φ ( T S ) thusis 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 furthercharacterisation as we find it illuminating. It is well known that there are twocanonical identity-on-objects pseudofunctors relating
Cat and
Prof . Given afunctor C F D in CAT the two functors act as follows.1. Covariant: C F ∗ D in Prof defined by F ∗ ( d, c ) = D ( d, F c ). This is thecanonical free pseudofunctor if we regard Prof as the Kleisli bicategoryfor the presheaf Kleisli structure.2. Contravariant: D F ∗ C defined by F ∗ ( c, d ) = F ( F c, d ).Thus given a monad
Set T Set we get a monad
Set T ∗ Set in PROF andthis could be regarded as an algebraic theory typed in
Set . However if we havea finitary monad we can restrict our types to the small category F via a chosenembedding F I Set . Then we can define a functor[
Set , Set ] f Prof ( F , F ) Set F Set F I ∗ Set F ∗ Set I ∗ F . The following proposition shows that on monads this gives us the (oppositeof) the associated Lawvere theory.
Proposition 7.7.
The above composite gives the profunctor ( k, n ) Set ( k, F n ) . roof. This is a routine coend calculation, using the fact that F ∗ I ∗ = ( F I ) ∗ :( k, n ) X ∈ Set Z I ∗ ( k, X ) × ( F I ) ∗ ( X, n )= X ∈ Set Z Set ( k, X ) × Set ( X, F n )= Set ( k, F n ) by density.Finally we can regard this as F op F op by taking it to be in Prof op via thestandard duality. Hence we have directly constructed the functor[
Set , Set ] f Prof op ( F op , F op )constructed previously as the composite via Prof F , and this gives another ex-planation of the (slightly annoying) presence of the “op”.Furthermore, that this functor is monoidal follows neatly from the finitaryconditions as follows. We need to check that, given finitary functors Set F Set G Set the composite in
Prof F I ∗ Set F ∗ Set G ∗ Set I ∗ F is isomorphic to F I ∗ Set F ∗ Set I ∗ F I ∗ Set G ∗ Set I ∗ F . In fact G being finitary gives us that Set G ∗ Set I ∗ F is isomorphic to Set I ∗ F I ∗ Set G ∗ Set I ∗ F . We simply calculate the coends. The first gives( k, X ) A ∈ Set Z G ∗ ( A, X ) × I ∗ ( k, A )= A ∈ Set Z Set ( A, GX ) × Set ( k, A )= Set ( k, GX ) by density.For the second composite we have( k, X ) n ∈ F Z Set ( k, Gn ) × Set ( n, X )= Set ( k, GX )as G is finitary. 35 Future work
This new theory of distributive laws for Lawvere theories, with its four differentviewpoints, opens up various possibilities for further study. We conclude bybriefly mentioning a few. • We could seek more concrete ways of expressing distributive laws over F op using the (quite special) properties of F op . We could seek “canonicalforms” for operations in the composite theory. • We could study the question of when an algebraic theory can be decom-posed into simpler ones, and when it is “irreducible”, • We could further study iterated distibutive laws in the context of Lawveretheories. • We could extend the theory to any of the generalised versions of Lawveretheory.
References [1] T. Altenkirch, J. Chapman and T. Uustualu. Monads need not be endo-functors. Ong L. (Eds)
Foundations of Software Science and ComputationalStructures , FoSSaCS 2010. Lecture Notes in Computer Science, vol 6014.Springer, Berlin, Heidelberg. Also E-print .[2] J. Beck. Distributive laws.
Lecture Notes in Mathematics , 80:119–140,1969.[3] J. B´enabou. Les distributeurs.
Universit´e Catholique de Louvain, Institutde Math´ematique Pure et Appliqu´ee , rapport 33, 1973.[4] E. Cheng. Iterated distributive laws.
Mathematical Proceedings of theCambridge Philosophical Society , 150(3):459–487, 2011. Also E-print .[5] E. Cheng, M. Hyland, and J. Power. Pseudo-distributive laws.
ElectronicNotes in Theoretical Computer Science , 83, 2004.[6] M. Hyland. Elements of a theory of algebraic theories.
Theoretical Com-puter Science , 546:132–144, 2014. Also E-print .[7] M. Hyland and J. Power. The category theoretic understanding of universalalgebra: Lawvere theories and monads.
Electronic Notes in TheoreticalComputer Science , 172:437–458, 2007.[8] S. Lack and J. Rosick´y. Notions of Lawvere theory.
Applied Categori-cal Structures , 175(1):243–265, 2011. Special volume celebrating the 70thbirthday of Professor Max Kelly.[9] S. Lack. Composing PROPs.
Theory and Applications of Categories ,13:147–163, 2004. 3610] F. W. Lawvere.
Functional semantics of algebraic theories . PhD the-sis, Columbia University, 1963. Also available as TAC Reprint 5, http://tac.mta.ca/tac/reprints/articles/5/tr5abs.html .[11] F. E. J. Linton. Some aspects of equational theories. In
Proc. Conf. onCategorical Algebra at La Jolla , pages 84–95, 1966.[12] E. Manes.
Algebraic Theories.
Springer, 1976.[13] J. Power. Enriched Lawvere theories.
Theory and Applications of Cate-gories , 6(7):83–93, 1999.[14] E. Riehl, Factorization systems. Preprint available at [15] R. Rosebrugh and R. Wood. Distributive laws and factorization.
J. PureAppl. Algebra , 175:327–353, 2002.[16] R. Street. The formal theory of monads.