Documentation

CslibFrontier.Probability.BernoulliComparison

Comparing bounded i.i.d. means with Bernoulli means #

Maurer's reduction [Mau04]: for a convex φ on [0, 1] and i.i.d. random variables X₁, …, Xₙ with values in [0, 1] and mean p, 𝔼 φ ((X₁ + ⋯ + Xₙ) / n) is at most the same expectation for Bernoulli trials with success probability p, ∑ₖ C(n, k) p ^ k (1 - p) ^ (n - k) φ (k / n). Pointwise, x ∈ [0, 1]ⁿ is a convex combination of the vertices of the cube, the vertex T weighted by ∏_{i ∈ T} xᵢ ∏_{i ∉ T} (1 - xᵢ), with barycenter x, so Jensen's inequality bounds φ of the mean; independence turns the expected weights into binomial probabilities.

With φ = exp (n binaryKL · p) every binomial term is at most 1, so 𝔼 exp (n binaryKL (mean ‖ p)) ≤ n + 1, the exponential moment behind the PAC-Bayes-kl bound. [Seeger2002, Appendix A] proves it for Bernoulli trials; the comparison extends it to [0, 1]. [Maurer2004, Theorem 1] sharpens it to 2√n for n ≥ 8 using Stirling's formula, which is not formalized here.

Main results #

References #

theorem Cslib.Probability.map_sum_div_card_le_of_convexOn {ι : Type u_1} [Fintype ι] [DecidableEq ι] {φ : ℝ → ℝ} (hφ : ConvexOn ℝ (Set.Icc 0 1) φ) {x : ι → ℝ} (hx : ∀ (i : ι), x i ∈ Set.Icc 0 1) :
φ ((∑ i : ι, x i) / ↑(Fintype.card ι)) ≤ ∑ T : Finset ι, (∏ i : ι, if i ∈ T then x i else 1 - x i) * φ (↑T.card / ↑(Fintype.card ι))

Maurer's pointwise comparison: for φ convex on [0, 1] and x ∈ [0, 1]^ι, φ of the mean of x is at most the average of φ (#T / card ι) over the vertices T of the cube, the vertex T weighted by ∏_{i ∈ T} xᵢ ∏_{i ∉ T} (1 - xᵢ).

theorem Cslib.Probability.lintegral_ofReal_comp_sum_div_le {ι : Type u_1} [Fintype ι] {Ω : Type u_2} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {X : Ω → ℝ} {φ : ℝ → ℝ} (hφ : ConvexOn ℝ (Set.Icc 0 1) φ) (hφ0 : ∀ (y : ℝ), 0 ≤ φ y) (hXm : Measurable X) (hX : ∀ (ω : Ω), X ω ∈ Set.Icc 0 1) :
(∫⁻ (ω : ι → Ω), ENNReal.ofReal (φ ((∑ i : ι, X (ω i)) / ↑(Fintype.card ι))) ∂MeasureTheory.Measure.pi fun (x : ι) => μ) ≤ ENNReal.ofReal (∑ k ∈ Finset.range (Fintype.card ι + 1), ↑((Fintype.card ι).choose k) * ((∫ (ω : Ω), X ω ∂μ) ^ k * (1 - ∫ (ω : Ω), X ω ∂μ) ^ (Fintype.card ι - k) * φ (↑k / ↑(Fintype.card ι))))

Maurer's comparison [Maurer2004, Lemma 3]: for φ ≥ 0 convex on [0, 1] and i.i.d. X (ω i), i ∈ ι, with values in [0, 1] and mean p, 𝔼 φ (mean) is at most the expectation ∑ₖ C(n, k) p ^ k (1 - p) ^ (n - k) φ (k / n) for n = card ι Bernoulli trials.

theorem Cslib.Probability.lintegral_exp_mul_binaryKL_sum_div_le {ι : Type u_1} [Fintype ι] {Ω : Type u_2} [MeasurableSpace Ω] {μ : MeasureTheory.Measure Ω} [MeasureTheory.IsProbabilityMeasure μ] {X : Ω → ℝ} (hXm : Measurable X) (hX : ∀ (ω : Ω), X ω ∈ Set.Icc 0 1) :
(∫⁻ (ω : ι → Ω), ENNReal.ofReal (Real.exp (↑(Fintype.card ι) * binaryKL ((∑ i : ι, X (ω i)) / ↑(Fintype.card ι)) (∫ (ω : Ω), X ω ∂μ))) ∂MeasureTheory.Measure.pi fun (x : ι) => μ) ≤ ENNReal.ofReal (↑(Fintype.card ι) + 1)

The exponential moment of the binary relative entropy [Seeger2002, Appendix A] [Maurer2004, Lemma 3]: for i.i.d. X (ω i), i ∈ ι, with values in [0, 1] and mean p, and n = card ι, 𝔼 exp (n binaryKL (mean ‖ p)) ≤ n + 1.