Abstract 1 Introduction 2 Riesz spaces 3 Models of linear logic 4 Probabilistic coherence spaces and Banach lattices 5 Categories of Cones and 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 6 A Probabilistic Calculus 7 Related work 8 Conclusion References Appendix A A Metalanguage for Linear Operators and Markov Kernels Appendix B Proof of Lemma 38 Appendix C Proof of Theorem 50 Appendix D Proof of Theorem 57 Appendix E Proof of Theorem 60

Classical Linear Logic in Perfect Banach Lattices

Pedro H. Azevedo de Amorim ORCID Oxford University, UK Leon Witzman ORCID Nanyang Technological University, Singapore Dexter Kozen ORCID Cornell University, Ithaca, NY, USA
Abstract

In recent years, researchers have proposed various models of linear logic with strong connections to measure theory, with probabilistic coherence spaces (𝐏𝐂𝐨𝐡) being one of the most prominent. One of the main limitations of the 𝐏𝐂𝐨𝐡 model is that it cannot interpret continuous measures. To overcome this obstacle, Ehrhard has extended 𝐏𝐂𝐨𝐡 to a category of positive cones and linear Scott-continuous functions and shown that it is a model of intuitionistic linear logic. In this work we show that the category 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 of perfect Banach lattices and positive linear functions of norm at most 1 can serve the same purpose, with some added benefits. We show that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a model of classical linear logic (without exponential) and that 𝐏𝐂𝐨𝐡 embeds fully and faithfully in 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 while preserving the monoidal and -autonomous structures. Finally, we show how 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 can be used to give semantics to a higher-order probabilistic programming language.

Keywords and phrases:
Probabilistic Semantics, Linear Logic, Categorical Semantics
Funding:
Pedro H. Azevedo de Amorim: Pedro H. Azevedo de Amorim was funded by the National Science Foundation under grant CCF-2008083. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
Dexter Kozen: Dexter Kozen was funded by the National Science Foundation under grants AitF-1637532, SaTC-1717581, and CCF-2008083. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the authors and do not necessarily reflect the views of the National Science Foundation.
Copyright and License:
[Uncaptioned image] © Pedro H. Azevedo de Amorim, Leon Witzman, and Dexter Kozen; licensed under Creative Commons License CC-BY 4.0
2012 ACM Subject Classification:
Theory of computation Categorical semantics
; Theory of computation Linear logic ; Theory of computation Denotational semantics ; Theory of computation Probabilistic computation
Acknowledgements:
The authors would like to thank Raphaëlle Crubillé, Christine Tasson, Thomas Ehrhard and Fredrik Dahlqvist for lively discussions on the subject. We would also like to thank Arthur Azevedo de Amorim and Michael Roberts for reading an earlier draft of this work.
Editors:
Jörg Endrullis and Sylvain Schmitz

1 Introduction

Recent work has shown that linear logic has deep connections to the semantics of probabilistic programming languages [8, 13, 10, 12, 11, 25, 9, 19, 7]. By using monoidal closed categories instead of cartesian closed categories, linear logic provides an alternative categorical framework for higher-order functions. This was foreshadowed in early work on probabilistic semantics [20] in which bounded linear operators on Banach lattices were used to interpret a first-order imperative probabilistic programming language. This can be seen as evidence that a linear approach might be a natural alternative to cartesian closed categories.

Since then, many probabilistically-flavored models of linear logic have appeared. For instance, the connection between the early work of Kozen [20] and linear logic has been recently made precise by Dahlqvist and Kozen [7], where the category of regular ordered Banach spaces and regular maps (𝐑𝐨𝐁𝐚𝐧) was used to extend the semantics of Kozen [20] with higher-order functions. They also showed that 𝐑𝐨𝐁𝐚𝐧 is a model of intuitionistic linear logic.

An appealing aspect of the 𝐑𝐨𝐁𝐚𝐧 model is that ordered Banach spaces are mathematically well-understood objects with a well-developed classical theory, thus providing a plethora of useful theorems to reason about programs. This is illustrated by Dahlqvist and Kozen [7] by using results from ergodic theory to prove the correctness of a Gibbs sampling algorithm implemented in a higher-order language. However, the programming model supported by the semantics is somewhat brittle, in that the soundness of the system depends on a tricky interaction between three different type grammars with several syntactic restrictions.

A different approach was taken by Ehrhard and Danos [8], in which a category 𝐏𝐂𝐨𝐡 was defined and shown to be a model of classical linear logic. The model was used to interpret a version of PCF extended with discrete probabilities [13]. Although this category handles discrete probabilities very nicely, it cannot interpret continuous distributions such as the normal distribution over , a severe limitation for real-world applications. To remedy this, a category of positive cones with measurability paths and linear Scott-continuous functions 𝐂𝐋𝐢𝐧m has recently been introduced and shown to be a conservative extension of the intuitionistic fragment of 𝐏𝐂𝐨𝐡 [6].

From a programming point of view, the language of Ehrhard et al. [12] is an extension of the simply typed λ-calculus with recursion, making it a simple and expressive programming model. However, the definition of positive cone with measurability paths deviates from standard objects from the probability literature and thus would require a large amount of mathematical effort to rephrase useful theorems that could be used to reason about programs.

Although these previous approaches are valuable contributions to our understanding of higher-order probabilistic programming through linear logic, missing up to now is a comprehensive model that embodies the following desirable aspects:

  • extends 𝐏𝐂𝐨𝐡 to admit continuous measures;

  • is a model of classical (not just intuitionistic) linear logic, thus allowing it to handle other computational interpretations of linear logic such as session types;

  • has a simple and expressive programming model that can handle higher-order computation;

  • is based on well-understood classical structures from measure theory and functional analysis.

In this paper we propose such a model. Our model extends 𝐏𝐂𝐨𝐡 with continuous probabilities and satisfies all of the properties above. Our model is based on complete normed vector lattices, called Banach lattices. To accommodate the second point, we work with spaces with an involutive linear negation, the so-called perfect spaces.

Compared to previous models, our model has simpler tensor product, which we believe lead to a more perspicuous and theoretically satisfying generalization of 𝐏𝐂𝐨𝐡. For example, we invite a comparison with 𝐂𝐋𝐢𝐧m, where the construction rely on categorical machinery which, though elegant, are indirect.

Most importantly, Banach lattices can be seen as an abstraction of ordinary measure spaces and are well-studied in functional analysis, with many results from measure theory holding for certain classes of Banach lattices. There is a vast literature on the subject; see Fremlin [14] for a thorough introduction.

In order to justify the viability of our model, we show that it can be used to interpret a recently introduced higher-order probabilistic calculus [2], and we extend the core calculus with recursion.

Summary of contributions

  • In §3, we define the category 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 of perfect Banach lattices and order-continuous positive linear operators with norm at most 1 and show that it is a model of classical linear logic.

  • In §4, we show that there is a full and faithful monoidal closed functor 𝐏𝐂𝐨𝐡𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏. This is a more adequate extension than the model 𝐂𝐋𝐢𝐧m proposed by Ehrhard [11], since it also accommodates the classical aspects of the linear structure of 𝐏𝐂𝐨𝐡.

  • In §5, we show that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is isomorphic to a category of lattices of positive complete cones.

  • In §6, we show that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a model to the recently defined calculus by Azevedo de Amorim [2].

Our work contributes both to the study of quantitative models of linear logic as well as to a deeper understanding of higher-order probability theory, shedding light on the importance of linear logic as a vehicle to interpret higher-order programs without cartesian closure.

2 Riesz spaces

Our model depends on technical definitions and constructions from the vector lattice literature. This section contains a brief self-contained presentation of the subject. We point the interested reader to introductory texts [1, 26] for good presentations of much of the material presented in this section.

Although we are primarily interested in Banach lattices – normed vector lattices with a completeness property – we start by defining the objects in the general unnormed case.

Definition 1.

Let +={a|a0}. A Riesz space is a partially-ordered vector space (V,) over such that

  • if xy, then x+wy+w;

  • if xy, then αxαy for α+; and

  • it is an upper semilattice with respect to with join operation .

It follows that the space is also a lattice with meet operation xy=(xy).

Many standard vector spaces are Riesz spaces.

Example 2.

The following are Riesz spaces:

  • n with the pointwise ordering;

  • the set of bounded sequences of real numbers with pointwise ordering;

  • the set of signed measures on a measurable space;

  • the set of bounded measurable functions on a measurable space.

Unlike the real numbers, there are elements that are neither negative nor positive, but a notable characteristic of Riesz spaces is that every element decomposes uniquely into its positive and negative parts.

Definition 3.

For v an element of a Riesz space, define v+=v0, v=(v)0 and |v|=vv=v++v.

Then v+ and v are the unique positive elements such that v=v+v and v+v=0. Thus Riesz spaces are completely characterized by their positive elements. This often simplifies constructions, as one can often prove a property for the positive elements, then extend to the entire space using this decomposition.

Given a Riesz space V, let V+ denote the set of positive elements of V. Using the decomposition property mentioned above, it follows that V=V+V+, where applied to sets denotes elementwise subtraction.

2.1 Order convergence

Every topology gives rise to a notion of convergence. For normed spaces, one usually studies convergence in the norm topology. However, ordered spaces also carry an order topology.

Definition 4.

Let D be a directed set and V a Riesz space. A net {vα}αD is a function DV. We say that the net is increasing (respectively, decreasing) and write {vα} (respectively, {vα}) if αDβ implies vαVvβ (respectively, vαVvβ).

Definition 5.

Given a decreasing net {xα}, we write {xα}0 if inf{xα}=0.

Definition 6 (Order convergence).

We say that a net {xα} converges in order to x and write xα𝑜x if there is a decreasing net {yα}0 such that for all α, |xαx|yα.

In general, this notion of convergence is neither weaker nor stronger than convergence in the norm topology. However, when a net converges in both order and norm, it converges to the same value in both. When it is clear from the context, we will denote order convergence as .

2.2 Riesz subspaces, solids, ideals and bands

In the theory of Riesz spaces, there are classes of subspaces that have many interesting properties that will be used in our constructions.

Definition 7.

A subset S of a Riesz space is

  • solid if xS and |y||x| implies yS,

  • an ideal if it is a solid linear subspace,

  • a band if it is an ideal and closed under existing suprema.

Definition 8.

We say that a Riesz space V is Archimedean if for every vV+, {v/n}n0. Furthermore, if every bounded subset of V admits a supremum, then we say that V is Dedekind complete.

Proposition 9.

Every band in a Dedekind complete Riesz space is Dedekind complete.

Definition 10.

A Riesz subspace AV is said to be order dense if for every element 0<vV there is an element aA such that 0<av.

Theorem 11 ([1, Theorem 1.34]).

A Riesz subspace A is order dense in an Archimedean Riesz space V iff for every vV+,

{aA| 0av}v.

2.3 Order-continuous functions

As usual when studying vector spaces with extra structure, we care only about linear maps that interact nicely with the extra structure. In our case, the linear functions will have to respect the partial order.

We call a linear function f:VW positive if it maps positive elements of V to positive elements of W; that is, it restricts to a function V+W+. A linear function is regular if it can be written as the difference of two positive functions.

Definition 12.

A linear function T:VW between Riesz spaces V and W if Tvα𝑜Tv whenever {vα} is an increasing net with supremum v.

We can also characterize the positive order-continuous functions as those that preserve existing suprema and infima.

Order continuity interacts well with order density. Indeed, it is possible to show using Theorem 11 the following lemma

Lemma 13.

If V is an Archimedian Riesz space and f,g:VW are two linear order-continuous functions that agree on an order-dense subset of V, then f=g.

This lemma will come in handy when constructing our model. Furthermore, the space of order-continuous linear functions on certain Riesz spaces are well-behaved subsets of the regular linear functions.

Theorem 14 ([1, Theorem 1.57]).

If W is Dedekind complete, then the set of order-continuous linear functions VW is a band in the space of regular functions, thus forms a Dedekind-complete Riesz space.

Proof.

The Riesz space structure is given by Theorem 1.18 of Aliprantis and Burkinshaw [1].

Definition 15.

A Riesz space is separated if for every distinct pair v1,v2V, there exists an order-continuous linear functional f:V such that f(v1)f(v2).

2.4 Normed Riesz spaces

Now we will introduce normed Riesz spaces. In the context of probabilistic semantics, the norm plays an important role, as it can be used to distinguish between arbitrary measures and (sub)-probability distributions, the measures with norm at most 1.

Definition 16.

Let V be a real vector space. A norm is a function :V+ such that:

  • v=0 iff v=0

  • αv=|α|v

  • v+uv+u.

For Riesz spaces, we require the norm to satisfy the additional property

|v||u| implies vu.

If the Riesz space is also complete with respect to the norm, we call it a Banach lattice. In vector space models of linear logic, the norm is typically used to distinguish between the product & and the coproduct , as they both have the same underlying set, but distinct norms. However, in the context of program semantics, the norm also has the extra role of allowing the interpretation of recursive programs.

Example 17.

The set () of signed measures over the Borel σ-algebra on is a Riesz space (cf. Section 2.6). We can equip it with the total variation norm μ=μ+()+μ().

Theorem 14 shows that by assuming the right amount of structure on the Riesz space, the set of order-continuous linear functions between Riesz spaces also has a lattice structure. It is not immediately clear whether this result generalizes to the normed case. Luckily, Dedekind completeness is once again enough.

Example 18.

Let V and W be normed Riesz spaces with W Dedekind complete. The set of order-continuous linear functions VW can be equipped with the regular norm

Tr=supxV1|T|(x)W

where |T| is given by Theorem 14 and Definition 3.

Definition 19.

Let V be a normed Riesz space. The closed unit ball of V is the set (V)={vV|v1}.

Banach lattices

Banach lattices are normed Riesz spaces that are also Banach spaces. In the usual categorical study of Banach spaces, the relevant morphisms are the norm-continuous linear functions.

Definition 20.

A linear function f between normed Riesz spaces V and W is said to be norm-continuous (or norm-bounded) if supv(V)f(v) is finite.

Since we are interested in spaces with two distinct structures, a partial order and a norm, it is not immediately clear which class of morphisms one should care about. In general, the space of all norm-continuous linear functions between Banach lattices is not a Banach lattice, making them unable to give semantics to linear implication.

Normed Riesz spaces are also problematic, as not every order-continuous function is norm-continuous, making it unclear how one would equip the space of order-continuous functions with a norm. However, if the codomain is a Banach lattice, then every order-continuous linear function is also norm-continuous [1]. This suggests that one should work with Banach lattices but only use order-continuous linear functions.

Definition 21.

The category 𝐁𝐚𝐧𝐋𝐚𝐭𝟏 has separated Banach lattices as objects and order-continuous positive linear functions of norm at most one as morphisms.

These objects have been widely studied in functional analysis, being influential in the linear operator approach to measure theory [14]. A subtlety when working with a norm and a partial order is that there are two distinct notions of convergence in play that on the surface appear only tenuously related. However, a useful property has been identified in the literature that brings some harmony between the two.

Definition 22.

A normed Riesz space is said to satisfy the (sequential) weak Fatou property if every norm-bounded monotone (sequence) net has a supremum.

In the context of program semantics, the sequential version of this property has been used before to interpret recursive programs [8, 12].

Lemma 23.

Let f:VV be a positive order-continuous function (not necessarily linear) such that f((V))(V). If V satisfies the weak Fatou property, then f admits a fixpoint.

Proof.

It can be directly shown that the limit of the ω-chain {fn(0)}n is a fixpoint of f. Note that when f is linear, the theorem is trivially true, since f(0)=0.

Lemma 24 ([14, Lemma 354B(d)]).

Every band in a Banach lattice is a Banach lattice.

Theorem 25.

If V and W are Banach lattices, then the set of order-continuous linear functions between V and W is a Banach lattice.

Proof.

The proof is a direct consequence of Banach lattices being Dedekind complete – e.g. Fremlin [14, Proposition 354E(e)] – and the space of order-continuous being a band in the space of regular linear functions.

2.5 Dualities

The category 𝐁𝐚𝐧𝐋𝐚𝐭𝟏 seems to be a good candidate in which to interpret intuitionistic linear logic. However, since the linear negation connective () is usually interpreted as the linear dual V in models of linear logic based on vector spaces over , 𝐁𝐚𝐧𝐋𝐚𝐭𝟏 would not be able to model classical linear logic, since there are examples of Banach lattices that are not isomorphic to their bidual, e.g. summable real sequences.

A recurring challenge in models of linear logic is to make an involutive linear negation – typical of finite-dimensional spaces – coexist with !V, which requires infinite-dimensional spaces. Since we are interested in defining a model of classical linear logic, we should only work with Riesz spaces that are isomorphic to their bidual.

Definition 26.

Let Vσ denote the space of order-continuous functionals V. A Riesz space V is said to be perfect if the map σV=λxf.f(x):VVσσ is an isomorphism.

We will write σ for σV when V is clear from context.

Definition 27.

The category 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 has perfect Banach lattices as objects and positive order-continuous linear functions of norm at most one as morphisms.

Although the definition of perfect spaces is simple, it is difficult to manipulate in practice. The following theorems provide some alternative characterisations, both in the normed and unnormed cases:

Theorem 28 ([21, Theorem 41.4, Volume XIII]).

Let V be a separated normed Riesz space. Then V is perfect and Banach iff V has the weak Fatou property.

Theorem 29 ([1, Theorem 1.71]).

A Riesz space V is perfect iff

  • it is separated;

  • whenever 0{xα}α:D and supα:D{f(xα)}α:D< for all positive fVσ and directed set D, there exists xV such that 0{xα}α:Dx.

Corollary 30.

Bands of perfect Riesz spaces are also perfect.

Lemma 31.

Every perfect Riesz space is Dedekind complete.

Proof.

The proof follows from the second condition of Theorem 29.

Lemma 32.

Every Riesz space of the form Vσ is perfect.

Proof.

To show the first point of Theorem 29, assume that f1f2Vσ. Then there is vV such that f1(v)f2(v). Using the fact that λf.f(v) is an element of Vσσ, we can conclude that Vσ is separated. For the second point, let us assume that 0{fα} and that for all FVσσ, if F0, then supαF(fα)<. From this hypothesis, it follows that for all vV, if v0, then supαfα(v)=supασ(x)(fα)<. This means that the function f(x)=supαfα(x) is well-defined, linear, and order-continuous. By Lemma 1.18 in Aliprantis and Burkinshaw [1], Vσ is Dedekind complete and f bounds fα.

An interesting fact that is not obvious from the definitions is that the bidual of Riesz spaces can be seen as a sort of completion procedure. We formalize this claim using adjunctions, but first we need a lemma.

Lemma 33 ([1, Theorem 1.70]).

Let V be an Archimedean Riesz space. The set σ(V) is an order-dense Riesz subspace of Vσσ.

Theorem 34.

The functor ()σσ:𝐁𝐚𝐧𝐋𝐚𝐭𝟏𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is left adjoint to the forgetful functor U.

Proof.

We observe that if f:VW, then σ1fσσ:VσσW. In the other direction, if we have a function f:VσσW, we can consider its restriction fV:VW. To show that these operations are inverses, we use Theorem 11 and Lemma 33, which allow us to show that if two order-continuous functions agree on σ(V), then they agree everywhere.

Note that this implies that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a reflective subcategory of 𝐁𝐚𝐧𝐋𝐚𝐭𝟏, which means that it is closed under the same (co)limits that exists in 𝐁𝐚𝐧𝐋𝐚𝐭𝟏, c.f. Borceux [3, Section 3.5].

2.6 Signed measures as Riesz spaces

Measures are usually defined as countably additive, nonnegative real-valued functions on a σ-algebra. Signed measures provide a slight generalization by dropping the requirement of nonnegativity.

Definition 35.

Let (X,Σ) be a measurable space. A signed measure is a function μ:Σ such that μ()=0 and μ(iAi)=iμ(Ai) for disjoint sets (Ai)i. The infinite series on the right hand side must converge absolutely.

An important difference between ordinary measures and signed measures is that signed measures come equipped with a natural vector space structure. Indeed, it can be shown that signed measures are perfect Riesz spaces.

Lemma 36.

Let (X,Σ) be a measurable space. The space (X,Σ) of signed measures is a normed Riesz space.

Proof.

The vector space structure is defined pointwise with lattice structure defined by μν=(μν)++ν using the Hahn-Jordan decomposition and the norm is the total-variation norm.

When a measure μ is positive, its total variation norm is its total mass μ(X).

Theorem 37.

Let (X,Σ) be a measurable space. The space (X,Σ) of signed measures with the total variation norm is a perfect Banach lattice.

Proof.

The proof follows by applying Theorem 28, the lemma above and observing that since the order of measures is given pointwise, you can define their suprema pointwise as well.

3 Models of linear logic

The categorical semantics of linear logic is very well understood; see Mellies [22] for an overview. In this section, we show that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a model of classical linear logic.

3.1 Symmetric Monoidal Closed Structure

In order for 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 to interpret the multiplicative fragment of linear logic, i.e. give semantics to a linear λ-calculus with tensors, it must be a symmetric monoidal closed category. Concretely, it needs a monoidal product such that for every object A, the functor A has a right adjoint A, known as linear implication.

For models based on vector spaces, the monoidal product is typically given by the tensor product. For such models, linear implication has a natural interpretation in terms of linear functions. Furthermore, since our spaces are perfect, we have an involutive linear negation A defined as the space A, and, in models of classical linear logic, the equation AB=(AB) holds. Thus the tensor product can be defined in terms of linear implication and negation in such models.

Note that this circumvents one of the main complications with the model of Ehrhard [11], where the existence of a suitable monoidal product is established non-constructively using a categorical density argument.

3.1.1 Internal Homs

Since the category 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 has order-continuous linear functions with norm at most 1 as morphisms, it makes sense to define the internal hom object VW as the space of order-continuous linear functions between perfect Banach lattices V and W. This definition is justified by the following theorem.

Lemma 38 (c.f. Appendix B).

If V and W are perfect Riesz spaces, then the set of order continuous linear functions VW is a perfect Riesz space.

From Theorem 25 and the theorem above, it follows that if V and W are perfect Banach lattices, then so is VW. By using standard techniques from the literature on vector models of linear logic, we have

Theorem 39.

The operation :𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏op×𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is functorial.

3.1.2 Monoidal structure

As mentioned above, the monoidal structure on vector space models of linear logic is usually defined as a tensor product, and monoidal closure is obtained from the universal property of tensor products. The usual recipe for defining tensor products is to use a free construction modulo the tensor product equations. When working with infinite-dimensional spaces, a completion procedure may be required as well.

Indeed, this is the approach taken by Fremlin [15], in which a tensor product is defined for perfect Riesz spaces via a more traditional construction using the completion of the algebraic tensor product. It is also shown by Fremlin [15] that VW(VW), meaning that their construction is isomorphic to ours.

In contrast, our construction starts with the definition VW(VWσ)σ, as required by the laws of linear logic. We then show that it satisfies the expected universal property of tensor products: for every biliear function f:V×WY, there is a unique linear function f^:VWY such that f^ι=f, where ι:V×WY is the bilinear inclusion function.

We show this using the fact that the internal hom can be used to classify bilinear functions using V(WY), then showing that this space is isomorphic to VWY.

Lemma 40.

VWYVWY.

Proof.

If V and W are perfect Riesz spaces, then VWWσVσ. Then

VWY=(VWσ)σY
Yσ(VWσ)VYσWσ
VWY.  

Theorem 41.

VW, defined as (VWσ)σ, satisfies the universal property of tensor products.

Proof.

Observe that the set of (norm bounded) bilinear order-continuous functions V×WY is (isometrically, in the normed case) isomorphic to VWY. We must now show VWYVWY. This is exactly Lemma 40.

Using the universal property of tensor products and the (easy to prove) facts that V(WY)(VW)Y and VWWV, we can conclude:

Theorem 42.

𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a symmetric monoidal closed category.

It is difficult in general to give an intuitive characterization of the elements of a tensor product. This is also the case with our construction. Nevertheless, in the context of measures, we can give some intuition for the elements of (A)(B). Let μA and μB be probability distributions on measurable spaces A and B, respectively. The product distribution μAμB is the joint probability distribution on A×B with marginals μA and μB obtained by sampling μA and μB independently. This is an element of (A)(B), but there are also other joint distributions in (A)(B) that do not represent independent samples. For example, let A=B={0,1} and consider the joint distribution 12(δ0δ0+δ1δ1). Sampling this distribution returns (0,0) or (1,1), each with probability 1/2, so the two components are clearly not independent.

In general, not every joint distribution is an element of the tensor product, as explained by Dahlqvist and Kozen [7]. From a programming point of view, the universal property of tensor products says that the behavior of a program taking inputs of type (A)(B) is fully characterized by independent distributions over A and B.

3.2 -autonomous categories

Classical linear logic differs from its intuitionistic variant by requiring that linear negation be involutive, that is, A=A for every formula A. Categorically, this is modeled by -autonomous categories, symmetric monoidal closed categories 𝐂 with a functor ():𝐂op𝐂 such that every object A is naturally isomorphic to A and for every three objects A, B, C, there is a natural bijection Hom(AB,C)Hom(A,(BC)). Equivalently, a -autonomous category is a symmetric monoidal closed category 𝐂 equipped with a dualizing object such that for every object A, the unit A:A(A) is an isomorphism.

In our case, the dualizing object is , the unit is the linear function σV:VVσσ, and the isomorphism holds by assumption.

Theorem 43.

𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a -autonomous category.

3.3 Cartesian and co-Cartesian structure

Cartesian and co-Cartesian structure are useful in the formation of product and sum types. In models of linear logic, these are represented by linear conjunction & and disjunction , respectively. In 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏, both operations have V×W as their underlying set with lattice operations defined componentwise. In the normed case, we can distinguish them by choosing different norms.

Definition 44.

Let V and W be normed Riesz spaces. We define

  • the product V&W=(V×W,sum), where (v,w)sum=v+w.

  • the coproduct VW=(V×W,max), where (v,w)max=max(v,w).

Since convergence for both is defined componentwise, by using Theorem 28 we can show that if V and W are perfect and Banach, then V&W and VW are as well. The unit for the product and 0 for the coproduct are both the trivial Riesz space {0}.

Theorem 45.

𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is (co-)Cartesian.

4 Probabilistic coherence spaces and Banach lattices

Probabilistic coherence spaces (PCS) [8] are a model of linear logic with a vector space flavor. It has been shown by Ehrhard [11] that its intuitionistic fragment can be fully and faithfully embedded in a category of positive cones. In this section, we show that Banach lattices, contrary to previous work [11], extends the -autonomous structure of the category of probabilistic coherence spaces as well as its symmetric monoidal closed structure. We make use of the vector space construction presented in the original paper [8].

Definition 46.

A Probabilistic Coherence Space (PCS) is a pair (|X|,𝒫(X)), where |X| is a countable set and 𝒫(X)|X|+ called the web such that:

  • a|X|εa>0εaδa𝒫(X), where δa(a)=1 iff a=a and 0 otherwise;

  • a|X|λax𝒫(X)xaλa;

  • 𝒫(X)=𝒫(X), where 𝒫(X)={x|X|+|v𝒫(X)aXxava1}.

Definition 47.

Let (|X|,𝒫(X)) be a PCS. Its linear negation is the PCS (|X|,𝒫(X)).

Definition 48.

Let (|X|,𝒫(X)) and (|Y|,𝒫(Y)) be PCSs. The PCS XY is the pair (|X|×|Y|,𝒫(XY)), where P(XY))={M:|X|×|Y|+|v𝒫(X)Mv𝒫(Y)}, where (Mv)(y)=x:XM(x,y)v(x).

The intuition behind Definition 46 is that the web of every PCS corresponds to the positive unit ball of a partially-ordered vector space. This idea is used by Ehrhard and Danos [8] to define a functor that maps every PCS to a Banach space. It is possible to show that this vector space can be equipped with a Riesz space structure, where the order is defined pointwise.

Definition 49.

Given a PCS (|X|,𝒫X), we define BX={u|X|||u|𝒫X} and eX=λ>0λBX. The pair (eX,usupu𝒫X|u|,u) is the normed Riesz space associated with the PCS (|X|,𝒫X).

It is shown by Ehrhard and Danos [8] that eX is a Banach space. Furthermore, the lattice structure can be defined pointwise, making eX a Banach lattice. Later in this section we will show that e can be made into a functor.

𝐏𝐂𝐨𝐡 and duality

In this section we show that the functor e preserves the -autonomous structure of 𝐏𝐂𝐨𝐡.

Theorem 50 (c.f. Appendix C).

For every probabilistic coherence space X, there is a natural isomorphism e(X)e(X)σ.

Corollary 51.

For every PCS (|X|,𝒫(X)) the vector space eX is a perfect Banach lattice.

Since convergence for PCS is defined componentwise, it is possible to use a similar proof technique to show

Theorem 52.

The operation e is monoidal closed and functorial.

Proof.

The functoriality of e has been proven in Section 5.1 of Ehrhard and Danos [8]. The proof of preservation of monoidal closure is similar to the proof of Theorem 50. Another important theorem which is direct to show is.

Theorem 53.

The functor e:𝐏𝐂𝐨𝐡𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is full and faithful.

5 Categories of Cones and 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏

Even though 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a mathematically natural model of linear logic, it relies on tools from functional analysis not usually familiar to computer scientists. On the other hand, in recent years, cones have found numerous applications in semantics of programming languages and logics [12, 6, 23, 18]. In this section we show that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is isomorphic to a category cones, meaning that computer scientists can translate their intuitions about cones to this novel setting without having to learn functional analysis.

As it was frequently mentioned throughout this paper, every Banach lattice gives rise to a positive cone. Furthermore, since every 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 morphism f:VW is positive and has norm at most 1, it restricts to a linear function (V)+(W)+. With this observations we state a few definitions from previous work [6, 11], which assume that the cones are separated.

Definition 54 (cf. [12, Definition 4.1]).

A cone C is a +-semimodule with a norm :C+ such that it satisfies the cancellation property x+y1=x+y2 implies y1=y2, for every points x, y1 and y2.

Every cone can be equipped with the partial order xy if and only if there is a z such that x+z=y, meaning that it is possible to define a partial subtraction operation whenever xy, calling yx the element such that x+(yx)=y.

A function f:C1C2 between cones is linear if it commutes with addition and scalar multiplication, it is monotonic if it preserves the order relation, and it is Scott-continuous if for every directed set xα with supremum x, supαf(xα)=f(x). As is the case with partially-ordered vector spaces, there are different classes of cones where the order and the norm have particular properties:

Definition 55.

A cone C is said to be:

  • Sequentially complete if every norm-bounded sequence has a least upper bound.

  • Directed complete if every norm-bounded directed set has a least upper bound.

  • A lattice cone if the poset structure is a lattice.

Using this notation, it seems appropriate to imagine that there should be a functor 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏𝐂𝐋𝐚𝐭, where 𝐂𝐋𝐚𝐭 is the category of directed complete cone lattices. It is unclear, however, if there is a mapping on morphisms. Luckily, the lemma below guarantees that the mapping is well-defined. Its proof follows from the weak Fatou property.

Lemma 56.

Let V and W be two perfect Banach lattices and f:VW a linear, positive function of norm at most 1. The function f is order-continuous if and only if supxAf(x)=f(v) whenever AV+ is a non-empty upwards-directed set with supremum v.

Since the mapping on morphisms is basically the identity, the functorial laws hold, which allows us to conclude that there is a functor 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏𝐂𝐋𝐚𝐭.

Next, we would like to map every positive cone to a vector space. Let C be a positive cone and define CC={(c1,c2)|c1,c2C}/, where is the binary relation (c1,c2)(c3,c4) iff c1+c4=c2+c3. Intuitively, CC corresponds to the vector space of formal differences c1c2 of elements in C. The equivalence relation is used to capture the fact that, for instance, (3,2) and (4,3) should represent the same real number, since 32=1=43.

Theorem 57 (c.f. Appendix D).

Let C be a directed complete cone lattice. Then CC is a perfect Banach lattice.

By linearity, Scott-continuous functions f:CD with norm at most 1 extend to order-continuous functions f:(CC)(DD) with norm at most 1 and we can prove that there is a functor 𝐂𝐋𝐚𝐭𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏. With this functor and the positive cone restriction functor defined, it is a direct calculation to show:

Theorem 58.

The categories 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 and 𝐂𝐋𝐚𝐭 are isomorphic.

Figure 1: Terms and Types of λMKLL.

6 A Probabilistic Calculus

Though it is theoretically interesting understanding how 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 relates to existing models of linear logic, we are also interested in using it as a semantic basis for a language with probabilistic primitives. Being symmetric monoidal closed, it can give semantics to the linear λ-calculus. This, however, is insufficient from a programming point of view. The linearity restrictions are severely limiting in terms of which programs one can define in this language. A frequently used solution to this lack of expressivity is to use the exponential modality, where the coKleisli category is Cartesian closed, meaning that it can interpret the λ-calculus.

However, even though we have not defined a linear logic exponential in 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏, we can still get non-linear programming by using recent work [2] that proposes a new syntax for programming with linear operators and Markov kernels. The proposed two-level calculus allows for non-linear programs to be defined by using a lax-monoidal modality.

The 𝝀𝑴𝑲𝑳𝑳 metalanguage

The semantic structure used to interpret the calculus of Azevedo de Amorim [2] is given by a triple (𝐂,𝐋,), where 𝐂 is roughly a category of Markov kernels111a CD category, to be more precise, 𝐋 is a symmetric monoidal closed category and :𝐂𝐋 is a lax monoidal functor.

This two-level structure manisfests itself at the syntactic level by having a two-level syntax: the first level is used to program kernels while the second one serves as a kind of metalanguage that has access to higher-order functions, both of which are depicted in Figure 1, The linear language has linear function types, which allows for higher-order programming and, unlike most languages based on linear logic, it has a modality , which corresponds to the types that may be sampled from. The variables bound by the linear context are, roughly speaking, computations. In the language for kernels there are no linearity restrictions and, therefore, variables, i.e. samples from distributions, can be freely duplicated and discarded. Under this perspective, the variables in MK programs should be thought of as values. The intuition behind this language is that linearity forbids distributions to be sampled more than once, but once you have the sample in hands, it can be used as many times as you want.

Each layer has its own typing judgement relations LL and MK, which we go over in more detail in Appendix A. We highlight one of the most interesting rules; it is the rule that allows programs to be transported between layers:

Operationally, it samples from n LL programs {ti}i, each sample is bound to the corresponding variable in {xi}i and finally the continuation M is executed.

We want to model λMKLL with 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏. For that we still need a CD category and a lax monoidal functor. For the CD category we will use the category of measurable spaces and sub-Markov kernels.

Definition 59.

The category 𝐬𝐒𝐭𝐨𝐜𝐡 has measurable spaces as objects and sub-Markov kernels as morphisms, i.e. measurable functions between a measurable space and the space of subprobability distributions over a measurable space.

𝐬𝐒𝐭𝐨𝐜𝐡 is a CD category, which means that it is symmetric monoidal, with the monoidal product being the product measurable space.

Theorem 60 (c.f. Appendix E).

There is a lax monoidal functor :𝐬𝐒𝐭𝐨𝐜𝐡𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏.

This means that the triple (𝐬𝐒𝐭𝐨𝐜𝐡,𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏,) is a λMKLL model.

7 Related work

There have been a number of semantics of linear logic based on vector space-like objects. Two important families of such semantics are the ones based on probabilistic coherence spaces and the ones based on Banach spaces. As we will explain below, we see our model as a nice synthesis of these two approaches.

Positive Cone Semantics of Linear Logic

To overcome the limitation that 𝐏𝐂𝐨𝐡 cannot represent continuous distributions, Ehrhard et al. define a cartesian closed category 𝐂𝐒𝐭𝐚𝐛𝐦 [12], which uses normed +-semimodule – which are in correspondence with positive cones of partially ordered vector spaces – to interpret a probabilistic variant of PCF with continuous distributions. In a follow-up paper, Ehrhard [11] has defined a category 𝐂𝐋𝐢𝐧𝐦 of sequentially complete positive cones with measurability paths and linear Scott continuous maps in which 𝐏𝐂𝐨𝐡 embeds fully and faithfully.

A similar approach was taken by Slavnov [24], who defined a category 𝐂𝐂𝐨𝐧𝐞𝐬 of so-called coherent cones and linear contractive functions and showed that it is a model of classical linear logic. These cones come equipped with a different notion of completeness that is stronger than sequential completeness but weaker than ours.

From a mathematical point of view, the objects of both 𝐂𝐂𝐨𝐧𝐞𝐬 and 𝐂𝐒𝐭𝐚𝐛𝐦 are not as well understood as Banach lattices, making them not ideal semantic frameworks to reason about probabilistic programs, since many useful lemmas for reasoning about programs would have to be reproved. Besides, our model provides a clear mathematical justification for having Fatou-like properties in the semantics: it is forced upon it by Theorem 28 instead of being there for denotational reasons, as is the case of 𝐂𝐒𝐭𝐚𝐛𝐦, or in enabling the exponential construction, as is the case of 𝐂𝐂𝐨𝐧𝐞𝐬, showing a kind of canonicity of our model.

Vector Space Semantics of Linear Logic

Dahlqvist and Kozen [7] have defined a category of partially ordered Banach spaces 𝐑𝐨𝐁𝐚𝐧, shown that it is a model of intuitionistic linear logic, and used it to interpret a higher-order imperative probabilistic language with while loops and soft-conditioning.

Their model also uses a mathematically well-understood class of vector spaces. That being said, by using a more general class of vector spaces than we do, their model has less structure than ours. A practical consequence of this lack of structure is that in order to guarantee the soundness of their semantics, they define 6 type grammars that are used for different program constructs. As an example, in order to interpret conditionals and while loops the context may only have Dedekind complete types.

Another relevant vector space model is the one based on complex coherent Banach spaces [17]. However, since they are complex vector spaces, it is unclear if it would be possible to embed 𝐏𝐂𝐨𝐡 into them.

Neither 𝐑𝐨𝐁𝐚𝐧 nor 𝐂𝐒𝐭𝐚𝐛𝐦 are models of classical linear logic.

8 Conclusion

In this paper we have shown that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 is a model of classical linear logic that conservatively extends 𝐏𝐂𝐨𝐡 and can be used to give semantics to a recursive probabilistic calculus. Our model differs from existing extensions of 𝐏𝐂𝐨𝐡 that only extends 𝐏𝐂𝐨𝐡’s intuitionistic fragment, meaning that they do not have an involutive negation. We believe that our model is a good fit for formal verification purposes because Riesz spaces have decades of research and have been extensively used in the formalization of stochastic processes.

For future work, we are interested in showing that 𝐏𝐁𝐚𝐧𝐋𝐚𝐭𝟏 can accommodate exponentials and use this category for reasoning about correctness properties of probabilistic programs such as inference algorithms.

References

  • [1] Charalambos D Aliprantis and Owen Burkinshaw. Positive operators. Springer, 2006. doi:10.1007/978-1-4020-5008-4.
  • [2] Pedro H. Azevedo de Amorim. A higher-order language for markov kernels and linear operators. In Foundations of Software Science and Computation Structures (FoSSaCS), 2023. doi:10.1007/978-3-031-30829-1_5.
  • [3] Francis Borceux. Handbook of categorical algebra: volume 1, Basic category theory, volume 1. Cambridge University Press, 1994.
  • [4] Francis Borceux. Handbook of categorical algebra: volume 2, Categories and Structures, volume 2. Cambridge University Press, 1994.
  • [5] Kenta Cho and Bart Jacobs. Disintegration and bayesian inversion via string diagrams. Mathematical Structures in Computer Science, 2019.
  • [6] Raphaëlle Crubillé. Probabilistic stable functions on discrete cones are power series. In Logic in Computer Science (LICS), 2018.
  • [7] Fredrik Dahlqvist and Dexter Kozen. Semantics of higher-order probabilistic programs with conditioning. In Principles of Programming Languages (POPL), 2019.
  • [8] Vincent Danos and Thomas Ehrhard. Probabilistic coherence spaces as a model of higher-order probabilistic computation. Information and Computation, 209(6):966–991, 2011. doi:10.1016/J.IC.2011.02.001.
  • [9] Thomas Ehrhard. On Köthe sequence spaces and linear logic. Mathematical Structures in Computer Science, 12(5):579–623, 2002. doi:10.1017/S0960129502003729.
  • [10] Thomas Ehrhard. Differentials and distances in probabilistic coherence spaces. arXiv preprint, 2019. arXiv:1902.04836.
  • [11] Thomas Ehrhard. On the linear structure of cones. In Logic in Computer Science (LICS), 2020.
  • [12] Thomas Ehrhard, Michele Pagani, and Christine Tasson. Measurable cones and stable, measurable functions: a model for probabilistic higher-order programming. In Principles of Programming Languages (POPL), 2017.
  • [13] Thomas Ehrhard, Christine Tasson, and Michele Pagani. Probabilistic coherence spaces are fully abstract for probabilistic PCF. In Principles of Programming Languages (POPL), 2014.
  • [14] David H Fremlin. Measure theory. Torres Fremlin, 2000.
  • [15] DH Fremlin. Abstract Köthe spaces IV. In Mathematical Proceedings of the Cambridge Philosophical Society, pages 45–52. Cambridge University Press, 1968.
  • [16] Tobias Fritz. A synthetic approach to markov kernels, conditional independence and theorems on sufficient statistics. Advances in Mathematics, 370:107239, 2020.
  • [17] Jean-Yves Girard. Coherent banach spaces: a continuous denotational semantics. Theoretical Computer Science, 227(1-2):275–297, 1999. doi:10.1016/S0304-3975(99)00056-0.
  • [18] Klaus Keimel and Gordon D Plotkin. Mixed powerdomains for probability and nondeterminism. Logical Methods in Computer Science, 2017.
  • [19] Marie Kerjean and Christine Tasson. Mackey-complete spaces and power series–a topological model of differential linear logic. Mathematical Structures in Computer Science, 28(4):472–507, 2018. doi:10.1017/S0960129516000281.
  • [20] Dexter Kozen. Semantics of probabilistic programs. In Symposium on Foundations of Computer Science (SFCS), 1979.
  • [21] WAJ Luxemberg and AC Zaanen. Notes on Banach function spaces VI-XIII. Proceedings of the Koninklijke Nederlandse Akademie van Wetenschappen, Series A, 66:251–263, 1963.
  • [22] Paul-André Mellies. Categorical semantics of linear logic. Panoramas et syntheses, 27:15–215, 2009.
  • [23] Peter Selinger. Towards a semantics for higher-order quantum computation. In Quantum Programming Languages (QPL), 2004.
  • [24] Sergey Slavnov. Linear logic in normed cones: probabilistic coherence spaces and beyond. Mathematical Structures in Computer Science, 31(5):495–534, 2021. doi:10.1017/S0960129521000177.
  • [25] Christine Tasson and Thomas Ehrhard. Probabilistic call by push value. Logical Methods in Computer Science, 15, 2019. doi:10.23638/LMCS-15(1:3)2019.
  • [26] Adriaan C Zaanen. Introduction to operator theory in Riesz spaces. Springer, 2012.

Appendix A A Metalanguage for Linear Operators and Markov Kernels

In this section we further explain the two-level language λMKLL and its semantics. The language MK corresponds to an effectful language with probabilistic primitives and where free variables are assumed to be values, as opposed to computations. For instance, the program x:,y:MKx+y: is interpreted as a deterministic program. This language is interpreted in a CD category, which can be seen as an abstraction for programming with commutative effects [16].

Definition 61 ([5, Definition 2.2]).

CD categories are symmetric monoidal categories such that every object A has a commutative comonoid structure 𝖼𝗈𝗉𝗒A:AAA and 𝖽𝖾𝗅𝖾𝗍𝖾A:A1 satisfying certain structural properties.

In the context of probabilistic programming, there are many CD categories to choose from. In particular, for any subprobability monad, its Kleisli category is a CD category. This is the case for the 𝐬𝐒𝐭𝐨𝐜𝐡 category, since it can be characterized as the category of measurable sets and measurable functions A𝒢(B), where 𝒢 is the subprobability monad over 𝐌𝐞𝐚𝐬.

The language LL is basically a linear λ-calculus. By itself, linearity limits the expressivity of the language quite a bit. In the original paper, the author argues that for probabilistic programming, the linear usage of variables is, semantically, too restrictive, since many linear probabilistic calculi, in the algebraic sense, may use variables more than once [2]. This observation led to the introduction of the modality in the LL language which allows MK programs to be called from an LL program. Semantically, this is interpreted as a lax monoidal functor.

Definition 62 ([4, Definition 6.4.1]).

Let 𝐂 and 𝐃 be monoidal categories. A (lax) monoidal functor is a functor F:𝐂𝐃 equipped with a natural transformation εA,B:FA𝐃FBF(A𝐂B) and a morphism I𝐃F(I𝐂) making certain coherence diagrams commute.

From a programming point of view, types τ should be thought of as types that can be sampled from. Supposing that the language has a primitive 𝗎𝗇𝗂𝖿𝗈𝗋𝗆 for the uniform distribution over the unit interval the Sample construct can be used to write the program

𝗌𝖺𝗆𝗉𝗅𝖾𝗎𝗇𝗂𝖿𝗈𝗋𝗆𝖺𝗌x𝗂𝗇(x+x)

The program above samples from a uniform distribution and adds the result to itself. This program illustrates why this syntax increases the expressivity of the linear λ-calculus. By allowing the continuation x+x to be an MK program, variables may be freely reused or discarded without worrying about syntactic restriction imposed by linearity.

However, once inside the MK language, there is no way of going back to the higher-order language, meaning that the program 𝗌𝖺𝗆𝗉𝗅𝖾𝗎𝗇𝗂𝖿𝗈𝗋𝗆𝖺𝗌x𝗂𝗇(𝗌𝖺𝗆𝗉𝗅𝖾𝗎𝗇𝗂𝖿𝗈𝗋𝗆𝖺𝗌y𝗂𝗇(x+y)) is not well-typed. This is mitigated by lax monoidality, which makes it possible to simultaneously sample from distributions: 𝗌𝖺𝗆𝗉𝗅𝖾(𝗎𝗇𝗂𝖿𝗈𝗋𝗆,𝗎𝗇𝗂𝖿𝗈𝗋𝗆)𝖺𝗌(x,y)𝗂𝗇(x+y).

Definition 63.

A model of λMKLL is a triple (𝐂,𝐋,), where 𝐂, a symmetric monoidal closed category 𝐋 and :𝐌𝐂 is a lax monoidal functor.

The typing rules are depicted in Figure 2. They are basically the amalgamation of the rules for programming with CD categories, i.e. a first-order expression language with pairs, with symmetric monoidal closed categories, i.e. the linear λ-calculus with tensor types. The main novelty is the introduction of the lax monoidal modality and its accompanying typing rule Sample which connects the MK and LL languages.

Figure 2: Typing rules for λMKLL.

Much like the typing rules, the categorical semantics of λMKLL is the combination of the categorical semantics of the internal languages of CD categories and the linear λ-calculus with the exception of the Sample rule that makes use of the functor . The full semantics is depicted in Appendix A.

Appendix B Proof of Lemma 38

By Theorem 14, VW is a Riesz space. Applying Theorem 29, we can also show that it is perfect. To show separability, let f1,f2:VW be distinct functions. Then there is a point vV such that f1(v)f2(v). Since W is perfect, it is separated, therefore there exists g:W such that g(f1(v))g(f2(v)). Then the order-continuous function λf.g(f(v)) separates the points f1 and f2, therefore VW is separated.

Now let 0{fα} be an increasing net such that supαF(fα)< for all positive F:(VW). We can define an f such that fαf pointwise. Let vV+ and let F:W be a positive functional. Consider the functional λf.F(f(v)):(VW). By hypothesis, supα(F(fα(v)))<, and since W is perfect and {fα(v)} is a positive net in W, there exists f(v)W such that fα(v)f(v). This defines f on elements of V+, and for arbitrary vV we take f(v)=f(v+)f(v). Then supαfα=f.

Appendix C Proof of Theorem 50

If ue(X), consider the element fu=λx.u+,xu,x. It is possible to show that the function λx.u,x is positive and Scott-continuous, therefore order-continuous for every u𝒫(X). Using this result, it is not hard to show that fue(X)σ.

Conversely, consider an element fe(X)σ. Without loss of generality, we can assume that f is positive. We want to associate to f an element in e(X). As is shown by Ehrhard and Danos [8], we can alternatively characterize the space e(X) as

{u|X||λ>0u𝒫(X)|u|,uλ}.

Consider the function fδ=λx.f(δx). Let us show that fδe(X). To do this, we show that for every u𝒫(X), |f|,u is uniformly bounded. Let (uα)αfin(X) be the ascending net uα,a=ua if aα and 0 otherwise. By expanding the definition, we get the equality

|fδ|,uα=a|X||f(δa)|uα,a=
a|X||f(δauα,a)|=a|X|f(δauα,a).

We get the last equality from f being a positive function. Since every uα has finite support, the expression above is well defined.

a|X|f(δauα,a)=f(a|X|δauα,a)=f(uα)

Since f is order-continuous and monotone and {uα} is an increasing net, we can conclude that |fδ|,uf(u), therefore for every u𝒫(X), |fδ|,uf and fδe(X). If f is not positive, we decompose it as the difference of two positive maps f=f+f and define fδ=fδ+fδ.

A direct calculation shows that this is indeed an isomorphism.

Appendix D Proof of Theorem 57

Let C be a directed complete lattice cone. In order to define functions over it we use the universal property of quotients: it suffices to define it over every pair (c1,c2) while guaranteeing that the function acts the same over every equivalence class.

For instance, the vector space structure can be simply defined componentwise. Let (c1,c2),(c3,c4)CC then we define

(c1,c2)+(c3,c4) =(c1+c3,c2+c4)
α(c1,c2) =(αc1,αc2) for α0
α(c1,c2) =(αc2,αc1) otherwise

The lattice operations require a bit more ingenuity, and we first observe the equation uv=u+(vu)+ which holds in every Riesz space, reducing the lowest upper bound operation to addition and the positive part. By doing some algebraic manipulations we get that if (c1,c2),(c3,c4)CC then we define (c1,c2)(c3,c4)=(c1,c2)((c3,c4)(c1,c2))+=(c1,c2)+(c3+c2(c1+c4)(c2+c3),0)=(c1+c3+c2(c1+c4)(c2+c3),c2). The lattice equations such as commutativity and idempotency follow by unfolding the definitions and from C being a lattice.

Before defining a norm over CC we first need the following lemma

Lemma 64.

(CC)+{(c,0)|cC}C.

Proof.

The mapping {(c,0)|cC}(CC)+ is the injection through the equivalence class function and the mapping in the other direction can be constructed by observing that whenever (c1,c2)(0,0) it can be shown that c1c2 and, therefore, (c1c2,0)=(c1,c2) and this decomposition is unique, since (c,0)=(d,0) implies, by definition of that c=d. The second isomorphism is trivial.

Given a norm over C it is possible to extend it to a norm over CC. This follows from the property of normed Riesz spaces, where |v|=v which forces us to define (c1,c2)=|(c1,c2)|C. Note that since |(c1,c2)| is a positive element of CC, by the lemma above it can be mapped back to an element of C which, in turn, has a norm.

Therefore, we have shown that CC is a normed Riesz space. Since C has the directed completeness property it follows that CC has the weak Fatou property and, therefore, it is Banach and perfect.

Appendix E Proof of Theorem 60

There is a standard functor that maps measurable sets to the vector space of signed measures and sub-Markov kernels f:AMB to the linear function f(μ)=f𝑑μ. The proof of linearity is standard, but order-continuity requires a few words. Let {μα}0 be a descending arrow, f(μα)=f𝑑μα1𝑑μα=μα(A) which, as μα goes to zero, so does μα(A), making f~ order-continuous. The functorial laws also follows from standard proofs from the literature.

To show that is lax monoidal, we need to define a natural transformation μX,Y:(X)(Y)(X×Y) which is easily defined by the universal property of the tensor product and a morphism ε:(1) which maps a real number r to the measure rδ{}, where is the only member of the singleton set 1. Showing that the necessary diagrams commute follows from the universal property of the tensor product.