Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Rollout improves a sequentially improving heuristic (Prop. 6.4.2)

Proved
BertsekasDP.rollout_sequential_improvement

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

costimprovementrollout

Proposition 6.4.2 (rollout improves on a sequentially improving heuristic). Let the base heuristic H\mathcal{H}H be sequentially improving, i.e. min⁡j∈N(i)H(j)≤H(i)\min_{j \in N(i)} H(j) \le H(i)minj∈N(i)​H(j)≤H(i) at every non-destination node iii, and let (i1,…,imˉ)(i_1, \dots, i_{\bar m})(i1​,…,imˉ​) be a path generated by a terminating run of the rollout algorithm RHR\mathcal{H}RH from a non-destination node i1i_1i1​ to a destination imˉi_{\bar m}imˉ​. Then the rollout cost improves on the heuristic,

g(imˉ)  ≤  H(i1),g(i_{\bar m}) \;\le\; H(i_1),g(imˉ​)≤H(i1​),

and is in fact the least of the heuristic cost at the start and at every neighbor visited along the way (Eq. (6.37)):

g(imˉ)  =  min⁡{ H(i1),  min⁡j∈N(i1)H(j),  …,  min⁡j∈N(imˉ−1)H(j) }.g(i_{\bar m}) \;=\; \min\Bigl\{\, H(i_1), \; \min_{j \in N(i_1)} H(j), \; \dots, \; \min_{j \in N(i_{\bar m - 1})} H(j) \,\Bigr\}.g(imˉ​)=min{H(i1​),j∈N(i1​)min​H(j),…,j∈N(imˉ−1​)min​H(j)}.

This is the "rollout never hurts" theorem — the formal warrant for policy improvement by simulation, and the ancestor of the improvement step in Monte-Carlo tree search and modern reinforcement learning. The second identity is stronger than the first: it says the rollout has an automatic cost sorting property, always ending at the best destination among all those its base heuristic proposed along the run, so it can exhibit good behavior that the base heuristic alone never would.

Formalization Note The equality is phrased as a least element (IsLeast) of the displayed set, which asserts both that g(imˉ)g(i_{\bar m})g(imˉ​) is a lower bound and that it is attained by one of the listed values. Ties in the neighbor selection are permitted; the run is any complete node sequence satisfying the rollout selection rule.

Preamble
import Mathlib
import Definitions.Def_BertsekasGraphSearch
Formal statement
namespace BertsekasDP

theorem rollout_sequential_improvement {V : Type} [Fintype V] [DecidableEq V]
    (G : BertsekasGraphSearch V) (H : BertsekasBaseHeuristic G)
    (himp : BertsekasSeqImproving G H)
    (l : List V) (hrun : BertsekasIsRolloutRun G H l)
    (i₁ : V) (hhead : l.head? = some i₁) (hstart : i₁ ∉ G.dest)
    (d : V) (hlast : l.getLast? = some d) :
    G.cost d ≤ BertsekasHeurCost G H i₁ ∧
    IsLeast {c : ℝ | c = BertsekasHeurCost G H i₁ ∨
        ∃ v ∈ l.dropLast, ∃ j ∈ BertsekasNbrs G v, c = BertsekasHeurCost G H j}
      (G.cost d) := by sorry

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

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

Let VVV be a finite type with decidable equality, GGG a graph structure, HHH a base heuristic, and assume BertsekasSeqImproving holds for (G,H)(G,H)(G,H) (at every non-destination vertex with at least one out-neighbour, the minimum of H^\hat HH^ over out-neighbours is ≤H^\le \hat H≤H^ at the vertex itself). Suppose lll is a list satisfying BertsekasIsRolloutRun for (G,H)(G,H)(G,H); i1i_1i1​ is the first element of lll, with i1∉G.desti_1 \notin G.\mathrm{dest}i1​∈/G.dest; and ddd is the last element of lll. The conclusion is a conjunction:

  1. G.cost(d)≤H^(i1)G.\mathrm{cost}(d) \le \hat H(i_1)G.cost(d)≤H^(i1​): the vertex cost of the run's final (destination) vertex is at most the heuristic cost of the starting vertex.
  2. G.cost(d)G.\mathrm{cost}(d)G.cost(d) is the least element (membership plus lower bound, in the IsLeast sense) of the set
{c∈R  ∣  c=H^(i1)  ∨  ∃ v∈l′, ∃ j∈N(v), c=H^(j)},\Big\{ c \in \mathbb{R} \;\Big|\; c = \hat H(i_1) \;\lor\; \exists\, v \in l',\ \exists\, j \in \mathcal{N}(v),\ c = \hat H(j) \Big\},{c∈R​c=H^(i1​)∨∃v∈l′, ∃j∈N(v), c=H^(j)},

where l′l'l′ is lll with its last element removed: the set consisting of H^(i1)\hat H(i_1)H^(i1​) together with the heuristic costs of all out-neighbours of all non-final vertices of the run. Conjunct (1) is the special case of the lower-bound half of (2) applied to the element H^(i1)\hat H(i_1)H^(i1​); the statement nevertheless asserts both explicitly. The proof is left as sorry.

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

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