Hostname: page-component-848d4c4894-m9kch Total loading time: 0 Render date: 2024-05-21T16:40:26.464Z Has data issue: false hasContentIssue false

Synthetic topology in Homotopy Type Theory for probabilistic programming

Published online by Cambridge University Press:  13 August 2021

Martin E. Bidlingmaier
Affiliation:
Department of Computer Science, Aarhus University, Aarhus, Denmark
Florian Faissole
Affiliation:
Inria/LRI, Université Paris-Saclay, Gif-sur-Yvette, France
Bas Spitters*
Affiliation:
Department of Computer Science, Aarhus University, Aarhus, Denmark
*
*Corresponding author. Email: bawspitters@gmail.com, spitters@cs.au.dk

Abstract

The ALEA Coq library formalizes measure theory based on a variant of the Giry monad on the category of sets. This enables the interpretation of a probabilistic programming language with primitives for sampling from discrete distributions. However, continuous distributions have to be discretized because the corresponding measures cannot be defined on all subsets of their carriers. This paper proposes the use of synthetic topology to model continuous distributions for probabilistic computations in type theory. We study the initial σ-frame and the corresponding induced topology on arbitrary sets. Based on these intrinsic topologies, we define valuations and lower integrals on sets and prove versions of the Riesz and Fubini theorems. We then show how the Lebesgue valuation, and hence continuous distributions, can be constructed.

Type
Paper
Copyright
© The Author(s), 2021. Published by Cambridge University Press

Access options

Get access to the full version of this content by using one of the access options below. (Log in options will check for institutional or personal access. Content may require purchase if you do not have access.)

References

Altenkirch, T., McBride, C. and Swierstra, W. (2007). Observational equality, now! In: Proceedings of the 2007 Workshop on Programming Languages Meets Program Verification, PLPV 2007. ACM, 57–68. ISBN 9781595936776.Google Scholar
Altenkirch, T., Danielsson, N. A. and Kraus, N. (2017). Partiality, revisited - the partiality monad as a quotient inductive-inductive type. In: FOSSACS 2017, 534549.Google Scholar
Altenkirch, T., Capriotti, P., Dijkstra, G., Kraus, N. and Forsberg, F. N. (2018). Quotient inductive-inductive types. In: International Conference on Foundations of Software Science and Computation Structures. Springer, 293310.CrossRefGoogle Scholar
Anel, M. (2020). Computing enveloping ∞-topoi. href http://mathieu.anel.free.fr/mat/doc/Anel-2020-MURImeeting.pdf Google Scholar
Audebaud, P. and Paulin-Mohring, C. (2006). Proofs of randomized algorithms in Coq. In: MPC.Google Scholar
Bauer, A., Gross, J., Lumsdaine, P. L., Shulman, M., Sozeau, M. and Spitters, B. (2017). The HoTT library: A formalization of homotopy type theory in coq. In: Proceedings of the 6th ACM SIGPLAN Conference on Certified Programs and Proofs, CPP 2017. ACM, 164172. ISBN 978-1-4503-4705-1.CrossRefGoogle Scholar
Béguelin, S. Z. (2010). Formal Certification of Game-Based Cryptographic Proofs. PhD thesis, Ecole Nationale des Mines de Paris.Google Scholar
Bridges, D. and Richman, F. (1987). Varieties of Constructive Mathematics, vol. 97. Cambridge University Press.CrossRefGoogle Scholar
Coquand, T. (2019). Constructive Mathematics and Higher Topos Theory. http://www.cse.chalmers.se/coquand/birmingham.pdf Google Scholar
Coquand, T. and Palmgren, E. (2002). Metric boolean algebras and constructive measure theory. Archive for Mathematical Logic 41 (7) 687704.CrossRefGoogle Scholar
Coquand, T. and Spitters, B. (2009). Integrals and valuations. Journal of Logic and Analysis 1 (3) 122. ISSN 1759-9008.Google Scholar
Coquand, T., Mannaa, B. and Ruch, F. (2017). Stack semantics of type theory. In: 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS). IEEE, 111.CrossRefGoogle Scholar
Escardó, M. (2004). Synthetic topology: of data types and classical spaces. ENTCS 87 21156.Google Scholar
Escardó, M. and Xu, C. (2016). A constructive manifestation of the Kleene–Kreisel continuous functionals. Annals of Pure and Applied Logic 167 (9) 770793.CrossRefGoogle Scholar
Escardó, M. H. and Knapp, C. M. (2017). Partial elements and recursion via dominances in univalent type theory. In: Goranko, V. and Dam, M. (eds.), CSL 2017, vol. 82. LIPIcs. Schloss Dagstuhl, 21:1–21:16. ISBN 978-3-95977-045-3.Google Scholar
Faissole, F. and Spitters, B. (2018). Preuves constructives de programmes probabilistes. In: Presentation at JFLA 2018 - Journées Francophones des Langages Applicatifs. https://hal.inria.fr/hal-01654459 Google Scholar
Fourman, M. (1984). Continuous truth I: Non-constructive objects. In: Studies in Logic and the Foundations of Mathematics, vol. 112. Elsevier, 161180.CrossRefGoogle Scholar
Fourman, M. (2013). Continuous truth II: Reflections. In: WoLLIC.Google Scholar
Gilbert, G. (2016). Formalising real numbers in homotopy type theory. In: CPP 2017.Google Scholar
Giry, M. (1982). A categorical approach to probability theory. In: Categorical Aspects of Topology and Analysis. Springer, 6885.CrossRefGoogle Scholar
Heunen, C., Kammar, O., Staton, S. and Yang, H. (2017). A convenient category for higher-order probability theory. In: 2017 32nd Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), 112.CrossRefGoogle Scholar
Horn, A. and Tarski, A. (1948). Measures in Boolean algebras. Transactions of the American Mathematical Society 64 (3) 467497.CrossRefGoogle Scholar
Huang, D. (2017). On Programming Languages for Probabilistic Modeling. PhD thesis, Harvard (2017).Google Scholar
Huang, D., Morrisett, G. and Spitters, B. (2020). An application of computable distributions to the semantics of probabilistic programs. In: Barthe, G., Silva, A. and Katoen, J.-P. (eds.), Foundations of Probabilistic Programming.Google Scholar
Hyland, M. (1991). First steps in synthetic domain theory. In: Category Theory. Springer, 131156.CrossRefGoogle Scholar
Johnstone, P. T. (1979). On a topological topos. Proceedings of the London Mathematical Society 3 (2) 237271.CrossRefGoogle Scholar
Johnstone, P. T. (2002). Sketches of an Elephant: A Topos Theory Compendium, vol. 2. Oxford University Press.Google Scholar
Jones, C. and Plotkin, G. (1989). A probabilistic powerdomain of evaluations. In: LICS.Google Scholar
Jung, A., Moshier, M. A. and Vickers, S. (2008). Presenting dcpos and dcpo algebras. Electronic Notes in Theoretical Computer Science 218 209229.CrossRefGoogle Scholar
Lešnik, D. (2010). Synthetic Topology and Constructive Metric Spaces. Diss. University of Ljubljana. Google Scholar
Lumsdaine, P. and Shulman, M. (2017). Semantics of higher inductive types. Mathematical Proceedings of the Cambridge Philosophical Society 150.Google Scholar
Marsaglia, G. and Bray, T. A.. A convenient method for generating normal variables. SIAM Review 6 (3) 260264.CrossRefGoogle Scholar
Moggi, E. (1991). Notions of computation and monads. Information and Computation 93 (1) 5592.CrossRefGoogle Scholar
Plotkin, G. and Power, J. (2001). Adequacy for algebraic effects. In: International Conference on Foundations of Software Science and Computation Structures. Springer, 124.Google Scholar
Rijke, E. and Spitters, B. (2014). Sets in homotopy type theory. In: MSCS, Special Issue: From Type Theory and Homotopy Theory to Univalent Foundations.Google Scholar
Rosolini, G. (1986). Continuity and Effectiveness in Topoi. PhD thesis, University of Oxford.Google Scholar
Shulman, M. (2018). Brouwer’s fixed-point theorem in real-cohesive homotopy type theory. Mathematical Structures in Computer Science 28 (6) 856941.CrossRefGoogle Scholar
Shulman, M. (2019). All (,1) -Toposes have Strict Univalent Universes.Google Scholar
Spitters, B. and Van der Weegen, E. (2011). Type classes for mathematics in type theory. MSCS, special issue on ‘Interactive Theorem Proving and the Formalization of Mathematics’ 21 131.Google Scholar
Staton, S., Yang, H., Heunen, C., Kammar, O. and Wood, F. (2016). Semantics for probabilistic programming: higher-order functions, continuous distributions, and soft constraints. CoRR, abs/1601.04943.CrossRefGoogle Scholar
Sterling, J., Angiuli, C. and Gratzer, D. (2020). A cubical language for bishop sets. arXiv preprint arXiv:2003.01491.Google Scholar
Swan, A. and Uemura, T. (2019). On Church’s thesis in cubical assemblies. arXiv preprint arXiv:1905.03014.Google Scholar
The Univalent Foundations Program. (2013). Homotopy Type Theory: Univalent Foundations for Mathematics. http://homotopytypetheory.org/book, Institute for Advanced Study.Google Scholar
Van Der Hoeven, G. and Moerdijk, I. (1984). On choice sequences determined by spreads. The Journal of Symbolic Logic 49 (3) 908916.CrossRefGoogle Scholar
Vickers, S. (2008). A localic theory of lower and upper integrals. Mathematical Logic Quarterly 54 (1) 109123.CrossRefGoogle Scholar
Vickers, S. (2011). A Monad of Valuation Locales. http://www.cs.bham.ac.uk/sjv/Riesz.pdf Google Scholar