p. 102: the value of an ε-soft policy that is no longer improved satisfies the altered optimality equation
ProvedSuttonBartoRL.EpsSoft.unimproved_fixed_pointdynamic-programmingp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1reinforcement-learning
Let a finite MDP be given with discount rate , let , let be -soft and -greedy with respect to , and suppose (the policy is no longer improved). Then for every state
This is the same equation as the one for with substituted; by uniqueness, an unimproved -soft policy has .
Preamble
import Mathlib import Definitions.Def_SuttonBartoRL_EpsSoft_EpsSoftPolicies
Formal statement
namespace SuttonBartoRL.EpsSoft
/-- p. 102: for a finite MDP with `0 ≤ γ < 1` and `0 < ε ≤ 1`, if `π` is `ε`-soft, `π'` is
`ε`-greedy with respect to `q_π`, and `v_{π'} = v_π` (the policy is no longer improved), then for
every state `s`
`v_π(s) = (1 - ε) max_a q_π(s, a) + (ε / |A|) Σ_a q_π(s, a)
= (1 - ε) max_a Σ_{s', r} p(s', r | s, a) [r + γ v_π(s')] + (ε / |A|) Σ_a Σ_{s', r} p(s', r | s, a) [r + γ v_π(s')]`. -/
theorem unimproved_fixed_point {S A : Type} [Fintype S] [DecidableEq S] [Fintype A]
[DecidableEq A] [Nonempty A] (M : MDP S A) (γ : ℝ) (hγ0 : 0 ≤ γ) (hγ1 : γ < 1) (ε : ℝ)
(hε0 : 0 < ε) (hε1 : ε ≤ 1) (π π' : SuttonBartoRL.FiniteMDP.Policy S A) (hπ : IsEpsSoft ε π)
(hπ' : IsEpsGreedy M γ ε π π') (heq : ∀ s, stateValue M γ π' s = stateValue M γ π s) :
∀ s, (stateValue M γ π s =
(1 - ε) * Finset.univ.sup' Finset.univ_nonempty (fun a => actionValue M γ π s a) +
ε / (Fintype.card A : ℝ) * ∑ a, actionValue M γ π s a) ∧
stateValue M γ π s =
(1 - ε) * Finset.univ.sup' Finset.univ_nonempty (fun a => ∑ s', ∑ r ∈ M.R,
M.p s a s' r * (r + γ * stateValue M γ π s')) +
ε / (Fintype.card A : ℝ) * ∑ a, ∑ s', ∑ r ∈ M.R,
M.p s a s' r * (r + γ * stateValue M γ π s') := by sorry
end SuttonBartoRL.EpsSoft
Source
Sutton & Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press (2018), ISBN 9780262039246, §5.4, p. 102 ('When equality holds and the ε-soft policy π is no longer improved, then we also know, from (5.2), that …')
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.