Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 6, p. 31 — |R_true − R̂| ≤ 2α_n + (4nα_n + M)√(ln(2/δ)/2n) for uniformly stable algorithms

Proved
BigDataNV.Reg.theorem6_two_sided_bound

by mikedeng1 · Oct 5, 2026 · Mathlib 0df444a (Lean v4.33.1)

generalization-boundmcdiarmidp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1uniform-stability

Let μ\muμ be a probability distribution on a data space Z\mathcal ZZ, concentrated on a set Z0\mathcal Z_0Z0​. Let AAA be an algorithm mapping samples Sn=(z1,…,zn)S_n=(z_1,\dots,z_n)Sn​=(z1​,…,zn​) of size n≥1n\ge1n≥1 to hypotheses, let ℓ(f,z)\ell(f,z)ℓ(f,z) be a loss, and for each iii let ASn∖iA^{\setminus i}_{S_n}ASn​∖i​ be a comparison hypothesis that does not depend on ziz_izi​. Assume, for all samples and points in Z0\mathcal Z_0Z0​,

  1. uniform stability: ∣ℓ(ASn,z)−ℓ(ASn∖i,z)∣≤αn|\ell(A_{S_n},z)-\ell(A^{\setminus i}_{S_n},z)|\le\alpha_n∣ℓ(ASn​​,z)−ℓ(ASn​∖i​,z)∣≤αn​ for all iii;
  2. bounded loss: 0≤ℓ(ASn,z)≤M0\le\ell(A_{S_n},z)\le M0≤ℓ(ASn​​,z)≤M;
  3. measurability: (Sn,z)↦ℓ(ASn,z)(S_n,z)\mapsto\ell(A_{S_n},z)(Sn​,z)↦ℓ(ASn​​,z) is measurable.

Write Rtrue(A,Sn)=Ez[ℓ(ASn,z)]R_{true}(A,S_n)=\mathbb E_{z}[\ell(A_{S_n},z)]Rtrue​(A,Sn​)=Ez​[ℓ(ASn​​,z)] and R^(A,Sn)=1n∑i=1nℓ(ASn,zi)\hat R(A,S_n)=\frac1n\sum_{i=1}^n\ell(A_{S_n},z_i)R^(A,Sn​)=n1​∑i=1n​ℓ(ASn​​,zi​). Then for every δ∈(0,1)\delta\in(0,1)δ∈(0,1), with probability at least 1−δ1-\delta1−δ over an iid sample Sn∼μnS_n\sim\mu^nSn​∼μn,

∣Rtrue(A,Sn)−R^(A,Sn)∣≤2αn+(4nαn+M)ln⁡(2/δ)2n.|R_{true}(A,S_n)-\hat R(A,S_n)|\le 2\alpha_n+(4n\alpha_n+M)\sqrt{\frac{\ln(2/\delta)}{2n}} .∣Rtrue​(A,Sn​)−R^(A,Sn​)∣≤2αn​+(4nαn​+M)2nln(2/δ)​​.

This two-sided bound converts the stability of an algorithm into a high-probability bound on its generalization gap; Theorem 2 applies it to (NV-reg).

Formalization Note The failure event, on which the gap exceeds the bound, is shown to have probability at most δ\deltaδ. The comparison hypothesis A∖iA^{\setminus i}A∖i is any map that ignores the iii-th observation, which covers the algorithm run on Sn∖iS_n^{\setminus i}Sn∖i​ (Definition 1) and the 1/n1/n1/n-weighted leave-one-out problem of Theorems 4 and 5. Stability and boundedness are required on the support Z0\mathcal Z_0Z0​ of μ\muμ, which plays the role of the paper's Z\mathcal ZZ. Symmetry of AAA is not assumed. Measurability is the standing convention of Appendix B ("all functions are measurable").

Preamble
import Mathlib

open MeasureTheory
Formal statement
namespace BigDataNV.Reg

/-- Theorem 6, p. 31: a two-sided generalization bound for any algorithm that is uniformly stable
(with parameter `α`) and whose loss is bounded in `[0, M]`. The data space is `Z`, its support is
`Z0`, `A` maps a sample of size `n` to a hypothesis in `H`, and `Aloo i S` is the comparison
hypothesis that ignores the `i`-th observation. -/
theorem theorem6_two_sided_bound {Z H : Type*} [MeasurableSpace Z]
    (μ : Measure Z) [IsProbabilityMeasure μ] (Z0 : Set Z) (hμ : μ Z0ᶜ = 0)
    (ℓ : H → Z → ℝ) (n : ℕ) (hn : 1 ≤ n) (A : (Fin n → Z) → H)
    (Aloo : Fin n → (Fin n → Z) → H)
    (hloo : ∀ (i : Fin n) (S S' : Fin n → Z), (∀ j, j ≠ i → S j = S' j) → Aloo i S = Aloo i S')
    (α M : ℝ)
    (hstab : ∀ S : Fin n → Z, (∀ j, S j ∈ Z0) → ∀ i : Fin n, ∀ z ∈ Z0,
      |ℓ (A S) z - ℓ (Aloo i S) z| ≤ α)
    (hbound : ∀ S : Fin n → Z, (∀ j, S j ∈ Z0) → ∀ z ∈ Z0, 0 ≤ ℓ (A S) z ∧ ℓ (A S) z ≤ M)
    (hmeas : Measurable (fun q : (Fin n → Z) × Z => ℓ (A q.1) q.2))
    (δ : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1) :
    (Measure.pi fun _ : Fin n => μ)
      {S | 2 * α + (4 * (n : ℝ) * α + M) * Real.sqrt (Real.log (2 / δ) / (2 * (n : ℝ))) <
        |(∫ z, ℓ (A S) z ∂μ) - (1 / (n : ℝ)) * ∑ i, ℓ (A S) (S i)|} ≤ ENNReal.ofReal δ := by sorry

end BigDataNV.Reg
Source
Rudin & Vahn, The Big Data Newsvendor: Practical Insights from Machine Learning, MIT Sloan Working Paper 5036-13 (version of February 6, 2014), p. 31, Theorem 6, display (32), and the risks defined before it; proof p. 32
Human review
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me