{'fraction_non_alphanumeric': 0.047513526740803176, 'fraction_numerical': 0.00679735718752549, 'mean_word_length': 4.086012583834613, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 16, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Nuclear and Trace Ideals in Tensored *-Categories

We generalize the notion of nuclear maps from functional analysis by defining nuclear ideals in tensored *-categories. The motivation for this study came from attempts to generalize the structure of the category of relations to handle what might be called ``probabilistic relations''. The compact closed structure associated with the category of relations does not generalize directly, instead one obtains nuclear ideals. We introduce the notion of nuclear ideal to analyze these classes of morphisms. In compact closed categories, we see that all morphisms are nuclear, and in the category of Hilbert spaces, the nuclear morphisms are the Hilbert-Schmidt maps. We also introduce two new examples of tensored *-categories, in which integration plays the role of composition. In the first, morphisms are a special class of distributions, which we call tame distributions. We also introduce a category of probabilistic relations which was the original motivating example. Finally, we extend the recent work of Joyal, Street and Verity on traced monoidal categories to this setting by introducing the notion of a trace ideal. For a given symmetric monoidal category, it is not generally the case that arbitrary endomorphisms can be assigned a trace. However, we can find ideals in the category on which a trace can be defined satisfying equations analogous to those of Joyal, Street and Verity. We establish a close correspondence between nuclear ideals and trace ideals in a tensored *-category, suggested by the correspondence between Hilbert-Schmidt operators and trace operators on a Hilbert space.


Introduction
This paper develops a new categorical structure, called a nuclear ideal, which comes from two independent, seemingly unrelated, developments. These are Grothendieck's concept of nuclearity in functional analysis, see for example [56], and the usual notion of binary relations. The original motivation for this investigation was the need to generalize ordinary binary relations to probabilistic relations with an eye towards certain applications in computer science. However a satisfactory notion of what this generalization should be comes from the concept of nuclearity in functional analysis. This paper presents the new concept and gives several nontrivial examples of nuclear ideals.
Relations form a basic and ubiquitous mathematical structure. There has been much activity in formulating what relations are "abstractly", so that one can generalize the concept to new situations. Typical examples of such formulations are the concept of cartesian bicategories [19] and allegories [27]. One of the key aspects of the category Rel is the fact that one has "transfer of variables" i.e. one can use the closed structure and the involution to move variables from "input" to "output". Intuitively speaking, this reflects the idea that the source and target of a binary relation are a matter of convention and a binary relation is an inherently symmetric object. In many situations that otherwise resemble relations, one finds that the closed structure does not exist and hence one loses the ability to transfer variables. A typical analogue of binary relations are the "probabilistic" binary relations, described at length later in the paper. Even in the absence of detailed definitions it ought to be clear that one cannot (indeed should not) rearrange the inputs and outputs of a probabilistic relation because there may be dependencies present among different inputs. What remains then in lieu of closed structure? We claim that it is precisely the nuclear ideals of the present paper.
In these settings, there appears to be a tension between having identities and having compact closed structure. If one looks only at the nuclear ideal, one has a compact closed "category" without identities. On the other hand, the ambient category lacks closed structure. Others have observed that there are "categories without identities", and given a wide range of examples and applications [4,54]. However the interplay between the ideal and the ambient category is the point of the present work, not just the lack of identities.
Another motivation for this work comes from considering Hilbert spaces. The tensored *category of Hilbert spaces and bounded linear maps (hereafter denoted Hilb) shares much of the same structure as Rel. One of the goals of this paper is to measure the extent of this correspondence. Like the category of relations, Hilb has a tensor product and a tensor-preserving involution, which is the identity on objects. In the case of Hilb, it is given by the adjoint operation. However, the category of Hilbert spaces lacks the closed structure of Rel. The structure of Hilb has been axiomatized as the notion of a tensored * -category [29,23]. (In fact, it is a tensored C * -category, but we will not consider its normed structure here.) In this paper, we argue that a tensored * -category should be thought of as a category of (generalized) relations. The category of relations is compact closed, and this property is frequently taken to be fundamental in axiomatizing relational categories [1,19]. However, the categories of relations which we consider are not compact closed, but rather contain a large class of morphisms, in fact an ideal, which has the basic structure of a compact closed category. To axiomatize this notion, we introduce the new notions of nuclear ideal and nuclear morphism. This idea is based on the definition of a nuclear morphism between Banach spaces, due to Grothendieck [33], which was subsequently axiomatized by Higgs and Rowe [37]. The concept of nuclearity in analysis can be viewed as describing when one can think of linear maps as matrices. Of course, in the finite-dimensional case one can always do this and it will be the case that all maps between finite-dimensional vector spaces are nuclear. The Higgs-Rowe theory applies only to autonomous (symmetric monoidal closed) categories, while our definition applies to the somewhat different setting of tensored * -categories. In the case of a compact closed * -category, all morphisms are nuclear, while in Hilb with its usual tensored * -structure, the nuclear morphisms are precisely the Hilbert-Schmidt maps [42]. Note that since we are only considering Hilb with the L 2 tensored * -structure, the notion of nuclear map we obtain is different from Grothendieck's notion arising from the category of Banach spaces (with, of course, the L 1 tensor product).
A further goal of this paper is to introduce two new examples of tensored * -categories, in which integration plays the role of composition. The first such category is a category of generalized functions or distributions [6,56]. Since a discrete relation on X × Y can be viewed as a function f : X × Y → {0, 1}, it seems reasonable to model a "smeared out" relation as a continuous function f : U × V → R, where U and V are open subsets of Euclidean space. However, the identity for such a category would be the Dirac Delta which is not a function, but a distribution. We choose a particular class of distributions, the tame distributions, which are sufficiently functional to allow composition. We then present a nuclear ideal for this category. It will consist of the tame distributions with functional kernel.
To build a category of probabilistic relations, one would like a category where the objects are probability spaces, and a morphism is a measure on the product space. The structure we eventually arrive at is the notion of conditional probability distribution, described in section 9. Categories of conditional probability distributions have previously been studied by Giry [32] and Wendt [57,58]. Our formulation differs from theirs in that in our category, objects are equipped with measures and morphisms are measures on the product space satisfying an absolute continuity property. To each morphism, we are then able to associate a pair of conditional probability distributions. Again, in this case the nuclear ideal will consist of measures having a functional kernel.
We also extend the recent work of Joyal, Street and Verity on traced monoidal categories [40] to the present setting by introducing the notion of a trace ideal. For a given symmetric monoidal category, it is not generally the case that arbitrary endomorphisms can be assigned a trace. However, one can often find ideals on which a trace can be defined satisfying equations analogous to those of Joyal, Street and Verity. Our abstract definition is suggested by the usual trace construction in the category of Hilbert spaces, where there is a well-established relationship between maps in the trace class and Hilbert-Schmidt maps. In this case, we obtain the usual notion of trace of a bounded linear operator in the trace class.

Categorical Preliminaries
We assume the reader is familiar with the notion of a symmetric monoidal 1 category. A suitable reference is [43]. We now review some of the different closed structures such a category could have.
Definition 2.1 A symmetric monoidal category is closed or autonomous if, for all objects A and B, there is an object A −• B and an adjointness relation: The unit and counit of this adjunction are the familiar morphisms: Examples of autonomous categories include the category of vector spaces and the category of relations. We obtain a pair of autonomous categories by considering Banach spaces. We can either consider Ban ∞ , the category of Banach spaces and bounded linear maps, or we can consider the category Ban 1 , of Banach spaces and maps of norm less than or equal to 1. In either case, the internal Hom is the Banach space of all bounded linear maps, and the tensor product is the completed projective tensor product [56].
Definition 2.2 A compact closed category is a symmetric monoidal category such that for each object A there exists a dual object A * , and canonical morphisms: such that the usual adjunction equations hold: together with the dual diagram for A * . In the case of a strict monoidal category, these equations reduce to the usual adjunction triangles. It is easy to see that a compact closed category is indeed closed and that A −• B ∼ = A * ⊗ B.
Compact categories could also be defined as * -autonomous categories [13,15] with the additional canonical isomorphism A * ⊗ B * ∼ = (A ⊗ B) * . * -Autonomous categories provide the basic framework for the model theory of the multiplicative fragment of linear logic [30].
We briefly describe the prototypical example, the category of relations.
The category of relations, Rel, has sets as objects, a morphism from X to Y will be a relation on X × Y , with the usual relational composition.
In what follows, X, Y, Z will denote sets, and x, y, z will denote elements. A binary relation on X × Y will be denoted xRy. The identity relation will be denoted ID, and is defined as xIDx, for all x ∈ X. Given a relation R: X → Y , we let R: Y → X denote the converse relation.
We verify that Rel is compact. The tensor product ⊗ is given by taking the products of sets, and on morphisms, we have: The unit for the tensor is given by any one point set. We define the functor ( ) * : Rel → Rel by: The relation ν: I → X ⊗ X * is given by * ν(x, x) for all x ∈ X and similarly for ψ.

The Tensored * -Category of Hilbert Spaces
Our notation for this section will be as follows. We will use brackets of the form −, − to denote the inner product, which will be linear in the first variable. The associated norm will be denoted || − ||. If α is an element of the base field, then α will denote its conjugate. If H is a Hilbert space, then H will denote the conjugate space. An orthonormal basis will be denoted {e i } i∈I . A suitable reference for basic Hilbert space theory is [42].
Let Hilb denote the category of Hilbert spaces and bounded linear maps, where "bounded" always means bounded in the norm associated to the inner product. We now discuss the structure of this category which is relevant to this paper. The first structure we need is the adjoint function [42]. Definition 3.1 Let H and K be Hilbert spaces, and f : H → K a bounded linear map. Then the adjoint of f , denoted f * , is defined to be the unique bounded linear map f * : K → H such that, for all a ∈ H, b ∈ K, we have: Lemma 3.2 The adjoint construction satisfies the following properties: The tensor product will be discussed below.) These conditions tell us that the adjoint operation provides a contravariant, tensor-preserving, involutive functor on Hilb which is the identity on objects. Given such a functor, it is clear that the category Hilb is much closer in its categorical structure to the category of relations than to the category of Banach spaces.

Hilbert-Schmidt Maps
We now discuss a crucial class of bounded linear maps, called the Hilbert-Schmidt maps. The material in this section can be found in [42].
is finite for an orthonormal basis {e i } i∈I . The sum is independent of basis chosen.
It is straightforward to see that: Lemma 3.4 If f : H → K is a Hilbert-Schmidt map and g: H 1 → H, g ′ : K → K 1 are arbitrary bounded linear maps, then g ′ f and f g are Hilbert-Schmidt.
Thus the Hilbert-Schmidt operators on a space form a 2-sided ideal in the set of all bounded linear operators. A proof of the following theorem may be found in [42].
Here, {e i } i∈I is an orthonormal basis for H and {e ′ j } j∈J is an orthonormal basis for K.

The Tensor Product
It is standard to construct the tensor product of Hilbert spaces H ⊗ K as the completion of the algebraic tensor product with respect to the inner product: One then completes with respect to the L 2 norm to obtain a Hilbert space. (Note that it is also possible to give an equivalent presentation that emphasizes the universal mapping property of the tensor. This involves the notion of a weak Hilbert-Schmidt mapping. This is explained in [42], page 132.) Remark 3. 6 We wish to emphasize that, in this paper, we will only be considering the L 2 tensor product. Furthermore, the category Hilb will always be the category of Hilbert spaces with bounded linear maps, equipped with this tensored * -structure.
Thus, our notion of nuclearity will not coincide with the notion obtained by viewing Hilbert spaces as Banach spaces and applying Grothendieck's definition, which of course uses the L 1 tensor.
For us, the most important property of the Hilbert tensor product is its relation to Hilbert-Schmidt maps. This is given by the following theorem [42], p.142: In particular, we note that the morphism U is a linear bijection.

Tensored * -categories
The category Hilb, of Hilbert spaces and bounded linear maps, shares many of the properties of a compact closed category, except for the closed structure. Hilb is in fact an example of a tensored * -category. We now develop this theory.
Definition 4.1 A category C is a * -category if it is equipped with a functor (−) * : C op → C, which is strictly involutive and the identity on objects. (Note that the strict involution may be replaced with a coherent involution, but we will not require that level of generality.) A * -category is tensored if it is symmetric monoidal, (f ⊗ g) * = f * ⊗ g * , and there is a covariant conjugate functor, ( ): C → C, which commutes with the * -functor and has natural isomorphisms: • A ∼ = A (We will generally take this to be an equality.) • A ⊗ B ∼ = A ⊗ B (We will generally take this to be an equality.) satisfying the usual monoidal equations, and the following equation. Suppose that f : I → I.
In all of our examples except for those involving complex Hilbert spaces, conjugation will simply be taken to be the identity. In this case, the previous diagram implies that if f : I → I, then f * = f . The notion of a tensored * -category is the first step towards defining a tensored C * -category, or multiobject C * -algebra [29,23]. This theory has been developed quite extensively in the previously cited references. Among the results established is a representation theorem stating that such categories have faithful structure-preserving embeddings in Hilb. This should be thought of as a multiobject version of the Gelfand-Naimark-Segal theorem.

Examples of tensored * -categories • Rel
• Hilb • Hilb f d , the category of finite-dimensional Hilbert spaces.
• URep(G), the category of unitary representations of a compact group G. Further examples can be found in [29,23]. Note that examples 2 and 4 are tensored * -categories which are not closed. We will present other examples of tensored * -categories which are not closed.
Even though tensored * -categories are not compact closed, they share much of the same structure. One of the goals of this paper is to introduce a structure for measuring the extent to which such a category is closed.

Nuclearity
One of the characteristic features of compact closed categories is the ability to distribute the dual functor across the tensor product. This is represented by the equation denotes the dual object. We temporarily adopt this notation to avoid confusion with the * -functor we will be discussing later. In the context of tensored * -categories, one should keep in mind the equation A • = A * .) This allows one to arbitrarily repartition the morphism or "interface" in the terminology of interaction categories [1]. The categories we will encounter typically allow such repartitioning for some maps, but do not meet all the requirements of being a compact closed category.
We now introduce the related notion of nuclearity in a symmetric monoidal closed category, due to Rowe [50], and subsequently studied by Rowe and Higgs [37]. The idea is suggested by Grothendieck's work on topological tensor products and nuclear spaces [33]. Grothendieck defined a continuous linear map f : A → B between Banach spaces to be nuclear if it can be written as We begin by noting that in any symmetric monoidal closed category, there is a morphism of the form: Here, A • = A −• I, where I is the unit for the tensor. This is constructed as the transpose of the composite: We will refer to p(f ) as a pseudoname for f . (We should point out that there are some cases in which a pseudoname is not unique.) We say that an object of C is nuclear if its identity map is nuclear.
2 Suppose that f : A → B and g: C → D are nuclear, then so are: All of the above can be obtained by straightforward diagram chasing. For example, in the third item, one can choose p(f h) = p(f ); (id ⊗ h • ). It is not in general the case that if f, g are nuclear, then so is f −• g. However, if C is * -autonomous with unit as dualizing object, then f −• g will also be nuclear, [37] p. 70.
In a compact closed category, the map ϕ is an isomorphism, and thus every map is nuclear. Furthermore, we can see the following: • A is nuclear Theorem 5.4 For any symmetric monoidal closed category, the full subcategory of nuclear objects is compact-closed.
Proof. Suppose that A is a nuclear object. Then, choosing a pseudoname for the identity gives a morphism of the form I → A ⊗ A • . It only remains to show that the adjunction triangles commute. We will consider one of the two adjunction triangles.
It is standard that the lower leg of the diagram is the identity. The upper leg of the diagram corresponds to the adjunction triangle. The upper triangle in the above square is the definition of pseudoname. The lower triangle is a straightforward exercise.
In Ban ∞ or Ban 1 , we recover Grothendieck's original definition of nuclearity. The nuclear objects are the finite-dimensional Banach spaces. In the category of vector spaces, a morphism is nuclear if and only if its image is finite-dimensional. Again, a vector space is nuclear if and only if it is finite-dimensional. In [37], the authors explore the notion of nuclearity in the category of complete join semilattices CJSL. It is well known that this is a symmetric monoidal closed category, in fact * -autonomous [41]. The authors completely characterize nuclearity in this case (This result is closely related to Raney's notion of a tight morphism [48].): Remark 5.6 Following recent work of Joyal, Street and Verity [40] on traced monoidal categories, one can now observe that, in a symmetric monoidal closed category, it is possible to define a trace on the nuclear morphisms as follows, under the assumption that pseudonames are unique. If f : A → A is nuclear, then tr(f ): I → I is given by: where ev: A ⊗ A • → I is the usual evaluation map. Then given h: A → B a nuclear map, and g: B → A arbitrary, one can verify the usual trace equation tr(gh) = tr(hg). This is seen by the following diagram: r r r r r r r r r r r r I r r r r r r r r r r r r The righthand diamond is the usual (di)naturality of evaluation. The two triangles on the left are the equations for p(gh) and p(hg).
While this theory is satisfactory when considering symmetric monoidal closed categories, there are nonclosed categories which exhibit similar structure. For example, the category of Hilbert spaces is not closed, but the class of Hilbert-Schmidt maps seem to have something like a nuclearity property. We will soon exhibit other such categories. One of the goals of this paper is to extend the above notions to a larger class of categories, specifically to * -categories. We now introduce a new notion, that of a nuclear ideal.
Definition 5.7 Let C be a tensored * -category. A nuclear ideal for C consists of the following structure: • For all objects A, B ∈ C, a subset N (A, B) ⊆ Hom(A, B). We will refer to the union of these subsets as N (C) or N . We will refer to the elements of N as nuclear maps. The class N must be closed under composition with arbitrary C-morphisms, closed under ⊗, closed under ( ) * , and the conjugate functor.
• A bijection θ: N (A, B) → Hom(I, A ⊗ B). If f : A → B is a nuclear morphism, note that we can use the bijection θ and the * -functor to construct morphisms of the form: We shall frequently refer to these morphisms as transposes of f . It will always be clear from the context which transpose is being considered. The bijection θ must also satisfy the following properties: 1. Preservation of tensored * -structure The bijection θ must preserve all of the tensored * -structure. In other words, (a) If f : A → B and g : C → D are nuclear, then θ(f ⊗ g) = θ(f ) ⊗ θ(g). More precisely, the map θ(f ⊗ g): I → A ⊗ C ⊗ B ⊗ D is given by the composite: Furthermore, the transposes of a map of the form f : I → A are given by composition with the evident isomorphism.
Again, more precisely, we would say: where c is the symmetry and ι is the isomorphism ι: I → I.

2.
Naturality For any f : A → C and g: B → D, the following diagram commutes: Note that since the class of nuclear morphisms is closed under composition with arbitrary C-morphisms, the function N (f * , g) is well defined.
3. Compactness Let f : A → B and g: B → C be nuclear. Then the following should commute.
This completes the definition of nuclear ideal. In the case where A is a nuclear object and f = g = id A , then this last equation reduces to the usual adjunction equation for a compact closed category. We will see that it is also related to the "yanking" axiom of [40].
Given a category C and a nuclear ideal N , we say that an object A of C is N -nuclear if we have that N (A, −) = Hom(A, −). Note that by the ideal property, this is equivalent to saying that the identity map for A is nuclear. Typically, this notion of nuclear object is capturing the "finite-dimensional" subcategory. It should not be thought of as describing Grothendieck's much richer theory of nuclear spaces.
Note that we are not claiming that the transposition map is in any way unique; different choices of θ could conceivably give different nuclear ideal structures. The usual uniqueness arguments, see for example [43] pp. 80-82, do not apply here in that we may not transpose the identity map. Thus it is possible that several distinct nuclear structures may exist on a given category. We are still pursuing this question. However, we know of no such examples. In the examples presented in this paper, the choice of the transpose is obvious and canonical, given the structures under consideration.
One of the consequences of the above definition is the "sliding" equation of Joyal, Street and Verity [40]: Lemma 5.8 Suppose f : A → B and g: B → A are nuclear. Then the following diagram commutes for any nuclear ideal: This equation is a straightforward consequence of the axioms. We will see in Section 8 that it corresponds to the familiar trace equation tr(f g) = tr(gf ). Theorem 5.9 Let (C, N ) be a nuclear ideal for which all objects are nuclear, then C is a compactclosed category.
Proof. If A is an object of C, then the transpose of the identity will be a morphism of the form I → A ⊗ A. The commutativity of the adjunction triangles follows from the compactness requirement of the definition.
Theorem 5.10 The set of Hilbert-Schmidt maps forms a nuclear ideal for Hilb.
Proof. Let H and K be Hilbert spaces, and let N (H, K) be the set of all Hilbert-Schmidt maps from H to K. It is evident that Hom(I, H ⊗ K) ∼ = H ⊗ K. So the morphism U , defined in 3.7, will act as a transpose operator. We saw in section 3 that this map was a linear bijection. It only remains to check the equations. These are a straightforward consequence of linearity and properties of the adjointness operator.
The nuclear objects in this case are precisely the finite-dimensional Hilbert spaces. Thus we recover the familiar compact closed subcategory. The same program can be carried out for categories of representations such as URep(G).

Partial Injective Functions
Define a category PInj as follows. Its objects will be sets, and morphisms will be partial injective functions, that is to say partial functions which are monomorphic when restricted to the domain. These partial functions were used by Danos in his modeling of the geometry of interaction [21].
is defined}. This category has an evident * -structure, and if we choose the cartesian product of sets as a tensor, then we evidently have a tensored * -category. We now demonstrate that this category has an evident nuclear ideal. Define: Then one can see that we have an obvious bijection between Hom(I, X ⊗ Y ) and N (X, Y ).

Theorem 5.11
The above construction defines a nuclear ideal for PInj.

Crossed M-Sets
The following is based on Freyd and Yetter's notion of a crossed G-Set, which they use in their work on braided compact closed categories [28]. In this paper, we will only consider a commutative monoid, which gives a symmetric monoidal category. We hope to explore the nonsymmetric and braided versions of this construction in future work, as well as the connections to topological quantum field theory [10]. Now define a category XRel as follows. Objects are crossed M-sets, and maps are relations R : X → Y such that: Freyd and Yetter construct a category where the objects are functions satisfying precisely these requirements. They use a nonabelian group and the braiding is the symmetry adjusted appropriately by the action of G. They then use this category to develop knot invariants [28]. In subsequent work, Yetter uses crossed G-sets to construct topological quantum field theories [59]. See also [47].
If X and Y are crossed M-sets, define X ⊗ Y as cartesian product with componentwise action, and |(x, y)| = |x||y|. The unit is the one element set I = { * }. Define | * | = e.
Note that XRel is not compact. The counit of the adjunction would be required to satisfy * R(x, x) for all x ∈ X, but this would hold if and only if |x| 2 = e. This will be our definition of nuclear object. Now for all X, Y , define N (X, Y ) ⊆ Hom(X, Y ) by: Theorem 5.14 This defines a nuclear ideal for XRel.

Distributions as Relations
In this section, we introduce a generalized category of relations based on the idea of distributions.
The guiding intuition is that composition should be determined by an integral of the form: The viewpoint here is that the notion of integration generalizes the existential quantification that appears in the definition of relational composition. We will refer to this formula as the "convolution formula." We now introduce a framework in which this makes sense. A naive approach is to view ϕ(x, y) and ψ(y, z) as real-valued functions. However, for such a "category" to have identities would require an equation of the form: and similarly for left composition. The "function" playing this role is in fact the Dirac δ which is not a function but a generalized function or distribution in the sense of Schwartz [52,56,6]. Unfortunately multiplication of distributions is not always well-defined. Formulas like the one above are sensible only for certain limited kinds of distributions. In the rest of this section, we review basic facts about distributions and then develop a theory of what we call "tame" distributions for which the above integral formula makes sense.
Tame distributions are mentioned in the extant literature (see, for example, Dieudonné's "Treatise on Analysis", volume 7, chapter 23, sections 9 and 10 [22]), but are not given a name.

Basics of Distributions
Let Ω denote a nonempty open subset of R n . Let E(Ω) denote the set of C ∞ (smooth) functions on Ω and D(Ω) denote the smooth (complex-valued) functions of compact support on Ω. We will refer to the elements of D(Ω) as test functions. In what follows, we use Greek letters such as φ, ψ, η as test functions. D(Ω) is given the structure of a topological vector space as follows. This structure is described for example in [6,56].
We begin by considering a compact subset K ⊆ Ω, and letting D(Ω; K) be the set of continuous functionals on Ω with support contained in K. Then we define a family of seminorms on D(Ω; K) by the following formula, where ∂ x i 1 ...x j n denotes the partial derivative with respect to the listed variables: We then give D(Ω; K) the least topology such that each of these seminorms is continuous. The existence of such a topology is proved on page 12 of [6]. With this topology, D(Ω; K) is a Fréchet space, i.e. it is locally convex, metrizable and complete. Now observe that We then give D(Ω) the finest locally convex topology such that the inclusions D(Ω; K) ⊆ D(Ω) are continuous for every compact K. This is known as the inductive limit of the topologies on D(Ω; K). With this topology, D(Ω) is not metrizable. However it is an LF space (locally Fréchet) in the sense of [56] p.126. As such, it is locally convex, Hausdorff and complete.
Then we define a distribution on Ω to be a continuous, linear (complex-valued) functional on D(Ω). Let D ′ (Ω) denote the set of all distributions on Ω. Let D ′ (Ω) be given the weak topology, p. 45 [6] or p.197 [56]. This is equivalent to the topology of pointwise convergence, and D ′ (Ω) is locally convex, Hausdorff and complete. We will also have need of the following extension theorem [56]  1. Let L loc (Ω) denote the space of locally integrable functions. Suppose that f ∈ L loc (Ω). Define a distribution T f by: Note that two locally integrable functions determine the same distribution if and only if they are equal almost everywhere [56]. A distribution of this form is called regular, and the function f is called the kernel of the distribution. A distribution which does not arise in this way is called singular. Regular distributions are fundamental examples, in fact there are a number of strong results regarding the approximation of distributions by regular distributions [56]. This justifies thinking of distributions as generalized functions.
2. As a special case of the previous example, we observe that every test function is itself locally integrable, and so induces a regular distribution. Thus we have a canonical inclusion given as follows: There are similar inclusions for the set of locally integrable functions or smooth functions.
3. For any point x ∈ Ω, let δ x (ϕ) = ϕ(x). If 0 ∈ Ω, we denote δ 0 simply as δ and refer to it as the (one-variable) Dirac delta. One can show that this distribution is singular, see for example [6,56].

4.
If Ω ⊆ R, we may also "differentiate" the previous distribution via the formula: This distribution is also singular. More generally, if Ω ⊆ R n and T ∈ D ′ (Ω), we have the formulas: These formulas allow one to "differentiate" nondifferentiable functions, and are one of the many advantages of distributions. See, for example, [6], Chapter 2.3.

The Schwartz kernel theorem
One is often interested in distributions on product spaces, especially in the theory of differential equations and their associated Green's functions. In this situation the analogy between distributions and "infinite-dimensional matrices" is quite striking. The theory of kernel distributions can be seen as a formalization of this analogy. In the analysis literature, the notion of "kernel distribution" is studied at length, see for example the massive treatise of Dieudonné [22] or the book by Treves [56]. When considering a space of test functions of the form D(X × Y ), there is a canonical subspace of fundamental importance. Consider the tensor product D(X) ⊗ D(Y ). A typical element of this space is of the form There is a canonical inclusion of D(X) ⊗ D(Y ) into D(X × Y ) given by: The result we will have use for is: Now we have a chance of defining functions on D(X × Y ) as the unique continuous extension of functions defined on D(X) ⊗ D(Y ) using Theorem 6.2.
One of the fundamental results in the theory of distributions is the Schwartz kernel theorem, which gives conditions under which maps from D(X) to D ′ (Y ) can be realized as distributions on X × Y . We need the following notations to state the theorem. If f is a distribution on X × Y and φ ∈ D(X) then f * (φ) will be the function from D(Y ) to the base field given by ψ ∈ D(Y ) → f (φ⊗ψ) and f * (ψ) is given by the evident "transpose" formula. We have not yet said that f * (φ) and f * (ψ) are distributions; that is part of the content of the kernel theorem.
The Schwartz kernel theorem states: 2. Let f * be a continuous linear map from D(X) to D ′ (Y ). Then there exists a unique distribution on X × Y such that for φ ∈ D(X) and ψ ∈ D(Y ) the following holds: Evidently, by symmetry, the same result applies for f * . In light of the kernel theorem, we may now state the following definition.
Definition 6.5 Suppose that f is a distribution on X × Y , then we obtain the following continuous maps (supposing that φ ∈ D(X), ψ ∈ D(Y ) are arbitrary):

Tame Distributions
To pass from the "discrete" category of ordinary relations to a category of "continuously varying" relations, we should replace the usual notion of morphism in Rel, a function X × Y → 2, with an integrable function X × Y → R, where X and Y are now open subsets of some Euclidean space. We have already seen, however, that functions do not suffice. One must pass to a class of generalized functions or distributions. While distributions satisfy many properties of functions, they cannot be multiplied and hence the composition formula that we had proposed does not make sense. Thus our goal is to introduce a class of distributions which are sufficiently "functional" as to allow us to compose them using the integral formula discussed above.
We will use a notion defined by Dieudonné in [22]. It will provide the first step towards defining a composable class of distributions. Note that E(X) is the space of all smooth complex-valued functions on X (not necessarily of compact support). Unfortunately, Dieudonné uses the term regular which conflicts with the terminology above. We therefore use the term Dieudonné-regular.
An equivalent statement is that the function f * : D(X) → D ′ (Y ) specified by the kernel theorem factors through the inclusion E(Y ) ֒→ D ′ (Y ), and similarly for f * .
We would like to define our composition as follows. Given distributions f ∈ D(X × Y ), g ∈ D(Y × Z) which are Dieudonné-regular, we try to define a distribution f ; g ∈ D(X × Z) using the following formula (with φ ∈ D(X), γ ∈ D(Z)).
Hereφ is the element of E(Y ) associated to the distribution f * (φ), andγ is the element of E(Y ) associated to the distribution f * (γ).
However, the above integral may well be infinite. Thus we must add an additional assumption which assures the finiteness of this integral. One possibility is to require not only that the two kernels be smooth, but that they have compact support. 2 Thus, we have the following: that each of f * and f * factor continuously through the appropriate ι, where ι is the inclusion of the space of test functions into the space of distributions. Explicitly, there exist continuous linear maps such that for every φ ∈ D(X) and ψ ∈ D(Y ), we have: Note that we are not saying that f L and f R have functional kernels and certainly not that f has a functional kernel. But rather that f * and its adjoint f * map test functions to distributions with test functions as kernels. In some sense, tame distributions are allowed to be mildly singular, in that composing with a test function "tames" the singularity.
Dieudonné, in [22], page 77, examines the question of when the operators f * and f * map test functions to test functions, and he derives the following theorem. 2. The operator f * maps D(Y ) to D(X).

The operator
is the space of distributions of compact support (see [6] for the definition of support of a distribution).

Examples
• Let X be an open subset of R n . The trace distribution on X × X is given by T r(η) = η(x, x)dx where η(x, x ′ ) ∈ D(X × X). From this definition it follows that T r * (φ)(ψ) = T r * (ψ)(φ) = T r(φ ⊗ ψ) = φ(x)ψ(x)dx. Thus we clearly have T r L (φ) = T r R (φ) = φ, which shows that δ is tame. This tame distribution will act as the identity in our category.
• Suppose that T is a regular distribution on X × Y with a test function β(x, y) as its kernel, that is to say: Then T is tame with its associated functions being given by: We write T (X, Y ) for the tame distributions on X × Y .

Composing tame distributions
Given tame distributions we can define the following operation which will serve as composition. Suppose that f ∈ T (X, Y ), g ∈ T (Y, Z). We define f ; g ∈ T (X, Z) as follows. Given that f is tame, we have a continuous function f L : D(X) → D(Y ). Applying the first part of the Schwartz kernel theorem to g, we obtain a morphism g * : D(Y ) → D ′ (Z). Composition gives a continuous map D(X) → D ′ (Z). By the second part of the kernel theorem, we obtain a distribution on X × Z. Alternatively, we could use the extension theorem, Theorem 6.2. Let φ ∈ D(X), ψ ∈ D(Z). We set This, of course, only defines f ; g on D(X) ⊗ D(Z) rather than on D(X × Z). We then use the fact that the tensor product is a dense subspace to extend composition to all of D(X × Z). One observes that f ; g is tame as can be seen by an elementary calculation, noting (f ; g) L = f L ; g L and (f ; g) R = g R ; f R and the tameness of f and g.

The category DRel
Definition 6.9 The category DRel has as objects open subsets on R n , and, as morphisms, tame distributions. Composition is as described above.
Proof. Evidently we can verify properties of the composition f ; g by carrying out calculations on the distribution defined on D(X)⊗D(Z) and appealing to continuity and the density of D(X)⊗D(Z) in D(X × Z). We have already noted above that f ; g is tame. A simple calculation shows that the trace distribution is the identity for composition.
To verify associativity we calculate as follows. Let f ∈ D(X × Y ), g ∈ D(Y × Z) and h ∈ D(Z × W ) be tame distributions. Then we have: Thus we have shown that DRel is a category. The tensor product is given as follows. Given objects X and Y we define X ⊗ Y as the cartesian product space X × Y . Given morphisms in DRel f : X → Y and g: It is routine to verify that this is tame. We extend f ⊗ g to all of D(X × X ′ × Y × Y ′ ) as above. The one-point space, written I = { * }, is the unit for the tensor (with measure µ({ * }) = 1).
Finally the * -structure is the identity on objects. On morphisms, the only thing that changes is the role of f L and f R . The conjugate functor is taken to be the identity.

Remark 6.11
As an example, we will describe Hom(I, X), where X is an arbitrary object. Clearly, D(I) is isomorphic to the base field. We must have two functions: such that, for all ψ ∈ D(X): . So the function f R is uniquely determined by the function f L . Hence we may conclude that Hom(I, X) is in bijective correspondence to test functions on X.
We now display a nuclear ideal for DRel. We remarked that not all tame distributions can be viewed as integral operators with functions as kernels. In particular the identity morphisms do not have this property. However, we will see that tame distributions with functional kernels form a nuclear ideal. Definition 6.12 Given objects Y and Z of DRel we define the set of nuclear morphisms, written N (Y, Z), as the collection of tame distributions g: Y → Z such that ∃β(y, z) ∈ D(Y × Z) with the property that for every φ(y, z) ∈ D(Y × Z): Note that the test function β(y, z) ∈ D(Y × Z) associated to to the tame distribution g is unique. Thus, the set N (Y, Z) is in bijective correspondence to D(Y × Z).
Theorem 6.13 The sets N (Y, Z) form a nuclear ideal for DRel.
Proof. As already remarked, if g ∈ N (Y, Z) and if β is its kernel, then: ∀ψ ∈ D(Y ), g L (ψ) = β(y, z)ψ(y)dy To verify that we have an ideal, we have to show that for any f ∈ T (X, Y ) the composite f ; g is nuclear and symmetrically for composition on the other side of g. In order to verify this we need to find a kernel for f ; g. We claim that this kernel is α(x, z) = df f R (β(y, z)) where we interpret this formula as follows. For each fixed z ∈ Z β(y, z) is a smooth function of compact support in Y ; f R acts on this function to produce a function of compact support in X. The function α(x, z) evidently has compact support, and its smoothness is a consequence of the continuity of f R . It suffices to prove this for functions β of the form β(y, z) = a(y)b(z) where a ∈ D(Y ) and b ∈ D(Z). This follows from Proposition 6.3 which implies that arbitrary β can be written: The general result then follows from the linearity and continuity of f R . Now observe that for a fixed z: Now we calculate as follows, again letting β(y, z) = a(y)b(z) and relying on linearity and continuity for the general result: It follows that f ; g is an integral operator with α as its kernel. The verification for composition on the other side of g is very similar.
To complete the proof, we need to show that Hom(I, X ⊗ Y ) ∼ = N (X, Y ). This isomorphism is described in Remark 6.11. It remains to verify the equations. Naturality requires an argument similar to the previous calculation. Compactness is quite straightforward.

The Category PRel
In this section, we define a category of probabilistic relations, and describe a nuclear ideal for it. We will see that we indeed get most of the important properties of the category of relations, i.e. we have a tensored * -category with a nuclear ideal. Thus one may think of this category as representing relations "smeared out probabilistically". Once again, as in DRel we have a situation where the identity maps are too singular to be in the nuclear ideal. The nuclear ideal can be thought of as functions but the ambient category has to be described in terms of measures.

Basic Definitions of Measure Theory
We assume the reader is familiar with the basic concepts of measure theory. We recall the basic definitions for completeness. A reader who remembers these definitions can skip to the start of the next section without loss of continuity. Definition 7.1 A σ-field Σ on a set X is a collection of subsets of X which 1. includes the whole space X,

is closed under finite and countable unions.
A measurable space is a set together with a σ-field. A measurable function from a measurable space Given a measurable space (X, Σ X ), we call the members of Σ X measurable sets. If B is a measurable set then the characteristic function of B is denoted χ B and is clearly measurable.
If we have a measure taking values in [0, 1] we call it a sub-probability measure and if the measure ("mass") of the whole space is 1 we say that it is a probability measure. A σ-field equipped with a measure is called a measure space and equipped with a probability measure it is called a probability space.
Sets of measure zero play an important role. The phrase almost everywhere is frequently used to assert that a certain property holds everywhere except on a set of measure zero. If there is confusion about which measure is intended we might say, for example, P -almost everywhere.
The set of real numbers and the closed unit interval [0, 1] play a central role in the subsequent discussion. As measurable spaces, each has two σ-fields which are often used, the Borel σ-field and the Lebesgue σ-field. Any collection of subsets of a set X generates a σ-field, namely the least σ-field containing all the sets of the given collection. If we take the open sets of any topological space and generate a σ-field we get the Borel σ-field. In particular we get the Borel σ-field on the reals. This σ-field on the reals can be given a measure in such a way that the measure of an interval is its length. The resulting measure space has the property that there are subsets of sets of measure zero that are not measurable. There is a canonical "completion" procedure which yields an extended σ-field and measure, such that any previously measurable set has the same measure and all subsets of sets of measure 0 are measurable (and have measure 0). When applied to the Borel subsets of the reals with the Lebesgue measure one gets Lebesgue measurable sets (with the Lebesgue measure). In our discussion we always mean Borel measurable whenever we talk about a measurable subset of the reals.
In some older books [34,51], a measurable function from the reals to the reals is defined to be a function where the inverse image of an open set has to be a Lebesgue measurable set rather than a Borel measurable set. This has the unfortunate effect that the composite of two measurable functions need not be measurable. A suitable reference for the above discussion is [44], but any good book on probability theory such as Ash [7], Billingsley [14], or Dudley [25] covers this material.

A category of stochastic kernels
Probability theory has been examined in the past from a categorical perspective. For example, Giry [32] has given the following construction, based on hints in unpublished notes of Lawvere. Wendt has examined this construction extensively [57,58].
Let Meas denote the category of measurable spaces and measurable functions. We will now describe a triple T on the category Meas. In what follows, when we talk about measurable functions into [0, 1], we always mean the Borel σ-field on [0, 1], denoted B. If (X, Σ) is an object of Meas, then we define T (X, Σ) to be the set of probability measures on (X, Σ) equipped with the least σ-algebra making the evaluations e B : T (X) → [0, 1] defined by e B (P ) = P (B) measurable, where B ranges over the measurable sets of X. T acts on maps by the formula: The unit for the triple η: id → T is defined by the formula: where x ∈ X and χ B is the characteristic function of B. The multiplication µ: T 2 → T is defined as follows. If P ′ ∈ T 2 (X), then P ′ defines a measure on T (X), and we use it to form the following integral: With these definitions, one can then prove [32]: To understand the structure of the Kleisli category, we require the following definition. Definition 7.4 If (X, Σ) and (X ′ , Σ ′ ) are measurable spaces, then a stochastic kernel on X × X ′ is a function that is measurable in its first argument, for each fixed measurable set and a probability measure in its second argument for each point in X.
Stochastic kernels are closely related to regular conditional probability distributions [7,25].
If τ is a stochastic kernel on X × Y and ρ is a stochastic kernel on Y × Z, then we can compose ρ and τ to obtain a stochastic kernel τ • ρ: X × Σ Z → [0, 1], using the following formula: Note that in the above formula ρ(−, C) is acting as the measurable function, and τ (x, −) as the measure. The associativity of this composition follows easily from the monotone convergence theorem.
So we obtain a category Stoch, whose objects are measurable spaces, and whose morphisms are stochastic kernels. The identity for this category is given by the δ-formula: One can now derive [32]: The Kleisli category for the triple T is equivalent to Stoch.
Given a morphism f : X → T Y in the Kleisli category, one obtains a stochastic kernel via the formula:

Probabilistic Relations
While the category Stoch allows valuable insights into probability theory -for example, the Chapman-Kolmogorov equation is simply functoriality [32] -it lacks some of the structure one requires of a category of relations; notably the ability to take the converse. To pass to a category which is more relational in nature, we will use measures on the product space. Unfortunately one cannot compose measures in any simple way. Given measures on the product space, there is no obvious sense in which one can integrate them to compose as in the category Stoch. The idea is to rely on a basic theorem which says that given such product measures, on suitable spaces, one can construct a pair of stochastic kernels -which, together with the marginal distributions, determine the original measure on the product space -and then compose them in the manner described for Stoch.
We now give the details of the construction. First suppose that we have a pair of measurable spaces (X, Σ X ) and (Y, Σ Y ), a probability measure P X on (X, Σ X ), and a stochastic kernel h(x, B): X × Σ Y → [0, 1]. Then we have a unique measure P on the product such that for all A ∈ Σ X : Thus if we have a pair of stochastic kernels h : X × Σ Y − → [0, 1] and k : Y × Σ X − → [0, 1] and probability distributions P X on (X, Σ X ) and P Y on (Y, Σ Y ) -satisfying an evident compatibility condition -we can reconstruct a unique probability measure on the product space.
Conversely, given a measure P on the product X × Y we can construct a measure on each of the factor spaces by setting P X (A) := P (A × Y ) and P Y (B) := P (X × B). These are called the marginals. Knowing one of the marginals and the appropriate stochastic kernel is equivalent to knowing the product measure. Clearly the pair of stochastic kernels does not uniquely determine the product measure; it does not even determine the marginals. We now need to show how to go from the product measure to the stochastic kernels.
The situation we have is: a pair of measure spaces (X, Σ X , µ X ) and (Y, Σ Y , µ Y ) and a measure, say α, on the product space equipped with the product σ-field, Σ X ⊗ Σ Y . We want to construct a stochastic kernel h : X × Σ Y − → [0, 1]. The product space is a product in the category Meas and is equipped with the usual projections π 1 and π 2 to X and Y respectively. We want to construct h : where h is the morphism (of the category Stoch) that we are trying to construct and π 1 , π 2 , the projections, are morphisms of the category Meas. However, this construction requires some assumption on the spaces involved. More precisely, we require that the spaces are Polish spaces 3 . Recall that a Polish space is the topological space underlying a complete separable metric space. This assumption is quite common in probability theory and allows the construction of regular conditional probability distributions [7,14,25]. We will not invoke these general concepts here.
We state a slightly more general theorem from which the construction of h in the preceding paragraph follows immediately.
Theorem 7.6 Suppose that (U, Σ U , P ) is a probability space, V is a Polish space with the Borel σfield, written Σ V , and (W, Σ W ) is a measurable space. Suppose that f is a measurable function from U to V and that g is a measurable function from U to W . Then there exists a Stoch morphism, i.e. a stochastic kernel, Q : W − → V as shown in the diagram This Q is unique in the sense that if Q ′ is another stochastic kernel satisfying the same equation then for P -almost all u ∈ U Q(u, ·) and Q ′ (U, ·) are identical.
Roughly speaking, this says that Q composed with g agrees with f at least when evaluated on the measures P . In probability texts this theorem is stated in terms of existence of regular conditional probability distributions relative to a sub σ-field. We have essentially the same situation since the set of inverse images under g of the W -measurable sets forms a sub-σ-field of Σ U . With this identification, theorem 7.6 is equivalent to theorem 10.2.2 of [25].
We are now ready for the corollary of chief interest.
Corollary 7.7 Given Polish spaces X and Y with their Borel σ-fields and a probability measure α on the product space, there is a stochastic kernel Q 1 (x, B) (i.e. a Stoch morphism from X to Y ), where B ∈ Σ Y and a stochastic kernel Proof. We use the theorem 7.6 with X × Y as U , X as W and Y as V and the projection maps as f and g. Now we immediately get Q 1 . To see that the equation is satisfied we check as follows: On the other hand the left hand side of the equation asserted in theorem 7.6 is, in this case, This can be rewritten as which is the desired result. One gets the result for Q 2 similarly.
Here are two simple example applications of corollary 7.7. For the first we take the product measure α to be µ ⊗ ν. In this case the stochastic kernel h : it is independent of x. If we take the product X × X with the measure ∆ defined by ∆(A × B) = µ(A ∩ B), we get the usual Dirac delta δ(x, A).
Finally, to define morphisms in our category, we proceed as follows. Given two measures, µ and ν, on a measurable space we say ν is absolutely continuous with respect µ, written ν << µ, if for any measurable set A, µ(A) = 0 implies that ν(A) = 0. We now assume that the marginal α X is absolutely continuous with respect to µ. By applying the Radon-Nikodym theorem [14], we obtain a measurable function h(x): X → R such that From which it follows that: We refer to the function F (x, B) = Q(x, B)h(x) as the stochastic kernel associated to α. Definition 7. 8 We define a category PRel as follows. The objects of PRel are triples (X, Σ, µ), where X is a Polish space, Σ the associated σ field and µ is a probability measure on (X, Σ). A morphism α: (X, Σ, µ) → (X ′ , Σ ′ , µ ′ ) is a probability measure on Σ ⊗ Σ ′ whose marginals are absolutely continuous with respect to µ and µ ′ .
To compose morphisms α: X → Y and β: Y → Z, we calculate their associated stochastic kernels F (x, B) and G(y, C) and compose as in the above Kleisli category to obtain a stochastic kernel H(x, C). We then obtain a measure on X × Z via the formula: Theorem 7.9 PRel is a category.
Proof. The only thing remaining to consider is the identity. If (X, Σ, µ) is an object, its identity is given by ∆(A × A ′ ) = µ(A ∩ A ′ ), with the associated conditional distribution given by the Dirac δ.
Proof. The * -structure of PRel is evident, and the tensor product on objects is given by the product in the category Meas, that is, one takes the product of the 2 sets, the tensor of the σalgebras, and the product measure. The necessary equations are all straightforward to verify.
It is worth understanding the nature of isomorphisms in PRel in order to get a better sense of the role of the measures on the PRel objects. We consider first objects with the same underlying Polish space and hence σ-field. We will show that two such objects are isomorphic exactly when they define the same ideal of sets of measure zero. Proposition 7.11 Consider two PRel objects X 1 and X 2 where X 1 = (X, Σ, µ) and X 2 = (X, Σ, ν). They are isomorphic in PRel if and only if µ << ν and ν << µ.
By the absolute continuity assumptions these are PRel morphisms. The associated stochastic kernels are just the Dirac delta distributions and the composite of these distributions are again Dirac delta distributions. As we have observed before the Dirac delta distribution is the stochastic kernel associated with the identity morphism. Thus H and K form an isomorphism. Conversely, suppose that we have an isomorphism H : X 1 − → X 2 and K : X 2 − → X 1 . Suppose that µ(A) = 0 for some A ∈ Σ. Let h ′ be the stochastic kernel from X 2 to X 1 associated with H, then we have where the last equality follows from H 1 << µ as required for H to be a PRel morphism. We are writing integrals over X 2 and X 1 rather than over X in order to avoid confusion; of course X 1 and X 2 are both X as sets. Since h ′ is always nonnegative we have that it is ν-almost everywhere 0. Let k be the stochastic kernel from X 1 to X 2 associated to K. Since H and K form an isomorphism, we have Integrating both sides of this equation over X 1 using ν, we get It can easily be shown, using the monotone convergence theorem, that we can rewrite the left hand side as where the integral in square brackets defines the measure used for the outer integration. This measure is absolutely continuous with respect to ν since it is defined by k. Since the integrand h ′ (x ′ , A) is ν-almost everywhere 0, the whole integral is 0. Thus ν(A) = 0 and ν << µ. Similarly µ << ν.
Observation 7.12 Similarly, given two Polish spaces and a Borel isomorphism between them, one can show that the two objects are isomorphic if and only if the Borel isomorphism preserves and reflects sets of measure zero.
In view of proposition 7.11 and observation 7.12 the following important theorem of classical measure theory (see, for example, theorem 13.1.1 in [25]) almost completes the analysis of isomorphisms in PRel. Proof. In view of theorem 7.13, it remains to show that isomorphic objects in PRel always have the same cardinality. First note that for finite or countable objects in PRel the stochastic kernels are just stochastic matrices. Thus an elementary rank argument suffices.
In the case that one of the objects has an uncountable underlying set we argue as follows. It is easy to see that in an uncountable set, with any σ-field and with any probability measure, say P , there can be at most countably many points, x, with P ({x}) = 0. Now suppose that (X, Σ X , µ), with X a countable set, and (Y, Σ Y , ν), with Y uncountable, are PRel objects. Suppose, for the moment, that µ({x}) is nonzero for every x ∈ X. Now suppose that we have an isomorphism H : X − → Y with inverse K : Y − → X. Thus we have stochastic kernels as follows: Since these are isomorphisms, we obtain the equation Since X is countable, this reduces to where the last equality is a consequence of the absolute continuity requirement. But By assumption, for every x ∈ X, we have that µ({x}) = 0. Thus, for every x ∈ X, it is the case that k − (x, {y}) = 0. So we conclude: This is a contradiction.
Finally, recall that the stochastic kernels are uniquely defined only almost everywhere. In particular, for a countable probability space, the set of all points of measure zero itself has measure zero. Thus, at points where µ({x}) = 0, we can define k − (x, B) to be 0, and the above argument still applies.

A nuclear ideal for PRel
To determine a nuclear ideal for PRel, we must consider the set Hom(I, X ⊗ Y ). By definition, this consists of measures α which are absolutely continuous with respect to the product measure µ × µ ′ . By Radon-Nikodym, we can construct a measurable function f : As usual two measures are equal if and only if their associated functions agree almost everywhere.
Thus, we will define N (X, Y ) to be the set of all measures on X × Y for which there exists a measurable function f such that the previous formula holds. It is immediate that the marginals associated to such a measure are absolutely continuous with respect to µ and µ ′ , respectively. While f itself is only unique almost everywhere, the measure with which f is associated is easily viewedin a canonical way -both as a member of Hom(X, Y ) and as a member of Hom(I, X × Y ). Thus every element of the set Hom(I, X ⊗ Y ) is associated with a measure that has a functional kernel which is in turn one of the members of the set N (X, Y ).
To see that we have a 2-sided ideal, suppose that α ∈ N (X, Y ). Hence we have a function f : X × Y → R satisfying the above equation. Suppose β ∈ Hom(Y, Z). let G 2 : Σ Y × Z → R be the associated stochastic kernel. Then we define a function h: X × Z → R by the formula: As usual, we are viewing f (x, y) as a measurable function of y for the fixed x, and G 2 (−, z) as a measure on Y for the fixed z. The construction for right composition is essentially identical. One can readily verify that the functions so constructed are indeed functional kernels for the composite measures.
Finally, we observe that in the case when both α and β are nuclear, then there exist functions f (x, y) and g(y, z) which act as functional kernels. The functional kernel of the composite is given by: We conclude: Theorem 7.15 The above construction determines a nuclear ideal for PRel.
The verification of the requirements for a nuclear ideal are routine. The calculations involve computing transposes and can be done just the same way as proving associativity of composition in Stoch. We call this nuclear ideal MRel. One can generalize the setting to analytic spaces [25] which are continuous (or measurable) images of ∞ in Polish spaces.

Trace Ideals
In [40], Joyal, Street and Verity develop an abstract theory of trace operators in a monoidal category. A trace is a function of the form: satisfying appropriate equations. (In fact, the authors introduce a more general parametrized trace which we discuss below.) The authors demonstrate that in a symmetric (in fact, braided) compact closed category, one obtains a trace via the formula (using the notation of section 2 and using c to represent the symmetry): (h: A → A) → (ν; h ⊗ id; c; ψ: I → I) For example, in the compact closed category of finite-dimensional Hilbert spaces, one obtains the usual notion of trace of an endomorphism. This notion of trace also underlies such ideas as feedback in a computation and braid closure [40,36].
When one passes from the category of finite-dimensional Hilbert spaces to the category of arbitrary Hilbert spaces, one finds endomorphisms which do not have a trace, for example the identity on an infinite-dimensional space. However, each endomorphism monoid contains an ideal of endomorphisms which do have a trace. This ideal is called the trace class and these trace maps are closely related to Hilbert-Schmidt morphisms. After reviewing this relationship, we describe a general theory of trace ideals for symmetric monoidal categories. We then show that if a tensored * -category has a nuclear ideal satisfying certain additional structure, then one can recover a trace ideal, as in the compact closed case.

Hilbert Spaces
Appropriate references for this material are [49,55].  • I is a vector space.
• It is a 2-sided ideal in the monoid Hom(H, H).
• If A ∈ I, then A * ∈ I These last two conditions say that we have a * -ideal. We now extend the notion of trace to arbitrary endomorphisms in the trace ideal.

Trace Ideals
The previous discussion suggests the following abstract definition. We suppose for the remainder that C is a symmetric monoidal category. An alternative approach to partial traces is presented in [18], which considers traces on a linearly distributive category. The trace operator works on a certain subcategory, the core, which has the same sort of "type degeneracy" as a compact closed category.
We would like to extend the relationship between compact closed categories and traced monoidal categories to a relationship between nuclear ideals and trace ideals. Keeping in mind the correspondence between Hilbert-Schmidt maps and the trace class, we define: Definition 8.12 Suppose that C is a tensored * -category equipped with a nuclear ideal. Suppose also that A is an object in C. We define the trace class of A to be: While one can define the notion of trace class for arbitrary morphisms in C as above, note that the actual trace function only acts on I(A) = I (A, A). In other words, the trace function acts only on the diagonal of the functor I(−, −). This is analogous to the notion of dinatural transformation, which is the appropriate notion of naturality for multivariate functors. These are families of morphisms between the two given functors, instantiated along the diagonals, satisfying an appropriate commutative hexagon [26,24,12,15]. Hence the alternate name "dinaturality" for the sliding axiom.
If h ∈ I(A), we would like to define a morphism tr A (h): I → I (or just tr(h) if there is no confusion) by the formula (whereĝ,f denote the evident transposes): However, there is no guarantee that if h is also equal to f ′ g ′ that we will obtain the same trace. Therefore we make the following definition: Definition 8.14 A nuclear ideal is traced if it satisfies the following uniqueness property: • If f : A → B, g: B → A, f ′ : A → C, g ′ : C → A are nuclear and gf = g ′ f ′ , thenĝf =ĝ ′f ′ : I → I.

Theorem 8.15
The above construction assigns a trace ideal to each traced nuclear ideal.
The proof of this theorem is simply a matter of checking the necessary diagrams. For example, lemma 5.8 gives the sliding axiom. One can also check that: Theorem 8. 16 The canonical nuclear ideal in Hilb is traced.

Traces in DRel
We now examine the trace construction in our category of distributions.

Theorem 8.17 The canonical nuclear ideal in DRel is traced.
Proof. Suppose that f : X → Y, g: Y → X, f ′ : X → Z, g ′ : Z → X are nuclear and gf = g ′ f ′ . Since f is nuclear, we have a morphismf : I → X ⊗ Y , which has associated to itf L : D(I) → D(X × Y ). As already remarked, D(I) is isomorphic to the base field, hence the mapf L simply picks out an element of D(X × Y ), which we denote by β f . Similarly for f ′ , g, g ′ .
To verify the uniqueness property, recall that if φ ∈ D(X), then After rearranging the order of integration one can conclude: The left-hand side corresponds to the distribution on X × X with kernel Y β f (x, y)β g (y, x ′ ), and the right-hand side has kernel Z β f ′ (x, z)β g ′ (z, x ′ ). We know that two integrable functions induce the same distribution if and only if they are equal almost everywhere, but since these are smooth functions on X × X, we conclude: Thus we have: And we conclude tr(gf ) = tr(g ′ f ′ ).
Actually, there is a more succinct description of the trace operator in DRel. Since h = gf is nuclear, it has a kernel, α(x, x ′ ). Recall from theorem 6.13 that the formula for α is given by: Hence we may conclude that: We leave the details of the following to the reader. The result is quite similar to the case of DRel.
Theorem 8. 18 The canonical nuclear ideal in PRel is traced.
• Furthermore, if C is a tensored * -category, then the trace must preserve this structure in an evident sense.
Some discussion of our version of the Yanking axiom is in order. The Joyal-Street-Verity version of this axiom is essentially the requirement that the trace of a symmetry morphism is the identity. However, in our framework, one cannot make this requirement since the symmetry map will generally not be in the trace class. In the forthcoming thesis of Haghverdi [35], it is observed that the following requirement is equivalent to the Joyal-Street-Verity version:

Generalized Yanking Rule:
Suppose f : A → U and g: U → B. Then, tr U A,B (c U,B • (f ⊗ g)) = gf : A → B

U-nuclear ideals
As before, we would like to construct trace ideals from nuclear ideals. An analogous construction can be carried out using the notion of a U -nuclear ideal. We now outline this idea, but leave most of the details to the reader. The generalization amounts to introducing the notion of a U -nuclear morphism. We will say that a morphism f : Similarly for the variables A and B. Also there should be a natural bijection of the form: satisfying appropriate equations. For example, the compactness requirement becomes: • (Compactness) Suppose f : A → C ⊗ B and g: B ⊗ D → E. Then we have: If a tensored * -category is equipped with such structure, we will refer to it as a parametrized nuclear ideal.
Given such a construction, one defines the U -trace class I U (A⊗U, B ⊗U ) ⊆ Hom(A⊗U, B ⊗U ) by saying that: if and only if there exist f ∈ N U (A ⊗ U, C), g ∈ N U (B ⊗ U, C) such that h = g * f One then constructs the U -trace of h via the formula: where the components are the evident transposes of f and h. Again, one must add conditions to ensure that the trace satisfies appropriate equations. In particular, we note that with the above axioms, we can only obtain the following weaker version of the yanking axiom: Lemma 8.20 Suppose that C is a tensored * -category equipped with a parametrized nuclear ideal. If f : X → U and g: U → Y are nuclear, then c • (f ⊗ g): X ⊗ U → Y ⊗ U is in the U -trace class, and This is a consequence of the compactness requirement of section 5.

Traces in PInj
We now discuss the traced structure of PInj. First it is evident that unlike in Hilb, we have that I(A) = N (A, A) for all objects A. If f : A → A is a trace map, then we have the following formula: tr(f ) = id if |Dom(f )| = 1, and f is the identity when restricted to its domain. ∅ otherwise The parametrized trace also has a very simple description. We will say that a morphism f : X ⊗ U → Y is U -nuclear if it satisfies: ∀x ∈ X if (x, u) ∈ Dom(f ) and (x, u ′ ) ∈ Dom(f ), then u = u ′ Given this definition, there is an evident bijection N (X ⊗ U, Y ) ∼ = N (Y ⊗ U, X). The class I(X ⊗ U, Y ⊗ U ) is described by having the above requirement for both the domain and codomain. Then we can say that if f ∈ T r(X ⊗ U, Y ⊗ U ), (x, u) ∈ Dom(f ) and f (x, u) = (y, u ′ ), then:

Conclusions
Our investigations began with an attempt to define probabilistic relations in analogy with ordinary relations. Unexpectedly, ideas from functional analysis [33] were essential. The key idea, expressed in our abstract definition of nuclear ideals, is that certain morphisms can be thought of as behaving like "matrices". Our work naturally follows on from the development of Higgs and Rowe [37], the fundamental difference being that we have no closed structure. Crudely speaking, Higgs and Rowe generalize Banach space theory while we generalize Hilbert space theory.
A key application of our work is that we can now work with structures that are not categories but which are nuclear ideals inside some tensored * -category. For example, the nuclear ideal MRel, described in Section 7, is of interest but is not a category. (As an example of its possible applications, we note that MRel has partially additive structure [45,35].) However, MRel is indeed a nuclear ideal in PRel.
An important open question is the computational significance of trace ideals. It is already well-established that a trace structure can be used to model feedback in denotational semantics [40,36]. But what can be said when one only has these operations on an ideal? The geometry of interaction program, due to Girard [31], can be used to obtain a compact closed category from a traced monoidal category [2,3,40]. It seems possible that a similar construction applied to a category with a traced ideal will give a nuclear ideal.
Another area of application of the theory of compact closed categories is topological quantum field theory [8,9], which evolved, in part, from Segal's work on conformal field theory [53]. In topological quantum field theory, one considers a compact closed category of cobordisms in which composition is defined by gluing along boundaries. Then a TQFT is given by a compact closed functor to the compact closed category of finite-dimensional Hilbert spaces. In Segal's formulation of conformal field theory, one works with arbitrary Hilbert spaces and a similar "category" of Riemann surfaces with boundary. This structure is essentially a compact closed category, except that it fails to be a category in that it lacks identity morphisms. Thus it seems reasonable to suspect that it is a nuclear ideal in some larger ambient tensored * -category. One of our goals in future work will be to find such a category. A conformal field theory would then be a nuclear functor to the tensored * -category Hilb.
A related issue is the extension of our work to higher-dimensional categories. The theory of n-Hilbert spaces [11], a higher-dimensional analogue of Hilbert space, has become quite important in TQFT [10]. Baez has developed the theory of 2-Hilbert spaces with this in mind, and extended some of the work of Doplicher and Roberts to this setting [23].
Finally, the category DRel suggests several further topics of investigation. One possible extension of DRel is to the theory of noncommutative distributions [5]. Roughly speaking, these are distributions which take values in a Lie group. They are useful in the representation theory of gauge groups. Finally, we hope to take advantage of the fact that distributions form a D-module, that is to say they provide representations of the Weyl algebra [20]. It would be interesting to attempt to extend the work of [16,17], where full completeness theorems are obtained by considering representations of the additive group of integers and a noncocommutative Hopf algebra.