diff --git a/LMLRoadmaps/Bandits/README.md b/LMLRoadmaps/Bandits/README.md index 3b139ac..596739a 100644 --- a/LMLRoadmaps/Bandits/README.md +++ b/LMLRoadmaps/Bandits/README.md @@ -2,11 +2,12 @@ Develop the regret theory of multi-armed and linear bandits: stochastic bandits with finitely many arms, their minimax and instance-dependent lower bounds, adversarial bandits with finitely -many arms and with expert advice, online linear and convex optimization, and stochastic and -adversarial linear bandits. The headline results are the regret bounds of MOSS, asymptotically -optimal UCB, KL-UCB and Thompson sampling for exponential families, Exp3, Exp3-IX and Exp4 against -adaptive adversaries, OFUL, phased elimination with G-optimal designs, and mirror descent with -bandit feedback, matched by the minimax lower bounds and the Lai–Robbins lower bound. +many arms and with expert advice, the online linear and convex optimization that bandit +algorithms use, and stochastic and adversarial linear bandits. The headline results are the regret +bounds of MOSS, asymptotically optimal UCB, KL-UCB and Thompson sampling for exponential families, +Exp3, Exp3-IX and Exp4 against adaptive adversaries, Tsallis-INF in the adversarial and stochastic +regimes, OFUL, phased elimination with G-optimal designs, and mirror descent with bandit feedback, +matched by the minimax lower bounds and the Lai–Robbins lower bound. Build the surrounding library at the generality the proofs support: index policies and weight-based randomized policies, Ville's inequality and time-uniform concentration, the binary @@ -30,9 +31,9 @@ theorem). This roadmap owns regret minimization for: stochastic bandits with a finite set of arms; adversarial bandits with a finite set of arms against adaptive adversaries, oblivious reward tables -included, and bandits with expert advice; online linear and convex optimization with full -information; stochastic linear bandits with possibly changing decision sets; and adversarial linear -bandits with finite action sets or the Euclidean unit ball. +included, and bandits with expert advice; the online linear and convex optimization of Layer 6, +which the bandit algorithms use; stochastic linear bandits with possibly changing decision sets; and +adversarial linear bandits with finite action sets or the Euclidean unit ball. | Material | Owner and interface consumed here | | --- | --- | @@ -51,17 +52,20 @@ bandits with finite action sets or the Euclidean unit ball. | Positive operators, Loewner order, matrix determinant lemma, Woodbury identity | Mathlib `Analysis/InnerProductSpace/Positive.lean`, `LinearAlgebra/Matrix/SchurComplement.lean`, `LinearAlgebra/Matrix/NonsingularInverse.lean` | | Moore–Penrose inverse | Tau Ceti `Analysis/InnerProductSpace/MoorePenrose.lean` | | Finitely supported probability measures | Mathlib `Geometry/Convex/ConvexSpace/Defs.lean` (`Convexity.StdSimplex`) | +| The local-norm bound through the unconstrained step, for FTRL with time-varying regularizers | OnlineLearning roadmap, Layer 6.1 | Build missing material in this roadmap where it is listed as a target, and consume existing implementations directly. Outside this roadmap: pure exploration and best-arm identification (LML's `IdentAlg` framework), sparse linear bandits, combinatorial and semi-bandits, non-stationary bandits, ranking, partial -monitoring, Markov decision processes, Bayesian-optimal policies and Gittins indices, Bayesian regret -beyond what LML proves, high-probability lower bounds, asymptotic lower bounds for linear bandits, -and bandit convex optimization (convex losses with bandit feedback). AdaHedge and its regret bounds -belong to the Identification roadmap (Layer 6.1). Scalar Bernstein, McDiarmid and matrix -concentration inequalities belong to Tau Ceti's `RandomMatrices` roadmap; nothing here needs them. +monitoring, Markov decision processes, Bayesian-optimal policies and Gittins indices, Bayesian +regret beyond what LML proves, high-probability lower bounds, asymptotic lower bounds for linear +bandits, and bandit convex optimization (convex losses with bandit feedback). Online learning with +full information beyond Layer 6 belongs to the [OnlineLearning](../OnlineLearning/README.md) +roadmap, which builds on Layer 6. AdaHedge and its regret bounds belong to the Identification +roadmap (Layer 6.1). Scalar Bernstein, McDiarmid and matrix concentration inequalities belong to Tau +Ceti's `RandomMatrices` roadmap; nothing here needs them. ## Conventions @@ -178,7 +182,7 @@ dependency sync that brings the rename updates this roadmap and the code togethe | 4 | Lower bounds for finitely many arms | Layer 0; LML divergence decomposition; Layers 2–3 for item 5 | | 5 | Thompson sampling | Layers 0–1; Identification roadmap Layer 1.2; Layer 4 for asymptotic optimality | | 6 | Convex analysis, online linear and convex optimization | Layer 0 | -| 7 | Adversarial bandits with finitely many arms and expert advice | Layers 0, 6; Layer 4.5 for the lower bound | +| 7 | Adversarial bandits with finitely many arms and expert advice | Layers 0, 6; Layer 4.5 for the lower bound; OnlineLearning roadmap Layer 6.1 for item 5 | | 8 | Least squares, self-normalized bounds, optimal design | Layer 1 | | 9 | Stochastic linear bandits | Layers 0, 8; Layer 4 tools for lower bounds | | 10 | Adversarial linear bandits | Layers 6–8 | @@ -596,14 +600,35 @@ $\gamma_t\ge0$ are nonincreasing sequences (Conventions). $\eta_t=2\gamma_t=\sqrt{2\log(M)/(nk)}$, $\hat R^E_n\le2\sqrt{2nk\log M}+\big(\sqrt{2nk/\log M}+1\big)\log(2/\delta)$ with probability at least $1-\delta$. +5. **Tsallis-INF and best of both worlds** [Ora, §9.1.2, Theorem 9.2, §9.3, Algorithm 9.6, + Theorem 9.17; ZS21]. Work with the losses $1-Y_t$, translated once as in the Conventions, and + with the estimates $\hat Y_t$ of item 1 with $\gamma=0$. + - Define Tsallis-INF: the weight-based policy (Layer 0.3) whose weights at round $t$ minimize + $\langle\sum_{s0}(1+\log n)/\Delta_a$. Against `stationaryEnv ν` with + rewards in $[0,1]$ and a unique optimal arm the constraint holds with equality, so this bounds + the expected stochastic regret. + - The mirror-descent form with the $\frac12$-Tsallis potential and a constant rate $\eta$ + [Ora, Theorem 9.2]: $\bar R_n\le2\sqrt k/\eta+\eta\sqrt k\,n$. Generalization: adaptive adversaries, expert advice that depends on the history, anytime learning rates and a single algorithm for Exp3, Exp3-IX and Exp4, where [LS] fixes an oblivious table, a -known horizon and three algorithms. Completion checks: for $k=1$ every bound is $0$; the lower bound -of Layer 4.5 shows the order $\sqrt{nk}$ of item 3 is attained up to $\sqrt{\log k}$; with a single -expert the expert pseudo-regret of Exp4 is nonpositive; against `stationaryEnv ν` with rewards in -$[0,1]$, item 3 bounds the expected stochastic regret of Exp3 with anytime rates by -$2\sqrt{nk\log k}$. +known horizon and three algorithms; and, for Tsallis-INF, adaptive adversaries and the self-bounding +regime, where [Ora] fixes an oblivious table and independent losses. Completion checks: for $k=1$ +every bound is $0$; the lower bound of Layer 4.5 shows the order $\sqrt{nk}$ of item 3 is attained +up to $\sqrt{\log k}$; with a single expert the expert pseudo-regret of Exp4 is nonpositive; against +`stationaryEnv ν` with rewards in $[0,1]$, item 3 bounds the expected stochastic regret of Exp3 with +anytime rates by $2\sqrt{nk\log k}$. ## Layer 8: Least squares, self-normalized bounds and optimal design @@ -768,6 +793,8 @@ T. L. Lai and H. Robbins, *Asymptotically efficient adaptive allocation rules* ( beyond*, COLT 2011. - [KKM13] N. Korda, E. Kaufmann and R. Munos, *Thompson sampling for 1-dimensional exponential family bandits*, NeurIPS 2013. +- [ZS21] J. Zimmert and Y. Seldin, *Tsallis-INF: an optimal algorithm for stochastic and + adversarial bandits*, JMLR 22 (2021) (Layer 7.5). - [Neu15] G. Neu, *Explore no more: improved high-probability regret bounds for non-stochastic bandits*, NeurIPS 2015. - [Ora] F. Orabona, *Online learning: a modern introduction using convex optimization*, diff --git a/LMLRoadmaps/Generalization/README.md b/LMLRoadmaps/Generalization/README.md index 6be68bf..ac5841f 100644 --- a/LMLRoadmaps/Generalization/README.md +++ b/LMLRoadmaps/Generalization/README.md @@ -1,7 +1,8 @@ # Roadmap: Refactors toward the generality of the literature This roadmap restates material that LMLExplore already contains, in the generality that the -[Identification](../Identification/README.md), [Bandits](../Bandits/README.md) and +[Identification](../Identification/README.md), [Bandits](../Bandits/README.md), +[OnlineLearning](../OnlineLearning/README.md) and [ReinforcementLearning](../ReinforcementLearning/README.md) roadmaps specify. Those roadmaps ask for the forms of the literature: tasks on arbitrary models, stopping-time tools for every environment, thresholds that read the history, one algorithm where the literature has one, @@ -34,10 +35,11 @@ In scope: - declarations of LMLExplore that Tau Ceti provides at the pinned version (Layer 2). LMLExplore's scan for overlaps covers Mathlib only. -**Relation to the other roadmaps.** The Identification, Bandits and ReinforcementLearning roadmaps -specify the mathematics, and each target here points to the item that specifies its general form. -This roadmap restates merged code in that generality and adds no item of those roadmaps. Where a -target needs a general statement that is not merged, it lists that item as a prerequisite. +**Relation to the other roadmaps.** The Identification, Bandits, OnlineLearning and +ReinforcementLearning roadmaps specify the mathematics, and each target here points to the item that +specifies its general form. This roadmap restates merged code in that generality and adds no item of +those roadmaps. Where a target needs a general statement that is not merged, it lists that item as a +prerequisite. **Restatements that the other roadmaps own.** Some items of the other roadmaps specify a general statement that LMLExplore does not have yet, and say which merged declarations become its @@ -58,6 +60,11 @@ targets here: - Bandits 3.1–3.4: `klucb` and `ucbF` as instances of KL-UCB for exponential families; Bandits 5.1: `gaussianTS` as an instance of Thompson sampling for exponential families; Bandits 8.3: `ridgeEstimate` as the case `λ > 0` of least squares with the Moore–Penrose inverse; +- OnlineLearning 0.3: `sum_apply_sub_le_ftrl` as the case of linear losses of the FTRL equality; + OnlineLearning 5.2: `ftrl_regret_le_of_strongConvexOn_of_antitone` and + `ftrl_regret_le_of_strongConvexOn` without their derivative hypothesis; OnlineLearning 10.1: + `mixLoss` and `hedgePotential` as the finite case of Gibbs mixtures, after target 1.13 has stated + them once in `OnlineLearning/ExponentialWeights.lean`; - ReinforcementLearning 8.2 and 8.4: backward induction, and `EpisodicMDP.value_le_optValue` from it. diff --git a/LMLRoadmaps/OnlineLearning/README.md b/LMLRoadmaps/OnlineLearning/README.md new file mode 100644 index 0000000..d3b8f30 --- /dev/null +++ b/LMLRoadmaps/OnlineLearning/README.md @@ -0,0 +1,1125 @@ +# Roadmap: Online learning through convex optimization + +Develop the theory of online learning with full information: regret minimization against +arbitrary, adaptively chosen sequences of losses, in the generality of convex analysis, following +F. Orabona, *Online Learning: A Modern Introduction Using Convex Optimization* [Ora]. The headline +results are: +- adaptive and AdaGrad-type rates, $L^\star$ bounds and logarithmic regret for strongly convex and + exp-concave losses (the Online Newton Step, the Vovk–Azoury–Warmuth forecaster); +- online-to-batch conversions, in expectation and with high probability; +- the minimax lower bounds of online linear optimization, bounded and unconstrained; +- optimistic mirror descent and optimistic FTRL, with delayed feedback and gradual variations; +- the Perceptron and the Gaptron; +- the Aggregating Algorithm for mixable losses and Cover's universal portfolio; +- black-box reductions, and parameter-free algorithms through coin betting (Krichevsky–Trofimov); +- dynamic, strongly adaptive and tracking regret; +- no-regret dynamics for saddle points, with fast rates through optimism; +- online-learning proofs of statistical results: Rademacher complexity bounds, PAC-Bayes bounds, + non-convex optimization, and time-uniform confidence sequences by betting. + +Build the surrounding library at the generality the proofs support: +- online learners as composable objects, and regret notions; +- the FTRL equality for arbitrary losses on arbitrary sets, and a stability lemma that needs no + derivative of the regularizer; +- strong convexity and smoothness through subgradients and conjugates; +- the distance to a convex set, $p$-norm potentials, exp-concavity and mixability; +- Gibbs mixtures over arbitrary priors; +- the coin-betting game, the Lambert function and the Gamma-function inequalities that the + regret bounds use. + +`README.md` is the definitive specification; `Suggested.lean` records selected interfaces and is +not an exhaustive checklist. + +Suggested homes: `LMLExplore/OnlineLearning/` (namespace `LMLExplore.OnlineLearning`) for online +learning, and the mathematical home of each general tool: +- `LMLExplore/Analysis/Convex/` for strong convexity, smoothness, conjugates, distance functions, + $p$-norm potentials and exp-concavity; +- `LMLExplore/Analysis/SpecialFunctions/` for the Lambert function and the Gamma-function + inequalities; +- `LMLExplore/Probability/Martingale/` for betting martingales and the conditional Hoeffding lemma; +- `LMLExplore/Optimization/` for saddle points and stochastic optimization. + +## Scope and dependencies + +This roadmap owns regret minimization with full information against arbitrary loss sequences: +online linear and convex optimization, prediction with expert advice, online classification and +regression, portfolio selection and coin betting. It also owns their applications to stochastic +optimization, saddle-point problems and the statistical results of Layer 16. + +**Relation to the Bandits roadmap.** The [Bandits](../Bandits/README.md) roadmap's Layer 6 +specifies the core that its bandit algorithms use, and this roadmap cites it by item number and does +not restate it: +- Legendre functions (6.1) and Bregman projections (6.2); +- follow-the-regularized-leader and mirror descent with time-varying regularizers, nonincreasing + learning rates and the first local-norm bound (6.3); +- exponential weights on a finite set, with its anytime local-norm bound (6.4); +- estimated losses (6.5); +- online convex optimization through subgradients, and projected online subgradient descent + (6.6). + +The rest of [Ora]'s full-information material is specified here, except what the list below +excludes. In particular, the items of Layers 5–7 extend Bandits 6.3 with statements it does not +contain. + +| Material | Owner and interface consumed here | +| --- | --- | +| FTRL, mirror descent, exponential weights, linearization, projected OSD | Bandits roadmap, Layer 6; LMLExplore `OnlineLearning/` | +| Binary relative entropy `klBer` and Pinsker for Bernoulli laws; Bernoulli laws are $\tfrac14$-sub-Gaussian | Bandits roadmap, Layers 0.1–0.2 | +| Ville's inequality | Bandits roadmap, Layer 1.1; LMLExplore `MeasureTheory.Supermartingale.measure_exists_le_le` | +| Bounded variables are conditionally dominated by Bernoulli laws | Bandits roadmap, Layer 1.4 | +| Design operators $V_0+\sum_{s0$) that is lower semicontinuous on a nonempty closed convex set $V$ has exactly one + minimizer on $V$. The FTRL and mirror-descent steps of strongly convex objectives therefore + exist on unbounded closed convex sets, where `exists_ftrl` needs compactness. +2. **Subgradients and Lipschitz functions** [Ora, Theorems 2.21, 2.30, 4.21, Lemma 4.20]. + - Convexity from subgradients: if every point of a convex set $V$ has a subgradient within $V$, + then $f$ is convex on $V$. + - Lipschitz functions: on an open convex set $U$, if $f$ is $L$-Lipschitz on $U$ then every + subgradient within $U$ at a point of $U$ has norm at most $L$; conversely, if every point of + $U$ has a subgradient of norm at most $L$, then $f$ is $L$-Lipschitz on $U$. + - In finite dimension, a convex function has a subgradient at every interior point of its + domain (Tau Ceti `nonempty_subdifferential_of_mem_interior`, transferred to subgradients + within a set). + - Dual norms: $\sup_{\|x\|=r}y(x)=r\|y\|$ for $r\ge0$, attained in finite dimension. +3. **Smoothness and self-bounded functions** [Ora, Definitions 4.22 and 4.26, Lemma 4.24, + Theorem 4.25, Remark 4.27]. A function is $s$-smooth on a convex set $V$ if it is + differentiable on an open set containing $V$ and its derivative is $s$-Lipschitz on $V$ for the + dual norm. + - The descent lemma: for $s$-smooth $f$ and $x,y\in V$, + $|f(y)-f(x)-f'(x)(y-x)|\le\frac s2\|y-x\|^2$. ReinforcementLearning 5.2 uses it on inner + product spaces. + - If $f$ is $s$-smooth on `E` and bounded below, then $\|f'(x)\|^2\le2s(f(x)-\inf f)$. + - Define $s$-self-bounded functions within $V$: bounded below, with + $\|g\|^2\le2s(f(x)-\inf f)$ for every subgradient $g$ within $V$ at a point $x\in V$. + - A convex $s$-smooth function on `E` is $s$-self-bounded. + - A self-bounded function on a convex set is convex. +4. **Conjugates of norms and the duality of strong convexity and smoothness** [Ora, Example 6.19, + Lemma 6.22, Theorem 6.26]. On Tau Ceti's `fenchelConjugate` for the pairing of `E` and its + dual: + - the conjugate of $\frac s2\|\cdot\|^2$ is $\frac1{2s}\|\cdot\|^2$ on the dual; + - the conjugates of $af(\cdot)+b$, of $f(\cdot-x_0)$ and of $f+y_0$; + - for `E` finite-dimensional and $f$ proper, lower semicontinuous and $m$-strongly convex + ($m>0$) on its domain: the conjugate is differentiable on the dual, its derivative at $y$ is + the unique maximizer of $y(x)-f(x)$ (through the canonical isomorphism of `E` with its + bidual), and it is $\frac1m$-smooth; + - conversely, a proper lower semicontinuous convex function whose conjugate is + $\frac1m$-smooth is $m$-strongly convex on the domain of its subdifferential. +5. **Distance to a convex set** [Ora, Definition 12.1, Lemma 12.2, Example 12.3]. For a convex + set $V$, the function $x\mapsto$ `Metric.infDist x V`: + - is convex and $1$-Lipschitz, so its subgradients have norm at most $1$; + - vanishes exactly on the closure of $V$; + - for $x$ outside a closed $V$ with a nearest point $p$ (which exists in finite dimension), has + a subgradient $q$ at $x$ with $q(x-p)=\|x-p\|$. + + Prove that a continuous convex function on `E` has a subgradient at every point (Hahn–Banach). +6. **$p$-norm potentials** [Ora, Lemma 6.35, §6.7]. On `PiLp p (fun _ : α ↦ ℝ)` with `[Fintype α]` + and $10$. + - For $a,b,c,x\ge0$ with $x-\sqrt{ax+b}\le c$: $x\le a+c+\sqrt{b+ac}$. + - For $|x|\le\frac12$: $\log(1+x)\ge x-x^2$. For $-10$ (Layer 1.1 gives it for losses that + are $\mu_t$-strongly convex on $V$). + - Prove that the rates $\eta_t=1/\sum_{s\le t}\mu_s$ give + $\sum_{t0$, the losses + $\ell_t=\alpha_tf(\cdot,\xi_t)$ satisfy, for every $\mathcal F_0$-measurable $u$ in $V$: + $$\mathbb E\Big[F\Big(\frac{\sum_{t0$ and + $n\ge1$, there are losses with $\|y_t\|\le L$ and $u\in\{v,w\}$ with + $\sum_{t0$, coins $c_t\in[-1,1]$, bets $x_t\in\mathbb R$, + wealth $W_t=\varepsilon+\sum_{s0$ and $U>0$ with + $1\le W\big(\sqrt{en}\,UL/(8\varepsilon_n)\big)\le\sqrt n/2$. For every learner on $\mathbb R$ + whose regret against $0$ is at most $\varepsilon_n$ on all $L$-Lipschitz linear losses, there + are losses with $|g_t|\le L$ and $|u|=U$ with + $\sum_tg_t(x_t-u)\ge UL\sqrt n\big(\sqrt{2W(\sqrt n\,UL/(5\varepsilon_n))}-1\big)-2UL+\varepsilon_n$. + - Deduce the $\sqrt{n\log n}$ asymptotics for $\varepsilon_n$ bounded away from $0$ and $\infty$. + +## Layer 5: FTRL for convex losses + +Plays $x_t$ minimize $F_t=\psi_t+\sum_{s0$ for the second form): + $$F_t(x_t)+\ell_t(x_t)-F_{t+1}(z)\le g_t(x_t-z)-\tfrac{\lambda_t}2\|x_t-z\|^2+\psi_t(z)-\psi_{t+1}(z)\le\frac{\|g_t\|^2}{2\lambda_t}+\psi_t(z)-\psi_{t+1}(z).$$ + - No derivative of $\psi_t$ is needed, and only $F_t+\ell_t$ must be strongly convex. + - Prove the form with a nonnegative divergence $D_t(z)$ in place of + $\frac{\lambda_t}2\|x_t-z\|^2$ (relative strong convexity), and its quadratic case in an inner + product space: $D_t(z)=\frac12\langle S_t(z-x_t),z-x_t\rangle$ for a positive definite operator + $S_t$, with the bound $\frac12\langle g_t,S_t^{-1}g_t\rangle$. + - Proximal regularizers: if $x_t$ minimizes $\psi_{t+1}-\psi_t$ on $V$ and $F_{t+1}$ is + $\lambda_{t+1}$-strongly convex on $V$, then + $F_t(x_t)+\ell_t(x_t)-F_{t+1}(x_{t+1})\le\frac{\|g_t\|^2}{2\lambda_{t+1}}+\psi_t(x_t)-\psi_{t+1}(x_t)$. +2. **The FTRL bound for convex losses** [Ora, Corollary 7.6, Example 7.9]. + - Sum item 1 with Layer 0.3: for every $u\in V$, + $\sum_{t0$, the increments are + $\big(\frac1{\eta_t}-\frac1{\eta_{t+1}}\big)F(x_{t+1})$. Keep them: Layer 13.5 needs them. + - Derive `ftrl_regret_le_of_strongConvexOn_of_antitone` and `ftrl_regret_le_of_strongConvexOn` + with the derivative hypothesis `hF'` removed, migrating their uses. + - FTRL-Proximal, in an inner product space: $\psi_t(x)=\sum_{s0$. + [Ora]'s constant for the tuned rate does not follow from the stated rate; this item states the + corrected form. +4. **Multi-scale experts** [Ora, §6.9, Algorithm 6.4, Theorem 6.36]. + - Define mirror descent on `simplex α` with the weighted negative entropy + $\sum_a\frac{c_a}\eta x_a\log x_a$ and the shifted losses + $\tilde y_{t,a}=y_{t,a}+\eta y_{t,a}^2/c_a$. + - For $|y_{t,a}|\le c_a$ and $\eta\le\frac15$, prove + $\sum_{t0\}$, and + the bounded squared loss. + - The quadratic lower bound: if $f$ is $\alpha$-exp-concave on $V$, $g$ is a subgradient within + $V$ at $x$ and $|g(y-x)|\le B$ for $y\in V$, then + $f(y)\ge f(x)+g(y-x)+\frac\beta2g(y-x)^2$ with $\beta=\frac12\min(\alpha,1/B)$. +2. **The log-determinant potential** [Ora, Lemma 7.29]. For $V_0$ positive definite, $\mu>0$ and + $S_t$ the design operator of the vectors $\sqrt\mu\,g_s$, $s\le t$ (current vector included), + prove $\sum_{t0$. + - The real digamma function $\psi=(\log\Gamma)'$: it is increasing and concave, with + $\log x-\frac1x\le\psi(x)\le\log x-\frac1{2x}$; the series of $\psi'$; Batir's bound + (Proposition A.10). + - $\Gamma(n+\frac d2)/\Gamma(n+\frac12)\le(n+\frac{d-1}2)^{(d-1)/2}$ for integers $n\ge1$, $d\ge2$ + (Lemma A.11), and Lemma A.12. + - The vertex lemma A.13: $\prod_ia_i^{a_i}/\Gamma(a_i+\frac12)$ is maximized over + $\{a\ge0,\sum_ia_i=n\}$ at a vertex, by convexity of $x\log x-\log\Gamma(x+\frac12)$. + - Prove the cases $d=2$ of Lemma A.12 and of the vertex lemma from Mathlib's log-convexity and + Bohr–Mollerup sequence; Layers 13.2 and 16.4 use them. +4. **The regret of the universal portfolio** [Ora, Theorem 10.1, Definition 10.2, Lemma 10.3, + Theorem 10.4]. + - Method of types: for a sequence in $\alpha^n$ of type $N$, $\prod_tu_{j_t}\le\prod_a(N_a/n)^{N_a}$ + for every $u$ in the simplex, and the number of sequences of a type. + - Dirichlet moments: from Tau Ceti's `integral_prod_pow_dirichletMeasure`, transported from + `EuclideanSpace` to `simplex α`. + - With the Dirichlet$(\frac12,\dots,\frac12)$ prior, $k=$ `Fintype.card α`: + $\text{regret}_n\le\log\frac{\sqrt\pi\,\Gamma(n+\frac k2)}{\Gamma(\frac k2)\Gamma(n+\frac12)}\le\frac{k-1}2\log\big(\frac n{(k-1)/2}+1\big)+\frac k2-1+\frac12\log\frac\pi2$. + - With the uniform prior: $\text{regret}_n\le\log\binom{n+k-1}{k-1}\le(k-1)\big(\log(\frac n{k-1}+1)+1\big)$. +5. **The Online Newton Step for portfolios** [Ora, §10.4, Algorithm 10.2]: a corollary of Layer 8.3 + with the exp-concavity of Layer 8.1. + +## Layer 12: Black-box reductions + +State each reduction for sequences, then for learners (Layer 0.2). Work in a normed space with +losses in the dual. + +1. **Constraints through projections** [Ora, Algorithm 12.1, Theorem 12.5, Remark 12.6, + Example 12.9]. + - An inner learner plays $z_t$ in a superset $W\supseteq V$. The outer play is a nearest point + $x_t$ of $V$ to $z_t$, and the inner learner receives a surrogate loss. + - The four surrogates of Theorem 12.5 are built from $\|y_t\|\,d(\cdot,V)$ and a subgradient + $q_t$ of $d(\cdot,V)$ at $z_t$ (Layer 1.5), with the indicator variants. + - For each, prove $y_t(x_t-u)\le\tilde\ell_t(z_t)-\tilde\ell_t(u)$ for $u\in V$, and the bound + $\|\tilde y_t\|\le2\|y_t\|$ on the surrogate's subgradients. For the third and fourth + surrogates in an inner product space, $\|\tilde y_t\|\le\|y_t\|$ (Remark 12.6). + - Example 12.9: clipping a one-dimensional learner to $[0,\infty)$, with the surrogate + $\min(g_t,0)$ when $z_t<0$. +2. **Constraints through Bregman projections** [Ora, Theorem 12.11]: the same reduction with the + Bregman projection of Bandits 6.2. +3. **Sleeping experts** [Ora, Algorithm 12.2, Theorem 12.13, (12.1), Remark 12.14]. + - Experts form a type $\iota$, possibly countable. Activity weights $a_{t,i}\in[0,1]$ are revealed + before the play, with finitely many nonzero and at least one positive per round. The sleeping + regret against $u\ge0$ is $\sum_t\sum_iu_ia_{t,i}(\langle y_t,x_t\rangle-y_{t,i})$. + - An inner learner plays $z_t\ge0$. The outer play is $x_{t,i}\propto a_{t,i}z_{t,i}$ (any + distribution on the active experts if the sum is $0$), and the inner learner receives + $\tilde y_{t,i}=a_{t,i}(y_{t,i}-\langle y_t,x_t\rangle)$. + - Prove $\langle\tilde y_t,z_t\rangle=0$, so the sleeping regret against $u$ is the inner + linear regret against $u$, and the range bound on $\tilde y_t$. + - The normalization to the simplex (12.1) is the case $a=1$. +4. **Magnitude and direction** [Ora, Algorithm 12.3, Theorems 12.16 and 14.5]. + - A one-dimensional learner plays $z_t$, a learner on the unit ball plays $\tilde x_t$, and the + outer play is $x_t=z_t\tilde x_t$. They receive $s_t=y_t(\tilde x_t)$ and $y_t$, and + $|s_t|\le\|y_t\|$. + - Prove, for every $U>0$ and comparators $u_t$ with $\|u_t\|\le U$, the per-round identity + $y_t(z_t\tilde x_t-u_t)=(z_t-U)s_t+U\,y_t(\tilde x_t-u_t/U)$. + - Hence the dynamic regret is at most the one-dimensional regret against $U$ plus $U$ times the + dynamic regret of the ball learner. + - The static case $u_t=u$, $U=\|u\|$ is Theorem 12.16, and $u=0$ is the one-dimensional regret + against $0$. + +## Layer 13: Parameter-free learning through coin betting + +1. **Regret–reward duality** [Ora, Theorem 13.5, Lemma 13.6]. + - On Tau Ceti's `fenchelConjugate`: for every $\phi$ on the dual, if + $-\sum_{t0$, the conjugate of + $\theta\mapsto\beta e^{\theta^2/(2\alpha)}$ is at most + $|u|\sqrt{\alpha\log(1+\alpha u^2/\beta^2)}-\beta$. Prove it without the Lambert function, + from the concavity of $x|u|-\beta e^{x^2/(2\alpha)}$ and $(1+s)\log(1+s)\ge s$. +2. **The Krichevsky–Trofimov bettor** [Ora, Algorithms 13.1–13.2, Theorems 13.2 and 13.4, + Problems 13.1 and 13.4, §13.2.1]. + - The bettor plays the fraction $\beta_t=\sum_{s0$. + - The prediction $p_t$ weights $\pi$ by the positive parts of the bets. For every probability + $Q\ll\pi$ and every concave nondecreasing $h$ with $x\le h(f_n(x))$, prove + $\sum_{t0$. Optimistic FTRL (Layer 7.2) for both + players, with the last gradients as hints, gives + $\text{gap}(\bar x_n,\bar y_n)\le\frac1n\big(\psi_X(x')-\psi_X(x_0)+\psi_Y(y')-\psi_Y(y_0)+\frac{\|g_{X,0}\|^2}{\lambda_X}+\frac{\|g_{Y,0}\|^2}{\lambda_Y}\big)$. + - The optimistic mirror-descent version (Layer 7.1) has $\lambda_XD_{\psi_X}(x',x_0)+\lambda_YD_{\psi_Y}(y',y_0)$ + in place of the regularizer differences. [Ora] drops the factors $\lambda_X,\lambda_Y$. + - Prove Luo's bound (15.11) on the sum of the squared movements. + - Bilinear games have $L_{XX}=L_{YY}=0$ and $L_{XY}=\|A\|$ for the chosen norms. +6. **Algorithms that see the current loss** [Ora, Theorems 15.30 and 15.31, Remark 15.32]. + - Implicit mirror descent plays $x_{t+1}$ minimizing $\eta_t\ell_t(x)+D_F(x,x_t)$. For convex + losses, with no subgradient assumption and nonincreasing rates, prove + $\sum_{t Fin.elim0 + | t + 1 => Fin.snoc (α := fun _ ↦ G) (closedLoopHist A c φ t) + (φ t (A.play t (fun s ↦ (c s, closedLoopHist A c φ t s)) (c t))) + +/-- The feedback sequence of the closed-loop run. -/ +def closedLoopFeedback (A : OnlineLearner C G X) (c : ℕ → C) (φ : ℕ → X → G) (t : ℕ) : G := + closedLoopHist A c φ (t + 1) (Fin.last t) + +/-- The learner restarted at round `s`: from round `s` on, it plays as `A` on the shifted history; +before, it plays as `A` at its first round. -/ +def restart (A : OnlineLearner C G X) (s : ℕ) : OnlineLearner C G X where + play t h c := + if hst : s ≤ t then A.play (t - s) (fun i ↦ h ⟨s + i, by omega⟩) c else A.play 0 Fin.elim0 c + +end OnlineLearner + +/-- A regret guarantee for a learner of online linear optimization: every run whose feedback is +admissible has linear regret at most `B n c y u` against every comparator `u ∈ U`. -/ +def HasRegretBound {C E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + (A : OnlineLearner C (E →L[ℝ] ℝ) E) (adm : C → (E →L[ℝ] ℝ) → Prop) (U : Set E) + (B : ℕ → (ℕ → C) → (ℕ → E →L[ℝ] ℝ) → E → ℝ) : Prop := + ∀ (c : ℕ → C) (y : ℕ → E →L[ℝ] ℝ) (n : ℕ), (∀ t < n, adm (c t) (y t)) → + ∀ u ∈ U, ∑ t ∈ range n, y t (A.run c y t - u) ≤ B n c y u + +/-- **The FTRL equality** [Ora, Lemma 7.1], for arbitrary losses, regularizers and points on an +arbitrary type. No convexity and no minimality is used. -/ +theorem regret_eq_ftrl (ψ ℓ : ℕ → α → ℝ) (x : ℕ → α) (u : α) (n : ℕ) : + regret ℓ x u n = ψ n u - ψ 0 (x 0) + + ∑ t ∈ range n, ((ψ t (x t) + ∑ s ∈ range t, ℓ s (x t)) - + (ψ (t + 1) (x (t + 1)) + ∑ s ∈ range (t + 1), ℓ s (x (t + 1))) + ℓ t (x t)) + + ((ψ n (x n) + ∑ s ∈ range n, ℓ s (x n)) - (ψ n u + ∑ s ∈ range n, ℓ s u)) := + sorry + +/-- **Be-the-leader** [Ora, Lemma 1.2]: playing at each round the leader including the current +loss has nonpositive regret. -/ +theorem sum_le_of_isMinOn_sum (ℓ : ℕ → α → ℝ) (x : ℕ → α) + (hx : ∀ t, IsMinOn (fun a ↦ ∑ s ∈ range (t + 1), ℓ s a) Set.univ (x (t + 1))) (u : α) + (n : ℕ) : + ∑ t ∈ range n, ℓ t (x (t + 1)) ≤ ∑ t ∈ range n, ℓ t u := + sorry + +/-! ## Layer 1: convex analysis for online learning -/ + +section Convex + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- **Strong convexity gives a quadratic minorant** at every subgradient within the set +[Ora, Lemma 4.2]. -/ +theorem StrongConvexOn.add_apply_sub_add_le {V : Set E} {m : ℝ} {f : E → ℝ} + (hf : StrongConvexOn V m f) {g : E →L[ℝ] ℝ} {x y : E} + (hg : HasSubgradientWithinAt f g V y) (hy : y ∈ V) (hx : x ∈ V) : + f y + g (x - y) + m / 2 * ‖x - y‖ ^ 2 ≤ f x := + sorry + +/-- **Minimizers of strongly convex functions** [Ora, Theorem 6.9]: in finite dimension, a +strongly convex, lower semicontinuous function on a nonempty closed convex set has exactly one +minimizer there. -/ +theorem StrongConvexOn.existsUnique_isMinOn [FiniteDimensional ℝ E] {V : Set E} {m : ℝ} + {f : E → ℝ} (hf : StrongConvexOn V m f) (hm : 0 < m) (hV : IsClosed V) (hVne : V.Nonempty) + (hlsc : LowerSemicontinuousOn f V) : + ∃! x, x ∈ V ∧ IsMinOn f V x := + sorry + +/-- A function is `s`-self-bounded within `V` [Ora, Definition 4.26]: it is bounded below, and +every subgradient within `V` at a point of `V` has squared norm at most `2 s (f x - inf f)`. -/ +def IsSelfBoundedOn (V : Set E) (s : ℝ) (f : E → ℝ) : Prop := + BddBelow (Set.range f) ∧ ∀ x ∈ V, ∀ g : E →L[ℝ] ℝ, HasSubgradientWithinAt f g V x → + ‖g‖ ^ 2 ≤ 2 * s * (f x - ⨅ z, f z) + +/-- The pairing of `E` with its dual, `(x, y) ↦ y x`, as the bilinear map taken by Tau Ceti's +`fenchelConjugate`. -/ +def dualPairing : E →ₗ[ℝ] (E →L[ℝ] ℝ) →ₗ[ℝ] ℝ := + LinearMap.mk₂ ℝ (fun x y ↦ y x) (fun x x' y ↦ by simp) (fun c x y ↦ by simp) + (fun x y y' ↦ by simp) (fun c x y ↦ by simp) + +/-- **The conjugate of a squared norm** [Ora, Example 6.19]. -/ +theorem fenchelConjugate_mul_norm_sq {s : ℝ} (hs : 0 < s) (y : E →L[ℝ] ℝ) : + TauCeti.fenchelConjugate dualPairing (fun x : E ↦ ((s / 2 * ‖x‖ ^ 2 : ℝ) : EReal)) y = + ((1 / (2 * s) * ‖y‖ ^ 2 : ℝ) : EReal) := + sorry + +end Convex + +/-- **The `p`-norm potential is strongly convex** [Ora, Lemma 6.35]. -/ +theorem strongConvexOn_norm_sq_piLp [Fintype α] {p : ℝ≥0∞} [Fact (1 ≤ p)] (hp1 : 1 < p) + (hp2 : p ≤ 2) : + StrongConvexOn Set.univ (p.toReal - 1) (fun x : PiLp p (fun _ : α ↦ ℝ) ↦ ‖x‖ ^ 2 / 2) := + sorry + +/-! ## Layer 4: lower bounds and the coin-betting game -/ + +/-- The wealth of a bettor with initial wealth `ε`, coins `c` and bets `x`, before round `t`. -/ +def wealth (ε : ℝ) (c x : ℕ → ℝ) (t : ℕ) : ℝ := + ε + ∑ s ∈ range t, c s * x s + +/-- The Lambert function on `[0, ∞)`, the inverse of `w ↦ w * exp w` (README Layer 4.4). -/ +def lambertW (x : ℝ) : ℝ := + sorry + +theorem lambertW_mul_exp_lambertW {x : ℝ} (hx : 0 ≤ x) : lambertW x * exp (lambertW x) = x := + sorry + +/-! ## Layer 5: FTRL for convex losses -/ + +section FTRL + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- **Stability without derivatives** [Ora, Lemma 7.5]: if `x t` minimizes +`F_t = ψ_t + ∑_{s < t} ℓ_s` on `V`, `g` is a subgradient of `ℓ t` within `V` at `x t` and +`F_t + ℓ_t` is `λ`-strongly convex on `V`, then the one-round term of the FTRL equality at any +`z ∈ V` is at most `‖g‖² / (2 λ)` plus the increment of the regularizer at `z`. -/ +theorem ftrl_stability_le {V : Set E} (hV : Convex ℝ V) (ψ ℓ : ℕ → E → ℝ) (x : ℕ → E) (t : ℕ) + (hx : IsMinOn (fun a ↦ ψ t a + ∑ s ∈ range t, ℓ s a) V (x t)) (hxV : x t ∈ V) + {lam : ℝ} (hlam : 0 < lam) + (hF : StrongConvexOn V lam (fun a ↦ ψ t a + ∑ s ∈ range (t + 1), ℓ s a)) + {g : E →L[ℝ] ℝ} (hg : HasSubgradientWithinAt (ℓ t) g V (x t)) {z : E} (hz : z ∈ V) : + (ψ t (x t) + ∑ s ∈ range t, ℓ s (x t)) + ℓ t (x t) - + (ψ (t + 1) z + ∑ s ∈ range (t + 1), ℓ s z) ≤ + ‖g‖ ^ 2 / (2 * lam) + (ψ t z - ψ (t + 1) z) := + sorry + +end FTRL + +/-! ## Layer 8: exp-concave losses -/ + +/-- `f` is `α`-exp-concave on `V` [Ora, Definition 7.31]: `exp (-α f)` is concave on `V`. -/ +def ExpConcaveOn {E : Type*} [AddCommGroup E] [Module ℝ E] (V : Set E) (a : ℝ) (f : E → ℝ) : + Prop := + ConcaveOn ℝ V (fun x ↦ exp (-(a * f x))) + +/-! ## Layer 10: Gibbs mixtures and the Aggregating Algorithm -/ + +section Mixtures + +variable {Θ : Type*} [MeasurableSpace Θ] + +/-- The mix loss of cumulative losses `L` under the prior `ν` at temperature `lam`. -/ +def mixLoss (ν : Measure Θ) (L : Θ → ℝ) (lam : ℝ) : ℝ := + -lam * log (∫ θ, exp (-(L θ / lam)) ∂ν) + +/-- The Gibbs measure of the cumulative losses `L` at temperature `lam`. -/ +def gibbs (ν : Measure Θ) (L : Θ → ℝ) (lam : ℝ) : Measure Θ := + ν.tilted fun θ ↦ -(L θ / lam) + +/-- **The variational formula of the mix loss** ([Ora, (11.5)], Donsker–Varadhan). -/ +theorem mixLoss_le_integral_add_klDiv (ν : Measure Θ) [IsProbabilityMeasure ν] {L : Θ → ℝ} + (hL : Measurable L) (hLb : BddBelow (Set.range L)) {lam : ℝ} (hlam : 0 < lam) + (Q : Measure Θ) [IsProbabilityMeasure Q] (hQ : Q ≪ ν) (hLQ : Integrable L Q) : + mixLoss ν L lam ≤ ∫ θ, L θ ∂Q + lam * (klDiv Q ν).toReal := + sorry + +/-- A loss on predictions `Γ` and outcomes `Ω` is `η`-mixable [Ora, Definition 11.7; Vovk 1990]: +for every probability measure on predictions, some prediction has loss at most the mix loss on +every outcome. -/ +def IsMixable {Γ Ω : Type*} [MeasurableSpace Γ] (loss : Γ → Ω → ℝ) (η : ℝ) : Prop := + ∀ P : Measure Γ, IsProbabilityMeasure P → + ∃ γ₀ : Γ, ∀ ω, loss γ₀ ω ≤ -(1 / η) * log (∫ γ, exp (-(η * loss γ ω)) ∂P) + +end Mixtures + +/-! ## Layer 13: parameter-free learning through coin betting -/ + +/-- The betting fraction of the Krichevsky–Trofimov bettor at round `t`. -/ +def ktFraction (c : ℕ → ℝ) (t : ℕ) : ℝ := + (∑ s ∈ range t, c s) / (t + 1) + +/-- The wealth of the Krichevsky–Trofimov bettor with initial wealth `ε` before round `t`. -/ +def ktWealth (ε : ℝ) (c : ℕ → ℝ) : ℕ → ℝ + | 0 => ε + | t + 1 => ktWealth ε c t * (1 + c t * ktFraction c t) + +/-- **The wealth of the Krichevsky–Trofimov bettor** [Ora, Theorem 13.4]. -/ +theorem le_ktWealth {ε : ℝ} (hε : 0 < ε) {c : ℕ → ℝ} (hc : ∀ t, c t ∈ Set.Icc (-1 : ℝ) 1) + {n : ℕ} (hn : 1 ≤ n) : + ε * exp ((∑ t ∈ range n, c t) ^ 2 / (2 * n) - log n / 2 - 1) ≤ ktWealth ε c n := + sorry + +section Duality + +variable {E : Type*} [NormedAddCommGroup E] [NormedSpace ℝ E] + +/-- **Regret–reward duality** [Ora, Theorem 13.5], the direction that holds for every `φ`: a lower +bound on the reward by `φ` of the negated cumulative loss bounds the regret against every `u` by +the conjugate of `φ`. -/ +theorem sum_apply_sub_le_fenchelConjugate (φ : (E →L[ℝ] ℝ) → EReal) (y : ℕ → E →L[ℝ] ℝ) + (x : ℕ → E) (n : ℕ) + (h : φ (-∑ t ∈ range n, y t) ≤ ((-∑ t ∈ range n, y t (x t) : ℝ) : EReal)) (u : E) : + ((∑ t ∈ range n, y t (x t - u) : ℝ) : EReal) ≤ + TauCeti.fenchelConjugate (dualPairing (E := E)).flip φ u := + sorry + +end Duality + +/-! ## Layer 15: saddle points and games -/ + +section SaddlePoint + +variable {E F : Type*} [AddCommGroup E] [Module ℝ E] [AddCommGroup F] [Module ℝ F] + +/-- The duality gap of `(x', y')` for the problem `min_{x ∈ X} max_{y ∈ Y} f x y` +[Ora, Definition 15.8]. -/ +def dualityGap (X : Set E) (Y : Set F) (f : E → F → ℝ) (x' : E) (y' : F) : EReal := + (⨆ y ∈ Y, (f x' y : EReal)) - ⨅ x ∈ X, (f x y' : EReal) + +/-- **No-regret dynamics** [Ora, Theorem 15.12]: for arbitrary plays of the two players, the gap +of the averages against any `(x, y)` is at most the sum of the two regrets divided by `n`. No +property of the learners is used. -/ +theorem sub_le_regret_add_regret_div {X : Set E} {Y : Set F} {f : E → F → ℝ} + (hfx : ∀ y ∈ Y, ConvexOn ℝ X fun x ↦ f x y) (hfy : ∀ x ∈ X, ConcaveOn ℝ Y (f x)) + (xs : ℕ → E) (ys : ℕ → F) (hxs : ∀ t, xs t ∈ X) (hys : ∀ t, ys t ∈ Y) {n : ℕ} (hn : 0 < n) + {x : E} (hx : x ∈ X) {y : F} (hy : y ∈ Y) : + f ((n : ℝ)⁻¹ • ∑ t ∈ range n, xs t) y - f x ((n : ℝ)⁻¹ • ∑ t ∈ range n, ys t) ≤ + (regret (fun t a ↦ f a (ys t)) xs x n + regret (fun t b ↦ -f (xs t) b) ys y n) / n := + sorry + +end SaddlePoint + +/-! ## Layer 16: betting confidence sequences -/ + +/-- **The betting martingale** (README Layer 16.4): for data in `[0, 1]` with conditional mean +`μ` and predictable bets in `[-1 / (1 - μ), 1 / μ]`, the wealth of the bettor is a nonnegative +martingale. No moment generating function is involved. -/ +theorem martingale_prod_one_add_mul_sub {Ω : Type*} {mΩ : MeasurableSpace Ω} {P : Measure Ω} + [IsProbabilityMeasure P] {𝓕 : Filtration ℕ mΩ} {Z β : ℕ → Ω → ℝ} {μ : ℝ} + (hμ : μ ∈ Set.Ioo 0 1) (hZ : ∀ t, StronglyMeasurable[𝓕 (t + 1)] (Z t)) + (hZ01 : ∀ t ω, Z t ω ∈ Set.Icc 0 1) (hZμ : ∀ t, P[Z t|𝓕 t] =ᵐ[P] fun _ ↦ μ) + (hβ : ∀ t, StronglyMeasurable[𝓕 t] (β t)) + (hβb : ∀ t ω, β t ω ∈ Set.Icc (-1 / (1 - μ)) (1 / μ)) : + Martingale (fun t ω ↦ ∏ s ∈ range t, (1 + β s ω * (Z s ω - μ))) + 𝓕 P := + sorry + +end LMLRoadmaps.OnlineLearning diff --git a/LMLRoadmaps/OnlineLearning/metadata.toml b/LMLRoadmaps/OnlineLearning/metadata.toml new file mode 100644 index 0000000..3452649 --- /dev/null +++ b/LMLRoadmaps/OnlineLearning/metadata.toml @@ -0,0 +1 @@ +topic = "math.OC" diff --git a/LMLRoadmaps/ReinforcementLearning/README.md b/LMLRoadmaps/ReinforcementLearning/README.md index ccfe0dd..747063a 100644 --- a/LMLRoadmaps/ReinforcementLearning/README.md +++ b/LMLRoadmaps/ReinforcementLearning/README.md @@ -65,6 +65,7 @@ This roadmap owns Markov decision processes and reinforcement learning: | Path laws of Markov chains; countable-state classification, recurrence, period, coupling | Tau Ceti `Probability/Process/MarkovChain.lean` (`markovChainLaw`) and the MarkovChainsAndRenewal roadmap: follow its names, and cite it for the countable-state theory | | Ville's inequality, time-uniform sub-Gaussian bounds, method of mixtures, binary relative entropy, Bretagnolle–Huber | Bandits roadmap, Layers 0–1 and 4 (in LMLExplore) | | FTRL, mirror descent, exponential weights, Legendre functions; implicit exploration | Bandits roadmap, Layers 6–7 | +| The descent lemma for smooth functions; Gibbs mixtures and their variational formula | OnlineLearning roadmap, Layers 1.3 and 10.1 | | Design operators, ridge regression, self-normalized bounds, elliptical potential, Kiefer–Wolfowitz | Bandits roadmap, Layer 8 | | Chain rule for the KL divergence of stopped histories at a stopping time, for arbitrary pairs of environments [GMS19, §2], and its bandit regrouping; data processing for `klBer` | Identification roadmap, Layers 2.1–2.2 | | Transfer of every event about the first $s$ rewards of each arm from runs to reward streams | Identification roadmap, Layer 4.1 | @@ -280,7 +281,7 @@ These are sources to adapt, not dependencies: | 2 | Mean ergodic theory and finite Markov chains | Layers 0–1 | | 3 | Concentration | Bandits roadmap, Layer 1; Identification roadmap, Layer 4.2 | | 4 | Stochastic approximation | Mathlib martingale convergence | -| 5 | Optimization | Bandits roadmap, Layer 6 | +| 5 | Optimization | Bandits roadmap, Layer 6; OnlineLearning roadmap, Layers 1.3 and 10.1 | | 6 | Sequential-learning tools: keyed streams, divergence decomposition by keys | LML; Identification roadmap, Layers 0.3, 2.1–2.2, 4.1 | | 7 | MDPs, policies and values | Layers 0–1, 6 | | 8 | Bellman operators and the finite horizon | Layers 0, 7 | @@ -695,12 +696,12 @@ Suggested homes: `Optimization/`, `Analysis/SpecialFunctions/`, `OnlineLearning/ - `softmax θ` $=\exp\theta/\sum\exp\theta$, with values in LMLExplore's `simplex`; - `logSumExp`. - Prove the Jacobian $\mathrm{diag}(\pi)-\pi\pi^\top$, the convexity of `logSumExp`, its gradient - `softmax`, and the Gibbs variational formula on a finite type (the finite case of Tau Ceti's - Donsker–Varadhan). + Prove the Jacobian $\mathrm{diag}(\pi)-\pi\pi^\top$, the convexity of `logSumExp` and its + gradient `softmax`. The Gibbs variational formula on a finite type is the finite case of the + OnlineLearning roadmap's Layer 10.1. 2. **Smooth optimization** [Nes18, Lemma 1.2.3], [KNS16, Theorem 1], [AKLM21, Proposition B.1, - Theorem E.1], [MXSS20, Lemmas 7–8]. In a real inner product space, prove: - - the descent lemma for $L$-smooth functions; + Theorem E.1], [MXSS20, Lemmas 7–8]. The descent lemma for $L$-smooth functions is the + OnlineLearning roadmap's Layer 1.3, in a normed space. In a real inner product space, prove: - for $L$-smooth $f$ satisfying the Polyak–Łojasiewicz inequality $\frac12\|\nabla f\|^2\ge\mu(f^*-f)$, gradient ascent with step $1/L$ gives $f^*-f(x_k)\le(1-\mu/L)^k(f^*-f(x_0))$;