Repository navigation
feat: adaptive learning rates, self-bounded functions and L⋆ bounds - #398
Conversation
Mirror descent with the adaptive learning rates sqrt(m B / sum_{s<=t} ||y_s||^2)
has regret at most 2 sqrt(B sum ||y_t||^2 / m); projected online subgradient
descent with D / sqrt(2 sum ||g_s||^2) has regret at most D sqrt(2 sum ||g_t||^2)
[Ora, Theorem 4.14]; and for losses with ||g_t||^2 <= 2 s f_t(a_t), in particular
nonnegative s-self-bounded losses, the L⋆ bound 4 s D^2 + 2 D sqrt(s sum f_t u)
[Ora, Theorem 4.30]. Adds self-bounded functions (SelfBoundedOn), the gradient
bound for smooth functions bounded below, and their self-boundedness.
Co-Authored-By: Claude Code <noreply@github.com>
There was a problem hiding this comment.
🟡 reuse — request_changes claude/claude-opus-5-5
The new isMirrorDescentStep_zero_iff re-proves from scratch a special case of the existing isMirrorDescentStep_iff_isMinOn_bregDiv; the rest of the PR (self-bounded functions, the smooth-gradient bound, the adaptive-rate and L⋆ bounds) is new and reuses the merged mirror-descent, subgradient-descent and Layer 1.7 API.
LMLExplore/OnlineLearning/MirrorDescent.lean:119—isMirrorDescentStep_zero_iffrestatesisMirrorDescentStep_iff_isMinOn_bregDivwith loss0and base pointa(G = F' - η • 0 = F'), and proves it again by hand withsimpa. Fix: Keep the@[simp]statement but prove it asisMirrorDescentStep_iff_isMinOn_bregDiv (by simp) a a x. Alternatively, delete it and use that lemma at its one call site inAdaptiveRate.lean(theha'step).
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 46s · 304.6k in (285.8k cache read, 18.8k cache write) / 3.7k out tokens · reviewing this diff · rubric ·
There was a problem hiding this comment.
🟡 proof-quality — request_changes claude/claude-opus-5-5
Proofs are well structured and commented, but one rewrite chain for √(c² · X) = c · √X is repeated three times instead of being factored into a lemma, and one step relies on the iInf/sInf definitional equality where Mathlib's sInf_range is available.
LMLExplore/OnlineLearning/AdaptiveRate.lean:233— The same brittle chainshow … = c ^ 2 * X by ring, Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq _that rewrites √(c² · X) as c · √X is repeated at lines 233, 266 and 272. The same pattern already appears elsewhere in the repo. Fix: Add a small lemma such asReal.sqrt_sq_mul (hc : 0 ≤ c) : √(c ^ 2 * x) = c * √x(next to the other Layer 1.7 lemmas inLMLExplore/Analysis/Real/Sqrt.lean) and use it at all three sites.LMLExplore/Analysis/Convex/Smooth.lean:289—exact hf.norm_fderiv_sq_le hbdd xcloses a goal stated withsInf (range f)using a lemma stated with⨅ y, f y, so it relies on the definitional unfolding ofiInf. A comment notes this, but an explicit lemma is available. Fix: Rewrite withsInf_range(add it afterimage_univin therw) and drop the comment.
Reply in this thread to contest a finding; that re-runs only this rubric and posts an answer here. (To fix it, just push a commit — that re-reviews on its own. To contest again after an answer, post a NEW reply rather than editing an old one.)
claude/claude-opus-5-5 · 38s · 125.2k in (117.3k cache read, 7.9k cache write) / 3.6k out tokens · reviewing this diff · rubric ·
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 |
Prove `isMirrorDescentStep_zero_iff` as an instance of `isMirrorDescentStep_iff_isMinOn_bregDiv` (moved after the `TwoStep` section), and move the closing identity `B √A / r + r √A / m = 2 √(B A / m)` of `mirrorDescent_regret_le_two_mul_sqrt_of_ne_zero` into a private lemma. Co-Authored-By: Claude Code <noreply@github.com>
Rewrite `√(c ^ 2 * X)` with Tau Ceti's `Real.sqrt_sq_mul` instead of the repeated `sqrt_mul`/`sqrt_sq` chain, and close `SmoothOn.selfBoundedOn_univ` through `sInf_range` rather than the definitional unfolding of `iInf`. Co-Authored-By: Claude Code <noreply@github.com>
400fc0c
This PR adds OnlineLearning Layer 2.3, adaptive rates and
L⋆bounds [Ora, Theorems 4.14 and 4.30], to the milestone "Layer 2: Online subgradient descent beyond √n". It also adds the self-bounded part of Layer 1.3 (smoothness and self-bounded functions [Ora, Definition 4.26, Remark 4.27]), which theL⋆bound of Layer 2.3 consumes throughonlineSubgradientDescent_regret_le_of_selfBoundedOn. After this PR, the milestone still needs Layer 2.4 (AdaGrad). Layer 1.3 still needs its last bullet, "a self-bounded function on a convex set is convex".Roadmap: OnlineLearning
New file
LMLExplore/OnlineLearning/AdaptiveRate.lean:mirrorDescent_regret_le_two_mul_sqrtis the first bullet of 2.3. Take mirror descent with anm-strongly convex potential,D_F(u, a t) ≤ B, and the ratesη t = √(m B / ∑ s ≤ t, ‖y s‖²). Then∑ t < n, y t (a t - u) ≤ 2 √(B ∑ ‖y t‖² / m). The roadmap says "no step while the sum is 0". Lean's division makes that rate0, and a mirror-descent step for the rate0is a Bregman projection of the current play, so the algorithm stays put. No separate case is needed in the hypotheses. The proof freezes the rates at the first roundt₀with a nonzero loss; beforet₀the steps are unchanged because the loss is0. It then applies the existingmirrorDescent_regret_le_of_strongConvexOn_of_antitoneand Layer 1.7'sReal.sum_div_sqrt_le_two_mul_sqrt. The degenerate casesn = 0, all losses zero andB = 0are handled. No sign hypothesis onBis needed.onlineSubgradientDescent_regret_le_mul_sqrt_sumis Theorem 4.14: projected OSD withη t = D / √(2 ∑ s ≤ t, ‖g s‖²)has regret at mostD √(2 ∑ ‖g t‖²). As in the existingonlineSubgradientDescent_regret_le_of_antitone, it only assumes‖u - a t‖ ≤ Dat the plays, which is weaker than a diameter bound.onlineSubgradientDescent_regret_le_of_norm_sq_leis theL⋆bound4 s D² + 2 D √(s ∑ t < n, f t u), for subgradients with‖g t‖² ≤ 2 s f t (a t)at the plays. It solves the implicit inequality with Layer 1.7'sReal.le_add_add_sqrt_of_sub_sqrt_le.onlineSubgradientDescent_regret_le_of_selfBoundedOnis the roadmap's statement for nonnegatives-self-bounded losses, as a corollary. Convexity is used only through the subgradients at the plays.mirrorDescent_regret_le_two_mul_sqrt_of_ne_zero, holds the positive-rate case so that no proof exceeds 50 lines.In
LMLExplore/Analysis/Convex/Smooth.lean, next to the existingSmoothOnand the descent lemma:SelfBoundedOn V s fis the roadmap's definition: bounded below onV, and‖g‖² ≤ 2 s (f x - sInf (f '' V))for every subgradientgwithinVatx ∈ V, using LML'sHasSubgradientWithinAt.s : ℝ≥0matchesSmoothOn.SmoothOn.norm_fderiv_sq_le: iffiss-smooth onEand bounded below, then‖fderiv ℝ f x‖² ≤ 2 s (f x - ⨅ y, f y). The proof applies the descent lemma along each direction and then Mathlib'sdiscrim_le_zero. It works in any normed space, with no attainment of the dual norm.SmoothOn.selfBoundedOn_univ: a smooth function bounded below is self-bounded. The roadmap states this for convex functions, but uniqueness of the subgradient at a differentiable point (LML'sHasFDerivAt.eq_of_hasSubgradientWithinAt) makes convexity unnecessary. Bounded below is required, since it is part of the definition.SelfBoundedOn.weakenandSelfBoundedOn.norm_sq_le_of_nonneg(‖g‖² ≤ 2 s f xfor nonnegativef).In
LMLExplore/OnlineLearning/MirrorDescent.lean: new@[simp] isMirrorDescentStep_zero_iff. A step for the zero loss is a Bregman projection of the current play, whatever the learning rate.No public declaration is removed or renamed.
Reuse: I grepped Mathlib, Tau Ceti, LML and Statlib at the pinned versions for
SelfBounded/self-bounded, for gradient bounds of the form‖fderiv ℝ f x‖ ^ 2 ≤ 2 * s * (f x - …), and for adaptive learning rates. The only near hits are unrelated Tau Ceti PDE estimates (norm_fderiv_sq_le_of_norm_fderiv_le). The new proofs reuse the merged mirror-descent and OSD API (mirrorDescent_regret_le_of_strongConvexOn_of_antitone,isMirrorDescentStep_norm_sq_div_two_iff,bregDiv_norm_sq_div_two,sum_sub_le_sum_apply_sub_of_hasSubgradientWithinAt) and the Layer 1.7 numerical lemmas from #379.Local checks only (CI verifies the pushed PR):
scope: scoped: against f65097d5db6300d6bcd15c72a6d907cffb02bb04.local-axioms: checked 3 changed module(s), 82 declaration(s); 0 violation(s). The whole-librarylake build --iofail, the source guards, the module-system audit, the header check and the environment lint (3 changed modules, 82 declarations, 14 environment linters) all passed, and the verify script exited 0.🤖 Prepared with Claude Code