Corollary 4.1: the NP classifier under i.i.d. labelled sampling
ProvedNeymanPearsonClassification.random_sampling_oracle_inequalityLet and the base classifiers be as in Theorem 4.1, let Assumption 1 hold, and let and be as in Theorem 4.2. Let be independent copies of , where , , and has law given and given . Let and , and let be any solution of the program (3.4) built from the two label classes of the sample. If , then:
- With probability at least ,
- With probability at least ,
Formalization Note The law of each pair is given by and . In part 1 the paper's convention is made explicit. When the paper's program (3.4) is undefined; part 1 excludes that case by an explicit guard (in Lean, with an empty sample the level evaluates to and to , so junk solutions would exist). When the type II bound is , so only the type I bound is required. Part 2 has no guard: on or the Lean program has such junk solutions, but these events lie inside and , whose probabilities are already part of the failure bound, so part 2 remains true as stated. "Any solution" is stated uniformly over all solutions, as in Theorem 4.2.
import Mathlib import Definitions.Def_NeymanPearsonClassification_Basic open MeasureTheory ProbabilityTheory
namespace NeymanPearsonClassification
theorem random_sampling_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)
(p : ℝ) (hp : p ∈ Set.Ioo 0 1) {n : ℕ}
(hn : 2 * (nZero (kappa L M δ) (epsBar h Pm φ α) α : ℝ) / (1 - p) < n)
{Omega : Type*} [MeasurableSpace Omega] (μ : Measure Omega) [IsProbabilityMeasure μ]
(X : Fin n → Omega → EuclideanSpace ℝ (Fin d)) (Y : Fin n → Omega → ℝ)
(hXm : ∀ i, Measurable (X i)) (hYm : ∀ i, Measurable (Y i))
(hind : iIndepFun (fun i ω => (X i ω, Y i ω)) μ)
(hY : ∀ i ω, Y i ω = -1 ∨ Y i ω = 1)
(hlawp : ∀ i (A : Set (EuclideanSpace ℝ (Fin d))), MeasurableSet A →
μ {ω | X i ω ∈ A ∧ Y i ω = 1} = ENNReal.ofReal p * Pp A)
(hlawm : ∀ i (A : Set (EuclideanSpace ℝ (Fin d))), MeasurableSet A →
μ {ω | X i ω ∈ A ∧ Y i ω = -1} = ENNReal.ofReal (1 - p) * Pm A) :
μ {ω | ¬ (0 < (labelIdx (fun i => Y i ω) (-1)).card →
∀ f, IsNPClassifier h φ α (kappa L M δ) (labelIdx (fun i => Y i ω) (-1)) (fun i => X i ω)
(labelIdx (fun i => Y i ω) 1) (fun i => X i ω) f →
(typeI Pm f ≤ phiTypeI Pm φ f ∧ phiTypeI Pm φ f ≤ α) ∧
(0 < (labelIdx (fun i => Y i ω) 1).card →
phiTypeII Pp φ f - minPhiTypeII h Pm Pp φ α ≤
4 * φ 1 * kappa L M δ /
((1 - epsBar h Pm φ α) * α * Real.sqrt (labelIdx (fun i => Y i ω) (-1)).card) +
2 * kappa L M δ / Real.sqrt (labelIdx (fun i => Y i ω) 1).card))} ≤
ENNReal.ofReal (1 - (1 - 2 * δ) * (1 - Real.exp (-(n * (1 - p) ^ 2 / 2)))) ∧
μ {ω | ¬ ∀ f, IsNPClassifier h φ α (kappa L M δ) (labelIdx (fun i => Y i ω) (-1))
(fun i => X i ω) (labelIdx (fun i => Y i ω) 1) (fun i => X i ω) f →
(typeI Pm f ≤ phiTypeI Pm φ f ∧ phiTypeI Pm φ f ≤ α) ∧
phiTypeII Pp φ f - minPhiTypeII h Pm Pp φ α ≤
4 * Real.sqrt 2 * φ 1 * kappa L M δ /
((1 - epsBar h Pm φ α) * α * Real.sqrt (n * (1 - p))) +
2 * Real.sqrt 2 * kappa L M δ / Real.sqrt (n * p)} ≤
ENNReal.ofReal (2 * δ + Real.exp (-(n * (1 - p) ^ 2 / 2)) + Real.exp (-(n * p ^ 2 / 2))) := by sorry
end NeymanPearsonClassificationRead-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix natural numbers and with , and identify the Euclidean space with the space where the features live.
Base classifiers and measures.
- are measurable functions, each taking all its values in .
- and are probability measures on .
- For in the standard simplex , write .
- .
The surrogate . is a convex surrogate: on it is non‑negative, non‑decreasing, continuous and convex, and . Its values outside are unconstrained. In addition, is a real number and is ‑Lipschitz on .
Error functionals. For any define:
- the type I error ;
- the ‑type I error ;
- the ‑type II error .
These are Bochner integrals, which by convention equal when the integrand is not integrable. For a real , let , and let
This is the real infimum, which by convention is if the set is empty or unbounded below.
Parameters.
- (open intervals).
- There exists with and .
- .
Set
where is the natural logarithm. Also set
The sample size is a natural number with .
The sample. is a probability space, and and are measurable. They satisfy:
- the pairs are mutually independent under ;
- every equals or , for every ;
- for every and every measurable :
For each outcome , let and , with and . Define the empirical errors:
By convention, division by gives . So an empirical error over an empty index set is , and .
NP classifiers. A function is called an NP classifier at if:
- and ;
- for every with .
When the constraint reduces to . When every feasible is a minimizer. No existence of an NP classifier is asserted; if none exists, the conditions below hold vacuously.
Conclusion. The theorem asserts two bounds; is applied to sets whose measurability is not asserted, so these are outer‑measure bounds. Throughout, a negative right‑hand side is replaced by .
- Let be the set of with the following property: if , then every NP classifier at satisfies , and, if moreover ,
Then
- Let be the set of such that every NP classifier at satisfies and
Here there is no condition on or . Then
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.