Lemma 4.3 — the first-in, first-out algorithm makes at most passes over the queue
ProvedGoldbergTarjan.FIFO.pass_count_leLet . Pass one over the queue consists of the discharges of the vertices added to the queue during the initialization. Pass consists of the discharges of the vertices added to the queue during pass . In every run of the first-in, first-out algorithm,
Within a pass each vertex is discharged at most once, so this bound turns into a bound on the number of discharges and, with Corollary 4.4, on the number of nonsaturating pushes.
Formalization Note The passes made by a run of discharges are counted as the largest pass number of a discharged queue entry. The pass number of an entry is propagated as in the definition: at initialization, and for every vertex added during a discharge of pass .
import Mathlib import Definitions.Def_GoldbergTarjan_FIFO_Network import Definitions.Def_GoldbergTarjan_FIFO_PushRelabel import Definitions.Def_GoldbergTarjan_FIFO_Algorithm import Definitions.Def_GoldbergTarjan_FIFO_Counts
namespace GoldbergTarjan.FIFO
/-- Lemma 4.3 (Goldberg–Tarjan 1988, p. 930): the number of passes over the queue made by the
first-in, first-out algorithm is at most `4n²`, where `n = |V|`. Pass one consists of the
discharges of the vertices added to the queue during the initialization, and pass `i + 1` of the
discharges of the vertices added during pass `i`; the passes made by the first `K` discharges
number the largest pass tag of a discharged entry. -/
theorem pass_count_le {V : Type} [Fintype V] [DecidableEq V]
(N : Network V) (L : V → List V) (K : ℕ) (S : ℕ → State V) (J : ℕ → ℕ)
(hrun : IsFIFORun N L K S J) :
passCount K S ≤ 4 * Fintype.card V ^ 2 := by sorry
end GoldbergTarjan.FIFO
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Setting. The theorem fixes:
- a finite type with and decidable equality;
- a network with nonnegative real capacities (with ), source and sink ;
- a list assignment , a natural number , and sequences of states and of natural numbers.
Hypothesis. is a first-in, first-out run of discharges. That is:
- is an edge list: lists without repetition exactly the with or ;
- has the initial flow, the labels and elsewhere, and current positions ;
- the queue of contains each with once, each tagged with pass number ;
- for each , results from one discharge of the front entry of 's queue using push/relabel operations. Every vertex appended to the queue during that discharge is tagged .
Claim.
where is the pass tag of the first entry of 's queue, or if that queue is empty. The maximum is taken to be when .
Degenerate cases.
- For the claim is , which is trivial.
- The theorem bounds only the largest tag of the entries discharged in the first steps. It says nothing about itself or about whether the run terminates.
- always holds.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.