Black-box external-to-swap regret reduction #
This module formalizes the generic black-box reduction from any external-regret online algorithm
(IsOnlineAlgorithm) to a swap-regret online algorithm of [BlumMansour2007AGT, §4.5, Definition
4.14, Theorem 4.15, Corollary 4.16, and Exercise 4.6, pp. 92–94, 101], reusing
swap_regret_le_sum_regret from SwapRegret.lean and Matrix.stationaryVec from
Stochastic.lean.
While SwapRegret.lean constructs the coupled Hedge instantiation (blumMansourProb) directly,
this module constructs the black-box master learner swapMasterProb A for any family
A : ι → (ℕ → ι → ℝ) → ℕ → ι → ℝ of causal online algorithms (IsOnlineAlgorithm (A j)):
- Black-box master construction (
swapMasterProb,swapMasterLoss,swapMasterMatrix,swapMasterProb_eq_stationaryVec,swapMasterProb_vecMul,isOnlineAlgorithm_swapMasterProb): by well-founded recursion on the round indext, copyjreceives the scaled lossesp s j * ℓ sfrom roundss < t, outputs rowjof a row-stochastic matrixQ t, and the master outputsp t = Matrix.stationaryVec (Q t). On[0, 1]histories,swapMasterProb Ais itself a causalIsOnlineAlgorithm. - Theorem 4.15 — Black-box external-to-swap reduction (
swapMasterProb_swap_regret_le_sum,swapMasterProb_swap_regret_le_card_mul— [BlumMansour2007AGT, §4.5, Theorem 4.15, p. 93]): if each copyA jhas external regret at mostR jon[0, 1]losses, thenswapMasterProb Ahas swap regret (modRegret Set.univ) at most∑ j, R j; in particular,Ncopies of anyR-external-regret procedure (Definition 4.14) achieve swap regret at mostN * R. - Corollary 4.16 and Exercise 4.6 via Polynomial Weights (
swapMasterMW_swap_regret_le,swapMasterMW_swap_regret_le_sqrt— [BlumMansour2007AGT, Corollary 4.16, p. 94, and Exercise 4.6, p. 101]): instantiatingswapMasterProbwith Polynomial Weights (prob (mwFactor η)) uses the second-order boundmw_regret_le_sqand∑ j, ∑ t < T, (p t j * ℓ t (δ j))^2 ≤ Tto achieve swap regretη * T + N * ln N / ηfor0 < η ≤ 1 / 2, and with the capped rateη = min √(N * ln N / T) (1 / 2)achieves2 * √(T * (N * ln N))for every horizonT : ℕand everyN ≥ 1on[0, 1]losses (removing theT ≥ N ln Nfloor ofSwapRegret.lean).
Main definitions #
Cslib.MachineLearning.OnlineLearning.Experts.swapMasterProb: black-box Blum–Mansour master distribution for arbitrary external-regret copiesA.Cslib.MachineLearning.OnlineLearning.Experts.swapMasterLoss: scaled loss sequencep t j * ℓ tfed to copyj.Cslib.MachineLearning.OnlineLearning.Experts.swapMasterMatrix: row-stochastic matrix whose rowjis copyj's distribution.
Main results #
Cslib.MachineLearning.OnlineLearning.Experts.swapMasterProb_eq_stationaryVec,Cslib.MachineLearning.OnlineLearning.Experts.swapMasterProb_vecMul,Cslib.MachineLearning.OnlineLearning.Experts.isOnlineAlgorithm_swapMasterProb: well-definedness, stationarity, and causality ofswapMasterProb A.Cslib.MachineLearning.OnlineLearning.Experts.swapMasterProb_swap_regret_le_sum,Cslib.MachineLearning.OnlineLearning.Experts.swapMasterProb_swap_regret_le_card_mul: [BlumMansour2007AGT, Theorem 4.15].Cslib.MachineLearning.OnlineLearning.Experts.swapMasterMW_swap_regret_le,Cslib.MachineLearning.OnlineLearning.Experts.swapMasterMW_swap_regret_le_sqrt: [BlumMansour2007AGT, Corollary 4.16 and Exercise 4.6] via Polynomial Weights for every horizonT : ℕ.
References #
Black-box Blum–Mansour master learner #
Black-box Blum–Mansour master learner [BlumMansour2007AGT, §4.5, pp. 92–93]: combines any
family A : ι → (ℕ → ι → ℝ) → ℕ → ι → ℝ of external-regret copies into a single master
distribution sequence via stationary vectors p^t = p^t Q^t.
The scaled loss sequence p^t_j * ℓ^t fed to copy j in swapMasterProb.
Row-stochastic matrix Q^t whose row j is copy j's distribution on swapMasterLoss.
On [0, 1] histories, swapMasterMatrix A ℓ t is row-stochastic.
On [0, 1] histories, swapMasterProb A ℓ t equals stationaryVec (swapMasterMatrix A ℓ t).
On [0, 1] histories, swapMasterProb A ℓ t is stationary for swapMasterMatrix A ℓ t.
On [0, 1] histories, the scaled losses swapMasterLoss A ℓ j s i remain in [0, 1].
Causality of swapMasterProb: combining any family of causal online algorithms produces
a causal online algorithm (IsOnlineAlgorithm).
Theorem 4.15: Black-box external-to-swap regret reduction #
Black-box Blum–Mansour reduction (per-copy form) [BlumMansour2007AGT, §4.5, Theorem 4.15,
p. 93]: if each copy A j is a causal online algorithm achieving external regret at most R j on
its realized [0, 1] scaled losses swapMasterLoss A ℓ j, then swapMasterProb A has swap regret
at most ∑ j, R j.
Theorem 4.15 (uniform black-box external-to-swap reduction) [BlumMansour2007AGT, §4.5,
Definition 4.14 and Theorem 4.15, p. 93]: given any causal online algorithm H achieving
external regret at most R over T rounds on all [0, 1] loss sequences, running N copies of
H inside swapMasterProb (fun _ => H) yields a causal online algorithm with swap regret at most
N * R.
Corollary 4.16 and Exercise 4.6 via Polynomial Weights #
Polynomial Weights instantiation of Theorem 4.15 / Exercise 4.6 [BlumMansour2007AGT, §4.5,
p. 94, and Exercise 4.6, p. 101]: running N Polynomial Weights copies (prob (mwFactor η),
0 < η ≤ 1 / 2) inside swapMasterProb achieves swap regret at most η * T + N * ln N / η on
every [0, 1]-valued loss sequence (using ∑ j, ∑ t < T, (p t j * ℓ t (δ j)) ^ 2 ≤ T).
All-horizon 2 √(T N ln N) swap regret via Polynomial Weights [BlumMansour2007AGT,
Corollary 4.16, p. 94, and Exercise 4.6, p. 101]: for every nonempty finite action space of size
N, every horizon T : ℕ (no T ≥ N ln N floor), and every [0, 1]-valued loss sequence ℓ,
running swapMasterProb with capped Polynomial Weights rate η = min √(N * ln N / T) (1 / 2)
achieves swap regret at most 2 * √(T * (N * ln N)).