Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Cut inequality: c(X,Xˉ)≥f(X,Xˉ)−f(Xˉ,X)=f(t,s)c(X,\bar X) \ge f(X,\bar X) - f(\bar X,X) = f(t,s)c(X,Xˉ)≥f(X,Xˉ)−f(Xˉ,X)=f(t,s)

Proved
EdmondsKarp.MaxCapacity.cut_bound

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

cutsnetwork-flowsp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let NNN be a network with integer capacities, and let XXX be a set of nodes with s∈Xs \in Xs∈X and t∉Xt \notin Xt∈/X; write Xˉ\bar XXˉ for its complement. For every flow fff in NNN,

c(X,Xˉ)  ≥  f(X,Xˉ)−f(Xˉ,X)  =  f(t,s),c(X,\bar X) \;\ge\; f(X,\bar X) - f(\bar X,X) \;=\; f(t,s),c(X,Xˉ)≥f(X,Xˉ)−f(Xˉ,X)=f(t,s),

where c(X,Xˉ)c(X,\bar X)c(X,Xˉ) and f(X,Xˉ)f(X,\bar X)f(X,Xˉ) sum over the arcs of AAA from XXX to Xˉ\bar XXˉ and f(Xˉ,X)f(\bar X,X)f(Xˉ,X) over the arcs of AAA from Xˉ\bar XXˉ to XXX (the return arc is not in AAA).

The net flow across any sss–ttt cut equals the value on the return arc and is bounded by the cut's capacity; applied to a maximum flow it gives f∗(t,s)≤c(X,Xˉ)f^*(t,s) \le c(X,\bar X)f∗(t,s)≤c(X,Xˉ), the first step of the proof of Theorem 2.

Formalization Note The integrality of the capacities is the standing assumption of §1.3 and is kept as a hypothesis, although the inequality does not need it.

Preamble
import Mathlib
import Definitions.Def_EdmondsKarp_MaxCapacity_Network
import Definitions.Def_EdmondsKarp_MaxCapacity_Augmentation
import Definitions.Def_EdmondsKarp_MaxCapacity_Run
Formal statement
namespace EdmondsKarp.MaxCapacity

/-- Proof of Theorem 2, p. 254: for a network `N` with integer capacities, a set of nodes `X` with
`s ∈ X`, `t ∉ X`, and any flow `f`: `c(X, X̄) ≥ f(X, X̄) − f(X̄, X) = f(t, s)`. -/
theorem cut_bound {V : Type} [Fintype V] [DecidableEq V] (N : Network V)
    (hcap : IntegralCaps N) (X : Finset V) (hs : N.s ∈ X) (ht : N.t ∉ X)
    (f : V → V → ℝ) (hf : IsFlow N f) :
    cutFlowOut N f X - cutFlowIn N f X = f N.t N.s ∧
      cutFlowOut N f X - cutFlowIn N f X ≤ cutCap N X := by sorry

end EdmondsKarp.MaxCapacity
Source
Edmonds, Karp, Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems, J. ACM 19(2), 1972, p. 254, proof of Theorem 2 (displayed definitions of c(X, X̄), f(X, X̄), f(X̄, X) and "Then, for any flow f, c(X, X̄) ≥ f(X, X̄) − f(X̄, X) = f(t, s).")
Read-back

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

Let VVV be any finite type with decidable equality, and let NNN be any network on VVV. It has source sss, sink ttt with s≠ts \neq ts=t, a loop-free finite arc set AAA not containing (t,s)(t,s)(t,s), and capacities c>0c > 0c>0 on AAA. Its arcs are A∪{(t,s)}A \cup \{(t,s)\}A∪{(t,s)}.

Hypotheses.

  1. c(u,v)∈Zc(u,v) \in \mathbb{Z}c(u,v)∈Z for every (u,v)∈A(u,v) \in A(u,v)∈A.
  2. XXX is any subset of VVV with s∈Xs \in Xs∈X and t∉Xt \notin Xt∈/X. Write Xˉ=V∖X\bar X = V \setminus XXˉ=V∖X.
  3. fff is a flow: f≥0f \ge 0f≥0 on all arcs of NNN including (t,s)(t,s)(t,s); f≤cf \le cf≤c on AAA; and at every node, outflow equals inflow over the arcs of NNN.

Cut quantities. All three sums range over arcs of AAA only, so the return arc is excluded:

c(X,Xˉ)=∑(u,v)∈Au∈X, v∉Xc(u,v),f(X,Xˉ)=∑(u,v)∈Au∈X, v∉Xf(u,v),f(Xˉ,X)=∑(u,v)∈Au∉X, v∈Xf(u,v).c(X,\bar X) = \sum_{\substack{(u,v)\in A\\ u\in X,\ v\notin X}} c(u,v),\quad f(X,\bar X) = \sum_{\substack{(u,v)\in A\\ u\in X,\ v\notin X}} f(u,v),\quad f(\bar X,X) = \sum_{\substack{(u,v)\in A\\ u\notin X,\ v\in X}} f(u,v).c(X,Xˉ)=(u,v)∈Au∈X, v∈/X​∑​c(u,v),f(X,Xˉ)=(u,v)∈Au∈X, v∈/X​∑​f(u,v),f(Xˉ,X)=(u,v)∈Au∈/X, v∈X​∑​f(u,v).

Conclusion.

f(X,Xˉ)−f(Xˉ,X)=f(t,s)andf(X,Xˉ)−f(Xˉ,X)≤c(X,Xˉ).f(X,\bar X) - f(\bar X, X) = f(t,s) \qquad\text{and}\qquad f(X,\bar X) - f(\bar X, X) \le c(X,\bar X).f(X,Xˉ)−f(Xˉ,X)=f(t,s)andf(X,Xˉ)−f(Xˉ,X)≤c(X,Xˉ).

The integer-capacity hypothesis is assumed, but the conclusion does not mention integrality.

Degenerate cases. If no arc of AAA crosses between XXX and Xˉ\bar XXˉ, all three sums are 000. The statement then asserts f(t,s)=0f(t,s) = 0f(t,s)=0 and 0≤00 \le 00≤0. The integrality hypothesis is vacuous when AAA is empty.

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