## Abstract

This paper introduces a categorical framework to study the exact and approximate semantics of probabilistic programs. We construct a dagger symmetric monoidal category of Borel kernels where the dagger-structure is given by Bayesian inversion. We show functorial bridges between this category and categories of Banach lattices which formalize the move from kernel-based semantics to predicate transformer (backward) or state transformer (forward) semantics. These bridges are related by natural transformations, and we show in particular that the Radon-Nikodym and Riesz representation theorems - two pillars of probability theory - define natural transformations.

With the mathematical infrastructure in place, we present a generic and endogenous approach to approximating kernels on standard Borel spaces which exploits the involutive structure of our category of kernels. The approximation can be formulated in several equivalent ways by using the functorial bridges and natural transformations described above. Finally, we show that for sensible discretization schemes, every Borel kernel can be approximated by kernels on finite spaces, and that these approximations converge for a natural choice of topology.

We illustrate the theory by showing that our approximation scheme can be used in practice as an approximate Bayesian inference algorithm and as an approximation scheme for programs in the probabilistic network specification language ProbNetKAT.

With the mathematical infrastructure in place, we present a generic and endogenous approach to approximating kernels on standard Borel spaces which exploits the involutive structure of our category of kernels. The approximation can be formulated in several equivalent ways by using the functorial bridges and natural transformations described above. Finally, we show that for sensible discretization schemes, every Borel kernel can be approximated by kernels on finite spaces, and that these approximations converge for a natural choice of topology.

We illustrate the theory by showing that our approximation scheme can be used in practice as an approximate Bayesian inference algorithm and as an approximation scheme for programs in the probabilistic network specification language ProbNetKAT.

Original language | English |
---|---|

Pages (from-to) | 91-119 |

Number of pages | 29 |

Journal | Electronic Notes in Theoretical Computer Science |

Volume | 341 |

DOIs | |

Publication status | Published - 11 Dec 2018 |

Event | 34th Conference on the Mathematical Foundations of Programming Semantics (MFPS 2018) - Dalhousie University, Halifax, Canada Duration: 6 Jun 2018 → 9 Jun 2018 https://www.mathstat.dal.ca/mfps2018/ |

## Keywords

- Probabilistic programming
- probabilistic semantics
- Markov process
- Bayesian inference
- approximation