Theory and Applications of Categories, Vol. 25, No. 21, 2011, pp. 537–613.

DIFFERENTIAL RESTRICTION CATEGORIES

J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

Abstract. We combine two recent ideas: cartesian differential categories, and restriction categories. The result is a new structure which axiomatizes the category of smooth maps defined on open subsets of ℝ^{n} in a way that is completely algebraic. We also give other models for the resulting structure, discuss what it means for a partial map to be additive or linear, and show that differential restriction structure can be lifted through various completion operations.

Contents

1 Introduction 537 2 Restriction categories review 541 3 Differential restriction categories 550 4 Rational functions 570 5 Join completion and differential structure 595 6 Classical completion and differential structure 599 7 Conclusion 610

1. Introduction

In [Blute et. al. 2008], the authors proposed an alternative way to view differential calculus. The derivative was seen as an operator on maps, with many of its typical properties (such as the chain rule) axioms on this operation. The resulting categories were called cartesian differential categories, and the standard model is smooth maps between the spaces ℝ^{n}. One interesting aspect of this project was the algebraic feel it gave to differential calculus. The seven axioms of a cartesian differential category described all the necessary properties that the standard Jacobian has. Thus, instead of reasoning with epsilon arguments, one could reason about differential calculus by manipulating algebraic axioms.

First author partially supported by NSERC, Canada. Second author partially supported by PIMS, Calgary. Received by the editors 2010-11-16 and, in revised form, 2011-12-15. Transmitted by S. Lack. Published on 2011-12-22. 2000 Mathematics Subject Classification: 14A20,18D10, 18C20, 12H05, 32W99,58A99. Key words and phrases: Differential restriction categories, Rational functions and the Rational

monad, Join completion, Classical completion.

\begin{matrix}c \\ ◯ \end{matrix} J.R.B. Cockett, G.S.H. Cruttwell, and J. D. Gallagher, 2011. Permission to copy for private use granted.

Moreover, as shown in [Bucciarelli et. al. 2010], cartesian (closed) differential categories provide a semantic basis for modeling the simply typed differential lambda-calculus described in [Erhard and Regnier 2003]. This latter calculus is linked to various resource calculi which, as their name suggests, are useful in understanding the resource requirements of programs. Thus, models of computation in settings with a differential operator are of interest in the semantics of computation when resource requirements are being considered.

Fundamental to computation is the possibility of non-termination. Thus, an obvious extension of cartesian differential categories is to allow partiality of maps. Of course, this has a natural analogue in the standard model: smooth maps defined on open subsets of ℝ^{n} are a notion of partial smooth map which is ubiquitous in analysis.

To axiomatize these ideas, we combine cartesian differential categories with the restriction categories of [Cockett and Lack 2002]. Again, the axiomatization is completely algebraic: there are two operations (differentiation and restriction) that satisfy seven axioms for the derivative, four for the restriction, and two for the interaction of derivation and restriction.

Our goal in this paper is not only to give the definitions and examples of these “differential restriction categories”, but also to show how natural the structure is. There are a number of points of evidence for this claim. In a differential restriction category, one can define what it means for a partial map such as

f(x) = \{ \begin{matrix}2x & if x ≠ 5; \\ ↑ & if x = 5. \end{matrix}

to be “linear”. One can give a similar description for the notion of “additive”. The differential interacts so well with the restriction that not only does it preserve the order and compatibility relations, it also preserves joins of maps, should they exist.

Moreover, differential restriction structure is surprisingly robust^{1}. In the final two sections of the paper, we show that differential structure lifts through two completion operations on restriction categories. The first completion is the join completion, which freely add joins of compatible maps to a restriction category. We show that if differential structure is present on the original restriction category, then one can lift this differential structure to the join completion.

The second completion operation is much more drastic: it adds “classical” structure to the restriction category, allowing one to classically reason about the restriction category’s maps. Again, we show that if the original restriction category has differential structure, then this differential structure lifts to the classical setting. This is perhaps the most surprising result of the paper, as one typically thinks of differential structure as being highly non-classical. In particular, it is not obvious how differentials of functions defined at a single point should work. We show that what the classical completion is doing is adding germs of functions, so that a function defined on a point (or a closed set) is defined by how it works on any open set around that point (or closed set). It is these germs of functions on which one can define differential restriction structure.

1With the exception of being preserved when we take manifolds. Understanding what happens when we take manifolds of a differential restriction category will be considered in a future paper: see the concluding section of this paper for further remarks.

The paper is laid out as follows. In Section 2, we review the theory of restriction categories. This includes reviewing the notions of joins of compatible maps, as well as the notion of a cartesian restriction category.

In Section 3, we define differential restriction categories. We must begin, however, by defining left additive restriction categories. Left additive categories are categories in which it is possible to add two maps, but the maps themselves need not preserve the addition (for example, the set of smooth maps between ℝ^{n}). Such categories were an essential base for defining cartesian differential categories, as the axioms need to discuss what happens when maps are added. Here, we describe left additive restriction categories, in which the maps being added may only be partial. One interesting aspect of this section is the definition of additive maps (those maps which do preserve the addition), which is slightly more subtle than its total counterpart.

With the theories of cartesian restriction categories and left additive restriction categories described, we are finally able to define differential restriction categories. One surprise is that the differential automatically preserves joins. Again, as with additive maps, the definition of linear is slightly more subtle than its total counterpart.

In Section 4, we develop a family of examples of differential restriction categories: rational functions over a commutative ring. Rational functions (even over rigs), because of their “poles”, provide a natural source of restriction structure. We show that the formal derivative on these functions, together with this restriction, naturally forms a differential restriction category. The construction of rational functions presented here, is, we believe, novel: it involves the use of weak and rational rigs (described in 4.1). While one can describe restriction categories of rational functions directly, the description of the restriction requires some justification. Thus, we first characterize the desired categories abstractly, by showing they occur as subcategory of a particular, more general, partial map category. This then makes the derivation of the concrete description straightforward. Moreover, the theory we develop to support this abstract characterization appears to be interesting in its own right. While many of the ideas of this section are implicit in algebraic geometry, the packaging of differential restriction categories makes both the partial aspects of these settings and their differential structure explicit.

In the next two sections, we describe what happens when we join or classically complete the underlying restriction category of a differential restriction category, and show that the differential structure lifts in both cases. Again, this is important, as it shows how robust differential restriction structure is, as well as allowing one to differentiate in a classical setting.

Finally, in section 7, we discuss further developments. An obvious step, given a differential restriction category with joins, is to use the manifold completion process of [Grandis 1989] to obtain a category of smooth manifolds. While the construction does not yield a differential restriction category, it is clearly central to developing the differential geometry of such settings. This is the subject of continuing work.

On that note, we would like to compare our approach to other categorical theories of smooth maps. Lawvere’s synthetic differential geometry (carried out in [Dubuc 1979], [Kock 2006], and [Moerdijk and Reyes 1991]) is one such example. The notion of smooth topos is central to Lawvere’s program. A smooth topos is a topos which contains an object of “infinitesimals”. One thinks of the this object as the set D = {x : x^{2} = 0}. Smooth toposes give an extremely elegant approach to differential geometry. For example, one defines the tangent space of an object X to be the exponential X^{D}. This essentially makes the tangent space the space of all infinitesimal paths in X, which is precisely the intuitive notion of what the tangent space is.

The essential difference between the synthetic differential geometry approach and ours is the level of power of the relative settings. A smooth topos is, in particular, a topos, and so enjoys a great number of powerful properties. The differential restriction categories we describe here have fewer assumptions: we only ask for finite products, and assume no closed structure or subobject classifier. Thus, our approach begins at a much more basic level. While the standard model of a differential restriction category is smooth maps defined on open subsets of ℝ^{n}, the standard model of a smooth topos is a certain completion of smooth maps between all smooth manifolds. In contrast to the synthetic differential geometry approach, our goal is thus to see at what minimal level differential calculus can be described, and only then move to more complicated objects such as smooth manifolds.

A number of authors have described others notions of smooth space: see, for example, [Chen 1977], [Frölicher 1982], [Sikorski 1972]. All have a similar approach, and the similarity is summed up in [Stacey 2011]:

“...we know what it means for a map to be smooth between certain subsets of Euclidean space and so in general we declare a function smooth if whenever, we examine it using those subsets, it is smooth. This is a rather vague statement

- what do we mean by ‘examine’? - and the various definitions can all be seen as ways of making this precise.”

Thus, in each of these approaches, the author assumes an existing knowledge of smooth maps defined on open subsets of ℝ^{n}. Again, our approach is more basic: we are seeking to understand the nature of these smooth maps between ℝ^{n}. In particular, one could define Chen spaces, or Frölicher spaces, based on a differential restriction category other than the standard model, and get new notions of generalized smooth space.

Finally, it is important to note that none of these other approaches work with partial maps. Our approach, in addition to starting at a more primitive level, gives us the ability to reason about the partiality of maps which is so central to differential calculus, geometry, and computation.

2. Restriction categories review

In this section, we begin by reviewing the theory of restriction categories. Restriction categories were first described in [Cockett and Lack 2002] as an alternative to the notion of a “partial map category”. In a partial map category, one thinks of a partial map from A to B as a span

\xymatrix{ & A′ \ar[dl]_{m} \ar[dr]^{f} \\ A &  & B}

where the arrow m is a monic. Thus, A′ describes the domain of definition of the partial map. By contrast, a restriction category is a category which has to each arrow f : A [figure] B a “restriction” \overline{f} : A [figure] A. One thinks of this \overline{f} as giving the domain of definition: in the case of sets and partial functions, the map \overline{f} is given by

\overline{f}x = \begin{cases}x & iff(x) defined \\ undefined & otherwise. \end{cases}

There are then four axioms which axiomatize the behavior of these restrictions (see below).

There are two advantages of restriction categories when compared to partial map categories. The first is that they are more general than partial map categories. In a partial map category, one needs to have as objects each of the possible domains of definition of the partial functions. In a restriction category, this is not the case, as the domains of definition are expressed by the restriction maps. This is important for the examples considered below. In particular, the canonical example of a differential restriction category will have objects the spaces ℝ^{n}, and maps the smooth maps defined on open subsets of these spaces. This is not an example of a partial map category, as the open subsets are not objects, but it is naturally a restriction category, with the same restriction as for sets and partial functions.

The second advantage is that the theory is completely algebraic. In partial map categories, one deals with equivalence classes of spans and their pullbacks. As a result, they are often difficult to work with directly. In a restriction category, one simply manipulates equations involving the restriction operator, using the four given axioms. As cartesian differential categories give a completely algebraic description of the derivatives of smooth maps, bringing these two algebraic theories together is a natural approach to capturing smooth maps which are partially defined.

2.1. Definition and examples. Restriction categories are axiomatized as follows. Note that throughout this paper, we are using diagrammatic order of composition, so that “f, followed by g”, is written fg.

2.2. Definition. Given a category, 𝕏, a restriction structure on 𝕏 gives for each,

A ⟶^{f} B, a restriction arrow, A ⟶^{\overline{f}} A, that satisfies four axioms:

542  J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

[R.1] \overline{f} f = f; [R.2] If dom(f) = dom(g) then \overline{g} \overline{f} = \overline{f} \overline{g}; [R.3] If dom(f) = dom(g) then \overline{\overline{g} f} = \overline{g} \overline{f} ; [R.4] If dom(h) = cod(f) then f\overline{h} = \overline{fh} f.

A category with a specified restriction structure is a restriction category.

We have already seen two examples of restriction categories: sets and partial functions, and smooth functions defined on open subsets of ℝ^{n}. For more examples see [Cockett and Lack 2002], as well as [Cockett and Hofstra 2008], where restriction categories are used to describe categories of partial computable maps.

A rather basic fact is that each restriction \overline{f} is idempotent: we will call such idempotents restriction idempotents. We record this together with some other basic consequences of the definition: 2.3. Lemma. If 𝕏 is a restriction category then:

(i) \overline{f} is idempotent; (ii) \overline{f} \overline{fg} = \overline{fg}; (iii) \overline{f\overline{g}} = \overline{fg}; (iv) \overline{\overline{f}} = \overline{f} ;

(v) \overline{\overline{f} \overline{g}} = \overline{f} \overline{g}; (vi) If f is monic then \overline{f} = 1 (and so in particular \overline{1} = 1); (vii) \overline{f} g = g implies \overline{g} = \overline{f} \overline{g}. Proof. Left as an exercise. 2.4. Partial map categories. As alluded to in the introduction to this section, an alternative way of axiomatizing categories of partial maps is via spans where one leg is a monic. We recall this notion here. These will be important, as we shall see that rational functions over a commutative rig naturally embed in a larger partial map category.

2.5. Definition. Let 𝕏 be a category, and M a class of monics in 𝕏. M is a stable system of monics in case

[SSM.1] all isomorphisms are in M;

[SSM.2] M is closed to composition;

[SSM.3] for any m : B′ → B ∈ M, f : A → B ∈ C the following pullback, called an M-pullback, exists and m′ ∈ M:

\xymatrix{A′ \ar[r]^{f′} \ar[d]_{m′} & B′ \ar[d]^{m} \\ A \ar[r]_{f} & B}

2.6. Definition. An M-Category is a pair (𝕏, M) where 𝕏 is a category with a specified system of stable monics M.

Given an M-Category, we can define a category of partial maps.

2.7. Definition. Let (𝕏, M) be an M-Category. Define Par(𝕏, M) to be the category where

Obj: The objects of 𝕏

Arr: A ⟶^{(m,f)} B are classes of spans (m, f),

\xymatrix{ & A′ \ar[dl]_{m} \ar[dr]^{f} \\ A &  & B}

where m ∈ M. The classes of spans are quotiented by the equivalence relation (m, f) ∼ (m′, f′) if there is an isomorphism, ϕ, such that both triangles in the following diagram commute.

\xymatrix{ & A′ \ar[dl]_{m} \ar[drr]|{f} \ar@{.>}[r]^{ϕ} & A′′ \ar[dll]^{m′} \ar[dr]^{f′} \\ A &  &  & B}

Id: A ⟶^{(1_{A},1_{A})} A

Comp: By pullback; i.e. given A ⟶^{(m,f)} B, B ⟶^{(m′,f′)} C, the pullback

\xymatrix{ &  & A′′ \ar[dl]_{m′′} \ar[dr]^{f′′} \\  & A′ \ar[dl]_{m} \ar[dr]^{f} &  & B′ \ar[dl]_{m′} \ar[dr]^{f′} \\ A &  & B &  & C}

gives a composite A [figure: (m′′m,f′′f′)] C. (Note that without the equivalence relation on the arrows, the associative law would not hold.)

Moreover, this has restriction structure: given an arrow (m, f), we can define its restriction to be (m, m). From [Cockett and Lack 2002], we have the following completeness result:

2.8. Theorem. Every restriction category is a full subcategory of a category of partial maps.

However, it is not true that every full subcategory of a category of partial maps is a category of partial maps, so the restriction notion is more general.

2.9. Joins of compatible maps. An important aspect of the theory of restriction categories is the idea of the join of two compatible maps. We first describe what it means for two maps to be compatible, that is, equal where they are both defined.

2.10. Definition. Two parallel maps f, g in a restriction category are compatible, written f ⌣ g, if \overline{f} g = \overline{g} f.

Note that compatibility is not transitive. Recall also the notion of when a map f is less than or equal to a map g:

2.11. Definition. f ≤ g if \overline{f} g = f.

This captures the notion of g having the same values as f, but having a smaller domain of definition. Note that this inequality is in fact anti-symmetric.

An important alternative characterization of compatibility is the following:

2.12. Lemma. In a restriction category,

f ⌣ g ⇔ \overline{f} g ≤ f ⇔ \overline{g} f ≤ g.

Proof. If f ⌣ g, then \overline{f} g = \overline{g} f ≤ f. Conversely, if \overline{f} g ≤ f, then by definition, \overline{\overline{f} g} g = \overline{f} g, so \overline{g} f = \overline{f} g.

We can now describe what it means to take the join of compatible maps. Intuitively, the join of two compatible maps f and g will be a map which is defined everywhere f and g are, while taking the value of f where f is defined, and the value of g where g is defined. There is no ambiguity, since the maps are compatible.

2.13. Definition. Let 𝕏 be a restriction category. We say that 𝕏 is a join restriction category if for any family of pairwise compatible maps (f_{i} : X [figure] Y)_{i∈I}, there is a map ⋁_{i∈I} f_{i} : X [figure] Y such that

• for all i ∈ I, f_{i} ≤ ⋁_{i∈I} f_{i};

• if there exists a map g such that f_{i} ≤ g for all i ∈ I, then ⋁ f_{i} ≤ g;

(that it, it is the join under the partial ordering of maps in a restriction category) and these joins are compatible with composition: that is, for any h : Z [figure] X,

• h(⋁_{i∈I} f_{i}) = ⋁_{i∈I} hf_{i}.

Note that by taking an empty family of compatible maps between objects X and Y, we get a “nowhere-defined” map ∅_{X,Y} : X [figure] Y which is the bottom element of the partially ordered set of maps from X to Y.

Obviously, sets and partial functions have all joins - simply take the union of the domains of the compatible maps. Similarly, continuous functions on open subsets also have joins.

Note that the definition only asks for compatibility of joins with composition on the left. In the following proposition, we show that this implies compatibility with composition on the right.

2.14. Proposition. Let 𝕏 be a join restriction category, and (f_{i})_{i∈I} : X [figure] Y a compatible family of arrows.

(i) for any j ∈ I, \overline{f_{j}} (⋁_{i∈I} f_{i}) = f_{j};

(ii) \overline{⋁_{i∈I} f_{i}} = ⋁_{i∈I} \overline{f_{i}};

(iii) for any h : Y [figure] Z, (⋁_{i∈I} f_{i})h = ⋁_{i∈I} f_{i}h.

Proof.

(i) This is simply a reformulation of f_{j} ≤ ⋁_{i} f_{i}.

(ii) By the universal property of joins, we always have ⋁ \overline{f_{i}} ≤ \overline{⋁ f_{i}}. Note that this also implies that ⋁ \overline{f_{i}} is a restriction idempotent, since it is less than or equal to a restriction idempotent. Now, to show the reverse inequality, consider:

\overline{⋁_{i∈I} f_{i}} ⋁_{j∈I} \overline{f_{j}}
= \overline{⋁_{j∈I} \overline{f_{j}} ⋁_{i∈I} f_{i}} since ⋁ \overline{f_{j}} is a restriction idempotent,
= \overline{⋁_{j∈I} f_{j}} by (i),

as required.

(iii) Again, by the universal property of joins, we automatically have ⋁(f_{i}h) ≤ (⋁ f_{i})h. In this case, rather than show the reverse inequality, we will instead show that their restrictions are equal: if one map is less than or equal to another, and their restrictions agree, then they must be equal. To show that their restrictions are equal, we first show ⋁(f_{i}\overline{h}) = (⋁ f_{i})\overline{h}:

(⋁_{i∈I} f_{i}) \overline{h}

= \overline{(⋁_{j∈I} f_{j}) h} (⋁_{i∈I} f_{i}) by [R.4],

= ⋁_{i∈I} \overline{(⋁_{j∈I} f_{j}) h} f_{i}

= ⋁_{i∈I} \overline{\overline{f_{i}} (⋁_{j∈I} f_{j}) h} f_{i}

= ⋁_{i∈I} \overline{f_{i}h} f_{i} by (i),
= ⋁_{i∈I} f_{i}\overline{h} by [R.4].

Now, we can show that the restrictions of ⋁(f_{i}h) and (⋁ f_{i})h are equal:

\overline{⋁_{i∈I} f_{i}h}

= ⋁_{i∈I} \overline{f_{i}h} by (ii),
= ⋁_{i∈I} \overline{f_{i}\overline{h}}
= \overline{⋁_{i∈i} f_{i}\overline{h}}
= \overline{(⋁ f_{i}) \overline{h}} by the result above,

as required.

2.15. Cartesian restriction categories. Not surprisingly, cartesian differential categories involve cartesian structure. Thus, to develop the theory which combines cartesian differential categories with restriction categories, it will be important to recall how cartesian structure interacts with restrictions. This was described in [Cockett and Lack 2007] where it was noted that the resulting structure was equivalent to the P-categories introduced in [Robinson and Rosolini 1988]. We recall the basic idea here:

2.16. Definition. Let 𝕏 be a restriction category. A restriction terminal object is an object T in 𝕏 such that for any object A, there is a unique total map !_{A} : A ⟶ T which satisfies !_{T} = 1_{T}. Further, these maps ! must satisfy the property that for any map f : A ⟶ B, f!_{B} ≤!_{A}, i.e. f!_{B} = \overline{f!_{B}} !_{A} = \overline{f\overline{!_{B}}} !_{A} = \overline{f} !_{A}.

A restriction product of objects A, B in 𝕏 is defined by total projections

π_{0} : A × B ⟶ A π_{1} : A × B ⟶ B

satisfying the property that for any object C and maps f : C ⟶ A, g : C ⟶ B there is a unique pairing map, ⟨f, g⟩ : C ⟶ A × B such that both triangles below exhibit lax commutativity

[figure: C; f; g; ⟨f,g⟩; ≥; ≤; A; A × B; π_{0}; π_{1}; B]

that is,

⟨f, g⟩π_{0} = \overline{⟨f, g⟩}f and ⟨f, g⟩π_{1} = \overline{⟨f, g⟩}g.

In addition, we ask that \overline{⟨f, g⟩} = \overline{f} \overline{g}.

We require lax commutativity as a pairing ⟨f, g⟩ should only be defined as much as both f and g are.

548  J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

2.17. Definition. A restriction category 𝕏 is a cartesian restriction category if 𝕏 has a restriction terminal object and all restriction products.

Clearly, both sets and partial functions, and smooth functions defined on open subsets of ℝ^{n} are cartesian restriction categories.

The following contains a number of useful results. 2.18. Proposition. In any cartesian restriction category,

(i) ⟨f, g⟩π_{0} = \overline{f} g and ⟨f, g⟩π_{1} = \overline{g} f; (ii) if e = \overline{e}, then e⟨f, g⟩ = ⟨ef, g⟩ = ⟨f, eg⟩; (iii) f⟨g, h⟩ = ⟨fg, fh⟩; (iv) if f ≤ f′ and g ≤ g′, then ⟨f, g⟩ ≤ ⟨f′, g′⟩;

(v) if f ⌣ f′ and g ⌣ g′, then ⟨f, g⟩ ⌣ ⟨f′, g′⟩; (vi) if f is total, then (f × g)π_{1} = π_{1}g. If g is total, (f × g)π_{0} = π_{0}f. Proof.

(i) By the lax commutativity, ⟨f, g⟩π_{0} = \overline{⟨f, g⟩} f = \overline{f} \overline{g} f = \overline{g} f and similarly with π_{1}. (ii) Note that

e⟨f, g⟩π_{0} = e\overline{g} f = \overline{e} \overline{g} f = \overline{\overline{e} g} f = \overline{eg} f = ⟨f, eg⟩π_{0}

A similar result holds with π_{1}, and so by universality of pairing, e⟨f, g⟩ = ⟨f, eg⟩. By symmetry, it also equals ⟨ef, g⟩.

(iii) Note that

f⟨g, h⟩π_{0} = fh̄g = \overline{fh} fg = ⟨fg, fh⟩π_{0}

where the second equality is by [R.4]. A similar result holds for π_{1}, and so the result follows by universality of pairing.

(iv) Consider

\overline{⟨f, g⟩} ⟨f′, g′⟩
= \overline{f} \overline{g} ⟨f′, g′⟩ by (i)
= ⟨f′, \overline{f} \overline{g} g′⟩ by (ii)
= ⟨f′, \overline{f} , g⟩ since g ≤ g′
= ⟨\overline{f} f′, g⟩ by (ii)
= ⟨f, g⟩ since f ≤ f′.

Thus ⟨f, g⟩ ≤ ⟨f′, g′⟩.

DIFFERENTIAL RESTRICTION CATEGORIES  549

(v) By Lemma 2.12, we only need to show that \overline{⟨f, g⟩} ⟨f′, g′⟩ ≤ ⟨f, g⟩. But, again by Lemma 2.12, we have \overline{f} f′ ≤ f and \overline{g} g′ ≤ g, so by (iv) we get ⟨f̄f′, ḡg′⟩ ≤ ⟨f, g⟩ and thus by (ii) and (i), we get \overline{⟨f, g⟩} ⟨f′, g′⟩ ≤ ⟨f, g⟩.

(vi) (f × g)π_{1} = ⟨π_{0}f, π_{1}g⟩π_{1} = \overline{π_{0}f} π_{1}g = π_{1}g

If 𝕏 is a cartesian restriction category which also has joins, then the two structures are automatically compatible: 2.19. Proposition. In any cartesian restriction category with joins,

(i) ⟨f ∨ g, h⟩ = ⟨f, h⟩ ∨ ⟨g, h⟩ and ⟨f, ∅⟩ = ⟨∅, f⟩ = ∅; (ii) (f ∨ g) × h = (f × h) ∨ (g × h) and f × ∅ = ∅ × f = ∅. Proof.

(i) Since \overline{⟨f, ∅⟩} = \overline{f} \overline{∅} = \overline{f} ∅ = ∅, by Proposition 2.14, we have ⟨f, ∅⟩ = ∅. For pairing,

⟨f ∨ g, h⟩ = \overline{⟨f ∨ g, h⟩}⟨f ∨ g, h⟩
= \overline{f ∨ g}\overline{h}⟨f ∨ g, h⟩
= (\overline{f} ∨ \overline{g})⟨f ∨ g, h⟩
= (\overline{f}⟨f ∨ g, h⟩) ∨ (\overline{g}⟨f ∨ g, h⟩)
= ⟨\overline{f}(f ∨ g), h⟩ ∨ ⟨\overline{g}(f ∨ g), h⟩
= ⟨f, h⟩ ∨ ⟨g, h⟩

as required. (ii) Using part (a), f × ∅ = ⟨π_{0}f, π_{1}∅⟩ = ⟨π_{0}f, ∅⟩ = ∅ and

(f ∨ g) × h = ⟨π_{0}(f ∨ g), π_{1}h⟩
= ⟨(π_{0}f) ∨ (π_{0}g), π_{1}h⟩
= ⟨π_{0}f, π_{1}h⟩ ∨ ⟨π_{0}g, π_{1}h⟩
= (f × h) ∨ (g × h)

We shall see that this pattern continues with left additive and differential restriction categories: if the restriction category has joins, then it is automatically compatible with left additive or differential structure.

3. Differential restriction categories

Before we define differential restriction categories, we need to define left additive restriction categories. Left additive categories were introduced in [Blute et. al. 2008] as a precursor to differential structure. To axiomatize how the differential interacts with addition, one must define categories in which it is possible to add maps, but not have these maps necessarily preserve the addition (as is the case with smooth maps defined on real numbers). The canonical example of one of these left additive categories is the category of commutative monoids with arbitrary functions between them. These functions have a natural additive structure given pointwise: (f + g)(x) := f(x) + g(x), as well as 0 maps: 0(x) := 0. Moreover, while this additive structure does not interact well with postcomposition by a function, it does with precomposition: h(f + g) = hf + hg, and f0 = 0. This is essentially the definition of a left additive category.

3.1. Left additive restriction categories. To define left additive restriction categories, we need to understand what happens when we add two partial maps, as well as the nature of the 0 maps. Intuitively, the maps in a left additive category are added pointwise. Thus, the result of adding two partial maps should only be defined where the original two maps were both defined. Moreover, the 0 maps should be defined everywhere. Thus, the most natural requirement for the interaction of additive and restriction structure is that \overline{f + g} = \overline{f}\overline{g}, and that the 0 maps be total.

3.2. Definition. 𝕏 is a left additive restriction category if each 𝕏(A, B) is a commutative monoid with \overline{f + g} = \overline{f}\overline{g}, \overline{0} = 1, and furthermore is left additive: f(g + h) = fg + fh and f0 = \overline{f} 0.

It is important to note the difference between the last axiom (f0 = \overline{f} 0) and its form for left additive categories (f0 = 0). f0 need not be total, so rather than ask that this be equal to 0 (which is total), we must instead ask that f0 = \overline{f} 0. This phenomenon will return when we define differential restriction categories. In general, any time an equational axiom has a variable which occurs on only one side, we must modify the axiom to ensure the variable occurs on both sides, by including the restriction of the variable on the other side.

There are two obvious examples of left additive restriction categories: commutative monoids with arbitrary partial functions between them, and the subcategory of these consisting of continuous or smooth functions defined on open subsets of ℝ^{n}.

Some results about left additive structure:

DIFFERENTIAL RESTRICTION CATEGORIES  551

3.3. Proposition. In any left additive restriction category:

(i) f + g = \overline{g} f + \overline{f} g; (ii) if e = \overline{e}, then e(f + g) = ef + g = f + eg; (iii) if f ≤ f′, g ≤ g′, then f + g ≤ f′ + g′; (iv) if f ⌣ f′, g ⌣ g′, then (f + g) ⌣ (f′ + g′). Proof. (i)

f + g = \overline{f + g} (f + g) = \overline{f} \overline{g} (f + g) = \overline{g} \overline{f} f + \overline{f} \overline{g} g = \overline{g} f + \overline{f} g

(ii)

f + eg
= \overline{eg} f + \overline{f} eg by (i)
= \overline{e} \overline{g} f + \overline{e} \overline{f} g
= \overline{e} (\overline{g} f + \overline{f} g)
= e(f + g) by (i)

(iii) Suppose f ≤ f′, g ≤ g′. Then:

\overline{f + g} (f′ + g′)

= \overline{f} \overline{g} (f′ + g′)
= \overline{g} \overline{f} f′ + \overline{f} \overline{g} g′
= \overline{g} f + \overline{f} g since f ≤ f′, g ≤ g′
= f + g by (i).

so (f + g) ≤ (f′ + g′). (iv) Suppose f ⌣ f′, g ⌣ g′. By lemma 2.12, it suffices to show that \overline{f + g} (f′ + g′) ≤

f + g. By lemma 2.12, we have \overline{f} f′ ≤ f and \overline{g} g′ ≤ g, so by (ii), we can start with

\overline{f} f′ + \overline{g} g′ ≤ f + g
\overline{\overline{g} g′} \overline{f} f′ + \overline{\overline{f} f′} \overline{g} g′ ≤ f + g
\overline{g} \overline{g′} \overline{f} f′ + \overline{f} \overline{f′} \overline{g} g′ ≤ f + g by R3
\overline{f} \overline{g} (\overline{g′} f′ + \overline{f′} g′) ≤ f + g by left additivity
\overline{f + g} (f′ + g′) ≤ f + g by (i)

If 𝕏 has joins and left additive structure, then they are automatically compatible:

3.4. Proposition. If 𝕏 is a left additive restriction category with joins, then:

(i) f + ∅ = ∅;

(ii) (⋁_{i} f_{i}) + (⋁_{j} g_{j}) = ⋁_{i,j}(f_{i} + g_{j}).

Proof.

(i) \overline{f + ∅} = \overline{f} \overline{∅} = \overline{f} ∅ = ∅, so by Proposition 2.14, f + ∅ = ∅.

(ii) Consider:

(⋁_{i} f_{i}) + (⋁_{j} g_{j}) = \overline{(⋁_{i} f_{i}) + (⋁_{j} g_{j})}(⋁_{i} f_{i}) + (⋁_{j} g_{j})
= (⋁_{i} \overline{f_{i}})(⋁_{j} \overline{g_{j}})((⋁_{i} f_{i}) + (⋁_{j} g_{j}))
= (⋁_{i,j} \overline{f_{i}} \overline{g_{j}})((⋁_{i} f_{i}) + (⋁_{j} g_{j}))
= ⋁_{i,j} \overline{g_{j}} \overline{f_{i}}(⋁_{i} f_{i}) + \overline{f_{i}} \overline{g_{j}}(⋁_{j} g_{j}))
= ⋁_{i,j} \overline{g_{j}} f_{i} + \overline{f_{i}} g_{j} by Proposition 2.14,
= ⋁_{i,j} f_{i} + g_{j},

as required.

3.5. Additive and strongly additive maps. Before we get to the definition of a differential restriction category, it will be useful to have a slight detour, and investigate the nature of the additive maps in a left additive restriction category. In a left additive category, arbitrary maps need not preserve the addition, in the sense that

(x + y)f = xf + yf and 0f = 0,

are not taken as axioms. Those maps which do preserve the addition (in the above sense) form an important subcategory, and such maps are called additive. Similarly, it will be important to identify which maps in a left additive restriction category are additive.

Here, however, we must be a bit more careful in our definition. Suppose we took the above axioms as our definition of additive in a left additive restriction category. In particular, asking for that equality would be asking for the restrictions to be equal, so that

\overline{(x + y)f} = \overline{xf + yf} = \overline{xf} \overline{yf}

That is, xf and yf are defined exactly when (x + y)f is. Obviously, this is a problem in one direction: it would be nonsensical to ask that f be defined on x + y implies that f is defined on both x and y. The other direction seems more logical: asking that if f is defined on x and y, then it is defined on x + y. That is, in addition to being additive as a function, its domain is also additively closed.

Even this, however, is often too strong for general functions. A standard example of a smooth partial function would be something 2x, defined everywhere but x = 5. This map does preserve addition, wherever it is defined. But it is not additive in the sense that its domain is not additively closed. Thus, we need a weaker notion of additivity: we merely ask that (x + y)f be compatible with xf + yf. Of course, the stronger notion, where the domain is additively closed, is also important, and will be discussed further below.

3.6. Definition. Say that a map f in a left additive restriction category is additive if for any x, y,

(x + y)f ⌣ xf + yf and 0f ⌣ 0

We shall see below that for total maps, this agrees with the usual definition. We also have the following alternate characterizations of additivity:

3.7. Lemma. A map f is additive if and only if for any x, y,

\overline{xf} \overline{yf} (x + y)f ≤ xf + yf and 0f ≤ 0

or

(x\overline{f} + y\overline{f} )f ≤ xf + yf and 0f ≤ 0.

Proof. Use the alternate form of compatibility (Lemma 2.12) for the first part, and then [R.4] for the second.

3.8. Proposition. In any left additive restriction category,

(i) total maps are additive if and only if (x + y)f = xf + yf;

(ii) restriction idempotents are additive;

(iii) additive maps are closed under composition;

(iv) if g ≤ f and f is additive, then g is additive;

(v) 0 maps are additive, and additive maps are closed under addition.

Proof. In each case, the 0 axiom is straightforward, so we only show the addition axiom.

(i) It suffices to show that if f is total, then \overline{(x + y)f} = \overline{xf + yf} . Indeed, if f is total,

\overline{(x + y)f} = \overline{x + y} = \overline{x} \overline{y} = \overline{xf} \overline{yf} = \overline{xf + yf} .

(ii) Suppose e = \overline{e}. Then by [R.4],

(xe + ye)\overline{e} = \overline{\overline{xe + ye} \overline{e}} (xe + ye) ≤ xe + ye

so that e is additive.

(iii) Suppose f and g are additive. Then

\overline{xfg} \overline{yfg} (x + y)fg
= \overline{xfg} \overline{yfg} \overline{xf} \overline{yf} (x + y)fg
≤ \overline{xfg} \overline{yfg} (xf + yf)g since f is additive,
≤ xfg + yfg since g is additive,

as required.

(iv) If g ≤ f, then g = \overline{g} f, and since restriction idempotents are additive, and the composites of additive maps are additive, g is additive.

(v) For any 0 map, (x + y)0 = 0 = 0 + 0 = x0 + y0, so it is additive. For addition, suppose f and g are additive. Then we have

(x + y)f ⌣ xf + yf and (x + y)g ⌣ xg + yg.

Since adding preserves compatibility, this gives

(x + y)f + (x + y)g ⌣ xf + yf + xg + yg.

Then using left additivity of x, y, and x + y, we get

(x + y)(f + g) ⌣ x(f + g) + y(f + g)

so that f + g is additive.

The one property we do not have is that if f is additive and has a partial inverse g, then g is additive. Indeed, consider the left additive restriction category of arbitrary partial maps from ℤ to ℤ. In particular, consider the partial map f which is only defined on {p, q, r} for r ≠ p + q, and maps those points to {n, m, n + m}. In this case, f is additive, since (p + q)f is undefined. However, f’s partially inverse g, which sends {n, m, n + m} to {p, q, r}, is not additive, since ng + mg ≠ (n + m)g. The problem is that f’s domain is not additively closed, and this leads us to the following definition.

3.9. Definition. Say that a map f in a left additive restriction category is strongly additive if for any x, y,

xf + yf ≤ (x + y)f and 0f = 0.

An alternate description, which can be useful for some proofs, is the following:

3.10. Lemma. f is strongly additive if and only if (x\overline{f} + y\overline{f} )f = xf + yf and 0f = 0.

Proof.

xf + yf ≤ (x + y)f
⇔ \overline{xf + yf} (x + y)f = xf + yf
⇔ \overline{xf} \overline{yf} (x + y)f = xf + yf
⇔ (\overline{xf} x + \overline{yf} y)f = xf + yf
⇔ (x\overline{f} + y\overline{f} )f = xf + yf by [R.4].

Intuitively, the strongly additive maps are the ones which are additive in the previous sense, but whose domains are also closed under addition and contain 0. Note then that not all restriction idempotents will be strongly additive, and a map less than or equal to a strongly additive map need not be strongly additive. Excepting this, all of the previous results about additive maps hold true for strongly additive ones, and in addition, a partial inverse of a strongly additive map is strongly additive.

3.11. Proposition. In a left additive restriction category,

(i) strongly additive maps are additive, and if f is total, then f is additive if and only if it is strongly additive;

(ii) f is strongly additive if and only if \overline{f} is strongly additive and f is additive;

(iii) identities are strongly additive, and if f and g are strongly additive, then so is fg;

(iv) 0 maps are strongly additive, and if f and g are strongly additive, then so is f + g;

(v) if f is strongly additive and has a partial inverse g, then g is also strongly additive.

Proof. In most of the following proofs, we omit the proof of the 0 axiom, as it is straightforward.

(i) Since ≤ implies ⌣, strongly additive maps are additive, and by previous discussion, if f is total, the restrictions of xf + yf and (x + y)f are equal, so ⌣ implies ≤.

(ii) When f is strongly additive then f is additive. To show that \overline{f} is strongly additive we have:

(x\overline{f} + y\overline{f} )\overline{f}
= \overline{(x\overline{f} + y\overline{f} )f} (x\overline{f} + y\overline{f} ) by [R.4],
= \overline{xf + yf} (x\overline{f} + y\overline{f} )by 3.10 as f is strongly additive,
= \overline{x\overline{f}} \overline{y\overline{f}} (x\overline{f} + y\overline{f} )
= x\overline{f} + y\overline{f}

Together with 0\overline{f} = \overline{0f} 0 = \overline{0} 0 = 0, this implies, using Lemma 3.10, that \overline{f} is strongly additive.

Conversely, suppose \overline{f} is strongly additive and f is additive. First, observe:

\overline{xf + yf} = \overline{xf} \overline{yf}
= \overline{x\overline{f}} \overline{y\overline{f}}
= \overline{x\overline{f} + y\overline{f}}
= \overline{(x\overline{f} + y\overline{f} )\overline{f}} by 3.10 as \overline{f} is strongly additive
= \overline{(x\overline{f} + y\overline{f} )f}

This can be used to show:

xf + yf = \overline{xf + yf} (xf + yf)
= \overline{(x\overline{f} + y\overline{f} )f} (xf + yf) by the above
= \overline{xf + yf} (x\overline{f} + y\overline{f} )fas f is additive
= \overline{(x\overline{f} + y\overline{f} )f} (x\overline{f} + y\overline{f} )f by the above
= (x\overline{f} + y\overline{f} )f,

For the zero case we have:

0f = \overline{0f} 0 since f is additive
= \overline{0\overline{f}} 0
= \overline{0} 0 since \overline{f} is strongly additive
= 0

Thus, by lemma 3.10, f is strongly additive.

(iii) Identities are total and additive, so are strongly additive. Suppose f and g are strongly additive. Then

xfg + yfg
≤ (xf + yf)g since g strongly additive,
≤ (x + y)fg since f strongly additive,

so fg is strongly additive.

(iv) Since any 0 is total and additive, 0’s are strongly additive. Suppose f and g are strongly additive. Then

x(f + g) + y(f + g)
= xf + xg + yf + yf by left additivity,
≤ (x + y)f + (x + y)g since f and g are strongly additive,
= (x + y)(f + g) by left additivity,

so f + g is strongly additive.

(v) Suppose f is strongly additive and has a partial inverse g. Using the alternate form of strongly additive,

(x\overline{g} + y\overline{g})g
= (xgf + ygf)g
= (xg\overline{f} + yg\overline{f} )fg since f is strongly additive,
= (xg\overline{f} + yg\overline{f} )\overline{f}
= xg\overline{f} + yg\overline{f} since \overline{f} strongly additive,
= xg + yg

and 0g = 0fg = 0\overline{f} = 0, so g is strongly additive.

Finally, note that neither additive nor strongly additive maps are closed under joins. For additive, the join of the additive maps f : {n, m} [figure] {p, q} and g : {n + m} [figure] {r}, where p + q ≠ r, is not additive. For strongly additive, if f is defined on multiples of 2 and g on multiples of 3, their join is not closed under addition, so is not strongly additive.

3.12. Cartesian left additive restriction categories. In a differential restriction category, we will need both cartesian and left additive structure. Thus, we describe here how cartesian and additive restriction structures must interact.

3.13. Definition. 𝕏 is a cartesian left additive restriction category if it is both a left additive and cartesian restriction category such that the product functor preserves addition (that is (f + g) × (h + k) = (f × h) + (g × k) and 0 = 0 × 0) and the maps π_{0},π_{1}, and Δ are additive.

If 𝕏 is a cartesian left additive restriction category, then each object becomes canonically a (total) commutative monoid by +_{X} = π_{0} + π_{1} : X × X [figure] X and 0 : 1 [figure] X. Surprisingly, assuming these total commutative monoids are coherent with the cartesian structure, one can then recapture the additive structure, as the following theorem shows. Thus, in the presence of cartesian restriction structure, it suffices to give additive structure on the total maps to get a cartesian left additive restriction category.

3.14. Theorem. 𝕏 is a left additive cartesian restriction category if and only if 𝕏 is a cartesian restriction category in which each object is canonically a total commutative monoid, that is, for each object A, there are given maps A × A [figure: +_{A}] A and 1 [figure: 0_{A}] A making A a total commutative monoid, such that following exchange^{2} axiom holds:

+_{X×Y} = (X × Y) × (X × Y) [figure: ex] (X × X) × (Y × Y) [figure: +_{X}×+_{Y}] X × Y.

2Recall that the exchange map is defined by ex := ⟨π_{0} × π_{0}, π_{1} × π_{1}⟩ and that it satisfies, for example, ⟨⟨f, g⟩, ⟨h, k⟩⟩ex = ⟨⟨f, h⟩, ⟨g, k⟩⟩ and (Δ × Δ)ex = Δ.

Proof. Given a canonical commutative monoid structure on each object, the left additive structure on 𝕏 is defined by:

\begin{matrix}A [figure: f] B & A [figure: g] B \\ A [figure: f+g:=⟨f,g⟩+_{B}] B \end{matrix} add  A [figure: 0_{AB}:=!_{A}0_{B}] B zero

That this gives a commutative monoid on each 𝕏(A, B) follows directly from the commutative monoid axioms on B and the cartesian structure. For example, to show f + 0 = f, we need to show ⟨f,!_{A}0_{B}⟩ = f. Indeed, we have

[figure: A; B × B; ⟨f,!_{A}0_{B}⟩; A; A × 1; ≅; A × 1; B × B; f×0_{B}; A × 1; B × 1; f×1; B × 1; B; ≅; B × B; B; +_{B}; B × 1; B × B; 1×0_{B}; A; B; f]

the right-most shape commutes by one of the commutative monoid axioms for B, and the other shapes commute by coherences of the cartesian structure. The other commutative monoid axioms are similar.

For the interaction with restriction,

\overline{f + g} = \overline{⟨f, g⟩+_{B}} = \overline{⟨f, g⟩\overline{+_{B}}} = \overline{⟨f, g⟩} = \overline{f} \overline{g} ,

and \overline{0_{AB}} = \overline{!_{A}0_{B}} = 1 since ! and 0 are themselves total.

For the interaction with composition,

f(g + h) = f⟨g, h⟩+_{C} = ⟨fg, fh⟩+_{C} = fg + fh

and

f0_{BC} = f!_{B}0_{C} = \overline{f} !_{A}0_{C} = \overline{f} 0_{AC}

as required.

The requirement that (f + g) × (h + k) = (f × h) + (g × k) follows from the exchange axiom:

[figure: A × C; ⟨f,g⟩+_{B}×⟨h,k⟩+_{D}; ⟨f×h,g×k⟩; ⟨f,g⟩×⟨h,k⟩; (B × D) × (B × D); ex; +_{B×D}; (B × B) × (D × D); +_{B}×+_{D}; B × D]

the right triangle is the exchange axiom, and the other two shapes commute by the cartesian coherences.

Since π_{0} is total, π_{0} is additive in case for all f, g : A [figure] B × C, (f + g)π_{0} = fπ_{0} + gπ_{0}, which is shown by the following diagram:

[figure: A; ⟨fπ_{0},gπ_{0}⟩; ⟨f,g⟩; ⟨⟨fπ_{0},gπ_{0}⟩,⟨fπ_{1},gπ_{1}⟩⟩; (B × C) × (B × C); +_{(B×C)}; ex; B × C; π_{0}; B; (B × B) × (C × C); +_{B}×+_{C}; π_{0}; B × B; +_{B}]

A similar argument shows that π_{1} is additive. Since Δ is total, Δ is additive when for all f, g : A [figure] B, fΔ + gΔ = (f + g)Δ. This is shown by the following diagram:

[figure: A; ⟨fΔ,gΔ⟩; ⟨f,g⟩; ⟨f,g⟩+_{B}; (B × B) × (B × B); ex; +_{B×B}; B × B; +_{B}; Δ×Δ; ⟨+_{B},+_{B}⟩; Δ; (B × B) × (B × B); +_{B}×+_{B}; B; Δ; B × B]

3.15. Proposition. In a cartesian left additive restriction category:

(i) ⟨f, g⟩ + ⟨f′, g′⟩ = ⟨f + f′, g + g′⟩ and ⟨0, 0⟩ = 0;

(ii) if f and g are additive, then so is ⟨f, g⟩;

(iii) the projections are strongly additive, and if f and g are strongly additive, then so is ⟨f, g⟩, (iv) f is additive if and only if

(π_{0} + π_{1})f ⌣ π_{0}f + π_{1}f and 0f ⌣ 0;

(that is, in terms of the monoid structure on objects, (+)(f) ⌣ (f × f)(+) and 0f ⌣ 0),

(v) f is strongly additive if only if

(π_{0} + π_{1})f ≥ π_{0}f + π_{1}f and 0f = 0;

(that is, (+)(f) ≥ (f × f)(+) and 0f ≥ 0).

Note that f being strongly additive only implies that + and 0 are lax natural transformations.

Proof.

(i) Since the second term is a pairing, it suffices to show they are equal when postcomposed with projections. Post-composing with π_{0}, we get

(⟨f, g⟩ + ⟨f′, g′⟩)π_{0}
= ⟨f, g⟩π_{0} + ⟨f′, g′⟩π_{0} since π_{0} is additive,
= \overline{g} f + \overline{g′} f′
= \overline{g} \overline{g′} (f + f′)
= \overline{g + g′} (f + f′)
= ⟨f + f′, g + g′⟩π_{0}

as required. The 0 result is direct.

(ii) We need to show

(x + y)⟨f, g⟩ ⌣ x⟨f, g⟩ + y⟨f, g⟩;

however, since the first term is a pairing, it suffices to show they are compatible when post-composed by the projections. Indeed,

(x + y)⟨f, g⟩π_{0} = (x + y)\overline{g} f ⌣ x\overline{g} f + y\overline{g} f

while since π_{0} is additive,

(x⟨f, g⟩ + y⟨f, g⟩)π_{0} = x⟨f, g⟩π_{0} + y⟨f, g⟩π_{0} = x\overline{g} f + y\overline{g} f

so the two are compatible, as required. Post-composing with π_{1} is similar.

(iii) Since projections are additive and total, they are strongly additive. If f and g are strongly additive,

x⟨f, g⟩ + y⟨f, g⟩

= ⟨xf, xg⟩ + ⟨yf, yg⟩
= ⟨xf + yf, xg + yg⟩ by (i)
≤ ⟨(x + y)f, (x + y)g⟩ since f and g are strongly additive,
= (x + y)⟨f, g⟩

so ⟨f, g⟩ is strongly additive.

(iv) If f is additive, the condition obviously holds. Conversely, if we have the condition, then f is additive, since

(x + y)f = ⟨x, y⟩(π_{0} + π_{1})f ⌣ ⟨x, y⟩(π_{0}f + π_{1}f) = xf + yf

as required.

(v) Similar to the previous proof.

3.16. Differential restriction categories. With cartesian left additive restriction categories defined, we turn to defining differential restriction categories. To do this, we begin by recalling the notion of a cartesian differential category. The idea is to axiomatize the Jacobian of smooth maps. Normally, the Jacobian of a map f : X [figure] Y gives, for each point of X, a linear map X [figure] Y. That is, D[f] : X [figure] [X, Y]. However, we don’t want to assume that our category has closed structure. Thus, uncurrying, we get that the derivative should be of the type D[f] : X × X [figure] Y. The second coordinate is simply the point at which the derivative is being taken, while the first coordinate is the direction in which this derivative is being evaluated. With this understanding, the first five axioms of a cartesian differential category should be relatively clear. Axioms 6 and 7 are slightly more tricky, but in essence they say that the derivative is linear in its first variable, and that the order of partial differentiation does not matter. For more discussion of these axioms, see [Blute et. al. 2008].

3.17. Definition. A cartesian differential category is a cartesian left additive category with a differentiation operation

{X [figure: f] Y \atop X × X [figure: D[f]] Y}

such that

[CD.1] D[f + g] = D[f] + D[g] and D[0] = 0 (additivity of differentiation);

562  J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

[CD.2] ⟨g + h, k⟩D[f] = ⟨g, k⟩D[f] + ⟨h, k⟩D[f] and ⟨0, g⟩D[f] = 0 (additivity of a

derivative in its first variable); [CD.3] D[1] = π_{0}, D[π_{0}] = π_{0}π_{0}, and D[π_{1}] = π_{0}π_{1} (derivatives of projections); [CD.4] D[⟨f, g⟩] = ⟨D[f], D[g]⟩ (derivatives of pairings); [CD.5] D[fg] = ⟨D[f], π_{1}f⟩D[g] (chain rule); [CD.6] ⟨⟨g, 0⟩, ⟨h, k⟩⟩D[D[f]] = ⟨g, k⟩D[f] (linearity of the derivative in the first vari-

able); [CD.7] ⟨⟨0, h⟩, ⟨g, k⟩⟩D[D[f]] = ⟨⟨0, g⟩, ⟨h, k⟩⟩D[D[f]] (independence of partial differen-

tiation). We now give the definition of a differential restriction category. Axioms 8 and 9 are

the additions to the above. Axiom 8 says that the differential of a restriction is similar to the derivative of an identity, with the partiality of f now included. Axiom 9 says that the restriction of a differential is nothing more than 1 × \overline{f}: the first component, being simply the co-ordinate of the direction the derivative is taken, is always total. In addition to these new axioms, one must also modify axioms 2 and 6 to take into account the partiality when one loses maps, and remove the first part of axiom 3 (D[1] = π_{0}), since axiom 8 makes it redundant. 3.18. Definition. A differential restriction category is a cartesian left additive restriction category with a differentiation operation

{X [figure: f] Y \atop X × X [figure: D[f]] Y}

such that [DR.1] D[f + g] = D[f] + D[g] and D[0] = 0; [DR.2] ⟨g + h, k⟩D[f] = ⟨g, k⟩D[f] + ⟨h, k⟩D[f] and ⟨0, g⟩D[f] = \overline{gf}0; [DR.3] D[π_{0}] = π_{0}π_{0}, and D[π_{1}] = π_{0}π_{1}; [DR.4] D[⟨f, g⟩] = ⟨D[f], D[g]⟩; [DR.5] D[fg] = ⟨D[f], π_{1}f⟩D[g]; [DR.6] ⟨⟨g, 0⟩, ⟨h, k⟩⟩D[D[f]] = \overline{h}⟨g, k⟩D[f]; [DR.7] ⟨⟨0, h⟩, ⟨g, k⟩⟩D[D[f]] = ⟨⟨0, g⟩, ⟨h, k⟩⟩D[D[f]]; [DR.8] D[\overline{f}] = (1 × \overline{f})π_{0};

DIFFERENTIAL RESTRICTION CATEGORIES  563

[DR.9] \overline{D[f]} = 1 × \overline{f}.

Of course, any cartesian differential category is a differential restriction category, when equipped with the trivial restriction structure (\overline{f} = 1 for all f). The standard example with a non-trivial restriction is smooth functions defined on open subsets of ℝ^{n}; that this is a differential restriction category is readily verified. In the next section, we will present a more sophisticated example (rational functions over a commutative ring).

There is an obvious notion of differential restriction functor: 3.19. Definition. If 𝕏 and 𝕐 are differential restriction categories, a differential restriction functor 𝕏 [figure: F] 𝕐 is a restriction functor such that

• F preserves the addition and zeroes of the homsets;

• F preserves products strictly: F (A × B) = F A × F B, F 1 = 1, as well as pairings and projections,

• F preserves the differential: F (D[f]) = D[F (f)].

The differential itself automatically preserves both the restriction ordering and the compatibility relation: 3.20. Proposition. In a differential restriction category:

(i) D[\overline{f}g] = (1 × \overline{f})D[g]; (ii) If f ≤ g then D[f] ≤ D[g]; (iii) If f ⌣ g then D[f] ⌣ D[g]. Proof.

(i) Consider:

D[\overline{f}g]
= ⟨D\overline{f} , π_{1}\overline{f} ⟩D[g] by [[DR.5]]
= ⟨(1 × \overline{f} )π_{0}, π_{1}\overline{f} ⟩D[g] by [[DR.8]]
= ⟨(1 × \overline{f} )π_{0}, (1 × \overline{f} )π_{1}⟩D[g] by naturality
= (1 × \overline{f} )D[g] by Lemma 2.18.

as required. (ii) If f ≤ g, then

\overline{D[f]} D[g] = (1 × \overline{f} )D[g] = D[\overline{f} g] = D[f],

so D[f] ≤ D[g].

564  J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

(iii) If f ⌣ g, then

\overline{D[f]} D[g] = (1 × \overline{f} )D[g] = D[\overline{f} g] = D[\overline{g} f] = (1 × \overline{g})D[f] = \overline{D[g]} D[f], so D[f] ⌣ D[g].

Moreover, just as for cartesian and left additive structure, if 𝕏 has joins and differential structure, then they are automatically compatible: 3.21. Proposition. In a differential restriction category with joins,

(i) D[∅] = ∅, (ii) D [⋁_{i} f_{i}] = ⋁_{i} D[f_{i}]. Proof.

(i) \overline{D[∅]} = 1 × \overline{∅} = ∅, so by Lemma 2.14, D[∅] = ∅. (ii) Consider:

⋁_{i∈I} D[f_{i}]

= ⋁_{i∈I} D [\overline{f_{i}} ⋁_{j∈I} f_{j}] by Lemma 2.14
= ⋁_{i∈I}(1 × \overline{f_{i}})D [⋁_{j∈I} f_{j}] by Lemma 3.20
= (1 × ⋁_{i∈I} \overline{f_{i}} ) D [⋁_{j∈I} f_{j}]
= (1 × \overline{⋁_{i∈I} f_{i}} ) D [⋁_{j∈I} f_{j}]
= \overline{D [⋁_{i∈I} f_{i}]} D [⋁_{j∈I} f_{j}] by [DR.9]
= D [⋁_{i∈I} f_{i}]

as required.

DIFFERENTIAL RESTRICTION CATEGORIES  565

3.22. Linear maps. Just as we had to modify the definition of additive maps for left additive restriction categories, so too do we have to modify linear maps when dealing with differential restriction categories. Recall that in a cartesian differential category, a map is linear if D[f] = π_{0}f. If we asked for this in a differential restriction category, we would have

\overline{π_{0}f} = \overline{D[f]} = 1 × \overline{f} = \overline{π_{1}f} ,

which is never true unless f is total. In contrast to the additive situation, however, there is no obvious preference for one side to be more defined that the other. Thus, a map will be linear when D[f] and π_{0}f are compatible. 3.23. Definition. A map f in a differential restriction category is linear if

D[f] ⌣ π_{0}f

We shall see below that for total f, this agrees with the usual definition. We also have the following alternate characterizations of linearity: 3.24. Lemma. In a differential restriction category,

f is linear

⇔ \overline{π_{1}f}π_{0}f ≤ D[f]
⇔ \overline{π_{0}f}D[f] ≤ π_{0}f

Proof. Use the alternate form of compatibility (Lemma 2.12).

Linear maps then have a number of important properties. Note one surprise: while additive maps were not closed under partial inverses, linear maps are. 3.25. Proposition. In a differential restriction category:

(i) if f is total, f is linear if and only if D[f] = π_{0}f; (ii) if f is linear, then f is additive; (iii) restriction idempotents are linear; (iv) if f and g are linear, so is fg;

(v) if g ≤ f and f is linear, then g is linear; (vi) 0 maps are linear, and if f and g are linear, so is f + g; (vii) projections are linear, and if f and g are linear, so is ⟨f, g⟩; (viii) ⟨1, 0⟩D[f] is linear for any f; (ix) if f is linear and has a partial inverse g, then g is also linear.

566  J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

Proof.

(i) It suffices to show that if f is total, \overline{D[f]} = \overline{π_{0}f} . Indeed, if f is total, \overline{D[f]} = 1 × \overline{f} = \overline{f} × 1 = \overline{π_{0}f} .

(ii) For the 0 axiom:

0f = \overline{0f} 0f
= \overline{⟨0, 0⟩π_{1}f} ⟨0, 0⟩π_{0}f
= ⟨0, 0⟩\overline{π_{1}f} π_{0}f by [R.4],
≤ ⟨0, 0⟩D[f] since f linear,
= \overline{0f} 0 by [DR.2],
≤ 0

and for the addition axiom:

\overline{(x + y)f)}(xf + yf) = \overline{(x + y)f}(\overline{xf}xf + \overline{y}\overline{xf}\overline{x}yf)
= \overline{(x + y)f}(\overline{xf}xf + \overline{\overline{y}xf}\overline{x}yf)
= \overline{(x + y)f}(\overline{⟨x, x⟩π_{1}f}⟨x, x⟩π_{0}f + \overline{⟨y, x⟩π_{1}f}⟨y, x⟩π_{0}f)
= \overline{(x + y)f}(⟨x, x⟩\overline{π_{1}f}π_{0}f + ⟨y, x⟩\overline{π_{1}f}π_{0}f)
≤ \overline{(x + y)f}(⟨x, x⟩D[f] + ⟨y, x⟩D[f]) since f is linear
= \overline{⟨x + y, x⟩π_{0}f}⟨x + y, x⟩D[f] by [DR.2]
= ⟨x + y, x⟩\overline{π_{0}f}D[f]
= ⟨x + y, x⟩\overline{π_{1}f}π_{0}f since f is linear
= \overline{x + y, x⟩π_{1}f}⟨x + y, x⟩π_{0}f
= \overline{\overline{x + y}xf}\overline{x}(x + y)f
≤ (x + y)f

as required. (iii) Suppose e = \overline{e}. Then consider

\overline{π_{1}e} π_{0}\overline{e}
= \overline{π_{1}e} \overline{π_{0}e} π_{0}
≤ \overline{π_{1}e} π_{0}
= ⟨π_{0}e, π_{1}e⟩π_{0}
= (1 × e)π_{0}
= D[e]

so that e is additive.

DIFFERENTIAL RESTRICTION CATEGORIES  567

(iv) Suppose f and g are linear; then consider

D[fg] = ⟨D[f], π_{1}f⟩D[g]
≥ ⟨\overline{π_{1}f}π_{0}f, π_{1}f⟩\overline{π_{1}g}π_{0}g since f and g are linear
= \overline{⟨\overline{π_{1}f}π_{0}f, π_{1}f⟩π_{1}g}⟨\overline{π_{1}f}π_{0}f, π_{1}f⟩π_{0}g by [R.4]
= \overline{\overline{π_{1}f}\overline{π_{0}f}π_{1}fg}\overline{π_{1}f}\overline{π_{1}f}π_{0}fg
= \overline{π_{1}f}\overline{π_{1}fg}\overline{π_{0}f}π_{0}fg
= \overline{π_{1}fg}π_{0}fg

(v) If g ≤ f, then g = \overline{g} f; since restriction idempotents are linear and the composite of linear maps is linear, g is linear.

(vi) Since D[0] = 0 = π_{0}0, 0 is linear. Suppose f and g are linear; then consider

\overline{π_{0}(f + g)}D[f + g] = \overline{π_{0}f + π_{0}g}(D[f] + D[g])
= \overline{π_{0}f}\overline{π_{0}g}(D[f] + D[g])
= \overline{π_{0}f}D[f] + \overline{π_{0}g}D[g]
= \overline{π_{1}f}π_{0}f + \overline{π_{1}g}π_{0}g since f and g are linear
= \overline{π_{1}f}\overline{π_{1}g}π_{0}(f + g)
≤ π_{0}(f + g)

as required. (vii) By [DR.3], projections are linear. Suppose f and g are linear; then consider

D[⟨f, g⟩] = ⟨D[f], D[g]⟩
≥ ⟨\overline{π_{1}f}π_{0}f, \overline{π_{1}g}π_{0}g⟩ since f and g are linear
= \overline{π_{1}f}\overline{π_{1}g}π_{0}⟨f, g⟩
= \overline{\overline{π_{1}f}π_{1}g}π_{0}⟨f, g⟩
= \overline{\overline{π_{1}\overline{f}}π_{1}\overline{g}}π_{0}⟨f, g⟩
= \overline{π_{1}\overline{f}\overline{g}}π_{0}⟨f, g⟩ by [R.4]
= \overline{π_{1}⟨f, g⟩}π_{0}⟨f, g⟩

as required. (viii) The proof is identical to that for total differential categories:

D[⟨1, 0⟩D[f]] = ⟨D[⟨1, 0⟩], π_{1}⟨1, 0⟩⟩D[D[f]]
= ⟨⟨π_{0}, 0⟩, ⟨π_{1}, 0⟩⟩D[D[f]]
= ⟨π_{0}, 0⟩D[f] by [DR.6]
= π_{0}⟨1, 0⟩D[f]

as required.

(ix) If g is the partial inverse of a linear map f, then

D[g] ≥ (\overline{g} × \overline{g})D[g]
= (gf × gf)D[g]
= (g × g)(f × f)D[g]
= (g × g)⟨π_{0}f, π_{1}f⟩D[g]
= (g × g)⟨\overline{π_{1}f} π_{0}f, π_{1}f⟩D[g]
= (g × g)⟨\overline{π_{0}f} D[f], π_{1}f⟩D[g] since f is linear,
= (g × g)\overline{π_{0}f} ⟨D[f], π_{1}f⟩D[g]
= (g × g)\overline{π_{0}f} D[fg] by [DR.5],
= (g × g)\overline{π_{0}f} D[\overline{f} ]
= (g × g)\overline{π_{0}f} (1 × \overline{f} )π_{0} by [DR.8],
= \overline{(g × g)π_{0}f} (g × g)(1 × \overline{f} )π_{0} by [R.4],
= \overline{\overline{π_{1}g} π_{0}gf} (g × g)π_{0}
= \overline{π_{1}g} \overline{π_{0}\overline{g}} \overline{π_{1}g} π_{0}g
= \overline{π_{1}g} π_{0}g

as required.

Note that the join of linear maps need not be linear. Indeed, consider the linear partial maps 2x : (0, 2) [figure] (0, 4) and 3x : (3, 5) [figure] (9, 15). If their join was linear, then it would be additive. But this is a contradiction, since 2(1.75) + 2(1.75) ≠ 3(3.5). However, the join of linear maps is a standard concept of analysis:

3.26. Definition. If f is a finite join of linear maps, say that f is piecewise linear.

An interesting result from [Blute et. al. 2008] is the nature of the differential of additive maps. We get a similar result in our context:

3.27. Proposition. If f is additive, then D[f] is additive and

D[f] ⌣ π_{0}⟨1, 0⟩D[f];

if f is strongly additive, then D[f] is strongly additive and

D[f] ≤ π_{0}⟨1, 0⟩D[f].

Proof. The proof that f being (strongly) additive implies f (strongly) additive is the same as for total differential categories ([Blute et. al. 2008], pg. 19) with ⌣ or ≤ replacing = when one invokes the additivity of f. The form of D[f] in each case, however, takes a bit more work. We begin with a short calculation:

⟨0, π_{1}⟩\overline{π_{1}f} = \overline{⟨0, π_{1}⟩π_{1}f} ⟨0, π_{1}⟩ = \overline{π_{1}f} ⟨0, π_{1}⟩ and

⟨π_{0}, 0⟩\overline{π_{1}f} = \overline{⟨π_{0}, 0⟩π_{1}f} ⟨π_{0}, 0⟩ = \overline{0f} ⟨π_{0}, 0⟩.

Now, if f is additive, we have:

\overline{π_{0}⟨1, 0⟩D[f]} D[f]
= \overline{⟨π_{0}, 0⟩π_{1}f} D[f]
= \overline{0f} \overline{⟨π_{0}, 0⟩} D[f] by the second calculation above,
= \overline{0f} D[f]
= \overline{0f} \overline{π_{1}f} D[f]
= \overline{0f} \overline{π_{1}f} (⟨0, π_{1}⟩ + ⟨π_{0}, 0⟩)D[f]
= (\overline{π_{1}f} ⟨0, π_{1}⟩ + \overline{0f} ⟨π_{0}, 0⟩)D[f]
= (⟨0, π_{1}⟩\overline{π_{1}f} + ⟨π_{0}, 0⟩\overline{π_{1}f} )D[f] by both calculations above,
≤ ⟨0, π_{1}⟩D[f] + ⟨π_{0}, 0⟩D[f] since D[f] is additive,
= \overline{π_{1}f} 0 + ⟨π_{0}, 0⟩D[f] by [DR.2],
≤ 0 + ⟨π_{0}, 0⟩D[f]
= π_{0}⟨1, 0⟩D[f]

so that D[f] ⌣ π_{0}⟨1, 0⟩D[f], as required. If f is strongly additive, consider

\overline{D[f]} ⟨π_{0}, 0⟩D[f]

= \overline{π_{1}f} ⟨π_{0}, 0⟩D[f]
= \overline{π_{1}f} 0 + ⟨π_{0}, 0⟩D[f]
= ⟨0, π_{1}⟩D[f] + ⟨π_{0}, 0⟩D[f]
= (⟨0, π_{1}⟩\overline{π_{1}f} + ⟨π_{0}, 0⟩\overline{π_{1}f} )D[f] since D[f] is strongly additive,
= \overline{π_{1}f} \overline{0f} (⟨0, π_{1}⟩ + ⟨π_{0}, 0⟩)D[f] by the calculations above,
= \overline{π_{1}f} \overline{0} (1)D[f] since f strongly additive,
= \overline{π_{1}f} D[f]
= D[f]

so that D[f] ≤ π_{0}⟨1, 0⟩D[f], as required.

Any differential restriction category has the following differential restriction subcategory:

3.28. Proposition. If 𝕏 is a differential restriction category, then 𝕏_{0}, consisting of the maps which preserve 0 if it is in their domain (i.e., satisfying 0f ≤ 0), is a differential restriction subcategory.

Proof. The result is immediate, since the differential has this property:

⟨0, 0⟩D[f] = \overline{0f} 0 ≤ 0.

Finally, note that any differential restriction functor preserves additive, strongly additive, and linear maps:

3.29. Proposition. If F is a differential restriction functor, then

(i) F preserves additive maps;

(ii) F preserves strongly additive maps;

(iii) F preserves linear maps.

Proof. Since any restriction functor preserves ≤ and ⌣, the result follows automatically.

4. Rational functions

Thus far, we have only seen a single, analytic example of a differential restriction category. This section rectifies this situation by presenting a class of examples of differential restriction categories with a more algebraic flavour. Rational functions over a commutative ring have an obvious formal derivative. Thus, rational functions are a natural candidate for differential structure. Moreover, rational functions have an aspect of partiality: one thinks of a rational function as being undefined at its poles – that is wherever the denominator is zero.

To capture this partiality, we provide a very general construction of rational functions from which we extract a (partial) Lawvere theory of rational functions for any commutative rig and whence, in particular, for any commutative ring. We will then show that, for each commutative ring R, this category of rational functions over R is a differential restriction category.

Moreover, we will also show that these categories of rational functions embed into the partial map category of affine schemes with respect to localizations. Thus, we relate these categories of rational functions to categories which are of traditional interest in algebraic geometry.

4.1. The fractional monad. In order to provide a general categorical account of rational functions, it is useful to first have a monadic construction for fractions. When a construction is given by a monad, not only can one recover substitution – as composition in the Kleisli category – but also one has the whole category of algebras in which to interpret structures. The main difficulty with the construction of fractions is that, to start with, one has to find both an algebraic interpretation of the construction, and a setting where it becomes a monad.

A formal fraction is a pair (a, b), which one thinks of as \frac{a}{b}, with addition and multiplication defined as expected for fractions. If one starts with a commutative ring and one builds these formal fractions the very first peculiarity one encounters is that, to remain algebraic, one must allow the pair (a, 0) into the construction: that is one must allow division by zero. Allowing division by zero, \frac{a}{0}, introduces a number of problems. For example, because \frac{a}{0} + \frac{−a}{0} = \frac{0}{0} and not, as one would like, \frac{0}{1}, one loses negatives. One can, of course, simply abandon negatives and settle for working with commutative rigs. However, this does not resolve all the problems. Without cancellation, fractions under the usual addition and multiplication will not be a rig: binary distributivity of multiplication over addition will fail – as will the nullary distribution (that is 0 · x = 0). Significantly, to recover the binary distributive law, requires only a limited ability to perform cancellation: one needs precisely the equality \frac{a}{a^{2}} = \frac{1}{a}. By imposing this equality, one can recover, from the fraction construction applied to a rig, a weak rig – weak because the nullary distributive law has been lost (although the equalities 0 · 0 = 0 and 0 · x = 0 · x^{2} are retained). As we shall show below, this construction of fractions does then produce a monad on the category of weak rigs. Furthermore, the algebras for this monad, fractional rigs, can be used to provide a general description of rational functions.

An algebraic structure, closely related to our notion of a fractional rig, which was proposed in order to solve very much the same sort of problems, is that of a wheel [Carlström 2004]. Wheels also arise from formal fraction constructions, but the equalities imposed on these fractions is formulated differently. In particular, this means that the monadic properties over weak rigs – which are central to the development below – do not have a counterpart for wheels. Nonetheless, the theory developed here has many parallels in the theory of wheels. Certainly the theory of wheels illustrates the rich possibilities for algebraic structures which can result from allowing division by zero, and there is a nice discussion of the motivation for studying such structures in [Carlström 2004].

Technically a wheel, as proposed in [Carlström 2004], does not satisfy the binary distributive law (instead, it satisfies (x + y)z + 0z = xz + yz – where notably 0z ≠ 0 in general) and in this regard it is a weaker notion than a fractional rig. A wheel also has an involution with x^{∗∗} = x, while fractional rigs have a star operation satisfying the weaker requirement x^{∗∗∗} = x^{∗}. Thus, the structures are actually incomparable, although they certainly have many common features.

A weak commutative rig R = (U(R), ·, +, 1, 0) (where U(R) is the underlying set) is a set with two commutative associative operations, · with unit 1, and + with unit 0 which satisfies the binary distributive law x · (y + z) = x · y + x · z, has 0 · 0 = 0, and 0 · x = 0 · x · x (but in which the nullary distributive law fails, so in general x · 0 ≠ 0). Weak rigs with evident homomorphisms form a category wCRig.

For convenience, when manipulating the terms of a (weak) rig, we shall tend to drop the multiplication symbol, writing x · y simply by juxtaposition as xy.

Notice that there is a significant difference between a weak rig and a rig: a weak rig R can have a non-trivial “zero ideal”, R_{0} = {0r|r ∈ R}. Clearly 0 ∈ R_{0}, and it is closed to addition and multiplication. In fact, R_{0} itself is a weak rig with the peculiar property that 0 = 1. To convince the reader that weak rigs with 0 = 1 are a plausible notion, consider the natural numbers with the addition and multiplication given by maximum: this is a weak rig in which necessarily the additive and multiplicative units coincide. The fact that, in this example, the addition and multiplication are the same is not a coincidence:

4.2. Lemma. In a weak commutative rig R, in which 0 = 1, we have:

(i) Addition and multiplication are equal: x + y = xy;

(ii) Addition – and so multiplication – is idempotent, making R into a join semilattice (where x ≤ y if x + y = y).

Proof. When 1 = 0, to show that x + y = xy it is useful to first observe that both are addition and multiplication are idempotent:

x + x = x0 + x0 = x(0 + 0) = x0 = x and xx = 0x0x = 0xx = 0x = x.

Now we have the following calculation:

x + y = (x + y)(x + y) = x^{2} + xy + yx + y^{2} = x + xy + y
= x(1 + y) + y = x(0 + y) + y = xy + y
= (x + 1)y = (x + 0)y = xy

Thus, one now has a join semilattice determined by this operation.

Both rigs and rings, of course, are weak rigs in which R_{0} = {0}.

Define the fractions, 𝔣𝔯(R), of a weak commutative rig R as the set of pairs U(R) × U(R) modulo the equivalence relation generated by (r, as) ∼ (ar, a^{2}s), with the following “fraction” operations:

\begin{matrix}(r, s) + (r′, s′) := (rs′ + sr′, ss′), & 0 := (0, 1), \\ (r, s) · (r′, s′) := (rr′, ss′), & 1 := (1, 1). \end{matrix}

Now it is not at all obvious that this structure is, with this equivalence, a weak commutative rig. To establish this, it is useful to analyze the equivalence relation more carefully.

We shall, as is standard, write a|s to mean a divides s, in the sense that there is an s′ with s = as′. We may then write the generating relations for the equivalence above as (r, s) ⇾_{a} (r′, s′) where r′ = ar, s′ = as and a|s. Furthermore, we shall say a iteratively divides r, written a|^{∗}r, in case there is a decomposition a = a_{1} … a_{n} such that a_{1}|a_{2} … a_{n}r, and a_{2}|a_{3} … a_{n} · r, and ... , and a_{n}|r. Then define (r, s) ⇾_{a}^{∗} (r′, s′) to mean r′ = ar, s′ = as and a|^{∗}s.

Observe that to say (r, s) ⇾_{a}^{∗} (r′, s′) is precisely to say there is a decomposition a = a_{1} … a_{n} such that

(r, s) ⇾_{a_{n}} (a_{n}r, a_{n}s) ⇾_{a_{n−1}} ⋯ ⇾_{a_{1}} (a_{1} … a_{n}r, a_{1} … a_{n}r) = (r′, s′).

Thus ⇾^{∗} is just the transitive reflexive closure of ⇾ , the generating relation of the equivalence.

Next, say that (r_{1}, s_{1}) ∼ (r_{2}, s_{2}) if and only if there is a (r_{0}, s_{0}) and a, b ∈ R such that

\xymatrix{ & (r_{0}, s_{0}) \\ (r_{1}, s_{1}) \ar@{-->}[ur]_{∗}^{a} & & (r_{1}, s_{1}) \ar@{-->}[ul]^{∗}_{b}} .

Then we have:

4.3. Proposition. For any weak commutative rig, the relation (r_{1}, s_{1}) ∼ (r_{2}, s_{2}) on R × R is the equivalence relation generated by ⇾. Furthermore, it is a congruence with respect to fraction addition and multiplication, turning R×R/ ∼ into a weak commutative rig 𝔣𝔯(R).

Proof. That ∼ contains the generating relations and is contained in the equivalence relation generated by the generating relations is clear. That it is symmetric and reflexive is also clear. What is less clear is that it is transitive: for that we need the transitivity of ⇾^{∗} – which is immediate – and the ability to pushout the generating relations with generating relations:

\xymatrix{ & (r, s) \ar@{-->}[dl]_{a} \ar@{-->}[dr]^{b} \\ (ar, as) \ar@{-->}[dr]_{b} &  & (br, bs) \ar@{-->}[dl]^{a} \\  & (abr, abs)}

This shows that it is an equivalence relation.

To see that this is a congruence with respect to the fraction operations it suffices (given symmetries) to show that if (r, s) ⇾_{a} (ar, as) = (r′, s′) that (r, s)+(p, q) ⇾_{a} (r′, s′)+(p, q), and similarly for multiplication. That this works for multiplication is straightforward. For addition we have:

(r, s) + (p, q) = (rq + sp, sq) ⇾_{a} (a(rq + sp), asq) = (ar, as) + (p, q) = (r′, s′) + (p, q)

where a|sq as a|s.

Finally, we must show that this is a weak commutative rig. It is clear that the multiplication has unit (1, 1), and is commutative and associative. Similarly for addition it is clearly commutative, the unit is (0, 1) as:

(0, 1) + (a, b) = (0b + a, b) ⇾_{b} ((0b + a)b, b^{2}) = (0b^{2} + ab, b^{2}) = (0b + ab, b^{2})
= ((0 + a)b, b^{2}) = (ab, b^{2}) ⇽_{b} (a, b).

Furthermore, (0, 1)(0, 1) = (0, 1) and (0, 1)(a, b) = (0, 1)(a, b)^{2} as:

(0, 1)(a, b) = (0a, b) ⇾_{b^{2}} (0ab^{2}, b^{3}) = (0a^{2}b, b^{3}) ⇽_{b} (0a^{2}, b^{2}) = (0, 1)(a, b)^{2}.

That addition is associative is a standard calculation. The only other non-standard aspect is binary distributivity:

(a, b)((c, d) + (e, f)) = (a, b)(cf + de, df)
= (acf + ade, bdf)
⇾_{b} (abcf + abde, b^{2}df)
= (ac, bd) + (ae, bf)
= (a, b)(c, d) + (a, b)(e, f).

Notice that forcing binary distributivity to hold implies

(1, b) = (1, b)((1, 1)+(0, 1)) ≡ (1, b)(1, 1)+(1, b)(0, 1) = (1, b)+(0, b) = (b+0b, b^{2}) = (b, b^{2})

so that the generating equivalences above must hold, when distributivity is present. This means we are precisely forcing binary distributivity of multiplication over fraction addition with these generating equivalences. Note also that nullary distributivity, even when one starts with a rig R, will not hold in 𝔣𝔯(R), as (0, 0) = (0, 0)(0, 1) and (0, 1) are distinct unless 0 = 1.

It is worth briefly considering some examples:

(1) Any lattice L is a rig. 𝔣𝔯(L) has as its underlying set pairs {(x, y)|x, y ∈ L, x ≤ y} as, in this case, (x, y) ∼ (x ∧ y, y). These are the set of intervals of the lattice. The resulting addition and multiplication are both idempotent and are, respectively, the join and meet for two different ways of ordering intervals. For the multiplication the ordering is (x, y) ≤ (x′, y′) if and only if x ≤ x′ and y ≤ y′. For the addition the ordering^{3} is (x, y) ≤ (x′, y′) if and only if x′ ∧ y ≤ x and y ≤ y′.

Notice that the zero ideal consists of all intervals (⊥, a).

(2) In any unique factorization domain, R, such as the integers or any polynomial ring over a unique factorization domain, the equality in 𝔣𝔯(R) may be expressed by reduction (as opposed to the expansion given above). This reduction to a canonical form performs cancellation while the factor is not eliminated from the denominator. Thus, in 𝔣𝔯(ℤ) we have (18, 36) reduces to (3, 6) but no further reduction is allowed as this would eliminate a factor (in this case 3) from the denominator.

In any rig R, as zero divides zero, we have (r, 0) = (0, 0) for every r ∈ R. The zero ideal will, in general, be quite large as it is 𝔣𝔯R_{0} = {(0, r)|r ∈ R}.

(3) A special case of the above is when R is a field. In this case (x, y) = (xy^{−1}, 1) when y ≠ 0 and when y = 0 then, as above, (x, 0) = (0, 0). Thus, in this case the construction adds a single point “at infinity”, ∞ = (0, 0). Note that the zero ideal is {0, ∞}.

(4) The initial weak commutative rig is just the natural numbers, ℕ. Thus, it is of some interest to know what 𝔣𝔯(ℕ) looks like as this will be the initial algebra of the monad. The canonical form of the elements is, as for unique factorization domains, determined by canceling factors from the fractions while the denominator remains divisible by that factor. Addition and multiplication are performed as usual for fractions and then reduced by canceling in this manner to the canonical form. The zero ideal consists of (0, 0) and element of the form (0, p_{1}p_{2}...p_{n}) where the denominator is a (possibly empty) product of distinct primes.

3This order is known as the “modal interval inclusion” in the rough set literature and the meet with respect to this order is a well-known database operation related to “left outer joins”!

Clearly we always have a weak rig homomorphism:

η : R [figure] 𝔣𝔯(R); r ↦ (r, 1)

Furthermore this is always a faithful embedding: if (r, 1) ∼ (s, 1), then we have (u, v) ⇾_{a}^{∗} (r, 1) and (u, v) ⇾_{b}^{∗} (s, 1). This means a iteratively divides 1 but this means a = a_{1}·· · ··a_{n} where a_{n}|1 which, in turn, means a_{n} is a unit (i.e. has an inverse). But now we may argue similarly for a_{n−1} and this eventually gives that a itself is a unit. Similarly b is a unit and as a · v = 1 = b · v it follows a = b and whence that r = s.

In order to show that 𝔣𝔯 is a monad, we will use the “Kleisli triple” presentation of a monad. For this we need a combinator

{f : R [figure] 𝔣𝔯(S) \atop #(f) : 𝔣𝔯(R) [figure] 𝔣𝔯(S)}

such that #(η) = 1, η#(f) = f and #(f)#(g) = #(f#(g)). Recall that given this, the functor is defined by 𝔣𝔯(f) := #(fη) and the multiplication is defined by μ_{X} := #(1_{𝔣𝔯(X)}).

We define this combinator as #(f)(x, y) := [(x_{1}y_{2}^{2}, x_{2}y_{1}y_{2})], where [(x_{1}, x_{2})] = f(x) and [(y_{1}, y_{2})] = f(y). To simplify notation we shall write (x_{1}, x_{2}) ∈ f(x), rather than [(x_{1}, x_{2})] = f(x), to mean (x_{1}, x_{2}) is in the equivalence class determined by f(x).

Our very first problem is to prove that this is well-defined. That is if (x, y) ∼ (x′, y′) that #(f)(x, y) ∼ #(f)(x′, y′) and as this is a little tricky we shall give an explicit proof. First note that it suffices to prove this for a generating equivalence: so we may assume that (x, y) ⇾_{a} (x′, y′) = (ax, ay) (where this also means a|y) and we must prove that #(f)(x, y) ∼ #(f)(ax, ay). Now #(f)(ax, ay) = (x′_{1}(y′_{2})^{2}, x′_{2}y′_{1}y′_{2}) where (x′_{1}, x′_{2}) ∈ f(ax) and (y′_{1}, y′_{2}) ∈ f(ay). But we have f(ax) ∼ f(a)f(x) and f(ay) ∼ f(a)f(y) = f(a)f(a)f(z) where y = az thus, letting (a_{1}, a_{2}) ∈ f(a) and (z_{1}, z_{2}) ∈ f(z), there are α,β,γ, and δ such that

\xymatrix{ & (βa_{1}x_{1}, βa_{2}x_{2}) &  &  & (δa_{1}a_{1}z_{1}, δa_{2}a_{2}z_{2}) \\ (x′_{1}, x′_{2}) \ar@{-->}[ur]^{α} &  & (a_{1}x_{1}, a_{2}x_{2}) \ar@{-->}[ul]_{β} & (y′_{1}, y′_{2}) \ar@{-->}[ur]^{γ} &  & (a_{1}a_{1}z_{1}, a_{2}a_{2}z_{2}) \ar@{-->}[ul]_{δ}}

we may now calculate:

(x′_{1}y′_{2}^{2}, y′_{1}y′_{2}x′_{2}) ⇾_{α} (βa_{1}x_{1}y′_{2}^{2}, y′_{1}y′_{2}βa_{2}x_{2})
⇾_{γ} (βa_{1}x_{1}δa_{2}a_{2}z_{2}y′_{2}, δa_{1}a_{1}z_{1}y′_{2}βa_{2}x_{2})
⇾_{γ} (βa_{1}x_{1}δa_{2}a_{2}z_{2}δa_{2}a_{2}z_{2}, δa_{1}a_{1}z_{1}δa_{2}a_{2}z_{2}βa_{2}x_{2})
=  (βδ^{2}a_{1}x_{1}a_{2}^{4}y_{2}^{2}, βδ^{2}a_{1}^{2}a_{2}^{3}z_{1}z_{2}x_{2})
⇽_{βδ^{2}a_{2}^{2}a_{1}} (x_{1}(a_{2}z_{2})^{2}, (a_{1}z_{1})(a_{2}z_{2})x_{2})
=  (x_{1}y_{2}^{2}, y_{1}y_{2}x_{2}) ∈ #(f)(x, y)

This is the first step in proving:

4.4. Proposition. (𝔣𝔯, η, μ) is a monad, called the fractional monad, on wCRig

Proof. It remains to show that #(f) is a weak rig homomorphism and satisfies the Kleisli triple requirements. It is straightforward to check that #(f) preserves the units and multiplication. The argument for addition is a little more tricky.

First note:

f(rq + sp, sq) = [((r_{1}, r_{2})(q_{1}, q_{2}) + (s_{1}, s_{2})(p_{1}, p_{2}), (s_{1}, s_{2})(q_{1}, q_{2}))]
where (r_{1}, r_{2}) ∈ f(r), (s_{1}, s_{2}) ∈ f(s), (p_{1}, p_{2}) inf(p), (q_{1}, q_{2}) ∈ f(q)
= [((r_{1}q_{1}, r_{2}q_{2}) + (s_{1}p_{1}, s_{2}p_{2}), (s_{1}q_{1}, s_{2}q_{2}))]
= [(r_{1}q_{1}s_{2}p_{2} + r_{2}q_{2}s_{1}p_{1}, r_{2}q_{2}s_{2}p_{2})]
f(sq) = [(s_{1}q_{1}, s_{2}q_{2})]

so that we now have:

#(f)([(r, s)] + [(p, q)]) = #(f)([(rq + sp, sq)])
= [((r_{1}q_{1}s_{2}p_{2} + r_{2}q_{2}s_{1}p_{1})(s_{2}q_{2})^{2}, s_{1}p_{2}q_{1}r_{2}(s_{2}q_{2})^{2})]
∼ [((r_{1}q_{1}s_{2}p_{2} + r_{2}q_{2}s_{1}p_{1})s_{2}q_{2}, s_{1}p_{2}q_{1}r_{2}q_{2}s_{2})]
= [(r_{1}s_{2}^{2}p_{2}q_{1}q_{2} + r_{2}s_{1}s_{2}p_{1}q_{2}^{2}, r_{2}s_{1}s_{2}p_{2}q_{1}q_{2})]
= [(r_{1}s_{2}^{2}, r_{2}s_{1}s_{2})] + [(p_{1}q_{2}^{2}, p_{2}q_{1}q_{2})]
= #(f)([(r, s)]) + #(f)([(p, q)])

It remains to check the monad identities for the Kleisli triple. The first two are straightforward we shall illustrate the last identity:

#(g)(#(f)([(x, y)])) = #(g)(x_{1}y_{2}^{2}, x_{2}y_{1}y_{2}) where (x_{1}, x_{2}) ∈ f(x), (y_{1}, y_{2}) ∈ g(y)
= [(x_{11}y_{12}^{2}(x_{22}y_{21}y_{22})^{2}, x_{21}y_{22}^{2}x_{12}y_{11}y_{12}x_{22}y_{21}y_{22})]
where (x_{1i}, x_{2i}) ∈ g(x_{i}), (y_{1j}, y_{2j}) ∈ g(y_{j})
= [(x_{11}x_{22}^{2}(y_{21}y_{22}y_{12})^{2}, x_{12}x_{22}x_{12}y_{11}y_{22}^{2}y_{21}y_{22}y_{12})]
= [(x′_{1}y′_{2}^{2}, x′_{2}y′_{1}y′_{2})] where (x′_{1}, x′_{2}) ∈ #(g)(f(x)), (y′_{1}, y′_{2}) ∈ #(g)(f(y))
and (x_{11}x_{22}^{2}, x_{21}x_{22}x_{12}) ∈ #(g)([(x_{1}, x_{2})]) = #(g)(f(x))
(y_{11}y_{22}^{2}, y_{12}y_{22}y_{12}) ∈ #(g)([(y_{1}, y_{2})]) = #(g)(f(y))
= #(f#(g))([(x, y)]).

The algebras for this monad are “fractional rigs” as we will now show. A fractional rig is a weak commutative rig with an operation ( )^{∗} such that

• 1^{∗} = 1, x^{∗∗∗} = x^{∗}, (xy)^{∗} = y^{∗}x^{∗};

• x^{∗}xx^{∗} = x^{∗} (that is, x^{∗} is regular);

DIFFERENTIAL RESTRICTION CATEGORIES  577

• x^{∗}x(y + z) = x^{∗}xy + z (linear distributivity for idempotents). The last axiom is equivalent to demanding x^{∗}xy = x^{∗}x0 + y. In particular, setting y = 1, this means that x^{∗}x = x^{∗}x0 + 1.

Fractional rigs are of interest in their own right. Here are some simple observations: 4.5. Lemma. In any fractional rig:

(i) xx^{∗} is idempotent; (ii) If x is a unit, with xy = 1, then x^{∗} = y; (iii) x^{∗}x^{∗∗}x^{∗} = x^{∗}; (iv) xx^{∗} = (xx^{∗})^{∗};

(v) e is idempotent with e^{∗} = e if and only if there is an x with e = xx^{∗}; (vi) xx^{∗}x = x^{∗∗}; (vii) An element x is regular (that is, xx^{∗}x = x) if and only if x = x^{∗∗}. (viii) if 0 = 0^{∗} then 0 = 1, addition equals multiplication, and both operations are idem-

potent. We shall call an element e a ∗-idempotent when e is idempotent and e^{∗} = e.

Proof.

(i) (xx^{∗})(xx^{∗}) = x(x^{∗}xx^{∗}) = xx^{∗}. (ii) As xx^{∗} is idempotent if it has an inverse it is the identity. However, yy^{∗} is its inverse:

this means y = x^{∗}. (iii) x^{∗}x^{∗∗}x^{∗} = x^{∗∗∗}x^{∗∗}x^{∗∗∗} = x^{∗∗∗} = x^{∗}; (iv) xx^{∗} = xx^{∗}x^{∗∗}x^{∗} = x^{∗}xx^{∗}x^{∗∗} = x^{∗}x^{∗∗} = (xx^{∗})^{∗};

(v) If e is idempotent with e^{∗} = e then ee^{∗} = ee = e and the converse follows from the above.

(vi) xx^{∗}x = xx^{∗}x^{∗∗}x^{∗}x = x^{∗}xx^{∗}x^{∗∗}x = x^{∗∗}x^{∗}x = x^{∗∗}x^{∗}x^{∗∗}x^{∗}x = x^{∗∗}x^{∗}x^{∗∗} = x^{∗∗}; (vii) If x is regular in this sense then x^{∗∗} = xx^{∗}x = x so x = x^{∗∗} and the converse follows

from above. (viii) If 0 = 0^{∗} then 0 = 00 = 00^{∗} so 0 is a ∗-idempotent. This means 1 = 1 + 0 =

0(1 + 0) = 01 + 0 = 0!

In particular, as a consequence of the last observation, it follows from Lemma 4.2 that for any fractional rig R, the fractional rig R_{00^{∗}} = {00^{∗}r|r ∈ R}, which we discuss further in the next section, is a semilattice. In fact, we may say more:

4.6. Lemma. In any fractional rig in which 0 = 1:

(i) The addition and multiplication are equal and idempotent, producing a join semilattice;

(ii) 0 = 0^{∗} and ( )^{∗} is a closure operator (that is, it is monotone with x ≤ x^{∗} and x^{∗∗} = x^{∗}).

Proof. The first part follows from Lemma 4.2. For the second part: as 0 = 1 and 1^{∗} = 1, the first observation is immediate. Now x ≤ y if and only if y = xy but then, as ( )^{∗} preserves multiplication, y^{∗} = x^{∗}y^{∗} so that x^{∗} ≤ y^{∗}. Thus, ( )^{∗} is monotone. x ≤ x^{∗} if and only if x^{∗}x = x^{∗} but x^{∗}x = xx^{∗}x = x^{∗∗}, so we are done if we can show x^{∗} = x^{∗∗}. But x^{∗} = x^{∗}x^{∗∗}x^{∗} = x^{∗}x^{∗∗} = x^{∗∗}x^{∗}x^{∗∗} = x^{∗∗}x^{∗∗∗}x^{∗∗} = x^{∗∗}.

We observe next that for any weak commutative rig R, 𝔣𝔯(R) is a fractional rig with ( )^{∗} defined by (x, y)^{∗} := (y^{2}, yx). Notice first that it is straightforward to check that this is a well-defined operation which is multiplicative and that x^{∗∗∗} = x^{∗}. Furthermore, (x, y)^{∗} is regular in the sense that

(x, y)^{∗}(x, y)(x, y)^{∗} = (y^{2}, xy)(x, y)(y^{2}, xy) = (y^{4}x, y^{3}x^{2}) = (y^{2}, xy) = (x, y)^{∗}.

For the linear distribution observe that

(z, z)((p, q) + (r, s)) = (z, z)(ps + qr, qs) = (zps + zqr, zqs) = (z, z)(p, q) + (r, s).

Note that, for example, in 𝔣𝔯(ℕ) we have, for any two primes p ≠ q, (p, q)^{∗} = (q^{2}, pq) and (p, q)^{∗∗} = (p^{2}q^{2}, q^{3}p) = (p^{2}, pq) and (p, q)^{∗∗∗} = (p^{2}q^{2}, p^{3}q) = (q^{2}, pq) = (p, q)^{∗}. So here x^{∗∗} ≠ x and x^{∗∗} ≠ x^{∗}. On the other hand, (0, p)^{∗} = (p^{2}, 0p) = (0, 0) = (0, 0)^{∗} = (0, p)^{∗∗}, thus the “closure” of everything in the zero ideal is its top element, (0, 0).

To show that fractional weak rigs are exactly the algebras for the fractional monad, we need to show that for any fractional rig R, there is a structure map ν : 𝔣𝔯(R) [figure] R such that

\xymatrix{𝔣𝔯^{2}(R) \ar[d]_{𝔣𝔯(ν)} \ar[r]^{μ} & 𝔣𝔯(R) \ar[d]^{ν} \\ 𝔣𝔯(R) \ar[r]_{ν} & R}

commutes. Define ν : 𝔣𝔯(R) [figure] R; (r, s) ↦ rs^{∗}, then:

4.7. Lemma. For every fractional weak rig, R, ν as defined above is a fractional rig homomorphism.

Proof. We must check that ν is well-defined and is a fractional rig homomorphism. To establish the former it suffices to prove ν(x, ay) = ν(ax, a^{2}y) which is so as

ν(ax, a^{2}y) = axa^{2}y(a^{∗}^{2}y^{∗})^{2} = xaya^{∗}^{2}y^{∗}^{2} = ν(x, ay).

It is straightforward to check that multiplication and the units are preserved by ν. This leaves addition:

ν((r, s) + (p, q)) = ν(rq + sp, sq) = (rq + sp)sqs^{∗}^{2}q^{∗}^{2}
= s^{∗}q^{∗}(qq^{∗}(rq + sp)ss^{∗}) = s^{∗}q^{∗}(q^{2}q^{∗}r + s^{2}s^{∗}p)
= q^{2}q^{∗}^{2}rs^{∗} + s^{2}s^{∗}^{2}pq^{∗} = qq^{∗}rs^{∗} + ss^{∗}pq^{∗}
= qq^{∗}(rs^{∗} + pq^{∗})ss^{∗} = ss^{∗}(rs^{∗} + pq^{∗})qq^{∗}
= srs^{∗}^{2} + pqq^{∗}^{2} = ν(r, s) + ν(p, q).

Finally, ν preserves the ( )^{∗} as

ν((x, y)^{∗}) = ν(y^{2}, xy) = y^{2}x^{∗}y^{∗} = x^{∗}(yy^{∗}y) = x^{∗}y^{∗∗} = (xy^{∗})^{∗} = ν(x, y)^{∗}.

Now we can complete the story by showing not only that this definition of ν makes every fractional rig an algebra, but also that such an algebra inherits the structure of a fractional rig.

4.8. Proposition. An algebra for the fractional monad is exactly a fractional rig.

Proof. Every fractional rig is an algebra, that is the diagram above commutes:

ν(μ((r, s), (p, q))) = ν(rq^{2}, spq) =
= rq^{2}s^{∗}p^{∗}q^{∗}
= rs^{∗}p^{∗}qq^{∗}q
= rs^{∗}p^{∗}q^{∗∗}
= ν(rs^{∗}, pq^{∗})
= ν(𝔣𝔯(ν)((r, s), (p, q))

Conversely an algebra ν : 𝔣𝔯(R) [figure] R has r^{∗} = ν(η(r)^{∗}). It remains to check that this definition turns R into a fractional rig. The identities which do not involve nested uses of ( )^{∗} are straightforward. For example to show r^{∗}rr^{∗} = r^{∗} we have:

r^{∗}rr^{∗} = ν(η(r)^{∗})rν(η(r)^{∗}) = ν(η(r)^{∗})ν(η(r))ν(η(r)^{∗}) = ν(η(r)^{∗}η(r)η(r)^{∗}) = ν(η(r)^{∗}) = r^{∗}

where we use the fact that ν is a weak rig homomorphism and 𝔣𝔯(R) satisfies the identity. More difficult is to prove that r^{∗∗∗} = r^{∗}: we shall use two facts

\xymatrix{𝔣𝔯(X) \ar[d]^{(1)}_{∗} \ar[r]^{𝔣𝔯(f)} & 𝔣𝔯(Y) \ar[d]^{∗} & 𝔣𝔯^{2}(X) \ar[d]^{(2)}_{∗} \ar[r]^{μ} & 𝔣𝔯(X) \ar[d]^{∗} \\ 𝔣𝔯(X) \ar[r]_{𝔣𝔯(f)} & 𝔣𝔯(Y) & 𝔣𝔯^{2}(X) \ar[r]_{μ} & 𝔣𝔯(X)}

namely (1) the ( )^{∗} on 𝔣𝔯(X) is natural and (2) that μ preserves the ( )^{∗}. We start by establishing for any z ∈ 𝔣𝔯(R) that ν(η(ν(z))^{∗}) = ν(z^{∗}) as:

ν(η(ν(z))^{∗}) = ν(𝔣𝔯(ν)(η(z))^{∗}) =_{(1)} ν(𝔣𝔯(ν)(η(z)^{∗})) = ν(μ(η(z)^{∗})) =_{(2)} ν(μ(η(z))^{∗}) = ν(z^{∗})

This allows the calculation:

r^{∗∗∗} = ν(η(ν(η(ν(η(r)^{∗}))^{∗}))^{∗}) = ν(η(ν(η(r)^{∗∗}))^{∗}) = ν(η(r)^{∗∗∗}) = ν(η(r)^{∗}) = r^{∗}.

Let us denote the category of fractional rigs and and homomorphisms by fwCRig. Because this is a category of algebras over sets, this is a complete and cocomplete category. Furthermore, we have established:

4.9. Corollary. The underlying functor V : fwCRig [figure] wCRig has a left adjoint which generates the fraction monad on wCRig.

This observation suggests an alternative, more abstract, approach to these results: proving that the adjoint between these categories generates the fractional monad, in fact, suffices to prove that fwCRig is monadic over wCRig. The approach we have followed reflects our focus on the fractional monad itself and on its concrete development.

4.10. Rational functions. In any fractional rig the ∗-idempotents, e = e^{∗} = ee, have a special role. If we force the identity e = 1, this forces all e′ with ee′ = e – this is the up-set generated by e under the order e ≤ e′ ⇔ ee′ = e – to be the identity. For fractional rigs this is an expression of localization. A localization in fractional rigs is any map which is universal with respect to an identity of the form e = 1, where e is a ∗-idempotent of the domain. Thus the map ℓ_{e} : R [figure] R/⟨e = 1⟩ is a localization at e in case whenever f : R [figure] S has f(e) = f(1) there is a unique map f′ such that:

\xymatrix{R \ar[r]^{ℓ_{e}} \ar[dr]_{f} & R/⟨e = 1⟩ \ar@{.>}[d]^{f′} \\  & S}

Here R/⟨e = 1⟩ is determined only up to isomorphism, however, there is a particular realization of R/⟨e = 1⟩ as the fractional rig R_{e} = {re|r ∈ R}, with the evident addition, multiplication, and definition of ( )^{∗}. This gives a canonical way of representing the localization at any e by the map

ℓ_{e} : R [figure] R_{e}; r ↦ re.

In particular, ℓ_{00^{∗}} : R [figure] R_{00^{∗}} gives a localization of any fractional rig to one in which 0 = 1.

4.11. Lemma. In fwCRig the class of localizations, loc, contains all isomorphisms and is closed to composition and pushouts along any map.

Proof. All isomorphism are localizations as all isomorphisms are universal solutions to the equation 1 = 1. For composition observe, in the canonical representation of localizations, ℓ_{e_{1}}ℓ_{e_{2}} ≃ ℓ_{e_{1}e_{2}}. Finally, the pushout of ℓ_{e} : R [figure] R_{e} along f : R [figure] S is given by ℓ_{f(e)} : S [figure] S_{f(e)}:

[figure: R; ℓ_{e}; f; S; ℓ_{f(e)}; k_{1}; R_{e}; f′; k_{2}; S_{f(e)}; k̂; K]

First note that f′ is defined by f′(er) = f(e)f(r), which is clearly a fractional rig homomorphism. Now suppose the outer square commutes. If we define k̂(f(e)s) = k_{2}(f(e)s), then the right triangle commutes while

k̂(f′(er)) = k̂(f(e)f(r)) = k_{2}(f(e)f(r)) = k_{2}(f(er)) = k_{1}(ℓ_{e}(er)) = k_{1}(er),

showing that the left triangle commutes. Furthermore, k̂ is unique as ℓ_{f(e)} is epic, showing that the inner square is a pushout.

This means immediately:

4.12. Proposition. loc is a stable system of monics in fwCRig^{op}, so (fwCRig^{op},loc) is an M-category and, thus Par(fwCRig^{op},loc) is a cartesian restriction category.

We shall denote this partial map category RAT and refer to it as the category of rational functions. Recall that a map R [figure] S in this category, as defined above, is a cospan in fwCRig of the form:

\xymatrix{ & R_{e} \\ R \ar@{-->}[ur]^{ℓ_{e}} &  & S \ar[ul]_{h}}

where we use the representation R_{e} = {er|r ∈ R}. This means, in fact, that a map in this category is equivalently a map h : S [figure] R which preserves addition, multiplication, and ( )^{∗} – but does not preserve the unit of multiplication, and has h(0) = h(1) · 0. These we shall refer to as corational morphisms. Thus, RAT can be alternately presented as:

4.13. Corollary. RAT is precisely the opposite of the category of fractional rigs with corational morphisms.

The advantage of this presentation is that one does not have to contend with spans or pushouts: one can work directly with corational maps. In particular, the corestriction of a corational map f : S [figure] R is just f(1) · : R [figure] R.

This category is certainly not obviously recognizable as a category of rational functions as used in algebraic geometry. Our next objective is to close this gap. In order to do this we start by briefly reviewing localization in commutative rigs.

The definition of a localization for commutative rigs is a direct generalization of the usual notion of localization for commutative rings, as in [Eisenbud 2004]. A localization is a rig homomorphism ϕ : R → S such that there exists a multiplicative set, U, with ϕ(U) ⊆ units(S), with the property that for any map f : R [figure] T, with f(U) ⊆ units(T), there is a unique map k : S [figure] T such that f = ϕk:

\xymatrix{R \ar[r]^{ϕ} \ar[dr]_{f} & S \ar@{.>}[d]^{k} \\  & T}

A localization is said to be finitely generated if there is a finitely generated multiplicative set U for which the map is universal.

Denote the class of finitely generated localizations by Loc. We next show that Loc is a stable system of monics in CRig^{op}, so one may form a partial map category for commutative rigs opposite with respect to localizations.

If R is a commutative rig, and U is a multiplicative closed set, R[U^{−1}], is the universal rig obtained with all elements in U turned into into units. This is called the rig of fractions with respect to a multiplicative set U, as the operations in the rig are defined as for fractions with denominator chosen from U, see for example [Dummit and Foote 2004]. This is exactly the fractional construction described above except with denominators restricted to U and with the additional ability that one may quotient out by arbitrary factors. There is a canonical localization, l_{U} : R [figure] R[U^{−1}]; l_{U}(r) = \frac{r}{1}. It is clear that (finitely generated) localizations in CRig are epic, contain all isomorphisms, and are closed to composition. Furthermore, we have the following:

4.14. Proposition. In CRig, the pushout along any map of a (finitely generated) localization exists and is a (finitely generated) localization.

Proof. Let R, A, S be rigs. Let ϕ : R [figure] S be a localization, let f : R [figure] A be a rig homomorphism, and let W ⊆ R be the factor closed multiplicative set that ϕ inverts. Then f(W) is also a multiplicative set which is finitely generated if W is, so we can form the canonical localization l_{f(W)} : A [figure] A[(f(W))^{−1}]. This means that l_{f(W)}f(W) ⊂ units(A[(f(W))^{−1}], and so we get a unique k : S [figure] A[(f(W))^{−1}] such that the following diagram commutes

\xymatrix{R \ar[r]^{ϕ} \ar[d]_{f} & S \ar[d]^{k} \\ A \ar[r]_{l_{f(W)}} & A[(f(W))^{−1}]}

To show that this square is a pushout, suppose the outer square commutes in:

\xymatrix{R \ar[r]^{ϕ} \ar[d]_{f} & S \ar[d]^{k} \ar[ddr]^{q_{1}} \\ A \ar[drr]_{q_{0}} \ar[r]_{l_{f(W)}} & A[(f(W))^{−1}] \ar@{.>}[dr]^{k̂} \\  &  & Q}

If we can show that q_{0} sends f(W) to units, we get a unique map k̂ : A[(f(W))^{−1}] [figure] Q. Now, q_{0}(f(W)) = q_{1}(ϕ(W)) by commutativity; thus, q_{1}(ϕ(W)) ⊂ units(Q), so q_{0}(f(W)) ⊂ units(Q) giving k̂. Next, we must show that kk̂ = q_{1}. However, ϕq_{1} = fq_{0} = fl_{f(W)}k̂ = ϕkk̂ and ϕ is epic, q_{1} = kk̂. Moreover, since k̂ is the unique map this makes the bottom triangle commute, and the square a pushout.

Thus Loc is a stable system of monics in CRig^{op}, and so we can form a partial map category:

4.15. Proposition. (CRig^{op}, Loc) is an M-category, and Par(CRig^{op}, Loc) is a cartesian restriction category.

We shall call this category RAT_{rig}. Our next objective is to prove:

4.16. Theorem. RAT_{rig} is the full subcategory of RAT determined by objects 𝔣𝔯(W (R)) for R ∈ CRig, where W is the inclusion of commutative rigs into weak commutative rigs.

To prove that the induced comparison between the cospan categories is full and faithful it suffices to show that the composite W 𝔣𝔯 is a full and faithful left adjoint which preserves and reflects localizations. This because it will then fully represent the maps in the cospan category and preserve their composition – as this is given by a colimit. That it is a left adjoint follows from 4.17, the full and faithfulness follows from 4.18(i) and the preservation and reflection of localizations from 4.18(iii),(iv), and (v). We start with:

4.17. Lemma. The inclusion functor W : CRig [figure] wCRig has both a left and right adjoint.

The left adjoint arises from simply forcing the nullary distributive law to hold. It is the form of the right adjoint which is of more immediate interest to us. Given any weak rig R, the set of rig elements of R is rig(R) = {r|r · 0 = 0}. Clearly rig elements include 0 and 1, and are closed under the multiplication and addition. Thus, they form a subrig of any weak rig, and it is this rig which is easily seen to give the right adjoint to the inclusion W above.

This leads to the following series of observations:

4.18. Lemma. For any rig R:

(i) rig(𝔣𝔯(W (R))) ≅ R;

(ii) If e is a ∗-idempotent of 𝔣𝔯(W (R)) then e ∼ (r, r) for some r ∈ R; (iii) The up-sets of ∗-idempotents e ∈ 𝔣𝔯(W (R)), uparrowe{e′|ee′ = e}, correspond pre-

cisely to finitely generated multiplicative closed subsets of R which are also factor closed, Σ_{e} = {r ∈ R|(r, r) ≥ e};

(iv) rig(𝔣𝔯(W (R))/e) = R(Σ_{e}^{−1}) (where Σ_{e}^{−1} is a rig with Σ_{e} universally inverted);

(v) 𝔣𝔯(W (R))/e ≅ 𝔣𝔯(R[Σ_{e}^{−1}]).

Proof.

(i) Suppose (r, s)(0, 1) ∼ (0, 1) then (0, 1) ⇾_{α} (p, q) ⇽_{β} (0, s). It follows that α is a unit (as it must iteratively divide 1) and so p = 0 and q = α. But q = βs so that β and s are units. However then (r, s) ∼ (s^{−1}r, 1) showing each rig element is (up to equivalence) an original rig element.

(ii) We must have (r, s) ⇾_{α} (p, q) ⇽_{β} (r^{2}, s^{2}) and (r, s) ⇾_{γ} (p′, q′) ⇽_{δ} (s^{2}, rs) from which we have: (r, s) ⇾_{α} (βr^{2}, βs^{2}) ⇾_{γ} (βδrs^{2}, βδsrs).

(iii) Σ_{e} is multiplicatively closed as its idempotents are closed to multiplication, it is factor closed (that rs ∈ Σ_{e} implies r, s ∈ Σ_{e}) provided e_{1}e_{2} ≥ e implies e_{1} ≥ e and e_{2} ≥ e which is immediate. Finally, any representative (r, r) for e itself will clearly generate the multiplicative set Σ_{e}, so it is finitely generated.

A factor closed multiplicative set, U, which is finitely generated by {r_{1}, .., r_{n}} is generated by a single element, namely the product of the generators, ∏ r_{i}, as each generator is a factor of this. However, it is then easy to see that U = Σ_{∏ r_{i}}.

(iv) First observe that forcing e to be a unit forces each e′ ≥ e to be a unit. But forcing e′ = (r, r) to have (r, r) ∼ (1, 1) forces r to become a unit in 𝔣𝔯(W (R))/e as (r, 1)(1, r) = (r, r) = (1, 1). Thus, the evident map R [figure] 𝔣𝔯(W (R))/e certainly inverts every element in Σ_{e}. However, the rig elements of 𝔣𝔯(W (R))/e must, using a similar argument to (i) above must have their denominators invertible so that they are of the form (r, s) where s ∈ Σ_{e}. But these elements give the rig of fractions with respect to Σ_{e} as discussed below.

(v) If l : R [figure] R[Σ_{e}] is the universal map, we have 𝔣𝔯(W (l)) : 𝔣𝔯(W (R)) [figure] 𝔣𝔯(W (R[Σ_{e}])) where this sends e = (r, r) to the identity as r becomes a unit. So this map certainly factors 𝔣𝔯(W (l)) = ℓ_{e}h where h : 𝔣𝔯(W (R))/e [figure] 𝔣𝔯(W (R[Σ_{e}])). However there is also a map (at the level of the underlying sets) in the reverse direction given by (pu_{1}^{−1}, qu_{2}^{1}) ↦ (pu_{1}^{−1}r^{n}, qu_{2}^{1}r^{n}) where e = (r, r) and a high enough power n is chosen so that u_{1}^{−1} and u_{2}^{−1} can be eliminated. This is certainly a section of h as a set map which is enough to show that h is bijective and so an isomorphism.

We can now complete the proof of Theorem 4.16:

Proof. As W and 𝔣𝔯 are both left adjoints they preserve colimits and thus there is a functor RAT_{rig} [figure] RAT which carries an object R to 𝔣𝔯(W (R)) and a map R [figure: l] R[Σ_{e}^{−1}] ⟵^{h} S

to 𝔣𝔯(W (R)) [figure: ℓ_{e}] 𝔣𝔯(W (R))/e ≅ 𝔣𝔯(W (R[Σ_{e}^{−1}])) ⟵^{h} fr(W (S)). The preservation of colimits ensures composition is preserved.

It remains to show that this functor is full. For this we have to show that given a cospan

𝔣𝔯(W (R)) [figure: ℓ_{e}] 𝔣𝔯(W (R))/e ⟵^{h} fr(W (S))

that it arises bijectively from a span in RAT_{rig}. For this we note the correspondences:

R [figure: l_{Σe}] R[Σ_{e}^{−1}] = rig(𝔣𝔯(W (R))/e) CRig
W (R) [figure: (ℓ_{e})^{♭}] 𝔣𝔯(W (R))/e wCRig
𝔣𝔯(W (R)) [figure: ℓ_{e}] 𝔣𝔯(W (R))/e fwCRig

and also

S [figure: (ηh)^{♭}] R[Σ_{e}^{−1}] CRig
S [figure: (ηh)^{♭}] rig(𝔣𝔯(W (R))/e) CRig
W (S) [figure: ηh] (𝔣𝔯(W (R))/e) wCRig
𝔣𝔯(W (S)) [figure: h] 𝔣𝔯(W (R))/e fwCRig

so that there is a bijective correspondence between the cospans of RAT from 𝔣𝔯(W (R)) to 𝔣𝔯(W (S)) and the cospans in RAT_{rig}.

We indicated that we had restricted RAT to rigs by writing RAT_{rig}. Commutative rings sit inside rigs and, fortuitously, when one localizes a ring R in the category of rigs one obtains a ring. Thus, in specializing this result further to RAT_{ring} there is nothing further to do!

4.19. Corollary. RAT_{ring} is the full subcategory of RAT determined by the objects 𝔣𝔯(W (R)) where R ∈ CRing.

4.20. Rational polynomials. Recall that for any commutative rig R, there is an adjunction between Sets and R/CRig. The left adjoint takes a set B to the free commutative R-algebra on B, giving the correspondence

{x_{1}, …, x_{n}} [figure: s] U(S) Sets
R[x_{1}, …, x_{n}] [figure: s^{♯}] S R/CRig

This correspondence gives the morphism, s^{♯}, which is obtained by substituting s_{i} ∈ S for x_{i} which we may present as:

s^{♯} : R[x_{1}, …, x_{n}] [figure] S; ∑ r_{i}x_{1}^{α_{1,i}}..x_{n}^{α_{n,i}} ↦ [s_{i}/x_{i}](∑ r_{i}x_{1}^{α_{1,i}} … x_{n}^{α_{n,i}}) = ∑ r_{i}s_{1}^{α_{1,i}} … s_{n}^{α_{n,i}}

(Note that here we identify r_{i}, as is conventional, with its image in an R-algebra: strictly speaking we should always write u(r_{i}) as an R-algebra is a map u : R [figure] S.)

The category of finitely generated free commutative R-algebras opposite is just the Lawvere theory for R-algebras: one may think of it as the category of polynomials over R. It may be presented concretely as follows: its objects are natural numbers and a map from n to m is an m-tuple of polynomials (p_{1}, … p_{m}) where each p_{i} ∈ R[x_{1}, …, x_{n}]. Clearly the object n is the n-fold product of the object 1 (e.g. the projections 2 [figure] 1 are (x_{1}) and (x_{2}) and there is only one map () to 0 making it the final object). Composition is then given by substituting these tuples:

n [figure: (p_{1},...,p_{m})] m [figure: (q_{1},...,q_{k})] k = n [figure: ([p_{1}/x_{1},...,p_{m}/x_{m}]q_{1},...,[p_{1}/x_{1},...,p_{m}/x_{m}]q_{k})] k.

The aim of this section is derive a similar concrete description of the category of rational polynomials over a rig (or ring) R, which we shall call Rat_{R}. This category will again have natural numbers as objects and its maps will involve fractions of the polynomial rigs. However, before we derive this concrete description, we shall provide an abstract description of this category using our understanding of rational functions developed above.

The category of rational polynomials over a commutative rig R may be described in terms of the partial map category obtained from using localizations in R/CRig. Recall that objects in this coslice category are maps u : R [figure] S, and maps are triangles:

\xymatrix{ & R \ar[dl]_{u_{1}} \ar[dr]^{u_{2}} \\ S_{1} \ar[rr]_{f} &  & S_{2}}

A (finitely generated) localization is just a map whose bottom arrow is a localization in CRig. This allows us to form the category of cospans whose left leg is a localization: the composition is given as before by pushing out, where pushing outs is the same as in CRig. We may call this category RAT_{R/rig} and, as above, we shall now argue that it is a full subcategory of a larger category of rational functions which we shall call RAT_{𝔣𝔯(W (R))}. This latter category is formed by taking the cospan category of localizations in the coslice category 𝔣𝔯(W (R))/fwCRig. Thus a typical map in this category has the form:

\xymatrix{ & 𝔣𝔯(W (R)) \ar[ddl]_{u_{1}} \ar[d]|{u′} \ar[ddr]^{u_{2}} \\  & S_{1}/e \\ S_{1} \ar[ur]_{ℓ_{e}} &  & S_{2} \ar[ul]^{h}}

It is now a straightforward observation that:

4.21. Proposition. RAT_{R/rig} is the full subcategory of RAT_{𝔣𝔯(W (R))} determined by the objects 𝔣𝔯(W (u)) : 𝔣𝔯(W (R)) [figure] 𝔣𝔯(W (S)) for u ∈ R/CRig.

The category of rational polynomials over R, Rat_{R}, may then be described as the full subcategory of RAT_{R/rig} determined by the objects under R given by the canonical (rig) embeddings u_{n} : R [figure] R[x_{1}, …, x_{n}] for each n ∈ ℕ. Thus, the objects correspond to natural numbers. In RAT_{R}, this is the full subcategory determined by the objects 𝔣𝔯(W (u_{n}) and the maps are the opposite of the corational functions which fix 𝔣𝔯(W (R). Unwinding this has the maps as cospans:

\xymatrix{ & 𝔣𝔯(W (R)) \ar[ddl]_{𝔣𝔯(W (u_{1}))} \ar[d]|{u′} \ar[ddr]^{𝔣𝔯(W (u_{2}))} \\  & 𝔣𝔯(W (R[x_{1}, …, x_{n}]))/e \\ 𝔣𝔯(W (R[x_{1}, …, x_{n}])) \ar@{-->}[ur]_{ℓ_{e}} &  & 𝔣𝔯(W (R[x_{1}, …, x_{m}])) \ar@{-->}[ul]^{h}}

where we have:

𝔣𝔯(W (R[x_{1}, …, x_{m}])) [figure: h] 𝔣𝔯(W (R[x_{1}, …, x_{n}]))/e 𝔣𝔯(W (R))/fwCRig
W (R[x_{1}, …, x_{m}]) [figure: ηh] 𝔣𝔯(W (R[x_{1}, …, x_{n}]))/e W (R)/wCRig
R[x_{1}, …, x_{m}] [figure: (ηh)^{♭}] rig(𝔣𝔯(W (R[x_{1}, …, x_{n}]))/e) R/CRig
{x_{1}, …, x_{m}} [figure: sub((ηh)^{♭})] U(rig(𝔣𝔯(W (R[x_{1}, …, x_{n}]))/e)) Set

Thus, such a map devolves into a selecting, for each variable x_{i}, elements from the underlying set of rig(𝔣𝔯(W (R[x_{1}, …, x_{n}]))/e). To select such elements amounts to selecting m fractions from 𝔣𝔯(W (R[x_{1}, …, x_{n}])) whose denominator is in the multiplicative set Σ_{e}. NowΣ_{e} is a finitely generated multiplicative set, so it can be written as Σ_{e} := ⟨p_{1}, ..., p_{k}⟩, where the p_{i} ∈ R[x_{1}, …, x_{n}] are the generators.

This allows us to concretely define a category of rational polynomial over a commutative rig R. The objects are natural numbers: the maps n [figure] m are m-tuples of rational polynomials in n variables accompanied by a finite set of polynomials called the restriction set such that each denominator is in the factor closed multiplicative set generated by the restriction set. For brevity we will write x_{1}, …, x_{n} as \overrightarrow{x}^{n}.

4.22. Definition. Let R be a commutative rig. Define Rat_{R} to be the following

Objects: n ∈ ℕ

Arrows: n → m given by a pair (\overrightarrow{x}^{n} ↦ (f_{i}, g_{i})_{i=1}^{m} , U) where • (f_{i}, g_{i}) ∈ 𝔣𝔯(W (R[x_{1}, …, x_{n}])) for each i;

• U = ⟨p_{1}, …, p_{k}⟩ ⊆ R[x_{1}, …, x_{n}] is a finitely generated factor closed and multiplicatively closed set of polynomials;

• Each (f_{i}, g_{i}) is subject to fractional equality, every denominator g_{i} is in U, and any u ∈ U can be completely eliminated from the fraction (as these are inverted).

Identity: (\overrightarrow{x}^{n} ↦ (x_{i}, 1)_{i=1}^{n} , ⟨⟩) : n ⟶ n

Composition: Given (\overrightarrow{x}^{n} ↦ (f_{i}, g_{i})_{i=1}^{m} , U) : n ⟶ m and (\overrightarrow{x}^{m} ↦ (f′_{i}, g′_{i})_{i=1}^{k} , U′) : m ⟶ k, then the composition is given by substitution:

\begin{matrix}(\overrightarrow{x}^{n} ↦ (f_{i}, g_{i})_{i=1}^{m} , U) & (\overrightarrow{x}^{m} ↦ (f′_{i}, g′_{i})_{i=1}^{k} , U′) \\ (\overrightarrow{x}^{n} ↦ (a_{i}, b_{i})_{i=1}^{k} , U′′) \end{matrix}

Where

• (a_{j}, b_{j}) = [(f_{i}, g_{i})/x_{i}] (f′_{j}, g′_{j}),

• (α_{j}, α_{j}) = [(f_{i}, g_{i})/x_{i}] (u′_{j}, u′_{j}) where ⟨u′_{1}, …, u′_{w}⟩ = U′,

• and U′′ = ⟨u_{1}, …, u_{l}, α_{1}, …, α_{w}⟩, where ⟨u_{1}, …, u_{l}⟩ ∈ U.

Perhaps the one part of this concrete definition of Rat_{R} which requires some explanation is the manner in which U′′ is obtained. To understand what is happening, recall that the restriction is determined by a ∗-idempotent which for U′ is e′ = (u′_{1} … u′_{w}, u′_{1} … u′_{w}). To obtain the new ∗-idempotent we must multiply the ∗-idempotent, e, obtained from U, with the result of mapping (i.e. substituting) e′.

Here is an example of a composition in Rat_{ℤ}. Take the maps

(x_{1}, x_{2} ↦ (\frac{5x_{1}x_{2}}{x_{1}} , \frac{x_{1}x_{2}^{2}}{x_{1} + x_{2}} , \frac{(x_{1} + x_{2})^{2}}{3x_{2}} ) , ⟨x_{1}, x_{1} + x_{2}, x_{2}⟩) : 2 [figure] 3,

and

(x_{1}, x_{2}, x_{3} ↦ (\frac{7(x_{1} + x_{3})}{x_{1}x_{2}}, \frac{x_{1}}{1} ) , ⟨4 + x_{3} + x_{1}, x_{1}, x_{2}⟩) : 3 [figure] 2.

The composite of the above maps – without cleaning up any factors – is:

(x_{1}, x_{2} ↦(\frac{(105x_{1}x_{2}^{2} + 7x_{1}(x_{1} + x_{2})^{2})(x_{1}(x_{1} + x_{2}))^{2}}{15x_{1}^{4}x_{2}^{4}(x_{1} + x_{2})} , \frac{5x_{1}x_{2}}{x_{1}} ) , ⟨ \begin{matrix}x_{1},x_{1}+x_{2},x_{2}, \\ 5x_{1}^{3}x_{2},x_{1}x_{2}^{2}(x_{1}+x_{2})^{2}, \\ ( \begin{matrix}15x_{1}x_{2}^{2}+12x_{1}x_{2} \\ +x_{1}(x_{1}+x_{2})^{2} \end{matrix} )(3x_{2}x_{1})^{2} \end{matrix} ⟩): 2 [figure] 2.

Recall that here we have used the Kleisli composition of the fractional monad. This can be cleaned up somewhat by using properties of fractional rigs:

(x_{1}, x_{2} ↦(\frac{(105x_{2}^{2} + 7x_{1}(x_{1} + x_{2})^{2})(x_{1} + x_{2})^{2}}{15x_{1}^{2}x_{2}^{4}(x_{1} + x_{2})} , \frac{5x_{1}x_{2}}{x_{1}} ) , ⟨ \begin{matrix}x_{1},x_{1}+x_{2},x_{2}, \\ 5,3, \\ ( & \begin{matrix}15x_{2}^{2}+12x_{2} \\ +(x_{1}+x_{2})^{2} \end{matrix} & ) \end{matrix} ⟩): 2 [figure] 2.

Finally, we can actually eliminate factors which are in the multiplicative set:

(x_{1}, x_{2} ↦(\frac{(105x_{2}^{2} + 7x_{1}(x_{1} + x_{2})^{2})(x_{1} + x_{2})}{15x_{1}^{2}x_{2}^{4}}, \frac{5x_{2}}{1} ) , ⟨ \begin{matrix}x_{1},x_{1}+x_{2},x_{2}, \\ 5,3, \\ ( & \begin{matrix}15x_{2}^{2}+12x_{2} \\ +(x_{1}+x_{2})^{2} \end{matrix} & ) \end{matrix} ⟩): 2 [figure] 2.

The hard work we have done with fractional rigs (in particular, Proposition 4.21) can now be reaped to give:

4.23. Proposition. For each commutative rig R, Rat_{R} is a cartesian restriction category.

The restrictions are, in this presentation, given by the multiplicative sets.

A final remark which will be useful in the next section. If R is a ring, then the rig of polynomials R[x_{1}, …, x_{n}] is also a ring. Thus, as before, there is nothing extra to be done to define Rat_{R} for a commutative ring.

4.24. Differential structure on rational polynomials. To be a differential restriction category, Rat_{R} must have cartesian left additive structure.

4.25. Proposition. For each commutative rig, R, Rat_{R} is a cartesian left additive restriction category.

Proof. Each object is canonically a total commutative monoid by the map:

((x_{i})_{i=1,...,2n} ↦ (x_{i} + x_{n+i})_{i=1,...,n}) : 2n [figure] n

and this clearly satisfies the required exchange coherence (see 3.14).

If (\overrightarrow{x}^{n} ↦ (p_{i}, q_{i})_{i=1}^{m} , U) , (\overrightarrow{x}^{n} ↦ (p′_{i}, q′_{i})_{i=1}^{m} , V) : n ⟶ m are arbitrary parallel maps then

(\overrightarrow{x}^{n} ↦ (p_{i}, q_{i})_{i=1}^{m} , U) + (\overrightarrow{x}^{n} ↦ (p′_{i}, q′_{i})_{i=1}^{m} , V)
= (\overrightarrow{x}^{n} ↦ (p_{i}q′_{i} + p′_{i}q_{i}, q_{i}q′_{i})_{i=1}^{m} , ⟨U ∪ V⟩)

so we are using the addition defined in 𝔣𝔯(R[x_{1}, …, x_{n}]).

It remains to define the differential structure of Rat_{R}. We will use formal partial derivatives to define this structure. Formal partial derivatives are used in many places: in Galois theory the formal derivative is used to determine if a polynomial has repeated roots [Stewart 2004], and in algebraic geometry the rank of the formal Jacobian matrix is used to determine if a local ring is regular [Eisenbud 2004]. Finally, it is also important to note that here we must assume we start with a commutative ring, rather than a rig: negatives are required to define the formal derivative of a rational function.

4.26. Proposition. If R is a commutative ring, then Rat_{R} is a differential restriction category.

Given a ring, R, there is a formal partial derivative for elements of R[x_{1}, …, x_{n}]. Let f = ∑_{l} a_{l}x_{1}^{l_{1}} ⋯ x_{n}^{l_{n}} be a polynomial. Then the formal partial derivative of f with respect

to the variable x_{k} is

\frac{∂f}{∂x_{k}} = ∑_{l} l_{k}a_{l}x_{1}^{l_{1}} ⋯ x_{k−1}^{l_{k−1}}x_{k}^{l_{k}−1}x_{k+1}^{l_{k+1}} ⋯ x_{n}^{l_{n}}

Extend the above definition to rational functions, where g = \frac{p}{q} by

\frac{∂g}{∂x_{k}} = \frac{\frac{∂p}{∂x_{k}} q − p\frac{∂q}{∂x_{k}}}{q^{2}} .

From the above observation, one can show that the unit must have an additive inverse and, thus, every element must have an additive inverse. This means we need a ring to define the differential structure on rational functions. Now, if we have f = (f_{1}, …, f_{m}) = (\frac{p_{1}}{q_{1}} , …, \frac{p_{m}}{q_{m}} ), an m-tuple of rational functions in n variables over R, then we can define the formal Jacobian at a point of R^{n} as the m × n matrix

J_{f}(y_{1}, …, y_{n}) = [\begin{matrix}\frac{∂f_{1}}{∂x_{1}} (y_{1}, …, y_{n}) & … & \frac{∂f_{1}}{∂x_{n}} (y_{1}, …, y_{n}) \\ ⋮ & ... & ⋮ \\ \frac{∂f_{m}}{∂x_{1}} (y_{1}, …, y_{n}) & … & \frac{∂f_{m}}{∂x_{n}} (y_{1}, …, y_{n}) \end{matrix}]

Finally, consider Rat_{R} where R is a commutative ring. Then, define the differential structure to be

(\overrightarrow{x}^{n} ↦ (p_{i}, q_{i})_{i=1}^{m} , U) : n [figure] m D[ ] (\overrightarrow{x}^{2n} ↦ ((J_{(p_{i},q_{i})}(x_{n+1}, …, x_{2n})) · (x_{1}, …, x_{n})) , [x_{n+i}/x_{i}] R) : 2n = n × n [figure] m

For example, consider Rat_{ℤ} and the map (x_{1}, x_{2} ↦ (\frac{1}{x_{1}} , \frac{x_{1}^{2}}{1+x_{2}} ) , ⟨x_{1}, 1 + x_{2}⟩). Then the differential of this map is

(x_{1}, x_{2}, x_{3}, x_{4} ↦ (\frac{−x_{1}}{x_{3}^{2}} , \frac{2x_{3}x_{1}(x_{4} + 1) − x_{3}^{2}x_{2}}{(x_{4} + 1)^{2}} ) , ⟨x_{3}, 1 + x_{4}⟩)

Proof. In [Blute et. al. 2008], the category of smooth functions between finite dimensional ℝ vector spaces is established as an example of a cartesian differential category using the Jacobian as the differential structure. The proof for showing that Rat_{R} is a differential restriction category is much the same, so we will highlight the places where the axioms have changed and new axioms have been added.

[DR.2] Consider the second part of [DR.2], ⟨0, g⟩D[f] = \overline{gf} 0: it has been modified by the addition of the restriction constraint. Let f = (\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{m}, V) and g = (\overrightarrow{x}^{k} ↦ (g_{i}, g′_{i})_{n}, U) then it is clear that we must show

[0/x_{i}, (g_{i}, g′_{i})/x_{n+i}] V′ = [(g_{i}, g′_{i})/x_{i}] V

where V′ = [x_{n+i}/x_{i}]V so that V′ is just V with variable indices shifted by n. Thus, these substitutions are clearly equal.

[DR.6] Consider the maps

g = (\overrightarrow{x}^{k} ↦ (g_{i}, g′_{i})_{i=1}^{n} , U) , h = (\overrightarrow{x}^{k} ↦ (h_{i}, h′_{i})_{i=1}^{n} , W) , and k = (\overrightarrow{x}^{k} ↦ (k_{i}, k′_{i})_{i=1}^{n} , W) .

The restriction set for D[f] is V′ = \overline{h}⟨[x_{n+i}/x_{i}]V, and the restriction set for D[D[f]] is V′′ = [x_{2n+j}/x_{j}]V′ = [x_{3n+i}/x_{i}]V. We must prove ⟨⟨g, 0⟩, ⟨h, k⟩⟩D[D[f]] = \overline{h}⟨g, k⟩D[f] which translates to:

(\overrightarrow{x}^{k} ↦ ((g_{1}, g′_{1}), …, (g_{n}, g′_{n}), 0, …, 0, (h_{1}, h′_{1}), …, (h_{n}, h′_{n}), (k_{1}, k′_{1}), …, (k_{n}, k′_{n})) , ⟨U ∪ W ∪ T ⟩)

D[D[f]] = \overline{(\overrightarrow{x}^{k} ↦ (h_{i}, h′_{i})_{i=1}^{n} , T )}

(\overrightarrow{x}^{k} ↦ ((g_{1}, g′_{1}), …, (g_{n}, g′_{n}), (k_{1}, k′_{1}), …, (k_{n}, k′_{n})) , ⟨U ∪ W⟩) D[f].

The rational functions of the maps are easily seen to be the same. It remains to prove that the restriction sets are the same, that is:

⟨(U ∪ W ∪ T) ∪ [(g_{i}, g′_{i})/x_{i}, 0_{i}/x_{n+i}, (h_{i}, h′_{i})/x_{2n+i}, (k_{i}, k′_{i})/x_{3n+i}] V′′⟩
= ⟨U ∪ (W ∪ T ∪ [(g_{i}, g′_{i})/x_{i}, (k_{i}, k′_{i})/x_{n+i}] V′)⟩

This amounts to showing:

[(g_{i}, g′_{i})/x_{i}, 0_{i}/x_{n+i}, (h_{i}, h′_{i})/x_{2n+i}, (k_{i}, k′_{i})/x_{3n+i}] V′′ = [(g_{i}, g′_{i})/x_{i}, (k_{i}, k′_{i})/x_{n+i}] V′.

which is immediate from the variable shifts which are involved.

[DR.8] Let f = (\overrightarrow{x}^{n} ↦ (f_{i})i = 1^{m}, V) : n [figure] m then

(1 × \overline{f} )π_{0} = (\overrightarrow{x}^{2n} ↦ (x_{i})_{i=1}^{2n}, [x_{n+i}/x_{i}]V) π_{0}
= (\overrightarrow{x}^{2n} ↦ (x_{i})_{i=1}^{n}, [x_{n+i}/x_{i}]V)
= (\overrightarrow{x}^{2n} ↦ I_{n×n}x⃗, [x_{n+i}/x_{i}]V)
= (\overrightarrow{x}^{2n} ↦ (J_{(x_{i})_{i}}(\overrightarrow{x}_{n+1}^{2n})) · \overrightarrow{x}_{1}^{n}, [x_{n+i}/x_{i}]V)
= D[\overline{f} ].

[DR.9] Considering f = (\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m}, V), we have

1 × \overline{f} = (\overrightarrow{x}^{n} ↦ (x_{i}, 1)_{i=1}^{n} , \{\}) × (\overrightarrow{x}^{n} ↦ (x_{i}, 1)_{i=1}^{n} , V)
= (\overrightarrow{x}^{2n} ↦ (x_{i}, 1)_{i=1}^{2n} , ⟨[x_{n+i}/x_{i}] V⟩)
= \overline{D[f]} .

4.27. Further properties of Rat_{R}. In this section we will describe three aspects of Rat_{R}. First we will prove that Rat_{R} has nowhere defined maps for each R. Next, after briefly introducing the definition of 0-unitariness for restriction categories, we will show that if R is an integral domain, then Rat_{R} is a 0-unitary restriction category. Finally, we will show that Rat_{R} does not in general have joins.

Recall from section 2.9 that a restriction category 𝕏 has nowhere defined maps, if for each 𝕏(A, B) there is a map ∅_{AB} which is a bottom element for 𝕏(A, B), and these are preserved by precomposition. We will show that Rat_{R} always has nowhere defined maps. Intuitively, a nowhere defined rational function should be one whose restriction set U is the entire rig R[x_{1}, …, x_{n}]. This can be achieved with a finitely generated set by simply considering the set generated by 0, since any such polynomial is in the factor closure of 0.

4.28. Proposition. For any commutative rig R, Rat_{R} has nowhere defined maps given by

(\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{m} , ⟨0⟩) .

Proof. First, note

\overline{(\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{m} , ⟨0⟩)} = (\overrightarrow{x}^{n} ↦ (x_{i}, 1)_{i=1}^{n} , ⟨0⟩) = (\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{n} , ⟨0⟩)

since 0x_{i} = 0. Next, note that R[x_{1}, …, x_{n}] = ⟨0⟩ = ⟨⟨0⟩ ∪ U⟩. Let (a_{i}, b_{i}) = [(1, 1)/x_{i}] (p_{i}, q_{i}); clearly for each i,

0 = 0a_{i} = 0b_{i}.

Thus, the following equalities are clear:

(\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{n} , ⟨0⟩) (\overrightarrow{x}^{n} ↦ (p_{i}, q_{i})_{i=1}^{m} , U)
= (\overrightarrow{x}^{n} ↦ (a_{i}, b_{i})_{i=1}^{m} , ⟨⟨0⟩ ∪ U⟩)
= (\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{m} , ⟨0⟩) ,

so that this map is the bottom element. Now consider

(\overrightarrow{x}^{n} ↦ (p_{i}, q_{i})_{i=1}^{m} , U) (\overrightarrow{x}^{m} ↦ (1, 1)_{i=1}^{k} , ⟨0⟩)
= (\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{k} , ⟨U ∪ ⟨0⟩⟩)
= (\overrightarrow{x}^{n} ↦ (1, 1)_{i=1}^{k} , ⟨0⟩) ,

so that these maps are preserved by precomposition, which completes the proof that Rat_{R} has nowhere defined maps.

Now, if R is an integral domain, we would expect that whenever two rational functions agree on some common restriction idempotent, then they should be equal wherever they are both defined. To make this idea explicit, we will introduce the concept of 0-unitary for restriction categories^{4}.

Let 𝕏 be a restriction category with nowhere defined maps. To define 0-unitariness, we first define a relation ≤_{0} on parallel arrows, called the 0-density relation, as follows:

f ≤_{0} g if f ≤ g and hf = ∅ implies hg = ∅.

𝕏 is a 0-unitary restriction category when for any f, g, h:

f ≥_{0} h ≤_{0} g implies f ⌣ g.

4.29. Lemma. Let 𝕏 be a restriction category with nowhere defined maps, and assume h ≤_{0} f. Then if f or h equals ∅, then both f and h equal ∅.

Proof. Since h ≤_{0} f, we have h = \overline{h} f, and whenever kh = ∅, kf = ∅.

First assume that f = ∅. Then h = ∅ since

h = \overline{h} f = \overline{h} ∅ = ∅.

Next, assume that h = ∅. Then by 0-unitariness,

1h = h = ∅ implies 1f = ∅,

which completes the proof.

Now we prove that Rat_{R} is a 0-unitary restriction category when R is an integral domain.

4.30. Proposition. Let R be an integral domain. Then Rat_{R} is a 0-unitary restriction category.

Proof. Consider the maps:

(\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m} , U) , (\overrightarrow{x}^{n} ↦ (g_{i}, g′_{i})_{i=1}^{m} , V) , and (\overrightarrow{x}^{n} ↦ (h_{i}, h′_{i})_{i=1}^{m} , W)

Assume:

(\overrightarrow{x}^{n} ↦ (h_{i}, h′_{i})_{i=1}^{m} , W) ≤_{0} (\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m} , U)
(\overrightarrow{x}^{n} ↦ (h_{i}, h′_{i})_{i=1}^{m} , W) ≤_{0} (\overrightarrow{x}^{n} ↦ (g_{i}, g′_{i})_{i=1}^{m} , V) .

Now if any of the above maps are ∅, then lemma (4.29) says that all three of the above equal ∅; therefore,

(\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m} , U) ⌣ (\overrightarrow{x}^{n} ↦ (g_{i}, g′_{i})_{i=1}^{m} , V) .

4This is related to the concept of 0-unitary from inverse semigroup theory (see [Lawson 1998]); the relationship will be explored in detail in a future paper.

Thus, suppose all three are not ∅. Then 0 ∉ U, V, or W. Then we have

(\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m} , ⟨W ∪ U⟩)
= \overline{(\overrightarrow{x}^{n} ↦ (h_{i}, h′_{i})_{i=1}^{m} , W)} (\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m} , U)
= \overline{(\overrightarrow{x}^{n} ↦ (h_{i}, h′_{i})_{i=1}^{m} , W)} (\overrightarrow{x}^{n} ↦ (g_{i}, g′_{i})_{i=1}^{m} , V) since \overline{h} f = h = \overline{h} g,
= (\overrightarrow{x}^{n} ↦ (g_{i}, g′_{i})_{i=1}^{m} , ⟨W ∪ V⟩) .

Now, since R is an integral domain, the product of two nonzero elements is nonzero. Thus, 0 ∉ ⟨W ∪ U⟩. Thus for each i, there is a W_{i} ≠ 0 ∈ ⟨W ∪ U⟩ such that W_{i}f_{i}g′_{i} = W_{i}f′_{i}g_{i}. Moreover, the fact that R is an integral domain also gives the cancellation property: if a ≠ 0, ac = ab implies c = b. Thus, we have that f_{i}g′_{i} = f′_{i}g_{i}, which proves

(\overrightarrow{x}^{n} ↦ (f_{i}, f′_{i})_{i=1}^{m} , U) ⌣ (\overrightarrow{x}^{n} ↦ (g_{i}, g′_{i})_{i=1}^{m} , V) .

Thus, when R is an integral domain, Rat_{R} is a 0-unitary restriction category.

It may seem natural to ask if Rat_{R} has finite joins, especially if R has unique factorization. If R is a unique factorization domain, it is easy to show that any two compatible maps in Rat_{R} will have the form

(\overrightarrow{x}^{n} ↦ (P_{i}, Q_{i})_{i=1}^{m} , U) ⌣ (\overrightarrow{x}^{n} ↦ (P_{i}, Q_{i})_{i=1}^{m} , V) ,

where gcd(P_{i}, Q_{i}) = 1. Thus Q_{i} ∈ U, V, so Q_{i} ∈ ⟨U ∩ V⟩. Thus from the order theoretic nature of joins, the only candidate for the join is (\overrightarrow{x}^{n} ↦ (P_{i}, Q_{i})_{i=1}^{m} , ⟨U ∩ V⟩). However, reducing the restriction sets of compatible maps by intersection does not define a join restriction structure on Rat_{R}, as stability under composition will not always hold. For a counterexample, consider the maps

(1, ⟨x − 1⟩) ⌣ (1, ⟨y − 1⟩) .

By the above discussion, (1, ⟨⟨x − 1⟩ ∩ ⟨y − 1⟩⟩) must be (1, ⟨1⟩). We will show that s(f ∨ g) ≠ sf ∨ sg. Consider the map ((x^{2}, x^{2}), {}). Then

((x^{2}, x^{2}), {}) (1, ⟨1⟩) = (1, ⟨1⟩) .

However,

((x^{2}, x^{2}), {}) (1, ⟨x − 1⟩) = (1, ⟨x + 1, x − 1⟩)

and

((x^{2}, x^{2}), {}) (1, ⟨y − 1⟩) = (1, ⟨x + 1, x − 1⟩) .

The “join” of the latter two maps is (1, ⟨x + 1, x − 1⟩) ≠ (1, ⟨1⟩). Thus, in general Rat_{R} does not have joins.

5. Join completion and differential structure

In the final two sections of the paper, our goal is to show that when one adds joins or relative complements of partial maps, differential structure is preserved. These are important results, as they show that one can add more logical operations to the maps of a differential restriction category, while retaining the differential structure.

5.1. The join completion. As we have just seen, a restriction category need not have joins, but there is a universal construction which freely adds joins to any restriction category. We show in this section that if the original restriction category has differential structure, then so does its join completion. By join completing Rat_{R}, we thus get a restriction category which has both joins and differential structure, but is very different from the differential restriction category of smooth functions defined on open subsets of ℝ^{n}.

The join completion we describe here was first given in this form in [Cockett and Manes 2009], but follows ideas of Grandis from [Grandis 1989].

5.2. Definition. Given a restriction category 𝕏, define Jn(𝕏) to have:

• objects: those of 𝕏;

• an arrow X [figure: A] Y is a subset A ⊆ 𝕏(X, Y) such that A is down-closed (under the restriction order), and elements are pairwise compatible;

• X [figure: 1_{X}] X is given by the down-closure of the identity, ↓1_{X};

• the composite of A and B is {fg : f ∈ A, g ∈ B};

• restriction of A is \{\overline{f} : f ∈ A\};

• the join of (A_{i})_{i∈I} is given by the union of the A_{i}.

From [Cockett and Manes 2009], we have the following result:

5.3. Theorem. Jn(𝕏) is a join-restriction category, and is the left adjoint to the forgetful functor from join restriction categories to restriction categories.

Note that this construction destroys any existing joins. This can be dealt with: for example, if one wishes to join complete a restriction category which already has empty maps (such as Rat_{R}) and one wants to preserve these empty maps, then one can modify the above construction by insisting that each down-closed set contain the empty map.

Because we will frequently be dealing with the down-closures of various sets, the following lemma will be extremely helpful.

5.4. Lemma. (Down-closure lemma) Suppose 𝕏 is a restriction category, and A, B ⊆ 𝕏(A, B). Then we have:

(i) ↓A ↓B =↓(AB);

(ii) \overline{↓A} =↓(\overline{A});

(iii) if 𝕏 is cartesian, ⟨↓A, ↓B⟩ =↓⟨A, B⟩;

(iv) if 𝕏 is left additive, ↓A+ ↓B =↓(A + B);

(v) if 𝕏 has differential structure, D[↓A] =↓D[A].

Proof.

(i) If h ∈↓(AB), then ∃f ∈ A, g ∈ B such that h ≤ fg. So \overline{h} fg = h, and \overline{h} f ∈↓A, b ∈↓ B, so h ∈↓ A ↓ B. Conversely, if mn ∈↓ A ↓ B, there exists f, g such that m ≤ f ∈ A, n ≤ g ∈ B. But composition preserves order, so mn ≤ fg, so mn ∈↓(AB).

(ii) Suppose h ∈ \overline{↓A}. So there exists f ∈ A such that h ≤ f. Since restriction preserves order, \overline{h} ≤ \overline{f} . But since h ∈ \overline{↓A}, h is idempotent, so we have h ≤ \overline{f} . So h ∈↓(\overline{A}). Conversely, suppose h ∈↓(\overline{A}), so h ≤ \overline{f} for some f ∈ A. Then we have h = \overline{h} \overline{f} = \overline{\overline{h} f} , so h is idempotent and h ≤ f, so h ∈ \overline{↓A}.

(iii) Suppose h ∈↓⟨A, B⟩, so h ≤ ⟨f, g⟩ for f ∈ A, g ∈ B. Then h = \overline{h} ⟨f, g⟩ = ⟨\overline{h} f, g⟩, and \overline{h} f ∈↓A, g ∈↓B, so h ∈ ⟨↓A, ↓B⟩. Conversely, suppose h ∈ ⟨↓A, ↓B⟩, so that h = ⟨m, n⟩ where m ≤ f ∈ A, n ≤ g ∈ B. Since pairing preserves order, h = ⟨m, n⟩ ≤ ⟨f, g⟩, so h ∈↓⟨A, B⟩.

(iv) Suppose h ∈↓A+ ↓B, so h = m + n, where m ≤ f ∈ A, n ≤ g ∈ B. Since addition preserves order, h = m+n ≤ f +g, so h ∈↓(A+B). Conversely, suppose h ∈↓(A+B). Then there exist f ∈ A, g ∈ B so that h ≤ f + g. Then h = \overline{h} (f + g) = \overline{h} f + \overline{h} g (by left additivity), so h ∈↓A+ ↓B.

(v) Suppose h ∈ D[↓ A]. Then there exists m ≤ f ∈ A so that h ≤ D[m]. But differentiation preserves order, so h ≤ D[m] ≤ D[f], so h ∈↓ D[A]. Conversely, suppose h ∈ D[A]. Then there exists f ∈ A so that h ≤ D[f], so h ∈ D[↓A].

5.5. Cartesian structure. We begin by showing that cartesianess is preserved by the join completion.

5.6. Theorem. If 𝕏 is a cartesian restriction category, then so is Jn(𝕏).

Proof. We define 1 and X × Y as for 𝕏, the projections to be ↓π_{0} and ↓π_{1}, the terminal maps to be ↓(!_{A}), and

⟨A, B⟩ := {⟨f, g⟩ : f ∈ A, g ∈ B}

This is compatible by Proposition 2.18, and down-closed since if h ≤ ⟨f, g⟩, then

h = \overline{h} ⟨f, g⟩ = ⟨\overline{h} f, g⟩

so since A is down-closed, this is also in ⟨A, B⟩.

The terminal maps do indeed satisfy the required property, as

\overline{A} ↓(!_{A}) = \overline{A}!_{A} = \{\overline{f} !_{A} : f ∈ A\} = \{f : f ∈ A\} = A,

as required.

To show that ⟨−, −⟩ satisfies the required property, consider

⟨A, B⟩ ↓π_{0} = \{⟨f, g⟩π_{0} : f ∈ A, g ∈ B\} = \{\overline{g} f : f ∈ A, g ∈ B\} = \overline{B} A

and similarly for ↓π_{1}.

We now need to show that ⟨−, −⟩ is universal with respect to this property. That is, suppose there exists a compatible down-closed set of arrows C with the property that C ↓π_{0} = \overline{B} A and C ↓π_{1} = \overline{A} B. We need to show that C = ⟨A, B⟩.

To show that C ⊆ ⟨A, B⟩, let c ∈ C. Since ↓(Cπ_{0}) = C ↓π_{0} = \overline{B} A, there exists f ∈ A, g ∈ B such that cπ_{0} = \overline{g} f. Then, since ↓(Cπ_{1}) = C ↓π_{1} = \overline{A} B, there exists a c′ such that c′π_{1} = \overline{f} g. Then

\overline{c′} cπ_{0} = \overline{c′} \overline{c} cπ_{0} = \overline{c′} \overline{c} \overline{g} f

and since c ⌣ c′,

\overline{c′} cπ_{1} = \overline{c′} \overline{c} c′π_{1} = \overline{c′} \overline{c} \overline{f} g

Thus, by the universality of \overline{c′} \overline{c} ⟨f, g⟩, \overline{c′} c = \overline{c′} \overline{c} ⟨f, g⟩. Thus

c ≤ \overline{c′} c = \overline{c′} \overline{c} ⟨f, g⟩ ≤ ⟨f, g⟩,

so since ⟨A, B⟩ is down-closed, c ∈ ⟨f, g⟩.

To show that ⟨A, B⟩ ⊆ C, let f ∈ A, g ∈ B. Then there exists c such that

cπ_{0} = \overline{g} f = ⟨f, g⟩π_{0}.

Thus, there exists f′ ∈ A, g′ ∈ B such that

cπ_{1} = \overline{f′} g′ = ⟨f′, g′⟩π_{1}.

Now, we have

\overline{⟨f′, g′⟩} ⟨f, g⟩π_{0} = \overline{⟨f′, g′⟩} \overline{⟨f, g⟩} ⟨f, g⟩π_{0} = \overline{⟨f′, g′⟩} \overline{⟨f, g⟩} cπ_{0}

and since f ⌣ f′ and g ⌣ g′, ⟨f, g⟩ ⌣ ⟨f′, g′⟩, so we also get

\overline{⟨f′, g′⟩} ⟨f, g⟩π_{1} = \overline{⟨f′, g′⟩} \overline{⟨f, g⟩} ⟨f′, g′⟩π_{1} = \overline{⟨f′, g′⟩} \overline{⟨f, g⟩} cπ_{1}.

Thus, by the universality of \overline{⟨f′, g′⟩} ⟨f, g⟩,

⟨f, g⟩ ≤ \overline{⟨f′, g′⟩} ⟨f, g⟩ = \overline{⟨f′, g′⟩} \overline{⟨f, g⟩} c ≤ c .

Since C is down-closed, this shows ⟨f, g⟩ ∈ C, as required.

5.7. Left additive structure. Next, we show that left additive structure is preserved.

5.8. Theorem. If 𝕏 is a left additive restriction category, then so is Jn(𝕏), where

0_{Jn(𝕏)} :=↓0 and A + B := {f + g : f ∈ A, g ∈ B}

.

Proof. By Proposition 3.3, A+B is a compatible set. For down-closed, suppose h ≤ f+g. Then h = \overline{h} (f + g) = \overline{h} f + \overline{h} g. Since A and B are down-closed, \overline{h} f ∈ A, \overline{h} g ∈ B, so h ∈ A + B.

That this gives a commutative monoid structure on each hom-set follows directly from Lemma 5.4, as does \overline{0} =↓1. Finally,

\overline{A + B} = \overline{\{f + g : f ∈ A, g ∈ B\}} = \{\overline{f + g} : f ∈ A, g ∈ B\} = \{\overline{f} \overline{g} : f ∈ A, g ∈ B\} = \overline{A} \overline{B} .

so that Jn(𝕏) is a left additive restriction category.

5.9. Theorem. If 𝕏 is a cartesian left additive restriction category, then so is Jn(𝕏).

Proof. Immediate from Theorem 3.14.

5.10. Differential structure. Finally, we show that differential structure is preserved. There is one small subtlety, however. To define the pairing or addition of maps in Jn(𝕏), we merely needed to add or pair pointwise, as the resulting set was automatically down-closed and pairwise compatible if the original was. However, note that A being down-closed does not imply {D[f] : f ∈ A} down-closed. Axiom [DR.9] requires that differentials be total in the first component. However, this is not always true of an arbitrary h ≤ D[f]. Thus, to define the differential in the join completion, we make take the down-closure of {D[f] : f ∈ A}.

5.11. Theorem. If 𝕏 is a differential restriction category, then so is Jn(𝕏), where

D[A] :=↓{D[f] : f ∈ A}

Proof. Checking the differential axioms is a straightforward application of our downclosure lemma. For example, for [DR.1], by the down-closure lemmas,

D[0_{Jn(𝕏)}] = D[↓0] =↓D[0] =↓0 = 0_{Jn(𝕏)}

and

D[A + B] =↓{D[f + g] : f ∈ A, g ∈ B} =↓{D[f] + D[g] : f ∈ A, g ∈ B} = D[A] + D[B] .

Similarly, to check [DR.5]:

D[AB] =↓{D[fg] : f ∈ A, g ∈ B} =↓{⟨D[f], π_{1}f⟩D[g] : f ∈ A, g ∈ B} = ⟨D[A], ↓π_{1}A⟩DB

where the last equality follows from several applications of the down-closure lemmas. All other axioms similarly follow.

Finally, it is easy to see the following:

5.12. Proposition. The unit 𝕏 [figure] Jn(𝕏), which sends f to ↓f, is a differential restriction functor.

Proof. The result immediately follows, given the additive, cartesian, and differential structure of Jn(𝕏).

Thus, by Proposition 3.29, we have

5.13. Corollary. If 𝕏 is a differential restriction category, and f is additive/strongly additive/linear, then so is ↓f in Jn(𝕏).

6. Classical completion and differential structure

In our final section, we show that differential structure is preserved when we add relative complements to a join restriction category. This process will greatly expand the possible domains of definition for differentiable maps, even in the standard example. The standard example (smooth maps on open subsets) does not have relative complements. By adding them in, we add smooth maps between any set which is the complement of an open subset inside some other open subset. Of course, this includes closed sets, and so by applying this construction, we have a category of smooth maps defined on all open, closed and half open-half-closed sets. This includes smooth functions defined on points; as we shall see below, this captures the notion of the germ of a smooth function.

6.1. The classical completion. The notion of classical restriction category was defined in [Cockett and Manes 2009] as an intermediary between arbitrary restriction categories and the Boolean restriction categories of [Manes 2006].

6.2. Definition. A restriction category 𝕏 with restriction zeroes is a classical restriction category if

1. the homsets are locally Boolean posets (under the restriction order), and for any

W [figure: f] X, Y [figure: g] Z,

𝕏(X, Y) [figure: f∘(−)∘g] 𝕏(W, Z)

is a locally Boolean morphism;

2. for any disjoint maps f, g (that is, \overline{f} \overline{g} = ∅), f ∨ g exists.

6.3. Example. Sets and partial functions form a classical restriction category.

For our purposes, the following alternate characterization of the definition, which describes classical restriction categories as join restriction categories with relative complements, is more useful.

6.4. Definition. If f′ ≤ f, the relative complement of f′ in f, denoted f \ f′, is the unique map such that

• f \ f′ ≤ f;

• g ∧ (f \ f′) = ∅;

• f ≤ g ∨ (f \ f′).

The following can be found in [Cockett and Manes 2009]:

6.5. Proposition. A classical restriction category is a join restriction category with relative complements f \ f′ for any f′ ≤ f.

Just as one can freely add joins to an arbitrary restriction category, so too can one freely add relative complements to a join restriction category. We will first describe this completion process, then show that cartesian, additive, and differential structure is preserved when classically completing. This is of great interest, as classically completing adds in a number of new maps, even to the standard examples.

6.6. Definition. Let 𝕏 be a join restriction category. A classical piece of 𝕏 is a pair of maps (f, f′) : A [figure] B such that f′ ≤ f.

One thinks of a classical piece as a formal relative complement.

6.7. Definition. Two classical pieces (f, f′), (g, g′) are disjoint, written (f, f′) ⊥ (g, g′), if \overline{f} \overline{g} = \overline{f′} \overline{g} ∨ \overline{f} \overline{g′}. A raw classical piece consists of a finite set of classical pieces, (f_{i}, f′_{i}) that are pairwise disjoint, and is written

⨆_{i∈I}(f_{i}, f′_{i}) : A [figure] B.

One defines an equivalence relation on the set of raw classical maps by:

• Breaking: (f, f′) ≡ (ef, ef′) ⊔ (f, f′ ∨ fe) for any restriction idempotent e = \overline{e},

• Collapse: (f, f) ≡ ∅.

The first part of the equivalence relation says that if we have some other domain e, then we can split the formal complement (f, f′) into two parts: the first part, (ef, ef′), inside e, and the second, (f, f′ ∨ fe), outside e. The second part of the equivalence is obvious: if you formally take away all of f from f, the result should be nowhere defined.

6.8. Definition. A classical map is an equivalence class of raw classical maps.

6.9. Proposition. Given a join restriction category 𝕏, there is a classical restriction category Cl(𝕏) with

• objects those of 𝕏,

• arrows classical maps,

• composition by

⨆_{i∈I}(f_{i}, f′_{i}) ⨆_{j∈J}(g_{j}, g′_{j}) := ⨆_{i,j}(f_{i}g_{j}, f′_{i}g_{j} ∨ f_{i}g′_{j}),

• restriction by

\overline{⨆_{i∈I}(f_{i}, f′_{i})} := ⨆_{i∈I}(\overline{f_{i}} , \overline{f′_{i}}),

• disjoint join is simply ⊔ of classical pieces,

• relative complement is

(f, f′) \ (g, g′) := (f, f′ ∨ \overline{g} f) ⊔ (\overline{g′} f, \overline{g′} f′).

In [Cockett and Manes 2009], this process is shown to give a left adjoint to the forgetful functor from classical restriction categories to join restriction categories.

We make one final point about the definition. We defined (f, f′) ⊥ (f_{0}, f′_{0}) if \overline{f} \overline{f_{0}} = \overline{f′} \overline{f_{0}} ∨ \overline{f} \overline{f′_{0}} . Note, however, that it suffices that we have ≤, since

\overline{f′} \overline{f_{0}} ∨ \overline{f} \overline{f′_{0}} ≤ \overline{f} \overline{f_{0}} ∨ \overline{f} \overline{f_{0}} = \overline{f} \overline{f_{0}}

We will often use this alternate form of ⊥ when checking whether maps we give are well-defined.

6.10. Cartesian structure. Our goal is to show that if 𝕏 has differential restriction structure, then so does Cl(𝕏). We begin by showing that cartesian structure is preserved, and for this we begin by define the pairing of two classical maps.

6.11. Lemma. Given a join restriction category 𝕏 and maps ⨆(f_{i}, f′_{i}) from Z to X and ⨆(g_{j}, g′_{j}) from Z to Y in Cl(𝕏), the following:

⟨⨆_{i}(f_{i}, f′_{i}), ⨆_{j}(g_{j}, g′_{j})⟩ := ⨆_{i,j} (⟨f_{i}, g_{j}⟩, ⟨f′_{i}, g_{j}⟩ ∨ ⟨f_{i}, g′_{j}⟩)

is a well-defined map from Z to X × Y in Cl(𝕏).

Proof. First, we need to check

(⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′⟩)

defines a classical piece. Indeed, since f′ ⌣ f and g ⌣ g′, the two maps being joined are compatible, so we can take the join. Also, since f′ ≤ f and g′ ≤ g, the right component is less than or equal to the left component.

Now, we need to check that

⨆_{i,j} (⟨f_{i}, g_{j}⟩, ⟨f′_{i}, g_{j}⟩ ∨ ⟨f_{i}, g′_{j}⟩)

defines a raw classical map. That is, we need to check that the pieces are disjoint. That is, we need to show that if

(f, f′) ⊥ (f_{0}, f′_{0}) and (g, g′) ⊥ (g_{0}, g′_{0})

then

(⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′⟩) ⊥ (⟨f_{0}, g_{0}⟩, ⟨f′_{0}, g′_{0}⟩ ∨ ⟨f_{0}, g′_{0}⟩).

Consider:

\overline{⟨f, g⟩} \overline{⟨f_{0}, g_{0}⟩}
= \overline{f} \overline{f_{0}} \overline{g} \overline{g_{0}}
= (\overline{f′} \overline{f_{0}} ∨ \overline{f} \overline{f′_{0}} )(\overline{g′} \overline{g_{0}} ∨ \overline{g} \overline{g′_{0}} )
= \overline{f′} \overline{f_{0}} \overline{g′} \overline{g_{0}} ∨ \overline{f} \overline{f′_{0}} \overline{g′} \overline{g_{0}} ∨ \overline{f′} \overline{f_{0}} \overline{g} \overline{g′_{0}} ∨ \overline{f} \overline{f′_{0}} \overline{g} \overline{g′_{0}}
≤ \overline{f} \overline{g′} \overline{f_{0}} \overline{g_{0}} ∨ \overline{f} \overline{g} \overline{f_{0}} \overline{g_{0}} ∨ \overline{f′} \overline{g} \overline{f_{0}} \overline{g_{0}} ∨ \overline{f} \overline{g} \overline{f_{0}} \overline{g′_{0}}
= (\overline{f′} \overline{g} ∨ \overline{f} \overline{g′})(\overline{f_{0}} \overline{g_{0}} ) ∨ (\overline{f} \overline{g})(\overline{f′_{0}} \overline{g_{0}} ∨ \overline{f_{0}} \overline{g′_{0}} )
= \overline{⟨f′, g⟩ ∨ ⟨f, g′⟩} \overline{⟨f_{0}, g_{0}⟩} ∨ \overline{⟨f, g⟩} \overline{⟨f′_{0}, g_{0}⟩ ∨ ⟨f_{0}, g′_{0}⟩}

so that

(⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′⟩) ⊥ (⟨f_{0}, g_{0}⟩, ⟨f′_{0}, g′_{0}⟩ ∨ ⟨f_{0}, g′_{0}⟩),

as required.

Finally, we need to check that this is a well-defined classical map. Thus, we need to check it is well-defined with respect to collapse and breaking. For collapse, consider

⟨(f, f′), (g, g)⟩ = (⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g⟩) = (⟨f, g⟩, ⟨f, g⟩) ≡ ∅

as required.

For breaking, suppose we have

(g, g′) ≡ (g, g′ ∨ eg) ⊥ (eg, eg′)

Then

⟨(f, f′), (g, g′ ∨ eg) ⊥ (eg, eg′)⟩
= (⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′ ∨ eg⟩) ⊥ (⟨f, eg⟩, ⟨f′, eg⟩ ∨ ⟨f, eg′⟩)
= (⟨f, g⟩, ⟨f′, g⟩ ∨ e⟨f, g′ ∨ eg⟩) ⊥ (e⟨f, g⟩, e(⟨f′, g⟩ ∨ ⟨f, g′⟩)
≡ (⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′⟩)
= ⟨(f, f′), (g, g′)⟩

as required. Thus, the above is a well-defined classical map.

We now give some lemmas about our definition. Note that once we show that this pairing does define cartesian structure on Cl(𝕏) , these lemmas follow automatically, as they are true in any cartesian restriction category (see Lemma 2.18) However, we will need these lemmas to establish that this does define cartesian structure on Cl(𝕏).

6.12. Lemma. Suppose we have maps f : Z [figure] X, g : Z [figure] Y, and e = \overline{e} : Z [figure] Z in Cl(𝕏). Then e⟨f, g⟩ = ⟨ef, g⟩ = ⟨f, eg⟩.

Proof. It suffices to show the result for classical pieces. Thus, consider

⟨(e, e′)(f, f′), (g, g′)⟩
= ⟨(ef, e′f ∨ ef′), (g, g′)⟩
= (⟨ef, g⟩, ⟨e′f ∨ ef′, g⟩ ∨ ⟨ef, g′⟩)
= (e⟨f, g⟩, e′⟨f, g⟩ ∨ e⟨f′, g⟩ ∨ e⟨f, g′⟩
= (e, e′)(⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′⟩
= (e, e′)⟨(f, f′), (g, g′)⟩

as required. Putting the e in the right component is similar.

6.13. Lemma. For any c in Cl(𝕏), ⟨cπ_{0}, cπ_{1}⟩ = c.

Proof. It suffices to show the result for classical pieces. Thus, consider

⟨(c, c′)(π_{0}, ∅), (c, c′)(π_{1}, ∅)⟩
= ⟨(cπ_{0}, c′π_{0}), (cπ_{1}, c′π_{1})⟩
= (⟨cπ_{0}, cπ_{1}⟩, ⟨c′π_{0}, cπ_{1}⟩ ∨ ⟨cπ_{0}, c′π_{1}⟩)
= (c, \overline{c′} ⟨cπ_{0}, cπ_{1}⟩ ∨ \overline{c′} ⟨cπ_{0}, cπ_{1}⟩)
= (c, \overline{c′} c ∨ \overline{c′} c)
= (c, c′)

as required.

It will be most helpful if we can give an alternate characterization of when two classical maps are equivalent. To that, we prove the following result:

6.14. Theorem. In Cl(𝕏), (f, f′) ≡ (g, g′) if and only if there exist restriction idempotents e_{1}, …, e_{n} such that for any I ⊆ {1, …, n}, if we define

e_{I} := (◯_{i∈I}e_{i}, (◯_{i∈I}e_{i}) (⋁_{j∉I} e_{j}))

(where ◯ denotes iterated composition) then for each such I,

e_{I}(f, f′) = e_{I}(g, g′)

or they both collapse to the empty map.

Proof. As discussed in [Cockett and Manes 2009], breaking and collapse form a system of rewrites, so that if two maps are equivalent, they can be broken into a series of pieces, each of which are either equal or both collapse to the empty map. Thus, it suffices to show that the above is what occurs after doing n different breakings along the idempotents e_{1}, …, e_{n}. To this end, note that the two pieces left after breaking (f, f′) by e are given by precomposing with (e, ∅) and (1, e); indeed:

(e, ∅)(f, f′) = (ef, ef′) and (1, e)(f, f′) = (f, ef ∨ f′)

Thus, if n = 1, the result holds. Now assume by induction that the result holds for k. Then for any subset I ⊆ {1, … n}, breaking e_{I} by (e_{k+1}) gives the pieces

(e_{n+1}, ∅)(∘e_{i}, (∘e_{i})(∨e_{j}) = (e_{n+1} ∘ e_{i}, (e_{n+1} ∘ e_{i})(∨e_{j}))

and

(1, e_{n+1})(∘e_{i}, (∘e_{i})(∨e_{j}) = (∘e_{i}, (∘e_{i})(e_{n+1}) ∨ (∘e_{i})(∨e_{j})) = (∘e_{i}, (∘e_{i})(e_{n+1} ∨ e_{j}))

Thus, we get all possible idempotents e_{I′}, where I′ ⊆ {1, …, n + 1}, as required.

6.15. Theorem. If 𝕏 is a cartesian restriction category, then so is Cl(𝕏).

Proof. Define the terminal object T as for 𝕏, and the unique maps by !_{A} := (!_{A}, ∅). Then for any classical map ⨆(f_{i}, f′_{i}), we have

⨆(f_{i}, f′_{i}) = ⨆(!_{A}\overline{f_{i}} ,!_{A}\overline{f′_{i}}) = (⨆(\overline{f_{i}} , \overline{f′_{i}})) (!_{A}, ∅)

as required. So Cl(𝕏) has a partial final object.

We define the product objects A × B as for 𝕏, the projections by (π_{0}, ∅) and (π_{1}, ∅), and the product map as above. To show that our putative product composes well with the projections, consider

⟨(f, f′), (g, g′)⟩(π_{0}, ∅)
= (⟨f, g⟩, ⟨f′, g⟩ ∨ ⟨f, g′⟩)(π_{0}, ∅)
= (⟨f, g⟩π_{0}, ⟨f′, g⟩π_{0} ∨ ⟨f, g′⟩π_{0})
= (\overline{g} f, \overline{g} f′ ∨ \overline{g′} \overline{f} )
= (\overline{g} , \overline{g′})(f, f′)
= \overline{(g, g′)} (f, f′)

as required. Composing with π_{1} is similar.

Finally, we need to show that the universal property holds. It suffices to show that if cπ_{0} ≤ f and cπ_{1} ≤ g, then c ≤ ⟨f, g⟩. Suppose we have the first two inequalities, so that

\overline{c} f ≡ cπ_{0} by breaking with idempotents (e_{1}, …, e_{n})

and

\overline{c} g ≡ cπ_{1} by breaking with idempotents (d_{1}, …, d_{m}).

We claim that \overline{c} ⟨f, g⟩ ≡ c by breaking with idempotents (e_{1}, … e_{n}, d_{1}, …, d_{m}). By the previous theorem, it suffices to show they are equal (or both collapse to the empty map) when composing with an element of the form in the theorem for an arbitrary subset K ⊆ {1, … n, n + 1, … n + m}. However, if I = K ∩ {1, …, n} and J = K ∩ {n + 1, … n + m}, then such an element can be written as

(e_{I}, e_{I}e_{I′})(d_{J}, d_{J}d_{J′})

since that equals

(e_{I}d_{J}, (e_{I}d_{J})(e_{I′} ∨ d_{J′}))

which is e_{K}. Thus, writing e for (e_{I}, e_{I}e_{I′}) and d for (d_{J}, d_{J}d_{J′}), it suffices to show that ed\overline{c} ⟨f, g⟩ = edc (or they both collapse to the empty map). However, we know that

e\overline{c} f = ecπ_{0} and d\overline{c} g = dcπ_{1}

(or one or the other collapses to the empty map). Pairing the above equalities, we get

⟨e\overline{c} f, d\overline{c} g⟩ = ⟨ecπ_{0}, dcπ_{1}⟩

which, by lemma 2.18, reduces to

(ed)\overline{c} ⟨f, g⟩ = edc

as required. If either equality has both sides collapsing to the empty map, then both sides of the above collapse to the empty map, since we showed earlier that pairing is welldefined when applied to collapsed maps. Thus, we have the required universal property, and Cl(𝕏) is cartesian.

6.16. Left additive structure. Next, we show that left additive structure is preserved. We begin by defining the sum of two maps.

6.17. Lemma. Suppose that 𝕏 is a left additive restriction category with joins. Given maps ⨆(f_{i}, f′_{i}) and ⨆(g_{j}, g′_{j}) from X to Y in Cl(𝕏), the following:

⨆_{i,j}(f_{i} + g_{j}, (f′_{i} + g_{j}) ∨ (f_{i} + g′_{j}))

is a well defined map from X to Y in Cl(𝕏).

Proof. The proof is nearly identical to that for showing that the pairing definition gives a well-defined classical map.

6.18. Theorem. If 𝕏 has the structure of a left additive restriction category, then so does Cl(𝕏), where addition of maps is defined as above, and the zero map is given by (0, ∅).

Proof. It is easily checked that the addition and zero give each homiest the structure of a commutative monoid. For the restriction axioms,

\overline{(f, f′) + (g, g′)}
= \overline{(f + g, (f′ + g) ∨ (f + g′))}
= (\overline{f + g} , \overline{f′ + g} ∨ \overline{f + g′})
= (\overline{f} \overline{g} , \overline{f′} \overline{g} ∨ \overline{f} \overline{g′})
= (\overline{f} , \overline{f′})(\overline{g} , \overline{g′})
= \overline{(f, f′)} \overline{(g, g′)}

and clearly (0, ∅) is total. For the left additivity, consider

(f, f′)(g, g′) + (f, f′)(h, h′)
= (fg, f′g ∨ fg′) + (fh, f′h ∨ fh′)
= (fg + fh, ((f′g ∨ fg′) + fh) ∨ (fg + (f′h ∨ fh′)))
= (fg + fh, (f′g + fh) ∨ (fg′ + fh) ∨ (fg + f′h) ∨ (fg + fh′))
= (fg + fh, \overline{f′} (fg + fh) ∨ \overline{f′} (fg + fh) ∨ (fg′ + fh) ∨ (fg + fh′)) since f′ ≤ f
= (f(g + h), \overline{f′} f(g + h) ∨ f(g′ + h) ∨ f(g + h′))
= (f(g + h), f′(g + h) ∨ f(g′ + h) ∨ f(g + h′))
= (f, f′)(g + h, (g′ + h) ∨ (g + h′))
= (f, f′)((g, g′) + (h, h′))

as required. Thus Cl(𝕏) is a left additive restriction category.

6.19. Theorem. If 𝕏 has the structure of a cartesian left additive restriction category, then so does Cl(𝕏).

Proof. Immediate from Theorem 3.14.

6.20. Differential structure. Finally, we show that if 𝕏 has differential restriction structure, so does Cl(𝕏). We first need to define the differential of a map.

6.21. Lemma. If 𝕏 is a differential join restriction category, and ⨆(f_{i}, f′_{i}) is a map from X to Y in Cl(𝕏), then the following:

⨆(D[f_{i}], D[f′_{i}])

is a well-defined map in Cl(𝕏) from X × X to Y.

Proof. If f′ ≤ f, then D[f′] ≤ D[f], so it is a well-defined classical piece. If (f, f′) ⊥ (g, g′), then

\overline{Df} \overline{Dg}
= (1 × \overline{f} )(1 × \overline{g})
= 1 × \overline{f} \overline{g}
= 1 × (\overline{f′} \overline{g} ∨ \overline{f} \overline{g′}) since (f, f′) ⊥ (g, g′)
= (1 × \overline{f′} \overline{g}) ∨ (1 × \overline{f} \overline{g′})
= (1 × \overline{f′})(1 × \overline{g}) ∨ (1 × \overline{f} )(1 × \overline{g′})
= \overline{Df′} \overline{Dg} ∨ \overline{Df} \overline{Dg′}

so (Df, Df′) ⊥ (Dg, Dg′), so it is a well-defined raw classical map.

That this is well-defined under collapsing is obvious. For breaking, suppose we have

(f, f′) ≡ (f, f′ ∨ ef) ⊥ (ef, ef′)

for some restriction idempotent e = \overline{e}. Then consider

D[(f, f′ ∨ ef) ⊥ (ef, ef′)]
= (Df, Df′ ∨ D(ef)) ⊥ (D(ef), D(ef′))
= (Df, Df′ ∨ (1 × e)Df) ⊥ ((1 × e)Df, (1 × e)Df′)) by lemma 3.20
≡ (Df, Df′) by breaking along the restriction idempotent (1 × e).

Thus the map is well-defined under collapsing and breaking, so is a well-defined classical map.

6.22. Theorem. If 𝕏 is a differential join restriction category, then so is Cl(𝕏), with the differential of ⨆(f_{i}, f′_{i}) given above.

Proof. Most axioms involve a straightforward calculation and use of the lemmas we have developed. We shall demonstrate the two most involved calculations: [DR.2] and [DR.5]. For [DR.2], consider

⟨(g, g′), (k, k′)⟩D(f, f′) + ⟨(h, h′), (k, k′)⟩D(f, f′)
= (⟨g, k⟩, ⟨g′, k⟩ ∨ ⟨g, k′⟩)(Df, Df′) + (⟨h, k⟩, ⟨h′, k⟩ ∨ ⟨h, k′⟩)(Df, Df′)
= (⟨g, k⟩Df, ⟨g′, k⟩Df ∨ ⟨g, k′⟩Df ∨ ⟨g, k⟩Df) + (⟨h, k⟩Df, ⟨h′, k⟩Df ∨ ⟨h, k′⟩Df
∨⟨h, k⟩Df′)
= (⟨g, k⟩Df + ⟨h, k⟩Df, [⟨g′, k⟩Df + ⟨h, k⟩Df] ∨ [⟨g, k′⟩Df + ⟨h, k⟩Df] ∨ [⟨g, k⟩Df′ +

⟨h, k⟩Df] ∨ [⟨g, k⟩Df + ⟨h′, k⟩Df] ∨ [⟨g, k⟩Df + ⟨h, k′⟩Df] ∨ [⟨g, k⟩Df + ⟨h, k⟩Df′])

We can simplify a term like ⟨g, k′⟩Df as follows:

⟨g, k′⟩Df = ⟨g, \overline{k′} k⟩Df = \overline{k′} ⟨g, k⟩Df

And for a term like ⟨g, k⟩Df′, we can simplify it as follows:

⟨g, k⟩Df′ = ⟨g, k⟩D(\overline{f′} f) = ⟨g, k⟩(1×\overline{f′})Df = ⟨g, k\overline{f′} ⟩Df = ⟨g, \overline{kf′} k⟩Df = \overline{kf′} ⟨g, k⟩Df

Thus, continuing the calculation above, we get

= (⟨g, k⟩Df + ⟨h, k⟩Df, [⟨g′, k⟩Df + ⟨h, k⟩Df] ∨ \overline{k′} [⟨g, k⟩Df + ⟨h, k⟩Df]
∨\overline{kf′} [⟨g, k⟩Df + ⟨h, k⟩Df] ∨ [⟨g, k⟩Df + ⟨h′, k⟩Df] ∨ \overline{k′} [⟨g, k⟩Df + ⟨h, k′⟩Df]
∨\overline{kf′} [⟨g, k⟩Df + ⟨h, k⟩Df′])
= (⟨g, k⟩Df + ⟨h, k⟩Df, [⟨g′, k⟩Df + ⟨h, k⟩Df] ∨ [⟨g, k⟩Df + ⟨h′, k⟩Df]
∨\overline{k′} [⟨g, k⟩Df + ⟨h, k⟩Df] ∨ \overline{kf′} [⟨g, k⟩Df + ⟨h, k⟩Df])
= (⟨g, k⟩Df + ⟨h, k⟩Df, [⟨g′, k⟩Df + ⟨h, k⟩Df] ∨ [⟨g, k⟩Df + ⟨h′, k⟩Df] ∨ [⟨g, k′⟩Df
+⟨h, k′⟩Df] ∨ [⟨g, k⟩Df′ + ⟨h, k⟩Df′]) using the above calculations in reverse
= (⟨g + h, k⟩Df, ⟨g′ + h, k⟩Df ∨ ⟨g + h′, k⟩Df ∨ ⟨g + h, k′⟩Df
∨⟨g + h, k⟩Df′) by [DR.2] for 𝕏
= (⟨g + h, k⟩, ⟨g′ + h, k⟩ ∨ ⟨g + h′, k⟩ ∨ ⟨g + h, k′⟩)(Df, Df′)
= ⟨(g + h, (g′ + h) ∨ (g + h′)), (k, k′)⟩(Df, Df′)
= ⟨(g, g′) + (h, h′), (k, k′)⟩D(f, f′)

as required. For [DR.5], consider

⟨D(f, f′), (π_{1}, ∅)(f, f′)⟩D(g, g′)
= ⟨(Df, Df′), (π_{1}f, π_{1}f′)⟩(Dg, Dg′)
= (⟨Df, π_{1}f⟩, ⟨Df′, π_{1}⟩ ∨ ⟨Df, π_{1}f′⟩)(Dg, Dg′)
= (⟨Df, π_{1}f⟩Dg, ⟨Df′, π_{1}f⟩Dg ∨ ⟨Df, π_{1}f′⟩Dg ∨ ⟨Df, π_{1}f⟩Dg′)

Now, we can simplify

⟨Df′, π_{1}f⟩ = ⟨D(\overline{f′} f), π_{1}f⟩ = ⟨(1 × \overline{f′})Df, π_{1}f⟩ = (1 × \overline{f′})⟨Df, π_{1}f⟩

(where the second equality is by Lemma 3.20), and

⟨Df, π_{1}f′⟩ = ⟨Df, π_{1}\overline{f′} f⟩ = ⟨Df, (1 × \overline{f′})π_{1}f⟩ = (1 × \overline{f′})⟨Df, π_{1}f⟩

where the second equality is by lemma 2.18. Thus, the above becomes

= (⟨Df, π_{1}f⟩Dg, (1 × \overline{f′})⟨Df, π_{1}f⟩Dg ∨ ⟨Df, π_{1}f⟩Dg′)
= (D(fg), (1 × \overline{f′} D(fg) ∨ D(fg′)) by [DR.5] for 𝕏
= (D(fg), D(f′g) ∨ D(fg′)) by Lemma 3.20
= D(fg, f′g ∨ fg′)
= D((f, f′)(g, g′))

as required.

Now that we know that the classical completion of a differential restriction category is again a differential restriction category, it will be interesting to see what type of maps are in the classical completion of the standard model. For example, consider two functions: f(x) = 2x defined everywhere but x = 5, and g(x) = 2x defined everywhere. Taking the relative complement of these maps gives a map defined only at x = 5, and has the value 2x = 10 there. But if differential structure is retained, in what sense is this map “smooth”?

Of course, this map is really an equivalence class of maps. In particular, imagine we have a restriction idempotent e = \overline{e} (that is, an open subset), which includes 5. Then we have

(f, f′) ≡ (ef, ef′) ⊔ (f, f′ ∨ ef) = (ef, ef′) ⊔ (f, f) ≡ (ef, ef′)

So that this map is actually equivalent to any other map defined on an open subset which includes 5. This is precisely the definition of the germ of a function at 5. Thus, the classical completion process adds germs of functions at points.

Of course, it also allows us to take joins of germs and regular maps, so that for example we could take the join of the above map, and something like \frac{x−1}{x−5}, giving a total map which has “repaired” the discontinuity of the second map at 5. The fact that this restriction category is a differential restriction category is perhaps now much more surprising. Clearly, this will be an example that will need to be explored further.

Finally, given the additive, cartesian, and differential structure of Cl(𝕏), the following is immediate:

6.23. Proposition. The unit 𝕏 [figure] Cl(𝕏), which sends f to (f, ∅), is a differential restriction functor.

And as a result, we have the following:

6.24. Corollary. Suppose 𝕏 is a differential restriction category with joins, and f′ ≤ f. Then:

(i) if f is additive in 𝕏, then so are (f, ∅) and (f, f′) in Cl(𝕏);

(ii) if f is strongly additive in 𝕏, then so is (f, ∅) in Cl(𝕏);

(iii) if f is linear in 𝕏, then so are (f, ∅) and (f, f′) in Cl(𝕏).

Proof. By Proposition 3.29, (f, ∅) retains being additive/strongly additive/linear, and since (f, f′) is a relative complement, (f, f′) ≤ f, so is additive/linear if f is.

7. Conclusion

There are a number of different expansions of this work that are possible; here we mention the most immediate. A construction given in [Grandis 1989] allows one to build a new restriction category of manifolds out of any join restriction category. For example, applying this construction to continuous functions defined on open subsets of ℝ^{n} gives a category of real manifolds. An obvious expansion of the present theory is to understand what happens when we apply this construction to a differential restriction category with joins. Clearly, this will build categories of smooth maps between smooth manifolds. In general, however, one should not expect this to again be a differential restriction category, as the derivative of a smooth manifold map f : M [figure] N is not a map M × M [figure] N, but instead a map T M [figure] T N, where T is the tangent bundle functor. Thus, we must show that one can describe the tangent bundle of any object in the manifold completion of a differential restriction category. This leads one to consider using the tangent space as a basis for axiomatizing this sort of differential structure. This is the subject of a future paper, and will allow for closer comparisons between the theory presented here and synthetic differential geometry.

Acknowledgments

The authors are grateful to both the referee and the editor for their handling of an error concerning the fractional monad construction. In the first version of the paper we had rather stupidly failed to observe that the fraction construction was not distributive unless one insisted on the equation (a, a^{2}) = (1, a). The referee had therefore suggested we should add the equation. This resulted in the expanded section on the fractional monad and, the non-standard – but we felt interesting – presentation of the rational functions where we were forced to use weak rigs.

References

[Blute et. al. 2008] Blute, R., Cockett, J and Seely, R. (2008) Cartesian differential categories. Theory and Applications of Categories, 22, 622–672.

[Bucciarelli et. al. 2010] A. Bucciarelli, T. Ehrhard, and G. Manzonetto. (2010) Categorical models for simply typed resource calculi. To appear in 26th Conference on the Mathematical Foundations of Programming Semantics (MFPS2010).

[Carlström 2004] Carlström, J (2004) Wheels – on division by zero, Mathematical. Structures in Comp. Sci., Vol. 14, Issue 1, 143–184.

[Chen 1977] Chen, K. (1977) Iterated path integrals. Bulletin of the American Mathematical Society, 85 (5), 831–879.

[Cockett and Manes 2009] Cockett, J. and Manes, E. (2009) Boolean and classical restriction categories. Mathematical Structures in Computer Science, 19 (2), 357–416.

[Cockett and Lack 2002] Cockett, J. and Lack, S. (2002) Restriction categories I: categories of partial maps. Theoretical computer science, 270 (2), 223–259.

[Cockett and Lack 2007] Cockett, J. and Lack, S. (2007) Restriction categories III: colimits, partial limits, and extensivity. Mathematical Structures in Computer Science, 17, 775–817.

[Cockett and Guo 2006] Cockett, J. and Guo, X. (2006) Stable meet semilattice fibrations and free restriction categories. Theory and applications of categories, 16, 307–341.

[Cockett and Hofstra 2008] Cockett, J and Hofstra, P. (2008) Introduction to turing categories. Annals of pure and applied logic, 156 (2–3), 183–209.

[Cohn 2002] Cohn, P. (2002) Basic Algebra: Groups, Rings, and Fields. Springer, 352.

[Dubuc 1979] Dubuc, E. (1979) Sur la modèle de la geométrie différentielle synthétique. Cahiers de Topologie et Geométrie Différential Catégoriques, XX (3).

[Dummit and Foote 2004] Dummit, D. and Foote, R. (2004) Abstract Algebra. John Wiley and Sons Inc, 655-709.

[Eisenbud 2004] Eisenbud, E. Commutative Algebra with a View Toward Algebraic Geometry. Springer (Graduate Texts in Mathematics), 57–86, 404–410.

[Erhard and Regnier 2003] Ehrhard, T., and Regnier, L. (2003) The differential lambdacalculus. Theoretical Computer Science, 309 (1), 1–41.

[Frölicher 1982] Frölicher, A. (1982) Smooth structures. In Category Theory (Gummersbach, 1981), volume 962 of Lecture Notes in Mathematics, 69–81. Springer, Berlin.

612  J.R.B. COCKETT, G.S.H. CRUTTWELL, AND J. D. GALLAGHER

[Golan 1992] Golan, J. (1992) The Theory of Semirings with Applications in Mathematics

and Theoretical Computer Sciecne. Longman Scientific and Technical. [Grandis 1989] Grandis, M. (1989) Manifolds as Enriched Categories. Categorical Topol-

ogy (Prague 1988), 358–368. [Hartshorne 1997] Hartshorne, R . (1997) Algebraic Geometry. Springer (Graduate Texts

in Mathematics). [Hungerford 2000] Hungerford, T. (2000) Algebra. Springer (Graduate Texts in Mathe-

matics). [Lawson 1998] Lawson, M. (1998) Inverse Semigroups: The Theory of Partial Symme-

tries. World Scientific. [Lindstrum 1967] Lindstrum, A. (1967) Abstract Algebra. Holden-Day. [Manes 2006] Manes, E. (2006) Boolean restriction categories and taut monads. Theoret-

ical Computer Science, 360, 77–95. [Moerdijk and Reyes 1991] Moerdijk, I. and Reyes, G. (1991) Models for Smooth Infinites-

imal Analysis, Springer. [Kock 2006] Kock, A. (2006) Synthetic Differential Geometry, Cambridge University

Press (2nd ed.). Also available at http://home.imf.au.dk/kock/sdg99.pdf. [Robinson and Rosolini 1988] Robinson, E. and Roslini, G. (1988) Categories of partial

maps. Information and Computation, vol. 79, 94–130. [Sikorski 1972] Sikorski, R. (1972) Differential Modules. Colluquia Mathematica, 24, 45–

79. [Stacey 2011] Stacey, A. (2011) Comparative Smootheology. Theory and applications of

categories, 25, 64–117. [Stewart 2004] Stewart, I. (2004) Galois Theory. Chapman and Hall, 185–187. [Stewart 2003] Stewart, J. (2003) Calculus. Thompson, 1077–1085. [Zariski and Samuel 1975] Zariski, O. and Pierre Samuel. (1975) Commutative Algebra.

Springer (Graduate Texts in Mathematics), 42–49.

Department of Computer Science, University of Calgary, Alberta, Canada

Email: robin@ucalgary.ca
      geoff.cruttwell@gmail.com
      jdgallag@ucalgary.ca

This article may be accessed at http://www.tac.mta.ca/tac/ or by anonymous ftp at

ftp://ftp.tac.mta.ca/pub/tac/html/volumes/25/21/25-21.{dvi,ps,pdf}

THEORY AND APPLICATIONS OF CATEGORIES (ISSN 1201-561X) will disseminate articles that significantly advance the study of categorical algebra or methods, or that make significant new contributions to mathematical science using categorical methods. The scope of the journal includes: all areas of pure category theory, including higher dimensional categories; applications of category theory to algebra, geometry and topology and other areas of mathematics; applications of category theory to computer science, physics and other mathematical sciences; contributions to scientific knowledge that make use of categorical methods. Articles appearing in the journal have been carefully and critically refereed under the responsibility of members of the Editorial Board. Only papers judged to be both significant and excellent are accepted for publication. Full text of the journal is freely available in .dvi, Postscript and PDF from the journal’s server at http://www.tac.mta.ca/tac/ and by ftp. It is archived electronically and in printed paper format.

Subscription information Individual subscribers receive abstracts of articles by e-mail as they are published. To subscribe, send e-mail to tac@mta.ca including a full name and postal address. For institutional subscription, send enquiries to the Managing Editor, Robert Rosebrugh, rrosebrugh@mta.ca.

Information for authors The typesetting language of the journal is TEX, and L^{A}TEX2e strongly encouraged. Articles should be submitted by e-mail directly to a Transmitting Editor. Please obtain detailed information on submission format and style files at http://www.tac.mta.ca/tac/.

Managing editor Robert Rosebrugh, Mount Allison University: rrosebrugh@mta.ca

TEXnical editor Michael Barr, McGill University: barr@math.mcgill.ca

Assistant TEX editor Gavin Seal, Ecole Polytechnique Fédérale de Lausanne:

gavin seal@fastmail.fm

Transmitting editors

Clemens Berger, Université de Nice-Sophia Antipolis, cberger@math.unice.fr Richard Blute, Université d’ Ottawa: rblute@uottawa.ca Lawrence Breen, Université de Paris 13: breen@math.univ-paris13.fr Ronald Brown, University of North Wales: ronnie.profbrown(at)btinternet.com

Valeria de Paiva: valeria.depaiva@gmail.com

Ezra Getzler, Northwestern University: getzler(at)northwestern(dot)edu Kathryn Hess, Ecole Polytechnique Fédérale de Lausanne : kathryn.hess@epfl.ch Martin Hyland, University of Cambridge: M.Hyland@dpmms.cam.ac.uk P. T. Johnstone, University of Cambridge: ptj@dpmms.cam.ac.uk Anders Kock, University of Aarhus: kock@imf.au.dk Stephen Lack, Macquarie University: steve.lack@mq.edu.au F. William Lawvere, State University of New York at Buffalo: wlawvere@buffalo.edu Tom Leinster, University of Glasgow, Tom.Leinster@glasgow.ac.uk Jean-Louis Loday, Université de Strasbourg: loday@math.u-strasbg.fr Ieke Moerdijk, University of Utrecht: moerdijk@math.uu.nl Susan Niefield, Union College: niefiels@union.edu Robert Paré, Dalhousie University: pare@mathstat.dal.ca Jiri Rosicky, Masaryk University: rosicky@math.muni.cz Giuseppe Rosolini, Università di Genova: rosolini@disi.unige.it Alex Simpson, University of Edinburgh: Alex.Simpson@ed.ac.uk James Stasheff, University of North Carolina: jds@math.upenn.edu Ross Street, Macquarie University: street@math.mq.edu.au Walter Tholen, York University: tholen@mathstat.yorku.ca Myles Tierney, Rutgers University: tierney@math.rutgers.edu Robert F. C. Walters, University of Insubria: robert.walters@uninsubria.it R. J. Wood, Dalhousie University: rjwood@mathstat.dal.ca