Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Theorem 14.1 — integer capacities admit an integer maximum flow

Proved
AppliedComb.Flows.integral_max_flow

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

combinatoricsgraph-theoryintegralitynetwork-flowsp2o-batch-books5p2o-gran-per-chapterp2o-plan-bookp2o-v1

Let GGG be a network in which every edge has integer capacity: c(x,y)∈Zc(x, y) \in \mathbb Zc(x,y)∈Z for every edge (x,y)(x, y)(x,y). Then there is a maximum flow in which every edge carries an integer amount of flow: a flow ϕ\phiϕ with

value⁡(ψ)≤value⁡(ϕ)  for every flow ψ,ϕ(x,y)∈Z  for every edge (x,y).\operatorname{value}(\psi) \le \operatorname{value}(\phi) \ \text{ for every flow } \psi, \qquad \phi(x, y) \in \mathbb Z \ \text{ for every edge } (x, y).value(ψ)≤value(ϕ)  for every flow ψ,ϕ(x,y)∈Z  for every edge (x,y).

The theorem does not say that every maximum flow is integral, only that one is. With capacities all equal to 111 it turns flow problems into combinatorial problems (matchings, chain partitions). The book states it without proof.

Formalization Note. Networks and flows are those of AppliedComb.Flows.Network; the flow is real-valued and its integrality is asserted on edges (on non-edges it is 000 by the definition of a flow).

Preamble
import Mathlib
import Definitions.Def_AppliedComb_Flows_Network
Formal statement
namespace AppliedComb.Flows

/-- **Theorem 14.1** (Keller & Trotter, *Applied Combinatorics*, 2017 Edition, p. 279). In a
network flow problem in which every edge has integer capacity, there is a maximum flow in which
every edge carries an integer amount of flow: a flow `ϕ` whose value is at least the value of
every flow, with `ϕ(x, y) ∈ ℤ` for every edge `(x, y)`. -/
theorem integral_max_flow {V : Type*} [Fintype V] [DecidableEq V] (N : Network V)
    (hcap : ∀ x y, N.adj x y → ∃ n : ℤ, N.cap x y = n) :
    ∃ ϕ : V → V → ℝ, N.IsFlow ϕ ∧
      (∀ ψ : V → V → ℝ, N.IsFlow ψ → N.value ψ ≤ N.value ϕ) ∧
      ∀ x y, N.adj x y → ∃ n : ℤ, ϕ x y = n := by sorry

end AppliedComb.Flows
Source
Keller & Trotter, Applied Combinatorics (2017 Edition), p. 279, Theorem 14.1
Read-back

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

Setting. Let VVV be a finite type with decidable equality. Let NNN be a network on VVV with directed edge relation adj\mathrm{adj}adj, source SSS, sink TTT and capacity ccc, satisfying

  • S≠TS\ne TS=T;
  • at most one of adj(x,y)\mathrm{adj}(x,y)adj(x,y) and adj(y,x)\mathrm{adj}(y,x)adj(y,x) holds (no loops);
  • there are no edges into SSS and no edges out of TTT;
  • c≥0c\ge0c≥0 on edges.

Hypothesis. For every edge (x,y)(x,y)(x,y), c(x,y)c(x,y)c(x,y) is an integer. Nothing is assumed about ccc on non-edges.

Conclusion. There exists a function ϕ:V×V→R\phi:V\times V\to\mathbb{R}ϕ:V×V→R with the following three properties.

  1. ϕ\phiϕ is a flow in NNN:
    • 0≤ϕ(x,y)≤c(x,y)0\le\phi(x,y)\le c(x,y)0≤ϕ(x,y)≤c(x,y) on every edge;
    • ϕ(x,y)=0\phi(x,y)=0ϕ(x,y)=0 on every non-edge;
    • ∑x∈Vϕ(S,x)=∑x∈Vϕ(x,T)\sum_{x\in V}\phi(S,x)=\sum_{x\in V}\phi(x,T)∑x∈V​ϕ(S,x)=∑x∈V​ϕ(x,T);
    • ∑x∈Vϕ(x,y)=∑x∈Vϕ(y,x)\sum_{x\in V}\phi(x,y)=\sum_{x\in V}\phi(y,x)∑x∈V​ϕ(x,y)=∑x∈V​ϕ(y,x) for every y≠S,Ty\ne S,Ty=S,T.
  2. ϕ\phiϕ is maximum. For every flow ψ\psiψ in NNN,
∑x∈Vψ(S,x)≤∑x∈Vϕ(S,x).\sum_{x\in V}\psi(S,x)\le\sum_{x\in V}\phi(S,x).x∈V∑​ψ(S,x)≤x∈V∑​ϕ(S,x).
  1. ϕ\phiϕ is integral on edges. ϕ(x,y)\phi(x,y)ϕ(x,y) is an integer for every edge (x,y)(x,y)(x,y). On non-edges it is 000, by property 1.

Degenerate cases.

  • The network conditions force ∣V∣≥2|V|\ge2∣V∣≥2.
  • If NNN has no edges, the hypothesis is vacuous. The asserted ϕ\phiϕ is then the zero function, which is the only flow.
  • If every edge has capacity 000, every flow is zero on all pairs, and again ϕ=0\phi=0ϕ=0.
Human review
  • Endorsed by Shuze Chen · Oct 2, 2026

    Confirmed by the moderator at approval.

  • Endorsed by mikedeng1 · Oct 2, 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