A Lean Certificate for the Single Source Unsplittable Flow Cost Counterexample
Abstract
We explain a standalone Lean 4 and Mathlib verification of the finite counterexample announced by Dmitry Rybin to the cost-preserving single-source unsplittable-flow conjecture. The instance has seven vertices, nine directed arcs, and three terminal demands. An exact rational path flow saturates every arc, has cost 58, and has largest demand 15. Exhaustive graph-path classification reduces every unsplittable routing to two choices per terminal. Three backbone-arc inequalities force any routing with load at most the fractional load plus 15 to use at least two paid routes, each costing 30. Thus every such routing costs at least 60, ruling out cost preservation even with a non-strict congestion bound. We present the numerical certificate, its graph realization, and the boundary between the pinned proved implementation and its statement-only verification interface. The contribution is an exposition of a source-based formal certificate; no new counterexample, first formalization, or general rounding algorithm is claimed.
The cost question and the certified result
In single-source unsplittable flow, a terminal’s entire demand must be sent along one path from a common source. Dinitz, Garg, and Goemans established a rounding theorem with additive congestion bounded by the largest demand [2]. The cost-enhanced conjecture attributed to Goemans additionally asks that the rounded flow cost no more than the given fractional flow. We use the explicit formulation in Traub, Vargas Koch, and Zenklusen, Conjecture 1.3 [11]. The 1999 paper is background for the congestion theorem; it is not used here as a source for the wording of the cost conjecture.
For the positive-demand subcase sufficient here, take a finite directed graph , source , distinct terminals different from , positive demands , a feasible nonnegative fractional flow , and nonnegative per-unit arc costs , put . The existential cost-preserving assertion is that paths from to can be selected so that, for every arc,
Conjecture 1.3 also asserts polynomial-time computation. Refuting its existential part suffices to refute that stronger claim, without formalizing a computational model. The cited formulation permits zero demands; our witness satisfies the stricter positivity condition of the Lean interface. A strict variant replaces the first inequality by . We call the two bounds weak and strict only to distinguish from ; the cited cost conjecture uses .
Rybin announced the counterexample on July 22, 2026, and made the discovery session public [9, 8]. The same finite certificate is formalized in Isabelle/HOL in the Archive of Formal Proofs (AFP) by Ramos, Hulak, and de Queiroz [6]. The Lean repository discussed here is a separate reimplementation [7], not a translation imported from Isabelle. Other Lean
Copyright 2026 the authors. Licensed under Creative Commons Attribution 4.0 International (CC BY 4.0). verifications by Jason Hickey and by DiscreteAlias are also publicly available [4, 3]. We make no priority claim relative to these developments and no claim to discovery.
All references to the present Lean source mean revision cc7284cf415fc2a773f00d400319ef39663c277a. The seven selected declarations are registered in Palomar as PALOMAR-2026-08-29-000003, version 1 [5]. The mathematical core is the following finite statement.
Theorem 1.1. There is a seven-vertex, nine-arc single-source instance with three demands and a feasible fractional flow of cost 58, with , such that every unsplittable routing satisfying on every arc has cost at least 60. Consequently neither the weak cost-preserving assertion nor its strict variant holds universally.
The selected formal theorem proves this over . Its graph-path classification ensures that the finite route model covers every source-to-terminal path in the actual graph. The corresponding real-valued counterexample follows from the same integer data and finite inequalities. That interpretation is explained below; a general rational-to-real transfer theorem is not part of this snapshot.
The finite path flow interface
The generic structure PathFlowInstance has commodity, route, and arc carrier types . It records an admissibility predicate , demands , capacities , costs , and an incidence predicate . The generic interface is an abstract incidence model: graph endpoints and path validity are established separately for the concrete witness. With finite and , fractional route amounts induce
The latter sum requires finite . The maximum demand additionally requires nonempty and is the maximum of the finite demand image.
Definition 2.1. An instance is well formed if every demand is positive, every commodity has an admissible route, and every capacity and cost is nonnegative. A fractional routing is feasible if the instance is well formed, , inadmissible routes have amount zero, for every , and for every .
An unsplittable routing is a function with for every . Its arc load and cost are
The definitions weakDggRounding and strictDggRounding combine admissibility, the corresponding congestion inequality relative to , and . Their existential versions quantify over . The reference load is the specified fractional flow, not an arbitrary capacity upper bound. In this witness on every arc, so the two numerical formulations coincide.
The finite universal negation in the registered theorem uses the specific carrier types with three commodities, two route choices, and nine arcs. It is already enough to contradict an assertion quantified over all graph instances, because the witness is realized by a genuine graph and its routes are exhaustive. The code does not establish a generic equivalence between arbitrary incidence structures and graphs.
The graph and the fractional witness
Let
The directed arcs and all numerical data are given in Table 1. Figure 1 draws the same endpoint relation. The terminal vertices have no outgoing arcs. The ordering places every arc forward, so the graph is acyclic. All endpoints are distinct on each arc, and no ordered endpoint pair is repeated. These observations are immediate properties of the data; separate generic graph simplicity or acyclicity theorems are not selected in this formalization.
| Arc | Capacity | Fractional load | Unit cost |
| 10 | 10 | 2 | |
| 6 | 6 | 3 | |
| 24 | 24 | 0 | |
| 14 | 14 | 0 | |
| 10 | 10 | 2 | |
| 5 | 5 | 0 | |
| 9 | 9 | 0 | |
| 4 | 4 | 0 | |
| 5 | 5 | 0 |
Table 1. The complete arc data. The displayed fractional load equals capacity.

Figure 1. The seven vertices and nine arcs. Numerical labels are in Table 1; the drawing asserts only the endpoint relation.
For each terminal there is one paid route and one free route :
Here vertex lists abbreviate the consecutive directed arcs. The names paid and free refer to total route cost, not to disjointness: and both use .
Lemma 3.1. Every directed source-to- path is exactly or .
Proof. From a nonempty path goes directly to or and then stops. From it goes to or to ; from it goes to or to ; from it goes to , , or . Following these alternatives gives precisely the six displayed terminal paths. There are no additional continuations from any terminal.
The formal predicate edgePath is recursive on a list of arcs. It checks each tail against the current vertex, advances to the head, and accepts the empty list exactly when the current and final vertices agree. It does not assume vertex simplicity. The proof classifies all such lists from each terminal, then from , and obtains allSourceTerminalPaths. Thus no longer walk, omitted splice, or additional source-to-terminal route escapes the two-choice model.
The fractional route amounts are
| 1 | 10 | 5 | 15 |
| 2 | 6 | 4 | 10 |
| 3 | 10 | 5 | 15 |
Table 3.
They are all nonnegative and meet the three demands. Summing their incidences gives Table 1, proving feasibility and saturation. For example the backbone loads are on , on , and on . As an arc-flow check, the source outflow is ; conservation at is respectively , , and . The terminal inflows are 15, 10, 15. Only three arcs have positive cost, so
The corresponding Lean facts are fractionalLoadEqCapacity, splitFlowFeasible, fractionalCostValue, and counterexampleMaximumDemand.
The obstruction to cost preserving rounding
Let be 1 if selects , and 0 if it selects . Every paid route contributes 30: its cost is respectively , , or . Every free route contributes zero. Hence
The crucial shared-arc loads are
The constant 15 in comes from terminal on either route.
Lemma 4.1. If on every arc, then at most one free route is selected, and at least two paid routes are selected.
Proof. If are selected, then . If are selected, then . If are selected, then . Any selection of at least two free routes contains one of these pairs, so it violates a congestion inequality.
Proof of Theorem 1.1. The preceding fractional witness is feasible and has cost 58. By Lemma 3.1, every unsplittable graph routing is represented by the three binary choices. Lemma 4.1 and (5) give for any weakly bounded routing. Thus no routing can satisfy both inequalities in (1). A strict congestion bound implies the weak bound, so the strict cost-preserving assertion fails as well.
Table 2 is an exhaustive numerical cross-check. Its excess column means , so weak congestion feasibility is exactly excess at most 15. All four feasible assignments actually have excess strictly below 15. This also shows that the obstruction is the cost requirement, rather than a lack of any bounded routing.
| Cost | Maximum excess | Bound | |||
| 90 | 5 | Yes | |||
| 60 | 10 | Yes | |||
| 60 | 6 | Yes | |||
| 30 | 16 | No | |||
| 60 | 10 | Yes | |||
| 30 | 16 | No | |||
| 30 | 16 | No | |||
| 0 | 26 | No |
Table 2. All eight routing assignments, computed from the arc incidences.
For example has loads, in the arc order of Table 1,
Every load is strictly below , and its cost is 60. Thus 60 is the exact minimum under either congestion reading. This attainment check and the full table are elementary consequences of the displayed data; the pinned selected Lean result asserts the lower bound, not a separately packaged optimum-attainment theorem. The all-free routing has cost zero and maximum excess 26, illustrating that cost alone is also satisfiable. The example makes no claim against rounding guarantees allowing larger additive error, such as .
The Lean proof and its verification boundary
The development uses Lean 4 [1] and Mathlib [10]. The graph, route lists, rational amounts, loads, and predicates are in Definitions.lean. The substantive proofs are in Proof.lean. Finite carrier instances explicitly list the three commodities, two route choices, and nine arcs. This permits finite sums to simplify to exact rational expressions.
Path completeness is proved structurally, not stipulated by making all binary choices admissible. In the concrete instance both choices are declared admissible, but routeEdgesValid proves their graph validity and allSourceTerminalPaths proves completeness for arbitrary arc lists. This separation is essential: an incidence-table counterexample would otherwise leave open whether the real graph admits an unlisted cheap routing.
The arithmetic proof first identifies the finite universes. It uses simp and norm_num for well-formedness, demand sums, capacity saturation, maximum demand, and fractional cost. The three backbone-load formulas and unsplittableCostEqPaidCount are proved by cases on the three route choices. In boundedRoutingHasTwoPaid, the hypotheses for , , are extracted; each of the eight cases reduces to rational arithmetic, and linarith closes the impossible ones. Coercing the paid-count bound to yields boundedUnsplittableCost. The remaining witness and universal negations instantiate the property at the concrete instance and combine .
The statement surface Challenge.lean repeats the definitions and states seven targets with deliberate sorry bodies. It is an interface for statement comparison, not the completed proof. Solution.lean imports DinitzGargGoemans.Proof, whose import chain goes through Definitions rather than Challenge. The inspected implementation files contain no sorry, admit, native_decide, or custom axiom declaration. A textual inspection by itself does not establish the transitive axiom footprint.
The pinned comparator configuration selects the seven theorems named in the registry and ten load, cost, feasibility, rounding, and witness definitions. It permits only propext, Quot.sound, and Classical.choice, and enables NanoDa checking. The registry records successful historical mechanical verification on August 28, 2026, under Lean v4.33.0; the Mathlib manifest resolves to db584cd6d46c92f209a44c0f1c829460d327499d. Its linked workflow is run 33131019615 [5]. These are historical verification records, not a new kernel or comparator run performed during manuscript preparation.
The boundary of the formal result is therefore explicit. It is a finite rational counterexample with exhaustive graph-path coverage and exact cost separation. Interpretation as an ordinary real-valued graph-flow counterexample uses the same integer incidence and arithmetic, and does not require choosing any irrational route amounts: the routing domain is still the same eight assignments. Source alignment, the conjecture’s historical attribution, and prose claims about other work are scholarly judgments outside the Lean kernel. The development does not formalize the general Dinitz–Garg–Goemans theorem, algorithmic complexity, parameterized counterexample families, or every published variant of the cost conjecture.
Provenance and reproducibility
This manuscript is a new exposition of the pinned Lean certificate. The counterexample is credited to Rybin and the GPT-5.6 Pro session he published; the prior AFP proof document remains a separate Isabelle artifact [8, 6]. No prior proof-document text or figure is reproduced here. The data tables and diagram were prepared from the inspected Lean definitions, with an independent exact-arithmetic enumeration used as a numerical cross-check. A matching enumeration is not a substitute for formal theorem verification.
The repository metadata records GPT-5 agent assistance for the historical Lean proof engineering. The present manuscript was generated primarily with OpenAI GPT-6.1 assistance for exposition, source comparison, bibliographic research, and typesetting. Arthur Freitas Ramos directed the submission and reports understanding some parts of the manuscript. No comprehensive personal line-by-line review by Arthur, or complete understanding by every listed author, is claimed. Model-assisted manuscript checks should not be read as independent human peer review.
The referenced Lean repository is licensed Apache 2.0, and the AFP entry has a BSD license. Those artifact licenses remain distinct from this manuscript’s CC BY 4.0 license. The source archive for this article contains only its LaTeX source and bibliography; it does not bundle the Lean project or the prior Isabelle document. The immutable source and registry references identify the formal artifact needed to inspect or independently reproduce the mathematical verification.
References
References
- [1]Leonardo de Moura and Sebastian Ullrich, The Lean 4 theorem prover and programming language, Automated Deduction – CADE 28, Lecture Notes in Computer Science, vol. 12699, Springer, 2021, https://doi.org/10.1007/978-3-030-79876-5_37, pp. 625–635.
- [2]Yefim Dinitz, Naveen Garg, and Michel X. Goemans, On the single-source unsplittable flow problem, Combinatorica 19 (1999), no. 1, 17–41, https://doi.org/10.1007/s004930050043.
- [3]DiscreteAlias, unsplittable-flow, Lean verification repository, 2026, Separate verification and catalogue of cost-conjecture formulations. Repository consulted October 1, 2026. https://github.com/DiscreteAlias/unsplittable-flow.
- [4]Jason Hickey, dinitz-verify, Lean verification repository, 2026, With Claude assistance; separate verification of the same finite witness. Repository consulted October 1, 2026. https://github.com/jyh/dinitz-verify.
- [5]Palomar Registry, PALOMAR-2026-08-29-000003, version 1, Immutable formalization registry record, 2026, Registered August 29, 2026. https://palomar-registry.org/entry?id=PALOMAR-2026-08-29-000003&version=1.
- [6]Arthur Freitas Ramos, David Barros Hulak, and Ruy Jose Guerra Barretto de Queiroz, A formal counterexample to the cost-preserving single-source unsplittable flow conjecture, Archive of Formal Proofs, 2026, Entry dated July 22, 2026. Isabelle/HOL formalization. https://isa-afp.org/entries/Dinitz_Garg_Goemans_Counterexample.html.
- [7]———, Lean formalization of the Dinitz–Garg–Goemans cost counterexample, Version-pinned source repository, 2026, Revision cc7284cf415fc2a773f00d400319ef39663c277a. https://github.com/Arthur742Ramos/dinitz-garg-goemans-counterexample-lean/tree/cc7284cf415fc2a773f00d400319ef39663c277a.
- [8]Dmitry Rybin, Counterexample to Dinitz conjecture, Public shared ChatGPT session, 2026, Source discovery transcript, including the complete finite certificate. https://chatgpt.com/share/6a60b2eb-0b64-83ee-9c76-7931ca1de063.
- [9]———, Counterexample to the Dinitz–Garg–Goemans cost conjecture, Public announcement on X, July 22, 2026, https://x.com/DmitryRybin1/status/2079904005652893709.
- [10]The mathlib Community, The Lean mathematical library, Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs, ACM, 2020, https://doi.org/10.1145/3372885.3373824, pp. 367–381.
- [11]Vera Traub, Laura Vargas Koch, and Rico Zenklusen, Single-source unsplittable flows in planar and bounded-genus graphs, Mathematical Programming, online first, 2026, Published July 22, 2026. Definition 1.1 and Conjecture 1.3. https://doi.org/10.1007/s10107-026-02365-x.