Graded Diﬀerential Categories and Graded Diﬀerential Linear Logic ⋆

In Linear Logic ( LL ), the exponential modality ! brings forth a distinction between non-linear proofs and linear proofs, where linear means using an argument exactly once. Diﬀerential Linear Logic ( DiLL ) is an extension of Linear Logic which includes additional rules for ! which encode diﬀerentiation and the ability of linearizing proofs. On the other hand, Graded Linear Logic ( GLL ) is a variation of Linear Logic in such a way that ! is now indexed over a semiring R . This R -grading allows for non-linear proofs of degree r ∈ R , such that the linear proofs are of degree 1 ∈ R . There has been recent interest in combining these two variations of LL together and developing Graded Diﬀerential Linear Logic ( GDiLL ). In this paper we present a sequent calculus for GDiLL , as well as introduce its categorical semantics, which we call graded diﬀerential categories, using both coderelictions and deriving transformations. We prove that symmetric powers always give graded diﬀerential categories, and provide other examples of graded diﬀerential categories. We also discuss graded versions of (monoidal) coalgebra modalities, additive bialgebra modalities, and the Seely isomorphisms, as well as their implementations in the sequent calculus of GDiLL .


Introduction
Linear Logic (LL) was introduced by Girard in [17], and is a resource-sensitive logic whose categorical semantics are based in monoidal category theory [23].A key feature of LL is that there is a natural notion of linearity, allowing for a distinction between non-linear proofs and linear proofs.In many models of LL, the logical notion of linear, meaning using an argument exactly once, coincides with the algebraic notion of linear, meaning preserving addition.In the multiplicative and exponential fragments of LL (MELL), the separation between linear and non-linear is captured thanks to the exponential modality, which is a unary connective !, read as "of course" or "bang".A non-linear proof of A implies B is of the form !A ⊢ B, while a linear proof is of the form A ⊢ B. A categorical model of MELL, often called a linear category [2, Def 3], is a symmetric monoidal closed category equipped with monoidal coalgebra modality [6,Sec 3], also sometimes called a linear exponential modality, which in particular is a comonad !such that each !A is naturally a cocommutative comonoid.So categorically speaking, a non-linear map from A to B is a map of type !A → B, while a linear map from A to B is one of type A → B. One of the great aspects of monoidal category theory is its flexibility.As such, this allows for many natural variations, extensions, and generalizations of LL and its fragments.
In one direction there is Differential Linear Logic (DiLL), which was introduced by Ehrhard and Regnier in [14].In particular, DiLL is an extension of MELL which adds a differentiation structural rule for !, which allows one to differentiate non-linear proofs to obtain linear proofs.The categorical semantics of DiLL is provided by differential categories, which were introduced by Blute, Cockett, and Seely in [4].Differential categories were further developed by Fiore [15] and Ehrhard [13], and then again revisited by Blute, Cockett, Seely, and the first author in [3].In a differential category, the non-linear maps !A → B are interpreted as smooth maps, meaning infinitely differentiable.The differential structure can be defined in terms of either a deriving transformation ∂ : !A ⊗ A → !A [4, Def 2.5] or a codereliction d : A → !A [4,Def 4.11], which were shown to indeed be equivalent in [3,12].
In another direction there is Graded Linear Logic (GLL), whose conception originated from Girard, Scedrov, and Scott's bounded linear logic [18].The exponential fragment of GLL is now graded over a fixed semiring R, which means that there are unary connectors !r for each r ∈ R.This allows for non-linear proofs of degree r, !r A ⊢ B, such that the linear proofs are of degree 1 ∈ R. Categorically speaking, the R-graded exponential modality is captured by an R-graded monoidal coalgebra modality [19,Def 1], also called a graded linear exponential comonad, first introduced by Brunel et al. in [10] (under the name exponential action), and then further studied by Breuvart and Pagani in [9], Gaboardi et al. in [16], and Katsumata in [19].In particular, an R-graded monoidal coalgebra modality is an R-graded comonad such that all the !r A naturally form a graded comonoid.So a non-linear map of degree r is a map of type !r A → B, and from a linear map A → B, we can obtain a non-linear map of degree 1, ! 1 A → B.
There has been a recent desire to combine DiLL and GLL [8,20] to obtain Graded Differential Linear Logic (GDiLL).As such, in this paper, we introduce a sequent calculus for GDiLL, and also introduce graded differential categories (Sec 3), which provide the categorical semantics of GDiLL.We provide graded versions of both the deriving transformation, now of type ∂ r : !r A ⊗ A → !r+1 A (Def 3.1), and the codereliction, now of type d : A → ! 1 A (Def 5.1).We will also explain why deriving transformations and coderelicitons are still equivalent in the graded setting (Thm 5.2).The main intuition in a graded differential category is that the derivative of a smooth map of degree r + 1 has degree r, which is analogous to the fact that the derivative of x n+1 is (n+1)•x n , and that the linear maps are precisely the smooth maps of degree 1.This intuition is nicely captured by symmetric powers, which we show always give a graded differential category and capture differentiating (homogenous) polynomials (Sec 6).We also discuss other examples of graded differential categories, including R-valued multisets.
Graded differential categories also provide a solution to the problem presented by the first author in [21].Indeed, in said paper, it is explained why the category of finite dimensional Hilbert spaces (FHILB), the main model of interest in categorical quantum mechanics, has no non-trivial differential category structure.Briefly, in the non-graded setting, !A has a distinct "infinite dimensional" flavour to it.However, in the graded setting, !r A no longer carries this "infinite dimensional" flavour.In particular, this is the case regarding the symmetric powers construction, since individually the symmetric powers of a finite-dimensional Hilbert space are again finite-dimensional.Therefore, while FHILB may not be an interesting (co)differential category, FHILB is in fact a very interesting graded (co)differential category.As such, graded differential categories allow us to consider more "finite dimensional" flavoured models of differential categories and provide a path for studying differential category theory in categorical quantum mechanics.
In order to properly define graded differential categories, we also review graded versions of coalgebra modalities and monoidal coalgebra modalities (Sec 2), as well as introduce the novel concept of a graded additive bialgebra modality (Sec 4).This latter concept provides a solution to the problem regarding Seely isomorphisms in the graded setting.Indeed, in the non-graded setting, a monoidal coalgebra modality can equivalently be described as either a storage modality [3, Def 10], which in particular is a comonad ! with the Seely isomorphisms !(A × B) ∼ = !A ⊗ !B (where ⊗ is the monoidal product and × is the product), or as an additive bialgebra modality [3,Def 5], which in particular is a comonad !where !A is naturally a bialgebra.Unfortunately in the graded setting, the R-grading makes the constructions between these concepts no longer properly typed.In particular for the Seely isomorphisms, one should not expect that !r (A × B) be isomorphic to ! r A ⊗ !r B -in particular the symmetric powers example fails this.So we must be careful in the definitions of graded Seely isomorphisms and graded additive bialgebra modalities.
The fact that, in the non-graded setting, monoidal coalgebra modalities and additive bialgebra modalities are indeed equivalent [3,Thm 1] was crucial for proving that there was a bijective correspondence between deriving transformations and coderelictions.Since we wish this bijective correspondence to still hold in the graded setting, we will require by definition that a graded additive bialgebra modality (Def 4.2) be a graded monoidal coalgebra modality -which was not required in the non-graded case.As such, graded additive bialgebra modalities lead us to the correct version of the graded Seely isomorphisms (Thm 4.5) which is that !r (A ⊕ B) ∼ = s+t=r !s A ⊗ !t B (where ⊕ is the biproduct since we will be working in a setting with additive structure).When taking the grading over the zero semiring 0, we recover the non-graded versions, that is, 0-graded additive bialgebra modalities, the 0-graded Seely isomorphism, and 0-graded differential categories are the same as additive bialgebra modalities, the Seely isomorphism, and differential categories.
Conventions: The graded story involves heavy usage of indexing.To not overload notation, we will omit the object index for identity maps and natural transformations.In an arbitrary category, we write identity maps as 1 : A → A and write composition diagrammatically, that is, the composition of maps f : A → B and g : B → C is denoted f ; g : A → C, which first does f then g.For the definitions of this paper, we provide the necessary axioms as equations, while commutative diagram versions for these equations can be found in [22, App A], which is a version of this paper which includes an appendix.

Graded Linear Logic and Graded Coalgebra Modalities
In this section, we review the sequent calculus for the exponential fragment of GLL and its categorical semantics, specifically graded (monoidal) coalgebra modalities.In previous work [9,10,19], the grading of GLL is often considered to be over a partially ordered semiring.For the story of this paper, we will slightly generalize and consider a grading over just a semiring.So throughout this paper, an arbitrary semiring is denoted as the tuple R = (|R|, +, * , 0, 1), where |R| is the underlying set, + is the addition, * is the multiplication, 0 the additive unit, and 1 is the multiplicative unit.As a shorthand, when there is no confusion, we will simply write the multiplication as rs := r * s.
In this paper, we work in the intuitionistic setting, so we do not assume negations (since it does not play a role in the differential story).The multiplicative and additive fragments of GLL are the same as LL (see [23] for a review of these fragments).For the exponential fragment of GLL, we now have for each r ∈ R a unary connector !r , called the exponential modality at r or just read as "bang r", and which together satisfy graded versions of the four exponential modality rules from LL.In this case however, the weakening rule (w) is only for !0 , the dereliction rule (d) is only for ! 1 , while the contraction rule (c) depends on pairs of elements r, s ∈ R and the promotion rule (prom) depends on tuples of elements r, s i ∈ R: The four rules are each associated with a separate aspect of the semiring structure.The weakening is associated with the zero element, the dereliction to the multiplicative unit, the contraction to addition, and the digging to multiplication.The cut-elimination rules can be found in [9, Fig 2].Now let's turn our attention to the underlying category theory.Recall that the categorical semantics of the multiplicative fragment of LL is interpreted by a symmetric monoidal closed category and the additive fragment by finite products (see [23] for a review of these details).Since neither being closed nor having products is necessary for the categorical definition of the exponential modality, we will not require them here (though we will add products to the story later in Sec 4 when discussing the Seely isomorphisms).Thus we will for now simply work with symmetric monoidal categories.For simplicity, we allow ourselves to work within a symmetric strict monoidal category, meaning that the associativity and unit isomorphisms for the monoidal product are identities.An arbitrary symmetric monoidal category is denoted as the tuple L = (|L|, ⊗, I, σ) where |L| is the underlying category, ⊗ is the monoidal product, I is the monoidal unit, and σ : A ⊗ B → B ⊗ A is the natural symmetry isomorphism.By strictness, we have that A ⊗ I = A = I ⊗ A and can write A 1 ⊗ . . .⊗ A n .
In the categorical semantics of GLL, the exponential modality is interpreted by an R-graded symmetric monoidal comonad such that altogether the !r A naturally form an R-graded cocommutative comonoid.Unpacking this, we have that !r is a functor, while the four exponential rules are given by natural transformations.The weakening is given by a natural transformation of type w : !0 A → I and the dereliction by a natural transformation of type d : ! 1 A → A. On the other hand, the contraction is given by an R-indexed family of natural transformations c r,s : !r+s A → !r A ⊗ !s A, while the promotion gives us three R-indexed families: (i) p r,s : , and (iii) µ I r : I → !r I.We will in fact split the definition in two, one without µ ⊗ , and µ I , and one with them.This is because we wish to provide a graded version of Blute, Cockett, and Seely's original definition of a differential category [4], which does not require non-graded versions of µ ⊗ and µ I .So the following is the graded version of [3, Def 1].Definition 2.1 An R-graded coalgebra modality on a symmetric monoidal category L is a tuple (!, p, d, c, w) consisting of a family of endofunctors !where for every r ∈ R we have an endofunctor !r : L → L; two families of natural transformations p and c where for every r, s ∈ R we have a natural transformation of type p r,s : !rs A → !r !s A and c r,s : !r+s A → !r A ⊗ !s A; two natural transformations d : ! 1 A → A and w : !0 A → I, and such that the following equalities hold for all r, s, t ∈ R: (ii) (A, c, w) is an R-graded cocommutative comonoid: (iii) p is an R-graded comonoid morphism: p r+s,t ; c r,s = c rt,st ; (p r,t ⊗ p s,t ) p 0,r ; w = w In a symmetric monoidal category with an R-graded coalgebra modality !, we can interpret both linear maps and non-linear maps of degree r ∈ R. A linear map from A to B is simply a map of type A → B. On the other hand, a non-linear map of degree r is a map of type !r A → B. We can use d to forget about the linearity of a linear map f : A → B and obtain a non-linear map of degree 1 as the composite d; f : ! 1 A → B. We stress that in some models, not all non-linear maps of degree 1 are linear maps.Using p we can compose non-linear maps f : !s A → B and g : !r B → C to obtain a non-linear map of degree rs defined as the composite p r,s ; !r (f ); g : !rs A → C. We can take the product of non-linear maps f : !r A → B and g : !s A → C using c to obtain a non-linear map of degree r + s defined as the composite c r,s ; If one wishes to write down a sequent calculus for coalgebra modalities, one would replace the promotion rule with a weaker version: This weaker version still allows us to obtain p and the functoriality of !r .Adding back µ ⊗ r , and µ I r , we obtain the notion of an R-graded monoidal coalgebra modality.In this paper, we've elected to use the term graded monoidal coalgebra modality rather than graded linear exponential comonad to more closely follow the terminology used in differential category literature, specifically [3].So the following is indeed the same as [19, Def 1] (but without the assumption of order), which is a graded version of [3, Def 2].Definition 2.2 An R-graded monoidal coalgebra modality on a symmetric monoidal category L is a tuple (!, p, d, c, w, µ ⊗ , µ I ) consisting of an R-graded coalgebra modality (!, p, d, c, w), and two families of natural transformations µ ⊗ and µ I where for every r ∈ R we have natural transformations of type µ ⊗ r : !r A ⊗ !r B → !r (A ⊗ B) and µ I r : I → !r I, and such that the following equalities hold for all r, s, t ∈ R: (ii) p and d are R-graded monoidal transformations: (iii) c and d are R-graded monoidal transformations: (iv) c and d are R-graded !-coalgebra morphisms: Every non-graded (monoidal) coalgebra modality is trivially graded over the zero semiring: Example 2.3 Let 0 be the zero semiring.Then a 0-graded (monoidal) coalgebra modality is precisely a non-graded (monoidal) coalgebra modality.
Here is now a running example we will use throughout the paper of a graded coalgebra modality on the category of sets and relations REL.Recall that REL is the category whose objects are sets X and whose maps S : X → Y are subsets S ⊆ X × Y , and also that REL is a symmetric monoidal category where the monoidal product is given by the Cartesian product X ⊗ Y = X × Y (but this not the categorical product) and the monoidal unit is a chosen singleton I = { * }.
Example 2.4 Finite multisets valued in R induce an R-graded monoidal coalgebra modality on REL.For a function f : X → R, define the support of f as the set: For every set X and every r ∈ R, define the set ! r X as follows: To define the rest of the structure, we need to first define a few special finite multisets.Define 0 : X → R which maps everything to zero, 0(x) = 0, and note that deg(0) = 0, so 0 ∈ !0 X.For each x ∈ X, define , and note that if f and g have finite support then deg(f + g) = deg(f ) + deg(g).We now define the following relations: Other examples of graded monoidal coalgebra modalities can be found in [19].In Section 6, we will review how symmetric powers always provide an N-graded monoidal coalgebra modality.

Graded Differential Categories
In this section, we introduce the main novel concept of this paper: graded differential categories, which are graded versions of Blute, Cockett, and Seely's differential categories [4].In particular, this means we will provide a graded version of the deriving transformation approach to differential categories.The associated sequent calculus is an extension of GLL in which there are appropriate notions of zero proofs and sums of proofs, and with an extra differentiation rule (∂): satisfying the equivalent cut elimination steps for the equations provided below.Categorically speaking, sums and zeroes are provided by an additive enrichment of the underlying category.So an additive symmetric monoidal category [3, Def 3] is a symmetric monoidal category L which is enriched over commutative monoids, that is, each homset L(A, B) is a commutative monoid with a binary operation +, so we can sum parallel maps f + g, and zero element 0 : A → B, such that composition and the monoidal product preserve this additive structure.Definition 3.1 An R-graded differential modality on an additive symmetric monoidal category L is a tuple (!, p, d, c, w, ∂) consisting of an R-graded coalgebra modality (!, p, d, c, w) and a deriving transformation, that is, a family of natural transformations ∂ where for every r ∈ R we have a natural transformation ∂ r : !r A ⊗ A → !r+1 A and such that the following equalities hold for all r, s ∈ R: An R-graded differential category is an additive symmetric monoidal category with a chosen R-graded differential modality.
The intuition in an R-graded differential category is that a non-linear map !r+1 A → B should now be interpreted as a differentiable map of degree r + 1.In some models, this means that after differentiating r + 1 times we get 0, but this may not always be the case.The derivative of f : !r+1 A → B is defined by pre-composing by the deriving transformation, which is interpreted as a non-linear map of degree r in its first argument A and linear in its second argument A. The linear rule says that the derivative of a linear map, viewed as a differentiable map of degree 1, is essentially just itself.The product rule and the chain rule are analogues of their namesakes from classical differential calculus, which tell us how to differentiate products and compositions of non-linear maps respectively.The symmetry rule gives us the symmetry of partial derivatives.To better understand these rules, consider the case R = N, the semiring of natural numbers, and view !n A → B as just a homogeneous monomial function of degree n, say x n .We then invite the readers to check these formulas for themselves with polynomials in mind.In Section 6, we will make the intuition of differentiating polynomials precise.
Readers familiar with differential categories will note that a graded version of the so-called constant rule is missing, that is, ∂; w = 0.In [3, Lem 3], it was shown that the non-graded constant rule follows from the naturality of ∂ and w.The same is true in the graded version.Indeed, first note that for ∂ r ; w to be well-typed we need that r + 1 = 0, which means that r = −1 and that R is, in fact, a ring.Then if −1 exists in R, we indeed have the constant rule that is ∂ −1 ; w = 0, which entails that the derivative of points (which we can also understand as constant maps), viewed as a differential map of degree 0, is zero.Lemma 3.2 Let R be a ring.Then in a R-graded differential category, the following equality holds: Proof.By naturality of w and ∂, i.e w = !0 (f ); w and ∂ r ; !r (f ) = (! r (f ) ⊗ f ); ∂ r , and that the monoidal product preserves zero, i.e. f ⊗ 0 = 0, we easily compute that: We now define deriving transformations for graded monoidal coalgebra modalities by also requiring that a graded version of Fiore's monoidal rule from [15] holds.Again, readers familiar with differential categories will note that in the non-graded case, the monoidal rule can be proved from the other deriving transformation axioms, and is, in fact, equivalent to the product rule [3, Prop 7].However, we claim that in the graded case, this is no longer true.This is because the proof in the non-graded uses a construction that is no longer well-typed in the graded setting.We will discuss more about this in the next section.Definition 3.3 An R-graded monoidal differential modality on an additive symmetric monoidal category L is a tuple (!, p, d, c, w, µ ⊗ , µ I , ∂) consisting of an R-graded monoidal coalgebra modality and a monoidal deriving transformation, which is a deriving transformation ∂ which also satisfies the following equality for all r ∈ R: ); ∂ r We conclude this section with our running example.
Example 3.4 A 0-graded (monoidal) differential modality is precisely the same as a non-graded (monoidal) differential modality.Therefore, a 0-graded differential category is precisely a non-graded differential category.
Example 3.5 REL is an additive symmetric monoidal category where the sum of relations is given by union, + = ⊔, and the zero map is given by the empty relation, 0 = ∅.Define the deriving transformation for the R-graded monoidal coalgebra modality from Example 2.4 as the following relation: !, p, d, c, w, µ ⊗ , µ I , ∂) is an R-graded monoidal differential modality and so REL is an R-graded differential category.

Graded Additive Bialgebra Modalities and Seely Isomorphisms
In order to properly define a graded version of a codereliction, we first need to discuss graded versions of cocontraction and coweakening.In the sequent calculus, these are two extra rules for the graded exponential modality, the cocontraction rule (c) and the coweakening rule (w): In categorical terms, the coweakening rule is given by a natural transformation of type w : I → !0 A, while the cocontraction rule is given by an R-indexed family of natural transformations c r,s : !r A ⊗ !s A → !r+s A.
Note that c and w are of dual types of c and w.Together, these four natural transformations subject to equations that are presented below make !r A into an R-graded bimonoid (the generalization of a bialgebra in a symmetric monoidal category).
In classical algebra, the notion of graded bialgebra is usually defined simply as being graded over a monoid R, typically R = N, and as a bialgebra A which can be decomposed as a direct sum A = r∈R A r such that the multiplication and comultiplication are compatible in appropriate ways with this grading [25, Chap XI].In our context, R is a semiring and we replace the underlying object A by the family (A r ) r∈R of its components without assuming biproducts.The compatibility between the comultiplication and the multiplication now uses a sum indexed by elements of the semiring that verify some equations.This sum needs to be finite, and in order for this to hold, we must require that there are only a finite number of elements which sum to r.More precisely: Definition 4.1 A semiring R is finite additive split (f.a.s) if the following conditions hold: (i) For every r ∈ R, the set + −1 (r) = {(s, t) | ∀s, t ∈ R s.t.s + t = r} is finite.In other words, for every r ∈ R, there is only a finite number of elements s, t ∈ R such that s + t = r.(ii) We have that + −1 (0) = {(0, 0)} and + −1 (1) = {(1, 0), (0, 1)}.In other words, if s + t = 0 then s = t = 0, and if s + t = 1, then either s = 0 and t = 1, or s = 1 and t = 0.
The axioms for a f.a.s.semiring are similar to those of a multiplicity semiring [11, Sec 2.1], though the axioms here are slightly stronger.Examples of f.a.s.semirings include 0, N, N × N, N[x], etc.
We now provide the definition of a graded additive bialgebra modality, which is the graded version of [3,Def 5].Notice that the following definition does not assume that the underlying graded coalgebra modality is monoidal (this will come later).
(ii) (! A, c, w, c, w) is an R-graded bimonoid in the sense that: (iii) d is compatible with c in the sense that: where δ x,y ∈ R is Kronecker delta, that is, δ x,y = 1 if x = y and δ x,y = 0 if x = y.(iv) For every map f : A → B, the following equalities hold: Let us explain these axioms a bit more.The equations of ( 13) are generalizations of those for N-graded bialgebras [1, Lem 4.1] but for f.a.s.semirings -which are well-defined since the sum needs to be finite.Of course, if we are working in an additive symmetric monoidal category where infinite sums are well-defined, then the assumption that R is an f.a.s.could, in theory, be dropped.When R = 0, there is only one term in the sum, so we re-obtain the non-graded bimonoid axiom.The equations of (15) say that !relates the additive enrichment to the graded bimonoid convolution.Again when R = 0, there is only one term in the sum, so we re-obtain the bimonoid convolution axiom in the non-graded case.At first glance, ( 14) might seem unproperly typed since w ⊗ d : !0 A ⊗ ! 1 A → A and d ⊗ w : ! 1 A ⊗ !0 A → A. However, when R = 0, δ r,0 • (w ⊗ d) + δ 0,s • (d ⊗ w) is either w ⊗ d when r = 0 and s = 1, or d ⊗ w when r = 1 or s = 0, or 0 when r and s are neither 0 or 1.When R = 0, then 0 = 1 and therefore we obtain the sum w ⊗ d + d ⊗ w, which is the axiom for the non-graded case.
Example 4.3 A 0-graded additive bialgebra modality is precisely a non-graded additive bialgebra modality.
Example 4.4 For any f.a.s.semiring R, define the following relations: Then (!, p, d, c, w, c, w) is an R-graded additive bialgebra modality on REL.
When working in the additive fragment of GLL, it turns out that we obtain graded versions of the Seely isomorphisms.In a setting with sums of proofs, note that the additive disjunction ⊕ and the additive conjunction & are actually the same, so ⊕ = & [15].Thus writing ⊕ for both, recall the following rules: Then using these rules, in addition to (co)contraction, dereliction and promotion we derive: where the value r is fixed and the last rules are obtained by repeating a finite number of times the corresponding binary rule for every pair of elements s, t ∈ R such that s + t = r -which is indeed a finite number of times since R is f.a.s.These two derivations are inverses of each other.Categorically speaking, recall that the additive fragment, in this case, is captured by finite biproducts [15, Sec 2].So for a category |L| with finite biproducts, we denote the biproduct as ⊕, the projections by π j : A 0 ⊕ . . .⊕ A n → A j , the injections by ι j : A j → A 0 ⊕ . . .⊕ A n , and the zero object by 0. So we will now prove that the above derivations correspond to isomorphisms and obtain: We are making a slight abuse of notation here and allow for indexing over the set + −1 (r), which for an f.a.s.semiring is finite.We denote by ι s,t and π s,t the injection and projection into the (s, t) ∈ + −1 (r) term of the biproduct.Also recall that for biproducts, the pairing and copairing operations (so & r and ⊕ l ) can be defined using sums.
Theorem 4.5 Let R be a f.a.s.semiring and let (!, p, d, c, w, c, w) be an R-graded additive bialgebra modality on an additive symmetric monoidal category L with finite biproducts.Define the natural transformations χ ⊗ r : !r (A ⊕ B) → s,t∈R s+t=r !s A ⊗ !t B and χ I : !0 0 → I respectively as follows: Then χ ⊗ r and χ I are natural isomorphisms with inverses defined as follows: For starters, by one of the axioms in ( 13), we already have that: For the zero object, 1 = 0, therefore by (15), we also have that: To show that χ ⊗ r and χ ⊗ r −1 inverses, we need to use the biproduct identities that ι j ; π i = δ j,i and j π j ; ι j = 1.Now for χ ⊗ r ; χ ⊗ r −1 = 1, we use the first biproduct identity to first greatly reduce the sum, and then use (15) to afterwards use the second biproduct identity: ! r (π 0 ; For χ ⊗ r+s −1 ; χ ⊗ r = 1, we first use the graded bialgebra axiom (13), then using naturality and the first biproduct identity, we obtain ! a (0), we can then greatly simplify the sum using (15) in order to use the second biproduct identity: Thus the graded Seely isomorphisms hold as desired.
The converse of Thm 4.5 is also true.Indeed, note that χ ⊗ r and χ I can be defined for any graded coalgebra modality, and we could ask that they be natural isomorphisms, giving us a notion of graded storage coalgebra modality -the graded version of [3,Def 10].Then it follows that we can construct both c and w, and obtain a graded additive bialgebra modality.Proposition 4.6 Let R be a f.a.s.semiring and let (!, p, d, c, w) be an R-graded coalgebra modality on an additive symmetric monoidal category L with finite biproducts.Suppose that the natural transformations χ ⊗ r and χ I , as defined in Thm 4.5, are natural isomorphisms.Define: where ∇ : A ⊕ A → A is the codiagonal map of the biproduct.Then (!, p, d, c, w, c, w) is an R-graded additive bialgebra modality.
Proof.The proof is essentially the same as the non-graded version [3, Sec 7], which can be done mostly by brute force calculations.The main idea for this proof is that !transfers the canonical bimonoid structure on ⊕ to a graded bimonoid structure on ⊗.
It is worth mentioning that the constructions of Thm 4.5 and Prop 4.6 are inverses of each other.In particular, if we start with a R-graded additive bialgebra modality (!, p, d, c, w, c, w), and apply the constructions of Prop 4.6 we get back precisely c and u.The proof is again similar to the non-graded version [3,Sec 7], where in this case one uses the graded bialgebra axioms ( 13) and ( 15), as well as the biproduct identities.
As mentioned, the definition of a graded additive bialgebra modality does not require the underlying graded coalgebra modality to be monoidal.The same is true in the non-graded setting.In fact, in the non-graded setting it can be shown that every additive bialgebra modality is also a monoidal coalgebra modality, and vice-versa [3, Thm 1].However the non-graded constructions of going from an additive bialgebra modality to a monoidal coalgebra modality [3, Prop 2], or vice-versa [3, Prop 1], use d and w.As such, these constructions are no longer properly typed in the graded setting since d and w are now only well-typed for ! 1 and !0 respectively.Here are now counter-examples to further justify why graded monoidal coalgebra modalities are not the same as graded additive bialgebra modalities: Example 4.7 Observe that for any semiring R, any non-graded monoidal coalgebra modality is an Rgraded monoidal coalgebra modality by setting !r = !for all r ∈ R. Now take R = N and suppose that we are in an additive symmetric monoidal category with finite biproducts.If ! was also an N-graded additive bialgebra modality, then by Thm 4.5, we would have that !
But this is false since the non-graded version of the Seely isomorphism gives us !(A ⊕ B) ∼ = !A ⊗ !B only.So ! while is a N-graded monoidal coalgebra modality, !cannot be an N-graded additive bialgebra modality.
Example 4.8 For any additive symmetric monoidal category with biproducts, we have an N-graded additive bialgebra modality by setting !0 A = I and !n+1 A = 0 for all n ∈ N, and the rest of the structure is quite trivial.The promotion is p 0,n = 1 I and p n+1,0 = 0, while the dereliction is simply d = 0.The counit and unit are both w = w = 1.The comultiplication and multiplication are c 0,0 = 1 = c 0,0 and zero otherwise.However, ! is not monoidal since this would in particular require a map µ I 1 : I → ! 1 I such that µ I 1 ; d = 1.But since d = 0, this would mean that 0 = 1, which is not the case since I is not a zero object (if it was, then the additive symmetric monoidal category is trivial).Thus ! is an N-graded additive bialgebra modality which is not a N-graded monoidal coalgebra modality.
We now introduce the monoidal version of graded additive bialgebra modalities, by requiring extra compatibility relations between the graded monoid structure and the graded monoidal structure.These extra axioms are required if we wish to still have a bijective correspondence between deriving transformations and coderelictions in the graded setting (Thm 5.2).These axioms are graded versions of [3, Prop 2] (which were first observed by Fiore in [15]): Definition 4.9 Let R be a f.a.s.semiring.An R-graded monoidal additive bialgebra modality on an additive symmetric monoidal category L is a tuple (!, p, d, c, w, µ ⊗ , µ I , c, w) consisting of an Rgraded monoidal coalgebra modality (!, p, d, c, w, µ ⊗ , µ I ) and an R-graded additive bialgebra modality (!, p, d, c, w, c, w), such that the following equalities hold: (i) c and w are R-graded !-coalgebra morphisms: (ii) µ ⊗ is also compatible with c and w in the following sense: Example 4.10 Every 0-graded (i.e.non-graded) additive bialgebra modality is always a 0-graded monoidal additive bialgebra modality.Since for an additive symmetric monoidal category, non-graded monoidal coalgebra modalities are always non-graded additive bialgebra modalities [3, Thm 1], we may also alternatively state that every 0-graded monoidal coalgebra modality is always a 0-graded monoidal additive bialgebra modality.

Graded Differential Linear Logic and Coderelictions
In this section, we are finally in a position to properly introduce the graded version of the codereliction.The final rule for GDiLL is the codereliction rule (d): From the codereliction rule, one can take a non-linear proof of degree 1 and obtain a linear proof.In fact, the cut-elimination rules tell us that in GDiLL, the linear proofs are precisely the non-linear proofs of degree 1.In categorical terms, this is given by a natural transformation d : A → ! 1 A, which note is of the opposite type of d.The following is mostly a graded version of [3, Def 9]: Definition 5.1 Let R be a f.a.s.semiring.An R-graded monoidal additive bialgebra differential modality on an additive symmetric monoidal category L is a tuple (!, p, d, c, w, µ ⊗ , µ I , c, w, d) consisting of an R-graded monoidal additive bialgebra modality (!, p, d, c, w, µ ⊗ , µ I , c, w) and a codereliction d, which is a natural transformation d : A → ! 1 A such that the following equations hold: ; d An R-graded differential linear category is an additive symmetric monoidal category equipped with a chosen R-graded monoidal additive bialgebra differential modality.
Let us quickly compare this with the non-graded version.For starters, there is no longer a constant rule (which was shown to be provable anyways in [3,Lem 6]) between d and w, since in general they cannot compose.The explanation for the product rule is the same as for (14), and recaptures the non-graded version when R = 0.While the monoidal rule is provable from the rest in the non-graded case, this is no longer necessarily true in the graded setting.The intuition for the codereliction is that it provides a way to linearize differentiable maps of degree 1, specifically by taking the derivative and then evaluating at zero.The linear rule says that linearizing a linear map does nothing.The product rule says that linearization of the product of a linear map and a constant map results in the product of the linear map and the constant map.The chain rule tells us how to linearize the composition of differentiable maps that result in one of degree 1. Lastly, the monoidal rule tells us how the codereliction interacts with the monoidal product.
We now explain how even in the graded setting, deriving transformations and coderelictions are equivalent.Thus we may claim that there is only one notion of differentiation in categorical models of GDiLL.Syntactically, the construction from one to the other is given as follows: We will require an extra axiom for the deriving transformation, which is taking the product rule at zero: This is not necessarily captured by the product rule in Def 3.1, but is still satisfied in the non-graded setting.We may now properly state the graded version of [3,Thm 4].
Theorem 5.2 Let R be f.a.s. and let (!, p, d, c, w, µ ⊗ , µ I , c, w) be an R-graded monoidal additive bialgebra modality on an additive symmetric monoidal category L. Then there is a bijective correspondence between coderelictions and monoidal deriving transformations that also satisfy the product rule at 0. Explicitly: (i) If d is a codereliction, then for every r ∈ R define: Then ∂ is a monoidal deriving transformation which also satisfies the product Rule at 0. (ii) If ∂ is a monoidal deriving transformation which also satisfies the product Rule at 0, then define: Then d is a codereliction.
Furthermore, these constructions are inverses of each other.
Proof.The proof is mostly the same as that of [4,Thm 4.12].Essentially, one uses the rule for a deriving transformation (resp.codereliction) to prove the rule of the same for a codereliction (resp.deriving transformation).The only tricky one might be the product rule, so let us prove it here.Starting with a deriving transformation ∂, we use the product rule at 0 and (13), to prove the product rule for the codereliction: Now suppose that we are also in an additive symmetric monoidal category.Then equalizer symmetric powers always give an N-graded monoidal additive bialgebra differential modality where d = 1 A , w = 1 I , and c n,m is defined using the equalizer universal property, so the unique map such that: The binomial coefficient for c is necessary for the graded bimonoid identity.If we also have finite biproducts, then by Thm 4.5 we also obtain the graded Seely isomorphism, so: . Now the induced deriving transformation will simply be ∂ n = c n,1 , which is the unique map such that: In other words, ∂ n is given by equalizing all possible n + 1 ways of inserting an extra A into A ⊗ n .We will explain below how this (in the dual case) corresponds precisely to differentiating polynomials.Proposition 6.1 An additive symmetric monoidal category with (co)equalizer symmetric powers is an N-graded (co)differential linear category.
Example 6.2 REL has equalizer symmetric powers, and we have already in fact defined them.Indeed, we may set X [n] = !n X, where !n X is defined as in Ex 2.4 and define the relation: The N-graded differential linear structure induced by the equalizer symmetric powers on REL is exactly the one defined in the above examples for the case R = N.
Example 6.3 Let k be a commutative semiring and let k-MOD be the category of modules over k and k-linear maps between them.k-MOD is an additive symmetric monoidal category with the standard algebraic tensor product and k-linear enrichment.It is well-known that k-MOD is both complete and cocomplete, which in particular implies that k-MOD has all equalizers and coequalizers.However, the tensor product ⊗ does not necessarily preserve equalizers, and so k-MOD may not always have equalizer symmetric powers.On the other hand, ⊗ preserves all colimits and so k-MOD has coequalizer symmetric powers and is, therefore, an N-graded codifferential category.The coequalizer symmetric powers are wellknown since they are the symmetrized tensor spaces used in the construction of the symmetric algebra.For a k-module M , the n-th coequalizer symmetric power S n M is defined as the quotient of M ⊗ n by the action of all n! permutations.So an arbitrary element of S n M can be expressed in terms of finite sums of pure symmetric tensors x 1 ⊗ s ... ⊗ s x n for all x i ∈ M , and these satisfy that for all n! permutations τ : The resulting graded codifferential structure is given as follows (if the maps look backwards, recall we are in the dual setting): the submodule of the polynomial algebra k[x 1 , . . ., x m ] generated by monomials of degree n.From this point of view, p corresponds to polynomial composition, d gives the monomials of degree 1, c is given by polynomial multiplication, w gives the constant polynomials, and lastly ∂ correspond to differentiating polynomials.Indeed, if p(x) ∈ k n [x 1 , . . ., x m ], then: Thus by Prop 6.1, k-MOD is an N-graded codifferential linear category, and therefore k-MOD op is an N-graded differential linear category.Furthermore, if M is finite-dimensional, then S n M are all finitedimensional as well.Therefore, for the subcategory of finite-dimensional k-modules, k-FMOD, its opposite category k-FMOD op is also an N-graded differential linear category.In particular when k = C, the field of complex numbers, C-FMOD ∼ = FHILB.So FHILB op is also an N-graded differential linear category, solving the problem of [21].
Now there are many examples where the n-th equalizer symmetric power A [n] is also the n-th coequalizer symmetric power, as is the case in the category of vector spaces over a field of characteristic 0 [7, Chap III.Sec 6.3].A particular instance of when this is the case is when a certain idempotent splits.First, let us now work in Q ≥0 -additive symmetric monoidal categories, which are additive symmetric monoidal categories whose homsets are also Q ≥0 -modules, so we may scalar multiply by positive rationals p q ∈ Q ≥0 .In this case, for every object A and every n ∈ N, define the natural transformation ρ(n) : A ⊗ n → A ⊗ n as the sum of all n! permutations on A ⊗n divided by a factor of n!, so: Observe that ρ(n) is an idempotent.Indeed, first note that since Σ(n) is a finite group, ρ(n) both equalizes and coequalizes all permutations, that is, for all permutation τ ′ ∈ Σ(n), we have that ρ(n); τ ′ = ρ(n) = τ ′ ; ρ(n).Then since Σ(n) is of size n!, we have that: So ρ(n) is indeed an idempotent.Now suppose that ρ(n) is, in fact, a split idempotent, which means there is an object A [n] and maps ǫ n : A [n] → A ⊗ n and ς n : A ⊗ n → A [n] , such that: For split idempotents, it is well-known that A [n] is both the equalizer and coequalizer of the identity 1 and the idempotent ρ(n), and these are absolute (co)limits, so in particular, ⊗ preserves these (co)equalizers.Furthermore, since ρ(n) also equalizes and coequalizes all permutations, it follows that A [n] is indeed the n-th (co)equalizer symmetric power.Thus a Q ≥0 -additive symmetric monoidal category where ρ(n) splits for all n has equalizer symmetric powers A [n] which are also coequalizer symmetric powers, and therefore by Prop 6.1 is both an N-graded differential linear category and an N-graded codifferential linear category.
Using the splitting of ρ(n), we can define all the necessary structure maps for the monoidal additive bialgebra differential modality as follows: By dualizing these formulas, we also obtain the necessary structure for an N-graded codifferential category.
Example 6.4 REL is a Q ≥0 -additive symmetric monoidal category since addition is idempotent in REL, that is, S + S = S.In particular, the idempotent relation ρ(n) ⊆ X × n × X × n splits through !n X via the relation ǫ n ⊆ !n X × X × n , as defined in Example 6.2, and the relation: Applying the constructions of (25) results precisely in the differential structure described above.Applying the dual of ( 25) also makes REL an N-graded codifferential category -which also follows from the fact that REL is self-dual.
Example 6.5 Let k be a commutative semiring that is also a Q ≥0 -algebra.In particular this implies that k-MOD is a Q ≥0 -additive symmetric monoidal category.It is well known that all idempotents split in k-MOD.In particular, the idempotent ρ(n) : M ⊗ n → M ⊗ n can split through S n M via the maps ǫ n : S n M → M ⊗ n and ς n : M ⊗ n → S n M respectively defined as follows [7, Chap III.Sec 6.3]: Applying the dual constructions of (25) results precisely in the codifferential structure given in Example 6.3.Interestingly, we could also apply (25) directly to k-MOD instead to obtain an N-graded differential structure, where in particular the deriving transformation is given by: So k-MOD is also an N-graded differential linear category.Note that the resulting graded bimonoid is not the same that the one in Ex 6.3, though they are isomorphic (see [26] for more details).Nevertheless, this structure of differential category as a whole is somewhat mysterious.

Conclusion: Future Work
This paper introduced graded differential categories, a new branch in the theory of differential categories.There remain many intriguing questions to answer about graded differential categories and many possible paths for interesting future work.Let us conclude this paper by briefly describing some.
(i) An obvious objective is always to construct and study new examples of graded differential categories and models of GDiLL.(ii) We could study more carefully the relation between syntax and semantics, in particular the cutelimination for the different sequent calculus presented here.It would also be interesting to understand the relations of graded differential categories with the differential linear logic indexed by differential operators of [8], and with the Taylor expansion of differential linear logic, notably as treated in the recent work [20].(iii) Also, in most models of GLL, one considers the grading to be over an ordered semiring.We could investigate what order adds to the story of differentiation.(iv) It is natural to ask whether it is possible to take a graded differential category and somehow glue together the graded exponential !r to obtain a differential category.Or conversely, when is it possible to start from a non-graded differential category and somehow extract a graded differential category.(v) Another question is whether it is possible to build a Cartesian differential category [5] from a graded differential category, or possibly some yet-to-be-defined graded version of a Cartesian differential category.
So in conclusion, this paper is only the start of the story of graded differential categories -there are many interesting questions to investigate and exciting future work still to be done.

Definition 4 . 2
Let R be a f.a.s.semiring.An R-graded additive bialgebra modality on an additive symmetric monoidal category L is a tuple (!, p, d, c, w, c, w) consisting of an R-graded coalgebra modality (!, p, d, c, w), a family of natural transformation c where for every r, s ∈ R we have a natural transformation of type c r,s : !r A⊗! s A → !r+s A, and a natural transformation w : I → !0 A such that the following equalities hold:(i) (! A, c,w) is an R-graded cocommutative comonoid: (c r,s ⊗ 1); c r+s,t = (1 ⊗ c s,t ); c r,s+t (w ⊗ 1); c 0,r = 1 = (1 ⊗ w); c r,0 σ; c s,r = c r,s c r,s ; c t,u = a,b,c,d∈R a+b=r c+d=s a+c=t b+d=u (c a,b ⊗ c c,d ); (1 ⊗ σ ⊗ 1); c a,c ⊗ c b,d where r + s = t + u w; w = 1 w; c 0,0 = w ⊗ w c 0,0 ; w = w ⊗ w