Max-flow min-cut theorem
ProvedLinearOptimization.max_flow_min_cut(Bertsimas & Tsitsiklis, Theorem 7.10, p. 310, GOAL)
- (a) If the Ford–Fulkerson algorithm terminates because no augmenting path can be found, then the current flow is optimal.
- (b) (Max-flow min-cut theorem) The value of the maximum flow is equal to the minimum cut capacity.
Encoding: (Part (a) is formalized by its exact mathematical content: a feasible flow admitting no augmenting path is optimal — precisely the Step-3 termination state, and all the book's proof uses. In part (b) both sides may simultaneously be ; the book's proof (p. 311) treats the infinite case explicitly, and in the finite case the maximum is attained, with a minimum-capacity cut given by the labeled set at termination.)
import Definitions.Def_LinearOptimization_AugmentingPath import Definitions.Def_LinearOptimization_Cut open Matrix open scoped ENNReal /-- **Bertsimas & Tsitsiklis, Theorem 7.10 (p. 310).** (a) A feasible flow of the maximum flow problem admitting no augmenting path is optimal. (b) Max-flow min-cut: the value of the maximum flow equals the minimum cut capacity (in `EReal`; both sides may be `+∞`), and when finite the maximum is attained by a feasible flow. -/
theorem LinearOptimization.max_flow_min_cut {n m : ℕ} (arcs : Fin m → Fin n × Fin n)
(u : Fin m → ℝ≥0∞) (s t : Fin n)
(hst : s ≠ t) (hloop : HasNoSelfLoops arcs) (hupos : ∀ k, 0 < u k) :
(∀ f, IsFeasibleMaxFlow arcs u s t f →
(¬∃ steps, IsAugmentingPath arcs u s t f steps) →
∀ f', IsFeasibleMaxFlow arcs u s t f' →
flowValue arcs s f' ≤ flowValue arcs s f) ∧
maxFlowValue arcs u s t =
⨅ S ∈ {S : Finset (Fin n) | IsCut s t S},
((cutCapacity arcs u S : ℝ≥0∞) : EReal) ∧
(maxFlowValue arcs u s t ≠ ⊤ →
∃ f, IsFeasibleMaxFlow arcs u s t f ∧
((flowValue arcs s f : ℝ) : EReal) = maxFlowValue arcs u s t) := by
sorry
Read-back
What the Lean code literally says, in plain math · claude-fable-5
Fix a network of directed arcs on nodes , capacities , and nodes , with no self-loops and every capacity strictly positive. Writing feasibility of for the max-flow problem as: conservation for , , and , per arc; and ; the theorem asserts three conjuncts. (i) For every feasible admitting no augmenting path (no step-list that is a node-distinct path using forward steps with and backward steps with ), is a maximum flow: for all feasible . (ii) The extended-real supremum equals the infimum, over all finite node sets with , of the cut capacity , coerced from into the extended reals (); since , is such a cut, so the infimum is over a nonempty family. (iii) If the supremum is not , it is attained: some feasible has equal to it. All three parts are asserted together under the same hypotheses.
Confirmed by the mission captain (proposal self-audit).