Skip to content

Commit 28df7eb

Browse files
committed
Update readme
1 parent 84ffc3d commit 28df7eb

2 files changed

Lines changed: 27 additions & 12 deletions

File tree

‎README.md‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
11
# Bandit algorithms in Lean
22

3-
Under construction.
3+
This repository contains a Lean formalization of regret bounds for several stochastic bandit algorithms.
4+
5+
Authors: Rémy Degenne, Paulo Rauber.
6+
7+
Main results:
8+
- Framework for working on bandit algorithms in Lean.
9+
- Regret bound for the Explore-Then-Commit algorithm.
10+
- Regret bound for the UCB algorithm.
11+
12+
Contents:
13+
- Definitions of an iterative, stochastic algorithm and a stochastic environment
14+
- Proofs of the existence of probability spaces on which those algorithm-environment interactions are defined, and uniqueness of the resulting laws
15+
- Notations and tools to analyze bandits: number of times an arm was pulled, time of the nth pull, regret, gap. Relations between those.
16+
- Concentration inequalities
17+
- Definitions of ETC and UCB
18+
- Proofs of regret bounds for those two algorithms.

‎blueprint/src/chapters/algorithm.tex‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ \subsection{Ionescu-Tulcea theorem}
274274
\subsection{Case of an algorithm-environment interaction}
275275

276276
We now go back to the setting of an algorithm interacting with an environment and suppose that $\Omega_t = \mathcal{A} \times \mathcal{R}$ for some measurable spaces $\mathcal{A}$ and $\mathcal{R}$, and that for all $t \in \mathbb{N}$, $\kappa_t = \pi_t \otimes \nu_t$ for policy kernels $\pi_t : (\mathcal{A} \times \mathcal{R})^{t+1} \rightsquigarrow \mathcal{A}$ and feedback kernels $\nu_t : (\mathcal{A} \times \mathcal{R})^{t+1} \times \mathcal{A} \rightsquigarrow \mathcal{R}$.
277-
Likewise, $\mu = P_0 \otimes \nu'_0$ for a probability measure $P_0$ on $\mathcal{A}$ and a Markov kernel $\nu'_0 : \mathcal{A}_\rightsquigarrow \mathcal{R}$.
277+
Likewise, $\mu = P_0 \otimes \nu'_0$ for a probability measure $P_0$ on $\mathcal{A}$ and a Markov kernel $\nu'_0 : \mathcal{A} \rightsquigarrow \mathcal{R}$.
278278
The step random variable $X_t$ takes values in $\mathcal{A} \times \mathcal{R}$.
279279

280280
\begin{definition}\label{def:IT.actionReward}
@@ -307,27 +307,27 @@ \subsection{Case of an algorithm-environment interaction}
307307
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
308308
\leanok
309309
\lean{Learning.IT.condDistrib_action}
310-
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$.
310+
For any $t \in \mathbb{N}$, $P_{\mathcal{T}}\left[A_{t+1} \mid H_t\right] = \pi_t$.
311311
\end{lemma}
312312

313313
\begin{proof}\leanok
314314
\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$.
316-
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$.
315+
By Lemma~\ref{lem:IT.condDistrib_X_add_one}, $P_{\mathcal{T}}\left[X_{t+1} \mid H_t\right] = \kappa_t = \pi_t \otimes \nu_t$.
316+
Since $A_{t+1}$ is the projection of $X_{t+1}$ on $\mathcal{A}$, $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}$, which is $\pi_t$.
317317
\end{proof}
318318

319319

320320
\begin{lemma}\label{lem:IT.condDistrib_R_add_one}
321321
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
322322
\leanok
323323
\lean{Learning.IT.condDistrib_reward}
324-
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$.
324+
For any $t \in \mathbb{N}$, $P_{\mathcal{T}}\left[R_{t+1} \mid H_t, A_{t+1}\right] = \nu_t$.
325325
\end{lemma}
326326

327327
\begin{proof}\leanok
328328
\uses{lem:IT.condDistrib_X_add_one, lem:IT.condDistrib_A_add_one}
329329
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}}$.
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$.
330+
By Lemma~\ref{lem:IT.condDistrib_X_add_one}, $P_{\mathcal{T}}\left[X_{t+1} \mid H_t\right] = \pi_t \otimes \nu_t$.
331331
Thus $((H_t)_* P_{\mathcal{T}}) \otimes (\pi_t \otimes \nu_t) = (H_t, X_{t+1})_* P_{\mathcal{T}}$.
332332

333333
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$.
@@ -340,28 +340,28 @@ \subsection{Case of an algorithm-environment interaction}
340340
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
341341
\leanok
342342
\lean{Learning.IT.hasLaw_action_zero}
343-
The law of $A_0$ under $P_{\mathcal{T}}$ is $\alpha_0$.
343+
The law of $A_0$ under $P_{\mathcal{T}}$ is $P_0$.
344344
\end{lemma}
345345

346346
\begin{proof}\leanok
347347
\uses{lem:IT.law_X_zero}
348-
$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$.
348+
$X_0$ has law $\mu = P_0 \otimes \nu'_0$. $A_0$ is the projection of $X_0$ on the first space $\mathcal{A}$ and $\nu_0'$ is Markov, so $A_0$ has law $P_0$.
349349
\end{proof}
350350

351351

352352
\begin{lemma}\label{lem:IT.condDistrib_R_zero}
353353
\uses{def:IT.actionReward, def:trajMeasure, def:algorithm, def:environment}
354354
\leanok
355355
\lean{Learning.IT.condDistrib_reward_zero}
356-
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$.
356+
$P_{\mathcal{T}}\left[R_0 \mid A_0\right] = \nu'_0$.
357357
\end{lemma}
358358

359359
\begin{proof}\leanok
360360
\uses{lem:IT.law_X_zero}
361361
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$.
362362
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}}$.
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$.
363+
By Lemma~\ref{lem:IT.law_X_zero}, $X_{0*} P_{\mathcal{T}} = \mu = P_0 \otimes \nu'_0$.
364+
By Lemma~\ref{lem:IT.law_A_zero}, $A_{0*} P_{\mathcal{T}} = P_0$.
365365
Thus the two sides are equal.
366366
\end{proof}
367367

0 commit comments

Comments
 (0)