Documentation

Dynamics.BridgePMF

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.

The probability mass function #

noncomputable def Dynamics.Distribution.toPMF {α : Type u_1} [Fintype α] (p : Distribution α) :
PMF α

The probability mass function of a finite distribution: the weights, as extended nonnegative reals.

Equations
Instances For
    theorem Dynamics.Distribution.toPMF_apply {α : Type u_1} [Fintype α] (p : Distribution α) (a : α) :
    @[simp]
    theorem Dynamics.Distribution.toReal_toPMF_apply {α : Type u_1} [Fintype α] (p : Distribution α) (a : α) :
    (p.toPMF a).toReal = p.weight a

    The weights are recovered from the mass function.

    The uniform distribution is Mathlib's PMF.uniformOfFintype.

    theorem Dynamics.Distribution.toPMF_point {α : Type u_1} [Fintype α] [DecidableEq α] (a : α) :

    A point mass is Mathlib's PMF.pure.

    theorem Dynamics.Distribution.toPMF_map {α : Type u_1} {β : Type u_2} [Fintype α] [Fintype β] [DecidableEq β] (p : Distribution α) (f : α → β) :
    (p.map f).toPMF = PMF.map f p.toPMF

    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.

    theorem Dynamics.Distribution.iIndepFun_independent {α : Type u_1} {ι : Type u_3} [Fintype α] [Fintype ι] [MeasurableSpace α] [MeasurableSingletonClass α] [DecidableEq ι] {β : ι → Type u_4} [(i : ι) → MeasurableSpace (β i)] (p : ι → Distribution α) (Y : (i : ι) → α → β i) :
    ProbabilityTheory.iIndepFun (fun (i : ι) (x : ι → α) => Y i (x i)) (independent p).toPMF.toMeasure

    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 #

    theorem Dynamics.Distribution.hoeffding {α : Type u_1} {ι : Type u_2} [Fintype α] [Fintype ι] [DecidableEq ι] (p : ι → Distribution α) (Y : ι → α → ℝ) {a b : ι → ℝ} (hY : ∀ (i : ι) (x : α), Y i x ∈ Set.Icc (a i) (b i)) {lam : ℝ} (hlam : 0 ≤ lam) :
    ((independent p).prob fun (x : ι → α) => ∑ i : ι, (p i).expect (Y i) + lam ≤ ∑ i : ι, Y i (x i)) ≤ Real.exp (-(2 * lam ^ 2 / ∑ i : ι, (b i - a i) ^ 2))

    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.