Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 5 — quantile-value and truncated-mean generalization bounds for pseudo-robust algorithms

Proved
XuMannorRobust.Quantile.theorem5_quantile_truncated_mean_bounds

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

algorithmic-robustnessgeneralizationlearning-theoryp2o-batch-p200bp2o-gran-per-chapterp2o-plan-paperp2o-v1quantile

Let Z\mathcal ZZ be a measurable space, H\mathcal HH a set of hypotheses and l:H×Z→[0,M]l : \mathcal H \times \mathcal Z \to [0, M]l:H×Z→[0,M] a loss with each l(h,⋅)l(h, \cdot)l(h,⋅) measurable. Let the training set s=(s1,…,sn)\mathbf s = (s_1, \dots, s_n)s=(s1​,…,sn​), n≥1n \ge 1n≥1, consist of nnn i.i.d. draws from a probability measure μ\muμ on Z\mathcal ZZ, with empirical distribution μemp\mu_{\mathrm{emp}}μemp​. Let A:Zn→H\mathcal A : \mathcal Z^n \to \mathcal HA:Zn→H be (K,ϵ(⋅),n^(⋅))(K, \epsilon(\cdot), \hat n(\cdot))(K,ϵ(⋅),n^(⋅)) pseudo robust (Definition 5), let β∈(0,1)\beta \in (0,1)β∈(0,1), δ>0\delta > 0δ>0, and

λ0=2Kln⁡2+2ln⁡(1/δ)n.\lambda_0 = \sqrt{\frac{2K \ln 2 + 2 \ln(1/\delta)}{n}}.λ0​=n2Kln2+2ln(1/δ)​​.

Then with probability at least 1−δ1 - \delta1−δ the following holds: if 0≤β−λ0−n−n^(s)n0 \le \beta - \lambda_0 - \frac{n - \hat n(\mathbf s)}{n}0≤β−λ0​−nn−n^(s)​ and β+λ0+n−n^(s)n≤1\beta + \lambda_0 + \frac{n - \hat n(\mathbf s)}{n} \le 1β+λ0​+nn−n^(s)​≤1, then

  1. Q(As,β−λ0−n−n^(s)n,μemp)−ϵ(s)≤Q(As,β,μ)≤Q(As,β+λ0+n−n^(s)n,μemp)+ϵ(s)\displaystyle \mathcal Q\Big(\mathcal A_{\mathbf s}, \beta - \lambda_0 - \tfrac{n - \hat n(\mathbf s)}{n}, \mu_{\mathrm{emp}}\Big) - \epsilon(\mathbf s) \le \mathcal Q(\mathcal A_{\mathbf s}, \beta, \mu) \le \mathcal Q\Big(\mathcal A_{\mathbf s}, \beta + \lambda_0 + \tfrac{n - \hat n(\mathbf s)}{n}, \mu_{\mathrm{emp}}\Big) + \epsilon(\mathbf s)Q(As​,β−λ0​−nn−n^(s)​,μemp​)−ϵ(s)≤Q(As​,β,μ)≤Q(As​,β+λ0​+nn−n^(s)​,μemp​)+ϵ(s);
  2. T(As,β−λ0−n−n^(s)n,μemp)−ϵ(s)≤T(As,β,μ)≤T(As,β+λ0+n−n^(s)n,μemp)+ϵ(s)\displaystyle \mathcal T\Big(\mathcal A_{\mathbf s}, \beta - \lambda_0 - \tfrac{n - \hat n(\mathbf s)}{n}, \mu_{\mathrm{emp}}\Big) - \epsilon(\mathbf s) \le \mathcal T(\mathcal A_{\mathbf s}, \beta, \mu) \le \mathcal T\Big(\mathcal A_{\mathbf s}, \beta + \lambda_0 + \tfrac{n - \hat n(\mathbf s)}{n}, \mu_{\mathrm{emp}}\Big) + \epsilon(\mathbf s)T(As​,β−λ0​−nn−n^(s)​,μemp​)−ϵ(s)≤T(As​,β,μ)≤T(As​,β+λ0​+nn−n^(s)​,μemp​)+ϵ(s).

Here Q(h,β,ν)\mathcal Q(h, \beta, \nu)Q(h,β,ν) and T(h,β,ν)\mathcal T(h, \beta, \nu)T(h,β,ν) are the β\betaβ-quantile value and β\betaβ-truncated mean of the loss l(h,z)l(h, z)l(h,z), z∼νz \sim \nuz∼ν.

The theorem says that the quantile value and truncated mean of the testing error of a pseudo-robust algorithm are bracketed, up to ϵ(s)\epsilon(\mathbf s)ϵ(s), by the same functionals of the training errors at slightly shifted levels, so they can be estimated from the training sample.

Formalization Note The level condition involves n^(s)\hat n(\mathbf s)n^(s) and so depends on the sample; it is placed inside the high-probability event as the premise of an implication, which is the reading the paper's proof gives (everything holds pointwise on the event E\mathcal EE). "With probability at least 1−δ1-\delta1−δ" is encoded as: the outer measure under μn\mu^nμn of the set of training sets where the implication fails is at most δ\deltaδ, so no measurability of s↦As\mathbf s \mapsto \mathcal A_{\mathbf s}s↦As​ is required. Measurability of each l(h,⋅)l(h, \cdot)l(h,⋅) and of the cells of the partition is added (the paper ignores measurability). T\mathcal TT uses Definition 3 with the misprinted second branch corrected. Levels are real numbers, with nnn and n^(s)\hat n(\mathbf s)n^(s) cast to R\mathbb RR.

Preamble
import Mathlib
import Definitions.Def_XuMannorRobust_Quantile_LossQuantile
import Definitions.Def_XuMannorRobust_Quantile_IsPseudoRobust

open MeasureTheory
Formal statement
namespace XuMannorRobust.Quantile

/-- **Theorem 5** (Xu & Mannor 2012, p. 402; proof in Appendix C, pp. 415–418). Let the loss take
values in `[0, M]` with each `l h` measurable, let `s` consist of `n ≥ 1` i.i.d. draws from the
probability measure `μ`, with empirical distribution `μ_emp`, let `β ∈ (0, 1)`, `δ > 0`,
`λ₀ = √((2K ln 2 + 2 ln(1/δ))/n)` and `r(s) = (n − n̂(s))/n`. If `A` is `(K, ε(·), n̂(·))` pseudo
robust, then with probability at least `1 − δ` the following holds: if
`0 ≤ β − λ₀ − r(s)` and `β + λ₀ + r(s) ≤ 1`, then
(I)  `Q(A_s, β − λ₀ − r(s), μ_emp) − ε(s) ≤ Q(A_s, β, μ) ≤ Q(A_s, β + λ₀ + r(s), μ_emp) + ε(s)`;
(II) `T(A_s, β − λ₀ − r(s), μ_emp) − ε(s) ≤ T(A_s, β, μ) ≤ T(A_s, β + λ₀ + r(s), μ_emp) + ε(s)`.
"With probability at least `1 − δ`" is: the outer measure under `μⁿ` of the set of training sets
where the implication fails is at most `δ`. `T` uses the corrected Definition 3. -/
theorem theorem5_quantile_truncated_mean_bounds {Z H : Type*} [MeasurableSpace Z]
    (μ : Measure Z) [IsProbabilityMeasure μ] (l : H → Z → ℝ) (M : ℝ)
    (hl_bound : ∀ h z, 0 ≤ l h z ∧ l h z ≤ M) (hl_meas : ∀ h, Measurable (l h))
    {n : ℕ} (hn : 0 < n) (A : (Fin n → Z) → H) (K : ℕ) (ε : (Fin n → Z) → ℝ)
    (nhat : (Fin n → Z) → ℕ) (hA : IsPseudoRobust l A K ε nhat)
    (δ : ℝ) (hδ : 0 < δ) (β : ℝ) (hβ0 : 0 < β) (hβ1 : β < 1) :
    (Measure.pi fun _ : Fin n => μ)
        {s : Fin n → Z | ¬
          ((0 ≤ β - Real.sqrt ((2 * (K : ℝ) * Real.log 2 + 2 * Real.log (1 / δ)) / (n : ℝ))
                - ((n : ℝ) - (nhat s : ℝ)) / (n : ℝ) ∧
            β + Real.sqrt ((2 * (K : ℝ) * Real.log 2 + 2 * Real.log (1 / δ)) / (n : ℝ))
                + ((n : ℝ) - (nhat s : ℝ)) / (n : ℝ) ≤ 1) →
          -- (I) quantile value
          ((lossQuantile l (A s)
                (β - Real.sqrt ((2 * (K : ℝ) * Real.log 2 + 2 * Real.log (1 / δ)) / (n : ℝ))
                  - ((n : ℝ) - (nhat s : ℝ)) / (n : ℝ)) (empiricalMeasure s) - ε s
              ≤ lossQuantile l (A s) β μ ∧
            lossQuantile l (A s) β μ
              ≤ lossQuantile l (A s)
                (β + Real.sqrt ((2 * (K : ℝ) * Real.log 2 + 2 * Real.log (1 / δ)) / (n : ℝ))
                  + ((n : ℝ) - (nhat s : ℝ)) / (n : ℝ)) (empiricalMeasure s) + ε s) ∧
          -- (II) truncated mean
          (lossTruncatedMean l (A s)
                (β - Real.sqrt ((2 * (K : ℝ) * Real.log 2 + 2 * Real.log (1 / δ)) / (n : ℝ))
                  - ((n : ℝ) - (nhat s : ℝ)) / (n : ℝ)) (empiricalMeasure s) - ε s
              ≤ lossTruncatedMean l (A s) β μ ∧
            lossTruncatedMean l (A s) β μ
              ≤ lossTruncatedMean l (A s)
                (β + Real.sqrt ((2 * (K : ℝ) * Real.log 2 + 2 * Real.log (1 / δ)) / (n : ℝ))
                  + ((n : ℝ) - (nhat s : ℝ)) / (n : ℝ)) (empiricalMeasure s) + ε s)))}
      ≤ ENNReal.ofReal δ := by sorry

end XuMannorRobust.Quantile
Source
Xu & Mannor, Robustness and Generalization, Mach Learn 86 (2012), DOI 10.1007/s10994-011-5268-1, p. 402, Theorem 5 (proof in Appendix C, pp. 415–418)
Human review
  • Endorsed by Shuze Chen · Oct 1, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 1, 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 paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me