Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Proof of Theorem 9 — the maximum-flow value of Problem ppp is min⁡(∑i[ai/2p],∑j[bj/2p])\min(\sum_i [a_i/2^p], \sum_j [b_j/2^p])min(∑i​[ai​/2p],∑j​[bj​/2p])

Proved
EdmondsKarp.Scaling.maxFlow_value_problem

by mikedeng1 · Sep 27, 2026 · Mathlib 0df444a (Lean v4.33.1)

maximum-flowp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1transportation-problem

Let a1,…,ama_1,\dots,a_ma1​,…,am​ and b1,…,bnb_1,\dots,b_nb1​,…,bn​ be positive integers with ∑iai=∑jbj\sum_i a_i = \sum_j b_j∑i​ai​=∑j​bj​ (m,n≥1m, n \ge 1m,n≥1), let dij≥0d_{ij} \ge 0dij​≥0, and let p≥0p \ge 0p≥0. Problem ppp has a maximum flow, and every maximum flow fff of Problem ppp has value

fp∗=f(t,s)=min⁡(∑i=1m⌊ai2p⌋, ∑j=1n⌊bj2p⌋)≥0.f_p^* = f(t,s) = \min\Big(\sum_{i=1}^m \Big\lfloor \frac{a_i}{2^p}\Big\rfloor,\ \sum_{j=1}^n \Big\lfloor \frac{b_j}{2^p}\Big\rfloor\Big) \ge 0.fp∗​=f(t,s)=min(i=1∑m​⌊2pai​​⌋, j=1∑n​⌊2pbj​​⌋)≥0.

The number of augmentations in a phase of the scaling method is bounded by the gap between this value and the value of the phase's initial flow.

Preamble
import Mathlib
import Definitions.Def_EdmondsKarp_Scaling_Transport
import Definitions.Def_EdmondsKarp_Scaling_Augmentation
import Definitions.Def_EdmondsKarp_Scaling_Run
Formal statement
namespace EdmondsKarp.Scaling

/-- Proof of Theorem 9 (p. 260): Problem `p` has a maximum flow, and the value `f_p^*` of every
maximum flow of Problem `p` is `min(∑_i [a_i/2^p], ∑_j [b_j/2^p])`. -/
theorem maxFlow_value_problem {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) (p : ℕ) :
    (∃ x : Flow m n, IsMaxFlow (problem a b d p) x) ∧
      ∀ x : Flow m n, IsMaxFlow (problem a b d p) x →
        x.ret = ((min (∑ i, a i / 2 ^ p) (∑ j, b j / 2 ^ p) : ℕ) : ℝ) := by sorry

end EdmondsKarp.Scaling
Source
Edmonds, Karp, Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems, J. ACM 19(2), 1972, p. 260, proof of Theorem 9 (unnumbered display defining f_p*)
Read-back

What the Lean code literally says, in plain math · claude-opus-5-5

Setting. Let m≥1m\ge1m≥1 and n≥1n\ge1n≥1. Take natural numbers aia_iai​ and bjb_jbj​, and reals dijd_{ij}dij​.

Hypotheses.

  • ai>0a_i>0ai​>0 and bj>0b_j>0bj​>0;
  • ∑iai=∑jbj\sum_i a_i=\sum_j b_j∑i​ai​=∑j​bj​;
  • dij≥0d_{ij}\ge0dij​≥0;
  • ppp is any natural number.

Conclusion. Consider Problem ppp: capacities ⌊ai/2p⌋\lfloor a_i/2^p\rfloor⌊ai​/2p⌋ on (s,si)(s,s_i)(s,si​), ⌊bj/2p⌋\lfloor b_j/2^p\rfloor⌊bj​/2p⌋ on (tj,t)(t_j,t)(tj​,t), and costs dijd_{ij}dij​. The statement asserts two things:

  1. Problem ppp has at least one maximum flow.
  2. Every maximum flow xxx of Problem ppp has return value
r(x)=min⁡(∑i⌊ai2p⌋, ∑j⌊bj2p⌋).r(x) = \min\Big(\sum_i \Big\lfloor \tfrac{a_i}{2^p}\Big\rfloor,\ \sum_j \Big\lfloor \tfrac{b_j}{2^p}\Big\rfloor\Big).r(x)=min(i∑​⌊2pai​​⌋, j∑​⌊2pbj​​⌋).

Each term is floored separately before summing.

A maximum flow here means a flow (nonnegative, within the capacities, conserving at every node) whose return value is at least that of every flow.

Degenerate cases.

  • For p=0p=0p=0 the value is min⁡(∑ai,∑bj)=∑iai\min(\sum a_i,\sum b_j)=\sum_i a_imin(∑ai​,∑bj​)=∑i​ai​.
  • Once 2p2^p2p exceeds every aia_iai​ and bjb_jbj​, all capacities are 000 and the asserted value is 000.
Human review
  • Endorsed by Shuze Chen · Sep 27, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Sep 27, 2026

    Confirmed by the mission captain (proposal self-audit).

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me