# Reinforcement learning with imperceptible rewards

$$\newcommand{\Co}[1]{}
\DeclareMathOperator{\Sgn}{sgn}
\DeclareMathOperator{\Supp}{supp}
\DeclareMathOperator{\Dom}{dom}
\DeclareMathOperator{\Sp}{span}
\newcommand{\AP}[1]{\left(#1\right)}
\newcommand{\AB}[1]{\left[#1\right]}
\newcommand{\AC}[1]{\left\{#1\right\}}
\newcommand{\APM}[2]{\left(#1\;\middle\vert\;#2\right)}
\newcommand{\ABM}[2]{\left[#1\;\middle\vert\;#2\right]}
\newcommand{\ACM}[2]{\left\{#1\;\middle\vert\;#2\right\}}
\newcommand{\Abs}[1]{\left\vert #1 \right\vert}
\newcommand{\Norm}[1]{\left\Vert #1 \right\Vert}
\newcommand{\Floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\Ceil}[1]{\left\lceil #1 \right\rceil}
\newcommand{\Chev}[1]{\left\langle #1 \right\rangle}
\newcommand{\Quote}[1]{\left\ulcorner #1 \right\urcorner}
\newcommand{\Pb}[1]{\operatorname{Pr}\AB{#1}}
\newcommand{\Pa}[2]{\underset{#1}{\operatorname{Pr}}\AB{#2}}
\newcommand{\CPb}[2]{\operatorname{Pr}\ABM{#1}{#2}}
\newcommand{\CP}[3]{\underset{#1}{\operatorname{Pr}}\ABM{#2}{#3}}
\newcommand{\PP}[2]{\underset{\substack{#1 \\ #2}}{\operatorname{Pr}}}
\newcommand{\PPP}[3]{\underset{\substack{#1 \\ #2 \\ #3}}{\operatorname{Pr}}}
\newcommand{\E}[1]{\operatorname{E}\AB{#1}}
\newcommand{\Ea}[2]{\underset{#1}{\operatorname{E}}\AB{#2}}
\newcommand{\CEx}[2]{\operatorname{E}\ABM{#1}{#2}}
\newcommand{\CE}[3]{\underset{#1}{\operatorname{E}}\ABM{#2}{#3}}
\newcommand{\EE}[2]{\underset{\substack{#1 \\ #2}}{\operatorname{E}}}
\newcommand{\EEE}[3]{\underset{\substack{#1 \\ #2 \\ #3}}{\operatorname{E}}}
\newcommand{\Var}[2]{\underset{#1}{\operatorname{Var}}\AB{#2}}
\newcommand{\I}[1]{\underset{#1}{\operatorname{I}}}
\newcommand{\CI}[3]{\underset{#1}{\operatorname{I}}\ABM{#2}{#3}}
\newcommand{\Ia}[2]{\underset{#1}{\operatorname{I}}\AB{#2}}
\newcommand{\II}[2]{\underset{\substack{#1 \\ #2}}{\operatorname{I}}}
\newcommand{\III}[3]{\underset{\substack{#1 \\ #2 \\ #3}}{\operatorname{I}}}
\newcommand{\KL}[2]{\operatorname{D}_{\mathrm{KL}}\AP{#1\middle\vert\middle\vert#2}}
\newcommand{\RD}[3]{\operatorname{D}_{#1}\AP{#2\middle\vert\middle\vert#3}}
\newcommand{\Dtv}{\operatorname{d}_{\text{tv}}}
\newcommand{\Dtva}[1]{\operatorname{d}_{\text{tv}}\AP{#1}}
\newcommand{\En}{\operatorname{H}}
\newcommand{\Ena}[1]{\operatorname{H}\AP{#1}}
\newcommand{\Argmin}[1]{\underset{#1}{\operatorname{arg\,min}}\,}
\newcommand{\Argmax}[1]{\underset{#1}{\operatorname{arg\,max}}\,}
\newcommand{\Nats}{\mathbb{N}}
\newcommand{\Ints}{\mathbb{Z}}
\newcommand{\Rats}{\mathbb{Q}}
\newcommand{\Reals}{\mathbb{R}}
\newcommand{\Coms}{\mathbb{C}}
\newcommand{\Id}{\mathrm{I}}
\newcommand{\PD}{\mathrm{PD}}
\newcommand{\PSD}{\mathrm{PSD}}
\newcommand{\Hom}{\mathrm{Hom}}
\newcommand{\End}{\mathrm{End}}
\DeclareMathOperator{\Img}{im}
\DeclareMathOperator{\Ker}{ker}
\newcommand{\Mor}{\mathrm{Mor}}
\newcommand{\Pt}{\boldsymbol{\mathrm{pt}}}
\newcommand{\Lim}[1]{\lim_{#1 \rightarrow \infty}}
\newcommand{\LimInf}[1]{\liminf_{#1 \rightarrow \infty}}
\newcommand{\LimSup}[1]{\limsup_{#1 \rightarrow \infty}}
\newcommand{\D}{\mathrm{d}} % differential
\newcommand{\La}{\mathcal{L}}
\newcommand{\K}{\xrightarrow{\mathrm{k}}}
\newcommand{\PF}{\xrightarrow{\circ}}
\newcommand{\PS}[1]{\mathcal{P}\AP{#1}} % power set
\newcommand{\Estr}{\boldsymbol{\lambda}} % empty string
\newcommand{\KD}[1]{\boldsymbol{1}_{#1}}
\newcommand{\St}{\mathcal{S}}
\newcommand{\A}{\mathcal{A}}
\newcommand{\AX}{\A\sqcup\{\bot\}}
\newcommand{\Ob}{\mathcal{O}}
\newcommand{\AO}{\AP{\A\times\Ob}}
\newcommand{\FH}{\AO^*}
\newcommand{\FHS}{\AP{\A\times\St}^*}
\newcommand{\R}{\mathcal{R}}
\newcommand{\T}{\mathcal{T}}
\newcommand{\Hy}{\mathcal{H}}
\newcommand{\ER}{\mathrm{E}}
\newcommand{\Con}{{\boldsymbol{\mathrm{ConSet}}}}
\DeclareMathOperator{\Cone}{Cone}
\newcommand{\Ht}{\mathrm{h}}
\newcommand{\In}{\mathcal{I}}
\newcommand{\IS}{\mathcal{IS}}
\newcommand{\Prj}{\mathrm{pr}}
\newcommand{\Prjo}{\mathrm{pr}^\omega_n}
\DeclareMathOperator{\RVO}{\dim_{RVO}}
\DeclareMathOperator{\MB}{\dim_{MB}}
\newcommand{\DRVO}{D_{\mathrm{RVO}}}
\newcommand{\DMB}{D_{\mathrm{MB}}}
\newcommand{\Est}{\mathrm{est}}
\newcommand{\PE}{\pi_\Est}
\newcommand{\X}{\mathcal{X}}
\newcommand{\Y}{\mathcal{Y}}
\newcommand{\V}{\mathrm{V}}
\newcommand{\Q}{\mathrm{Q}}
\newcommand{\EU}{\mathrm{EU}}
\newcommand{\Reg}{\mathrm{R}}
\newcommand{\PSR}{\text{PS}}
\newcommand{\THy}{Y_*}
\newcommand{\SHy}{Y}
\newcommand{\AT}{\mathrm{A}}
\newcommand{\Ev}{\mathcal{E}}
\newcommand{\ET}{N}
\newcommand{\IT}{M}
\newcommand{\TE}[1]{{\operatorname{E}_k}\AB{#1}}
\newcommand{\Fi}{\mathfrak{H}}
\newcommand{\CSE}{G}
\newcommand{\F}{\mathcal{F}}
\newcommand{\N}{\mathrm{N}}
\newcommand{\LS}{\mathrm{LS}}
\newcommand{\CS}{\mathrm{CS}}
\newcommand{\W}{\mathrm{W}}$$

**TLDR:** We define a variant of reinforcement learning in which the reward is not perceived directly, but can be estimated at any given moment by some (possibly costly) experiment. The reward function is no longer a function of the observation history, but a different object that we call "instrumental reward function". We give two definitions of instrumental reward function and prove their equivalence. We also derive a regret bound for this setting.

# Background

In "classical" reinforcement learning the agent perceives the reward signal on every round of its interaction with the environment, whether through a distinct input channel or through some given way to compute the reward from the interaction history so far. On the other hand, we can rather easily imagine agents that optimize properties of their environment that they do not directly perceive. For example, if Alice, who lives in Dominica, donates money to the Against Malaria Foundation in order to save someone in Africa, then the result is usually not visible to Alice at the time it occurs, if ever. Similarly, Clippy the paperclip maximizer doesn't always perceive all the paperclips in the universe. Moreover, we might want to design agents that, in order to estimate the reward, direct queries to humans (which is costly and cannot be done continuously non-stop).

Now, it is possible to define the perceived reward as the *subjective expected value* of the "true" imperceptible reward (see the Results section for details). Although this transformation preserves expected utility, it does *not* preserve Bayesian regret. Indeed, Bayesian regret is the difference between the expected utility attained by the agent and the expected utility attained by a "reference" agent that knows the true environment from the onset. However, after the transformation, the reference agent will behave as if it knows the observable dynamics of the true environment but still pretends not to know the true environment for the purpose of computing the reward. Therefore, regret analysis requires us to consider the imperceptible reward honestly. In fact, as we will see, certain assumptions about the imperceptible reward function are needed even to make the problem learnable at all. Finally, this transformation makes the reward function more complex and hence applying a "generic" reinforcement learning algorithm after the transformation (instead of exploiting the special form of the resulting reward function) might carry a significant computational complexity penalty.

**Related Work:** [De Blanc 2011](https://arxiv.org/abs/1105.3821) studies so called "ontological crises". That is, de Blanc examines the problem of translating a reward function from one ontology into another. Here, we avoid this problem by considering reward functions that are automatically defined in *all* ontologies. That said, it might still be interesting to think about how to specify our type of reward function starting from a reward function that is only defined in one particular ontology. We will return to this in the Discussion section.

[Krueger et al 2016](https://pdfs.semanticscholar.org/a47f/52b25ce1e56a03876d9c0fd7c45e63270eb4.pdf) consider a setting where querying the reward is instantaneous and has a fixed cost. This is a special case of our setting, but we allow a much more general type of query and cost. Also, Krueger et al don't derive any theoretical regret bound (but they do present some experimental results).

Finally, multi-armed bandits with partial monitoring are closely related, see for example [Bartok et al 2013](http://www.mit.edu/~rakhlin/papers/partial_monitoring.pdf). However, bandits by definition assume a stateless environment, and also our approach is rather different than what is usually studied in partial monitoring.

The literature study was very cursory and I will be glad to know about prior work I missed!

# Results

## Partially Observable MDPs with Imperceptible Rewards

Partially Observable Markov Decision Processes (POMDPs) serve as a natural starting point for thinking about imperceptible rewards. Indeed, it might seem like all we have to do is consider RL in a POMDP environment and let the reward to be a function of the (imperceptible) state. However, this setting is in general unlearnable even given assumptions that rule out traps.

A (finite) POMDP is defined by non-empty finite sets $\St$ (states), $\A$ (actions) and $\Ob$ (observations), the transition kernel $\T:\St\times\A\K\St\times\Ob$ and the reward function $\R:\St\rightarrow[0,1]$. As opposed to the "classical" definition of POMDP, we allow the value of $\R$ is to be imperceptible. The perceptible setting is a special case of the imperceptible setting: we can always encode the reward into the observation.

To formulate a learning problem, we assume $\St$, $\A$ and $\Ob$ to be fixed and an initial state $s_0\in\St$ to be given, while $\T$ and $\R$ are unknown and belong to some hypothesis class $\Hy$:

$$\Hy\subseteq\AC{\St\times\A\K\St\times\Ob}\times\bigg\{\St\rightarrow[0,1]\bigg\}$$

Such a problem can be unlearnable even if $\R$ is known and there are no irreversible events that can happen:

**Example 1**

*Suppose that $\St=\AC{s_0,s_-,s_+}$, $\A=\AC{a_-,a_+}$, $\Ob=\AC{\bot}$, $\R\AP{s_0}=\frac{1}{2}$, $\R\AP{s_-}=0, \R\AP{s_+}=1$ and $\Hy=\AC{\AP{\T_-,\R},\AP{\T_+,\R}}$ where for any $s\in\St$*

$$\T_-\APM{s_+,\bot}{s,a_-}=1$$
$$\T_-\APM{s_-,\bot}{s,a_+}=1$$ 
$$\T_+\APM{s_+,\bot}{s,a_+}=1$$
$$\T_+\APM{s_-,\bot}{s,a_-}=1$$ 

*Since $\Abs{\Ob}=1$, there is no way to gain any information about which hypothesis is correct. Moreover, the optimal policies for the two hypotheses are different. Namely, for $\T_+$ we should always take action $a_+$ and for $\T_-$ we should always take action $a_-$.*

To formalize and illustrate the discussion in the Background section, suppose $\Hy$ is Borel and $\zeta\in\Delta\Hy$ is the prior. We can then define the "perceived effective reward" $\ER\R:\FH\rightarrow[0,1]$ by

$$\ER\R(ao):=\CE{\substack{(\T,\R)\sim\zeta\\\AP{s_{n+1},o'_n}\sim\T\AP{s_n,a_n}}}{\R\AP{s_{\Abs{h}}}}{o'=o}$$

It is then easy to see that the $\ER$ operator preserves expected utility: given any policy $\pi:\FH\K \A$ and $m\in\Nats$

$$\Ea{\substack{(\T,\R)\sim\zeta\\a_n\sim\pi\AP{ao_{:n}}\\\AP{s_{n+1},o_n}\sim\T\AP{s_n,a_n}}}{\ER\R\AP{ao_{:m}}}=\Ea{\substack{(\T,\R)\sim\zeta\\a_n\sim\pi\AP{ao_{:n}}\\\AP{s_{n+1},o_n}\sim\T\AP{s_n,a_n}}}{\R\AP{s_m}}$$

and therefore, for any geometric time discount parameter $\gamma\in[0,1)$

$$\Ea{\substack{(\T,\R)\sim\zeta\\a_n\sim\pi\AP{ao_{:n}}\\\AP{s_{n+1},o_n}\sim\T\AP{s_n,a_n}}}{\sum_{n=0}^\infty\gamma^n\ER\R\AP{ao_{:n}}}=\Ea{\substack{(\T,\R)\sim\zeta\\a_n\sim\pi\AP{ao_{:n}}\\\AP{s_{n+1},o_n}\sim\T\AP{s_n,a_n}}}{\sum_{n=0}^\infty\gamma^n\R\AP{s_n}}$$

On the other hand, Bayesian regret is not preserved since, in general

$$\Ea{(\T,\R)\sim\zeta}{\max_{\pi}\Ea{aos\sim\T\pi}{\sum_{n=0}^\infty\gamma^n\ER\R\AP{ao_{:n}}}}\ne\Ea{(\T,\R)\sim\zeta}{\max_{\pi}\Ea{aos\sim\T\pi}{\sum_{n=0}^\infty\gamma^n\R\AP{s_n}}}$$

Here $aos\sim\T\pi$ is shorthand notation for the same probability distribution as before.

Indeed, in Example 1 the LHS of the above is $\frac{1}{2}\cdot\frac{1}{1-\gamma}$ since $\ER\R\equiv\frac{1}{2}$, whereas the RHS is $\frac{1}{2}+\frac{\gamma}{1-\gamma}$.

The pathology of Example 1 comes about because reward is not only imperceptible but entirely *unobservable*. That is, no experiment can produce any information about whether the reward on a given round $n > 0$ was 0 or 1. More specifically, the states $s_-$ and $s_+$ are assigned different rewards, but there is no observable difference between them. It is as if Alice would assign value, not to people in Africa (whose existence and well-being can be measured) but to some Flying Spaghetti Monster s.t. the world behaves exactly the same regardless of its existence or condition.

This observation suggests that, instead of assigning rewards to states which are just abstract labels in a model, we should assign rewards to states that are defined in terms of the observable consequences of the interaction of the agent with the environment. This leads us to the notion of "instrumental state", which we will now define formally.

## Instrumental States and Reward Functions

First, we introduce some technical definitions for notational convenience.

**Definition 1**

*$\Con$ is the category whose objects are pairs $(V,C)$ where $V$ is a real vector space and $C$ is a convex subset of $V$, and whose morphisms are*

$$\Mor\AP{(V,C),(W,D)}:=$$
$$\ACM{f:C\rightarrow D}{\exists A \in \Hom(V,W),w\in W \forall v\in C: f(v)=Av+w}$$

We omit describing identity and composition of morphisms since they are obvious.

It is easy to see that $\Con$ has arbitrary limits. In particular, $\Con$ has a final object that we denote by $\Pt$ (the one point set), products ($(V,C)\times(W,D)\cong(V\oplus W,C\times D)$) and inverse limits of sequences. For any finite set $A$, $\AP{\Reals^A,\Delta A}$ is an object in $\Con$. Also, we will sometimes abuse notation by regarding $C$ as an object of $\Con$ instead of $(V,C)$ (i.e. making $V$ implicit).

**Definition 2**

*The functor $\Cone:\Con\rightarrow\Con$ is defined by*

$$\Cone{(V,C)}:=\AP{V\oplus\Reals,\ACM{(\lambda v,\lambda)}{\lambda\in[0,1], v\in C}}$$
$$\AP{\Cone{f}}(\lambda v, \lambda):=\AP{\lambda f(v), \lambda}$$

**Definition 3**

*For any $C\in\Con$, we define $\Ht_{C}:\Cone{C}\rightarrow[0,1]$ by*

$$\Ht_{C}(\lambda v, \lambda):=\lambda$$

Note that $\Ht$ is a natural transformation from $\Cone$ to the constant functor with value $[0,1]$.

Given $C\in\Con$ and $x\in \Cone C$ s.t. $x=(u,\lambda)$ for $\lambda > 0$, we denote $[x]:=\lambda^{-1}u\in C$.

Now, we are ready to define instrumental states. We fix the sets $\A$ and $\Ob$.

**Definition 4**

*For any $n\in\Nats$, we define* $\IS_n\in\Con$, the space of $n$ time step instrumental states, *recursively by*

$$\IS_0:=\Pt$$
$$\IS_{n+1}:=\prod_{a\in\A}\AP{\prod_{o\in\Ob}\Ht_{\IS_n}}^{-1}(\Delta\Ob)$$

Here, $\prod_{o\in\Ob}\Ht_{\IS_n}$ is a mapping from $\prod_{o\in\Ob}\Cone\IS_n$ to $[0,1]^\Ob$. The inverse image of a convex set (in this case $\Delta\Ob\subseteq[0,1]^\Ob$) under an affine mapping (in this case $\prod_{o\in\Ob}\Ht_{\IS_n}$) is also a convex set.

The semantics of Definition 4 is as follows. Any $\alpha\in\AP{\prod_{o\in\Ob}\Ht_{\IS_n}}^{-1}(\Delta\Ob)$ can be regarded as a pair consisting of some $\alpha'\in\Delta\Ob$ (the image of $\alpha$ under $\prod_{o\in\Ob}\Ht_{\IS_n}$) and a mapping $\alpha'':\Supp{\alpha'}\rightarrow\IS_n$ defined by $\alpha''(o):=\AB{\alpha_o}$. Given $\theta\in\IS_{n+1}$, $\theta_{a}'$ is the probability distribution over observations resulting from taking action $a$ in state $\theta$, whereas $\theta_{a}''(o)$ is the state resulting from taking action a in state $\theta$ conditional on observing $o$. This semantics can be made more formal as follows:

**Definition 5**

*Given $\theta\in\IS_n$, we define $\Dom\theta\subseteq\FH$ recursively as follows:*

1. $\Estr\in\Dom\theta$

2. *For all $h\in\FH$, $a\in\A$ and $o\in\Ob$: $aoh\in\Dom\theta$ iff $n>0$, $\Ht_{\IS_{n-1}}(\theta_{ao})>0$ and $h\in\Dom\AB{\theta_{ao}}$.*

**Definition 6**

*Given $\theta\in\IS_n$, $h\in\Dom\theta$ and $a\in\A$, and assuming that $\Abs{h}<n$, we recursively define $\theta(ha)\in\Delta\Ob$ by*

1. *For $h=\Estr$: $\theta( o\mid a):=\Ht_{\IS_{n-1}}(\theta_{ao})$*

2. *For $h=a'o'h'$ with some $a'\in\A$, $o'\in\Ob$ and $h'\in\FH$: $\theta(ha):=\AB{\theta_{a'o'}}(h'a)$*

The point of defining $\IS_n$ in this manner is that (i) different points in $\IS_n$ correspond to states that are truly not equivalent, i.e. can be empirically distinguished (statistically) and (ii) convex combinations of points in $\IS_n$ correspond precisely to probabilistic mixtures. Formally, we have:

**Definition 7**

*Given $\theta\in\IS_n$ and $\pi:\AO^{<n}\K\A$ (a policy), we define $\theta\pi\in\Delta\AO^n$ (probability distribution over histories resulting from following policy $\pi$ in state $\theta$) by*

$$\Pa{ao\sim\theta\pi}{a_m=a_*}=\Ea{ao\sim\theta\pi}{\pi\APM{a_*}{ao_{:m}}}$$
$$\Pa{ao\sim\theta\pi}{o_m=o_*}=\Ea{ao\sim\theta\pi}{\theta\APM{o_*}{ao_{:m}a_m}}$$

**Proposition 1**

*Consider some $\theta,\theta'\in\IS_n$ and assume that for any $\pi:\AO^{<n}\rightarrow\A$, $\theta\pi=\theta'\pi$. Then, $\theta=\theta'$.*

**Proposition 2**

*Consider some $\theta,\theta'\in\IS_n$,  $\pi:\AO^{<n}\K\A$ and $p\in[0,1]$. Then*

$$\AP{p\theta+(1-p)\theta'}\pi=p\theta\pi+(1-p)\theta'\pi$$

$\IS_n$ is a bounded polytope but in general it is *not} a simplex: we cannot regard it as just probability distributions over some set. For example, if $\Abs{\A}=\Abs{\Ob}=2$, then it's easy to see that $\IS_1$ is a square (one axis is the probability to get a given observation when taking one action, the other axis is the probability for the other action). On the other hand, if $\Abs{\A}=1$ then $\IS_n$ *is* a simplex: it is canonically isomorphic to $\Delta\Ob^n$.

There are a natural morphisms $\Prj_n:\IS_{n+1}\rightarrow\IS_n$ whose semantics is forgetting about the behavior of the state at time step $n$:

**Definition 8**

*We define $\Prj_n:\IS_{n+1}\rightarrow\IS_n$ for any $n\in\Nats$ recursively. $\Prj_0$ is the unique morphism from $\IS_1$ to $\IS_0\cong\Pt$. For any $n\in\Nats$, $\Prj_{n+1}$ is given by*

$$\Prj_{n+1}(\theta)_{ao}:=\AP{\Cone{\Prj_n}}\AP{\theta_{ao}}$$

We thereby get a sequence $\IS_0 \leftarrow \IS_1 \leftarrow \IS_2 \leftarrow \ldots$

**Definition 9**

*We define* $\IS_\omega$, the space of (infinite time step) instrumental states *by*

$$\IS_\omega:=\varprojlim_n \IS_n$$

*We denote the canonical projections by* $\Prjo:\IS_\omega\rightarrow\IS_n$.

Of course, $\IS_\omega$ can also be regarded as the space of all possible stochastic environments. Specifically, we have:

**Definition 10**

*For any $\mu\in\IS_\omega$ we define $\Dom\mu\in\FH$ by*

$$\Dom\mu:=\bigcup_{n=0}^\infty \Dom\Prjo\mu$$

**Definition 11**

*Given $\mu\in\IS_\omega$, $h\in\Dom\mu$ and $a\in\A$, we define $\mu(ha)\in\Delta\Ob$ by*

$$\mu(ha):=\Prj^\omega_{\Abs{h}+1}\mu(ha)$$

Like in the finite time case, we have

**Definition 12**

*Given $\mu\in\IS_\omega$ and $\pi:\FH\K\A$, we define $\mu\pi\in\Delta\AO^\omega$ by*

$$\Pa{ao\sim\mu\pi}{a_n=a_*}=\Ea{ao\sim\mu\pi}{\pi\APM{a_*}{ao_{:n}}}$$
$$\Pa{ao\sim\mu\pi}{o_n=o_*}=\Ea{ao\sim\mu\pi}{\mu\APM{o_*}{ao_{:n}a_n}}$$

**Proposition 3**

*Consider some $\mu,\mu'\in\IS_\omega$ and assume that for any $\pi:\FH\rightarrow\A$, $\mu\pi=\mu'\pi$. Then, $\mu=\mu'$.*

**Proposition 4**

*Consider some $\mu,\mu'\in\IS_\omega$,  $\pi:\FH\K\A$ and $p\in[0,1]$. Then*

$$\AP{p\mu+(1-p)\mu'}\pi=p\mu\pi+(1-p)\mu'\pi$$

For each $n\in\Nats$, $\IS_n$ is finite-dimensional and therefore has a natural topology. $\IS_\omega$ also becomes a topological space by equipping it with the inverse limit topology. Since the $\IS_n$ are closed and bounded they are compact, and therefore $\IS_\omega$ is also compact by Tychonoff's theorem. In the special case $\Abs{\A}=1$, $\IS_\omega\cong\Delta\Ob^\omega$ and the inverse limit topology is the weak topology for probability measures, defined w.r.t. the product topology on $\Ob^\omega$.

We can now give the first definition of an instrumental reward function: a continuous affine function $\R: \IS_\omega \rightarrow \Reals$. Why affine? A convex linear combination of instrumental states is empirically indistinguishable from a probabilistic lottery. If we assign expected values to probabilistic lotteries (as we should by the VNM theorem), then we must also assign them to convex linear combinations of instrumental states: otherwise our reward again depends on entirely unobservable parameters of our model.

An alternative approach is to consider the notion of "experiment" explicitly.

We will use the notation $\X^{\leq\omega}:=\X^*\sqcup\X^\omega$. Given a logical condition $\phi$, the symbol $\KD{\phi}$ will denote 1 when $\phi$ is true and 0 when $\phi$ is false.

**Definition 13**

*Given $\pi: \FH\K\AX$ and $\mu\in\IS_\omega$, we define $\mu\pi\in\Delta\AO^{\leq\omega}$ by*

$$\Pa{ao\sim\mu\pi}{a_n=a_*}=\Ea{ao\sim\mu\pi}{\KD{\Abs{ao}\geq n}\pi\APM{a_*}{ao_{:n}}}$$
$$\Pa{ao\sim\mu\pi}{o_n=o_*}=\Ea{ao\sim\mu\pi}{\KD{\Abs{ao}> n}\mu\APM{o_*}{ao_{:n}a_n}}$$

*$\pi$ is said to be a* terminable policy *when for any $\mu\in\IS_\omega$*

$$\Pa{h\sim\mu\pi}{\Abs{h}<\infty} = 1$$

That is, a terminable policy is allowed to produce a special token $\bot$ which terminates the "experiment" (instead of choosing an action), and we require that, for any environment, this token will be eventually produced with probability 1.

**Definition 14**

*Given a terminable policy $\pi$ and a bounded function $r:\FH\rightarrow\Reals$, we define the function $\R_{\pi r}:\IS_\omega\rightarrow\Reals$ by*

$$\R_{\pi r}(\mu):=\Ea{h\sim\mu\pi}{r(h)}$$

This gives us a second definition of instrumental reward functions. In fact, the two definitions are equivalent:

**Theorem 1**

*For any terminable policy $\pi$ and bounded function $r:\FH\rightarrow\Reals$, $\R_{\pi r}$ is continuous and affine. Conversely, for any continuous affine $\R:\IS_\omega\rightarrow[0,1]$, there exists a terminable policy $\pi$ and $r:\FH\rightarrow[-2,2]$ s.t. $\R = \R_{\pi r}$.*

Putting the second part of the theorem into words, for any instrumental reward function (in the sense of the first definition) there is some experiment the agent can do which yields an *unbiased estimate* of the reward for the instrumental state that existed at the beginning of the experiment.

The range $[-2,2]$ is not optimal, but for the regret bound in the next subsection, it's only important that it is bounded by some fixed constant.

To illustrate this concept of instrumental reward function, imagine that Clippy has access to a black box with a collection of levers on its outside. Pulling the levers produces some sounds that hint at what happens inside the box, but are not enough to determine it with certainty. The box has a shuttered glass window, whose shutter can be opened from the outside. Through the window, Clippy can see a jumble of scrap metal, mechanical manipulators that are controlled by the levers (and can be used to shape the scrap metal), and also a few mice running around the box and wreaking havoc. However, it is not possible to control the manipulators while the shutter is open. Worse, while opening the shutter allows seeing a snapshot of the shape of the metal, it also causes the manipulators to move chaotically, ruining this shape. So, Clippy can experiment with the levers and occasionally open the shutter to test the result. However, in order to produce and maintain paperclips inside the box, the shutter has to be kept closed (and the paperclips hidden) most of the time.

It is also possible to consider reward functions of the more general form $\R:\FH\times\IS_\omega\rightarrow\Reals$, required to be continuous and affine in the second argument. Such a reward function depends both on the current (unknown) instrumental state of the environment and the observable history so far. By Theorem 1, such a reward can be equivalently described in terms of a family $\AC{\pi_h:\FH\rightarrow\AX}_{h\in\FH}$ of terminable policies and a family $\AC{r_h:\FH\rightarrow\Reals}_{h\in\FH}$ of bounded functions s.t. 

$$\R(h,\mu)=\R_{\pi_h r_h}(\mu)$$

This means that, the value of reward can be estimated empirically, but only if the agent remembers the entire observation history. If the history is forgotten at some point, it might never be able to estimate the reward again. We will such reward functions "semi-instrumental".

Although semi-instrumental reward functions are more general than instrumental reward functions, I think that there is some interest in studying the narrower class. Arguably, instrumental reward functions are a better model of what counts as "consequentialist" or "goal-directed" behavior, since they depend only on the state of the environment. Indeed, it is easy to construct a semi-instrumental reward function that makes any given policy Bayes-optimal for any given prior, so semi-instrumental reward functions are incapable (without further assumptions) to distinguish between "intelligent" and "unintelligent" behavior. On the other hand, optimality w.r.t. some instrumental reward function seems like a stronger condition.

In order to derive a regret bound, we will restrict attention to those reward functions for which the terminable policy can be made to terminate within time that has some finite and bounded expected value. I don't know an elegant way to characterize those reward functions in general, but we will describe one class of such functions.

**Definition 15**

*Consider any $C\in\Con$. Then, we can define the* total variation distance $\Dtv:C\times C\rightarrow\Reals$ *by*

$$\Dtv(x,y):=\sup_{r\in\Mor\AP{C,[0,1]}} \Abs{r(x)-r(y)}$$

In general, $\Dtv$ is a pseudometric. Moreover, when $C$ is finite-dimensional and bounded, it is a metrization of the natural topology. For a finite set $A$ and $C=\Delta A$, $\Dtv$ is just the usual total variation metric. For $C$ a ball of unit diameter in Euclidean space, $\Dtv$ is the Euclidean metric.

**Definition 16**

*Consider any $\lambda\in(0,1)$. We define the metric* $\Dtv^\lambda$ *on $\IS_\omega$ by*

$$\Dtv^\lambda(\mu,\nu):=\sup_{n\in\Nats}{\lambda^n\Dtv\AP{\Prjo\mu,\Prjo\nu}}$$

For any $\lambda$, $\Dtv^\lambda$ is a metrization of the inverse limit topology on $\IS_\omega$.

**Proposition 5**

*Consider any $\lambda\in(0,1)$ and $\R:\IS_\omega\rightarrow\Reals$ affine and Lipschitz with respect to $\Dtv^\lambda$. Then there is a terminable policy $\pi$ and a bounded function $r:\FH\rightarrow\Reals$ s.t. $\R=\R_{\pi r}$ and*

$$\sup_{\mu\in\IS_\omega}\Ea{h\sim\mu\pi}{\Abs{h}} < \infty$$

Note that $\lambda$ is a parameter reminiscent of geometric time discount that constraints the shape of the reward function. However, in the regret analysis that follows, it is *not* the same as the actual geometric time discount parameter $\gamma$. In particular, we consider the asymptotics in which the latter approaches 1, while the reward function is assumed to be fixed. It might be interesting to study regimes in which both approach 1, but we will not attempt it at present.

## A Regret Bound for RL with Instrumental Rewards

Fix $\A$ and $\Ob$. For any finite set $\St$ and $\T:\St\times\A\K\St\times\Ob$, there is a unique mapping $\In_\T:\St\rightarrow\IS_{\omega}$ s.t. 

$$\In_\T(s)_{ao}=\AP{\sum_{s'\in\St}\T\APM{s',o}{s,a}\In_T\AP{s'},\sum_{s'\in\St}\T\APM{s',o}{s,a}}$$

That is, $\In_\T(s)$ is just the instrumental state corresponding to the POMDP state $s$.

Given $\R:\IS_\omega\rightarrow\Reals$ continuous affine, we get for any $\St$ and $\T$ the POMDP reward function $\R\circ\In_\T$. Hence, one natural setting for regret analysis is fixing $\R$ and $\St$ and considering a hypothesis class of transition kernels

$$\Hy\subseteq\AC{\St\times\A\K\St\times\Ob}$$

However, regret analysis for POMDPs involves some technical complexity, and we prefer to start with a simpler setting. Hopefully, we will address the POMDP case in a followup essay.

Suppose that $\Ob=\St$. Then, given any MPD transition kernel $\T:\St\times\A\K\St$, we can define the POMDP transition kernel $\T^\sharp:\St\times\A\K\St\times\Ob$ by

$$\T^\sharp\APM{s',s''}{s,a}:=\KD{s'=s''}\T\APM{s'}{s,a}$$

Fix $\R:\St\times\IS_\omega\rightarrow[0,1]$ continuous affine in the second argument (a type of semi-instrumental reward function). For any $\T$ as above, we get the induced reward function $\R_\T:\St\rightarrow[0,1]$ given by $\R_\T(s):=\R\AP{s,\In_{\T^\sharp}(s)}$. We can now consider the learning problem corresponding to a hypothesis class of MDP transition kernels

$$\Hy\subseteq\AC{\St\times\A\K\St}$$

It might seem odd to consider a setting with fully observable states in the context of imperceptible rewards. However, we can think about it as follows: what we observe is only a label whose physical meaning is unknown. Only given the (unknown) transition kernel, such a label can be interpreted as assigned a reward.

For example, imagine a robot tasked with sorting balls into bins according to their weight. Some of the balls are solid gold and some of them are solid silver, so it's in principle possible to know their weight just by looking at them. However, the robot doesn't know a priori whether silver or gold is heavier. On the other hand, the robot can perform some experiment with a ball to determine its weight. In this situation, the reward is imperceptible even if the state (e.g. the locations, colors and sizes of the balls, the locations and shapes of the bins and the location of the robot and the state of its manipulators) is fully observable.

Using the concepts of MB dimension and RVO dimension we defined in a [previous essay](https://www.alignmentforum.org/posts/Qa5jG9z9dC6E4s9JH/dimensional-regret-without-resets), we can formulate the regret bound.

**Theorem 2**

*There is some $C\in\Reals^+$ s.t. the following holds.*

*Consider any finite non-empty sets $\St$ and $\A$, function continuous affine in the second argument $\R:\St\times\IS_\omega\rightarrow[0,1]$, closed set $\Hy\subseteq\AC{\St\times\A\K\St}$ and Borel probability measure $\zeta$ on $\Hy$ (prior). Suppose $\PE:\St\times\FHS\K\AX$ is s.t. for any $s\in\St$, $\PE(s,\cdot)$ is terminable, and $r:\St\times\FHS\rightarrow[0,1]$ is a bounded function s.t.*

$$\R(s,\cdot)=\R_{\pi_{\mathrm{est}}(s,\cdot)r(s,\cdot)}$$ 

*Define the maximal expected reward estimation time $t_\Est$ by*

$$t_\Est=\sup_{s\in\St,\mu\in\IS_\omega}\Ea{h\sim\mu\pi_{\mathrm{est}}(s,\cdot)}{\Abs{h}}$$

*Define the maximal bias span $\tau$ by*

$$\tau:=\limsup_{\gamma\rightarrow1}{\max_{\T\in\Hy}\frac{\max_{s\in\St}\V_{\T\R_\T}(s,\gamma)-\min_{s\in\St}\V_{\T\R_\T}(s,\gamma)}{1-\gamma}}$$

*Define $\Hy_\R\subseteq\AC{\St\rightarrow\Reals}$ by*

$$\Hy_\R:=\ACM{\R_\T}{T\in\Hy}$$

*Denote $\DMB:=\MB{\Hy_\R}$ and $\DRVO:=\RVO{\Hy_\R}$. Define the Bayesian regret $\Reg(\gamma)$ by*

$$\Reg(\gamma):=\Ea{\T\sim\zeta}{\EU^*_{\T\R_\T}(\gamma)-\EU^{\pi^\dagger_\gamma}_{\T\R_\T}(\gamma)}$$

*Then, there is a family of policies $\AC{\pi^\dagger_\gamma:\St^*\times\St\K\A}_{\gamma\in(0,1)}$ s.t.*

$$\limsup_{\gamma \rightarrow 1}\frac{\Reg(\gamma)}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\AP{\DRVO+1}(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\leq C$$

# Discussion

## More on the Regret Bound

It might appear odd that the regret bound in Theorem 2 depends on the dimensions of the class of reward functions, but not on the dimensions on the class of transition kernels, like in the perceptible case. The reason for this is that we only give the asymptotic form. Asymptotically, the leading term is $O\AP{\sqrt[3]{\AP{1-\gamma}\ln{\frac{1}{1-\gamma}}}}$ and its coefficient depends only on those parameters that appear in Theorem 2. However, examining the proof reveals that there is also an $O\AP{\sqrt{\AP{1-\gamma}\ln{\frac{1}{1-\gamma}}}}$ term that has the same form as the regret bound in the perceptible case. For the sake of brevity and simplicity we will *not* attempt to write down a more precise regret bound that reflects the role of the dimensions of the class of transition kernels, but in principle it is not difficult. We must keep in mind, however, that in practice the other term might be significant: *a priori* the dimensions of the class of transition kernels are only bounded by a polynomial in $\Abs{\St}$ and $\Abs{\A}$ and the latter might be exponentially big for realistic models. 

## The Death of the Agent and Kamikaze Strategies

There is one potential application of defining rewards that are not a direct function of observations which seems not supported by instrumental rewards as we defined them. Namely, one can imagine agents that are motivated to follow a certain strategy that is designed to *destroy the agent* but produce some desirable results in the external world ("kamikaze strategy"). In other words, although survival is a convergent instrumental goal, it seems entirely reasonable for it to be sacrificed in certain specific scenarios. To give an example, imagine a bodyguard robot whose primary goal is keeping a certain person alive. If assassins shoot at the person, and the only wait to stop them is for the robot to block the bullets with its body, then it can be the optimal strategy, even if it will destroy the robot and prevent it from continuing its function as bodyguard (assuming that e.g. it will give the person a chance to escape or someone else a chance to stop the assassins).

Our formalism doesn't directly address the possibility of the agent's death, because the sequence of actions and observations is assumed to be infinite. One simple way to accommodate death is postulating a special observation $\bot\in\Ob$ s.t. it is never received before death and always received after death. If we do this, then death corresponds to a specific instrumental state and therefore its reward is a fixed constant. This seems incompatible with kamikaze strategies where the decision of self-sacrifice is contingent on conditions in the external world after death. 

Another approach is assuming the agent becomes a "ghost": it keeps receiving observations which reflect the actual physical world but its actions have no effect. Such ghosts might theoretically be produced by a simplicity prior: for example, if the agent is an AI connected to a camera that monitors a room, then we can imagine a virtual video of the same room continuing beyond the AI's shutdown. This allows for different instrumental states after death and can potentially justify kamikaze strategies, but it seems like a very fragile construct and is unlikely to guarantee reasonable behavior.

The problem with death can be viewed from another perspective: our regret analysis assumes a no-traps condition ($\tau<\infty$) whereas death is usually a trap. Therefore, to guarantee rational behavior while accounting for death, we need to operate within a framework that allows for traps. 

One such framework is requiring Bayes-optimality and giving up on learnability. This seems both too weak (because nothing is guaranteed for specific environments) and too strong (because it's [computationally intractable](https://cstheory.stackexchange.com/questions/41396/is-bayes-optimal-rl-of-a-finite-set-of-dfas-feasible)). That said, I think this approach can be salvaged by requiring something somewhat weaker than Bayes-optimality and proving something somewhat weaker than learnability (hopefully I will write on that in a future essay). In any case, once we give up on learnability we can allow unobservable rewards (the general POMDP setting in the beginning of the Results section) which allow handling death and kamikaze strategies easily. Specifically, we can have a plethora of "dead" states that produce only the $\bot$ observation and whose transitions do no depend on the action, but which have different rewards. So, this approach "solves" the problem but at a high cost: no learnability or regret analysis.

Another framework for dealing with traps is [Delegative Reinforcement Learning](https://www.lesswrong.com/posts/5bd75cc58225bf06703754d5/delegative-reinforcement-learning-with-a-merely-sane-advisor) (DRL). In DRL the agent interacts with an external advisor, and is thereby able to successfully navigate all traps that the advisor knows about. In other words, it converges to a policy that is Bayes-optimal with respect to the belief state of the advisor (while the advisor is not able to produce such a policy by itself). Combining DRL with the instrumental rewards formalism should allow accounting for death. Specifically, in any given POMDP hypothesis, the state space will be decomposed as $\St=\St_{\text{dead}}\sqcup\St_{\text{alive}}$, with the following assumptions:

* The transition kernel on states in $\St_{\text{dead}}$ doesn't depend on the action.

* $\St_{\text{dead}}$ is invariant under the dynamics (death is irreversible).

* The reward function on $\St_{\text{dead}}$ can be arbitrary.

* The reward function on $\St_{\text{alive}}$ has to factor through $\In_\T$ (i.e. depend only on the instrumental state), and moreover the policy for estimating the reward function is known to be safe (alternatively, we might let the agent learn a safe estimation policy from some space of candidate policies).

Under these assumptions (or some variant thereof), it seems plausible that we should be able to prove learnability and derive a reasonable regret bound. Formalizing this line of thought is a task for future work.

The DRL approach to kamikaze strategies also has implications on corrigibility. Indeed, if the external advice is compatible with an admissible reward function that recommends shutting down the agent (i.e. upon delegation, the advisor acts to shut down the agent) then a DRL agent will assist with its own shutdown.
This property is preserved by subagents, since creating a subagent is another potentially irreversible action (and therefore must be [vetted](https://www.lesswrong.com/posts/5bd75cc58225bf0670375575/the-learning-theoretic-ai-alignment-research-agenda#5bd75cc58225bf0670375584) by the advisor).

Also, it is tempting to speculate about DRL as a model of human self-sacrifice. We have already speculated before that we can view DRL as model of human learning, where the human's social environment or humanity as a whole is regarded as playing the role of the advisor. Similarly, humans that sacrifice their lives for the sake of their loved ones or the "greater good" can be regarded as heeding that "advise" regarding the rewards of states in which the human doesn't exist. Under this model, we can make sense of self-sacrifices by individual humans but not of hypothetical self-sacrifice by humanity as a whole (potentially augmented by other minds with which we could communicate and find common ground), but, the latter restriction seems compatible with intuition.

## Specifying Instrumental Reward Functions

It might be useful to find natural ways to specify instrumental reward functions. In particular, it is interesting to start with a reward function defined on a specific ontology (POMDP) and somehow extend it to a full instrumental reward function (which, like we said before, induces a reward function on any ontology via the $\In_\T$ mapping).

De Blanc suggests one way to extend reward functions from one POMDP to another, but I don't know whether this operation leads to an instrumental reward function, i.e. whether it is compatible with the constraints imposed by affine dependencies between the states (and I don't see any reason why it should).

Essentially, what we're looking for is a way to extend an affine function from an affine subspace to the entire affine space (the affine subspace is the affine span of the instrumental states corresponding to the states of the initial ontology; note that, if these instrumental states are not affine independent, then we have some constraint on this initial reward function). One natural way to do it is looking for an affine function whose differential (the linear function part) has minimal norm, or choosing some privileged projection operator from the entire space to the affine subspace. However, since the natural norms we have here are not inner product norms, these choices are usually non-unique, and it's possible we can't get much out of it.

A different natural approach is using Occam's razor, i.e. looking for an extension of minimal description length or the expected value of a random extension sampled from a conditional simplicity prior. This requires a natural way to describe instrumental reward functions. We do have such a way: assuming that the $\pi$ and $r$ guaranteed to exist by Theorem 1 can be chosen to be *computable*, the description is the program for those objects with respect to a fixed universal Turing machine (we consider a single program that computes both $\pi$ and $r$ to exploit possible mutual information between the two).

These questions are left for future research.

# Proofs

**Proof of Proposition 1**

We proceed by induction on $n$. For $n=0$ there is nothing to prove since $\IS_0=\Pt$ so $\theta=\theta'$ a priori. Now, suppose $n>0$.

We need to show that for any $a_*\in\A$ and $o_*\in\Ob$, $\theta_{a_*o_*}=\theta'_{a_*o_*}$. To show it for given $a_*$ and $o_*$, we consider some $\pi$ s.t. $\pi(\Estr)=a_*$. Since $\theta\pi=\theta'\pi$, we have

$$\Pa{ao\sim\theta\pi}{o_0=o_*}=\Pa{ao\sim\theta'\pi}{o_0=o_*}$$

By Definition 7, we get,

$$\theta\APM{o_*}{a_*}=\theta'\APM{o_*}{a_*}$$

By Definition 6, we get,

$$\Ht_{\IS_{n-1}}\big(\theta_{a_*o_*}\big)=\Ht_{\IS_{n-1}}\AP{\theta'_{a_*o_*}}$$

If this value vanishes then $\theta_{a_*o_*}=\theta'_{a_*o_*}=\boldsymbol{0}$. Otherwise, consider any $\sigma:\AO^{<n-1}\rightarrow\A$ and define $\pi:\AO^{<n}\rightarrow\A$ by

$$\pi(\Estr):=a_*$$
$$\pi(aoh):=\sigma(h)$$

Definitions 6 and 7 imply that

$$\AB{\theta_{a_*o_*}}\sigma(h)=\frac{\theta\pi(a_*o_*h)}{\theta\APM{o_*}{a_*}}$$

and similarly for $\theta'$. We have $\theta\pi=\theta'\pi$ and $\theta\APM{o_*}{a_*}=\theta'\APM{o_*}{a_*}$, which implies $\Big[\theta_{a_*o_*}\Big]\sigma=\AB{\theta'_{a_*o_*}}\sigma$. By the induction hypothesis, we get $\big[\theta_{a_*o_*}\big]=\AB{\theta'_{a_*o_*}}$. Combining this with $\Ht_{\IS_{n-1}}\big(\theta_{a_*o_*}\big)=\Ht_{\IS_{n-1}}\AP{\theta'_{a_*o_*}}$, we get $\theta_{a_*o_*}=\theta'_{a_*o_*}$. $\blacksquare$

**Proposition A.1**

*Consider any $C\in\Con$, $\theta,\theta'\in\Cone{C}$ and $p\in[0,1]$. Assume that* 

$$\Ht_C\AP{p\theta+(1-p)\theta'}>0$$

*Then*

$$\AB{p\theta+(1-p)\theta'}=\frac{p\Ht_C\big(\theta\big)\big[\theta\big]+(1-p)\Ht_C\AP{\theta'}\AB{\theta'}}{p\Ht_C\big(\theta\big)+(1-p)\Ht_C\AP{\theta'}}$$

Here, $\Ht_C\big(\theta\big)\big[\theta\big]$ is understood to mean $\boldsymbol{0}$ when $\Ht_C\big(\theta\big)=0$ and the same for $\theta'$.

**Proof of Proposition A.1**

Obvious from the definitions.

**Proof of Proposition 2**

Given $n\in\Nats^+$ and some $\alpha,\beta\in\Delta\AO^n$, to show that $\alpha=\beta$ it is sufficient to show that

1. For any $a_*\in\A$ and $o_*\in\Ob$, 

$$\Pa{ao\sim\alpha}{ao_{:1}=a_*o_*}=\Pa{ao\sim\beta}{ao_{:1}=a_*o_*}$$

2. For any $a_*\in\A$ and $o_*\in\Ob$, if $\Pa{ao\sim\alpha}{ao_{:1}=a_*o_*}>0$ then for any $h\in\AO^{n-1}$

$$\CP{ao\sim\alpha}{ao=a_*o_*h}{ao_{:1}=a_*o_*}=\CP{ao\sim\beta}{ao=a_*o_*h}{ao_{:1}=a_*o_*}$$

We will use this to prove the claim by induction on $n$. For $n=0$, there is nothing to prove. For $n>0$, by Definition 7

$$\Pa{ao\sim\AP{p\theta+(1-p)\theta'}\pi}{ao_{:1}=a_*o_*}=\pi\APM{a_*}{\Estr}\AP{p\theta+(1-p)\theta'}\APM{o_*}{ a_*}$$

By Definition 6
$$\Pa{ao\sim\AP{p\theta+(1-p)\theta'}\pi}{ao_{:1}=a_*o_*}=\pi\APM{a_*}{\Estr}\Ht_{\IS_{n-1}}\AP{\AP{p\theta+(1-p)\theta'}_{a_*o_*}}$$

$$\Pa{\AP{p\theta+(1-p)\theta'}\pi}{ao_{:1}=a_*o_*}=p\pi\APM{a_*}{\Estr}\Ht\AP{\theta_{a_*o_*}}+(1-p)\pi\APM{a_*}{\Estr}\Ht\AP{\theta'_{a_*o_*}}$$

$$\Pa{\AP{p\theta+(1-p)\theta'}\pi}{ao_{:1}=a_*o_*}=p\pi\APM{a_*}{\Estr}\theta\APM{o_*}{a_*}+(1-p)\pi\APM{a_*}{\Estr}\theta'\APM{o_*}{a_*}$$

$$\Pa{\AP{p\theta+(1-p)\theta'}\pi}{ao_{:1}=a_*o_*}=p\Pa{\theta\pi}{ao_{:1}=a_*o_*}+(1-p)\Pa{\theta'\pi}{ao_{:1}=a_*o_*}$$

$$\Pa{\AP{p\theta+(1-p)\theta'}\pi}{ao_{:1}=a_*o_*}=\Pa{p\theta\pi+(1-p)\theta\pi}{ao_{:1}=a_*o_*}$$

Furthermore, Definitions 6 and 7 imply that

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{ao_{:1}=a_*o_*}=\Pa{\AB{\AP{p\theta+(1-p)\theta'}_{a_*o_*}}\sigma}{h}$$

Here, $\sigma$ is defined by $\sigma(h):=\pi\AP{a_*o_*h}$. 

Denote

$$q:=\frac{p\Ht\big(\theta_{a_*o_*}\big)}{p\Ht\big(\theta_{a_*o_*}\big)+(1-p)\Ht\big(\theta'_{a_*o_*}\big)}$$

By Proposition A.1

$$\AB{\AP{p\theta+(1-p)\theta'}_{a_*o_*}}=q\big[\theta_{a_*o_*}\big]+(1-q)\AB{\theta'_{a_*o_*}}$$


We get

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{ao_{:1}=a_*o_*}=\Pa{\AP{q\big[\theta_{a_*o_*}\big]+(1-q)\AB{\theta'_{a_*o_*}}}\sigma}{h}$$

By the induction hypothesis, we get

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{ao_{:1}=a_*o_*}=\Pa{q\big[\theta_{a_*o_*}\big]\sigma+(1-q)\AB{\theta'_{a_*o_*}}\sigma}{h}$$

Decomposing the right hand side and applying the same reasoning in reverse,

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{a_*o_*}=q\CP{\theta\pi}{a_*o_*h}{a_*o_*}+(1-q)\CP{\theta'\pi}{a_*o_*h}{a_*o_*}$$

By Definition 6, $q$ can be written as

$$q=\frac{p\theta\APM{o_*}{a_*}}{p\theta\APM{o_*}{a_*}+(1-p)\theta'\APM{o_*}{a_*}}$$

Multiplying the numerator and denominator by $\pi\APM{a_*}{\Estr}$, we get

$$q=\frac{p\pi\APM{a_*}{\Estr}\theta\APM{o_*}{a_*}}{p\pi\APM{a_*}{\Estr}\theta\APM{o_*}{a_*}+(1-p)\pi\APM{a_*}{\Estr}\theta'\APM{o_*}{a_*}}$$

$$q=\frac{p\Pa{\theta\pi}{a_*o_*}}{p\Pa{\theta\pi}{a_*o_*}+(1-p)\Pa{\theta'\pi}{a_*o_*}}$$

Combining this with the previous identity, we get 

$$\ldots=\frac{p\Pa{\theta\pi}{a_*o_*}\CP{\theta\pi}{a_*o_*h}{a_*o_*}+(1-p)\Pa{\theta'\pi}{a_*o_*}\CP{\theta'\pi}{a_*o_*h}{a_*o_*}}{p\Pa{\theta\pi}{a_*o_*}+(1-p)\Pa{\theta'\pi}{a_*o_*}}$$

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{a_*o_*}=\frac{p\Pa{\theta\pi}{a_*o_*h}+(1-p)\Pa{\theta'\pi}{a_*o_*h}}{p\Pa{\theta\pi}{a_*o_*}+(1-p)\Pa{\theta'\pi}{a_*o_*}}$$

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{a_*o_*}=\frac{\Pa{p\theta\pi+(1-p)\theta'\pi}{a_*o_*h}}{\Pa{p\theta\pi+(1-p)\theta'\pi}{a_*o_*}}$$

$$\CP{\AP{p\theta+(1-p)\theta'}\pi}{a_*o_*h}{a_*o_*}=\CP{p\theta\pi+(1-p)\theta'\pi}{a_*o_*h}{a_*o_*}\ \blacksquare$$

Given $\mu\in\Delta\X^\omega$ and $f:\mathcal{X}^\omega\rightarrow\mathcal{X}^n$ defined by $f(x):=x_{:n}$, we will denote $\mu_{:n}:=f_*\mu$.

**Proposition A.2**

*Consider any $C,D\in\Con$ and $f\in\Mor(C,D)$. Then,*

$$\Ht_D\circ \Cone f=h_C$$

**Proof of Proposition A.2**

Obvious from the definitions.

**Proposition A.3**

*Consider any $C,D\in\Con$, $f\in\Mor(C,D)$ and $\theta\in\Cone C\setminus\boldsymbol{0}$. Then,*

$$\AB{\AP{\Cone f}(\theta)}=f\AP{\AB{\theta}}$$

**Proof of Proposition A.3**

Obvious from the definitions.

**Proposition A.4**

*Consider any $n\in\Nats$, $\theta\in\IS_{n+1}$, $a\in\A$ and $h\in\Dom\theta$ s.t. $\Abs{h}< n$. Then,* 

$$\Prj_n(\theta)(ha)=\theta(ha)$$

**Proof of Proposition A.4**

We prove the claim by induction on $n$. For $n=0$, there is nothing to prove. Assume $n>0$. For $h=\Estr$, we have

$$\Prj_n(\theta)\APM{o}{a}=\Ht\AP{\Prj_n(\theta)_{ao}}=\Ht\AP{\AP{\Cone\Prj_{n-1}}\AP{\theta_{ao}}}$$

By Proposition A.2

$$\Prj_n(\theta)\APM{o}{a}=\Ht\AP{\theta_{ao}}=\theta\APM{o}{a}$$

Now suppose that $h=a'o'h'$. We get

$$\Prj_n(\theta)\AP{a'o'h'a}=\AB{\Prj_n(\theta)_{a'o'}}\AP{h'a}=\AB{\AP{\Cone\Prj_{n-1}}\AP{\theta_{a'o'}}}\AP{h'a}$$

By Proposition A.3

$$\Prj_n(\theta)\AP{a'o'h'a}=\Prj_{n-1}\AB{\theta_{a'o'}}\AP{h'a}$$

Using the induction hypothesis

$$\Prj_n(\theta)\AP{a'o'h'a}=\AB{\theta_{a'o'}}\AP{h'a}=\theta\AP{a'o'h'a}\ \blacksquare$$

**Proof of Proposition 3**

Proposition A.4 implies that, in Definition 11, we can replace $\Abs{h}+1$ by any $m\geq\Abs{h}+1$. Therefore, for any $n\in\Nats$, $\AP{\Prjo\mu}\pi=\mu\pi_{:n}$. Hence, $\mu\pi=\mu'\pi$ implies that $\big(\Prjo\mu\big)\pi=\AP{\Prjo\mu'}\pi$. By Proposition 1, we get $\Prjo\mu=\Prjo\mu'$, and therefore $\mu=\mu'$. $\blacksquare$

**Proof of Proposition 4**

For any $n\in\Nats$, Proposition 2 implies that

$$\AP{p\cdot\Prjo\mu+(1-p)\cdot\Prjo\mu'}\pi=p\big(\Prjo\mu\big)\pi+(1-p)\AP{\Prjo\mu'}\pi$$

$\Prjo$ is an affine mapping, therefore

$$\Prjo\AP{p\mu+(1-p)\mu'}\pi=p\big(\Prjo\mu\big)\pi+(1-p)\AP{\Prjo\mu'}\pi$$

Using Proposition A.4

$$\AP{p\mu+(1-p)\mu'}\pi_{:n}=p\mu\pi_{:n}+(1-p)\mu'\pi_{:n}=\AP{p\mu\pi+(1-p)\mu'\pi}_{:n}$$

Since this holds for any $n$, we must have that

$$\AP{p\mu+(1-p)\mu'}\pi=p\mu\pi+(1-p)\mu'\pi\ \blacksquare$$

**Proposition A.5**

*For any terminable policy $\pi$*

$$\Lim{n}\sup_{\mu\in\IS_\omega}\Pa{h\sim\mu\pi}{\Abs{h}>n}=0$$

**Proof of Proposition A.5**

Assume to the contrary that there is $\epsilon\in(0,1)$ and sequences $\AC{n_k\in\Nats}_{k\in\Nats}$ and $\AC{\mu_k\in\IS_\omega}_{k\in\Nats}$ s.t. $n_{k+1} > n_k$ and, for any $k\in\Nats$

$$\Pa{h\sim\mu_k\pi}{\Abs{h}>n_k} > \epsilon$$

$\IS_\omega$ is compact, therefore $\AC{\mu_k}$ has a convergent subsequence. Without loss of generality, we can assume that $\AC{\mu_k}$ itself converges and denote $\mu_*:=\Lim{k}\mu_k$. For any $k\in\Nats$ and $j > k$, we have $n_k < n_j$ and therefore

$$\Pa{h\sim\mu_j\pi}{\Abs{h}>n_k} \geq \Pa{h\sim\mu_j\pi}{\Abs{h}>n_j} > \epsilon$$

Using Proposition A.4, it follows that

$$\Pa{h\sim\Prj^\omega_{n_k+1}\AP{\mu_j}\pi}{\Abs{h}>n_k} > \epsilon$$

The right hand side is clearly continuous in $\Prj^\omega_{n_k+1}\AP{\mu_j}$, and the latter converges to $\Prj^\omega_{n_k+1}\AP{\mu_*}$ as $j$ goes to $\infty$. We get

$$\Pa{h\sim\mu_*\pi}{\Abs{h}>n_k}=\Pa{h\sim\Prj^\omega_{n_k+1}\AP{\mu_*}\pi}{\Abs{h}>n_k} > \epsilon$$

Since this holds for any $k$, it follows that

$$\Pa{h\sim\mu_*\pi}{\Abs{h}=\infty}=\Lim{k}\Pa{h\sim\mu_*\pi}{\Abs{h}>n_k} \geq \epsilon$$

This contradicts the assumption that $\pi$ is terminable. $\blacksquare$

**Proposition A.6**

*Consider $\AC{X_n}_{n\in\Nats}$ a sequence of compact Polish spaces, and $\AC{\Prj_n:X_{n+1}\rightarrow X_n}_{n\in\Nats}$ continuous mappings. Denote*

$$X_\omega:=\varprojlim_n X_n$$

*Denote $\Prjo:X_\omega\rightarrow X_n$ the canonical mapping. Let $f:X\rightarrow\Reals$ be continuous. Then,*

$$\Lim{n}\sup_{\substack{x\in X_n\\x_{1,2}\in\AP{\Prjo}^{-1}(x)}}\Abs{f\AP{x_1}-f\AP{x_2}}=0$$

**Proof of Proposition A.6**

Assume to the contrary that there is $\epsilon\in\Reals^+$, and sequences $\AC{n_k\in\Nats}_{k\in\Nats}$, $\AC{x_1^k,x_2^k\in X_\omega}_{k\in\Nats}$ s.t. $n_{k+1}>n_k$, $\Prj^\omega_{n_k}\AP{x_1^k}=\Prj^\omega_{n_k}\AP{x_2^k}$ and $f\AP{x_1^k}-f\AP{x_2^k}>\epsilon$. Without loss of generality, we assume that $n_k=k$ and the limits $x_{1,2}^*:=\Lim{n}x_{1,2}^n$ exist (the latter using the fact $X_\omega$ is compact by Tychonoff's theorem). It follows that $f\AP{x_1^*}-f\AP{x_2^*}\geq\epsilon$, and in particular $x_1^*\ne x_2^*$ and therefore there is $m\in\Nats$ s.t. $\Prj^\omega_m\AP{x_1^*}\ne\Prj^\omega_m\AP{x_2^*}$. On the other hand, $\Prjo\AP{x_1^n}=\Prjo\AP{x_2^n}$, implying that, for $n\geq m$, $\Prj^\omega_{m}\AP{x_1^n}=\Prj^\omega_{m}\AP{x_2^n}$ and therefore $\Prj^\omega_m\AP{x_1^*}=\Prj^\omega_m\AP{x_2^*}$, a contradiction. $\blacksquare$

**Proposition A.7**

*Let $V$ be a finite-dimensional normed vector space and $W\subseteq V^*$ a linear subspace. Suppose $v\in V$ and $\epsilon\in\Reals^+$ are s.t. for any $\alpha\in W$, $\Abs{\alpha(v)} \leq \epsilon\Norm{\alpha}$. Then, there is $v'\in W^\bot\subseteq V$ s.t. $\Norm{v-v'}\leq\epsilon$.*

In the above, $\Norm{\alpha}$ refers to the standard dual norm on $V^*$, induced by the norm on $V$. $W^\bot$ refers to the set $\ACM{v\in V}{\forall\alpha\in W: \alpha(v)=0}$.

**Proof of Proposition A.7**

Consider $v^*\in W^*$ defined by $v^*(\alpha):=\alpha(v)$. By the assumption about $v$, $\Norm{v^*}\leq\epsilon$. By the Hahn-Banach theorem, there is $u^*\in V^{**}$ s.t. $u^*|_W=v^*$ and $\Norm{u^*}\leq\epsilon$. Using the canonical isomorphism $V\cong V^{**}$, $u^*$ corresponds to some $u\in V$, and it follows that $\Norm{u}\leq\epsilon$ and for any $\alpha\in W$, $\alpha(u)=\alpha(v)$. We now take $v':=v-u$. $\blacksquare$

**Proposition A.8**

*Let $C,D\in\Con$, $f\in\Mor(C,D)$ and $r\in\Mor\AP{C,\Reals}$. Assume $D$ is a bounded closed finite-dimensional polytope, and $f$ is onto (as a mapping). Suppose $\epsilon\in\Reals^+$ s.t. for any $x_{1,2}\in C$, if $f\AP{x_1}=f\AP{x_2}$ then $\Abs{r\AP{x_1}-r\AP{x_2}} \leq \epsilon$. Then, there exists $r'\in\Mor\AP{D,\Reals}$ s.t. for any $x\in C$* 

$$\Abs{r\AP{x}-r'\AP{f(x)}} \leq \frac{3}{2}\epsilon$$

**Proof of Proposition A.8**

Let $X$ be the vector space correspond to $C$, let $Y$ be the vector space corresponding to $D$ (so that $C\subseteq X$ and $D\subseteq Y$) and let $Q$ be the (finite) set of vertices of $D$. Since $f$ is onto, we can choose some $g:Q\rightarrow C$ s.t. for any $q\in Q$, $f\AP{g(q)}=q$. Define $v\in\Reals^Q$ by $v_q:=r\AP{g(q)}$. Let $\Reals^Q_0$ be the linear subspace of $\Reals^Q$ given by 

$$\Reals^Q_0:=\ACM{u\in\Reals^Q}{\sum_{q\in Q}u_q = 0}$$

Define the linear operators $A:\Reals^Q\rightarrow X$ and $B:\Reals^Q\rightarrow Y$ by

$$Au:=\sum_{q\in Q}u_q g(q)$$

$$Bu:=\sum_{q\in Q}u_q q$$

Consider any $w\in\Ker{B}\cap\Reals^Q_0\setminus\boldsymbol{0}$. In particular, $w\in\Reals^Q_0$ and therefore

$$0=\sum_{q\in Q}w_q=\sum_{q\in Q}\boldsymbol{1}_{w_q>0}w_q+\sum_{q\in Q}\boldsymbol{1}_{w_q<0}w_q$$

Also

$$\Norm{w}_1=\sum_{q\in Q}\Abs{w_q}=\sum_{q\in Q}\boldsymbol{1}_{w_q>0}w_q-\sum_{q\in Q}\boldsymbol{1}_{w_q<0}w_q$$

Combining the last two identities, we conclude

$$\sum_{q\in Q}\boldsymbol{1}_{w_q>0}w_q =-\sum_{q\in Q}\boldsymbol{1}_{w_q<0}w_q=\frac{\Norm{w}_1}{2}$$

Using the assumption $w\ne\boldsymbol{0}$, this allows us to define $w^+,w^-\in\Delta Q$ by

$$w^+_q:=\frac{2}{\Norm{w}_1}\boldsymbol{1}_{w_q>0}w_q$$

$$w^-_q:=-\frac{2}{\Norm{w}_1}\boldsymbol{1}_{w_q<0}w_q$$

We have $w=\frac{1}{2}\Norm{w}_1\AP{w^+-w^-}$. Also, $Bw=0$ and therefore $Bw^+=Bw^-$. 

Now, for any $u\in\Delta Q$, we have

$$u\cdot v=\sum_{q\in Q}u_q v_q=\sum_{q\in Q}u_q r\AP{g(q)}=r\AP{\sum_{q\in Q}u_q g(q)}=r\AP{Au}$$ 

Moreover,

$$f\AP{Au}=f\AP{\sum_{q\in Q}u_q g(q)}=\sum_{q\in Q}u_q f\AP{g(q)}=\sum_{q\in Q}u_q q = Bu$$

It follows that

$$w\cdot v=\frac{1}{2}\Norm{w}_1\AP{w^+\cdot v - w^-\cdot v}=\frac{1}{2}\Norm{w}_1\AP{r\AP{Aw^+}-r\AP{Aw^-}}$$

By our previous reasoning, $f\AP{Aw^+}=Bw^+=Bw^-=f\AP{Aw^-}$. Therefore, we can use the assumption on $r$ to conclude that

$$\Abs{w\cdot v}=\frac{1}{2}\Norm{w}_1\Abs{r\AP{Aw^+}-r\AP{Aw^-}}\leq\frac{\epsilon}{2}\Norm{w}_1$$

By Proposition A.7, it follows that there is some $v'\in\Reals^Q$ s.t. $v'\in\AP{\Ker B\cap\Reals^Q_0}^\bot$ and $\Norm{v-v'}_\infty\leq\frac{\epsilon}{2}$ (the $L^\infty$ norm is dual to the $L^1$ norm). 

Now, consider some $y\in D$. There is some $u\in\Delta Q$ s.t. $y=Bu$. We define $r'(y):=u\cdot v'$. To see this definition is unambiguous, consider some $u'\in\Delta Q$ s.t. also $y=Bu'$. In particular, $B\AP{u-u'}=0$ and therefore $u-u'\in\Ker B$. Moreover, $u-u'\in\Reals^Q_0$ since $u,u'\in\Delta Q$. Using that $u-u'\in\Ker B\cap\Reals^Q_0$ and $v'\in\AP{\Ker B\cap\Reals^Q_0}^\bot$, we get

$$u\cdot v'-u'\cdot v'=\AP{u-u'}\cdot v'=0$$

It is easy to see that $r'$ is affine. 

Finally, consider any $x\in C$. Choose $u\in\Delta Q$ s.t. $f(x)=Bu$. We have

$$\Big\lvert{r(x)-r'\AP{f(x)}}\Big\rvert\leq\Big\lvert{r(x)-r\AP{Au}}\Big\rvert+\Abs{r\AP{Au}-r'\AP{f(x)}}$$

Since $f\AP{Au}=Bu$, we can use the assumption on $r$ to bound the first term on the right hand side:

$$\Big\lvert{r(x)-r\AP{Au}}\Big\rvert\leq\epsilon$$

For the second term, we have

$$\Abs{r\AP{Au}-r'\AP{f(x)}}=\Big\lvert{u\cdot v-u\cdot v'}\Big\rvert=\Big\lvert{u\cdot\AP{v-v'}}\Big\rvert\leq\Norm{u}_1\Norm{v-v'}_\infty\leq\frac{\epsilon}{2}$$

Combining the two, we conclude

$$\Big\lvert{r(x)-r'\AP{f(x)}}\Big\rvert\leq\frac{3}{2}\epsilon\ \blacksquare$$

**Proposition A.9**

*Let $\A$ be a finite set, $C\in\Con$ and $\R\in\Mor\AP{C^\A,[0,1]}$. Assume $\R$ attains its infimum at some point $\theta^*\in C^\A$. Then, there exist $\pi\in\Delta\A$ and $r:\A\rightarrow\Mor\AP{C,[0,1]}$ s.t. for any $\theta\in C^\A$* 
$$\R(\theta)=\Ea{a\sim\pi}{r\AP{a,\theta_a}}$$

Here, we used implicit currying: $r(a,x):=r(a)(x)$.

**Proof of Proposition A.9**

For each $a\in\A$, define $\iota_a\in\Mor\AP{C,C^\A}$ by

$$\iota_a(x)_b:=\begin{cases} x \text{ if } a=b \\ \theta^*_b \text{ if } a\ne b\end{cases}$$

Denote $\R_a:=\R\circ\iota_a$ and $N_a:=\sup\R_a-\inf\R_a$. If $N_a$ vanishes for every $a\in\A$, then $\R$ is constant, so we can set $r$ to the same constant and take arbitrary $\pi$. Otherwise, we define $\pi$ and $r$ by

$$\pi_a:=\frac{N_a}{\sum_{b\in\A}N_b}$$

$$r(a,x):=\R\AP{\theta^*} +\frac{\sum_{b\in\A}N_b}{N_a}\AP{\R_a(x)-\R\AP{\theta^*}}$$

We need to show that $r$ takes values in $[0,1]$. It is non-negative since $\R$ is minimal at $\theta^*$, so both terms in $r$ are non-negative. To see it is not greater than $1$, observe that

$$r(a,x)=\R\AP{\theta^*} +\frac{\sum_{b\in\A}N_b}{N_a}\AP{\R_a(x)-\R\AP{\theta^*}}\leq\inf\R +\frac{\sum_{b\in\A}N_b}{N_a}\AP{\sup\R_a-\inf\R}$$

Clearly $\inf\R=\inf\R_a$ and therefore $\sup\R_a-\inf\R=N_a$. It is also easy to see that, since $\R$ is affine, $\sup\R-\inf\R=\sum_{b\in\A}N_b$. We get

$$r(a,x)\leq\inf\R+\frac{\sum_{b\in\A}N_b}{N_a}N_a=\inf\R+\sum_{b\in\A}N_b=\sup\R\leq 1$$

It remains to show that $\R(\theta)=\Ea{a\sim\pi}{r\AP{a,\theta_a}}$. We have

$$\Ea{a\sim\pi}{r\AP{a,\theta_a}}=\sum_{a\in\A}\pi_ar\AP{a,\theta_a}$$

$$\Ea{a\sim\pi}{r\AP{a,\theta_a}}=\sum_{a\in\A}\pi_a\AP{\R\AP{\theta^*} +\frac{\sum_{b\in\A}N_b}{N_a}\AP{\R_a\AP{\theta_a}-\R\AP{\theta^*}}}$$

$$\Ea{a\sim\pi}{r\AP{a,\theta_a}}=\sum_{a\in\A}\pi_a\R\AP{\theta^*} +\sum_{a\in\A}\pi_a{\frac{\sum_{b\in\A}N_b}{N_a}\AP{\R_a\AP{\theta_a}-\R\AP{\theta^*}}}$$

$$\Ea{a\sim\pi}{r\AP{a,\theta_a}}=\R\AP{\theta^*} +\sum_{a\in\A}\frac{N_a}{\sum_{b\in\A}N_b}\cdot{\frac{\sum_{b\in\A}N_b}{N_a}\AP{\R_a\AP{\theta_a}-\R\AP{\theta^*}}}$$

$$\Ea{a\sim\pi}{r\AP{a,\theta_a}}=\R\AP{\theta^*} +\sum_{a\in\A}\AP{\R_a\AP{\theta_a}-\R\AP{\theta^*}}$$

Using the fact $\R$ is affine, the desired conclusion follows. $\blacksquare$

**Proposition A.10**

*Consider any $n\in\Nats$ and $\R\in\Mor\AP{\IS_n,[0,1]}$. Then, there exist $\pi:\AO^{<n}\K\A$ and $r:\AO^n\rightarrow[0,1]$ s.t. for any $\theta\in\IS_n$*

$$\R(\theta)=\Ea{\theta\pi}{r}$$

**Proof of Proposition A.10**

We proceed by induction on $n$. For $n=0$, $\R$ is constant and we set $r$ to the same constant. Now, suppose $n>0$.

Define $\IS_{n-\frac{1}{2}}\in\Con$ by

$$\IS_{n-\frac{1}{2}}:=\AP{\prod_{o\in\Ob}\Ht_{\IS_{n-1}}}^{-1}(\Delta\Ob)$$

Using Proposition A.9, we get $\pi_0\in\Delta\A$ and $r_0:\A\rightarrow\Mor\AP{\IS_{n-\frac{1}{2}},[0,1]}$ s.t. for any $\theta\in\IS_n$

$$\R(\theta)=\Ea{a\sim\pi_0}{r_0\AP{a,\theta_a}}$$

For every $o\in\Ob$, we define $j_o\in\Mor\AP{\IS_{n-1},\IS_{n-\frac{1}{2}}}$ by

$$j_o(\theta)_{o'}:=\begin{cases} (\theta,1) \text{ if } o=o' \\ \boldsymbol{0} \text{ if } o\ne o' \end{cases}$$

For every $a\in\A$ and $o\in\Ob$, we apply the induction hypothesis to $r_0(a)\circ j_o$, and get $\pi_{ao}:\AO^{<n-1}\K\A$ and $r_{ao}:\AO^{n-1}\rightarrow[0,1]$ s.t. for any $\theta\in\IS_{n-1}$

$$r_0\AP{a,j_o(\theta)}=\Ea{\theta\pi_{ao}}{r_{ao}}$$

We now define $\pi$ and $r$ by

$$\pi(\Estr):=\pi_0$$
$$\pi(aoh):=\pi_{ao}(h)$$

$$r(aoh):=r_{ao}(h)$$

Now, observe that, for any $\theta\in\IS_n$

$$\Ea{h\sim\theta\pi}{r(h)}=\Ea{\substack{a\sim\pi_0\\o\sim\theta(a)}}{\Ea{\\h'\sim\AB{\theta_{ao}}\pi_{ao}}{r_{ao}\AP{h'}}}=\Ea{\substack{a\sim\pi_0\\o\sim\theta(a)}}{r_0\AP{a,j_o\AB{\theta_{ao}}}}$$

Using the fact that $r_0$ is affine in the second argument, we get

$$\Ea{h\sim\theta\pi}{r(h)}=\Ea{\substack{a\sim\pi_0}}{r_0\AP{a,\Ea{o\sim\theta(a)}{j_o\AB{\theta_{ao}}}}}$$

Moreover, using Definition 6 and the definition of $j_0$, we get

$$\Ea{o\sim\theta(a)}{j_o\AB{\theta_{ao}}}=\sum_{o\in\Ob}\Ht\AP{\theta_{ao}}\bigoplus_{o'\in\Ob}\AP{\KD{o'=o}\theta_{ao},\KD{o'=o}}$$

$$\Ea{o\sim\theta(a)}{j_o\AB{\theta_{ao}}}=\bigoplus_{o'\in\Ob}\AP{\sum_{o\in\Ob}\Ht\AP{\theta_{ao}}\KD{o'=o}\theta_{ao},\sum_{o\in\Ob}\Ht\AP{\theta_{ao}}\KD{o'=o}}$$

$$\Ea{o\sim\theta(a)}{j_o\AB{\theta_{ao}}}=\bigoplus_{o'\in\Ob}\AP{\Ht\AP{\theta_{ao'}}\theta_{ao'},\Ht\AP{\theta_{ao'}}}=\bigoplus_{o'\in\Ob}\theta_{ao'}=\theta_a$$

Combining this with the previous identity, we get

$$\Ea{h\sim\theta\pi}{r(h)}=\Ea{\substack{a\sim\pi_0}}{r_0\AP{a,\theta_a}}=\R(\theta)\ \blacksquare$$

**Proposition A.11**

*Consider some $\alpha\in\Delta\Nats$ and sequences*

$$\AC{\pi_k:\FH\K\AX}_{k\in\Nats}$$ 

$$\bigg\{r_k:\FH\rightarrow[0,1]\bigg\}_{k\in\Nats}$$

*Assume $\pi_k$ is a terminable policy for every $k\in\Nats$. Then, there is $\pi$ a terminable policy and $r:\FH\rightarrow[0,1]$ s.t.*

$$\R_{\pi r}=\Ea{k\sim\alpha}{\R_{\pi_k r_k}}$$

**Proof of Proposition A.11**

Define $\pi$ and $r$ by setting, for any $n\in\Nats$ and $ao\in\AO^n$

$$\pi(ao):=\frac{\Ea{n\sim\alpha}{\prod_{m=0}^{n-1}\pi_n\APM{a_m}{ao_{:m}}\cdot\pi_n\AP{ao}}}{\Ea{n\sim\alpha}{\prod_{m=0}^{n-1}\pi_n\APM{a_m}{ao_{:m}}}}$$

$$r(ao):=\frac{\Ea{n\sim\alpha}{\prod_{m=0}^{n-1}\pi_n\APM{a_m}{ao_{:m}}\cdot \pi_n\APM{\bot}{ao}r_n\AP{ao}}}{\Ea{n\sim\alpha}{\prod_{m=0}^{n-1}\pi_n\APM{a_m}{ao_{:m}}\cdot\pi_n\APM{\bot}{ao}}}$$

When the denominator vanishes, we can make an arbitrary choice.

Essentially, what we do is sample $n$ from $\alpha$ and then run the "experiment" defined by $\AP{\pi_n,r_n}$. We have

$$\R_{\pi r}(\mu)=\Ea{\mu\pi}{r}=\Ea{n\sim\alpha}{\Ea{\mu\pi_n}{r_n}}=\Ea{n\sim\alpha}{\R_{\pi_n r_n}(\mu)}\ \blacksquare$$

For any $n,m\in\Nats$ s.t. $m\geq n$, we will denote by $\Prj^{m}_n:\IS_m\rightarrow\IS_n$ the canonical projection. That is

$$\Prj^m_n:=\Prj_{m-1}\circ\Prj_{m-2}\ldots\circ\Prj_{n+1}\circ\Prj_n$$

**Proof of Theorem 1**

*Direction 1:* $\R_{\pi r}$ is affine by Proposition 4. To verify it is continuous, consider a sequence $\AC{\mu_k\in\IS_\omega}_{k\in\Nats}$ s.t. $\mu_*:=\Lim{k}\mu_k$ exists. Denote $\Delta r:=\sup r - \inf r$, $\mu_k^n:=\Prjo\AP{\mu_k}$ and $\mu^n_*:=\Prjo\AP{\mu_*}$. For any $n\in\Nats$, we can decompose the expected value into the contribution of histories at length at most $n$ and the contribution of longer histories.

$$\Abs{\R_{\pi r}\AP{\mu_k}-\R_{\pi r}\AP{\mu_*}} \leq \Delta r\AP{\Dtva{\mu_k^n,\mu_*^n}+\Pa{\mu_k\pi}{\Abs{h}>n} +\Pa{\mu_*\pi}{\Abs{h}>n}}$$

$\mu_k^n$ converges to $\mu_*^n$ as $k$ goes to $\infty$, therefore $\Dtva{\mu_k^n,\mu_*^n}$ converges to 0 and we get

$$\LimSup{k}\Abs{\R_{\pi r}\AP{\mu_k}-\R_{\pi r}\AP{\mu_*}} \leq 2\Delta r\sup_{\mu\in\IS_\omega}\Pa{\mu\pi}{\Abs{h}>n}$$

Since this holds for any $n\in\Nats$, we get

$$\LimSup{k}\Abs{\R_{\pi r}\AP{\mu_k}-\R_{\pi r}\AP{\mu_*}} \leq 2\Delta r\inf_{n\in\Nats}\sup_{\mu\in\IS_\omega}\Pa{\mu\pi}{\Abs{h}>n}$$

By Proposition A.5, the right hand side vanishes.

*Direction 2:* Define $\AC{\epsilon_n\in[0,1]}_{n\in\Nats}$ by

$$\epsilon_n:=\sup_{\substack{\theta\in\IS_n\\\mu_{1,2}\in\AP{\Prjo}^{-1}(\theta)}}\Abs{\R\AP{\mu_1}-\R\AP{\mu_2}}$$

By Proposition A.6, $\Lim{n}\epsilon_n=0$. By Proposition A.8, there is a sequence $\AC{\tilde{\R}_n\in\Mor\AP{\IS_n,[0,1]}}_{n\in\Nats}$ s.t. for any $n\in\Nats$

$$\sup_{\mu\in\IS_\omega}\Abs{\R(\mu)-\tilde{\R}_n\AP{\Prjo(\mu)}}\leq\frac{3}{2}\epsilon_n$$

It follows that there is a sequence $\AC{n_k\in\Nats}_{k\in\Nats}$ s.t. $n_{k+1}>n_k$ and

$$\sum_{k=0}^\infty \sup_{\mu\in\IS_\omega}\Abs{\tilde{\R}_{n_{k+1}}\AP{\Prj^\omega_{n_{k+1}}\AP{\mu}}-\tilde{\R}_{n_k}\AP{\Prj^\omega_{n_k}(\mu)}}<1$$

Define $\Delta\R_k\in\Mor\AP{\IS_{n_{k+1}},[-1,1]}$ by

$$\Delta\R_k(\theta):=\tilde{\R}_{n_{k+1}}\Big(\theta\Big)-\tilde{\R}_{n_k}\AP{\Prj^{n_{k+1}}_{n_k}(\theta)}$$

Denote $\delta_k:=\sup\Abs{\Delta\R_k}$. We can assume without loss of generality that $\delta_k>0$ for every $k\in\Nats$ (this can be arranged by choosing appropriate $n_k$, unless for some $m\in\Nats$, $\R=\Prjo\circ\tilde{\R}_m$; but in the latter case, the theorem follows directly from Proposition A.10). By Proposition A.10, for every $k\in\Nats$, there is $\pi_{k+1}:\AO^{<n_{k+1}}\K\A$ and $r_{k+1}:\AO^{n_{k+1}}\rightarrow\AB{-1,1}$ s.t.

$$\frac{1}{\delta_k}\Delta\R_k(\theta)=\Ea{\theta\pi_{k+1}}{r_{k+1}}$$

Also by Proposition A.10, there is $\pi_0:\AO^{<n_0}\K\A$ and $r_0:\AO^{n_0}\rightarrow\AB{0,1}$ s.t.

$$\tilde{\R}_{n_0}(\theta)=\Ea{\theta\pi_{0}}{r_{0}}$$

By the construction, $\sum_{k=0}^\infty\delta_k < 1$, and moreover, denoting $C:=1+\sum_{k=0}^\infty\delta_k$

$$\R=\Prj^\omega_{n_0}\circ\tilde{\R}_{n_0}+\sum_{k=0}^\infty\Prj^\omega_{n_{k+1}}\circ\Delta\R_k=C\AP{\frac{1}{C}\Prj^\omega_{n_0}\circ\tilde{\R}_{n_0}+\sum_{k=0}^\infty\frac{\delta_k}{C}\cdot\frac{\Prj^\omega_{n_{k+1}}\circ\Delta\R_k}{\delta_k}}$$

By Proposition A.11, there is  $\pi$ a terminable policy and $r:\FH\rightarrow[-2,2]$ (the range of $r_k$ is $[-1,1]$ and $C<2$) s.t. $\R_{\pi r}= \R$. $\blacksquare$

**Proposition A.12**

*Consider any $\lambda\in(0,1)$, $n\in\Nats$, $\theta\in\IS_n$ and $\mu_{1,2}\in\AP{\Prjo}^{-1}(\theta)$. Then,*

$$\Dtv^\lambda\AP{\mu_1,\mu_2} \leq \lambda^{n+1}$$

**Proof of Proposition A.12**

By Definition 16,

$$\Dtv^\lambda\AP{\mu_1,\mu_2}=\sup_{m\in\Nats}{\lambda^m\Dtv\AP{\Prj^\omega_m\mu_1,\Prj^\omega_m\mu_2}}$$

For $m\leq n$, $\Prj^\omega_m\mu_1=\Prj^n_m\theta=\Prj^\omega_m\mu_2$, and therefore $\Dtv\AP{\Prj^\omega_m\mu_1,\Prj^\omega_m\mu_2}=0$. For $m>n$, $\Dtv\AP{\Prj^\omega_m\mu_1,\Prj^\omega_m\mu_2}\leq 1$ by Definition 15. We get

$$\Dtv^\lambda\AP{\mu_1,\mu_2}\leq\sup_{m>n}{\lambda^m}=\lambda^{n+1}\ \blacksquare$$

**Proof of Proposition 5**

Define $\AC{\epsilon_n\in[0,1]}_{n\in\Nats}$ by

$$\epsilon_n:=\sup_{\substack{\theta\in\IS_n\\\mu_{1,2}\in\AP{\Prjo}^{-1}(\theta)}}\Abs{\R\AP{\mu_1}-\R\AP{\mu_2}}$$

Let $L\in\Reals$ be the Lipschitz constant of $\R$. We have

$$\epsilon_n\leq L \sup_{\substack{\theta\in\IS_n\\\mu_{1,2}\in\AP{\Prjo}^{-1}(\theta)}}\Dtv^\lambda\AP{\mu_1,\mu_2}$$ 
By Proposition A.12, we get

$$\epsilon_n\leq L\lambda^{n+1}$$

Without loss of generality, assume the range of $\R$ is contained in $[0,1]$. By Proposition A.8, it follows that there is a sequence $\AC{\tilde{\R}_n\in\Mor\AP{\IS_n,[0,1]}}_{n\in\Nats}$ s.t. for any $n\in\Nats$

$$\sup_{\mu\in\IS_\omega}\Abs{\R(\mu)-\tilde{\R}_n\AP{\Prjo(\mu)}}\leq\frac{3}{2}L\lambda^{n+1}$$

It follows that

$$\sum_{n=0}^\infty \sup_{\mu\in\IS_\omega}\Abs{\tilde{\R}_{n+1}\AP{\Prj^\omega_{n+1}\AP{\mu}}-\tilde{\R}_n\AP{\Prj^\omega_n(\mu)}}\leq\frac{3}{2}L\sum_{n=0}^\infty\AP{\lambda^{n+2}+\lambda^{n+1}}$$

$$\sum_{n=0}^\infty \sup_{\mu\in\IS_\omega}\Abs{\tilde{\R}_{n+1}\AP{\Prj^\omega_{n+1}\AP{\mu}}-\tilde{\R}_{n}\AP{\Prj^\omega_n(\mu)}}\leq\frac{3L}{2}\cdot\frac{\lambda^2+\lambda}{1-\lambda}$$

Define $\Delta\R_n\in\Mor\AP{\IS_{n+1},[-1,1]}$ by

$$\Delta\R_n(\theta):=\tilde{\R}_{n+1}\big(\theta\big)-\tilde{\R}_{n}\AP{\Prj_n(\theta)}$$

Denote $\delta_n:=\sup\Abs{\Delta\R_n}$. By Proposition A.10, for every $n\in\Nats$ s.t. $\delta_n>0$, there is $\pi_{n+1}:\AO^{\leq n}\K\A$ and $r_{n+1}:\AO^{n+1}\rightarrow\AB{-1,1}$ s.t.

$$\frac{1}{\delta_n}\Delta\R_n(\theta)=\Ea{\theta\pi_{n+1}}{r_{n+1}}$$

$\tilde{\R}_0$ is a constant. Define $C\in\Reals^+$ by 

$$C:=1+\sum_{k=0}^\infty\delta_k\leq1+\frac{3L}{2}\cdot\frac{\lambda^2+\lambda}{1-\lambda}$$

We have

$$\R=\tilde{\R}_{0}+\sum_{n=0}^\infty\Prj^\omega_{n+1}\circ\Delta\R_n=C\AP{\frac{1}{C}\tilde{\R}_{0}+\sum_{n=0}^\infty\frac{\delta_n}{C}\cdot\frac{\Prj^\omega_{n+1}\circ\Delta\R_n}{\delta_n}}$$

Here, the terms with $\delta_n=0$ are understood to vanish. By Proposition A.11, there is  $\pi$ a terminable policy and $r:\FH\rightarrow[-C,C]$ s.t. $\R_{\pi r}= \R$. Moreover, looking at the construction in the proof of Proposition A.11, we can see that

$$\Ea{h\sim\mu\pi}{\Abs{h}} = \sum_{n=0}^\infty \frac{\delta_n}{C}(n+1)\leq\sum_{n=0}^\infty\frac{3L}{2}\AP{\lambda^{n+2}+\lambda^{n+1}}(n+1)<\infty\ \blacksquare$$

In order to prove Theorem 2, we will consider the policy $\pi_{\gamma,T}^{\PSR}: \St^*\times\St\K\A$ implemented by an algorithm which is PSRL with two modifications:

1. Each episode has random duration, uniformly distributed from $1$ to $2T-1$, for some fixed $T\in\Nats^+$.
2. Between any two regular episodes, there is an "interlude" which consists of, performing the reward estimation experiment ($\pi_\Est$).

The PSRL algorithm assumes choosing $\Pi:\Hy\times\St\rightarrow\A$, a Borel measurable mapping s.t. $\Pi(\T)$ is an optimal policy, i.e.

$$\EU^{\Pi(\T)}_{\T\R_\T}(\gamma)=\EU^{*}_{\T\R_\T}(\gamma)$$

As usual, we will consider $(\Omega,P)$, a probability space governing both the uncertainty about the true hypothesis, the stochastic behavior of the environment and the random sampling inside the algorithm. Let $\THy:\Omega\rightarrow\Hy$ be a random variable representing the true hypothesis, $\AC{\SHy_k:\Omega\rightarrow\Hy}_{k\in\Nats}$ be random variables s.t. $\SHy_n$ represents the hypothesis sampled at episode $k$, $\AC{\Theta_n:\Omega\rightarrow\St}_{n\in\Nats}$ be s.t. $\Theta_n$ represents the state at time $n$, $\AC{\AT_n:\Omega\rightarrow\A}_{n\in\Nats}$ be s.t. $\AT_n$ represents the action taken at time $n$, $\AC{\ET_k:\Omega\rightarrow\Nats}_{k\in\Nats}$ be s.t. $\ET_{k}$ represents the time when the $k$-th episode starts and $\AC{\IT_k:\Omega\rightarrow\Nats}_{k\in\Nats}$ be s.t. $\IT_k$ represents the time when the $k$-the interlude starts.

This probability space can be formally defined via recursive equations on the random variables, but this is straightforward and we will omit it.

**Proposition A.13**

*In the setting of Theorem 2, fix $T\in\Nats^+$ and $\gamma\in(0,1)$.*

*Denote $\R_k:=\R_{\SHy_k}$, $\R_*:=\R_{\THy}$, $\Delta\R_k:=\R_k-\R_*$, $\Delta\SHy_k:=\SHy_k-\THy$, $\Ev_{*k}:=\SHy_*\Pi\AP{\SHy_{k}}$, $\Ev_{k*}:=\SHy_{k}\Pi\AP{\SHy_*}$, $\Ev_{**}:=\THy\Pi\AP{\THy}$, $\Delta\ET_k:=\IT_k-\ET_k$ and $\Delta\IT_k:=\ET_{k+1}-\IT_k$. Then,*

$$\Reg(\gamma)=\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\AP{(1-\gamma)\Delta\R_k\AP{\Theta_n}+\gamma\CE{\Delta\SHy_k}{\V_{\SHy_k\R_k}(\gamma)}{\Theta_n,\AT_n}}}$$
$$+\sum_{k=0}^\infty\E{{\gamma^{\IT_k}}\CE{\Ev_{k*}^{\Delta\ET_k}-\Ev_{*k}^{\Delta\ET_k}}{\V_{\SHy_*\R_*}(\gamma)}{\Theta_{\ET_k}}}$$
$$+(1-\gamma)\sum_{k=0}^\infty\E{\sum_{n=\IT_k}^{\ET_{k+1}-1}\gamma^n\CE{\Ev_{**}^{n-\IT_k}-\Ev_{*k}^{n-\IT_k}}{\R_*}{\Theta_{\IT_k}}}$$
$$+\sum_{k=0}^\infty\E{\gamma^{\ET_{k+1}}\CE{\Ev_{**}^{\Delta\IT_k}-\Ev_{*k}^{\Delta\IT_k}}{\V_{\THy\R_*}(\gamma)}{\Theta_{\IT_k}}}$$

**Proof of Proposition A.13**

For any $n\in\Nats$, define $\Pi_n:\Hy\times\Hy\times\St^*\times\St\K\A$ as follows.

$$\Pi_n\AP{\T_1,\T_2,h,s}:=\begin{cases} \Pi\AP{\T_1,s} \text{ if } \Abs{h}<n \\ \Pi\AP{\T_2,s} \text{ if }\Abs{h} \geq n \end{cases}$$

That is, $\Pi_n\AP{\T_1,\T_2}$ is a policy that follows $\Pi\AP{\T_1}$ for time $n$ and $\Pi\AP{\T_2}$ afterwards. 

In the following, we use the shorthand notation 

$$\V_*(s):=\V_{\SHy_*\R_*}(s,\gamma)$$

$$\V_k(s):=\V_{\SHy_{k}\R_k}(s,\gamma)$$

$$\V_{kl}(s):=\V_{\SHy_{*}\Pi_{\Delta\ET_k-l}\AP{\SHy_{k},\SHy_*}\R_*}\AP{s,\gamma}$$

It is easy to see that

$$\Reg(\gamma)=\sum_{k=0}^\infty{\E{\gamma^{\ET_k}\AP{\V_{*}\AP{\Theta_{\ET_k}}-\V_{k0}\AP{\Theta_{\ET_k}}}}}$$
$$+(1-\gamma)\sum_{k=0}^\infty\E{\sum_{n=\IT_k}^{\ET_{k+1}-1}\gamma^n\CE{\Ev_{**}^{n-\IT_k}-\Ev_{*k}^{n-\IT_k}}{\R_*}{\Theta_{\IT_k}}}$$
$$+\sum_{k=0}^\infty\E{\gamma^{\ET_{k+1}}\CE{\Ev_{**}^{\Delta\IT_k}-\Ev_{*k}^{\Delta\IT_k}}{\V_{\THy\R_*}(\gamma)}{\Theta_{\IT_k}}}$$

Here, the first term represents the regret incurred during the episodes, whereas the second and third term represent the regret incurred during the interludes (the lost reward and lost value respectively). We will denote the first term $\Reg_0(\gamma)$ in the following.

By definition, $\SHy_{k}$ and $\SHy_*$ have the same distribution even when conditioned by the history up to $\ET_k$. Therefore

$$\E{\V_{*}\AP{\Theta_{\ET_k}}}=\E{\V_{k}\AP{\Theta_{\ET_k}}}$$

It follows that

$$\Reg_0(\gamma)=\sum_{k=0}^\infty{\E{\gamma^{\ET_k}\AP{\V_{k}\AP{\Theta_{\ET_k}}-\V_{k0}\AP{\Theta_{\ET_k}}}}}$$

Denote $\Theta_{kl}:=\Theta_{\ET_k+l}$ and $\Delta\V_{kl}:=\V_k\AP{\Theta_{kl}}-\V_{kl}\AP{\Theta_{kl}}$. We now prove by induction on $l\in\Nats$ that, with probability 1

$$l\leq\Delta\ET_k\implies\CE{}{\Delta\V_{k0}}{\ET_k,\IT_k}=$$
$$\CE{}{\sum_{n=\ET_k}^{\ET_k+l-1}\gamma^{n-\ET_k}\AP{(1-\gamma)\Delta\R_k\AP{\Theta_n}+\gamma\CE{\Delta\SHy_k}{\V_{k}}{\Theta_n,\AT_n}}+\gamma^l\Delta\V_{kl}}{\ET_k,\IT_k}$$

For $l=0$ this is a tautology. For any $l\in\Nats$, the Bellman equation says that

$$\V_k(s)=(1-\gamma)\R_k(s)+\gamma\CE{\SHy_{k}\Pi\AP{\SHy_{k}}}{\V_k}{s}$$

$$l<\Delta\ET_k\implies\V_{kl}(s)=(1-\gamma)\R_*(s)+\gamma\CE{\SHy_{*}\Pi\AP{\SHy_{k}}}{\V_{k,l+1}}{s}$$

Denote $\Ev_{kk}:=\SHy_k\Pi\AP{\SHy_k}$. We will also use the notation $\TE{X}:=\CE{}{X}{\ET_k,\IT_k}$. Substituting $s=\Theta_{kl}$ and subtracting the two identities, we get that, in the subspace of $\Omega$ defined by $l<\Delta\ET_k$

$$\TE{\Delta\V_{kl}}=\TE{(1-\gamma)\Delta\R\AP{\Theta_{kl}}+\gamma\AP{\CE{\Ev_{kk}}{\V_k}{\Theta_{kl}}-\CE{\Ev_{*k}}{\V_{k,l+1}}{\Theta_{kl}}}}$$

Denote $\AT_{kl}:=\AT_{\ET_k+l}$. Since $\Pi\AP{\SHy_{k}}$ is exactly the policy followed by PSRL at time $\ET_k+l$, we get

$$\TE{\Delta\V_{kl}}=\TE{(1-\gamma)\Delta\R\AP{\Theta_{kl}}+\gamma\AP{\CE{\SHy_k}{\V_k}{\Theta_{kl},\AT_{kl}}-\CE{\THy}{\V_{k,l+1}}{\Theta_{kl},\AT_{kl}}}}$$

We now subtract and add $\gamma\CE{\SHy_*}{\V_k}{\Theta_{kl},\AT_{kl}}$, and use the fact that $\SHy_*\AP{\Theta_{kl},\AT_{kl}}$ is the conditional distribution of $\Theta_{k,l+1}$.

$$\TE{\Delta\V_{kl}}=\TE{(1-\gamma)\Delta\R\AP{\Theta_{kl}}+\gamma\AP{\CE{\Delta\SHy_k}{\V_k}{\Theta_{kl},\AT_{kl}}+\Delta\V_{k,l+1}}}$$

Applying this identity to the last term on the right hand side of the induction hypothesis, we prove the induction step. For $l=\Delta\ET_k$, we get

$$\TE{\Delta\V_{k0}}=\sum_{n=\ET_k}^{\IT_k}\gamma^{n-\ET_k}\TE{(1-\gamma)\Delta\R_k\AP{\Theta_n}+\gamma\CE{\Delta\SHy_k}{\V_{k}}{\Theta_n,\AT_n}}+$$
$$\gamma^{\Delta\ET_k}\TE{\V_k\AP{\Theta_{\IT_k}}-\V_*\AP{\Theta_{\IT_k}}}$$

Clearly

$$\TE{\V_k\AP{\Theta_{\IT_k}}}=\TE{\CE{\Ev_{*k}^{\Delta\ET_k}}{\V_k}{\Theta_{\ET_k}}}$$

$$\TE{\V_*\AP{\Theta_{\IT_k}}}=\TE{\CE{\Ev_{*k}^{\Delta\ET_k}}{\V_*}{\Theta_{\ET_k}}}$$

Using the definition of PSRL, we can exchange and true and sampled hypothesis and get

$$\TE{\V_k\AP{\Theta_{\IT_k}}}=\TE{\CE{\Ev_{k*}^{\Delta\ET_k}}{\V_*}{\Theta_{\ET_k}}}$$

It follows that

$$\TE{\Delta\V_{k0}}=\sum_{n=\ET_k}^{\IT_k}\gamma^{n-\ET_k}\TE{(1-\gamma)\Delta\R_k\AP{\Theta_n}+\gamma\CE{\Delta\SHy_k}{\V_{k}}{\Theta_n,\AT_n}}+$$
$$\gamma^{\Delta\ET_k}\TE{\CE{\Ev_{k*}^{\Delta\ET_k}-\Ev_{*k}^{\Delta\ET_k}}{\V_*}{\Theta_{\ET_k}}}$$

Applying this to each term in the earlier expression for $\Reg_0(\gamma)$, we get the desired result. $\blacksquare$

**Proposition A.14**

*Consider $(\Omega,P)$ a probability space, $\AC{M_k,\Delta_k:\Omega\rightarrow\Nats}_{k\in\Nats}$ random variables and $T\in\Nats^+$. Assume that $M_{k+1}-M_k\geq\Delta_k$ and the $\Delta_k$ are all independent and uniformly distributed between $1$ and $2T-1$. Define the random variable $K_n:\Omega\rightarrow\Nats$ by*

$$K_n:=\min\ACM{k\in\Nats}{M_k\geq n}$$

*Then,*

$$\Pa{}{K_n>\frac{2n}{T}+1}\leq\exp\AP{-\frac{n}{4T}}$$

**Proof of Proposition A.14**

Define $M'_k:=\sum_{l=0}^{k=1}\Delta_l$. Obviously, $M'_k\leq M_k$. For any $k\in\Nats$ and $m\in\Reals^{\geq0}$

$$\Pa{}{M_k\leq kT-m}\leq\Pa{}{M'_k\leq kT-m}$$

Apply Hoeffding's inequality to the RHS,

$$\Pa{}{M_k\leq kT-m}\leq\exp\AP{-\frac{2m^2}{k(2T-2)^2}}\leq\exp\AP{-\frac{m^2}{2kT^2}}$$

Taking $m:=\frac{1}{2}kT$, we get

$$\Pa{}{M_k\leq \frac{kT}{2}}\leq\exp\AP{-\frac{\AP{\frac{1}{2}kT}^2}{2kT^2}}=\exp\AP{-\frac{k}{8}}$$

Moreover, by definition of $K_n$, we have, for any $k,n\in\Nats$

$$\Pa{}{K_n> k}=\Pa{}{M_k< n}$$

It follows that

$$\Pa{}{K_{\Ceil{\frac{1}{2}kT}}>k}=\Pa{}{M_k< \Ceil{\frac{kT}{2}}}=\Pa{}{M_k<\frac{kT}{2}}\leq\exp\AP{-\frac{k}{8}}$$

Take $k:=\Ceil{\frac{2n}{T}}$. We get

$$\Pa{}{K_n>\frac{2n}{T}+1}\leq\Pa{}{K_{\Ceil{\frac{1}{2}\Ceil{\frac{2n}{T}}T}}>\Ceil{\frac{2n}{T}}}\leq\exp\AP{-\frac{\Ceil{\frac{2n}{T}}}{8}}\leq\exp\AP{-\frac{n}{4T}}\ \blacksquare$$

**Proposition A.15**

*Consider $\Psi$ be a measurable space, $(\Omega,P)$ a probability space, $\AC{\Fi_n\subseteq\PS{\Omega}}_{n\in\Nats}$ a filtration, $\AC{X_n:\Omega\rightarrow\Psi}_{n\in\Nats}$ a stochastic process adapted to $\Fi$, $\AC{M_k:\Omega\rightarrow\Nats}_{k\in\Nats}$ stopping times and $\AC{f_n:\Psi^{n+1}\rightarrow[0,1]}_{n\in\Nats}$ measurable functions. Consider also $\gamma\in(0,1)$ and $C\in\Reals^+$ and assume that with probability 1*

$$\sum_{k=0}^\infty \gamma^kf_k\AP{X_{M_0},X_{M_1}\ldots X_{M_{k}}} \leq C$$

*In addition, consider some $T\in\Nats^+$, $T\geq2$ and assume that for all $k\in\Nats$*

$$\CP{}{M_{k}=n}{M_{k-1}}=\begin{cases} \AP{2T-1}^{-1} \text{ if } M_{k-1} < n < M_{k-1}+2T\\ 0 \text{ otherwise} \end{cases}$$

*Here, $M_{-1}$ is understood to identically equal $-1$.*

*Finally, assume that, conditional on $M_k\geq n$, $M_k$ and $X_{n}$ are independent. Define the $\Fi_n$-measurable random variable $K_n:\Omega\rightarrow\Nats$ by*

$$K_n:=\min\ACM{k\in\Nats}{M_k\geq n}$$

*Then,*

$$\sum_{n=0}^\infty\gamma^{\frac{2n}{T}+1}\E{f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}}\leq 2CT+\frac{1}{1-\exp\AP{-\frac{1}{4T}}}$$

**Proof of Proposition A.15**

We have, with probability 1

$$\sum_{n=0}^\infty\KD{M_{K_n}=n}\gamma^{K_n}f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n} \leq C$$

Taking expected value

$$\sum_{n=0}^\infty\E{\KD{M_{K_n}=n}\gamma^{K_n}f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}} \leq C$$

Denote by $K_n^\sharp$ the joint random variables $K_n$ and $M_0,M_1\ldots M_{K_n-1}$. Our assumptions imply that, conditional on $K_n^\sharp$, the factor $\KD{M_{K_n}=n}$ is independent of the rest of the expression inside the expected value. It follows that

$$\sum_{n=0}^\infty\E{\CP{}{M_{K_n}=n}{K_n^\sharp}\gamma^{K_n}\CE{}{f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}}{K_n^\sharp}} \leq C$$

Clearly

$$\CP{}{M_{K_n}=n}{K_n^\sharp}=\frac{1}{2T-n+M_{K_n-1}}\geq\frac{1}{2T}$$

We get

$$\sum_{n=0}^\infty\E{\frac{1}{2T}\gamma^{K_n}f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}} \leq C$$

$$\sum_{n=0}^\infty\E{\gamma^{K_n}f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}} \leq 2CT$$

Using Proposition A.14, we get

$$\sum_{n=0}^\infty\AP{\E{\gamma^{\frac{2n}{T}+1}f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}}-\exp\AP{-\frac{n}{4T}}} \leq 2CT$$

$$\sum_{n=0}^\infty\gamma^{\frac{2n}{T}+1}\E{f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}} \leq 2CT+\sum_{n=0}^\infty\exp\AP{-\frac{n}{4T}}$$

$$\sum_{n=0}^\infty\gamma^{\frac{2n}{T}+1}\E{f_{K_n}\AP{X_{M_0},X_{M_1}\ldots X_{M_{K_n-1}},X_n}} \leq 2CT+\frac{1}{1-\exp\AP{-\frac{1}{4T}}}\ \blacksquare$$

**Proposition A.16**

*Consider $(\Omega,P)$ a probability space, $T\in\Nats^+$ and $\AC{N_k,\Delta_k:\Omega\rightarrow\Nats}_{k\in\Nats}$ random variables s.t. $N_{k+1}-N_k\geq\Delta_k$ and the $\Delta_k$ are all independent and uniformly distributed between $1$ and $2T-1$. Consider also $\gamma\in(0,1)$. Then, for any $k\in\Nats$*

$$\E{\gamma^{N_k}}\leq\AP{1-T\gamma^{2T-2}(1-\gamma)}^k$$

*In particular,*

$$\sum_{k=0}^\infty\E{\gamma^{N_k}}\leq\frac{1}{T\gamma^{2T-2}(1-\gamma)}$$

**Proof of Proposition A.16**

For any $n\in\Nats$, we have

$$\frac{1-\gamma^n}{1-\gamma}=\sum_{m=0}^{n-1}\gamma^m$$

$$1-\gamma^n=(1-\gamma)\sum_{m=0}^{n-1}\gamma^m\geq n(1-\gamma)\gamma^{n-1}$$

$$\gamma^n\leq1-n(1-\gamma)\gamma^{n-1}$$

Therefore, since $\Delta_0$ is uniformly distributed between $1$ and $2T-1$,

$$\E{\gamma^{\Delta_0}}=\frac{1}{2T-1}\sum_{n=1}^{2T-1}\gamma^n\leq\frac{1}{2T-1}\sum_{n=1}^{2T-1}\AP{1-n(1-\gamma)\gamma^{n-1}}$$

$$\E{\gamma^{\Delta_0}}\leq\frac{1}{2T-1}\sum_{n=1}^{2T-1}\AP{1-n(1-\gamma)\gamma^{2T-2}}=1-T(1-\gamma)\gamma^{2T-2}$$

Also, for any $k\in\Nats$

$$N_k\geq\sum_{l=0}^{k-1}\Delta_l$$

$$\gamma^{N_k}\leq\gamma^{\sum_{l=0}^{k-1}\Delta_l}=\prod_{l=0}^{k-1}\gamma^{\Delta_l}$$

$$\E{\gamma^{N_k}}\leq\E{\prod_{l=0}^{k-1}\gamma^{\Delta_l}}=\prod_{l=0}^{k-1}\E{\gamma^{\Delta_l}}=\E{\gamma^{\Delta_0}}^k$$

Here, we used that the $\Delta_l$ are independent and equally distributed. Substituting the expression for $\E{\Delta_0}$, we get the desired result. $\blacksquare$

**Proposition A.17**

*In the setting of Proposition A.16, consider some $\delta\in\Reals^+$. Denote*

$$\alpha:=1-T\gamma^{2T-2}(1-\gamma)$$

*Assume $\alpha>0$. Then,*

$$\sum_{k=0}^\infty\min\AP{\E{\gamma^{N_k}},\delta}\leq\AP{\Ceil{\frac{\ln\delta}{\ln\alpha}}+\frac{1}{1-\alpha}}\delta$$

**Proof of Proposition A.17**

By Proposition A.16

$$\sum_{k=0}^\infty\min\AP{\E{\gamma^{N_k}},\delta}\leq\sum_{k=0}^\infty\min\AP{\alpha^k,\delta}$$

$$\sum_{k=0}^\infty\min\AP{\E{\gamma^{N_k}},\delta}\leq\sum_{k=0}^{\Ceil{\frac{\ln\delta}{\ln\alpha}}-1}\min\AP{\alpha^k,\delta}+\sum_{k=\Ceil{\frac{\ln\delta}{\ln\alpha}}}^\infty\min\AP{\alpha^k,\delta}$$

In the second term, we have

$$\alpha^k\leq\alpha^{\Ceil{\frac{\ln\delta}{\ln\alpha}}}\leq\alpha^{\frac{\ln\delta}{\ln\alpha}}=e^{\ln\alpha\frac{\ln\delta}{\ln\alpha}}=e^{\ln\delta}=\delta$$

We get

$$\sum_{k=0}^\infty\min\AP{\E{\gamma^{N_k}},\delta}\leq\sum_{k=0}^{\Ceil{\frac{\ln\delta}{\ln\alpha}}-1}\delta+\sum_{k=\Ceil{\frac{\ln\delta}{\ln\alpha}}}^\infty\alpha^k=\Ceil{\frac{\ln\delta}{\ln\alpha}}\delta+\frac{\alpha^{\Ceil{\frac{\ln\delta}{\ln\alpha}}}}{1-\alpha}$$

We've already seen that $\alpha^{\Ceil{\frac{\ln\delta}{\ln\alpha}}}\leq\delta$, and therefore

$$\sum_{k=0}^\infty\min\AP{\E{\gamma^{N_k}},\delta}\leq\Ceil{\frac{\ln\delta}{\ln\alpha}}\delta+\frac{\delta}{1-\alpha}=\AP{\Ceil{\frac{\ln\delta}{\ln\alpha}}+\frac{1}{1-\alpha}}\delta\ \blacksquare$$

We will use the notations of Definitions B.1 and B.2 (see Appendix).

The following is a simple generalization of "Lemma 1" in [Osband and Van Roy 2014](https://arxiv.org/abs/1406.1853) and the proof is essentially the same.

**Proposition A.18**

*Consider a set $\X$, a finite-dimensional inner product space $\Y$ and some $\F\subseteq\AC{\X\rightarrow\Y}$. Consider also some $\boldsymbol{x}\in\X^\omega$, $\boldsymbol{y}\in\Y^\omega$, $T\in\Nats$, $\theta\in\Reals^+$, an increasing sequence $\AC{N_k\in\Nats}_{k\in\Nats}$ and a nondecreasing sequence $\AC{\beta_k\in\Reals^+}_{k\in\Nats}$. Suppose that for any $k\in\Nats$, $N_{k+1}\leq N_k+T$. For any $k\in\Nats$, define $\F^k$ by*

$$\F^k:=\CS^\F\AB{\boldsymbol{xy}_{:N_k},\beta_k^{-1}}$$

*Denote $D:=\RVO\F$. Then, for any $K\in\Nats$*

$$\Abs{\ACM{\AP{k\in[K],n\in\Nats}}{N_k\leq n<N_{k+1},\ \W^{\F^{k}}\AP{\boldsymbol{x}_{n}}>\theta}}\leq(D+1)\AP{\frac{4\beta_{K-1}}{\theta^{2}}+T}$$

*Here, $\beta_{-1}$ is understood to mean $0$.*

**Proof of Proposition A.18**

Let $A\subset\Nats\times\Nats$ be the set

$$A:=\ACM{\AP{k\in[K],n\in\Nats}}{N_k\leq n<N_{k+1},\ \W^{\F^{k}}\AP{\boldsymbol{x}_{n}}>\theta}$$

Let $A'\subset\Nats$ be the set

$$A':=\ACM{n\in\Nats}{\exists k\in[K]:(k,n)\in A}$$

For each $i\in\AB{\Abs{A}}$, we define $\AP{k_i,n_i}\in A$ recursively by

$$n_0:=\min A'$$
$$n_{i+1}:=\min\ACM{n\in A'}{n > n_i}$$

Denote $D:=\RVO{\F}$ and let $L:=\Floor{\frac{\Abs{A}}{D+1}}$. Given any $\boldsymbol{n}\in\Nats^*$, the notation $\boldsymbol{x}_{\boldsymbol{n}}$ will refer to the element of $\X^*$ s.t. $\Abs{\boldsymbol{x}_{\boldsymbol{n}}}=\Abs{\boldsymbol{n}}$ and for any $i\in\AB{\Abs{\boldsymbol{n}}}$, $\AP{\boldsymbol{x}_{\boldsymbol{n}}}_i:=\boldsymbol{x}_{\boldsymbol{n}_i}$. We define $j\in\AB{\Abs{A}}$ and $\AC{\boldsymbol{m}_{li}\in \Nats^*}_{l\in[L],i\in\AB{j+1}}$ by recursion over $i$.

For $i=0$, we set $\boldsymbol{m}_{l0}:=\Estr$. For any $i$, we consider whether there is $l\in[L]$ s.t. $\boldsymbol{x}_{n_i}$ is $(\F,\theta)$-independent of $\boldsymbol{x}_{\boldsymbol{m}_{li}}$. If there is such $l$, we set $\boldsymbol{m}_{l,i+1}:=\boldsymbol{m}_{li}{n_i}$ and for any $l'\in[L]\setminus l$, $\boldsymbol{m}_{l',i+1}:=\boldsymbol{m}_{li}$. If there is no such $l$, we set $j:=i$. The latter situation must occur for some $i\in\AB{\Abs{A}}$, since otherwise we would get

$$\sum_{l\in[L]}\Abs{\boldsymbol{m}_{l\Abs{A}}}=\Abs{A}$$

That would imply that there is $l\in[L]$ s.t.

$$\Abs{\boldsymbol{m}_{l\Abs{A}}}\geq\frac{\Abs{A}}{L}=\frac{\Abs{A}}{\Floor{\frac{\Abs{A}}{D+1}}}\geq\frac{\Abs{A}}{\AP{\frac{\Abs{A}}{D+1}}}=D+1$$

This is impossible since, by construction, each element of the sequence $\boldsymbol{x}_{\boldsymbol{m}_{l\Abs{A}}}$ is $(\F,\theta)$-independent of the preceding subsequence, whereas, by definition of $D$, it is the maximal length of such a sequence.

Since $(k_j,n_j)\in A$, $\W^{\F^{k_j}}\AP{\boldsymbol{x}_{n_j}}>\theta$. Therefore, there are $f,\tilde{f}\in\F^{k_j}$ s.t. 

$$\Norm{f\AP{\boldsymbol{x}_{n_j}}-\tilde{f}\AP{\boldsymbol{x}_{n_j}}}>\theta$$

By construction of $j$ and $m$, For each $l\in[L]$, $\boldsymbol{x}_{n_j}$ is $(\F,\theta)$-dependent of $\boldsymbol{x}_{\boldsymbol{m}_{lj}}$. Therefore,

$$\sum_{i=0}^{\Abs{\boldsymbol{m}_{lj}}-1}\Norm{f\AP{\boldsymbol{x}_{\boldsymbol{m}_{lji}}}-\tilde{f}\AP{\boldsymbol{x}_{\boldsymbol{m}_{lji}}}}^2>\theta^2$$

Define $J\subseteq[L]$ by

$$J:=\ACM{l\in[L]}{\forall i\in\AB{\Abs{\boldsymbol{m}_{lj}}}: \boldsymbol{m}_{lji}<N_{k_j}}$$

$$\sum_{l\in J}\sum_{i=0}^{\Abs{\boldsymbol{m}_{lj}}-1}\Norm{f\AP{\boldsymbol{x}_{\boldsymbol{m}_{lji}}}-\tilde{f}\AP{\boldsymbol{x}_{\boldsymbol{m}_{lji}}}}^2\geq\Abs{J}\theta^2$$

By construction, the sequences $\boldsymbol{m}_{lj}$ for all values of $l$ together are a collection of *distinct* elements of $\AB{n_j}$. Therefore, $\Abs{J}\geq L-\AP{n_j-N_{k_j}}\geq L-T+1$. It follows that

$$\sum_{n=0}^{N_{k_j}-1}\Norm{f\AP{\boldsymbol{x}_n}-\tilde{f}\AP{\boldsymbol{x}_n}}^2\geq(L-T+1)\theta^2$$

$$\sqrt{\sum_{n=0}^{N_{k_j}-1}\Norm{f\AP{\boldsymbol{x}_n}-\tilde{f}\AP{\boldsymbol{x}_n}}^2}\geq\theta\sqrt{\max(L-T+1,0)}$$

Denote $f^*:=\LS^\F\AB{\boldsymbol{xy}_{:N_{k_j}}}$.

$$\sqrt{\sum_{n=0}^{N_{k_j}-1}\Norm{f\AP{\boldsymbol{x}_n}-f^*\AP{\boldsymbol{x}_n}}^2}+\sqrt{\sum_{n=0}^{N_{k_j}-1}\Norm{\tilde{f}\AP{\boldsymbol{x}_n}-f^*\AP{\boldsymbol{x}_n}}^2}\geq\theta\sqrt{\max(L-T+1,0)}$$

Since $f,\tilde{f}\in\F^{k_j}$, by the definition of $\F^{k_j}$ each of the two terms on the RHS is at most $\sqrt{\beta_{k_j}}\leq\sqrt{\beta_{K-1}}$ and we get

$$2\sqrt{\beta_{K-1}} \geq\theta\sqrt{\max(L-T+1,0)}$$

$$4\beta_{K-1} \geq \theta^2(L+1-T)$$

$$4\beta_{K-1} \geq\theta^2\AP{\frac{\Abs{A}}{D+1}-T}$$

$$\Abs{A}\leq(D+1)\AP{\frac{4\beta_{K-1}}{\theta^2}+T}\ \blacksquare$$

**Proposition A.19**

*Consider $\alpha\in\Nats$ and $f:\Reals^+\rightarrow\Reals^+$ non-decreasing. Define $g:\Reals\rightarrow\Reals$ by $g(x):=\ln{f\AP{e^x}}$, and assume $g$ is Lipschitz continuous with constant $\alpha$. In other words, for any $t\in\Reals^+$ and $\lambda\in[1,\infty)$, we have $f\AP{\lambda t}\leq\lambda^\alpha f(t)$. Let $\La$ denote the Laplace transform operator. Then,*

$$\La[f](s)\leq\frac{1-e^{-1}+\alpha!}{s}f\AP{\frac{1}{s}}$$

**Proof of Proposition A.19**

$$\La[f](s)=\int_0^\infty e^{-st}f(t)\D t=\int_0^{\frac{1}{s}}e^{-st}f(t)\D t+\int_{\frac{1}{s}}^\infty e^{-st}f(t)\D t$$

For the first term, we will use that $f$ is non-decreasing, and for the second term, we will use that $g$ is Lipschitz continuous with constant $\alpha$.

$$\La[f](s)\leq\int_0^{\frac{1}{s}}e^{-st}f\AP{\frac{1}{s}}\D t+\int_{\frac{1}{s}}^\infty e^{-st}f\AP{\frac{1}{s}}\cdot\AP{ts}^\alpha\D t$$

$$\La[f](s)\leq\AP{\int_0^{\frac{1}{s}}e^{-st}\D t+s^\alpha\int_{\frac{1}{s}}^\infty e^{-st}t^\alpha\D t}f\AP{\frac{1}{s}}$$

$$\La[f](s)\leq\AP{\int_0^{\frac{1}{s}}e^{-st}\D t+s^\alpha\int_{0}^\infty e^{-st}t^\alpha\D t}f\AP{\frac{1}{s}}$$

$$\La[f](s)\leq\AP{\frac{1-e^{-1}}{s}+s^\alpha\cdot\alpha!s^{-\alpha-1}}f\AP{\frac{1}{s}}=\frac{1-e^{-1}+\alpha!}{s}f\AP{\frac{1}{s}}\ \blacksquare$$

**Proposition A.20**

*There is some $C_{\mathrm{A.20}}\in\Reals^+$ s.t. the following holds.*

*Consider a set $\X$, an inner product space $\Y$ and some $\F\subseteq\AC{\X\rightarrow\Y}$. Consider also some $\boldsymbol{x}\in\X^\omega$, $\boldsymbol{y}\in\Y^\omega$, $T\in\Nats^+$, $\gamma\in(0,1)$, $\theta\in\Reals^+$, $\eta_0,\eta_1\in\Reals^+$, $\delta\in(0,1)$ and an increasing sequence $\AC{N_k\in\Nats}_{k\in\Nats}$. Suppose that $N_0=0$, for any $k\in\Nats$, $N_{k+1}\leq N_k+T$, and $\gamma^T>\frac{1}{2}$. Denote*

$$\beta(t):=\eta_0 + \eta_1t\ln{\frac{et}{\delta}}$$

*For any $k\in\Nats$, define $\F^k$ by*

$$\F^k:=\CS^\F\AB{\boldsymbol{xy}_{:N_k},\beta\AP{N_k+1}^{-1}}$$

*Denote $D:=\RVO\F$. Then,*

$$\sum_{k=0}^\infty\sum_{n=N_k}^{N_{k+1}-1}{\gamma^{kT}\boldsymbol{1}_{\W^{F^k}\AP{\boldsymbol{x}_{n}}>\theta}} \leq C_{\mathrm{A.20}}D\AP{\frac{1}{\theta^2}\beta\AP{\frac{1}{1-\gamma}}+T}$$

**Proof of Proposition A.20**

By Proposition A.18, for any $K\in\Nats$

$$\sum_{k=0}^{K-1}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}
} \leq(D+1)\AP{\frac{4\beta\AP{N_{K-1}+1}}{\theta^{2}}+T}$$

Here, $N_{-1}$ is understood to mean $0$. Observing that $N_k\leq kT$, we get

$$\sum_{k=0}^{K-1}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}
} \leq(D+1)\AP{\frac{4\beta\AP{KT+1}}{\theta^{2}}+T}$$

Multiplying the inequality by $\gamma^{KT}$ and summing over $K$, we get

$$\sum_{k=0}^{\infty}\AP{\sum_{K=k+1}^\infty \gamma^{KT}}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}} \leq(D+1)\sum_{K=0}^\infty\gamma^{KT}\AP{\frac{4\beta\AP{KT+1}}{\theta^{2}}+T}$$

On the left hand side, we sum the geometric series. On the right hand side, we use the observation that

$$\gamma^{KT}\AP{\frac{4\beta\AP{KT+1}}{\theta^{2}}+T} \leq \frac{1}{T}\int_0^T \gamma^{KT+t-T}\AP{\frac{4\beta\AP{KT+t+1}}{\theta^2}+T}\D t$$

$$\gamma^{KT}\AP{\frac{4\beta\AP{KT+1}}{\theta^{2}}+T} \leq \frac{1}{T\gamma^T}\int_0^T \gamma^{KT+t}\AP{\frac{4\beta\AP{KT+t+1}}{\theta^2}+T}\D t$$

Here, we used that $\beta(t)$ is an increasing function for $t\geq 1$. We get

$$\sum_{k=0}^{\infty}\frac{\gamma^{(k+1)T}}{1-\gamma^T}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}} \leq \frac{D+1}{T\gamma^T}\int_0^\infty\gamma^{t}\AP{\frac{4\beta(t+1)}{\theta^2}+T}\D t$$

$$\frac{\gamma^T}{1-\gamma^T}\sum_{k=0}^{\infty}\gamma^{kT}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}} \leq \frac{D+1}{T\gamma^T}\La_t\AB{\frac{4\beta(t+1)}{\theta^2}+T}\AP{\ln\frac{1}{\gamma}}$$

It is easy to see that Proposition A.19 is applicable to the RHS for $\alpha=2$. We get,

$$\frac{\gamma^T}{1-\gamma^T}\sum_{k=0}^{\infty}\gamma^{kT}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}} \leq \frac{D+1}{T\gamma^T}\cdot\frac{3-e^{-1}}{\ln\frac{1}{\gamma}}\AP{\frac{4\beta\AP{\frac{1}{\ln\frac{1}{\gamma}}+1}}{\theta^2}+T}$$

Using the condition $\gamma^T>\frac{1}{2}$ and absorbing $O(1)$ factors into the definition of $C_{\text{A.20}}$, we get

$$\sum_{k=0}^{\infty}\gamma^{kT}\sum_{n=N_k}^{N_{k+1}-1}{\boldsymbol{1}_{\W^{\F^k}\AP{\boldsymbol{x}_{n}}>\theta}} \leq C_{\text{A.20}} D\AP{\frac{1}{\theta^2}\beta\AP{\frac{1}{1-\gamma}}+T}\ \blacksquare$$

**Proposition A.21**

*There is some $C_{\mathrm{A.21}}\in\Reals^+$ s.t. the following holds. In the setting of Proposition A.20, assume that for any $x\in\X$ and $f\in\F$, $\Norm{f(x)}\leq1$. Then,*

$$\sum_{k=0}^{\infty}\sum_{n=N_k}^{N_{k+1}-1}\gamma^{kT}\W^{\F^k}\AP{\boldsymbol{x}_{n}} \leq C_{\text{A.21}}\AP{DT+\sqrt{D\beta\AP{\frac{1}{1-\gamma}}\frac{1}{1-\gamma}}}$$

**Proof of Proposition A.21**

Due to the assumption $\Norm{f(x)}\leq1$, we have $\W^{\F^k}(x)\leq 2$. For any $t\in\Reals^+$, we have

$$\W^{F^k}\AP{\boldsymbol{x}_{n}}=\int_0^2\boldsymbol{1}_{\W^{F^k}\AP{\boldsymbol{x}_{n}}>\theta}\D\theta\leq t+\int_t^2\boldsymbol{1}_{\W^{F^k}\AP{\boldsymbol{x}_{n}}>\theta}\D\theta$$

$$\sum_{k=0}^\infty\sum_{n=N_k}^{N_{k+1}-1}{\gamma^{kT}\W^{F^k}\AP{\boldsymbol{x}_{n}}}\leq\frac{tT}{1-\gamma^{T}}+\int_t^2 \sum_{k=0}^\infty\sum_{n=N_k}^{N_{k+1}-1}\gamma^{kT}\boldsymbol{1}_{\W^{F^k}\AP{\boldsymbol{x}_{n}}>\theta}\D\theta$$

Applying Proposition A.20 to integrand on the RHS

$$\sum_{k=0}^\infty\sum_{n=N_k}^{N_{k+1}-1}{\gamma^{kT}\W^{F^k}\AP{\boldsymbol{x}_{n}}}\leq\frac{tT}{1-\gamma^{T}}+C_{\text{A.20}}D\int_t^2\AP{\frac{1}{\theta^2}\beta\AP{\frac{1}{1-\gamma}}+T}\D\theta$$

Evaluating the integral and dropping some negative terms on the right hand side, we get

$$\sum_{k=0}^\infty\sum_{n=N_k}^{N_{k+1}-1}{\gamma^{kT}\W^{F^k}\AP{\boldsymbol{x}_{n}}}\leq\frac{tT}{1-\gamma^{T}}+C_{\text{A.20}}D \AP{\frac{1}{t}\beta\AP{\frac{1}{1-\gamma}}+2T}$$

We now set $t$ to be

$$t:=\sqrt{D\beta\AP{\frac{1}{1-\gamma}}\cdot(1-\gamma)}$$

For an appropriate choice of $C_{\text{A.21}}$, and using the assumption $\gamma^T>\frac{1}{2}$, it follows that

$$\sum_{k=0}^{\infty}\sum_{n=N_k}^{N_{k+1}-1}\gamma^{kT}\W^{\F^k}\AP{\boldsymbol{x}_{n}} \leq C_{\text{A.21}}\AP{DT+\sqrt{D\beta\AP{\frac{1}{1-\gamma}}\frac{1}{1-\gamma}}}\ \blacksquare$$

**Proof of Theorem 2**

We take $\pi^\dagger_\gamma:=\pi^\PSR_{\gamma,T}$ where $T\in\Nats^+$ will be specified later. By Proposition A.13

$$\Reg(\gamma)\leq\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\AP{(1-\gamma)\Abs{\Delta\R_k\AP{\Theta_n}}+\gamma\Abs{\CE{\Delta\SHy_k}{\V_{\SHy_k\R_k}(\gamma)}{\Theta_n,\AT_n}}}}$$
$$+\sum_{k=0}^\infty\E{{\gamma^{\IT_k}}\Abs{\CE{\Ev_{k*}^{\Delta\ET_k}-\Ev_{*k}^{\Delta\ET_k}}{\V_{\SHy_*\R_*}(\gamma)}{\Theta_{\ET_k}}}}$$
$$+(1-\gamma)\sum_{k=0}^\infty\E{\sum_{n=\IT_k}^{\ET_{k+1}-1}\gamma^n\Abs{\CE{\Ev_{**}^{n-\IT_k}-\Ev_{*k}^{n-\IT_k}}{\R_*}{\Theta_{\IT_k}}}}$$
$$+\sum_{k=0}^\infty\E{\gamma^{\ET_{k+1}}\Abs{\CE{\Ev_{**}^{\Delta\IT_k}-\Ev_{*k}^{\Delta\IT_k}}{\V_{\THy\R_*}(\gamma)}{\Theta_{\IT_k}}}}$$

We will use the notation

$$\Delta\V(\gamma):=\max_{\T\in\Hy}{\AP{\max_{s\in\St}{\V_{\T\R_\T}(s,\gamma)}-\min_{s\in\St}{\V_{\T\R_\T}(s,\gamma)}}}$$

We will also use the notation $\Dtva{\mu-\nu}:=\Dtva{\mu,\nu}$.

It follows that

$$\Reg(\gamma)\leq\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\AP{(1-\gamma)\Abs{\Delta\R_k\AP{\Theta_n}}+\gamma\Delta\V(\gamma)\Dtva{\Delta\SHy_k\AP{\Theta_n,\AT_n}}}}$$
$$+\Delta\V(\gamma)\sum_{k=0}^\infty\E{{\gamma^{\IT_k}}}+(1-\gamma)\sum_{k=0}^\infty\E{\sum_{n=\IT_k}^{\ET_{k+1}-1}\gamma^n}+\Delta\V(\gamma)\sum_{k=0}^\infty\E{\gamma^{\ET_{k+1}}}$$

Denote $\Reg_{0}(\gamma)$ the first term on the RHS and $\Reg_{1}(\gamma)$ the sum of the others terms. We have

$$\Reg(\gamma)\leq\Reg_0(\gamma)+\Reg_1(\gamma)$$

First, we analyze $\Reg_1$. In the second term, we have $\gamma^n\leq\gamma^{M_k}$, leading to

$$\E{\sum_{n=\IT_k}^{\ET_{k+1}-1}\gamma^n}\leq\E{\Delta M_k\gamma^{M_k}}=\E{\CE{}{\Delta M_k}{M_k}\gamma^{M_k}}\leq t_\Est\E{\gamma^{M_k}}$$

We get

$$\Reg_1(\gamma)\leq\Delta\V(\gamma)\sum_{k=0}^\infty\E{{\gamma^{\IT_k}}}+t_\Est(1-\gamma)\sum_{k=0}^\infty\E{\gamma^{M_k}}+\Delta\V(\gamma)\sum_{k=0}^\infty\E{\gamma^{\ET_{k+1}}}$$

Applying Proposition A.16 to each term, we get

$$\Reg_1(\gamma)\leq\frac{2\Delta\V(\gamma)+t_\Est(1-\gamma)}{\gamma^{2T-2}(1-\gamma)T}$$

Now, we analyze $\Reg_0$. Define $\Theta_M^r\in\AP{\St\times\Reals}^\omega$ by

$$\Theta_{Mk}^r:=\AP{\Theta_{M_k},r\AP{\Theta\AT_{M_k:N_{k+1}}\Theta_{N_{k+1}}}}$$

That is, $\Theta_M^r$ is the history of reward estimation experiments. For any $i\in\Nats$, let $L_i$ be the stopping time defined recursively by

$$L_0:=0$$
$$L_{i+1}:=\min\ACM{l\in\Nats}{l>L_i,\ \exists k\in\Nats:\ET_k\leq l < \IT_k}$$

That is, $L$ are time indices that traverse the "interior" of the episodes only. Define $\Theta\AT_L\in\AP{\St\times\A}^\omega$ by

$$\Theta\AT_{Li}:=\Theta_{L_i}\AT_{L_i}$$

We apply Proposition B.1 (see Appendix) with $\delta:=\frac{1}{2}(1-\gamma)^2$ and $\epsilon:=(1-\gamma)^2$, to each of the two terms in $\Reg_0(\gamma)$:

$$\Pb{\R_*\in\bigcap_{k=0}^\infty\CS^{\Hy_\R}\AB{\Theta_{M:k}^{r},\beta_\R(k+1)^{-1}}} \geq 1-\frac{1}{2}(1-\gamma)^2$$
$$\Pb{\SHy_*\in\bigcap_{i=0}^\infty\CS^{\Hy}\AB{\Theta\AT_{L:i}\Theta_{L_i},\beta_\T(i+1)^{-1}}} \geq 1-\frac{1}{2}(1-\gamma)^2$$

Here, $\beta_R$ and $\beta_\T$ correspond to $\beta$ in Proposition B.1.

We also define $N_k'$ by the condition $L_{N'_k}=N_k$. Since the hypotheses $\SHy_k$ is sampled from the posterior, for any $k\in\Nats$ we also have

$$\Pb{\R_k\in\CS^{\Hy_\R}\AB{\Theta_{M:k}^{r},\beta_\R(k+1)^{-1}}} \geq 1-\frac{1}{2}(1-\gamma)^2$$
$$\Pb{\SHy_{k}\in\CS^\Hy\AB{\Theta\AT_{L:N'_k}\Theta_{N_k},\beta_\T\AP{N'_k+1}^{-1}}} \geq 1-\frac{1}{2}(1-\gamma)^2$$

$$\Pb{\R_*,\R_k\in\CS^{\Hy_\R}\AB{\Theta_{M:k}^{r},\beta_\R(k+1)^{-1}}} \geq 1-(1-\gamma)^2$$
$$\Pb{\THy,\SHy_{k}\in\CS^\Hy\AB{\Theta\AT_{L:N'_k}\Theta_{N_k},\beta_\T\AP{N'_k+1}^{-1}}} \geq 1-(1-\gamma)^2$$

Denote

$$\CSE_\R^k:=\AC{\R_*,\R_k\in\CS^{\Hy_\R}\AB{\Theta_{M:k}^{r},\beta_\R(k+1)^{-1}}}\subseteq\Omega$$
$$\CSE_\T^k:=\AC{\THy,\SHy_{k}\in\CS^\Hy\AB{\Theta\AT_{L:N'_k}\Theta_{N_k},\beta_\T\AP{N'_k+1}^{-1}}}\subseteq\Omega$$

Define $\Reg_{\R}(\gamma)$ and $\Reg_{\T}(\gamma)$ by

$$\Reg_{\R}(\gamma):=(1-\gamma)\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}}}$$
$$\Reg_{\T}(\gamma):=\Delta\V(\gamma)\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n+1}\Dtva{\Delta\SHy_k\AP{\Theta_n,\AT_n}}}$$

We have

$$\Reg_0(\gamma)=\Reg_{\R}(\gamma)+\Reg_{\T}(\gamma)$$

We split $\Reg_{\R}$ into the $\CSE_\R^k$ and $\CSE_\R^{k\complement}$ contributions

$$\Reg_{\R}(\gamma)=(1-\gamma)\sum_{k=0}^\infty\Bigg(\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^k}+$$
$$\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^{k\complement}}\Bigg)$$

For the second term, we have

$$\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}}\leq2T\gamma^{N_k}$$

$$\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^{k\complement}}\leq2T\E{\gamma^{N_k};\CSE_\R^{k\complement}}\leq2T\min\AP{\E{\gamma^{N_k}},\Pb{\CSE_\R^{k\complement}}}$$

$$\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^{k\complement}}\leq2T\min\AP{\E{\gamma^{N_k}},(1-\gamma)^2}$$

$$\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^{k\complement}}\leq 2T\sum_{k=0}^\infty\min\AP{\E{\gamma^{N_k}},(1-\gamma)^2}$$

Applying Proposition A.17 to the RHS, we get

$$\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^{k\complement}}\leq2T\AP{\Ceil{\frac{2\ln(1-\gamma)}{\ln\alpha}}+\frac{1}{T\gamma^{2T-2}(1-\gamma)}}(1-\gamma)^2$$

Here, $\alpha$ is as defined in Proposition A.17. Since we are interested in the asymptotics $\gamma\rightarrow1$, and our ultimate choice of $T$ will ensure that $\gamma^T\rightarrow1$, we will henceforth make the assumption that $\gamma^{2T}>\frac{1}{2}$.

$$\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^{k\complement}}\leq2T\Ceil{\frac{2\ln(1-\gamma)}{\ln\AP{1-\frac{1}{2}T(1-\gamma)}}}(1-\gamma)^2+4(1-\gamma)$$

Denote $\rho(\gamma,T)$ the expression on the RHS. We get

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\sum_{k=0}^\infty\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Abs{\Delta\R_k\AP{\Theta_n}};\CSE_\R^k}+\rho(\gamma,T)}$$

Denote

$$\Hy_\R^k:=\CS^{\Hy_\R}\AB{\Theta_{M:k}^r,\beta_\R(k+1)^{-1}}$$

Clearly

$$\CPb{\Abs{\Delta\R_k\AP{\Theta_n}}\leq\W^{\Hy_\R^k}\AP{\Theta_n}}{\CSE_\R^k}=1$$

Using this inequality, dropping the $;G_\R^k$ (since it can only the right hand side smaller) and moving the sum inside the expected value, we get

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\E{\sum_{k=0}^\infty\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\W^{\Hy_\R^k}\AP{\Theta_n}}+\rho(\gamma,T)}$$

Extending the sum on the RHS to $M_k$ (that can only increase it), and using the fact that the width is $\leq1$,

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\E{\sum_{k=0}^\infty\AP{\gamma^{N_k}+\sum_{n=\ET_k+1}^{\IT_k}\gamma^{n}\W^{\Hy_\R^k}\AP{\Theta_n}}}+\rho(\gamma,T)}$$

By Proposition A.16,

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\E{\sum_{k=0}^\infty\sum_{n=\ET_k+1}^{\IT_k}\gamma^{n}\W^{\Hy_\R^k}\AP{\Theta_n}}+\rho(\gamma,T)}+\frac{2}{T}$$

We define the random variable $K_i:\Omega\rightarrow\Nats$ by

$$K_i:=\min\ACM{k\in\Nats}{\IT_k\geq L_i}$$

We can now rewrite the previous inequality as

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\E{\sum_{i=0}^\infty\gamma^{L_i+1}\W^{\Hy_\R^{K_i}}\AP{\Theta_{L_i+1}}}+\rho(\gamma,T)}+\frac{2}{T}$$

Obviously $L_i+1\geq i$ and hence

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\sum_{i=0}^\infty\gamma^{i}\E{\W^{\Hy_\R^{K_i}}\AP{\Theta_{L_i+1}}}+\rho(\gamma,T)}+\frac{2}{T}$$

On the other hand, by Proposition A.21 (for the $T=1$, $N_k=k$ case, applied to the subsequence $\Theta_{M_k}$, with $\gamma^{\frac{1}{2}T}$ playing the role of $\gamma$)

$$\sum_{k=0}^\infty\gamma^{\frac{1}{2}Tk}\W^{\Hy_\R^{k}}\AP{\Theta_{M_k}}\leq C_{\text{A.21}}\AP{\DRVO +\sqrt{\DRVO\beta_\R\AP{\frac{1}{1-\gamma^{\frac{1}{2}T}}}\frac{1}{1-\gamma^{\frac{1}{2}T}}}}$$

Denote $\tilde{\beta}_\R(\gamma,T,\DRVO)$ the expression on the RHS. Applying Proposition A.15, we conclude

$$\sum_{i=0}^\infty\gamma^{i+\frac{1}{2}T}\E{\W^{\Hy_\R^{K_i}}\AP{\Theta_{L_i+1}}}\leq 2T\tilde{\beta}_\R(\gamma,T,\DRVO)+\frac{1}{1-\exp\AP{-\frac{1}{4T}}}$$

It follows

$$\Reg_\R(\gamma)\leq(1-\gamma)\AP{\gamma^{-\frac{1}{2}T}\AP{2T\tilde{\beta}_\R(\gamma,T,\DRVO)+\frac{1}{1-\exp\AP{-\frac{1}{4T}}}}+\rho(\gamma,T)}+\frac{2}{T}$$

Now, we analyze $\Reg_{\T}$. By the same reasoning as for $\Reg_\R$, we have

$$\Reg_\T(\gamma)\leq\Delta\V(\gamma)\AP{\E{\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\Dtva{\Delta\SHy_k\AP{\Theta_n,\AT_n}};\CSE_\T^k}+\rho(\gamma,T)}$$

Denote

$$\Hy_\T^k:=\CS^\Hy\AB{\Theta\AT_{L:N'_k}\Theta_{N_k},\beta_\T\AP{N'_k+1}^{-1}}$$

It is easy to see that for $N_k\leq n<M_k$

$$\CPb{\Dtva{\Delta\SHy_k\AP{\Theta_n,\AT_n}}\leq\frac{\Abs{\St}}{2}\W^{\Hy_\T^k}\AP{\Theta_n\AT_n}}{\CSE_\T^k}=1$$

It follows

$$\Reg_\T(\gamma)\leq\Delta\V(\gamma)\AP{\frac{\Abs{\St}}{2}\E{\sum_{k=0}^\infty\sum_{n=\ET_k}^{\IT_k-1}\gamma^{n}\W^{\Hy_\T^k}\AP{\Theta_n\AT_n}}+\rho(\gamma,T)}$$

$$\Reg_\T(\gamma)\leq\Delta\V(\gamma)\AP{\frac{\Abs{\St}}{2}\sum_{i=0}^\infty\E{\gamma^{L_i}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}}+\rho(\gamma,T)}$$

Since $L_i\geq i$, By Proposition A.14

$$\sum_{i=0}^\infty\E{\gamma^{L_i}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}}\leq\sum_{i=0}^\infty\AP{\E{\gamma^{\frac{1}{2}\AP{K_i-1}T}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}}+\exp\AP{-\frac{i}{4T}}}$$

$$\sum_{i=0}^\infty\E{\gamma^{L_i}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}}\leq\gamma^{-\frac{1}{2}T}\sum_{i=0}^\infty\E{\gamma^{\frac{1}{2}K_iT}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}}+\frac{1}{1-\exp\AP{-\frac{1}{4T}}}$$

Denote

$$\tilde{\rho}\AP{\gamma,T,\Abs{\St}}:=\rho(\gamma,T)+\frac{\Abs{\St}}{2}\cdot\frac{1}{1-\exp\AP{-\frac{1}{4T}}}$$

We get, using that $\gamma^{-\frac{1}{2}T}<2$

$$\Reg_\T(\gamma)\leq\Delta\V(\gamma)\AP{\Abs{\St}\sum_{i=0}^\infty\E{\gamma^{\frac{1}{2}K_iT}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}}+\tilde{\rho}\AP{\gamma,T,\Abs{\St}}}$$

On the other hand, $\RVO\Hy\leq\Abs{\St}\Abs{\A}$ and by Proposition A.21

$$\sum_{i=0}^\infty\gamma^{\frac{1}{2}K_i T}\W^{\Hy_\T^{K_i}}\AP{\Theta_{L_i}\AT_{L_i}}\leq C_{\text{A.21}}\AP{\Abs{\St}\Abs{\A} T+\sqrt{\Abs{\St}\Abs{\A}\beta_\T\AP{\frac{1}{1-\gamma^{\frac{1}{2}}}}\frac{1}{1-\gamma^{\frac{1}{2}}}}}$$

Denote $\tilde{\beta}_\T\AP{\gamma,T,\Abs{\St}\Abs{\A}}$ the expression on the RHS. It follows that

$$\Reg_\T(\gamma)\leq\Delta\V(\gamma)\AP{\Abs{\St}\tilde{\beta}_\T\AP{\gamma,T,\Abs{\St}\Abs{\A}}+\tilde{\rho}(\gamma,T)}$$

We set

$$T:=\sqrt[3]{\frac{\AP{\tau+t_\Est}^2}{\AP{\DMB+1}\DRVO(1-\gamma)\ln\frac{1}{1-\gamma}}}$$

Now, we analyze the $\gamma\rightarrow1$ limit. In this limit, the expression for $T$ justifies our assumption that $\gamma^{2T}>\frac{1}{2}$. Indeed, we have

$$\lim_{\gamma\rightarrow1}\ln{\gamma^T}=\lim_{\gamma\rightarrow1}T\ln\gamma=\lim_{\gamma\rightarrow1}\sqrt[3]{\frac{\AP{\tau+t_\Est}^2}{\AP{\DMB+1}\DRVO(1-\gamma)\ln\frac{1}{1-\gamma}}}\cdot\ln\gamma=0$$

We now analyze the separate contributions of $\Reg_\R$, $\Reg_\T$ and $\Reg_1$ to the limit of interest. We will use the notation $x\lesssim y$ to mean, there is some constant $C_0\in\Reals^+$ that depends on nothing (i.e. on none of the parameters of the problem) s.t. $x\leq C_0y$.

Our previous bound on $\Reg_\R$ can be written as

$$\Reg_\R(\gamma)\lesssim \DRVO(1-\gamma)T+$$
$$\sqrt{\DRVO\ln\N\AP{\Hy_\R,(1-\gamma)^{-4}}\cdot\frac{1}{1-\gamma^{\frac{1}{2}T}}}\cdot(1-\gamma)T+$$
$$\sqrt{\DRVO\frac{1}{1-\gamma^{\frac{1}{2}T}}\ln\frac{1}{1-\gamma}}\cdot(1-\gamma)T+$$
$$\frac{1-\gamma}{1-\exp\AP{-\frac{1}{4T}}}+$$
$$T\Ceil{\frac{\ln(1-\gamma)}{\ln\AP{1-\frac{1}{2}T(1-\gamma)}}}(1-\gamma)^3+$$
$$(1-\gamma)^2+$$
$$\frac{1}{T}$$

Here we used that $1\lesssim\gamma^T\leq1$, substituted the expressions for $\tilde{\beta}_\R$, $\tilde{\beta}$ and $\rho$, and dropped some dominated terms.

We analyze the separate contribution of each term.

$$\limsup_{\gamma \rightarrow 1}\frac{\DRVO(1-\gamma)T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\sqrt{\DRVO\ln\N\AP{\Hy_\R,(1-\gamma)^{-4}}\cdot\frac{1}{1-\gamma^{\frac{1}{2}T}}}\cdot(1-\gamma)T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\sqrt{\DRVO\DMB\ln\frac{1}{1-\gamma}\cdot\frac{1}{(1-\gamma)T}}\cdot(1-\gamma)T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\sqrt{\DRVO\DMB(1-\gamma)\ln\frac{1}{1-\gamma}\cdot T}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim1$$

$$\limsup_{\gamma \rightarrow 1}\frac{\sqrt{\DRVO\frac{1}{1-\gamma^{\frac{1}{2}T}}\ln\frac{1}{1-\gamma}}\cdot(1-\gamma)T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\sqrt{\DRVO\frac{1}{(1-\gamma)T}\ln\frac{1}{1-\gamma}}\cdot(1-\gamma)T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=$$
$$\limsup_{\gamma \rightarrow 1}\frac{\sqrt{\DRVO(1-\gamma)\ln\frac{1}{1-\gamma}\cdot T}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=\frac{1}{\sqrt[3]{\DMB+1}}$$

$$\limsup_{\gamma \rightarrow 1}\frac{\AP{\frac{1-\gamma}{1-\exp\AP{-\frac{1}{4T}}}}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{(1-\gamma)T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\AP{T\Ceil{\frac{\ln(1-\gamma)}{\ln\AP{1-\frac{1}{2}T(1-\gamma)}}}(1-\gamma)^3}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\ln\frac{1}{1-\gamma}(1-\gamma)^2}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{(1-\gamma)^2}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{1}{T\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=\frac{1}{\tau+t_\Est}$$

Our previous bound on $\Reg_\T$ can be written as

$$\R_\T(\gamma)\lesssim\Delta\V(\gamma)\Abs{\St}^2\Abs{\A} T$$
$$+\Delta\V(\gamma)\Abs{\St}\sqrt{\Abs{\St}\Abs{\A}\ln{\frac{\N(\Hy,(1-\gamma)^{-4} )}{(1-\gamma)^2}}\cdot\frac{1}{1-\gamma^{\frac{1}{2}}}}$$
$$+\Delta\V(\gamma)\Abs{\St}\sqrt{\Abs{\St}\Abs{\A}(1-\gamma)^{2} \frac{1}{1-\gamma^{\frac{1}{2}}}\ln{\frac{\AP{\frac{1}{1-\gamma^{\frac{1}{2}}}}}{(1-\gamma)^2}}\cdot\frac{1}{1-\gamma^{\frac{1}{2}}}}$$
$$+\Delta\V(\gamma)T\Ceil{\frac{\ln(1-\gamma)}{\ln\AP{1-\frac{1}{2}T(1-\gamma)}}}(1-\gamma)^2$$
$$+\Delta\V(\gamma)\cdot(1-\gamma)$$
$$+\Delta\V(\gamma)\frac{\Abs{\St}}{2}\cdot\frac{1}{1-\exp\AP{-\frac{1}{4T}}}$$

We analyze the contribution of each term.

$$\limsup_{\gamma \rightarrow 1}\frac{\Delta\V(\gamma)\Abs{\St}^2\Abs{\A} T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\tau(1-\gamma)\Abs{\St}^2\Abs{\A} T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\Delta\V(\gamma)\Abs{\St}\sqrt{\Abs{\St}\Abs{\A}\ln{\frac{\N(\Hy,(1-\gamma)^{-4} )}{(1-\gamma)^2}}\cdot\frac{1}{1-\gamma^{\frac{1}{2}}}}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\tau(1-\gamma)\Abs{\St}\sqrt{\Abs{\St}\Abs{\A}\AP{\MB\Hy+1}\ln\frac{1}{1-\gamma}\cdot\frac{1}{1-\gamma}}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\Delta\V(\gamma)\Abs{\St}\sqrt{\Abs{\St}\Abs{\A}(1-\gamma)^{2} \frac{1}{1-\gamma^{\frac{1}{2}}}\ln{\frac{\AP{\frac{1}{1-\gamma^{\frac{1}{2}}}}}{(1-\gamma)^2}}\cdot\frac{1}{1-\gamma^{\frac{1}{2}}}}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\Delta\V(\gamma)T\Ceil{\frac{\ln(1-\gamma)}{\ln\AP{1-\frac{1}{2}T(1-\gamma)}}}(1-\gamma)^2}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\tau(1-\gamma)^2\ln\frac{1}{1-\gamma}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\Delta\V(\gamma)\cdot(1-\gamma)}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

$$\limsup_{\gamma \rightarrow 1}\frac{\Delta\V(\gamma)\frac{\Abs{\St}}{2}\cdot\frac{1}{1-\exp\AP{-\frac{1}{4T}}}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\tau(1-\gamma)\Abs{\St}T}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=0$$

To complete the proof, we need to analyze the contribution of $\Reg_1$. We have

$$\Reg_1(\gamma)\lesssim\frac{1}{T}\AP{\frac{\Delta\V(\gamma)}{(1-\gamma)}+t_\Est}$$

$$\limsup_{\gamma \rightarrow 1}\frac{\frac{1}{T}\AP{\frac{\Delta\V(\gamma)}{(1-\gamma)}+t_\Est}}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim$$
$$\limsup_{\gamma \rightarrow 1}\frac{\tau+t_\Est}{T\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}=1$$

Putting everything together, we conclude

$$\limsup_{\gamma \rightarrow 1}\frac{\Reg(\gamma)}{\sqrt[3]{\AP{\tau+t_{\Est}}\AP{\DMB+1}\DRVO(1-\gamma)\ln{\frac{1}{1-\gamma}}}}\lesssim1\ \blacksquare$$

# Appendix

The following is a special case of what appeared in the [previous essay](https://www.alignmentforum.org/posts/Qa5jG9z9dC6E4s9JH/dimensional-regret-without-resets) as "Definition 1", introduced here for the sake of simplifying notations.

**Definition B.1**

*Consider a set $\X$, an inner product space $\Y$ and some $\F\subseteq\AC{\X\rightarrow\Y}$. Consider also $\theta\in \Reals^+$, $n\in\Nats$, a sequence $\AC{x_k\in\X}_{k\in[n]}$ and $x^*\in\X$. $x^*$ is said to be* $\AP{\F,\theta}$-dependant on $\AC{x_k}$ *when, for any $f,\tilde{f}\in\F$*

$$\sum_{k=0}^{n-1}\Norm{f\AP{x_k}-\tilde{f}\AP{x_k}}^{2}\leq\theta^2\implies \Norm{f\AP{x^*}-\tilde{f}\AP{x^*}}\leq\theta$$

*Otherwise, $x^*$ is said to be* $\AP{\F,\theta}$-independent of $\AC{x_k}$.

The following is a special case of what appeared in the [previous essay](https://www.alignmentforum.org/posts/Qa5jG9z9dC6E4s9JH/dimensional-regret-without-resets) as "Definition A.1".

**Definition B.2**

*Consider a set $\X$, a finite-dimensional inner product space $\Y$ and some $\F\subseteq\AC{\X\rightarrow\Y}$. Assume $\F$ is compact w.r.t. the product topology on $\X\rightarrow\Y\cong\prod_{x\in\X}\Y$. Consider also some $n\in\Nats$, $\boldsymbol{x}\in\X^n$, $\boldsymbol{y}\in\Y^n$ and $\lambda\in\Reals^+$. We then use the notation*

$$\LS^{\F}[\boldsymbol{xy}]:=\Argmin{f\in\F}{\sum_{m=0}^{n-1}\Norm{f\AP{\boldsymbol{x}_m}-\boldsymbol{y}_m }^{2}}$$

$$\CS^{\F}[\boldsymbol{xy},\lambda]:=\ACM{f\in\F}{\sum_{m=0}^{n-1}\Norm{f\AP{\boldsymbol{x}_m}-\LS^\F[\boldsymbol{xy}]\AP{\boldsymbol{x}_m}}^{2}\leq \frac{1}{\lambda}}$$

**Proposition B.1**

*There is some $C_{\mathrm{B.1}}\in\Reals^+$ s.t. the following holds.*

*Consider a finite set $\X$, a finite-dimensional inner product space $\Y$ and some $\F\subseteq\AC{\X\rightarrow\Y}$. Let $\AC{\mathfrak{H}_n\subseteq\PS{\X^\omega\times\Y^\omega}}_{n\in\Nats}$ be the canonical filtration, i.e.*

$$\mathfrak{H}_n:=\ACM{A'\subseteq\X^\omega\times\Y^\omega}{A'=\ACM{\boldsymbol{xy}}{\boldsymbol{xy}_{:n}\in A},\ A\subseteq\X^n\times\Y^n\text{ Borel}}$$

*Consider also $f^*\in\F$ and $\mu\in\Delta\AP{\X^\omega\times\Y^\omega}$ s.t. for any $n\in\Nats$ and $x\in\X$*

$$\CE{\boldsymbol{xy}\sim\mu}{\boldsymbol{y}_n}{\boldsymbol{x}_n=x,\ \mathfrak{H}_n} = f^*(x)$$

*Assume that $\Norm{\boldsymbol{y}_n}\leq1$ with $\mu$-probability $1$ for all $n\in\Nats$. Fix $\epsilon\in\Reals^+$, $\delta\in(0,1)$. Define $\beta:\Reals^+\rightarrow\Reals$ by*

$$\beta(t):=C_{\mathrm{B.1}}\AP{\sigma^2 \ln{\frac{\N\AP{\F,\epsilon^{-2}\Id_d}}{\delta}}+\epsilon t\ln{\frac{et}{\delta}}}$$

*Then,*

$$\Pa{\boldsymbol{xy}\sim\mu}{f^*\not\in\bigcap_{n=0}^\infty\CS^\F\AB{\boldsymbol{xy}_{:n},\beta(n+1)^{-1}}} \leq \delta$$

**Proof of Proposition B.1**

Straightforward from "Proposition B.1" and "Proposition A.3" in the [previous essay](https://www.alignmentforum.org/posts/Qa5jG9z9dC6E4s9JH/dimensional-regret-without-resets). $\blacksquare$