Repository navigation
feat: optimistic FTRL, and the stability of minimizers under linear perturbations - #375
Merged
lmlexplore-automation[bot] merged 3 commits intoNov 14, 2026
Conversation
…erturbations Add `OnlineLearning/FTRL/Optimistic.lean`: the regret of optimistic FTRL [Ora, Algorithm 7.8, Theorem 7.47, both inequalities] with the last hint set to zero, and the improved bound for linear losses and hints [Ora, Theorem 7.48], with given auxiliary plays and, in finite dimension, for all auxiliary hints. Add `StrongConvexOn.mul_norm_sub_le_norm_sub_of_isMinOn_add` [Ora, Lemma 7.49] to `Analysis/Convex/Strong.lean`. Co-Authored-By: Claude Code <noreply@github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
RemyDegenne
commented
Nov 14, 2026
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 |
…r linear-perturbation helpers Prove `optimistic_ftrl_stability_le_of_strongConvexOn` as the case of `ftrl_stability_le_of_strongConvexOn` with regularizers `ψ s + p` and round-`t` loss `ℓ t - p`, and correct its docstring. Add `StrongConvexOn.add_continuousLinearMap` and `ContinuousLinearMap.apply_le_opNorm_mul_norm`, used at every inline site. State the `q = p` case of Theorem 7.48 as a weakening of Theorem 7.47. Co-Authored-By: Claude Code <noreply@github.com>
Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 14, 2026
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
c156ad1
29 of 31 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 7.2, Optimistic FTRL [Ora, Algorithm 7.8, Theorems 7.47 and 7.48, Lemma 7.49]. It covers the regret of FTRL with hint losses, the stability of minimizers of a strongly convex function under linear perturbations, and the improved bound for linear losses that this stability gives. The prerequisites are Layer 0.3 (
regret_le_ftrl) and Layer 5.1 (the strong-convexity stability argument), both onmain.Roadmap: OnlineLearning
New file
OnlineLearning/FTRL/Optimistic.lean(normed spaceE, subgradients withinVas in LML'sHasSubgradientWithinAt, plays taken asIsMinOnhypotheses as in the other FTRL theorems):optimistic_ftrl_stability_le_of_strongConvexOnhandles one round. Supposex tminimizesF t + poverV, whereF t = ψ t + ∑ s < t, ℓ sandpis the hint, andgis a subgradient of the prediction errorℓ t - p. Thengis a subgradient ofF t + ℓ t, and strong convexity ofF t + ℓ tbounds the stability term byg (x t - z) - lam/2 ‖x t - z‖² + ψ t z - ψ (t+1) z. The hintp = 0gives backftrl_stability_le_of_strongConvexOn.regret_le_optimistic_ftrl_of_strongConvexOnis Theorem 7.47's first inequality, in the roadmap's exact form:ψ (n - 1) u - ψ 0 (x 0) + ∑ t < n, (g t (x t - x (t+1)) - lam t/2 ‖x t - x (t+1)‖²) + ∑ t < n - 1, (ψ t (x (t+1)) - ψ (t+1) (x (t+1))). Herex nonly has to do at least as well asuonψ (n - 1) + ∑ s < n, ℓ s, which is the hint-free last objective (ℓ̃_n = 0). The proof appliesregret_le_ftrlto the regularizersψ (min t (n - 1)), which repeat the last one, and does not telescope the hints. That is why the book's misplaced last hint plays no role. Neither the losses nor the hints need to be convex.regret_le_optimistic_ftrl_norm_sq_div_of_strongConvexOnis the second inequality, with‖g t‖² / (2 lam t). It needs no last point: the first inequality is applied withFunction.update x n u. It assumes0 < n, because atn = 0it would claimψ 0 (x 0) ≤ ψ 0 u.sum_apply_sub_le_optimistic_ftrlis Theorem 7.48, for linear lossesg tand hintsp t, regularizers that arelam t-strongly convex and nondecreasing onV,c ≤ ψ 0onV, and auxiliary hintsq twith given auxiliary plays. The bound is∑ g t (x t - u) ≤ ψ (n - 1) u - c + ∑ (‖g t - q t‖²/(2 lam t) + ‖g t‖ ‖p t - q t‖ / lam t). The book'smin_V ψ_1becomes any lower boundc.sum_apply_sub_le_optimistic_ftrl_of_isClosedgives the same bound for allq, in finite dimension, on a closedV, with lower semicontinuousψ t. The auxiliary plays come fromStrongConvexOn.exists_isMinOn_add_continuousLinearMap(Layer 1.1). Withq = gthis is the bound that the delayed-feedback reduction (7.3) uses.In
Analysis/Convex/Strong.lean:StrongConvexOn.mul_norm_sub_le_norm_sub_of_isMinOn_addis Lemma 7.49: minimizersx, yoff + θ₁andf + θ₂, for anm-strongly convexf, satisfym * ‖x - y‖ ≤ ‖θ₁ - θ₂‖. It is stated in multiplied form so that it needs no sign condition onm. It is proved fromadd_mul_norm_sub_sq_le_of_isMinOn.Reuse: no stability-under-perturbation lemma for minimizers of strongly convex functions exists in Mathlib, Tau Ceti, LML or Statlib. I searched every
StrongConvexOnfile that also mentionsIsMinOn, and Tau Ceti'sAnalysis/Convex/Strong.lean. No optimistic FTRL exists in LMLExplore (grep -i optimistic). The proofs reuseregret_le_ftrl,regret_congr,HasSubgradientWithinAt.fun_add_isMinOn,StrongConvexOn.add_add_le_of_hasSubgradientWithinAt,apply_sub_sub_mul_norm_sq_le,hasSubgradientWithinAt_linearandexists_isMinOn_add_continuousLinearMap. The closed form of the plays in Example 7.50 (a projection of-(g̃_t + ∑ g_s)/c) is already the case of a single quadratic inisMinOn_sum_inner_add_div_two_mul_norm_sub_sq_iff, so it is not restated.Supporting helpers, and the migration of existing code to them (in scope as part of this PR, because the reuse review asked that every inline copy go through the new helper, rather than restating it):
Analysis/Normed/Operator/Basic.leanwithContinuousLinearMap.apply_le_opNorm_mul_norm,f x ≤ ‖f‖ * ‖x‖forf : E →L[ℝ] ℝ. Lemma 7.49 and the Theorem 7.48 proofs use it. The four existing inline copies of this bound ((le_abs_self _).trans (f.le_opNorm _)or(Real.le_norm_self _).trans (f.le_opNorm _)) now use it as well, as one-line proof rewrites with an added import and no change to any statement:Analysis/Convex/Coercive.lean, infenchelConjugate_le_of_norm_sub_le;Analysis/Convex/Conjugate.lean, in the privateexists_pos_apply_sub_sub_bregDiv_le;Analysis/Convex/Strong.lean, inapply_sub_sub_div_le_of_mul_norm_sq_le;Bandits/UnitBallFTRL.lean, in the privateintegral_sum_apply_smul_sub_le.StrongConvexOn.add_continuousLinearMap(inAnalysis/Convex/Strong.lean): adding a continuous linear map keepsm-strong convexity. Lemma 7.49 uses it, and the proof of the existingStrongConvexOn.exists_isMinOn_add_continuousLinearMapnow uses it instead of the inlineadd_convexOn (by simpa using L.toLinearMap.convexOn hf.1).No public declaration is removed or renamed.
What remains: Layer 7.2 is complete. The remaining items of Layer 7 are 7.3 (delayed feedback, which uses
sum_apply_sub_le_optimistic_ftrl_of_isClosedwithq = g), 7.4 (variance and gradual-variation bounds, from the second inequality of Theorem 7.47) and 7.1 (optimistic mirror descent).Local checks only (CI verifies the pushed PR):
scope: scoped: against 3af64fae786dd9a2aa021aa47b8e4305858822ed.local-axioms: checked 2 changed module(s), 35 declaration(s); 0 violation(s). The whole-librarylake build --iofail, the source guards, the module-system audit, the header check and the environment lint (checked 2 changed module(s), 35 declarations; 14 environment linters) passed, and the verify script exited 0.🤖 Prepared with Claude Code