Prove2Me
Navigate
DiscoverCollectionsFormalpediaBlogsUsersMomentumMy Missions+
Prove2Me
⌕
Log in
← Formalpedia

Rollout under sequential consistency (Prop. 6.4.1)

Proved
BertsekasDP.rollout_sequential_consistency

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

rollouttermination

Proposition 6.4.1 (termination and improvement under sequential consistency). Let the base heuristic H\mathcal{H}H be sequentially consistent, and run the rollout algorithm with the source's tie-breaking convention: when several neighbors attain min⁡j∈N(i)H(j)\min_{j \in N(i)} H(j)minj∈N(i)​H(j) and one of them is the successor that H\mathcal{H}H itself would take from iii, that one is chosen. Then:

  1. The rollout terminates: the run reaches a destination node after finitely many steps.
  2. It improves on the base heuristic: at any time KKK at which a destination is reached,
H(iK)  ≤  H(i1),H(iK)  =  min⁡{ H(i1),  min⁡j∈N(i1)H(j),  …,  min⁡j∈N(iK−1)H(j) }.H(i_K) \;\le\; H(i_1), \qquad H(i_K) \;=\; \min\Bigl\{\, H(i_1), \; \min_{j \in N(i_1)} H(j), \; \dots, \; \min_{j \in N(i_{K-1})} H(j) \,\Bigr\}.H(iK​)≤H(i1​),H(iK​)=min{H(i1​),j∈N(i1​)min​H(j),…,j∈N(iK−1​)min​H(j)}.

The tie-breaking convention is not a technicality: the source exhibits a graph in which, with ties broken the other way, the rollout cycles forever without reaching a destination. Sequential consistency makes the HHH-values along the run non-increasing, and each plateau shortens the base heuristic's remaining path by one arc, which is what forces termination.

Formalization Note The run is modeled as an infinite sequence that obeys the selection rule while at a non-destination node and stays put once at a destination, so "terminates" is the genuine claim that some index lands in the destination set, rather than an assumption built into the shape of the object. The cost claim is stated for every such index. As in Prop. 6.4.2, the minimum is phrased as a least element, asserting attainment as well as the bound.

Preamble
import Mathlib
import Definitions.Def_BertsekasGraphSearch
Formal statement
namespace BertsekasDP

theorem rollout_sequential_consistency {V : Type} [Fintype V] [DecidableEq V]
    (G : BertsekasGraphSearch V) (H : BertsekasBaseHeuristic G)
    (hcons : BertsekasSeqConsistent G H)
    (r : ℕ → V) (hstart : r 0 ∉ G.dest)
    (hstep : ∀ k, r k ∉ G.dest →
      r (k + 1) ∈ BertsekasNbrs G (r k) ∧
      (∀ j ∈ BertsekasNbrs G (r k),
        BertsekasHeurCost G H (r (k + 1)) ≤ BertsekasHeurCost G H j))
    (htie : ∀ k, r k ∉ G.dest → ∀ (jH : V) (l : List V),
      H.path (r k) = r k :: jH :: l →
      (∀ j ∈ BertsekasNbrs G (r k),
        BertsekasHeurCost G H jH ≤ BertsekasHeurCost G H j) →
      r (k + 1) = jH)
    (habsorb : ∀ k, r k ∈ G.dest → r (k + 1) = r k) :
    (∃ K, r K ∈ G.dest) ∧
    (∀ K, r K ∈ G.dest →
      BertsekasHeurCost G H (r K) ≤ BertsekasHeurCost G H (r 0) ∧
      IsLeast {c : ℝ | c = BertsekasHeurCost G H (r 0) ∨
          ∃ k < K, r k ∉ G.dest ∧
            ∃ j ∈ BertsekasNbrs G (r k), c = BertsekasHeurCost G H j}
        (BertsekasHeurCost G H (r K))) := by sorry

end BertsekasDP
Source
D. P. Bertsekas, Dynamic Programming and Optimal Control, Vol. I, 3rd ed., Athena Scientific, 2005, Proposition 6.4.1
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 BertsekasSeqConsistent holds for (G,H)(G,H)(G,H) (tails of heuristic paths from non-destination vertices are again heuristic paths). Let r:N→Vr : \mathbb{N} \to Vr:N→V be an infinite sequence of vertices such that:

  • (hstart) r0∉G.destr_0 \notin G.\mathrm{dest}r0​∈/G.dest;
  • (hstep) for every kkk with rk∉G.destr_k \notin G.\mathrm{dest}rk​∈/G.dest: rk+1∈N(rk)r_{k+1} \in \mathcal{N}(r_k)rk+1​∈N(rk​) and H^(rk+1)≤H^(j)\hat H(r_{k+1}) \le \hat H(j)H^(rk+1​)≤H^(j) for every j∈N(rk)j \in \mathcal{N}(r_k)j∈N(rk​) — the sequence always steps to a heuristic-cost-minimizing out-neighbour;
  • (htie) a tie-breaking rule: for every kkk with rk∉G.destr_k \notin G.\mathrm{dest}rk​∈/G.dest, for every vertex jHj_HjH​ and list lll, if the heuristic path from rkr_krk​ has the literal form rk::jH::lr_k :: j_H :: lrk​::jH​::l and jHj_HjH​ itself minimizes H^\hat HH^ over N(rk)\mathcal{N}(r_k)N(rk​) (i.e. H^(jH)≤H^(j)\hat H(j_H) \le \hat H(j)H^(jH​)≤H^(j) for all j∈N(rk)j \in \mathcal{N}(r_k)j∈N(rk​)), then rk+1=jHr_{k+1} = j_Hrk+1​=jH​ — i.e. whenever the base heuristic's own next vertex is among the minimizers, the sequence must follow it;
  • (habsorb) for every kkk with rk∈G.destr_k \in G.\mathrm{dest}rk​∈G.dest: rk+1=rkr_{k+1} = r_krk+1​=rk​ (once at a destination the sequence is constant).

The conclusion is a conjunction:

  1. There exists some index KKK with rK∈G.destr_K \in G.\mathrm{dest}rK​∈G.dest (termination: the sequence reaches the destination set at some finite time).
  2. For every index KKK with rK∈G.destr_K \in G.\mathrm{dest}rK​∈G.dest: H^(rK)≤H^(r0)\hat H(r_K) \le \hat H(r_0)H^(rK​)≤H^(r0​), and the number H^(rK)\hat H(r_K)H^(rK​) is the least element (in the IsLeast sense: it both belongs to the set and is ≤\le≤ every element of the set) of the set of real numbers
{c∈R  ∣  c=H^(r0)  ∨  ∃ k<K, rk∉G.dest ∧ ∃ j∈N(rk), c=H^(j)},\Big\{ c \in \mathbb{R} \;\Big|\; c = \hat H(r_0) \;\lor\; \exists\, k < K,\ r_k \notin G.\mathrm{dest} \ \land\ \exists\, j \in \mathcal{N}(r_k),\ c = \hat H(j) \Big\},{c∈R​c=H^(r0​)∨∃k<K, rk​∈/G.dest ∧ ∃j∈N(rk​), c=H^(j)},

i.e. the set consisting of H^(r0)\hat H(r_0)H^(r0​) together with the heuristic costs H^(j)\hat H(j)H^(j) of all out-neighbours jjj of all non-destination vertices rkr_krk​ visited strictly before time KKK. Note H^(rK)\hat H(r_K)H^(rK​) is here G.cost(rK)G.\mathrm{cost}(r_K)G.cost(rK​), since heuristic paths from destination vertices are singletons. The IsLeast claim includes membership: H^(rK)\hat H(r_K)H^(rK​) must literally equal one of the listed values, not merely bound them below. 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