Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 5 (corrected constant) — Follow the Leader on costs gt(vt⊤x)g_t(v_t^\top x)gt​(vt⊤​x) has logarithmic regret

Proved
LogRegretOCO.FTAL.ftl_regret_bound

by mikedeng1 · Sep 26, 2026 · Mathlib 0df444a (Lean v4.33.1)

online-convex-optimizationonline-learningp2o-batch-p100ap2o-gran-per-chapterp2o-plan-paperp2o-v1regret

Let P⊆RnP \subseteq \mathbb{R}^nP⊆Rn be nonempty, convex, closed and bounded, with ∥y−z∥≤D\|y - z\| \le D∥y−z∥≤D for all y,z∈Py, z \in Py,z∈P. For each round t≥1t \ge 1t≥1 let the cost be ft(x)=gt(vt⊤x)f_t(x) = g_t(v_t^\top x)ft​(x)=gt​(vt⊤​x), where vt∈Rnv_t \in \mathbb{R}^nvt​∈Rn and gt:R→Rg_t : \mathbb{R} \to \mathbb{R}gt​:R→R is convex. Assume there are R,a,b>0R, a, b > 0R,a,b>0 such that for all t≥1t \ge 1t≥1:

  1. ∥vt∥2≤R\|v_t\|_2 \le R∥vt​∥2​≤R;
  2. for every x∈Px \in Px∈P, gtg_tgt​ is twice differentiable at vt⊤xv_t^\top xvt⊤​x (precisely: gtg_tgt​ and gt′g_t'gt′​ are differentiable there), with ∣gt′(vt⊤x)∣≤b|g_t'(v_t^\top x)| \le b∣gt′​(vt⊤​x)∣≤b and gt′′(vt⊤x)≥ag_t''(v_t^\top x) \ge agt′′​(vt⊤​x)≥a.

Let x1,x2,…x_1, x_2, \dotsx1​,x2​,… be a run of Follow the Leader on fff over PPP. Then for every T≥1T \ge 1T≥1 and every u∈Pu \in Pu∈P,

∑t=1T(ft(xt)−ft(u))≤nb2alog⁡(a2D2R2T2b2+1)+b2a.\sum_{t=1}^T \bigl(f_t(x_t) - f_t(u)\bigr) \le \frac{n b^2}{a} \log\left(\frac{a^2 D^2 R^2 T^2}{b^2} + 1\right) + \frac{b^2}{a}.t=1∑T​(ft​(xt​)−ft​(u))≤anb2​log(b2a2D2R2T2​+1)+ab2​.

The theorem shows that plain Follow the Leader already achieves O(log⁡T)O(\log T)O(logT) regret when each cost is a strongly curved convex function of a single linear form, a class that contains the quadratic surrogates of Follow the Approximate Leader and the losses of portfolio selection.

Formalization Note The paper prints the bound 2nb2a[log⁡DRaTb+1]\frac{2nb^2}{a}\bigl[\log\frac{DRaT}{b} + 1\bigr]a2nb2​[logbDRaT​+1]. That is false when DRaT/b<1/eDRaT/b < 1/eDRaT/b<1/e, where it is negative (for n=1n = 1n=1, P=[0,1]P = [0,1]P=[0,1], vt=1v_t = 1vt​=1, gt(y)=y2/20g_t(y) = y^2/20gt​(y)=y2/20, b=1b = 1b=1, T=1T = 1T=1, x1=1x_1 = 1x1​=1 the regret is 1/20>01/20 > 01/20>0). The paper's proof (Claims 1 and 2 with ε=b2/(aD2T)\varepsilon = b^2/(aD^2T)ε=b2/(aD2T)) gives the displayed bound, which implies the printed one when DRaT≥bDRaT \ge bDRaT≥b; the displayed form is stated because Theorem 6 applies Theorem 5 with DRa/b≤1/16DRa/b \le 1/16DRa/b≤1/16. The paper writes "ft:P→Rnf_t : P \to \mathbb{R}^nft​:P→Rn", a typo for R\mathbb{R}R. Derivatives are Mathlib's deriv, with explicit differentiability hypotheses at the points vt⊤xv_t^\top xvt⊤​x, x∈Px \in Px∈P (where deriv would otherwise return the junk value 000). Rounds are 111-based; regret is stated against every comparator u∈Pu \in Pu∈P rather than with a real-valued min⁡\minmin.

Preamble
import Mathlib
import Definitions.Def_LogRegretOCO_FTAL_IsFTLRun
Formal statement
namespace LogRegretOCO.FTAL
theorem ftl_regret_bound {n : ℕ} (P : Set (EuclideanSpace ℝ (Fin n))) (D R a b : ℝ)
    (g : ℕ → ℝ → ℝ) (v : ℕ → EuclideanSpace ℝ (Fin n)) (x : ℕ → EuclideanSpace ℝ (Fin n))
    (hPne : P.Nonempty) (hPconv : Convex ℝ P) (hPclosed : IsClosed P)
    (hPbdd : Bornology.IsBounded P)
    (hdiam : ∀ y ∈ P, ∀ z ∈ P, ‖y - z‖ ≤ D)
    (hR : 0 < R) (ha : 0 < a) (hb : 0 < b)
    (hv : ∀ t, 1 ≤ t → ‖v t‖ ≤ R)
    (hgconv : ∀ t, 1 ≤ t → ConvexOn ℝ Set.univ (g t))
    (hgdiff : ∀ t, 1 ≤ t → ∀ y ∈ P, DifferentiableAt ℝ (g t) (inner ℝ (v t) y))
    (hgdiff2 : ∀ t, 1 ≤ t → ∀ y ∈ P, DifferentiableAt ℝ (deriv (g t)) (inner ℝ (v t) y))
    (hg1 : ∀ t, 1 ≤ t → ∀ y ∈ P, |deriv (g t) (inner ℝ (v t) y)| ≤ b)
    (hg2 : ∀ t, 1 ≤ t → ∀ y ∈ P, a ≤ deriv (deriv (g t)) (inner ℝ (v t) y))
    (hx : IsFTLRun P (fun t y => g t (inner ℝ (v t) y)) x) :
    ∀ T : ℕ, 1 ≤ T → ∀ u ∈ P,
      ∑ t ∈ Finset.Icc 1 T, (g t (inner ℝ (v t) (x t)) - g t (inner ℝ (v t) u))
        ≤ n * b ^ 2 / a * Real.log (a ^ 2 * D ^ 2 * R ^ 2 * T ^ 2 / b ^ 2 + 1)
          + b ^ 2 / a := by sorry
end LogRegretOCO.FTAL
Source
Hazan, Agarwal, Kale, Logarithmic regret algorithms for online convex optimization, Mach Learn 69 (2007), p. 182, Theorem 5 (proof pp. 183–185, Claims 1–2 and the display on p. 185)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let n∈Nn \in \mathbb{N}n∈N and let Rn\mathbb{R}^nRn carry its Euclidean norm and inner product. The theorem concerns:

  • a set P⊆RnP \subseteq \mathbb{R}^nP⊆Rn;
  • real numbers D,R,a,bD, R, a, bD,R,a,b;
  • scalar functions gt:R→Rg_t : \mathbb{R} \to \mathbb{R}gt​:R→R, for t∈Nt \in \mathbb{N}t∈N;
  • vectors vt∈Rnv_t \in \mathbb{R}^nvt​∈Rn;
  • points xt∈Rnx_t \in \mathbb{R}^nxt​∈Rn.

The round-ttt cost of a point yyy is gt(⟨vt,y⟩)g_t(\langle v_t, y\rangle)gt​(⟨vt​,y⟩). Below, gt′g_t'gt′​ and gt′′g_t''gt′′​ denote the derivative function of gtg_tgt​ and the derivative of that function. By convention, a derivative takes the value 000 at points where the function is not differentiable.

Hypotheses on the set.

  1. PPP is nonempty, convex, closed and bounded.
  2. ∥y−z∥≤D\|y - z\| \le D∥y−z∥≤D for all y,z∈Py, z \in Py,z∈P. No sign is imposed on DDD, although nonemptiness forces D≥0D \ge 0D≥0.

Hypotheses on the constants and vectors.

  1. R>0R > 0R>0, a>0a > 0a>0 and b>0b > 0b>0.
  2. ∥vt∥≤R\|v_t\| \le R∥vt​∥≤R for every t≥1t \ge 1t≥1.

Hypotheses on the costs. For every t≥1t \ge 1t≥1 and every y∈Py \in Py∈P, writing s=⟨vt,y⟩s = \langle v_t, y\rangles=⟨vt​,y⟩:

  1. gtg_tgt​ is convex on all of R\mathbb{R}R.
  2. gtg_tgt​ is differentiable at sss.
  3. gt′g_t'gt′​ is differentiable at sss.
  4. ∣gt′(s)∣≤b|g_t'(s)| \le b∣gt′​(s)∣≤b.
  5. gt′′(s)≥ag_t''(s) \ge agt′′​(s)≥a.

Hypotheses 6–9 are imposed only at the points ⟨vt,y⟩\langle v_t, y\rangle⟨vt​,y⟩ with y∈Py \in Py∈P, not on all of R\mathbb{R}R.

Hypothesis on the run.

  1. xxx is a Follow-the-Leader run for these costs. That is, for every t≥1t \ge 1t≥1, xt∈Px_t \in Pxt​∈P, and for every y∈Py \in Py∈P,
∑τ=1t−1gτ(⟨vτ,xt⟩)≤∑τ=1t−1gτ(⟨vτ,y⟩).\sum_{\tau=1}^{t-1} g_\tau(\langle v_\tau, x_t\rangle) \le \sum_{\tau=1}^{t-1} g_\tau(\langle v_\tau, y\rangle).τ=1∑t−1​gτ​(⟨vτ​,xt​⟩)≤τ=1∑t−1​gτ​(⟨vτ​,y⟩).

Conclusion. For every integer T≥1T \ge 1T≥1 and every u∈Pu \in Pu∈P,

∑t=1T(gt(⟨vt,xt⟩)−gt(⟨vt,u⟩))  ≤  n b2a log⁡ ⁣(a2D2R2T2b2+1)+b2a,\sum_{t=1}^{T} \Big( g_t(\langle v_t, x_t\rangle) - g_t(\langle v_t, u\rangle) \Big) \;\le\; \frac{n\, b^2}{a}\,\log\!\Big(\frac{a^2 D^2 R^2 T^2}{b^2} + 1\Big) + \frac{b^2}{a},t=1∑T​(gt​(⟨vt​,xt​⟩)−gt​(⟨vt​,u⟩))≤anb2​log(b2a2D2R2T2​+1)+ab2​,

where log⁡\loglog is the natural logarithm. Because a,b>0a, b > 0a,b>0, there is no division by zero, and the logarithm's argument is at least 111.

Degenerate cases.

  • T=0T = 0T=0. Excluded by the conclusion's quantifier.
  • Round 000. g0g_0g0​, v0v_0v0​ and x0x_0x0​ are unconstrained and do not appear.
  • PPP is a single point. Then D=0D = 0D=0 is allowed, every xtx_txt​ equals uuu, the left side is 000, and the right side is b2/ab^2/ab2/a.
  • n=0n = 0n=0. Every inner product is 000 and PPP is the single point, so the left side is 000 and the right side is b2/ab^2/ab2/a.
  • vt=0v_t = 0vt​=0. The hypotheses on gtg_tgt​ reduce to conditions at the single point 000, which can be satisfied (for example by gt(s)=as2g_t(s) = a s^2gt​(s)=as2). So the hypotheses are not vacuous in general.
  • Derivative convention. Because hypotheses 6 and 7 hold at the relevant points, the values gt′(s)g_t'(s)gt′​(s) and gt′′(s)g_t''(s)gt′′​(s) in hypotheses 8 and 9 are not the default 000 at those points.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me