Interpreting Lambda Calculus in Domain-Valued Random Variables
Abstract
We develop Boolean-valued domain theory and show how the lambda-calculus can be interpreted using domain-valued random variables. We focus on the reflexive domain construction rather than the language and its semantics. We develop the Boolean-valued set theory needed from scratch and then develop Boolean-valued domain theory on top of that. The notions of equality and partial order have to be given Boolean-valued interpretations; when we say that an equation is valid in the model we mean that its interpretation is the top element of the Boolean algebra.
Keywords and phrases:
lambda calculus, domain theory, random variablesCopyright and License:
2012 ACM Subject Classification:
Theory of computation ; Theory of computation Probabilistic computation ; Theory of computation Lambda calculus ; Theory of computation Denotational semanticsEditors:
Stefano Guerrini and Barbara KönigSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
There has been burgeoning interest in probabilistic programming languages in the last decade. The main motivation is building compositional models of probabilistic processes and performing inference on them [25, 16, 33]. For machine learning applications the notion of conditioning is fundamental and the striking results of [1, 2] show that this is a subtle issue.
The combination of probability and higher type programming has been both technically challenging and important for the development of semantics for such languages. There are a variety of approaches based on probabilistic coherence spaces [10] or cones [9], quasi-Borel spaces [31, 17, 32] and Boolean-valued models [3] which was based on Dana Scott’s vision [28]. Stochastic lambda-calculi have appeared [6, 7, 8] with important contributions to the understanding of probability theory at higher type. The work on quasi-Borel spaces gives a cartesian closed category that can serve as the foundation for a typed higher-order probabilistic programming language [17].
In [3] a Boolean-valued domain theory was developed. The idea is to use one of the standard set-theoretic models of the -calculus but interpreted in a suitable Boolean-valued universe of sets. However, the basic domain theoretic definitions of directed set, supremum, reflexive dcpo and continuity were interpreted as usual. The theory presented there is rather complicated and had artificial restrictions on the way randomness was handled. In the present paper a completely Boolean-valued point of view is adopted and even basic concepts, like equality and order, are all interpreted in a Boolean-valued logic. This leads to a much simpler theory but still in line with the vision of [28]. The version of Boolean-valued domain theory used in the current paper supersedes [3] by working “internally”, by transferring theorems from ordinary logic to Boolean-valued logic as much as possible, rather than the “bare handed” approach of [3].
We show that untyped -calculus can be interpreted in domain-valued random variables. In order to employ the theory of Boolean-valued sets, for most of the article we actually use the Boolean-valued power set rather than random variables, and then show that there is an isomorphism between the two at the end. We focus on the reflexive domain construction rather than the language and its semantics.
The main contribution of this paper is the completely Boolean-valued reconstruction of domain theory. The notion of equality has to be interpreted in the Boolean algebra and when we say that an equation is valid in the model we mean that its interpretation is the top element of the domain.
What makes the theory of Boolean-valued sets necessary is that domain-valued random variables do not form a continuous dcpo. However, when “continuous dcpo” is given its interpretation in Boolean-valued sets, they are. The version of Boolean-valued sets we have used is the original version in terms of a cumulative hierarchy. If the reader prefers, they may rephrase the arguments results in terms of topos theory in a Boolean topos, and we outline the connection of the two in Section 3, though the only part of this theory that we use is the ability to define functions. As an example of how to apply Boolean-valued domain theory, we show that there exist two sets of integers, neither of which can be mapped to the other by a -definable function. The reason for choosing this example is that it shows that -calculus and its model based on domain-valued random variables are powerful enough to prove a fact that does not mention probability in its statement, and such that the proof is pure -calculus and probability and doesn’t need to pass via the equivalence between -definability and general recursion and applying the Kleene-Post theorem [20] that there are incomparable many-one degrees. The proof, however, is inspired by Spector’s probabilistic proof [30].
For reasons of space, the complete proofs of some results are omitted, even from the appendix. However, they can be found in the “related version” on the arxiv, linked above.
2 Background on Boolean-Valued Set Theory
In this section we describe how statements and proofs in ordinary set theory can be re-interpreted in a Boolean-valued sense. This interpretation is originally due to Scott and Solovay [26, 19, 5].
Throughout this section we let be an arbitrary complete Boolean algebra. It will play the role that the two-element Boolean algebra plays in ordinary logic. We can build up the class of -valued sets, , by considering an -valued set to be a partial function that assigns to each element of its domain the amount, valued in , that is an element of . We build up by the following generalization of von Neumann’s construction:
Then either informally, or using proper classes, .
We use the term -valued set for the elements of , but we also will use the shorter term -set, and this helps to avoid certain confusions arising from the term “valued”.
We can then interpret , and by the following mutually recursive formulas:
In the above, and all that follows, we use an operator precedence convention for and that agrees with operator precedence for and , so there is an implicit bracket around everything to the right of such a join or meet.
Recall that the first-order language of set theory, which we write as , is the usual first-order language for a signature with equality and one two-place relation symbol, namely . We write for this language extended with constants from .
In any Boolean algebra, we can interpret the connectives of propositional logic. Using the completeness of , we can interpret the universal quantifier as a meet and the existential quantifier as a join. All together, this gives us an interpretation of in .
Theorem 1 ( as a model).
-
(i)
If is a theorem of ZFC set theory, then in .
-
(ii)
The inference rules of first-order logic can be applied to theorems of ZFC set theory and statements about elements of in .
-
(iii)
If , where (and we allow ), then there exists such that .
The constructions of singletons , unordered pairs and ordered pairs are done as usual in set theory, but interpreted in . Details can be found in the arxiv version. For we define as follows.
For each -set , the -valued power set is defined by
For all we have
which is how the power set axiom is proved for .
If is a set-theoretic formula we can define the -set
which proves the axiom of separation for .
If we now consider von Neumann’s universe of classic set theory constructed inductively on ordinals , then for each set , there is a corresponding element defined recursively. The domain of is , and it is defined by:
To describe how a statement in set theory about an ordinary set in translates to a statement about , we need the notion of a statement. Bounded quantifiers are those of the form and , i.e. in the language of set theory and . A formula is one containing only bounded quantifiers. We have invariance111Note that Bell uses the alternative terminology “restricted” for . [19, Lemma 14.21] or [5, Theorem 1.23 (v)].
Theorem 2 ( invariance).
Let be a -formula, whose free variables are . Let . Then,
We point out some useful consequences of Theorem 2. The statements “ is a singleton whose only element is ”, “ is an unordered pair of and ” and “ is an ordered pair, first element , second element ” are all statements, and so the following all hold
Another important consequence of Theorem 2 is that is the smallest inductive222In the sense used to formulate the axiom of infinity in ZF. -set in , so that is the of . Given any set , we say a subset is finite if there exists and such that . We write for the set of all finite subsets of . If we interpret this with -sets, for each we can define to be the set of finite -subsets of , using the axiom of separation. The following proposition is a consequence of the distributive law – see [21, 3.1.11].
Proposition 3.
For all sets ,
We can define the category from as follows. The class of objects is , and for each , the set of functions can be defined using products, power set, and the axiom of separation. We define:
where is the equivalence relation defined by iff . Identity elements are defined as identity relations, and composition by composition of relations, which is well-defined with respect to .
3 Boolean-Valued Setoids
We now discuss the kind of “Boolean-valued sets” that are essentially -valued models of the theory of . These can be considered an alternative description of either sheaves or separated presheaves on , and are usually discussed in the more general case where is a Heyting algebra, such as in [12, 15, 24]. Although we will use only one definition of -valued sets, the distinction between -valued relations that satisfy the definition of a function internally and functions that do so gives us two distinct categories.
In order to distinguish the -valued sets we will be discussing from elements of , we call them -valued setoids333Setoid is a long-established term for a set equipped with an equivalence relation., or simply -setoids. An -setoid is a pair where is a set, . The two axioms of are symmetry and transitivity, i.e.
so -valued setoids are “-valued partial equivalence relations”.
Since reflexivity is not assumed, the statement does not represent a tautology, but its intended interpretation is, in some sense, the degree to which , or the place where . So we define the notation .
We say is total if for all , i.e. if reflexivity holds; it is strict if implies .
Definition 4.
Let be an -setoid. We say it is complete444This definition is slightly different from that used in [12, 4.10,4.11] and elsewhere, which would not suit us because under that definition is not complete, when considered as an -setoid in the sense we will define in Definition 14. if either, hence both, of the following equivalent properties holds:
-
(i)
For any family of elements in and corresponding family in such that for all , , there exists such that for all , .
-
(ii)
For any pairwise disjoint family of elements in and corresponding family in such that for all , , there exists such that for all , .
Definition 5.
If is an -setoid and is a set and a function , and is a bijection such that for all :
then we say is a strict isomorphism, and it follows that is an -setoid, and is total, strict or complete iff is.
Definition 6.
The product is defined to have
Definition 7.
A predicate on is a function such that:
-
(i)
For all , .
-
(ii)
For all , .
A binary relation is simply a predicate on .
This allows us to define a category of setoids with relations that satisfy the internal definition of a function (“relational functions”) as morphisms.
Definition 8.
The category has -setoids as objects and a morphism is a relation such that (additionally to (i) and (ii) from Definition 7):
-
(iii)
For all , , .
-
(iv)
For all , .
The identity function is defined by:
Composition of functions and is defined by
We define the category of -setoids and “functional functions”, , as follows.
Definition 9.
The category has -setoids as objects. The morphisms are defined starting with an -setoid:
Then the hom set is the quotient set of this,555Monro calls these admissible functions in [24, Definition 5.2]. i.e. modulo the equivalence relation:
Identity maps and composition are defined as for functions.
The category is called in [24, Definition 5.2], where it is proved to be a quasi-topos. The full subcategory on non-empty666We mean not having as an underlying set. It is still allowed, and necessary, to have sets that do not assign any value other than to any element, which are “empty” in terms of Boolean-valued logic. complete -setoids is a topos [24, Proposition 5.6 (ii)] equivalent to the category of sheaves on the canonical topology on .
Mapping a functional function to its graph defines a faithful functor from .
Definition 10.
The following defines a faithful functor . On objects, . For , we define
We can formulate a notion of poset that does not require us to define but can instead be defined in terms of it. It turns out to be useful in the general theory, as well as for dealing with posets that are -setoids or -sets.
Definition 11.
An -poset is a pair , where is a set and is such that for all :
-
(i)
-
(ii)
We then define by
| (1) |
Then is an -setoid, and is a reflexive, antisymmetric, transitive relation when these statements are interpreted in the -valued sense. If is an -setoid and is a relation that is reflexive, antisymmetric and transitive, in the -valued sense, then is an -poset in the above sense, and satisfies (1).
Since is defined in terms of , the following fact is convenient for proving that a function on underlying sets not only defines an element of but also a monotone function in the -valued sense.
Lemma 12.
Let be -posets, and suppose that is -monotone in the sense777This is monotonicity using the interpretation of logic in Section 2. that for all ,
Then . Every that is monotone in the -valued interpretation of the term is of this form.
The following definition and theorem are based on [23, Proposition 3.3].
Definition 13.
Let be -setoids such that is complete, and let . For each , there exists such that
| (2) |
Any choice of for all defines an element such that , and in fact this establishes a isomorphism .
Every -set defines an -setoid as follows.
Definition 14.
Let . Define by
| (3) |
Then is an -setoid, which we write when we need to be unambiguous. When we speak of elements of , we mean elements of the underlying set of , i.e. elements of , following the usual convention for sets with structure.
Definition 15.
Let . For each such that , then , defined as follows, is a predicate on :
where . In particular, this holds if .
Definition 16.
The following defines a functors, where is in :
This functors is full, faithful and essentially surjective, so .
Theorem 17.
For each , is complete. Moreover, if is a formula of and , then there exists such that .
Corollary 18.
For each , and are complete, and if we prove a relation or a function exists in the Boolean-valued sense, satisfying some formula , then there exists a corresponding element of or satisfying .
4 Models of Untyped Lambda-calculus in Boolean-valued sets
In this section we show how to model untyped -calculus in -valued sets. We use the Engeler model [11] as the main example. We will repeatedly use Theorem 1 to prove statements in by proving them in set theory first. The reader who would prefer to use a topos formulation might prefer to use the categorical formulation of the Engeler model from [18].
4.1 Background on Domain Theory
A dcpo is a poset that is directed complete, i.e. such that every directed set has a supremum. Every complete lattice is a dcpo. The least element of a dcpo , if it exists, is called the bottom element and is written . In a dcpo , where , we say that is way below , written , if for each directed set such that , there exists some such that . The relation is transitive and antisymmetric, but in general is neither reflexive nor irreflexive. We write . A dcpo is called continuous if for all , the set is directed and . A continuous dcpo is called a domain. A complete lattice that is continuous as a dcpo is called a continuous lattice. A basis or base for a domain is a subset such that for all , is directed, and . It follows that if is continuous, then is a base for . If has a countable base, we say it is a countably-based domain. See [14] for more related concepts.
If and are dcpos, a function is said to be Scott continuous if it is monotone and preserves directed suprema. We write for the set of Scott-continuous maps . This is a dcpo when given the pointwise ordering, and directed suprema are calculated pointwise. When we refer to this as a dcpo, we always use this structure. The Scott topology on a dcpo is the topology whose open sets are the sets such that is an up set and for all directed sets such that there exists such that . If and are dcpos, a function is Scott continuous iff it is a continuous map from to equipped with their respective Scott topologies.
Definition 19.
A reflexive dcpo is a triple , where is a dcpo with bottom888This is what is meant by a cpo in [4, Definition 1.2.1 (ii)]., and and are Scott-continuous maps making a retract of , i.e. . A reflexive dcpo is extensional iff , or equivalently is an isomorphism, i.e. iff additionally .
It is often convenient to formulate this notion using the uncurried form of , which is to say, we can equivalently define a reflexive dcpo to be a triple where is a dcpo with bottom, and and are Scott-continuous maps such that for each and we have .
The language of untyped -calculus can be interpreted in a reflexive dcpo as follows. Given a reflexive dcpo , and a set of variables , a valuation is a partial function . We also choose a set of constants , which is allowed to be any subset, including and itself. We then define the language of -calculus as follows.
Definition 20.
The language is defined inductively by the rules
We write for , since this does not depend on . The elements of are called pure -terms. We write for the set of free variables of , defined as usual.
We make the following observation about how the above definition is formulated in set theory999This is needed to make the proof of Proposition 22 and later results that deal with viewing the syntax of -calculus from inside more comprehensible. .
Example 21.
There exist formulas and , such that the sets and are respectively definable as the smallest sets satisfying their corresponding formula.
Indeed, to define and , we need a way to represent the syntax of -calculus. For example, we could take the ordinals to mean a variable, a -abstraction, an application and a constant, so that a variable appears as for , a -abstraction as where and is a -term, an application as where are -terms, and a constant as where .
Then we can define:
Strictly speaking this is not quite a formula, but it is not difficult to see that the statements , and are expressible as formulas (with the usual set-theoretic representations of ordered pairs). Then, we define:
Then, and are the least sets satisfying their respective formulas.
Proposition 22.
Let be a set101010Not Boolean-valued, just the usual kind of set.. For any complete Boolean algebra , there exists111111By Theorem 1 (i) and (iii). that satisfies the definition of in the Boolean-valued sense, i.e.
and for all such that , we have .
Then .
The equational theory of -calculus, called is described following [4]:
Definition 23.
Sentences of are of the form , where . The theory is generated by the following rules, under modus ponens and -conversion.
-
(i)
, where is capture-avoiding substitution of for .
-
(ii)
.
-
(iii)
.
-
(iv)
.
-
(v)
.
-
(vi)
.
-
(vii)
.
We write to say that the equation is derivable in the theory .
Example 24.
Here is a brief description of the set-theoretic formulation of . We can simply consider it to be a subset of , and interpret as . We can define a formula , which we no longer require to be , that encodes the rules of forming from Definition 23, and then can be characterized as the least set (with respect to ) such that . This allows us to define in .
We can then prove that by induction on the structure of an element of .
Definition 25.
Following [4, Definition 5.4.2], we define the interpretation of -terms from in , using a valuation such that , by
where is the “meta-lambda”, and is the partial function where and
This is proved to define a model of -calculus in [4, Theorem 5.4.4], which is to say, that for all , if , then for all valuations , . For closed terms , we write for .
We now give the Boolean-valued version.
Theorem 26.
Let such that the -setoid of is strict, total and complete, and let there be and in such that . And take to be a set of variables and such that an -set of constants. Then for each that defines a partial function from to , there are functions and satisfying Definition 25 in the -valued sense.
Furthermore, for all , if , then for all we have .
4.2 The Engeler Model
We start with a basic result about the power set.
Proposition 27.
For any set , the power set , when ordered using the subset relation , is a dcpo (in fact, a complete lattice). If , iff is finite and . The set of finite sets is a base, and if is countable, it is a countable base.
We can then apply this in as follows.
Proposition 28.
For any , the -set , ordered with the subset relation, is a continuous lattice with base , interpreted in the -valued sense. As an -setoid, is complete and total. If , then is a base, and is strict.
We define the Engeler model [11, 4], an adaptation of the Scott-Plotkin graph model that uses set-theoretic operations instead of Gödel numbering, as follows121212What we really need of is for it to be countable, non-empty, and an algebra of the functor , such that the structure map is injective, which implies must be infinite. We cannot use the initial algebra of , because it is ..
Let . We define and . Then we have a map defined by pairing, since for each we have for some . For reasons that will become clear later, we express the existence of the Engeler model in the following manner.
Proposition 29.
Let be a set equipped with an injective mapping . Define and by
where , and . Then is a reflexive dcpo.
We can now build the Engeler model in , as follows.
Theorem 30.
By combining Theorem 30 with Proposition 28 and Theorem 26, we obtain a function that interprets -terms in a manner that respects provable equations between them.
The following lemma shows that if we only use pure -terms we do not get anything new by using instead of as a model of -calculus.
Lemma 31.
Let and a valuation such that , and consider and as defined for and respectively. Then
In particular, since , if is closed we have
4.3 Injective Spaces and Oracles
We can encode the Booleans , and natural numbers in -calculus in several ways, e.g. with the Church numerals. The details of the encoding do not matter, only the following.
Definition 32.
Let be a reflexive dcpo, and let be closed -terms and a family of closed -terms. We say is a reflexive dcpo with numerals if
-
(i)
and are distinct elements of .
-
(ii)
There exists a closed -term such that for all -terms , and .
-
(iii)
There exist closed -terms and representing the successor and predecessor operations on , i.e. for all , and and .
-
(iv)
There exists a closed -term such that and for all , .
Proposition 33.
The Church Booleans and Church numerals make the Engeler model into a reflexive continuous lattice with numerals.
Corollary 34.
The Engeler model in , as described in Theorem 30, is a reflexive continuous lattice with numerals, when given ( of) the Church Booleans and Church numerals, with this whole statement being interpreted in .
In the following, for a set , we write for the function such that
while if are part of the structure of a reflexive dcpo with numerals , we write for the function such that:
Every dcpo is a topological space when equipped with its Scott topology [14]. And a topological space is injective for subspace embeddings in the category of -spaces iff is a continuous lattice equipped with the Scott topology [27]. This has useful consequences for representations of the natural numbers in reflexive dcpos that are continuous lattices.
Lemma 35.
Let be a reflexive dcpo with numerals. Then:
-
(i)
and are discrete in the Scott topology of , and also are distinct elements, i.e. implies .
If is additionally a continuous lattice, then:
-
(ii)
For every set , there is a such that for all , .
We can now define a pre-order on sets of integers to be used in the example (Theorem 43). Readers familiar with recursion theory will see that it is the -calculus version of comparability of many-one degrees [29, Definition 4.8 (i), (iii)].
Proposition 36.
Let be a reflexive continuous lattice with numerals. The following are equivalent for , in which case we write :
-
(i)
There exists a closed -term such that for all , there exists such that , and there exist such that for all , , and .
-
(ii)
There exists a closed -term such that for all , there exists such that , and for all such that for all , and , we have that for all , .
5 Random Variables
In this section we relate the Boolean-valued Engeler model in from Corollary 34 to the random-variable-based Boolean-valued models of -calculus from [3], and give the example application (Theorem 43).
We start with some terminology. A negligibility space is a measurable space equipped with a -ideal such that is a complete Boolean algebra, not just -complete. We use to denote , as it is the complete Boolean algebra associated to or simply the algebra associated to .
For a probability space , the null ideal is the -ideal of sets with , and is a complete Boolean algebra [13, 322B,322C], so is a negligibility space, and is known as the measure algebra of .
Let be a countable set. For each , let , which form a subbasis of open sets for the positive topology131313The positive topology equals the Scott topology. on . All notions of measurability for will be with respect to the Borel -algebra defined by this topology, and since this is a second countable topology, is also a countable generating set for this -algebra.
Definition 37.
Let be a measurable space and a countable set. We define to be the set of measurable functions , using the Borel -algebra of the Scott topology of . We define a -valued order as follows:
The corresponding notion of equality is
Lemma 38.
If is a negligibility space, define to be modulo the relation defined by: which is the usual “almost everywhere” equivalence. Then and , defined by composing the corresponding notions for with , are well-defined and make into an -poset.
We define as follows, where and :
| (4) |
The measurability of guarantees that .
Proposition 39.
For any negligibility space and any countable set , the map is a strict isomorphism of -posets .
Since is a reflexive dcpo and has a binary operation for application, for any measurable space we can extend this pointwise to by defining for and :
For a negligibility space we can then extend this to by defining
Proposition 40.
Let be a negligibility space. Then the above definition of is well-defined, and is an “application homomorphism”, i.e. for all ,
We now introduce the following notation. If , define to be the function taking the constant value . This relates to in the following way.
Lemma 41.
Let be an arbitrary countable set. For all we have
Recall that a subbase of clopens for the product topology of is given by the sets , where
These sets also generate the Borel -algebra of .
In the following, we will also have to consider the (isomorphic) product space , but for which we will need to describe the subsets in more detail. So for , and we write
Then for all , and we have .
Let equipped with its Borel -algebra as a measurable space. We define to be the usual independent fair coin measure, which is to say, it is the unique measure such that for all finitely-supported partial functions
We take the null ideal of this measure as the negligible sets of . Then are random variables in . They define as follows, taking :
| (5) |
We remind the reader at this point that because of the way Boolean-valued equality behaves for elements of .
Proposition 42.
For all , neither nor is the preimage of a finite -subset of , i.e. , and likewise for .
Moreover, and , i.e. these sets cannot be mapped to each other by any classical function.
Theorem 43.
There exist sets such that neither can be mapped to the other by a -definable function, i.e. we neither have nor (recall Proposition 36).
Proof.
We start by doing Boolean-valued reasoning about and , taking , and use the fact that the Engeler model is (-valuedly) a reflexive continuous lattice with numerals (Corollary 34) and Proposition 36.
Suppose such that for all , there exists such that . In particular, there exists some function such that for all , .
Now we consider and . In the following, for ease of notation, we write an equals sign to mean the corresponding -valued equality being equal to :
by Theorem 26. Therefore,
and the corresponding negative statement for . Likewise,
and the corresponding statement for . So all together,
It is proved in Proposition 42 that , so we can conclude that
for all that map numerals to numerals.
Let s.t. for we have . Then, using Proposition 39, Proposition 40, Lemma 31 and Lemma 41, we get:
,
so the set inside the square brackets has measure zero.
Since the set of that map numerals to numerals is countable (because is countable), the set of such that for all mapping numerals to numerals we have has measure .
For all , we have, by the definition of , for all the statement . By a similar argument to that used above, this means that the set of such that has measure , and by the countability of the set where this is true for both and all is also of measure .
Therefore the intersection of the sets defined in the previous two paragraphs has measure , and so is non-empty and so there exists a point in it. We can then define , and we have proved, by Proposition 36, that .
We could not have done this proof by using the “fact” that is a continuous dcpo, because this is not true, as stated in our last proposition.
Proposition 44.
Let be a negligibility space such that is not atomic, and let be a non-empty countable set. Then is not a continuous dcpo.
6 Conclusions
We have developed domain theory in a Boolean-valued universe of sets. Using the measure algebra as the Boolean algebra we obtained a domain of random variables which can be see to be a reflexive domain in the internal language of the Boolean-valued set theory. We have focused on the pure -calculus here but it should be straightforward to extend this to a -calculus with probabilistic choice as an explicit primitive.
There are a number of directions for future work. First, one can use this construction to give semantics to a -calculus extended with probabilistic choice as was done in [3]. In this model it will be interesting to see which equations involving the interplay of choice and the standard -calculus constructions are valid. One could then relate it to an operational semantics as, for example, in [8] but one would need a Boolean-valued notion of operational semantics. More interestingly one could define conditioning as a primitive and explore its semantics. A second line of research is the notion of approximation. A notion of “approximate equality” has been developed recently [22]; the connection to the notion of equality used in the present paper is unclear but there is a similarity in that in both cases equality may only hold partially.
References
- [1] Nathanael L. Ackerman, Cameron E. Freer, and Daniel M. Roy. Noncomputable conditional distributions. In Logic in Computer Science (LICS), 2011 26th Annual IEEE Symposium on, pages 107–116. IEEE, 2011. doi:10.1109/LICS.2011.49.
- [2] Nathanael L. Ackerman, Cameron E. Freer, and Daniel M. Roy. On the computability of conditional probability. J. ACM, 66(3):23:1–23:40, 2019. doi:10.1145/3321699.
- [3] Giorgio Bacci, Robert Furber, Dexter Kozen, Radu Mardare, Prakash Panangaden, and Dana Scott. Boolean-valued semantics for the stochastic -calculus. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, pages 669–678. ACM, 2018. doi:10.1145/3209108.3209175.
- [4] Henk P. Barendregt. The Lambda Calculus: Its Syntax and Semantics. North-Holland, Amsterdam, 1984.
- [5] John L. Bell. Set Theory: Boolean-Valued Models and Independence Proofs, volume 47 of Oxford Logic Guides. Oxford University Press, third edition, 2005.
- [6] Johannes Borgström, Ugo Dal Lago, Andrew D. Gordon, and Marcin Szymczak. A lambda-calculus foundation for universal probabilistic programming. In Jacques Garrigue, Gabriele Keller, and Eijiro Sumii, editors, Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming, ICFP 2016, Nara, Japan, September 18-22, 2016, pages 33–46. ACM, 2016. doi:10.1145/2951913.2951942.
- [7] Fredrik Dahlqvist and Dexter Kozen. Semantics of higher-order probabilistic programs with conditioning. Proc. ACM Program. Lang., 4(POPL):57:1–57:29, 2020. doi:10.1145/3371125.
- [8] Pedro H. Azevedo de Amorim, Dexter Kozen, Radu Mardare, Prakash Panangaden, and Michael Roberts. Universal semantics for the stochastic -calculus. In Proceedings of the ACM-IEEE Symposium on Logic in Computer Science, 2021. arXiv preprint:2011.13171.
- [9] Thomas Ehrhard, Michele Pagani, and Christine Tasson. Measurable cones and stable, measurable functions: a model for probabilistic higher-order programming. Proceedings of the ACM Symposium on Principles of Programming Languages, 2(POPL):1–28, 2017. doi:10.1145/3158147.
- [10] Thomas Ehrhard, Christine Tasson, and Michele Pagani. Probabilistic coherence spaces are fully abstract for probabilistic pcf. In Proceedings of the 41st ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 309–320, 2014. doi:10.1145/2535838.2535865.
- [11] Erwin Engeler. Algebras and Combinators. Algebra Universalis, 13(1):389–392, December 1981. doi:10.1007/BF02483849.
- [12] Michael P. Fourman and Dana S. Scott. Sheaves and Logic. In Michael Fourman, Christopher Mulvey, and Dana Scott, editors, Applications of Sheaves: Proceedings of the Research Symposium on Applications of Sheaf Theory to Logic, Algebra, and Analysis, Durham, July 9–21, 1977, pages 302–401. Springer Berlin Heidelberg, 1979. doi:10.1007/BFb0061824.
- [13] David H. Fremlin. Measure Theory, Volume 3. https://www.essex.ac.uk/maths/people/fremlin/mt.htm, 2002.
- [14] Gerhard Gierz, Karl H. Hofmann, Klaus Keimel, Jimmie D. Lawson, Michael W. Mislove, and Dana S. Scott. Continuous Lattices and Domains, volume 93 of Encyclopedia of Mathematics and its Applications. Cambridge University Press, 2003.
- [15] Robert Goldblatt. Topoi: The Categorial Analysis of Logic. Dover, 2006.
- [16] Noah Goodman, Vikash Mansingkha, Daniel Roy, Keith Bonawitz, and Joshua Tenenbaum. Church: a language for generative models. In Proceedings of the 24th Conference on Uncertainty in Artificial Intelligence, pages 220–229, 2008.
- [17] Chris Heunen, Ohad Kammar, Sam Staton, and Hongseok Yang. A convenient category for higher-order probability theory. In Proceedings of the Thirty-second Annual ACM-IEEE Symposium on Logic in Computer Science, pages 1–12, 2017. doi:10.1109/LICS.2017.8005137.
- [18] Martin Hyland, Misao Nagayama, John Power, and Giuseppe Rosolini. A Category Theoretic Formulation for Engeler-style Models of the Untyped -Calculus. Electronic Notes in Theoretical Computer Science, 161:43–57, 2006. Proceedings of the Third Irish Conference on the Mathematical Foundations of Computer Science and Information Technology (MFCSIT 2004). doi:10.1016/j.entcs.2006.04.024.
- [19] Thomas J. Jech. Set Theory. Springer, 3rd Millennium edition, 2003.
- [20] Stephen C. Kleene and Emil L. Post. The Upper Semi-Lattice of Degrees of Recursive Unsolvability. Annals of Mathematics, 59(3):379–407, 1954. doi:10.2307/1969708.
- [21] Anatoly G. Kusraev and Semën S. Kutateladze. Boolean Valued Analysis, volume 494 of Mathematics and Its Applications. Springer, 1999. doi:10.1007/978-94-011-4443-8.
- [22] Radu Mardare, Prakash Panangaden, and Gordon Plotkin. Quantitative algebraic reasoning. In Proceedings of the 31st Annual ACM-IEEE Symposium on Logic in Computer Science, pages 700–709, 2016. doi:10.1145/2933575.2934518.
- [23] Gordon P. Monro. A Category-theoretic Approach to Boolean-valued Models of Set Theory. Journal of Pure and Applied Algebra, 42(3):245–274, 1986. doi:10.1016/0022-4049(86)90010-1.
- [24] Gordon P. Monro. Quasitopoi, Logic and Heyting-valued Models. Journal of Pure and Applied Algebra, 42(2):141–164, 1986. doi:10.1016/0022-4049(86)90077-0.
- [25] Dan Roy. Computability, inference and modeling in probabilistic programming. PhD thesis, MIT, June 2011.
- [26] Dana Scott. A proof of the independence of the continuum hypothesis. Mathematical Systems Theory, 1(2):89–111, 1967. doi:10.1007/BF01705520.
- [27] Dana Scott. Continuous Lattices. In F. William Lawvere, editor, Toposes, Algebraic Geometry and Logic, pages 97–136. Springer Berlin Heidelberg, 1972. doi:10.1007/BFb0073967.
- [28] Dana Scott. Stochastic -calculi. Journal of Applied Logic, 12(3):369–376, 2014.
- [29] Robert I. Soare. Recursively Enumerable Sets and Degrees. Perspectives in Mathematical Logic. Springer, 1987.
- [30] Clifford Spector. Measure-Theoretic Construction of Incomparable Hyperdegrees. Journal of Symbolic Logic, 23(3):280–288, September 1958. doi:10.2307/2964288.
- [31] Sam Staton, Hongseok Yang, Frank Wood, Chris Heunen, and Ohad Kammar. Semantics for probabilistic programming: higher-order functions, continuous distributions, and soft constraints. In Proceedings of the 31st Annual ACM-IEEE Symposium On Logic In Computer Science, pages 525–534, 2017.
- [32] Matthijs Vákár, Ohad Kammar, and Sam Staton. A domain theory for statistical probabilistic programming. Proceedings of the ACM Conference on Principles of Programming Languages, 3(POPL):1–29, 2019. doi:10.1145/3290349.
- [33] Frank Wood, Jan Willem van de Meent, and Vikash Mansinghka. A new approach to probabilistic programming inference. In Proceedings of the 17th International conference on Artificial Intelligence and Statistics, pages 1024–1032, 2014. URL: http://proceedings.mlr.press/v33/wood14.html.
Appendix A Appendix
Proof of Theorem 1.
Proof of Theorem 26.
It follows from Theorem 1 applied to Definition 25 that there exist some elements of representing functions with the required properties holding with Boolean value . So by Corollary 18 we can take and also for pure terms (using Proposition 22). So by Definition 16, these define maps in and . So by completeness of , we can apply Definition 13 to get maps in and .
From this, we get that if , then , and therefore for all , . Since is strict, this implies that actually in the usual sense as well.
Proof of Proposition 28.
We get the first part by applying Theorem 1 to Proposition 27. By Theorem 17, is complete, and it is clear from its definition that it is total. Now, if , we use the fact that (Proposition 3), so is also a base for with Boolean value 1.
Finally, to show that is strict, let such that , which is equivalent to . First observe that , and then that for all , we have and likewise for . Since , for all we have
so .
Proof of Theorem 30.
Proof of Corollary 34.
By Lemma 31, , and likewise for and the Church numerals.
Proof of Lemma 35.
-
(i)
As Scott topologies are , part (i) of Definition 32 implies that there is a Scott-open set containing one of but not the other. We start under the assumption that and . This implies that is an open subset of the subspace .
The map is Scott continuous, and and vice-versa. So is an open set containing , but not , proving that is an open subset of the subspace . This proves that is a discrete subspace of , and the proof starting with is similar.
To prove the discreteness and distinctness of , we will need the fact that there exist closed -terms such that if and otherwise. It is not difficult to prove directly that we can take , and . It follows that if and otherwise.
Now, if are elements of , we have , and , so . As is a function, it follows that .
To prove the discreteness of , we show that for all , the singleton is relatively open in . Let be a Scott-open set such that , but . Then is a Scott-open set such that but for all such that .
-
(ii)
Given , define by . By the discreteness of , proved in the previous part, this is continuous. Since is a continuous lattice, and therefore injective [27, Theorem 2.12], extends to a Scott-continuous map , and since is a reflexive dcpo we can define , and then for all :
Proof of Lemma 38.
We prove that is measurable as follows. First, define to be the graph of the relation, i.e. .
, so since is measurable, we only need to show that is measurable with respect to the product measurable space structure. We have
Measurability then follows from the countability of .
For the well-definedness of , it is clear that if and , then and can only differ where differs from or differs from , and the set of all such points is in . It is easy to deduce the transitivity (in the sense of Definition 11 (i)) from transitivity of , and part (ii) of the definition of an -poset follows because for all .
Proof of Proposition 39.
We show that for all , . This shows, in one go, that is an -monotone function and also injective (using the fact that is total, i.e. for all ).
We start by expanding the definitions:
Since is a strict -setoid, and is total, implying that is an injective function. So to prove that is a strict isomorphism, we only need to show that is surjective.
Let . For each , pick such that . Define a function
by . For each , we have
Since generates the Borel -algebra of , this implies that is measurable. For all , we then have
and therefore , as required to prove surjective.
Proof of Proposition 40.
In fact, we will prove the first part by deducing it from the second part. So let . Then for all we have
| Proposition 3 | ||||
| as countable | ||||
so all together we have proved that . In passing, we have proved that for all , is measurable, and therefore that .
If such that and , then by Proposition 39 and the fact that is a strict -setoid:
and therefore , so the definition genuinely defines a function . Putting this together with what we proved above gives us .
Proof of Lemma 41.
It suffices to show that for all , . We have
Proof of Proposition 44.
First, let . As is not atomic, , so there is a set such that and . By definition there are no atoms below . Define
where . This defines a measurable function . As , . We show that is not continuous by showing that is not the supremum of elements way below it, which will follow from the fact that the only element of that is way below is .
If the only element below is , then we are finished, so we reduce to the case that there is at least one such that . Define , which is in because is measurable and and is therefore a Borel set. We have , so we redefine to be if necessary to make .
Since there are no atoms below , there are none below either, so there exists a non-zero element such that and has no atoms below it. We can repeat this argument to form a strictly descending sequence where for all , has no atoms below it and . We can define , to get such a strictly decreasing sequence , now with . Since , we can find a sequence of elements of such that for all , , and by adjusting negligible sets it can be arranged that is also strictly descending. Defining , then is strictly increasing with respect to , maps to a strictly increasing sequence under , and . Define, for each , as follows:
where . Each is measurable for the same reasons that is, and is a strictly increasing sequence in . Since for all , for all and , while for all , we have . But because . Therefore is not way below .
