Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Appendix B (corrected) — E sup_{h∈L∘F}(Eh − Ê_nh) ≤ R_n(F)/2 for the 0–1 loss

Proved
RadGauss.Classification.symmetrization

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

classificationlearning-theoryp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1rademacher-complexitysymmetrization

Let PPP be a probability distribution on X×{±1}\mathcal X \times \{\pm1\}X×{±1}, μ\muμ its marginal on X\mathcal XX, FFF a nonempty set of measurable {±1}\{\pm1\}{±1}-valued functions on X\mathcal XX, n≥1n \ge 1n≥1, and S=((Xi,Yi))i=1n∼PnS = ((X_i, Y_i))_{i=1}^n \sim P^nS=((Xi​,Yi​))i=1n​∼Pn. With the 0–1 loss 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)),

Esup⁡h∈L∘F(Eh−E^nh)=Esup⁡f∈F(P(Y≠f(X))−P^n(Y≠f(X)))≤Rn(F)2,\mathbb E \sup_{h \in \mathcal L \circ F}\big(\mathbb E h - \hat{\mathbb E}_n h\big) = \mathbb E \sup_{f \in F}\big(P(Y \ne f(X)) - \hat P_n(Y \ne f(X))\big) \le \frac{R_n(F)}{2},Eh∈L∘Fsup​(Eh−E^n​h)=Ef∈Fsup​(P(Y=f(X))−P^n​(Y=f(X)))≤2Rn​(F)​,

where Rn(F)=Esup⁡f∈F∣2n∑i=1nσif(Xi)∣R_n(F) = \mathbb E \sup_{f \in F}\big|\frac2n \sum_{i=1}^n \sigma_i f(X_i)\big|Rn​(F)=Esupf∈F​​n2​∑i=1n​σi​f(Xi​)​ is the Rademacher complexity (Definition 2) of FFF, viewed as a class of real functions with values in {−1,1}\{-1, 1\}{−1,1}, with respect to μ\muμ.

This is the symmetrization half of the proof of Theorem 5(b): the expected worst-case gap between misclassification probability and training error is controlled by the Rademacher complexity of the classifiers themselves, not of the loss class.

Formalization Note The paper prints the chain ending "=Esup⁡f∈F1n∑iσif(Xi)=Rn(F)/2= \mathbb E \sup_{f\in F} \frac1n\sum_i \sigma_i f(X_i) = R_n(F)/2=Esupf∈F​n1​∑i​σi​f(Xi​)=Rn​(F)/2". The last step is only an inequality: RnR_nRn​ has an absolute value inside the supremum, and for a single function F={f}F = \{f\}F={f} the left side of that step is 000 while Rn(F)/2=E∣1n∑iσif(Xi)∣>0R_n(F)/2 = \mathbb E\big|\frac1n\sum_i\sigma_i f(X_i)\big| > 0Rn​(F)/2=E​n1​∑i​σi​f(Xi​)​>0. The statement here is the chain's conclusion with ≤\le≤, which is what Theorem 5(b) uses. The left side is a real number converted to [0,∞][0,\infty][0,∞]; it is nonnegative for nonempty FFF. Three random variables are assumed measurable, because the proof integrates them: S↦sup⁡f(P(Y≠f(X))−P^n(Y≠f(X)))S \mapsto \sup_f (P(Y\ne f(X)) - \hat P_n(Y \ne f(X)))S↦supf​(P(Y=f(X))−P^n​(Y=f(X))), the double-sample supremum (S,S′)↦sup⁡f(P^n′−P^n)(Y≠f(X))(S, S') \mapsto \sup_f(\hat P'_n - \hat P_n)(Y \ne f(X))(S,S′)↦supf​(P^n′​−P^n​)(Y=f(X)), and x↦R^n(F)(x)x \mapsto \hat R_n(F)(x)x↦R^n​(F)(x). The hypothesis n≥1n \ge 1n≥1 is needed: at n=0n = 0n=0 the factor 2/n2/n2/n is 000 in Lean, so R0(F)=0R_0(F) = 0R0​(F)=0 while the left side can be positive.

Preamble
import Mathlib
import Definitions.Def_RadGauss_Classification_Complexity
import Definitions.Def_RadGauss_Classification_Classifier

open MeasureTheory
Formal statement
namespace RadGauss.Classification

/-- **Symmetrization for the 0–1 loss** (Bartlett–Mendelson 2002, Appendix B, p. 480, third
display, corrected): `E sup_{h ∈ L∘F} (E h − Ê_n h) ≤ R_n(F)/2`, where `L(Y, f(X)) = 1(Y ≠ f(X))`
and `R_n(F)` is the Rademacher complexity (Definition 2, with the absolute value) of the real
class `F ⊆ {±1}^X` with respect to the marginal of `P` on `X`. The paper prints the last step of
its chain as an equality; it is only an inequality (for `F = {f}` the left side of that step is
`0` while `R_n(F)/2 > 0`), and the chain's conclusion is stated with `≤`.
Measurability guards: `S ↦ sup_f (P(Y ≠ f(X)) − P̂_n(Y ≠ f(X)))`, the double-sample supremum
`(S, S') ↦ sup_f (P̂'_n − P̂_n)(Y ≠ f(X))`, and `x ↦ R̂_n(F)(x)` are measurable. -/
theorem symmetrization {X : Type*} [MeasurableSpace X]
    (P : Measure (X × ℤˣ)) [IsProbabilityMeasure P] (F : Set (X → ℤˣ)) (hFne : F.Nonempty)
    (hF : ∀ f ∈ F, Measurable f) (n : ℕ) (hn : 0 < n)
    (hgap : Measurable (fun S : Fin n → X × ℤˣ => gapSup P F S))
    (hghost : Measurable (fun p : (Fin n → X × ℤˣ) × (Fin n → X × ℤˣ) =>
      ghostGapSup F p.1 p.2))
    (hrad : Measurable (fun x : Fin n → X => empiricalRademacher (realClass F) n x)) :
    ENNReal.ofReal (∫ S, gapSup P F S ∂(Measure.pi fun _ : Fin n => P))
      ≤ rademacherComplexity (P.map Prod.fst) n (realClass F) / 2 := 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), third display (last equality corrected to ≤)
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