Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Lemma 4 — Σₜ⟨gₜ, diag(sₜ)⁻¹gₜ⟩ ≤ 2 Σᵢ‖g_{1:T,i}‖₂

Proved
AdaGrad.Diag.lemma_4

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

adaptive-methodsonline-learningp2o-batch-pfp2bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let g1,g2,⋯∈Rdg_1,g_2,\dots\in\mathbb R^dg1​,g2​,⋯∈Rd be any sequence of (sub)gradients, and let st,i=∥g1:t,i∥2=(∑τ=1tgτ,i2)1/2s_{t,i}=\|g_{1:t,i}\|_2=\big(\sum_{\tau=1}^tg_{\tau,i}^2\big)^{1/2}st,i​=∥g1:t,i​∥2​=(∑τ=1t​gτ,i2​)1/2 as in Algorithm 1. Then for every TTT,

∑t=1T⟨gt,diag(st)−1gt⟩≤2∑i=1d∥g1:T,i∥2.\sum_{t=1}^T\big\langle g_t,\mathrm{diag}(s_t)^{-1}g_t\big\rangle\le2\sum_{i=1}^d\|g_{1:T,i}\|_2 .t=1∑T​⟨gt​,diag(st​)−1gt​⟩≤2i=1∑d​∥g1:T,i​∥2​.

Here ⟨gt,diag(st)−1gt⟩=∑igt,i2/st,i\langle g_t,\mathrm{diag}(s_t)^{-1}g_t\rangle=\sum_i g_{t,i}^2/s_{t,i}⟨gt​,diag(st​)−1gt​⟩=∑i​gt,i2​/st,i​, and diag(st)−1\mathrm{diag}(s_t)^{-1}diag(st​)−1 is the pseudo-inverse: if st,i=0s_{t,i}=0st,i​=0 then gt,i=0g_{t,i}=0gt,i​=0 and the term is 000.

The lemma is the source of the per-coordinate quantity ∑i∥g1:T,i∥2\sum_i\|g_{1:T,i}\|_2∑i​∥g1:T,i​∥2​ in AdaGrad's regret bound.

Formalization Note The pseudo-inverse is Lean's division with 0/0=00/0=00/0=0. The lemma is stated for an arbitrary sequence ggg: it does not depend on how the subgradients were generated.

Preamble
import Mathlib
import Definitions.Def_AdaGrad_Diag_Setup
Formal statement
namespace AdaGrad.Diag

/-- Duchi, Hazan, Singer, JMLR 12 (2011), Lemma 4, p. 2131: for any sequence of (sub)gradients
`g_1, g_2, … ∈ ℝ^d` and `s_{t,i} = ‖g_{1:t,i}‖₂`,
`∑_{t=1}^T ⟨g_t, diag(s_t)⁻¹ g_t⟩ ≤ 2 ∑_{i=1}^d ‖g_{1:T,i}‖₂`.
`⟨g_t, diag(s_t)⁻¹ g_t⟩ = ∑_i g_{t,i}² / s_{t,i}` is `dualNormSq (s g t) (g t)`; `diag(s_t)⁻¹` is the
pseudo-inverse, i.e. `0/0 = 0` (if `s_{t,i} = 0` then `g_{t,i} = 0`). -/
theorem lemma_4 {d : ℕ} (g : ℕ → EuclideanSpace ℝ (Fin d)) (T : ℕ) :
    ∑ t ∈ Finset.Icc 1 T, dualNormSq (s g t) (g t) ≤ 2 * ∑ i, s g T i := by sorry

end AdaGrad.Diag
Source
Duchi, Hazan, Singer, Adaptive Subgradient Methods for Online Learning and Stochastic Optimization, JMLR 12 (2011), p. 2131, Lemma 4 (proof p. 2149, Appendix C)
Human review
  • Endorsed by Shuze Chen · Oct 6, 2026

    Confirmed by the moderator at approval.

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