Bayesian Updating with Contextful Arrows
Version 1 / Nov 24, 2026 / CC BY 4.0
Abstract
Many formulations of Bayesian updating with Markov categories are known, among them the dagger on probability spaces, Bayesian lenses and their dependent version, the recursion of the Bayes filter and conditional composition. A question common to many of them is how to make updating compositional, so that a posterior becomes the next prior; the author's earlier work also raised it, as the relation between sequential and batch updating. This paper gives one answer by composing contextful arrows. The states of a Markov category form a base , and their lifts, the joint states with a given marginal, form a presheaf on . A foot makes a contextful arrow : the marginal foot recovers the chain rule of Bayesian lenses, and the joint foot makes each joint state the next state. With the joint foot, the lifts to an object give a strong monoidal functor from to the monoidal category of contextful arrows on , whose runs are conditional composites. Through the symmetry of becomes a swap of two lifts, and this swap is a Bayesian inversion. The coherence of then gives the agreement of sequential and batch updating and recovers the recursion of the Bayes filter. These facts are known; here they follow from one strong monoidal functor.
Provenance statement
References
- D. Braithwaite, J. Hedges. Dependent Bayesian lenses: categories of bidirectional Markov kernels with canonical Bayesian inversion. Preprint, arXiv:2209.14728 (https://arxiv.org/abs/2209.14728), 2022.arXiv
- D. Braithwaite, J. Hedges, T. St Clere Smithe. The compositional structure of Bayesian inference. In MFCS 2023 , LIPIcs 272, 24:1--24:15, 2023.
- F. Clerc, V. Danos, F. Dahlqvist, I. Garnier. Pointless learning. In FoSSaCS 2017 , Lecture Notes in Comput. Sci. 10203, Springer, 2017.
- K. Cho, B. Jacobs. Disintegration and Bayesian inversion via string diagrams. Math. Struct. Comput. Sci. 29(7), 938--971, 2019.
- M. Capucci, D. J. Myers. Contextads as wreaths; Kleisli, Para, and Span constructions as wreath products. Preprint, arXiv:2410.21889v1 (https://arxiv.org/abs/2410.21889v1), 2024. Numbers refer to v1.arXiv
- E. Di Lavore, M. Román, P. Sobociński. Partial Markov categories. Preprint, arXiv:2502.03477 (https://arxiv.org/abs/2502.03477), 2025. Numbers refer to v5.arXiv
- T. Fritz, A. Klingler, D. McNeely, A. Shah-Mohammed, Y. Wang. Hidden Markov models and the Bayes filter in categorical probability. Preprint, arXiv:2401.14669 (https://arxiv.org/abs/2401.14669), 2024. Numbers refer to v3.arXiv
- M. Fréchet. Sur les tableaux de corrélation dont les marges sont données. Ann. Univ. Lyon, Sect. A (3) 14, 53--77, 1951.
- T. Fritz. A synthetic approach to Markov kernels, conditional independence and theorems on sufficient statistics. Adv. Math. 370, 107239, 2020.
- B. Jacobs. The mathematics of changing one's mind, via Jeffrey's or via Pearl's update rule. J. Artif. Intell. Res. 65, 783--806, 2019.
Show all 16 referencesShow fewer references
- A. Joyal, R. Street. The geometry of tensor calculus, I. Adv. Math. 88(1), 55--112, 1991.
- K. Kamiya, J. Welliaveetil. A category theory framework for Bayesian learning. Preprint, arXiv:2111.14293 (https://arxiv.org/abs/2111.14293), 2021.arXiv
- H. V. Lê. Batch learning equals online learning in Bayesian supervised learning. Preprint, arXiv:2510.16892 (https://arxiv.org/abs/2510.16892), 2025.arXiv
- P. Selinger. A survey of graphical languages for monoidal categories. In New Structures for Physics , Lecture Notes in Phys. 813, 289--355, Springer, 2011.
- T. St Clere Smithe. Bayesian updates compose optically. Preprint, arXiv:2006.01631 (https://arxiv.org/abs/2006.01631), 2020. Numbers refer to v2.arXiv
- T. St Clere Smithe. Mathematical foundations for a compositional account of the Bayesian brain. PhD thesis, University of Oxford, arXiv:2212.12538 (https://arxiv.org/abs/2212.12538), 2022.arXiv
Version history
- v1 · 15 pagesSubmitted by Kotaro Kamiya15 pages. Related earlier work: K. Kamiya and J. Welliaveetil, A category theory framework for Bayesian learning, arXiv:2111.14293.CurrentNov 24, 2026