Papers
Topics
Authors
Recent
Search
2000 character limit reached

A cubical formalisation of conditional independence, Bayesian conditioning, and Pearl's d-separation soundness

Published 18 Jun 2026 in cs.LO and cs.PL | (2606.20351v1)

Abstract: The standard convex-algebra interchange axiom, common to probability-monad formalisations since Stone, is provably too weak to support full Bayesian conditioning. We make this precise in Cubical Agda: finite distributions as a higher inductive type, conditional independence as a cubical path between kernels, recursive Bayesian conditioning as a total function on a full-support fragment. Lifting conditioning to the full HIT exposes a structural mismatch -- the two halves of the rearranged 4-leaf mix carry distinct Bayesian weights related by Bayes' formula, not the single shared inner weight the standard axiom provides. We exhibit the minimal generalisation that resolves this and prove the standard form is the degenerate case where the two inner weights coincide. Around this observation we verify the algebraic context constructively, with zero postulates above an abstract ordered-field interface: bind commutativity, the four semi-graphoid axioms, intersection (reduced to contraction via structural $Σ$-witnesses, without positivity), Pearl's do-calculus Rules~1, 2, and~3 in kernel form, finite-type Bayesian conditioning, and Pearl's d-separation theorem (soundness) on arbitrary $n$-vertex finite directed acyclic graphs (DAGs) in both interventional and Bayesian forms. The probability monad is also verified as a Markov category; the abstract interface discharges at $Q$.

Authors (1)

Summary

  • The paper introduces a mechanized, type-theoretic framework that formalizes conditional independence, Bayesian conditioning, and Pearl’s d-separation soundness using Cubical Type Theory and higher inductive types.
  • It employs a novel probability monad encoded as a higher inductive type, incorporating generalized convex-algebra interchange axioms to support constructive probabilistic reasoning.
  • The framework verifies key probabilistic axioms and Pearl’s do-calculus rules, enabling executable causal inference through a reusable Cubical Agda library.

Cubical Formalisation of Conditional Independence, Bayesian Conditioning, and Pearl's d-Separation Soundness

Introduction and Motivation

The paper "A cubical formalisation of conditional independence, Bayesian conditioning, and Pearl's d-separation soundness" (2606.20351) presents a mechanized, type-theoretic approach to probabilistic reasoning, focusing on the formalization of conditional independence (CI), Bayesian conditioning, and the soundness of Pearl's d-separation principle. The work is situated in Cubical Type Theory (CTT) and leverages Higher Inductive Types (HITs), providing a setting that supports constructive proofs with computational content, enabling direct execution and verification of key probabilistic concepts.

The motivation is grounded in gaps identified in previous mechanized accounts, notably the limitations of the standard convex-algebra interchange axiom and traditional presentations of probability monads, particularly concerning the expressiveness required for Bayesian conditioning and algebraic manipulation underlying CI theorems. The paper addresses these limitations by generalizing algebraic axioms and providing a comprehensive framework that captures the computational and logical nuances required for encoding do-calculus and d-separation constructively.

Probability Monad as a HIT and Algebraic Structure

The probability monad is formalized via a HIT encoding the type of finite distributions. This construction introduces base constructors for point masses and convex combinations, and crucially, incorporates path constructors corresponding to convex algebra laws: idempotency, skew-commutativity, two boundary conditions, interchange (medial), and skew-associativity. The representation theorem FDist(Fin n)≃PMF(n)FDist(\mathrm{Fin}\ n) \simeq \mathrm{PMF}(n) ensures faithfulness, mapping the HIT to the standard simplex over finite types.

A notable point in the construction is the explicit inclusion of both the interchange and the skew-associativity axioms as primitives. The interchange axiom is pivotal for proofs about bind commutativity, essential for deriving symmetry of CI. All path-constructor equalities in the HIT structure translate to computational rules rather than mere propositional equalities, distinguishing this approach from extensional classical treatments.

The weight type is parameterized as an abstract ordered field, with the canonical instantiation at Q∩[0,1]\mathbb{Q} \cap [0,1], minimizing postulates and ensuring constructive viability, including mass-preserving operations required for categorical probability.

Conditional Independence as a Path Type

CI is encoded as a path between distribution kernels, specifically, CI(kXY,kX,kY)=∀z.  kXYz≡(kXz⊗DkYz)CI(k_{XY}, k_X, k_Y) = \forall z.\; k_{XY} z \equiv (k_X z \otimes_D k_Y z), extending the standard definition from pointwise probability mass functions to a functional, compositional, and computationally tractable form. This enables the systematic manipulation of CI witnesses via composition and transport, supporting the direct computation of posteriors and the algorithmic assembly of CI theorems.

The approach is robust to any model instantiating the abstract weight interface, enhancing generality while maintaining rigorous verification through the cubical machinery.

Verification of the Semi-Graphoid and Intersection Axioms

All four semi-graphoid axioms—symmetry, decomposition, weak union, and contraction—are mechanized and verified in this framework. Their derivation leans heavily on the commutativity of monadic bind, which in this cubical HIT setting is nontrivial and demands explicit use of the interchange axiom.

The intersection axiom, non-trivial in classical settings due to its traditional dependence on positivity and division, is proved under mild assumptions by reduction to contraction. The key insight is the use of Σ\Sigma-type witnesses for CI, translating Bayesian extraction into structural kernel decompositions witnessed explicitly in type theory, rather than relying on arithmetic manipulations of non-zero probabilities. This leads to a constructive account of intersection that is robust in the HIT setting and eschews non-constructive prerequisites.

Pearl's do-Calculus in Kernel Form

The kernel-level formalization of all three of Pearl’s do-calculus rules is given, capturing the algebraic essence of interventions and observation in SCMs directly within the monad/HIT setting. For Rules 1 and 3, the proofs are corollaries of monad laws and the main lemma (constBind), while Rule 2 leverages a structural CI witness in SCMs with confounding, yielding conditioning and intervention equivalence under independence.

The constructive encoding explicitly packages SCMs, interventions, and conditioning operations as compositional Agda data and functions, rendering the machinery executable and verifiable by the type checker. The treatment is compatible with Mahadevan's framework for Topos Causal Models, providing the constructive bottom layer on which more abstract topos-theoretic reasoning can be layered.

Generalized Interchange and Bayesian Conditioning

A major contribution is the formal identification and correction of a structural insufficiency in the standard convex-algebra interchange (medial) law for Bayesian conditioning. Bayesian conditioning, especially in recursive form over arbitrary mixes, exposes cases where the two inner weights in a 4-leaf mix differ and are related by Bayes’ theorem, contradicting the assumption of a single inner weight admitted by traditional interchange. The authors explicitly construct a generalized interchange axiom, showing that:

  • The standard interchange is a degenerate case of this more general law (when the two weights coincide).
  • Full support and HIT-lifting coherences for Bayesian conditioning require and are satisfied by this generalized law.

This is a bold claim: the standard convex-algebra interchange law is insufficient for full Bayesian conditioning. The minimal generalization provided is both necessary and sufficient, and all required computational content is discharged without additional postulates.

Markov Category Structure and Categorical Alignment

The HIT-based probability monad FDistFDist is shown to instantiate all axioms required of a Markov category, as defined by Fritz and by Cho–Jacobs. This includes the monoidal structure, copy, and delete morphisms, and, critically, the naturality of delete (i.e., total mass preservation), which is non-trivial and relies on the equational structure of FDistFDist enabled by HITs.

This alignment places FDistFDist, and thus all formalized CI, conditioning, and do-calculus results, directly within the synthetic probability framework, ensuring compatibility with categorical probability literature and techniques such as string diagrammatic reasoning.

Practical Implications and Library

All constructive proofs and operators, including Bayesian conditioning, CI, and d-separation soundness, are packaged as a reusable Cubical Agda causal inference library. The library exposes high-level APIs for SCM construction, inference computations, and machine-checked d-separation certificates, and can serve as a backend for probabilistic programming systems, offering a path to formally verified statistical AI systems.

Limitations and Future Directions

While the framework covers the soundness direction of d-separation for arbitrary finite DAGs, it does not address the completeness (faithfulness) component, which requires explicit construction of distributions violating CI on non-d-separated tuples. Additionally, only the structural-to-quantitative CI direction is mechanized; reverse extraction of factor kernels from path-typed CI under positivity is left for future work.

Continuous distributions, higher-order probabilistic effect semantics, and statistical causal discovery from data are beyond the present scope but are immediately relevant directions, leveraging the categorical layering and the HIT foundation established.

Conclusion

This work provides a comprehensive, constructive formalization of probabilistic reasoning primitives—including conditional independence, Bayesian conditioning, and d-separation soundness—within Cubical Agda by means of higher inductive types and generalizations of convex algebraic laws. The identification and formal rectification of the insufficiency of the standard interchange axiom for Bayesian conditioning settles a foundational issue in monadic probability formalization. The resulting type-theoretic framework aligns with categorical probability theory and demonstrates executable, verified causal inference in finite settings, thus representing a robust foundation for the mechanized study of probabilistic and causal systems (2606.20351).

Paper to Video (Beta)

No one has generated a video about this paper yet.

Whiteboard

No one has generated a whiteboard explanation for this paper yet.

Open Problems

We haven't generated a list of open problems mentioned in this paper yet.

Collections

Sign up for free to add this paper to one or more collections.

Tweets

Sign up for free to view the 2 tweets with 6 likes about this paper.