Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proposition 3.1 — under F.1 or F.2 the DP algorithm yields J*_N = T^N(J_0); under F.2 N-stage ε-optimal policies exist

Proved
BertsekasShreve.FiniteHorizon.dp_algorithm_optimal_cost

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

dp-algorithmdynamic-programmingfinite-horizonp2o-batch-pfp2ap2o-gran-per-chapterp2o-plan-bookp2o-v1

Let (S,C,U,H)(S,C,U,H)(S,C,U,H) be a model of Section 2.1 (Monotonicity Assumption in force), J0∈FJ_0\in FJ0​∈F with J0(x)>−∞J_0(x)>-\inftyJ0​(x)>−∞ for all x∈Sx\in Sx∈S, and NNN a positive integer. Write Jk,π=(Tμ0⋯Tμk−1)(J0)J_{k,\pi}=(T_{\mu_0}\cdots T_{\mu_{k-1}})(J_0)Jk,π​=(Tμ0​​⋯Tμk−1​​)(J0​) and Jk∗=inf⁡π∈ΠJk,πJ^*_k=\inf_{\pi\in\Pi}J_{k,\pi}Jk∗​=infπ∈Π​Jk,π​.

  1. (a) Let Assumption F.1 hold and assume that Jk,π(x)<∞J_{k,\pi}(x)<\inftyJk,π​(x)<∞ for all x∈Sx\in Sx∈S, π∈Π\pi\in\Piπ∈Π and k=1,2,…,Nk=1,2,\dots,Nk=1,2,…,N. Then
JN∗=TN(J0).J^*_N=T^N(J_0).JN∗​=TN(J0​).
  1. (b) Let Assumption F.2 hold and assume that Jk∗(x)>−∞J^*_k(x)>-\inftyJk∗​(x)>−∞ for all x∈Sx\in Sx∈S and k=1,2,…,Nk=1,2,\dots,Nk=1,2,…,N. Then JN∗=TN(J0)J^*_N=T^N(J_0)JN∗​=TN(J0​), and for every ε>0\varepsilon>0ε>0 there exists an NNN-stage ε\varepsilonε-optimal policy, i.e. a πε∈Π\pi_\varepsilon\in\Piπε​∈Π such that
JN∗≤JN,πε≤JN∗+ε.J^*_N\le J_{N,\pi_\varepsilon}\le J^*_N+\varepsilon.JN∗​≤JN,πε​​≤JN∗​+ε.

This is the basic justification of the dynamic programming algorithm J0,T(J0),T2(J0),…J_0, T(J_0), T^2(J_0),\dotsJ0​,T(J0​),T2(J0​),… in the abstract setting: the optimal cost over all policies, an infimum over sequences of decision rules, is obtained by NNN successive one-step minimizations. The book's Counterexamples 1–4 show that neither the continuity assumption nor the finiteness assumptions can be dropped.

Formalization Note JN∗J^*_NJN∗​ is an infimum over policies and TNT^NTN is the NNN-fold iterate of TTT, so the identity has content. Both parts are stated as one conjunction with their own hypotheses.

Preamble
import Mathlib
import Definitions.Def_BertsekasShreve_FiniteHorizon_Model
import Definitions.Def_BertsekasShreve_FiniteHorizon_Problem
import Definitions.Def_BertsekasShreve_FiniteHorizon_Assumptions
Formal statement
namespace BertsekasShreve.FiniteHorizon

open Model

/-- Proposition 3.1 (Bertsekas & Shreve 1996, pp. 40–41). Let `J₀ ∈ F` satisfy
`J₀(x) > −∞` for all `x` (eq. (4) of Chapter 2) and let `N` be a positive integer.
(a) Under F.1, if `J_{k,π}(x) < ∞` for all `x ∈ S`, `π ∈ Π`, `k = 1, …, N`, then
`J*_N = T^N(J₀)`.
(b) Under F.2, if `J*_k(x) > −∞` for all `x ∈ S`, `k = 1, …, N`, then `J*_N = T^N(J₀)` and
for every `ε > 0` there is `π_ε ∈ Π` with `J*_N ≤ J_{N,π_ε} ≤ J*_N + ε`. -/
theorem dp_algorithm_optimal_cost {S C : Type*} (m : Model S C) (J₀ : S → EReal)
    (hJ₀ : ∀ x, J₀ x ≠ ⊥) (N : ℕ) (hN : 1 ≤ N) :
    (m.AssumptionF1 →
      (∀ x (π : m.Policy) (k : ℕ), 1 ≤ k → k ≤ N → m.costN J₀ k π x < ⊤) →
      m.optCostN J₀ N = m.T^[N] J₀) ∧
    (m.AssumptionF2 →
      (∀ x (k : ℕ), 1 ≤ k → k ≤ N → m.optCostN J₀ k x ≠ ⊥) →
      m.optCostN J₀ N = m.T^[N] J₀ ∧
        ∀ ε : ℝ, 0 < ε → ∃ π : m.Policy,
          m.optCostN J₀ N ≤ m.costN J₀ N π ∧
            m.costN J₀ N π ≤ fun x => m.optCostN J₀ N x + (ε : EReal)) := by sorry

end BertsekasShreve.FiniteHorizon
Source
Bertsekas & Shreve, Stochastic Optimal Control: The Discrete-Time Case, Athena Scientific 1996, pp. 40–41, Proposition 3.1
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 paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me