Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

With integer capacities, ε\varepsilonε is a positive integer and augmentation preserves integrality

Proved
EdmondsKarp.MaxCapacity.augment_integral

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

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

Let NNN be a network in which every capacity c(u,v)c(u,v)c(u,v) is an integer, let fff be an integer-valued flow in NNN, and let PPP be an augmenting path relative to fff. Then the augmentation ε\varepsilonε of PPP is a positive integer,

ε∈{1,2,3,… },\varepsilon \in \{1, 2, 3, \dots\},ε∈{1,2,3,…},

and the augmented flow f′f'f′ is again integer-valued on every arc of NNN.

By induction, a run of the labeling method started from an integer-valued flow consists of integer-valued flows only. This is what turns the geometric decrease of the gap f∗(t,s)−fk(t,s)f^*(t,s) - f^k(t,s)f∗(t,s)−fk(t,s) into a bound on the number of augmentations in Theorem 2.

Formalization Note Integer-valued means f(u,v)∈Zf(u,v)\in\mathbb Zf(u,v)∈Z on the arcs of AAA and on the return arc; values of f off the arcs of NNN are not constrained.

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

/-- §1.1, p. 250: if all capacities are integers, then for any augmenting path `P` relative to any
integer-valued flow `f`, `ε` is a positive integer, and the augmented flow is again integer-valued. -/
theorem augment_integral {V : Type} [Fintype V] [DecidableEq V] (N : Network V)
    (hcap : IntegralCaps N) (f : V → V → ℝ) (P : List V) (hf : IsFlow N f)
    (hfint : IsIntegralOn N f) (hP : IsAugPath N f P) :
    (∃ z : ℤ, 0 < z ∧ pathEps N f P = z) ∧ IsIntegralOn N (augment N f P) := by sorry

end EdmondsKarp.MaxCapacity
Source
Edmonds, Karp, Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems, J. ACM 19(2), 1972, p. 250, §1.1 (unnumbered: "Assuming that all the capacities c(u, v) are integers, then clearly for any augmenting path P relative to any integer-valued flow f, ε is a positive integer. …"); used on p. 254 ("since all the capacities are integers, each flow is integral")
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. fff is a flow: f≥0f \ge 0f≥0 on the arcs of NNN; f≤cf \le cf≤c on AAA; and conservation holds over the arcs of NNN at every node.
  3. f(u,v)∈Zf(u,v) \in \mathbb{Z}f(u,v)∈Z for every arc (u,v)(u,v)(u,v) of NNN, including (t,s)(t,s)(t,s).
  4. PPP is an augmenting path for fff: pairwise distinct nodes from sss to ttt, each consecutive pair (u,v)(u,v)(u,v) having ((u,v)∈A(u,v) \in A(u,v)∈A and c(u,v)−f(u,v)>0c(u,v) - f(u,v) > 0c(u,v)−f(u,v)>0) or ((v,u)∈A(v,u) \in A(v,u)∈A and f(v,u)>0f(v,u) > 0f(v,u)>0).

Definitions used in the conclusion.

  • ε\varepsilonε is the minimum step value along PPP. The step value of (u,v)(u,v)(u,v) is:
    • c(u,v)−f(u,v)+f(v,u)c(u,v) - f(u,v) + f(v,u)c(u,v)−f(u,v)+f(v,u) if both (u,v)(u,v)(u,v) and (v,u)(v,u)(v,u) are in AAA;
    • c(u,v)−f(u,v)c(u,v) - f(u,v)c(u,v)−f(u,v) if only (u,v)∈A(u,v) \in A(u,v)∈A;
    • f(v,u)f(v,u)f(v,u) if (u,v)∉A(u,v) \notin A(u,v)∈/A.
  • f′f'f′ is the augmented function:
    • f′(t,s)=f(t,s)+εf'(t,s) = f(t,s) + \varepsilonf′(t,s)=f(t,s)+ε;
    • on each (x,y)∈A(x,y) \in A(x,y)∈A, f′(x,y)=f(x,y)+inc⁡−dec⁡f'(x,y) = f(x,y) + \operatorname{inc} - \operatorname{dec}f′(x,y)=f(x,y)+inc−dec, where
      • inc⁡\operatorname{inc}inc is min⁡(ε,c(x,y)−f(x,y))\min(\varepsilon, c(x,y) - f(x,y))min(ε,c(x,y)−f(x,y)) or ε\varepsilonε when (x,y)(x,y)(x,y) is a step (according as (y,x)∈A(y,x) \in A(y,x)∈A or not), and 000 otherwise;
      • dec⁡\operatorname{dec}dec is max⁡(0,ε−c(y,x)+f(y,x))\max(0, \varepsilon - c(y,x) + f(y,x))max(0,ε−c(y,x)+f(y,x)) or ε\varepsilonε when (y,x)(y,x)(y,x) is a step (according as (y,x)∈A(y,x) \in A(y,x)∈A or not), and 000 otherwise;
    • f′=ff' = ff′=f elsewhere.

Conclusion.

∃z∈Z, z>0, ε=z,andf′(u,v)∈Z for every arc (u,v) of N.\exists z \in \mathbb{Z},\ z > 0,\ \varepsilon = z, \qquad\text{and}\qquad f'(u,v) \in \mathbb{Z} \text{ for every arc } (u,v) \text{ of } N.∃z∈Z, z>0, ε=z,andf′(u,v)∈Z for every arc (u,v) of N.

Degenerate cases. The statement is vacuous when fff has no augmenting path, for example when AAA is empty. The integer-capacity hypothesis is vacuous when AAA is empty. The conclusion says nothing about values of f′f'f′ off the arcs of NNN.

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