Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

(4.25) — expected value after one dynamic batch step in terms of E∥g∥2=∥∇J∥2+∥Var(g)∥1E\|g\|^2 = \|\nabla J\|^2 + \|\mathrm{Var}(g)\|_1E∥g∥2=∥∇J∥2+∥Var(g)∥1​

Proved
DynSampleSize.Stoch.eq_4_25

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

mini-batchp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1stochastic-optimization

Let (Z,P)(Z,P)(Z,P), ℓ\ellℓ, ∇ℓ\nabla\ell∇ℓ and J(w)=∫ℓ(w;z) dP(z)J(w)=\int\ell(w;z)\,dP(z)J(w)=∫ℓ(w;z)dP(z) satisfy the stochastic model of §4.2 (integrable loss, measurable gradient with finite second moment, ∇J(w)=∫∇ℓ(w;z) dP(z)\nabla J(w)=\int\nabla\ell(w;z)\,dP(z)∇J(w)=∫∇ℓ(w;z)dP(z)), and let JJJ satisfy (4.2) with constants 0<λ<L0<\lambda<L0<λ<L. Fix a point www and a sample size n≥1n\ge1n≥1, draw a batch b=(b1,…,bn)b=(b_1,\dots,b_n)b=(b1​,…,bn​) of nnn independent points with law PPP, and let g=1n∑i∇ℓ(w;bi)g=\frac1n\sum_i\nabla\ell(w;b_i)g=n1​∑i​∇ℓ(w;bi​). Then J(w−g/L)J(w-g/L)J(w−g/L) and ∥g∥2\|g\|^2∥g∥2 are integrable, and

E[J(w−1Lg)]≤J(w)−1L∥∇J(w)∥2+12LE[∥g∥2]E[∥g∥2]=∥∇J(w)∥2+∥Var(g)∥1,\begin{aligned} \mathbb E[J(w-\tfrac1L g)] &\le J(w)-\frac1L\|\nabla J(w)\|^2+\frac1{2L}\mathbb E[\|g\|^2]\\ \mathbb E[\|g\|^2] &= \|\nabla J(w)\|^2+\|\mathrm{Var}(g)\|_1 , \end{aligned}E[J(w−L1​g)]E[∥g∥2]​≤J(w)−L1​∥∇J(w)∥2+2L1​E[∥g∥2]=∥∇J(w)∥2+∥Var(g)∥1​,​

where ∥Var(g)∥1=E∥g−Eg∥2\|\mathrm{Var}(g)\|_1=\mathbb E\|g-\mathbb E g\|^2∥Var(g)∥1​=E∥g−Eg∥2.

In the paper, w=wkw=w_kw=wk​ is the current iterate and the expectation is conditional on wkw_kwk​; this is the first step of the one-iteration analysis of the dynamic batch method.

Formalization Note The batch law is the product measure P⊗nP^{\otimes n}P⊗n on ZnZ^nZn; fixing www and averaging over the batch is exactly the paper's conditional expectation given wkw_kwk​.

Preamble
import Mathlib
import Definitions.Def_DynSampleSize_Stoch_UniformConvexity
import Definitions.Def_DynSampleSize_Stoch_Model

open MeasureTheory
Formal statement
namespace DynSampleSize.Stoch

/-- (4.25), p. 11: at a point `w`, with the batch `b` of `n ≥ 1` i.i.d. draws from `P` and
`g = batchGrad gradℓ n w b`, the step `w − g/L` satisfies
`E[J(w − g/L)] ≤ J(w) − (1/L)‖∇J(w)‖² + (1/(2L)) E‖g‖²` and
`E‖g‖² = ‖∇J(w)‖² + ‖Var(g)‖₁`; all expectations exist. -/
theorem eq_4_25 {m : ℕ} {Z : Type*} [MeasurableSpace Z] (P : Measure Z) [IsProbabilityMeasure P]
    (ℓ : EuclideanSpace ℝ (Fin m) → Z → ℝ)
    (gradℓ : EuclideanSpace ℝ (Fin m) → Z → EuclideanSpace ℝ (Fin m))
    (hmodel : StochModel P ℓ gradℓ) (lam L : ℝ) (hJ : UniformlyConvex (objective P ℓ) lam L)
    (w : EuclideanSpace ℝ (Fin m)) (n : ℕ) (hn : 1 ≤ n) :
    Integrable (fun b => objective P ℓ (w - (1 / L) • batchGrad gradℓ n w b))
        (Measure.pi (fun _ : Fin n => P)) ∧
      Integrable (fun b => ‖batchGrad gradℓ n w b‖ ^ 2) (Measure.pi (fun _ : Fin n => P)) ∧
      ∫ b, objective P ℓ (w - (1 / L) • batchGrad gradℓ n w b) ∂(Measure.pi (fun _ : Fin n => P)) ≤
        objective P ℓ w - 1 / L * ‖gradient (objective P ℓ) w‖ ^ 2 +
          1 / (2 * L) * ∫ b, ‖batchGrad gradℓ n w b‖ ^ 2 ∂(Measure.pi (fun _ : Fin n => P)) ∧
      ∫ b, ‖batchGrad gradℓ n w b‖ ^ 2 ∂(Measure.pi (fun _ : Fin n => P)) =
        ‖gradient (objective P ℓ) w‖ ^ 2 +
          vecVar (Measure.pi (fun _ : Fin n => P)) (batchGrad gradℓ n w) := by sorry

end DynSampleSize.Stoch
Source
Byrd, Chin, Nocedal, Wu, Sample size selection in optimization methods for machine learning, Math. Program. (2012), doi:10.1007/s10107-012-0572-5 — authors' version of 18 Oct 2011, p. 11, (4.25)
Human review
  • Endorsed by Shuze Chen · Oct 7, 2026

    Confirmed by the moderator at approval.

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