Lectures onType Theory
Chapter 180
Chapter 180Optional

Dependent Probability and Fibred Measure

Prerequisites. Direct starred prerequisites: chapter 174. No later core chapter depends on this route.

Fix a two-point base Z={0,1} and a family over it: B(0)={} and B(1)={L,R}. Put a probability measure on each fibre: μ0()=1 and μ1(L)=μ1(R)=1/2. Substituting into the base is composing with a function into Z: with u:{a,b,c}Z given by u(a)=0, u(b)=1, u(c)=0, the family uB has (uB)(a)={}, (uB)(b)={L,R}, (uB)(c)={}, and the reindexed measure uμ assigns to each index the measure of its image. Substituting again along v:{p,q}{a,b,c} with v(p)=b and v(q)=c gives (uv)μ:p{L:12, R:12},q{:1},v(uμ):p{L:12, R:12},q{:1}. The two printed maps are equal, entry by entry.

That they are equal is not a general fact about probability monads; it is a fact about this presentation of families. A family of spaces indexed by a base is usually presented by a display map d:AΓ, and substitution along θ:ΔΓ is a chosen pullback. Pullbacks are determined only up to isomorphism, so two ways of substituting twice agree up to a canonical isomorphism and not on the nose, and the isomorphisms must then be carried through every construction that follows — including the measures, which would agree only after transport. The equality displayed above would become an isomorphism, and the practical checker printing the two maps would have to compare them modulo a coercion.

The obstruction is therefore strictness, and the object that removes it is a presentation of families in which reindexing is defined by composition and is strictly functorial by construction. This chapter builds that presentation over quasi-Borel spaces, lifts measures and probability measures into it, proves the reindexing laws as commuting squares, and states the conditional expectation results whose hypotheses the fibred setting makes visible.

Convention 180.1 — Imported interface

From chapter 174 this chapter uses quasi-Borel spaces (definition 174.6), their products and exponentials (proposition 174.8, proposition 174.10), measures on them (definition 174.12), and the probability monad with its laws (theorem 174.16, proposition 174.17); through that chapter it uses PMK-map and PMK-bind of convention 172.27. It uses no program logic, no inference transformation, and no result about SFPC.

Reindexing, computed before it is abstracted

Definition 180.2 — Families of measures and their reindexing

Let Γ be a set. A family of measure spaces over Γ is an assignment γAγ of a measurable space to each index, together with a measure μγ on Aγ. For θ:ΔΓ, the reindexed family is (θA)δ=Aθ(δ) with (θμ)δ=μθ(δ).

Proposition 180.3 — Strict functoriality

For φ:ΞΔ and θ:ΔΓ, φ(θA)=(θφ)A,φ(θμ)=(θφ)μ,idA=A,idμ=μ, as equalities of families, not merely as isomorphisms.

Proof of Proposition 180.3 — Strict functoriality

Proof. Evaluate at an index: (φ(θA))ξ=(θA)φ(ξ)=Aθ(φ(ξ))=((θφ)A)ξ, and the same computation with μ in place of A. The identity laws are immediate. ◻

Example 180.4 — The opening calculation, as an instance

Take Γ=Z, A and μ as in the chapter opening, and u,v as displayed. Proposition 180.3 gives (uv)μ=v(uμ) directly, and evaluating at p and q: ((uv)μ)p=μu(v(p))=μu(b)=μ1={L:12,R:12},((uv)μ)q=μu(c)=μ0={:1}. No transport and no coercion appears. The equality is the one the practical checker of exercise 180.8 compares, and the general statement it instantiates is proposition 180.3.

Remark 180.5 — What the display-map presentation would give instead

Presenting the same data by the display map d:γAγΓ and defining θ as a chosen pullback yields, for two composable substitutions, a canonical isomorphism φ(θA)(θφ)A rather than an equality, because a pullback is determined only up to isomorphism. Every later construction — the measure, the conditional expectation, the interpretation of a dependent type — then carries a coherence obligation. Definition 180.2 avoids the obligation by defining reindexing as composition; the work of the next section is to carry that definition into the quasi-Borel setting, where a family must also record which functions of a real parameter count as random.

Quasi-Borel families

Definition 180.6 — Quasi-Borel family

Let Γ be a quasi-Borel space with random elements MΓ. A quasi-Borel family over Γ, written ΓA, is a family (Aγ)γΓ of sets together with, for each υMΓ, a set RAυrRAυ(r) of fibred random elements, subject to three axioms mirroring definition 174.6:

  1. constants: for a constant υ=λr.γ, every constant function λr.a with aAγ lies in RAυ;

  2. precomposition: if αRAυ and f:RR is measurable, then αfRAυf;

  3. recombination: if R=iSi is a countable Borel partition, αiRAυi, and υ is the corresponding gluing of the υi, then the gluing of the αi lies in RAυ.

A map of families (θf):(ΓA)(ΔB) consists of a function θ:ΓΔ with θυMΔ for every υMΓ, and a family of functions fγ:AγBθ(γ) such that fαRBθυ for every αRAυ.

Example 180.7 — Constant and preimage families

A quasi-Borel space X gives the constant family Aγ=X with RAυ=MX; the axioms are those of definition 174.6. A morphism d:AΓ gives the preimage family d1[γ]={ad(a)=γ} with Rd1[]υ the random elements βMA with dβ=υ, read as functions into the fibres. The first is how a closed type enters a dependent context; the second is how an ordinary display map is presented as a family.

Definition 180.8 — Reindexing and comprehension

For θ:ΓΔ a morphism of quasi-Borel spaces and ΔB, define ΓB[θ] by B[θ]γ=Bθ(γ),RB[θ]υ=RBθυ. For ΓA, define the comprehension Γ.A=γΓAγ with random elements MΓ.A={λr.υ(r),α(r)|υMΓ, αRAυ}, and let dispA:Γ.AΓ be the first projection.

Proposition 180.9 — The family fibration is split, and comprehension is a morphism

B[θ] is a quasi-Borel family; reindexing is strictly functorial, B[θ][φ]=B[θφ] and B[id]=B; Γ.A is a quasi-Borel space; and dispA is a morphism.

Proof of Proposition 180.9 — The family fibration is split, and comprehension is a morphism

Proof. B[θ] is a family. Constants: a constant υ=λr.γ has θυ constant at θ(γ), so the constant functions into Bθ(γ)=B[θ]γ lie in RBθυ=RB[θ]υ. Precomposition: RB[θ]υf=RBθυf, which contains αf for αRBθυ. Recombination: the gluing of θυi is θ(gluing of υi), so the axiom for B applies verbatim.

Strictness. B[θ][φ]ξ=B[θ]φ(ξ)=Bθ(φ(ξ))=B[θφ]ξ, and RB[θ][φ]υ=RBθφυ=RB[θφ]υ. Both components are equal, so the families are equal; the identity case is the same computation.

Comprehension. The three axioms for MΓ.A follow from the corresponding axioms for MΓ and for RA, taken in pairs: a constant pair is a pair of constants; precomposition acts on both components; and a countable Borel gluing of pairs is the pair of gluings, which is where axiom (iii) of definition 180.6 is used. Finally dispAλr.υ(r),α(r)=υMΓ, so the display map is a morphism. ◻

Remark 180.10 — What splitness buys, stated exactly

Proposition 180.9 is the fibred form of proposition 180.3: substitution into a dependent type is composition in the index, so iterated substitution is associative on the nose. This is the property that Ahman–Kammar–Møgelberg’s Theorem 13 states, along with the fibred equivalence between this presentation and the codomain fibration over quasi-Borel spaces — the two present the same families, but only the first is split. The chapter uses splitness, not the equivalence.

Fibred measures

Definition 180.11 — The fibred distribution and probability families

For ΓA define ΓDA by (DA)γ=D(Aγ), the measures on the fibre in the sense of definition 174.12, with RDAυ={α|βRAυ. α=qDβ}, where qD sends a fibred random element to the measure it presents. Define ΓPA in the same way with probability measures. The unit and Kleisli extension are those of theorem 174.16 applied fibrewise: ηγ(a)=δa and (μ=f)γ=μγ=fγ.

Proposition 180.12 — Reindexing commutes with the fibred monads

For θ:ΓΔ and ΔB, D(B[θ])=(DB)[θ],P(B[θ])=(PB)[θ], as equalities of families, and the unit and Kleisli extension are preserved: ηB[θ]=ηB[θ] and (μ=f)[θ]=μ[θ]=f[θ].

Proof of Proposition 180.12 — Reindexing commutes with the fibred monads

Proof. On fibres, D(B[θ])γ=D(Bθ(γ))=(DB)θ(γ)=(DB)[θ]γ. On fibred random elements, RD(B[θ])υ={qDββRB[θ]υ}={qDββRBθυ}=RDBθυ=R(DB)[θ]υ. Both components agree, so the families are equal. The unit and Kleisli extension are defined fibrewise, and reindexing only renames fibres, so the two displayed equations hold at every index; the square index γ  θ(γ)commutes withμ  μ=f because both operations act on the index and on the fibre independently. ◻

Example 180.13 — The fixture, fibrewise and in the fibration

Discrete spaces are quasi-Borel spaces with all functions random, so the opening data is a quasi-Borel family with a fibred probability measure Zμ:PB. Proposition 180.12 gives P(B[uv])=(PB)[uv]=((PB)[u])[v] by proposition 180.9, and evaluating the fibred measure at the two indices reproduces example 180.4. The general finite statement proved in proposition 180.3 is thus an instance of the fibred one, and the checker’s structural equality of printed maps is legitimate exactly because the two sides are equal rather than isomorphic.

Convention 180.14 — Imported fibred structure

Theorem 33 of Ahman, Kammar and Møgelberg is imported at exactly this signature: D and P define commutative fibred monads on the category of quasi-Borel families, and the fibres of the distribution monad satisfy Kock’s axioms for synthetic measure theory, that is, for every countable set I there are canonical isomorphisms ΓD(iIAi)iID(Ai). Proposition 180.12 proves the reindexing half locally; commutativity in each fibre is proposition 174.17; what the import supplies is that these fit together as fibred monads and that the countable coproduct isomorphisms exist at the fibred signature. The synthetic axioms are therefore consequences of the construction rather than postulates: the coproduct isomorphism is countable additivity, and commutativity is Tonelli’s theorem, as remark 174.24 recorded.

Conditional expectation in the fibration

The fibred setting makes an observation map into a term ΓH:ΩΘ between two families, and a conditional expectation into a term of a function type. Two statements are imported at their exact signatures; both are recorded with every hypothesis they carry.

Convention 180.15 — Externalisation

Their Proposition 40: let ΓΩ and ΓΘ be quasi-Borel families, Γμ:PΩ a fibred probability measure, and ΓH:ΩΘ a fibred observation map. For each index γ, let BΩγ and BΘγ be the σ-algebras of the free measurable spaces on the fibres and let Gγ=Hγ1BΘγBΩγ. Then for integrable fibred random variables Γf:L1(Ω,μ) and Γg:L1(Θ,μH), (γ. gγ=Eμγ[fH])(γ. gγHγ=Eμγ[fγGγ]), so the fibred notion and the classical sub-σ-algebra notion agree index by index. What the import supplies is the passage between the two notions; the classical properties — almost sure uniqueness, linearity — then transfer through it. Almost sure uniqueness at a fixed index is the following argument, recorded here so that the chapter does not depend on it from elsewhere: if g and g both satisfy H1(A)fdμ=AgdμH for every measurable A, then A(gg)dμH=0 for every A; taking A={g>g} and then A={g>g} makes both sets μH-null.

Convention 180.16 — Measurable conditional expectation

Their Theorem 41: if the observation family Θ is separable, then conditional expectation is a dependent function in the fibration, ΓE[]: (μ:PΩ)(H:ΩΘ)Separable(Θ,μH)(f:L1(Ω,μ))Σg:L1(Θ,μH). g=Eμ[fH], and in particular, when Θ is a standard Borel space, the separability argument may be omitted. The hypotheses are exactly: separability of the observation family with respect to the pushforward measure μH, and integrability of f with respect to μ. Their proof constructs the conditional expectation first for square-integrable variables, using a measurable Schauder basis of L2(Θ,μH) and the projection i<kf,φiHφi, and then takes limits of Eμ[f±nH] for integrable variables; every stage is a term in context, which is what makes the result a dependent function rather than a family of choices.

Remark 180.17 — Separability is not decorative

Without separability the conditional expectation still exists at each fixed index — it is the Radon–Nikodym derivative of AH1(A)fdμ with respect to μH — but only as a choice at that index, determined up to a null set by the uniqueness argument of convention 180.15. Assembling those choices into a single term requires that the choices be made measurably in the index, and that is what the separability hypothesis and the measurable Schauder basis provide. This is the exact point at which the dependent setting demands more than the fibrewise classical theory.

Remark 180.18 — Semantic families are not a surface language

Everything above is semantic: quasi-Borel families, fibred measures, and terms in context are objects of a fibration, and the notation Γt:A names an element, not a derivation in a typed probabilistic programming language. No preservation, progress, inference, normalization, or implementation-correctness claim is made here for any surface syntax; such a claim would require a language, an operational semantics, and an interpretation theorem, none of which this chapter constructs. The martingale definition that the source derives — Efμ[ftHt]=ft for the restriction maps Ht — is likewise a semantic statement in the fibration, not a typing rule.

Exercise 180.1

★☆☆ Verify proposition 180.3 on the opening data with a third substitution w:{s}{p,q}, w(s)=p, by computing both ((uv)w)μ and w(v(uμ)).

Exercise 180.2

★★☆ For the display map d:{(0,),(1,L),(1,R)}{0,1} of the opening example, write out the preimage family of example 180.7 and check that its fibred random elements satisfy the three axioms of definition 180.6.

Exercise 180.3

★★☆ Compute Γ.A and dispA for the opening family, and exhibit a random element of Γ.A whose two components are a constant and a nonconstant map.

Suggested first pass.

None of these problems is a prerequisite for a later chapter. Begin with exercise 180.4, then exercise 180.5, then the practical project exercise 180.8.

Exercise 180.4

★☆☆ Prove proposition 180.3 for arbitrary finite index sets, displaying the evaluation at a generic index, and state where the proof would break if reindexing were defined by a chosen pullback.

Exercise 180.5

★★☆ Write out the proof of proposition 180.12 for the two substitutions of the chapter opening, displaying the fibred random elements on both sides at the index p.

Exercise 180.6

★★☆ Give two families that are isomorphic but not equal, arising from two different choices of pullback along the same substitution, and exhibit the coercion that a non-split presentation would require in example 180.4.

Exercise 180.7

★★☆ For the opening family with Θγ={} and H the unique map, compute the fibred conditional expectation of a bounded f and check the equivalence of convention 180.15 at both indices.

Exercise 180.8

★★★ Practical project.fibred-reindexing-checker Build a checker for finite fibred reindexing. Its inputs are a finite base set with a finite family of finite fibres, an exact rational probability measure on each fibre, and a chain of substitutions given as explicit finite maps. Its outputs are the two normalized finite maps obtained by reindexing once along the composite and twice along the factors, printed as sorted association lists from index to fibre measure with reduced rational masses.

The invariant to maintain is that every printed fibre measure sums to exactly 1, that reindexing never renames fibre elements, and that the two printed maps are compared by structural equality of the normalized representation, not by numerical tolerance.

The concrete result is the pair of printed maps for the chapter’s fixture: base Z={0,1} with B(0)={}, B(1)={L,R}, μ0()=1, μ1(L)=μ1(R)=1/2; the substitutions u:{a,b,c}Z with u(a)=0,u(b)=1,u(c)=0 and v:{p,q}{a,b,c} with v(p)=b,v(q)=c. The acceptance test is decidable and exact: both (uv)μ and v(uμ) must print exactly p{L:1/2, R:1/2}; q{:1}, and the checker must report structural equality; it must additionally reject an input whose fibre masses sum to 3/4, naming the defective index, and reject a substitution whose codomain does not match the base, naming the offending point. The written solution proves the general finite functoriality of proposition 180.3 before appealing to the quasi-Borel construction of proposition 180.9, and the checker establishes neither convention 180.14 nor convention 180.16.

Search the book

Type to search the local edition.