A Double Category Theoretic Analysis of Graded Linear Exponential Comonads

Graded linear exponential comonads are an extension of linear exponential comonads wih grading, and provide a categorical semantics of resource-sensitive exponential modality in linear logic. In this paper, we propose a concise double-category theoretic formulation of graded linear exponential comonads as a kind of monoid homomorphisms from the multiplicative monoids of semirings to the composition monoids of symmetric monoidal endofunctors. We also exploit this formulation to derive the category of graded comonoid-coalgebras, which decompose graded linear exponential comonads into symmetric monoidal adjunctions plus twists.


Introduction
One of the important discoveries in substructural logic is the decomposition of the intuitionistic implication φ ⇒ ψ using the linear implication and the exponential modality !. This discovery was studied by Girard through his linear logic, which brought many new ideas and perspectives to logic and programming language semantics.
Inside linear logic proofs, propositions with the exponential modality !φ can be freely copied or discarded. Later, it was realized that by adding a copy limit to the exponential modality, like ! r φ, linear logic gains fine control of assumption usage. This idea was first implemented in bounded linear logic [9], and studied in connection with implicit complexity theory [4,14]. Indexed exponential modalities ! r were then used in wider context: resource management in programming languages [3,7,8,20,23] and control of sensitivity in the metric semantics of programs [5,21].
The categorical structure corresponding to the exponential modality ! was studied by various researchers, and it was identified as a categorical structure called linear exponential comonad [1]. One of the celebrated results about linear exponential comonads is that any symmetric lax monoidal adjunction: The categorical structure corresponding to the indexed exponential modality ! r has been proposed as exponential action [3] and graded linear exponential comonad [7]; they are two different presentations of the same data. Compared to linear exponential comonads, however, categorical understanding of graded linear exponential comonads is not well-established. The aim of this paper is to contribute to this point. Concretely speaking, we show the following categorical results about graded linear exponential comonads: -We give a new concise formulation of graded linear exponential comonads as vertical monoid homomorphisms from multiplicative monoids of semirings to the composition monoids of symmetric lax monoidal endofunctors. This formulation is given in a rather complex multi-double category of symmetric monoidal categories. The slogan is "to represent a complex structure in a simple category as a simple structure in a complex category". -In the multi-double category, vertical monoid homomorphisms themselves can be seen as monoids. By considering actions of such monoids, we obtain the concept of graded comonoid-coalgebras. They are an extension of Eilenberg-Moore coalgebras to graded linear exponential comonads, and the category of graded comonoid-coalgebras provides a resolution of graded linear exponential comonads by a symmetric lax monoidal adjunction plus a twist.

Related Work
Graded linear exponential comonads were first introduced as exponential actions in [3], and an equivalent definition was given in [7]. This paper adopts the latter definition as the starting point of study. These papers also consider linear type systems with an indexed exponential modality ! r φ, which is directly interpreted by a graded linear exponential comonad. This paper, however, focuses only on the categorical axiomatics of the indexed exponential modality, and omit its syntactic theory. In [2], Breuvart and Pagani gave a construction of graded linear exponential comonads from a set of data called stratification. They derived various graded linear exponential comonads on the category of sets and binary relations and the category of coherence spaces. Structures close to, but different from, graded linear exponential comonads were considered in the categorical semantics of the following calculi: INTML for interactive computation [23], coeffect calculus [20] and bounded affine types system [8].
Looking at the dual structure, graded monads, first considered in mathematics [6,25], were recently used in the semantic study of logic, systems and programming languages [13,18,19,22]. The resolution of graded monads were studied in [12], mildly extending a classic work by Street [26]. The major difference between graded monads and graded linear exponential comonads is the way how they interact with the monoidal structure. In [13] only strengths were considered for graded monads, while graded linear exponential comonads interact with monoidal structures in an intricate manner.
The multicategory of symmetric lax monoidal multifunctors is related to the 2-multicategory of T -algebras for a pseudo-commutative 2-monad T [11].
Hyland and Power studied multifunctors that are symmetric strong monoidal in each argument, while in this paper we weaken "strong" to "lax". Yet, we think that by suitably extending their theory, the symmetric lax monoidal multifunctors can also be given in the language of 2-monad theory.
Monoids in the multicategory MSMC l in Sect. 5 are similar to the distributivity studied in [15], where Laplaza considered two symmetric non-strict monoidal structures together with a colax distributivity between them. On the other hand, in this paper, we consider a strict monoidal structure on top of the underlying symmetric (non-strict) monoidal structure, and a lax distributivity between them.

Preliminaries
For symmetric monoidal categories and symmetric lax monoidal functors, see [16]. In a symmetric monoidal category C, by ι : I ⊗ I → I we mean the isomorphism λ I = ρ I , and by τ : we mean the symmetry swapping the second and third component of the tensor product. For functors F i : whose codomain is the product category without the nesting of products.
Let C, D be symmetric monoidal categories. We write SMC l (D, C) for the category of symmetric lax monoidal functors and monoidal natural transformations between them. The following pointwise extension of the tensor unit and tensor product on C extends to a symmetric monoidal structure on SMC l (D, C): (We note that the symmetry in C is used to make F⊗ G a symmetric lax monoidal functor.) Below by [D, C] l we mean the symmetric monoidal category (SMC l (D, C),İ,⊗) of symmetric lax monoidal functors and monoidal natural transformations between them.

Graded Linear Exponential Comonad
Fix a partially ordered semiring (R, ≤, 0, +, 1, * ). We introduce the main subject of this study, R-graded linear exponential comonad. This concept first appeared in [3,Definition 13] under the name exponential action. We adopt the following definition [7,Sect. 5.2], which is equivalent to the exponential action: They satisfy four equational axioms in Fig. 1. Moreover, we say that D is an Rtwist if Dr is strong monoidal for each r ∈ R, and (D, , δ) is a strict monoidal functor (hence D1 = Id and D(r * r ) = Dr • Dr ).

Example 1.
Let C be a cartesian closed category. We take a partially ordered monoid R × = (R, ≤, 1, ×) such that (R, ≤) is a join semilattice and × preserves joins in both arguments. This condition makes the tuple R = (R, ≤, ⊥, ∨, 1, ×) a partially ordered semiring. We also take a lax monoidal functor G : Example 3. Consider the category EPMet of extended pseudometric spaces 1 and nonexpansive functions between them. It has a symmetric monoidal (closed) structure, whose unit is a terminal object, and whose tensor product is given by where r is an element of the ordered semiring of nonnegative extended reals, which we denote by [0, ∞]. The scaling modality is a [0, ∞]-twist with respect to the above symmetric monoidal structure.
The concept of R-graded linear exponential comonad is a generalization of non-graded linear exponential comonad [1,Definition 3]. This was first observed in [3].

Theorem 1. A 1-graded linear exponential comonad on a symmetric monoidal category C is exactly a non-graded linear exponential comonad on C.
On the other hand, 1-twists make monoidal structures cartesian:

Theorem 2. A 1-twist D exists on a symmetric monoidal category C if and only if the symmetric monoidal structure of C is cartesian (i.e. I is terminal and ⊗ is a binary product).
Proof. If it exists, the functor part of D must specify the identity functor Id C because of the strictness. Next, (Id, w, c) becomes a commutative monoid in [C, C] l ; especially w, c are monoidal natural transformations. From [17,Corollary 17], the monoidal structure of C is cartesian. The converse construction is evident.

A Double-Category Theoretic Reformulation of Graded Linear Exponential Comonad
Although it is in a reasonably compact form, the definition of graded linear exponential comonad is yet technical, and it indeed specifies a quite complex structure. The motivation of this study is to have a conceptually clean and compact definition of it. Particularly, what is less clear in the definition is the extra four axioms related to the distributive law (Fig. 1). In the non-graded setting (i.e. when R = 1), these four axioms reduces to simpler axioms, which can be viewed as the following conditions: -comultiplication δ is a comonoid morphism, (item 4, Sect. 7.4, [17]) and -weakening w and contraction c are coalgebra morphisms (item 3, Sect. 7.4, [17]).
However, it is not obvious how to upgrade these axioms to the graded setting, because the concept of "graded coalgebra" and "graded comonoid" are not yet defined, at least for graded linear exponential comonads. Especially, the concept of graded coalgebra should be defined after the concept of graded linear exponential comonad, which we are going to define! From this circularity, the above view of the four axioms are not very helpful when upgrading them in the current situation.
It is therefore desirable to have an alternative account on four axioms in Fig. 1, which relies on a notion that already exists before graded linear exponential comonads. The key observation of this paper is that these four axioms are an instance of the axioms for 2-cells in the double category SMC of symmetric monoidal categories, introduced by Grandis and Paré [10,Sect. 2.3]. In SMC, a 2-cell consists of the following data: We note that when V, V (resp. H, H ) are identity functors, the above axioms are reduced to the ones for monoidal natural transformations of type V → V (resp. H → H ).
Let us see how 2-cell axioms (1) in SMC derives the four axioms in Fig. 1.

Proposition 1.
In Definition 1, the four axioms (Fig. 1) can be replaced by the following statement: for each r ∈ R, both In order to create a room to accommodate δ as a kind of 2-cell, we extend horizontal morphisms of SMC to multi-ary functors that are symmetric lax monoidal in each argument. We first study such multi-ary functors in this section. Let C i (1 ≤ i ≤ n) and D be symmetric monoidal categories. Intuitively, an n-ary functor F : C 1 × · · · × C n → D is symmetric lax monoidal in each argument if it comes with a structure making the functor F (C 1 , .., − m , .., C n ) : C m → D symmetric lax monoidal for each m ∈ {1, · · · , n} and C i ∈ C i , i ∈ {1, · · · , n}\{m}. Moreover, these symmetric lax monoidal structures commute with each other in a coherent manner.
To formally define such multi-ary symmetric lax monoidal functors, we introduce a notation for sequences. For a sequence C = C 1 , · · · , C n of mathematical objects, a natural number 1 ≤ i ≤ n and another sequence D, by C[i : D] we mean the sequence obtained by replacing C i with D. For instance, (1,3,5)[2 : X, Y ] = 1, X, Y, 5. When D is empty, C[i :] stands for the sequence obtained by removing the i-th element of C.

Definition 2.
A symmetric lax monoidal multifunctor of type (C 1 , · · · , C n ) → D consists of a functor and a family of natural transformations indexed by 1 ≤ i ≤ n: such that: is a symmetric lax monoidal functor from C i to D. We denote it by F (C/i). 2. The following equalities hold for each C ∈ C 1 × · · · × C n and 1 ≤ i < j ≤ n: We note that a symmetric lax monoidal multifunctor of type () → D is just an object in D, because all natural transformations vanish and only the functor of type 1 → D remains.

Example 4.
Let us see how the definition of a binary symmetric lax monoidal multifunctor M : (C, C) → C is unfolded. It consists of a functor M : C × C → C and the following natural transformations: We will later use the following binary symmetric lax monoidal multifunctors. Let R be a partially ordered semiring and C be a symmetric monoidal category. Note that ( * ) is symmetric strict monoidal in each argument, while (•), ev are symmetric strict monoidal in the first argument, and symmetric lax monoidal in the second argument.
Next, for symmetric lax monoidal multifunctors (F, φ) : (C 1 , · · · , C n ) → D and (G i , γ(i)) : (B i,1 , · · · , B i,mi ) → C i (1 ≤ i ≤ n), we define their multicomposition. First, we define a bijection (/) : , · · · , 1≤i≤n m i }, and represent a number in the latter set as the pair of numbers uniquely determined by (/) in the former set. Then the multicomposition is given by the following (H, η): By unfolding the definition, a monoid (C, U, M) in MSMC l equips C with an additional strict monoidal structure (U, M ). The argument-wise symmetric lax monoidal structure on M becomes a lax distributivity (see Example 4). Thus we call a monoid in MSMC l a lax distributive strict rig category. It has a smaller set of coherence axioms than the one given by Laplaza in [15], thanks to the strictness of (U, M ).

Graded Linear Exponential Comonads as Vertical Monoid Homomorphisms
We now extend the double category SMC of Grandis and Paré by replacing horizontal morphisms with symmetric lax monoidal multifunctors. The concept of 2-cells in SMC is also replaced by prisms -the reason of the name is because they are placed in the middle of the space surrounded by two horizontal multifunctors and vertical morphisms. Such a prism is defined to be a natural transformation that is a 2-cell of SMC in each argument. Definition 3. Let F : (C 1 , · · · , C n ) → D and G : (E 1 , · · · , E n ) → F be symmetric lax monoidal multifunctors and V i : is a 2-cell of the following type in the double category SMC: We note that when n = 0, a prism α : Like double categories, composition of prisms can be done in two directions. Consider the following prisms (1 ≤ i ≤ n).
Then define vertical composition and horizontal multicomposition of prisms by the following (ordinary) natural transformations: where • on the right hand side is the vertical composition of natural transformations. Proposition 3. In the above setting,
such that the following prism equalities hold: The above prism equalities amounts to the following equality of natural transformations: With this concept, we can concisely capture R-graded linear exponential comonads: 2. An R-graded linear exponential comonad on C.
Vertical monoid homomorphisms vertically compose. Therefore we can extend a graded linear exponential comonad (as a vertical monoid homomorphism) by stacking vertical monoid homomorphisms.

Proposition 4.
Let R, S be partially ordered semirings. Then a vertical monoid homomorphism from (R + , 1 R , * R ) to (S + , 1 S , * S ) bijectively corresponds to a monotone function h : Proof. Let F U : C → D be a symmetric lax monoidal adjunction. From Kelly's doctrinal adjunction, F is symmetric strong monoidal, hence so is F • − in the following diagram: Next, − • U above is always symmetric strict monoidal. By composing them, we obtain that V F U is symmetric strong, hence colax monoidal. We next introduce prisms ( , δ) of the following type: We define to be the counit of the adjunction F U , which is monoidal natural, and δ be the following natural transformation: It is routine to check that this satisfies the axioms of prism.
Theorem 5. Let R be a partially ordered semiring and D be an R-graded linear exponential comonad on a symmetric monoidal category C. We moreover let S be another partially ordered semiring, h : S → R be a colax homomorphism and F U : C → D be a symmetric lax monoidal adjunction. Then the following composite of vertical monoid homomorphisms is an S-graded linear exponential comonad on D.
We call the above composite the extension of D with F U and h.

From Monoid Actions to Graded Comonoid-Coalgebras
Let (D, , δ) : (R + , 1, * ) → ([C, C] l , Id, •) be an R-graded linear exponential comonad as a vertical monoid homomorphism. The prism equations in Definition 4 suggests that the vertical monoid homomorphism itself can be seen as a monoid. We can thus consider monoid actions of (D, , δ): it consists of a prism A morphism from an R-graded comonoid-coalgebra (A, a, u, o) to another (B, b, v, p)   Like C D , there is a symmetric lax monoidal adjunction of the following type: but this itself is not enough to recover D -D takes two arguments, while the composite F • U is only equal to the symmetric lax monoidal comonad D1 on C.
The category C(C, D) actually carries an R-twist T , which acts on comonoidcoalgebras as follows: T r(A, · · · ) = (A(− * r), · · · ), and D is recovered as the extension of T with the adjunction F U (Theorem 5). R be a partially ordered semiring and (D, w, c, , δ) be an Rgraded linear exponential comonad on a symmetric monoidal category C.

Theorem 7. Let
1. The functor F : C(C, D) → C given by F (A, a,    Proof. From Theorem 1, D is a 1-graded linear exponential comonad on C. Therefore C(C, D) has a 1-twist by Theorem 7-3. Therefore the symmetric monoidal structure of C(C, D) is cartesian by Theorem 2. Finally, C(C, D) is strong monoidally isomorphic to C D by Theorem 6, hence the symmetric monoidal structure of C D is also cartesian.
We show the finality of the category of graded comonoid-coalgebras. Let R be a partially ordered semiring and D be an R-graded linear exponential comonad on a symmetric monoidal category C. We define a resolution of D to be a pair of a symmetric lax monoidal adjunction J K : E → C and an R-twist (S, w S , c S ) on E such that the extension of S with J K is equal to D.

Conclusion
We have given a concise characterization of graded linear exponential comonad as a vertical monoid homomorphism (D, , δ) from (R + , 1, * ) to ([C, C] l , Id, •). This characterization is built upon a combination of the theory of symmetric lax monoidal multifunctors and Grandis and Paré's double category of symmetric monoidal categories. After this characterization, we considered monoid actions, and derived the concept of graded comonoid-coalgebras. The category of graded comonoid-coalgebras are shown to give a resolution of the graded linear exponential comonad D. These results are consistent with the theory of non-graded linear exponential comonads developed in [1].
It remains to be seen if the category of graded comonoid-coalgebras can be constructed in a purely double-category theoretic way. In non-graded case, there are other type of categorical models of exponential modality using Lafont category and Seely category [17]. Graded version of these categories are also an interesting research topic.