Documentation

CslibFrontier.Probability.DonskerVaradhan

Donsker–Varadhan variational formula and Gibbs posteriors #

Completes the variational duality of the Kullback–Leibler divergence built on CslibFrontier.Probability.ChangeOfMeasure [DV83] [Cat07] [Alq24]:

  1. Exact excess-KL / tilted decomposition. For probability measures μ and ν with KL(μ ‖ ν) < ∞, an exponentially tilted (Gibbs) measure ν.tilted f satisfies KL(μ ‖ ν.tilted f) = KL(μ ‖ ν) - ∫ f ∂μ + log ∫ exp f ∂ν. At μ = ν.tilted f this gives exact equality in the change-of-measure inequality: ∫ f ∂(ν.tilted f) - KL(ν.tilted f ‖ ν) = log ∫ exp f ∂ν.
  2. Donsker–Varadhan variational formula (both halves).
    • log_integral_exp_eq_sSup: log ∫ exp f ∂ν = sup_μ (∫ f ∂μ - KL(μ ‖ ν)), where the supremum ranges over probability measures μ with KL(μ ‖ ν) < ∞ and f ∈ L¹(μ), attained uniquely at μ = ν.tilted f.
    • toReal_klDiv_eq_sSup: for arbitrary probability measures μ, ν with KL(μ ‖ ν) < ∞, KL(μ ‖ ν) = sup_f (∫ f ∂μ - log ∫ exp f ∂ν), where the supremum ranges over bounded measurable functions f : α → ℝ. The proof truncates the log-likelihood ratio llr μ ν to [-n, n] (setting -n on {dμ/dν = 0} where log 0 = 0), then passes to the limit using dominated convergence and log (1 + e⁻ⁿ) ≤ e⁻ⁿ.
  3. Unique Gibbs posterior minimizer. At inverse temperature β > 0, for any measurable loss g : α → ℝ with exp (-β * g) ∈ L¹(ν), the Gibbs posterior ν.tilted (-β * g) uniquely minimizes the PAC-Bayes free-energy functional μ ↦ ∫ g ∂μ + KL(μ ‖ ν) / β, with excess value KL(μ ‖ ν.tilted (-β * g)) / β.

Main results #

References #

Exact section and page locators below are unverified against the primary PDFs (pending an outside-fleet source check).

Tilted measure identities and equality case of change of measure #

If KL(μ ‖ ν) < ∞, f is μ-integrable, and exp ∘ f is ν-integrable, then KL(μ ‖ ν.tilted f) < ∞.

Exact tilted KL decomposition: for probability measures with KL(μ ‖ ν) < ∞, KL(μ ‖ ν.tilted f) = KL(μ ‖ ν) - ∫ f ∂μ + log ∫ exp f ∂ν.

The tilted probability measure ν.tilted f has finite KL divergence from ν whenever exp ∘ f is ν-integrable and f is (ν.tilted f)-integrable.

theorem Cslib.Probability.toReal_klDiv_tilted_self {α : Type u_1} {mα : MeasurableSpace α} {ν : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure ν] {f : α → ℝ} (hfν : MeasureTheory.Integrable (fun (x : α) => Real.exp (f x)) ν) (hft : MeasureTheory.Integrable f (ν.tilted f)) :
(InformationTheory.klDiv (ν.tilted f) ν).toReal = ∫ (x : α), f x ∂ν.tilted f - Real.log (∫ (x : α), Real.exp (f x) ∂ν)

Equality case of the change-of-measure inequality: the exponentially tilted measure ν.tilted f satisfies KL(ν.tilted f ‖ ν) = ∫ f ∂(ν.tilted f) - log ∫ exp f ∂ν.

Donsker–Varadhan variational duality #

Dual variational principle for the log-moment generating function (Fenchel conjugate of KL(· ‖ ν)): log ∫ exp f ∂ν = sup { ∫ f ∂μ - KL(μ ‖ ν) }, where the supremum runs over probability measures μ with KL(μ ‖ ν) < ∞ and f ∈ L¹(μ), attained at μ = ν.tilted f.

theorem Cslib.Probability.toReal_klDiv_eq_sSup {α : Type u_1} {mα : MeasurableSpace α} {μ ν : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [MeasureTheory.IsProbabilityMeasure ν] (hkl : InformationTheory.klDiv μ ν ≠ ⊤) :
(InformationTheory.klDiv μ ν).toReal = sSup {r : ℝ | ∃ (f : α → ℝ), Measurable f ∧ (∃ (C : ℝ), ∀ (x : α), |f x| ≤ C) ∧ r = ∫ (x : α), f x ∂μ - Real.log (∫ (x : α), Real.exp (f x) ∂ν)}

Donsker–Varadhan variational formula for KL(μ ‖ ν) [DV83] (locator unverified): for arbitrary probability measures μ, ν with KL(μ ‖ ν) < ∞, KL(μ ‖ ν) = sup { ∫ f ∂μ - log ∫ exp f ∂ν }, taken over bounded measurable functions f : α → ℝ.

Gibbs posterior free-energy minimization #

theorem Cslib.Probability.freeEnergy_sub_eq_toReal_klDiv_tilted {α : Type u_1} {mα : MeasurableSpace α} {μ ν : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [MeasureTheory.IsProbabilityMeasure ν] (hkl : InformationTheory.klDiv μ ν ≠ ⊤) {β : ℝ} (hβ : β ≠ 0) {g : α → ℝ} (hgμ : MeasureTheory.Integrable g μ) (hexp : MeasureTheory.Integrable (fun (x : α) => Real.exp (-β * g x)) ν) :
∫ (x : α), g x ∂μ + (InformationTheory.klDiv μ ν).toReal / β - -Real.log (∫ (x : α), Real.exp (-β * g x) ∂ν) / β = (InformationTheory.klDiv μ (ν.tilted fun (x : α) => -β * g x)).toReal / β

Exact excess free-energy identity for the Gibbs posterior ν.tilted (fun x => -β * g x) at inverse temperature β > 0: (∫ g ∂μ + KL(μ ‖ ν) / β) - (-log ∫ exp (-β * g) ∂ν / β) = KL(μ ‖ ν.tilted (-β * g)) / β.

theorem Cslib.Probability.freeEnergy_tilted_le {α : Type u_1} {mα : MeasurableSpace α} {μ ν : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [MeasureTheory.IsProbabilityMeasure ν] (hkl : InformationTheory.klDiv μ ν ≠ ⊤) {β : ℝ} (hβ : 0 < β) {g : α → ℝ} (hgμ : MeasureTheory.Integrable g μ) (hexp : MeasureTheory.Integrable (fun (x : α) => Real.exp (-β * g x)) ν) (hgt : MeasureTheory.Integrable g (ν.tilted fun (x : α) => -β * g x)) :
(∫ (x : α), g x ∂ν.tilted fun (x : α) => -β * g x) + (InformationTheory.klDiv (ν.tilted fun (x : α) => -β * g x) ν).toReal / β ≤ ∫ (x : α), g x ∂μ + (InformationTheory.klDiv μ ν).toReal / β

The Gibbs posterior ν.tilted (fun x => -β * g x) minimizes the KL-regularized loss μ ↦ ∫ g ∂μ + KL(μ ‖ ν) / β over all probability measures with KL(μ ‖ ν) < ∞ and g ∈ L¹(μ) [Cat07] [Alq24] (locators unverified).

theorem Cslib.Probability.freeEnergy_eq_tilted_iff {α : Type u_1} {mα : MeasurableSpace α} {μ ν : MeasureTheory.Measure α} [MeasureTheory.IsProbabilityMeasure μ] [MeasureTheory.IsProbabilityMeasure ν] (hkl : InformationTheory.klDiv μ ν ≠ ⊤) {β : ℝ} (hβ : 0 < β) {g : α → ℝ} (hgμ : MeasureTheory.Integrable g μ) (hexp : MeasureTheory.Integrable (fun (x : α) => Real.exp (-β * g x)) ν) :
∫ (x : α), g x ∂μ + (InformationTheory.klDiv μ ν).toReal / β = -Real.log (∫ (x : α), Real.exp (-β * g x) ∂ν) / β ↔ μ = ν.tilted fun (x : α) => -β * g x

Uniqueness of the Gibbs posterior minimizer: a probability measure μ with KL(μ ‖ ν) < ∞ achieves the minimum free energy -log ∫ exp (-β * g) ∂ν / β if and only if μ = ν.tilted (fun x => -β * g x).