Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Theorem 1 (Robust Dynamic Programming) — perfect duality and the robust Bellman recursion

Proved
RobustMDP.FiniteHorizon.robust_dynamic_programming

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

dynamic-programminggame-theoryp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1robust-optimization

Consider a finite-horizon MDP with states X={1,…,n}\mathcal X=\{1,\dots,n\}X={1,…,n}, horizon T={0,…,N−1}T=\{0,\dots,N-1\}T={0,…,N−1}, a finite nonempty action set A\mathcal AA, nonnegative stage costs ct(i,a)c_t(i,a)ct​(i,a), a terminal cost cNc_NcN​, an initial state i0i_0i0​, and rectangular uncertainty: nonempty sets Pia⊆Δn\mathcal P_i^a\subseteq\Delta_nPia​⊆Δn​ of possible iii-th rows of the transition matrix under action aaa (no other assumption). Let Π\PiΠ be the deterministic Markov controller policies, T\mathcal TT the admissible time-varying policies of nature, and CN(π,τ)C_N(\pi,\tau)CN​(π,τ) the expected total cost (2). Let vvv be given by the robust recursion (7) and, for π∈Π\pi\in\Piπ∈Π, vπv^\pivπ by recursion (10), both with terminal value cNc_NcN​. Then:

  1. Perfect duality holds, with value given by (7):
φN(Π,T)=min⁡π∈Πsup⁡τ∈TCN(π,τ)=v0(i0)=sup⁡τ∈Tmin⁡π∈ΠCN(π,τ)=ψN(Π,T).\varphi_N(\Pi,\mathcal T)=\min_{\pi\in\Pi}\sup_{\tau\in\mathcal T}C_N(\pi,\tau)=v_0(i_0)=\sup_{\tau\in\mathcal T}\min_{\pi\in\Pi}C_N(\pi,\tau)=\psi_N(\Pi,\mathcal T).φN​(Π,T)=π∈Πmin​τ∈Tsup​CN​(π,τ)=v0​(i0​)=τ∈Tsup​π∈Πmin​CN​(π,τ)=ψN​(Π,T).
  1. For every π∈Π\pi\in\Piπ∈Π, the worst-case cost is given by (10): sup⁡τ∈TCN(π,τ)=v0π(i0)\sup_{\tau\in\mathcal T}C_N(\pi,\tau)=v_0^\pi(i_0)supτ∈T​CN​(π,τ)=v0π​(i0​).
  2. Every policy π∗=(a0∗,…,aN−1∗)\pi^*=(\mathbf a_0^*,\dots,\mathbf a_{N-1}^*)π∗=(a0∗​,…,aN−1∗​) with at∗(i)∈arg⁡min⁡a∈A{ct(i,a)+σPia(vt+1)}\mathbf a_t^*(i)\in\arg\min_{a\in\mathcal A}\{c_t(i,a)+\sigma_{\mathcal P_i^a}(v_{t+1})\}at∗​(i)∈argmina∈A​{ct​(i,a)+σPia​​(vt+1​)} for all t,it,it,i (rule (8)) is optimal: sup⁡τ∈TCN(π∗,τ)=v0(i0)\sup_{\tau\in\mathcal T}C_N(\pi^*,\tau)=v_0(i_0)supτ∈T​CN​(π∗,τ)=v0​(i0​).
  3. Every policy of nature τ∗\tau^*τ∗ whose rows satisfy pia(t)∈arg⁡max⁡{pTvt+1:p∈Pia}p_i^a(t)\in\arg\max\{p^{\mathsf T}v_{t+1}:p\in\mathcal P_i^a\}pia​(t)∈argmax{pTvt+1​:p∈Pia​} for all t,a,it,a,it,a,i (rule (9)) is a worst case: min⁡π∈ΠCN(π,τ∗)=v0(i0)\min_{\pi\in\Pi}C_N(\pi,\tau^*)=v_0(i_0)minπ∈Π​CN​(π,τ∗)=v0​(i0​), and CN(π∗,τ∗)=v0(i0)C_N(\pi^*,\tau^*)=v_0(i_0)CN​(π∗,τ∗)=v0​(i0​) for every π∗\pi^*π∗ as in 3.

The theorem says that the robust control problem with time-varying rectangular uncertainty is solved by a dynamic programming recursion of the same form as the nominal one, with the expected continuation cost replaced by a support function, and that the order of play between controller and nature does not matter. Convexity of the uncertainty sets is not required.

Formalization Note Π\PiΠ is finite and nonempty, so minima over it are Lean's ⨅. The paper writes "max" over nature; the row sets need not be closed, so these are suprema ⨆ over the nonempty set T\mathcal TT, whose costs are bounded above because every row lies in Δn\Delta_nΔn​. For the same reason the maxima in (9) need not be attained, and conclusion 4 is stated for nature policies that attain them. The argmin rule (8) is stated for every policy attaining the minimum, not a particular choice. The terminal value vN=cNv_N=c_NvN​=cN​ is implicit in the paper's proof and explicit on p. 785. The paper's "(a0,…,aN)(\mathbf a_0,\dots,\mathbf a_N)(a0​,…,aN​)" in the sentence before (10) is read as (a0,…,aN−1)(\mathbf a_0,\dots,\mathbf a_{N-1})(a0​,…,aN−1​).

Preamble
import Mathlib
import Definitions.Def_RobustMDP_Shared_supportFunction
import Definitions.Def_RobustMDP_FiniteHorizon_Model
import Definitions.Def_RobustMDP_FiniteHorizon_expectedCost
import Definitions.Def_RobustMDP_FiniteHorizon_robustValue
Formal statement
namespace RobustMDP.FiniteHorizon

/-- Theorem 1 (Robust Dynamic Programming), Nilim–El Ghaoui 2005, pp. 782–783.
For a finite-horizon MDP with rectangular uncertainty (nonempty row sets `𝒫_i^a ⊆ Δ_n`, no other
assumption), initial state `i₀`, and `C_N(π, τ)` the expected total cost (2):

1. perfect duality holds, with value given by recursion (7):
   `min_{π ∈ Π} sup_{τ ∈ 𝒯} C_N(π, τ) = v_0(i₀) = sup_{τ ∈ 𝒯} min_{π ∈ Π} C_N(π, τ)`;
2. for every policy `π`, the worst case `sup_{τ ∈ 𝒯} C_N(π, τ)` is `v_0^π(i₀)`, recursion (10);
3. every policy `π*` whose actions attain the minimum in (8),
   `𝐚*_t(i) ∈ argmin_a {c_t(i, a) + σ_{𝒫_i^a}(v_{t+1})}`, is optimal:
   `sup_{τ ∈ 𝒯} C_N(π*, τ) = v_0(i₀)`;
4. every nature policy `τ*` whose rows attain the maxima in (9),
   `p_i^a(t) ∈ argmax {pᵀ v_{t+1} : p ∈ 𝒫_i^a}`, is a worst case:
   `min_{π ∈ Π} C_N(π, τ*) = v_0(i₀)`, and `C_N(π*, τ*) = v_0(i₀)` for every `π*` as in 3.

`Π` is finite, so its minima are `⨅`; nature's maxima are `⨆` over the (possibly infinite) set
`𝒯`, which is nonempty and whose costs are bounded above. The row maxima of (9) need not be
attained, so conclusion 4 is stated for nature policies that attain them. -/
theorem robust_dynamic_programming {n N : ℕ} {A : Type} [Fintype A] [Nonempty A]
    (M : Model n N A) (i₀ : Fin n) :
    ((⨅ π : ControlPolicy n N A, ⨆ τ : M.NaturePolicy, M.expectedCost i₀ π τ.1) =
        M.robustValue 0 i₀ ∧
      (⨆ τ : M.NaturePolicy, ⨅ π : ControlPolicy n N A, M.expectedCost i₀ π τ.1) =
        M.robustValue 0 i₀) ∧
    (∀ π : ControlPolicy n N A,
      (⨆ τ : M.NaturePolicy, M.expectedCost i₀ π τ.1) = M.policyValue π 0 i₀) ∧
    (∀ πstar : ControlPolicy n N A,
      (∀ (t : Fin N) (i : Fin n) (a : A),
        M.cost t i (πstar t i) + Shared.supportFunction (M.rows (πstar t i) i) (M.robustValue (t + 1)) ≤
          M.cost t i a + Shared.supportFunction (M.rows a i) (M.robustValue (t + 1))) →
      (⨆ τ : M.NaturePolicy, M.expectedCost i₀ πstar τ.1) = M.robustValue 0 i₀) ∧
    (∀ τstar : M.NaturePolicy,
      (∀ (t : Fin N) (a : A) (i : Fin n),
        ∑ j, τstar.1 t a i j * M.robustValue (t + 1) j =
          Shared.supportFunction (M.rows a i) (M.robustValue (t + 1))) →
      (⨅ π : ControlPolicy n N A, M.expectedCost i₀ π τstar.1) = M.robustValue 0 i₀ ∧
      ∀ πstar : ControlPolicy n N A,
        (∀ (t : Fin N) (i : Fin n) (a : A),
          M.cost t i (πstar t i) + Shared.supportFunction (M.rows (πstar t i) i) (M.robustValue (t + 1)) ≤
            M.cost t i a + Shared.supportFunction (M.rows a i) (M.robustValue (t + 1))) →
        M.expectedCost i₀ πstar τstar.1 = M.robustValue 0 i₀) := by sorry

end RobustMDP.FiniteHorizon
Source
Nilim and El Ghaoui, Robust Control of Markov Decision Processes with Uncertain Transition Matrices, Oper. Res. 53 (2005), pp. 782–783, Theorem 1
Read-back

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

Setting. The statement fixes the following:

  • natural numbers nnn (the number of states) and NNN (the horizon);
  • a type AAA of actions, which must be finite and nonempty;
  • a model MMM of type "finite-horizon robust MDP with nnn states, horizon NNN and actions AAA";
  • an initial state i0∈{0,…,n−1}i_0 \in \{0,\dots,n-1\}i0​∈{0,…,n−1}.

The code uses several named notions: MMM's stage costs, its uncertainty sets (called "rows"), its set of nature policies, the expected cost, the robust value, the policy value, and a support function. Their definitions are in imported files that are not part of the supplied code, so they cannot be unfolded here. Only the following can be read off from how they are used:

  • Control policy π\piπ. It assigns an action πt(i)∈A\pi_t(i) \in Aπt​(i)∈A to each stage t∈{0,…,N−1}t \in \{0,\dots,N-1\}t∈{0,…,N−1} and state iii. The minima below range over the whole type of control policies.
  • Nature policy τ\tauτ. It is an element of a set TM\mathcal T_MTM​ defined by the model; the membership condition is hidden. Its underlying data τt(a,i,j)\tau_t(a,i,j)τt​(a,i,j) is a number for each stage ttt, action aaa, state iii and next state jjj.
  • Stage cost. ct(i,a)c_t(i,a)ct​(i,a) is a number.
  • Uncertainty set. Pia\mathcal P^{a}_{i}Pia​ (MMM's "rows" at action aaa, state iii) is passed to a support function σP(v)\sigma_{\mathcal P}(v)σP​(v), which also takes a vector vvv indexed by states.
  • Values. The following appear:
    • the expected cost CN(i0,π,τ)C_N(i_0,\pi,\tau)CN​(i0​,π,τ), evaluated on the underlying data of τ\tauτ;
    • the robust value vs(i)v_s(i)vs​(i) at stage sss and state iii;
    • the policy value vsπ(i)v^\pi_s(i)vsπ​(i).

The theorem asserts the conjunction of four statements.

  1. Two dualities.
inf⁡π sup⁡τ∈TMCN(i0,π,τ)=v0(i0)andsup⁡τ∈TM inf⁡πCN(i0,π,τ)=v0(i0).\inf_{\pi}\ \sup_{\tau\in\mathcal T_M} C_N(i_0,\pi,\tau) = v_0(i_0) \qquad\text{and}\qquad \sup_{\tau\in\mathcal T_M}\ \inf_{\pi} C_N(i_0,\pi,\tau) = v_0(i_0).πinf​ τ∈TM​sup​CN​(i0​,π,τ)=v0​(i0​)andτ∈TM​sup​ πinf​CN​(i0​,π,τ)=v0​(i0​).
  1. Worst case of each policy. For every control policy π\piπ:
sup⁡τ∈TMCN(i0,π,τ)=v0π(i0).\sup_{\tau\in\mathcal T_M} C_N(i_0,\pi,\tau) = v^\pi_0(i_0).τ∈TM​sup​CN​(i0​,π,τ)=v0π​(i0​).
  1. Greedy policies are optimal. Take any control policy π∗\pi^*π∗ such that, for every stage t∈{0,…,N−1}t\in\{0,\dots,N-1\}t∈{0,…,N−1}, every state iii and every action a∈Aa\in Aa∈A,
ct(i,πt∗(i))+σPiπt∗(i)(vt+1)  ≤  ct(i,a)+σPia(vt+1).c_t\big(i,\pi^*_t(i)\big) + \sigma_{\mathcal P^{\pi^*_t(i)}_{i}}\big(v_{t+1}\big) \;\le\; c_t(i,a) + \sigma_{\mathcal P^{a}_{i}}\big(v_{t+1}\big).ct​(i,πt∗​(i))+σPiπt∗​(i)​​(vt+1​)≤ct​(i,a)+σPia​​(vt+1​).

Then

sup⁡τ∈TMCN(i0,π∗,τ)=v0(i0).\sup_{\tau\in\mathcal T_M} C_N(i_0,\pi^*,\tau) = v_0(i_0).τ∈TM​sup​CN​(i0​,π∗,τ)=v0​(i0​).

The condition must hold at all states, not only the ones reachable from i0i_0i0​.

  1. Attaining nature policies are worst cases. Take any nature policy τ∗∈TM\tau^*\in\mathcal T_Mτ∗∈TM​ such that, for every stage t∈{0,…,N−1}t\in\{0,\dots,N-1\}t∈{0,…,N−1}, every action aaa and every state iii,
∑jτt∗(a,i,j) vt+1(j)=σPia(vt+1).\sum_{j} \tau^*_t(a,i,j)\, v_{t+1}(j) = \sigma_{\mathcal P^{a}_{i}}\big(v_{t+1}\big).j∑​τt∗​(a,i,j)vt+1​(j)=σPia​​(vt+1​).

Then both of the following hold:

  • inf⁡πCN(i0,π,τ∗)=v0(i0)\inf_{\pi} C_N(i_0,\pi,\tau^*) = v_0(i_0)infπ​CN​(i0​,π,τ∗)=v0​(i0​);
  • CN(i0,π∗,τ∗)=v0(i0)C_N(i_0,\pi^*,\tau^*) = v_0(i_0)CN​(i0​,π∗,τ∗)=v0​(i0​) for every π∗\pi^*π∗ that satisfies the condition in item 3.

The condition is an equation between the vt+1v_{t+1}vt+1​-weighted sum of τ∗\tau^*τ∗'s row and the support-function value. Whether that row lies in Pia\mathcal P^a_iPia​ is not stated here; it holds only if the hidden membership condition of TM\mathcal T_MTM​ imposes it.

Fine print.

  • Stage index. In items 3 and 4, ttt lies in {0,…,N−1}\{0,\dots,N-1\}{0,…,N−1} and the next stage is written t+1t+1t+1. The code does not show what type the robust value's stage argument has. If it is a natural number, t+1t+1t+1 is the ordinary successor, reaching NNN at the last stage. If the addition happens in {0,…,N−1}\{0,\dots,N-1\}{0,…,N−1}, then t+1t+1t+1 wraps around to 000 when t=N−1t=N-1t=N−1.

  • No explicit hypotheses on the model. Nothing in the statement says:

    • that the uncertainty sets are nonempty or bounded;
    • that TM\mathcal T_MTM​ is nonempty;
    • that the costs CN(i0,π,⋅)C_N(i_0,\pi,\cdot)CN​(i0​,π,⋅) are bounded above over TM\mathcal T_MTM​.

    Any such property would have to come from the hidden definition of the model. If the values are real numbers (the use of +++, ≤\le≤ and finite sums suggests so, but the type is not shown), then a supremum over an empty set, or over a set that is not bounded above, takes the conventional value 000. The same would apply to a support function taken over such a set. In those cases the equalities above compare such default values with v0(i0)v_0(i_0)v0​(i0​) or v0π(i0)v^\pi_0(i_0)v0π​(i0​).

  • Infima over policies. These range over a type that is finite and nonempty whenever it consists of stage-and-state-indexed action choices, since AAA is finite and nonempty. In that case each infimum is an attained minimum.

Degenerate cases.

  • n=0n=0n=0. There is no initial state i0i_0i0​, so the theorem is vacuous.
  • N=0N=0N=0. There are no stages, so the conditions in items 3 and 4 hold vacuously. Every control policy then counts as π∗\pi^*π∗ and every element of TM\mathcal T_MTM​ counts as τ∗\tau^*τ∗. The theorem then asserts, for every π\piπ and every τ∈TM\tau\in\mathcal T_Mτ∈TM​:
C0(i0,π,τ)=v0(i0),sup⁡τC0(i0,π,τ)=v0(i0)=v0π(i0),C_0(i_0,\pi,\tau) = v_0(i_0), \qquad \sup_{\tau} C_0(i_0,\pi,\tau) = v_0(i_0) = v^\pi_0(i_0),C0​(i0​,π,τ)=v0​(i0​),τsup​C0​(i0​,π,τ)=v0​(i0​)=v0π​(i0​),

with the supremum taking whatever default value applies if TM\mathcal T_MTM​ is empty.

  • One action. If AAA has a single element, the condition in item 3 holds trivially, so the unique policy is asserted to satisfy item 3's conclusion.
  • Empty TM\mathcal T_MTM​. Item 4 is vacuous. Item 1's second equality and items 2 and 3 then equate the empty supremum (its default value, e.g. 000 in the reals) with v0(i0)v_0(i_0)v0​(i0​) and v0π(i0)v^\pi_0(i_0)v0π​(i0​).
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 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