Sparse Polynomial Interpolation Based on Derivative
aa r X i v : . [ c s . S C ] J a n Sparse Polynomial Interpolation Based on Derivative
Qiao-Long HuangResearch Center for Mathematics and Interdisciplinary SciencesShandong University, Qingdao, ChinaEmail: [email protected]
Abstract
In this paper, we propose two new interpolation algorithms for sparse multivariate polyno-mials represented by a straight-line program(SLP). Both of our algorithms work over any finitefields F q with large characteristic. The first one is a Monte Carlo randomized algorithm. Itsarithmetic complexity is linear in the number T of non-zero terms of f , in the number n ofvariables. If q is O (( nT D ) (1) ), where D is the partial degree bound, then our algorithm hasbetter complexity than other existing algorithms. The second one is a deterministic algorithm.It has better complexity than existing deterministic algorithms over a field with large charac-teristic. Its arithmetic complexity is quadratic in n, T, log D , i.e., quadratic in the size of thesparse representation. And we also show that the complexity of our deterministic algorithm isthe same as the one of deterministic zero-testing of Bl¨aser et al. [7] for the polynomial given byan SLP over finite field (for large characteristic). We consider the problem of interpolating a sparse multivariate polynomial f = c m + · · · + c t m t ∈ F q [ x , . . . , x n ]of degree d with t non-zero terms c i m i , where c , . . . , c t are coefficients over a finite field F q and m i , i = 1 , . . . , t are distinct monomials. We assume f is given by a straight-line program andthat we know bounds D > max ni =1 deg x i f and T ≥ t . Denote char ( F q ) to be the characteristicof F q .We summarize our results as follows. Theorem 1.1
Let f ∈ F q [ x , . . . , x n ] , where F q is a field. Given any straight-line program S f of length L that computes f , and bounds T and D for the sparsity and partial degree of f . • If char ( F q ) ≥ D , one can find all coefficients and exponents of f , with probability at least , with a cost of O ∼ ( LT log q + nT log q + T log q ) bit operations. • If char ( F q ) > O ∼ ( n T D ) ∗ , one can find all coefficients and exponents of f , with a cost of O ∼ ( Ln T log D log q ) bit operations ∗ More explicitly, char ( F q ) > npD , where p is the first N -th prime and N = 4 max { , ⌈ n ( T −
1) log D ⌉} . .1 The Straight-Line Program Model and Interpolation The straight-line program is a useful abstraction of a computer program without branches. Itis also an important model as a theoretical construct. Our interpolation algorithms work for n -variate sparse polynomials f ∈ F q [ x , x , . . . , x n ] given by a division-free straight-line program S f defined as follows.A division-free Straight-Line Program (SLP) over a ring R is a branchless sequence of arith-metic instructions that represents a polynomial function. Definition 1.2
A Straight-Line Program(SLP) over a ring R with inputs x , . . . , x n is a se-quence of arithmetic instructions Γ = (Γ , . . . , Γ L ) of the form Γ i = ( b i ← α ⋆ β ) (1) where ⋆ ∈ { + , − , ×} and α, β ∈ { x , . . . , x n } S { b j | j < i } S R . We say b L is the output for achoice of inputs x , . . . , x n . L denotes the length of an SLP. Since an SLP gives us a list of arithmetic instructions, wemay choose inputs x i from R , homomorphic images of R , or ring extensions. We say Γ computes f ∈ R [ x , . . . , x n ] if it outputs b L = f given indeterminate inputs x , . . . , x n . We write S f todenote an SLP that computes f . In our paper, the ring R we used is a finite field F q . The sparse interpolation for multivariate polynomials has received considerable interest. Thereare two basic models for this problem: the polynomial is either given as a straight-line program(SLP) [1, 2, 3, 4, 8, 10, 12, 14, 15] or a more general black-box [6, 13, 16, 17, 20]. As pointedout in [8], for black-box polynomials with degree d , there exist no algorithms yet, which worksfor arbitrary fields and have complexities polynomial in log d , while for SLP polynomials, it ispossible to give algorithms with complexities polynomial in log d .Following [2], we give a brief introduction to some algorithms specifically intended forstraight-line programs. The Garg − Schost Deterministic Algorithm . Garg and Schost [8] gave a deterministicinterpolation algorithm for a univariate polynomial given by an SLP. Their basic idea consists inevaluating the unknown polynomial f at roots of unity; they constructed these roots by workingin extensions of the base ring R of the form R [ x ] / ( x p i − p i , by recovering f from f mod ( x p i −
1) for O ( T log D ) different primes p i . Their algorithm constructed aninteger symmetric polynomial with roots at the exponents of f : χ ( y ) = t Y i =1 ( y − e i ) ∈ Z [ y ]which is then factored to obtain the exponents e i . Their algorithm first finds a good prime:a prime p for which the terms of f remain distinct when reduced modulo x p −
1. The image f mod ( x p −
1) gives us the values e i mod p and hence χ ( y ) mod p .Giesbrecht and Roche[10] gave a probabilistic method to find the good prime. It improvesGarg and Schost’s algorithm by a factor O ( T ), but becomes a Las Vegas algorithm. The “ Diversified ” Interpolation Algorithm . Giesbrecht and Roche [10] introduced theidea diversification. A polynomial f is said to be diverse if its coefficients c i are pairwise distinct.The authors show that for appropriate random choices of α , f ( αx ) is diverse with probabilityat least . They then try to interpolate the diversified polynomial f ( αx ). As f ( αx ) is diverse,we can recognize which terms in different good images are images of the same term. Thus, asall the e i are at most D , we can get all the exponents e i by looking at some O ∼ (log D ) imagesof f . eterministic Zero Testing . All the Monte Carlo algorithms can be made Las Vegas(i.e., no possibility of erroneous output, but unbounded worst-case running time) by way ofdeterministic zero-testing. Given a polynomial f represented by a straight-line program, suppose f ∗ is the output of a Monte Carlo algorithm that interpolate f , the following theorem is usedto test whether f = f ∗ . Theorem 1.3 (Bl¨aser et al. (2009); Lemma 13)
Let R be an integral domain, f, f ∗ ∈ R [ x ] and f − f ∗ ) ≤ T, deg( f − f ∗ ) ≤ D , and suppose f = f ∗ mod ( x p − for T log D primes.Then f = f ∗ . Thus, testing the correctness of the output of a Monte Carlo algorithm requires some O ∼ ( T log D ) probes of degree at most O ∼ ( T log D ). We will show that the complexity of the de-terministic zero-testing is the same as the one of deterministic interpolation algorithm presentedin this paper if R is finite field F q with large characteristic, (i.e. our deterministic interpolationalgorithm is as easy as the deterministic zero-testing of Bl¨aser et al.). Recursive Interpolation . Arnold, Giesbrecht and Roche [2] gave a faster recursive algo-rithm, which is the first time to deduce the complexity about T into linear. The chief noveltybehind that algorithm is to use smaller primes p with relaxed requirements. Instead of searchingfor good primes separating all of the non-zero terms of f , they probabilistically search for an“ok” prime p which separates most of the non-zero terms of f . Given this prime p they thenconstruct images of the form f mod ( x pq j − q , . . . , q k whoseproduct exceeds D , in order to build those non-colliding non-zero terms of f . The resultingpolynomial f ∗ contains these terms, plus possibly a small number of deceptive terms not occur-ring in f , such that f − f ∗ now has at most T / T ← T / g = f − f ∗ .“ Recursive + Diversified ” Interpolation . In Arnold, Giesbrecht, and Roche [3], theirunivariate interpolation algorithm works over finite fields. By combining the idea of diversifica-tion, the complexity becomes better. In their algorithm, they choose a set of N ∈ O ∼ (log D )“ok” primes p i ∈ O ∼ ( T log D ), 1 ≤ i ≤ N . Given these primes p i , they then compute im-ages f ij = f ( α j x ) mod ( x p i −
1) for choices of α j that will (probably) allow them to identifyimages of like terms of f . This approach relies on a more general notion of diversificationand they use information from the images f ij to construct at least half of the terms of f .At last, they use the iteratively method to build f . The complexity of their algorithm is O ∼ ( LT log D (log D + log q ) log ε ) bit operations. This cost improves on previous methods bya factor of log D , or log q .“ Recursive + Diversified + Substitution ” Interpolation
The previous algorithms forsparse interpolation of straight-line programs are essentially univariate algorithms, but can easilybe extended to handle multivariate polynomials by use of the well-known Kronecker substitution.In Arnold, Giesbrecht and Roche [4], they gave a multivariate interpolation combining thethe idea of randomize Kronecker substitutions which achieves similar aims as the Kroneckersubstitution but with decreased degrees for sparse polynomials.
In this paper, we propose two interpolation algorithms for polynomials over a finite field F q withlarge characteristic. Let f ∈ F q [ x , . . . , x n ] be a polynomial given by an SLP of length L witha partial degree bound D and a term bound T .Our first algorithm is a Monte Carlo algorithm. If char ( F q ) ≥ D , it finds all coefficients andexponents of f , with probability at least 3 /
4, with a cost of O ∼ ( LT log q + nT log q + T log q )bit operations. Denote inputsize be the input size and outputsize be the output size. Aswe know that the input is the straight-line program and the output is the sparse polynomial, he input size and out size are O ( L log q ) and O ( nT log D + T log q ), respectively. So if q is O (( T D ) (1) ), our complexity is O ∼ ( T · inputsize + log q · outputsize ).Our second algorithm is a deterministic algorithm. If char ( F q ) > O ∼ ( n T D ), it finds allcoefficients and exponents of f , with a cost of O ∼ ( Ln T log D log q ) bit operations. Referringto Theorem 1.3, testing the correctness of the output of an interpolation algorithm requiressome O ∼ ( T log D ) probes of degree at most O ∼ ( T log D ). So it needs probe f mod ( x p − O ∼ ( T log D ) times and p is O ∼ ( T log D ). By Lemma 2.2, it needs O ∼ ( LT log D log q ) bitoperations when the ring R is the finite field F q . Since testing f = f ∗ is the same as testing f − f ∗ = 0, the complexity of our deterministic algorithm is the same as the one of Bl¨aser et al.[7] deterministic zero-testing. In other word, for a univariate polynomial f given by SLP over afinite field F q with large characteristic, deterministically interpolating f is as easy as Bl¨aser etal. [7] deterministic testing f = 0.Table 1 gives a comparison of existing algorithms for sparse interpolation of straight-lineprograms over the finite field F q . In the table, for Las Vegas algorithms, we give their averagecomplexity; for Monte Carlo algorithms, we fix the probability of failure ε . Bit AlgorithmComplexity typeDense LD n log q DeterministicGarg & Schost [8] Ln T log D log q DeterministicRandomized G & S [10] Ln T log D log q Las VegasGiesbrecht & Roche [10] Ln T log D ( n log D + log q ) Las VegasArnold, Giesbrecht & Roche [2] Ln T log D log q Monte CarloArnold, Giesbrecht & Roche [3]
LnT log D (log D + log q ) + n ω T Monte CarloArnold, Giesbrecht & Roche [4] Ln log D ( T log D + n )(log D + log q ) Monte Carlo+ n ω − T log D + n ω log D Huang & Gao[12] Ln T log D log q + LnT log D log q DeterministicHuang & Gao[12]
LnT log D (log q + log D ) Monte CarloThis paper(Th.3.5)( char ( F q ) ≥ D ) LT log q + T log q + nT log q Monte CarloThis paper(Th.4.19)( char ( F q ) ≥ O ∼ ( n T D )) Ln T log D log q Deterministic
Table 1: A “soft-Oh” comparison for SLP polynomials over finite field F q From the table, our Monte Carlo algorithm is the first one to separate n and L in complexity.And if q is O ∼ (( nT D ) (1) ), then it is better than all existing algorithms. Our deterministicalgorithm is better than all existing deterministic algorithms. The other algorithms works forany finite field, while our algorithms can’t work for the finite fields with small characteristic. Baur-Strassen’s [5] technique allows us to evaluate the gradient ( ∂f∂x , . . . , ∂f∂x n ) using O ( L ) op-erations in R . Using O ( L + n ) operations, this provides an algorithm for the simultaneouslyevaluation of f, g , . . . , g n with g i = x i ( ∂f∂x i ) for i = 1 , . . . , n . † We summarize it into a lemma.
Lemma 2.1 [5] Assume f ( x ) ∈ F q [ x ] is given by an SLP S f with length L . Let g i = x i ( ∂f∂x i ) for i = 1 , . . . , n . For any point −→ α = ( α , . . . , α n ) ∈ F nq , it costs O ∼ ( L + n ) operations in F q toprobe f ( −→ α ) and g ( −→ α ) , . . . , g n ( −→ α ) from S f . † I thank ´Eric Schost for pointing out it and I also thank an anonymous referee of my ISSAC paper [11] forpointing out the work of Baur and Strassen .2 Probing univariate polynomials mod ( x p − In our deterministic algorithms, we need to evaluate polynomial f ∈ F q [ x ] in an extension ringof F q . More precisely, we want to evaluate f at p th roots of unity for various choices of p . Thismay be regarded as transforming a straight-line program by substituting operations in F q [ x ]with operations in F q [ x ] / ( x p − F q [ x ]of degree less than p . Each evaluation of straight-line program for f in F q [ x ] / ( x p −
1) is calleda probe of degree p .For p ∈ N > , denote f p = f ( x ) mod ( x p − ∈ F q [ x ] . (2)The following lemma is the complexity of probes of a univariate polynomial given by an SLP. Lemma 2.2 [11] Assume f ( x ) ∈ F q [ x ] is given by an SLP S f with length L . Let p be a prime,it costs O ∼ ( Lp ) field operations to probe f p and ( f ′ ) p from S f . In this section, we give a Monte Carlo interpolation algorithm for polynomials. The algorithmworks as follows. This algorithm is inspired by [11] and given in [9].Assume f ( X ) = t X k =1 c k X e k ∈ F q [ X ] (3)where c k ∈ F ∗ q , X = ( x , . . . , x n ), e k = ( e k, , . . . , e k,n ) are different vectors and X e k = x e k, · · · x e k,n n .Assume max ni =1 deg x i f < D and f ≤ T . Definition 3.1
A point −→ α = ( α , . . . , α n ) ∈ F nq is said a good point of f (as in (3)), iff −→ α e i = −→ α e j , ∀ i = j Now we assume the following two conditions are satisfied: • char ( F q ) ≥ D . • A good point −→ α ∈ F nq of f .Denote v k = −→ α e k , k = 1 , . . . , t , then a j = f ( −→ α ( j ) ) = t X k =1 c k v jk (4)where −→ α ( j ) = ( α j , . . . , α jn ).The term locator polynomial Λ( z ) is defined as follows.Λ( z ) = t Y k =1 ( z − v k ) = z t + λ t − z t − + · · · + λ z + λ . (5)Let M k := ( a i + j ) ≤ i,j
D > max ni =1 deg x i f and D ≤ char ( F q ). Output:
Return correct f = P tk =1 c k X e k with probability ≥ or Failure. Step 1: If q ≥ DT ( T −
1) + 1, randomly choose −→ α from F ∗ nq .If q < DT ( T −
1) + 1, extend F q into F q ′ , where q ′ = q u and u = ⌈ log (2 DT )log q ⌉ . Randomlychoose −→ α from F ∗ nq ′ . Step 2:
For j = 0 , . . . , T −
1, get the evaluations a j = f ( −→ α ( j ) ). Step 3:
For i = 1 , . . . , n, j = 0 , , . . . , T −
1, get the evaluations h i,j = ( x i ∂f∂x i )( −→ α ( j ) ). Step 4:
Find the rank t of the matrix M T and solve equation (6) to get the coefficients of theterm locator polynomial Λ( z ). Step 5:
Find all roots v k , k = 1 , . . . , t of Λ( z ). tep 6: Find the coefficients c i by solving the transposed Vandermonde system (7). Step 7:
For i = 1 , . . . , n , solve the transposed Vandermonde system (8) to find the coefficients e k,i c k , k = 1 , . . . , t . Step 8:
For i = 1 , . . . , n, k = 1 , . . . , t , compute e k,i from the division of c k and c k e k,i . Step 9:
Return P tk =1 c k z e k, · · · z e k,n n . Now we analyse the complexity. Since we compute e k,i from the division of c k , c k e k,i , not from v k = −→ α e k , we avoid computing the discrete logarithms over finite field F q . So we have thefollowing theorem. We assume that we may obtain a random bit with bit-cost O (1). Theorem 3.5
The expected bit complexity of Algorithm 3.4 is O ∼ ( LT log q + T log q + nT log q ) .Proof. In Step 1, if q ≥ DT ( T −
1) + 1, then randomly choose −→ α from F ∗ nq and it costs O ∼ ( n log q ) bit operations.If q < DT ( T −
1) + 1, suppose the element of F q u is represented as F q [ x ] / h Φ( x ) i , where Φis a degree- u irreducible polynomial over F q . In [18], Shoup proved that finding an irreduciblepolynomial Φ with degree u over F q costs expected O ∼ ( u log q + u log q ) bit operations. Since u is O ( log T +log D log q ), the bit complexity is O ∼ ( log ( DT )log q + log( DT ) log q ). Randomly choose −→ α from F ∗ nq ′ and it costs O ∼ ( n log q ′ ) = O ∼ ( nu log q ) bit operations.In the following steps, if q ≥ DT ( T −
1) + 1, the field we used is F q ; otherwise, the fieldused is F q ′ . We first consider the case q ≥ DT ( T −
1) + 1.In Step 2 and Step 3, for a fixed j , by Lemma 2.2, it needs O ( L + n ) operations in F q to probe f ( −→ α ( j ) ) and ( x i ∂f∂x i )( −→ α ( j ) ) , i = 1 , . . . , n . Since j = 0 , , . . . , T −
1, the total cost of probes is O ( LT + nT ) operations in F q .In Step 4, since Equ.(6) is a Hankel system, it can be solve by O ∼ ( T ) operations in F q [16].In Step 5, we can compute all v , . . . , v t with expected O ∼ ( T log q ) operations in F q . [19,Cor.14.16]In Step 6, solving the Vandermonde system costs O ∼ ( t ) operations in F q .[16]In Step 7, solving the Vandermonde system costs O ∼ ( nt ) operations in F q .[16]In Step 8, We compute e k,i from the division of c k , c k e k,i , so it costs O ∼ ( nt ) operations in F q .In total, it costs O ∼ ( LT + T log q + nT ) operations in F q , which is O ∼ ( LT log q + T log q + nT log q ) bit operations.In the case of q < DT ( T −
1) + 1. The field used is F q ′ , then the total complexity is O ∼ ( LT log q ′ + T log q ′ + nT log q ′ ) bit operations. log q ′ = u log q is O (log( DT )). Since char ( F q ) ≥ D , log q ≥ log D . So log q ′ is O (log T + log q ). The bit complexity is O ∼ ( LT log q + T log q + nT log q ) bit operations.The following lemma is used to prove the correctness of Algorithm 3.4. Lemma 3.6 [9] The probability that a randomly chosen −→ α ∈ F ∗ nq is a good point of f is ≥ − DT ( T − q − Theorem 3.7
Algorithm 3.4 is correct.Proof.
As mentioned before, if −→ α is a good point of f , then Algorithm 3.4 will return the correctpolynomial. s stated in Lemma 3.6, we can randomly choose a point from F ∗ nq . But to ensure a successrate of ≥ , we will ensure q ≥ DT ( T −
1) + 1. If q < DT ( T −
1) + 1, we can extend F q intothe extended field F q u , where u = ⌈ log (2 DT )log q ⌉ (9)So we have q ′ ≥ DT ( T −
1) + 1. In Step 1, by Lemma 3.6, −→ α ∈ F ∗ nq ′ is a good point withprobability ≥ − DT ( T − q − ≥ In this section, we give a deterministic interpolation algorithm for a polynomial given by SLPover finite field F q (for large characteristic). The algorithm works as follows. First, we givea deterministic interpolation algorithm for univariate polynomials. Then, we use the sparsedeterministic Kronecker substitutions to extend the univariate algorithm into a multivariateone. Let f = a x d + · · · + a t x d t ∈ F q [ x ] be a univariate polynomial with non-zero terms a i x d i .Denote f = t to be the number of terms of f and M f = { a x d , a x d , . . . , a t x d t } be the setof terms in f . Let D, T ∈ N such that D > max ni =1 deg x i ( f ) and T ≥ f .We have the following key concept. Definition 4.1
A term a i x d i ∈ M f is called a collision in f p if there exists an a j x d j ∈ M f , j = i such that d i mod p = d j mod p . We have the following lemmas.
Lemma 4.2 [11] Let f ∈ F q [ x ] , char ( F q ) > deg f . Assume d > and ax d ∈ M f . If ax d is nota collision in f p , then ( ad ) x d − ∈ M f ′ and ( ad ) x d − is not a collision in ( f ′ ) p . We will give an algorithm to recover the non-collision terms of f from f p and ( f ′ ) p .Denote f p = c + c x e + c x e + · · · + c k x e k ( f ′ ) p = h x p − + h x e − + h x e − + · · · + h k x e k − + g (10)where 0 < e < e < · · · < e k , c i , h i ∈ F q , i = 0 , . . . , k , and c i = 0 , i = 1 , . . . , k . The polynomial g contains all the terms in ( f ′ ) p whose degrees are not p − e i − , i = 1 , , . . . , k .As in [11], we now introduce the following key notation. U f p := { c i x d i | such that for some i ∈ [0 , k ]U1 : d i = h i /c i and d i ∈ N . U2 : d i ∈ [0 , D ) . } The following lemma gives the geometric meaning of U f p . Lemma 4.3 [11] Let f ∈ F q [ x ] , char ( F q ) > deg f and ax d ∈ M f . If ax d is not a collision in f p , then ax d ∈ U f p . The following algorithm computes the set U f p . lgorithm 4.4 (UTerms)Input: • Univariate polynomials f p , ( f ′ ) p . • A prime p . • A degree bound
D > deg( f ), where char ( F q ) ≥ D . Output: U f p . Lemma 4.5 [11] Algorithm 4.4 needs O ( T ) field operations and O ∼ ( T log D ) bit operations,where T ≥ f . Assume f ( x , . . . , x n ) ∈ F q [ x , . . . , x n ]. Let p be a prime. Denote f ( x s ) = f ( x s , x s , . . . , x s n ) (11) f ( x s + p I k ) = f ( x s , . . . , x s k + p , . . . , x s n )to be the univariate polynomials after substitutions x i = x s i , i = 1 , , . . . , n and substitutions x i = x s i , i = 1 , , . . . , n, i = k, x k = x s k + p , where I k ∈ Z n ≥ is the k -th unit vector. Definition 4.6
Let f ∈ F q [ x , x , . . . , x n ] , s = ( s , s , . . . , s n ) ∈ N n and prime p . f ( x s ) and f ( x s ) p are defined in (11) and (2). A term cm of f is said to collide in f ( x s ) (or f ( x s ) p ) if f has another term em such that m = m and m ( x s ) = m ( x s ) (or m ( x s ) p = m ( x s ) p ). Now we describe how to recover the non-collision terms from f ( x s ) and f ( x s + p I k ) , k =1 , , . . . , n .Let f ( x s ) mod ( x p −
1) = a x d + · · · + a r x d r (12)Since f ( x s ) mod ( x p −
1) = f ( x s + p I k ) mod ( x p − k = 1 , , . . . , n , we can write f ( x s ) = f + f + · · · + f r + g (13) f ( x s + p I k ) = f k, + f k, + · · · + f k,r + g k where f i mod ( x p −
1) = f k,i mod ( x p −
1) = a i x d i , g mod ( x p −
1) = g k mod ( x p −
1) = 0.We define the following key notationTS ( f,p, s ) = { a i x e i, · · · x e i,n n | a i is from (12) , andT1 : f i = a i x u i , f k,i = a i x v k,i , k = 1 , , . . . , n. (14)T2 : e i,k = v k,i − u i p ∈ N , k = 1 , , . . . , n. T3 : u i = e i, s + e i, s + · · · + e i,n s n . T4 : n X j =1 e i,j ≤ D. } Lemma 4.7 [11] Let f = P ti =1 c i m i ∈ F q [ x , x , . . . , x n ] and D ≥ deg( f ) . If cm does notcollide in f ( x s ) p , then cm ∈ TS ( f,p, s ) . We give the following algorithm to compute TS ( f,p, s ) . Algorithm 4.8 (TSTerms) nput: • Univariate polynomials f ( x s ) p , f ( x s ) , f ( x s + p I k ) ∈ F q [ x ], where k = 1 , , . . . , n . • A prime p . • A vector s = ( s , s , . . . , s n ) ∈ Z n ≥ . • Degree bound D ≥ deg( f ). Output: TS ( f,p, s ) . Lemma 4.9 [13] Algorithm 4.8 needs O ( nT ) arithmetic operations in F q and O ∼ ( nT log( s max D + pD )) bit operations, where s max = max { s , s , . . . , s n } . We will give the reduction algorithm which is used to obtain the polynomials g ( x s + p I k ) , k =1 , . . . , n from the exact form of g ( x , . . . , x n ). Algorithm 4.10 (PolySubs)Input: • A polynomial g ∈ F q [ x , . . . , x n ]. • A vector s = ( s , . . . , s n ) ∈ Z n ≥ . • A prime p . Output: g ( x s + p I k ) , k = 1 , . . . , n . Lemma 4.11 [13] The complexity of Algorithm 4.10 is O ∼ ( nt log( p + s max ) + nt log(deg( f ))) bit operations and at most O ( nt ) arithmetic operations in F q , where s max = max { s , s , . . . , s n } . The following theorem is the key for both the univariate and multivariate interpolationalgorithms.
Theorem 4.12 [12] Let f = P ti =1 c i m i ∈ F [ x , x , . . . , x n ] , F be a field, T ≥ f, D > max ni =1 deg x i f, s = (1 , D, . . . , D n − ) , N = max { , ⌈ n ( T −
1) log D ⌉} , and p , p , . . . , p N be N different primes. Let j be an integer in [1 , N ] such that f ( x s ) p j ≥ f ( x s ) p j for all j .Then f has at least ⌈ t ⌉ terms which are not a collision in f ( x s ) p j . The following theorem gives a technique to determine whether a term belongs to f . Theorem 4.13 [12] Let f = P ti =1 c i m i ∈ F [ x , x , . . . , x n ] , F is a field, T ≥ f, D > max ni =1 deg x i f, s = (1 , D, . . . , D n − ) , N = max { , ⌈ n ( T −
1) log D ⌉} , N = ⌈ nT log D ⌉ , and p , p , . . . , p N + N − be N + N − different primes. For a term cm satisfying deg( m ) D > max(deg x i f, deg x i f ∗ ). Output: f ∗∗ , which satisfies f − f ∗ − f ∗∗ ) ≤ ⌊ T ⌋ and max ni =1 deg x i f ∗∗ < D . Step 1: Let N = max { , ⌈ ( T − 1) log D ⌉} , N = ⌈ T log D ⌉ , N = max { N , N + N − } . Step 2: Find the first N primes p , p , . . . , p N . Step 3: For j = 1 , , . . . , N , probe f p j from S f . Let f j = f p j − f ∗ p j . Step 4: Let α = max { f j | j = 1 , , . . . , N } and j be the smallest number such that f j = α .If α = 0, then return 0; end if; Step 5: Probe ( f ′ ) p j from S f ′ . Let g = ( f ′ ) p j − ( f ∗ ′ ) p j . Step 6: Let U ( f − f ∗ ) pj := UTerms ( f j , g, p j , D ). Step 7: Let f ∗∗ := 0. For each u ∈ U ( f − f ∗ ) pj , if { j | f j − u p j ) < f j ) , j = 1 , . . . , N + N − } ≥ N then f ∗∗ := f ∗∗ + u . Step 8: Return f ∗∗ . Lemma 4.15 Algorithm 4.14 returns the correct f ∗∗ using O ∼ ( LT log D ) field operations in F q plus a similar number of bit operations.Proof. By Theorem 4.12 and Lemma 4.3, in Step 6, at least half of the terms of f − f ∗ are in U ( f − f ∗ ) pj . In Step 7, Theorem 4.13 is used to select the elements of M f − f ∗ from U ( f − f ∗ ) pj .Then, the correctness of the algorithm is proved.Now we analyse the complexity.In Step 2, since the bit complexity of finding the first N primes is O ( N log N log log N ) by[19, p.500,Thm.18.10] and N is O ∼ ( nT log D ), the bit complexity of Step 2 is O ∼ ( nT log D ).In Step 3, we probes N times. Since p j is O ∼ ( T log D ), by Lemma 2.2, the cost of theprobes is O ∼ ( LN T log D ) field operations. Since N is O ( T log D ), the cost is O ∼ ( LT log D )field operations. Since f ∗ ≤ T , it needs O ∼ ( T log D ) field operations and O ∼ ( T log D ) bitoperations to obtain all f ∗ p j and f j .In Step 4, we find the integer j . Since f − f ∗ ) p j ≤ T , it needs at most O ∼ ( N T ) fieldoperations and O ∼ ( N T log D ) bit operations to compute all f − f ∗ ) p j , i = 1 , , . . . , N , whichis O ∼ ( T log D ) field operations and O ∼ ( T log D ) bit operations. Find j needs O ∼ ( T log D )bit operations. So the bit complexity of Step 4 is O ∼ ( T log D ).In Step 5, by Lemma 2.2, it needs O ∼ ( LT log D ) field operations.In Step 6, by Lemma 4.7, the complexity is O ( T ) field operations and O ∼ ( T log D ) bitoperations.In Step 7, in order to determine whether f j − u p j ) < f j ), we just need to determinewhether u p j is a term of f j . We sort the terms of f j such that they are in ascending orderaccording to their degrees, which costs O ∼ (( N + N ) T log D ) = O ∼ ( T log D ) bit operations,since N + N is O ( T log D ). To find whether f j has a term with degree deg( u p j ), we need O (log T ) comparisons. Since the height of the degree is O (log D ), it needs O (log T log D ) bitoperations. To compare the coefficients, it needs one arithmetic operation. So it totally needs O (log T log D ) bit operations and O (1) arithmetic operation to compare f j − u p j ) with f j ).Hence, the total complexity of Step 7 is O ∼ ( U ( f − f ∗ ) pj ( N + N ) log T log D +( N + N ) T log D )bit operations and O ( U ( f − f ∗ ) pj ( N + N )) field operations. Since U ( f − f ∗ ) pj ≤ T and N + − O ( T log D ), the total complexity is O ∼ ( T log D ) field operations and O ∼ ( T log D )bit operations.We proved the theorem.Now we give the completed univariate interpolation algorithm. Algorithm 4.16 (DUIPoly)Input: • SLP S f that computes f ( x ) ∈ F q [ x ]. • A terms bound T ≥ f, . • A degree bound D > max ni =1 deg x i f . Output: The exact form of f . Step 1: Let h = 0 , T = T . Step 2: While T > a: Let g = DUIHalf ( S f , h, T, T , D ). b: Let h = h + g , T = ⌊ T ⌋ . Step 3: Return h . Theorem 4.17 Algorithm 4.16 can be used to find f using O ∼ ( LT log D ) field operationsplus a similar number of field operations.Proof. Since Algorithm DUIHalf at least obtain half of f − h , it takes O (log T ) times of Step 2.In a , by Lemma 4.15, the complexity is O ∼ ( LT log D ) field operations plus a similar numberof bit operations. In b , it needs O ( T ) field operations and O ∼ ( T log D ) bit operations to update h . We proved the theorem. In this section, assume f ∈ F q [ x , . . . , x n ] and D > max ni =1 deg x i f . To interpolate an n -variate polynomial f ( x , . . . , x n ), we can directly apply a Kronecker substitution, and interpolate b f ( x ) = f ( x, x D , . . . , x D n − ). While this certainly increases the degree, f and b f have the samenumber of nonzero terms, and f can be easily recovered from b f . This reduces the problemof interpolating the n -variate polynomial f of degree no more D to interpolating a univariatepolynomial b f of degree at most D n .But in our univariate interpolation algorithm over finite field F q , the polynomial to beinterpolated needs to satisfy the condition char ( F q ) > deg b f . So if we directly use the Kroneckersubstitution, it needs to make sure char ( F q ) > D n which is a large characteristic. In order toimprove the case, we use the sparse Kronecker substitution[12], the degree of the univariatepolynomial after substitution is O ∼ ( n T D ), so the characteristic of F q only need to make sure char ( F q ) > O ∼ ( n T D ).In this subsection, we use the sparse deterministic Kronecker substitutions to extended theunivariate interpolation algorithm into a multivariate one. Our algorithm works as follows. 1:Choose O ( nT log D ) primes p i of size O ∼ ( nT log D ) and substitutions s i ∈ Z n , where s i =(1 , D mod p i , . . . , D n − mod p i ). 2: Find i such that f ( x s i ) mod ( x p i − 1) has maximalnumber of terms. 3: Half of the terms of f can be recovered from f ( x s i ) and f ( x s i + p i I k ) , k =1 , , . . . , n .The degrees of f ( x s i ) , i = 1 , . . . , N and f ( x s i + p i I k ) , k = 1 , . . . , n are bounded by max { np i D | i =1 , , . . . , N } , where N is a fix integer. Since p i is O ∼ ( nT log D ), the degree of these polynomialsare bounded by O ∼ ( n T D ). In order to recover polynomials f ( x s i ) and f ( x s i + p i I k ) by Algo-rithm 4.16, we need char ( F q ) > max { np i D | i = 1 , , . . . , N } , which is char ( F q ) > O ∼ ( n T D ).The following is the algorithm. lgorithm 4.18 (DMIPoly)Input: • A SLP S f that computes f ∈ F q [ x , . . . , x n ]. • A terms bound T ≥ f . • A partial degree bound D > max ni =1 deg x i ( f ). Output: • If char ( F q ) > np N D , return the exact form of f , where p N is defined in Step 2 and2 np N D is O ∼ ( n T D ). • If 0 < char ( F q ) ≤ np N D , return “ char ( F q ) is not large enough for this algorithm”. Step 1: Let N = max { , ⌈ n ( T − 1) log D ⌉} , N = ⌈ nT log D ⌉ , N = max { N , N + N − } , T = T , h = 0. Step 2: Find the first N different primes p , p , . . . , p N . Step 3: For i = 1 , , . . . , N , let s i = (1 , mod ( D, p i ) , . . . , mod ( D n − , p i )) and probe f ( x s i ) p i from S f . Let f i = f ( x s i ) p i . Step 4: While max { f i | i = 1 , , . . . , N } 6 = 0 do a: Let i be the smallest number such that f i = max { f i | i = 1 , , . . . , N } . Denote s i = ( s , . . . , s n ). b: Denote Υ be the set of instructions of S f where x i = x s i , i = 1 , , . . . , n are the inputsand x is the new indeterminate. It is used to represent the univariate polynomial f ( x s i ). c: For k = 1 , , . . . , n , denote Υ k be the set of instructions of S f where x i = x s i , i =1 , , . . . , n, i = k and x k = x s k + p are the inputs and x is the new indeterminate. Theyare used to represent the univariate polynomials f ( x s i + p i I k ) , k = 1 , , . . . , n . d: { h ∗ , . . . , h ∗ n } = PolySubs ( h, s i , p i ). e: Let F = DUIPoly (Υ , T, k s i k ∞ D ) and g = F − h ( x s i ). f: For k = 1 , , . . . , n , let F k = DUIPoly (Υ k , T, k s i k ∞ D ). Let g k = F k − h ∗ k . g: Let TS := TSTerms ( f i , g, g , g , . . . , g n , p i , s i , D ). h: Let r = 0. For each u ∈ TS, if { i | f i − u p i ) < f i ) , i = 1 , . . . , N + N − } ≥ N , then r := r + u . i: Let h = h + r , T = T − r , N = max { , ⌈ n ( T − 1) log D ⌉} , N = ⌈ nT log D ⌉ , N =max { N , N + N − } . j: For i = 1 , , . . . , N , let f i = f i − r ( x s i ) p i . Step 5: Return h . Theorem 4.19 Algorithm 4.18 is correct. It needs O ∼ ( Ln T log D ) field operations plus asimilar number of bit operations.Proof. For the correctness, we need to show that when char ( F q ) > np N D , the algorithmreturns f . Since deg f ( x s i ) < npD and deg f ( x s i + p I k ) < npD ≤ np N D , char ( F q ) > max { deg f ( x s i ) , i = 1 , . . . , N, deg f ( x s i + p i I k ) , k = 1 , . . . , n } . So by Theorem 4.17, in e , f ofStep 4, F = f ( x s i ) and F k = f ( x s i + p I k ). In Step g of Step 4, by Theorem 4.12 and Lemma4.7, at least half of terms of f − h are in TS. In h of Step 4, Theorem 4.13 is used to select theelements of M f − h from TS. Then the correctness of the algorithm is proved.In Step 2, since the bit complexity of finding the first N primes is O ( N log N log log N ) by[19, p.500,Them.18.10] and N is O ∼ ( nT log D ), the bit complexity of Step 2 is O ∼ ( nT log D ). n Step 3, compute each s i needs O (log D + n log p i ) bit operations. Since p i is O ∼ ( nT log D )and N is O ( nT log D ), it needs O ∼ ( nT log D + n T log D ) bit operations to compute all s i . Forprobing f ( x s i ) p i , it probes O ( nT log D ) times. Since p i is O ∼ ( nT log D ), by Lemma 2.2, thecost of probes is O ∼ ( Ln T log D ) field operations and O ∼ ( n T log D ) bit operations.Since every recursive of Step 4, at least half of terms in f − h are found, it runs O (log T ) timesof Step 4. In a , since N is O ( nT log D ) and f i ≤ T , it needs O ∼ ( nT log D ) bit operations tocompute max { f i | i = 1 , , . . . , N } .In d , by Lemma 4.11, it needs O ( nT ) arithmetic operations in F q and O ∼ ( nT log D ) bitoperations.In e , f , by Theorem 4.17, it needs O ∼ ( nLT log ( k s i D k ∞ )) = O ∼ ( LnT log D log q ) fieldoperations and a similar number of bit operations.In g , by Lemma 4.9, the complexity is O ( nT ) field operations and O ∼ ( nT log D ) bit opera-tions.In h , to compute all the u p j , we need O ∼ ( n ( N + N ) Dp i )) bit operations.The proof for rest of this step is similar to that of Step 8 of Algorithm 4.14. The complex-ity is O ∼ ( n ( N + N ) Dp i ) + T ( N + N ) log( Dp i )) bit operations and O ( N + N )) field operations. Since ≤ T, p j = O ∼ ( nT log D ), and N + N = O ( nT log D ), it needs O ∼ ( n T log D ) bit operations and O ∼ ( nT log D ) field operations.In j , it needs O ( n r ) operations in Z to obtain r ( x s i ) p i . Subtract r ( x s i ) p i from f j needs O ( r log T ) operations in Z and r arithmetic operation in F q . Since the height of the data is O (log( k s i k ∞ D )) and we need update N polynomials, the complexity is O (( n r log( k s i k ∞ D ) + r log T log( k s i D k ∞ D ) N ) bit operations and O ( rN ) field operations. Since the sum of r is t , it total costs O ∼ ( nT log D ) field operations and O ∼ ( n T log D ) bit operations. In this paper, we consider sparse interpolation for a polynomial given by an SLP. The maincontributions are a Monte Carlo algorithm and a deterministic algorithms which work over afinite field (for large characteristic). Our Monte Carlo has lower complexity than any existingalgorithms if q is O (( nT D ) (1) ). Compare to our Monte Carlo algorithm, our deterministicalgorithm probes more times and we also give a criterion for checking whether a term belongs toa polynomial. The complexity of our deterministic algorithm is quadratic in the size of the sparserepresentation. We have showed that in finite field F q with large characteristic, deterministicinterpolation is as easy as Bl¨aser et al. [7] deterministic zero-testing for univariate polynomialsrepresented by SLP. References [1] A. Arnold. Sparse polynomial interpolation and testing. 2016.[2] A. Arnold, M. Giesbrecht, and D. S. Roche. Faster sparse interpolation of straight-lineprograms. In International Workshop on Computer Algebra in Scientific Computing , pages61–74. Springer, 2013.[3] A. Arnold, M. Giesbrecht, and D. S. Roche. Sparse interpolation over finite fields via low-order roots of unity. In Proceedings of the 39th International Symposium on Symbolic andAlgebraic Computation , pages 27–34. ACM, 2014.[4] A. Arnold, M. Giesbrecht, and D. S. Roche. Faster sparse multivariate polynomial inter-polation of straight-line programs. Journal of Symbolic Computation , 75:4–24, 2016.[5] W. Baur and V. Strassen. The complexity of partial derivatives. Theoretical computerscience , 22(3):317–330, 1983.[6] M. Ben-Or and P. Tiwari. A deterministic algorithm for sparse multivariate polynomialinterpolation. In Proceedings of the twentieth annual ACM symposium on Theory of com-puting , pages 301–309. ACM, 1988. 7] M. Bl¨aser, M. Hardt, R. J. Lipton, and N. K. Vishnoi. Deterministically testing sparsepolynomial identities of unbounded degree. Information Processing Letters , 109(3):187–192, 2009.[8] S. Garg and ´E. Schost. Interpolation of polynomials given by straight-line programs. The-oretical Computer Science , 410(27-29):2659–2662, 2009.[9] M. Giesbrecht, Q.-L. Haung, and ´E. Schost. Sparse multiplication of multivariate lineardifferential operators. Theoretical computer science , 2020.[10] M. Giesbrecht and D. S. Roche. Diversification improves interpolation. In Proceedings ofthe 36th international symposium on Symbolic and algebraic computation , pages 123–130.ACM, 2011.[11] Q.-L. Huang. Sparse polynomial interpolation over fields with large or zero characteris-tic. In Proceedings of the 2019 on International Symposium on Symbolic and AlgebraicComputation , pages 219–226, 2019.[12] Q.-L. Huang and X.-S. Gao. Faster interpolation algorithms for sparse multivariate poly-nomials given by straight-line programs. Journal of Symbolic Computation , 2019.[13] Q.-L. Huang and X.-S. Gao. Revisit sparse polynomial interpolation based on random-ized kronecker substitution. In International Workshop on Computer Algebra in ScientificComputing , pages 215–235. Springer, 2019.[14] E. Kaltofen. Computing with polynomials given by straight-line programs i: greatestcommon divisors. In Proceedings of the seventeenth annual ACM symposium on Theory ofcomputing , pages 131–142. ACM, 1985.[15] E. Kaltofen. Greatest common divisors of polynomials given by straight-line programs. Journal of the ACM (JACM) , 35(1):231–264, 1988.[16] E. Kaltofen and L. Yagati. Improved sparse multivariate polynomial interpolation algo-rithms. In International Symposium on Symbolic and Algebraic Computation , pages 467–474. Springer, 1988.[17] Y. Mansour. Randomized interpolation and approximation of sparse polynomials. SIAMJournal on Computing , 24(2):357–368, 1995.[18] V. Shoup. Fast construction of irreducible polynomials over finite fields. Journal of SymbolicComputation , 17(5):371–391, 1994.[19] J. Von Zur Gathen and J. Gerhard. Modern computer algebra . Cambridge university press,2013.[20] R. Zippel. Interpolating polynomials from their values. Journal of Symbolic Computation ,9(3):375–403, 1990.,9(3):375–403, 1990.