Documentation

CslibFrontier.MachineLearning.OnlineLearning.LowerBounds

External and dynamic regret lower bounds #

This module formalizes the four regret lower-bound theorems and Exercise 4.5 of [BlumMansour2007AGT, §4.3, §4.3.1, §4.3.4, and Exercise 4.5, pp. 82–88, 101] in the experts setting (Cslib.MachineLearning.OnlineLearning.Experts):

Main definitions #

Main results #

References #

Causal online algorithms #

structure Cslib.MachineLearning.OnlineLearning.Experts.IsOnlineAlgorithm {ι : Type u_1} [Fintype ι] (H : (ℕ → ι → ℝ) → ℕ → ι → ℝ) :

A causal online experts algorithm on [0, 1]-valued losses [BlumMansour2007AGT, §4.2, p. 81]: after any [0, 1]-valued history ℓ 0, …, ℓ (t - 1), H ℓ t is a probability distribution on ι determined solely by those earlier rounds.

  • nonneg {ℓ : ℕ → ι → ℝ} {t : ℕ} : (∀ s < t, ∀ (i : ι), ℓ s i ∈ Set.Icc 0 1) → ∀ (i : ι), 0 ≤ H ℓ t i

    Probabilities are nonnegative after any [0, 1]-valued history.

  • sum_eq_one {ℓ : ℕ → ι → ℝ} {t : ℕ} : (∀ s < t, ∀ (i : ι), ℓ s i ∈ Set.Icc 0 1) → ∑ i : ι, H ℓ t i = 1

    Probabilities sum to 1 after any [0, 1]-valued history.

  • congr {ℓ ℓ' : ℕ → ι → ℝ} {t : ℕ} : (∀ s < t, ∀ (i : ι), ℓ s i ∈ Set.Icc 0 1) → (∀ s < t, ℓ s = ℓ' s) → H ℓ t = H ℓ' t

    Round-t distribution depends only on rounds < t for [0, 1]-valued histories.

theorem Cslib.MachineLearning.OnlineLearning.Experts.isOnlineAlgorithm_prob {ι : Type u_1} [Fintype ι] [Nonempty ι] {φ : ℝ → ℝ} (hφ : ∀ x ∈ Set.Icc 0 1, 0 < φ x) :

Every multiplicative update whose factor is positive on [0, 1] (in particular Hedge for every η and Polynomial Weights for η < 1) is an online algorithm.

Theorem 4.1: Dynamic regret against G_all #

theorem Cslib.MachineLearning.OnlineLearning.Experts.exists_dynamic_regret_ge {ι : Type u_1} [Fintype ι] [Nonempty ι] {H : (ℕ → ι → ℝ) → ℕ → ι → ℝ} (hH : IsOnlineAlgorithm H) (T : ℕ) :
∃ (ℓ : ℕ → ι → ℝ) (g : ℕ → ι), (∀ t < T, ∀ (i : ι), ℓ t i = 0 ∨ ℓ t i = 1) ∧ ∑ t ∈ Finset.range T, ℓ t (g t) = 0 ∧ ↑T * (1 - 1 / ↑(Fintype.card ι)) ≤ ∑ t ∈ Finset.range T, ∑ i : ι, H ℓ t i * ℓ t i

Dynamic regret lower bound against G_all [BlumMansour2007AGT, Theorem 4.1, pp. 82–83]: for every causal online algorithm H on N ≥ 1 experts and horizon T, there exist a {0, 1} loss sequence ℓ and an action sequence g : ℕ → ι such that g incurs total loss 0 while H incurs expected loss at least T * (1 - 1 / N).

Theorem 4.3: Deterministic lower bound (L_D^T = T and L_min^T = ⌊T / N⌋) #

theorem Cslib.MachineLearning.OnlineLearning.Experts.exists_deterministic_loss_eq_and_minCumLoss_eq {ι : Type u_1} [Fintype ι] [Nonempty ι] {D : (ℕ → ι → ℝ) → ℕ → ι} (hD : ∀ {ℓ ℓ' : ℕ → ι → ℝ} {t : ℕ}, (∀ s < t, ∀ (i : ι), ℓ s i ∈ Set.Icc 0 1) → (∀ s < t, ℓ s = ℓ' s) → D ℓ t = D ℓ' t) (T : ℕ) :
∃ (ℓ : ℕ → ι → ℝ), (∀ t < T, ∀ (i : ι), ℓ t i = 0 ∨ ℓ t i = 1) ∧ ∑ t ∈ Finset.range T, ℓ t (D ℓ t) = ↑T ∧ minCumLoss ℓ T = ↑(T / Fintype.card ι)

Deterministic regret lower bound [BlumMansour2007AGT, Theorem 4.3, pp. 83–84]: for every causal deterministic algorithm D on N ≥ 1 experts and horizon T, there exists a {0, 1} loss sequence ℓ on which D incurs loss T while minCumLoss ℓ T = ⌊T / N⌋ holds with exact equality.

Unified block-map stochastic adversary (Theorems 4.7, 4.8, and Exercise 4.5) #

Theorems 4.7, 4.8, and Exercise 4.5 #

theorem Cslib.MachineLearning.OnlineLearning.Experts.exists_stochastic_loss_eq_half_minCumLoss_zero {ι : Type u_1} [Fintype ι] {T : ℕ} (hTN : 2 ^ T ≤ Fintype.card ι) :
∃ (ℓ : (Fin T → Bool) → ℕ → ι → ℝ), (∀ (w : Fin T → Bool) (t : ℕ) (i : ι), ℓ w t i = 0 ∨ ℓ w t i = 1) ∧ (∀ (w : Fin T → Bool), minCumLoss (ℓ w) T = 0) ∧ ∀ (H : (ℕ → ι → ℝ) → ℕ → ι → ℝ), IsOnlineAlgorithm H → (Finset.univ.expect fun (w : Fin T → Bool) => ∑ t ∈ Finset.range T, ∑ i : ι, H (ℓ w) t i * ℓ w t i) = ↑T / 2

Short-horizon stochastic lower bound (2 ^ T ≤ N) [BlumMansour2007AGT, Theorem 4.7, pp. 87–88]: whenever 2 ^ T ≤ Fintype.card ι (in particular for all T < log₂ N), there is a uniform {0, 1} loss family over Fin T → Bool such that every realization satisfies minCumLoss (ℓ w) T = 0 while every causal online algorithm H incurs expected loss T / 2.

theorem Cslib.MachineLearning.OnlineLearning.Experts.exists_two_experts_stochastic_regret_ge {ι : Type u_1} [Fintype ι] (hn : 2 ≤ Fintype.card ι) (T : ℕ) :
∃ (ℓ : (Fin T → Bool) → ℕ → ι → ℝ), (∀ (w : Fin T → Bool) (t : ℕ) (i : ι), ℓ w t i = 0 ∨ ℓ w t i = 1) ∧ ∀ (H : (ℕ → ι → ℝ) → ℕ → ι → ℝ), IsOnlineAlgorithm H → (Finset.univ.expect fun (w : Fin T → Bool) => ∑ t ∈ Finset.range T, ∑ i : ι, H (ℓ w) t i * ℓ w t i) = ↑T / 2 ∧ 1 / (2 * Real.exp 1) * √↑T ≤ Finset.univ.expect fun (w : Fin T → Bool) => ∑ t ∈ Finset.range T, ∑ i : ι, H (ℓ w) t i * ℓ w t i - minCumLoss (ℓ w) T

Two-expert Ω(√T) stochastic external-regret lower bound [BlumMansour2007AGT, Theorem 4.8, p. 88]: for N ≥ 2 experts (in particular N = 2) and any horizon T, under uniform fair-coin {0, 1} losses w : Fin T → Bool, every causal online algorithm H incurs expected loss T / 2 and expected external regret at least (1 / (2 e)) * √T.

theorem Cslib.MachineLearning.OnlineLearning.Experts.exists_stochastic_regret_ge_sqrt_mul_log {ι : Type u_1} [Fintype ι] (hn : 2 ≤ Fintype.card ι) {T : ℕ} (hT : Nat.log 2 (Fintype.card ι) ≤ T) :
∃ (ℓ : (Fin T → Bool) → ℕ → ι → ℝ), (∀ (w : Fin T → Bool) (t : ℕ) (i : ι), ℓ w t i = 0 ∨ ℓ w t i = 1) ∧ ∀ (H : (ℕ → ι → ℝ) → ℕ → ι → ℝ), IsOnlineAlgorithm H → 1 / (4 * Real.exp 1) * √(↑T * Real.log ↑(Fintype.card ι)) ≤ Finset.univ.expect fun (w : Fin T → Bool) => ∑ t ∈ Finset.range T, ∑ i : ι, H (ℓ w) t i * ℓ w t i - minCumLoss (ℓ w) T

General Ω(√(T log N)) stochastic external-regret lower bound [BlumMansour2007AGT, Exercise 4.5, p. 101]: for N ≥ 2 experts and ⌊log₂ N⌋ ≤ T (in particular for all T ≥ N, since ⌊log₂ N⌋ ≤ N), there exists a uniform {0, 1} loss family over Fin T → Bool under which every causal online algorithm incurs expected external regret at least (1 / (4 e)) * √(T * ln N).