Integral Categories and Calculus Categories

Differential categories are now an established abstract setting for differentiation. However not much attention has been given to the process which is inverse to differentiation: integration. This paper presents the parallel development for integration by axiomatizing an integral transformation, $s_A: !A \to !A \otimes A$, in a symmetric monoidal category with a coalgebra modality. When integration is combined with differentiation, the two fundamental theorems of calculus are expected to hold (in a suitable sense): a differential category with integration which satisfies these two theorem is called a {\em calculus category\/}. Modifying an approach to antiderivatives by T. Ehrhard, we define having antiderivatives as the demand that a certain natural transformation, $K: !A \to !A$, is invertible. We observe that a differential category having antiderivatives, in this sense, is always a calculus category. When the coalgebra modality is monoidal, it is natural to demand an extra coherence between integration and the coalgebra modality. In the presence of this extra coherence we show that a calculus category with a monoidal coalgebra modality has its integral transformation given by antiderivatives and, thus, that the integral structure is uniquely determined by the differential structure. The paper finishes by providing a suite of separating examples. Examples of differential categories, integral categories, and calculus categories based on both monoidal and (mere) coalgebra modalities are presented. In addition, differential categories which are not integral categories are discussed and vice versa.


Introduction
The two fundamental theorems of calculus relate the two most important operations of calculus: differentiation and integration. The first theorem states that the derivative of the integral of a function f : R − → R is the original function f : while the second states that the integral of the derivative of a function f : R − → R on a closed interval [a, b] is equal to the difference of f evaluated at the end points: They are called "fundamental" theorems because they are absolutely fundamental to the development of classical calculus.
There has been significant progress in the abstract understanding of differentiation in category theory. In contrast, the abstract formulation of integration has not received the same level of attention. Nonetheless, one might expect that, when suitably adjoined to the formulation of differentiation, an abstract form for integration should encompass these fundamental theorems. The purpose of this paper is to explore the extent to which this expectation is realized.
In the early 2000's, T. Ehrhard and L. Regnier introduced the differential λ-calculus [14] and differential proof nets [15]. A few years later, R. Blute, R. Cockett and R. Seely introduced differential categories [8], which were the appropriate categorical structure for modelling Ehrhard and Regnier's differential linear logic. Differential categories now have a rich literature of their own [5,3,4,7,12,10,16,21] and there are many examples which have been extensively studied [6,8,13]. However, as mentioned before, little attention has been given to abstracting the process of integration.
In 2014, T. Ehrhard observed that in certain * -autonomous categories which had the appropriate structure to be a differential category, it was possible with one additional assumption to produce antiderivatives [13]. The additional assumption was that a certain natural transformation -which he called J -constructed from the deriving transformation was a natural isomorphism. With this assumption, Ehrhard constructed an integral transformation with an inverse behaviour to the deriving transformation, in the sense that he gave necessary and sufficient conditions for a map to satisfy the first fundamental theorem of calculus -by proving Poincaré's Lemma. Furthermore, when the deriving transformation satisfied an extra -non-equational -condition, which he called the "Taylor Property", he then showed that every differentiable function satisfied the second fundamental theorem of calculus.
While much of the inspiration for our approach to integration derives from these observations, Ehrhard made no attempt to axiomatize integration separately from differentiation. Here we introduce integral categories as a notion which stands on its own (i.e. in the absence of differentiation). The inspiration for this independent axiomatization of integral categories comes from the much older notion of a Rota-Baxter algebra [1,18,24], the classical algebraic abstraction of integration. Briefly, for a commutative ring R, a Rota-Baxter algebra of weight λ is an R-algebra, A, with an R-linear morphism, P : A − → A, which satisfies the Rota-Baxter rule: P (a)P (b) = P (aP (b)) + P (P (a)b) + λP (ab) ∀a, b ∈ A where λ ∈ R. The map P is called a Rota-Baxter operator of weight λ. A particular example of a Rota-Baxter algebra of weight zero is the R-algebra of real continuous functions Cont(R), where the Rota-Baxter operator P : Cont(R) − → Cont(R) is defined as the integral of the function centred at zero: The Rota-Baxter rule for this example is the expression of the integration by parts rule without the use of derivatives (see [18] for more details): This example motivates the idea that the Rota-Baxter rule is one of the fundamental axioms of integration. In particular, a formalization of the Rota-Baxter rule of weight zero will be one of the axioms of the integral category structure.
When differentiation and integration are combined into what we call here a calculus category, we demand that the two fundamental theorems hold. The second fundamental theorem is assumed to hold verbatim. However, the first fundamental theorem, as above, has to be interpreted as being on maps -rather than objects -and, under this interpretation, becomes the Poincaré condition, a conditional property which provides necessary and sufficient conditions for a map to be the differential of its integral.
To obtain the notion of integration as an antiderivative, we insist that a slightly different natural transformation, which we call K, should be invertible. We show this is equivalent to requiring both that Ehrhard's transformation J is invertible and that the "Taylor Property" -which Ehrhard had suggested was desirable -holds. This improvement is easily underestimated: the "Taylor Property" is a conditional requirement, replacing a conditional requirement by a purely equational requirement is always, mathematically, a significant step. Demanding that, K, is invertible not only produces an integral transformation, but also secures the first and second fundamental theorem of calculus.
In fact, an integral transformation is already obtained when just Ehrhard's transformation, J, is invertible (see Proposition 6.7). Furthermore, this integral satisfies the Poincaré condition -our interpretation of the first fundamental theorem. However, this integral need not satisfy the second fundamental theorem of calculus -for a counterexample see Section 7, Example 7.10 -and, thus, may not yield a calculus category. The "Taylor Property" is required in addition to the invertibility of J to secure a calculus category. Of course, assuming invertibility of J and the Taylor property, guarantees the invertibility of K.
To prove that the antiderivative produced using the inverse of K yields a calculus category, we use the fact that, when K is invertible, J is also invertible and that the antiderivative produced by the inverse of K, is precisely the antiderivative produced by the inverse of J. This immediately gives that the invertibility of K gives an integral transformation satisfying the Poincaré condition; it then remains only to show that invertibility of K implies the second fundamental theorem of calculus (see Theorem 6.9).

Conventions and the Graphical Calculus
Before beginning, we should mention the conventions that we use in the paper. We shall use diagrammatic order for composition: explicitly, this means that the composite map f g is the map which first does f then g. Furthermore, to simplify working in symmetric monoidal categories, we will allow ourselves to work in strict symmetric monoidal categories and so will generally suppress the associator and unitor isomorphisms. For a symmetric monoidal category we will use ⊗ for the tensor product, K for the unit, and σ : A ⊗ B − → B ⊗ A for the symmetry isomorphism.
We shall make extensive use of the graphical calculus (see [20]) for symmetric monoidal categories as this makes proofs easier to follow. We refer the reader to [25] for an introduction to the graphical calculus in monoidal categories and its variations. Note, however, that our diagrams are to be read down the page -from top to bottom -and we shall often omit labelling wires with objects.
We will be working with coalgebra modalities: these are based on a comonad (!, δ, ε) where ! is the functor, δ is the comultiplicaton and ε is the counit. As in [8], we will use functor boxes when dealing with string diagrams involving the functor !: a mere map f : A − → B will be encased in a circle while !(f ) : !A − → !B will be encased in a box: 2 Coalgebra Modalites and the Coderiving Transformation

Coalgebra Modalities
In a symmetric monoidal category, a cocommutative comonoid is a triple (C, ∆, e) consisting of an object C, a map ∆ : C − → C ⊗ C called the comultiplication and a map e : C − → K called the counit such that the following diagrams commute: is a map f : C − → D which preserves the comultiplication and counit, that is, the following diagrams commute: Commutative monoids and their morphisms are defined dually.
Requiring that ∆ and e be natural transformations is equivalent to asking that for each map f : A − → B, !(f ) : !A − → !B is a comonoid morphism. This can be used to show that δ is a comonoid morphism.

Coderiving Transformation
Definition 2.3 For a coalgebra modality (!, δ, ε, ∆, e) on an additive symmetric monoidal category, the coderiving transformation is the natural transformation d • A : !A − → !A ⊗ A defined as: In the graphical calculus, we represent the coderiving transformation as follows: The coderiving transformation d • satisfies the following properties: Proof: Most of these properties follow from the coalgebra modality structure: Here we use the comonad triangle identity and that δ is a coalgebra map: Here we use that δ is a comonoid morphism and the counit laws for the comultiplication:

Monoidal Coalgebra Modalities
A symmetric monoidal functor [23] is a triple (!, m ⊗ , m K ) consisting of a functor ! between symmetric monoidal categories, a natural transformation m ⊗ : !A⊗!B − → !(A⊗B) and a map m K : K − → !K satisfying certain coherences. This can be extended to defining a symmetric monoidal comonad, which is a quintuple (!, δ, ε, m ⊗ , m K ) consisting of a symmetric monoidal functor (!, m ⊗ , m K ) and a comonad (!, δ, ε) such that δ and ε be monoidal natural transformations. For a full detailed list of the coherences for symmetric monoidal comonads, see [2]. The string diagrams representations of m ⊗ and m K are as follows: Definition 2.5 A monoidal coalgebra modality [2, 3] on a symmetric monoidal category is a symmetric monoidal comonad, (!, δ, ε, m ⊗ , m K ), and a coalgebra modality, (!, δ, ε, ∆, e), satisfying (i) ∆ and e are monoidal transformations, that is, the following diagrams commute: (ii) ∆ and e are !-coalgebra morphisms, that is, the following diagrams commute: The coderiving transformation d • of a monoidal coalgebra modality satisfies the following monoidal rule: Proof: Here we use that ∆ and ε are monoidal transformations

Integral Categories
Integral categories are integral analogues of differential categories and therefore there are two equivalent definitions of an integral category: one in terms of the integral combinator and another in terms of the integral transformation. While having two different ways of illustrating a concept is always important, there is a reason why we wish to have both. The combinator description of the integral category structure is more intuitive while the transformation description is much more practical (in particular for examples and calculations). For this reason, we give both definitions and prove the equivalence between an integral combinator and an integral transformation. This way of introducing integral categories mirrors precisely the way differential categories were originally introduced in [8].

Additive Categories
The basic setting of integral and differential categories: additive symmetric monoidal categories with a coalgebra modality. Here "additive" simply means commutative monoid enriched: we do not assume negatives nor do we assume biproducts (this differs from the usage in [23] for example). This allows many important examples such as the category of sets and relation or the category of modules for a commutative rig (also known as semirings: they are rings without negatives.).
Definition 3.1 An additive category is a commutative monoid enriched category, that is, a category in which each hom-set is a commutative monoid -with an addition operation + and zero 0 -such that composition preserves the additive structure, that is: k(f +g)h = kf h+kgh, 0f = 0 and f 0 = 0. An additive symmetric monoidal category is a symmetric monoidal category which is also an additive category in which the tensor product is compatible with the additive structure in the sense that k ⊗ (f +g) ⊗ h = k ⊗f ⊗ h+k ⊗g ⊗ h, 0 ⊗ h = 0, and h ⊗ 0 = 0.
For the maps of any additive category, there is a notion of "scalar multiplication" by the natural numbers N. The scalar multiplication of a map f : A − → B by n ∈ N is the map n · f : A − → B defined by summing n copies of f together.
Furthermore, in additive symmetric monoidal categories, one has that (n · f ) ⊗ g = n · (f ⊗ g) = f ⊗ (n · g). For every object A and every natural number n ∈ N we can also define the map n A : A − → A as scalar multiplying the identity by n, that is, n A = n · 1 A . For every map f : A − → B, we have that n A f = n · f = f n B , which implies that n A commutes (with respect to composition) with all endomorphisms f : A − → A.
Since we are not assuming any negatives, it is possible to have 1 = 2: this is the case in the category of sets and relations where addition is union. Definition 3.2 In an additive category, an object A is said to be additively idempotent if It is important to note that if A is additively idempotent then A ⊗ B is additively idempotent for each object B. In particular, if the monoidal unit is additively idempotent then every object is as well. An additive category in which every object is additively idempotent is, as we shall see shortly, always an integral category.

Integral Combinators
An integral category is an additive symmetric monoidal category with a coalgebra modality and an integral combinator. An integral combinator is an operator on maps with the type !A − → B, called integrable maps, which produces the integral of that map.

Definition 3.3
For an additive symmetric monoidal category with a coalgebra modality (!, δ, ε, ∆, e), an integral combinator S produces for each map f : such that S satisfies the following properties: [S.N] Naturality/Linear Substitution: If the square on the left commutes, then the square on the right commutes: / / D An integral category is an additive symmetric monoidal category with a coalgebra modality and an integral combinator. In an integral category, a map is integrable if it is of the form f : It might be useful for the reader to have some intuition regarding integral combinators, integrable maps and the axioms. The integral of f : !A ⊗ A − → B, S[f ] : !A − → B, should be thought of as the classical integral of f evaluated from 0 to x as a function of x: To interpret this as S[f ] one must regard f as being a function of two variables t and dt, which is linear in dt. Classically, f is regarded as a function of one (one dimensional) variable, t, and to obtain the interpretation as a function of two arguments one simply multiplies by the variable dt. This allows a simple interpretation of the integral notation for one dimensional functions: it leaves open the interpretation for multidimensional functions -an issue to which we shall return.
The first axiom [S.A] simply formalizes the fact that the integral of a sum of functions is the sum of each integral. The second axiom [S.N] is a naturality condition with respect to linear maps which amounts to saying that the integral preserves linear substitution. The next axiom [S.1] asks our integral combinator to satisfy that the integral of the constant function 1, or simply dt, is the linear function x (which is not the standard identity but rather the identity in the coKleisli category). The next axiom [S.2] is the so called Rota-Baxter rule, as discussed in our introduction. This is the fundamental axiom of our integral combinator. Finally [S.3] ensures the independence of the order of integration -the interchange law -that is integral with respect to u then t is the same as integral with respect to t then u. It may be tempting to think this is related to Fubini's theorem. In fact, it is not closely related at all: we discuss this at the end of this section.
Naturality of the integral combinator also gives a general way of describing the integrals of maps. Notice since the square on the left commutes trivially for every integrable map then the square on the right commutes: In fact, the integral combinator S can be completely re-expressed in terms of s, which we discuss next.

Integral Transformation
Integral transformations give an equivalent (and extremely useful) definition of an integral category -we integrate maps by precomposing with the integral transformation. Integral transformations are the analogue of deriving transformations for differential categories [8] and are obtained in a similar fashion through naturality of the combinator as discussed above.
The axioms for the integral transformation are simple re-expressions of the axioms for the integral combinator. Therefore every integral transformation induces an integral combinator by precomposition S[f ] = s A f . Conversly, every integral combinator induces an integral transformation by defining s A = S[1 !A⊗A ]. Therefore, the following are equivalent: (i) An integral category; (ii) An additive symmetric monoidal category with a coalgebra modality and an integral transformation.
Using the integral transformation, we can obtain sufficient conditions for when two maps have the same integral. This will be important in future work when we take the coKleisli category of an integral category to obtain a cartesian integral category. Proof: Suppose that (1 ⊗ ε)f = (1 ⊗ ε)g. By the comonad triangle equalities and the naturality of the integral transformation, we have that: Therefore, the coderiving transformation fails to satisfy [s.2], the Rota-Baxter rule, since there is an extra factor of 2. Of course, this problem is solved if 1 + 1 = 1. Thus as advertised, we obtain: Proposition 3.7 Every additive symmetric monoidal category with a coalgebra modality such that for each object A, !A is additively idempotent is an integral category with respect to the coderiving transformation, that is, the coderiving transformation is an integral transformation.

Integration by Substitution
Arguably the most important axiom of differential categories is the chain rule -the axiom which describes the derivative of a composition of functions. The chain rule is what separates differential categories from differential modules and differential algebras. The integration rule analogous to the chain rule is known as integration by substitution or U -substitution. As for integration by parts, integration by substitution is expressed using derivatives but can also be expressed in terms of only integrals: Unlike differential categories, integration by substitution is not an axiom of integral categories but rather a property that only certain integrable maps satisfy (similar to a situation we will explore later in Subsection 5.2 with the First Fundamental Theorem of Calculus).

Definition 3.8 In an integral category, an integrable map
In an integral category whose integral transformation is the coderiving transformation, all maps satisfy integration by substitution.
, the comonad triangle identities, that δ is a comonoid morphism, and the naturality of the coderiving transformation we have that:

Polynomial Integration and Positive Rationals
Perhaps the first formula learned in first year calculus is the integral of monomials: x 0 x n dx = 1 n + 1 x n+1 However this formula cannot be expressed in a general additive category -simply because there may not be fractions. That said, we will soon see that in every integral category there is a notion of scalar multiplication by positive rationals, that is, certain hom-sets are Q ≥0 -modules, where Q ≥0 is the rig of non-negative rationals. However, the integral of monomials can be re-expressed as: This re-expression of the identity does hold in any integral category! The proof of the polynomial integration formula is actually quite elegant and demonstrates the utility of the graphical calculus. The beauty of the proof of the polynomial integration formula is that it uses every axiom: integration of constants, the Rota-Baxter rule and the interchange rule. In fact, polynomial integration in classical calculus also uses all three axioms but the use of the interchange rule goes unnoticed, since, in classical calculus, the interchange rule is simply a change of variables.
To express the polynomial integration identity in integral categories, we will need the n-fold comultiplication. For every natural number n ∈ N, define the n-fold comultiplication: by comultiplying !A into n copies of !A. Explicitly one can write ∆ n as follows: However by co-associativity, we could have comultiplied in any other order. For example, we could have expressed ∆ 4 as follows: Note the following for the cases n = 0, 1 and 2: (i) When n = 0, ∆ 0 = e (since zero copies of !A is the monoidal unit); (ii) When n = 1, ∆ 1 = 1; (iii) When n = 2, ∆ 2 = ∆.
With this n-fold comultiplication, we can now properly express and prove a rule for integration of monomials in integral categories which works properly. Proposition 3.10 For every n ∈ N, the integral transformation satisfies the following: Proof: We will prove the equality for the integral transformation by induction on n. The proof is much smoother using the graphical calculus. For the base case of n = 0, this equality holds directly by the constant rule [s.1]. Assume the induction hypothesis [s. Poly] holds for n, we now show it for n + 1: The induction hypothesis was used in the 3rd, 6th, and last of the above equalities. ✷ In classical calculus notation, the dt always appears at the end of the expression of the integral. However, for integral categories the position of the linear part dt is unimportant when integrating polynomials. Intuitively, this can be expressed using classical calculus notation as follows: To express these formulas in integral categories, we need to introduce notation for a specific twist map. In any symmetric monoidal category X, for each finite family of objects {A 1 , ..., A n } and for each k ≤ n, define the following permutation isomorphism: which swaps the last tensor factor and the k-th tensor factor. Notice that ω (n n) is the identity and when k = 0, define ω (0 n) as follows: For each finite family of objects of size n ≥ 1 there are n + 1 of these kinds of permutation isomorphisms.
Proposition 3.11 For every n ∈ N and every k ≤ n, the following equality holds:

Proof:
We prove this by induction on n using both the interchange rule [s.3] and polynomial integration rule [s.poly]. For the base case of n = 0, this equality holds directly by the constant rule [s.1] since ∆ 0 = e. Assume the induction hypothesis holds for n, we now show it for n + 1 and for any k ≤ n + 1:

✷
An important consequence of polynomial integration is that certain hom-sets are Q ≥0 -modules.

Theorem 3.12
In an integral category, for every n ∈ N, n ≥ 1, and every object A, the map . Then for n ≥ 1, In string diagrams, n −1 !A is expressed as follows: To prove this we use the additive structure, [s.Poly], the comonad triangle identities, that δ is a comonoid morphism and the counit laws for the comultiplication.

Corollary 3.13
The coKleisli category of an integral category is skew enriched or left additive over Q ≥0 -modules.
In certain integral categories, it is possible to prove that, for every object A and n ≥ 1, n A is an isomorphism. There are two simple ways of obtaining this: the first when ε is a natural retraction and the second when the coalgebra modality is monoidal. Here we focus on ε being a natural retraction, that is, there exists a natural transformation η with components η A : Proposition 3.14 In an integral category such that ε is a natural retraction, for every n ∈ N, n ≥ 1, and every object A, the map n A : A − → A is an isomorphism.
Proof: Let η be a natural section of ε. For every n ≥ 1, define n −1 !A is defined as in the proof of Theorem 3.12. As before, it suffices to show that n·n −1 A = 1 A . Here we use the additive structure, that n · n −1 !A = 1 !A and that η A ε A = 1 A : An integral category such that ε is a natural retraction is enriched over Q ≥0modules.

Integral Categories with Monoidal Coalgebra Modalities and Fubini's Theorem
Proposition 3. 16 In an integral category with a monoidal coalgebra modality, for every n ∈ N, n ≥ 1, and every object A, the map n A : A − → A is an isomorphism.
Proof: For every n ≥ 1, define n −1 A : A − → A as follows: where n −1 !A is defined as in the proof of Theorem 3.12. As before, it suffices to show that n·n −1 A = 1 A . Here we use the additive structure, that n · n −1 !A = 1 !A and that e is a monoidal transformation: An integral category with a monoidal coalgebra modality is enriched over Q ≥0modules.
An alternative description of a monoidal integral transformation is given as follows: For an integral transformation s of a monoidal coalgebra modality, the following are equivalent: (i) s is monoidal; (ii) The following equality holds: where the dotted line represents the monoidal unit.
Proof: i) ⇒ ii): Using that s is monoidal we obtain the following equality For the equality with d • on the right, using [cd.m] and the associativity of m ⊗ , we have that: For the other equality with d • on the left, one must simply observe that: And the remainder of the proof is similar. ✷ We discuss briefly the interpretation of Fubini's theorem in integral categories. Fubini's theorem states that for a function f in two variables the following equality holds: that is, integral f with respect to x first then y is the same as integral f with respect to y then x. Under our intuition of integration for integral categories, this implies we are dealing with a function in four variables x, y, dx and dy which is bilinear in dx and dy. The reader may notice the similarities with the axiom [S.3], the independence rule, for integral categories. However there are crucial differences. First, Fubini's theorem concerns to the double integral of a function in two different variables while the axiom [S.3] explains the process of integral the same variable twice. Secondly, the double integral in Fubini's theorem is an iterated integral, where the function is integrated as a function of a single variable by holding the other variable constant. On the other hand, [S.3] takes all variables into consideration at once. Therefore, we will need a different approach in the interpretation of Fubini's theorem.
To interpret Fubini's theorem in an integral category we will require that our additive symmetric monoidal category has finite biproducts and that our coalgebra modality has Seely isomorphisms [2,3,8]. A coalgebra modality on a symmetric monoidal with finite products has Seely isomorphisms if the natural transformations χ and χ 0 defined respectively as: are isomorphisms, so !(A×B) ∼ = !A⊗!B and !(0) ∼ = K. As explained in [3] (Theorem 3.1.6), requiring that a coalgebra modality has Seely isomorphisms is equivalent to asking that it be monoidal. Every coalgebra modality having the Seely isomorphisms is a monoidal coalgebra modality, where m ⊗ is and m K is defined as Conversly, in the presence of finite products, every monoidal coalgebra modality satisfies the Seely isomorphisms [2] where the inverse of χ is while the inverse of χ T is where t : K − → T is the unique map to the terminal object. Suppose now that we have an integral category with finite biproducts and a monoidal coalgebra modality, which implies it has Seely isomorphisms. Fubini's theorem concerns maps of the form f : !(A × B) ⊗ A ⊗ B − → C whose type ensures it is bilinear in the second two occurrences of A and B. Maps of this form can be integrated with respect to either A or B, or both A and B simultaneously: the latter, the double integral of f , is obtained as follows: Fubini's theorem asserts that the order of integration in this double integral does not matter. At this level of generality this order independence is an immediate consequence of the bifunctoriality of ⊗ .
4 Differential Categories

Differential Categories
We briefly recall the definition of a differential category [8]. We omit the full definition of the differential combinator and directly give the definition of a deriving transformation (of course both are equivalent). At the same time, we introduce the graphical calculus for differential categories.
Definition 4.1 A differential category is an additive symmetric monoidal category with a coalgebra modality which comes equipped with a deriving transformation [8], that is, a natural transformation d with components d A : !A ⊗ A − → !A, which is represented in the graphical calculus as: such that d satisfies the following equations:  5] is the independence of differentiation or the interchange law, which naively states that differentiating with respect to x then y is the same as differentiation with respect to y then x. It should be noted that [d. 5] was not a requirement in [8] but was later added to the definition [3,4] to ensure that the coKleisli category of a differential category was a Cartesian differential category.
The coderiving transformation is related to the deriving transformation by: The deriving transformation and coderiving transformations satisfy the following equality: The notation W was introduced by Ehrhard in [13]. One might expect the definition of a monoidal deriving transformation, that is a deriving transformation d for a monoidal coalgebra modality, to require that the differential monoidal rule should hold: However, it turns out that this is already implied (see [11]):

L, K and J
Here we introduce L, K and J, which are natural transformations occurring in all differential categories, constructed using the deriving transformation and coderiving transformation. We provide long lists of rather technical properties which will be used to develop the theory of antiderivatives. Definition 4.4 In a differential category, define three natural transformations L, K and J of the same type ! ⇒ ! as follows: The main purpose of L will be to simplify proofs of the properties for K and J. The properties of K and J will be used to establish properties of K −1 and J −1 which will, in turn, be used in the definition of antiderivatives. It is convenient also to have a special notation for the following families of maps which will become important: L n := L + n · 1 and J n := J + n · 1 Clearly L = L 0 , J = J 0 = L 1 , and J n = L n+1 . Thus, by establishing properties of L n , we will obtain as a corollary properties of J n . We shall begin therefore with the basic properties of L n : [L.6] dL n = (L n+1 ⊗ 1)d; We now give properties of K. Notice that most of the properties of K are extremely similar, indeed sometimes identical, to the corresponding property of J.
Proof: These are straightforward calculations using the properties of L: Proposition 4.8 In a differential category with a monoidal coalgebra modality, the following equalities hold: Proof: Straightforward using the monoidal rules of the deriving transformation and coderiving transformation.

Calculus Categories
One of the main goals of developing integral categories, apart from axiomatizing integration, was to obtain a categorical setting for calculus. Now that we have established both integral categories and differential categories, we will combine them to obtain calculus categories. However, a calculus category is not simply a category which is both an integral category and a differential category: we require integration and differentiation to be compatible with each other. In particular, we would like integration to be anti-differentiation. In the classical calculus setting, the relationship between integration and anti-differentiation is precisely expressed by the two fundamental theorems of calculus. The fundamental theorems explain to what extent integration and differentiation are inverse processes. Therefore, the extra axioms required for calculus categories will be to impose a similar relation between the deriving transformation and integral transformations by axiomatizing the two fundamental theorems. Simply put, compatibility is a weaker version of the Second Fundamental Theorem of Calculus. In fact, if one differentiates the equation of the Second Fundamental Theorem of Calculus, one obtains the expression for compatibility. We next define the Taylor condition, which unlike compatibility and the fundamental theorems, is a property only of the deriving transformation. Definition 5.3 A deriving transformation d is said to be Taylor [13] if for every pair of maps f, g :

Second Fundamental Theorem of Calculus
The Taylor property is analogous to the statement that if the derivatives of two maps are equal, then those two maps differ by constants. In this case, the constants are the maps evaluated at zero. If one assumes that we can subtract maps, that is, if we have negatives, then the Taylor property is equivalent to the statement that, if the derivative of a map is zero, then it is a constant. The Taylor condition was the extra condition Ehrhard required of his differential transformation to obtain the Second Fundamental Theorem of Calculus for his integral transformation [13].
Being Compatible and Taylor is equivalent to satisfying the second fundamental theorem of calculus: For compatibility, by naturality, we have the following equality:

First Fundamental Theorem of Calculus and the Poincaré Condition
Unlike the Second Fundamental Theorem of Calculus, the First Fundamental Theorem of Calculus holds for only certain integrable maps.
Definition 5.5 Let d be a deriving transformation and s be an integral transformation on the same coalgebra modality. A map f : C ⊗ !A ⊗ A − → B satisfies the First Fundamental Theorem (in the last two arguments) if: Thus, if f satisfies the First Fundamental theorem, it may be viewed as the differential of a map -namely the differential of its integral. Clearly not all maps will satisfy the First Fundamental theorem calculus, but a necessary condition is: The converse of this lemma will be used as an axiom for calculus categories called the Poincaré condition.
The Poincaré Condition states that if an integrable map satisfies a certain pre-condition, then it satisfies the First Fundamental Theorem of Calculus. The name of the condition comes from the Poincaré Lemma from cohomology [26] and differential topology [9], which states an analoguous result giving criteria for a map to be an antiderivative.
Definition 5.7 A deriving transformation d and an integral transformation s for the same coalgebra modality are said to satisfy the Poincaré condition if any map f : The Poincaré condition and Lemma 5.6 imply the following equivalence: The Poincaré condition also implies compatibility of the deriving transformation and integral transformation.

Calculus Categories and Calculus Objects
We now give the definition of a calculus category.
Definition 5.10 A calculus category is a differential category and an integral category on the same coalgebra modality such that the deriving transformation and the integral transformation satisfy the Second Fundamental Theorem of Calculus and the Poincaré condition.
It is important to note that by Corollary 5.9, an equivalent definition of a calculus category would simply require the Poincaré Condition and that the deriving transformation is Taylor. In the next section, we will show that a differential category for which K is an isomorphism is a calculus category.
We now turn our attention to calculus objects: these are objects where the identity of !A ⊗ A satisfies the First Fundamental Theorem of Calculus, which is another way of saying that the deriving transformation and integral transformation satisfies it. This ensures that any integrable map with domain C ⊗ !A ⊗ A, where A is a calculus object, will satisfy the First Fundamental Theorem of Calculus. Every calculus category has at least one calculus object: the monoidal unit! Proposition 5.12 In a calculus category, if A is an object such that σ A,A = 1 A⊗A , then A is a calculus object. Conversely, if A is a calculus object and ε A is a retraction then σ A,A = 1 A⊗A .
Proof: Suppose that for an object A, σ A,A = 1 A⊗A . Then the Poincaré pre-condition is true trivially for the identity 1 !A⊗A . Therefore, d A s A = 1 !A⊗A . Conversly, suppose A is a calculus object and let η A be a section of ε A . To show that σ A,A = 1 A⊗A we will need to use the case n = 1 of Proposition 3.11 (recall that ω (0 1) = σ): The monoidal unit, K, of a calculus category is always a calculus object.
Proof: By coherence of symmetric monoidal categories, σ K,K = 1 K⊗K . Therefore, K is a calculus object. ✷

Antiderivatives
In this section we explore what it means for a differential category to have antiderivatives. We shall equate this with the requirement that K be a natural isomorphism. Recall, however, that Ehrhard's original idea was to obtain antiderivatives by requiring that J be a natural isomorphism [13]. Requiring that just J is invertible does not imply that K is invertible, and, more importantly, it does not imply the second fundamental theorem of calculus. This means that the antiderivative built from the inverse of J does not deliver a calculus category. This is why asking that K be a natural isomorphism is important. Proposition 6.1 shows that J being invertible and the Taylor Property holding implies K is invertible. In Theorem 6.9 we show that K being invertible implies that one has a calculus category (with respect to the antiderivative) and so the Taylor property holds. Thus, as advertised, assuming K is invertible removes the necessity for the non-equational Taylor requirement. As shown by Example 7.10 in Section 7, the invertibility of J may not deliver a calculus category. However, there is no reason why it should not still deliver an integral category and, in fact, we shall show that the invertibility of J does deliver an integral category. Furthermore the Poincaré Condition will hold in for this integral, thus, the only defect is that this integration may not satisfy the second fundamental theorem of calculus.
6.1 K −1 and J −1 n Proposition 6.1 In a differential category: (i) K is a natural isomorphism implies J is a natural isomorphism; (ii) J n is a natural isomorphism implies J m is a natural isomorphism for m ≥ n; (iii) If J is a natural isomorphism and the Taylor property holds then K is a natural isomorphism.
Before proving Proposition 6.1 it is useful to have the following observation in hand: Lemma 6.2 In any differential category, the following equality holds: Since the deriving transformation is Taylor, we then have: However by naturality we have that !0d • Fd = d • (!0 ⊗ 0)Fd = 0. Finally, we conclude: By Proposition 6.1, an equivalent definition of having antiderivatives is if J is a natural isomorphism and the deriving transformation is Taylor. We now give properties of K −1 . Proposition 6.4 K −1 satisfies the following properties: Proof: These are mostly straightforward calculations by using the properties of K and that K is an isomorphism: Then we obtain the following equality: Here we use [K.10]: We now give properties of J −1 . Notice that the first seven points below hold without the assumption that K is also an isomorphism. However [J −1 .8] and [J −1 .9] require K −1 . In particular, the [J −1 .9] will be important for the following section when we discuss our constructed integral transformation for differential category with antiderivatives.
Similarly to obtain K −1 on the right.
Then we have the following equality using [J −1 .6] and the preceding identity: In a differential category with antiderivatives, the antiderivative integral transformation is the natural transformation Notice that the equality is [J −1 .9] from Proposition 6.5. In string diagram notation, the antiderivative integral transformation is expressed as follows: Theorem 6.9 A differential category with antiderivatives is a calculus category.
Proof: By [J −1 .9], Proposition 6.7 implies that the antiderivative is an integral transformation satisfing the Poincaré Condition. Therefore, it remains to show that the antiderivative satisfies the Second Fundamental Theorem of Calculus: Here we have used the definition of the integral transformation, [K −1 .1], and that K is an isomorphism. ✷ Proposition 6.10 In a differential category with antiderivatives, a map which satisfies the first fundamental theorem of calculus satisfies integration by substitution.
Proof: Let f : !A ⊗ A − → B satisfy the first fundamental theorem, that is, dK −1 d • f = f , and let g : !C ⊗ C − → A be any integrable map. Using the Second Fundamental Theorem, the chain rule [d.5], naturality of δ, the deriving transformation and the coderiving transformation, [cd.3], and [K −1 .1] we have that:

From Calculus Categories to Antiderivatives
In this section we prove that a calculus category with a monoidal coalgebra modality has antiderivatives, and provide necessary and sufficient conditions for when the integral is the antiderivative integral.
Theorem 6.12 A differential category on a monoidal coalgebra modality which is also an integral category satisyfing the Second Fundamental Theorem of Calculus, is also a differential category with antiderivatives.
It is important to note in this statement that the assumed integral transformation is not necessarily the same as the integral transformation constructed as the antiderivative. Proof: Since the Second Fundamental Theorem of Calculus holds then the deriving transformation is Taylor. Therefore, it suffices to show that J is a natural isomorphism. Define J −1 as follows: expressed in the graphical calculus as: To prove this gives the identity, consider s K (J K ⊗ 1). Using that σ K,K = 1 K ⊗ 1 K , the W identity, the Second Fundamental Theorem of Calculus and naturality of the integral transformation, we have that: Finally using [J.m], the above identity, that ∆ and ε are monoidal transformation and the unit laws for the monoidal strength we obtain the following equality: 13 For a calculus category with a monoidal coalgebra modality, if the integral transformation is monoidal then it is the antiderivative integral transformation.
(i) d and s satisfy the Second Fundamental Theorem of Calculus and the following equality holds: (ii) X has antiderivatives and s is the antiderivative integral.
Proof: (i) ⇒ (ii): Since the Second Fundamental Theorem of Calculus holds then d is Taylor. Therefore, it suffices to show that J is a natural isomorphism. Define J −1 as follows: expressed in the graphical calculus as: Before showing that this is the inverse of J, we first observe that s and the coderiving transformation A well-known example of a differential category (whose coalgebra modality also happens to be monoidal) comes from the free symmetric algebra construction which actually gives a co-differential category. We briefly recall this example (see [8] for more details) by first recalling the free symmetric algebra adjunction: The category of vector spaces over a field K, VEC K , is a co-differential category [8], so that, VEC op K is a differential category. The additive symmetric monoidal structure is given by the standard tensor product and additive enrichment of vector spaces. The algebra modality is given by the free symmetric algebra monad where for a vector space V , define Sym(V ), called the free symmetric algebra over V , as following (see Section 8, Chapter XVI in [22] for more details): where Sym n (V ) is simply the quotient of V ⊗ n by the tensor symmetry equalities: Sym(V ) is the free commutative algebra over V , that is, we obtain an adjunction: The induced monad is an algebra modality -the dual of a coalgebra modality (see [8] for more details on this algebra modality). Furthermore, this algebra modality has the Seely isomorphisms [22], that is: and therefore this is also a comonoidal algebra modality. The deriving transformation d : Sym(V ) − → Sym(V ) ⊗ V on pure tensors is defined as follows: (a 1 ⊗ ... ⊗ a i−1 ⊗ a i+1 ⊗ ... ⊗ a n ) ⊗ a i which we then extend by linearity (if this map looks backwards, recall that MOD R is a co-differential category). An alternative approach of illustrating this differential category structure on VEC K is to consider polynomial rings. If X = {x 1 , x 2 , ...} is a basis of V , then SymV is isomorphic to the polynomial ring over X: Sym(V ) ∼ = K[X] [22]. Then the deriving transformation d V on monomials is given by the sum of partial derivatives of the monomial: It is important to note that this differential category structure on VEC K can be generalized to the category of modules over any ring R. In fact, this example can be generalized further. Indeed, the free symmetric algebra construction on appropriate additive symmetric monoidal categories induces a differential category structure.
We now give two examples of differential categories with monoidal coalgebra modalities and antiderivatives, and therefore, two examples of calculus categories. In fact, these were two of the main examples of differential categories in [8].
Example 7.2 The category of sets and relations, REL, is a differential category [8] with antiderivatives. The symmetric monoidal strucure is given by the cartesian product of sets while the additive structure is given by the union of sets. The coalgebra modality is given by the free symmetric algebra construction on REL, also known as the finite bag comonad. Explicitly, for a set X, !X is the set of all finite bags (also known as multisets) of X (including the empty bag): [8] for more details about this coalgebra modality. The deriving transformation d X : !X × X − → !X is the relation which adds an extra element to the bag: The additive idempotency of REL makes both K and J the identity and thus trivially isomorphisms. Therefore, the integral transformation is the coderiving transformation d • X : !X − → !X × X, which is the relation which removes an element from the bag: This makes REL into a calculus category. Furthermore, the only calculus objects of this calculus category structure for REL are one element sets and the empty set.

Example 7.3
The category of vector spaces over a field K of characteristic of 0, VEC K , is a codifferential category with antiderivatives, so that, VEC op K is a calculus category. While having a field of characteristic zero is not required to obtain differential structure, it is required for antiderivatives. On pure tensors, L scalar multiplies a word by its length: K is equal to L everywhere except on constants (elements of K) since L on constants is zero while K map constants is the identity: J, on pure tensors, scalar multiplies a word by its length plus one: Notice that in this case, unlike the previous example, the J map is not equal to the K map! As the rationals are embedded in our field, both K and J are isomorphisms, and the resulting integral transformation s V : SymV ⊗ V − → SymV is defined on pure tensors as follows: which we then extend by linearity. Using the alternative description, the integral transformation can be described on the polynomial ring s V : as follows on monomials: At first glance this may seem bizarre. One might expect the integral transformation to integrate a monomial with respect to the variable x i and thus only multiply by 1 1+r i . However, this classical idea of integration fails the Rota-Baxter rule [s.2] for any vector space of dimension greater than one. The only calculus objects of this calculus category structure for VEC K are one dimensional vector spaces, in particular the field K, and the zero vector space.
As seen with Corollary 3.17, all integral categories with a monoidal coalgebra modality is enriched over Q ≥0 -modules. Therefore, we do not need to look very far for a differential category which is not an integral category. Example 7.4 As shown above, the category of vector spaces for any fixed field with the free symmetric algebra is a differential category. However for a field with non-zero characteristic, this is not an integral category. For a particular example, the free symmetric algebra modality on category of vector spaces over Z 2 does have a deriving transformation but does not have an integral transformation.
Interestingly, one of the algebraic notions of differentiation -differential algebras -does not give a differential category, but does give an integral category (over the appropriate field).
Example 7.5 A (commutative) differential algebra (of weight 0) [19] over a field K is a pair (A, D) consisting of a commutative K-algebra A and a linear map D : A − → A such that D satisfies the Leibniz rule, that is, the following equality holds: Modifying slightly the construction given in [19] of the free differential algebra over a set to instead obtain a free differential algebra over a vector space, we obtain that the forgetful functor from the category of differential algebras over K, CDA K , has a left adjoint: Briefly, DIFF : VEC K − → CDA K is defined on objects as DIFF(V ) = Sym( n∈N V ) and we refer the reader to [19] for the remainder of the construction (as it is similar). The induced monad of this adjunction is an algebra modality. This algebra modality has the Seely isomorphisms since the free symmetric algebra does and the infinite coproduct behaves well with the finite biporduct [22]: Therefore this is a comonoidal algebra modality. However this algebra modality does not have a deriving transformation, since the chain rule [d.4] cannot be satisfied.
Example 7.6 For the category of vector space over Z 2 , DIFF is a comonoidal algebra modality which does not have a deriving transformation or an integral transformation.
Example 7.7 If K is a field of characteristic zero, then DIFF has an integral transformation defined as: where ι 0 : V − → n∈N V is the injection map into the coproduct and s n∈N V is the integral transformation of the free symmetric algebra.
Similarly one of the algebraic abstractions of integration -Rota-Baxter algebras -always gives a differential category: Example 7.8 A (commutative) Rota-Baxter algebra (of weight 0) [18] over a field K is a pair (A, P) consisting of a commutative K-algebra A and a linear map P : A − → A such that P satisfies the Rota-Baxter equation, that is, the following equality holds: The map P is called a Rota-Baxter operator (we refer the reader to [18] for more details on Rota-Baxter algebras). It turns out that there is a left adjoint to the forgetful functor between the category of Rota-Baxter algebras, CRBA K , and the category of commutative algebras over K, CALG K (for more details on this adjunction and the induced monad see [27]).
Briefly, on objects the left adjoint RB : CALG K − → CRBA K is given by RB(A) = Sh(A) ⊗ A where Sh(A) is the shuffle algebra [18]. To obtain an algebra modality on the category of vector spaces over K, we compose the free Rota-Baxter algebra adjunction and the free symmetric algebra adjunction: and take the induced monad of this adjunction. This algebra modality comes equipped with a deriving transformation defined as where d is the deriving transformation of Sym. However, this deriving transformation is not Taylor for the simple reason that there exists non-constants which derive to zero.
Example 7.9 For the category of vector space over Z 2 , RB is a non-comonoidal algebra modality with a deriving transformation but not an integral transformation.
As usual, in the presence of rationals, Rota-Baxter algebras also give example of an integral category. However, the differential and integral structures do not give a calculus category.
Example 7.10 If the field K has characteristic zero, then RB also has an integral transformation defined as 1 ⊗ s : Sh(Sym(V )) ⊗ Sym(V ) ⊗ V − → Sh(Sym(V )) ⊗ Sym(V ) where s is the integral transformation of Sym. Since the deriving transformation is not Taylor, the Second Fundamental Theorem of Calculus does not hold and therefore this is not a calculus category structure. Furthermore, this is an example where J is invertible while K is not.
Combining the differential algebra and Rota-Baxter algebra examples we obtain an example which is solely an algebra modality.
Example 7.11 A (commutative) differential Rota-Baxter algebra (of weight 0) [19] over a field K is a triple (A, D, P) consisting of a differential algebra (A, D) and a Rota-Baxter algebra (A, P) such that PD = 1 A . It turns out that the free Rota-Baxter algebra over a differential algebra is also its free differential Rota-Baxter algebra, and therefore inducing the following adjunction between the category differential algebras, CDA K , and the category of differential Rota-Baxter algebras, CDRBA K : The full construction can be found in [19]. Once again, to obtain an algebra modality we compose this adjunction with the free differential algebra adjunction: This algebra modality is not comonoidal for the same reasons as the free Rota-Baxter algebra, and is not a differential category failing the chain rule like the free differential algebra.
Example 7.12 Continuing the previous example, let K be a field of characteristic zero. We define an integral transformation for RB(DIFF(V )) as follows: Then VEC R with the free differential Rota-Baxter algebra monad is an integral category whose algebra modality is not comonoidal.

Example 7.13
On the other hand, the category of vector space over Z 2 with free differential Rota-Baxter algebra monad is not a differential category, nor is it an integral category, and whose algebra modality is not comonoidal.
Example 7.14 Let R be a non-zero commutative ring. The zero R-module, 0, induces a coalgebra modality on the category of modules over R where the functor maps all objects to 0 and all maps to zero maps. This coalgebra modality is not monoidal since !(0) = 0 ≇ R. It is however a differential category with antideriviatives since every map in sight would be zero and the necessary equalities hold trivially. This example can be generalized to any additive symmetric monoidal category with a zero object.
Example 7.15 Similar to the construction of the free symmetric algebra for the category of vector spaces over a field, one can construct the free additively idempotent (i.e 1 + 1 = 1) commutative algebra in the category of modules over a rig [17], which gives an algebra modality. The deriving transformation is the same as the free symmetric algebra, and since our algebra is additively idempotent: K and J are the identity. Therefore, this is a differential category with antiderivatives. However, if the rig R is not additively idempotent (such as N), this is not a comonoidal algebra modality since !(0) ≇ R. When R is additively idempotent, then the algebra modlity does have the Seely isomorphisms and therefore would be comonoidal.

Conclusion
In the examples above while we have filled in many of the blanks: however, it is important to note the areas we have not filled. For example, while we suspect it may be possible, we do not have an example of a differential category on a monoidal coalgebra modality which has integration and yet is not a calculus category. Nor do we have an example of a calculus category which does not have antiderivatives.
The influence of linear logic has made monoidal coalgebra modalities central. However, coalgebra modalities which are not monoidal, while perhaps somewhat overlooked, are certainly mathematically important. A natural example of a differential category with antiderivatives, whose coalgebra modality is not moniodal is the category of real vector spaces with smooth functions determined by the free C ∞ -ring monad. This example was uncovered by Geoff Cruttwell, Rory Lucyshyn-Wright, and the second author. The example, being mathematically central, suggests that non-monoidal coalgebra modalities cannot be ignored.
A reasonable strategy for further developing the theory of integral categories is to follow the same path as that followed for differential categories. The theory of differential categories was developed in four stages with each stage formalizing a different aspect of the theory of differentiation: (tensor) differential categories [8] formalize basic differentiation, cartesian differential categories axiomatize directional derivatives [4], restriction differential categories [12] formalize the theory of differentiation on open subsets, and tangent categories [10] formalize tangent structure and the theory of smooth manifolds. Each stage relates to the next in interesting ways: the coKleisli category of a differential category is a cartesian differential category, while a cartesian differential category is a special case of a restriction differential category. Restriction differential categories, in turn, have an associated manifold completion which is itself a tangent category.
Integral categories are closely related to differential categories. Therefore, it seems worthwhile to develop a parallel approach for integral categories in four corresponding stages. Here we have developed the first step with (tensor) integral categories. The next step -which is already in progress -is to develop Cartesian integral categories and Cartesian calculus categories, and in particular, to show the sense in which the coKleisli category of an integral category is a Cartesian integral category. Cartesian integral categories have a term logic which gives these categories a more "classical" feel: in fact, we have borrowed parts of this term logic to help motivate this paper.
The observation that the coderiving transformation is an integral transformation when addition is idempotent (i.e. 1 + 1 = 1) is interesting as differential categories of interest in computer science often have this property. The properties of these integral categories may, thus, be of special interest to computer science.