Repository navigation
feat: FTRL-Proximal, and follow-the-leader on strongly convex and quadratized losses - #370
Merged
lmlexplore-automation[bot] merged 2 commits intoNov 14, 2026
Conversation
…dratized losses Sum the proximal stability lemma [Ora, Lemma 7.7] through the FTRL equality, and derive from it the regret of FTRL-Proximal [Ora, Example 7.9], of follow-the-leader on strongly convex losses [Ora, Corollary 7.25] and on quadratized losses [Ora, Algorithm 7.5], the closed form (7.9) of the latter's plays, and the 1 + log n regret of follow-the-leader on the guessing game [Ora, Example 7.26]. Co-Authored-By: Claude Code <noreply@github.com>
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 |
…vex losses Prove regret_le_ftrl_proximal from regret_le_ftl_of_strongConvexOn applied to the losses σ t / 2 * ‖· - x t‖ ^ 2 + ℓ t, removing the duplicated padding of the plays. Fix the Stability module docstring's statement of the follow-the-leader bound and its references. Co-Authored-By: Claude Code <noreply@github.com>
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 14, 2026
278c9ec
23 of 25 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 finishes OnlineLearning Layer 5.2, The FTRL bound for convex losses, with its last bullet, FTRL-Proximal [Ora, Example 7.9]. It also completes Layer 5.3, Follow-the-leader on strongly convex losses [Ora, Corollary 7.25, Algorithm 7.5, Example 7.26], including the Layer 5 completion check (follow-the-leader on the guessing game has regret at most
1 + log n). Both rest on one new statement: the proximal stability lemma [Ora, Lemma 7.7], already onmain, summed through the FTRL equality. FTRL-Proximal and follow-the-leader (FTL) on quadratized losses are the same algorithm: FTRL with quadratic termsc / 2 * ‖a - x s‖ ^ 2centred at the past plays, run on linear losses. So the PR is one topic.Roadmap: OnlineLearning
In
OnlineLearning/FTRL/Stability.lean(normed space, subgradients withinVas in LML'sHasSubgradientWithinAt):regret_le_ftrl_of_isMinOn_sub_of_strongConvexOn[Ora, Lemmas 7.1 and 7.7]. If each play also minimizesψ (t + 1) - ψ tandF (t + 1)islam t-strongly convex, thenregret ≤ ψ n u - ψ 0 (x 0) + ∑ ‖g t‖² / (2 lam t) + ∑ (ψ t (x t) - ψ (t + 1) (x t)). This is the proximal counterpart ofregret_le_ftrl_of_strongConvexOn, with the same hypothesis shapes. It is built fromftrl_stability_le_norm_sq_div_of_isMinOn_sub_of_strongConvexOn.regret_le_ftl_of_strongConvexOn(5.3, first bullet). Takeμ t-strongly convex losses whose partial sums∑ s ≤ t, μ sare positive, and letx 0be any point ofV. Thenregret ≤ ∑ ‖g t‖² / (2 ∑ s ≤ t, μ s). Individual moduli may be negative. Plays are needed only fort < n, and the comparator is anyu ∈ V.New file
OnlineLearning/FTRL/Quadratic.lean(inner product space):regret_le_ftrl_proximal(5.2, last bullet). Take convex losses and weightsσ t ≥ 0with positive partial sums, and plays minimizing∑ s < t, (σ s / 2 * ‖a - x s‖² + ℓ s a). Thenregret ≤ ∑ σ t / 2 * ‖u - x t‖² + ∑ ‖g t‖² / (2 ∑ s ≤ t, σ s).regret_le_ftl_quadratized(5.3, second bullet, first half). Assume the losses lie aboveℓ t (x t) + g t (· - x t) + μ t / 2 * ‖· - x t‖²at the plays. Then FTL ong t a + μ t / 2 * ‖a - x t‖²has the same bound.isMinOn_sum_inner_add_div_two_mul_norm_sub_sq_iff(5.3, second bullet, second half: "its plays are projections of a closed form", [Ora, (7.9)]). It completes the square. The minimizers over any set of∑ i, (⟪v i, ·⟫ + μ i / 2 * ‖· - x i‖²)with∑ μ i > 0are the nearest points to(∑ μ i)⁻¹ • ∑ (μ i • x i - v i). This is the same projection convention asisMirrorDescentStep_norm_sq_div_two_iff.regret_sq_sub_le_one_add_log(Layer 5 completion check). FTL on(a - y t)²on[0, 1]has regret at most1 + log n, against the4 + 4 log nof [Ora, Theorem 1.3]. It usesReal.sum_range_inv_add_one_le.Small supporting API, each consumed here:
StrongConvexOn.fun_sum(Analysis/Convex/Strong.lean): finite sums ofm i-strongly convex functions are(∑ m i)-strongly convex. It is used by both FTL and FTRL-Proximal. Mathlib, Tau Ceti, LML and Statlib have only the binaryUniformConvexOn.add.strongConvexOn_div_two_mul_norm_sub_sq(Analysis/Convex/Bregman/Euclidean.lean):m / 2 * ‖b - c‖²ism-strongly convex for every realm. The existingstrongConvexOn_norm_sq_div_twois now derived from it, with an unchanged statement.regret_congr(OnlineLearning/Regret.lean): the regret afternrounds depends only on the firstnplays. It is the play-side sibling ofdynRegret_congr.No public declaration is removed or renamed.
What remains: Layer 5 now needs only 5.4 (composite losses and the proximal operator). The roadmap's Layer 7.4 variance bound consumes
regret_le_ftl_of_strongConvexOn(FTL on‖x - g t‖²).Local checks only (CI verifies the pushed PR):
scope: scoped: against 04108426374e73cba755bc601e1792d03176b28a.local-axioms: checked 5 changed module(s), 127 declaration(s); 0 violation(s). The whole-librarylake build --iofail, the source guards, the module-system audit, the header and style checks (rerun after replacing a combining tilde in a docstring), the environment lint (checked 5 changed module(s), 127 declarations) and the shim-expiry check all passed.🤖 Prepared with Claude Code