Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 1, p. 7 — SAG with α = 1/(16L): E[g(x̄ᵏ)] − g(x*) ≤ (32n/k)C₀, and E[g(xᵏ)] − g(x*) ≤ (1 − min{μ/16L, 1/8n})ᵏC₀ if g is μ-strongly convex

Proved
SAGFiniteSum.Rate.theorem_1

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

convergence-rateconvex-optimizationfinite-sumlinear-convergencep2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-paperp2o-v1stochastic-average-gradient

Let f1,…,fn:Rp→Rf_1,\dots,f_n:\mathbb R^p\to\mathbb Rf1​,…,fn​:Rp→R, n≥1n\ge1n≥1, be convex and differentiable with gradients fi′f'_ifi′​ that are Lipschitz continuous with constant L>0L>0L>0, ∥fi′(x)−fi′(y)∥≤L∥x−y∥\|f'_i(x)-f'_i(y)\|\le L\|x-y\|∥fi′​(x)−fi′​(y)∥≤L∥x−y∥, and let x∗x^*x∗ be a minimizer of g=1n∑i=1nfig=\frac1n\sum_{i=1}^nf_ig=n1​∑i=1n​fi​. Put g′=1n∑ifi′g'=\frac1n\sum_if'_ig′=n1​∑i​fi′​ and σ2=1n∑i∥fi′(x∗)∥2\sigma^2=\frac1n\sum_i\|f'_i(x^*)\|^2σ2=n1​∑i​∥fi′​(x∗)∥2.

Run the stochastic average gradient (SAG) method with the constant step size αk=116L\alpha_k=\frac1{16L}αk​=16L1​ from x0∈Rpx^0\in\mathbb R^px0∈Rp: at iteration kkk an index iki_kik​ is drawn uniformly from {1,…,n}\{1,\dots,n\}{1,…,n}, independently of the past, the table entry yiky_{i_k}yik​​ is replaced by fik′(xk−1)f'_{i_k}(x^{k-1})fik​′​(xk−1), and xk=xk−1−αn∑iyikx^k=x^{k-1}-\frac{\alpha}{n}\sum_iy^k_ixk=xk−1−nα​∑i​yik​. Let xˉk=1k∑i=0k−1xi\bar x^k=\frac1k\sum_{i=0}^{k-1}x^ixˉk=k1​∑i=0k−1​xi. Then for every k≥1k\ge1k≥1,

E[g(xˉk)]−g(x∗) ≤ 32nk C0,\mathbb E\big[g(\bar x^k)\big]-g(x^*)\ \le\ \frac{32n}{k}\,C_0,E[g(xˉk)]−g(x∗) ≤ k32n​C0​,

where

  1. if the table is initialized with yi0=0y^0_i=0yi0​=0, then C0=g(x0)−g(x∗)+4Ln∥x0−x∗∥2+σ216LC_0=g(x^0)-g(x^*)+\frac{4L}n\|x^0-x^*\|^2+\frac{\sigma^2}{16L}C0​=g(x0)−g(x∗)+n4L​∥x0−x∗∥2+16Lσ2​;
  2. if it is initialized with yi0=fi′(x0)−g′(x0)y^0_i=f'_i(x^0)-g'(x^0)yi0​=fi′​(x0)−g′(x0), then C0=32[g(x0)−g(x∗)]+4Ln∥x0−x∗∥2C_0=\frac32\big[g(x^0)-g(x^*)\big]+\frac{4L}n\|x^0-x^*\|^2C0​=23​[g(x0)−g(x∗)]+n4L​∥x0−x∗∥2.

Further, if ggg is μ\muμ-strongly convex for some μ>0\mu>0μ>0 (that is, x↦g(x)−μ2∥x∥2x\mapsto g(x)-\frac\mu2\|x\|^2x↦g(x)−2μ​∥x∥2 is convex), then for each of the two initializations, with its C0C_0C0​,

E[g(xk)]−g(x∗) ≤ (1−min⁡{μ16L,18n})kC0.\mathbb E\big[g(x^k)\big]-g(x^*)\ \le\ \Big(1-\min\Big\{\frac{\mu}{16L},\frac1{8n}\Big\}\Big)^kC_0 .E[g(xk)]−g(x∗) ≤ (1−min{16Lμ​,8n1​})kC0​.

This is the main result of the paper: SAG, which evaluates one component gradient per iteration, attains the O(1/k)O(1/k)O(1/k) rate of full gradient descent in the convex case and a linear rate in the strongly convex case, with constants that make it faster than both stochastic and deterministic gradient methods for large nnn.

Formalization Note Rp\mathbb R^pRp is EuclideanSpace ℝ (Fin p) and indices are Fin n. The expectation over the algorithm's randomness is SAGA.Convex.expectIdx n k, the uniform average over all nkn^knk index sequences; the data are deterministic. The four claims (two initializations, two rates) are stated as one conjunction; strong convexity is a hypothesis of the last two only. The theorem covers every n≥1n\ge1n≥1, including n=1n=1n=1, where SAG is gradient descent and the page's proof does not apply (it assumes n>1n>1n>1).

Preamble
import Mathlib
import Definitions.Def_SAGFiniteSum_Rate_Model

open scoped RealInnerProductSpace
Formal statement
namespace SAGFiniteSum.Rate

/-- Theorem 1 (Schmidt, Le Roux & Bach, arXiv:1309.2388v2, p. 7). SAG with the constant step
size `α = 1/(16L)`, for `k ≥ 1`, from `(y⁰, x⁰)` with `y⁰ = 0` or `y⁰ᵢ = f'ᵢ(x⁰) − g'(x⁰)`:
`E[g(x̄ᵏ)] − g(x*) ≤ (32n/k) C₀`, and if `g` is `μ`-strongly convex,
`E[g(xᵏ)] − g(x*) ≤ (1 − min{μ/(16L), 1/(8n)})ᵏ C₀`, with the `C₀` of each initialization. -/
theorem theorem_1 {p n : ℕ} (f : Fin n → EuclideanSpace ℝ (Fin p) → ℝ)
    (f' : Fin n → EuclideanSpace ℝ (Fin p) → EuclideanSpace ℝ (Fin p)) (L : ℝ)
    (xstar : EuclideanSpace ℝ (Fin p)) (hA : SAGAssumptions f f' L xstar)
    (x0 : EuclideanSpace ℝ (Fin p)) (k : ℕ) (hk : 1 ≤ k) :
    (SAGA.Convex.expectIdx n k
        (fun js => SAGA.Convex.fAvg f (avgIter f' (1 / (16 * L)) (zeroTable, x0) js))
        - SAGA.Convex.fAvg f xstar
      ≤ 32 * (n : ℝ) / (k : ℝ) * C0zero f f' L xstar x0)
    ∧ (SAGA.Convex.expectIdx n k
        (fun js => SAGA.Convex.fAvg f (avgIter f' (1 / (16 * L)) (centeredTable f' x0, x0) js))
        - SAGA.Convex.fAvg f xstar
      ≤ 32 * (n : ℝ) / (k : ℝ) * C0centered f L xstar x0)
    ∧ (∀ μ : ℝ, 0 < μ →
        ConvexOn ℝ Set.univ (fun x => SAGA.Convex.fAvg f x - μ / 2 * ‖x‖ ^ 2) →
        (SAGA.Convex.expectIdx n k
            (fun js => SAGA.Convex.fAvg f (sagIter f' (1 / (16 * L)) (zeroTable, x0) js k).2)
            - SAGA.Convex.fAvg f xstar
          ≤ (1 - min (μ / (16 * L)) (1 / (8 * (n : ℝ)))) ^ k * C0zero f f' L xstar x0)
        ∧ (SAGA.Convex.expectIdx n k
            (fun js => SAGA.Convex.fAvg f
              (sagIter f' (1 / (16 * L)) (centeredTable f' x0, x0) js k).2)
            - SAGA.Convex.fAvg f xstar
          ≤ (1 - min (μ / (16 * L)) (1 / (8 * (n : ℝ)))) ^ k * C0centered f L xstar x0)) := by sorry

end SAGFiniteSum.Rate
Source
Schmidt, Le Roux & Bach, arXiv:1309.2388v2, §3, Theorem 1, p. 7
Human review
  • Endorsed by Shuze Chen · Oct 9, 2026

    Confirmed by the moderator at approval.

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