\documentclass[11pt]{article} \input{preamble} % Macros of this paper (not in the shared preamble). \numberwithin{equation}{section} \newcommand{\Req}{\mathcal{R}} \newcommand{\cS}{\mathcal{S}} \newcommand{\cI}{\mathcal{I}} \newcommand{\cG}{\mathcal{G}} \newcommand{\cN}{\mathcal{N}} \newcommand{\cM}{\mathcal{M}} \newcommand{\coef}[2]{[#1]\,#2} \DeclareMathOperator{\adj}{adj} \DeclareMathOperator{\ord}{ord} \newcommand{\Tz}{T_0} \title{The exact turnpike problem in polynomial time% \thanks{Written by AI models, prompted by Rares-Darius Buhai. GPT-6.2 Astra (OpenAI) found the results and first proved them; Claude Opus 5.5 (Anthropic) formalized them in Lean~4, filling gaps and in places changing the arguments, and wrote this paper. The formalization is at \url{https://github.com/raresbuhai/ai-papers-lean-turnpike} and is registered in the Palomar registry as PALOMAR-2026-12-03-000064, \url{https://palomar-registry.org/entry.html?id=PALOMAR-2026-12-03-000064&version=1}.}} \author{} \date{} % There is no author entry: typeset only the title (with its footnote) above the abstract. \makeatletter \renewcommand{\@maketitle}{\newpage\null\vskip 2em \begin{center}{\LARGE \@title\par}\end{center}\par\vskip 1em} \makeatother \begin{document} \maketitle \begin{abstract} The turnpike problem asks for all configurations of $n$ points on a line whose $\binom n2$ pairwise distances form a given multiset. We allow points to coincide, a pair of coincident points contributing the distance $0$, and give a deterministic algorithm that, on a list of natural numbers written in binary, outputs every finite multiset of reals with least element $0$ 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 $\classP$. The classical problem, for sets of points, is the special case of lists without $0$. 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 $P$ whose coefficients are the multiplicities of its points, and the input determines the product $h$ of $P$ with its reversal $\rev 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))$ 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 $W$ of such polynomials $b$ that contains, for every solution, the polynomial $b_P$ with $b_P/(xh)=(\log(P/\rev P))'$. The residues of $W$ 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)$ and that the residues at $\dim W$ roots of $h$ of total multiplicity $O(\log n)$ separate $W$. At a root of multiplicity $e$, the order of vanishing of $P$ is one of $0,\dots,e$, which gives a polynomial equation of degree $e+1$ for the coordinates of $b_P$ in $W$. We derive these equations from the sparse data by linear algebra, without computing any root, and read off the polynomials $b_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. \end{abstract} \section{Introduction}\label{sec:intro} For a finite multiset $X$ of reals, listed with repetitions as $x_1,\dots,x_k$, let \[ \Delta(X)=\ms{\,\abs{x_i-x_j} : 1\le i0$, then $\coef{x^{2L}}h=\coef{x^0}h$ is the number of entries equal to $L$, and if $L=0$, then $h$ is the constant $n+2N$. So the roots of $h$ are nonzero, and they exist only if $L>0$. Moreover $\alpha\mapsto1/\alpha$ permutes the roots of $h$ and preserves multiplicities: if $h=(x-\alpha)^eg$ with $\alpha\ne0$, then $h(x)=x^{2L}h(1/x)=(-\alpha)^e(x-1/\alpha)^e\cdot x^{2L-e}g(1/x)$, and $x^{2L-e}g(1/x)$ is a polynomial since $\deg g=2L-e$; so $1/\alpha$ has multiplicity at least that of $\alpha$, and by symmetry the same. \paragraph{Realizing polynomials.} A polynomial $P\in\Z[x]$ is \emph{realizing} (for $D$) if its coefficients are nonnegative, $P(0)>0$, $\deg P=L$, $P(1)=n$ and $P\rev P=h$. Its \emph{sites} are the $u$ with $\coef{x^u}P>0$, and $\coef{x^u}P$ is the \emph{multiplicity} of the site $u$; the \emph{site list} of $P$ is the nondecreasing list in which every $u$ occurs $\coef{x^u}P$ times. There are finitely many realizing polynomials, since their coefficients lie in $\{0,\dots,n\}$ and their degree is $L$. By \cref{lem:bridge} below, every normalized realization of $D$ is the multiset of entries of the site list of a realizing polynomial. Put \begin{equation}\label{eq:bP} b_P=(\Dop P)\rev P-P\,\Dop\rev P . \end{equation} A polynomial $b$ over a field of characteristic zero is \emph{centered} if $\coef{x^a}b\ne0$ implies $\coef{x^a}h\ne0$, if $\coef{x^a}b=\coef{x^{2L-a}}b$ for $0\le a\le2L$, and if $\coef{x^0}b=\coef{x^{2L}}b=0$. A centered $b$ has degree less than $2L$ and satisfies $x^{2L}b(1/x)=b(x)$. The centered polynomials form a vector space. \paragraph{Residues.} Let $\alpha\in\C$ be a root of $h$ of multiplicity $e\ge1$ (so $L>0$ and $\alpha\ne0$) and write $h=(x-\alpha)^eh_1$ with $h_1(\alpha)\ne0$. We say that $b\in\C[x]$ \emph{has residue $\rho\in\C$ at $\alpha$} if \begin{equation}\label{eq:hasres} (x-\alpha)^e\ \text{divides}\ b-\rho\,\frac{x\,h}{x-\alpha}=b-\rho\,x(x-\alpha)^{e-1}h_1 . \end{equation} Then $(x-\alpha)^{e-1}$ divides $b$. Conversely, if $b=(x-\alpha)^{e-1}b_1$, then $b-\rho x(x-\alpha)^{e-1}h_1=(x-\alpha)^{e-1}(b_1-\rho xh_1)$, so $b$ has residue $\rho$ at $\alpha$ exactly for \[ \rho=\res_\alpha(b):=\frac{b_1(\alpha)}{\alpha\,h_1(\alpha)} . \] In terms of the differential $\omega_b=b(x)\,dx/(x\,h(x))$: since $b/(xh)=b_1/(xh_1\cdot(x-\alpha))$, $b$ has a residue at $\alpha$ if and only if $\omega_b$ has at most a simple pole at $\alpha$, and then $\res_\alpha(b)$ is the residue of $\omega_b$ at $\alpha$. Condition~\eqref{eq:hasres} is linear in the pair $(b,\rho)$: the polynomials that have a residue at $\alpha$ form a subspace of $\C[x]$, on which $\res_\alpha$ is linear, and $b$ has residue $0$ at $\alpha$ if and only if $(x-\alpha)^e$ divides $b$. We say that $b$ has \emph{simple real residues} if at every root $\alpha$ of $h$ it has a residue and $\res_\alpha(b)\in\R$. The centered polynomials in $\Q[x]$ with simple real residues form a $\Q$-vector space. If $b\in\C[x]$ has degree less than $2L$ and residue $0$ at every root of $h$, then $b=0$: the polynomials $(x-\alpha)^{\ord_\alpha h}$, over the distinct roots $\alpha$ of $h$, are pairwise coprime and all divide $b$, so their product $h/c_L$ divides $b$, and $\deg h=2L>\deg b$. \subsection{Realizing polynomials} \begin{lemma}[Realizations as polynomials]\label{lem:bridge} Let $X$ be a normalized realization of $D$. Then $X$ consists of $n$ natural numbers, counted with multiplicity, and the polynomial $P_X=\sum_um_ux^u$, where $m_u$ is the multiplicity of $u$ in $X$, is realizing. Its site list is the nondecreasing list of the points of $X$, each repeated according to its multiplicity. \end{lemma} \begin{proof} We saw that $X$ consists of natural numbers. List $X$ as $x_1,\dots,x_k$ with repetitions. Then $N=\binom k2$ and $k\ge1$, so $k=n$. If $\max X>0$, the distance from an occurrence of $\max X$ to one of $0$ is $\max X$, and all distances are at most $\max X-0$; if $\max X=0$, all distances are $0$. In both cases $\max X=L$. Thus $P_X$ has nonnegative integer coefficients, $P_X(0)=m_0>0$, $\deg P_X=L$ and $P_X(1)=k=n$. Moreover $\rev P_X=\sum_jx^{L-x_j}$, and \[ P_X\rev P_X=\sum_{i,j=1}^kx^{L+x_i-x_j}=k\,x^L+\sum_{1\le i0$, the coefficients of $\rev P$ are $\coef{x^v}\rev P=p_{L-v}\ge0$ for $0\le v\le L$, and $c_L=p_0p_L$. The coefficients of $h$ are nonnegative and $h(1)=n^2$. \item $s_0=\sum_up_u^2$. \item The sites of $P$ and of $\rev P$ lie in $C$. \item $b_P$ is centered. \item $b_P+\Dop h=2(\Dop P)\rev P$. \item If $L=0$, then $P$ is the constant $n$, and its site list consists of $n$ zeros. \end{enumerate} \end{lemma} \begin{proof} (a) The leading coefficient $p_L$ of $P$ is nonzero and nonnegative. The formula for the coefficients of $\rev P$ is the definition, as $\deg P=L$. Then $c_L=h(0)=P(0)\rev P(0)=p_0p_L$, and $h(1)=P(1)\rev P(1)=P(1)^2=n^2$. (b) The coefficient of $x^L$ in $P\rev P=\sum_{u,v}p_up_vx^{L+u-v}$ is $\sum_up_u^2$, and in $h$ it is $s_0$. (c) Let $p_u>0$ with $00$ the coefficient of $x^{L+c}$ in $h$ is the number of entries of $D$ equal to $c$, and in $P\rev P$ it is $\sum_{s-t=c}p_sp_t$, a sum of nonnegative terms. The terms $(s,t)=(u,0)$ and $(L,u)$ are positive, so $u\in D$ and $L-u\in D$, and $u\in C$. The sites of $\rev P$ are the $L-u$ for the sites $u$ of $P$, and $L-C=C$. (d) Since $\Dop\rev P=\sum_v(L-v)p_vx^{L-v}$, \[ b_P=\sum_{u,v}p_up_v\bigl(u-(L-v)\bigr)x^{L+u-v}=\sum_{u,v}p_up_v(u+v-L)\,x^{L+u-v}. \] If $\coef{x^a}b_P\ne0$, some pair $(u,v)$ with $p_up_v>0$ has $L+u-v=a$, and then $\coef{x^a}h=\coef{x^a}{(P\rev P)}\ge p_up_v>0$. Exchanging $u$ and $v$ maps the exponent $a$ to $2L-a$ and keeps the weight $u+v-L$, so the coefficients at $a$ and $2L-a$ agree. The exponent $0$ forces $(u,v)=(0,L)$ and the exponent $2L$ forces $(u,v)=(L,0)$, both of weight $0$. (e) $\Dop h=\Dop(P\rev P)=(\Dop P)\rev P+P\,\Dop\rev P$; add $b_P$. (f) If $L=0$ then $\deg P=0$, so $P=P(1)=n$. \end{proof} \subsection{Residues} \begin{lemma}[Residues]\label{lem:resprops} Let $\alpha$ be a root of $h$. \begin{enumerate}[label=\textup{(\alph*)}] \item \textup{(Conjugation.)} Let $b\in\Q[x]$ have a residue at $\alpha$, let $E\subseteq\C$ be a subfield containing $\alpha$, and let $\psi:E\to\C$ be a field homomorphism. Then $\res_\alpha(b)\in\Q(\alpha)$, $\psi(\alpha)$ is a root of $h$ of the same multiplicity, $b$ has a residue at $\psi(\alpha)$, and $\res_{\psi(\alpha)}(b)=\psi(\res_\alpha(b))$. \item \textup{(Inversion.)} Let $b\in\C[x]$ have degree at most $2L$ and satisfy $x^{2L}b(1/x)=b(x)$. If $b$ has residue $\rho$ at $\alpha$, then it has residue $-\rho$ at $1/\alpha$. \end{enumerate} \end{lemma} \begin{proof} (a) Let $e$ be the multiplicity of $\alpha$. Division by the monic polynomials $(x-\alpha)^{e-1}$ and $(x-\alpha)^e$ in $\Q(\alpha)[x]$ gives $b=(x-\alpha)^{e-1}b_1$ and $h=(x-\alpha)^eh_1$ with $b_1,h_1\in\Q(\alpha)[x]$ and $h_1(\alpha)\ne0$, so $\res_\alpha(b)=b_1(\alpha)/(\alpha h_1(\alpha))\in\Q(\alpha)$. Apply $\psi$ to the coefficients; it fixes those of $b$ and $h$, so $b=(x-\psi(\alpha))^{e-1}\psi(b_1)$ and $h=(x-\psi(\alpha))^e\psi(h_1)$, with $\psi(h_1)(\psi(\alpha))=\psi(h_1(\alpha))\ne0$. Hence $\psi(\alpha)$ has multiplicity $e$, and $\res_{\psi(\alpha)}(b)=\psi(b_1(\alpha))/(\psi(\alpha)\psi(h_1(\alpha)))=\psi(\res_\alpha(b))$. (b) We have $\alpha\ne0$ and $x^{2L}h(1/x)=h(x)$. Let $F(x)=b(x)/(xh(x))$, a rational function. For $y\ne0$, $F(1/y)=y\,b(1/y)/h(1/y)=y\cdot y^{-2L}b(y)/(y^{-2L}h(y))=y^2F(y)$. Near $\alpha$ we have $F(x)=\rho/(x-\alpha)+g(x)$ with $g$ holomorphic at $\alpha$, so for $y$ near $1/\alpha$ \[ F(y)=\frac1{y^2}\Bigl(\frac\rho{1/y-\alpha}+g(1/y)\Bigr) =-\frac{\rho}{\alpha y}\cdot\frac1{y-1/\alpha}+\frac{g(1/y)}{y^2}, \] and $1/(\alpha y)=1+O(y-1/\alpha)$. So $F$ has at most a simple pole at $1/\alpha$ with residue $-\rho$, which is the claim. \end{proof} For a realizing polynomial $P$, \cref{lem:realizing}(e) gives $(b_P+\Dop h)/(2xh)=P'/P$, whose residue at a root $\alpha$ of $h$ is $\ord_\alpha P$; and $b_P/(xh)=P'/P-(\rev P)'/\rev P$, so $b_P$ has the integer residues $\ord_\alpha P-\ord_\alpha\rev P$. Real residues do not characterize the polynomials $b_P$, however: \begin{remark}[Real residues are not enough]\label{rem:example} Let $D$ be the distance multiset of the multiset $\{0,1,1,1,2\}$, that is, three entries $0$, six entries $1$ and one entry $2$. Then $n=5$, $L=2$, $h=x^4+6x^3+11x^2+6x+1=P^2$ for $P=1+3x+x^2=\rev P$, and $P$ is the only realizing polynomial: $p_0p_2=c_L=1$ forces $p_0=p_2=1$, and then $P(1)=5$ forces $p_1=3$. So $b_P=(\Dop P)P-P\,\Dop P=0$ is the only polynomial $b_P$. But $b=xP=x+3x^2+x^3$ is centered, and $b/(xh)=1/P$ has simple poles at the roots $(-3\pm\sqrt5)/2$ of $P$, with the real residues $1/P'(\alpha)=\pm1/\sqrt5$. So real residues do not single out the rational span of the polynomials $b_P$, and the space $W$ of \cref{sec:span} has to be analyzed directly. \end{remark} \section{A semidefinite system for the residues}\label{sec:lift} We keep the notation of \cref{sec:poly}. Let $I=C\times C$ and $m=\abs I=\abs C^2$; for $i=(u,v)\in I$ let $q_i(z,w)=z^uw^v$. For a field $K$ of characteristic zero and a matrix $G\in K^{I\times I}$ define the polynomials \begin{align*} N_G(z,w)&=\sum_{i=(u,v)\in I}\ \sum_{j=(s,t)\in I}G_{ij}\,z^{u+t}w^{v+s},\\ J_G(z,w)&=\sum_{i=(u,v)\in I}\ \sum_{j=(s,t)\in I}(u-t)\,G_{ij}\,z^{u+t}w^{v+s},\\ b_G(z)&=J_G(z,0)=\sum_{i=(u,0)\in I}\ \sum_{j=(0,t)\in I}(u-t)\,G_{ij}\,z^{u+t}. \end{align*} Let $\cA=\cA(K)$ be the affine set of symmetric $G\in K^{I\times I}$ with \begin{equation}\label{eq:system} N_G(z,w)=h(z)h(w),\qquad c_L\,J_G(z,w)=b_G(z)\,h(w),\qquad \tr G=s_0^2,\qquad b_G\ \text{centered}. \end{equation} All conditions are linear in $G$ with rational coefficients, so a rational matrix lies in $\cA(\Q)$ if and only if it lies in $\cA(\R)$. We put $\Tz=s_0^2$. Setting $w=0$ in the second identity gives $c_Lb_G(z)=b_G(z)h(0)$, which holds since $c_L=h(0)$; the factor $c_L$ is there because the matrix of a realizing polynomial $P$ has $b_G=c_Lb_P$ rather than $b_P$ (\cref{lem:system}). The pair $(i,j)$ contributes the product $q_i(z,w)\,q_j(w,z)$ to $N_G$; writing $D_z=z\partial_z$, it contributes $(D_zq_i)(z,w)\,q_j(w,z)-q_i(z,w)\,D_z\bigl(q_j(w,z)\bigr)$ to $J_G$. So if $G=\sum_\ell r_\ell r_\ell^\top$ with $r_\ell\in K^I$ and $R_\ell=\sum_i(r_\ell)_iq_i$, then \begin{equation}\label{eq:NJ-squares} N_G=\sum_\ell R_\ell(z,w)R_\ell(w,z),\qquad J_G=\sum_\ell\Bigl((D_zR_\ell)(z,w)\,R_\ell(w,z)-R_\ell(z,w)\,D_z\bigl(R_\ell(w,z)\bigr)\Bigr). \end{equation} \begin{lemma}[The system]\label{lem:system} \begin{enumerate}[label=\textup{(\alph*)}] \item There is an algorithm that, given $D$, computes in polynomial time a list of rational affine equations in the entries of $m\times m$ matrices with the following property. Index $I$ by $\{1,\dots,m\}$ through the lexicographic order of $C\times C$. Over every field $K$ of characteristic zero, a symmetric $G\in K^{m\times m}$ with $\tr G=\Tz$ satisfies the equations if and only if $G\in\cA(K)$. \item Let $P$ be a realizing polynomial and define $v_P\in\N^I$ by $(v_P)_{(u,v)}=\coef{x^u}P\cdot\coef{x^v}\rev P$. Then $v_Pv_P^\top\in\cA(\Q)$, $b_{v_Pv_P^\top}=c_Lb_P$, and $\norm{v_P}^2=\Tz$. \end{enumerate} \end{lemma} \begin{proof} (a) Let $E=\{u+t:u,t\in C\}\cup\supp h$, a set of at most $\abs C^2+2N+1$ numbers, each at most $2L$. Every monomial of $N_G$ and $J_G$ has both exponents in $\{u+t:u,t\in C\}\subseteq E$, every monomial of $b_G$ has its exponent there, and $\supp h\subseteq E$. Hence the two polynomial identities of~\eqref{eq:system} hold if and only if, for all $a,b\in E$, \[ \coef{z^aw^b}N_G=\coef{x^a}h\cdot\coef{x^b}h,\qquad c_L\cdot\coef{z^aw^b}J_G=\coef{z^a}b_G\cdot\coef{x^b}h , \] and $b_G$ is centered if and only if $\coef{z^a}b_G=0$ for $a\in E$ with $\coef{x^a}h=0$, $\coef{z^a}b_G=\coef{z^{2L-a}}b_G$ for $a\in E$ with $a\le2L$, and $\coef{z^0}b_G=\coef{z^{2L}}b_G=0$ (for $a\notin E$ both sides of the symmetry condition vanish, or the condition is the one at $2L-a\in E$). Each of these conditions is an equation $\sum_{i,j\in I}\lambda_{ij}G_{ij}=\rho$, where $\lambda_{ij}$ is an integer determined by the four sites in $i$ and $j$, by $a$, $b$, $c_L$ and the coefficients of $h$, of absolute value at most $2L(c_L+\max_k\coef{x^k}h)+1$, and $\rho$ is $0$ or a product of two coefficients of $h$. There are $O(\abs E^2)$ equations with $m^2$ terms each, and all numbers involved have $O(\log(2+L)+\log(2+N))$ bits. Computing $n$, $L$, $C$ in increasing order, the nonzero coefficients of $h$, $c_L$, $s_0$ and $E$ takes polynomial time, and so does writing down the equations. (b) The sites of $P$ and $\rev P$ lie in $C$ (\cref{lem:realizing}(c)), so $R(z,w)=P(z)\rev P(w)=\sum_i(v_P)_iq_i$. By~\eqref{eq:NJ-squares} with the single vector $v_P$, \begin{align*} N_{v_Pv_P^\top}&=P(z)\rev P(w)\,P(w)\rev P(z)=h(z)h(w),\\ J_{v_Pv_P^\top}&=(\Dop P)(z)\rev P(w)\,P(w)\rev P(z)-P(z)\rev P(w)\,P(w)\,(\Dop\rev P)(z) =b_P(z)\,h(w). \end{align*} Hence $b_{v_Pv_P^\top}(z)=J_{v_Pv_P^\top}(z,0)=b_P(z)h(0)=c_Lb_P(z)$, which is centered by \cref{lem:realizing}(d), and $c_LJ_{v_Pv_P^\top}=c_Lb_P(z)h(w)=b_{v_Pv_P^\top}(z)h(w)$. Finally $\tr(v_Pv_P^\top)=\norm{v_P}^2=\sum_{u,v}(\coef{x^u}P)^2(\coef{x^v}\rev P)^2=s_0^2$ by \cref{lem:realizing}(a),(b). \end{proof} \begin{lemma}[Real residues]\label{lem:local} Suppose that $D$ has a realizing polynomial. For every real positive semidefinite $G\in\cA(\R)$, the polynomial $b_G$ has simple real residues. \end{lemma} \begin{proof} If $L=0$ then $h$ is a nonzero constant, with no roots. Let $L>0$. Write $G=\sum_{\ell}r_\ell r_\ell^\top$ with $r_\ell\in\R^I$ and put $R_\ell=\sum_i(r_\ell)_iq_i\in\R[z,w]$. By~\eqref{eq:NJ-squares} and~\eqref{eq:system}, \begin{gather} \sum_\ell R_\ell(z,w)R_\ell(w,z)=h(z)h(w),\label{eq:loc-id}\\ c_L\sum_\ell\Bigl((D_zR_\ell)(z,w)R_\ell(w,z)-R_\ell(z,w)D_z\bigl(R_\ell(w,z)\bigr)\Bigr) =b_G(z)h(w). \label{eq:loc-id2} \end{gather} Fix a root $\alpha$ of $h$ of multiplicity $e\ge1$, and write $h=(x-\alpha)^eh_1$; then $\alpha\ne0$ and $h_1(\alpha)\neq0$. We substitute $z=\alpha+s$, $w=\bar\alpha+t$ and work in $\C[s,t]$. Write \[ F_\ell(s,t)=R_\ell(\alpha+s,\bar\alpha+t)=\sum_{a,b\ge0}c_\ell(a,b)\,s^at^b,\qquad h(\alpha+s)=\sum_{k\ge e}\eta_ks^k,\quad \eta_e=h_1(\alpha)\ne0. \] Since $R_\ell$ and $h$ have real coefficients, $R_\ell(\bar\alpha+t,\alpha+s)=\widetilde F_\ell(s,t):=\sum_{a,b}\overline{c_\ell(a,b)}\,s^bt^a$ and $h(\bar\alpha+t)=\sum_k\bar\eta_kt^k$. Since $D_z=(\alpha+s)\partial_s$ after the substitution,~\eqref{eq:loc-id} and~\eqref{eq:loc-id2} become \begin{gather} \sum_\ell F_\ell\widetilde F_\ell=h(\alpha+s)\,h(\bar\alpha+t),\label{eq:loc-norm}\\ c_L\sum_\ell\Bigl((\alpha+s)(\partial_sF_\ell)\widetilde F_\ell-F_\ell\,(\alpha+s)\partial_s\widetilde F_\ell\Bigr)=b_G(\alpha+s)\,h(\bar\alpha+t).\label{eq:loc-deriv} \end{gather} In~\eqref{eq:loc-norm}, the term $c_\ell(a,b)s^at^b$ of $F_\ell$ and the term $\overline{c_\ell(a',b')}s^{b'}t^{a'}$ of $\widetilde F_\ell$ multiply to a monomial at $(a+b',b+a')$. \emph{Step 1: every $F_\ell$ vanishes to total order at least $e$.} We show by induction on $d0$ for every nonzero $x\in U$. \end{enumerate} \end{proposition} We write $\cA(\R)$ for the real solutions of the same conditions. Every $v\in\Req$ has $\norm v^2=\tr(vv^\top)=\Tz\ge1$, so $v\ne0$. The algorithm uses the constants \begin{equation}\label{eq:consts} S=(m+1)\,2^m(\Tz+1),\quad \delta=\frac1{2\bigl((m+1)S\bigr)^{m+2}},\quad a=\frac\delta8,\quad\gamma=\frac\delta{8(1+\Tz)},\quad R_0^2=\Tz+1, \end{equation} the ellipsoid method (\cref{lem:ellipsoid}), lattice basis reduction in a rational inner product (\cref{lem:lll}), exact linear algebra (\cref{lem:linalg}) and a semidefiniteness test that returns a negative direction (\cref{lem:psdtest}); these are stated in Appendix~\ref{app:tools}. \subsection{The algorithm} The state is a list $B=(b_1,\dots,b_d)$ of linearly independent vectors of $\Z^m$, initially the standard basis, and we write $U=\spanQ B$ (or its real span, as the context requires), $\Pi$ for the orthogonal projector onto $U$, and also $B$ for the $m\times d$ matrix with columns $b_i$. \begin{algorithm}[One round]\label{alg:round} Given the current list $B$: \begin{enumerate}[label=\arabic*.,leftmargin=2em] \item \emph{Projector.} Compute $\Pi=B(B^\top B)^{-1}B^\top$. \item \emph{Primal system.} The conditions $G^\top=G$, $\Pi G=G$, $\tr G=\Tz$ and $\mathcal E$ are linear equations in the $m^2$ entries of $G$; their solutions form the set $\cA_U=\{G\in\cA:G\text{ supported on }U\}$. Compute a chart of them (\cref{lem:linalg}). If there is none, stop and report $\Req=\emptyset$. Otherwise the chart is $G(t)=G_0+\sum_{l=1}^pt_lA_l$, $t\in\R^p$, where each $t_l$ is an entry of $G(t)$; the $A_l$ are symmetric, supported on $U$, and of trace $0$. Put $K=1+\sum_l\norm{A_l}_1$. \item \emph{Primal search.} Run the ellipsoid method (\cref{lem:ellipsoid}) in $\R^p$ with outer radius $p\Tz+1$, inner radius $a/(2K)$, and the following oracle for the set $K_{\mathrm P}=\{t:G(t)\PSD a\Pi\}$: at a query $c$, test $G(c)-a\Pi$ (\cref{lem:psdtest}); accept if it is positive semidefinite; otherwise, for the returned $u$ with $u^\top(G(c)-a\Pi)u<0$, let $g_l=-u^\top A_lu$, and report that the set is empty if $g=0$ and return the cut $g$ otherwise. If the search returns a point $c$, stop and output $B$ and $G_*=G(c)$. \item \emph{Dual search.} The conditions $Y^\top=Y$, $\Pi Y=Y$, $\tr Y=1$ and $\ip Y{A_l}=0$ ($l\le p$) are linear in $Y$; compute a chart $Y(s)=Y_0+\sum_{l=1}^{p'}s_lQ_l$ of them, and put $K'=1+\sum_l\norm{Q_l}_1$. Run the ellipsoid method in $\R^{p'}$ with outer radius $p'+1$, inner radius $\min\{\gamma/d,\ \delta/(4(1+\norm{G_0}_1))\}/K'$, and the following oracle for $K_{\mathrm D}=\{s:Y(s)\PSD0,\ \ip{Y(s)}{G_0}\le\delta\}$: at a query $c$, if $Y(c)$ is not positive semidefinite, cut with $g_l=-u^\top Q_lu$ as before; if it is and $\ip{Y(c)}{G_0}>\delta$, cut with $g_l=\ip{Q_l}{G_0}$ (reporting emptiness if $g=0$); otherwise accept. Let $Y_*=Y(s_*)$ for the returned point $s_*$ (it exists by \cref{lem:dualball}). \item \emph{Lattice step.} Apply \cref{lem:lll} to the positive definite rational matrix $\Gamma=B^\top(\Id+Y_*/\delta)B$; it returns a unimodular $T\in\Z^{d\times d}$ and the squared Gram--Schmidt lengths $g_1,\dots,g_d$ of the columns $w_1,\dots,w_d$ of $\widetilde B=BT$ in the inner product $\ip xy_M=x^\top My$, $M=\Id+Y_*/\delta$. Let $k$ be the largest $j$ with $g_j\le R_0^2$ ($k=0$ if there is none), and replace $B$ by $(w_1,\dots,w_k)$. \end{enumerate} \end{algorithm} The restriction algorithm runs rounds from the standard basis until a round stops. In the dual search, $Y_*$ satisfies the relaxed dual conditions \begin{equation}\label{eq:dual} Y_*^\top=Y_*,\quad \Pi Y_*=Y_*,\quad \tr Y_*=1,\quad \ip{Y_*}{A_l}=0\ (l\le p),\quad Y_*\PSD0,\quad \ip{Y_*}{G_0}\le\delta . \end{equation} The \emph{invariant} of the algorithm is: \emph{the vectors of $B$ are linearly independent, and every $v\in\Req$ is an integer combination of them.} It holds for the standard basis. \subsection{Correctness} \begin{lemma}[Separation]\label{lem:separation} Let $\Pi\ne0$ be the orthogonal projector onto a subspace $U\subseteq\R^m$, let $c\ge0$, and let $G_0,A_1,\dots,A_p$ be real symmetric matrices supported on $U$. If no $\tau\in\R^p$ satisfies $G_0+\sum_l\tau_lA_l\PSD c\Pi$, then there is a real symmetric $Y\PSD0$ supported on $U$ with $\ip Y{A_l}=0$ for all $l$, $\tr Y=1$ and $\ip Y{G_0}\le c$. \end{lemma} \begin{proof} Let $\cS_U$ be the space of real symmetric matrices supported on $U$, with the inner product $\ip XY=\tr(XY)$. Let $O\subseteq\cS_U$ be the set of $G$ such that $x^\top(G-c\Pi)x>0$ for all nonzero $x\in U$, and let $\cA_U=\{G_0+\sum_l\tau_lA_l:\tau\in\R^p\}\subseteq\cS_U$. The set $O$ is convex, open in $\cS_U$ (positivity on the unit sphere of $U$ is an open condition), and nonempty, as it contains $(c+1)\Pi$. It is disjoint from $\cA_U$: a matrix $G\in O$ satisfies $x^\top(G-c\Pi)x=(\Pi x)^\top(G-c\Pi)(\Pi x)\ge0$ for all $x$, that is $G\PSD c\Pi$. By the separation theorem for disjoint convex sets one of which is open \cite[Theorem~3.4(a)]{Rud91}, applied in the finite-dimensional space $\cS_U$, there are a linear functional $\lambda$ on $\cS_U$ and $\theta\in\R$ with $\lambda(G)<\theta\le\lambda(H)$ for all $G\in O$ and $H\in\cA_U$. Write $\lambda(G)=-\ip{Y_0}G$ with $Y_0\in\cS_U$. Since $\lambda(G_0)+\tau\lambda(A_l)\ge\theta$ for all $\tau\in\R$, $\ip{Y_0}{A_l}=0$ for every $l$, and $\ip{Y_0}G>-\theta\ge\ip{Y_0}{G_0}$ for all $G\in O$. For $x\in\R^m$ the matrix $H=\Pi xx^\top\Pi$ lies in $\cS_U$ and $(c+1)\Pi+\sigma H\in O$ for all $\sigma\ge0$; so $\ip{Y_0}{(c+1)\Pi}+\sigma\ip{Y_0}H>\ip{Y_0}{G_0}$ for all $\sigma\ge0$, whence $0\le\ip{Y_0}H=x^\top Y_0x$. So $Y_0\PSD0$, and $Y_0\ne0$ since $\lambda\ne0$ (as $O\ne\emptyset$), so $\tr Y_0>0$. Finally $(c+\tau)\Pi\in O$ for every $\tau>0$, and $\ip{Y_0}\Pi=\tr Y_0$, so $(c+\tau)\tr Y_0>\ip{Y_0}{G_0}$; letting $\tau\to0$ gives $\ip{Y_0}{G_0}\le c\tr Y_0$. Take $Y=Y_0/\tr Y_0$. \end{proof} \begin{lemma}[Supported perturbations]\label{lem:perturb} Let $H_1,\dots,H_q$ be real symmetric matrices supported on $U$ and $u\in\R^q$. Then $\abs{x^\top(\sum_lu_lH_l)x}\le\norm u_2\bigl(\sum_l\norm{H_l}_1\bigr)\,x^\top\Pi x$ for all $x\in\R^m$. \end{lemma} \begin{proof} Let $H=\sum_lu_lH_l$, supported on $U$, and $y=\Pi x$. Then $x^\top Hx=y^\top Hy$, and $\abs{y^\top Hy}\le\sum_{i,j}\abs{H_{ij}}\abs{y_i}\abs{y_j}\le\norm H_1\norm y^2$ with $\norm H_1\le\max_l\abs{u_l}\sum_l\norm{H_l}_1$ and $\norm y^2=x^\top\Pi x$. \end{proof} \begin{lemma}[The primal search]\label{lem:primal} Assume the invariant, and that the primal system of a round has a chart. \begin{enumerate}[label=\textup{(\alph*)}] \item The oracle of the primal search is a valid separation oracle for $K_{\mathrm P}$, and $K_{\mathrm P}$ lies in the ball of radius $p\Tz+1$ about the origin. \item If the search returns $c$, then $G_*=G(c)$ satisfies (ii) and (iii) of \cref{prop:restrict}, and $G_*\in\cA$. \item If the search returns no point, then no $G\in\cA_U(\R)$ satisfies $G\PSD 2a\Pi$. \end{enumerate} \end{lemma} \begin{proof} (a) Let $u$ be returned at the query $c$ and $t\in K_{\mathrm P}$. Since $u^\top G(t)u$ is affine in $t$, $u^\top(G(t)-a\Pi)u=u^\top(G(c)-a\Pi)u-g^\top(t-c)$; the left side is nonnegative and the first term on the right is negative, so $g^\top(t-c)<0$. If $g=0$, then $u^\top(G(t)-a\Pi)u<0$ for all $t$, and $K_{\mathrm P}=\emptyset$. If $t\in K_{\mathrm P}$, then $G(t)\PSD0$ and $\tr G(t)=\Tz$, so $\abs{G(t)_{ij}}\le\sqrt{G(t)_{ii}G(t)_{jj}}\le\Tz$; each $t_l$ is an entry of $G(t)$, so $\norm t_2\le p\Tz$. (b) $G_*\in\cA_U\subseteq\cA$ is rational and supported on $U$, and for $x\in U$, $x^\top G_*x\ge a\,x^\top\Pi x=a\norm x^2$. (c) Suppose $G(\tau)\PSD2a\Pi$ with $\tau\in\R^p$. If $\norm{t-\tau}_2j$; \item $H_{ii}\le g_i+\frac14\sum_{j0$, and let $C$, $h$, $s_0$, $c_L$, $\kappa$, $I$, $m=\abs C^2$, $\Tz=s_0^2$ and $\cA$ be as in \cref{sec:poly,sec:lift}. Apply \cref{prop:restrict} to the equations of \cref{lem:system}(a). If it reports $\Req=\emptyset$, then $D$ has no normalized realization: otherwise \cref{lem:bridge,lem:system}(b) give a realizing $P$ with $v_P\in\Req$. Suppose that it returns $w_1,\dots,w_k\in\Z^m$, spanning $U$, and $G_*$. Let $\cA_U(\Q)$ be the set of $G\in\cA(\Q)$ supported on $U$ (with $I$ identified with $\{1,\dots,m\}$ as in \cref{lem:system}(a)), and \[ W=\spanQ\{b_G:G\in\cA_U(\Q)\}\subseteq\Q[x]. \] \begin{proposition}[The span $W$]\label{prop:span} \begin{enumerate}[label=\textup{(\alph*)}] \item A basis of $W$, as a list of sparse polynomials, can be computed from $D$, the $w_j$ and $G_*$ in polynomial time. \item $b_P\in W$ for every realizing polynomial $P$. \item $W\subseteq\spanQ\{b_G:G\in\cA(\Q),\ G\PSD0\}$. \item If $D$ has a realizing polynomial, then every element of $W$ is centered and has simple real residues. \end{enumerate} \end{proposition} \begin{lemma}[Perturbing on the support]\label{lem:psdpert} Let $G$ be a rational symmetric matrix supported on $U$ with $x^\top Gx>0$ for all nonzero $x\in U$, and let $H$ be a rational symmetric matrix supported on $U$. Then $G\PSD0$, and $G+tH\PSD0$ for some rational $t>0$. \end{lemma} \begin{proof} Since $x^\top Gx\ne0$ for nonzero $x\in U$, Gram--Schmidt orthogonalization over $\Q$ for the bilinear form $(x,y)\mapsto x^\top Gy$ gives a basis $v_1,\dots,v_d$ of $U$ with $v_i^\top Gv_j=0$ for $i\ne j$ and $\gamma_i=v_i^\top Gv_i>0$. For a real combination $x=\sum_ic_iv_i$ we get $x^\top Gx=\sum_i\gamma_ic_i^2$, so $G$ is positive definite on the real span $U_\R$ of $U$, and by compactness $\lambda=\min\{x^\top Gx:x\in U_\R,\ \norm x=1\}>0$. Let $\mu=\max\{\abs{x^\top Hx}: x\in U_\R,\ \norm x=1\}$ and take a rational $t$ with $00$ with $G_*+tH\PSD0$; then $G_*+tH\in\cA(\Q)$ and $b_H=(b_{G_*+tH}-b_{G_*})/t$. So every generator of $W$ lies in the right side. (d) Let $G\in\cA(\Q)$ with $G\PSD0$. Then $b_G\in\Q[x]$ is centered, by the definition of $\cA$, and has simple real residues by \cref{lem:local} applied to $G$ as a real matrix. The centered polynomials in $\Q[x]$ with simple real residues form a $\Q$-vector space (\cref{sec:poly}), so by (c) it contains $W$. \end{proof} \subsection{Nonreciprocal factors over totally real fields} For a nonzero $f\in K[x]$, $K$ a field, let $\norm f=\sum_k(\coef{x^k}f)^2$ be the sum of the squares of its coefficients (for $K\subseteq\R$). If $K$ has characteristic zero, $f$ factors in $K[x]$ as a constant times a product of monic irreducible polynomials, uniquely up to order; when $f(0)\ne0$, none of these factors vanishes at $0$, and we count those that are not reciprocal, with multiplicity. \begin{theorem}[Nonreciprocal factors]\label{thm:factorbound} Let $K\subseteq\C$ be a totally real number field and $f\in\Z[x]$ with $f(x)>0$ for all real $x\ge0$, and let $r$ be the number of irreducible factors of $f$ in $K[x]$ that are not reciprocal, counted with multiplicity. Then \[ (5/4)^r\le\norm f . \] \end{theorem} The bound does not depend on $K$, and for us this is essential: the field will be generated by residues, and we have no control over its degree. For $K=\Q$, Smyth's theorem on the Mahler measure of nonreciprocal polynomials gives a bound of this kind, which Lemke, Skiena and Smith use to count homometric sets~\cite[proof of Theorem~2.11]{LSS02}, and Schinzel's Theorem~3$'$~\cite{Sch75} extends it to totally real fields with the larger base $(1+\sqrt5)/2$ in place of $5/4$ (and $\norm f/C(f)^2$ in place of $\norm f$, where $C(f)$ is the greatest common divisor of the coefficients). The weaker base suffices for us, since the proof of \cref{prop:goodroots} counts every factor twice; and the proof below is elementary. It compares the polynomials obtained from $f$ by reversing some of its nonreciprocal factors: they all have the same sum of squares of coefficients, and a Fourier expansion over the choices of reversal, together with the fact that a nonzero algebraic integer has norm at least $1$, bounds that sum from below. \begin{proof}[Proof of \cref{thm:factorbound}] Let $d=[K:\Q]$. As $K$ is totally real, every embedding $\sigma:K\to\C$ takes real values; we apply $\sigma$ to polynomials coefficientwise, and $\norm{\sigma p}$ is then defined for $p\in K[x]$. \emph{Step 1: reversing factors.} Write $f=HF_1\cdots F_r$ in $K[x]$, where $F_1,\dots,F_r$ are the monic irreducible factors that are not reciprocal, with multiplicity, and $H$ is the leading coefficient of $f$ times the product of the reciprocal ones. Since $f(0)\ne0$, $F_i(0)\ne0$, so $\rev F_i$ has the degree of $F_i$, constant term $1$, and $\rev{(\rev F_i)}=F_i$; and $\rev F_i\ne F_i$. For $y\in\{1,-1\}^r$ let $F_i^{(1)}=F_i$, $F_i^{(-1)}=\rev F_i$ and \[ Q_y=H\prod_{i=1}^rF_i^{(y_i)} . \] Reversal is multiplicative, so $Q_y\rev Q_y=H\rev H\prod_iF_i\rev F_i=f\rev f$, and $\deg Q_y=\deg f=:N$. The coefficient of $x^N$ in $Q_y\rev Q_y$ is $\sum_k(\coef{x^k}Q_y)^2$, as $\coef{x^j}\rev Q_y=\coef{x^{N-j}}Q_y$, and in $f\rev f$ it is $\norm f$. Applying an embedding $\sigma$, \begin{equation}\label{eq:orient} \norm{\sigma Q_y}=\norm f\qquad\text{for all $y$ and $\sigma$.} \end{equation} \emph{Step 2: integrality.} Every coefficient of every $Q_y$ lies in the ring of integers $\mathcal O_K$. We use Kronecker's theorem: if $g,g'\in K[x]$ and the coefficients of $gg'$ lie in $\mathcal O_K$, then so does every product of a coefficient of $g$ with a coefficient of $g'$. Indeed, take nonzero $\beta,\beta'\in\mathcal O_K$ with $G=\beta g$ and $G'=\beta'g'$ in $\mathcal O_K[x]$; by Gauss's lemma for the Dedekind domain $\mathcal O_K$, the ideal generated by the products of a coefficient of $G$ with one of $G'$ is the ideal generated by the coefficients of $GG'=\beta\beta'gg'$, which is contained in $\beta\beta'\mathcal O_K$. Apply this to $g=Q_y$ and $g'=\rev Q_y$, whose product $f\rev f$ has integer coefficients: as $\coef{x^{N-k}}\rev Q_y=\coef{x^k}Q_y$, the square of each coefficient of $Q_y$ is an algebraic integer, and hence so is the coefficient. \emph{Step 3: signs.} For every embedding $\sigma$, $\sigma F_i$ is a monic real polynomial that divides $f$ in $\R[x]$; as $f$ has no root in $[0,\infty)$, neither has $\sigma F_i$, which is therefore positive on $[0,\infty)$. In particular $\sigma(F_i(0))>0$. \emph{Step 4: the Fourier expansion.} Let $P_i=F_i+\rev F_i$ and $M_i=F_i-\rev F_i\ne0$, and for $A\subseteq\{1,\dots,r\}$ let \[ R_A=H\prod_{i\in A}M_i\prod_{i\notin A}P_i . \] For every $\sigma$, $p\mapsto\norm{\sigma p}$ satisfies the parallelogram law, so for every $i$ and every $T\in K[x]$, \[ \norm{\sigma(TP_i)}+\norm{\sigma(TM_i)}=2\norm{\sigma(TF_i)}+2\norm{\sigma(T\rev F_i)} . \] Applying this to the indices one after the other gives $\sum_A\norm{\sigma R_A}=2^r\sum_y\norm{\sigma Q_y}$ (this is the orthogonality of the characters $y\mapsto\prod_{i\in A}y_i$ on $\{1,-1\}^r$), and with~\eqref{eq:orient}, \begin{equation}\label{eq:parseval} \sum_A\norm{\sigma R_A}=4^r\norm f\qquad\text{for every $\sigma$.} \end{equation} \emph{Step 5: one coefficient of each $R_A$.} Fix $A$, let $T_A=H\prod_{i\in A}M_i\ne0$, and let $t$ be its lowest nonzero coefficient, at $x^\ell$. As $P_i(0)=F_i(0)+1$, the coefficient of $x^\ell$ in $R_A$ is \[ \rho_A=t\prod_{i\notin A}\bigl(F_i(0)+1\bigr). \] Expanding the $M_i$, the polynomials $B_+=T_A\prod_{i\notin A}F_i$ and $B_-=T_A\prod_{i\notin A}\rev F_i$ are sums of $2^{\abs A}$ polynomials $\pm Q_y$, so their coefficients lie in $\mathcal O_K$ by Step~2; their coefficients at $x^\ell$ are $t\prod_{i\notin A}F_i(0)$ and $t$, as $\rev F_i(0)=1$. So $c=t^2\prod_{i\notin A}F_i(0)$ is a nonzero element of $\mathcal O_K$, and $\sigma(c)>0$ for every $\sigma$ by Step~3. Hence $\prod_\sigma\sigma(c)=\abs{N_{K/\Q}(c)}\ge1$, and $\sum_\sigma\sigma(c)\ge d$ by the inequality of arithmetic and geometric means. Since $(v+1)^2\ge4v$ for $v\ge0$, \[ \sigma(\rho_A)^2=\sigma(t)^2\prod_{i\notin A}\bigl(\sigma(F_i(0))+1\bigr)^2 \ge4^{r-\abs A}\sigma(c),\qquad\text{so}\qquad\sum_\sigma\sigma(\rho_A)^2\ge4^{r-\abs A}d . \] \emph{Step 6: conclusion.} Summing~\eqref{eq:parseval} over the $d$ embeddings and keeping only the coefficient $\rho_A$ of each $R_A$, \[ d\,4^r\norm f=\sum_A\sum_\sigma\norm{\sigma R_A}\ge\sum_A\sum_\sigma\sigma(\rho_A)^2 \ge d\sum_A4^{r-\abs A}=d\,5^r . \] So $(5/4)^r\le\norm f$. \end{proof} \subsection{Good roots} \begin{proposition}[Good roots]\label{prop:goodroots} Suppose that $D$ has a realizing polynomial. Let $V\subseteq\Q[x]$ be a subspace of finite dimension $d$ whose elements are centered and have simple real residues, and let $\varphi_1,\dots,\varphi_d$ be a basis of $V$. Then $d\le\kappa$, and there are roots $\alpha_1,\dots,\alpha_d$ of $h$, of multiplicities $e_1,\dots,e_d$, such that $e_1+\dots+e_d\le\kappa$ and the $d\times d$ matrix $\bigl(\res_{\alpha_i}(\varphi_j)\bigr)_{i,j}$ is invertible. \end{proposition} We call such $\alpha_1,\dots,\alpha_d$ \emph{good roots} for $\varphi_1,\dots,\varphi_d$. They exist for one basis of $V$ if and only if they exist for every basis, since a change of basis multiplies the matrix of residues by an invertible matrix on the right. In the proof we use two standard facts: if $K\subseteq\C$ is a number field and $\alpha\in\C$ is algebraic, every embedding of $K$ into $\C$ extends to an embedding of $K(\alpha)$ into $\C$ \cite[Appendix~B, Theorem~50]{Mar18}; and if $\alpha,\alpha'$ are roots of the same irreducible polynomial $F$ over $K$, there is an embedding of $K(\alpha)$ into $\C$ that is the identity on $K$ and maps $\alpha$ to $\alpha'$, as $K(\alpha)\cong K[x]/(F)$. \begin{proof}[Proof of \cref{prop:goodroots}] Let $P$ be a realizing polynomial. Recall that $h$ has degree $2L$ and $h(0)=c_L\ne0$, so that the roots of $h$ are nonzero, and that $x^{2L}h(1/x)=h(x)$ (\cref{sec:poly}). Each $\varphi_j$ is centered, so $x^{2L}\varphi_j(1/x)=\varphi_j(x)$ and $\deg\varphi_j<2L$. For a root $\alpha$ of $h$ let $r(\alpha)=(\res_\alpha(\varphi_1),\dots,\res_\alpha(\varphi_d))\in\C^d$ be its \emph{residue vector}. \emph{Step 1: the residue field.} Let $K\subseteq\C$ be the field generated by the residues $\res_\alpha(\varphi_j)$ over all $j$ and all roots $\alpha$ of $h$. Each residue lies in $\Q(\alpha)$ by \cref{lem:resprops}(a) and is algebraic, and there are finitely many, so $K$ is a number field. It is totally real: let $\sigma:K\to\C$ be an embedding and $\alpha$ a root of $h$, and extend $\sigma$ to an embedding $\psi$ of $K(\alpha)$. By \cref{lem:resprops}(a), $\sigma(\res_\alpha(\varphi_j))=\psi(\res_\alpha(\varphi_j))=\res_{\psi(\alpha)}(\varphi_j)$, which is real since $\psi(\alpha)$ is a root of $h$. So $\sigma$ maps the generators of $K$, hence $K$, into $\R$. \emph{Step 2: conjugate roots.} Let $\alpha,\alpha'$ be roots of $h$ with the same minimal polynomial over $K$. Take an embedding $\psi$ of $K(\alpha)$ into $\C$ that is the identity on $K$ and maps $\alpha$ to $\alpha'$. As $\res_\alpha(\varphi_j)\in K$, \cref{lem:resprops}(a) gives $\res_{\alpha'}(\varphi_j)=\psi(\res_\alpha(\varphi_j))=\res_\alpha(\varphi_j)$ for every $j$, that is, $r(\alpha')=r(\alpha)$. \emph{Step 3: reciprocal roots.} Call a root $\alpha$ of $h$ \emph{reciprocal} if its minimal polynomial $F$ over $K$ is reciprocal (note $F(0)\ne0$, as $F$ divides $h$). Then $r(\alpha)=0$. Indeed, $\rev F=cF$ with $c\in K$, so $F(1/\alpha)=\alpha^{-\deg F}\rev F(\alpha)=0$. Thus $1/\alpha$ is a root of $h$ whose minimal polynomial over $K$ is also $F$, and Step~2 gives $r(1/\alpha)=r(\alpha)$, while \cref{lem:resprops}(b), applied to the centered $\varphi_j$, gives $r(1/\alpha)=-r(\alpha)$. \emph{Step 4: the nonreciprocal roots span.} We claim that the residue vectors $r(\alpha)$ of the nonreciprocal roots $\alpha$ of $h$ span $\C^d$. Otherwise there is a nonzero $c\in\C^d$ with $\sum_jc_j\res_\alpha(\varphi_j)=0$ for every nonreciprocal root $\alpha$. By linearity, $b=\sum_jc_j\varphi_j\in\C[x]$ has residue $0$ at every nonreciprocal root, and by Step~3 at every reciprocal root. As $\deg b<2L$, $b=0$ (\cref{sec:poly}). But the $\varphi_j$ are linearly independent over $\Q$, hence over $\C$ (the rank of their rational coefficient matrix does not depend on the field), so $c=0$, a contradiction. \emph{Step 5: the choice of the roots.} By Step~4 there are nonreciprocal roots $\alpha_1,\dots,\alpha_d$ of $h$ whose residue vectors form a basis of $\C^d$; then the matrix $(\res_{\alpha_i}(\varphi_j))_{i,j}$ is invertible. Let $F_i$ be the minimal polynomial of $\alpha_i$ over $K$; it is not reciprocal. \emph{Step 6: the inverse roots.} As $x^{2L}h(1/x)=h(x)$, each $1/\alpha_i$ is a root of $h$ of the same multiplicity as $\alpha_i$, and $r(1/\alpha_i)=-r(\alpha_i)$ by \cref{lem:resprops}(b). Let $F_i'$ be the minimal polynomial of $1/\alpha_i$ over $K$. It is not reciprocal, since otherwise $r(1/\alpha_i)=0$ by Step~3, and then $r(\alpha_i)=0$. The $2d$ polynomials $F_1,\dots,F_d,F_1',\dots,F_d'$ are distinct: by Step~2, $F_i=F_k$ or $F_i'=F_k'$ with $i\ne k$ would give $r(\alpha_i)=r(\alpha_k)$, and $F_i=F_k'$ would give $r(\alpha_i)=-r(\alpha_k)$ (also for $i=k$), and the vectors $r(\alpha_1),\dots,r(\alpha_d)$ are linearly independent. \emph{Step 7: multiplicities.} Write $h=c_L\prod_FF^{\mu_F}$ in $K[x]$, over the monic irreducible factors $F$ of $h$. Each $F$ is separable, as $K$ has characteristic zero, and distinct monic irreducible polynomials have no common root; so the multiplicity $e_i$ of $\alpha_i$ as a root of $h$ is $\mu_{F_i}$, and by Step~6 it is also $\mu_{F_i'}$. Since the $2d$ polynomials of Step~6 are distinct and not reciprocal, $2(e_1+\dots+e_d)\le r$, where $r=\sum_F\mu_F$ over the nonreciprocal $F$ is the number of irreducible factors of $h$ in $K[x]$ that are not reciprocal, counted with multiplicity. Also $d\le e_1+\dots+e_d$, as every $e_i\ge1$. \emph{Step 8: the bound.} The coefficients of $h$ are nonnegative, with sum $h(1)=n^2$ and $h(0)=c_L>0$ (\cref{lem:realizing}(a)), so $h(x)>0$ for $x\ge0$ and $\norm h\le h(1)^2=n^4$. By \cref{thm:factorbound} for $f=h$ and the totally real field $K$, $(5/4)^r\le n^4$, that is, $r\log(5/4)\le4\log n$. Since $(5/4)^4>2$, $\log(5/4)>\frac14\log2$, so $r\le16\log_2n$ and $e_1+\dots+e_d\le8\log_2n<\kappa$. \end{proof} Neither the field $K$ nor the roots $\alpha_i$ are computed: the algorithm only uses the existence of good roots, in the proof that the decoder of the next section finds every realization. \section{Decoding the multiplicities}\label{sec:decode} Throughout this section $D$ is a list of natural numbers with $L>0$, with the notation of \cref{sec:poly}, and $\varphi_1,\dots,\varphi_d\in\Q[x]$ are polynomials, given by their nonzero coefficients; $W$ is their span, and $E$ is the set of exponents at which some $\varphi_j$ has a nonzero coefficient. We show how to find every realizing polynomial $P$ with $b_P\in W$ when there are good roots for $\varphi_1,\dots,\varphi_d$ (which forces the $\varphi_j$ to be linearly independent). \paragraph{The identities.} We regard $t=(t_1,\dots,t_d)$ and $p=(p_u)_{u\in C}$ as indeterminates and put \[ b(t)=\sum_{j=1}^dt_j\varphi_j,\qquad a(t)=\frac{\Dop h+b(t)}2,\qquad P_p=\sum_{u\in C}p_ux^u,\qquad \rev P_p=\sum_{u\in C}p_ux^{L-u}, \] polynomials in $x$ with coefficients in $\Q[t,p]$, and \begin{equation}\label{eq:PhiPsi} \Phi=h\,\Dop P_p-a(t)\,P_p,\qquad \Psi=P_p\rev P_p-h . \end{equation} Every coefficient $\coef{x^l}\Phi$ is a polynomial of degree at most $1$ in $t$ and homogeneous of degree $1$ in $p$, and every $\coef{x^l}\Psi$ is free of $t$ and of degree at most $2$ in $p$. The coefficients can be nonzero only for $l$ in the finite sets $E_\Phi=(\supp h\cup E)+C$ and $E_\Psi=(C+C)\cup\supp h$, respectively. Let $\cG$ be the finite list of the polynomials \begin{equation}\label{eq:rows} t^\beta\coef{x^l}\Psi\quad(\abs\beta\le\kappa+1,\ l\in E_\Psi),\qquad t^\beta p_u\coef{x^l}\Phi\quad(\abs\beta\le\kappa,\ u\in C,\ l\in E_\Phi), \end{equation} where $t^\beta=t_1^{\beta_1}\cdots t_d^{\beta_d}$ and $\abs\beta=\beta_1+\dots+\beta_d$. All of them have degree at most $\kappa+1$ in $t$. For a field $K\supseteq\Q$ let \[ \cI_K=\spanop_K\cG\cap K[t] \] be the space of $K$-linear combinations of the elements of $\cG$ that do not involve $p$, and $\cI=\cI_\Q$. For a realizing polynomial $P$ with $b_P\in W$, let $t_P\in\Q^d$ be a vector with $b(t_P)=b_P$, and $p_P=(\coef{x^u}P)_{u\in C}$. Put $H=L\,h(1)=L(n+2N)$. \begin{lemma}[Genuine points]\label{lem:genuine} Let $P$ be a realizing polynomial with $b_P\in W$. \begin{enumerate}[label=\textup{(\alph*)}] \item The coefficients of $b_P$ are integers of absolute value at most $H$, and they vanish outside $E$. \item $P_{p_P}=P$, and all coefficients of $\Phi$ and $\Psi$ vanish at $(t,p)=(t_P,p_P)$. Hence every element of $\cI$ vanishes at $t_P$. \item Let $a=(\Dop h+b_P)/2$. The only $p\in\Q^C$ with $h\,\Dop P_p=aP_p$ and $\sum_{u\in C}p_u=n$ is $p=p_P$. \end{enumerate} \end{lemma} \begin{proof} (a) As in the proof of \cref{lem:realizing}(d), $b_P=\sum_{u,v}p_up_v(u+v-L)x^{L+u-v}$ with $p_u=\coef{x^u}P$. So its coefficients are integers, and since $\abs{u+v-L}\le L$ for $0\le u,v\le L$, they have absolute value at most $L\sum_{u,v}p_up_v=LP(1)\rev P(1)=L\,h(1)$. As $b_P\in W$, they vanish outside $E$. (b) The sites of $P$ lie in $C$ (\cref{lem:realizing}(c)), so $P_{p_P}=P$ and $\rev P_{p_P}=\rev P$. As $b(t_P)=b_P$, \cref{lem:realizing}(e) gives $a(t_P)=(\Dop P)\rev P$, and then $\Phi(t_P,p_P)=h\,\Dop P-(\Dop P)\rev PP=0$ and $\Psi(p_P)=P\rev P-h=0$. Every element of $\cG$ vanishes at $(t_P,p_P)$, and so does every element of $\cI$; as these do not involve $p$, they vanish at $t_P$. (c) By (b), $p_P$ is such a vector. Let $p$ be another one and $Q=P_p$. Then $h\,\Dop Q=aQ$ and $h\,\Dop P=aP$, so $h\,(P\,\Dop Q-Q\,\Dop P)=0$, and $P\,Q'-Q\,P'=0$ as $h\ne0$. So $(Q/P)'=0$ in $\Q(x)$, and $Q=cP$ for some $c\in\Q$. Evaluating at $1$ gives $n=cn$, so $c=1$ and $p=p_P$. \end{proof} \paragraph{Residues of $a(t)$.} Suppose that every element of $W$ has simple real residues. Let $\alpha$ be a root of $h$ of multiplicity $e$. Since $\Dop h=xh'$ and $h'/h=\sum_\zeta\ord_\zeta h/(x-\zeta)$, the sum over the distinct roots $\zeta$ of $h$, the polynomial $\Dop h$ has residue $e$ at $\alpha$. By linearity, for every $t\in\C^d$ the polynomial $a(t)$ has the residue \begin{equation}\label{eq:u0} u_\alpha(t)=\frac{e+\res_\alpha(b(t))}2=\frac e2+\frac12\sum_{j=1}^dt_j\res_\alpha(\varphi_j) \end{equation} at $\alpha$, an affine function of $t$. For a realizing $P$ with $b_P\in W$, $a(t_P)/(xh)=P'/P$, so $u_\alpha(t_P)=\ord_\alpha P\in\{0,1,\dots,e\}$, as $P$ divides $h$. So the polynomial $\prod_{k=0}^e(u_\alpha(t)-k)$ vanishes at every $t_P$. The point of the next lemma is that its multiples lie in $\cI_\C$, which is defined from the sparse data without reference to $\alpha$. \begin{lemma}[Local relations]\label{lem:localrel} Suppose that every element of $W$ has simple real residues. Let $\alpha$ be a root of $h$ of multiplicity $e$, and $V_\alpha(t)=\prod_{k=0}^{e}(u_\alpha(t)-k)$. Then $qV_\alpha\in\cI_\C$ for every $q\in\C[t]$ of degree at most $\kappa-e$. \end{lemma} \begin{proof} We expand around $\alpha$ in the variable $s=x-\alpha$. For a polynomial $F$ in $x$ with coefficients in $\C[t,p]$, the coefficient $\coef{s^k}{F(\alpha+s)}=\sum_l\binom lk\alpha^{l-k} \coef{x^l}F$ is a $\C$-linear combination of the coefficients of $F$. Write $h=(x-\alpha)^eh_1$ with $h_1(\alpha)\ne0$; recall that $\alpha\ne0$. If $g\in\C[x]$ has a residue at $\alpha$, then $g=(x-\alpha)^{e-1}g_1$, and \[ \frac{s\,g(\alpha+s)}{(\alpha+s)\,h(\alpha+s)}=\frac{g_1(\alpha+s)}{(\alpha+s)\,h_1(\alpha+s)} \] is a power series in $s$, linear in $g$, with constant term $\res_\alpha(g)$. Applying this to $\Dop h$ and to the elements of $W$, we get a power series \[ u(s,t)=\frac{s\,a(t)(\alpha+s)}{(\alpha+s)\,h(\alpha+s)}=\sum_{k\ge0}u_k(t)\,s^k, \] whose coefficients $u_k\in\C[t]$ have degree at most $1$, and $u_0=u_\alpha$. Write $P_p(\alpha+s)=\sum_jP_js^j$ and $\rev P_p(\alpha+s)=\sum_j\rev P_js^j$, where the $P_j$ and $\rev P_j$ are $\C$-linear forms in $p$, and $h(\alpha+s)=\sum_{k\ge e}\eta_ks^k$ with $\eta_e=h_1(\alpha)\ne0$. \emph{Step 1: the identity $\Phi=0$ at $\alpha$.} The Laurent series $\rho(s)=s/((\alpha+s)h(\alpha+s))$ has a pole of order $e-1$ at $s=0$. In $\C[t,p]((s))$, \[ \rho(s)\,\Phi(\alpha+s)=\rho(s)h(\alpha+s)\,(\alpha+s)P_p'(\alpha+s)-u(s,t)\,P_p(\alpha+s) =s\,\partial_s\bigl(P_p(\alpha+s)\bigr)-u(s,t)\,P_p(\alpha+s), \] since $(\Dop P_p)(x)=xP_p'(x)$. The coefficient of $s^j$ on the right is $(j-u_0)P_j-\sum_{i\kappa\ge e_1+\dots+e_d$, some $i$ has $\mu_i\ge e_i+1$. Let $q=u^\mu/u_i^{e_i+1}$, of degree $\kappa-e_i$. Then $u^\mu=qV_{\alpha_i}+q\,(u_i^{e_i+1}-V_{\alpha_i})$, where $qV_{\alpha_i}\in\cI_\C$ by \cref{lem:localrel}, and the second term has degree at most $\kappa$, as $V_{\alpha_i}$ is monic of degree $e_i+1$ in $u_i$. So for $f=t^\gamma$, the linear system for $R_\gamma$ and $g$, whose unknowns are the coefficients of $R_\gamma$ and of the combination and whose equations compare the coefficients of all monomials in $(t,p)$, has a complex solution. Its coefficients are rational, and the ranks of its matrix and of its augmented matrix do not depend on the field, so it also has a rational solution. \end{proof} \begin{algorithm}[Decoder]\label{alg:decode} Input: $D$ (with $L>0$) and $\varphi_1,\dots,\varphi_d$, as lists of nonzero coefficients. \begin{enumerate}[label=\arabic*.,leftmargin=2em] \item If $d>\kappa$, output the empty list. \item For every monomial $t^\gamma$ with $\abs\gamma=\kappa+1$, solve the rational linear system of \cref{lem:reduce} for $R_\gamma$ and $g$ (\cref{lem:linalg}); if it has no solution, put $R_\gamma=0$. \item Write $E=\{E_0<\dots\kappa$ the algorithm stops at once. Otherwise $d\le\kappa$, and $2^\kappa\le2^8n^8$ since $2^{\lfloor\log_2n\rfloor}\le n$; so the number of monomials in $t$ of degree at most $\kappa+1$ is $\binom{\kappa+1+d}{d}\le2^{2\kappa+1}\le2^{17}n^{16}$. The sets $E$, $E_\Phi$ and $E_\Psi$ have at most $\sum_j\abs{\supp\varphi_j}$, $(2N+1+\abs E)\abs C$ and $\abs C^2+2N+1$ elements. So $\cG$ has polynomially many elements, and they involve polynomially many monomials in $(t,p)$, of degree at most $\kappa+1$ in $t$ and at most $2$ in $p$. Their coefficients are coefficients of $h$, of $\Dop h$ and of the $\varphi_j$, times integers $u\le L$ and halves; so they have polynomial encoding length. Hence each linear system of step~2 has polynomial size and is solved in polynomial time, with a solution of polynomial encoding length (\cref{lem:linalg}). The matrix $M$ has order $\abs\cM\le2^{2\kappa}$, and its entries are sums of products of the coefficients of the $R_\gamma$ with the coefficients of $\lambda$, which have at most $\ell\log_2(2\beta_0)$ bits, where $\log_2\beta_0=O(\log(2+L)+\log(2+N))$; so $\chi$ is computed in polynomial time (\cref{lem:linalg}), and its integer roots in polynomial time in $\abs\cM$, the encoding length of $\chi$ and $\ell\log\beta_0$ (\cref{lem:introots}). There are at most $\abs\cM$ of them, and for each, step~5 solves one linear system of polynomial size. \end{proof} \section{The algorithm}\label{sec:algorithm} \begin{algorithm}[Turnpike reconstruction]\label{alg:main} Input: a list $D=(d_1,\dots,d_N)$ of natural numbers. \begin{enumerate}[label=\arabic*.,leftmargin=2em] \item Compute $n$, $L$, the candidate sites $C$ in increasing order, the nonzero coefficients of $h$, $s_0$, $c_L$ and $\kappa$. \item If $L=0$, the only candidate is the list $(0,\dots,0)$ of length $n$; go to step~6. \item Compute $m=\abs C^2$, $\Tz=s_0^2$ and the equations of \cref{lem:system}(a), and apply \cref{prop:restrict}. If it reports $\Req=\emptyset$, output the empty list. \item Otherwise compute a basis $\varphi_1,\dots,\varphi_d$ of $W$ (\cref{prop:span}(a)). \item Run \cref{alg:decode} on $D$ and $\varphi_1,\dots,\varphi_d$; its outputs are the candidates. \item Output the candidates $(x_1,\dots,x_q)$ that pass the following check, without repetitions: $q\ge1$, $x_1=0$, $x_1\le x_2\le\dots\le x_q$, and the multiset $\ms{x_j-x_i:i0$. By \cref{lem:system}(b), $v_P\in\Req$, so step~3 does not stop (\cref{prop:restrict}). By \cref{prop:span}(b) and~(d), $b_P\in W$, and every element of $W$ is centered and has simple real residues. By \cref{prop:goodroots}, $d\le\kappa$ and there are good roots for $\varphi_1,\dots,\varphi_d$ of total multiplicity at most $\kappa$. By \cref{prop:decode}(b), the site list of $P$ is among the candidates of step~5. In both cases it passes the check of step~6. \end{proof} \begin{theorem}[Running time]\label{thm:time} \Cref{alg:main} runs in time polynomial in the length of the encoding of $D$, on every input. \end{theorem} \begin{proof} Let $\Lambda$ be the length of the encoding of $D$, so that $N\le\Lambda$ and every $d_i$ has at most $\Lambda$ bits. Then $n\le N+1$, $\abs C\le N+1$, $m\le(N+1)^2$, $s_0\le3N+1$ and $\kappa\le8\log_2(N+1)+8$, so $m$ and $\Tz$ are polynomial in $\Lambda$, and all numbers computed in step~1 have polynomially many bits; steps~1 and~2 take polynomial time. Step~3 takes polynomial time by \cref{lem:system}(a) and \cref{prop:restrict}, and its output has polynomial length. Step~4 takes polynomial time by \cref{prop:span}(a), and step~5 by \cref{prop:decode}(a); so there are polynomially many candidates, each of polynomial length. In step~6, computing the differences of each candidate, comparing multisets and removing repetitions takes polynomial time. None of these bounds uses \cref{lem:local}, \cref{thm:factorbound} or \cref{prop:goodroots}: each step is polynomial on every input. \end{proof} \begin{proof}[Proof of \cref{thm:main}] \Cref{alg:main} is deterministic; it is correct by \cref{thm:correct} and runs in polynomial time by \cref{thm:time}. Each of its steps is a composition of operations on integers and rationals in binary, lists and exact linear algebra, which a multitape Turing machine performs within the same polynomial bounds, up to a polynomial factor; this is carried out in detail in the formalization (Appendix~\ref{app:lean}). \end{proof} \begin{proof}[Proof of \cref{cor:P}] A list $D$ is realizable if and only if it has a normalized realization, since $X-\min X$ is a normalized realization whenever $X$ is a realization. By \cref{thm:correct}, this holds if and only if the output of \cref{alg:main} on $D$ is nonempty. Running \cref{alg:main} and testing whether the output is empty decides realizability in polynomial time. \end{proof} \section{Discussion}\label{sec:discussion} \paragraph{Efficiency.} We made no attempt to optimize the running time. The ellipsoid searches run in dimension up to $\abs C^4$ on matrices of order $\abs C^2$, with precision parameters of $O(\abs C^4)$ bits, and the decoder works with polynomials of degree $\kappa+1$ in up to $\kappa$ variables, where $\kappa\approx8\log_2n$; as $2^\kappa\le2^8n^8$, its multiplication matrix has order up to $\binom{2\kappa}\kappa\le4^\kappa\le2^{16}n^{16}$, and its reduction systems are larger still. The algorithm is far from practical, and for practical purposes the backtracking algorithm of~\cite{SSL90} remains the method of choice. It would be interesting to find a direct way to compute the space $W$, avoiding the restriction step, and to decode with fewer variables or lower degrees. Lemke, Skiena and Smith asked for a strongly polynomial algorithm~\cite[\S5]{LSS02}. Our analysis does not give one: our bounds on the numbers of iterations of the ellipsoid method and of lattice reduction depend on the bit length of the distances, through the exponents $u-t$ that appear in the system~\eqref{eq:system}, and so do the sizes of the numbers in the decoder. Whether a strongly polynomial algorithm exists remains open. \paragraph{Where exactness is used.} The variants with noisy or missing distances are NP-hard~\cite{LSS02,CEP03,CE04}, and our method uses exact data in an essential way: the system $\cA$ contains the matrices $v_Pv_P^\top$ only if the distances are exact, the integrality of $v_P$ drives the restriction, the bound of \cref{thm:factorbound} needs the coefficients of $h$ to be the exact counts, and the decoder reads the coefficients of $b_P$ off the digits of an integer eigenvalue. \paragraph{The constant in $\kappa$.} The size of the decoder is exponential in $\kappa$, and the constant $8$ in $\kappa$ comes from the base $5/4$ of \cref{thm:factorbound}. With the base $(1+\sqrt5)/2$ of Schinzel's theorem~\cite{Sch75}, the proof of \cref{prop:goodroots} would give $e_1+\dots+e_d\le3\log_2n$, and so a multiplication matrix of order $O(n^6)$. \paragraph{Other spaces.} The beltway problem, for points on a circle~\cite{SSL90,LSS02}, replaces the identity $P\rev P=h$ by a congruence modulo $x^\ell-1$, and the roots of $h$ by roots of unity, where the residue argument of \cref{lem:local,prop:goodroots} does not apply directly. We do not know whether the beltway problem is in $\classP$. \appendix \section{Algorithmic tools}\label{app:tools} We state the known algorithmic results that \cref{sec:restrict,sec:span,sec:decode} use, in the form in which we use them. The formalization proves its own versions of all of them (Appendix~\ref{app:lean}). Encoding lengths of rationals, vectors and matrices are taken in binary, with numerators and denominators; for an oracle algorithm, polynomial time means a number of steps and oracle calls polynomial in the input length, with queries of polynomial length. \begin{lemma}[The ellipsoid method with an exact oracle]\label{lem:ellipsoid} There is an oracle algorithm that, given $d\in\N$ and positive rationals $R$ and $\rho$, and an oracle that answers each query $c\in\Q^d$ with ``accept'', with ``empty'' or with a nonzero $g\in\Q^d$, runs in time polynomial in $d$ and the encoding lengths of $R$ and $\rho$, and either returns a query that the oracle accepted or returns nothing. Let $K\subseteq\R^d$ be a closed convex set contained in the closed ball of radius $R$ about $0$, and suppose that the oracle is \emph{valid} for $K$: it answers ``empty'' only if $K=\emptyset$, and every returned $g$ satisfies $g^\top(x-c)\le0$ for all $x\in K$. If the algorithm returns nothing, then $K$ contains no open ball of radius $\rho$. \end{lemma} \begin{proof}[Source] For $d=0$ one query suffices. For $d\ge1$ this is the central-cut ellipsoid method of Grötschel, Lovász and Schrijver \cite[Theorem~(3.2.1)]{GLS93} (after Khachiyan~\cite{Kha79}), run with $\eps=(\rho/d)^d$ and our oracle, scaling each cut to $\norm g_\infty=1$, and stopping with no output if the oracle answers ``empty''. Our oracle is a separation oracle in their sense for every error parameter. The method stops at the first center at which the oracle asserts membership, and returns it (part~I of the proof of \cite[Theorem~(3.2.1)]{GLS93}); otherwise it ends with an ellipsoid that contains $K$ and has volume at most $\eps$. A ball of radius $\rho$ contains a cube of side $2\rho/\sqrt d$, of volume $(2\rho/\sqrt d)^d>\eps$, so in the second case $K$ contains no such ball. \end{proof} \begin{lemma}[Lattice basis reduction in a rational inner product]\label{lem:lll} There is a polynomial-time algorithm that, given a positive definite rational $d\times d$ matrix $\Gamma$, returns $T\in\Z^{d\times d}$ with $\det T=\pm1$ and rationals $g_1,\dots,g_d$ such that, for $H=T^\top\Gamma T$: \begin{enumerate}[label=\textup{(\roman*)}] \item $0j$; \item $H_{ii}\le g_i+\frac14\sum_{j{\raggedright\arraybackslash}p{0.2\textwidth}>{\raggedright\arraybackslash}p{0.77\textwidth}@{}} \toprule Statement & Lean declarations \\ \midrule \endfirsthead \toprule Statement & Lean declarations \\ \midrule \endhead \bottomrule \endfoot \cref{thm:main}, \cref{cor:P} & \lean{enumeration}, \lean{realizable_mem_P} \\ \cref{def:realization,def:enumerates} & \lean{distances}, \lean{IsRealization}, \lean{IsNormalized}, \lean{Realizable}, \lean{sites}, \lean{Enumerates} \\ Encodings, $\classP$ & \lean{encInstance}, \lean{encOutput}, \lean{Turing.MultiTapeTM.ComputableInPolyTime}, \lean{Cslib.Complexity.P} \\ \midrule $n$, $L$, \eqref{eq:h}, \eqref{eq:C} & \lean{numPoints}, \lean{diam}, \lean{hPoly}, \lean{candSet}, \lean{candList} \\ $s_0$, $c_L$, $\kappa$ & \lean{sZero}, \lean{cL}, \lean{sBound} \\ Realizing, \eqref{eq:bP}, centered & \lean{IsRealizingM}, \lean{sitesOf}, \lean{bPoly}, \lean{dOp}, \lean{IsCentered} \\ Residues, \eqref{eq:hasres} & \lean{residue}, \lean{HasSimpleRealResidues}; zero residues: \lean{Roots.eq_zero_of_dvd} \\ \cref{lem:bridge} & \lean{exists_isRealizingM_of_isRealization}, \lean{card_eq_numPoints} \\ \cref{lem:realizing} & (a) \lean{cL_pos}; (c) \lean{mem_candSet_of_coeff_ne_zeroM}; (d) \lean{isCentered_bPolyM}; (e) \lean{bPoly_add_dOp_hPolyM}; (f) \lean{sitesOf_of_diam_eq_zero}; site lists: \lean{pairwise_sitesOf} \\ \cref{lem:resprops} & (a) \lean{Roots.map_resOver}; (b) \lean{Roots.HasRes.inv}, \lean{Roots.residue_inv} \\ \midrule \eqref{eq:system} & \lean{NG}, \lean{JG}, \lean{bGPoly}, \lean{InSliceM} \\ \cref{lem:system} & (a) \lean{sliceSysM}, \lean{inAff_sliceSysM_iff}, \lean{sliceSysM_polytime}; (b) \lean{liftVec}, \lean{inSliceM_liftVec}, \lean{bGPoly_liftVecM}; \lean{inSliceM_map_iff} \\ \cref{lem:local} & \lean{hasSimpleRealResidues_bGPolyM}, \lean{LiftM.hasSimpleRealResidues_of_inSliceM}; steps: \lean{LiftM.exists_gram_of_posSemidef}, \lean{Lift.normCoeff_cc}, \lean{Lift.derivCoeff_cc}, \lean{LiftM.derivCoeff_cc_mul}, \lean{Lift.eq_zero_of_normCoeff}, \lean{Lift.derivCoeff_eq_zero}, \lean{Lift.derivCoeff_pred} \\ \midrule \cref{prop:restrict} & \lean{Restrict.restrict}, \lean{Restrict.restrict_none}, \lean{Restrict.restrict_some}, \lean{Restrict.restrict_polytime} \\ \eqref{eq:consts}, \cref{alg:round} & \lean{Restrict.bigS}, \lean{Restrict.delta}, \lean{Restrict.aC}, \lean{Restrict.gammaC}, \lean{Restrict.next}, \lean{Restrict.result}, \lean{Restrict.okBasis}, \lean{Restrict.Impl.restrict} \\ \cref{lem:separation} & \lean{Restrict.exists_separator} \\ \cref{lem:perturb} & \lean{Restrict.quad_comb_ge} \\ \cref{lem:primal} & \lean{Restrict.valid_primalOracle}, \lean{Restrict.primal_answer}, \lean{Restrict.ball_subset_primal}, \lean{Restrict.no_req_of_chart_none} \\ \cref{lem:dualball} & \lean{Restrict.dual_exists}, \lean{Restrict.valid_dualOracle}, \lean{Restrict.ball_subset_dual} \\ \cref{lem:latticestep} & \lean{Restrict.lll_step}, \lean{Restrict.lll_retention}, \lean{Restrict.lll_diag_le}, \lean{Restrict.properness}, \lean{Restrict.properness_lt_one} \\ Proof of \cref{prop:restrict} & \lean{Restrict.next_some}, \lean{Restrict.next_none}, \lean{Restrict.restrict_eq_result} \\ \midrule \cref{prop:span} & \lean{polySpan}; (a) \lean{SpanM.basisWM}, \lean{SpanM.linearIndependent_basisWM}, \lean{SpanM.basisWM_polytime}; (b) \lean{SpanM.bGPoly_mem_polySpan}, inside \lean{Final.mem_candidates}; (c) \lean{SpanM.polySpan_basisWM_le}; (d) \lean{Final.IsGood}, \lean{Final.isGood_of_mem_span}, \lean{Final.isGood_bGPoly} \\ \cref{lem:psdpert} & \lean{SpanM.Impl.exists_posSemidef_add_smul} \\ \cref{thm:factorbound} & \lean{five_fourths_pow_card_nonrec_le}; steps: \lean{FactorBound.map_eq_C_mul_prod_normalizedFactors}, \lean{FactorBound.mul_prod_ite_mul_reverse}, \lean{FactorBound.embNormSq_eq_of_mul_reverse_eq}, \lean{FactorBound.contentIdeal_mul}, \lean{FactorBound.isIntegral_coeff_mul_coeff}, \lean{FactorBound.isIntegral_coeff_of_mul_reverse}, \lean{FactorBound.realEmb_coeff_zero_pos}, \lean{FactorBound.two_pow_mul_sum_powerset}, \lean{FactorBound.card_le_sum_realEmb}, \lean{FactorBound.card_mul_four_pow_le}, \lean{FactorBound.card_mul_five_pow_le} \\ \cref{prop:goodroots} & \lean{goodRoots_of_residues}, \lean{GoodRoots}; steps: \lean{Roots.numberField_resField}, \lean{Roots.isTotallyReal_resField}, \lean{Roots.residue_eq_of_minpoly_eq}, \lean{Roots.residue_eq_zero_of_reverse_eq}, \lean{Roots.span_residueVec_eq_top}, \lean{Roots.residue_inv}, \lean{Roots.rootMultiplicity_inv}, \lean{Roots.rootMultiplicity_eq_count}, \lean{Roots.exists_goodRoots}, \lean{Roots.eval_hPoly_pos}, \lean{Roots.card_nonrec_lt_two_mul_sBound}, \lean{Roots.sum_sq_coeff_hPoly_le} \\ \midrule \cref{lem:genuine} & (a) \lean{Decode.Impl.abs_coeff_bPoly_le}; (c) \lean{Decode.Impl.eq_C_mul_of_dOp}, \lean{Decode.Impl.decodeRoot_eq} \\ \cref{lem:localrel} & \lean{Decode.exists_mem_rowSpace}, \lean{Decode.prod_mul_mem_tSpan} \\ \cref{lem:reduce} & \lean{Decode.exists_reduction}, \lean{Decode.Impl.monomial_mem_colSpan}, \lean{Decode.Impl.chart_isSome}, \lean{Decode.Impl.sum_red} \\ \cref{alg:decode} & \lean{decode}, \lean{Decode.Impl.decode}, \lean{Decode.Impl.red}, \lean{Decode.Impl.mMat}, \lean{Decode.Impl.charCoefs}, \lean{Decode.Impl.decodeRoot} \\ \cref{prop:decode} & (a) \lean{decode_polytime}, \lean{Decode.Impl.two_pow_sBound_le}; (b) \lean{mem_decode}, \lean{Decode.Impl.sitesOf_mem_decode}, \lean{Decode.Impl.eval_charpoly_lam}, \lean{Decode.Impl.lamAt_eq_ofDigits}, \lean{Decode.Impl.digitsOf_ofDigits} \\ \midrule \cref{alg:main} & \lean{Final.turnpikeAlg}, \lean{Final.candidates}, \lean{Final.candidatesPos}, \lean{checkSitesM}, \lean{checkSitesM_iff}, \lean{SetupM.checkSitesM_eq_true_iff}, \lean{checkSitesM_polytime} \\ \cref{thm:correct} & \lean{Final.enumerates_turnpikeAlg}, \lean{Final.exists_mem_turnpikeAlg}, \lean{Final.mem_candidates} \\ \cref{thm:time} & \lean{Final.turnpikeAlg_polytime} \\ Proof of \cref{cor:P} & \lean{Final.exists_normalized_of_isRealization}, \lean{Final.mem_realizable_iff}, \lean{Final.realizable_mem_P} \\ \midrule \cref{lem:ellipsoid} & \lean{Background.Ellipsoid.ellipsoid}, \lean{Background.Ellipsoid.ValidOracle}, \lean{Background.Ellipsoid.ellipsoid_some}, \lean{Background.Ellipsoid.ellipsoid_none}, \lean{Background.Ellipsoid.ellipsoid_polytime} \\ \cref{lem:lll} & \lean{LLL.lll}, \lean{LLL.lll_spec}, \lean{LLL.lll_polytime} \\ \cref{lem:linalg} & characteristic polynomials: \lean{Decode.Impl.charCoefs}, \lean{Decode.Impl.hornerEval_charCoefs}; in \lean{Background.LinAlg}: \lean{chart}, \lean{chart_some}, \lean{chart_none}, \lean{chart_polytime}, \lean{det_polytime}, \lean{inv_polytime}, \lean{indepIdx}, \lean{linearIndependent_indepIdx}, \lean{span_indepIdx}, \lean{indepIdx_polytime} \\ \cref{lem:psdtest} & \lean{Background.LinAlg.psdTest}, \lean{Background.LinAlg.psdTest_none}, \lean{Background.LinAlg.psdTest_some}, \lean{Background.LinAlg.psdTest_polytime} \\ \cref{lem:introots} & \lean{intRoots}, \lean{hornerEval}, \lean{mem_intRoots}, \lean{intRoots_polytime}; \lean{IntRoots.Impl.mem_intRoots_of_root}, \lean{IntRoots.dvd_eval_digit_iff}, \lean{IntRoots.exists_prime_not_dvd} \\ \caption{The statements of the paper and the Lean declarations that prove them (in the namespace \lean{Turnpike}, unless they begin with \lean{Background}).}\label{tab:lean} \end{longtable} \normalsize \paragraph{Differences between the paper and the formalization.} The mathematics of \cref{sec:poly,sec:lift,sec:restrict,sec:span,sec:decode} is that of the formalization, with the same constants. The differences are in the presentation and in the algorithmic tools. \begin{itemize} \item \emph{Inversion of residues} (\cref{lem:resprops}(b)). The paper uses Laurent expansions; the formalization applies the reflection $p\mapsto x^{2L}p(1/x)$ to the congruence~\eqref{eq:hasres}, which sends $(x-\alpha)^e$ to a unit multiple of $(x-1/\alpha)^e$. \item \emph{Real residues} (\cref{lem:local}). The formalization writes $G=B^\top B$ and works with explicit coefficient sums of the polynomials $F_\ell$ at the shifted point, without forming them as bivariate polynomials, and with $D_z=(\alpha+s)\partial_s$ expanded on coefficients; the factor $c_L$ is carried through these sums. \item \emph{Separation} (\cref{lem:separation}). The formalization applies the geometric Hahn--Banach theorem of Mathlib in the space of all $m\times m$ matrices, to the open convex set of matrices $G$ for which $G+(\Id-\Pi)-c\Pi$ is uniformly positive definite, rather than in the space of matrices supported on $U$. \item \emph{The restriction loop} (\cref{alg:round}). The formalization runs exactly $m+1$ rounds, a round that stops leaving the basis unchanged, and then recomputes the answer of the final round. It computes the projector by linear solves, without an inverse. After each lattice step it checks that the new basis has at most $m$ vectors with entries at most $S$ in absolute value and stops otherwise; the check is proved never to fail when $\Tz\ge1$, and it bounds the size of every state on every input, which the running-time certificate uses. \item \emph{The span $W$} (\cref{prop:span}). The greedy basis of $W$ is computed with charts deciding membership in the span of the earlier vectors, and proved equal to the greedy basis of \cref{lem:linalg}. The perturbation of \cref{lem:psdpert} is proved with a $G$-orthogonal rational basis on rational vectors, and passed to real vectors by density. \item \emph{Nonreciprocal factors} (\cref{thm:factorbound}). The formalization indexes the orientations by the set of reversed factors, and proves the identity of Step~4 for every function that satisfies the parallelogram law, by induction on the set of indices. In Step~1 it does not compute $\deg Q_y$: for $p(0)\ne0$, $\norm{\sigma p}$ is the coefficient of $x^{\deg p}$ in $\sigma(p\rev p)$, so $Q_y\rev Q_y=f\rev f$ gives $\norm{\sigma Q_y}=\norm{\sigma f}$ directly. The inequality of arithmetic and geometric means in Step~5 is proved from $\log y\le y-1$. \item \emph{Good roots} (\cref{prop:goodroots}). The formal statement also assumes $L>0$, which its proof does not use. \item \emph{Decoding} (\cref{sec:decode}). \Cref{lem:localrel} is proved in an abstract commutative $\C$-algebra that contains the polynomials in $t$ and the unknowns $p$, and instead of the Laurent series $\rho(s)$ the proof multiplies by a polynomial $w$ with $(\alpha+s)\,h_1(\alpha+s)\,w(s)\equiv1$ modulo $s^{e+1}$. The passage from $\C$ to $\Q$ in \cref{lem:reduce} uses that the chart of \cref{lem:linalg} describes the solutions over every field. The formal version of \cref{prop:decode}(b) also assumes that the $\varphi_j$ are linearly independent, which good roots imply. The running-time proof bounds the number of monomials through $2^\kappa\le256\,n^8$. \item \emph{Integer roots} (\cref{lem:introots}). The formalization does not factor. Let $F$ be $f$ with its denominators cleared, and $B=4(b+1)^2+1$, where $b$ is computed from the bit sizes of $F$ and $\Lambda$. For every $e$ below the length of the coefficient list of $f$, every modulus $p=m+2$ with $m2^{-b}$, it starts from the matrix $4^a\Id$, keeps the center and the matrix on the grid $2^{-p}\Z$ with $p=2b+3d+10$, runs $2(d+2)(2d(a+b)+1)$ rounds, approximates square roots by integer square roots, and replaces the matrix by its exact update times $(1+\eps)^3$, rounded down, plus $2d\,2^{-p}\Id$, with $\eps=1/(16(d+1)(d+2))$. Instead of volumes it uses determinants: a ball of radius $\rho$ inside the ellipsoid forces $A\PSD\rho^2\Id$, which also bounds the rounding error, and $A\PSD c\Id$ implies $\det A\ge c^d$; the matrices are compared with those of the exact method. The size of the state is bounded for every oracle. \item \emph{Lattice basis reduction} (\cref{lem:lll}). The formalization clears denominators, $H=s\Gamma$, and recomputes the Gram--Schmidt data at each pass as integer minors $\Delta_k$ and $\lambda_{ij}$, with the division-free determinant of Bird~\cite{Bir11} from cslib-frontier. A pass is a full size reduction, with coefficients from a rounding recursion, followed by at most one swap at the first violation of the Lovász condition, tested on integers as $4\Delta_{k+2}\Delta_k+4\lambda_{k+1,k}^2<3\Delta_{k+1}^2$. It runs $3d^2e+1$ passes with $e=d+\abs{\enc H}+1$, and a bound check on the entries, proved never to fire for positive definite input, keeps every state small on every input. \item \emph{Linear algebra} (\cref{lem:linalg,lem:psdtest}). Determinants are computed by clearing denominators and Bird's algorithm, inverses by the adjugate, linear independence by Gram determinants, and charts from pivot rows and columns of greedy bases; the semidefiniteness test computes every Schur complement in closed form. Rationals are kept in lowest terms, so that the encoding lengths follow from the values, which are quotients of minors. \end{itemize} \clearpage \begin{thebibliography}{Mathlib} \bibitem[AB09]{AB09} S.~Arora and B.~Barak. \newblock \emph{Computational Complexity: A Modern Approach}. \newblock Cambridge University Press, 2009. \bibitem[BG07]{BG07} A.~Bekir and S.~W.~Golomb. \newblock There are no further counterexamples to {S}. {P}iccard's theorem. \newblock \emph{IEEE Transactions on Information Theory}, 53(8):2864--2867, 2007. \bibitem[Bir11]{Bir11} R.~S.~Bird. \newblock A simple division-free algorithm for computing determinants. \newblock \emph{Information Processing Letters}, 111(21--22):1072--1074, 2011. \bibitem[Blo77]{Blo77} G.~S.~Bloom. \newblock A counterexample to a theorem of {S}. {P}iccard. \newblock \emph{Journal of Combinatorial Theory, Series A}, 22(3):378--379, 1977. \bibitem[BW81]{BW81} J.~M.~Borwein and H.~Wolkowicz. \newblock Facial reduction for a cone-convex programming problem. \newblock \emph{Journal of the Australian Mathematical Society, Series A}, 30:369--380, 1981. \bibitem[CE04]{CE04} M.~Cieliebak and S.~Eidenbenz. \newblock Measurement errors make the partial digest problem {NP}-hard. \newblock In \emph{LATIN 2004: Theoretical Informatics}, volume 2976 of \emph{LNCS}, pages 379--390. Springer, 2004. \bibitem[CEP03]{CEP03} M.~Cieliebak, S.~Eidenbenz, and P.~Penna. \newblock Noisy data make the partial digest problem {NP}-hard. \newblock In \emph{Algorithms in Bioinformatics (WABI 2003)}, volume 2812 of \emph{LNCS}, pages 111--123. Springer, 2003. \bibitem[CEP05]{CEP05} M.~Cieliebak, S.~Eidenbenz, and P.~Penna. \newblock Partial digest is hard to solve for erroneous input data. \newblock \emph{Theoretical Computer Science}, 349(3):361--381, 2005. \bibitem[Dak00]{Dak00} T.~Daki\'c. \newblock \emph{On the Turnpike Problem}. \newblock PhD thesis, Simon Fraser University, 2000. \bibitem[DGN02]{DGN02} A.~Daurat, Y.~G\'erard, and M.~Nivat. \newblock The chords' problem. \newblock \emph{Theoretical Computer Science}, 282(2):319--336, 2002. \bibitem[DGN05]{DGN05} A.~Daurat, Y.~G\'erard, and M.~Nivat. \newblock Some necessary clarifications about the chords' problem and the partial digest problem. \newblock \emph{Theoretical Computer Science}, 347(1--2):432--436, 2005. \bibitem[Edm67]{Edm67} J.~Edmonds. \newblock Systems of distinct representatives and linear algebra. \newblock \emph{Journal of Research of the National Bureau of Standards, Section B}, 71B(4):241--245, 1967. \bibitem[EMK26]{EMK26} C.~S. Elder, G.~Mar\c{c}ais, and C.~Kingsford. \newblock Turnpike with uncertain measurements: triangle-equality {ILP} with a deterministic recovery guarantee. \newblock arXiv:2603.18283, 2026. \bibitem[GLS93]{GLS93} M.~Gr\"otschel, L.~Lov\'asz, and A.~Schrijver. \newblock \emph{Geometric Algorithms and Combinatorial Optimization}, volume~2 of \emph{Algorithms and Combinatorics}. \newblock Springer, second corrected edition, 1993. \bibitem[HD21]{HD21} S.~Huang and I.~Dokmani\'c. \newblock Reconstructing point sets from distance distributions. \newblock \emph{IEEE Transactions on Signal Processing}, 69:1811--1827, 2021. \bibitem[JH13]{JH13} K.~Jaganathan and B.~Hassibi. \newblock Reconstruction of integers from pairwise distances. \newblock In \emph{IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP)}, pages 5974--5978, 2013. \bibitem[JP04]{JP04} N.~C.~Jones and P.~A.~Pevzner. \newblock \emph{An Introduction to Bioinformatics Algorithms}. \newblock MIT Press, 2004. \bibitem[Kha79]{Kha79} L.~G.~Khachiyan. \newblock A polynomial algorithm in linear programming. \newblock \emph{Doklady Akademii Nauk SSSR}, 244(5):1093--1096, 1979. \newblock English translation in \emph{Soviet Mathematics Doklady} 20:191--194, 1979. \bibitem[Lean4]{Lean4} L.~de~Moura and S.~Ullrich. \newblock The {L}ean~4 theorem prover and programming language. \newblock In \emph{Automated Deduction -- CADE 28}, volume 12699 of \emph{LNCS}, pages 625--635. Springer, 2021. \bibitem[LLL82]{LLL82} A.~K.~Lenstra, H.~W.~Lenstra, Jr., and L.~Lov\'asz. \newblock Factoring polynomials with rational coefficients. \newblock \emph{Mathematische Annalen}, 261(4):515--534, 1982. \bibitem[LSS02]{LSS02} P.~Lemke, S.~S.~Skiena, and W.~D.~Smith. \newblock Reconstructing sets from interpoint distances. \newblock DIMACS Technical Report 2002-37, 2002. \bibitem[LSS03]{LSS03} P.~Lemke, S.~S.~Skiena, and W.~D.~Smith. \newblock Reconstructing sets from interpoint distances. \newblock In B.~Aronov, S.~Basu, J.~Pach, and M.~Sharir, editors, \emph{Discrete and Computational Geometry: The Goodman--Pollack Festschrift}, volume~25 of \emph{Algorithms and Combinatorics}, pages 597--631. Springer, 2003. \bibitem[LW88]{LW88} P.~Lemke and M.~Werman. \newblock On the complexity of inverting the autocorrelation function of a finite integer sequence, and the problem of locating $n$ points on a line, given the $\binom n2$ unlabelled distances between them. \newblock IMA Preprint Series 453, Institute for Mathematics and its Applications, University of Minnesota, 1988. \bibitem[Mar18]{Mar18} D.~A.~Marcus. \newblock \emph{Number Fields}. \newblock Universitext. Springer, second edition, 2018. \bibitem[Mathlib]{Mathlib} The mathlib Community. \newblock The {L}ean mathematical library. \newblock In \emph{Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs (CPP 2020)}, pages 367--381, 2020. \bibitem[Pat34]{Pat34} A.~L.~Patterson. \newblock A {F}ourier series method for the determination of the components of interatomic distances in crystals. \newblock \emph{Physical Review}, 46(5):372--376, 1934. \bibitem[Pat39]{Pat39} A.~L.~Patterson. \newblock Homometric structures. \newblock \emph{Nature}, 143:939--940, 1939. \bibitem[Pat44]{Pat44} A.~L.~Patterson. \newblock Ambiguities in the {X}-ray analysis of crystal structures. \newblock \emph{Physical Review}, 65(5--6):195--201, 1944. \bibitem[Pic39]{Pic39} S.~Piccard. \newblock \emph{Sur les ensembles de distances des ensembles de points d'un espace euclidien}, volume~13 of \emph{M\'emoires de l'Universit\'e de Neuch\^atel}. \newblock Secr\'etariat de l'Universit\'e, Neuch\^atel, 1939. \bibitem[PR02]{PR02} G.~Pandurangan and H.~Ramesh. \newblock The restriction mapping problem revisited. \newblock \emph{Journal of Computer and System Sciences}, 65(3):526--544, 2002. \bibitem[Ram97]{Ram97} M.~V.~Ramana. \newblock An exact duality theory for semidefinite programming and its complexity implications. \newblock \emph{Mathematical Programming}, 77(1):129--162, 1997. \bibitem[RS82]{RS82} J.~Rosenblatt and P.~D.~Seymour. \newblock The structure of homometric sets. \newblock \emph{SIAM Journal on Algebraic and Discrete Methods}, 3(3):343--350, 1982. \bibitem[Rud91]{Rud91} W.~Rudin. \newblock \emph{Functional Analysis}. \newblock McGraw-Hill, second edition, 1991. \bibitem[Sch73]{Sch73} A.~Schinzel. \newblock On the product of the conjugates outside the unit circle of an algebraic number. \newblock \emph{Acta Arithmetica}, 24(4):385--399, 1973. \bibitem[Sch75]{Sch75} A.~Schinzel. \newblock Addendum to the paper ``{O}n the product of the conjugates outside the unit circle of an algebraic number''. \newblock \emph{Acta Arithmetica}, 26:329--331, 1975. \bibitem[SS94]{SS94} S.~S.~Skiena and G.~Sundaram. \newblock A partial digest approach to restriction site mapping. \newblock \emph{Bulletin of Mathematical Biology}, 56(2):275--294, 1994. \bibitem[SSL90]{SSL90} S.~S.~Skiena, W.~D.~Smith, and P.~Lemke. \newblock Reconstructing sets from interpoint distances (extended abstract). \newblock In \emph{Proceedings of the 6th Annual Symposium on Computational Geometry (SCG '90)}, pages 332--339. ACM, 1990. \bibitem[Zha94]{Zha94} Z.~Zhang. \newblock An exponential example for a partial digest mapping algorithm. \newblock \emph{Journal of Computational Biology}, 1(3):235--239, 1994. \end{thebibliography} \end{document}