Lemma 15 — Error decomposition for optimistic policies
ProvedFoundationsRL.RLBasics.error_decomposition_optimisticThis lemma is the analytical core that makes optimism-based algorithms (like UCB-VI) work: it bounds the sub-optimality of a greedy policy purely in terms of how self-consistent (under the Bellman operator) its driving -value estimates are.
Fix a finite-horizon episodic MDP and a sequence of -value estimates (with the terminal convention , in the -indexed convention of this mission) that are optimistic: for every layer and (Eq. (5.22)). Let be the deterministic policy greedy with respect to at every layer. Then for every state ,
where the roll-in expectation is under itself (an on-policy guarantee), and the bracketed term at each layer is 's own Bellman residual against the true Bellman operator . In words: however was produced, as long as it is optimistic, the sub-optimality of its greedy policy is controlled additively (not exponentially) by how badly fails to satisfy the true Bellman equation, evaluated only along the trajectories itself induces. This is exactly the guarantee UCB-VI's analysis instantiates, with built from the estimated transition model plus a confidence bonus.
Formalization Note Layers are -indexed; the hypothesis hterm encodes the terminal convention explicitly, and hgreedy encodes via IsArgmax.
import Mathlib import Definitions.Def_FoundationsRL_RLBasics_Core
namespace FoundationsRL.RLBasics
/-- **Lemma 15 (Error decomposition for optimistic policies)** (Foster–Rakhlin,
arXiv:2312.16730v1, p. 88, Lemma 15, Eq. (5.23)): given optimistic `Q`-value estimates
`Qhat` (`Qstar ≤ Qhat` pointwise at every layer `< H`, Eq. (5.22), with the terminal
convention `Qhat H ≡ 0`) and the deterministic policy `πdet` greedy w.r.t. `Qhat`, the
sub-optimality of `πdet` at any `s` is controlled by the `πdet`-roll-in expectation of
`Qhat`'s Bellman residuals. -/
theorem error_decomposition_optimistic {S A : Type*} [Fintype S] [Fintype A] [Nonempty A]
[DecidableEq S] [DecidableEq A] {H : ℕ} (M : EpisodicMDP S A H) (Qhat : ℕ → S → A → ℝ)
(hterm : ∀ s a, Qhat H s a = 0) (hopt : ∀ h, h < H → ∀ s a, Qstar M h s a ≤ Qhat h s a)
(πdet : ℕ → S → A) (hgreedy : ∀ h, h < H → ∀ s : S, IsArgmax (Qhat h s) (πdet h s))
(s : S) :
Vstar M 0 s - V M (detPolicy πdet) 0 s ≤
∑ h ∈ Finset.range H,
stateExp M (detPolicy πdet) s h (fun sh =>
Qhat h sh (πdet h sh) - bellmanOp M h (Qhat (h + 1)) sh (πdet h sh)) := by sorry
end FoundationsRL.RLBasics
Read-back
What the Lean code literally says, in plain math · claude-fable-5-1
Fix finite types (states) and (actions), with nonempty and both carrying decidable equality, a natural number (which may be ), and an object of type EpisodicMDP S A H, taken from the imported file Def_FoundationsRL_RLBasics_Core. Every other named notion below — Qstar, Vstar, V, detPolicy, stateExp, bellmanOp, IsArgmax — is also imported from that file and is not unfolded in the code shown; the read-back can only report the types at which they are used and the roles the statement assigns them, not what they compute. In particular, whether carries any structural conditions (e.g. that transition kernels are probability distributions, or that rewards are bounded) is not visible here.
The theorem takes the following data and hypotheses:
- A function , written , defined at every natural index (not only ).
- Terminal hypothesis: for all , . Nothing is assumed about for .
- Optimism hypothesis: for every with and every ,
where denotes the imported quantity Qstar M h s a, a real number. (Non-strict inequality; nothing is required at .)
- A function , written , again defined for all natural .
- Greediness hypothesis: for every and every , the proposition
IsArgmax (Qhat h s) (πdet h s)holds — i.e. the imported predicateIsArgmax, applied to the function on and to the action . WhateverIsArgmaxmeans (presumably that the action attains the maximum of that function over , but this is not verifiable from the code), it is asserted only for layers . - A state .
Write for detPolicy πdet, the policy object produced from by the imported constructor detPolicy. Write for Vstar M 0 s and for V M π 0 s, both real numbers evaluated at layer and state . Write for stateExp M π s h f, a real number obtained from , , the initial state , the layer index and a real-valued function on (its intended reading is an expectation of over the state reached at layer , but the code shown does not define it). Write for bellmanOp M h g s' a, a real number obtained from , the layer , a function , a state and an action .
The conclusion is the single real inequality
where the sum runs over (the finite set Finset.range H), and inside the -th term the function fed to sends a state to the difference between evaluated at and the operator applied to the next-layer function , evaluated at the same pair. For this uses , which the terminal hypothesis forces to be identically .
Edge cases the statement silently includes: if the sum is empty, both hypotheses about layers are vacuous, and the claim reduces to under only the assumption . The inequality is non-strict, is stated at layer only, and for the one given state (universally quantified since is an argument). Nothing constrains or for , and no bound on the size of the residuals or on is assumed or concluded.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.