Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 4.2: type I control and type II oracle inequality for the convexified NP classifier

Proved
NeymanPearsonClassification.np_classifier_oracle_inequality

by Xeroth · Nov 23, 2026 · Mathlib 0df444a (Lean v4.33.1)

binary-classificationchance-constrained-optimizationconvex-surrogateempirical-processesneyman-pearson

Let δ,α∈(0,1)\delta,\alpha\in(0,1)δ,α∈(0,1), L>0L>0L>0, and let φ\varphiφ be an LLL-Lipschitz convex surrogate. Let h1,…,hMh_1,\dots,h_Mh1​,…,hM​, M≥2M\ge2M≥2, be measurable base classifiers with values in [−1,1][-1,1][−1,1], and κ=42 Llog⁡(2M/δ)\kappa=4\sqrt2\,L\sqrt{\log(2M/\delta)}κ=42​Llog(2M/δ)​. Assume (Assumption 1) that there is ε∈(0,1)\varepsilon\in(0,1)ε∈(0,1) with Hφ,εα≠∅\mathcal H^{\varphi,\varepsilon\alpha}\neq\emptysetHφ,εα=∅. Let εˉ\bar\varepsilonεˉ be the smallest such ε\varepsilonε and n0=⌈(4κ/((1−εˉ)α))2⌉n_0=\lceil(4\kappa/((1-\bar\varepsilon)\alpha))^2\rceiln0​=⌈(4κ/((1−εˉ)α))2⌉.

Let X1−,…,Xn−−X^-_1,\dots,X^-_{n^-}X1−​,…,Xn−−​ be i.i.d. with law P−P^-P− and X1+,…,Xn++X^+_1,\dots,X^+_{n^+}X1+​,…,Xn++​ i.i.d. with law P+P^+P+. The two samples need not be independent of each other. Assume n+≥1n^+\ge1n+≥1 and n−≥n0n^-\ge n_0n−≥n0​. Let h~κ\tilde h^\kappah~κ be any solution of

min⁡h∈Hconv, R^φ−(h)≤α−κ/n−R^φ+(h).\min_{h\in\mathcal H^{\mathrm{conv}},\ \hat R^-_\varphi(h)\le\alpha-\kappa/\sqrt{n^-}}\hat R^+_\varphi(h).h∈Hconv, R^φ−​(h)≤α−κ/n−​min​R^φ+​(h).

Then, with probability at least 1−2δ1-2\delta1−2δ,

R−(h~κ)≤Rφ−(h~κ)≤αR^-(\tilde h^\kappa)\le R^-_\varphi(\tilde h^\kappa)\le\alphaR−(h~κ)≤Rφ−​(h~κ)≤α

and

Rφ+(h~κ)−min⁡h∈Hφ,αRφ+(h)≤4φ(1)κ(1−εˉ)αn−+2κn+.R^+_\varphi(\tilde h^\kappa)-\min_{h\in\mathcal H^{\varphi,\alpha}}R^+_\varphi(h)\le\frac{4\varphi(1)\kappa}{(1-\bar\varepsilon)\alpha\sqrt{n^-}}+\frac{2\kappa}{\sqrt{n^+}}.Rφ+​(h~κ)−h∈Hφ,αmin​Rφ+​(h)≤(1−εˉ)αn−​4φ(1)κ​+n+​2κ​.

This is the paper's main result: the convexified NP classifier respects the type I level α\alphaα with high probability and has near-optimal φ\varphiφ-type II error.

Formalization Note "Any solution" is stated uniformly: on one event of probability at least 1−2δ1-2\delta1−2δ, every solution of the empirical program satisfies both bounds. The minimum over Hφ,α\mathcal H^{\varphi,\alpha}Hφ,α is an infimum over a nonempty set. The asymptotic O(⋅)O(\cdot)O(⋅) remark that follows the theorem is not included.

Preamble
import Mathlib
import Definitions.Def_NeymanPearsonClassification_Basic

open MeasureTheory ProbabilityTheory
Formal statement
namespace NeymanPearsonClassification

theorem np_classifier_oracle_inequality {d M : ℕ} (hM : 2 ≤ M)
    (h : Fin M → EuclideanSpace ℝ (Fin d) → ℝ) (hh : IsBaseFamily h)
    (Pm Pp : Measure (EuclideanSpace ℝ (Fin d))) [IsProbabilityMeasure Pm] [IsProbabilityMeasure Pp]
    (φ : ℝ → ℝ) (hφ : IsConvexSurrogate φ) (L : ℝ) (hL : 0 < L) (hLip : LipschitzOnWith (Real.toNNReal L) φ (Set.Icc (-1) 1))
    (δ α : ℝ) (hδ : δ ∈ Set.Ioo 0 1) (hα : α ∈ Set.Ioo 0 1)
    (hA1 : ∃ ε : ℝ, 0 < ε ∧ ε < 1 ∧ (Hphi h Pm φ (ε * α)).Nonempty)
    {nm np : ℕ} (hnm1 : 1 ≤ nm) (hnp : 1 ≤ np)
    (hnm : nZero (kappa L M δ) (epsBar h Pm φ α) α ≤ nm)
    {Omega : Type*} [MeasurableSpace Omega] (μ : Measure Omega) [IsProbabilityMeasure μ]
    (Xm : Fin nm → Omega → EuclideanSpace ℝ (Fin d)) (Xp : Fin np → Omega → EuclideanSpace ℝ (Fin d))
    (hXm : ∀ i, Measurable (Xm i)) (hXp : ∀ i, Measurable (Xp i))
    (hXmind : iIndepFun Xm μ) (hXpind : iIndepFun Xp μ)
    (hXmlaw : ∀ i, μ.map (Xm i) = Pm) (hXplaw : ∀ i, μ.map (Xp i) = Pp) :
    μ {ω | ¬ ∀ f, IsNPClassifier h φ α (kappa L M δ) Finset.univ (fun i => Xm i ω)
        Finset.univ (fun i => Xp i ω) f →
      (typeI Pm f ≤ phiTypeI Pm φ f ∧ phiTypeI Pm φ f ≤ α) ∧
      phiTypeII Pp φ f - minPhiTypeII h Pm Pp φ α ≤
        4 * φ 1 * kappa L M δ / ((1 - epsBar h Pm φ α) * α * Real.sqrt nm) +
          2 * kappa L M δ / Real.sqrt np} ≤ ENNReal.ofReal (2 * δ) := by sorry

end NeymanPearsonClassification
Source
Rigollet and Tong, Neyman-Pearson classification, convexity and stochastic constraints, arXiv:1102.5750v1 (2011), Section 4.2, Theorem 4.2, eqs. (3.4), (4.3), (4.4), (4.5), Assumption 1, p. 9; proof in Section 6.4, pp. 17-18
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Fix natural numbers ddd and MMM with M≥2M \ge 2M≥2, and work on Rd\mathbb{R}^dRd (Euclidean space with its Borel structure).

Base classifiers. Let h1,…,hM:Rd→Rh_1, \dots, h_M : \mathbb{R}^d \to \mathbb{R}h1​,…,hM​:Rd→R be measurable functions taking values in [−1,1][-1,1][−1,1]. Let Λ={λ∈RM:λj≥0, ∑jλj=1}\Lambda = \{\lambda \in \mathbb{R}^M : \lambda_j \ge 0,\ \sum_j \lambda_j = 1\}Λ={λ∈RM:λj​≥0, ∑j​λj​=1} be the standard simplex. For λ∈Λ\lambda \in \Lambdaλ∈Λ write hλ=∑j=1Mλjhjh_\lambda = \sum_{j=1}^M \lambda_j h_jhλ​=∑j=1M​λj​hj​. The convex hull is Hconv={hλ:λ∈Λ}\mathcal{H}^{\mathrm{conv}} = \{h_\lambda : \lambda \in \Lambda\}Hconv={hλ​:λ∈Λ}.

Class-conditional laws. Let P−P^-P− and P+P^+P+ be probability measures on Rd\mathbb{R}^dRd.

Surrogate. Let φ:R→R\varphi : \mathbb{R} \to \mathbb{R}φ:R→R satisfy the following on [−1,1][-1,1][−1,1]:

  • φ\varphiφ is non-negative, non-decreasing, continuous and convex;
  • φ(0)=1\varphi(0) = 1φ(0)=1;
  • for a real L>0L > 0L>0, φ\varphiφ is LLL-Lipschitz: ∣φ(x)−φ(y)∣≤L∣x−y∣|\varphi(x) - \varphi(y)| \le L|x - y|∣φ(x)−φ(y)∣≤L∣x−y∣ for all x,y∈[−1,1]x, y \in [-1,1]x,y∈[−1,1].

Nothing is assumed about φ\varphiφ outside [−1,1][-1,1][−1,1].

Parameters. Let δ∈(0,1)\delta \in (0,1)δ∈(0,1) and α∈(0,1)\alpha \in (0,1)α∈(0,1), both open intervals.

Error functionals. For a function fff define:

  • the type I error R−(f)=P−({x:f(x)≥0})R^-(f) = P^-(\{x : f(x) \ge 0\})R−(f)=P−({x:f(x)≥0});
  • the φ\varphiφ-type I error Rφ−(f)=∫φ(f) dP−R^-_\varphi(f) = \int \varphi(f)\,dP^-Rφ−​(f)=∫φ(f)dP−;
  • the φ\varphiφ-type II error Rφ+(f)=∫φ(−f) dP+R^+_\varphi(f) = \int \varphi(-f)\,dP^+Rφ+​(f)=∫φ(−f)dP+.

Constrained classes. For a real aaa let Hφ,a={h∈Hconv:Rφ−(h)≤a}\mathcal{H}^{\varphi,a} = \{h \in \mathcal{H}^{\mathrm{conv}} : R^-_\varphi(h) \le a\}Hφ,a={h∈Hconv:Rφ−​(h)≤a}.

The statement assumes there is some ε\varepsilonε with 0<ε<10 < \varepsilon < 10<ε<1 such that Hφ,εα≠∅\mathcal{H}^{\varphi,\varepsilon\alpha} \neq \emptysetHφ,εα=∅.

Derived constants.

  • εˉ\bar\varepsilonεˉ is the infimum of all real ε\varepsilonε with Hφ,εα≠∅\mathcal{H}^{\varphi,\varepsilon\alpha} \neq \emptysetHφ,εα=∅. Under the hypotheses above, this set is non-empty and bounded below by 000.
  • The oracle value is
γ(α)=inf⁡{Rφ+(h):h∈Hφ,α}.\gamma(\alpha) = \inf\{R^+_\varphi(h) : h \in \mathcal{H}^{\varphi,\alpha}\}.γ(α)=inf{Rφ+​(h):h∈Hφ,α}.
  • The constant κ\kappaκ is
κ=42 L log⁡(2M/δ).\kappa = 4\sqrt{2}\,L\,\sqrt{\log(2M/\delta)}.κ=42​Llog(2M/δ)​.
  • The threshold n0n_0n0​ is
n0=⌈(4κ(1−εˉ)α)2⌉,n_0 = \left\lceil \left(\frac{4\kappa}{(1-\bar\varepsilon)\alpha}\right)^2 \right\rceil,n0​=⌈((1−εˉ)α4κ​)2⌉,

the ceiling taken in N\mathbb{N}N, with negative values mapped to 000.

Sample sizes. Let n−n^-n− and n+n^+n+ be natural numbers with n−≥1n^- \ge 1n−≥1, n+≥1n^+ \ge 1n+≥1 and n−≥n0n^- \ge n_0n−≥n0​.

Samples. Let (Ω,μ)(\Omega, \mu)(Ω,μ) be any probability space. On it take two families of measurable random vectors:

  • X1−,…,Xn−−:Ω→RdX^-_1, \dots, X^-_{n^-} : \Omega \to \mathbb{R}^dX1−​,…,Xn−−​:Ω→Rd, mutually independent, each with law P−P^-P−;
  • X1+,…,Xn++:Ω→RdX^+_1, \dots, X^+_{n^+} : \Omega \to \mathbb{R}^dX1+​,…,Xn++​:Ω→Rd, mutually independent, each with law P+P^+P+.

No independence between the two families is assumed.

NP classifiers. For an outcome ω\omegaω, a function fff is an NP classifier at ω\omegaω if both of the following hold:

  1. f∈Hconvf \in \mathcal{H}^{\mathrm{conv}}f∈Hconv and fff satisfies
1n−∑i=1n−φ(f(Xi−(ω)))≤α−κn−.\frac{1}{n^-}\sum_{i=1}^{n^-}\varphi\big(f(X^-_i(\omega))\big) \le \alpha - \frac{\kappa}{\sqrt{n^-}}.n−1​i=1∑n−​φ(f(Xi−​(ω)))≤α−n−​κ​.
  1. For every g∈Hconvg \in \mathcal{H}^{\mathrm{conv}}g∈Hconv satisfying the same constraint,
1n+∑i=1n+φ(−f(Xi+(ω)))≤1n+∑i=1n+φ(−g(Xi+(ω))).\frac{1}{n^+}\sum_{i=1}^{n^+}\varphi\big(-f(X^+_i(\omega))\big) \le \frac{1}{n^+}\sum_{i=1}^{n^+}\varphi\big(-g(X^+_i(\omega))\big).n+1​i=1∑n+​φ(−f(Xi+​(ω)))≤n+1​i=1∑n+​φ(−g(Xi+​(ω))).

The bad set. Let BBB be the set of ω\omegaω for which it is not true that every NP classifier fff at ω\omegaω satisfies all three of:

R−(f)≤Rφ−(f),Rφ−(f)≤α,R^-(f) \le R^-_\varphi(f), \qquad R^-_\varphi(f) \le \alpha,R−(f)≤Rφ−​(f),Rφ−​(f)≤α, Rφ+(f)−γ(α)≤4 φ(1) κ(1−εˉ) α n−+2κn+.R^+_\varphi(f) - \gamma(\alpha) \le \frac{4\,\varphi(1)\,\kappa}{(1-\bar\varepsilon)\,\alpha\,\sqrt{n^-}} + \frac{2\kappa}{\sqrt{n^+}}.Rφ+​(f)−γ(α)≤(1−εˉ)αn−​4φ(1)κ​+n+​2κ​.

In other words, BBB is the set of ω\omegaω at which at least one NP classifier violates at least one of these three inequalities.

Conclusion. The theorem asserts

μ(B)≤2δ,\mu(B) \le 2\delta,μ(B)≤2δ,

where μ\muμ is applied to BBB as an outer measure; BBB is not asserted to be measurable.

Notes on scope.

  • If no NP classifier exists at ω\omegaω, then ω∉B\omega \notin Bω∈/B vacuously.
  • When several minimizers exist, the bound must hold for all of them simultaneously.
  • The ordinary type II error P+(f≤0)P^+(f \le 0)P+(f≤0) does not appear in the conclusion; only the φ\varphiφ-type II error does.
Human review
  • Endorsed by Shuze Chen · Nov 23, 2026

    Confirmed by the moderator at approval.

  • Endorsed by Xeroth · Nov 23, 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