Synthetic topology in Homotopy Type Theory for probabilistic programming Martin Bidlingmaier Florian Faissole Bas Spitters 1907.10674 1/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 1 / 27
Monadic programming with effects Moggi’s computational λ -calculus Kleisli category of a monad: Obj ( C T ) = Obj ( C ) ; C T ( A, B ) = C ( A, T ( B )) . Used for: Partial functions: X + ⊥ State: ( X × S ) S Non-determinism: P ( X ) Discrete probabilities: convex ( X ) 2/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 2 / 27
Probability theory Classical probability: measures on σ -algebras of sets σ -algebra: collection closed under countable � , � measure: σ -additive map to R . Giry monad: X �→ Meas ( X ) is a monad. . . . . . on measurable spaces, . . . on subcategories of topological spaces or domains. valuations restrict measures to open sets. Problem 1: Meas is not CCC Problem 2: Not a monad on Set Use a synthetic approach 3/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 3 / 27
Plan Plan: Develop a richer semantics using topos theory Synthetic topology and its models Probability theory using synthetic topology Use HoTT to formalize this Both computable and topological semantics 4/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 4 / 27
Synthetic topology 5/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 5 / 27
Synthetic topology Scott: Synthetic domain theory Domains as sets in a topos (Hyland, Rosolini, ...) By adding axioms to the topos we make a DSL for domains. Synthetic topology (Brouwer, ..., Escardo, Taylor, Vickers, Bauer, ..., Leˇ snik) Every object carries a topology, all maps are continuous � ⊙ � Idea: Sierpinski space S = . classifies opens: O ( X ) ∼ = X → S Convenient category of/type theory for ‘topological’ spaces. Synthetic (real) computability semi-decidable truth values S classify semi-decidable subsets. Common generalization based on abstract properties for S ⊂ Ω : Dominance axiom: monos classified by S compose. 6/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 6 / 27
Synthetic topology Ambient logic: predicative topos (hSets). Assumption : free ω -cpo completions exist. This follows from: QIITs [ADK16] countable choice impredicativity classical logic The ω -cpo completion of 1 is a dominance. 7/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 7 / 27
More axioms for synthetic topology Definition A space X is metrizable if its intrisic topology, given by X → S , coincides with a metric topology. The fan principle: Fan : 2 N is metrizable and compact Intuitionistic, will be used for the synthetic Lebesgue measure. Fix such a topos where every object comes with a topology. 8/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 8 / 27
Models for synthetic topology Standard axioms for continuous computations: Brouwer, Kleene-Vesley K 2 -realizability (TTE) Gives a realizability topos CAC ⊢ S is the set of increasing binary sequences modulo α ∼ β iff there exists n , αn = βn = 1 . 9/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 9 / 27
Big Topos Topological site: A category of topological spaces closed under open inclusions Covering by jointly epi open inclusions Big topos: sheaves over such a site S is Yoneda of the Sierpinski space Fourman: Model for intuitionism: all maps are continuous Convenient category: Nice category vs nice objects 10/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 10 / 27
Valuation monad 11/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 11 / 27
Valuations and Lower integrals Lower Reals: Dedekind Reals: r : R l := Q → S R D ⊂ ( Q → S ) × ( Q → S ) � �� � � �� � ∀ p, r ( p ) ⇐ ⇒ ∃ q, ( p < q ) ∧ r ( q ) . lower real upper real � lower semi-continuous topology. Valuations: Integrals: Valuations on A : Set : Positive integrals: V al ( A ) = ( A → S ) → R + Int + ( A ) = ( A → R + D ) → R + l D � µ ( ∅ ) = 0 ( λx. 0) = 0 Modularity Additivity Monotonicity Monotonicity ω -continuity ω -continuity Riesz theorem: homeomorphism between integrals and valuations. Constructive proof (Coquand/S): A regular compact locale. 12/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 12 / 27
Valuations and Lower integrals Lower Reals: Dedekind Reals: r : R l := Q → S R D ⊂ ( Q → S ) × ( Q → S ) � �� � � �� � ∀ p, r ( p ) ⇐ ⇒ ∃ q, ( p < q ) ∧ r ( q ) . lower real upper real � lower semi-continuous topology. Valuations: Lower integrals: Valuations on A : Set : Positive integrals: V al ( A ) = ( A → S ) → R + Int + ( A ) = ( A → R + l ) → R + l l � µ ( ∅ ) = 0 ( λx. 0) = 0 Modularity Additivity Monotonicity Monotonicity ω -continuity ω -continuity Riesz theorem: homeomorphism between integrals and valuations. Constructive proof by Vickers: A locale. Here: synthetically. 13/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 13 / 27
Analysis based on S HoTT book: ‘one experiment with QIITs is enough. . . ’ We’ve done the experiment: We’ve learned: the lower reals are the ω -cpo completion of Q avoid countable choice by indexing by S similarity with geometric reasoning (open power set, no choice) 14/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 14 / 27
Lebesgue valuation Fubini: the monad is (almost) commutative So far, classically, ω -supported discrete valuations. To construct the Lebesgue valuation we use the fan principle: the locale 2 ω is spatial. 15/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 15 / 27
Probabilistic programming 16/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 16 / 27
Monadic semantics Kleisli category: Giry monad: (space) � (space of its valuations): functor M : Space → Space . unit operator η x = δ x (Dirac) � bind operator ( µ >> = M )( f ) = λx. ( Mx ) f . µ ( >> =) :: M A → ( A → M B ) → M B . 17/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 17 / 27
Function types To interpret the full computational λ -calculus we need T -exponents ( A → TB ) as objects. The standard Giry monads do not support this. hSet is cartesian closed, so we obtain a higher order language. Moreover, the Kleisli category is ω -cpo enriched (subprobability valuations), so we can interpret PCF with fix [Plotkin-Power]. Rich semantics for a programming language. 18/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 18 / 27
Unfolding Huang developed an efficient compiled higher order probabilistic programming language: augur/v2 Semantics in topological domains (domains with computability structure) Theorem (Huang/Morrisett/S) Markov’s Principle ⊢ The interpretation of the monadic calculus in the K2-realizability topos gives the same interpretation as in topological domains. 19/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 19 / 27
Finally: HoTT. . . 20/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 20 / 27
Type theory Formalizing this construction in homotopy type theory. Correctness, proof assistant for continuous probabilistic programs Programming language with an expressive type system Potentially: type theory based on K2 (as in Prl) 21/27 Martin Bidlingmaier, Florian Faissole, Bas Spitters Synthetic topology in Homotopy Type Theory for probabilistic programming 1907.10674 21 / 27
Recommend
More recommend