Prove2Me
Navigate
DiscoverFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

SSP main theorem (Prop. 7.2.1(a),(b) + optimality)

Proved
BertsekasDP.ssp_main_theorem

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

bellmanequationstochasticshortestpathvalueiteration

Proposition 7.2.1(a),(b) (the stochastic shortest path theorem). Consider the finite-state stochastic shortest path problem under Assumption 7.2.1: there is an integer m>0m > 0m>0 such that, regardless of the policy used and the initial state, termination is reached within mmm stages with positive probability,

P{xm≠t∣x0=i,π}  <  1for every admissible π and every state i.P\{x_m \ne t \mid x_0 = i, \pi\} \;<\; 1 \qquad \text{for every admissible } \pi \text{ and every state } i .P{xm​=t∣x0​=i,π}<1for every admissible π and every state i.

Then there is a cost vector J∗J^*J∗ such that:

  1. Value iteration converges from every start: for any initial vector J0J_0J0​,
lim⁡k→∞(TkJ0)(i)  =  J∗(i)for every i;\lim_{k \to \infty} (T^k J_0)(i) \;=\; J^*(i) \qquad \text{for every } i ;k→∞lim​(TkJ0​)(i)=J∗(i)for every i;
  1. J∗J^*J∗ satisfies Bellman's equation and is its unique solution:
J∗(i)  =  min⁡u∈U(i)[ g(i,u)+∑j=1npij(u)J∗(j) ],i=1,…,n;J^*(i) \;=\; \min_{u \in U(i)} \Bigl[\, g(i,u) + \sum_{j=1}^{n} p_{ij}(u) J^*(j) \,\Bigr], \qquad i = 1,\dots,n ;J∗(i)=u∈U(i)min​[g(i,u)+j=1∑n​pij​(u)J∗(j)],i=1,…,n;
  1. J∗J^*J∗ is the optimal cost: every admissible policy π\piπ has a well-defined infinite-horizon cost Jπ(i)=lim⁡NJπN(i)J_\pi(i) = \lim_N J^N_\pi(i)Jπ​(i)=limN​JπN​(i) with J∗(i)≤Jπ(i)J^*(i) \le J_\pi(i)J∗(i)≤Jπ​(i), and some admissible stationary policy attains J∗J^*J∗.

This is the base case of infinite-horizon dynamic programming, and the theorem that value iteration and QQQ-learning ultimately rest on: the Bellman operator has a unique fixed point which is the optimal cost, and it can be found by iterating from anywhere. The discounted theory of §7.3 is the special case where termination occurs with probability 1−α1-\alpha1−α at each stage.

Formalization Note Uniqueness of the fixed point is asserted over all real-valued cost vectors, with no boundedness side condition. The existence of the limit defining JπJ_\piJπ​ for nonstationary policies is part of the claim, not an assumption. Assumption 7.2.1 is stated through the survival probability under admissible policies; the source notes one may always take m=nm = nm=n.

Preamble
import Mathlib
import Definitions.Def_BertsekasSSPModel
Formal statement
namespace BertsekasDP

theorem ssp_main_theorem {n : ℕ} {C : Type} [Fintype C]
    (M : BertsekasSSPModel n C)
    (hA : ∃ m : ℕ, 0 < m ∧ ∀ π, BertsekasSSPAdmissible M π →
      ∀ i, BertsekasSSPSurvival M π m i < 1) :
    ∃ Jstar : Fin n → ℝ,
      (∀ J₀ : Fin n → ℝ,
        Filter.Tendsto (fun k => (BertsekasSSPBellmanOp M)^[k] J₀)
          Filter.atTop (nhds Jstar)) ∧
      BertsekasSSPBellmanOp M Jstar = Jstar ∧
      (∀ J : Fin n → ℝ, BertsekasSSPBellmanOp M J = J → J = Jstar) ∧
      (∀ π, BertsekasSSPAdmissible M π → ∀ i, ∃ Jπ : ℝ,
        Filter.Tendsto (fun N => BertsekasSSPNCost M π N i)
          Filter.atTop (nhds Jπ) ∧ Jstar i ≤ Jπ) ∧
      (∃ μ : Fin n → C, (∀ i, μ i ∈ M.U i) ∧ ∀ i,
        Filter.Tendsto (fun N => BertsekasSSPNCost M (fun _ => μ) N i)
          Filter.atTop (nhds (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(a),(b)
Read-back

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

Let n∈Nn \in \mathbb{N}n∈N, CCC a finite type, and MMM a BertsekasSSPModel on nnn states with controls in CCC (so the transition rows satisfy pij(u)≥0p_{ij}(u)\ge 0pij​(u)≥0 for all uuu and ∑jpij(u)≤1\sum_j p_{ij}(u) \le 1∑j​pij​(u)≤1 for u∈U(i)u \in U(i)u∈U(i); there is no requirement that the rows sum to exactly 111). Assume the hypothesis hAhAhA: there exists m∈Nm \in \mathbb{N}m∈N with m>0m > 0m>0 such that for every policy sequence π\piπ satisfying the admissibility condition πk(i)∈U(i)\pi_k(i) \in U(i)πk​(i)∈U(i) for all k,ik,ik,i, and for every state iii,

Sπm(i)<1,S^m_\pi(i) < 1,Sπm​(i)<1,

where Sπm(i)S^m_\pi(i)Sπm​(i) is the mmm-step survival mass defined above (the probability of remaining in the state space for mmm steps under π\piπ). The theorem then asserts the existence of a function J∗:{0,…,n−1}→RJ^* : \{0,\dots,n-1\} \to \mathbb{R}J∗:{0,…,n−1}→R (existence only, ∃\exists∃, not ∃!\exists!∃!) satisfying the conjunction of the following five clauses, where TTT is the SSP Bellman operator and JπNJ^N_\piJπN​ the NNN-stage cost defined above:

  1. Value iteration converges from every start: for every J0:{0,…,n−1}→RJ_0 : \{0,\dots,n-1\} \to \mathbb{R}J0​:{0,…,n−1}→R, the sequence of kkk-fold iterates TkJ0T^k J_0TkJ0​ converges to J∗J^*J∗ as k→∞k \to \inftyk→∞, in the topology of the finite product space R{0,…,n−1}\mathbb{R}^{\{0,\dots,n-1\}}R{0,…,n−1} (pointwise convergence, which for finite nnn coincides with uniform convergence).
  2. Fixed point: TJ∗=J∗T J^* = J^*TJ∗=J∗ (equality of functions).
  3. Uniqueness of the fixed point: every JJJ with TJ=JT J = JTJ=J equals J∗J^*J∗ — quantified over all real-valued functions JJJ on the states, with no boundedness or other side condition.
  4. Lower bound over admissible policies, with convergence: for every policy sequence π\piπ that is admissible (πk(i)∈U(i)\pi_k(i) \in U(i)πk​(i)∈U(i) for all k,ik,ik,i), and every state iii, there exists a real number JπJ_\piJπ​ such that JπN(i)→JπJ^N_\pi(i) \to J_\piJπN​(i)→Jπ​ as N→∞N \to \inftyN→∞ and J∗(i)≤JπJ^*(i) \le J_\piJ∗(i)≤Jπ​. Note this clause asserts, for each admissible π\piπ and each iii, the existence of the limit of the NNN-stage costs, not merely a bound.
  5. A stationary policy attains J∗J^*J∗: there exists a single stage policy μ:{0,…,n−1}→C\mu : \{0,\dots,n-1\} \to Cμ:{0,…,n−1}→C with μ(i)∈U(i)\mu(i) \in U(i)μ(i)∈U(i) for all iii, such that for every state iii the NNN-stage cost of the constant policy sequence (μ,μ,… )(\mu,\mu,\dots)(μ,μ,…) converges to J∗(i)J^*(i)J∗(i) as N→∞N \to \inftyN→∞.

If n=0n = 0n=0 the state space is empty, hypothesis hAhAhA is satisfiable (e.g. m=1m=1m=1 vacuously), and all clauses are vacuous or trivially witnessed. The theorem's proof is not supplied in this file (the body 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