<<

and Slope of p-Adic

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 , 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 and depend on the input polynomials in Euclidean division. 1. INTRODUCTION Main Results. Suppose that the Newton polygon of P (X) = 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 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 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 . 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, 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 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 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 0 and the following rate of convergence: i benefit of using the lattice precision model becomes more ∀i ≥ 0, NF(A∞ − Ai) ≥ NF(P )|[0,d−1] + 2 κ. (5) apparent. The comparison between the gain of precision in Remark 4.2. The iteration formulae of the above theorem the jagged model and the of not diffused digits in already appeared in [2, § 3.1]; nevertheless, as far as we the lattice model makes sense: indeed the latter appears as know, the result of Theorem 4.1 is new. a theoretical upper bound of the former and the difference between them quantifies the quality of the way we track Remark 4.3. The divisor A is uniquely determined by the precision in the jagged (or the Newton) precision model. conditions of Theorem 4.1. Indeed, consider two 0 0 We observe that this difference is usually not negligible (cf A and A of P such that NF(A) = NF(A ) = NF(P )|[0,d]. 5 notably the case of M(X) = (X +1) +2) meaning that this Then L = lcm(A, A0) is a divisor of P as well and the slopes quality is not very good in general. As for diffused digits, of its Newton polygon are all at most λ0 = NF(P )(d) − they correspond to digits that cannot be “seen” in the jagged NF(P )(d−1). Therefore deg L = d and L differs from A and precision model. Their number then measures the intrinsic A0 by a multiplicative nonzero constant. Then, if A and limitations of this model. We observe that it can be very A0 share in addition the same leading coefficient, they must important as well in several cases. coincide. The modulus (X +1)5 +2 shows the advantage of working with lattice precision in intermediate computations. Indeed, The rest of this subsection is devoted to the proof of the the precision behavior using the lattice model closely paral- theorem. If d = n (resp. d = 0), the sequence Ai is con- lels that of X5 + 2, since the lattices are related by a change stant equal to P (resp. to the constant coefficient of P ) and of variables. But this structure is not detected in the Newton theorem is clear. We then assume 0 < d < n. We set: or jagged models. λ0 = NF(P )(d) − NF(P )(d−1)

λ1 = NF(P )(d+1) − NF(P )(d), 4. SLOPE FACTORIZATION so that κ = λ − λ . The existence of an extremal point A well-known theorem [6, Theorem 6.1] asserts that each 1 0 of NP(P ) located at abscissa d ensures that λ > λ , i.e. extremal point M in the Newton polygon NP(P ) of a poly- 1 0 κ > 0. For all indices i, we define: nomial P ∈ K[X] corresponds to a factorization P = AB where the Newton polygon of A (resp. B) is given by the Qi = ViP //Ai,Ri = ViP % Ai = Ai+1 − Ai, part of NP(P ) located at the left (resp. the right) of M. Si = P % Ai,Ti = (1 − ViBi)% Ai Such a factorization is often called a slope factorization. The aim of this section is to design efficient and stable and when  is some letter, we put ∆i = i+1 − i. algorithms for computing these factorizations. Precisely the Lemma 4.4. The following relations hold: algorithm we obtain has a quasi-optimal complexity (com- pared to the size of the input polynomial) and outputs a ∆Bi = −(RiBi+1) //Ai, (6) result whose precision is (close to be) optimal. Two of its ∆S = −(R B )% A , (7) important additional features are simplicity and flexibility. i i i+1 i Si = (BiRi + TiSi−1 + Ti ∆Si−1)% Ai, (8) 2 4.1 A Newton iteration ∆Vi = (ViTi − Vi ∆Bi)% Ai, (9) The factor A defined above is usually obtained via a New- 1 − Qi = Ti − (ViSi) //Ai, (10) ton iteration after having prepared our polynomial by flat- tening the first slope using a change of variables involving Ri+1 = (∆Vi Si+1 + (1−Qi)Ri)% Ai+1, (11) 2 possibly rational exponents. We introduce here a variant of Ti+1 = (Ti + Vi ∆Bi) % Ai+1. (12) Proof. From P = AiBi + Si = Ai+1Bi+1 + Si+1, we NP (R0) get −RiBi+1 = ∆Bi · Ai + ∆Si. Hence, by consideration NP (S0) of degree, we obtain (6) and (7). On the other hand, from NF (P ) ViP = AiQi + Ri = Vi(AiBi + Si), we derive

(ViBi − Qi) · Ai = Ri − ViSi. (13)

Thus Ri = ViSi % Ai. Hence BiRi = (Si − SiTi)% Ai and Si = BiRi + SiTi % Ai, from which (8) follows directly By 1 definition of Vi, we get ∆Vi = Vi(1 − ViBi+1)% Ai+1 and λ consequently (9). We now write 1 − Qi = Ti + (ViBi − Qi). slope = ϕ Using (13) and noting that deg Ri < deg Ai = d, we get κ λ0 (10). A0 slope = We have V P = A Q + R = (A − R )Q + R and i i i i i+1 i i i 0 d−1 d d+1 Vi+1P = Ai+1Qi+1 + Ri+1. Thus: Figure 3: Bound on NF(R ) and NF(S ) Ri+1 = ∆Vi P + (1 − Qi)Ri 0 0

= (∆Vi Si+1 + (1 − Qi)Ri)% Ai+1, and (11) is proved. Finally convex cone generated by the vectors starting from (0, 0) to (0, 1) and (1, λ0). Thus 2 2 Ti+1 ≡ 1 − 2ViBi+1 + Vi Bi+1 (mod Ai+1)   NP(Q1Q2) ⊂ t2 ◦ t1 Epi(ϕ) + C = t2 ◦ t1 Epi(ϕ) 2 ≡ (1 − ViBi+1) (mod Ai+1) 2 and c) follows. ≡ (Ti + Vi ∆Bi) (mod Ai+1) Finally d) and e) follows from Theorem 3.2. which concludes the proof. We are now going to prove by induction on i the conjonc- tion of all equalities and inequalities below: If λ0 = −∞ or λ1 = +∞, the sequence (Ai) is constant and the theorem follows, so assume that λ0 and λ1 are finite. NF(Ai) = ϕ|[0,d], + We define the function ϕ : R → R ∪ {+∞} by: i b1(Vi) ≥ 0, bϕ(Ri) ≥ 2 κ (17) ( i NF(P )(x) if x ≤ d bϕ(Si) ≥ 0, b0(Ti) ≥ 2 κ. ϕ(x) = (14) λ0(x − d) + NF(P )(d) if x > d Noting that A0 and P agree up to degree d and that NP(P ) has an extremal point at abscissa d, we get NF(A ) = For nonzero c in a finite extension of K, note that the the- 0 ϕ . Clearly b (V ) ≥ 0 since V = 1. It follows from the orem holds for P if and only if it holds for cP , since the |[0,d] 1 0 0 definitions that R = S = P % A = (P −A )% A . We A ’s change to cA ’s while the B ’s and the V ’s remained 0 0 0 0 0 i i i i remark that P −A = Pn a Xi. Using Theorem 3.2, we unchanged. We may thus assume that P is normalized so 0 i=d+1 i obtain that b (P −A ) ≥ κ and then b (R ) = b (S ) ≥ κ that NF(P )(d) = dλ , i.e. ϕ(x) = λ x for x > d. For a ϕ 0 ϕ 0 ϕ 0 0 0 (see Figure3). Finally observe that: polynomial Q ∈ K[X] of degree n, we further define:  T0 = (1 − B0)% A0 = (A0 − P ) //A0 % A0. bϕ(Q) = min NF(Q)(x) − ϕ(x) (15) x∈[0,n] Therefore b0(T0) ≥ κ results from bϕ(A0−P ) ≥ κ thanks to and bi(Q) = min NF(Q)(x) − λix for i ∈ {0, 1}. (16) Lemma 4.5. We have then established (17) when i = 0. x∈[0,n] We now assume (17) for the index i. From Ai+1 = Ai +Ri i Set also bϕ(0) = b0(0) = b1(0) = +∞ by convention. With and the estimation bϕ(Ri) ≥ 2 κ > 0, we derive NF(Ai+1) = the normalization of P we chose above, we have b0(P ) = ϕ|[0,d]. Therefore, Lemma 4.5 applies with A = Ai and bϕ(P ) = 0 and bϕ(Q) ≤ b0(Q) for all polynomial Q. Simi- A = Ai+1. Now coming back to the the definition of Bi+1 larly b1(Q) ≤ b0(Q) for all Q. and using Theorem 3.2, we get b0(Bi+1) ≥ b1(Bi+1) ≥ 0. As a consequence: Lemma 4.5. Let b ∈ {bϕ, b0, b1}. For Q1,Q2 ∈ K[X]: i  bϕ(RiBi+1) ≥ bϕ(Ri) + b0(Bi+1) ≥ 2 κ a) b(Q1 + Q2) ≥ min b(Q1), b(Q2)

b) b(Q1Q2) ≥ min b(Q1) + b(Q2) by Lemma 4.5 and the induction hypothesis. Using again Lemma 4.5, we then derive from (6) and (7) that b0(∆Bi) ≥ c) bϕ(Q1Q2) ≥ bϕ(Q1) + b0(Q2) i i 2 κ and bϕ(∆Si) ≥ 2 κ. Similarly, using (8) and the estima- i For Q, A ∈ K[X] with deg A = d and NF(A) = NF(P )|[0,d]: tions we already know, we obtain bϕ(Si) ≥ 2 κ. Combining i i d) b(Q % A) ≥ b(Q) this with bϕ(∆Si) ≥ 2 κ, we find bϕ(Si+1) ≥ 2 κ as well. Ap- plying again and again the same strategy, we deduce succes- e) b0(Q //A) ≥ bϕ(Q). i i sively b0(∆Vi) ≥ 2 κ using (9), b0(1−Qi) ≥ 2 κ using (10), i+1 i+1 Proof. a) is clear. bϕ(Ri+1) ≥ 2 κ using (11), and then b0(Ti+1) ≥ 2 κ We skip the proof of b) which is similar to that of c). using (12). Finally, coming back to the recurrence defining Let t1 (resp. t2) be the translation of vector (0, bϕ(Q1)) Vi+1 and remembering that b1(Vi) and b1(Bi+1) are both (resp. (0, b0(Q2)). It follows from the definition of bϕ that nonnegative, we find b1(Vi+1) ≥ 0. The equalities and in- NP(Q1) is a subset of t1(Epi(ϕ)) where Epi(ϕ) denotes the equalities of Eq. (17) have then all been established for the epigraph of ϕ. Similarly NP(Q2) ⊂ t2(C) where C is the index i + 1 and the induction goes. i From the inequalities bϕ(Ri) ≥ 2 κ, we deduce that the We define the sequences (Ai) and (Vi) by the recurrence: sequence (Ai) is Cauchy and therefore converges. Its limit A0 = Aapp,V0 = Vapp A∞ certainly satisfies NF(A∞) = ϕ|[0,d] because all the Ai’s i  do. Moreover we know that bϕ(Si) ≥ 2 κ from what we Ai+1 = Ai + Vi(Papp + δP )% Ai , derive that the sequence (Si) goes to 0. Coming back to the 2 Vi+1 = (2Vi − Vi Bi+1)% Ai+1 definition of Si, we find P % A∞ = 0, i.e. A∞ divides P . Finally, Eq. (5) giving the rate of convergence follows from where Bi+1 = (Papp + δP ) //Ai+1. P∞ the writing A∞−Ai = j=i Rj together with the facts that where Aapp and Vapp are those related to Papp. Note that i (1) d bϕ(Rj ) ≥ 2 κ and deg Rj ≤ d−1 for all j ≥ i. Aapp = ad · Aapp if ad denotes the coefficient of X in Papp. By Remark 4.6, we know that the sequence (Ai) converges (1) Remark 4.6. From the proof above, the sequence (Vi)i≥0 to A = ad · A and furthermore: converges as well. Its limit V∞ is an inverse of B∞ = P //A∞  NP(A − Aapp) ≥ ϕ|[0,d−1] + bϕ (Vapp · δP )% Aapp modulo A∞ and it satisfies in addition b1(V∞) ≥ 0.

Moreover, the conclusion of Theorem 4.1 is still correct if since (VappPapp)% Aapp = (1−VappBapp)% Aapp = 0. Using A0 is any polynomial of degree d with leading coefficient ad repeatedly Lemma 4.5, we obtain: and V0 is any polynomial as soon as they satisfy:  bϕ (Vapp · δP )% Aapp ≥ b0(Vapp) + bϕ(δP ) ≥ bϕ(δP ) ≥ δ.   bϕ V0P % A0 > 0 and b0 (1 − V0B0)% A0 > 0 Thus NP(A − Aapp) ≥ ϕ[0,d−1] + δ. Dividing by ad, we find (1) (1) NP(A − Aapp) ≥ ϕ (1) and we are done. except that the constant κ giving the rate of convergence A   should be now κ = min bϕ V0P % A0 , b0 (1−V0B0)% A0 . Remark 4.8. Under the hypothesis (H) introduced below, (1) a correct precision on A is also O(ψA(1) ) where: 4.2 A slope factorization algorithm ×  % ψA(1) = ϕP NF(Vapp) − NF(P )(d) NF(P )|[0,d]. Let P ∈ Kn[X] and d be the abscissa of an extremal point (1) −1 of NP(P ). Previously (cf Theorem 4.1), we have defined a This follows from Proposition 4.10 using Vapp = ad Vapp. sequence (Ai,Vi) converging to (A, V ) where A is a factor of It follows in addition from Remark 4.6 that NF(Vapp) is P whose Newton function is NF(P )|[0,d] and V is the inverse bounded from below by x 7→ λ1x. This yields the bound ×  % of B = P/A modulo A. We now assume that P is known ψA(1) ≥ ϕP ψ NF(P )|[0,d] where ψ : [0, d−1] → R is up to some finite precision: P = Papp + O( ··· ) where the the affine function mapping x to λ1x − NF(P )(d). object inside the O depends on the chosen precision model. We can now move to the second question we have raised We address the two following questions: (1) what is the (1) precision of the factor A, and (2) how can one compute in before, i.e. the design of an algorithm for computing A practice A at this precision? with the precision given by Proposition 4.7. Our strategy In the sequel, it will be convenient to use a different nor- consists in computing first the precision and then applying the Newton iteration until the expected precision is reached. malization on A and B: if ad is the coefficient of P of degree (1) −1 (1) (1) d, we set A = a A and B = adB so that A is monic d Algorithm slope_factorisation_Newton and P = A(1)B(1). We also assume the leading coefficient of Input: a monic polynomial P + O(ϕ ) ∈ K [X], P is exactly 1; the precision datum on P then only concerns P n a break point d of NP(P ) the coefficients up to degree n−1. Similarly, A(1) and B(1) Output: the factor A described above only carry precision up to degree d−1 and n−d−1 respec- tively. 1. Compute the functions NF(P ) and ϕ 2. Compute ϕA = ϕ|[0,d−1] − ϕ(d) + minx∈[0,n] ϕP (x) − ϕ(x) Newton precision. We assume that the precision of the 3. Compute κ = NP(P )(d+1) + NF(P )(d−1) − 2 · NF(P )(d) input P has the shape O(ϕ ) where ϕ is a Newton function P P 4. Set i = 0, A = Pd a Xi (a = coeffs of P ), V = 1 of degree n−1. From now on, we assume that the precision 0 i=0 i i 0 i O(ϕP ) is nondegenerate in the sense of Definition 2.3. This 5. repeat until ϕ|[0,d−1] + 2 κ ≥ ϕA ensures in particular that the Newton polygon of P is well 6. lift Ai, Vi and P at enough precision defined. We import the notations ϕ, b and b from §4.1 ϕ 0 7. compute and refer to Eqs. (14)–(16) for the definitions. • Ai+1 = Ai + (PVi % Ai) i+1 Proposition 4.7. We keep all the above notations and as- at precision O(ϕ|[0,d−1] + 2 κ) 2 sumptions. We set: • Vi+1 = (2Vi − Vi · (P //Ai+1)) % Ai+1 i+1 at precision O(x 7→ λ1x + 2 κ) δ = min ϕP (x) − ϕ(x) 8. set i = i + 1 x∈[0,n−1] 9. return Ai + O(ϕA) and assume that δ > 0. Then the factor A(1) is known with precision at least O(ϕA(1) ) with ϕA(1) = ϕ|[0,d−1] − ϕ(d) + δ. Remark 4.9. The precision needed at line 6 is of course governed by the computation performed at line 7. Note that Proof. Let δP ∈ K[X] be such that NP(δP ) ≥ ϕP . Let it can be either computed a priori by using Proposition 3.3 (1) (1) Aapp and A be the monic factors of Papp and Papp + δP or dynamically by using relaxed algorithms from [1, 11, 12]. Ni i respectively whose Newton functions are ϕ|[0,d] − ϕ(d). In both cases, it is in O(π ) with Ni = O(2 κ+min NF(P )). It follows from Theorem 4.1, Remark 4.6 and Proposition 4.7 most n−1 (resp. at most d−1) whose Newton function is that Algorithm slope_factorisation_Newton is correct and not less that ϕP = NF(P )|[0,d−1] + δ (resp. ϕA(1) ). We 0 stable. Using the standard soft-O notation O˜(·) for hiding have to show that FA(Papp)(HP ) = HA(1) . According to logarithmic factor, our algorithm performs at most O˜(n) Proposition 4.10 the mapping G : K≤d−1[X] → K≤n−1[X], (1) (1) (1) (1) 0 combinatorial operations and O˜(n) operations in K at pre- dA 7→ (Bapp dA )% Aapp is a right inverse of F (Papp). N A cision O(π ) with N = O(max ϕP − min NF(P )) if one uses It is then enough to prove that G takes HA(1) to HP , which quasi-optimal algorithms for multiplication and Euclidean can be done easily using Theorem 3.2. division of polynomials. To compute A(1) in practice, we give a stopping criterion. Lattice precision. The precision datum is given here by Proposition 4.12. We assume (H). a lattice HP in K≤n−1[X]; we shall then write P = Papp + (1) (1) (1) O(HP ) where Papp is a monic approximation of the inexact (i) Let A˜ ∈ K=d[X] such that A˜ B˜ ∈ Papp + O(HP ) polynomial P we want to factor. We assume from now that (1) (1) (1) (1) with B˜ = Papp // A˜ . Then A˜ ∈ Aapp + H (1) . H is sufficiently small so that the Newton polygon of P is A P ˜ (1) well defined. We then can define the function: (ii) Let in addition V ∈ K≤d−1[X] such that: ˜(1) ˜ (1)  ˜(1) ˜(1) F = (FA,FB ): Papp + HP → K=d[X] × K=n−d[X] B V · HP % A = HP % A . (1) (1) ˜ (1)  ˜(1) mapping a polynomial P to the pair (A ,B ) obtained Then HA(1) = V · HP % A . (1) (1) from it. We set (Aapp,Bapp) = F (Papp). Proof. (i) Set P˜ = A˜(1)B˜(1). We know by assumption We make the following hypothesis (H): that P˜ = Papp + O(HP ). Thus F (P˜) is well defined. The

The lattice HP is a first order lattice at every point of unicity of the slope factorization (cf Remark 4.3) further ˜ ˜(1) ˜(1) Papp + HP in the sense of [4, Definition 3.3], i.e. for all implies that F (P ) = (A , B ). The claimed result now P ∈ Papp + HP : follows from the hypothesis (H). 0 ˜ 0 ˜ F (P + HP ) = F (P ) + F (P )(HP ). (ii) By applying (H) with P = P and replacing F (P ) by its expression given by Proposition 4.10, we find: Obviously (H) gives an answer to the first question we have (1) −1  (1) H (1) = (B˜ ) · HP % A˜ . (1) A raised above: the precision of A is the lattice HA(1) de- 0 ˜(1) ˜ (1)  ˜(1) ˜(1) ˜(1) fined as projection on the first component of F (Papp)(HP ). Dividing B V HP % A = HP % A by B modulo It turns out that it can be computed explicitely as shown by ˜(1) ˜ (1)  ˜(1) A , we get HA(1) = V · HP % A as expected. the next proposition. As a conclusion, the algorithm we propose consists in com- (1) Proposition 4.10. The map FA : P 7→ A is of class puting the Newton sequences (Ai) and (Vi) (following the 1 C on Papp + HP and its differential at some point P is the strategy of Algorithm slope_factorisation_Newton regarding linear mapping to precision) until we find a pair (A˜(1), V˜ (1)) satisfying the requirements (i) and (ii) of Proposition 4.12. Once this pair dP 7→ dA(1) = (V (1) dP )% A(1) has been found, one may safely output A˜(1) + OV˜ (1) · (1) (1) (1) (1)  (1) where (A ,B ) = F (P ) and V is the inverse of B HP % A˜ under (H). The resulting algorithm has quasi- modulo A(1). optimal running time and optimal stability. Proof. The function F is injective and a left inverse of it is G :(A(1),B(1)) 7→ A(1)B(1). Clearly G is of class C1 References [1] J´er´emy Berthomieu, Joris van der Hoeven, and Gr´egoire Lecerf, Relaxed al- and its differential is given by gorithms for p-adic numbers, J. Th´eorie des Nombres des Bordeaux 23 (2011), no. 3, 541–577. (dA(1), dB(1)) 7→ dP = A(1) dB(1) + B(1) dA(1). (18) [2] J´er´emy Berthomieu, Gr´egoire Lecerf, and Guillaume Quintin, Polynomial root finding over local rings and application to error correcting codes, Applicable Algebra in Engineering, Communication and Computing 24 (2013), no. 6, 413–443, Thanks to B´ezout Theorem, it is invertible as soon as A(1) DOI 10.1007/s00200-013-0200-5. and B(1) are coprime, which is true because NP(A(1)) and [3] Xavier Caruso, Slope factorization of ore polynomials, 2016. in preparation. (1) [4] Xavier Caruso, Tristan Vaccon, and David Roe, Tracking p-adic precision, LMS NP(B ) do not shape a common slope. As a consequence Journal of Computation and Mathematics 17 (Special issue A) (2014), F is of class C1 and its differential is obtained by inverting 274–294. (1) (1) (1) [5] , p-adic stability in linear algebra, Proceedings of the 2015 acm on inter- Eq. (18). Reducing modulo A , we get dP ≡ B dA national symposium on symbolic and algebraic computation, 2015, pp. 101– (1) 108. (mod A ). The claimed result follows after having noticed [6] Bernard Dwork, Giovanni Gerotto, and Francis Sullivan, An introduction to that dA(1) has degree at most d−1. G-functions, Princeton U.P., Princeton, 1994. [7] Jordi Gu`ardia, Jes´usMontes, and Enric Nart, Newton polygons of higher order in algebraic number theory, Transactions of the AMS 364 (2012), no. 1, 361– A remarkable Corollary of Proposition 4.10 asserts the 416. [8] Jordi Gu`ardia, Enric Nart, and Sebastian Pauli, Single-factor lifting and fac- optimality of Proposition 4.7 in a particular case. torization of polynomials over local fields, Journal of Symbolic Computation 47 (2012), no. 11, 1318 –1346. Corollary 4.11. We assume (H). Let δ ∈ R. When the [9] Jes´usMontes, Pol´ıgonos de newton de orden superior y aplicaciones aritm´eticas, Ph.D. Thesis, 1999. precision of P is given by O(NF(P )|[0,d−1] +δ), the precision [10] Sebastian Pauli, Factoring polynomials over local fields II, Algorithmic number of A(1) given by Proposition 4.7 is optimal. theory, 9th international symposium, 2010. [11] Joris van der Hoeven, Relax, but don’t be too lazy, J. Symbolic Comput. 34 Proof. First remark that the δ defined in the statement (2002), no. 6, 479–542. [12] , New algorithms for relaxed multiplication, J. Symbolic Comput. 42 of Proposition 4.7 coincide with the δ introduced in the (2007), no. 8, 792–802. Corollary. Define ϕA(1) = ϕ|[0,d−1] −ϕ(d)+δ. Let HP (resp. [13] Adrien Poteaux and Marc Rybowicz, Improving Complexity Bounds for the Com- putation of Puiseux Series over Finite Fields, ISSAC’15, 2015, pp. 299–306. HA(1) ) be the lattice consisting of polynomials of degree at