Documentation

CslibFrontier.MachineLearning.OnlineLearning.FTRL

Follow the regularized leader #

In online convex optimization a learner plays a point x t of a set K and then suffers the loss ℓ t (x t). Follow the regularized leader (FTRL) [Orabona2019, Algorithm 7.1] [Hazan2022, Algorithm 13] plays a minimizer over K of a regularizer plus the losses seen so far:

Rounds are indexed from 0, so x t, ℓ t and ψ t are the source's x_{t+1}, ℓ_{t+1} and ψ_{t+1}. Minimizers need not be unique, so IsFTRL and IsTimeVaryingFTRL describe families of runs. They exist when K is compact and nonempty and the regularizers and losses are continuous on K (exists_isFTRL, exists_isTimeVaryingFTRL), and the run is unique under positive strong convexity (IsFTRL.unique, IsTimeVaryingFTRL.unique). Both predicates constrain the realized sequence pointwise, and x t depends only on ℓ 0, …, ℓ (t - 1), so every bound below also holds when an adaptive adversary chooses ℓ t after seeing x 0, …, x t. lazyOGD constructs such a run explicitly for adaptively chosen gradients.

The analysis follows [Orabona2019, §7]. The regret equalities timeVaryingFtrl_regret_eq and ftrl_regret_eq [Orabona2019, Lemma 7.1] hold for every sequence. With the minimality of x T they give the "be the leader" / stability bounds IsFTRL.regret_le_add_sum_sub [Hazan2022, Lemma 5.3] and IsTimeVaryingFTRL.regret_le_add_sum_sub (plus its specialization IsTimeVaryingFTRL.regret_le_add_sum_sub_of_mono for non-decreasing regularizers ψ t y ≤ ψ (t + 1) y on K).

For local-norm stability [Orabona2019, Lemma 7.8], given per-round functions N : ℕ → E → ℝ (seminorms, norms, ℓ¹, or local Mahalanobis norms) such that F t (timeVaryingFtrlObjective) satisfies quadratic growth F t (x t) + μ t / 2 * N t (x t - y) ^ 2 ≤ F t y (μ t > 0) and ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y) on K, IsTimeVaryingFTRL.regret_le_of_localNorm and IsTimeVaryingFTRL.regret_le_of_localNorm_succ bound the regret by ψ T u - ψ 0 (x 0) + ∑ t, L t ^ 2 / (2 μ t). When ψ t is μ t-strongly convex with respect to N t (StrongConvexOnWrt) and the losses are convex, F t inherits that quadratic growth automatically (IsTimeVaryingFTRL.regret_le_of_strongConvexOnWrt). For ψ t y = R y / η t with a σ-strongly convex R (with respect to N, not required to be nonnegative) and nonincreasing η t > 0, shifting by -R (x 0) / η t preserves minimizers and makes the regularizers nondecreasing on K, yielding [Orabona2019, Corollary 7.9] (IsTimeVaryingFTRL.regret_le_div) and the anytime O(√T) regret bounds with η t = c / √(t + 1) (IsTimeVaryingFTRL.regret_le_sqrt_anytime, IsTimeVaryingFTRL.regret_le_sqrt_anytime_optimal).

For a constant regularizer ψ, the same argument gives IsFTRL.regret_le_wrt, IsFTRL.regret_le_div_wrt, IsFTRL.regret_le_sqrt_wrt for an arbitrary N : E → ℝ, together with their ambient-norm forms IsFTRL.regret_le, IsFTRL.regret_le_div, IsFTRL.regret_le_sqrt, and FTRL with linearized losses [Orabona2019, §7.3] (IsFTRL.regret_le_of_subgradient, IsFTRL.regret_le_of_hasFDerivWithinAt).

In a real inner product space, for a nonempty complete convex K and η > 0, with the Euclidean regularizer ‖y - x₀‖ ^ 2 / (2 η) and linear losses y ↦ ⟪g t, y⟫, the FTRL iterate is the metric projection of x₀ - η ∑ s < t, g s onto K (isFTRL_euclidean_iff). This is lazy projected online gradient descent, or dual averaging [Hazan2022, §5.4.1]. lazyOGD runs it with gradients grad t (x t) chosen at the played points (lazyOGD_regret_le, lazyOGD_regret_le_fixed).

Main definitions #

Main results #

References #

noncomputable def Cslib.MachineLearning.OnlineLearning.OCO.ftrlObjective {E : Type u_1} (ψ : E → ℝ) (ℓ : ℕ → E → ℝ) (t : ℕ) (y : E) :

The FTRL objective at round t: the regularizer plus the losses of the rounds before t.

theorem Cslib.MachineLearning.OnlineLearning.OCO.ftrlObjective_def {E : Type u_1} (ψ : E → ℝ) (ℓ : ℕ → E → ℝ) (t : ℕ) (y : E) :
ftrlObjective ψ ℓ t y = ψ y + ∑ s ∈ Finset.range t, ℓ s y
@[simp]
theorem Cslib.MachineLearning.OnlineLearning.OCO.ftrlObjective_zero {E : Type u_1} (ψ : E → ℝ) (ℓ : ℕ → E → ℝ) (y : E) :
ftrlObjective ψ ℓ 0 y = ψ y
theorem Cslib.MachineLearning.OnlineLearning.OCO.ftrlObjective_succ {E : Type u_1} (ψ : E → ℝ) (ℓ : ℕ → E → ℝ) (t : ℕ) (y : E) :
ftrlObjective ψ ℓ (t + 1) y = ftrlObjective ψ ℓ t y + ℓ t y
structure Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL {E : Type u_1} (K : Set E) (ψ : E → ℝ) (ℓ : ℕ → E → ℝ) (x : ℕ → E) :

x is a run of follow the regularized leader on K with regularizer ψ and losses ℓ [Orabona2019, Algorithm 7.1]: every x t lies in K and minimizes ψ + ∑ s < t, ℓ s there.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.objective_le {E : Type u_1} {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsFTRL K ψ ℓ x) (t : ℕ) {u : E} (hu : u ∈ K) :
ftrlObjective ψ ℓ t (x t) ≤ ftrlObjective ψ ℓ t u
theorem Cslib.MachineLearning.OnlineLearning.OCO.ftrl_regret_eq {E : Type u_1} (ψ : E → ℝ) (ℓ : ℕ → E → ℝ) (x : ℕ → E) (u : E) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) = ψ u - ψ (x 0) + ∑ t ∈ Finset.range T, (ftrlObjective ψ ℓ t (x t) - ftrlObjective ψ ℓ (t + 1) (x (t + 1)) + ℓ t (x t)) + (ftrlObjective ψ ℓ T (x T) - ftrlObjective ψ ℓ T u)

The FTRL regret equality [Orabona2019, Lemma 7.1], for a constant regularizer. It holds for every sequence x and comparator u; FTRL makes the last two terms F T (x T) - F T u nonpositive for u ∈ K, where F = ftrlObjective ψ ℓ.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.add_sum_le {E : Type u_1} {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsFTRL K ψ ℓ x) {u : E} (hu : u ∈ K) (T : ℕ) :
ψ (x 0) + ∑ t ∈ Finset.range T, ℓ t (x (t + 1)) ≤ ψ u + ∑ t ∈ Finset.range T, ℓ t u

Be the leader [Hazan2022, Lemma 5.4]: playing each round's minimizer one round early does at least as well as every fixed u ∈ K, regularizer included.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_add_sum_sub {E : Type u_1} {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsFTRL K ψ ℓ x) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ u - ψ (x 0) + ∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t (x (t + 1)))

Regret is at most stability [Hazan2022, Lemma 5.3]: the regret of FTRL against u ∈ K is at most ψ u - ψ (x 0) plus the stability terms ℓ t (x t) - ℓ t (x (t + 1)).

theorem Cslib.MachineLearning.OnlineLearning.OCO.exists_isFTRL {E : Type u_1} {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} [TopologicalSpace E] (hK : IsCompact K) (hne : K.Nonempty) (hψ : ContinuousOn ψ K) (hℓ : ∀ (t : ℕ), ContinuousOn (ℓ t) K) :
∃ (x : ℕ → E), IsFTRL K ψ ℓ x

Existence of FTRL runs: on a compact nonempty K, with a regularizer and losses continuous on K, every round's objective has a minimizer on K.

noncomputable def Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrlObjective {E : Type u_1} (ψ ℓ : ℕ → E → ℝ) (t : ℕ) (y : E) :

The time-varying FTRL objective at round t: the round-t regularizer ψ t plus the losses of the rounds before t.

theorem Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrlObjective_def {E : Type u_1} (ψ ℓ : ℕ → E → ℝ) (t : ℕ) (y : E) :
timeVaryingFtrlObjective ψ ℓ t y = ψ t y + ∑ s ∈ Finset.range t, ℓ s y
@[simp]
theorem Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrlObjective_zero {E : Type u_1} (ψ ℓ : ℕ → E → ℝ) (y : E) :
timeVaryingFtrlObjective ψ ℓ 0 y = ψ 0 y
theorem Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrlObjective_succ {E : Type u_1} (ψ ℓ : ℕ → E → ℝ) (t : ℕ) (y : E) :
timeVaryingFtrlObjective ψ ℓ (t + 1) y = timeVaryingFtrlObjective ψ ℓ t y + ℓ t y + (ψ (t + 1) y - ψ t y)
structure Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL {E : Type u_1} (K : Set E) (ψ ℓ : ℕ → E → ℝ) (x : ℕ → E) :

x is a run of follow the regularized leader on K with time-varying regularizers ψ and losses ℓ [Orabona2019, Algorithm 7.1]: every x t lies in K and minimizes ψ t + ∑ s < t, ℓ s there.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.objective_le {E : Type u_1} {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) (t : ℕ) {u : E} (hu : u ∈ K) :
theorem Cslib.MachineLearning.OnlineLearning.OCO.isTimeVaryingFTRL_const_iff {E : Type u_1} {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {ψ₀ : E → ℝ} :
IsTimeVaryingFTRL K (fun (x : ℕ) => ψ₀) ℓ x ↔ IsFTRL K ψ₀ ℓ x

Constant-regularizer FTRL is the special case of IsTimeVaryingFTRL with fun _ => ψ.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.add_const {E : Type u_1} {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) (c : ℕ → ℝ) :
IsTimeVaryingFTRL K (fun (t : ℕ) (y : E) => ψ t y + c t) ℓ x

Shifting each round's regularizer by a constant independent of y preserves IsTimeVaryingFTRL.

theorem Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrl_regret_eq {E : Type u_1} (ψ ℓ : ℕ → E → ℝ) (x : ℕ → E) (u : E) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) = ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range T, (timeVaryingFtrlObjective ψ ℓ t (x t) - timeVaryingFtrlObjective ψ ℓ (t + 1) (x (t + 1)) + ℓ t (x t)) + (timeVaryingFtrlObjective ψ ℓ T (x T) - timeVaryingFtrlObjective ψ ℓ T u)

The time-varying FTRL regret equality [Orabona2019, Lemma 7.1]: holds for every sequence x and comparator u. When x is an FTRL run and u ∈ K, the final difference F T (x T) - F T u is nonpositive.

theorem Cslib.MachineLearning.OnlineLearning.OCO.timeVaryingFtrl_regret_eq_succ {E : Type u_1} (ψ ℓ : ℕ → E → ℝ) (x : ℕ → E) (u : E) (T : ℕ) :
∑ t ∈ Finset.range (T + 1), (ℓ t (x t) - ℓ t u) = ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range T, (timeVaryingFtrlObjective ψ ℓ t (x t) - timeVaryingFtrlObjective ψ ℓ (t + 1) (x (t + 1)) + ℓ t (x t)) + (timeVaryingFtrlObjective ψ ℓ T (x T) + ℓ T (x T) - (timeVaryingFtrlObjective ψ ℓ T u + ℓ T u))

Time-varying FTRL regret equality over T + 1 rounds without ψ (T + 1) (compare [Orabona2019, Lemma 7.1]): isolates the final round's stability term F T (x T) + ℓ T (x T) - (F T u + ℓ T u), so only ψ 0, …, ψ T and x 0, …, x T appear.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_add_sum_sub {E : Type u_1} {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t (x (t + 1)) - (ψ (t + 1) (x (t + 1)) - ψ t (x (t + 1))))

Time-varying FTRL stability inequality [Orabona2019, Lemma 7.1]: bounds regret by ψ T u - ψ 0 (x 0) plus the per-round stability terms ℓ t (x t) - ℓ t (x (t + 1)) minus the regularizer increments ψ (t + 1) (x (t + 1)) - ψ t (x (t + 1)).

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_add_sum_sub_of_mono {E : Type u_1} {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) (hmono : ∀ (t : ℕ), ∀ y ∈ K, ψ t y ≤ ψ (t + 1) y) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t (x (t + 1)))

For nondecreasing regularizers (ψ t y ≤ ψ (t + 1) y on K), the regularizer increments drop out of the time-varying FTRL stability bound.

theorem Cslib.MachineLearning.OnlineLearning.OCO.exists_isTimeVaryingFTRL {E : Type u_1} {K : Set E} {ψ ℓ : ℕ → E → ℝ} [TopologicalSpace E] (hK : IsCompact K) (hne : K.Nonempty) (hψ : ∀ (t : ℕ), ContinuousOn (ψ t) K) (hℓ : ∀ (t : ℕ), ContinuousOn (ℓ t) K) :
∃ (x : ℕ → E), IsTimeVaryingFTRL K ψ ℓ x

Existence of time-varying FTRL runs: on a compact nonempty K, with regularizers and losses continuous on K, every round's objective has a minimizer on K.

theorem Cslib.MachineLearning.OnlineLearning.OCO.strongConvexOnWrt_timeVaryingFtrlObjective {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {N : E → ℝ} {μ : ℝ} {t : ℕ} (hψ : StrongConvexOnWrt K N μ (ψ t)) (hℓ : ∀ s < t, ConvexOn ℝ K (ℓ s)) :

The time-varying FTRL objective inherits StrongConvexOnWrt from ψ t when the losses are convex.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.unique {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x x' : ℕ → E} {N : ℕ → E → ℝ} {μ : ℕ → ℝ} (h : IsTimeVaryingFTRL K ψ ℓ x) (h' : IsTimeVaryingFTRL K ψ ℓ x') (hψ : ∀ (t : ℕ), StrongConvexOnWrt K (N t) (μ t) (ψ t)) (hμ : ∀ (t : ℕ), 0 < μ t) (hN : ∀ (t : ℕ) (v : E), N t v = 0 → v = 0) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) :
x = x'

With μ t-strongly convex regularizers (μ t > 0) with respect to positive-definite local norms N t and convex losses, the time-varying FTRL run is unique.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.stability_le_of_quad_growth {E : Type u_1} [AddCommGroup E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) {t : ℕ} {N : E → ℝ} {μ L : ℝ} (hμ : 0 < μ) (hmono : ∀ y ∈ K, ψ t y ≤ ψ (t + 1) y) (hquad : ∀ y ∈ K, timeVaryingFtrlObjective ψ ℓ t (x t) + μ / 2 * N (x t - y) ^ 2 ≤ timeVaryingFtrlObjective ψ ℓ t y) (hL : ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L * N (x t - y)) :
timeVaryingFtrlObjective ψ ℓ t (x t) - timeVaryingFtrlObjective ψ ℓ (t + 1) (x (t + 1)) + ℓ t (x t) ≤ L ^ 2 / (2 * μ)

Local-norm stability step for time-varying FTRL [Orabona2019, Lemma 7.8]: if ψ t ≤ ψ (t+1) on K, F t satisfies local-norm quadratic growth at x t with modulus μ > 0, and ℓ t (x t) - ℓ t y ≤ L * N (x t - y) on K, then the round-t stability term in the regret equality is at most L ^ 2 / (2 * μ).

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_of_localNorm {E : Type u_1} [AddCommGroup E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) {N : ℕ → E → ℝ} {μ L : ℕ → ℝ} {T : ℕ} (hmono : ∀ t < T, ∀ y ∈ K, ψ t y ≤ ψ (t + 1) y) (hμ : ∀ t < T, 0 < μ t) (hquad : ∀ t < T, ∀ y ∈ K, timeVaryingFtrlObjective ψ ℓ t (x t) + μ t / 2 * N t (x t - y) ^ 2 ≤ timeVaryingFtrlObjective ψ ℓ t y) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range T, L t ^ 2 / (2 * μ t)

Time-varying FTRL regret under local-norm quadratic growth [Orabona2019, Lemmas 7.1, 7.8]: if ψ t y ≤ ψ (t + 1) y on K, each F t satisfies local-norm quadratic growth at x t with modulus μ t > 0 and local norm N t, and ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y) for t < T, then against every u ∈ K, ∑ t < T, (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t < T, L t ^ 2 / (2 * μ t).

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_of_localNorm_succ {E : Type u_1} [AddCommGroup E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) {N : ℕ → E → ℝ} {μ L : ℕ → ℝ} {T : ℕ} (hmono : ∀ t < T, ∀ y ∈ K, ψ t y ≤ ψ (t + 1) y) (hμ : ∀ t ≤ T, 0 < μ t) (hquad : ∀ t ≤ T, ∀ y ∈ K, timeVaryingFtrlObjective ψ ℓ t (x t) + μ t / 2 * N t (x t - y) ^ 2 ≤ timeVaryingFtrlObjective ψ ℓ t y) (hL : ∀ t ≤ T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range (T + 1), (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range (T + 1), L t ^ 2 / (2 * μ t)

Time-varying FTRL regret over T + 1 rounds without ψ (T + 1): uses the T-th regularizer ψ T u rather than ψ (T + 1) u, by applying local-norm stability directly to F T (x T) + ℓ T (x T) - (F T u + ℓ T u).

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_of_strongConvexOnWrt {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) {N : ℕ → E → ℝ} {μ L : ℕ → ℝ} {T : ℕ} (hmono : ∀ t < T, ∀ y ∈ K, ψ t y ≤ ψ (t + 1) y) (hψ : ∀ t < T, StrongConvexOnWrt K (N t) (μ t) (ψ t)) (hμ : ∀ t < T, 0 < μ t) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range T, L t ^ 2 / (2 * μ t)

Time-varying FTRL regret with local-norm strongly convex regularizers [Orabona2019, Lemmas 7.1 and 7.8].

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_of_strongConvexOnWrt_succ {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ψ ℓ : ℕ → E → ℝ} {x : ℕ → E} (h : IsTimeVaryingFTRL K ψ ℓ x) {N : ℕ → E → ℝ} {μ L : ℕ → ℝ} {T : ℕ} (hmono : ∀ t < T, ∀ y ∈ K, ψ t y ≤ ψ (t + 1) y) (hψ : ∀ t ≤ T, StrongConvexOnWrt K (N t) (μ t) (ψ t)) (hμ : ∀ t ≤ T, 0 < μ t) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t ≤ T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N t (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range (T + 1), (ℓ t (x t) - ℓ t u) ≤ ψ T u - ψ 0 (x 0) + ∑ t ∈ Finset.range (T + 1), L t ^ 2 / (2 * μ t)

Time-varying FTRL regret over T + 1 rounds with local-norm strongly convex regularizers, using ψ T u rather than ψ (T + 1) u.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_div {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R N : E → ℝ} {η L : ℕ → ℝ} {σ : ℝ} {T : ℕ} (h : IsTimeVaryingFTRL K (fun (t : ℕ) (y : E) => R y / η t) ℓ x) (hR : StrongConvexOnWrt K N σ R) (hσ : 0 < σ) (hη : ∀ (t : ℕ), 0 < η t) (hanti : Antitone η) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t ≤ T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range (T + 1), (ℓ t (x t) - ℓ t u) ≤ (R u - R (x 0)) / η T + ∑ t ∈ Finset.range (T + 1), η t * L t ^ 2 / (2 * σ)

Time-varying learning rate [Orabona2019, Corollary 7.9]: FTRL with regularizers ψ t y = R y / η t, for a σ-strongly convex R (with respect to N, not required to be nonnegative) and positive nonincreasing learning rates η, has regret over T + 1 rounds at most (R u - R (x 0)) / η T + ∑ t ≤ T, η t * L t ^ 2 / (2 * σ) against every u ∈ K.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_sqrt_anytime {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R N : E → ℝ} {σ c D L : ℝ} {T : ℕ} (hσ : 0 < σ) (hc : 0 < c) (h : IsTimeVaryingFTRL K (fun (t : ℕ) (y : E) => R y / (c / √(↑t + 1))) ℓ x) (hR : StrongConvexOnWrt K N σ R) (hRD : ∀ y ∈ K, ∀ z ∈ K, R y - R z ≤ D ^ 2) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L * N (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ (D ^ 2 / c + c * L ^ 2 / σ) * √↑T

Anytime O(√T) regret for time-varying FTRL [Orabona2019, Corollary 7.9]: with η t = c / √(t + 1) (c > 0), a σ-strongly convex R (w.r.t. N) with oscillation at most D ^ 2 on K, convex losses and ℓ t (x t) - ℓ t y ≤ L * N (x t - y), the regret over any horizon T : ℕ against every u ∈ K is at most (D ^ 2 / c + c * L ^ 2 / σ) * √T.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsTimeVaryingFTRL.regret_le_sqrt_anytime_optimal {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R N : E → ℝ} {σ D L : ℝ} {T : ℕ} (hσ : 0 < σ) (hD : 0 < D) (hL0 : 0 < L) (h : IsTimeVaryingFTRL K (fun (t : ℕ) (y : E) => R y / (D * √σ / L / √(↑t + 1))) ℓ x) (hR : StrongConvexOnWrt K N σ R) (hRD : ∀ y ∈ K, ∀ z ∈ K, R y - R z ≤ D ^ 2) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L * N (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ 2 * D * L * √(↑T / σ)

Optimally tuned anytime O(√T) regret for time-varying FTRL: choosing η t = (D * √σ / L) / √(t + 1) gives regret at most 2 * D * L * √(T / σ) for every horizon T : ℕ against every u ∈ K.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_wrt {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {ψ₀ N : E → ℝ} {μ : ℝ} {L : ℕ → ℝ} {T : ℕ} (h : IsFTRL K ψ₀ ℓ x) (hψ : StrongConvexOnWrt K N μ ψ₀) (hμ : 0 < μ) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ₀ u - ψ₀ (x 0) + ∑ t ∈ Finset.range T, L t ^ 2 / (2 * μ)

Constant-regularizer FTRL regret with respect to an arbitrary N : E → ℝ ([Orabona2019, Lemmas 7.1 and 7.8]): covers ℓ¹, ℓ² or any non-ambient norm.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_div_wrt {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R N : E → ℝ} {η σ : ℝ} {L : ℕ → ℝ} {T : ℕ} (h : IsFTRL K (fun (y : E) => R y / η) ℓ x) (hR : StrongConvexOnWrt K N σ R) (hσ : 0 < σ) (hη : 0 < η) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * N (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ (R u - R (x 0)) / η + η / (2 * σ) * ∑ t ∈ Finset.range T, L t ^ 2

Constant learning rate with respect to N : E → ℝ: FTRL with regularizer R / η for a σ-strongly convex R (w.r.t. N) and σ, η > 0 has regret at most (R u - R (x 0)) / η + η / (2 * σ) * ∑ t < T, L t ^ 2 against every u ∈ K.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_sqrt_wrt {E : Type u_1} [AddCommGroup E] [Module ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R N : E → ℝ} {σ D L : ℝ} {T : ℕ} (hσ : 0 < σ) (hD : 0 < D) (hL0 : 0 < L) (hT : 0 < T) (h : IsFTRL K (fun (y : E) => R y / (D / L * √(2 * σ / ↑T))) ℓ x) (hR : StrongConvexOnWrt K N σ R) (hRD : ∀ y ∈ K, ∀ z ∈ K, R y - R z ≤ D ^ 2) (hℓ : ∀ t < T, ConvexOn ℝ K (ℓ t)) (hL : ∀ t < T, ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L * N (x t - y)) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ D * L * √(2 * ↑T / σ)

Tuned learning rate with respect to N : E → ℝ: if R is σ-strongly convex (w.r.t. N) with R y - R z ≤ D ^ 2 on K, the losses are convex and ℓ t (x t) - ℓ t y ≤ L * N (x t - y) for t < T, then FTRL with regularizer R / (D / L * √(2 * σ / T)) has regret at most D * L * √(2 * T / σ) over T ≥ 1 rounds against every u ∈ K.

theorem Cslib.MachineLearning.OnlineLearning.OCO.strongConvexOn_ftrlObjective {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {μ : ℝ} (hψ : StrongConvexOn K μ ψ) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) (t : ℕ) :

The FTRL objective inherits the strong convexity of the regularizer.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.unique {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {μ : ℝ} {x' : ℕ → E} (h : IsFTRL K ψ ℓ x) (h' : IsFTRL K ψ ℓ x') (hψ : StrongConvexOn K μ ψ) (hμ : 0 < μ) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) :
x = x'

With a μ-strongly convex regularizer (μ > 0) and convex losses, the FTRL run is unique.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.stability_le {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {μ : ℝ} (h : IsFTRL K ψ ℓ x) (hψ : StrongConvexOn K μ ψ) (hμ : 0 < μ) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) {t : ℕ} {L : ℝ} (hL : ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L * ‖x t - y‖) :
ftrlObjective ψ ℓ t (x t) - ftrlObjective ψ ℓ (t + 1) (x (t + 1)) + ℓ t (x t) ≤ L ^ 2 / (2 * μ)

Stability of FTRL (compare [Orabona2019, Lemma 7.8]): with a μ-strongly convex regularizer and convex losses, if ℓ t (x t) - ℓ t y ≤ L * ‖x t - y‖ for y ∈ K, then the stability term of round t in the regret equality is at most L ^ 2 / (2 μ).

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ψ : E → ℝ} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {μ : ℝ} (h : IsFTRL K ψ ℓ x) (hψ : StrongConvexOn K μ ψ) (hμ : 0 < μ) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) {L : ℕ → ℝ} (hL : ∀ (t : ℕ), ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * ‖x t - y‖) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ ψ u - ψ (x 0) + ∑ t ∈ Finset.range T, L t ^ 2 / (2 * μ)

Regret of FTRL with a strongly convex regularizer ([Orabona2019, Lemmas 7.1 and 7.8]; compare [Hazan2022, Theorem 5.2]). If ψ is μ-strongly convex on K with μ > 0, the losses are convex on K and ℓ t (x t) - ℓ t y ≤ L t * ‖x t - y‖ for y ∈ K (for instance, ℓ t is L t-Lipschitz on K), then the regret against every u ∈ K is at most ψ u - ψ (x 0) + ∑ t < T, L t ^ 2 / (2 μ).

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_div {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R : E → ℝ} {η σ : ℝ} (h : IsFTRL K (fun (y : E) => R y / η) ℓ x) (hR : StrongConvexOn K σ R) (hσ : 0 < σ) (hη : 0 < η) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) {L : ℕ → ℝ} (hL : ∀ (t : ℕ), ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L t * ‖x t - y‖) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ (R u - R (x 0)) / η + η / (2 * σ) * ∑ t ∈ Finset.range T, L t ^ 2

Constant learning rate ([Orabona2019, Corollary 7.9] with η_t = η): FTRL with the regularizer R / η, for a σ-strongly convex R with σ, η > 0, has regret at most (R u - R (x 0)) / η + η / (2 σ) ∑ t < T, L t ^ 2 against every u ∈ K. Since x 0 minimizes R on K, R u - R (x 0) = R u - min_K R.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_sqrt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ℓ : ℕ → E → ℝ} {x : ℕ → E} {R : E → ℝ} {σ D L : ℝ} {T : ℕ} (hσ : 0 < σ) (hD : 0 < D) (hL0 : 0 < L) (hT : 0 < T) (h : IsFTRL K (fun (y : E) => R y / (D / L * √(2 * σ / ↑T))) ℓ x) (hR : StrongConvexOn K σ R) (hRD : ∀ y ∈ K, ∀ z ∈ K, R y - R z ≤ D ^ 2) (hℓ : ∀ (t : ℕ), ConvexOn ℝ K (ℓ t)) (hL : ∀ (t : ℕ), ∀ y ∈ K, ℓ t (x t) - ℓ t y ≤ L * ‖x t - y‖) {u : E} (hu : u ∈ K) :
∑ t ∈ Finset.range T, (ℓ t (x t) - ℓ t u) ≤ D * L * √(2 * ↑T / σ)

Tuned learning rate. If R is σ-strongly convex on K with R y - R z ≤ D ^ 2 for y z ∈ K, the losses are convex and ℓ t (x t) - ℓ t y ≤ L * ‖x t - y‖ on K, then FTRL with regularizer R / η for η = D / L * √(2 σ / T) has regret at most D L √(2 T / σ) over T ≥ 1 rounds against every u ∈ K.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_of_subgradient {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ψ : E → ℝ} {x : ℕ → E} {μ : ℝ} {f : ℕ → E → ℝ} {g : ℕ → E →L[ℝ] ℝ} (h : IsFTRL K ψ (fun (t : ℕ) (y : E) => (g t) y) x) (hψ : StrongConvexOn K μ ψ) (hμ : 0 < μ) (hsub : ∀ (t : ℕ), ∀ y ∈ K, f t (x t) + (g t) (y - x t) ≤ f t y) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (f t (x t) - f t u) ≤ ψ u - ψ (x 0) + ∑ t ∈ Finset.range T, ‖g t‖ ^ 2 / (2 * μ)

FTRL with linearized losses [Orabona2019, §7.3]: run FTRL on the linear losses given by subgradients g t of convex losses f t at the played points, i.e. f t (x t) + g t (y - x t) ≤ f t y for y ∈ K. With a μ-strongly convex regularizer, the regret on the losses f t against every u ∈ K is at most ψ u - ψ (x 0) + ∑ t < T, ‖g t‖ ^ 2 / (2 μ), with the operator norm (dual norm) ‖g t‖. The g t may depend on x t, so this covers gradients revealed at the played points.

theorem Cslib.MachineLearning.OnlineLearning.OCO.IsFTRL.regret_le_of_hasFDerivWithinAt {E : Type u_1} [NormedAddCommGroup E] [NormedSpace ℝ E] {K : Set E} {ψ : E → ℝ} {x : ℕ → E} {μ : ℝ} {f : ℕ → E → ℝ} {f' : ℕ → E →L[ℝ] ℝ} (h : IsFTRL K ψ (fun (t : ℕ) (y : E) => (f' t) y) x) (hψ : StrongConvexOn K μ ψ) (hμ : 0 < μ) (hf : ∀ (t : ℕ), ConvexOn ℝ K (f t)) (hd : ∀ (t : ℕ), HasFDerivWithinAt (f t) (f' t) K (x t)) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (f t (x t) - f t u) ≤ ψ u - ψ (x 0) + ∑ t ∈ Finset.range T, ‖f' t‖ ^ 2 / (2 * μ)

FTRL with linearized losses for convex losses f t differentiable within K at the played points, with derivatives f' t (IsFTRL.regret_le_of_subgradient with g t = f' t).

theorem Cslib.MachineLearning.OnlineLearning.OCO.isFTRL_euclidean_iff {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} (hne : K.Nonempty) (hc : IsComplete K) (hK : Convex ℝ K) (hη : 0 < η) (g x : ℕ → E) :
IsFTRL K (fun (y : E) => ‖y - x₀‖ ^ 2 / (2 * η)) (fun (t : ℕ) (y : E) => inner ℝ (g t) y) x ↔ ∀ (t : ℕ), x t = metricProjection K (x₀ - η • ∑ s ∈ Finset.range t, g s)

Euclidean FTRL is lazy projection [Hazan2022, §5.4.1]: with the regularizer ‖y - x₀‖ ^ 2 / (2 η) and linear losses y ↦ ⟪g t, y⟫, a sequence is an FTRL run on a nonempty complete convex K iff each x t is the metric projection of x₀ - η ∑ s < t, g s onto K.

noncomputable def Cslib.MachineLearning.OnlineLearning.OCO.lazyOGDState {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (K : Set E) (η : ℝ) (grad : ℕ → E → E) (x₀ : E) :
ℕ → E

The unprojected state of lazy projected online gradient descent: y 0 = x₀ and y (t + 1) = y t - η • grad t (Π_K (y t)).

noncomputable def Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] (K : Set E) (η : ℝ) (grad : ℕ → E → E) (x₀ : E) (t : ℕ) :
E

Lazy projected online gradient descent [Hazan2022, §5.4.1]: play the metric projection onto K of the unprojected state, which accumulates the gradients revealed at the played points.

@[simp]
theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGDState_zero {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} :
lazyOGDState K η grad x₀ 0 = x₀
theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGDState_succ {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} (t : ℕ) :
lazyOGDState K η grad x₀ (t + 1) = lazyOGDState K η grad x₀ t - η • grad t (lazyOGD K η grad x₀ t)
theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD_def {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} (t : ℕ) :
lazyOGD K η grad x₀ t = metricProjection K (lazyOGDState K η grad x₀ t)
theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGDState_eq {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} (t : ℕ) :
lazyOGDState K η grad x₀ t = x₀ - η • ∑ s ∈ Finset.range t, grad s (lazyOGD K η grad x₀ s)

The unprojected state is x₀ minus η times the sum of the gradients revealed so far.

theorem Cslib.MachineLearning.OnlineLearning.OCO.isFTRL_lazyOGD {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} (hne : K.Nonempty) (hc : IsComplete K) (hK : Convex ℝ K) (hη : 0 < η) :
IsFTRL K (fun (y : E) => ‖y - x₀‖ ^ 2 / (2 * η)) (fun (t : ℕ) (y : E) => inner ℝ (grad t (lazyOGD K η grad x₀ t)) y) (lazyOGD K η grad x₀)

Lazy projected online gradient descent is FTRL with the Euclidean regularizer ‖y - x₀‖ ^ 2 / (2 η) on the linear losses y ↦ ⟪grad t (x t), y⟫ given by the gradients at the played points.

theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD_mem {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} (hne : K.Nonempty) (hc : IsComplete K) (hK : Convex ℝ K) (t : ℕ) :
lazyOGD K η grad x₀ t ∈ K
theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD_regret_le {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {η : ℝ} {x₀ : E} {grad : ℕ → E → E} {f : ℕ → E → ℝ} (hne : K.Nonempty) (hc : IsComplete K) (hK : Convex ℝ K) (hη : 0 < η) (hsub : ∀ (t : ℕ), ∀ x ∈ K, ∀ y ∈ K, f t x + inner ℝ (grad t x) (y - x) ≤ f t y) {u : E} (hu : u ∈ K) (T : ℕ) :
∑ t ∈ Finset.range T, (f t (lazyOGD K η grad x₀ t) - f t u) ≤ ‖u - x₀‖ ^ 2 / (2 * η) + η / 2 * ∑ t ∈ Finset.range T, ‖grad t (lazyOGD K η grad x₀ t)‖ ^ 2

Regret of lazy projected online gradient descent. If the gradients satisfy the subgradient inequality f t x + ⟪grad t x, y - x⟫ ≤ f t y on K, then for every η > 0 the regret against every u ∈ K is at most ‖u - x₀‖ ^ 2 / (2 η) + η / 2 * ∑ t < T, ‖grad t (x t)‖ ^ 2. This is the Euclidean case of IsFTRL.regret_le (strong convexity 1 / η, L t = ‖grad t (x t)‖).

theorem Cslib.MachineLearning.OnlineLearning.OCO.lazyOGD_regret_le_fixed {E : Type u_1} [NormedAddCommGroup E] [InnerProductSpace ℝ E] {K : Set E} {x₀ : E} {grad : ℕ → E → E} {f : ℕ → E → ℝ} (hne : K.Nonempty) (hc : IsComplete K) (hK : Convex ℝ K) {D G : ℝ} (hD0 : 0 < D) (hG0 : 0 < G) (hG : ∀ (t : ℕ), ∀ x ∈ K, ‖grad t x‖ ≤ G) (hsub : ∀ (t : ℕ), ∀ x ∈ K, ∀ y ∈ K, f t x + inner ℝ (grad t x) (y - x) ≤ f t y) {u : E} (hu : u ∈ K) (hD : ‖u - x₀‖ ≤ D) {T : ℕ} (hT : 0 < T) :
∑ t ∈ Finset.range T, (f t (lazyOGD K (D / (G * √↑T)) grad x₀ t) - f t u) ≤ G * D * √↑T

Tuned lazy projected online gradient descent: if the gradients satisfy the subgradient inequality f t x + ⟪grad t x, y - x⟫ ≤ f t y and have norm at most G on K, ‖u - x₀‖ ≤ D and D, G > 0, the constant step size η = D / (G √T) gives regret at most G D √T over T ≥ 1 rounds (compare the 2 G D √T of [Hazan2022, §5.4.1], and ogd_regret_le_fixed for the agile variant).