Repository navigation
feat: online subgradient descent on unbounded sets and on strongly convex losses - #381
Merged
lmlexplore-automation[bot] merged 3 commits intoNov 14, 2026
Conversation
…nvex losses Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
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 |
…red-loss facts Add inner_sub_sub_norm_sq_div_le, the stability term of one projected subgradient step, and use it in inner_sub_le_of_isMinOn_norm_sub and onlineSubgradientDescent_regret_le_of_antitone. Factor strongConvexOn_sq_sub and hasSubgradientWithinAt_sq_sub in FTRL/Quadratic.lean and use them in both guessing-game theorems. Use mem_of_isMirrorDescentStep for the plays' membership in the strongly convex bound. Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
strongConvexOn_sq_sub and hasSubgradientWithinAt_sq_sub move from FTRL/Quadratic.lean to Analysis/Convex/Bregman/Euclidean.lean, so that SubgradientDescent.lean no longer imports follow-the-leader material. Co-Authored-By: Claude Code <noreply@github.com>
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
2023697
20 of 21 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 completes OnlineLearning Layer 2.1 (constant rates on unbounded sets [Ora, Theorem 2.13, Lemmas 2.12 and 2.31]) and Layer 2.2 (strongly convex losses [Ora, Theorem 4.7, Corollary 4.8, Example 4.11]) of the milestone "Layer 2: Online subgradient descent beyond √n". It also passes the guessing-game completion check that the roadmap sets for item 2.
Roadmap: OnlineLearning
In
OnlineLearning/SubgradientDescent.lean(real inner product space, subgradients withinKas LML'sHasSubgradientWithinAt, plays given by nearest-point hypotheses like the existingonlineSubgradientDescent_regret_le, new bounds stated with Layer 0.1'sregret):inner_sub_le_of_isMinOn_norm_subis Lemma 2.12/2.31, one projected step:⟪g, a - u⟫ ≤ (‖u - a‖² - ‖u - x‖²)/(2η) + η/2 ‖g‖²forxa nearest point ofKtoa - η • g. It is proved from the mirror-descent one-step inequalityIsMirrorDescentStep.apply_sub_lewith the potential‖·‖²/2, together withapply_sub_sub_div_le_of_mul_norm_sq_le.onlineSubgradientDescent_regret_le_norm_sub_sq_divis Theorem 2.13 with a constant rate:(‖u - a 0‖² - ‖u - a n‖²)/(2η) + η/2 ∑ ‖g t‖². It needs no diameter and noa 0 ∈ K.onlineSubgradientDescent_regret_le_of_antitoneis Theorem 2.13 with nonincreasing rates. It keeps-‖u - a n‖²/(2η (n-1))and assumes only‖u - a t‖ ≤ Dfort < n, not a diameter. It takes0 < n, without which it would claim‖u - a 0‖ ≤ D.onlineSubgradientDescent_regret_le_sum_norm_sq_divis Theorem 4.7, under strong convexity at the plays (f t (a t) + ⟪g t, v - a t⟫ + μ t/2 ‖v - a t‖² ≤ f t vonK) with rates(∑ s ≤ t, μ s)⁻¹. The bound is∑ ‖g t‖²/(2 ∑ s ≤ t, μ s). Only the partial sums must be positive; the individualμ tmay be negative. The proof telescopes the potential(∑ s < t, μ s)/2 ‖u - a t‖².onlineSubgradientDescent_regret_le_of_strongConvexOnis the same bound forμ t-strongly convex losses with subgradients at the plays, throughStrongConvexOn.add_add_le_of_hasSubgradientWithinAt(Layer 1.1).onlineSubgradientDescent_regret_le_mul_one_add_logis Corollary 4.8:L²/(2μ) (1 + log n)forμ-strongly convex losses with‖g t‖ ≤ Lat the plays, fromReal.sum_range_inv_add_one_le.onlineSubgradientDescent_regret_sq_sub_le_one_add_logis Example 4.11 and the Layer 2 completion check. Corollary 4.8 withμ = 2,L = 2gives regret at most1 + log non the guessing game(a - y t)²on[0, 1], for the explicit playsx (t+1) = x t - (x t - y t)/(t+1). These are OSD steps that never leave[0, 1]. The follow-the-leader versionregret_sq_sub_le_one_add_log(Layer 5.3) instead takes its plays as minimizers. This one comes from the OSD bound, as the roadmap's check asks.In
OnlineLearning/MirrorDescent.lean:sum_apply_sub_le_mirrorDescent_of_antitone: the nonincreasing-rate bound(D - D_F(u, a n))/η (n-1) + ∑ stability terms, keeping the last divergence. It needs neither convexity ofFnora 0 ∈ K. The summation-by-parts estimate thatmirrorDescent_regret_le_of_antitonedid inline now lives here, and that theorem is re-derived from it with the same statement.onlineSubgradientDescent_regret_le(diameter form) is likewise re-proved from the newonlineSubgradientDescent_regret_le_of_antitone, with its statement unchanged.No public declaration is removed or renamed.
Reuse: I found no projected-step inequality, OSD bound for strongly convex losses, or logarithmic-regret statement in Mathlib, Tau Ceti, LML or Statlib. I grepped for
onlineSubgradientDescent, nearest-pointIsMinOn (fun b ↦ ‖b - …‖)hypotheses andinner_sub_le_of_isMinOn. Mathlib'snorm_eq_iInf_iff_real_inner_le_zerocharacterizes projections through⨅, not nearest-point minimizers, so the one-step lemma goes through the existing mirror-descent API instead. The proofs reuseisMirrorDescentStep_norm_sq_div_two_iff,bregDiv_norm_sq_div_two,hasFDerivAt_norm_sq_div_two,sum_apply_sub_le_mirrorDescent,sum_sub_le_sum_apply_sub_of_hasSubgradientWithinAt,strongConvexOn_div_two_mul_norm_sub_sqandReal.sum_range_inv_add_one_le. Credit for logarithmic regret goes to [HAK07] in the module docstring, alongside [Ora].What remains on this milestone after this PR: Layer 2.3 (adaptive rates and
L*bounds, which also need the Layer 1.7 numerical lemmas in flight in #379 and Layer 1.3's self-bounded functions) and Layer 2.4 (AdaGrad).Local checks only (CI verifies the pushed PR):
scope: scoped: against 7fc78707241a5393aa85a7751e472cf1cb45fca9.local-axioms: checked 2 changed module(s), 80 declaration(s); 0 violation(s). The whole-librarylake build --iofail, source guards, module-system audit, header check and environment lint (checked 2 changed module(s), 80 declarations; 14 environment linters) passed, and the verify script exited 0.🤖 Prepared with Claude Code