Bridge from Distribution to Mathlib's PMF and measures #
The finite layer of this library (Distribution, expect, prob, independent) is kept and
identified with Mathlib's measure-theoretic probability, so that Mathlib's theorems apply to it.
The sample type α carries any measurable structure in which singletons are measurable (on a
finite type every set is then measurable); ⊤ is the canonical choice.
Distribution.toPMF: the probability mass function of a distribution, withtoPMF_apply,toReal_toPMF_apply, and the compatibilitiestoPMF_uniform(PMF.uniformOfFintype),toPMF_point(PMF.pure) andtoPMF_map(PMF.map);Distribution.expect_eq_integral:p.expect f = ∫ a, f a ∂p.toPMF.toMeasure, andDistribution.prob_eq_toMeasure:p.prob s = (p.toPMF.toMeasure {a | s a}).toReal;Distribution.toMeasure_independent: the measure of the independent product isMeasure.piof the coordinate measures, henceDistribution.iIndepFun_independent: the coordinatesx ↦ Y i (x i)are independent random variables in Mathlib's sense (iIndepFun);Distribution.hoeffding: Hoeffding's inequality for independent bounded coordinates with arbitrary (non-identical) weights, derived from Mathlib'sProbabilityTheory.HasSubgaussianMGF.measure_sum_ge_le_of_iIndepFunthrough the bridge. It recovers the{0,1}uniform caseavg_hoeffding(checked at the end of this file).
The probability mass function #
The probability mass function of a finite distribution: the weights, as extended nonnegative reals.
Equations
- p.toPMF = PMF.ofFintype (fun (a : α) => ENNReal.ofReal (p.weight a)) ⋯
Instances For
The weights are recovered from the mass function.
The uniform distribution is Mathlib's PMF.uniformOfFintype.
A point mass is Mathlib's PMF.pure.
Transport along a function is Mathlib's PMF.map.
Expectation and probability #
Expectation is the Lebesgue integral against the induced measure.
The measure of a singleton is its weight.
Probability is the measure of the event.
Independence #
The independent product is the product measure: the measure induced by
independent p is Measure.pi of the coordinate measures.
Coordinates of the independent product are independent in Mathlib's sense: for any
observables Y i, the random variables x ↦ Y i (x i) are iIndepFun under the measure
induced by independent p.
Hoeffding's inequality through the bridge #
Hoeffding's inequality for independent bounded coordinates, from Mathlib's
HasSubgaussianMGF.measure_sum_ge_le_of_iIndepFun and Hoeffding's lemma
hasSubgaussianMGF_of_mem_Icc:
if Y i takes values in [a i, b i], then under independent p,
P(∑ Yᵢ ≥ ∑ 𝔼Yᵢ + λ) ≤ exp(-2λ² / ∑ (bᵢ - aᵢ)²). The coordinate laws p i may differ.