Flow optimality iff no unsaturated negative-cost cycle
ProvedLinearOptimization.network_no_negative_cycle_optimal(Bertsimas & Tsitsiklis, Theorem 7.6, p. 298) A feasible flow is optimal if and only if there is no unsaturated cycle with negative cost.
(Setting: the general capacitated minimum cost network flow problem of §7.2. A cycle with forward-arc set and backward-arc set is unsaturated under if for all and for all (pp. 293-294, equivalently in Eq. (7.12)); its cost is
'Optimal' = attains the minimum cost among feasible flows.)
import Definitions.Def_LinearOptimization_NetworkFlowProblem open Matrix open scoped ENNReal /-- **Bertsimas & Tsitsiklis, Theorem 7.6 (p. 298).** A feasible flow `f` of the (capacitated) minimum cost network flow problem is optimal iff no cycle is both unsaturated under `f` (`f_k < u_k` on forward arcs, `f_k > 0` on backward arcs) and of negative cost `c'h^C < 0`. -/
theorem LinearOptimization.network_no_negative_cycle_optimal {n m : ℕ}
(arcs : Fin m → Fin n × Fin n) (hloop : HasNoSelfLoops arcs)
(bsupply : Fin n → ℝ) (u : Fin m → ℝ≥0∞) (cost : Fin m → ℝ)
(f : Fin m → ℝ) (hf : IsFeasibleFlow arcs bsupply u f) :
(∀ f', IsFeasibleFlow arcs bsupply u f' → cost ⬝ᵥ f ≤ cost ⬝ᵥ f') ↔
¬∃ (v : Fin n) (steps : List (Fin m × Bool)),
IsCycle arcs v steps ∧
(∀ st ∈ steps, st.2 = true → ENNReal.ofReal (f st.1) < u st.1) ∧
(∀ st ∈ steps, st.2 = false → 0 < f st.1) ∧
cost ⬝ᵥ traversalVector steps < 0 := by
sorry
Read-back
What the Lean code literally says, in plain math · claude-fable-5
Fix a network of directed arcs on nodes with no self-loops, supplies , capacities , costs , and a flow that is feasible: (incidence matrix ) and, for every arc, with in . The theorem asserts an equivalence: minimizes cost among feasible flows — for every feasible — iff there is no residual negative-cost cycle, i.e. no vertex and step-list (steps = arc index + direction flag) such that: the steps form a cycle at (nonempty closed walk whose node list minus its last entry has no repeats and whose arc indices are pairwise distinct); every forward step has ; every backward step has ; and strictly, where (membership, not multiplicity). Both directions of the iff are asserted.
Confirmed by the mission captain (proposal self-audit).