The greedy policy (4.9) satisfies (4.7) and improves on
ProvedSuttonBartoRL.DP.greedy_policy_improvesdynamic-programmingp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1reinforcement-learning
Let be a deterministic policy of a finite MDP with discount , and let be a deterministic policy that is greedy with respect to :
with ties broken arbitrarily. Then
- meets the condition (4.7) of the policy improvement theorem: for all ;
- is as good as, or better than, : for all .
This is the policy improvement step of policy iteration.
Formalization Note Values are expected discounted returns with ; is defined by (4.6). A deterministic policy is identified with the stochastic policy selecting with probability one.
Preamble
import Mathlib import Definitions.Def_SuttonBartoRL_DP_MDP import Definitions.Def_SuttonBartoRL_DP_ValueFunctions
Formal statement
namespace SuttonBartoRL.DP
/-- Greedy policy improvement, Sutton & Barto (2018), (4.9), p. 79: if the deterministic policy
`π'` is greedy with respect to `q_π` for a deterministic policy `π`, then `π'` meets the
condition (4.7), `q_π(s, π'(s)) ≥ v_π(s)` for all `s`, and it is as good as or better than `π`:
`v_{π'}(s) ≥ v_π(s)` for all `s`. -/
theorem greedy_policy_improves {S A : Type} [Fintype S] [DecidableEq S] [Fintype A]
[DecidableEq A] (M : MDP S A) (γ : ℝ) (hγ0 : 0 ≤ γ) (hγ1 : γ < 1) (π π' : S → A)
(hgreedy : IsGreedy M γ (Policy.ofDet π) π') :
(∀ s, stateValue M γ (Policy.ofDet π) s ≤ actionValue M γ (Policy.ofDet π) s (π' s)) ∧
(∀ s, stateValue M γ (Policy.ofDet π) s ≤ stateValue M γ (Policy.ofDet π') s) := by sorry
end SuttonBartoRL.DP
Source
Sutton & Barto, Reinforcement Learning: An Introduction, 2nd ed., MIT Press (2018), ISBN 9780262039246, Eq. (4.9) and the paragraph after it, p. 79
Human review
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.