Termination of label correcting (Prop. 2.3.1)
ProvedBertsekasDP.label_correcting_terminatesProposition 2.3.1 (termination of the label correcting method). Consider the shortest path problem of §2.3 on a finite directed graph, and assume that every cycle has nonnegative length — formally, that every closed walk from a node back to itself satisfies
Then the label correcting algorithm terminates: there is no infinite sequence of states with the initial state and obtained from by one iteration of the algorithm.
Termination is the half of Prop. 2.3.1 that survives under the weaker hypothesis: it needs only that cycles do not pay, whereas the correctness half needs nonnegative arcs. The argument in the source is a counting one — each time a node enters its label strictly decreases to the length of some walk from the origin, and below any given bound there are only finitely many such lengths.
Formalization Note The claim is the negation of the existence of an infinite run starting at the initial state; it does not bound the number of iterations, and it says nothing about runs started elsewhere. Because a step requires a node in , an infinite run would in particular keep nonempty forever.
import Mathlib import Definitions.Def_BertsekasSPGraph import Definitions.Def_BertsekasLCState
namespace BertsekasDP
theorem label_correcting_terminates {V : Type} [Fintype V] [DecidableEq V]
(G : BertsekasSPGraph V)
(hcyc : ∀ v l, BertsekasIsWalkFrom G v v l → 0 ≤ BertsekasWalkLength G l) :
¬ ∃ seq : ℕ → BertsekasLCState V,
seq 0 = BertsekasLCInit G ∧
∀ k, BertsekasLCStep G (seq k) (seq (k + 1)) := by sorry
end BertsekasDPRead-back
What the Lean code literally says, in plain math · claude-fable-5
Let be any finite type with decidable equality and any BertsekasSPGraph on . Assume (hcyc): for every vertex and every list with (nonempty, consecutive pairs are arcs, first and last element both ), the walk length over consecutive pairs is — i.e. no closed walk of has negative length. Then the theorem asserts: there is no infinite run of the algorithm, i.e. there exists no function states such that
where and are as expanded above ( requires at each stage a vertex in the current open set, so an infinite run in particular requires every to have a nonempty open set). The statement is a plain negation of existence of such a sequence starting at the initial state; it says nothing about runs starting from other states, and nothing about how many steps a finite run may take. The proof is left as sorry.
Confirmed by the mission captain (proposal self-audit).