Repository navigation
feat: the FTRL equality on arbitrary types, be-the-leader and the regret of follow-the-leader - #284
Merged
lmlexplore-automation[bot] merged 3 commits intoNov 12, 2026
Conversation
…ret of follow-the-leader Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 12, 2026
RemyDegenne
commented
Nov 12, 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 |
…Remark 7.3 Move the structure-free FTRL equality, be-the-leader and follow-the-leader results to `LMLExplore/OnlineLearning/FTRL/Equality.lean`, importing only `Regret`, and move `FTRL.lean` to `FTRL/Basic.lean`. Replace `isMinOn_add_const_add_sum_iff` by the general `isMinFilter_add_const_iff` and `isMinOn_add_const_iff` in `LMLExplore/Order/Filter/Extr.lean`. Co-Authored-By: Claude Code <noreply@github.com>
RemyDegenne
commented
Nov 12, 2026
Co-Authored-By: Claude Code <noreply@github.com>
Merged
via the queue into
LeanMachineLearning:main
with commit Nov 12, 2026
feff431
21 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 proves the FTRL equality [Ora, Lemma 7.1] for arbitrary losses, regularizers and points on an arbitrary type, together with the consequences that OnlineLearning Layer 0.3 asks for, and re-derives LMLExplore's
sum_apply_sub_le_ftrlfrom it.Roadmap: OnlineLearning
Milestone: OnlineLearning Layer 0, item 3 ("The FTRL equality" [Ora, Lemma 7.1, Remarks 7.3–7.4, Lemma 1.2]). The structure-free results are in the new module
LMLExplore/OnlineLearning/FTRL/Equality.lean(namespaceLMLExplore.OnlineLearning), which imports onlyOnlineLearning.RegretandOrder.Filter.Extr. They are stated on theregretofOnlineLearning/Regret.lean(Layer 0.1, #281):regret_eq_ftrl ψ ℓ x z u n: withF t = ψ t + ∑ s < t, ℓ s, the regret ofzagainstuequalsψ n u - ψ 0 (x 0) + ∑ t < n, (F t (x t) - F (t+1) (x (t+1)) + ℓ t (z t)) + (F n (x n) - F n u). Takingz = xgives Lemma 7.1. Taking any otherzgives Remark 7.4, where the losses of other points stand on both sides.regret_le_ftrl: the inequality form, which holds whenF n (x n) ≤ F n u.isMinOn_add_const_iff(with its filter formisMinFilter_add_const_iff), in the newLMLExplore/Order/Filter/Extr.lean, for any[Add β] [Preorder β] [AddRightMono β] [AddRightReflectLE β]. The Equality module doc explains how it applies to FTRL.sum_le_of_isMinOn_sum: the be-the-leader lemma [Ora, Lemma 1.2, Remark 15.32], on a setV, deduced fromregret_le_ftrlwith no regularizer.regret_le_sum_sub_of_isMinOn_sum: the roadmap's completion check. The regret of follow-the-leader is at most∑ t < n, (ℓ t (x t) - ℓ t (x (t+1)))[Ora, proof of Theorem 1.3].sum_apply_sub_le_ftrlkeeps its statement, but is now proved as the linear-loss case ofregret_le_ftrl, as the roadmap's "derive it from this item" asks. No declaration is removed or renamed.Module moved (no forwarding module):
LMLExplore.OnlineLearning.FTRL→LMLExplore.OnlineLearning.FTRL.Basic, which importsFTRL.Equality. All declarations in it keep their names.MirrorDescent,SimplexandUnitBallPotentialnow importFTRL.Basic, and the docstrings that cited the module are updated.After this PR, Layer 0 lacks only item 2, the online learners. Layer 5's derivative-free stability lemma (
ftrl_stability_le) will sum its one-round bounds throughregret_eq_ftrl.The citations were checked against the text of [Ora] arXiv v10 (Lemma 1.2, Lemma 7.1, Remarks 7.3, 7.4 and 15.32). No Mathlib material is vendored. LML and Tau Ceti were searched for an existing FTRL equality or be-the-leader lemma, and neither has one.
🤖 Prepared with Claude Code