Theorem 8.3.5 — one algorithm acts T-step optimally at all but NAT timesteps in every deterministic MDP
ProvedSampleComplexityRL.Exploration.deterministic_sample_complexityFix a finite state set with states, a finite nonempty action set with actions, and a horizon . There exists a single algorithm — a deterministic function of the observed path of states, actions and rewards — with the following property. For every deterministic MDP on these states and actions (next-state map , rewards ), every start state and every number of epochs , the path produced by running from satisfies
for all but at most times . Here is the normalized reward the algorithm collects from to the -step end time of , and is the best such reward any algorithm could collect from the same subpath.
The bound does not depend on : however long the algorithm runs, it fails to act -step optimally at most times. It is matched by the thesis's lower bound (Theorem 8.3.6).
Formalization Note The printed statement fixes the MDP before the algorithm ("Let be … There exists an algorithm"), which an algorithm knowing satisfies trivially. The thesis's algorithm ( with , p. 114) does not know , and Theorem 8.3.1 says the algorithm takes only (and ) as inputs; here the algorithm is chosen before the MDP, the start state and . The algorithm observes rewards, as does (p. 105). Times are 0-based and counted for for every , which is equivalent to the printed "". In a deterministic MDP the expectation in is the realised sum, and is the best normalized reward over action sequences of length from (Markov property, p. 102).
import Mathlib import Definitions.Def_SampleComplexityRL_Exploration_Online
namespace SampleComplexityRL.Exploration
/-- **Theorem 8.3.5 (Deterministic Sample Complexity)** (Kakade 2003, p. 104), uniform form.
Fix finite state and action sets `S`, `A` (`N = |S|`, `A = |A|`) and a horizon `T ≥ 1`. There is
one algorithm — a deterministic function of the observed state–action–reward path, chosen before
the MDP — such that for every deterministic MDP (next-state map `f`, rewards `r` in `[0,1]`), every
start state `s₀` and every number of epochs `L`, the run `c` of the algorithm satisfies
`U_A(c_t) = U*(c_t)` at all but at most `N·A·T` times `t < L`.
The printed statement reads "Let `M` be … There exists an algorithm `A`", i.e. `∀ M ∃ A`, which
is trivially satisfied by an algorithm that knows `M`; the thesis's algorithm (R_max with `m = 1`,
p. 114) does not know `M`, and Theorem 8.3.1 says the algorithm takes only `N, A, T` as inputs, so
the algorithm is quantified before the MDP. Rewards are part of the observed path (p. 105:
"Estimating the reward function is trivial"). -/
theorem deterministic_sample_complexity {S A : Type} [Fintype S] [DecidableEq S] [Fintype A]
[DecidableEq A] [Nonempty A] (T : ℕ) (hT : 0 < T) :
∃ alg : OnlineAlg S A,
∀ (f : S → A → S) (r : S → A → ℝ), (∀ s a, 0 ≤ r s a ∧ r s a ≤ 1) →
∀ (s₀ : S) (L : ℕ),
((Finset.range L).filter
(fun t => algValue f r T alg s₀ t ≠ optValue f r T alg s₀ t)).card
≤ Fintype.card S * Fintype.card A * T := by sorry
end SampleComplexityRL.Exploration
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.