Lemma 3.8 — at most relabelings per vertex and at most overall
ProvedGoldbergTarjan.Generic.relabel_count_leLet be a flow network with vertices and let be an execution of the generic algorithm, started from the initial state of Fig. 2 with the simple labeling. Then
- every vertex is relabeled at most times among the steps;
- the total number of relabeling steps is at most ;
- .
This is the first of the three counts whose sum bounds the number of basic operations in Theorem 3.11.
Formalization Note. The subtractions and are natural-number subtractions; they are exact because forces .
import Mathlib import Definitions.Def_GoldbergTarjan_Generic_Run
namespace GoldbergTarjan.Generic
/-- Lemma 3.8 (Goldberg–Tarjan 1988, p. 927). The number of relabeling operations is at most
`2n - 1` per vertex and at most `(2n - 1)(n - 2) < 2n²` overall, where `n = |V|`. -/
theorem relabel_count_le {V : Type} [Fintype V] [DecidableEq V]
(N : Network V) (σ : ℕ → State V) (K : ℕ) (hrun : IsRun N σ K) :
(∀ v : V, relabelCountAt N σ K v ≤ 2 * Fintype.card V - 1) ∧
relabelCount N σ K ≤ (2 * Fintype.card V - 1) * (Fintype.card V - 2) ∧
(2 * Fintype.card V - 1) * (Fintype.card V - 2) < 2 * Fintype.card V ^ 2 := 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 , a sequence of states , and .
Hypothesis. is a run of length from the initial state, each step being an applicable push or relabel.
Conclusion. Three facts hold, all computed with natural-number arithmetic and truncated subtraction.
- For every vertex , the number of indices at which the step is a relabel at is at most . This applies to all , including and .
- The number of indices at which the step is a relabel at some vertex is at most .
- . This is a statement about alone.
Degenerate cases. Since , , so neither subtraction truncates. When , part 2 asserts that no relabel ever occurs. For , all counts are .
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.