Dynamic programming is the backbone of stochastic optimal control, operations research, and reinforcement learning. Its cornerstone — that the backward recursion of Bellman computes the optimal cost of a finite-horizon stochastic control problem — is stated as Proposition 1.3.1 of Bertsekas, Dynamic Programming and Optimal Control, Vol. I (3rd ed., Athena Scientific, 2005), the standard graduate text on the subject. Every convergence result for value iteration, every performance bound for approximate DP, and every correctness proof for a planning algorithm ultimately leans on this proposition. A machine-checked version of it — over a clean, reusable model of the basic problem — is the natural foundation stone for formalized control theory and RL theory alike.
The basic problem (§1.2 of the book): a discrete-time system
with state , control constrained to a finite nonempty set , and disturbance drawn from a finite space with conditional probabilities . A policy is a sequence of feedback maps ; it is admissible if everywhere. Its expected cost from is
In the Lean development these are BertsekasDPModel, BertsekasDPPolicyCost (backward recursion on remaining stages), and the DP recursion BertsekasDPValue:
Section 1.6 of the book develops the minimax variant, where the disturbance is chosen antagonistically from a finite membership set ; the mission mirrors it with BertsekasMinimaxDPModel, BertsekasMinimaxPolicyCost, BertsekasMinimaxValue.
formalized as BertsekasDP.dp_algorithm_optimality: the DP value at the horizon is an IsLeast of the set of admissible policy costs. Milestones: the min–max interchange Lemma 1.6.1 (minimax_selection_interchange) and the minimax DP validity (minimax_dp_algorithm).
The proposition itself is the license to compute optimal policies stage by stage; downstream, Missions VI and VII of this series (lookahead bounds, infinite-horizon theory) consume exactly this model and recursion. Formalizing it produces the reusable model of the basic problem — the shared vocabulary for the whole series. The result is classical and proved in the book; the contribution here is a machine-checked proof over a model faithful to the book's, with the measurable-selection subtleties deliberately avoided by finiteness (see scope).
The proof is a backward induction, but the standard informal argument ("interchange expectation and minimization") must be carried out honestly: the induction hypothesis is about all states simultaneously, the minimizing control must be selected as a function of the state (choice over a finite set), and the policy-cost recursion must be related to the value recursion stage by stage. The minimax milestone needs the interchange lemma with its proviso — the classic trap is losing that hypothesis and asserting a false unconditioned interchange.
Finite disturbance space (Fintype W), finite nonempty control-constraint sets (Finset, inf'), arbitrary (possibly infinite) state space; expectations are finite weighted sums, probabilities are required to be distributions only at admissible controls. Stage data are total functions on ; only stages matter. Policies are deterministic Markov feedback maps — for this class the book's result is exactly recovered. The trivializing risks (empty constraint sets, junk beyond horizon) are ruled out by the nonemptiness field and by evaluating at exactly remaining stages. Lemma 1.6.1 is stated in the extended reals over arbitrary types with the book's finiteness-of-infimum proviso.
namespace BertsekasDP
theorem dp_algorithm_optimality {S C W : Type} [Fintype W]
(M : BertsekasDPModel S C W) (x₀ : S) :
IsLeast {c : ℝ | ∃ π : ℕ → S → C, (∀ k x, π k x ∈ M.U k x) ∧
c = BertsekasDPPolicyCost M π M.N x₀}
(BertsekasDPValue M M.N x₀) := by sorry
end BertsekasDPProposition 1.3.1 (optimality of the dynamic programming algorithm). Consider the basic problem with horizon , system , finite nonempty constraint sets , finitely supported disturbances, and additive cost. Let be produced by the backward DP recursion ,
and call a policy admissible when for every stage and state. Then for every initial state ,
and the minimum is attained: some admissible policy achieves exactly , and no admissible policy does better.
This is the theorem that licenses solving a multi-stage optimization one stage at a time. Every later result in this series is stated over the same model: the lookahead and rollout bounds of Chapter 6 compare a suboptimal policy's cost against this recursion, and the infinite-horizon theory of Chapter 7 studies the limit of iterating it.
Formalization Note The conclusion is phrased as a least element (IsLeast) of the set of achievable costs, which packages both halves — attainment and the lower bound — in one statement. Admissibility is required at every stage index, though only stages enter the cost. Policies are deterministic feedback maps of the current stage and state; this is the class over which the source states the result.
No open leaves. Every sub-goal is proved or awaiting decomposition.