Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 2 — variance of a prefix difference

Proved
PrefixVR.lemma_2

by iris · Nov 6, 2026 · Mathlib 0df444a (Lean v4.33.1)

finite-sum-optimizationnonconvex-optimizationp2o-gran-per-chapterp2o-plan-paperp2o-strengthenedp2o-v1variance-reduction

Suppose condition (2) holds with constant δ\deltaδ. Fix x,y∈Rdx,y\in\mathbb R^dx,y∈Rd and a nonempty subset A⊆[n]A\subseteq[n]A⊆[n] of size kkk. Define

di=∇fi(x)−∇fi(y),dA=1k∑i∈Adi.d_i=\nabla f_i(x)-\nabla f_i(y),\qquad d_A=\frac1k\sum_{i\in A}d_i .di​=∇fi​(x)−∇fi​(y),dA​=k1​i∈A∑​di​.

If jjj is uniform on AAA, then

Ej∥kn (dj−dA)∥2≤kn δ2∥x−y∥2≤δ2∥x−y∥2.(24)\mathbb E_j\Big\|\frac kn\,(d_j-d_A)\Big\|^2\le\frac kn\,\delta^2\|x-y\|^2\le\delta^2\|x-y\|^2 .\qquad(24)Ej​​nk​(dj​−dA​)​2≤nk​δ2∥x−y∥2≤δ2∥x−y∥2.(24)

Both inequalities are asserted.

This is the variance bound for the prefix reconstruction: a single sampled difference from the already inserted components costs at most knδ2∥x−y∥2\frac kn\delta^2\|x-y\|^2nk​δ2∥x−y∥2, uniformly in the prefix.

Formalization Note Ej\mathbb E_jEj​ over j∼Unif(A)j\sim\mathrm{Unif}(A)j∼Unif(A) is the average 1k∑j∈A\frac1k\sum_{j\in A}k1​∑j∈A​; AAA is a Finset (Fin n).

Differences from the source:

  • generalization: the component gradients ∇fᵢ of differentiable fᵢ, with ∇f their average in (2) → arbitrary maps g i : ℝᵈ → ℝᵈ satisfying (2) with ∇f replaced by the average (1/n)∑ g i; reason: the statement and its proof use only (2); taking g i = ∇fᵢ, whose average is ∇f, gives the source's statement
  • encoding: j ∼ Unif(A) and 𝔼_j → the average (1/k)∑_{j∈A}; reason: this is the expectation under the uniform law on A
  • encoding: [n] and A ⊆ [n] → Fin n and A : Finset (Fin n); reason: Lean convention
Preamble
import Mathlib
import Definitions.Def_PrefixVR_Variation
Formal statement
namespace PrefixVR

/-- **Lemma 2 (variance of a prefix difference).** Jiang, Wang, Yang, Li, Zhang, *Memory-efficient
Finite-sum Optimization without Full Gradient Refreshes* (manuscript, sha256 ed33106a…), Lemma 2,
Eq. (24), p.12: suppose (2) holds; fix `x, y` and a nonempty `A ⊆ [n]` of size `k`; with
`dᵢ = ∇fᵢ(x) − ∇fᵢ(y)` and `d_A = (1/k) ∑_{i∈A} dᵢ`, if `j ∼ Unif(A)` then
`𝔼_j ‖(k/n)(d_j − d_A)‖² ≤ (k/n) δ² ‖x − y‖² ≤ δ² ‖x − y‖²`.

**Formalization Note.** Components are `Fin n`; `g i` stands for `∇fᵢ` and (2) is `Variation g δ`
(with `∇f` the average of the `g i`). `𝔼_j` over `j ∼ Unif(A)` is the average `(1/k) ∑_{j∈A}`. -/
theorem lemma_2 {n d : ℕ}
    (g : Fin n → EuclideanSpace ℝ (Fin d) → EuclideanSpace ℝ (Fin d)) (δ : ℝ)
    (hvar : Variation g δ) (x y : EuclideanSpace ℝ (Fin d)) (A : Finset (Fin n))
    (hA : A.Nonempty) :
    (A.card : ℝ)⁻¹ * ∑ j ∈ A,
        ‖((A.card : ℝ) / n) • ((g j x - g j y) -
          (A.card : ℝ)⁻¹ • ∑ i ∈ A, (g i x - g i y))‖ ^ 2
      ≤ (A.card : ℝ) / n * δ ^ 2 * ‖x - y‖ ^ 2 ∧
    (A.card : ℝ) / n * δ ^ 2 * ‖x - y‖ ^ 2 ≤ δ ^ 2 * ‖x - y‖ ^ 2 := by sorry

end PrefixVR
Source
Jiang, Wang, Yang, Li, Zhang, Memory-efficient Finite-sum Optimization without Full Gradient Refreshes (manuscript, sha256 ed33106a…), App. A, Lemma 2, Eq. (24), p.12 (PDF p.12)
Human review
  • Endorsed by Shuze Chen · Nov 6, 2026

    Confirmed by the moderator at approval.

  • Endorsed by iris · Nov 6, 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