Papers
Topics
Authors
Recent
Gemini 2.5 Flash
Gemini 2.5 Flash
133 tokens/sec
GPT-4o
7 tokens/sec
Gemini 2.5 Pro Pro
46 tokens/sec
o3 Pro
4 tokens/sec
GPT-4.1 Pro
38 tokens/sec
DeepSeek R1 via Azure Pro
28 tokens/sec
2000 character limit reached

A Formal Proof of Complexity Bounds on Diophantine Equations (2505.16963v1)

Published 22 May 2025 in cs.LO and math.NT

Abstract: We present a universal construction of Diophantine equations with bounded complexity in Isabelle/HOL. This is a formalization of our own work in number theory. Hilbert's Tenth Problem was answered negatively by Yuri Matiyasevich, who showed that there is no general algorithm to decide whether an arbitrary Diophantine equation has a solution. However, the problem remains open when generalized to the field of rational numbers, or contrarily, when restricted to Diophantine equations with bounded complexity, characterized by the number of variables $\nu$ and the degree $\delta$. If every Diophantine set can be represented within the bounds $(\nu, \delta)$, we say that this pair is universal, and it follows that the corresponding class of equations is undecidable. In a separate mathematics article, we have determined the first non-trivial universal pair for the case of integer unknowns. In this paper, we contribute a formal verification of the main construction required to establish said universal pair. In doing so, we markedly extend the Isabelle AFP entry on multivariate polynomials, formalize parts of a number theory textbook, and develop classical theory on Diophantine equations in Isabelle. Additionally, our work includes metaprogramming infrastructure designed to efficiently handle complex definitions of multivariate polynomials. Our mathematical draft has been formalized while the mathematical research was ongoing, and benefitted largely from the help of the theorem prover. We reflect how the close collaboration between mathematician and computer is an uncommon but promising modus operandi.

Summary

  • The paper presents a formal Isabelle/HOL proof that constructs a universal pair (11, δ) to show the undecidability of Diophantine equations with bounded complexity.
  • Key methodologies include the Coding Theorem, Lucas sequences related to Pell’s equation, and the Matiyasevich-Robinson lemma to combine complex Diophantine conditions.
  • The research employs custom metaprogramming infrastructure to manage over 20,000 lines of formal proof, significantly advancing the library of verified mathematical results.

This paper (2505.16963) presents a formal verification in Isabelle/HOL of results concerning the complexity of Diophantine equations, specifically focusing on establishing a universal pair over the integers (\in). This work builds upon the known undecidability of Hilbert's Tenth Problem, which states there is no general algorithm to determine if an arbitrary Diophantine equation has integer solutions. The paper explores the problem when restricted to equations with bounded complexity, measured by the number of variables (ν\nu) and total degree (δ\delta). A pair (ν,δ)(\nu, \delta) is considered "universal" if every Diophantine set (a set of parameters for which a Diophantine equation has solutions) can be represented by a polynomial within these complexity bounds. If such a pair is universal, the class of equations defined by these bounds is also undecidable.

The primary contribution is the formalization of a construction that demonstrates the universality of the pair $(11, \eta(\nu, \delta))_$, where η\eta is a function of a known universal pair over natural numbers $(\nu, \delta)_$. This is the first formal derivation of a non-trivial universal pair over the integers, improving upon trivial bounds that would arise from simply converting natural number unknowns (like in the known $(9, \delta)_$ case) to integers using representations like Lagrange's four-square theorem.

The formal proof in Isabelle/HOL, totaling 20,000 lines, relies on extending existing libraries and formalizing concepts from number theory and computability theory. The core of the proof is the construction of a polynomial Q~\tilde Q with 11 integer unknowns that is equivalent in solvability over the integers to an arbitrary Diophantine polynomial PP with any number of natural number unknowns. This construction is broken down into several key stages:

  1. Coding Theorem: This theorem provides a mechanism to encode the solvability of a general Diophantine equation P(a,z1,,zν)=0P(a, z_1, \ldots, z_\nu)=0 (with ziz_i \in and aa \in) into an equivalent Diophantine relation involving only the parameter aa and two new variables f,gf, g \in. This relation involves checking if b(a,f)b(a, f) is a power of two and if a binomial coefficient (2KK)\binom{2K}{K} is divisible by gg, where bb and KK are polynomials in a,f,ga, f, g. The formalization of this step uses Isabelle's library for digit expansions and requires formalizing properties of factorials and multinomial coefficients. The equivalence takes the form: z1,,zν[0,b)ν:P(a,z1,,zν)=0    g[b,γbα):S(a,f,g)(2K(a,f,g)K(a,f,g))\exists z_1, \dots, z_\nu \in [0, b)^\nu : P(a, z_1, \dots, z_\nu) = 0 \iff \exists g \in [b, \gamma b^\alpha) : \mathscr{S}(a, f, g) \mid \binom{2\mathscr{K}(a, f, g)}{\mathscr{K}(a, f, g)}, where S,K\mathscr{S}, \mathscr{K} are polynomials. In Isabelle, this is represented within a locale coding_theorem that manages the dependencies between the parameter a, variable f, and the generated polynomials:
    1
    2
    3
    
    locale coding_theorem = coding_variables +
    assumes a_nonneg: "a %%%%23%%%% 0"
    (* ... other assumptions like f > 0, b is power of 2 ... *)
    The formal statement of the theorem's reverse direction involves checking the existence of g satisfying the range and divisibility conditions:
    1
    2
    3
    
    theorem coding_theorem_reverse':
    assumes "%%%%24%%%%g. 0 %%%%25%%%% g %%%%26%%%% g < 2*(int %%%%27%%%%)*%%%%28%%%%^%%%%29%%%% %%%%30%%%% %%%%31%%%% g) choose nat (%%%%90%%%% g))"
    shows "%%%%32%%%%z. z 0 = a %%%%33%%%% (%%%%34%%%%i. 0 %%%%35%%%% z i %%%%36%%%% z i < %%%%37%%%%) %%%%38%%%% insertion z P = 0"
  2. Lucas Sequences and Pell Equation (Bridge Theorem): The exponential and binomial coefficient conditions from the Coding Theorem are not directly elementary polynomial relations. The Bridge Theorem [(2505.16963), Theorem 2] translates these into conditions involving perfect squares, divisibility, and inequality, which are amenable to the Matiyasevich-Robinson relation combining technique. This translation relies heavily on the properties of Lucas sequences and their connection to solutions of Pell's equation X2dY2=4X^2 - dY^2 = 4. The formalization defines Lucas sequences ψn(A)\psi_n(A) and χn(A)\chi_n(A) recursively for natural numbers and extends them to integers.
    1
    2
    
    fun %%%%42%%%% :: "int %%%%43%%%% nat %%%%44%%%% int" where ...
    definition %%%%45%%%%_int :: "int %%%%46%%%% int %%%%47%%%% int" where ...
    A key lemma formalized is that pairs (χn(A),ψn(A))(\chi_n(A), \psi_n(A)) are solutions to X2(A24)Y2=4X^2 - (A^2-4)Y^2 = 4:
    1
    
    lemma lucas_solves_pell: "(A%%%%50%%%%-4)*(%%%%51%%%%_int A m)%%%%52%%%% + 4 = (%%%%53%%%%_int A m)%%%%54%%%%"
    The Bridge Theorem itself involves a complex definition of auxiliary variables based on the inputs (b,X,Y,gb, X, Y, g) and additional unknowns (h,k,l,w,x,yh, k, l, w, x, y). These variables are constructed such that specific combinations of them must be perfect squares, satisfy a divisibility condition, and an inequality, if and only if bb is a power of two and Y(2XX)Y \mid \binom{2X}{X}. The formalization structures these complex dependencies using a locale bridge_variables.
  3. Relation Combining (Matiyasevich-Robinson Lemma): This technique, based on work by Matiyasevich and Robinson [MR75], shows that a conjunction of conditions like STS|T, R>0R>0, and A1,,AqA_1, \ldots, A_q being perfect squares can be expressed as the existence of a single non-negative integer nn such that Mq(A1,,Aq,S,T,R,n)=0M_q(A_1, \dots, A_q, S, T, R, n) = 0, where MqM_q is a specific polynomial. The paper uses the q=3q=3 case. This lemma is crucial for consolidating the various Diophantine relations derived from the Bridge Theorem into a single polynomial equation.
    1
    2
    3
    4
    
    lemma relation_combining:
    assumes "S %%%%66%%%% 0"
    shows "(S dvd T %%%%67%%%% R > 0 %%%%68%%%% is_square A%%%%69%%%% %%%%70%%%% is_square A%%%%71%%%% %%%%72%%%% is_square A%%%%73%%%%)
    = (%%%%74%%%%n%%%%75%%%%0. M3 A%%%%76%%%% A%%%%77%%%% A%%%%78%%%% S T R n = 0)"

Combining these three steps allows the authors to prove an intermediate result (Theorem 3 (2505.16963)), stating that any Diophantine equation over natural numbers P(a,z1,,zν)=0P(a, z_1, \ldots, z_\nu)=0 is equivalent to the existence of 8 integer unknowns and 1 natural number unknown satisfying a polynomial equation Q(a,f,g,h,k,l,w,x,y,n)=0Q(a, f, g, h, k, l, w, x, y, n)=0.

The final step to reach 11 integer unknowns utilizes the Three Squares Theorem (n0    n1,n2,n3:n=n12+n22+n32+n3n \geq 0 \iff \exists n_1, n_2, n_3 \in : n = n_1^2 + n_2^2 + n_3^2 + n_3). By substituting n12+n22+n32+n3n_1^2 + n_2^2 + n_3^2 + n_3 for the natural number unknown nn in QQ, they obtain the polynomial Q~(a,f,g,h,k,l,w,x,y,n1,n2,n3)\tilde Q(a, f, g, h, k, l, w, x, y, n_1, n_2, n_3), which has 11 integer unknowns and is equivalent in solvability to QQ over integers (with n0n \geq 0). This proves Theorem 11-unknowns (2505.16963), showing any Diophantine equation over natural numbers is equivalent to one with 11 integer unknowns.

The practical implementation aspect is less about building a runnable application and more about constructing a complex formal proof within a theorem prover. The authors developed custom metaprogramming infrastructure (\texttt{poly_extract}) to manage the large and complex polynomials arising from the many substitutions. This framework helps bridge the gap between abstract Isabelle terms and the formal int mpoly type, simplifying the definition and manipulation of these polynomials.

1
2
3
4
5
6
7
8
9
10
(* Example of using poly_extract conceptually *)
(* Define a polynomial using standard Isabelle function syntax *)
definition MyPoly_term :: "int => int => int"
where "MyPoly_term x y = x^2 + y^2 - 5"

(* Use poly_extract to convert it to the mpoly type *)
lemma MyPoly_mpoly_def: "MyPoly_poly = poly_extract MyPoly_term"
(* Q_tilde_poly is built similarly from compositions of simpler polynomials *)
definition Q_tilde_poly :: "int mpoly %%%%88%%%% int mpoly"
where "Q_tilde_poly P = poly_subst f (Q_poly P)" (* Conceptual substitution *)

A significant outcome of this project is the formalization of a substantial body of mathematical results in number theory and polynomial theory within Isabelle/HOL, contributing to the library of verified mathematics. The paper highlights the benefits of formalizing mathematics in-situ, i.e., in parallel with the mathematical research, as the proof assistant helped refine definitions, identify missing assumptions, and correct errors in the draft manuscript.

While the theorems themselves are fundamental results in computability and number theory with implications for the theoretical limits of algorithms, the practical application discussed in the paper is primarily the formal verification methodology and the development of reusable formal libraries. The proof demonstrates a complex, multi-step construction formalized rigorously, pushing the boundaries of what is formally verified. The explicit universal pair $(11, \delta)_$ provides a concrete bound on the complexity threshold for undecidability of Diophantine equations over integers.