Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

p. 102: the value of an ε-soft policy that is no longer improved satisfies the altered optimality equation

Proved
SuttonBartoRL.EpsSoft.unimproved_fixed_point

by mikedeng1 · Oct 4, 2026 · Mathlib 0df444a (Lean v4.33.1)

dynamic-programmingp2o-batch-b23bp2o-gran-per-chapterp2o-plan-bookp2o-v1reinforcement-learning

Let a finite MDP be given with discount rate 0≤γ<10 \le \gamma < 10≤γ<1, let 0<ε≤10 < \varepsilon \le 10<ε≤1, let π\piπ be ε\varepsilonε-soft and π′\pi'π′ ε\varepsilonε-greedy with respect to qπq_\piqπ​, and suppose vπ′=vπv_{\pi'} = v_\pivπ′​=vπ​ (the policy is no longer improved). Then for every state sss

vπ(s)=(1−ε)max⁡aqπ(s,a)+ε∣A∣∑aqπ(s,a)v_\pi(s) = (1 - \varepsilon) \max_a q_\pi(s, a) + \frac{\varepsilon}{|\mathcal A|} \sum_a q_\pi(s, a)vπ​(s)=(1−ε)amax​qπ​(s,a)+∣A∣ε​a∑​qπ​(s,a) =(1−ε)max⁡a∑s′,rp(s′,r∣s,a)[r+γvπ(s′)]+ε∣A∣∑a∑s′,rp(s′,r∣s,a)[r+γvπ(s′)].= (1 - \varepsilon) \max_a \sum_{s', r} p(s', r \mid s, a)\big[r + \gamma v_\pi(s')\big] + \frac{\varepsilon}{|\mathcal A|} \sum_a \sum_{s', r} p(s', r \mid s, a)\big[r + \gamma v_\pi(s')\big].=(1−ε)amax​s′,r∑​p(s′,r∣s,a)[r+γvπ​(s′)]+∣A∣ε​a∑​s′,r∑​p(s′,r∣s,a)[r+γvπ​(s′)].

This is the same equation as the one for v~∗\tilde v_*v~∗​ with vπv_\pivπ​ substituted; by uniqueness, an unimproved ε\varepsilonε-soft policy has vπ=v~∗v_\pi = \tilde v_*vπ​=v~∗​.

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
  • Endorsed by Shuze Chen · Oct 5, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 5, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paper
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me