Scholarly article on topic 'Pseudo-commutative Monads'

Pseudo-commutative Monads Academic research paper on "Computer and information sciences"

CC BY-NC-ND
0
0
Share paper
Keywords
{}

Abstract of research paper on Computer and information sciences, author of scientific article — Martin Hyland, John Power

Abstract We introduce the notion of pseudo-commutative monad together with that of pseudo-closed 2-category, the leading example being given by the 2-monad on Cat whose 2-category of algebras is the 2-category of small symmetric monoidal categories. We prove that for any pseudo-commutative 2-monad on Cat, its 2-category of algebras is pseudo-closed. We also introduce supplementary definitions and results, and we illustrate this analysis with further examples such as those of small categories with finite products, and examples arising from wiring, interaction, contexts, and the logic of Bunched Implication.

Academic research paper on topic "Pseudo-commutative Monads"

Electronic Notes in Theoretical Computer Science 45 (2001)

URL: http://www.elsevier.nl/locate/entcs/volume45.html 12 pages

Pseudo-commutative Monads

Martin Hyland

Dept of Pure Mathematics and Mathematical Statistics University of Cambridge Wilberforce Road, Cambridge, ENGLAND

and John Power1

Laboratory for the Foundations of Computer Science

University of Edinburgh King's Buildings, Edinburgh EH9 3JZ, SCOTLAND

Abstract

We introduce the notion of pseudo-commutative monad together with that of pseudo-closed 2-category, the leading example being given by the 2-monad on Cat whose 2-category of algebras is the 2-category of small symmetric monoidal categories. We prove that for any pseudo-commutative 2-monad on Cat, its 2-category of algebras is pseudo-closed. We also introduce supplementary definitions and results, and we illustrate this analysis with further examples such as those of small categories with finite products, and examples arising from wiring, interaction, contexts, and the logic of Bunched Implication.

1 Introduction

Symmetric monoidal categories, often with a little extra structure and subject to some extra axioms, such as those required to make symmetric monoidal structure into finite product or finite coproduct structure, play a fundamental foundational role in much of theoretical computer science. For instance, they have long been used to model contexts, typically but not only when in the form of finite product structure (see for instance [4] and, especially relevant here, [5]). They have also long been used to model a parallel operator (see for instance [9]) or interaction [1]. Occasionally, one sees two symmetric monoidal

1 This work is supported by EPSRC grant GR/M56333: The structure of programming languages : syntax and semantics, and a British Council grant and the COE budget of STA Japan.

©2001 Published by Elsevier Science B. V.

structures interacting with each other, for instance in work on linear logic or more recently on Bunched Implication [11]. Several delicate constructions are made using symmetric monoidal structure. For instance, one often considers the free symmetric monoidal category, possibly with additional structure, on 1, and one sometimes sees study of the free symmetric monoidal closed category on a symmetric monoidal category. One also sees constructions on categories possessing a pair of symmetric monoidal structures as in Bunched Implication.

This all motivates us to seek a calculus of symmetric monoidal categories, possibly with a little extra structure subject to mild axioms as illustrated above. By a calculus, we mean a mathematical account of what constructions one can make on symmetric monoidal categories and still obtain a symmetric monoidal category. For instance, it is routine to verify that a product of symmetric monoidal categories is symmetric monoidal. Formally, such a calculus amounts to study of the structure of the 2-category SymMon of small symmetric monoidal categories and strong symmetric monoidal functors. It has long been known that this is an instance of algebraic structure on Cat [2] and therefore has well-behaved limits and bicolimits, in particular products and bicoproducts for example. But is the 2-category SymMon, or at least the variant SymMons of small symmetric monoidal categories and strict symmetric monoidal functors, itself a symmetric monoidal category? And is there an axiomatic proof of such a result that would apply to variants of the notion of small symmetric monoidal category such as that of small category with finite products? Positive answers would substantially increase the range of constructions available for use: for instance, considering the free structure on 1 as for example in [5], implicit is the idea that structure on C, which is isomorphic to Cat(1,C), lifts to structure on the category of structure preserving functors from F(1) to C.

There is good reason to hope that the answers to these questions might be positive. A small symmetric monoidal category is, except for some isomorphisms rather than equalities, a commutative monoid in the category Cat, And the category of commutative monoids, CMon, in Set, is a symmetric monoidal closed category, the reason being that the monad T on Set for which CMon is isomorphic to T-Alg is a commutative monad (the notion of commutative monad appearing in theoretical computer science in work such as that of Moggi on computational effects [10]), and for any commutative monad T, the category T-Alg is symmetric monoidal closed, with the adjunction between T-Alg and Set being a symmetric monoidal adjunction.

In fact, there is a monad T on Cat for which the category T-Alg is iso-morphic to the category of small symmetric monoidal categories and strict symmetric monoidal functors, and that monad has a unique strength. However, that strength is not commutative, the reason being that at precisely one point where one requires an equality, one has an isomorphism. And consequently, SymMons is not symmetric monoidal closed. But the 2-category SymMon does have a structure that is a mild weakening of closed structure,

and we can prove that result axiomatically, with axioms that hold equally of the 2-category of small categories with finite products and of variants. So this paper is devoted to spelling out what that mild 2-categorical generalisation of closed structure is, what the corresponding generalisation of the notion of commutative monad is, and giving the proof that for every pseudo-commutative monad on Cat, the 2-category of algebras and pseudo-maps of algebras is pseudo-closed.

Inevitably, with the complexity of coherence required for our definitions, we must be very sketchy with detail for a short conference paper. But much more detail appears in [6]. A definition provably (with considerable effort) equivalent to one we have here was introduced by Max Kelly in [7], but, as he recognised at the time, his axioms were too complicated to be definitive.

The paper is organised very simply: we define the notions of pseudo-commutativity and symmetry for a pseudo-commutativity, given a 2-monad on Cat, and present our leading example, in Section 2; we define the notion of pseudo-closedness in Section 3; and we outline a proof that T-A/g is pseudo-closed if T has a pseudo-commutativity in Section 4.

2 Pseudo-commutativity for a 2-monad

We refer the reader to [2] for 2-categorical terminology: unfortunately, there is not space to include much of it here. Let T be a 2-monad on Cat, for instance the 2-monad for small symmetric strict monoidal categories. Then T possesses a unique strength

tA,B : A x TB —► T(A x B)

and, by symmetry, a unique costrength

tA,B : TA x B —► T(A x B)

The 2-functorial behaviour of T corresponds to t via commutativity of

[B, A x B]

[A, B] x TA-* T ([A, B ] x A)

[TB, A x TB]

[TB, T(A x B)] [TA, TB] x TA

[TB, t]

Definition 2.1 A pseudo-commutativity for a 2-monad (T, n) is an isomor-

phic modification

TA x TB-* T(A x TB)

T2(A x B)

$ Y A.

T (TA x B) — T2 (A x B )

T (A x B)

such that the following three strength axioms, two n axioms and two ^ axioms hold.

(i) YAxB,C • (tA,B X TC) = tA,BxC • (A X YB,C)

(ii) YA,BxC • (TA X tB,c) = YAxB,C • (t%B X TC)

(iii) YA,BxC • (TA X tB,C) = t*AxB,C • (YA,B x C)

(iv) Ya,B • (nA x TB) is an identity modification

(v) YA,B • (TA X nB) is an identity modification

(vi) ya,B • (pA x TB) is equal to the pasting

T2A TB

T (TA x TB)

T2 (A x TB)

T3(A x B)

^ TYa,

T (T2 A x B)

T2 (TA x B )—r T 3(A x B )

^ Yta,

ßTAxB

TßAxB

ßT (AxB)

T2 (TA x B)

ßTAxB

T (TA x B)

T2 (A x B)

T2(A x B)

T (A x B)

(vii) the dual of the above ^ axiom

There is a little redundancy here, as follows. Proposition 2.2 Any two of the strength axioms implies the third.

If the modification 7 were an identity, T would be a commutative 2-monad [7,8] and the axioms would all be redundant. But in our leading example, where T is the 2-monad on Cat for symmetric strict monoidal categories, 7 is not an identity but rather is determined by a non-trivial symmetry. We shall soon spell out that example in detail, but first we introduce a further symmetry condition on a pseudo-commutativity: we do not use this condition for our main results, but it simplifies analysis of the examples and we believe

it will be useful in practice, for example in relation to Bunched Implication [11], as we shall explain below.

Definition 2.3 A pseudo-commutativity 7 is symmetric when TcA,B • Ya,b • cTB,TA is the inverse of yb,a.

The simplification that this definition allows is given by the following proposition.

Proposition 2.4 An isomorphic modification 7 as above is a symmetric pseudo-commutativity if the symmetry axiom, one strength axiom, one n axiom, and one ^ axiom hold.

Finally, we spell out our leading example in detail. Most of the other examples, which we list afterwards, work similarly.

Example 2.5 Let T be the 2-monad for symmetric strict monoidal categories.

• Given a category A, the category TA has as objects sequences

ai... On

of objects of A (with maps generated by symmetries and the maps of A); the tensor product is concatenation.

• Given two categories A and B, the category TA x TB has as objects pairs

((ai ...a„), (bi... bm))

and the two maps TA x TB —> T(A x B) take such pairs to the sequences of all (aj, bj) ordered according to the two possible lexicographic orderings. In fact

TA x TB T(TA x B) ^ T2 (A x B) ^^ T(A x B) gives the ordering

(ai,bi), (ai,b2),... in which the first coordinate takes precedence, while

TA x TB -L T(TA x B) ^^ T2 (A x B) ^^ T(A x B) gives the ordering

(ai, bi), (a2, bi),... in which the second coordinate takes precedence.

• The component Ya,b of the modification is given by the unique symmetry mediating between the two lexicographic orders.

We now indicate the force of our various axioms as they appear here.

• The strength axioms concern the various lexicographic orderings of the sequences (ai,bj,ck) where again there is just one ai (or bj or ck). Various orderings are identified and as a result there are in each case prima facie two processes for mediating between the orderings: these are equal. So the axioms reflect the fact that there is a unique way to mediate between a pair of orderings.

• The n axioms express the fact that the two lexicographic orderings of the (ai5 bj) are equal if one of n or m is 1.

• The p axioms take more explaining. Take a sequence a1,...,an of sequences a1,...amm(i). Concatenation gives a sequence aj where the order is determined by the precedence (i, j): that is, i takes precedence over j. Take this concatenated sequence together with a sequence b1,..., bp. Then YA,B • (pA x TB) mediates between the order on the (aj ,bk) with precedence (i,j, k) and that with precedence (k, i, j). However we can also use p • T7a>b • t* to mediate between the orders determined by (i, j, k) and (i,k, j), and use p • Tt* • YTA,B to mediate between the orders determined by (i,k,j) and (k,i, j). Composing these two gives the first. So again the axioms reflect the fact that there is a unique way to mediate between a pair of orderings.

• The symmetry axiom just says that if you swap the order twice, you return to where you began.

Further examples of symmetric pseudo-commutative monads, for which we shall not spell out the details, are given by those for

(i) Symmetric monoidal categories.

(ii) Categories with strictly associative finite products. (Categories with strictly associative finite coproducts.)

(iii) Categories with finite products. (Categories with finite coproducts.)

(iv) Categories with an action of a symmetric strictly associative monoidal category.

(v) Symmetric strict monoidal categories with a strict monoidal endofunctor.

(vi) Symmetric monoidal categories with a strong monoidal endofunctor.

These examples are used widely for modelling contexts, or parallelism, or interaction in computer science [1,4,5,9], and one can build combinations as used in [11] or variants. In more detail, finite products are used extensively for modelling contexts, for instance in [4]. A subtle combination of finite products and symmetric monoidal structure is used to model parallelism in [9]. And symmetric monoidal structure is used to model interaction in [1]. And in current research, Plotkin is using a category with an action of a symmetric monoidal category to model call-by-name and call-by-value, along the lines of symmetric premonoidal categories being represented as the action of a symmetric monoidal category on a category [12]. For a non-example of the

symmetry condition, we believe that there is a natural pseudo-commutativity on the 2-monad for braided monoidal categories which is not symmetric.

We can prove that our definition of symmetric pseudo-commutativity implies that adumbrated by Kelly in [7], which tells us

Theorem 2.6 If T is a symmetric pseudo-commutative monad on Cat, then T lifts to a 2-monad on the 2-category SymMon of small symmetric monoidal categories and strong symmetric monoidal functors.

This result seems likely to relate to Bunched Implication [11], where the underlying first order structure involves a symmetric monoidal category, so an object of SymMon, that possesses finite products, so has T-structure for the symmetric pseudo-commutative monad for small categories with finite products. We do not immediately have a more direct relationship with linear logic, as the latter involves a comonad !, and the 2-category of small categories equipped with a comonad is not an example of the 2-category of algebras for a pseudo-commutative 2-monad.

3 Pseudo-closed 2-categories

In this section, we define the notion of a pseudo-closed 2-category.

Definition 3.1 A pseudo-closed 2-category consists of a 2-category K, a 2-functor

[-, -] : Kop x K —

I-J—-- [B, B]

[[A,B], [A, B]]

[A, C ]

[[A, A], [A, C]]

[Ja, [A,C]]

[A, C ]

e[A,c ]

[I, [A, C]]

■kl [[A, C], [A, D]] ^ [[[A, B], [A, C]], [[A, B], [A, D]]]

[kA, [[A,B], [A, D]]]

[[B,C], [B, D]]

[[B,C],kA]

[[B,C], [[A,B], [A, D]]]

[A,B ]—1 [[I, A], [I, B]]

[eA, B]

[[I,A],eB ]

[[I,A],B]

(v) The map

K(A, A) = V[A, A] —^ V[I, [A, A]] = K(I, [A, A])

induced by i\A,A] takes 1A to jA.

We compare this definition with that of closed category in [3], where the theory of enriched categories was introduced. Its primary definition was that of a closed category; it then defined monoidal closed categories and proceeded from there. The only reason more modern accounts start with the notion of monoidal category is because it is first order structure: but the closed structure is typically more primitive.

Given our aims, we ask for 2-categories, 2-functors, and 2-natural or 2-dinatural transformations where [3] drops the prefix 2: there is one significant case of pseudo-naturality. Moreover, as K(—, —) is a 2-functor into Cat, the codomain for V should be Cat rather than Set as in [3].

Allowing for these changes, our five enumerated conditions correspond to Eilenberg and Kelly's five axioms. The fact that e is a retract equivalence

rather than an isomorphism as in [3] is significant. We have no choice if we are to include our leading example: one might hope that the 2-category of small symmetric monoidal categories would have invertible e, but it does not; and because e is not an isomorphism, we do not have the Eilenberg and Kelly versions of conditions 2 and 4 which are expressed in terms of i; and those conditions would fail in our leading example. Moreover i is only pseudo-natural in examples. We note that we are able to give our restricted definition so that T-Alg will be an example where all the structure maps other than iA are strict maps of T-algebras.

This is not the most general possible notion of pseudo-closedness. Even Eilenberg and Kelly could have asked for an isomorphism between V [—, —] and K(—, —): their choice of equality means that a monoidal category subject to the usual adjointness condition need not be closed in their sense. But our examples allow us considerable strictness, so we take advantage of that to provide a relatively simple definition.

On the other hand, it does not contain all axioms that hold of our class of examples either. In particular, our pseudo-natural transformation i and our pseudo-dinatural transformation j satisfy strictness conditions along the lines that, for some specific classes of maps, the isomorphism given by pseudo-naturality is in fact an identity. However, at present, we have no theorems that make use of such facts, and adding them to the definition would complicate rather than simplify it, so we have not introduced them as axioms.

4 Pseudo-closed structure on T-Alg

We consider the 2-category T-Alg of strict T-algebras and pseudo-maps of T-algebras as developed in [2], for a 2-monad T on Cat. We can readily generalise beyond Cat, but this contains the examples of primary interest to us: the 2-category of small symmetric monoidal categories and strong symmetric monoidal functors is an example, as is the category of small categories with finite products and finite product preserving functors, etcetera. We write A = (A, a) for a typical T-algebra. A pseudo-map (f, f) : A —► B is given by data

where the isomorphic 2-cell f satisfies n and p conditions. We often write f = (f, f) : A —► B for such a pseudo-map, the 2-cell usually being understood. Given a pseudo-commutativity for T, we show that for any T-algebras A

and B, the category T-Alg (A, B) has a T-algebra structure defined pointwise, i.e., it inherits a T-algebra structure from the cotensor, i.e., from the functor category [A, B] with pointwise T-structure.

In order to express the definition, we recall two sorts of limits in 2-categories. Given a pair of parallel 2-cells f, g : X —► Y in a 2-category K, the isoinserter of f and g consists of the universal 1-cell i : I —► X and isomorphic 2-cell y : fi ^ gi, universally inserting an isomorphism between f and g. Given parallel 2-cells a, P : f ^ g : X —► Y, the equifier of a and P is the universal 1-cell e : E —► X making ae = Pe.

Proposition 4.1 [2] For any 2-monad T on Cat, the 2-category T-Alg has and the forgetful 2-functor U : T-Alg —► Cat preserves iso-inserters and equifiers.

It is routine to describe iso-inserters and equifiers in Cat by considering their universal properties as they apply to functors with domain 1. With these definitions, we can define the pseudo-closed structure of T-A/g for pseudo-commutative T.

Definition 4.2 Given T-algebras A = (A, a) and B = (B, b), we construct a new T-algebra in three steps.

(i) Take the iso-inserter (i : In —► [A, B], a') of

[A, B]-* [TA, B]

[a, B]

where the underlying 1-cell of aA;B is defined by the composite

[A, B] — [TA, TB] [TA b] [TA, B]

which canonically but not obviously lifts to a map in T-Alg, with 2-cell structure defined by use of y, So we get a universal 2-cell a' : aA;B • i —► [a, B] • i.

(ii) Take the equifier e' : Eq' —► In of [nA, B] • a' with the identity.

(iii) Take the equifier e : Eq —► Eq' of [pA,B] • a' • e' with the following

pasting:

[A, B]

Eq'-- In-- [A, B]

[A, B]

[TA, B]

[T2 A, B]

[Ta, B]

[a,B ]

[TA, B]

Here the final square commutes by naturality of a, and the domains of the 2-cells match easily; for the codomains, one must work a little.

We write the resulting T-algebra [A, B] and call it, equipped with the composite

p = i • e' • e : [A, B] —► [A, B] and the isomorphic 2-cell

a' • e' • e : <ja,b • p

[a, B] • p

the exponential A to B.

Taking the canonical constructions of iso-inserters and equifiers in Cat, it transpires that our final Eq is exactly the category of pseudo-maps from A to B. So the forgetful 2-functor takes [A, B] to T-Alg(A, B). Moreover the following universal property follows directly from the construction.

Proposition 4.3 Given T-algebras A = (A, a) and B = (B, b), the T-algebra [A, B] equipped with

p : [A, B] —► [A, B] and an isomorphic 2-cell a : aA,s • P —> [a, B] • p

satisfies the universal property that for each D, composition with p induces an isomorphism between T-Alg(D, [A, B]) and the category of cones given by data

f : D —► [A, B] and an isomorphic 2-cell P : aA,B • f —> [a, B] • f

satisfying two equification conditions: one for ^, the other for n.

To complete the proof of our main theorem, a delicate notion of multilinear map of T-algebras seems of fundamental importance [6]. But the above is the central point, and, taking the unit to be T1, the free T-algebra on 1, we have

Theorem 4.4 If T is a pseudo-commutative 2-monad on Cat, then T-Alg is

a pseudo-closed 2-category.

References

[1] Abramsky, S., Retracing some paths in process algebra, "Proc. CONCUR 96," Lect. Notes in Computer Science 1119 (1996) 1-17.

[2] Blackwell, R., G.M. Kelly, and A.J. Power, Two-dimensional monad theory, J. Pure Appl. Algebra 59 (1989) 1-41.

[3] Eilenberg, S., and G.M. Kelly, Closed categories, "Proc. Conference on Categorical Algebra (La Jolla 1965)," Springer-Verlag (1966).

[4] Fiore, M., and G.D. Plotkin, An axiomatisation of computationally adequate domain-theoretic models of FPC, Proc. LICS 94 (1994) 92-102.

[5] Fiore, M., G.D. Plotkin, and A.J. Power, Cuboidal sets in axiomatic domain theory, Proc. LICS 97 (1997) 268-279.

[6] Hyland, M., and A.J. Power, Pseudo-commutative monads and pseudo-closed 2-categories, J. Pure Appl. Algebra (to appear).

[7] Kelly, G.M., Coherence theorems for lax algebras and for distributive laws, Lecture Notes in Mathematics 420, Springer-Verlag (1974) 281-375.

[8] Kock, A., Closed categories generated by commutative monads, J. Austral. Math Soc. 12 (1971) 405-424.

[9] Milner, R., Calculi for interaction, Acta Informatica 33 (1996) 707-737.

[10] Moggi, E., Notions of computation and monads, Information and Computation 93 (1991) 55-92.

[11] O'Hearn, P.W., and D.J. Pym, The logic of bunched implications, Bull. Symbolic Logic (to appear)

[12] Power, A.J., and E. P. Robinson, Premonoidal categories and notions of computation, Math. Struct. in Comp. Science 7 (1997) 453-468.