Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Appendix B — w.p. ≥ 1 − δ, every f in F has P(Y ≠ f(X)) ≤ P̂_n(Y ≠ f(X)) + E sup_{h∈L∘F}(Eh − Ê_nh) + √(ln(1/δ)/(2n))

Proved
RadGauss.Classification.mcdiarmid_step

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

classificationconcentrationgeneralization-boundlearning-theoryp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let PPP be a probability distribution on X×{±1}\mathcal X \times \{\pm1\}X×{±1}, FFF a nonempty set of measurable {±1}\{\pm1\}{±1}-valued functions on X\mathcal XX, n≥1n \ge 1n≥1, and 0<δ<10 < \delta < 10<δ<1. Let S=((Xi,Yi))i=1nS = ((X_i, Y_i))_{i=1}^nS=((Xi​,Yi​))i=1n​ be drawn from PnP^nPn, let L(Y,f(X))=1(Y≠f(X))\mathcal L(Y, f(X)) = \mathbf 1(Y \ne f(X))L(Y,f(X))=1(Y=f(X)) be the 0–1 loss, and write

Φ(S)=sup⁡h∈L∘F(Eh−E^nh)=sup⁡f∈F(P(Y≠f(X))−P^n(Y≠f(X))).\Phi(S) = \sup_{h \in \mathcal L \circ F}\big(\mathbb E h - \hat{\mathbb E}_n h\big) = \sup_{f \in F}\big(P(Y \ne f(X)) - \hat P_n(Y \ne f(X))\big).Φ(S)=h∈L∘Fsup​(Eh−E^n​h)=f∈Fsup​(P(Y=f(X))−P^n​(Y=f(X))).

Then with probability at least 1−δ1 - \delta1−δ, every f∈Ff \in Ff∈F satisfies

P(Y≠f(X))≤P^n(Y≠f(X))+E Φ(S)+ln⁡(1/δ)2n.P(Y \ne f(X)) \le \hat P_n(Y \ne f(X)) + \mathbb E\,\Phi(S) + \sqrt{\frac{\ln(1/\delta)}{2n}} .P(Y=f(X))≤P^n​(Y=f(X))+EΦ(S)+2nln(1/δ)​​.

Precisely, the PnP^nPn-probability of the event that some f∈Ff \in Ff∈F violates this inequality is at most δ\deltaδ. This is the concentration half of the proof of Theorem 5(b); the remaining half bounds E Φ(S)\mathbb E\,\Phi(S)EΦ(S) by Rn(F)/2R_n(F)/2Rn​(F)/2.

Formalization Note The map S↦Φ(S)S \mapsto \Phi(S)S↦Φ(S) is assumed measurable (the paper does not discuss measurability; McDiarmid's inequality needs a genuine expectation of Φ\PhiΦ, and Φ\PhiΦ is bounded, so the expectation is a Bochner integral of a bounded measurable function). The hypotheses n≥1n \ge 1n≥1, 0<δ<10 < \delta < 10<δ<1 and F≠∅F \ne \emptysetF=∅ are the reading of the page's "with probability at least 1−δ1-\delta1−δ" and "every f∈Ff \in Ff∈F". The bad event is a union over FFF and is measured by the outer measure of PnP^nPn.

Preamble
import Mathlib
import Definitions.Def_RadGauss_Classification_Classifier

open MeasureTheory
Formal statement
namespace RadGauss.Classification

/-- **McDiarmid step for the 0–1 loss** (Bartlett–Mendelson 2002, Appendix B, p. 480, second
display). With probability at least `1 − δ` over an i.i.d. sample `S ∼ P^n`, every `f ∈ F`
satisfies `P(Y ≠ f(X)) ≤ P̂_n(Y ≠ f(X)) + E sup_{h ∈ L∘F}(E h − Ê_n h) + √(ln(1/δ)/(2n))`.
The bad event (some `f ∈ F` violates the bound) has `P^n`-(outer) measure at most `δ`.
Measurability guard: the supremum `S ↦ gapSup P F S` is measurable (so its expectation is a
genuine Bochner integral of a bounded measurable function). -/
theorem mcdiarmid_step {X : Type*} [MeasurableSpace X]
    (P : Measure (X × ℤˣ)) [IsProbabilityMeasure P] (F : Set (X → ℤˣ)) (hFne : F.Nonempty)
    (hF : ∀ f ∈ F, Measurable f) (n : ℕ) (hn : 0 < n) (δ : ℝ) (hδ0 : 0 < δ) (hδ1 : δ < 1)
    (hgap : Measurable (fun S : Fin n → X × ℤˣ => gapSup P F S)) :
    (Measure.pi fun _ : Fin n => P)
        {S | ∃ f ∈ F, ¬ (classError P f ≤ trainError S f
            + (∫ S', gapSup P F S' ∂(Measure.pi fun _ : Fin n => P))
            + Real.sqrt (Real.log (1 / δ) / (2 * n)))}
      ≤ ENNReal.ofReal δ := by sorry

end RadGauss.Classification
Source
Bartlett, Mendelson, Rademacher and Gaussian Complexities: Risk Bounds and Structural Results, J. Mach. Learn. Res. 3 (2002), p. 480 (PDF p. 18), Appendix B (Proof of Theorem 5), second display
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