Skip to content

Commit 84ffc3d

Browse files
authored
Blueprint update: ETC and UCB (#56)
2 parents c612533 + f16ea18 commit 84ffc3d

5 files changed

Lines changed: 37 additions & 79 deletions

File tree

‎blueprint/lean_decls‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ Bandits.ucbAlgorithm
120120
Bandits.UCB.ucbIndex_le_ucbIndex_arm
121121
Bandits.UCB.gap_arm_le_two_mul_ucbWidth
122122
Bandits.UCB.pullCount_arm_le
123-
Bandits.UCB.todo
124-
Bandits.UCB.todo'
125123
Bandits.UCB.prob_ucbIndex_le
126124
Bandits.UCB.prob_ucbIndex_ge
127125
Bandits.UCB.pullCount_le_add_three

‎blueprint/src/chapters/algorithm.tex‎

Lines changed: 28 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ \chapter{Iterative stochastic algorithms}
7373
For such a statement to make sense, we need a probability space on which the whole sequence of actions and observations is defined as a random variable.
7474

7575
We denote by $P[X \mid Y]$ the conditional distribution of a random variable $X$ given another random variable $Y$ under a probability measure $P$.
76+
When we write that $P[X \mid Y] = \kappa$, or that $X$ has conditional distribution $\kappa$ given $Y$, the equality should be understood as holding $Y_* P$-almost surely.
7677

7778

7879
\begin{definition}[Algorithm-environment interaction]\label{def:IsAlgEnvSeq}
@@ -229,7 +230,7 @@ \subsection{Ionescu-Tulcea theorem}
229230
$(\mathcal{F}_t)_{t \in \mathbb{N}}$ is the canonical filtration on $\Omega_{\mathcal{T}}$, and is the natural filtration for the canonical process $(X_t)_{t \in \mathbb{N}}$.
230231

231232

232-
\begin{lemma}\label{lem:adapted_history}
233+
\begin{lemma}\label{lem:IT.adapted_history}
233234
\uses{def:IT.history, def:IT.filtration}
234235
\leanok
235236
\lean{Learning.IT.adapted_step, Learning.IT.adapted_hist}
@@ -242,7 +243,7 @@ \subsection{Ionescu-Tulcea theorem}
242243
\end{proof}
243244

244245

245-
\begin{lemma}\label{lem:condDistrib_X_add_one}
246+
\begin{lemma}\label{lem:IT.condDistrib_X_add_one}
246247
\uses{def:IT.history, def:trajMeasure}
247248
\leanok
248249
\lean{ProbabilityTheory.Kernel.condDistrib_trajMeasure}
@@ -256,7 +257,7 @@ \subsection{Ionescu-Tulcea theorem}
256257
\end{proof}
257258

258259

259-
\begin{lemma}\label{lem:law_X_zero}
260+
\begin{lemma}\label{lem:IT.law_X_zero}
260261
\uses{def:IT.history, def:trajMeasure}
261262
\leanok
262263
\lean{Learning.IsAlgEnvSeq.hasLaw_step_zero}
@@ -286,7 +287,7 @@ \subsection{Case of an algorithm-environment interaction}
286287
\end{definition}
287288

288289

289-
\begin{lemma}\label{lem:adapted_action_reward}
290+
\begin{lemma}\label{lem:IT.adapted_action_reward}
290291
\uses{def:IT.actionReward, def:IT.filtration}
291292
\leanok
292293
\lean{Learning.IT.adapted_action, Learning.IT.adapted_reward}
@@ -295,72 +296,72 @@ \subsection{Case of an algorithm-environment interaction}
295296
\end{lemma}
296297

297298
\begin{proof}\leanok
298-
\uses{lem:adapted_history}
299+
\uses{lem:IT.adapted_history}
299300

300301
\end{proof}
301302

302303

303304
We need to check that the random variables $A_t$ and $R_t$ have the expected conditional distributions.
304305

305-
\begin{lemma}\label{lem:condDistrib_A_add_one}
306+
\begin{lemma}\label{lem:IT.condDistrib_A_add_one}
306307
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
307308
\leanok
308309
\lean{Learning.IT.condDistrib_action}
309310
For any $t \in \mathbb{N}$, the conditional distribution $P_{\mathcal{T}}\left[A_{t+1} \mid H_t\right]$ is $((H_t)_* P_{\mathcal{T}})$-almost surely equal to $\pi_t$.
310311
\end{lemma}
311312

312313
\begin{proof}\leanok
313-
\uses{lem:condDistrib_X_add_one}
314-
By Lemma~\ref{lem:condDistrib_X_add_one}, $P_{\mathcal{T}}\left[X_{t+1} \mid H_t\right]$ is $((H_t)_* P_{\mathcal{T}})$-almost surely equal to $\kappa_t = \pi_t \otimes \nu_t$.
314+
\uses{lem:IT.condDistrib_X_add_one}
315+
By Lemma~\ref{lem:IT.condDistrib_X_add_one}, $P_{\mathcal{T}}\left[X_{t+1} \mid H_t\right]$ is $((H_t)_* P_{\mathcal{T}})$-almost surely equal to $\kappa_t = \pi_t \otimes \nu_t$.
315316
Since $A_{t+1}$ is the projection of $X_{t+1}$ on $\mathcal{A}_{t+1}$, $P_{\mathcal{T}}\left[A_{t+1} \mid H_t\right]$ is $((H_t)_* P_{\mathcal{T}})$-almost surely equal to the projection of $\kappa_t$ on $\mathcal{A}_{t+1}$, which is $\pi_t$.
316317
\end{proof}
317318

318319

319-
\begin{lemma}\label{lem:condDistrib_R_add_one}
320+
\begin{lemma}\label{lem:IT.condDistrib_R_add_one}
320321
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
321322
\leanok
322323
\lean{Learning.IT.condDistrib_reward}
323324
For any $t \in \mathbb{N}$, the conditional distribution $P_{\mathcal{T}}\left[R_{t+1} \mid H_t, A_{t+1}\right]$ is $((H_t, A_{t+1})_* P_{\mathcal{T}})$-almost surely equal to $\nu_t$.
324325
\end{lemma}
325326

326327
\begin{proof}\leanok
327-
\uses{lem:condDistrib_X_add_one, lem:condDistrib_A_add_one}
328+
\uses{lem:IT.condDistrib_X_add_one, lem:IT.condDistrib_A_add_one}
328329
It suffices to show that $((H_t, A_{t+1})_* P_{\mathcal{T}}) \otimes \nu_t = (H_t, A_{t+1}, R_{t+1})_* P_{\mathcal{T}} = (H_t, X_{t+1})_* P_{\mathcal{T}}$.
329-
By Lemma~\ref{lem:condDistrib_X_add_one}, $P_{\mathcal{T}}\left[X_{t+1} \mid H_t\right]$ is $((H_t)_* P_{\mathcal{T}})$-almost surely equal to $\kappa_t = \pi_t \otimes \nu_t$.
330+
By Lemma~\ref{lem:IT.condDistrib_X_add_one}, $P_{\mathcal{T}}\left[X_{t+1} \mid H_t\right]$ is $((H_t)_* P_{\mathcal{T}})$-almost surely equal to $\kappa_t = \pi_t \otimes \nu_t$.
330331
Thus $((H_t)_* P_{\mathcal{T}}) \otimes (\pi_t \otimes \nu_t) = (H_t, X_{t+1})_* P_{\mathcal{T}}$.
331332

332333
We thus have to prove that $((H_t)_* P_{\mathcal{T}}) \otimes (\pi_t \otimes \nu_t) = ((H_t, A_{t+1})_* P_{\mathcal{T}}) \otimes \nu_t$.
333334

334-
By Lemma~\ref{lem:condDistrib_A_add_one}, $(H_t, A_{t+1})_* P_{\mathcal{T}} = (H_t)_* P_{\mathcal{T}} \otimes \pi_t$, and replacing this in the right-hand side gives the left-hand side (using associativity of the composition-product).
335+
By Lemma~\ref{lem:IT.condDistrib_A_add_one}, $(H_t, A_{t+1})_* P_{\mathcal{T}} = (H_t)_* P_{\mathcal{T}} \otimes \pi_t$, and replacing this in the right-hand side gives the left-hand side (using associativity of the composition-product).
335336
\end{proof}
336337

337338

338-
\begin{lemma}\label{lem:law_A_zero}
339+
\begin{lemma}\label{lem:IT.law_A_zero}
339340
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
340341
\leanok
341342
\lean{Learning.IT.hasLaw_action_zero}
342343
The law of $A_0$ under $P_{\mathcal{T}}$ is $\alpha_0$.
343344
\end{lemma}
344345

345346
\begin{proof}\leanok
346-
\uses{lem:law_X_zero}
347+
\uses{lem:IT.law_X_zero}
347348
$X_0$ has law $\mu = \alpha_0 \otimes \nu'_0$. $A_0$ is the projection of $X_0$ on the first space $\mathcal{A}_0$ and $\nu_0'$ is Markov, so $A_0$ has law $\alpha_0$.
348349
\end{proof}
349350

350351

351-
\begin{lemma}\label{lem:condDistrib_R_zero}
352+
\begin{lemma}\label{lem:IT.condDistrib_R_zero}
352353
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
353354
\leanok
354355
\lean{Learning.IT.condDistrib_reward_zero}
355356
The conditional distribution $P_{\mathcal{T}}\left[R_0 \mid A_0\right]$ is $(A_{0*} P_{\mathcal{T}})$-almost surely equal to $\nu'_0$.
356357
\end{lemma}
357358

358359
\begin{proof}\leanok
359-
\uses{lem:law_X_zero}
360+
\uses{lem:IT.law_X_zero}
360361
To prove almost sure equality, it is enough to prove that $(A_{0*} P_{\mathcal{T}}) \otimes P_{\mathcal{T}}\left[R_0 \mid A_0\right] = (A_{0*} P_{\mathcal{T}}) \otimes \nu'_0$.
361362
By definition of the conditional distribution, we have $(A_{0*} P_{\mathcal{T}}) \otimes P_{\mathcal{T}}\left[R_0 \mid A_0\right] = (A_0, R_0)_* P_{\mathcal{T}} = X_{0*} P_{\mathcal{T}}$.
362-
By Lemma~\ref{lem:law_X_zero}, $X_{0*} P_{\mathcal{T}} = \mu = \alpha_0 \otimes \nu'_0$.
363-
By Lemma~\ref{lem:law_A_zero}, $A_{0*} P_{\mathcal{T}} = \alpha_0$.
363+
By Lemma~\ref{lem:IT.law_X_zero}, $X_{0*} P_{\mathcal{T}} = \mu = \alpha_0 \otimes \nu'_0$.
364+
By Lemma~\ref{lem:IT.law_A_zero}, $A_{0*} P_{\mathcal{T}} = \alpha_0$.
364365
Thus the two sides are equal.
365366
\end{proof}
366367

@@ -373,8 +374,8 @@ \subsection{Case of an algorithm-environment interaction}
373374
\end{theorem}
374375

375376
\begin{proof}\leanok
376-
\uses{lem:law_A_zero, lem:condDistrib_R_zero, lem:condDistrib_A_add_one, lem:condDistrib_R_add_one}
377-
The four conditions of Definition~\ref{def:IsAlgEnvSeq} are exactly the statements of Lemmas~\ref{lem:law_A_zero}, \ref{lem:condDistrib_R_zero}, \ref{lem:condDistrib_A_add_one} and \ref{lem:condDistrib_R_add_one}.
377+
\uses{lem:IT.law_A_zero, lem:IT.condDistrib_R_zero, lem:IT.condDistrib_A_add_one, lem:IT.condDistrib_R_add_one}
378+
The four conditions of Definition~\ref{def:IsAlgEnvSeq} are exactly the statements of Lemmas~\ref{lem:IT.law_A_zero}, \ref{lem:IT.condDistrib_R_zero}, \ref{lem:IT.condDistrib_A_add_one} and \ref{lem:IT.condDistrib_R_add_one}.
378379
\end{proof}
379380

380381

@@ -510,14 +511,14 @@ \section{Finitely many actions}
510511
\end{proof}
511512

512513

513-
\begin{lemma}\label{lem:measurable_rewardByCount_mul_indicator}
514-
\uses{def:rewardByCount, def:stepsUntil}
515-
$Y_{n, a} \mathbb{I}\{T_{n, a} < \infty\}$ is $\mathcal{F}_{T_{n, a}}$-measurable.
516-
\end{lemma}
514+
% \begin{lemma}\label{lem:measurable_rewardByCount_mul_indicator}
515+
% \uses{def:rewardByCount, def:stepsUntil}
516+
% $Y_{n, a} \mathbb{I}\{T_{n, a} < \infty\}$ is $\mathcal{F}_{T_{n, a}}$-measurable.
517+
% \end{lemma}
517518

518-
\begin{proof}
519-
It is the stopped value of the adapted process $(R_t)_{t \in \mathbb{N}}$ at the stopping time $T_{n, a}$.
520-
\end{proof}
519+
% \begin{proof}
520+
% It is the stopped value of the adapted process $(R_t)_{t \in \mathbb{N}}$ at the stopping time $T_{n, a}$.
521+
% \end{proof}
521522

522523

523524
\section{Scalar rewards}

‎blueprint/src/chapters/concentration.tex‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ \section{Sub-Gaussian random variables}
8686

8787

8888

89-
\section{Laws of sums of rewards}
89+
\section{Concentration of the sums of rewards in bandit models}
9090

9191

9292
\begin{lemma}\label{lem:AM.identDistrib_pullCount_prod_sumRewards}
@@ -155,14 +155,15 @@ \section{Laws of sums of rewards}
155155

156156
\subsection{Sub-Gaussian rewards}
157157

158+
TODO: extend this to sub-Gaussian with constant other than 1.
158159

159160
\begin{lemma}\label{lem:probReal_sum_le_sum_streamMeasure}
160161
\leanok
161162
\lean{Bandits.probReal_sum_le_sum_streamMeasure}
162163
Let $\nu(a)$ be a 1-sub-Gaussian distribution on $\mathbb{R}$ for each arm $a \in \mathcal{A}$.
163164
\begin{align*}
164165
(\otimes_a \nu(a))^{\otimes \mathbb{N}} \left( \sum_{s=0}^{m-1} \omega_{s, a^*} \le \sum_{s=0}^{m-1} \omega_{s, a} \right)
165-
&\le \exp\left( -m \frac{\Delta_a^2}{4 \sigma^2} \right)
166+
&\le \exp\left( -m \frac{\Delta_a^2}{4} \right)
166167
\end{align*}
167168
\end{lemma}
168169

‎blueprint/src/chapters/etc.tex‎

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
\chapter{Bandit algorithms}
22

3-
TODO: update this chapter to reflect the changes in the formalization.
4-
53
\section{Explore-Then-Commit}
64

75
Note: times start at 0 to be consistent with Lean.
@@ -58,28 +56,19 @@ \section{Explore-Then-Commit}
5856
\end{lemma}
5957

6058
\begin{proof}\leanok
61-
\uses{lem:independent_rewardByCount, lem:sum_rewardByCount, lem:measure_sum_le_sum_le', lem:identDistrib_sum_Icc_rewardByCount, lem:sumRewards_bestArm_le_of_arm_mul_eq}
59+
\uses{lem:prob_sumRewards_le_sumRewards_le, lem:probReal_sum_le_sum_streamMeasure, lem:sumRewards_bestArm_le_of_arm_mul_eq}
6260
By Lemma~\ref{lem:sumRewards_bestArm_le_of_arm_mul_eq},
6361
\begin{align*}
6462
\mathbb{P}(\hat{A}_m^* = a)
6563
&\le \mathbb{P}(S_{Km, a} \ge S_{Km, a^*})
6664
\: .
6765
\end{align*}
68-
By Lemma~\ref{lem:sum_rewardByCount}, $S_{Km, a} = \sum_{i=1}^m Y_{a,i}$ and $S_{Km, a^*} = \sum_{i=1}^m Y_{a^*,i}$.
69-
And by Lemma~\ref{lem:identDistrib_sum_Icc_rewardByCount} and the independence lemma~\ref{lem:independent_rewardByCount}, the pair $(\sum_{i=1}^m Y_{a,i}, \sum_{i=1}^m Y_{a^*,i})$ has the same distribution as $(\sum_{i=0}^{m-1} Z_{i,a}, \sum_{i=0}^{m-1} Z_{i,a^*})$.
70-
We thus obtain
71-
\begin{align*}
72-
\mathbb{P}(\hat{A}_m^* = a)
73-
&\le \mathbb{P}\left(\sum_{i=0}^{m-1} Z_{i,a} \ge \sum_{i=0}^{m-1} Z_{i,a^*}\right)
74-
\: .
75-
\end{align*}
76-
The random variables $Z_{i,a}$ and $Z_{i,a^*}$ are i.i.d. with distributions $\nu(a)$ and $\nu(a^*)$ respectively, and 1-sub-Gaussian by assumption.
77-
They satisfy the hypotheses of Lemma~\ref{lem:measure_sum_le_sum_le'}, and we thus obtain
66+
By Lemma~\ref{lem:prob_sumRewards_le_sumRewards_le}, and then the concentration inequality of Lemma~\ref{lem:probReal_sum_le_sum_streamMeasure} we have
7867
\begin{align*}
79-
\mathbb{P}(\hat{A}_m^* = a)
80-
&\le \mathbb{P}\left(\sum_{i=0}^{m-1} Z_{i,a} \ge \sum_{i=0}^{m-1} Z_{i,a^*}\right)
68+
P_{\mathcal{A}}\left(S_{Km, a^*} \le S_{Km, a}\right)
69+
&\le (\otimes_a \nu(a))^{\otimes \mathbb{N}} \left( \sum_{s=0}^{m-1} \omega_{s, a^*} \le \sum_{s=0}^{m-1} \omega_{s, a} \right)
8170
\\
82-
&\le \exp\left(- \frac{m \Delta_a^2}{4}\right)
71+
&\le \exp\left( -m \frac{\Delta_a^2}{4} \right)
8372
\: .
8473
\end{align*}
8574
\end{proof}

‎blueprint/src/chapters/ucb.tex‎

Lines changed: 1 addition & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
\section{UCB}
22

3-
TODO: update this chapter to reflect the changes in the formalization.
4-
53
\begin{definition}[UCB algorithm]\label{def:ucbAlgorithm}
64
\uses{def:IT.actionReward, def:pullCount, def:empMean}
75
\leanok
@@ -64,33 +62,6 @@ \section{UCB}
6462
\end{proof}
6563

6664

67-
%todo: move to concentration section?
68-
\begin{lemma}\label{lem:todo}
69-
\uses{def:rewardByCount}
70-
\leanok
71-
\lean{Bandits.UCB.todo, Bandits.UCB.todo'}
72-
Suppose that $\nu(a)$ is 1-sub-Gaussian for all arms $a \in [K]$.
73-
Let $c \ge 0$ be a real number and $k$ a positive natural number.
74-
Then
75-
\begin{align*}
76-
P\left(\frac{1}{k} \sum_{m=1}^k Y_{m, a} + \sqrt{\frac{c \log(n + 1)}{k}} \le \mu_a\right)
77-
&\le \frac{1}{(n + 1)^{c / 2}}
78-
\: .
79-
\end{align*}
80-
And also,
81-
\begin{align*}
82-
P\left(\frac{1}{k} \sum_{m=1}^k Y_{m, a} - \sqrt{\frac{c \log(n + 1)}{k}} \ge \mu_a\right)
83-
&\le \frac{1}{(n + 1)^{c / 2}}
84-
\: .
85-
\end{align*}
86-
\end{lemma}
87-
88-
\begin{proof}\leanok
89-
\uses{lem:identDistrib_sum_Icc_rewardByCount, thm:hoeffding}
90-
91-
\end{proof}
92-
93-
9465
\begin{lemma}\label{lem:prob_ucbIndex_le}
9566
\uses{def:empMean, def:pullCount}
9667
\leanok
@@ -112,10 +83,8 @@ \section{UCB}
11283
\end{lemma}
11384

11485
\begin{proof}\leanok
115-
\uses{lem:todo, lem:pullCount_basic}
116-
Since $N_{n,a} \le n$ (Lemma~\ref{lem:pullCount_basic}), there exists $k \in [1, n]$ such that $N_{n,a} = k$ and $\hat{\mu}_{n,a} = \frac{1}{k} \sum_{m=1}^k Y_{m,a}$.
86+
\uses{lem:prob_pullCount_prod_sumRewards_mem_le, lem:prob_sum_le_sqrt_log, lem:pullCount_basic}
11787

118-
Then apply a union bound over $k \in [1, n]$ and use Lemma~\ref{lem:todo}.
11988
\end{proof}
12089

12190

0 commit comments

Comments
 (0)