A Cartesian Closed Category for Random Variables

Pietro Di Gianantonio,Abbas Edalat
2024-06-11
Abstract:We present a novel, yet rather simple construction within the traditional framework of Scott domains to provide semantics to probabilistic programming, thus obtaining a solution to a long-standing open problem in this area. Unlike current main approaches that employ some probability measures or continuous valuations on non-standard or rather complex structures, we use the Scott domain of random variables from a standard sample space -- the unit interval or the Cantor space -- to any given Scott domain. The map taking any such random variable to its corresponding probability distribution provides an effectively given, Scott continuous surjection onto the probabilistic power domain of the underlying Scott domain, establishing a new basic result in classical domain theory. We obtain a Cartesian closed category by enriching the category of Scott domains to capture the equivalence of random variables on these domains. The construction of the domain of random variables on this enriched category forms a strong commutative monad, which is suitable for defining the semantics of probabilistic programming.
Programming Languages
What problem does this paper attempt to address?
The main problem that this paper attempts to solve is to provide a solid semantic foundation for probabilistic programming languages (PPLs), especially by constructing a suitable probability monad, thus solving the long - standing Jung - Tix problem. Specifically: 1. **Semantic Foundation of Probabilistic Computation**: The traditional semantic of probabilistic computation is based on Scott domains or more general continuous dcpos (directed - complete partial orders), but these methods encounter difficulties in constructing Cartesian - closed categories (CCCs), especially when dealing with the construction of probabilistic power domains. 2. **The Jung - Tix Problem**: The core of this problem lies in finding an appropriate category of continuous dcpos that is Cartesian - closed and closed under the construction of probabilistic power domains. Previous research has failed to find such a category, causing some researchers to abandon classical domain theory and turn to more general categories. 3. **A New Solution**: This paper proposes a novel solution, that is, by describing the computation as a random variable from a fixed standard sample space to the result space, rather than directly as a probability distribution or a continuous valuation. This method enables the author to construct a Cartesian - closed category on the basis of Scott domains, thus solving the Jung - Tix problem. 4. **Specific Contributions**: - It is proved that the mapping from the random variables on the Scott domain to their corresponding probability distributions is a Scott - continuous surjection and preserves the canonical base elements of the two domains. - A new natural topology (R - topology) is proposed to handle the equivalence relations of random variables. - Four basic strongly commutative monads are constructed, which are suitable for defining the semantics of probabilistic programming. Through these contributions, this paper provides a solid mathematical foundation for probabilistic programming languages and opens up new avenues for future research and applications. ### Formula Summary - **Scott - continuous surjection**: \[ \text{Probability mapping}: \text{Random variables on Scott domain} \to \text{Probability distributions in probability power domain} \] This mapping is Scott - continuous and preserves the canonical base elements. - **R - topology**: The R - topology is composed of Scott - open sets, and these open sets are invariant with respect to partial equivalence relations. - **Strongly commutative monads**: Using the Cantor space and the unit interval as probability spaces, four basic strongly commutative monads are constructed. These formulas and concepts together form the core contributions of this paper and solve the key problems in the semantics of probabilistic programming languages.