Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1, p. 4 — if ℓ(w, Z) is σ-subgaussian for every w, then |gen(μ, P_{W|S})| ≤ √(2σ² I(S;W)/n)

Proved
InfoGen.Expected.theorem_1

by mikedeng1 · Oct 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

generalization-errorinformation-theoretic-generalizationmutual-informationp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1subgaussian

This is the main theorem of Xu and Raginsky: the expected generalization error of a learning algorithm is bounded by the mutual information between its input and its output.

Let Z\mathsf ZZ be an instance space, W\mathsf WW a hypothesis space and ℓ:W×Z→R+\ell:\mathsf W\times\mathsf Z\to\mathbb R_+ℓ:W×Z→R+​ a nonnegative, jointly measurable loss. Let μ\muμ be a probability measure on Z\mathsf ZZ, n≥1n\ge1n≥1, and S=(Z1,…,Zn)∼μ⊗nS=(Z_1,\dots,Z_n)\sim\mu^{\otimes n}S=(Z1​,…,Zn​)∼μ⊗n an i.i.d. sample. A learning algorithm is a Markov kernel PW∣SP_{W|S}PW∣S​ from Zn\mathsf Z^nZn to W\mathsf WW; the pair (S,W)(S,W)(S,W) has law PS,W=μ⊗n⊗PW∣SP_{S,W}=\mu^{\otimes n}\otimes P_{W|S}PS,W​=μ⊗n⊗PW∣S​. With Lμ(w)=E[ℓ(w,Z)]L_\mu(w)=\mathbb E[\ell(w,Z)]Lμ​(w)=E[ℓ(w,Z)] and LS(w)=1n∑i=1nℓ(w,Zi)L_S(w)=\frac1n\sum_{i=1}^n\ell(w,Z_i)LS​(w)=n1​∑i=1n​ℓ(w,Zi​), the expected generalization error is gen(μ,PW∣S)=E[Lμ(W)−LS(W)]\mathrm{gen}(\mu,P_{W|S})=\mathbb E[L_\mu(W)-L_S(W)]gen(μ,PW∣S​)=E[Lμ​(W)−LS​(W)], and I(S;W)=D(PS,W∥PS⊗PW)I(S;W)=D(P_{S,W}\|P_S\otimes P_W)I(S;W)=D(PS,W​∥PS​⊗PW​) is the input–output mutual information.

Suppose that ℓ(w,Z)\ell(w,Z)ℓ(w,Z) is σ\sigmaσ-subgaussian under μ\muμ for all w∈Ww\in\mathsf Ww∈W, that is, log⁡E[eλ(ℓ(w,Z)−Lμ(w))]≤λ2σ2/2\log\mathbb E[e^{\lambda(\ell(w,Z)-L_\mu(w))}]\le\lambda^2\sigma^2/2logE[eλ(ℓ(w,Z)−Lμ​(w))]≤λ2σ2/2 for all λ∈R\lambda\in\mathbb Rλ∈R, and that I(S;W)<∞I(S;W)<\inftyI(S;W)<∞. Then

∣gen(μ,PW∣S)∣≤2σ2n I(S;W).\big|\mathrm{gen}(\mu,P_{W|S})\big|\le\sqrt{\frac{2\sigma^2}{n}\,I(S;W)} .​gen(μ,PW∣S​)​≤n2σ2​I(S;W)​.

The less the output hypothesis reveals about the training data, the smaller the expected gap between population and empirical risk. The bound places no restriction on the size of W\mathsf WW and allows unbounded losses, provided they are subgaussian; a loss with values in [a,b][a,b][a,b] is (b−a)/2(b-a)/2(b−a)/2-subgaussian for every μ\muμ.

Formalization Note Subgaussianity is Mathlib's HasSubgaussianMGF of the centred loss with variance proxy σ2\sigma^2σ2 (the square of the paper's σ\sigmaσ). The mutual information lives in [0,∞][0,\infty][0,∞]; the hypothesis I(S;W)≠∞I(S;W)\neq\inftyI(S;W)=∞ is added because Lean's conversion of ∞\infty∞ to a real number gives 000, which would turn the page's vacuous bound into a false one. Also added, as implicit on the page: n≥1n\ge1n≥1 (the bound divides by nnn) and joint measurability of ℓ\ellℓ (so that Lμ(W)L_\mu(W)Lμ​(W) and LS(W)L_S(W)LS​(W) are random variables). The nonnegativity of ℓ\ellℓ is the page's own assumption. The generalization error integrates the pointwise difference Lμ(W)−LS(W)L_\mu(W)-L_S(W)Lμ​(W)−LS​(W); no integrability hypothesis is assumed.

Preamble
import Mathlib
import Definitions.Def_InfoGen_Expected_Setting

open MeasureTheory ProbabilityTheory InformationTheory
open scoped ENNReal NNReal
Formal statement
namespace InfoGen.Expected

open LearnStability.Characterization

/-- Theorem 1 (Xu & Raginsky, arXiv:1705.07809v2, p. 4, eq. (10)). Let `S` be an i.i.d. sample of
size `n ≥ 1` from `μ` and `W` the output of the learning algorithm `κ = P_{W|S}`. If `ℓ(w, Z)` is
`σ`-subgaussian under `μ` for every hypothesis `w` and `I(S; W) < ∞`, then
`|gen(μ, P_{W|S})| ≤ √((2σ²/n) I(S; W))`. -/
theorem theorem_1 {Z W : Type*} [MeasurableSpace Z] [MeasurableSpace W]
    (μ : Measure Z) [IsProbabilityMeasure μ] (n : ℕ) (hn : 0 < n)
    (ℓ : W → Z → ℝ) (hℓ : Measurable (Function.uncurry ℓ)) (hℓ0 : ∀ w z, 0 ≤ ℓ w z)
    (κ : Kernel (Fin n → Z) W) [IsMarkovKernel κ]
    (σ : ℝ≥0) (hσ : ∀ w, HasSubgaussianMGF (fun z => ℓ w z - risk ℓ μ w) (σ ^ 2) μ)
    (hI : mutualInfo (sampleLaw μ n ⊗ₘ κ) ≠ ⊤) :
    |genError ℓ μ κ|
      ≤ Real.sqrt (2 * (σ : ℝ) ^ 2 / n * (mutualInfo (sampleLaw μ n ⊗ₘ κ)).toReal) := by sorry

end InfoGen.Expected
Source
Xu & Raginsky, arXiv:1705.07809v2, Theorem 1, eq. (10), p. 4; proof p. 4 (first sentence) with Lemma 1 (p. 3) and App. A (p. 11)
Human review
  • Endorsed by Shuze Chen · Oct 8, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 8, 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