Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

§1.1 — augmentation along an augmenting path yields a flow of value f(t,s)+εf(t,s)+\varepsilonf(t,s)+ε

Proved
EdmondsKarp.ShortestPath.augment_isFlow

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

augmenting-pathsnetwork-flowsp2o-batch-p100bp2o-gran-per-chapterp2o-plan-paperp2o-v1

Let NNN be a network with source sss, sink ttt and return arc (t,s)(t,s)(t,s), let fff be a flow in NNN, and let PPP be an augmenting path relative to fff, with ε=min⁡iεi\varepsilon = \min_i \varepsilon_iε=mini​εi​ as defined by Cases (a)–(c). Let f′f'f′ be the function obtained from fff by the augmentation along PPP. Then

ε>0,f′ is a flow in N,f′(t,s)=f(t,s)+ε.\varepsilon > 0, \qquad f' \text{ is a flow in } N, \qquad f'(t,s) = f(t,s) + \varepsilon.ε>0,f′ is a flow in N,f′(t,s)=f(t,s)+ε.

This is the step that makes the labeling method well defined: every augmentation produces a flow of strictly larger value.

Preamble
import Mathlib
import Definitions.Def_EdmondsKarp_ShortestPath_Network
import Definitions.Def_EdmondsKarp_ShortestPath_Augmentation
Formal statement
namespace EdmondsKarp.ShortestPath

/-- §1.1, p. 249: for an augmenting path `P` relative to a flow `f`, `ε = min ε_i > 0`, and the
augmented `f′` is a flow in `N` with `f′(t, s) = f(t, s) + ε`. -/
theorem augment_isFlow {V : Type} [Fintype V] [DecidableEq V] (N : Network V)
    (f : V → V → ℝ) (P : List V) (hf : IsFlow N f) (hP : IsAugPath N f P) :
    0 < pathEps N f P ∧ IsFlow N (augment N f P) ∧
      augment N f P N.t N.s = f N.t N.s + pathEps N f P := by sorry

end EdmondsKarp.ShortestPath
Source
Edmonds, Karp, Theoretical Improvements in Algorithmic Efficiency for Network Flow Problems, J. ACM 19(2), 1972, p. 249, §1.1 (unnumbered: "let ε = min ε_i > 0" and "It is easily checked that the f′ thus defined is a flow in N")
Read-back

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

Setting. VVV is a finite node type with decidable equality, and NNN is a network on it:

  • a source sss and a sink ttt with s≠ts \neq ts=t;
  • a finite set AAA of ordered pairs, with no loops and (t,s)∉A(t,s) \notin A(t,s)∈/A;
  • a real capacity ccc with c(u,v)>0c(u,v) > 0c(u,v)>0 on AAA.

Flow. f:V×V→Rf : V \times V \to \mathbb{R}f:V×V→R is a flow if it satisfies:

  • f≥0f \ge 0f≥0 on A∪{(t,s)}A \cup \{(t,s)\}A∪{(t,s)};
  • f≤cf \le cf≤c on AAA;
  • at every node uuu (including sss and ttt), the sum of f(u,v)f(u,v)f(u,v) over (u,v)∈A∪{(t,s)}(u,v) \in A \cup \{(t,s)\}(u,v)∈A∪{(t,s)} equals the sum of f(v,u)f(v,u)f(v,u) over (v,u)∈A∪{(t,s)}(v,u) \in A \cup \{(t,s)\}(v,u)∈A∪{(t,s)}.

Residual arcs. (u,v)(u,v)(u,v) is in NfN^fNf if either (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.

Augmenting path. An augmenting path P=(p1,…,pr)P = (p_1, \dots, p_r)P=(p1​,…,pr​) is a list of pairwise distinct nodes with p1=sp_1 = sp1​=s and pr=tp_r = tpr​=t, each of whose steps (pi,pi+1)(p_i, p_{i+1})(pi​,pi+1​) lies in NfN^fNf.

The number ε\varepsilonε. εf(P)\varepsilon_f(P)εf​(P) is the minimum over the steps (u,v)(u,v)(u,v) of PPP of:

  • 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),(v,u)∈A(u,v), (v,u) \in A(u,v),(v,u)∈A;
  • 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.

It is 000 if there are no steps.

Augmented function. The augmented function f′f'f′ is defined as follows:

  • f′(t,s)=f(t,s)+εf(P)f'(t,s) = f(t,s) + \varepsilon_f(P)f′(t,s)=f(t,s)+εf​(P).
  • For (x,y)∈A(x,y) \in A(x,y)∈A, f′(x,y)=f(x,y)+inc(x,y)−dec(x,y)f'(x,y) = f(x,y) + \mathrm{inc}(x,y) - \mathrm{dec}(x,y)f′(x,y)=f(x,y)+inc(x,y)−dec(x,y), where:
    • inc(x,y)\mathrm{inc}(x,y)inc(x,y) is 000 unless (x,y)(x,y)(x,y) is a step of PPP. If it is a step, inc(x,y)\mathrm{inc}(x,y)inc(x,y) is min⁡(εf(P), c(x,y)−f(x,y))\min(\varepsilon_f(P),\, c(x,y) - f(x,y))min(εf​(P),c(x,y)−f(x,y)) when (y,x)∈A(y,x) \in A(y,x)∈A, and εf(P)\varepsilon_f(P)εf​(P) otherwise.
    • dec(x,y)\mathrm{dec}(x,y)dec(x,y) is 000 unless (y,x)(y,x)(y,x) is a step of PPP. If it is a step, dec(x,y)\mathrm{dec}(x,y)dec(x,y) is max⁡(0, εf(P)−c(y,x)+f(y,x))\max(0,\, \varepsilon_f(P) - c(y,x) + f(y,x))max(0,εf​(P)−c(y,x)+f(y,x)) when (y,x)∈A(y,x) \in A(y,x)∈A, and εf(P)\varepsilon_f(P)εf​(P) otherwise.
  • f′(x,y)=f(x,y)f'(x,y) = f(x,y)f′(x,y)=f(x,y) at every other pair.

Theorem. For every such NNN, every fff and every list PPP: if fff is a flow in NNN and PPP is an augmenting path relative to fff, then

εf(P)>0,f′ is a flow in N,f′(t,s)=f(t,s)+εf(P).\varepsilon_f(P) > 0, \qquad f' \text{ is a flow in } N, \qquad f'(t,s) = f(t,s) + \varepsilon_f(P).εf​(P)>0,f′ is a flow in N,f′(t,s)=f(t,s)+εf​(P).

Degenerate cases.

  • VVV has at least two elements because s≠ts \neq ts=t.
  • An augmenting path has at least one step, so εf(P)\varepsilon_f(P)εf​(P) is not the default value 000.
  • If no augmenting path exists (for example when A=∅A = \emptysetA=∅), the statement is vacuous for that fff.
  • The third conjunct holds directly by the definition of f′f'f′.
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