% Standalone manuscript. Build with pdfLaTeX twice for cross-references. \documentclass[11pt,letterpaper]{article} \usepackage[hmargin=1.08in,vmargin=1.03in]{geometry} \usepackage{amsmath,amssymb,amsthm} \usepackage{enumitem,needspace} \usepackage[hidelinks,bookmarksnumbered=true,pdfencoding=auto]{hyperref} \hypersetup{pdfauthor={Jingyang Yu},pdfdisplaydoctitle=true,pdftitle={A fixed Diophantine verifier for native binary bitwise inclusion},pdfsubject={Diophantine complexity, finite arithmetic, and witness bounds}} \newtheorem{theorem}{Theorem}[section] \newtheorem{lemma}[theorem]{Lemma} \newtheorem{corollary}[theorem]{Corollary} \numberwithin{equation}{section} \newcommand{\ZZ}{\mathbb Z} \newcommand{\DD}{\mathsf D} \newcommand{\NP}{\mathsf{NP}} \setlength{\emergencystretch}{2em} \setlist[enumerate]{leftmargin=*,itemsep=2pt,topsep=5pt} \raggedbottom \title{A fixed Diophantine verifier for\\native binary bitwise inclusion} \author{Jingyang Yu\\[2pt] \small University of Toronto} \date{} \begin{document} \maketitle \begin{abstract} Leonard Adleman and Kenneth Manders conjectured that the bounded Diophantine complexity class $\mathsf{D}$ equals $\mathsf{NP}$. We give a proof for binary numerical languages by applying the bitwise-inclusion criterion of Jones and Matiyasevich. For nonnegative integers $a,b$, we construct a single integer polynomial $P(a,b,\mathbf{w})$ whose zeros certify that every set bit of $a$ is set in $b$. Its arity is independent of the input width $n$. Every true inclusion has a witness of total bit length polynomial in $n$. A false inclusion has no integer root. We encode sets of bit positions as modular idempotents and recover their binary weights from a residue. To certify the modulus and the multiplier used in this recovery, we represent the packed output of a fixed first-order formula with majority by a Diophantine equation. Applying the inclusion test to the bit masks of a packed accepting computation gives the class equality. \end{abstract} \section{Introduction}\label{sec:intro} In their study of Diophantine complexity, Adleman and Manders asked whether polynomially bounded roots of a fixed equation suffice to express every language in $\NP$ \cite{am,lipmaa}. Jones and Matiyasevich reduced the question to a relation on two integers \cite[Section~5]{jm}. Write $a\preceq b$ if every set bit of $a$ is set in $b$. We construct the bounded Diophantine representation of this relation. The class equality also appears in work on zero-knowledge arguments \cite[Section~2.3 of the full version]{cpp} and in questions about spectra of finite structures \cite[Chap.~8]{kojelis}. A bit scan decides $a\preceq b$ in linear time. Encoding the same test in a single polynomial equation poses a different problem. The polynomial has two input slots, one for each integer, and a fixed number of witness slots for words of arbitrary length. Introducing a separate binary variable for each position would make the arity grow with the input. We instead recover all positions from a pair of modular residues. Write $\ell(0)=1$ and $\ell(x)=1+\lfloor\log_2|x|\rfloor$ for $x\ne0$. We count a fixed additional bit for the sign of an integer witness and add the lengths across a witness tuple. We number bits starting at zero. The width $n$ in the following statement is a bound for analysis. The two native integers $a,b$ are the inputs to the polynomial. \begin{theorem}[Native bitwise inclusion]\label{thm:main} There are integers $r,C\ge1$ and a polynomial $\mathcal P\in\ZZ[A,B,W_1,\ldots,W_r]$ with the following properties for all $n\ge1$ and $0\le a,b<2^n$. \begin{enumerate}[label=\textup{(\roman*)}] \item If $a\preceq b$, there is a tuple $w\in\ZZ^r$ of total bit length at most $(n+2)^C$ such that $\mathcal P(a,b,w)=0$. \item If $a\not\preceq b$, then $\mathcal P(a,b,w)\ne0$ for every $w\in\ZZ^r$. \end{enumerate} \end{theorem} We use numerical languages $L\subseteq\mathbb N$ on binary inputs. In the bounded Diophantine class $\DD$, there are a fixed arity $s$, a polynomial $q\in\mathbb N[X]$, and an integer polynomial $F$ such that, for every $x$, \[ x\in L \quad\Longleftrightarrow\quad \exists w\in\mathbb N^s\quad \sum_{i=1}^s\ell(w_i)\le q(\ell(x))\quad\text{and}\quad F(x,w)=0 . \] The same convention applies to a fixed tuple of inputs, using its total bit length \cite{am,pollett,lipmaa}. A false input may have longer roots of $F$. Theorem~\ref{thm:main}(ii) excludes roots of every length. \Needspace{5\baselineskip} For $\NP$ we retain the same fixed arity and polynomial certificate budget, and replace $F(x,w)=0$ by acceptance of $(x,w)$ by a deterministic polynomial-time verifier. Each natural is encoded in binary, least significant bit first, and followed by a delimiter. Zero has an empty payload on the tape and costs one bit in the witness budget. The verifier halts on all tapes within a polynomial in the tape length. An arbitrary binary certificate, including its leading zeroes, fits in one field by adjoining one high sentinel bit. Section~\ref{sec:arithmetic} records the comparison of witness bounds. \Needspace{7\baselineskip} \begin{corollary}[Diophantine complexity]\label{cor:classes} For binary numerical languages, $\DD=\NP$. \end{corollary} \begin{proof} To apply the sufficient direction of the bitwise-inclusion criterion \cite[Section~5]{jm}, we give the transfer for the verifier convention above. Fix a verifier $V$ and certificate budget $q$ for $L\in\NP$. Encode its finite control and stacks by natural registers. Pack each register's values along a computation into the successive digits of one integer in a power-of-two radix. The checker for this fixed machine has a fixed number of register words. Equations and bit-inclusion tests on the words enforce the initial tape, the transitions and an accepting final configuration. For example, if $A$ and $B$ pack the old and new values of a register, then \[ A+Q^t x_{\mathrm{last}}=QB+x_{\mathrm{first}} \] links $t$ successive steps at radix $Q$. For the branch tests, let $I=\sum_{k=0}^{t-1}Q^k$. Choose one marker word $L_i\preceq I$ per branch and impose $\sum_i L_i=I$. With $Q$ larger than the number of branches, each digit position selects exactly one branch. For its marker $L$, the part $A$ of a register word $R$ on the selected positions is specified by \[ A\preceq R,\qquad A\preceq(Q-1)L,\qquad R\preceq(Q-1)(I-L)+A . \] At an unselected position these masks force the digit of $A$ to zero. At a selected position the first and third masks force its digit to equal that of $R$. A branch can therefore check an affine register equality simultaneously at its selected positions by using the selected words and replacing a constant $c$ by $cL$. Digit masks bound the register values. Reserving a fixed number of guard bits for the coefficients keeps the affine sums below $Q$ in each position. Reading the radix digits gives a run from the supplied tape to acceptance. A polynomial-time run has polynomially many positions and uses polynomially many bits per position, so its packed words have polynomial length. Inside the same system enforce $\sum_i\ell(w_i)\le q(\ell(x))$ using exact binary lengths and a natural slack. Replace each bit-inclusion test by a fresh copy of the polynomial of Theorem~\ref{thm:main}. Represent each signed witness by a difference of naturals. Its positive and negative parts have combined bit length equal to the signed cost, including at zero. Take the sum of squares of the polynomial differences. Every zero now decodes to a computation that accepts an original certificate within budget. Conversely, on an accepting run, each test has short witnesses by Theorem~\ref{thm:main}(i). Adding their lengths, the packed words, and the witnesses for the input framing and length checks gives a polynomial total bound. This proves $L\in\DD$. For $L\in\DD$, use its original tuple and cutoff as the $\NP$ certificate and cutoff. Evaluate the fixed polynomial $F(x,w)$ and accept precisely when the result is zero. Its fixed degree bounds every intermediate binary length by a constant multiple of the input and witness lengths plus a constant. Binary addition and multiplication therefore give a polynomial-time verifier. \end{proof} \paragraph{The printed halving mask.} Jones and Matiyasevich give a one-mask numerical characterization in \cite[Section~5, eq.~(53), p.~827]{jm} (see also \cite[Section~4.3]{lipmaa}). There is a local error in the implication from (49) to (50) on that page. Write $Q$ for the radix, $I$ for all time markers, $L$ for active markers, $R$ for a packed register and $J$ for the selected half-register. At $(Q,I,L,R,J)=(64,65,64,128,0)$, the first two masks have zero left sides. The third, as printed, holds because \[ (Q-1)(I-L)+2J+I=63+65=128=R. \] Equation (50) requires $J=64$ in the active position. Replacing the last $I$ by $L$ restores the floor-half selector at every active position and forces zero elsewhere. Corollary~\ref{cor:classes} uses as many masks as the fixed verifier requires and establishes the transfer directly. \paragraph{Proof outline.} Section~\ref{sec:residues} assigns to each width $n$ a modulus $D$ and a multiplier $J_n$. The idempotents $S^2=S\pmod D$ select bit positions independently. Taking a least residue of $SJ_n$ and rounding recovers the integer whose bits were selected. The remaining task is to produce the \emph{correct} $D,J_n$ with fixed arity. Uniform threshold arithmetic supplies fixed formulas for their individual bits, in Lemma~\ref{lem:width-formulas}. Theorem~\ref{thm:unarycompiler} in Section~\ref{sec:unarycompiler} is the main encoding step. A first-order formula on a finite arithmetic universe of size $U$ describes a word one bit at a time. To obtain the entire integer, we represent its truth values on roots of unity, implement each quantifier by averaging a coordinate, and attach the weight $2^i$ to position $i$ by Fourier orthogonality. Lemma~\ref{lem:mean-extract} evaluates each average by extracting a signed coefficient from a single integer. Section~\ref{sec:arithmetic} assembles the graphs, proves Theorem~\ref{thm:main}, and accounts for the witness costs. Appendix~\ref{sec:exact-power} gives the globally sound integer-power graph used in the extractions. Its Pell-index cutoff is certified inside the equation. Appendix~\ref{sec:lean} identifies the formal counterparts of the main statements. \section{Reading a binary word from a modular idempotent}\label{sec:residues} Fix a width \(n\ge1\). Put \(m=2^{n+2}\) and \(e=4n+10\). For \(0\le i2v\). Consequently the entire power of each prime in the binomial coefficient is at most \(2v\). As \(\log_2 K\le4x\), the display gives \(\pi(K)\ge 4x>n+1\), and \(K\) itself is even. Also \(e\le5x\), so \(\log_2D\le en\log_2K\le20x^3\), and \(0\le J_n1\) with \(uv=p\). All factors of \(p\) are in the universe. Count the odd primes \(q0]|<2^{-q}$. On all of $\mathbb R$, $|H_q(t)|\le\max(1,|t|)^d$. Its value at a rational argument is given exactly by a fixed number of rational operations, integer powers, divisions with remainder, and roundings. \end{lemma} \begin{proof} For $|t|\le1$ put $p=(1+t)/2$. The polynomial is the probability of at least $k$ successes in $d$ independent Bernoulli trials of success probability $p$. For $1/20$, and put $a=s+m$, $b=s-m$, $H=(2+|a|+|b|)^d$, $Z=8H+3$. If $(b+aY)^d=\sum_i b_iY^i$, then $\sum_i|b_i|\le H$. Consequently \[ \left|\frac{(b+aZ)^d}{Z^k} -\sum_{i=k}^d b_i Z^{i-k}\right|\le H/Z<1/8 . \] Thus rounding $(b+aZ)^d/Z^k$ gives $\sum_{i=k}^d b_iZ^{i-k}$. Its residue modulo $Z-1$ equals $\sum_{i=k}^d b_i$ modulo $Z-1$. The centered representative equals this sum in $\mathbb Z$ since its magnitude is at most $H<(Z-1)/2$. Dividing by $(2s)^d$ gives $H_q(t)$. The argument allows either sign for the coefficients, which is needed at later integer evaluation points. \end{proof} \subsection{Representing an integer by two grid points} Let $z=e^{2\pi i l/M}$, where $l$ ranges over $\mathbb Z/M\mathbb Z$. Define rational Laurent polynomials \[ c(z)=\tfrac12(z+z^{-1}),\qquad x(z)=B-\frac{M c(z)}{2P},\qquad Y(z)=\frac{(PJ/M)^2-c(z)^2}{4}. \] Call $z$ selected if $l=\pm(M/4+j)$ with $-B\le j\le B$. Its label is $B+j$. Each label from $0$ through $2B$ occurs twice, and both copies satisfy $c(z)=-\sin(2\pi j/M)$. \begin{lemma}[Label and window bounds]\label{lem:packing-label} On the full grid, $|x(z)|0$. At these points, \[ |x(z)-(B+j)|\le E_0,\qquad E_0=32B^3/M^2+B/\beta . \] \end{lemma} \begin{proof} The bound on $x$ follows from $|c|\le1$ and $P>\pi>3$. On the selected arcs use $|\sin t-t|\le |t|^3/6$ and \eqref{eq:packing-wallis} in $x=B+M\sin(2\pi j/M)/(2P)$. Let $h$ be the distance in grid steps to the nearer center $l=\pm M/4$. Then $0\le h\le M/4$ and $c(z)^2=\sin^2(2\pi h/M)$ increases with $h$. At $h=B$, $M^2(4Y)\ge \pi^2(J^2-4B^2)=\pi^2(4B+1)>4$. At $h=B+1$, use $\sin^2(t)\ge t^2-t^4$ for $|t|\le1$ and $P^2\le\pi^2(1+2/\beta)$ to obtain \[ M^2(-4Y)\ge \pi^2(4B+3) -\frac{(8(B+1))^4}{M^2}-\frac{2\pi^2J^2}{\beta}>4 . \] Indeed $M\ge 2^{10}(B+1)^4$ makes each subtracted term less than one. Monotonicity gives the sign and the lower bound at every point. Finally $PJ/M<1$ and $|c|\le1$ give the upper bound. \end{proof} \subsection{Logical induction by guarded averaging} For each subformula $\psi$ we construct a rational Laurent polynomial in the grid coordinates of its free variables. It has values in $[0,1]$ on the whole grid. Whenever these coordinates are selected and their labels lie in $[U]$, its value differs from $[\psi]$ by at most $\varepsilon$. Numerical parameters are substituted as their exact integer values. The guard used below also compares a label to the external integer $U$. For an equality atom let $A=x-y$, $x+y-z$, or $xy-z$ according to the relation. Here $x,y,z$ stand for the corresponding label observables or numerical parameters. For each selected assignment with labels through $2B$, the difference between $A$ and the corresponding integer expression is at most $(4B+3)E_0<1/8$. For example a product contributes at most $4BE_0+E_0^2$ before subtracting the last observable. Globally $|A|\le2M^2$. Use \[ H_{h_0}\!\left(\frac{1/4-A^2}{8M^4}\right) \quad\text{for equality},\qquad H_{h_0}\!\left(\frac{A+1/2}{8M^4}\right) \quad\text{for weak order }A=x-y\ge0. \] Each argument lies in $[-1,1]$ on the grid. On a selected assignment an integer equality gives $|A|\le1/8$, and an inequality of the two integers gives $|A|\ge7/8$. Thus the equality test has the correct sign with gap at least $(1/4-1/64)/(8M^4)>\delta$. For order the unnormalized gap is at least $3/8$. Lemma~\ref{lem:packing-tail} gives the claimed error. Negation sends $f$ to $1-f$. For conjunction and disjunction of $f,g$ apply $H_{h_0}$ respectively to $(f+g-3/2)/4$ and $(f+g-1/2)/4$. On valid labels the threshold margin before division by four is at least $1/2-2\varepsilon$. The output error is again at most $\varepsilon$, independently of the depth already treated. To quantify a coordinate, first conjoin its child with the guard $x\delta$. This proves the induction, with universal quantification obtained by negating existence. Conjoin the output with $j1/2$ and has the sign of its arc. Hence $S$ approximates the same-sign indicator to error $\varepsilon$. Replace the seven factors $T_\varphi$, the four windows, $L$, and $S$ by their intended indicators on the selected arcs, and declare the resulting summand zero elsewhere. For each $0\le i0$ take $(q,\max(1,|p|),0)$, and for a monomial $\mathbf z^\nu$ take $(1,1,\max_i|\nu_i|)$. If the children have triples $(D_i,H_i,G_i)$, we may use the following recurrences. \[ \begin{array}{c|ccc} &D_E&H_E&G_E\\ \hline E_1\mathbin{\pm} E_2&D_1D_2&D_2H_1+D_1H_2&\max(G_1,G_2)\\ E_1 E_2&D_1D_2&H_1H_2&G_1+G_2\\ E_1^b\ (b\ge0)&D_1^b&H_1^b&bG_1\\ H_q(E_1),\ d=d(q)&(2D_1)^d&[2(D_1+H_1)]^d&dG_1 . \end{array} \] The last line follows by expanding the binomial tail with numerator factors $D_1+P_{E_1}$ and $D_1-P_{E_1}$ and using $\sum_j\binom dj=2^d$. Inverting the Laurent coordinates preserves the triple. The geometric sum in the four-coordinate readout has denominator $1$, norm $2^J-1$, and exponent bound $(J-1)M/J$. At a positive rational value of $w$ it is evaluated as $(r^J-1)/(r-1)$ for $r=2w^{-M/J}\ne1$, and as $J$ for $r=1$. Partial means also preserve the triple because orthogonality keeps exactly the terms whose exponent in the eliminated variable is divisible by the period, then combines their coefficients. This can only decrease the coefficient norm. \begin{lemma}[Extraction of a cyclic mean]\label{lem:mean-extract} Suppose that $E(z,\mathbf x)$ has triple $(D,H,G)$ and that its scalar evaluator accepts positive rational coordinates. For an integer $m\ge1$ and positive rational $a_i=p_i/q_i$, the scalar \[ \underset{z^m=1}{\operatorname{mean}} E(z,\mathbf a) \] can be computed with one call to that evaluator, integer arithmetic, integer powers, rounding, and a remainder. The number of operations depends only on the number of remaining coordinates. \end{lemma} \begin{proof} Put $C_0=\prod_i(p_iq_i)^G$ and $H'=H\prod_i\max(p_i,q_i)^{2G}$. Then $L(z)=DC_0E(z,\mathbf a)$ is integral Laurent with $\|L\|_1\le H'$. Indeed the multiplier for a coordinate exponent $\nu_i$ is $p_i^{G+\nu_i}q_i^{G-\nu_i}$, an integer bounded by $\max(p_i,q_i)^{2G}$. Choose $b=m\lceil\max(G,1)/m\rceil$, so $b$ is a positive multiple of $m$ and $b\ge G$. The ordinary polynomial \[ R(z)=z^b L(z)\sum_{h=0}^{2b/m}z^{mh} \] has $[z^{2b}]R=\sum_{m\mid t}[z^t]L$. In fact the contributing exponents of $L$ are $b-mh$, which run from $b$ to $-b$ in steps of $m$. The desired mean is consequently $[z^{2b}]R/(DC_0)$. Let $S=H'(2b+1)$ and $Z=4S+5$. We have $\|R\|_1\le S$. Compute $R(Z)$ by one call to the evaluator of $E$ at $(Z,\mathbf a)$ and use \[ \sum_{h=0}^{2b/m} Z^{mh} =\frac{Z^{2b+m}-1}{Z^m-1}. \] Write $R(z)=\sum_t r_tz^t$. In $R(Z)/Z^{2b}$ the terms of degree less than $2b$ have total absolute value at most $S/Z<1/4$. Its nearest integer therefore equals $\sum_{t\ge2b}r_tZ^{t-2b}$. The centered remainder of this integer modulo $Z$ is exactly $r_{2b}$, since $|r_{2b}|\le S0, \label{eq:assembly-words}\\ &0\le S,T,N_S,N_Ty$ as $x-y-1\ge0$ and $d\mid t$ as $t=dq$ for $d>0$. \item To obtain $k=\lfloor p/q\rfloor$ for $q>0$, use $kq\le p<(k+1)q$. For $k=\lceil p/q\rceil$ use $(k-1)q0$ is defined by $t-r=dv$ and $-d\le2r0$, certify $l=\ell(x)$ by $l\ge1$ and $2^{l-1}\le x<2^l$. The power graph in Appendix~\ref{sec:exact-power} itself uses only fixed-degree arithmetic, rational-coordinate tests and a fixed constant $2^{1024}$, so these substitutions terminate. \item Replace every resulting equation by its polynomial difference. Compile a conjunction of differences $f_i$ as $\sum_i f_i^2$ and a disjunction as $\prod_i f_i$. Rename witnesses apart in different branches. Witnesses in inactive branches can be set to zero. Both rules give the stated logical operation on integer zeros. \end{enumerate} Only the syntax of two fixed finite-arithmetic formulas and the fixed graph definitions determine the resulting repetitions and the variable count. The prime list is used in Lemma~\ref{lem:width-formulas} to define bit predicates. The grid points and the real number $\pi$ enter only the proof of the approximation bounds. The graph computes its rational parameter $P$ from $U$ by a binomial-coefficient extraction. Every prime-list bit and every subsequent digit is fixed by an exact graph. Once the formula $\Phi$ in Lemma~\ref{lem:width-formulas} is fixed, these finite substitutions determine a single integer polynomial for all input widths. \subsection{Proof of the main theorem} \begin{proof}[Proof of Theorem~\ref{thm:main}] \emph{Soundness.} Take any integer zero of $\mathcal P$. Its value of $n$ satisfies \eqref{eq:assembly-width}. For that width the two exact graphs in \eqref{eq:assembly-words} force the integers in \eqref{eq:width-words}. Equations \eqref{eq:assembly-residue} and the range restrictions select the least residues. By Lemma~\ref{lem:read} and \eqref{eq:assembly-ceil}, the residues of $S,T$ at the $i$th prime power are precisely the $i$th binary digits of $a,b$. The divisibility $D\mid S(1-T)$ excludes the pair $(1,0)$ in every position. Thus $a\preceq b$. This argument holds for every admitted width, including a width with arbitrarily many leading zeroes, and for witnesses of every size. \emph{Completeness.} Given $a\preceq b$, take $n_0=\max(1,\ell(a),\ell(b))$. Choose $S,T$ by the Chinese remainder theorem with component residues equal to the native digits. Their representatives in $[0,D)$ satisfy \eqref{eq:assembly-order}. Set $N_S,N_T$ to the two least residues. Lemma~\ref{lem:read} gives both ceiling inequalities, and the packing theorem supplies witnesses for the exact $D,J_{n_0}$. \emph{Bit length.} We have $n_0\le n$. The modulus has $O((n_0+2)^3)$ bits by Section~\ref{sec:residues}. Every quotient and slack in \eqref{eq:assembly-order}--\eqref{eq:assembly-ceil} can be chosen with $O(1+n_0+\ell(D))$ bits, since these expressions have fixed degree and $J_{n_0},S,T,N_S,N_TU^{248}$. The intervening projections preserve denominators and the products of denominators at arithmetic nodes preserve this lower bound. Along the indicated path the bit count therefore grows at least as $U^{248h}$. A bound $(n+2)^C$ covering these explicit intermediates needs $C\ge4960h>10^{599000}$. This estimate applies to the expanded formula and its specified denominator recurrence. Theorem~\ref{thm:main} leaves open how small an exponent a different representation could attain. The modular readout can be tested separately. With $D,J_n,2^{n+2}$ supplied, its five-input polynomial uses 17 natural witnesses and admits the bound $17(40(n+2)^3+7)$ on their total bit length. At $a=b=n=1$, \eqref{eq:width-words} gives $D=3^{14}=4{,}782{,}969$, $J_1=597{,}871$, and $2^{n+2}=8$. An explicit zero of this polynomial has total witness length 185 bits. The two-input polynomial of Theorem~\ref{thm:main} additionally certifies the three supplied values. \appendix \section{An exact integer power graph}\label{sec:exact-power} The coefficient extractions in the proof use variable exponents. The bounded Pell construction of Lipmaa already gives short witnesses for true powers \cite[Thm.~3]{lipmaa03}. Its soundness statement places a length condition on potential witnesses for false inputs. Here a constraint from rational points on an elliptic curve forces the index of the final Pell pair to equal the proposed exponent, for assignments of every length. All logarithms in this appendix have base two unless indicated otherwise. \Needspace{7\baselineskip} \begin{theorem}\label{thm:power-graph} There is a fixed integer polynomial $F(g,e,y,\mathbf w)$ such that, for every integer triple $(g,e,y)$, an integer zero in $\mathbf w$ exists exactly when $g,e,y\ge0$ and $y=g^e$, with $0^0=1$. For each triple in this relation there is a witnessing tuple of total bit length $O((1+\log(2+g+e+y))^4)$. The bound includes the size of the proposed output $y$. \end{theorem} The proof uses an integer $H_*$ with two properties. Its logarithm must be large enough to accommodate the intended Pell solution and small enough to exclude every larger candidate index. We construct the inequalities defining $H_*$ before introducing the Pell equations. \subsection{A size bound from consecutive rational points} Use $E\colon y^2+y=x^3-x$ and $P=(0,0)$. Its rational points form the infinite cyclic group generated by $P$ \cite{cremona,curve}. For an affine point $Q$ with $x(Q)=u/v$ in lowest terms and $v>0$, put $H(Q)=\max(|u|,v)$. Put $H(O)=1$ and $h(Q)=\log H(Q)$. \begin{lemma}\label{lem:power-height} For each integer $V\ge2^{1024}$ there exists $Q\in E(\mathbb Q)$ such that \begin{equation}\label{eq:power-adjacent} V H(Q)\le H(Q+P)\le V^2 H(Q). \end{equation} Every such $Q$ satisfies $\tfrac12(\log V)^2\le h(Q)\le45(\log V)^2$. \end{lemma} \begin{proof} The duplication formula gives $x(2Q)=F/G$, where \[ F=u^4+2u^2v^2-2uv^3+v^4,\qquad G=4u^3v-4uv^3+v^4. \] A finite rational $Q$ has $G\ne0$, since $E(\mathbb Q)$ has no nonzero point of order two. Completing the square gives $F=u^4+2(uv-v^2/2)^2+v^4/2$, and $\max(|F|,|G|)\le9H(Q)^4$. For the common divisor, write $f(X)=X^4+2X^2-2X+1$ and $d(X)=4X^3-4X+1$. Direct multiplication gives \[ (64-48X^2)f(X)+(12X^3+20X-27)d(X)=37. \] Substitute $X=u/v$ and multiply by $v^7$. Since $\gcd(F,v)=1$, the resulting identity shows $\gcd(F,G)\mid37$. Thus $H(Q)^4/74\le H(2Q)\le9H(Q)^4$, and in particular $|h(2Q)-4h(Q)|\le12$. The latter bound also holds at $O$. The limit $b(Q)=\lim_{k\to\infty}4^{-k}h(2^kQ)$ exists and differs from $h(Q)$ by at most $\sum_{k\ge1}12/4^k=4$. In Silverman's natural-log normalization, the even function $x$ has degree two, so $b(Q)=2\widehat h(Q)/\ln 2$. Quadraticity therefore gives $b(jP)=j^2 b(P)$ \cite[Chap.~VIII, Section~9, Thm.~9.3(b)]{silverman}. Write $\alpha=b(P)$. Four applications of the duplication formula give the reduced $x$-coordinates \[ x(2P)=1,\quad x(4P)=2,\quad x(8P)=21/25,\quad x(16P)=480106/4225. \] Since $180$. Therefore \[ \frac{(L-9)^2}{4\alpha}-4\le h(Q) \le \frac{(L+4)^2}{\alpha}+4 . \] The bounds on $\alpha$ and $L\ge1024$ imply both stated estimates. \end{proof} Apply the lemma first to $V$ and then to $H(Q)$ from the first application. The latter is at least $2^{1024}$. Let $H_*$ denote the height $H$ of the point from the second application. These two constraints admit a witness for every allowable $V$, and every witness satisfies \begin{equation}\label{eq:power-window} 2L^3 < L^4/8\le \log H_*\le 45^3L^4 < 2^L=V. \end{equation} For the rightmost inequality, $2^L/L^4$ is increasing for $L\ge1024$ and $45^3\cdot1024^4<2^{57}$. We specify how to impose \eqref{eq:power-adjacent} with integer variables. Each affine coordinate is a reduced fraction with positive denominator. A B\'ezout equation enforces coprimality. A separate flag represents $O$. Heights use absolute value and maximum, both finite cases. For $Q=(x,y)$ with $x\ne0$, introduce $\lambda=y/x$. Then $Q+P=(x',y')$ with $x'=\lambda^2-x$ and $y'=-1-\lambda x'$. The three other cases are $O+P=P$, $P+P=(1,0)$, and $(0,-1)+P=O$. These exhaust the possibilities since $x=0$ forces $y=0$ or $-1$. The equation of $E$, these addition equations, and \eqref{eq:power-adjacent} use a fixed number of operations on the integer coordinates. Their sizes are controlled by $h$. In particular \[ (2y+1)^2=(4u^3-4uv^2+v^3)/v^3 . \] The reduced numerator and denominator of the right hand side have magnitude at most $9H(Q)^3$. The reduced coordinates of $y$ consequently have $O(1+h(Q))$ bits. The same argument applies to $Q+P$. In both applications of the lemma, all coordinate numerators, denominators, B\'ezout coefficients, and comparison slacks may thus be chosen with $O(L^4)$ bits. The real logarithms occur only in this size estimate. \subsection{Selecting the exponent with two Pell equations} For an integer $C\ge4$ call a pair of integers $(s,t)$ admissible at $C$ if $0\le s0$, the preceding pair is $(Cs-t,s)$ with $Cs-t=(s^2-1)/t$ an integer in $[0,s)$. The same quadratic expression has value one on the preceding pair. Descent ends at $(0,1)$. Conversely, the recurrence preserves the equation and strict increase. Two bounds we will use are \begin{equation}\label{eq:power-recurrence} U_j\equiv j\pmod{C-2},\qquad (C-1)^j\le U_{j+1}\le C^j . \end{equation} The congruence follows by reducing the recurrence modulo $C-2$. The inequalities follow from $(C-1)U_{j+1}\le U_{j+2}\le C U_{j+1}$. \begin{proof}[Proof of Theorem~\ref{thm:power-graph}] Impose $g,e,y\ge0$ in all branches. First take $g\ge2$. Set $T=g+e+y+2^{1024}$, $c=T+5$, and use $V=T$ in the two height constraints producing $H_*$. The following are all the remaining conditions on the graph. \begin{enumerate} \item Choose $(s_0,t_0)$ admissible at $c$ with $s_0\equiv e\pmod{c-2}$. Define $A=t_0+g^2+y+T+10$ and $m=Ag-g^2-1$. \item Choose $(s,t)$ admissible at $A$ and require \[ s\equiv e\pmod{A-2},\qquad y\equiv t+(g-A)s\pmod m,\qquad t\le H_* . \] \end{enumerate} For soundness, \eqref{eq:power-recurrence} implies that the first index is congruent to $e$ modulo $c-2$ and hence is at least $e$. It follows that $t_0\ge(c-1)^e\ge g^e$. Further, $m\ge2A-g^2-1>A>\max(t_0,y)$. If the second index is $j$, then $j\equiv e\pmod{A-2}$ with $0\le eT$, so that $\log t\ge j\log(A-1)>T$. This contradicts \eqref{eq:power-window}. Hence $j=e$. At coefficient $A$ the sequence $R_j=U_{j+1}+(g-A)U_j$ starts with $1,g$ and follows the same second-order recurrence as $U_j$. Since $g^2\equiv Ag-1\pmod m$, induction gives $R_j\equiv g^j\pmod m$. Thus $y\equiv g^e\pmod m$. Both sides belong to $[0,m)$, and equality follows. For completeness take $y=g^e$ and use index $e$ in each pair. With $L=\log T$ we have $e\le L$ and $\log t_0\le e\log(T+5)\le L(L+1)$. Each of the five positive summands defining $A$ is at most $2^{L(L+1)}$. Therefore $\log A\le L^2+L+3$ and $\log t\le e\log A<2L^3$. Every admissible $H_*$ thus accepts the intended pair. The congruences hold by \eqref{eq:power-recurrence} and the identity for $R_j$. All Pell variables, congruence quotients, and fixed-degree intermediate results can be chosen with $O(L^4)$ bits, including the height variables and the slack $H_*-t$. For $g=1$ impose $y=1$. For $g=0$ use the cases $(e=0,y=1)$ and $(e>0,y=0)$. Nonnegativity, divisibility, and all the finite alternatives above compile by the rules of Section~\ref{sec:arithmetic}. The number of variables is fixed and four-square witnesses for a nonnegative slack have bit length bounded by that of the slack plus one. This gives the claimed total bound. For use with signed integer bases the same graph applies to the magnitude, with one parity test on $e$ to determine the sign of the output. \end{proof} \clearpage \section{Lean formalization}\label{sec:lean} The \href{https://github.com/tteg33/math/tree/main/complexity_theory/D_NP/lean/DiophantineNP}{Lean sources and build instructions} are available in the public repository \texttt{tteg33/math}. The development uses Lean~4.24.0 and mathlib revision \texttt{f897ebcf72cd}. All declaration names below are relative to the namespace \texttt{DiophantineNP}. \paragraph{Statements.} \texttt{Statement.lean} defines \texttt{NativeVerifier}, with the polynomial and number of witness slots quantified before the input width. \texttt{Classes.lean} defines the two classes on subsets of $\mathbb N$. The file \texttt{HABVerified.lean} contains the closed theorems \begin{center} \begin{tabular}{@{}ll@{}} \texttt{nativeVerifier} & Theorem~\ref{thm:main}, including soundness for every integer root.\\[2pt] \texttt{classEquality} & Corollary~\ref{cor:classes} with a total witness-bit bound.\\[2pt] \texttt{classEquality\_powerCutoff} & The same equality with inclusive per-coordinate cutoffs. \end{tabular} \end{center} \paragraph{Proof dependencies.} The theorem \texttt{HAB.corollary63} constructs the division and iterated-product formulas of Hesse, Allender and Barrington \cite{hab}. For the product, two indices address the $U^2$ output bits for $U$ words of $U$ bits. The formulas use order, bit access, the input relation and unary strict majority. The iterated-product result supplies the width formulas of Lemma~\ref{lem:width-formulas}. For Appendix~\ref{sec:exact-power}, \texttt{CubicDescent.lean} contains \texttt{Curve37.rank\_one}, and \texttt{PowerPolynomial.lean} gives the integer-power verifier. The explicit padding construction in Section~\ref{sec:literal-size} appears in \texttt{HABPolylogProduct.lean} and \texttt{HABShortLift.lean}. The 185-bit example is checked in \texttt{review/WidthOne.lean}. \paragraph{Machine and certificate conventions.} The class-equality proof compiles as many bit masks as the fixed machine requires. The table equivalence and its witness bound appear in \texttt{TraceChecker.lean}. The forward transfer from a verifier to an equation appears in \texttt{RegisterNativeTrace.lean} and \texttt{NativeComplexity.lean}. The converse uses the polynomial evaluator in \texttt{VerifiedCompilers.lean}. The correction to the printed halving mask appears in \texttt{JMTableau.lean}. The exact single-mask normal form of \cite[eq.~(53)]{jm} is a premise of a separate, conditional result. The direct proof of \texttt{classEquality} uses the finite family of masks. \texttt{CoordinateClass.lean} compares the different witness cutoffs. The clocked characterization of the deterministic finite-alphabet verifier is in \texttt{ClockedVerifier.lean}. For a raw binary certificate $s$, the scanner in \texttt{review/CertificateTransducer.lean} checks its format and emits the framed fields in at most $|s|+1$ steps. Its final theorems combine this bound with the verifier clock. The development stops at this verifier characterization. A direct implementation on a single nondeterministic tape with arbitrary string inputs lies outside its scope. \paragraph{Verification record.} The repository's \href{https://github.com/tteg33/math/blob/main/complexity_theory/D_NP/lean/DiophantineNP/VERIFICATION.txt}{verification record} documents a clean rebuild of the project on 27 November 2026 using the pinned dependency cache. The recorded kernel replay checked 10,213 safe, total project declarations, including all 7,145 theorems. The axiom audit reported \texttt{propext}, \texttt{Classical.choice} and \texttt{Quot.sound}. Reproduction commands and the project-level replay log accompany that record. \begingroup \small \begin{thebibliography}{10} \setlength{\itemsep}{2pt} \bibitem{am} L. Adleman and K. Manders, Diophantine complexity, \emph{17th Annual Symposium on Foundations of Computer Science}, IEEE, 1976, 81--88. \href{https://doi.org/10.1109/SFCS.1976.13}{Publisher's version}. \bibitem{cpp} G. Couteau, T. Peters and D. Pointcheval, Removing the Strong RSA assumption from arguments over the integers, \emph{Advances in Cryptology---EUROCRYPT 2017}, Lecture Notes in Computer Science \textbf{10211}, Springer, 2017, 321--350. \href{https://doi.org/10.1007/978-3-319-56614-6_11}{Publisher's version}. \href{https://eprint.iacr.org/2016/128}{Full version}. \bibitem{cremona} J. E. Cremona, \emph{Algorithms for Modular Elliptic Curves}, 2nd ed., Cambridge University Press, 1997, Tables 1 and 2, entry 37A1. \href{https://wstein.org/edu/Fall2003/252/references/cremona-algs/Cremona-Algorithms_for_modular_elliptic_curves.pdf}{Electronic edition}. \bibitem{hab} W. Hesse, E. Allender and D. A. Mix Barrington, Uniform constant-depth threshold circuits for division and iterated multiplication, \emph{Journal of Computer and System Sciences} \textbf{65} (2002), 695--716. \href{https://people.cs.rutgers.edu/~allender/papers/division.pdf}{Author's version}. \bibitem{jm} J. P. Jones and Yu. V. Matiyasevich, Register machine proof of the theorem on exponential Diophantine representation of enumerable sets, \emph{Journal of Symbolic Logic} \textbf{49} (1984), 818--829. \href{https://www.cambridge.org/core/journals/journal-of-symbolic-logic/article/abs/register-machine-proof-of-the-theorem-on-exponential-diophantine-representation-of-enumerable-sets/A2A8808B208B10A9D71BF54B6E7DA10E}{Publisher's version}. \bibitem{kojelis} D. Kojelis, \emph{Extended Counting Quantifiers and Generalisations of the Fluted Fragment of First-order Logic}, Ph.D. thesis, University of Manchester, 2025, Chap.~8. \href{https://research.manchester.ac.uk/en/studentTheses/extended-counting-quantifiers-and-generalisations-of-the-fluted-f/}{University record}. \bibitem{libkin} L. Libkin, \emph{Elements of Finite Model Theory}, Springer, 2004, Cor.~6.15. \href{https://www.cs.toronto.edu/~libkin/fmt/fmt.pdf}{Author's version}. \bibitem{lipmaa03} H. Lipmaa, On Diophantine complexity and statistical zero-knowledge arguments, \emph{Advances in Cryptology---ASIACRYPT 2003}, Lecture Notes in Computer Science \textbf{2894}, Springer, 2003, 398--415. \href{https://doi.org/10.1007/978-3-540-40061-5_26}{Publisher's version}. \bibitem{lipmaa} H. Lipmaa, Statistical zero-knowledge arguments: theory and practice, \emph{European Congress on Computational Methods in Applied Sciences and Engineering}, 2004, Section~4.3. \href{https://kodu.ut.ee/~lipmaa/papers/lip04/eccomas.pdf}{Author's version}. \bibitem{curve} LMFDB Collaboration, Elliptic curve over $\mathbb Q$ with label 37.a1 (Cremona label 37a1), Mordell--Weil group and generators. \href{https://www.lmfdb.org/EllipticCurve/Q/37/a/1}{Database record}. \bibitem{pollett} C. Pollett, On the bounded version of Hilbert's tenth problem, \emph{Archive for Mathematical Logic} \textbf{42} (2003), 469--488. \href{https://www.cs.sjsu.edu/faculty/pollett/papers/hilbert10.pdf}{Author's version}. \bibitem{silverman} J. H. Silverman, \emph{The Arithmetic of Elliptic Curves}, 2nd ed., Graduate Texts in Mathematics 106, Springer, 2009, Chap.~VIII, Section~9. \href{https://doi.org/10.1007/978-0-387-09494-6}{Publisher's version}. \bibitem{astra} OpenAI, \emph{GPT-6.2 Astra}, model documentation, 2026. \href{https://developers.openai.com/api/docs/models/gpt-6.2-astra}{OpenAI API documentation}. \end{thebibliography} \endgroup \section*{Disclosure of AI use} OpenAI's GPT-6.2 Astra~\cite{astra} was used to survey the relevant literature and revise the exposition. It supplied a counterexample to the implication from (49) to (50) in the halving construction of Jones and Matiyasevich~\cite[Section~5, p.~827]{jm}, suggested the modular idempotent argument in Section~\ref{sec:residues}, and formalized the proof in Lean~4 as described in Appendix~\ref{sec:lean}. \end{document}