- Boxes
- definitions
- Ellipses
- theorems and lemmas
- Blue border
- the statement of this result is ready to be formalized; all prerequisites are done
- Orange border
- the statement of this result is not ready to be formalized; the blueprint needs more work
- Blue background
- the proof of this result is ready to be formalized; all prerequisites are done
- Green border
- the statement of this result is formalized
- Green background
- the proof of this result is formalized
- Dark green background
- the proof of this result and all its ancestors are formalized
- Dark green border
- this is in math-comp
\(\mathrm{bin\_ digit}(x, n)\) extracts the \(n\)-th binary digit of \(x \in [0,1)\) via the doubling map. \(\mathrm{bin\_ partial\_ sum}(d, n) = \sum _{i{\lt}n} d(i) \cdot 2^{-(i+1)}\) and \(\mathrm{bin\_ sum}(d) = \lim _n \mathrm{bin\_ partial\_ sum}(d, n)\).
For a measurable index type \(I\) and a family \(X : I \to \mathbf{QBS}\), the general coproduct \(\coprod _{i:I} X_i\) has carrier \(\{ i : I ~ \& ~ X_i\} \) (dependent sum). A random element \(\alpha \) factors as \(\alpha (r) = (P(r), F_{P(r)}(r))\) for measurable \(P : \mathbb {R} \to I\) and family \(F_i \in M_{X_i}\).
A quasi-Borel space (QBS) over \(R\) is a type \(T\) equipped with a set \(M_X \subseteq (\mathbb {R} \to T)\) of random elements satisfying three axioms:
Composition (qbs_Mx_comp): If \(\alpha \in M_X\) and \(f : \texttt{\{ mfun mR {\gt}-{\gt} mR\} }\) (a bundled measurable function), then \(\alpha \circ f \in M_X\).
Constants (qbs_Mx_const): For every \(x : T\), the constant function \(\lambda r.\; x\) is in \(M_X\).
Gluing (qbs_Mx_glue): If \(P : \texttt{\{ mfun mR {\gt}-{\gt} nat\} }\) and \(F_i \in M_X\) for all \(i\), then \(\lambda r.\; F_{P(r)}(r) \in M_X\).
The HB structure QBSpace packages this mixin with a short type name qbsType R. All type constructions (prodQ, expQ, unitQ, etc.) use the Section + HB.instance Definition pattern recommended by mathcomp maintainers.
For a QBS \(X\) with inhabitant \(x_0 : X\), the list QBS \(\mathrm{list}(X)\) has \(\alpha \) random iff there exist measurable \(\mathrm{len} : \mathbb {R} \to \mathbb {N}\) and random \(F_i \in M_X\) such that \(\alpha (r) = \mathrm{mkseq}(\lambda i.\; F_i(r), \mathrm{len}(r))\).
Given \(p : P(X \times \mathbb {R})\) with weight function \(w(r) = \mathrm{snd}(\alpha _p(r)) \geq 0\) and evidence \(Z = \int w \, d\mu _p \in (0,+\infty )\), the normalized measure is \(\nu (A) = \int _A (w/Z) \, d\mu _p\). This is a probability measure (\(\nu (\Omega ) = 1\)).
Given \(p = (\alpha , \mu )\) on \(X\) and \(f : X \to P(Y)\), the bind \(p \mathbin {{\gt}\! \! {\gt}\! \! =} f\) is \((\lambda r.\; \alpha _{f(\alpha (r))}(r),\; \mu )\). The key obligation is that the diagonal \(r \mapsto \alpha _{f(\alpha (r))}(r)\) is random in \(Y\).
Postcomposition with a measurable \(\psi : M \to M'\) commutes with the hom-set bijection on the measurable side: if \(f : X \to M\) is a QBS morphism into \(R(M)\), then \(\psi \circ f : X \to M'\) is a QBS morphism into \(R(M')\).
Precomposition with a QBS morphism \(\phi : X' \to X\) commutes with the hom-set bijection on the QBS side: if \(\phi \) is a QBS morphism and \(f : X \to M\) is a QBS morphism into \(R(M)\), then \(f \circ \phi : X' \to M\) is also a QBS morphism into \(R(M)\).
The measurable-preimage characterization transports along \(\phi \): if \(\phi : X' \to X\) is a QBS morphism and every measurable \(U \subseteq M\) has \(f^{-1}(U) \in L(X)\), then every measurable \(U\) has \((f \circ \phi )^{-1}(U) \in L(X')\).
Full commuting square for \(L \dashv R\) naturality: given a QBS morphism \(\phi : X' \to X\), a measurable \(\psi : M \to M'\), and a QBS morphism \(f : X \to M\) into \(R(M)\), the composite \(\psi \circ f \circ \phi \) is a QBS morphism \(X' \to R(M')\) and its measurable preimages land in \(L(X')\).
Genuine independence factorization. For random variables \(f : Z \to X\) and \(g : Z \to Y\) on a common probability space \(p : \mathrm{qbs\_ prob}(Z)\) that are independent in the sense of Definition 146, and real-valued test functions \(\phi : X \to \mathbb {R}\), \(\psi : Y \to \mathbb {R}\):
Unlike Lemma 147, the hypothesis qbs_indep is used non-trivially: the proof rewrites the joint integral against the pushforward \((f, g)_*(p)\) through the product \(f_*(p) \otimes g_*(p)\) via qbs_prob_equiv, then reduces to the product-measure factorization.
For functions \(f, g\) depending on disjoint coordinates of a product measure: \(\int _{p_X \otimes p_Y} f(x) \cdot g(y) = \mathbb {E}_{p_X}[f] \cdot \mathbb {E}_{p_Y}[g]\). This is product-measure factorization (a tautology of products), not a non-trivial statistical independence theorem – the lemma has no independence hypothesis. The genuine independence factorization, using the qbs_indep predicate, is Lemma 148.
A function \(f : X \to M\) is a QBS morphism \(X \to R(M)\) if and only if it pulls back measurable sets to \(L(X)\)-measurable sets:
Naturality of this bijection in both arguments is formalized by the five lemmas lr_adj_natural_dom, lr_adj_natural_dom_preimage, lr_adj_natural_cod, lr_adj_natural_cod_preimage, and lr_adj_natural_square below.
For \(s, s' \neq 0\):
where \(\mu _{\mathrm{new}} = \frac{m s'^2 + m' s^2}{s^2 + s'^2}\), \(\sigma _{\mathrm{new}} = \frac{s s'}{\sqrt{s^2 + s'^2}}\), and \(K\) is a scalar involving \(|m - m'|\) and \(\sqrt{s^2 + s'^2}\).
The joint integral equals the iterated integral: \(\int _{p \otimes q} h = \int _p \int _q h(x, y)\). This is a special case of Fubini for the specific QBS product measure construction, not the full Fubini theorem on arbitrary product measures.