The exact turnpike problem in polynomial time

Contributed by Rares-Darius Buhai ↗

Version 1 / Dec 03, 2026 / CC BY 4.0

Abstract

The turnpike problem asks for all configurations of nn points on a line whose (n2)\binom{n}{2} pairwise distances form a given multiset. We allow points to coincide, a pair of coincident points contributing the distance 00, and give a deterministic algorithm that, on a list of natural numbers written in binary, outputs every finite multiset of reals with least element 00 whose multiset of pairwise distances is the list, each exactly once, in time polynomial in the length of the input. In particular, deciding whether a list of integers is the distance multiset of finitely many points on a line is in P\mathsf{P}. The classical problem, for sets of points, is the special case of lists without 00. The known exact algorithms are exponential in the worst case or polynomial only in the size of the largest distance. A solution is encoded by the polynomial PP whose coefficients are the multiplicities of its points, and the input determines the product hh of PP with its reversal P#P^{\#}, a polynomial of possibly exponential degree with few nonzero coefficients. A semidefinite system built from these coefficients certifies that a differential b(x) dx/(xh(x))b(x)\,dx/(xh(x)) has only simple poles, with real residues. The ellipsoid method and lattice basis reduction restrict the system to a subspace that keeps every integral solution vector, and yield a rational space WW of such polynomials bb that contains, for every solution, the polynomial bPb_P with bP/(xh)=(log⁡(P/P#))′b_P/(xh)=(\log(P/P^{\#}))'. The residues of WW generate a totally real number field, and an elementary bound on the number of nonreciprocal factors over totally real fields shows that dim⁡W=O(log⁡n)\dim W=O(\log n) and that the residues at dim⁡W\dim W roots of hh of total multiplicity O(log⁡n)O(\log n) separate WW. At a root of multiplicity ee, the order of vanishing of PP is one of 0,…,e0,\dots,e, which gives a polynomial equation of degree e+1e+1 for the coordinates of bPb_P in WW. We derive these equations from the sparse data by linear algebra, without computing any root, and read off the polynomials bPb_P of all solutions from the integer eigenvalues of a multiplication matrix of polynomial size. Both results are formalized in Lean 4 and checked with only the standard axioms.

Author comments: 36 pages. The results are formalized in Lean 4 and registered in the Palomar registry as PALOMAR-2026-12-03-000064; the formalization is at https://github.com/raresbuhai/ai-papers-lean-turnpike.

Provenance statement

How it was produced. Prompted by Rares-Darius Buhai, GPT-6.2 Astra (OpenAI) found the results and proved them in preliminary manuscripts, which are not published. Claude Opus 5.5 (Anthropic), working as an agent in Claude Code, formalized the results in Lean 4 with Mathlib and CSLib, filling gaps and in places changing the arguments, and then wrote this paper from the formalization. The text of the paper was written by Claude Opus 5.5. How it was checked. Both main results, Theorem 1.1 (the enumeration algorithm) and Corollary 1.2 (the decision problem is in P), are proved in Lean 4 using only the standard axioms. The statements are in a self-contained Challenge file that imports only Mathlib and CSLib. Lean's comparator tool checks that the proofs establish exactly those statements, and three independent kernels (Lean's, NanoDa and con-ron) accept the proofs. The formalization is registered in the Palomar registry as PALOMAR-2026-12-03-000064, version 1; the registry's automated editorial review found no blocking problem. The source is at https://github.com/raresbuhai/ai-papers-lean-turnpike. Human understanding. Rares-Darius Buhai has read the statements of the results and the overview of the proof, and understands the high-level strategy of the proof but has not checked its technical details.

Formalizations

Tools used

OpenAI
ChatGPTVersion 6.2 Astra
Anthropic
Claude OpusVersion 5.5

References

  1. S. Arora and B. Barak. Computational Complexity: A Modern Approach . Cambridge University Press, 2009.
  2. A. Bekir and S. W. Golomb. There are no further counterexamples to S . P iccard's theorem. IEEE Transactions on Information Theory , 53(8):2864--2867, 2007.
  3. R. S. Bird. A simple division-free algorithm for computing determinants. Information Processing Letters , 111(21--22):1072--1074, 2011.
  4. G. S. Bloom. A counterexample to a theorem of S . P iccard. Journal of Combinatorial Theory, Series A , 22(3):378--379, 1977.
  5. J. M. Borwein and H. Wolkowicz. Facial reduction for a cone-convex programming problem. Journal of the Australian Mathematical Society, Series A , 30:369--380, 1981.
  6. M. Cieliebak and S. Eidenbenz. Measurement errors make the partial digest problem NP -hard. In LATIN 2004: Theoretical Informatics , volume 2976 of LNCS , pages 379--390. Springer, 2004.
  7. M. Cieliebak, S. Eidenbenz, and P. Penna. Noisy data make the partial digest problem NP -hard. In Algorithms in Bioinformatics (WABI 2003) , volume 2812 of LNCS , pages 111--123. Springer, 2003.
  8. M. Cieliebak, S. Eidenbenz, and P. Penna. Partial digest is hard to solve for erroneous input data. Theoretical Computer Science , 349(3):361--381, 2005.
  9. T. Dakić. On the Turnpike Problem . PhD thesis, Simon Fraser University, 2000.
  10. A. Daurat, Y. Gérard, and M. Nivat. The chords' problem. Theoretical Computer Science , 282(2):319--336, 2002.
Show all 38 referencesShow fewer references
  1. A. Daurat, Y. Gérard, and M. Nivat. Some necessary clarifications about the chords' problem and the partial digest problem. Theoretical Computer Science , 347(1--2):432--436, 2005.
  2. J. Edmonds. Systems of distinct representatives and linear algebra. Journal of Research of the National Bureau of Standards, Section B , 71B(4):241--245, 1967.
  3. C. S. Elder, G. Marçais, and C. Kingsford. Turnpike with uncertain measurements: triangle-equality ILP with a deterministic recovery guarantee. arXiv:2603.18283, 2026.arXiv
  4. M. Grötschel, L. Lovász, and A. Schrijver. Geometric Algorithms and Combinatorial Optimization , volume 2 of Algorithms and Combinatorics . Springer, second corrected edition, 1993.
  5. S. Huang and I. Dokmanić. Reconstructing point sets from distance distributions. IEEE Transactions on Signal Processing , 69:1811--1827, 2021.
  6. K. Jaganathan and B. Hassibi. Reconstruction of integers from pairwise distances. In IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP) , pages 5974--5978, 2013.
  7. N. C. Jones and P. A. Pevzner. An Introduction to Bioinformatics Algorithms . MIT Press, 2004.
  8. L. G. Khachiyan. A polynomial algorithm in linear programming. Doklady Akademii Nauk SSSR , 244(5):1093--1096, 1979. English translation in Soviet Mathematics Doklady 20:191--194, 1979.
  9. L. de Moura and S. Ullrich. The L ean 4 theorem prover and programming language. In Automated Deduction -- CADE 28 , volume 12699 of LNCS , pages 625--635. Springer, 2021.
  10. A. K. Lenstra, H. W. Lenstra, Jr., and L. Lovász. Factoring polynomials with rational coefficients. Mathematische Annalen , 261(4):515--534, 1982.
  11. P. Lemke, S. S. Skiena, and W. D. Smith. Reconstructing sets from interpoint distances. DIMACS Technical Report 2002-37, 2002.
  12. P. Lemke, S. S. Skiena, and W. D. Smith. Reconstructing sets from interpoint distances. In B. Aronov, S. Basu, J. Pach, and M. Sharir, editors, Discrete and Computational Geometry: The Goodman--Pollack Festschrift , volume 25 of Algorithms and Combinatorics , pages 597--631. Springer, 2003.
  13. P. Lemke and M. Werman. On the complexity of inverting the autocorrelation function of a finite integer sequence, and the problem of locating nn points on a line, given the (n2)\binom n2 unlabelled distances between them. IMA Preprint Series 453, Institute for Mathematics and its Applications, University of Minnesota, 1988.
  14. D. A. Marcus. Number Fields . Universitext. Springer, second edition, 2018.
  15. The mathlib Community. The L ean mathematical library. In Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP 2020) , pages 367--381, 2020.
  16. A. L. Patterson. A F ourier series method for the determination of the components of interatomic distances in crystals. Physical Review , 46(5):372--376, 1934.
  17. A. L. Patterson. Homometric structures. Nature , 143:939--940, 1939.
  18. A. L. Patterson. Ambiguities in the X -ray analysis of crystal structures. Physical Review , 65(5--6):195--201, 1944.
  19. S. Piccard. Sur les ensembles de distances des ensembles de points d'un espace euclidien , volume 13 of Mémoires de l'Université de Neuchâtel . Secrétariat de l'Université, Neuchâtel, 1939.
  20. G. Pandurangan and H. Ramesh. The restriction mapping problem revisited. Journal of Computer and System Sciences , 65(3):526--544, 2002.
  21. M. V. Ramana. An exact duality theory for semidefinite programming and its complexity implications. Mathematical Programming , 77(1):129--162, 1997.
  22. J. Rosenblatt and P. D. Seymour. The structure of homometric sets. SIAM Journal on Algebraic and Discrete Methods , 3(3):343--350, 1982.
  23. W. Rudin. Functional Analysis . McGraw-Hill, second edition, 1991.
  24. A. Schinzel. On the product of the conjugates outside the unit circle of an algebraic number. Acta Arithmetica , 24(4):385--399, 1973.
  25. A. Schinzel. Addendum to the paper `` O n the product of the conjugates outside the unit circle of an algebraic number''. Acta Arithmetica , 26:329--331, 1975.
  26. S. S. Skiena and G. Sundaram. A partial digest approach to restriction site mapping. Bulletin of Mathematical Biology , 56(2):275--294, 1994.
  27. S. S. Skiena, W. D. Smith, and P. Lemke. Reconstructing sets from interpoint distances (extended abstract). In Proceedings of the 6th Annual Symposium on Computational Geometry (SCG '90) , pages 332--339. ACM, 1990.
  28. Z. Zhang. An exponential example for a partial digest mapping algorithm. Journal of Computational Biology , 1(3):235--239, 1994.

Version history

  1. v1 · 36 pagesSubmitted by Rares-Darius Buhai36 pages. The results are formalized in Lean 4 and registered in the Palomar registry as PALOMAR-2026-12-03-000064; the formalization is at https://github.com/raresbuhai/ai-papers-lean-turnpike.CurrentDec 03, 2026