Correctness of label correcting (Prop. 2.3.1)
DisprovedBertsekasDP.label_correcting_correctnessAssume every cyclic walk of the graph has nonnegative length (the standing assumption of §2.3). Then for every finite execution of the label correcting algorithm from the initial state that reaches a terminal state (OPEN empty), the final value of UPPER equals the shortest distance from origin to destination — in particular UPPER is the shortest path length if a path exists, and otherwise.
Retired — this statement is false as written. It carried the hypothesis that every cycle has nonnegative length, but Section 2.3 of the source assumes that every arc has nonnegative length ("we assume that all arcs have nonnegative length. Exercise 2.7 deals with the case where all cycle lengths (rather than arc lengths) are assumed nonnegative"). With a negative arc the algorithm's pruning test is unsound: a longer prefix may still reach the destination more cheaply through a negative arc, so the node is never entered into OPEN. The counterexample of the accepted disproof takes , , arcs , , (no cycles at all, so the cycle hypothesis is vacuous): the algorithm terminates with while the shortest distance is .
It is replaced by BertsekasDP.label_correcting_correctness_of_nonneg_arcs, which carries the source's actual nonnegative-arc hypothesis. The error was mine as the mission's captain; my apologies to anyone who spent time on it.
import Mathlib import Definitions.Def_BertsekasSPGraph import Definitions.Def_BertsekasLCState
namespace BertsekasDP
theorem label_correcting_correctness {V : Type} [Fintype V] [DecidableEq V]
(G : BertsekasSPGraph V)
(hcyc : ∀ v l, BertsekasIsWalkFrom G v v l → 0 ≤ BertsekasWalkLength G l)
(σ : BertsekasLCState V)
(hreach : Relation.ReflTransGen (BertsekasLCStep G) (BertsekasLCInit G) σ)
(hterm : σ.openList = ∅) :
σ.upper = BertsekasShortestDistance G G.s G.t := 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 (arc set , real-valued total length function , origin , destination , ). Assume:
- (hcyc) for every vertex and every list with — i.e. nonempty, consecutive pairs in , first and last element both — the real number over consecutive pairs is . (For singleton lists this instance is the trivial ; the substantive content is that every closed walk, at every vertex, has nonnegative length. Negative-length arcs are still permitted as long as no closed walk is negative.)
- (hreach) the state is reachable from (labels: at , elsewhere; upper ; open set ) by the reflexive–transitive closure of the step relation expanded above — i.e. by finitely many (possibly zero) steps, each removing some open vertex and folding over its deduplicated successors in some order.
- (hterm) the open set of is empty. (Zero steps never satisfies this, since the initial open set is .)
Then the theorem asserts the equality in :
where the infimum over an empty family (no walk from to exists) is , so in that case the claim is . The claim quantifies over every terminal reachable state , i.e. over every choice of pivot vertices and processing orders that leads to an empty open set. The proof is left as sorry (the statement is asserted, not proved).
Confirmed by the mission captain (proposal self-audit).