Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 8 — a learning method generalizes w.r.t. s∗\mathbf s^*s∗ iff it is weakly robust w.r.t. s∗\mathbf s^*s∗

Proved
XuMannorRobust.WeakRobust.theorem8_generalizes_iff_weakly_robust

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

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

Let Z\mathcal ZZ be a measurable space of samples with a probability measure μ\muμ, 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 that is non-negative, bounded by MMM and measurable in its sample argument. Let A={An}n∈N\mathcal A = \{\mathcal A^n\}_{n \in \mathbb N}A={An}n∈N​, An:Zn→H\mathcal A^n : \mathcal Z^n \to \mathcal HAn:Zn→H, be a learning method, and fix a sequence of training samples s∗=(s1∗,s2∗,… )\mathbf s^* = (s^*_1, s^*_2, \dots)s∗=(s1∗​,s2∗​,…). Then

A generalizes w.r.t. s∗  ⟺  A is weakly robust w.r.t. s∗,\mathcal A \text{ generalizes w.r.t. } \mathbf s^* \iff \mathcal A \text{ is weakly robust w.r.t. } \mathbf s^*,A generalizes w.r.t. s∗⟺A is weakly robust w.r.t. s∗,

that is, lim⁡n∣L(As∗(n))−L(As∗(n),s∗(n))∣=0\lim_n |\mathcal L(\mathcal A_{\mathbf s^*(n)}) - L(\mathcal A_{\mathbf s^*(n)}, \mathbf s^*(n))| = 0limn​∣L(As∗(n)​)−L(As∗(n)​,s∗(n))∣=0 if and only if there are sets Dn⊆Zn\mathcal D_n \subseteq \mathcal Z^nDn​⊆Zn with Pr⁡t(n)∼μn(t(n)∈Dn)→1\Pr_{\mathbf t(n) \sim \mu^n}(\mathbf t(n) \in \mathcal D_n) \to 1Prt(n)∼μn​(t(n)∈Dn​)→1 on which the average loss of As∗(n)\mathcal A_{\mathbf s^*(n)}As∗(n)​ is uniformly within o(1)o(1)o(1) of its training average loss.

The theorem says that a (weak) form of robustness is not only sufficient but also necessary for generalization: this is the sense in which Xu and Mannor call robustness an essential property of successful learning.

Formalization Note The training sequence is fixed and deterministic; all probabilities are over the test sample t(n)∼μn\mathbf t(n) \sim \mu^nt(n)∼μn, the product measure Measure.pi (fun _ : Fin n => μ). The standing assumption of the paper (Sect. 1.1) that 0≤l≤M0 \le l \le M0≤l≤M is a hypothesis; measurability of l(h,⋅)l(h, \cdot)l(h,⋅), which the paper ignores, is added. See the definitions for the encoding of Eq. (6).

Preamble
import Mathlib
import Definitions.Def_XuMannorRobust_WeakRobust_Generalizes
import Definitions.Def_XuMannorRobust_WeakRobust_WeaklyRobust

open MeasureTheory
Formal statement
namespace XuMannorRobust.WeakRobust

/-- Xu & Mannor 2012, p. 409, Theorem 8: fix a sequence of training samples `s*`. A learning
method `A` generalizes w.r.t. `s*` if and only if it is weakly robust w.r.t. `s*` (samples i.i.d.
from the probability measure `μ`; loss measurable with values in `[0, M]`). -/
theorem theorem8_generalizes_iff_weakly_robust {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))
    (A : (n : ℕ) → (Fin n → Z) → H) (sStar : ℕ → Z) :
    Generalizes μ l A sStar ↔ WeaklyRobust μ l A sStar := by sorry

end XuMannorRobust.WeakRobust
Source
Xu & Mannor, Robustness and Generalization, Mach Learn 86 (2012), DOI 10.1007/s10994-011-5268-1, p. 409, Theorem 8
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