UCRL2 optimistic phase run with explicit confidence widths
ProvedBanditAlgorithm.mdp_ucrl2_optimistic_phase_run_with_confidence_widthsFix states, actions, a horizon , a confidence level and a known reward function with values in . There is a policy, depending on these known quantities but not on the transition matrix, such that for every communicating MDP with reward function and diameter and every initial state distribution there is an event with such that every trajectory lying in and in the confidence good event admits an optimistic phase run reporting its confidence widths.
This is the run of UCRL2 with its bookkeeping left visible. As in the plain optimistic phase run, the rounds are cut into consecutive phases , , with , and each phase carries a gain , a bias and a transition matrix satisfying optimism , the span bound and the Bellman equation along the realised trajectory. What is reported in addition is the data that the accumulated estimation error is computed from:
- the visit counts at the start of phase and the numbers of visits during it, satisfying , , , the doubling inequality that is exactly what ends a phase, and ;
- the fact that summing any function of the pair over the rounds of phase is the same as summing it against ;
- the width bound: the optimistic row and the true row both lie in the confidence ball of the pair played, hence are within of each other in ;
- each is a probability vector.
Everything except the accumulated estimation error is stated exactly as in the plain optimistic phase run; the estimation error is replaced by these local facts, which is what the algorithm actually delivers and from which the aggregate bound is a computation.
Formalization Note The states and actions of the trajectory are named by functions on agreeing with below , so that the terminal state, which the trajectory does not record but the telescoping and the martingale term refer to, may be supplied as extra data. The counts are real-valued because that is the form in which the doubling sum is applied.
import Definitions.Def_UCRL2ConfidenceSets open MeasureTheory ProbabilityTheory ENNReal
theorem BanditAlgorithm.mdp_ucrl2_optimistic_phase_run_with_confidence_widths
(S A n : ℕ) (hS : 2 ≤ S) (hA : 0 < A) (hn : 0 < n)
(δ : ℝ) (hδ : δ ∈ Set.Ioo (0 : ℝ) 1)
(r : Fin S → Fin A → ℝ) (hr : ∀ s a, r s a ∈ Set.Icc (0 : ℝ) 1) :
∃ π : MDPPolicy S A,
∀ M : FiniteMDP S A, M.r = r → M.IsCommunicating → 1 ≤ mdpDiameter M →
∀ μ0 : MDPStateDistribution S,
∃ E : Set (MDPTrajectory S A n),
mdpMeasure M μ0 π n Eᶜ ≤ ENNReal.ofReal (δ / 2) ∧
∀ h ∈ mdpConfidenceGoodEvent M n δ ∩ E,
∃ (st : ℕ → Fin S) (act : ℕ → Fin A) (K : ℕ) (τ : ℕ → ℕ)
(ρ : ℕ → ℝ) (v : ℕ → Fin S → ℝ) (q : ℕ → Fin S → Fin S → ℝ)
(N ν : ℕ → Fin S → Fin A → ℝ),
(∀ t : Fin n, h t = (st t, act t)) ∧
τ 0 = 0 ∧ τ K = n ∧ (∀ k, τ k ≤ τ (k + 1)) ∧
(K : ℝ) ≤ 3 * Real.sqrt (S * A * n) ∧
(∀ k < K, mdpOptimalGain M ≤ ρ k) ∧
(∀ k < K, ∀ x y : Fin S, v k x - v k y ≤ mdpDiameter M) ∧
(∀ k < K, ∀ s : Fin S, ∑ s', q k s s' = 1) ∧
(∀ k < K, ∀ t ∈ Finset.Ico (τ k) (τ (k + 1)),
ρ k + v k (st t)
= M.r (st t) (act t) + ∑ s', q k (st t) s' * v k s') ∧
(∀ s a, N 0 s a = 0) ∧
(∀ k s a, 0 ≤ ν k s a) ∧
(∀ k s a, N (k + 1) s a = N k s a + ν k s a) ∧
(∀ k s a, ν k s a ≤ max 1 (N k s a)) ∧
(∑ s, ∑ a, N K s a ≤ (n : ℝ)) ∧
(∀ k < K, ∀ g : Fin S → Fin A → ℝ,
∑ t ∈ Finset.Ico (τ k) (τ (k + 1)), g (st t) (act t)
= ∑ s, ∑ a, ν k s a * g s a) ∧
(∀ k < K, ∀ t ∈ Finset.Ico (τ k) (τ (k + 1)),
∑ s', |q k (st t) s' - (M.P (st t) (act t) s' : ℝ)|
≤ 2 * Real.sqrt (14 * S * Real.log (2 * S * A * n / δ)
/ max 1 (N k (st t) (act t)))) ∧
(∑ k ∈ Finset.range K, ∑ t ∈ Finset.Ico (τ k) (τ (k + 1)),
((∑ s', (M.P (st t) (act t) s' : ℝ) * v k s') - v k (st (t + 1)))
≤ mdpDiameter M * Real.sqrt (2 * n * Real.log (2 / δ))) := by
sorry