Monoidal categories graded by partial commutative monoids
Effectful categories have two classes of morphisms: pure morphisms, which form a monoidal category; and effectful morphisms, which can only be combined monoidally with central morphisms (such as the pure ones), forming a premonoidal category. This su…
Authors: Matthew Earnshaw, Chad Nester, Mario Román
Submitted to MFPS 2026 Monoidal categories graded b y partial comm utativ e monoids Matthew Earnsha w a Chad Nester a Mario Rom´ an b , c a Institute of Computer Scienc e, University of T artu, Estonia b Dep artment of Softwar e Scienc e, T al linn University of T e chnolo gy, Estonia c Dep artment of Computer Scienc e, University of Oxfor d, Unite d Kingdom Abstract Effectful categories ha v e t wo classes of morphisms: pur e morphisms, whic h form a monoidal category; and effe ctful morphisms, whic h can only b e combined monoidally with central morphisms (suc h as the pure ones), forming a premonoidal category . This suggests seeing morphisms of an effectful category as carrying a gr ade that combines under the monoidal product in a p artial ly define d manner. W e axiomatize this idea with the notion of monoidal c ategory gr ade d by a p artial c ommutative monoid (PCM). Monoidal categories arise as the sp ecial case of grading by the singleton PCM, and effectful categories arise from grading b y a t wo-elemen t PCM. F urther examples include grading by p o werset PCMs, mo delling non-interfering parallelism for programs accessing shared resources, and grading by in terv als, mo delling bounded resource usage. W e show that effectful categories form a coreflective sub category of PCM-graded monoidal categories; introduce cartesian structure, reco vering F reyd categories; and describ e PCM-graded monoidal categories as monoids by viewing a PCM as a thin promonoidal category . Keywor ds: monoidal categories, premonoidal categories, effectful categories, F reyd categories, partial commutativ e monoids 1 In tro duction Effe ctful c ate gories , or gener alize d F r eyd c ate gories , refine monoidal categories in to a structure fit for the seman tics of effectful programming languages [ 19 , 30 , 45 ]. They do this by dividing morphisms b et ween a category of pur e c omputations and a category of effe ctful c omputations , with a functor including the former amongst the latter. Since pure computations are indep enden t of one another, their parallel execution is w ell defined, and is mo delled by a monoidal pro duct. Effectful computations instead form a pr emonoidal c ate gory : since in general they dep end on one another, these morphisms ma y only be combined monoidally with c entr al morphisms 1 , suc h as morphisms in the image of the functor from the category of pure com- putations [ 40 ]. This tw o-part categorization of morphisms suggests taking the p erspective that morphisms in an effectful category ha ve an algebraic gr ading . In the existing literature on gr ade d effe ct systems [ 23 , 32 , 34 , 53 ] and their semantics in gr ade d monads [ 24 , 36 , 39 , 50 ], grades typically combine under se quential c omp osition of morphisms. The grading introduced here is different in tw o resp ects. Firstly , grades com bine only under the monoidal pr o duct of morphisms. The monoidal pro duct of a pure and an effectful computation, for example, should yield an effectful computation. On the other hand, sequentially comp osing t wo pure computations should yield a pure computation, and likewise for effectful computations. Secondly , the combination of grades need only b e 1 Cen tral morphisms in a premonoidal category are those inter changing with all other morphisms. This defines a monoidal product on the category when all morphisms are cen tral. The center of a premonoidal category is monoidal. MFPS 2026 Pro ceedings will app ear in Electronic Notes in Theoretical Informatics and Computer Science Earnsha w, Nester, Rom ´ an p artial ly define d : for example, the monoidal pro duct of tw o effectful computations m ust b e undefined. The central con tribution of this pap er, laid out starting in Section 3 , is the notion of monoidal c ate gory gr ade d by a p artial c ommutative monoid (PCM) , which axiomatizes this idea. In a monoidal category graded b y a PCM, every morphism has a grade, taken from a partial commu- tativ e monoid ( E , ⊕ , 0). Thus they comprise a family of categories { C a } a ∈ E indexed by the grading PCM, and monoidal pro duct op erations of the t yp e ( ⊗ ) a,b : C a ( X ; Y ) × C b ( X ′ ; Y ′ ) → C a ⊕ b ( X ⊗ X ′ ; Y ⊗ Y ′ ) . Crucially , ( ⊗ ) a,b exists only when a ⊕ b is defined in the grading PCM. If w e grade b y the singleton PCM, 1 , we recov er monoidal categories. Effectful categories are isomorphic to monoidal categories graded b y the p o w erset PCM, 2 ∼ = P ( 1 ), in whic h 1 ⊕ 1 is undefined. More generally , w e can consider the p o werset PCM , P ( X ), ov er an arbitrary set X , whose op eration of union is defined only on disjoin t subsets. A monoidal category graded by the p o werset PCM mo dels safe parallelism of programs accessing a set of heap lo cations, file handles or other such devic es in X : their monoidal pro duct exists only when they use disjoin t devices. Grading by an interv al [0 , r ], whic h forms a PCM under b ounde d addition , captures the situation of b ounded b andwidth , where morphisms are graded b y their bandwidth usage, and may use no more than the b ound in p ar al lel . All of these examples, and more, are giv en in more detail in Section 3 . In Section 4 , we establish an isomorphism b et ween the category of effectful categories and the category of 2 -graded monoidal categories, and exhibit the latter as a coreflective sub category of PCM -graded monoidal categories. W e go on to introduce symmetric and cartesian structure on PCM -graded monoidal categories, extending the case of grading by 2 to find an isomorphism b et ween the category of cartesian 2 -graded monoidal categories and the category of F reyd categories. In Section 5 we show that for certain well b eha ved PCMs E , we can assemble the family of categories { C a } a ∈ E of an E -graded monoidal category into a single category in t w o wa ys, which makes sense of the sequen tial comp osition of heterogeneously graded morphisms. Section 6 lays out a more formal p erspective on our cen tral definition, reform ulating PCM -graded monoidal categories as monoids in a monoidal category . The key idea in this reform ulation is to view a PCM as a thin promonoidal category . This is enough structure to obtain a monoidal structure on preshea ves, whic h forms the heart of this reformulation. 1.1 R elate d work Premonoidal categories w ere introduced b y P o wer and Robinson [ 40 ] as a reform ulation of Moggi’s monadic seman tics of effectful programming languages [ 37 ], capturing structure presen t in the Kleisli category of strong monads. F reyd categories, in tro duced by Levy , Po w er and Thieleck e [ 41 , 28 ], extend these with a cartesian base and inclusion functor, providing semantics for effectful call-by-v alue languages. Jeffrey [ 19 ] considered an additional symmetric monoidal category of central computations to mo del con trol-flow graphs. Bonchi, Di Lav ore and Rom´ an [ 3 ] ha ve used the resulting effe ctful triples to define effectful Mealy mac hines. Non-cartesian F reyd categories or effe ctful c ate gories ha ve recently b een applied to the semantics of SSA b y Ghalayini and Krishnasw ami [ 16 ]. A substantial literature studies the syntax and semantics of languages in which programs are equipp ed with grades trac king quantitativ e or qualitative information such as effects, costs, or securit y levels. Key examples include graded monads (Katsumata [ 24 ]; Melli` es [ 36 ]; Orchard, P etricek and Mycroft [ 39 ]), in- dexed monads (Maillard and Melli` es [ 33 ]), parameterized monads (Atk ey [ 1 ]), and graded F reyd categories [ 14 ], where grades combine under sequential comp osition. By contrast, sequen tial comp osition in PCM- graded monoidal categories preserves the grade. Grades instead combine under the monoidal product, and moreo ver gov ern its existence: the monoidal pro duct is defined only when the sum of the grades is de- fined in the grading PCM . This mak es PCM -graded monoidal categories w ell suited to mo delling am bien t resources suc h as memory lo cations or bandwidth, rather than sequentially accumulating information. PCMs , esp ecially qua sep ar ation and effe ct algebr as , are widely used to mo del shared resources or ghost state in program logics and v erification [ 9 , 25 , 20 , 31 ]. Undefinedness typically mo dels disjointness , as in Reynolds’ separation logic [ 44 , 6 , 43 , 21 ], with heaps pro viding the paradigmatic example. 2 Earnsha w, Nester, Rom ´ an P artial monoidal categories hav e b een defined in the literature on categorical quantum mec hanics (Co- ec ke and Lau [ 7 ]). These restrict the monoidal pro duct to a full sub category of the pro duct category , mo delling space-like separation of resources. Hefford and Kissinger [ 17 ] relate these to promonoidal cate- gories, sho wing they generally differ but agree in sp ecial cases. In our notion, ob jects form a monoid and so alwa ys ha v e a monoidal pro duct, and the monoidal pro duct of morphisms is controlled by the grading. Sarkis and Zanasi [ 48 ] study monoidal categories graded by a symmetric semicartesian strict monoidal category . Unlik e in our notion, these grades com bine totally , and by the same op eration, under b oth sequen tial and monoidal comp osition. In prior work [ 12 ], we sho wed that ev ery effectful category has an underlying signature which is effec- tiv ely “graded by” a p o werset, with a left adjoint that constructs free effectful categories. This relies on a w eak notion of signature morphism; its connection to the presen t work remains to be clarified further. Heunen and Sigal [ 18 ] defined enriched F reyd categories ov er a duoidal category V . In Section 6 , w e sho w that PCM-graded monoidal categories can b e captured as an instance of this definition, where V is the category of preshea ves on a promonoidal category enco ding the PCM. 2 P artial commutativ e monoids This section introduces PCMs and some basic prop ositions on them. Readers may wish to start at Section 3 , consulting this section as a reference. T o av oid proliferation of side-conditions on definedness when working with PCMs , it is helpful to in tro duce the follo wing “Kleene equalit y” notation. Definition 2.1 F or partial functions f , g : A B , we write f ( a ) ≃ g ( a ) to denote that if either side is defined then b oth are, and they are equal. W e write f ( a ) g ( a ) to denote that if the left-hand side is defined, then so is the righ t, and they are equal. W e write f ( a ) ↑ to denote that f is undefined at a . Definition 2.2 A p artial c ommutative monoid ( E , ⊕ , 0) is a set E , a partial function ⊕ : E × E E and an elemen t 0 ∈ E satisfying a ⊕ b ≃ b ⊕ a, a ⊕ 0 = a = 0 ⊕ a, ( a ⊕ b ) ⊕ c ≃ a ⊕ ( b ⊕ c ) . In view of asso ciativit y , we may unambiguously write a ⊕ b ⊕ c . W e write a ⊥ b (“ a is ortho gonal to b ”) when a ⊕ b is defined; conv ersely , we write a ⊬ b when a ⊕ b is undefined. Of course, a comm utative monoid is a PCM , and w e shall consider some total examples in the following. Definition 2.3 A homomorphism of p artial c ommutative monoids is a (total) function f : E → E ′ satisfying f (0 E ) = 0 E ′ and f ( a ⊕ b ) f ( a ) ⊕ f ( b ) . PCMs and their homomorphisms form a category , PCM . Every PCM gives rise to a canonical preorder, whic h we will use extensiv ely in the following. Definition 2.4 The extension pr e or der ( E , ⩽ ) on the elements of a partial commutati v e monoid ( E , ⊕ , 0) is the preorder defined b y a ⩽ b if and only if there exists c such that a ⊕ c = b. Lemma 2.5 F or every element b of a PCM ( E , ⊕ , 0) , the op er ations ( − ⊕ b ) ar e monoton i c with r esp e ct to the extension pr e or der : x ⩽ y and y ⊥ b implies x ⊥ b and x ⊕ b ⩽ y ⊕ b . Pro of. Since x ⩽ y we hav e ∃ c , x ⊕ c = y by definition. Let b b e an elemen t of E and y ⊥ b . Then y ⊕ b = ( x ⊕ c ) ⊕ b = ( x ⊕ b ) ⊕ c , applying asso ciativit y t wice and commutativit y . That is, x ⊕ b ⩽ y ⊕ b . 2 Often w e shall ha ve a ⩽ b just when a is a “less capacious” grade than b , that is, b “extends” a . Clearly , 0 is a least element in the extension preorder . PCMs with a top elemen t in their extension preorder , such as effe ct algebr as , feature prominen tly in the following. Let us no w introduce a few examples of PCMs . Example 2.6 The PCM 1 is the singleton w i th the unique total op eration. 3 Earnsha w, Nester, Rom ´ an Example 2.7 The PCM 2 has tw o elements (0 and 1) with partial op eration, 0 ⊕ 0 = 0 0 ⊕ 1 = 1 ⊕ 0 = 1 1 ⊬ 1 . The PCM 2 is isomorphic to the p o werset PCM of 1 , defined as follo ws. Example 2.8 The p o werset of a set, P ( X ), has a partial comm utative monoid structure ( ⊎ , ∅ ) defined b y taking the union of subsets only when they are disjoin t S ⊎ T := S ∪ T if S ∩ T = ∅ ↑ otherwise . Definition 2.9 Given a family of PCMs { ( A i , ⊕ i , 0 i ) } i ∈ I , their pro duct has carrier Q i ∈ I A i and op eration ( a i ) i ∈ I ⊕ ( b i ) i ∈ I := ( a i ⊕ i b i ) i ∈ I if a i ⊥ b i for all i ∈ I , ↑ otherwise, with unit (0 i ) i ∈ I . Sep ar ation algebr as and effe ct algebr as are PCMs with extra prop erties/structure making them partic- ularly w ell b eha v ed as gradings. Definition 2.10 (Calcagno, O’Hearn, Y ang [ 6 ]) A sep ar ation algebr a is a PCM that is cancellativ e: if a ⊕ c = b ⊕ c then a = b . Definition 2.11 (F oulis and Bennett [ 13 ]) An effe ct algebr a is a PCM ( E , ⊕ , 0) equipp ed with a unary op eration ( − ) ⊥ : E → E , such that a ⊥ is the unique elemen t suc h that a ⊕ a ⊥ = 1, where 1 := 0 ⊥ . P ow erset PCMs are separation algebras, for example. It follo ws that an elemen t c witnessing a ⩽ b in the extension preorder of a separation algebra is unique . This moreo ver implies that the extension preorder of a separation algebra is a p oset . Every effect algebra is a separation algebra [ 13 , Theorem 2.5]. In the extension preorder of an effect algebra , 1 is the top element , as witnessed by x ⊕ x ⊥ = 1. The archet ypical effect algebras are intervals (see Example 3.10 ). 3 Monoidal categories graded b y partial comm utative monoids In this section w e introduce our central definition, its basic prop erties, and several examples. W e shall refer to elemen ts of PCMs as gr ades . Partiality of their op eration will corresp ond to partial definedness of monoidal pro ducts. Commutativity will corresp ond to the fact that the grade of a monoidal pro duct do es not c hange if the factors are sw app ed. Definition 3.1 F or a partial commutativ e monoid ( E , ⊕ , 0), an E -gr ade d monoidal c ate gory consists of • a monoid of ob jects, ( C ob j , ⊗ , I ), • for eac h grade, a ∈ E , a category C a with set of ob jects C ob j , with comp osition denoted by ( # ) a : C a ( X ; Y ) × C a ( Y ; Z ) → C a ( X ; Z ) , and iden tities at grade 0 denoted id X , • for eac h a ⩽ b in the extension preorder an iden tit y-on-ob jects regrading functor ( − ) b a : C a → C b , allo wing us to denote identities at grade a b y (id X ) a 0 , and • monoidal pro duct op erations for ev ery pair of grades a and b such that a ⊥ b ( ⊗ ) a,b : C a ( X ; Y ) × C b ( X ′ ; Y ′ ) → C a ⊕ b ( X ⊗ X ′ ; Y ⊗ Y ′ ) . 4 Earnsha w, Nester, Rom ´ an These are sub ject to the follo wing axioms, whenev er well typed (and parametric in the omitted subscripts), (Reg-A ct) f a a = f and ( f b a ) c b = f c a , for f ∈ C a (Reg- ⊗ ) ( f ⊗ g ) c ⊕ d a ⊕ b = f c a ⊗ g d b , for f ∈ C a , g ∈ C b , ( ⊗ -U-A) f ⊗ id I = f = id I ⊗ f and ( f ⊗ g ) ⊗ h = f ⊗ ( g ⊗ h ) ( ⊗ -ID) id X ⊗ id Y = id X ⊗ Y (Inter) ( f ⊗ g ) # ( h ⊗ k ) = ( f # h ) ⊗ ( g # k ) whenever f ∈ C a ( X ; Y ), h ∈ C a ( Y ; Z ), g ∈ C b ( X ′ ; Y ′ ), and k ∈ C b ( Y ′ ; Z ′ ). The crucial p oin t of Definition 3.1 is that ⊗ a,b only exists when a ⊥ b : the PCM structure on grades con trols our abilit y to tak e the monoidal pro duct of morphisms. The data of a PCM -graded category can b e formulated in terms of a monoid in a monoidal category of lax monoidal functors, as in Section 6 . W e can show that regradings are given by monoidal pro ducts with the iden tit y on I in some grade. Prop osition 3.2 L et f ∈ C a b e a morphism in an E -gr ade d monoidal c ate gory , wher e a ⩽ b . Then f b a = f ⊗ (id I ) c 0 , for every c witnessing a ⩽ b . Pro of. f ⊗ (id I ) c 0 (Reg-Act) = f a a ⊗ (id I ) c 0 (Reg- ⊗ ) = ( f ⊗ id I ) a ⊕ c a ( ⊗ -U-A) = f b a . 2 When E is a separation algebra , the witnesses of a ⩽ b are necessarily unique. Moreov er, when E is an effect algebra , not only do we ha ve regrading functors ( − ) 1 a for every grade a , their b eha viour is giv en b y monoidal pro duct with the iden tit y on I at the grade a ⊥ , i.e. f 1 a = f ⊗ (id I ) a ⊥ 0 . Bew are of r e d herrings [ 38 ]: PCM -graded monoidal categories are not, in general, monoidal categories equipp ed with extra stuff, structure, or prop erties. How ev er, we do ha ve the following. Lemma 3.3 L et ( C , ⊗ , I ) b e an E -gr ade d monoidal c ate gory , and let e b e an idemp otent in E . Then the c ate gory C e is a strict monoidal c ate gory with monoidal pr o duct ⊗ e,e and unit I . Pro of. If e = e ⊕ e is an idemp oten t, e ⊥ e and so the monoidal pro duct op eration ( ⊗ ) e,e has the t yp e required of a strict monoidal structure , C e ( X ; Y ) × C e ( X ′ ; Y ′ ) → C e ( X ⊗ X ′ ; Y ⊗ Y ′ ). The axioms that these m ust satisfy (Definition A.1 ) are exactly giv en by ⊗ -U-A , ⊗ -ID and Inter of Definition 3.1 . 2 Corollary 3.4 F or every ( E , ⊕ , 0) -gr ade d monoidal c ate gory , the c ate gory C 0 at the identity of E is a monoidal c ate gory . The PCM 1 (Example 2.6 ) therefore pro vides our first example, whic h provides a sanity chec k for the definition of E -graded monoidal category . Example 3.5 A 1 -graded monoidal category is precisely a strict monoidal category . Lemma 3.6 L et C b e an E -gr ade d monoidal c ate gory and a ∈ E b e a gr ade. Then the c ate gory C a is a strict pr emonoidal c ate gory with A ⋉ B = A ⋊ B := A ⊗ B and whiskering functors ( A ⋉ − ) := (id A ⊗ 0 ,a − ) : C a ( X ; Y ) → C a ( A ⊗ X ; A ⊗ Y ) ( − ⋊ A ) := ( − ⊗ a, 0 id A ) : C a ( X ; Y ) → C a ( X ⊗ A ; Y ⊗ A ) . Pro of. The whiskering functors are defined since 0 ⊕ a = a = a ⊕ 0 b y the unit la ws of PCMs . That they satisfy the laws of strict premonoidal categories (Definition A.6 ) follo ws straightforw ardly from the axioms ⊗ -U-A , ⊗ -ID , and Inter . 2 Via this lemma, the PCM 2 (Example 2.7 ) supplies our first non-trivial example. Example 3.7 A 2 -graded monoidal category comprises tw o categories C 0 and C 1 , and a non-trivial regrading functor ( − ) 1 0 : C 0 → C 1 . By Lemmas 3.3 and 3.6 , we hav e that C 0 is monoidal and C 1 is premonoidal. As we shall see in Prop osition 4.2 , the regrading functor is moreo ver premonoidal and has image in the center of C 1 , and so a 2 -graded monoidal category is precisely an effectful category , also kno wn as a gener alize d F r eyd c ate gory [ 15 , 30 , 42 , 47 ]. W e in vestigate this case in more detail in Section 4 . Since 2 ∼ = P ( 1 ), Example 3.7 is a “coarse grained” instance of grading b y arbitrary p o w erset PCMs . 5 Earnsha w, Nester, Rom ´ an Example 3.8 Recall the p o w erset separation algebra ( P ( D ) , ⊎ , ∅ ) from Example 2.8 . In a P ( D )-graded monoidal category C , morphisms are graded b y subsets of a set D , and the monoidal pro duct of morphisms f ∈ C S and g ∈ C T is defined if and only if the intersection S ∩ T is empty . This could mo del programs that use subsets of a giv en set D of devic es , whic h ma y b e though t of as resources corresp onding to definite noun phrases, suc h as “ the database” or “ the lo c k x ”. The monoidal pro duct of tw o programs that share a device is not defined; it is defined just when they use disjoin t sets of devices. Sequential comp osition of programs that use the same set of devices again yields a program using that set. This notion of devic e was introduced in our prior work [ 10 , 12 ], where we show ed that every effectful category has an underlying effe ctful signatur e – in the context of the present pap er we migh t call this informally a “ P ( D )-graded signature”. Example 3.9 Consider the PCM RW := ( P ( L ) 2 , ⊕ , ( ∅ , ∅ )) where L is a set and where ( R 1 , W 1 ) ⊕ ( R 2 , W 2 ) := ( R 1 ∪ R 2 , W 1 ∪ W 2 ) if W 1 ∩ ( R 2 ∪ W 2 ) = ∅ = W 2 ∩ ( R 1 ∪ W 1 ) ↑ otherwise . A morphism in an RW -graded monoidal category with grade ( R, W ) could mo del a program whic h may read a set of memory lo cations R ⊆ L and write a set of memory lo cations W ⊆ L . The side conditions for ⊕ enforce non-interference: read-read ov erlap is allo w ed, but an y ov erlap inv olving a write is forbidden, so parallel comp osition is defined exactly for race-free pairs of morphisms. Example 3.10 F or a c hoice of r ⩾ 0, the real interv al ([0 , r ] , ∔ , 0) is an effect algebra with the op eration of b ounded addition, x ∔ y := x + y if x + y ⩽ r ↑ otherwise x ⊥ := r − x In an [0 , r ]- graded monoidal category C , morphisms are graded by real n umbers in the interv al [0 , r ], and the monoidal pro duct of morphisms f ∈ C x and g ∈ C y is defined if and only if x + y ⩽ r . These grades migh t mark the amoun t of some finite resource, whose total amount is r , used by that morphism. F or example, this could mo del programs that use some amount of a fixed bandwidth or pro cessor capacity . The monoidal pro duct exists only so long as together they do not exceed the b ound r , in which case the amoun t of the resource used b y the monoidal pro duct is the sum of that used by the factors. The sequen tial comp osition of tw o programs using the same amount of the resource again uses that same amount. Example 3.11 W e can refine Example 3.8 by taking a pro duct of interv als as follows. Consider a set D equipp ed with a function b : D → R , thought of as sp ecifying the maxim um av ailable quan tit y of each elemen t of D . Consider the family of interv al PCMs { ([0 , b ( d )] , ∔ , 0) } d ∈ D , and let [0 , b ] denote the pro duct of this family , as in Definition 2.9 . A [0 , b ]-graded monoidal category is one in which every morphism ma y use a certain amoun t of each device, up to the b ound sp ecified by b . The monoidal pro duct is defined, and has grade given by the p oin t wise sum of the quantities, only when this do es not exceed the b ound for any d . This is a quan titative refinemen t of Example 3.8 . In that example, a device w as either present or not, without m ultiplicity , and the monoidal pro duct of tw o morphisms sharing a device was necessarily undefined. Example 3.12 Let ( N , max , 0) denote the total monoid of natural num b ers with the maxim um op eration. Morphisms in a ( N , max , 0)-graded monoidal category are graded by natural n um b ers, the monoidal pro d- uct exists for every pair of morphisms, and the grade of a monoidal pro duct is the maximum of the grades of the factors. It is tempting to interpret these grades as marking the running time of a morphism, but for this to b e the case, grades should sum under sequential comp osition, whic h they do not. How ever, we can interpret these grades as marking, for example, the maximum time of an atomic step in the execution of a program. The sequential comp osition of programs, each ha ving maximum time of an atomic step n , again has maximum time of an atomic step n . In Section 5 , and Example 5.5 in particular, we sho w how to build a category from an ( N , max , 0)-graded monoidal category in whic h we can interpret the idea of grades summing under sequen tial c omposition. Example 3.13 Let ( N , + , 0) denote the total monoid of natural num b ers with addition. Morphisms in a ( N , + , 0)-graded monoidal category are graded by a natural num b er, the monoidal pro duct exists for ev ery 6 Earnsha w, Nester, Rom ´ an pair of morphisms, and the grade of a monoidal product is the sum of the grades of the factors. W e migh t in terpret these grades as measuring how muc h of some reusable ambien t resource a program has access to, where running programs in parallel uses disjoint resources (and hence has grade given b y the sum of the factors), but running programs sequen tially uses the same resource p o ol (and so the grades must match, and do not accum ulate). An example of suc h a resource might be auxiliary memory cells. Example 3.14 Let ( S, ∨ , ⊥ ) b e a join semilattice, which might for example mo del clearance or security lev els, with the join of tw o lev els b eing the least lev el ab o ve its factors. Since ( S, ∨ , ⊥ ) is also a total monoid, we can consider an ( S, ∨ , ⊥ )-graded monoidal category C . A morphism f ∈ C ℓ 1 where 1 ∈ S , migh t mo del the fact that one needs clearance lev el 1 to run the program f . Then given g ∈ C ℓ 2 , the grade of the monoidal pro duct f ⊗ g , which is alwa ys defined, is given by 1 ∨ 2 , indicating the clearance required to run f and g in parallel. In the follo wing section, we shall need the category of PCM -graded monoidal categories. Definition 3.15 A morphism of PCM -graded monoidal categories ( M , φ ) : ( C , E ) → ( D , F ) comprises • a monoid homomorphism M : ( C ob j , ⊗ C , I C ) → ( D ob j , ⊗ D , I D ) • a homomorphism of partial comm utative monoids φ : ( E , ⊕ E , 0 E ) → ( F , ⊕ F , 0 F ), • for ev ery e ∈ E , a functor M e : C e → D ϕ ( e ) with action M on ob jects. These m ust satisfy the axioms enforcing preserv ation of monoidal products and regradings • M e ⊕ e ′ ( g ⊗ h ) = M e ( g ) ⊗ M e ′ ( h ), whenev er g ∈ C e and h ∈ C e ′ ha ve orthogonal grades e ⊥ e ′ , and • M f ( g f e ) = M e ( g ) ϕ ( f ) ϕ ( e ) . Prop osition 3.16 Ther e is a functor ( − ) - GradMon : PCM op → Cat , taking a PCM E to the c ate gory of E -gr ade d monoidal c ate gories and morphisms b etwe en them. Pro of. Let E be a PCM . Then E - GradMon has ob jects E -graded monoidal categories, and morphisms (Definition 3.15 ) of the form ( M , id E ). Define ( M , id E ) ◦ ( N , id E ) to hav e monoid homomorphism M ◦ N , morphism of PCMs id E , and functors ( M ◦ N ) e := M e ◦ N e . This is unital with identities (id C , id E ). Let φ : E → F b e a morphism of PCMs . Define a functor φ ∗ : F - GradMon → E - GradMon on ob jects b y sending an F -graded monoidal category C to one having the same ob jects, and φ ∗ C e ( X ; Y ) := C ϕ ( e ) ( X ; Y ). Since φ is a morphism of PCMs , e ⊥ e ′ implies φ ( e ) ⊥ φ ( e ′ ), and so monoidal pro ducts as w ell as sequen tial comp osition can b e defined by those in C . On a morphism ( P , id F ) : ( C , F ) → ( D , F ) in F - GradMon , φ ∗ ( P ) := ( P , id E ) with lo cal functors P e : φ ∗ ( C ) e → φ ∗ ( D ) e b eing P e : C ϕ ( e ) → D ϕ ( e ) from the definition of P , whic h assignment is clearly functorial. 2 Definition 3.17 GradMon is the total category of the corresp onding split fibration ov er PCM induced by Prop osition 3.16 . F or a PCM E , the category E - GradMon is a sub category of GradMon , the fibre o ver E . 4 Effectful categories are 2-graded monoidal categories This section lays out in detail the isomorphism b et ween effectful categories and 2 -graded monoidal cate- gories (Prop osition 4.2 ), preview ed in Example 3.7 , establishing a new p ersp ectiv e on a well established structure in the semantics of programming languages. W e also sho w that if E has a top element, for ex- ample, when it is an effect algebra , then E -graded monoidal categories can b e functorially “squashed” into 2 -graded monoidal categories, and this is a coreflector (Theorem 4.4 ). W e then introduce symmetric and cartesian structure for graded monoidal categories, and sho w that cartesian 2 -graded monoidal categories are isomorphic to F reyd categories. Lemma 4.1 L et C b e an E -gr ade d monoidal c ate gory , and let f ∈ C 0 ( X ; Y ) and g ∈ C a ( X ′ ; Y ′ ) . Then f and g inter change in C a : ( f a 0 ⊗ id X ′ ) # (id Y ⊗ g ) = (id X ⊗ g ) # ( f a 0 ⊗ id Y ′ ) = f ⊗ g , and similarly for g ⊗ f . Pro of. See Section B.1 . 2 Prop osition 4.2 The c ate gory 2 - GradMon is isomorphic to the c ate gory Eff of strict effe ctful c ate gories and effe ctful functors. 7 Earnsha w, Nester, Rom ´ an Pro of. W e define a functor F : 2 - GradMon → Eff . Let C b e a 2 -graded monoidal category . W e claim that F ( C ) := ( C 0 , C 1 , ( − ) 1 0 : C 0 → C 1 ) is an effectful category . W e already hav e that C 0 is a monoidal category b y Corollary 3.4 , and C 1 is a premonoidal category by Lemma 3.6 . The axioms Reg-Act and Reg- ⊗ en tail that the regrading functor ( − ) 1 0 preserv es whiskerings, thus we hav e an identit y-on-ob jects strict premonoidal functor ( − ) 1 0 : C 0 → C 1 . That the image of this functor is cen tral follows from unfolding the definition of ⋉ and ⋊ and applying Lemma 4.1 with a = 1. F or the action on morphisms, recall that a morphism ( M , id 2 ) : C → D in 2 - GradMon comprises a monoid homomorphism M : ( C ob j , ⊗ C , I C ) → ( D ob j , ⊗ D , I D ) and functors M 0 : C 0 → D 0 , M 1 : C 1 → D 1 with action on ob jects giv en by M , satisfying compatibility with monoidal pro duct and regradings. Since 0 ⊥ 0 and the functors M e are monoid homomorphisms on ob jects, the monoidal pro duct axiom giv es us that M 0 is a strict monoidal functor , and similarly that M 1 preserv es whiskerings and hence is a strict premonoidal functor . Finally , the regrading axiom is precisely the condition that these commute with the effectful categories F ( C ) and F ( D ). Con versely , let ( V , C , η ) b e an effectful category . W e define a 2 -graded monoidal category G ( V , C , η ) b y setting G ( V , C , η ) 0 = V and G ( V , C , η ) 1 = C , with only non-trivial regrading functor giv en by ( − ) 1 0 := η : V → C . The monoidal pro duct ( ⊗ ) 0 , 0 is the tensor of V . F or f ∈ V ( X ; Y ) and g ∈ C ( X ′ ; Y ′ ), define f ⊗ 0 , 1 g := ( η ( f ) ⋊ X ′ ) # ( Y ⋉ g ) . The axioms Reg-A ct are immediate. F or Reg- ⊗ , the only non-trivial cases are those inv olving the regrading η ; for f ∈ V ( X ; Y ) and g ∈ V ( X ′ ; Y ′ ) w e hav e ( f ⊗ g ) 1 0 := η ( f ⊗ g ) = η (( f ⊗ id X ′ ) # (id Y ⊗ g )) ( V mon. cat) = η ( f ⊗ id X ′ ) # η (id Y ⊗ g ) ( η func.) = ( η ( f ) ⋊ X ′ ) # ( Y ⋉ η ( g )) ( η premon. cat) =: f ⊗ 0 , 1 η ( g ) , and similarly η ( f ⊗ g ) = η ( f ) ⊗ 1 , 0 g . The axioms ⊗ - U-A and ⊗ - ID follow from the strict premonoidal axioms in C together with preserv ation of iden tities by η . F or Inter , the grade 0 case is in terc hange in V . F or the mixed case, let f , h ∈ V and g , k ∈ C b e comp osable. Then ( f ⊗ 0 , 1 g ) # ( h ⊗ 0 , 1 k ) := ( η ( f ) ⋊ X ′ ) # ( Y ⋉ g ) # ( η ( h ) ⋊ Y ′ ) # ( Z ⋉ k ) = ( η ( f ) ⋊ X ′ ) # ( η ( h ) ⋊ X ′ ) # ( Z ⋉ g ) # ( Z ⋉ k ) ( η central) = ( η ( f # h ) ⋊ X ′ ) # ( Z ⋉ ( g # k )) ( η , ⋊ , ⋉ func.) =: ( f # h ) ⊗ 0 , 1 ( g # k ) . The case of ⊗ 1 , 0 is analogous. Thus G ( V , C , η ) is a 2 -graded monoidal category . An effectful functor ( H 0 , H 1 ) : ( V , C , η ) → ( V ′ , C ′ , η ′ ) determines a morphism G ( H 0 , H 1 ) in 2 - GradMon with monoid homomorphism given b y the action on ob jects of H 0 (whic h necessarily coincides with that of H 1 ) and lo cal functors G ( H 0 , H 1 ) 0 and G ( H 0 , H 1 ) 1 giv en by H 0 and H 1 resp ectiv ely . The fact that H 0 is strict monoidal and H 1 is strict premonoidal, along with the condition η ′ ◦ H 0 = H 1 ◦ η gives the required preserv ation of monoidal pro ducts in the grade com binations where they are defined. The condition η ′ ◦ H 0 = H 1 ◦ η corresp onds precisely to the regrading compatibilit y axiom. Thus we recov er a morphism of 2 -graded monoidal categories. It is clear that these pro cesses are m utually inv erse. 2 Definition 4.3 Denote by GradMon ⊤ the sub category of GradMon whose grading PCMs ha v e a top ele- men t , and whose morphisms preserv e the top grade. Since 2 has a top element and morphisms in 2 - GradMon preserve it, 2 - GradMon is a full sub category of GradMon ⊤ , and moreo ver a coreflectiv e one. Theorem 4.4 The ful l sub c ate gory inclusion i : 2 - GradMon → GradMon ⊤ has a right adjoint. That is, 2 - GradMon ∼ = Eff is a c or efle ctive sub c ate gory of GradMon ⊤ . 8 Earnsha w, Nester, Rom ´ an Pro of. W e construct a universal morphism from the functor i to an arbitrary C in GradMon ⊤ with monoid of ob jects ( C ob j , ⊗ , I ), graded b y a PCM E with a top element. Define R C to be the 2 -graded monoidal category o ver the same monoid of ob jects and where, R C 0 ( X ; Y ) := C 0 ( X ; Y ) and R C 1 ( X ; Y ) := C ⊤ ( X ; Y ), the non-trivial regrading ( − ) 1 0 is ( − ) ⊤ 0 and monoidal pro duct for tw o morphisms of grade 0, or of grade 0 and grade 1 is just that in C . Define a morphism ε C : i ( R C ) → C in GradMon ⊤ to b e iden tity-on-ob jects, with morphism of PCMs 2 → E the unique ⊤ preserving morphism, sending 0 to 0 and 1 to ⊤ . The required functors from grade 0 to 0 and grade 1 to ⊤ are then simply iden tities, and it is immediate that these comm ute with regradings and monoidal products where defined. Let D b e a 2-graded monoidal category and ( M , φ ) : i D → C a morphism in GradMon ⊤ , where φ is necessarily the unique top-preserving PCM morphism 2 → E . Define c M : D → R C in 2 - GradMon to hav e the same action on ob jects and morphisms as M . Then it is easy to verify that ε C ◦ i ( c M ) = M , and moreo ver c M is unique with this prop ert y: if b N is another morphism such that ε C ◦ i ( b N ) = M then b N = c M . Therefore i has a righ t adjoint giv en on ob jects by R and on a morphism F : D → C by the unique \ F ◦ ε D . 2 4.1 Symmetric and c artesian structur e Monoidal categories lack structure corresp onding to the syntactic rules of symmetry , weak ening, and con traction. This makes them suited to the semantics of non-cartesian domains, such as quantum [ 49 ] or probabilistic programming languages [ 51 , 26 ]. F or classical programming languages, we m ust supply c artesian structure. F r eyd c ate gories [ 30 , 42 ] are the cartesian cousins of effectful categories. Their category of pure morphisms is a c artesian monoidal category , and the category of effectful morphisms is a symmetric premonoidal category . In this section, we define c artesian PCM -graded monoidal categories, and show that cartesian 2 -graded monoidal categories are precisely F reyd categories, extending Prop osition 4.2 . W e shall b egin with symmetric structure. Definition 4.5 Let ( E , ⊕ , 0) b e a partial commutativ e monoid, and let C b e an E -graded monoidal category . W e say that C is symmetric in case the monoidal category C 0 is a symmetric strict monoidal category with braidings σ X,Y ∈ C 0 ( X ⊗ Y ; Y ⊗ X ) suc h that for all a, b ∈ E with a ⊥ b , and all f ∈ C a ( X ; Y ) and g ∈ C b ( X ′ ; Y ′ ), w e hav e ( f ⊗ g ) # ( σ Y ,Y ′ ) a ⊕ b 0 = ( σ X,X ′ ) a ⊕ b 0 # ( g ⊗ f ) . Example 4.6 A symmetric 1 -graded monoidal category is simply a symmetric strict monoidal category . More generally , in a symmetric E -graded monoidal category C , the category C a is symmetric monoidal for an y idemp oten t a ∈ E , with braidings ( σ X,Y ) a 0 . The straightforw ard pro of of this fact is essen tially that of the follo wing lemma. Lemma 4.7 L et E b e a PCM , let C b e a symmetric E -gr ade d monoidal c ate gory, and let a ∈ E b e a gr ade. Then C a is a symmetric pr emonoidal c ate gory with br aidings ( σ X,Y ) a 0 . Pro of. See Section B.2 . 2 Prop osition 4.8 L et E b e a PCM , let C b e a symmetric E -gr ade d monoidal c ate gory and let a ∈ E b e a gr ade. Then ther e is a symmetric effe ctful c ate gory given by ( − ) a 0 : C 0 → C a . Pro of. W e hav e that C a is symmetric premonoidal from Lemma 4.7 , and ( − ) a 0 preserv es the braiding by construction. That ( − ) a 0 is strict premonoidal and has central image follows by the same reasoning as in the first part of the pro of of Prop osition 4.2 . 2 Definition 4.9 A morphism M of symmetric PCM -graded monoidal categories is a morphism as in Def- inition 3.15 , for whic h M 0 ( σ X,Y ) = σ M X,M Y , i.e. M 0 is a symmetric strict monoidal functor . Prop osition 4.10 The c ate gory SymEff is isomorphic to the c ate gory Sym 2 - GradMon . Pro of. F rom Prop osition 4.8 with a = 1, a symmetric 2 -graded monoidal category induces a symmetric effectful category . F rom Prop osition 4.2 we hav e that an effectful category induces a 2 -graded monoidal category . Assume ( V , C , η ) is symmetric. T o show the induced 2 -graded monoidal category is symmetric, 9 Earnsha w, Nester, Rom ´ an w e m ust chec k ( f ⊗ g ) # ( σ Y ,Y ′ ) a ⊕ b 0 = ( σ X,X ′ ) a ⊕ b 0 # ( g ⊗ f ) for all a ⊥ b . F or a = b = 0, this follows from the fact that V is symmetric. F or a = 0 , b = 1, we hav e f 1 0 := η ( f ) and ( σ X,X ′ ) 1 0 := η ( σ X,X ′ ), so we must show ( η ( f ) ⊗ g ) # σ Y ,Y ′ = σ X,X ′ # ( g ⊗ η ( f )) , which follo ws from the fact that C is symmetric premonoidal , using that η preserves braidings and lands in the center. The case a = 1 , b = 0 is analogous. Giv en a morphism of symmetric 2 -graded monoidal categories, Prop osition 4.2 giv es us an effectful functor with comp onen ts M 0 and M 1 . The condition that the morphism is symmetric is precisely that M 0 is a symmetric strict monoidal functor , so it remains to chec k that M 1 is a symmetric premonoidal functor , whic h follows from M 1 (( σ X,Y ) 1 0 ) = M 0 ( σ X,Y ) 1 0 = ( σ M X,M Y ) 1 0 . Conv ersely , giv en a symmetric strict effectful functor , w e hav e a morphism of 2 -graded monoidal categories from Prop osition 4.2 , and the condition that M 0 preserv e symmetries is the extra condition that the functor b et ween the monoidal categories b e symmetric strict. 2 Prop osition 4.11 The adjunction of The or em 4.4 r estricts to symmetric structur es, i.e. Sym 2 - GradMon ∼ = SymEff is a c or efle ctive sub c ate gory of SymGradMon ⊤ . Pro of. Let C b e a symmetric E -graded monoidal category for a PCM E with top element. F rom Theo- rem 4.4 w e obtain a 2 -graded monoidal category R C . Since by definition ( R C ) 0 = C 0 , and ( − ) 1 0 preserv es braidings, R C is a symmetric 2 -graded monoidal category . Since the counit is identit y on ob jects and mor- phisms, it preserves the braiding and so is a morphism of symmetric E -graded monoidal categories. Given a symmetric 2 -graded monoidal category D and a symmetric morphism ( M , φ ) : i D → C in SymGradMon ⊤ , w e hav e the unique c M as in Theorem 4.4 , whic h w e m ust c heck is a morphism of Sym 2 - GradMon . It suffices to c heck that it preserv es braidings, which follows from c M 0 ( σ X,Y ) := M 0 ( σ X,Y ) = σ M X,M Y . 2 Definition 4.12 Let E = ( E , ⊕ , 0) b e a PCM . An E -graded monoidal category is said to b e c artesian in case C 0 is a cartesian monoidal category , and the braiding there mak es C into a symmetric E -graded monoidal category . Prop osition 4.13 L et E b e a PCM , let C b e a c artesian E -gr ade d monoidal c ate gory, and let a ∈ E b e a gr ade. Then ther e is a F r eyd c ate gory given by ( − ) a 0 : C 0 → C a . Pro of. By Prop osition 4.8 , ( − ) a 0 : C 0 → C a is a symmetric effectful category and since C 0 is cartesian monoidal b y definition, this is a F reyd category . 2 Definition 4.14 A morphism of cartesian E -graded monoidal categories is a morphism as in Defini- tion 3.15 , for whic h M 0 is a cartesian monoidal functor . Theorem 4.15 The c ate gory of F r eyd c ate gories is isomorphic to the c ate gory of c artesian 2 -gr ade d monoidal c ate gories, Cart 2 - GradMon ∼ = F reyd . Pro of. By Prop osition 4.10 , symmetric 2 -graded monoidal categories are isomorphic to symmetric effect- ful categories. W e sho w that this isomorphism restricts to the cartesian case. On ob jects, if C is a cartesian 2 -graded monoidal category , then by Prop osition 4.13 the induced effectful category ( − ) 1 0 : C 0 → C 1 is a F reyd category since C 0 is cartesian b y definition. Con versely , if ( V , C , J ) is a F reyd category , then Proposition 4.10 yields a symmetric 2 -graded monoidal category with grade 0 category V and grade 1 category C . Since V is cartesian monoidal, this is in fact a cartesian 2 -graded monoidal category . On morphisms, the isomorphism of Prop osition 4.10 sends an effectful functor ( M 0 , M 1 ) to the corresp onding morphism of symmetric 2 -graded monoidal categories with the same comp onen ts. The additional requirement for a morphism in Freyd is precisely that M 0 b e cartesian, whic h is exactly the additional requiremen t for a morphism in Cart 2 - GradMon . 2 Prop osition 4.16 The adjunction of Pr op osition 4.11 r estricts to c artesian structur es, i.e. Ca rt 2 - GradMon ∼ = F reyd is a c or efle ctive sub c ate gory of CartGradMon ⊤ . Pro of. W e extend Prop osition 4.11 . Let C b e a cartesian E -graded monoidal category for a PCM E with top elemen t. F rom Prop osition 4.11 we obtain a symmetric 2 -graded monoidal category , R C . Since b y definition ( R C ) 0 = C 0 , it is a cartesian 2 -graded monoidal category . Since the counit is the identit y on ob jects and morphisms, it is a morphism of cartesian E -graded monoidal categories. Giv en a F reyd category D and a morphism ( M , φ ) : i D → C in CartGradMon ⊤ , we hav e from Prop osition 4.11 a unique 10 Earnsha w, Nester, Rom ´ an c M : D → R C in Sym 2 - GradMon . Since c M 0 is defined to b e exactly M 0 , which is a cartesian monoidal functor b y assumption, c M preserves cartesian structure and hence is a morphism in Cart 2 - GradMon . 2 Jeffrey [ 19 ] considered programming language semantics in triples of a cartesian category , a symmetric monoidal category and a symmetric premonoidal category , corresp onding resp ectiv ely to v alues, pure computations and effectful computations. F rom this p oin t of view, the PCM 2 is a “truncated” instance of the total monoid giv en b y maximum , which extends to three elemen ts as follows. Example 4.17 Denote by 3 the PCM with three elements { 0 , 1 , 2 } and partial op eration x ⊕ y := ↑ x = y = 2 max( x, y ) otherwise. Then com bining the ab o v e results, we observ e that Corollary 4.18 Cartesian 3 -gr ade d monoidal c ate gories ar e the triples of Jeffr ey [ 19 ]. 5 Categories from PCM-graded monoidal categories Although the sequential comp osition op erators of an E -graded monoidal category C are homo gene ous in the grade, if the extension preorder of E is appropriately w ell b eha ved, we can mak e sense of the sequen tial comp osition of heter o gene ously graded morphisms, assembling the “lo cal” categories C a in to a single “global” category . The simplest case is when the extension preorder of E has binary joins, in which case w e can take the disjoin t union of the hom-sets. Prop osition 5.1 L et ( E , ⊕ , 0) b e a PCM whose extension pr e or der has binary joins, and let C b e an E -gr ade d monoidal c ate gory . Ther e is a c ate gory, also denote d by C , with obje cts C obj and hom-sets C ( X ; Y ) := ` a ∈ E C a ( X ; Y ) . Identities ar e given by id X (gr ade 0 identities), and c omp osition for f ∈ C a ( X ; Y ) and g ∈ C b ( Y ; Z ) by f ; g := f a ∨ b a # g a ∨ b b . Pro of. Let f ∈ C a ( X ; Y ), g ∈ C b ( Y ; Z ), and h ∈ C c ( Z ; W ). F or asso ciativit y , we hav e by definition ( f ; g ); h = ( f a ∨ b a # g a ∨ b b ) ( a ∨ b ) ∨ c a ∨ b # h ( a ∨ b ) ∨ c c . Then w e hav e ( f a ∨ b a # g a ∨ b b ) ( a ∨ b ) ∨ c a ∨ b # h ( a ∨ b ) ∨ c c = (( f a ∨ b a ) a ∨ b ∨ c a ∨ b # ( g a ∨ b b ) a ∨ b ∨ c a ∨ b ) # h ( a ∨ b ) ∨ c c (regrad. func.) = ( f a ∨ b ∨ c a # g a ∨ b ∨ c b ) # h ( a ∨ b ) ∨ c c ( Reg-A ct ) = f a ∨ b ∨ c a # ( g a ∨ b ∨ c b # h ( a ∨ b ) ∨ c c ) , ( # asso c.) and the same reasoning starting with f ; ( g ; h ) arrives at the same term. F or left unitality , let f ∈ C a ( X ; Y ) then w e hav e id X ; f := id X 0 ∨ a 0 # f 0 ∨ a a = f a a = f a , and similarly for righ t unitalit y . 2 Example 5.2 The extension preorder of a p o w erset PCM (Example 2.8 ) is exactly the usual subset inclusion preorder, since U = T − S witnesses S ⩽ T . Therefore join is given by the union S ∪ T . Recall from Example 3.8 the devic e interpretation of P ( X )-graded monoidal categories: a morphism of grade S ⊆ X is a program that uses devices in S , and parallel comp osition is defined only for disjoint device sets. Under this interpretation, sequential comp osition in the category C corresp onds to the intuitiv e notion that a sequen tial program uses the union of the devices app earing in each term of the sequence. Example 5.3 The (total) commutativ e monoid ( N , + , 0) has binary joins, n ∨ m := max( n, m ). Under the interpretation of ( N , + , 0)-graded monoidal categories as those mo delling programs whose grade cor- resp onds to the amount of a reusable resource used by that program (such as auxiliary “scratch” memory cells), comp osition in the resulting global category captures the intuitiv e idea that w e should b e able to comp ose an n graded and an m graded program to obtain a max( n, m ) graded one. 11 Earnsha w, Nester, Rom ´ an In fact, insp ection of the pro of of Prop osition 5.1 sho ws that we do not need the full strength of a join: it suffices that ∨ is an “upp er-bounding monoid” structure in the following sense. Prop osition 5.4 L et ( E , ⊕ , 0) b e a PCM and let ∨ b e an asso ciative binary op er ation on E , with unit 0 , and such that it pr ovides an upp er b ound of its ar guments in the extension pr e or der , a ⩽ a ∨ b and b ⩽ a ∨ b . Then an E -gr ade d monoidal c ate gory gives a c ate gory C exactly as define d in Pr op osition 5.1 . When ∨ is mor e over idemp otent, the c omp osition of two morphisms f ∈ C a ( X ; Y ) and g ∈ C a ( Y ; Z ) with the same gr ade a c oincides with the op er ation ( # a ) of the E -gr ade d monoidal c ate gory. An y total comm utative monoid pro vides an example of such an upp er-bounding op eration, given by the operation of the monoid. F or example + is an upp er bounding operation for the total monoid ( N , + , 0), differing from the join, giv en b y max. W e can also sw ap these op erations, as in the following example. Example 5.5 Consider the total comm utative monoid of natural n um b ers with maximum, ( N , max , 0). The extension preorder has a join giv en b y max but addition is an upp er-bounding op eration in the sense of Prop osition 5.4 . Therefore, given an ( N , max , 0)-graded monoidal category (Example 3.12 ) we obtain a category from Prop osition 5.1 in which grades sum under sequential comp osition: this migh t mo del execution time or other accum ulating c osts . The category C constructed ab o v e con tains copies of “the same” morphism in different grades, b eing a disjoint union of the hom-sets at eac h grade, C a . It is also natural to consider iden tifying morphisms along regrading functors, whic h allows us to w eaken the hypothesis on the extension preorder to directedness. Prop osition 5.6 L et ( E , ⊕ , 0) b e a PCM whose extension pr e or der is dir e cte d. Then ther e is a c ate gory C with obje cts C obj and hom-sets C ( X ; Y ) := ` a C a ( X ; Y ) / ≡ wher e ≡ is the le ast e quivalenc e r elation gener ate d by p airs ⟨ a, f ⟩ ≡ ⟨ b, f b a ⟩ for every a ⩽ b in E . Pro of. See Section C.1 . 2 Example 5.7 PCMs whose extension preorders hav e binary joins, or ha ve an upp er-bounding monoid structure (in the sense of Proposition 5.4 ), are directed, and so Examples 5.2 , 5.3 and 5.5 also giv e rise to categories as in Prop osition 5.6 . In case E has a top element in its extension preorder , for example, when E is an effect algebra , this global category C is isomorphic to C ⊤ , and in case ⊕ is total, C is a monoidal category . Prop osition 5.8 L et ( E , ⊕ , 0) b e a PCM whose extension pr e or der has a top element. Then the c ate gory C with obje cts C obj and hom-sets C ( X ; Y ) := ` a C a ( X ; Y ) / ≡ define d in Pr op osition 5.6 exists and is isomorphic to the c ate gory C ⊤ . Pro of. C exists since a top element implies directedness. F or every a ∈ E w e ha v e a ⩽ ⊤ , so ev- ery equiv alence class [ ⟨ a, f ⟩ ] has the representativ e ⟨⊤ , f ⊤ a ⟩ . The map [ ⟨ a, f ⟩ ] 7→ f ⊤ a is then a w ell de- fined bijection C ( X ; Y ) ∼ = C ⊤ ( X ; Y ) with inv erse u 7→ [ ⟨⊤ , u ⟩ ]. These functions preserve identities since [ ⟨ 0 , id X ⟩ ] 7→ (id X ) ⊤ 0 , and comp osition since for comp osable [ ⟨ a, f ⟩ ] and [ ⟨ b, g ⟩ ], the top elemen t is an upp er b ound of a and b , so by the definition of comp osition in C , [ ⟨ a, f ⟩ ] # [ ⟨ b, g ⟩ ] = [ ⟨⊤ , f ⊤ a # ⊤ g ⊤ b ⟩ ] 7→ ( f ⊤ a # ⊤ g ⊤ b ) ⊤ ⊤ = f ⊤ a # ⊤ g ⊤ b . Hence these bijections assem ble in to an isomorphism of categories C ∼ = C ⊤ . 2 Prop osition 5.9 When ( E , ⊕ , 0) is a (total) c ommutative monoid then C is define d and has a strict monoidal structur e . Pro of. See Section C.2 . 2 6 PCM-graded monoidal categories as monoids In this section, w e presen t a category-theoretic p erspective on our central definition (Definition 3.1 ). This reform ulation b etter connects our notion to the existing literature, and op ens it up to generalization. 12 Earnsha w, Nester, Rom ´ an Categories of grades are often treated as thin monoidal cate gories, for example in the literature on graded monads [ 24 , 36 , 39 ] and lo cally graded categories [ 54 , 29 , 35 ]. The preorder structure in such categories of grades induces regrading maps, and the monoidal structure captures the monoid structure on grades. T o deal with the fact that our grades combine only partially , we in tro duce a thin pr omonoidal category of grades [ 8 ]. Promonoidal structure suffices to obtain a conv olution monoidal structure on presheav es, whic h are duoidal with the p oin t wise cartesian monoidal pro duct. This allows us to use the results of Heunen and Sigal [ 18 ] to characterize PCM-graded monoidal categories as monoids in a category of lax monoidal functors. W e shall not need promonoidal categories in their full generality , but rather the simpler case of Bo ol -enric hed promonoidal categories. Definition 6.1 Let Bo ol b e the p oset of truth v alues { ∅ ⩽ ⊤} . A Bo ol -profunctor P : C − 7 − → D is a functor P : C op × D → Bo ol . Comp osition is relational comp osition, ( Q ◦ P )( c ; d ) := ∃ e ∈ D , P ( c ; e ) ∧ Q ( e ; d ) . Definition 6.2 A Bo ol - pr omonoidal c ate gory ( C , P , I ) is a category C equipp ed with Bo ol -profunctors P : C × C − 7 − → C and I : 1 − 7 − → C , satisfying the asso ciativit y and unitalit y la ws P ◦ ( P × bid C ) = P ◦ (bid C × P ) , P ◦ (bid C × I ) = bid C , P ◦ ( I × bid C ) = bid C , where bid C is the Bo ol -profunctor given by change of base of Hom C along Set → Bo ol : ∅ 7→ ∅ , A 7→ ⊤ . W e enco de a PCM as thin Bo ol - promonoidal category as follows. Prop osition 6.3 L et ( E , ⊕ , 0) b e a PCM . Then E = (( E , ⩽ ) , P , I ) is a Bo ol - pr omonoidal c ate gory on the extension pr e or der of E wher e P ( a, b ; c ) := ⊤ if a ⊕ b ⩽ c, ∅ otherwise, I ( c ) := ⊤ for al l c. Pro of. See Section D.1 . 2 A functor F : E → Set , or c opr eshe af , comprises a family of sets { F ( e ) } e ∈ E indexed by E , together with functions F ( e ⩽ e ′ ) : F ( e ) → F ( e ′ ) for each e ⩽ e ′ in the extension preorder . These families will give graded hom-sets, and the functions F ( e ⩽ e ′ ) will give regrading maps. W e shall also need t w o monoidal structures on the category [ E , Set ] of functors E → Set and natural transformations b et ween them. Prop osition 6.4 L et ( E , P , I ) b e the strict Bo ol - pr omonoidal c ate gory gener ate d by a PCM (Pr op osi- tion 6.3 ). Then the c ate gory [ E , Set ] has c onvolution monoidal structur e ([ E , Set ] , ∗ , J ) wher e ( F ∗ G )( c ) := a a ⊕ b ⩽ c F ( a ) × G ( b ) / ∼ and ∼ is the le ast e quivalenc e r elation gener ate d by p airs ( a, b, x, y ) ∼ ( a ′ , b ′ , F ( a ⩽ a ′ )( x ) , G ( b ⩽ b ′ )( y )) for x ∈ F ( a ) , y ∈ G ( b ) , a ⩽ a ′ , b ⩽ b ′ and a ′ ⊕ b ′ ⩽ c . The unit is given by J ( c ) := {∗} for al l c . Pro of. This is the Bo ol -enric hed case of the standard con volution monoidal structure for presheav es on a promonoidal category [ 8 ], sp ecialized to the promonoidal category E . 2 Along with the p oin t wise cartesian monoidal structure ( × , K ), where ( F × G )( e ) := F ( e ) × G ( e ), and K is constant at the singleton, it is standard that ([ E , Set ] , ∗ , J, × , K ) is a duoidal category [ 52 ], and so: Prop osition 6.5 (Heunen and Sigal, [ 18 , § 5, Prop ositions 3,4 and 5]) L et ( C obj , ⊗ , I ) b e a monoid, se en as a monoidal discr ete c ate gory, so that C op obj × C obj is monoidal with ( X , Y ) ⊗ ( X ′ , Y ′ ) := ( X ⊗ X ′ , Y ⊗ Y ′ ) . The functor c ate gory MonCat lax ( C op obj × C obj , ([ E , Set ] , ∗ , J )) 13 Earnsha w, Nester, Rom ´ an has a monoidal structur e ( ◦ , L ) given by lifting ( × , K ) , ( P ◦ Q )( X ; Z ) := a Y ∈ C obj Q ( X ; Y ) × P ( Y ; Z ) L ( X ; Y ) := K if X = Y e 7→ ∅ otherwise. Since C ob j is discrete, C op ob j ∼ = C ob j , but w e retain the op to an ticipate future generalization. Theorem 6.6 L et ( E , ⊕ , 0) b e a PCM , E b e the c orr esp onding Bo ol - pr omonoidal c ate gory , as in Pr op osi- tion 6.3 , and ( C obj , ⊗ , I ) b e a monoid, se en as monoidal discr ete c ate gory. A n E -gr ade d monoidal c ate gory with monoid of obje cts ( C obj , ⊗ , I ) is pr e cisely a monoid in the monoidal c ate gory ( MonCat lax ( C op obj × C obj , ([ E , Set ] , ∗ , J )) , ◦ , L ) , that is, a duoidal ly [ E , Set ] -enriche d F r eyd c ate gory, in the terminolo gy of Heunen and Sigal [ 18 ]. Pro of. This is mostly a case of unfolding definitions, so let us first unpac k what such a monoid comprises in elemen tary terms. W e will then examine the apparent discrepancies. 1. A lax monoidal functor C : C op ob j × C ob j → ([ E , Set ] , ∗ , J ), whic h is (i) a set C a ( X ; Y ), for eac h pair of ob jects X , Y in C ob j , and grade a ∈ E , and (ii) a function ( − ) b a : C a ( X ; Y ) → C b ( X ; Y ), for grades a ⩽ b in E , (iii) such that ( − ) a a is the iden tity , and ( − ) c b ◦ ( − ) b a = ( − ) c a , (iv) functions ⊗ a,b ; c : C a ( X ; Y ) × C b ( X ′ ; Y ′ ) → C c ( X ⊗ X ′ ; Y ⊗ Y ′ ) for eac h a ⊕ b ⩽ c (v) an element η a ∈ C a ( I ; I ), for each a ∈ E , satisfying the follo wing naturality and coherence equations (vi) compatibility of ⊗ a,b ; c with the equiv alence relation in Prop osition 6.4 , i.e. whenever a ⩽ a ′ , b ⩽ b ′ , and a ′ ⊕ b ′ ⩽ c , ( f a ′ a ) ⊗ a ′ ,b ′ ; c ( g b ′ b ) = f ⊗ a,b ; c g , (vii) η c ′ = ( η c ) c ′ c whenev er c ⩽ c ′ , (viii) ( f ⊗ a,b ; c g ) d c = f ⊗ a,b ; d g whenever a ⊕ b ⩽ c ⩽ d , (ix) ( f ⊗ a,b ; x g ) ⊗ x,c ; d h = f ⊗ a,y ; d ( g ⊗ b,c ; y h ) whenever a ⊕ b ⩽ x , x ⊕ c ⩽ d , b ⊕ c ⩽ y , and a ⊕ y ⩽ d , (x) f ⊗ a,b ; c η b = f c a and η a ⊗ a,b ; c f = f c b whenev er a ⊕ b ⩽ c . 2. A monoidal natural transformation ( # ) : C ◦ C ⇒ C , whic h is (i) a function ( # ) a : C a ( X ; Y ) × C a ( Y ; Z ) → C a ( X ; Z ) , for each grade a ∈ E and ob jects X , Y , Z , (ii) natural in the grade, i.e. for a ⩽ b , ( f # a g ) b a = f b a # b g b a , and (iii) monoidal with respect to the lax structure ⊗ a,b ; c , i.e. ( f # a g ) ⊗ a,b ; c ( h # b i ) = ( f ⊗ a,b ; c h ) # c ( g ⊗ a,b ; c i ) , whenev er a ⊕ b ⩽ c . 3. A monoidal natural transformation id : L ⇒ C , which is (i) an element (id X ) a ∈ C a ( X ; X ), for each grade a ∈ E and ob ject X , (ii) natural in the grade, i.e. ((id X ) a ) b a = (id X ) b whenev er a ⩽ b , (iii) monoidal with resp ect to ⊗ a,b ; c , i.e. (id X ) a ⊗ a,b ; c (id Y ) b = (id X ⊗ Y ) c whenev er a ⊕ b ⩽ c , (iv) and compatible with the lax monoidal unit ab o ve, i.e. η c = (id I ) c , for all c ∈ E . 4. the monoid laws for # and id, namely (i) asso ciativit y in each grade: for comp osable f , g , h ∈ C a , w e hav e ( f # a g ) # a h = f # a ( g # a h ), (ii) left and right unit in each grade: (id X ) a # a f = f and f # a (id Y ) a = f for all f ∈ C a ( X ; Y ). This data defines an E -graded monoidal category: by items 1.(i) , 2.(i) , 3.(i) and 4 , for each a ∈ E w e hav e a category C a with ob jects C ob j ; items 1.(ii) , 2.(ii) and 3.(ii) give identit y-on-ob jects regrading functors ( − ) b a : C a → C b ; item 1.(iv) giv es partial monoidal pro ducts with c = a ⊕ b , i.e. ⊗ a,b := ⊗ a,b ; a ⊕ b . F or the la ws, Reg-Act is item 1.(iii) . F or Reg- ⊗ we ha ve ( f ⊗ g ) c ⊕ d a ⊕ b := ( f ⊗ a,b ; a ⊕ b g ) c ⊕ d a ⊕ b 1 . ( v iii ) = f ⊗ a,b ; c ⊕ d g 1 . ( v i ) = ( f c a ) ⊗ c,d ; c ⊕ d ( g d b ) =: f c a ⊗ g d b . ⊗ -U-A follows from items 1.(ix) , 1.(x) and 3.(iv) ; ⊗ -Id follows from item 3.(iii) ; Inter follo ws from item 2.(iii) with c = a ⊕ b . F or the conv erse, the idea is that given an E -graded monoidal category , we can 14 Earnsha w, Nester, Rom ´ an define the monoidal pro ducts required ab o v e via regrading, f ⊗ a,b ; c g := ( f ⊗ a,b g ) c a ⊕ b . The lax monoidal unit η c (item 1.(v) ) is determined b y the sequen tial unit via item 3.(iv) , and item 1.(vii) is then subsumed b y item 3.(ii) at X = I . W e verify that the necessary laws hold in Section D.2 . These tw o pro cesses are m utually in verse: starting from an E -graded monoidal category , w e ha ve f ⊗ a,b ; a ⊕ b g = ( f ⊗ g ) a ⊕ b a ⊕ b = f ⊗ g b y Reg-Act ; conv ersely , starting from a lax monoidal functor with laxator ⊗ a,b ; c , the recov ered laxator is ( f ⊗ a,b ; a ⊕ b g ) c a ⊕ b = f ⊗ a,b ; c g by Item 1.(viii) . 2 Remark 6.7 L o c al ly indexe d c ate gories [ 29 ] axiomatize a notion of category in which hom-sets C v ( A ; B ) carry a grade v , t ypically an ob ject of a monoidal category V , equipp ed with regrading morphisms and sequen tial comp osition op erations that are homogeneous in the grade: C v ( A ; B ) × C v ( B ; C ) → C v ( A ; C ). F ormally , a lo cally V -indexed category is a category enriched in the category of preshea ves on V , equipp ed with its p oin t wise cartesian pro duct ( × ). L o c al ly gr ade d c ate gories [ 54 , 29 , 35 ] are instead enriched in the con volution monoidal pro duct on presheav es ( ∗ ), which allo ws grades to c ombine under sequential comp osition. As noted ab o v e, these tw o monoidal structures form a duoidal structure [ 52 ]. Whenever one has a duoidal category ( V , ∗ , J, × , I ), the category ( V , ∗ , J )- Cat has a monoidal structure given b y ( × , I ), as in Batanin and Markl [ 2 , Section 3]. In the case of V = [ E , Set ], monoids in this monoidal category are a “flipp ed” notion of graded monoidal category in which grades com bine sequentially but not monoidally . 7 Conclusion and future w ork W e hav e in tro duced monoidal categories graded by partial commutativ e monoids: a uniform framework for monoidal categories, effectful categories, and F reyd categories. By v arying the grading PCM, we ha ve mo delled non-in terfering parallelism, b ounded resource usage, and other resource-sensitive settings, going b ey ond the t w o-element grading of effectful categories. Prop osition 5.1 raises the p ossibilit y of equipping an E -graded monoidal category with sequen tial comp osition op erations of the type C a ( X ; Y ) × C b ( Y ; Z ) → C a ∨ b ( X ; Z ) , suggesting a notion of monoidal categories graded in algebraic structures equipp ed with t wo (partial) monoid structures, with one operation grading the monoidal comp osition, and the other sequential comp osition. A similar notion in the total case has app eared in a preprint of the third author with Di Lav ore [ 27 ]. Section 6 suggests a concrete approach to defining suc h “partial duoid” graded monoidal categories, b y taking an E to b e an appropriate (thin) pr o duoidal category , which again induces a duoidal structure on preshea v es [ 4 , 11 ]. This might pro vide a common ro of for our notion and that of Sarkis and Zanasi [ 48 ] in which grades com bine totally , b y the same op eration, under b oth sequen tial and monoidal comp osition. Most of our examples of E -graded monoidal categories ha ve b een agnostic tow ards the definition of ob jects and morphisms in the category . It would be nice to give conditions under whic h effectful categories can b e refined to non-trivially E -graded monoidal categories. The w ork of Breuv art, McDermott and Uustalu on canonical gradings of monads [ 5 ] ma y b e relev ant in this regard. In previous w ork [ 12 ], we constructed free effectful categories ov er what migh t b e termed P ( X )-graded signatur es (or “effectful signatures”). In particular, we show ed that every effectful category has a non- trivial underlying P ( X )-graded signature, where the set X is given by taking maximal cliques in a graph determined b y the morphisms of an effectful category . Thus w e may wonder if there is a further right adjoin t to the functor R of Theorem 4.4 , defined using this construction. How ever, it seems that the morphisms of GradMon ⊤ are to o strong for this to be the case, since their assignmen t on morphisms is go verned by a morphism of PCMs whereas the morphisms of signatures in our paper [ 12 ] were necessarily w eaker, only preserving orthogonality . It remains to be seen how to relate these tw o notions of morphism. P artial comm utative monoids are used extensively in separation logic to mo del resources [ 44 , 22 ]. Es- tablishing substantiv e connections to separation logic is also a promising direction for future work. In particular, a natural next step would b e to understand the relation b et ween separating conjunction and partially defined monoidal pro ducts arising from grading by appropriate separation algebras. Ac knowledgemen ts Matthew Earnshaw and Chad Nester were supp orted by Estonian Researc h Council gran t PRG2764. Mario Rom´ an was supp orted by the Safeguarded AI programme of the Adv anced Researc h + Inv ention Agency and the Estonian Researc h Council gran t PRG3215. 15 Earnsha w, Nester, Rom ´ an References [1] Atk ey , R., Par ameterise d notions of c omputation , Journal of F unctional Programming 19 , page 335–376 (2009). https://doi.org/10.1017/S095679680900728X [2] Batanin, M. and M. Markl, Centers and homotopy c enters in enriched monoidal c ate gories , Adv ances in Mathematics 230 , pages 1811–1858 (2012), ISSN 0001-8708. https://doi.org/https://doi.org/10.1016/j.aim.2012.04.011 [3] Bonchi, F., E. Di La vore and M. Rom´ an, Effe ctful Me aly Machines: Bisimulation and T r ac e , in: 2025 40th Annual ACM/IEEE Symp osium on L o gic in Computer Scienc e (LICS) , pages 541–554, IEEE Computer So ciet y , Los Alamitos, CA, USA (2025). https://doi.org/10.1109/LICS65433.2025.00047 [4] Bo ok er, T. and R. Street, T annaka duality and c onvolution for duoidal c ate gories , Theory and Applications of Categories 28 , pages 166–205 (2013). [5] Breuv art, F., D. McDermott and T. Uustalu, Canonic al gr adings of monads , Electronic Pro ceedings in Theoretical Computer Science 380 , page 1–21 (2023), ISSN 2075-2180. https://doi.org/10.4204/eptcs.380.1 [6] Calcagno, C., P . W. O’Hearn and H. Y ang, L o c al action and abstract sep ar ation lo gic , in: 22nd Annual IEEE Symp osium on L o gic in Computer Scienc e (LICS 2007) , pages 366–378, IEEE (2007). [7] Co ec ke, B. and R. Lal, Causal c ate gories: R elativistic al ly inter acting pr o c esses , F oundations of Physics 43 , pages 458–501 (2013). https://doi.org/10.1007/s10701- 012- 9646- 8 [8] Day , B., On close d c ate gories of functors , in: Rep orts of the Midwest Cate gory Seminar IV , volume 137, pages 1–38, Springer Berlin Heidelb erg, Berlin, Heidelb erg (1970). https://doi.org/10.1007/BFb0060438 [9] Dinsdale-Y oung, T., L. Birk edal, P . Gardner, M. P arkinson and H. Y ang, Views: c omp ositional r e asoning for c oncurr ent pr o gr ams , in: Pr o c e e dings of the 40th annual A CM SIGPLAN-SIGA CT symp osium on principles of pr o gr amming languages , pages 287–300 (2013). [10] Earnshaw, M., L anguages of String Diagr ams , Ph.D. thesis, T allinn Univ ersity of T ec hnology (2025). https://doi.org/10.23658/TALTECH.2/2025 [11] Earnshaw, M., J. Hefford and M. Rom´ an, The Pro duoidal A lgebra of Pr o c ess De c omp osition , in: A. Murano and A. Silv a, editors, 32nd EACSL Annual Confer enc e on Computer Scienc e L o gic (CSL 2024) , v olume 288 of L eibniz International Pr o c e e dings in Informatics (LIPIcs) , pages 25:1–25:19, Schloss Dagstuhl – Leibniz-Zen trum f ¨ ur Informatik, Dagstuhl, German y (2024), ISBN 978-3-95977-310-2, ISSN 1868-8969. https://doi.org/10.4230/LIPIcs.CSL.2024.25 [12] Earnshaw, M., C. Nester and M. Rom´ an, R esour c eful T r ac es for Commuting Pr oc esses , in: S. Guerrini and B. K¨ onig, editors, 34th EACSL A nnual Conferenc e on Computer Scienc e L o gic (CSL 2026) , volume 363 of Leibniz International Pr o c e e dings in Informatics (LIPIcs) , pages 28:1–28:20, Schloss Dagstuhl – Leibniz-Zen trum f ¨ ur Informatik, Dagstuhl, German y (2026), ISBN 978-3-95977-411-6, ISSN 1868-8969. https://doi.org/10.4230/LIPIcs.CSL.2026.28 [13] F oulis, D. J. and M. K. Bennett, Effect algebr as and unsharp quantum lo gics , F oundations of Ph ysics 24 , pages 1331–1352 (1994), ISSN 1572-9516. https://doi.org/10.1007/BF02283036 [14] Gab oardi, M., S. Katsumata, D. Orchard and T. Sato, Grade d ho ar e lo gic and its c ate goric al semantics , in: Eur op ean Symp osium on Pr o gr amming , pages 234–263, Springer International Publishing Cham (2021). [15] Garner, R. and I. L. F ranco, Commutativity , Journal of Pure and Applied Algebra 220 , pages 1707–1751 (2016). [16] Ghalayini, J. E. and N. Krishnasw ami, The denotational semantics of SSA (2024). 2411.09347 . [17] Hefford, J. and A. Kissinger, On the Pr e- and Promonoidal Structur e of Sp ac etime , EPTCS 380 , pages 284–306 (2023). 2206.09678 . https://doi.org/10.4204/EPTCS.380.17 [18] Heunen, C. and J. Sigal, Duoidal ly enriche d F r eyd c ate gories , in: R. Gl¨ u ck, L. Santocanale and M. Winter, editors, R elational and Algebr aic Metho ds in Computer Scienc e , pages 241–257, Springer In ternational Publishing, Cham (2023), ISBN 978-3-031-28083-2. 16 Earnsha w, Nester, Rom ´ an [19] Jeffrey , A., Pr emonoidal c ategories and a gr aphic al view of pr o gr ams , Preprint (1997). [20] Jensen, J. B. and L. Birkedal, Fictional separ ation logic , in: H. Seidl, editor, Pr o gr amming Languages and Systems , pages 377–396, Springer Berlin Heidelberg, Berlin, Heidelb erg (2012), ISBN 978-3-642-28869-2. [21] Jung, R., D. Sw asey , F. Sieczko wski, K. Sv endsen, A. T uron, L. Birkedal and D. Dreyer, Iris: Monoids and invariants as an orthogonal b asis for concurr ent r e asoning , in: Pr o c e e dings of the 42nd A nnual ACM SIGPLAN-SIGACT Symp osium on Principles of Pr o gr amming L anguages , POPL ’15, page 637–650, Asso ciation for Computing Machinery , New Y ork, NY, USA (2015), ISBN 9781450333009. https://doi.org/10.1145/2676726.2676980 [22] Jung, R., D. Sw asey , F. Sieczko wski, K. Sv endsen, A. T uron, L. Birkedal and D. Dreyer, Iris: Monoids and invariants as an ortho gonal b asis for c oncurr ent r e asoning , SIGPLAN Not. 50 , page 637–650 (2015), ISSN 0362-1340. https://doi.org/10.1145/2775051.2676980 [23] Kammar, O. and G. D. Plotkin, Algebr aic foundations for effe ct-dep endent optimisations , in: Pr o c e e dings of the 39th annual ACM SIGPLAN-SIGACT symp osium on Principles of pro gr amming languages , pages 349–360 (2012). [24] Katsumata, S., Par ametric effe ct monads and semantics of effe ct systems , SIGPLAN Not. 49 , page 633–645 (2014), ISSN 0362-1340. https://doi.org/10.1145/2578855.2535846 [25] Krishnaswami, N. R., A. T uron, D. Drey er and D. Garg, Superficial ly substructur al typ es , SIGPLAN Not. 47 , page 41–54 (2012), ISSN 0362-1340. https://doi.org/10.1145/2398856.2364536 [26] Lav ore, E. D., B. Jacobs and M. Rom´ an, A simple formal language for pr ob abilistic de cision pr oblems (2025). 2410.10643 . [27] Lav ore, E. D. and M. Rom´ an, Timing via pinwhe el double c ategories (2025). 2504.12846 . [28] Levy , P . B., Call-By-Push-V alue: A F unctional/Imp er ative Synthesis (Semantics Structur es in Computation, V. 2) , Klu wer Academic Publishers, USA (2004), ISBN 1402017308. [29] Levy , P . B., L o c al ly gr ade d c ate gories (2019). T alk presented at the Universit y of Cambridge Category Theory Seminar. https://www.cs.bham.ac.uk/ ~ pbl/papers/locgrade.pdf [30] Levy , P . B., J. P ow er and H. Thielec ke, Mo del ling envir onments in call-by-value pro gr amming languages , Information and Computation 185 , pages 182–210 (2003), ISSN 0890-5401. https://doi.org/https://doi.org/10.1016/S0890- 5401(03)00088- 9 [31] Ley-Wild, R. and A. Nanevski, Subje ctive auxiliary state for c o arse-gr aine d c oncurr ency , in: Pr o c e e dings of the 40th Annual ACM SIGPLAN-SIGACT Symp osium on Principles of Pr o gr amming L anguages , POPL ’13, page 561–574, Asso ciation for Computing Machinery , New Y ork, NY, USA (2013), ISBN 9781450318327. https://doi.org/10.1145/2429069.2429134 [32] Lucassen, J. M. and D. K. Gifford, Polymorphic effe ct systems , in: Pr o c e e dings of the 15th A CM SIGPLAN-SIGACT Symp osium on Principles of Pr o gramming L anguages , POPL ’88, page 47–57, Association for Computing Machinery , New Y ork, NY, USA (1988), ISBN 0897912527. https://doi.org/10.1145/73560.73564 [33] Maillard, K. and P .-A. Mellies, A fibr ational ac c ount of lo c al states , in: Pr o ce e dings of the 2015 30th Annual ACM/IEEE Symp osium on L o gic in Computer Scienc e (LICS) , LICS ’15, page 402–413, IEEE Computer So ciet y , USA (2015), ISBN 9781479988754. https://doi.org/10.1109/LICS.2015.45 [34] McDermott, D., Grading Cal l-By-Push-V alue, Explicitly and Implicitly , in: M. F ern´ andez, editor, 10th International Confer enc e on F ormal Structur es for Computation and De duction (FSCD 2025) , volume 337 of L eibniz International Pr o c e e dings in Informatics (LIPIcs) , pages 28:1–28:19, Schloss Dagstuhl – Leibniz-Zen trum f ¨ ur Informatik, Dagstuhl, German y (2025), ISBN 978-3-95977-374-4, ISSN 1868-8969. https://doi.org/10.4230/LIPIcs.FSCD.2025.28 [35] McDermott, D. and T. Uustalu, Flexibly gr ade d monads and gr ade d algebr as , in: Mathematics of Pro gr am Construction: 14th International Confer enc e, MPC 2022, Tbilisi, Ge or gia, Septemb er 26–28, 2022, Pro c e e dings , page 102–128, Springer- V erlag, Berlin, Heidelb erg (2022), ISBN 978-3-031-16911-3. https://doi.org/10.1007/978- 3- 031- 16912- 0_4 [36] Melli` es, P .-A., The p ar ametric c ontinuation monad , Mathematical Structures in Computer Science 27 , page 651–680 (2017). https://doi.org/10.1017/S0960129515000328 17 Earnsha w, Nester, Rom ´ an [37] Moggi, E., Notions of c omputation and monads , Inf. Comput. 93 , pages 55–92 (1991). https://doi.org/10.1016/0890- 5401(91)90052- 4 [38] nLab, R e d herring principle (nlab entry) (2009). https://ncatlab.org/nlab/show/red+herring+principle , Last accessed on 2025-11-24. [39] Orchard, D., T. Petricek and A. Mycroft, The semantic marriage of monads and effe cts (2014). 1401.5391 . [40] Po wer, J. and E. Robinson, Pr emonoidal c ate gories and notions of c omputation , Mathematical Structures in Computer Science 7 , pages 453–468 (1997). https://doi.org/10.1017/S0960129597002375 [41] Po wer, J. and H. Thieleck e, Envir onments, c ontinuation semantics and indexe d c ate gories , in: M. Abadi and T. Ito, editors, Theor etic al Asp e cts of Computer Softwar e , pages 391–414, Springer Berlin Heidelberg, Berlin, Heidelberg (1997), ISBN 978-3-540-69530-1. [42] Po wer, J. and H. Thieleck e, Close d fr eyd- and κ -c ate gories , in: J. Wiedermann, P . v an Emde Boas and M. Nielsen, editors, Automata, L anguages and Pr o gr amming , pages 625–634, Springer Berlin Heidelberg, Berlin, Heidelb erg (1999), ISBN 978-3-540-48523-0. [43] Pym, D. J., P . W. O’Hearn and H. Y ang, Possible worlds and r esour c es: the semantics of bi , Theoretical Computer Science 315 , pages 257–305 (2004), ISSN 0304-3975. Mathematical F oundations of Programming Semantics. https://doi.org/https://doi.org/10.1016/j.tcs.2003.11.020 [44] Reynolds, J. C., Sep ar ation lo gic: A lo gic for shar e d mutable data structures , in: Pr oc e e dings of the 17th Annual IEEE Symp osium on L o gic in Computer Scienc e , LICS ’02, page 55–74, IEEE Computer Society , USA (2002), ISBN 0769514839. [45] Rom´ an, M., Pr omonads and string diagr ams for effe ctful c ate gories , in: ACT ’22: Applied Cate gory The ory, Glasgow, Unite d Kingdom, 18 - 22 July, 2022 , volume abs/2205.07664 (2022). 2205.07664 . https://doi.org/10.48550/arXiv.2205.07664 [46] Rom´ an, M., Monoidal Context The ory , Ph.D. thesis, T allinn Univ ersit y of T ec hnology (2023). [47] Rom´ an, M. and P . Sobo ci´ nski, String diagr ams for premonoidal c ate gories , Logical Metho ds in Computer Science V olume 21, Issue 2 , 9 (2025), ISSN 1860-5974. https://doi.org/10.46298/lmcs- 21(2:9)2025 [48] Sarkis, R. and F. Zanasi, String Diagr ams for Gr ade d Monoidal The ories, with an Application to Impr e cise Pr ob ability , in: C. C ˆ ırstea and A. Knapp, editors, 11th Confer enc e on Algebr a and Co algebr a in Computer Scienc e (CALCO 2025) , v olume 342 of L e ibniz International Pr o c ee dings in Informatics (LIPIcs) , pages 5:1–5:23, Schloss Dagstuhl – Leibniz- Zen trum f ¨ ur Informatik, Dagstuhl, German y (2025), ISBN 978-3-95977-383-6, ISSN 1868-8969. https://doi.org/10.4230/LIPIcs.CALCO.2025.5 [49] Selinger, P ., T owar ds a quantum pro gr amming language , Mathematical Structures in Computer Science 14 , page 527–586 (2004), ISSN 1469-8072. https://doi.org/10.1017/s0960129504004256 [50] Smirnov, A. L., Gr ade d monads and rings of p olynomials , Journal of Mathematical Sciences 151 , pages 3032–3051 (2008), ISSN 1573-8795. https://doi.org/10.1007/s10958- 008- 9013- 7 [51] Stein, D., Structur al foundations for pr ob abilistic pr o gr amming languages , Universit y of Oxford (2021). [52] Street, R., Monoidal c ate gories in, and linking, ge ometry and algebr a , Bulletin of the Belgian Mathematical So ciet y-Simon Stevin 19 , pages 769–820 (2012). [53] W adler, P . and P . Thiemann, The marriage of effe cts and monads , A CM T rans. Comput. Logic 4 , page 1–32 (2003), ISSN 1529-3785. https://doi.org/10.1145/601775.601776 [54] W o od, R. J., Indicial metho ds for r elative c ate gories , Ph.D. thesis, Dalhousie Univ ersity (1976). A Monoidal, premonoidal, and effectful categories A.1 Monoidal c ate gories and their morphisms A strict monoidal category is usually defined to be a monoidal category for which asso ciators and unitors are iden tities. The following elementary reformulation (see e.g. Rom´ an [ 46 ]) is more conv enien t for our purp oses. 18 Earnsha w, Nester, Rom ´ an Definition A.1 A strict monoidal c ate gory C consists of a monoid of ob jects, ( C ob j , ⊗ , I ), a collection of morphisms C ( X ; Y ), for every pair of ob jects X , Y ∈ C ob j , (families of ) op erations for the sequential and parallel comp osition of morphisms, resp ectiv ely ( # ) : C ( X ; Y ) × C ( Y ; Z ) → C ( X ; Z ) , and ( ⊗ ) : C ( X ; Y ) × C ( X ′ ; Y ′ ) → C ( X ⊗ X ′ ; Y ⊗ Y ′ ) , and a family of iden tity morphisms, id X ∈ C ( X ; X ). This data must satisfy the following axioms • sequen tial comp osition is unital, f # id Y = f and id X # f = f , • sequen tial comp osition is asso ciativ e, f # ( g # h ) = ( f # g ) # h , • parallel comp osition is unital, f ⊗ id I = f and id I ⊗ f = f , • parallel comp osition is asso ciativ e, f ⊗ ( g ⊗ h ) = ( f ⊗ g ) ⊗ h , • parallel comp osition and identities interc hange, id A ⊗ id B = id A ⊗ B , and • parallel comp osition and sequential comp osition in terchange, ( f # g ) ⊗ ( f ′ # g ′ ) = ( f ⊗ f ′ ) # ( g ⊗ g ′ ) . P arallel comp osition is also called the tensor pr o duct or monoidal pr o duct . Definition A.2 A strict monoidal functor F : C → D b et ween strict monoidal categories is a functor that is a monoid homomorphism on ob jects, i.e. F ( A ⊗ B ) = F ( A ) ⊗ F ( B ) and F ( I ) = I , and preserves the monoidal pro duct on morphisms, i.e. F ( f ⊗ g ) = F ( f ) ⊗ F ( g ). Definition A.3 A symmetric strict monoidal c ate gory is a strict monoidal category further equipp ed with braiding maps σ X,Y ∈ C ( X ⊗ Y ; Y ⊗ X ) for each pair of ob jects X , Y , which are natural and satisfy the axioms (i) σ X,Y # σ Y ,X = id X ⊗ Y , (ii) ( σ X,Y ⊗ id Z ) # (id Y ⊗ σ X,Z ) = σ X,Y ⊗ Z , (iii) σ X,I = id X . Definition A.4 A symmetric strict monoidal functor is a strict monoidal functor whic h moreov er pre- serv es the braiding maps, F ( σ X,Y ) = σ F X,F Y . Definition A.5 A c artesian monoidal c ate gory is a monoidal category whose monoidal pro duct A ⊗ B is giv en by a c hosen category theoretic pro duct of A and B , and in which the unit I is a terminal ob ject. A c artesian monoidal functor b et w een cartesian monoidal categories is simply a strict monoidal functor . A.2 Pr emonoidal c ate gories and their morphisms F or more details, see Po w er and Robinson [ 40 ], or Rom´ an [ 45 ]. Definition A.6 A strict pr emonoidal c ate gory is a category C equipp ed with: • for eac h pair of ob jects A, B ∈ C an ob ject A ⊗ B , • for each ob ject A ∈ C a functor A ⋉ − (“left-whisk ering with A ”) whose action on ob jects sends B to A ⊗ B , • for eac h ob ject A ∈ C a functor − ⋊ A (“right-whisk ering with A ”) whose action on ob jects sends B to B ⊗ A , and • a unit ob ject I , suc h that, for all morphisms f and ob jects A, B , C the follo wing equations hold: • ( A ⋉ f ) ⋊ B = A ⋉ ( f ⋊ B ), • ( A ⊗ B ) ⋉ f = A ⋉ ( B ⋉ f ), • f ⋊ ( A ⊗ B ) = ( f ⋊ A ) ⋊ B , • I ⋉ f = f = f ⋊ I , • I ⊗ A = A = A ⊗ I , and • A ⊗ ( B ⊗ C ) = ( A ⊗ B ) ⊗ C . 19 Earnsha w, Nester, Rom ´ an Definition A.7 A morphism f : A → B in a premonoidal category is c entr al if and only if for every morphism g : C → D , ( A ⋉ g ) # ( f ⋊ D ) = ( f ⋊ C ) # ( B ⋉ g ) , and ( g ⋊ A ) # ( D ⋉ f ) = ( C ⋉ f ) # ( g ⋊ B ) . Definition A.8 The c enter of a pr emonoidal c ate gory is the wide sub category of central morphisms . Definition A.9 A symmetric strict pr emonoidal c ate gory C is a strict premonoidal category further equipp ed with central braiding maps σ X,Y ∈ C ( X ⊗ Y ; Y ⊗ X ) which are natural and satisfy the ax- ioms (i) σ X,Y # σ Y ,X = id X ⊗ Y , (ii) ( σ X,Y ⋊ Z ) # ( Y ⋉ σ X,Z ) = σ X,Y ⊗ Z , (iii) σ X,I = id X . Definition A.10 A strict pr emonoidal functor F : X → Y b et ween (strict) premonoidal categories is a functor that is a monoid homomorphism on ob jects, i.e. F ( A ⊗ B ) = F ( A ) ⊗ F ( B ) and F ( I ) = I , and preserv es whiskerings, i.e. F ( A ⋉ f ) = F ( A ) ⋉ F ( f ) and F ( f ⋊ A ) = F ( f ) ⋊ F ( A ). Definition A.11 A symmetric strict pr emonoidal functor is a strict premonoidal functor which moreov er preserv es the central braiding maps, F ( σ X,Y ) = σ F X,F Y . A.3 Effe ctful c ate gories and their morphisms Definition A.12 A strict effe ctful c ate gory ( V , C , η ) is given b y a strict monoidal category V , strict premonoidal category C , and an identit y on ob jects, strict premonoidal functor η : V → C , suc h that the image of η lands in the center of C . Definition A.13 A symmetric strict effe ctful c ate gory is an effectful category ( V , C , η ) in whic h V is equipp ed with a symmetric strict monoidal structure , and C a symmetric strict premonoidal structure , and η : V → C preserves the braidings. Definition A.14 A strict effe ctful functor ( F 0 , F 1 ) : ( V , C , η ) → ( V ′ , C ′ , η ′ ) b et ween effectful categories is a strict monoidal functor F 0 : V → V ′ and a strict premonoidal functor F 1 : C → C ′ suc h that η # F 1 = F 0 # η ′ . In particular, w e must ha ve F 0 ( X ) = F 1 ( X ) for all X in V ob j = C ob j . Definition A.15 A symmetric strict effe ctful functor is a strict effectful functor ( F 0 , F 1 ) for whic h F 0 is a symmetric strict monoidal functor and F 1 is a symmetric strict premonoidal functor . W rite SymEff for category of symmetric strict effectful categories and symmetric strict effectful functors . Definition A.16 A (strict) F r eyd c ate gory ( V , C , η ) is a symmetric strict effectful category in which V is a cartesian monoidal category . Definition A.17 A functor of F r eyd c ate gories ( F 0 , F 1 ) : ( V , C , η ) → ( V ′ , C ′ , η ′ ) is a symmetric strict effectful functor for whic h F 0 is a cartesian monoidal functor . W rite Freyd for category of F reyd categories and functors b et w een them. B Details for Section 4 B.1 Pr o of of Lemma 4.1 Pro of. ( f a 0 ⊗ id X ′ ) # (id Y ⊗ g ) = ( f a 0 ⊗ id X ′ 0 0 ) # (id Y ⊗ g ) ( Reg-A ct ) = ( f ⊗ id X ′ ) a ⊕ 0 0 ⊕ 0 # (id Y ⊗ g ) ( Reg- ⊗ ) = ( f ⊗ id X ′ ) 0 ⊕ a 0 ⊕ 0 # (id Y ⊗ g ) (PCM comm.) = ( f 0 0 ⊗ id X ′ a 0 ) # (id Y ⊗ g ) ( Reg- ⊗ ) = ( f # id Y ) ⊗ (id X ′ a 0 # g ) ( Reg-A ct , Inter ) = f ⊗ g , 20 Earnsha w, Nester, Rom ´ an and analogous reasoning starting from (id X ⊗ g ) # ( f a 0 ⊗ id Y ′ ) similarly arriv es at f ⊗ g . 2 B.2 Pr o of of Lemma 4.7 Pro of. Lemma 3.6 gives that C a is premonoidal. W rite σ X,Y ∈ C 0 ( X ⊗ Y , Y ⊗ X ) for the braiding of C . Then the braidings of C a are given by ( σ X,Y ) a 0 ∈ C a ( X ⊗ Y , Y ⊗ X ). These satisfy the required axioms of braidings, using axioms for regrading and the axioms of braidings in C 0 , ( i ) ( σ X,Y ) a 0 # ( σ Y ,X ) a 0 = ( σ X,Y # σ Y ,X ) a 0 = (id X ⊗ Y ) a 0 = id X ⊗ Y , ( ii ) (( σ X,Y ) a 0 ⋊ Z ) # ( Y ⋉ ( σ X,Z ) a 0 ) := (( σ X,Y ) a 0 ⊗ a, 0 id Z ) # (id Y ⊗ 0 ,a ( σ X,Z ) a 0 ) = ( σ X,Y ⊗ id Z ) a 0 # (id Y ⊗ σ X,Z ) a 0 = (( σ X,Y ⊗ id Z ) # (id Y ⊗ σ X,Z )) a 0 = ( σ X,Y ⊗ Z ) a 0 ( iii ) ( σ X,I ) a 0 = (id X ) a 0 and for an y f ∈ C a ( X ; Y ) w e hav e naturality , via the symmetry axiom for symmetric E -graded monoidal categories, ( f ⋊ Z ) # ( σ Y ,Z ) a 0 = ( f ⊗ id Z ) # ( σ Y ,Z ) a 0 = ( σ X,Z ) a 0 # (id Z ⊗ f ) = ( σ X,Z ) a 0 # ( Z ⋉ f ) . It remains to show that these braidings are central in C a . Let g ∈ C a ( A ; B ). Unfolding the whiskerings in C a and applying Lemma 4.1 w e obtain (( X ⊗ Y ) ⋉ g ) # (( σ X,Y ) a 0 ⋊ B ) := (id X ⊗ Y ⊗ g ) # (( σ X,Y ) a 0 ⊗ id B ) = (( σ X,Y ) a 0 ⊗ id A ) # (id Y ⊗ X ⊗ g ) =: (( σ X,Y ) a 0 ⋊ A ) # (( Y ⊗ X ) ⋉ g ) , and similarly for the other interc hange equation. Hence ( σ X,Y ) a 0 is cen tral, so C a is a symmetric pre- monoidal category . 2 C Details for Section 5 C.1 Pr o of of Pr op osition 5.6 Pro of. W rite [ ⟨ a, f ⟩ ] ∈ C ( X ; Y ) for the equiv alence class of a morphism f ∈ C a ( X ; Y ). Let [ ⟨ a, f ⟩ ] ∈ C ( X ; Y ) and [ ⟨ b, g ⟩ ] ∈ C ( Y ; Z ). W e define comp osition as follows. Since E is directed, we can choose a c suc h that a, b ⩽ c . Define [ ⟨ a, f ⟩ ] # [ ⟨ b, g ⟩ ] := [ ⟨ c, f c a # c g c b ⟩ ]. W e m ust show this is w ell defined. Firstly , if c ′ is another a, b ⩽ c ′ , then by directedness we can again choose c, c ′ ⩽ d , and by the axioms of E -graded monoidal categories w e hav e ( f c a # c g c b ) d c = ( f c a ) d c # d ( g c b ) d c = f d a # d g d b = ( f c ′ a ) d c ′ # d ( g c ′ b ) d c ′ = ( f c ′ a # c ′ g c ′ b ) d c ′ , so [ ⟨ c, f c a # g c b ⟩ ] = [ ⟨ d, f d a # g d b ⟩ ] = [ ⟨ c ′ , f c ′ a # g c ′ b ⟩ ]. No w let ⟨ p , h ⟩ and ⟨ q , i ⟩ b e different represen tativ es of the equiv alence classes [ ⟨ a, f ⟩ ] and [ ⟨ b, g ⟩ ] re- sp ectiv ely . F or p, q ⩽ r , we m ust show [ ⟨ r, h r p # i r q ⟩ ] = [ ⟨ c, f c a # g c b ⟩ ]. Again, by directedness choose c, r ⩽ z , then w e shall sho w that b oth equiv alence classes are equal to [ ⟨ z , f z a # g z b ⟩ ]. On the one hand, from c ⩽ z w e ha v e [ ⟨ c, f c a # g c b ⟩ ] = [ ⟨ z , f z a # g z b ⟩ ], establishing one of the desired equalities. F rom r ⩽ z and the axioms for regrading, w e hav e [ ⟨ r, h r p # i r q ⟩ ] = [ ⟨ z , h z p # i z q ⟩ ], so it remains to sho w [ ⟨ z , h z p # i z q ⟩ ] = [ ⟨ z , f z a # g z b ⟩ ]. W e ha ve assumed [ ⟨ a, f ⟩ ] = [ ⟨ p, h ⟩ ], so there must exist a sequence ⟨ a 0 , f 0 ⟩ ≡ ... ≡ ⟨ a n , f n ⟩ , with a 0 = a, f 0 = f and a n = p, f n = h , and either a i − 1 ⩽ a i and f i = ( f i − 1 ) a i a i − 1 , or a i ⩽ a i − 1 and f i − 1 = ( f i ) a i − 1 a i , and similarly for g (with sequence of grades b = b 0 , ..., b m = i , say). By directedness of E , there exists an elemen t w such that w ⩾ z , a i , b k for all 0 ⩽ i ⩽ n and 0 ⩽ k ⩽ m . Observe that for any step in the chain, sa y ⟨ a i − 1 , f i − 1 ⟩ ≡ ⟨ a i , f i ⟩ , the morphisms b ecome equal when regraded to w . Explicitly , if a i − 1 ⩽ a i and f i = ( f i − 1 ) a i a i − 1 , then b y the axioms of regrading ( f i ) w a i = (( f i − 1 ) a i a i − 1 ) w a i = ( f i − 1 ) w a i − 1 . 21 Earnsha w, Nester, Rom ´ an The case a i ⩽ a i − 1 follo ws symmetrically . Applying this to each pair w e obtain, f w a = f 0 w a 0 = ... = f n w a n = h w p . Similar reasoning for g establishes g w b = i w q , so finally w e hav e, [ ⟨ z , f z a # g z b ⟩ ] = [ ⟨ w , ( f z a # g z b ) w z ⟩ ] = [ ⟨ w , f w a # g w b ⟩ ] = [ ⟨ w , h w p # i w q ⟩ ] = [ ⟨ w , ( h z p # i z q ) w z ⟩ ] = [ ⟨ z , h z p # i z q ⟩ ] , establishing that comp osition is well defined. F or asso ciativit y , let [ ⟨ a, f ⟩ ], [ ⟨ b, g ⟩ ], [ ⟨ c, h ⟩ ] b e comp osable. W e show b oth orders of comp osition are equal to [ ⟨ t, f t a # t g t b # t h t c ⟩ ] , for som e t ⩾ a, b, c , recalling that # t is asso ciativ e axiomatically . F or instance, compute ([ ⟨ a, f ⟩ ] # [ ⟨ b, g ⟩ ]) # [ ⟨ c, h ⟩ ] b y taking d ⩾ a, b and then t ⩾ d, c , giving [ ⟨ t, ( f d a # g d b ) t d # h t c ⟩ ] = [ ⟨ t, f t a # g t b # h t c ⟩ ], and similarly for the other paren thesisation. Therefore comp osition is asso ciativ e. The iden tity at X is [ ⟨ 0 , id X ⟩ ]. Given [ ⟨ a, f ⟩ ] : X → Y , and taking a ⩾ 0 , a w e hav e left unitality , [ ⟨ 0 , id X ⟩ ] # [ ⟨ a, f ⟩ ] = [ ⟨ a, (id X ) a 0 # a f a a ⟩ ] = [ ⟨ a, f ⟩ ] , with righ t unitality follo wing similarly . 2 C.2 Pr o of of Pr op osition 5.9 Pro of. A total commutativ e monoid has a directed extension preorder since a, b ⩽ a ⊕ b , so C exists by Prop osition 5.6 . Define [ ⟨ a, f ⟩ ] ⊗ [ ⟨ b, g ⟩ ] := [ ⟨ a ⊕ b, f ⊗ a,b g ⟩ ] . T o sho w that this is well defined, it suffices to c heck compatibilit y with the generating relation. If a ⩽ c and ⟨ a, f ⟩ ≡ ⟨ c, f c a ⟩ , then ( f ⊗ g ) c ⊕ b a ⊕ b = f c a ⊗ g b b = f c a ⊗ g b y Reg- ⊗ and Reg-Act , so [ ⟨ a ⊕ b, f ⊗ g ⟩ ] = [ ⟨ c ⊕ b, f c a ⊗ g ⟩ ] . The argumen t in the second v ariable is ident ical, and therefore the monoidal pro duct descends to equiv a- lence classes. The monoidal unit is I , whose identit y morphism in C is [ ⟨ 0 , id I ⟩ ]. Asso ciativit y on morphisms follo ws immediately from ⊗ - U-A . F or instance, ([ ⟨ a, f ⟩ ] ⊗ [ ⟨ b, g ⟩ ]) ⊗ [ ⟨ c, h ⟩ ] = [ ⟨ ( a ⊕ b ) ⊕ c, ( f ⊗ g ) ⊗ h ⟩ ] = [ ⟨ a ⊕ ( b ⊕ c ) , f ⊗ ( g ⊗ h ) ⟩ ] = [ ⟨ a, f ⟩ ] ⊗ ([ ⟨ b, g ⟩ ] ⊗ [ ⟨ c, h ⟩ ]) . Unitalit y for the monoidal pro duct is likewise inherited from ⊗ - U-A : [ ⟨ a, f ⟩ ] ⊗ [ ⟨ 0 , id I ⟩ ] = [ ⟨ a ⊕ 0 , f ⊗ id I ⟩ ] = [ ⟨ a, f ⟩ ] , and similarly on the left, and we hav e that [ ⟨ 0 , id X ⟩ ] ⊗ [ ⟨ 0 , id Y ⟩ ] = [ ⟨ 0 , id X ⊗ id Y ⟩ ] = [ ⟨ 0 , id X ⊗ Y ⟩ ] b y ⊗ - ID . It remains to chec k interc hange with comp osition in C . Let [ ⟨ a, f ⟩ ], [ ⟨ a ′ , h ⟩ ], [ ⟨ b, g ⟩ ], and [ ⟨ b ′ , k ⟩ ] b e comp osable. Using the definition of comp osition from Prop osition 5.6 , choose the upp er b ound a ⊕ a ′ of a, a ′ and b ⊕ b ′ of b, b ′ . Then ([ ⟨ a, f ⟩ ] # [ ⟨ a ′ , h ⟩ ]) ⊗ ([ ⟨ b, g ⟩ ] # [ ⟨ b ′ , k ⟩ ]) = [ ⟨ a ⊕ a ′ , f a ⊕ a ′ a # h a ⊕ a ′ a ′ ⟩ ] ⊗ [ ⟨ b ⊕ b ′ , g b ⊕ b ′ b # k b ⊕ b ′ b ′ ⟩ ] = [ ⟨ a ⊕ a ′ ⊕ b ⊕ b ′ , ( f a ⊕ a ′ a # h a ⊕ a ′ a ′ ) ⊗ ( g b ⊕ b ′ b # k b ⊕ b ′ b ′ ) ⟩ ] = [ ⟨ a ⊕ b ⊕ a ′ ⊕ b ′ , ( f ⊗ g ) ( a ⊕ a ′ ) ⊕ ( b ⊕ b ′ ) a ⊕ b # ( h ⊗ k ) ( a ⊕ a ′ ) ⊕ ( b ⊕ b ′ ) a ′ ⊕ b ′ ⟩ ] , b y Reg- ⊗ , Inter , asso ciativit y and commutativit y of ⊕ . This is exactly the comp osite [ ⟨ a ⊕ b, f ⊗ g ⟩ ] # [ ⟨ a ′ ⊕ b ′ , h ⊗ k ⟩ ] = ([ ⟨ a, f ⟩ ] ⊗ [ ⟨ b, g ⟩ ]) # ([ ⟨ a ′ , h ⟩ ] ⊗ [ ⟨ b ′ , k ⟩ ]) using the common upp er b ound a ⊕ a ′ ⊕ b ⊕ b ′ . Therefore C is a strict monoidal category . 2 22 Earnsha w, Nester, Rom ´ an D Details for Section 6 D.1 Pr o of of Pr op osition 6.3 (c ont.) Pro of. As regards functoriality , w e hav e • if a ′ ⩽ a and P ( a, b ; c ) = ⊤ , then a ′ ⊕ b ⩽ a ⊕ b ⩽ c by Lemma 2.5 , hence P ( a ′ , b ; c ) = ⊤ , and similarly for b , • if c ⩽ c ′ and P ( a, b ; c ) = ⊤ , then a ⊕ b ⩽ c implies a ⊕ b ⩽ c ′ , so P ( a, b ; c ′ ) = ⊤ , • if c ⩽ c ′ and I ( c ) = ⊤ then 0 ⩽ c ⩽ c ′ , so I ( c ′ ) = ⊤ . F or asso ciativit y , we need to show, for arbitrary elemen ts a, b, c, d ∈ E ∃ x ∈ E , a ⊕ x ⩽ d ∧ b ⊕ c ⩽ x ⇐ ⇒ ∃ x ∈ E , a ⊕ b ⩽ x ∧ x ⊕ c ⩽ d. Assume the left hand side holds with witness x , then by Lemma 2.5 we ha ve ( a ⊕ b ) ⊥ c and a ⊕ b ⊕ c ⩽ a ⊕ x ⩽ d , and so a ⊕ b witnesses the righ t hand side. If the right hand side holds with witness x , then Lemma 2.5 similarly giv es that b ⊕ c witnesses the left hand side. F or right unitality , since I is constantly true, w e need to show ∃ x ∈ E , a ⊕ x ⩽ b ⇐ ⇒ a ⩽ b. Let the left hand side hold with witness x . Then since 0 ⩽ x , w e hav e a = a ⊕ 0 ⩽ a ⊕ x ⩽ b from Lemma 2.5 . Conv ersely , if the righ t hand side holds, 0 witnesses the left hand side. Left unitalit y is analogous. 2 D.2 Pr o of of The or em 6.6 (c ont.) Pro of. F or the conv erse, let an E -graded monoidal category b e given in the sense of Definition 3.1 . Then immediately w e hav e sets C a ( X ; Y ), asso ciativ e and unital comp ositions ( # ) a with iden tities (id X ) a := (id X ) a 0 , and regrading functors ( − ) b a . F or every a ⊕ b ⩽ c , define f ⊗ a,b ; c g := ( f ⊗ a,b g ) c a ⊕ b , η c := (id I ) c 0 . As b efore, item 1.(iii) is exactly Reg-A ct . Item 1.(vii) follo ws an application of Reg-Act . F or item 1.(vi) , let a ⩽ a ′ , b ⩽ b ′ , and a ′ ⊕ b ′ ⩽ c . Then a ⊕ b ⩽ c , so b oth sides b elo w are defined, and ( f a ′ a ) ⊗ a ′ ,b ′ ; c ( g b ′ b ) := (( f a ′ a ) ⊗ a ′ ,b ′ ( g b ′ b )) c a ′ ⊕ b ′ = (( f ⊗ a,b g ) a ′ ⊕ b ′ a ⊕ b ) c a ′ ⊕ b ′ ( Reg- ⊗ ) = ( f ⊗ a,b g ) c a ⊕ b ( Reg-A ct ) =: f ⊗ a,b ; c g . Item 1.(viii) follows similarly , by application of Reg-Act . F or item 1.(ix) , supp ose grades satisfying the h yp otheses are giv en. Then, we hav e ( f ⊗ a,b ; x g ) ⊗ x,c ; d h := ((( f ⊗ g ) x a ⊕ b ) ⊗ h ) d x ⊕ c := ((( f ⊗ g ) x a ⊕ b ) ⊗ h c c ) d x ⊕ c (Reg-A ct) = ((( f ⊗ g ) ⊗ h ) x ⊕ c ( a ⊕ b ) ⊕ c ) d x ⊕ c (Reg- ⊗ ) = (( f ⊗ g ) ⊗ h ) d ( a ⊕ b ) ⊕ c , (Reg-A ct) 23 Earnsha w, Nester, Rom ´ an An analogous deriv ation from the right hand side yields the same result, after applying ⊗ - U-A and asso ciativit y of PCMs . F or item 1.(x) , let a ⊕ b ⩽ c . Then f ⊗ a,b ; c η b := ( f ⊗ a,b (id I ) b ) c a ⊕ b = ( f ⊗ a,b (id I ) b 0 ) c a ⊕ b (def. of (id I ) b ) = (( f ⊗ id I ) a ⊕ b a ) c a ⊕ b ( Reg- ⊗ , Reg-A ct ) = ( f ⊗ id I ) c a ( Reg-A ct ) = f c a . ( ⊗ - U-A ) and similarly for left unitalit y . F or item 3.(iii) , let a ⊕ b ⩽ c . Then (id X ) a ⊗ a,b ; c (id Y ) b := ((id X ) a ⊗ a,b (id Y ) b ) c a ⊕ b = ((id X ) a 0 ⊗ a,b (id Y ) b 0 ) c a ⊕ b (def. of grade- a, b identities) = ((id X ⊗ id Y ) a ⊕ b 0 ) c a ⊕ b ( Reg- ⊗ ) = (id X ⊗ id Y ) c 0 ( Reg-A ct ) = (id X ⊗ Y ) c 0 ( ⊗ - ID ) =: (id X ⊗ Y ) c . Item 3.(iv) is immediate. F or item 2.(iii) , let a ⊕ b ⩽ c . Then we ha ve ( f # a g ) ⊗ a,b ; c ( h # b i ) := (( f # a g ) ⊗ a,b ( h # b i )) c a ⊕ b = (( f ⊗ a,b h ) # a ⊕ b ( g ⊗ a,b i )) c a ⊕ b ( Inter ) = ( f ⊗ a,b h ) c a ⊕ b # c ( g ⊗ a,b i ) c a ⊕ b (reg. func.) =: ( f ⊗ a,b ; c h ) # c ( g ⊗ a,b ; c i ) . Item 2.(ii) follo ws from the functorialit y of regrading, item 3.(ii) follo ws from Reg-Act . W e therefore ha ve a monoid in ( MonCat lax ( C op ob j × C ob j , ([ E , Set ] , ∗ , J )) , ◦ , L ). 2 24
Original Paper
Loading high-quality paper...
Comments & Academic Discussion
Loading comments...
Leave a Comment