arXiv:2610.37179cs.CCOct 2026

Manuscript Offprint

arXiv:2610.37179

Irreducibility Testing of Sparse Polynomials over Integers is NP-hard and Probabilistic Polynomial Time

Yichuan Cao, Xiao-Shan Gao, Qiao-Long Huang, Jiawei Nie

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

In this paper, we prove that irreducibility testing for sparse polynomials in Z[X]\mathbb{Z}[X] is coNP-hard under deterministic polynomial-time many-one reductions. That is, there exists no polynomial-time irreducibility test algorithm unless P=NP\mathbf{P} = \mathbf{NP}. We also provide an upper bound for this problem by demonstrating that the same irreducibility testing problem lies in PP⊆PSPACE\mathbf{PP} \subseteq \mathbf{PSPACE}; in other words, it can be solved in probabilistic polynomial time and, moreover, within polynomial space. The fact that SparselredZ∈PP\text{Sparselred}_{\mathbb{Z}} \in \mathbf{PP} relies on the quasi-Riemann hypothesis result of Cureton–Thorner and on the uniform effective prime-ideal bound by Frei–Sofos–Widmer just posted recently.

1 Introduction

Polynomial factorization is a central problem in algebraic and symbolic computation, and substantial progress has been made in developing efficient algorithms. This extensive research has produced effective randomized algorithms for polynomial factorization, which have significant applications in complexity theory, coding theory, and cryptography [21].

For dense univariate polynomials, factoring over finite fields admits randomized polynomial-time (Las Vegas) algorithms [3], and irreducibility testing (abbr. irreducibility) follows as a consequence. However, deterministic polynomial-time factorization over finite fields remains open. Over integers, factorization and irreducibility are deterministic in polynomial time via the seminal LLL algorithm [15]. When polynomials are instead given by compact representations such as straight-line programs or sparse (lacunary) sums, the complexity of factorization is surveyed in [11], and a retrospective on the algorithmic progress in polynomial factorization is given in [12].

In practical settings and in mathematical software like Maple, polynomials are typically represented in sparse form—that is, as lists of their exponents and coefficients. Factorization of sparse polynomials is quite different from that of dense ones. The simple example below illustrates that a reducible sparse polynomial can have an irreducible factor with exponentially many nonzero terms compared to the size of the original polynomial. Therefore, there exists no polynomial-time factorization algorithm for sparse polynomials.

Example 1. Let p be an odd prime. Then

f(x)=xp−1=∏d∣pΦd(x)=Φ1(x)Φp(x)∈Z[x]f(x)=x^{p}-1=\prod_{d\mid p}\Phi_{d}(x)=\Phi_{1}(x)\Phi_{p}(x)\in\mathbb{Z}[x]

where each cyclotomic polynomial Φd(x)\Phi_d(x) is irreducible over Z[x]\mathbb{Z}[x]. The size of f(x)f(x) is O(log⁡p)O(\log p). The polynomial Φp(x)\Phi_p(x) contains pp nonzero terms, and its size grows exponentially relative to the input size O(log⁡p)O(\log p) of f(x)f(x).

Recently, Mishra [17] proves that for every sufficiently large m, there exists an f∈Q[x]f \in \mathbb{Q}[x] with exactly m nonzero coefficients such that every irreducible factor of f over Q\mathbb{Q} has more than exp⁡(cm/log⁡m)\exp(c\sqrt{m/\log m}) nonzero coefficients. Thus, for such f, every irreducible factor has a superpolynomial number of terms in m.

1^{1}State Key Laboratory of Mathematical Sciences, Academy of Mathematics and Systems Science, Chinese Academy of Sciences; University of Chinese Academy of Sciences

2^{2}School of Mathematics, Shandong University

Therefore, for sparse polynomials, the complexity of testing irreducibility can differ substantially from that of factoring, because a sparse polynomial may have irreducible factors that are dense, making straightforward enumeration of candidate factors infeasible. Based on the seminal work on the complexity of sparse polynomial operations [18], Kaltofen and Koiran [13] proved that irreducibility testing for bi-variate sparse polynomials over integers or sufficiently large finite fields is coNP-hard under randomized polynomial-time many-one reductions. In [4], a similar result is proved for arbitrary fields; precisely, irreducibility for bi-variate sparse polynomials over any field is coNP-hard under deterministic polynomial-time many-one reductions.

In this paper, we consider the following basic problem.

Problem Sparselrred_Z. Given a polynomial f∈Z[X]f \in \mathbb{Z}[X] in sparse form ⟨f⟩={(ei,ai)}i≤τ\langle f \rangle = \{(e_i, a_i)\}_{i \leq \tau}, of size ∑i(log⁡∣ai∣+log⁡ei+O(1))\sum_i (\log |a_i| + \log e_i + O(1)) bits, decide whether ff is irreducible in Z[X]\mathbb{Z}[X].

An instance of the problem is a polynomial f∈Z[X]f \in \mathbb{Z}[X] given in sparse (supersparse) form, that is, as a list of its nonzero terms

⟨f⟩={(e1,a1),…,(eτ,aτ)},ai∈Z∖{0}, eipairwisedistinct,(1)\langle f\rangle=\{(e_{1},a_{1}),\dots,(e_{\tau},a_{\tau})\},\qquad a_{i}\in\mathbb{Z}\setminus\{0\},\ e_{i}\mathrm{p a i r w i s e}\mathrm{d i s t i n c t}, \tag{1}

where τ=tc(f)\tau = \mathrm{tc}(f) is the number of nonzero terms of ff and nn the degree of ff. Its size is

L=size(f)=∑i=1τ(log⁡∣ai∣+log⁡ei+2)bits.L=\mathrm{size}(f)=\sum_{i=1}^{\tau}\left(\log|a_{i}|+\log e_{i}+2\right)\mathrm{bits}.

Only the logarithms of the exponents are charged, so a polynomial of exponentially large degree may still have an input of polynomial length; consequently, no polynomial-time algorithm may traverse ff term by term up to its degree. The decision problem is to decide, in time polynomial in size(f)(f), whether such an ff is irreducible in Z[X]\mathbb{Z}[X] (equivalently, whether ff is reducible, i.e. f=ghf = gh for some nonunits g,h∈Z[X]g, h \in \mathbb{Z}[X]).

The computational complexity of testing irreducibility for univariate sparse polynomials has remained unresolved for a long time, as noted either explicitly or implicitly in [8, 13, 14, 19]. In [14], it was mentioned that “another interesting related question to which probably can be studied by the method of this paper (Hilbert irreducibility) is deciding irreducibility of sparse polynomials (in Z[X]\mathbb{Z}[X]).” In [13], it was mentioned that “the hardness of sparse irreducibility in Fq[X]\mathbb{F}_q[X] remains open.” Open problem 7 in [19] implicitly assumed irreducibility over Z\mathbb{Z} as an open problem. Furthermore, the irreducibility of univariate sparse polynomials cannot be deduced from the CoNP-hardness of testing irreducibility for bivariate sparse polynomials because, in [13], the polynomials studied have the special shape F(X,Y)=f(x)+YMg(x)F(X,Y) = f(x) + Y^M g(x) with M>0M > 0 and f≠0f \neq 0, and F(X,Y)F(X,Y) is irreducible precisely when f(x)f(x) and g(x)g(x) are coprime.