Documentation

FormalSLT.PACBayes.FinitePMFBridge

Finite PAC-Bayes interoperability with mathlib probability measures #

This module connects FormalSLT's finite real-valued probability mass functions, posterior averages, and KL divergence to mathlib's PMF, Measure, and InformationTheory.klDiv APIs.

The KL bridge requires the posterior support to be contained in the prior support. This is exactly the finite absolute-continuity condition. Without it, FormalSLT's totalized real-valued finite sum is not the same object as mathlib's extended-real KL divergence, which is infinite when absolute continuity fails.

Real-valued PMFs as mathlib PMFs #

noncomputable def FormalSLT.PACBayesKL.IsPMF.toPMF {ι : Type u_1} [Fintype ι] {ρ : ι} ( : IsPMF ρ) :
PMF ι

Convert a finite nonnegative real-valued PMF into mathlib's PMF type.

Equations
Instances For
    @[simp]
    theorem FormalSLT.PACBayesKL.IsPMF.toPMF_apply {ι : Type u_1} [Fintype ι] {ρ : ι} ( : IsPMF ρ) (i : ι) :
    .toPMF i = ENNReal.ofReal (ρ i)
    @[simp]
    theorem FormalSLT.PACBayesKL.IsPMF.toPMF_apply_toReal {ι : Type u_1} [Fintype ι] {ρ : ι} ( : IsPMF ρ) (i : ι) :
    (.toPMF i).toReal = ρ i

    Posterior averages as Bochner integrals #

    theorem FormalSLT.PACBayesKL.IsPMF.integral_toPMF_eq_sum {ι : Type u_1} [Fintype ι] [MeasurableSpace ι] [MeasurableSingletonClass ι] {ρ : ι} ( : IsPMF ρ) (g : ι) :
    (i : ι), g i .toPMF.toMeasure = i : ι, ρ i * g i

    Integration against the mathlib PMF associated to a FormalSLT finite PMF is the corresponding finite weighted sum.

    theorem FormalSLT.PACBayesKL.integral_toPMF_eq_posteriorAverage {ι : Type u_1} [Fintype ι] [MeasurableSpace ι] [MeasurableSingletonClass ι] {ρ : ι} ( : IsPMF ρ) (g : ι) :
    (i : ι), g i .toPMF.toMeasure = posteriorAverage ρ g

    A FormalSLT finite posterior average is the Bochner integral against the corresponding mathlib probability measure.

    Support-aware measure and KL bridges #

    Finite support inclusion induces absolute continuity between the associated mathlib probability measures.

    A full-support prior dominates every finite posterior PMF.

    theorem FormalSLT.PACBayesKL.klDiv_nonneg_of_support {ι : Type u_1} [Fintype ι] [MeasurableSpace ι] [MeasurableSingletonClass ι] {ρ π : ι} ( : IsPMF ρ) ( : IsPMF π) (hsupport : Function.support ρFunction.support π) :
    0 klDiv ρ π

    FormalSLT's finite KL sum is nonnegative under the minimal finite absolute-continuity assumption.

    Under finite support inclusion, mathlib's extended-real KL divergence is exactly ENNReal.ofReal of FormalSLT's finite KL sum.

    Real-valued form of the support-aware finite KL interoperability theorem.

    Full-support specialization of the extended-real finite KL bridge used by FormalSLT's finite PAC-Bayes theorems.

    Full-support specialization of the real-valued finite KL bridge used by FormalSLT's finite PAC-Bayes theorems.