Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma D.1 — uniform Bernstein inequality with Rademacher complexity, both directions

Disproved
VarianceRegularization.Localized.uniform_bernstein_rademacher

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

concentration-inequalitiesempirical-processesp2o-batch-pfp1ap2o-gran-per-chapterp2o-plan-paperp2o-v1rademacher-complexity

Let PPP be a probability measure on X\mathcal XX and x1,…,xnx_1,\dots,x_nx1​,…,xn​ an i.i.d. sample from PPP, n≥1n\ge1n≥1. Let M>0M>0M>0, r>0r>0r>0, t>0t>0t>0 with nr>M2tnr>M^2tnr>M2t, and let F\mathcal FF be a collection of measurable functions f:X→[0,M]f:\mathcal X\to[0,M]f:X→[0,M] with Var(f(X))≤r\mathrm{Var}(f(X))\le rVar(f(X))≤r for every f∈Ff\in\mathcal Ff∈F. Write

L=t+log⁡⌈log⁡nrM2t⌉.L=t+\log\Big\lceil\log\frac{nr}{M^2t}\Big\rceil .L=t+log⌈logM2tnr​⌉.

Then, with probability at least 1−e−t1-e^{-t}1−e−t, for every f∈Ff\in\mathcal Ff∈F,

E[f] ≤ EP^n[f]+2e Var(f)n L+6 E[Rn(F)]+7Mn L.\mathbb E[f]\ \le\ \mathbb E_{\widehat P_n}[f]+\sqrt{\frac{2e\,\mathrm{Var}(f)}{n}\,L}+6\,\mathbb E[\mathfrak R_n(\mathcal F)]+\frac{7M}{n}\,L .E[f] ≤ EPn​​[f]+n2eVar(f)​L​+6E[Rn​(F)]+n7M​L.

The same statement holds, with probability at least 1−e−t1-e^{-t}1−e−t, with the roles of E[f]\mathbb E[f]E[f] and EP^n[f]\mathbb E_{\widehat P_n}[f]EPn​​[f] reversed.

The lemma is a Bernstein-type bound uniform over the class: the deviation of each function scales with its own standard deviation, at the price of a doubly logarithmic term from peeling.

Formalization Note The conditions M>0M>0M>0 and nr>M2tnr>M^2tnr>M2t make log⁡nrM2t>0\log\frac{nr}{M^2t}>0logM2tnr​>0, so its ceiling is at least 111 and the outer logarithm is defined, as the page presupposes. The expected Rademacher complexity is assumed integrable over the sample; each direction is its own probability bound; probabilities of non-measurable events are outer measures.

Preamble
import Mathlib
import Definitions.Def_UnderstandingML_Rademacher
import Definitions.Def_VarianceRegularization_Localized_RobustRisk
import Definitions.Def_VarianceRegularization_Localized_LocalizedComplexity

open MeasureTheory ProbabilityTheory
Formal statement
namespace VarianceRegularization.Localized

/-- **Lemma D.1** (p. 39). Let `r > 0` and `F` a collection of measurable functions
`f : X → [0, M]` with `Var(f(X)) ≤ r`. Write `L = t + log ⌈log (n r / (M² t))⌉`. Then with
probability at least `1 − e^{−t}`, for every `f ∈ F`,
`E[f] ≤ E_{P̂_n}[f] + √((2e Var(f)/n) L) + 6 E[ℜ_n(F)] + (7M/n) L`,
and the same holds with the roles of `E[f]` and `E_{P̂_n}[f]` reversed (a separate probability
bound). Domain conditions: `M > 0` and `n r > M² t` make `log(n r/(M² t)) > 0`, so its ceiling is
at least `1` and the outer logarithm is defined, as the page presupposes; `t > 0`. The expected
Rademacher complexity is assumed integrable. -/
theorem uniform_bernstein_rademacher {X : Type*} [MeasurableSpace X] (P : Measure X)
    [IsProbabilityMeasure P] (n : ℕ) (hn : 0 < n) (F : Set (X → ℝ)) (M r t : ℝ)
    (hM : 0 < M) (hr : 0 < r) (ht : 0 < t) (hnr : M ^ 2 * t < n * r)
    (hmeas : ∀ f ∈ F, Measurable f) (hrange : ∀ f ∈ F, ∀ x, f x ∈ Set.Icc 0 M)
    (hvar : ∀ f ∈ F, variance f P ≤ r)
    (hint : Integrable (fun s : Fin n → X => empRademacher F s)
      (Measure.pi fun _ : Fin n => P)) :
    (Measure.pi (fun _ : Fin n => P))
        {s | ∃ f ∈ F, empMean s f
            + Real.sqrt (2 * Real.exp 1 * variance f P / n
                * (t + Real.log (⌈Real.log (n * r / (M ^ 2 * t))⌉ : ℝ)))
            + 6 * expRademacher P n F
            + 7 * M / n * (t + Real.log (⌈Real.log (n * r / (M ^ 2 * t))⌉ : ℝ))
          < ∫ x, f x ∂P}
        ≤ ENNReal.ofReal (Real.exp (-t)) ∧
    (Measure.pi (fun _ : Fin n => P))
        {s | ∃ f ∈ F, (∫ x, f x ∂P)
            + Real.sqrt (2 * Real.exp 1 * variance f P / n
                * (t + Real.log (⌈Real.log (n * r / (M ^ 2 * t))⌉ : ℝ)))
            + 6 * expRademacher P n F
            + 7 * M / n * (t + Real.log (⌈Real.log (n * r / (M ^ 2 * t))⌉ : ℝ))
          < empMean s f}
        ≤ ENNReal.ofReal (Real.exp (-t)) := by sorry

end VarianceRegularization.Localized
Source
Duchi and Namkoong, Variance-based regularization with convex objectives, arXiv:1610.02581v3 (2017), p. 39, Lemma D.1
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