Lemma 4.1 — the push/relabel operation relabels only when relabeling is applicable
ProvedGoldbergTarjan.FIFO.relabel_only_when_applicableConsider a run of the first-in, first-out algorithm on a flow network. Take any discharge of the run, say of vertex , and any push/relabel operation inside it that takes the relabeling branch of Fig. 3: no push is applicable through the current edge of , and that edge is the last one on the edge list of . Then, at that moment, the relabeling operation of Fig. 1 is applicable to :
Thus the implementation with current edges performs only legitimate relabelings, and every run of the FIFO algorithm is a run of the generic push–relabel algorithm.
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.1 (Goldberg–Tarjan 1988, p. 929): the push/relabel operation does a relabeling only
when the relabeling operation is applicable. In every run of the first-in, first-out algorithm,
whenever the `j`-th push/relabel operation of the `k`-th discharge (of the front vertex `v`)
takes the relabeling branch of Fig. 3, `relabel(v)` is applicable (Fig. 1) at that moment. -/
theorem relabel_only_when_applicable {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) (k : ℕ) (hk : k < K) (j : ℕ) (hj : j < J k)
(hrel : IsRelabelOp N L (frontVertex N (S k))
(prIter N L (frontVertex N (S k)) (S k).cfg j)) :
RelabelApplicable N (prIter N L (frontVertex N (S k)) (S k).cfg j).f
(prIter N L (frontVertex N (S k)) (S k).cfg j).d (frontVertex N (S k)) := 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 decidable equality;
- a network with nonnegative real capacity (with ), source and sink ;
- an assignment of a list to each vertex;
- a natural number ;
- a sequence of states and 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 initial labeling (, elsewhere) and all current positions ;
- the queue of contains each with exactly once, each tagged ;
- for each , arises from by one discharge of the front queue vertex, performing exactly push/relabel operations.
Claim. Fix and . Let be the front vertex of (its first queue vertex, or if the queue is empty), and let be the configuration after the first push/relabel operations of that discharge. Suppose the relabel branch is taken at : the current entry of exists, is not applicable, and . Then is applicable at :
- , , , and ;
- for every with , we have .
Degenerate cases. If the statement is vacuous. The hypotheses are satisfiable, for example with on any network. When , only runs exist, so the statement is again vacuous.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.