Theorem 3.4 — if the algorithm terminates with finite labels, the preflow is a maximum flow
ProvedGoldbergTarjan.Generic.terminated_run_is_max_flowLet be an execution of the generic algorithm on a flow network, started from the initial state of Fig. 2 with the simple labeling. Suppose the algorithm terminates at step — no push and no relabel is applicable in — and all distance labels are finite at termination, for all . Then
This is the correctness statement of the algorithm.
import Mathlib import Definitions.Def_GoldbergTarjan_Generic_Run
namespace GoldbergTarjan.Generic
/-- Theorem 3.4 (Goldberg–Tarjan 1988, p. 926). Suppose that the algorithm terminates (no basic
operation applies in the final state `σ K`) and all distance labels are finite at termination.
Then the preflow `f_K` is a maximum flow; that is, the algorithm is correct. -/
theorem terminated_run_is_max_flow {V : Type} [Fintype V] [DecidableEq V]
(N : Network V) (σ : ℕ → State V) (K : ℕ) (hrun : IsRun N σ K)
(hterm : NoBasicOpApplicable N (σ K)) (hfin : ∀ v : V, (σ K).2 v < ⊤) :
IsMaxFlow N (σ K).1 := by sorry
end GoldbergTarjan.Generic
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
The statement concerns an arbitrary finite type with decidable equality, a network with capacities , source and sink , a sequence of states , and . Three hypotheses are assumed.
-
is a run of length from the initial state, each step being an applicable push or relabel.
-
In , no basic operation is applicable:
- there is no pair with active, and ;
- there is no vertex that is active and satisfies for all with .
Here "active" means: not or , finite label, and positive excess .
-
for every vertex .
Conclusion. is a maximum flow. This means is a flow (, antisymmetric, and zero excess at every vertex other than ), and for every flow of .
Degenerate cases. For , the statement concerns the initial state: if no operation applies there and all initial labels are finite, then the initial flow is a maximum flow. Hypothesis 3 is an explicit assumption of the statement.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.