Repository navigation
feat: AdaGrad on a box, its regret bound and coordinatewise scale-freeness - #417
Merged
lmlexplore-automation[bot] merged 1 commit intoNov 15, 2026
Conversation
…eness Add the online learners `OnlineLearner.adaGradIcc` (adaptive projected online subgradient descent on an interval) and `OnlineLearner.adaGrad` (their coordinatewise product on a box), with their run lemmas, scale-freeness, and the regret bound of [Ora, Theorem 4.32] for linear and convex losses. Add `Set.isMinOn_abs_sub_projIcc`: the projection onto a closed interval is a nearest point. Co-Authored-By: Claude Code <noreply@github.com>
Contributor
Author
AI review — approvedEach rubric is judged independently by multiple review agents; the PR merges only once every rubric is green — any rubric that is not green (changes requested, blocked, errored, stale, or not yet run) blocks the merge. See the rubrics.
♻️ = approved on an earlier commit, re-run before merge. Reviewing this diff at head |
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 15, 2026
83df5e7
17 of 20 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds OnlineLearning Layer 2.4, AdaGrad [Ora, Algorithm 4.1, Theorem 4.32, Definition 4.33], the last open item of the milestone "Layer 2: Online subgradient descent beyond √n". As the roadmap asks, AdaGrad is built as the coordinatewise product of learners (Layer 0.2,
OnlineLearner.pi), and its bound comes from item 3 in dimension one (onlineSubgradientDescent_regret_le_mul_sqrt_sum, #398). After this PR, every item of Layer 2 has been stated and proved, so nothing is left on this milestone. (The guessing-game completion check of Layer 2 is already covered byonlineSubgradientDescent_regret_sq_sub_le_one_add_log.)Roadmap: OnlineLearning
In
LMLExplore/OnlineLearning/AdaptiveRate.lean, next to the adaptive-rate results it uses (new sectionAdaGrad; the module docstring and title are updated):OnlineLearner.adaGradIcc l r h x₀ : OnlineLearner C ℝ ℝis AdaGrad in dimension one, that is, projected online subgradient descent on[l, r]with the rates(r - l) / √(2 ∑ s ≤ t, g s ^ 2)of [Ora, Theorem 4.14]. Its first play isprojIcc l r h x₀, so no membership hypothesis is needed. Its API:run_adaGradIcc_zero(simp),run_adaGradIcc_succ(the update),run_adaGradIcc_mem,run_adaGradIcc_const_mul(scale-free), andhasRegretBound_adaGradIcc, which bounds the regret for linear lossesx ↦ g t * xby(r - l) √(2 ∑ t < n, g t ^ 2). The history recursion is a private helperadaGradIccPlay; users only need the run lemmas.OnlineLearner.adaGrad l r h x₀ : OnlineLearner C (α → ℝ) (α → ℝ)ispiof theadaGradIcc (l a) (r a). Its API:run_adaGrad(reduction to coordinates),run_adaGrad_zero(simp),run_adaGrad_succ(the coordinatewise update of Algorithm 4.1),run_adaGrad_mem(plays in the box), andrun_adaGrad_mul, the roadmap's coordinatewise scale-freeness: multiplying each coordinate of every feedback by a positive constantk aleaves the plays unchanged.hasRegretBound_adaGradis Theorem 4.32 for linear lossesx ↦ ∑ a, g t a * x a: the bound is√2 ∑ a, (r a - l a) √(∑ t < n, g t a ^ 2)against everyuin the box. It is derived fromHasRegretBound.piandhasRegretBound_adaGradIcc.regret_run_adaGrad_leis Theorem 4.32 for convex losses: if∑ a, g t a • proj ais a subgradient off twithin the box at each play, the regret offhas the same bound. The feedback is arbitrary, so the bound also holds for closed-loop (adaptive) feedback.New file
LMLExplore/Algebra/Order/Interval/Set/ProjIcc.lean, general infrastructure that AdaGrad's projection step needs:Set.isMinOn_abs_sub_projIcc: in a linearly ordered additive group,projIcc a b h xminimizesy ↦ |y - x|overIcc a b. Mathlib has the 1-Lipschitz boundSet.abs_projIcc_sub_projIcc, but not the nearest-point property.No public declaration is removed or renamed.
Reuse: I grepped Mathlib, Tau Ceti, LML and Statlib at the pinned versions, and
LMLExplore/, forAdaGrad/adaGrad(no hits). I also grepped forprojIcctogether withabs/dist/IsMinOn. The only related lemma is Mathlib'sSet.abs_projIcc_sub_projIcc, which is a contraction bound, not the nearest-point property. The proofs reuse the mergedonlineSubgradientDescent_regret_le_mul_sqrt_sum,OnlineLearner.pi/HasRegretBound.pi/run_pi,sum_sub_le_sum_apply_sub_of_hasSubgradientWithinAt, LML'shasSubgradientWithinAt_linearand Tau Ceti'sReal.sqrt_sq_mul. Sources cited in the file: [Ora] and the original AdaGrad paper [DHS11] (Duchi, Hazan and Singer, JMLR 2011).Local checks only (CI verifies the pushed PR):
scope: scoped: against 7142c37d5e5dacc0509d1da87594fe25c9d6e0f5.local-axioms: checked 2 changed module(s), 56 declaration(s); 0 violation(s). The whole-librarylake build --iofail, the source guards, the module-system audit, the header check and the environment lint (2 changed modules, 56 declarations, 14 environment linters) all passed, and the verify script exited 0.🤖 Prepared with Claude Code