Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Optimality condition (Prop. 7.2.1(d))

Proved
BertsekasDP.ssp_optimality_condition

by Shuze Chen · Sep 8, 2026 · Mathlib 0df444a (Lean v4.33.1)

optimalitycondition

Proposition 7.2.1(d) (optimality condition). Under Assumption 7.2.1, let J∗J^*J∗ solve Bellman's equation and let μ\muμ be an admissible stationary policy with evaluated cost JμJ_\muJμ​. Then μ\muμ is optimal if and only if it attains the minimum in Bellman's equation at every state:

Jμ=J∗⟺g(i,μ(i))+∑j=1npij(μ(i))J∗(j)  =  min⁡u∈U(i)[ g(i,u)+∑j=1npij(u)J∗(j) ]for all i.J_\mu = J^* \qquad \Longleftrightarrow \qquad g\bigl(i, \mu(i)\bigr) + \sum_{j=1}^{n} p_{ij}\bigl(\mu(i)\bigr) J^*(j) \;=\; \min_{u \in U(i)} \Bigl[\, g(i,u) + \sum_{j=1}^{n} p_{ij}(u) J^*(j) \,\Bigr] \quad \text{for all } i .Jμ​=J∗⟺g(i,μ(i))+j=1∑n​pij​(μ(i))J∗(j)=u∈U(i)min​[g(i,u)+j=1∑n​pij​(u)J∗(j)]for all i.

In words: the optimal policies are exactly the policies that are greedy with respect to the optimal cost vector. This is what turns the solution of Bellman's equation into a controller — one reads off an optimal policy by minimizing state by state — and it is the criterion by which policy iteration recognizes that it has finished.

Formalization Note J∗J^*J∗ and JμJ_\muJμ​ enter as given fixed points of TTT and TμT_\muTμ​ respectively; their uniqueness is not assumed here, being supplied by Prop. 7.2.1(b),(c). Both directions of the equivalence are asserted.

Preamble
import Mathlib
import Definitions.Def_BertsekasSSPModel
Formal statement
namespace BertsekasDP

theorem ssp_optimality_condition {n : ℕ} {C : Type} [Fintype C]
    (M : BertsekasSSPModel n C)
    (hA : ∃ m : ℕ, 0 < m ∧ ∀ π, BertsekasSSPAdmissible M π →
      ∀ i, BertsekasSSPSurvival M π m i < 1)
    (Jstar : Fin n → ℝ) (hbell : BertsekasSSPBellmanOp M Jstar = Jstar)
    (μ : Fin n → C) (hμ : ∀ i, μ i ∈ M.U i)
    (Jμ : Fin n → ℝ) (heval : BertsekasSSPPolicyOp M μ Jμ = Jμ) :
    Jμ = Jstar ↔
      ∀ i, M.g i (μ i) + ∑ j, M.p i (μ i) j * Jstar j =
        BertsekasSSPBellmanOp M Jstar i := by sorry

end BertsekasDP
Source
D. P. Bertsekas, Dynamic Programming and Optimal Control, Vol. I, 3rd ed., Athena Scientific, 2005, Proposition 7.2.1(d)
Read-back

What the Lean code literally says, in plain math · claude-fable-5

Let MMM be a BertsekasSSPModel on nnn states with finite control type CCC. Assume:

  • hAhAhA: there is an m>0m > 0m>0 such that for every admissible policy sequence π\piπ and every state iii, Sπm(i)<1S^m_\pi(i) < 1Sπm​(i)<1 (the mmm-step survival mass, as defined in this bundle);
  • J∗:{0,…,n−1}→RJ^* : \{0,\dots,n-1\} \to \mathbb{R}J∗:{0,…,n−1}→R is a function given as a hypothesis together with the assumption TJ∗=J∗T J^* = J^*TJ∗=J∗, where TTT is the SSP Bellman operator (no uniqueness or optimality of J∗J^*J∗ is assumed — only that it is some fixed point of TTT);
  • μ:{0,…,n−1}→C\mu : \{0,\dots,n-1\} \to Cμ:{0,…,n−1}→C is a stage policy with μ(i)∈U(i)\mu(i) \in U(i)μ(i)∈U(i) for every iii;
  • Jμ:{0,…,n−1}→RJ_\mu : \{0,\dots,n-1\} \to \mathbb{R}Jμ​:{0,…,n−1}→R is a function given with the assumption TμJμ=JμT_\mu J_\mu = J_\muTμ​Jμ​=Jμ​ (again only some fixed point of the policy operator; uniqueness is not assumed).

The conclusion is a genuine if and only if:

Jμ=J∗  ⟺  ∀i,g(i,μ(i))+∑jpij(μ(i)) J∗(j)=(TJ∗)(i),J_\mu = J^* \iff \forall i,\quad g(i,\mu(i)) + \sum_{j} p_{ij}(\mu(i))\, J^*(j) = (T J^*)(i),Jμ​=J∗⟺∀i,g(i,μ(i))+j∑​pij​(μ(i))J∗(j)=(TJ∗)(i),

i.e. JμJ_\muJμ​ equals J∗J^*J∗ (as functions) exactly when, at every state iii, the control μ(i)\mu(i)μ(i) attains the minimum in the Bellman operator applied to J∗J^*J∗ (the left side of the displayed equality is the μ\muμ-value at iii, the right side is the minimum over u∈U(i)u \in U(i)u∈U(i)). Both directions of the equivalence are asserted. The proof is a placeholder.

Human review
  • Endorsed by Community (Bot) · Sep 8, 2026

  • Endorsed by Shuze Chen · Sep 8, 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