Division and Slope Factorization of p-Adic Polynomials
Xavier Caruso David Roe Tristan Vaccon Université Rennes 1 University of Pittsburgh JSPS–Rikkyo University [email protected] [email protected] [email protected]
ABSTRACT slope factor corresponding to a segment of the Newton poly- We study two important operations on polynomials defined gon, rather than the irreducible factor found by single factor over complete discrete valuation fields: Euclidean division lifting [8]. The slope factors are easier to find; as a conse- and factorization. In particular, we design a simple and effi- quence our iteration is less involved. We also remark that cient algorithm for computing slope factorizations, based on the methods introduced in this paper extend partially to the Newton iteration. One of its main features is that we avoid non-commutative setting and appear this way as an essential working with fractional exponents. We pay particular atten- building block in several decomposition algorithms of p-adic tion to stability, and analyze the behavior of the algorithm Galois representations and p-adic differential equations [3]. using several precision models. Any computation with p-adic fields must work with ap- proximations modulo finite powers of p, and one of the key requirements in designing an algorithm is an analysis of how CCS Concepts the precision of the variables evolve over the computation. •Computing methodologies → Algebraic algorithms; We work with precision models developed by the same au- thors [4, Section 4.2], focusing on the lattice and Newton Keywords models. As part of the analysis of the slope factorization al- Algorithms, p-adic precision, Newton polygon, factorization gorithm, we describe how the precision of the quotient and remainder depend on the input polynomials in Euclidean division. 1. INTRODUCTION Main Results. Suppose that the Newton polygon of P (X) = Polynomial factorization is a fundamental problem in com- Pn i aiX has an extremal point at abscissa d. Set A0 = putational algebra. The algorithms used to solve it depend i=0 Pd a Xi, V = 1 and on the ring of coefficients, with finite fields, local fields, num- i=0 i 0 ber fields and rings of integers of particular interest to num- Ai+1 = Ai + (ViP % Ai) ber theorists. In this article, we focus on a task that forms a Bi+1 = P //Ai+1 building block for factorization algorithms over complete dis- 2 crete valuation fields: the decomposition into factors based Vi+1 = (2Vi − Vi Bi+1)% Ai+1. on the slopes of the Newton polygon. where S //T and S % T denotes the quotient and the re- P i The Newton polygon of a polynomial f(X) = aiX mainder in the Euclidean division of S by T respectively. over such a field is given by the convex hull of the points Our main result is Theorem 4.1, which states that the se- (i, val(a )) and the point (0, +∞). The lower boundary of i quence (Ai) converges quadratically to a divisor of P . This this polygon consists of line segments (xj , yj )–(xj+1, yj+1) provides a quasi-optimal simple-to-implement algorithm for of slope sj . The slope factorization of f(X) expresses f(X) computing slope factorizations. We moreover carry out a as a product of polynomials gj (X) with degree xj+1 − xj careful study of the precision and, applying a strategy com- whose roots all have valuation −sj . Our main result is a ing from [4], we end up with an algorithm that outputs op- new algorithm for computing these gj (X). timal results regarding to accuracy. Polynomial factorization over local fields has seen a great In order to prove Theorem 4.1, we also determine the pre- deal of progress recently [7–10] following an algorithm of cision of the quotient and remainder in Euclidean division, Montes. Slope factorization provides a subroutine in such which may be of independent interest. These results are algorithms [10, Section 2]. Note that our algorithm lifts a found in Section 3.2. Organization of the paper. After setting notation, in Section2 we recall various models for tracking precision in polynomial arithmetic. We give some background on New- Publication rights licensed to ACM. ACM acknowledges that this contribution was authored or co-authored by an employee, contractor or affiliate of a national govern- ton polygons and explain how using lattices to store pre- ment. As such, the Government retains a nonexclusive, royalty-free right to publish or cision can allow for extra diffuse p-adic digits that are not reproduce this article, or to allow others to do so, for Government purposes only. localized on any single coefficient. ISSAC’16, July 19–22, 2016, Waterloo, ON, Canada In Section3, we consider Euclidean division. We describe ACM ISBN 978-1-4503-4380-0/16/07. . . $15.00 in Theorem 3.2 how the Newton polygons of the quotient DOI: http://dx.doi.org/10.1145/2930889.2930897 and remainder depend on numerator and denominator. We use this result to describe in Proposition 3.3 the precision with absolute (resp. relative) precision Nx and Ny respec- evolution in Euclidean division using the Newton precision tively, one can compute the sum x+y (resp. the product xy) model. We then compare the precision performance of Eu- at absolute (resp. relative) precision min(Nx,Ny). Compu- clidean division in the jagged, Newton and lattice models tations with p-adic and Laurent series are often handled this experimentally, finding different behavior depending on the way on symbolic computation softwares. modulus. Finally, in Section4 we describe our slope factorization 2.1 Precision for polynomials algorithm, which is based on a Newton iteration. Unlike The situation is much more subtle when we are working other algorithms for slope factorization, ours does not re- with a collection of elements of K (e.g. a polynomial) and quire working with fractional exponents (compare for in- not just a single one. Indeed, several precision data may be stance with [13, § 6]). In Theorem 4.1 we define a sequence considered and, as we shall see later, each of them has its of polynomials that will converge to the factors determined own interest. Below we detail three models of precision for by an extremal point in the Newton polygon. We then dis- the special case of polynomials. cuss the precision behavior of the algorithm. Flat precision. The simplest method for tracking the pre- Notations. Throughout this paper, we fix a complete dis- cision of a polynomial is to record each coefficient modulo a crete valuation field K; we denote by val : K → ∪ {+∞} Z fixed power of π. While easy to analyze and implement, this the valuation on it and by W its ring of integers (i.e. the method suffers when applied to polynomials whose Newton set of elements with nonnegative valuation). We assume polygons are far from flat. that val is normalized so that it is surjective and denote by π a uniformizer of K, that is an element of valuation 1. De- Jagged precision. The next obvious approach is to record noting by S ⊂ W a fixed set of representatives of the classes the precision of each coefficient individually, a method that modulo π and assuming 0 ∈ S, one can prove that each ele- we will refer to as jagged precision. Jagged precision is com- ment in x ∈ K can be represented uniquely as a convergent monly implemented in computer algebra systems, since stan- series: dard polynomial algorithms can be written for generic coef- +∞ ficient rings. However, these generic implementations often X i x = aiπ with ai ∈ S. (1) have suboptimal precision behavior, since combining inter- i=val(x) mediate expressions into a final answer may lose precision. The two most important examples are the field of p-adic Moreover, when compared to the Newton precision model, numbers K = Qp and the field of Laurent series K = k((t)) extra precision in the middle coefficients, above the Newton over a field k. The valuation on them are the p-adic valua- polygon of the remaining terms, will have no effect on any tion and the usual valuation of a Laurent series respectively. of the values of that polynomial. Their ring of integers are therefore Zp and k[[t]] respectively. A distinguished uniformizer is p and t whereas a possible set Newton precision. We now move to Newton precision S is {0, . . . , p − 1} and k respectively. The reader who is not data. They can be actually seen as particular instances of familiar with complete discrete valuation fields may assume jagged precision but there exist for them better representa- (without sacrifying too much to the generality) that K is tions and better algorithms. one of the two aforementioned examples. Definition 2.1. A Newton function of degree n is a convex In what follows, the notation K[X] refers to the ring of function ϕ : [0, n] → ∪ {+∞} which is piecewise affine, univariate polynomials with coefficients in K. The subspace R which takes a finite value at n and whose epigraph1 Epi(ϕ) of polynomials of degree at most n (resp. exactly n) is de- have extremal points with integral abscissa. noted by K≤n[X] (resp. Kn[X]). Remark 2.2. The datum of ϕ is equivalent to that of 2. PRECISION DATA Epi(ϕ) and they can easily be represented and manipulated Elements in K (and a fortiori in K[X]) carry an infinite on a computer. amount of information. They thus cannot be stored entirely in the memory of a computer and have to be truncated. We recall that one can attach a Newton function to each Pn i Elements of K are usually represented by truncating Eq.(1) polynomial. If P (X) = i=0 aiX ∈ Kn[X], we define its as follows: Newton polygon NP(P ) as the convex hull of the points N−1 (i, val(ai)) (1 ≤ i ≤ n) together with the point at infinity X i N (0, +∞) and then its Newton function NF(P ) : [0, n] → x = aiπ + O(π ) (2) R i=v as the unique function whose epigraph is NP(P ). It is well known [6, Section 1.6] that: where N is an integer called the absolute precision and the N notation O(π ) means that the coefficients ai for i ≥ N NP(P + Q) ⊂ Conv NP(P ) ∪ NP(Q) are discarded. If N > v and av 6= 0, the integer v is the valuation of x and the difference N − v is called the relative NP(PQ) = NP(P ) + NP(Q) precision. Alternatively, one may think that the writing (2) where Conv denotes the convex hull and the plus sign stands represents a subset of K which consists of all elements in K for the Minkowski sum. This translates to: for which the ai’s in the range [v, N − 1] are those specified. From the metric point of view, this is a ball (centered at any NF(P + Q) ≥ NF(P ) + NF(Q) point inside it). NF(PQ) = NF(P ) × NF(Q) It is worth noting that tracking precision using this repre- sentation is rather easy. For example, if x and y are known 1Recall that the epigraph is the region above the graph. where the operations + and × are defined accordingly. There exist classical algorithms for computing these two op- erations whose complexity is quasi-linear with respect to the ϕ degree. In a similar fashion, Newton functions can be used to model precision: given a Newton function ϕ of degree n, we agree that a polynomial of degree at most n is given at ∆ precision O(ϕ) when, for all i, its i-th coefficient is given at precision O πdϕ(i)e (where d·e is the ceiling function). In Pn dϕ(i)e i the sequel, we shall write O(ϕ) = i=0 O π · X and Pn i use the notation i=0 aiX + O(ϕ) (where the coefficients ψ ai are given by truncated series) to refer to a polynomial given at precision O(ϕ). 0 d−1 d It is easily checked that if P and Q are two polynomials known at precision O(ϕP ) and O(ϕQ) respectively, then P + Figure 1: Euclidean division of Newton functions Q is known at precision O(ϕP + ϕQ) and PQ is known at × + × precision O (ϕP NF(Q)) (NF(P ) ϕQ) . need to first understand the precision attached to the quo- Definition 2.3. Let P = Papp + O(ϕP ). We say that the tient and remainder when dividing two polynomials. In the Newton precision O(ϕP ) of P is nondegenerate if ϕP ≥ sequel, we use the notation A //B and A % B for the polyno- NF(Papp) and ϕP (x) > y for all extremal point (x, y) of mials satisfying A = (A //B)·B+(A % B) and deg(A % B) < NP(Papp). deg(B). We notice that, under the conditions of the above defini- 3.1 Euclidean division of Newton functions tion, the Newton polygon of P is well defined. Indeed, if δP is any polynomial whose Newton function is not less than Definition 3.1. Let ϕ and ψ be two Newton functions of ϕP , we have NP(Papp + δP ) = NP(Papp). degree n and d respectively. Set λ = ψ(d)−ψ(d−1). Letting ∆ be the greatest affine function of slope λ with ∆ ≤ ϕ|[d,n] Lattice precision. The notion of lattice precision was de- and δ = ∆(d) − ψ(d), we define: veloped in [4]. It encompasses the two previous models and has the decisive advantage of precision optimality. As a ϕ % ψ = ϕ|[0,d−1] + ψ|[0,d−1] + δ counterpart, it might be very space-consuming and time- ϕ // ψ : [0, n − d] → ∪ {+∞} consuming for polynomials of large degree. R x 7→ infh≥0 ϕ(x + d + h) − λh. Definition 2.4. Let V be a finite dimensional vector space over K. A lattice in V is a sub-W -module of V generated Figure1 illustrates the definition: if ϕ and ψ are the func- by a K-basis of V . tions represented on the diagram, the epigraph of ϕ % ψ is the blue area whereas that of ϕ // ψ is the green area trans- We fix an integer n. A lattice precision datum for a poly- lated by (−d, 0). It is an easy exercise (left to the reader) nomial of degree n is a lattice H lying in the vector space to design quasi-linear algorithms for computing ϕ % ψ and K≤n[X]. We shall sometimes denote it O(H) in order to ϕ // ψ. emphasize that it should be considered as a precision da- Theorem 3.2. Given A, B ∈ K[X] with B 6= 0, we have: tum. The notation Papp(X) + O(H) then refers to any polynomial in the W -affine space Papp(X) + H. Tracking NF(A % B) ≥ NF(A) % NF(B) (3) lattice precision can be done using differentials as shown in and NF(A //B) ≥ NF(A) // NF(B) (4) [4, Lemma 3.4 and Proposition 3.12]: if f : K≤n[X] → Proof. Write A = A