Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

An oracle inequality for nonparametric least squares (Theorem 13.13)

Proved
HighDimStat.NonparametricLS.thm13_13_oracle_inequality

by mikedeng1 · Sep 19, 2026 · Mathlib 0df444a (Lean v4.33.1)

machine-learningprobabilitystatistics

Theorem 13.13 (p. 433), the goal of this mission. Let δn\delta_nδn​ be any positive solution of Gn(δ;∂F)/δ≤δ/(2σ)G_n(\delta;\partial F)/\delta\le\delta/(2\sigma)Gn​(δ;∂F)/δ≤δ/(2σ), where ∂F=F−F\partial F=F-F∂F=F−F (no longer requiring f∗∈Ff^*\in Ff∗∈F). There are universal positive constants (c0,c1,c2)(c_0,c_1,c_2)(c0​,c1​,c2​) — not depending on the covariate space, sample size, function class, f∗f^*f∗, σ\sigmaσ, δn\delta_nδn​ or ttt — such that for any t≥δnt\ge\delta_nt≥δn​, the nonparametric least-squares estimate f^n\hat f_nf^​n​ satisfies, simultaneously for every f∈Ff\in Ff∈F,

∥f^n−f∗∥n2≤inf⁡γ∈(0,1)[1+γ1−γ∥f−f∗∥n2+c0γ(1−γ) tδn],\|\hat f_n-f^*\|_n^2\le\inf_{\gamma\in(0,1)}\left[\frac{1+\gamma}{1-\gamma}\|f-f^*\|_n^2 +\frac{c_0}{\gamma(1-\gamma)}\,t\delta_n\right],∥f^​n​−f∗∥n2​≤γ∈(0,1)inf​[1−γ1+γ​∥f−f∗∥n2​+γ(1−γ)c0​​tδn​],

with probability at least 1−c1e−c2ntδn/σ21-c_1e^{-c_2nt\delta_n/\sigma^2}1−c1​e−c2​ntδn​/σ2.

This is called an oracle inequality because inf⁡f∈F∥f−f∗∥n2\inf_{f\in F}\|f-f^*\|_n^2inff∈F​∥f−f∗∥n2​ — attained at t=δnt=\delta_nt=δn​ by optimizing the right-hand side over fff — is the error that would be achievable only by an oracle with direct access to uncorrupted samples of f∗f^*f∗; the bound shows the least-squares estimate pays only a constant-factor penalty on this error, plus the estimation-error term δn2\delta_n^2δn2​. Setting f=f∗f=f^*f=f∗ (when f∗∈Ff^*\in Ff∗∈F) recovers Theorem 13.5 up to constants.

Formalization Note The universal quantification over (c0,c1,c2)(c_0,c_1,c_2)(c0​,c1​,c2​) is placed before the quantification over the covariate type, sample size, function class and all other instance data, so the constants cannot secretly depend on the problem instance. The infimum over γ∈(0,1)\gamma\in(0,1)γ∈(0,1) is a real infimum over the (nonempty, e.g. γ=1/2\gamma=1/2γ=1/2) subtype {r : ℝ // r ∈ Set.Ioo 0 1}.

Preamble
import Mathlib
import Definitions.Def_HighDimStat_NonparametricLS_Core
Formal statement
namespace HighDimStat.NonparametricLS

open MeasureTheory

/-- **Theorem 13.13** (p. 433, PDF 453), the goal of this mission: an oracle inequality for
nonparametric least squares. Let `δn` be any positive solution of `Gₙ(δ; ∂F)/δ ≤ δ/(2σ)`
(Eq. (13.42a), with `∂F = F − F`, no longer requiring `f* ∈ F`). There are **universal**
positive constants `(c0, c1, c2)` — independent of `X`, `n`, `F`, `f*`, `σ`, `δn`, `t` — such
that for any `t ≥ δn`, the least-squares estimate `f̂ₙ` satisfies, simultaneously for every
`f ∈ F`,

`‖f̂ₙ − f*‖ₙ² ≤ inf_{γ∈(0,1)} [ (1+γ)/(1−γ) · ‖f − f*‖ₙ² + c0/(γ(1−γ)) · tδn ]`,

with probability at least `1 − c1 exp(−c2 n t δn / σ²)` (Eq. (13.42b)). -/
theorem thm13_13_oracle_inequality :
    ∃ c0 c1 c2 : ℝ, 0 < c0 ∧ 0 < c1 ∧ 0 < c2 ∧
      ∀ {X Ω : Type*} [MeasurableSpace Ω] {n : ℕ}, 0 < n →
      ∀ (x : Fin n → X) (w : Fin n → Ω → ℝ) (P : Measure Ω) [IsProbabilityMeasure P],
        IsIIDStdGaussian P w →
      ∀ (F : Set (X → ℝ)) (fStar : X → ℝ), IsStarShaped (diffClass F) →
      ∀ (σ : ℝ), 0 < σ →
      ∀ (y : Ω → Fin n → ℝ), (∀ ω i, y ω i = fStar (x i) + σ * w i ω) →
      ∀ (fHat : Ω → (X → ℝ)), (∀ ω, IsLeastSquaresEstimate x F (y ω) (fHat ω)) →
      ∀ (δn t : ℝ), SatisfiesCriticalInequality x w P (diffClass F) σ δn → δn ≤ t →
        1 - c1 * Real.exp (-c2 * ↑n * t * δn / σ ^ 2) ≤
          P.real {ω | ∀ f ∈ F, empiricalNormSq x (fun z => fHat ω z - fStar z) ≤
              ⨅ γ : {r : ℝ // r ∈ Set.Ioo (0 : ℝ) 1},
                (1 + γ.1) / (1 - γ.1) * empiricalNormSq x (fun z => f z - fStar z)
                  + c0 / (γ.1 * (1 - γ.1)) * t * δn} := by sorry

end HighDimStat.NonparametricLS
Source
Wainwright, High-Dimensional Statistics, CUP 2019, p. 433 (PDF p. 453), Theorem 13.13, Eq. (13.42)
Human review
  • Endorsed by Shuze Chen · Sep 28, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 28, 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