Theorem 9 — the scaling method uses at most augmentations
ProvedEdmondsKarp.Scaling.scaling_augmentation_boundLet , let the supplies and demands be positive integers with , and let be the costs of the Hitchcock transportation problem. Let be such that and for all . Then every run of the scaling method, which solves Problems in turn, starting from the zero flow in Problem and from twice the final flow of Problem in Problem , performs a total number of flow augmentations at most
The bound is roughly the number of binary digits needed to write the data, so the scaling method is a polynomial-time ("good") algorithm for the transportation problem, whereas the direct primal–dual method can take augmentations.
Formalization Note The count is compared in with , using Real.logb 2 and Int.floor; under the hypotheses, so the floor is nonnegative. Positivity of the , is §1.1's standing assumption that capacities are positive; without it the bound fails (, , , needs one augmentation, while the bound is negative). A run is any sequence satisfying IsScalingRun; the paper's path selection rule is abstracted to its invariant (every flow pseudo-extreme), so the statement covers every run of the paper's method. The bound does not depend on or on the costs.
import Mathlib import Definitions.Def_EdmondsKarp_Scaling_Transport import Definitions.Def_EdmondsKarp_Scaling_Augmentation import Definitions.Def_EdmondsKarp_Scaling_Run
namespace EdmondsKarp.Scaling
/-- Theorem 9 (p. 260). The number of flow augmentations in applying the scaling method to a
transportation problem with integral (positive) supplies `a_1, …, a_m` and demands `b_1, …, b_n`,
`∑ a_i = ∑ b_j`, nonnegative costs, and any `l` with all `a_i, b_j < 2^l`, is at most
`max(m, n) (2 + [log_2 (∑ a_i / max(m, n))])`, where `[·]` is the floor. -/
theorem scaling_augmentation_bound {m n : ℕ} (hm : 1 ≤ m) (hn : 1 ≤ n) (a : Fin m → ℕ)
(b : Fin n → ℕ) (d : Fin m → Fin n → ℝ) (ha : ∀ i, 0 < a i) (hb : ∀ j, 0 < b j)
(hsum : ∑ i, a i = ∑ j, b j) (hd : ∀ i j, 0 ≤ d i j) (l : ℕ)
(hla : ∀ i, a i < 2 ^ l) (hlb : ∀ j, b j < 2 ^ l) (K : ℕ → ℕ) (F : ℕ → ℕ → Flow m n)
(hR : IsScalingRun a b d l K F) :
((∑ p ∈ Finset.range l, K p : ℕ) : ℤ) ≤
((max m n : ℕ) : ℤ) *
(2 + ⌊Real.logb 2 (((∑ i, a i : ℕ) : ℝ) / ((max m n : ℕ) : ℝ))⌋) := by sorry
end EdmondsKarp.Scaling
Read-back
What the Lean code literally says, in plain math · claude-opus-5-5
Fix two natural numbers with and . The statement also takes the following data:
- a vector of natural numbers with every ;
- a vector of natural numbers with every ;
- an matrix of real numbers with every . The entries do not have to be integers or rationals;
- a natural number such that for every and for every ;
- a function ;
- a doubly indexed family . Each is an object of type , which is defined in an imported file that is not shown here.
The vectors and must have the same total:
The last hypothesis is that the predicate holds. This predicate is also defined in an imported file that is not shown, so its content cannot be expanded here. Whatever link the theorem makes between and a scaling or augmentation process depends entirely on that unseen definition. The statement itself does not tie the numbers to anything else. The family and the costs appear only inside this predicate. The docstring's reading, that the conclusion counts "flow augmentations", is not part of the formal content.
Under these hypotheses, the statement asserts the following inequality between integers:
- The left side is a finite sum in the natural numbers, converted to an integer. It covers only the indices ; nothing is claimed about for .
- On the right, the quotient is computed in the real numbers.
- means .
- is the integer floor.
The hypotheses force (each ) and (each ). So , the logarithm is a nonnegative real number, and the floor is a nonnegative integer. The right side is therefore at least .
Degenerate cases.
- Empty index sets: these are excluded, because and .
- One source and one sink (): the hypotheses force , and the bound becomes .
- : the hypothesis contradicts , so there are no admissible inputs and the statement is vacuously true. (In that case the left-hand sum would be empty and equal to .) Any admissible satisfies , so .
- larger than necessary: allowed. is only required to be large enough, not minimal. Since the bound does not depend on , a larger adds more terms to the left side while the right side stays the same.
- Division by zero and logarithms of nonpositive numbers: neither can occur, because and .
- Overflow: none. is summed in the natural numbers and then converted to an integer exactly.
- Satisfiability of : whether this predicate can ever hold, for which inputs, and whether it constrains at all for cannot be determined from the code shown. If it is unsatisfiable for some or all admissible , the statement is vacuous for those inputs.
Confirmed by the mission captain (proposal self-audit).
Confirmed by the moderator at approval.