Bayesian Updating with Contextful Arrows

A mix of human-written and AI-generated textHuman understanding: all partsmath.CT — Category Theorymath.ST — Statistics Theory

Contributed by Kotaro Kamiya ↗

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 C\mathcal{C} form a base B=(I/C)op\mathcal{B}=(I/\mathcal{C})^{\mathrm{op}}, and their lifts, the joint states with a given marginal, form a presheaf LL on B\mathcal{B}. A foot makes LL a contextful arrow B→B\mathcal{B}\to\mathcal{B}: 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 YY give a strong monoidal functor KK from C\mathcal{C} to the monoidal category of contextful arrows on B\mathcal{B}, whose runs are conditional composites. Through KK the symmetry of C\mathcal{C} becomes a swap of two lifts, and this swap is a Bayesian inversion. The coherence of KK 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.

Author comments: 15 pages. Related earlier work: K. Kamiya and J. Welliaveetil, A category theory framework for Bayesian learning, arXiv:2111.14293.

Provenance statement

This work was produced by the author with an AI agent based on a large language model. The author set the research direction, posed the questions and made the decisions on scope, structure and notation. The agent wrote drafts of the text, proofs and figures, and the author directed their revision through repeated rounds of close reading. The final text therefore results from the author's corrections to sentences, notation and figures. The agent also checked the drafts against the cited literature and kept notation, cross-references and the build consistent. Independent instances of the agent reviewed the drafts and tried to refute proofs, and the gaps they found were fixed.

References

  1. 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
  2. D. Braithwaite, J. Hedges, T. St Clere Smithe. The compositional structure of Bayesian inference. In MFCS 2023 , LIPIcs 272, 24:1--24:15, 2023.
  3. F. Clerc, V. Danos, F. Dahlqvist, I. Garnier. Pointless learning. In FoSSaCS 2017 , Lecture Notes in Comput. Sci. 10203, Springer, 2017.
  4. K. Cho, B. Jacobs. Disintegration and Bayesian inversion via string diagrams. Math. Struct. Comput. Sci. 29(7), 938--971, 2019.
  5. 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
  6. 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
  7. 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
  8. 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.
  9. T. Fritz. A synthetic approach to Markov kernels, conditional independence and theorems on sufficient statistics. Adv. Math. 370, 107239, 2020.
  10. 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
  1. A. Joyal, R. Street. The geometry of tensor calculus, I. Adv. Math. 88(1), 55--112, 1991.
  2. K. Kamiya, J. Welliaveetil. A category theory framework for Bayesian learning. Preprint, arXiv:2111.14293 (https://arxiv.org/abs/2111.14293), 2021.arXiv
  3. H. V. Lê. Batch learning equals online learning in Bayesian supervised learning. Preprint, arXiv:2510.16892 (https://arxiv.org/abs/2510.16892), 2025.arXiv
  4. P. Selinger. A survey of graphical languages for monoidal categories. In New Structures for Physics , Lecture Notes in Phys. 813, 289--355, Springer, 2011.
  5. T. St Clere Smithe. Bayesian updates compose optically. Preprint, arXiv:2006.01631 (https://arxiv.org/abs/2006.01631), 2020. Numbers refer to v2.arXiv
  6. 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

  1. 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