This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

Lexicographic Gröbner bases of bivariate polynomials modulo a univariate one

Xavier Dahan Tohoku University, IEHE. 41 Kawauchi, Aoba ward, Sendai. 980-8576, Japan xdahan@gmail.com
Abstract

Let T(x)k[x]T(x)\in k[x] be a monic non-constant polynomial and write R=k[x]/TR=k[x]/\langle T\rangle the quotient ring. Consider two bivariate polynomials a(x,y),b(x,y)R[y]a(x,y),b(x,y)\in R[y]. In a first part, T=peT=p^{e} is assumed to be the power of an irreducible polynomial pp. A new algorithm that computes a minimal lexicographic Gröbner basis of the ideal a,b,pe\langle a,\ b,\ p^{e}\rangle, is introduced. A second part extends this algorithm when TT is general through the “local/global” principle realized by a generalization of “dynamic evaluation”, restricted so far to a polynomial TT that is squarefree. The algorithm produces splittings according to the case distinction “invertible/nilpotent”, extending the usual “invertible/zero” in classic dynamic evaluation. This algorithm belongs to the Euclidean family, the core being a subresultant sequence of aa and bb modulo TT. In particular no factorization or Gröbner basis computations are necessary. The theoretical background relies on Lazard’s structural theorem for lexicographic Gröbner bases in two variables. An implementation is realized in Magma. Benchmarks show clearly the benefit, sometimes important, of this approach compared to the Gröbner bases approach.

keywords:
Gröbner basis , lexicographic order , dynamic evaluation , subresultant

1 Introduction

1.1 Context and results

Gröbner bases are a major tool to solve and manipulate systems of polynomial equations, as well as computing in their quotient algebras. Modern and most efficient algorithms rely on linear algebra on variants of Macaulay matrices [20, 21]. Another class of methods, the triangular decomposition, rely on some broad generalizations of the Euclidean algorithm, as initiated by Ritt [46], Wu [55], and pursued by many researchers (see surveys [26, 8, 53] for details). Starting from an input system \mathcal{F}, these methods produce a family of triangular sets (Ti)i(T_{i})_{i} which enjoy the elimination property and satisfies iTi\cap_{i}\langle T_{i}\rangle\simeq\langle\mathcal{F}\rangle. In dimension zero, these sets form a particular subclass of lexicographic Gröbner bases (lexGb thereafter). This representation is well-understood and implemented since already more than two decades, especially for radical ideals. Although several attempts to represent multiplicities have come out [9, 33, 35, 2] they are limited in scope, and resort to sophisticated concepts while obtaining partial information only. Triangular sets, hence standard triangular decomposition methods, cannot in general produce an ideal preserving decomposition: for example a mere primary ideal in dimension zero is not triangular in general (think of the primary ideal y2+3x,xy+2x,x2\langle y^{2}+3x,xy+2x,x^{2}\rangle of associated prime x,y\langle x,y\rangle; it is a reduced lexGb for xyx\prec y and does not generate a radical ideal). However, the underlying key algorithmic concepts may still be relevant, and the present work shows it is the case, yet in a particular situation.

The algorithms proposed in this work consider lexGbs instead of triangular sets. Although it also builds upon the Euclidean algorithm and hence can be compared to triangular decomposition algorithms, it goes only half-way when decomposing. A splitting follows from those of polynomials in xx only, by generalizing dynamic evaluation. In particular, no decomposition is produced in the first part, when T=peT=p^{e} is the power of an irreducible polynomial. One can expect to decompose along the yy-variable too, but this requires dynamic evaluation in two variables. Nonetheless, the methods introduced here pave the way toward such decompositions. Let us illustrate this by a toy example.

Example 1 (Computing a lexGb).

From now on p.r.s stands for (subresultant) pseudo-remainder sequence. Below it is computed modulo t1t_{1} (Eq. (1)) or modulo t1t_{1}^{\prime} (Eq. (2)), 𝖲i(a,b)\mathsf{S}_{i}(a,\ b) refers to the ii-th subresultant of amodt1a\bmod t_{1} and bmodt1b\bmod t_{1}. See Definition 2 for details.

{a:=(y+x)y(y+1+x)(y1)b:=(y+x)(y+1x)t1:=x2prs(a,b)modt1¯ab𝖲1(a,b)=4xy𝖲0(a,b)=0\left\{\begin{array}[]{l}a:=(y+x)y(y+1+x)(y-1)\\ b:=(y+x)(y+1-x)\\ t_{1}:=x^{2}\end{array}\right.\left\|\begin{array}[]{l}\underline{{\rm prs}(a,\ b)\bmod t_{1}}\\ a\quad\rightarrow\quad b\quad\rightarrow\quad\mathsf{S}_{1}(a,\ b)=-4xy\quad\rightarrow\quad\mathsf{S}_{0}(a,\ b)=0\end{array}\right. (1)

The last non-zero subresultant 𝖲1(a,b)=4xy\mathsf{S}_{1}(a,\ b)=-4xy is nilpotent modulo t1t_{1}. We factor out 4x-4x (it is obvious here, in general realized through a removal of nilpotent coefficients, and Weierstrass factorization), and divide 4xy-4xy by 4x-4x and t1t_{1} by 4x4=x\frac{-4x}{-4}=x in order to make them monic. We obtain now a monic polynomial c:=y=4xy4xc:=y=\frac{-4xy}{-4x} modulo t1:=t1x=xt_{1}^{\prime}:=\frac{t_{1}}{x}=x. We restart then a subresultant p.r.s of (bmodt1(x))(b\bmod t_{1}^{\prime}(x)) and (cmodt1(x))(c\bmod t_{1}^{\prime}(x)) modulo t1(x)=xt_{1}^{\prime}(x)=x, while keeping record of the division by xx.

{b¯:=bmodt1=y(y+1)c¯:=cmodt1=yt1(x):=xprs(b¯,c¯)modt1¯y2+y𝖲1(b¯,c¯)=y𝖲0(b¯,c¯)=0.\left\{\begin{array}[]{l}\bar{b}:=b\bmod t_{1}^{\prime}=y(y+1)\\ \bar{c}:=c\bmod t_{1}^{\prime}=y\\ t_{1}^{\prime}(x):=x\end{array}\right.\left\|\begin{array}[]{l}\underline{{\rm prs}(\bar{b},\ \bar{c})\bmod t_{1}^{\prime}}\\ y^{2}+y\quad\to\quad\mathsf{S}_{1}(\bar{b},\ \bar{c})=y\quad\to\quad\mathsf{S}_{0}(\bar{b},\ \bar{c})=0.\end{array}\right. (2)

The last non-zero subresultant 𝖲1(b¯,c¯)=y\mathsf{S}_{1}(\bar{b},\ \bar{c})=y is a gcd of b¯\bar{b} and c¯\bar{c} (modulo t1(x)=xt^{\prime}_{1}(x)=x) so that b¯,c¯,x=y,x\langle\bar{b},\ \bar{c},\ x\rangle=\langle y,\ x\rangle. Note that [𝖲1(b¯,c¯),x]=[y,x][\mathsf{S}_{1}(\bar{b},\ \bar{c}),\ x]=[y,\ x] is a lexGb of x,c¯,b¯\langle x,\ \bar{c},\ \bar{b}\rangle. A minimal lexGb of a,b,x2\langle a,\ b,\ x^{2}\rangle is then obtained by multiplying by xx (of which we have kept record) the lexGb [y,x][y,\ x] and concatenating bb (this is Line 5 of Algorithm 5).

[xx,xy]𝖼𝖺𝗍[b]=[x2,xy,y2+(3x+1)y+x].\left[x\cdot x,\ x\cdot y\right]\mathsf{~{}cat~{}}\left[b\right]=\left[x^{2},\ xy\ ,\ y^{2}+(3x+1)y+x\right].

This lexGb of a,b,x2\langle a,\ b,\ x^{2}\rangle is minimal but not reduced. If necessary, it suffices to compute adequate normal forms to obtain the reduced one. We will consider lexGbs as output by the algorithms, hence minimal Gröbner bases but not necessarily reduced. ∎

As this example shows, several new steps come into play to handle the computation of the subresultant p.r.s. modulo T=pe=x2T=p^{e}=x^{2}: removal of nilpotent (Algorithm 1) and Weierstrass factorization (Algorithm 2). These two algorithms transform a non monic polynomial modulo pep^{e} to an equivalent monic one (Algorithm 3). In this way, pseudo divisions can be carried through to retrieve the “first nilpotent” and the “last non nilpotent” polynomials in a modified subresultant p.r.s (Algorithm 4). It suffices then to iterate the above process to compute a minimal lexGb (Algorithm 5).

Generalizing dynamic evaluation

In a second part of the article, TT can be any monic polynomial. The most interesting cases are when a (monic) large degree factor of TT is also a factor of the resultant of aa and bb. If TT has no common factor or only a small common factor, the degree of the ideal a,b,T\langle a,\ b,\ T\rangle is small compared to the degrees of the input polynomials and while the algorithms proposed work in this case, they are slower than Gröbner bases.

This however covers most important situations, for example when the input are two polynomials a,ba,\ b without a modulus TT. Then we take T=Resy(a,b)T=\mathrm{Res}_{y}(a,b) the resultant itself. In the experimental section 6 (Columns 4 & 7 of the tables), timings show indeed that computing the resultant (Column 3) and applying the algorithms of this work (Column 4) reveals faster or simply competitive with computing a lexGb of a,b\langle a,\ b\rangle (Column 5). Computing the squarefree decomposition of the resultant (Column 6) and applying the algorithms of this work is always much faster.

When TT is not the power of an irreducible polynomial, Weierstrass factorization does not apply in general and making polynomials monic in order to restart subresultant computations becomes impossible “globally” (that is modulo TT, while modulo primary factors pep^{e}, it does). Applying the “local/global” philosophy of classic dynamic evaluation fails here too, the polynomial TT being not squarefree. We show that it is possible to extend it to a general TT with splittings of type “invertible/nilpotent”, instead of the standard “invertible/zero”. The algorithms developed in the first part to treat the local case are then rewritten under this new dynamic evaluation paradigm. The output are families of lexGbs, deduced from the splittings that occur when attempting a division by a non-invertible element.

Example 2.

(See also Algorithm 7𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕\mathtt{invertNil}”, Example 10) Consider a non-zero polynomial fk[x]/Tf\in k[x]/\langle T\rangle. If TT is irreducible, ff is invertible, being non-zero. The Extended Euclidean algorithm permits to find it. If TT is squarefree not irreducible and gcd(f,T)=g\mathrm{gcd}(f,\ T)=g then ff is invertible modulo Tg\frac{T}{g} and zero modulo gg (the “invertible/zero” dichotomy). This leads to an isomorphism k[x]/Tk[x]/T/g×k[x]/gk[x]/\langle T\rangle\simeq k[x]/\langle T/g\rangle\times k[x]/\langle g\rangle, as in classic dynamic evaluation.

If TT is not squarefree like T=x3(x+1)2T=x^{3}(x+1)^{2}, then ff may still not be invertible modulo Tgcd(f,T)\frac{T}{\mathrm{gcd}(f,\ T)}. Take for example f=x2(x+2)f=x^{2}(x+2). Then g0=gcd(T,f)=x2g_{0}=\mathrm{gcd}(T,\ f)=x^{2} and Tg0=x(x+1)2\frac{T}{g_{0}}=x(x+1)^{2}. ff is not invertible modulo Tg0\frac{T}{g_{0}}. Consider next g1=gcd(Tg0,g0)=gcd(x(x+1)2,x2)=xg_{1}=\mathrm{gcd}(\frac{T}{g_{0}},\ g_{0})=\mathrm{gcd}(x(x+1)^{2},\ x^{2})=x. This time ff is invertible modulo Tg1g0=(x+1)2\frac{T}{g_{1}g_{0}}=(x+1)^{2}, and nilpotent modulo g:=g0g1=x3g:=g_{0}g_{1}=x^{3} (the “invertible/nilpotent” dichotomy). Moreover, k[x]/Tk[x]/g×k[x]/T/gk[x]/\langle T\rangle\simeq k[x]/\langle g\rangle\times k[x]/\langle T/g\rangle. In the invertible branch, we can pursue computations (typically invert a coefficient of a polynomial in (k[x])[y](k[x])[y]), and in the nilpotent branch, work as introduced in the first part when T=peT=p^{e}. \Box

Main results

In the first part, Algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}” and Theorem 3 show how to compute a minimal lexGb of an ideal a,b,T\langle a,\ b,\ T\rangle, where a,bk[x,y]a,\ b\in k[x,y] and T=peT=p^{e} is the power of an irreducible polynomial pk[x]p\in k[x].

In the second part, the input are polynomials a,bk[x,y]a,\ b\in k[x,y] and a monic non-constant polynomial Tk[x]T\in k[x]. They verify the assumption

for any primary factor pe of T,aandbarenotnilpotentmodulope.\text{for any primary factor }p^{e}\text{ of }T,\quad a{\rm~{}and~{}}b{\rm~{}are~{}not~{}nilpotent~{}modulo~{}}p^{e}. (H)

Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” and Theorem 4 computes, on input a,b,Ta,\ b,\ T, a family of minimal lexGbs (𝒢i)i(\mathcal{G}_{i})_{i} such that i𝒢i=a,b,T\prod_{i}\langle\mathcal{G}_{i}\rangle=\langle a,\ b,\ T\rangle. The product is a direct one. More precisely, 𝒢ik[x]+𝒢jk[x]=1\langle\mathcal{G}_{i}\cap k[x]\rangle+\langle\mathcal{G}_{j}\cap k[x]\rangle=\langle 1\rangle for iji\not=j.

The outcome translates to faster computations of (a direct product of) lexGbs of an ideal a,b,T\langle a,\ b,\ T\rangle than the Gröbner engine of Magma [5], one of the fastest available, especially when TT is a factor of the resultant of aa and bb having multiplicities.

There is no difference if in Algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}pp is a prime number instead of an irreducible polynomial, and if a,b[y]a,b\in\mathbb{Z}[y]. The obtained family of lexGbs is made of strong Gröbner bases of the ideal a,b,pe[y]\langle a,\ b,\ p^{e}\rangle\subset\mathbb{Z}[y]. Indeed, Hensel lifting, Weierstrass factorization, Lazard’s structural theorem [1, Section 4.6] all hold in this context too.

In Algorithm 12 it is similarly possible to replace TT by an integer nn and to consider polynomials a,b[y]a,\ b\in\mathbb{Z}[y]. The output is then a family of coprime lexGbs whose (direct) product equals the ideal a,b,n[y]\langle a,\ b,\ n\rangle\subset\mathbb{Z}[y]. These lexGbs are strong Gröbner bases.

Motivation

There exists a variety of methods to represent the solutions of a system of polynomials. The most widespread are probably Gröbner bases, triangular-decomposition methods, primitive element representations (among which the RUR [47] and the Kronecker representation [24] have received the most attention), homotopy continuation method [50, 4], multi-resultant/eigenvector methods [3, 18]. However, when it comes to representing faithfully the ideal generated by the input polynomial, it remains essentially the Gröbner bases only. Some of the aforementioned methods have the ability to represent a multiplicity of a solution, which is just a number, however this is nowhere near to be ideal preserving. This work is somehow affiliated to the triangular-decomposition method, having the Euclidean algorithm at its core. It thus constitutes a first incursion to ideal preserving methods based on the Euclidean algorithm.

Primary decomposition constitutes another clear motivation. Being factorization free, this work nor its generalizations can compute directly a primary decomposition. Rather, it yields a decomposition at a cheap cost, so that a primary decomposition algorithm can then be run on each component. Finding a decomposition efficiently is indeed a well-known speed-up in the realm of primary decomposition [14, Remark 2]. For example, the PrimaryDecomposition command of Magma tries to compute a triangular decomposition from a Gröbner basis (apparently following [28]) in order to reduce the cost of internal subsequent routines such as factorization. It is not known how to do this for non-radical ideals. In addition, the lexicographic monomial order plays a crucial role in GTZ-like primary decomposition algorithms [23]. As mentioned above, in this work decompositions follow only from polynomials in xx, so comparisons would be premature. We would rather wait that decompositions following the yy variables are developed, which essentially amounts to dynamic evaluation in two variables.

Direct product of lexGbs

While our algorithms naturally compare to Gröbner bases’ ones, the output differs in that it is a family of lexGbs. However, this is not a drawback. Indeed it carries more information, like an intermediate representation toward the primary decomposition. Normal forms, for example to test ideal membership, can be done componentwise. It is also possible to perform other standard ideal operations. Besides, when the coefficients are rational numbers, their size are smaller: this stems from the fact that one lexGb can be reconstructed from the family output by our algorithm, through the Chinese remainder theorem, which induces a growth in the size of the coefficients. See [11] for details. Additionally, decomposing a lexGb for solving has been known to be advantageous since a long time [28].

1.2 Previous and related work

On the general method

There exists a quite dense literature about representations of the solutions of a system of polynomials a,bk[x,y]a,\ b\in k[x,y], whether they are simple or not.

One line of research builds upon a subresultant sequence. It started with [25] by Gonzàlez-Vega and El Kahoui, with several forthcoming articles improving the idea. In the background of these works lies the topology of plane (real) curves defined by polynomials over the rationals. The analysis of the bit-complexity is thus a central aspect, and the forthcoming works aim at improving it [15, 6, 31, 34]. From a subresultant sequence of aa and bb, it computes a triangular decomposition of the common set of solutions of aa and bb. A key step is to take the squarefree part of the resultant. It thus does not consider representation of multiplicities.

Another direction considers shearing of coordinates, for representations in term of primitive element (RUR) [6, 37]. It should be noted that primitive element representations cannot be ideal preserving [47, Remark 3.1].

As for general triangular decomposition methods, some have studied the representation of multiplicities. In most references below the multiplicity is equal to the dimension of a certain local algebra. In the bivariate case, [9] proposes algebraic cycles and primitive p.r.s. to find the multiplicity of each primary components. A preliminary study of deformation techniques is found in [33] that computes a certain multiplicity number. The intersection multiplicity through Fulton’s algorithm was investigated in the bivariate case in [35]. The complexity of this approach remains unclear. It was extended in [2] to multivariate system by reducing to the bivariate ones, through a method dealing with the tangent cone.

The present work distinguishes from the above in that it faithfully produces an ideal preserving representation, which contains far more information than a multiplicity number, yet relying ultimately on the classic routine: the subresultant. To compare with other formal techniques supplied with the ideal preserving feature, I am only aware of Gröbner bases computations.

About the subresultant algorithm

Algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” presents a subresultant algorithm computed modulo the power of an irreducible polynomial T=peT=p^{e}. If the input is written a,b,Ta,\ b,\ T then the output written u,v,T1,Uu,\ v,\ T_{1},\ U with UT1=TUT_{1}=T, and u,vk[x,y]u,\ v\in k[x,y] monic (in yy) polynomials, satisfy a,b,T=u,vT1,T\langle a,\ b,\ T\rangle=\langle u,\ vT_{1},\ T\rangle. uu is a monic gcd of aa and bb modulo TT if there exists one, in which case v=0v=0 (such a gcd does not necessarily exist see [12]). Otherwise, v0v\not=0 and this algorithm provides a weak version of the gcd, with the ideal preserving feature. The terminology 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil} reflects the fact that uu is the last non-nilpotent polynomial “made monic” in the modified p.r.s, while vv if the first nilpotent one “made monic” too (we assume that 0 is a nilpotent element in this article).

Moroz and Schost [41] propose to compute the resultant modulo xex^{e}, that is when p(x)=xp(x)=x with our notation. It shares some similar tools, Weierstrass factorization and Hensel lifting. However, their purpose is to write a quasi-linear complexity estimate, rather than producing a practical and neat algorithm. The idea amounts to adapt the half-gcd algorithm that runs asymptotically in quasi-linear time, to this particular context — whereas here it is the standard quadratic time subresultant algorithm that is used. The possibility to compute subresultants along with the resultant, required by Algorithm 4, is left open in [41]. The present article aims rather at practical algorithms and implementations. The algorithms presented here being new, they must demonstrate their practical efficiency, and be as simple as possible to check their correctness and to be implemented. Despite this, the description is already quite technical, and the possibility to incorporate faster routines such as the half-gcd for computing subresultants appears to be an interesting challenge for future work. The algorithms described are all implemented “as such” in Magma [5] (see http://xdahan.sakura.ne.jp/gb.html), and in many cases outperform the Gröbner engine of Magma, yet equipped with one of the best implementation of the F4 and FGLM algorithms.

Recently, faster algorithms for the computation of the resultant of a,ba,b have come out [51, 49]. It does so by bypassing the computation of a p.r.s sequence — whereas here the p.r.s. is essential. These outcomes imply directly an algorithm that computes a lexGb of the ideal a,b\langle a,\ b\rangle within the same complexity. However, they require strong generic assumptions: the lexGb must consist of two polynomials, and the unique monic (in yy) polynomial shall be of degree one. These assumptions lie far away of the present work that deal with lexGbs containing many polynomials of arbitrary degree.

The algorithms of this article adapt straightforwardly to univariate polynomials aa and bb that have coefficients in \mathbb{Z}. When T=peT=p^{e} with pp a prime number, one can think of pp-adic polynomials, ee being the precision. A related work [7] in this situation studies the stability of the subresultant algorithm to compute a (pp-adic) approximate gcd. It should be mentioned that this gcd is not monic, nor have an invertible leading coefficient, hence is of limited practical interest. The subresultant algorithm therein does not hold the crucial functionalities (Hensel lifting, Weierstrass factorization) that make polynomials monic.

About dynamic evaluation

The second part of this article involves dynamic evaluation. In its broad meaning, this technique automatically produces case distinctions depending on the values of some parameters in an equation. More precisely here, the two algebraic equations are the polynomials aa and bb in the variable yy, the parameter being xx. The case distinctions comes from the image of their coefficients (in xx) modulo each primary factor of TT. In this context, classic dynamic evaluation considers TT squarefree; A primary factor is then of the form xαx-\alpha (at least in the algebraic closure) for a root α\alpha of TT: this corresponds to the evaluation of the parameter at the value α\alpha. This work allows Taylor expansions at α\alpha at order e1e-1 if the primary factor of TT is of degree ee namely is (xα)e(x-\alpha)^{e}. The case distinction still follows from the different roots of TT, thus the different Taylor expansions considered should be at different expansion points.

The computational paradigm of dynamic evaluation, introduced in [16] is quite simple. A squarefree polynomial TT is split by a gcd computation when attempting to perform an inversion modulo TT, see Example 2. It is not surprising that such splittings actually appeared before [16] in the realm of integer factorization, as Pollard did with his rho method [45]. In the algebraic context, dynamic evaluation, also coined “D5 principle” [16], has been quite thoroughly studied, especially toward manipulation and representation of algebraic numbers [17], generalization to multivariate polynomials through the triangular representation [40], becoming a major component of some triangular decomposition algorithms [32]. Another standard reference is [39]. Concerning complexity results, we refer to [10] that brings fast univariate arithmetic to this multivariate context, or more recently to [48]. The splitting can also be performed in an ideal-theoretic way through Gröbner bases computations, see [43], but at a probably too expensive cost to be competitive with what gcd computations afford. Except this latter article, all these previous works manipulate squarefree polynomials only, the present work being to the best of my knowledge, the first addressing general univariate polynomials.

1.3 Organization

The first part (Sections 2-3) considers TT equal to the power of an irreducible polynomial. Section 2 is made of preliminaries: Lazard’s structural theorem, Weierstrass factorization through Hensel lifting, subresultant p.r.s are recalled. The following section 3 introduces the main subresultant routine “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}”, and shows how to deduce a minimal (not reduced in general) lexGb of a,b,pe\langle a,\ b,\ p^{e}\rangle. The second part considers TT general and is treated in Sections 4-5. This consists essentially in translating the algorithms presented in the first part into a dynamic evaluation that works when TT is not necessarily squarefree. Section 4 introduces the dichotomy “invertible/nilpotent” and applies it to the algorithms that make polynomials monic. It is followed in Section 5 by the generalization of the algorithm “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” that computes the “monic form” of the last nilpotent/first nilpotent polynomials in the modified subresultant p.r.s of aa and bb, and by the computation of families of lexGbs whose (direct) product is a,b,T\langle a,\ b,\ T\rangle. An experimental section 6 shows the benefits of an implementation realized in Magma of this approach, compared to Gröbner basis computations. A special emphasize is put on the case of an input aa, bb without a modulus TT in Section 6.4 due to the importance of this case and the questions it raises. The last section 7 describes some improvements for future work and various generalizations.

As one can see, the second part encompasses the algorithms proposed in the first part, restricted to when T=peT=p^{e}. Is this first part then really necessary ? Well, rewriting known algorithms to the classic dynamic evaluation paradigm is one thing, rewriting new algorithms in a new dynamic evaluation is another one. Without the first part, the algorithms of the second part would become too obscure. Besides, some of these algorithms rely on those restricted to the “local case” T=peT=p^{e} dealt with in the first part, in order to alleviate the proofs.

Notations and convention

Below are gathered some notations used in this paper:

  • sqfp(f)\mathrm{sqfp}(f): squarefree part of a polynomial fk[x]f\in k[x].

  • a polynomial pp strictly divides another polynomial qq if p|qp|q and pqp\not=q.

  • 𝒫\mathcal{P} denotes the set of irreducible polynomials in k[x]k[x]. Given p𝒫p\in\mathcal{P} and a polynomial Tk[x]T\in k[x], vp(T)v_{p}(T)\in\mathbb{N} is the largest integer such that pvp(T)|Tp^{v_{p}(T)}|T.

  • an ideal generated by a family of polynomials \mathcal{L} is denoted \langle\mathcal{L}\rangle.

  • kk will denote a perfect field: irreducible polynomials are squarefree in any algebraic extension of kk.

  • a product of ideals is direct if the ideals are pairwise coprime. Unless otherwise specified, all products of ideals will be direct.

  • all lexicographic Gröbner bases are monic, meaning that their leading coefficient is 11.

  • although zero is usually not considered a nilpotent element, it is convenient to assume it is one.

  • a value output by an algorithm is ignored by writing “__\_\_” (underscore) instead of that value.

  • algorithms are written as pseudo-codes. There is no obvious shortcut that would allow to simplify them furthermore. Most routines are indeed elementary, and it essentially amounts to recursive calls, and case distinctions. The proof of correctness follows the lines of the algorithms. They are all self-contained though, copiously commented which should allow to read them without too much effort.

2 Preliminaries

We consider a perfect field kk, and a monic non-constant polynomial Tk[x]T\in k[x]. Write R=k[x]/TR=k[x]/\langle T\rangle the quotient ring. The other input are two polynomials aa, bb in k[x,y]k[x,y] reduced modulo TT. The lexicographic monomial order with xyx\prec y is put on the monomials of k[x,y]k[x,y]. In the first part Sections 2-3 TT is a power of an irreducible polynomial pp, T=peT=p^{e}.

2.1 Nilpotents

Definition 1.

Let TT be a non-constant monic polynomial in k[x]k[x]. An element rR=k[x]/Tr\in R=k[x]/\langle T\rangle is invertible if and only if gcd(T,r)=1\mathrm{gcd}(T,r)=1. It is nilpotent if all irreducible factors of TT divide rr. Equivalently, if the squarefree part sqfp(T)\mathrm{sqfp}(T) of TT divides rr.

The following result is classical and elementary:

Proposition. A polynomial aR[y]a\in R[y] is nilpotent if and only if all its coefficients are nilpotent in RR, or equivalently, if sqfp(T)\mathrm{sqfp}(T) divides aa.

Example 3 (nilpotent element).

Let r=x2(x+1)r=x^{2}(x+1). Then rr is nilpotent modulo T=x4T=x^{4}, modulo T=(x+1)4T=(x+1)^{4}, and modulo T=x3(x+1)2T=x^{3}(x+1)^{2}, but not modulo T=x2(x1)2T=x^{2}(x-1)^{2}. ∎

Example 4 (nilpotent polynomial).

Let T=x2(x+1)2T=x^{2}(x+1)^{2} and P=x(x+1)y+2x(x+1)(x1)P=x(x+1)y+2x(x+1)(x-1). Then PP is nilpotent since its coefficients x(x+1)x(x+1) and 2x(x+1)(x1)2x(x+1)(x-1) are all nilpotents. ∎

2.2 About lexicographic Gröbner bases

The lexicographic monomial order \prec with xyx\prec y is a total order on the monomials of k[x,y]k[x,y] defined as xaybxcydx^{a}y^{b}\prec x^{c}y^{d} if b<db<d, or b=db=d and a<ca<c. Given fk[x,y]f\in k[x,y] a non-zero polynomial, the notation lm(f)\textsc{lm}(f) will refer to the leading monomial for \prec among the monomials occuring in ff. A lexGb of a polynomial system (f1,,fm)(f_{1},\ldots,f_{m}) generating an ideal II is any family of polynomials (g1,,gs)I(g_{1},\ldots,g_{s})\subset I such that for any fIf\in I there is a gjg_{j} such that lm(gj)|lm(f)\textsc{lm}(g_{j})|\textsc{lm}(f). If kk is simply an Euclidean ring, variations exist, and the one corresponding to this definition is called a strong Gröbner basis. The Gröbner basis is minimal if for all 1is1\leq i\leq s, lm(gi)\textsc{lm}(g_{i}) is not divided by lm(gj)\textsc{lm}(g_{j}) for any jij\not=i.

In 1985, Lazard [30] completely characterized lexGbs in k[x,y]k[x,y], result now known as “Lazard’s structural theorem”. It will be used in the following form:

Theorem 1.

(A)  Let monic non-constant polynomials h1,h2,,h1k[x]h_{1},\ h_{2},\ldots,\ h_{\ell-1}\in k[x] such that hih_{i} divides hi1h_{i-1} for i=2,,1i=2,\ldots,\ \ell-1. Let also monic (in yy) polynomials g2,,g(k[x])[y]g_{2},\ldots,\ g_{\ell}\in(k[x])[y] of increasing degree: degy(g2)<degy(g3)<<degy(g)\deg_{y}(g_{2})<\deg_{y}(g_{3})<\cdots<\deg_{y}(g_{\ell}). The list of polynomials

=[h1,h2g2,,h1g1,g]\mathcal{L}=[h_{1},\ h_{2}g_{2},\ \ldots,\ h_{\ell-1}g_{\ell-1},\ g_{\ell}]

is a lexGb if and only if:

gigi1,hi2hi1gi2,,h1hi1,for3ig_{i}\in\langle g_{i-1},\frac{h_{i-2}}{h_{i-1}}g_{i-2},\ \ldots,\frac{h_{1}}{h_{i-1}}\rangle,\ \text{for}~{}3\leq i\leq\ell (3)

It is moreover minimal if and only if hih_{i} strictly divides hi1h_{i-1} for i=2,,1i=2,\ldots,\ell-1.

(B) Assume now that \mathcal{L} above is already a lexGb. Given h0k[x]h_{0}\in k[x] a monic non-constant polynomial, and g+1(k[x])[y]g_{\ell+1}\in(k[x])[y] monic (in yy) of degree larger than that of all the polynomials g1,,gg_{1},\ldots,g_{\ell}, then

:=[h0f:f]𝖼𝖺𝗍[g+1]\mathcal{L}^{\prime}:=[\ h_{0}\,f\ :\ f\in\mathcal{L}\ ]\ \mathsf{~{}cat~{}}\ [\ g_{\ell+1}\ ]

is a lexGb if and only if g+1g_{\ell+1}\in\langle\mathcal{L}\rangle. It is moreover minimal if and only if \mathcal{L} is minimal.

Example 5.

The system of polynomials (x2,xy,y2+x)(x^{2},\ xy,\ y^{2}+x) is a minimal lexGb. Indeed, with the notation of the theorem we have h1=x2,h2=xh_{1}=x^{2},\ h_{2}=x and f2=y,f3=y2+xf_{2}=y,\ f_{3}=y^{2}+x. Moreover h2h_{2} strictly divides h1h_{1}. The condition f3h1h2,f2f_{3}\in\langle\frac{h_{1}}{h_{2}},\ f_{2}\rangle is the only one that we must verify. It translates to the condition y2+xx,yy^{2}+x\in\langle x,\ y\rangle which is clearly true.

However, the system (x2,xy,y2+1)(x^{2},\ xy,\ y^{2}+1) is not a lexGb. Indeed, y2+1x,yy^{2}+1\notin\langle x,\ y\rangle. \Box

Proof.

Part (A) is a restatement111 with the notations k,fi,Hi,Gik,\ f_{i},\ H_{i},\ G_{i}s of Lazard’s article: k=1k=\ell-1, f0=h1,f1=h2g2,,fk1=h1g1,fk=gf_{0}=h_{1},\ f_{1}=h_{2}g_{2},\ \ldots\ ,\ f_{k-1}=h_{\ell-1}g_{\ell-1},\ f_{k}=g_{\ell}, and Hi=gi+1H_{i}=g_{i+1} and Gi=hi+1hi+2G_{i}=\frac{h_{i+1}}{h_{i+2}}. of Lazard’s theorem [30, Thm 1] in our particular context.

Part (B) is straightforward when we translate the conditions of Eq. (3) made on the list \mathcal{L} to the list =[h0f:f]𝖼𝖺𝗍[g+1]\mathcal{L}^{\prime}=[\ h_{0}\,f\ :\ f\in\mathcal{L}\ ]\ \mathsf{~{}cat~{}}\ [\ g_{\ell+1}\ ]. Indeed, all these conditions, except the one mentioned that is (g+1g_{\ell+1}\in\langle\mathcal{L}\rangle), are verified since \mathcal{L} is assumed to be a lexGb. If \mathcal{L} is minimal, then the condition for minimality is guaranteed since h0h_{0} is assumed to be non-constant. ∎

2.3 Making polynomials monic

In order to cope with subresultants which do not have an invertible leading coefficient modulo TT, a routine that transforms them into equivalent monic polynomials is presented here. If the polynomial is not nilpotent, Weierstrass factorization allows to realize this. Else, we need first to “remove” the nilpotent part. When T=peT=p^{e}, it suffices to factor out the largest power of pp that divides it. When TT is general however, a polynomial which is not nilpotent may not necessarily have a coefficient that is invertible. We need then dynamic evaluation as introduced in Section 4. The main algorithm 3𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖\mathtt{MonicForm}” is a wrapping of two subroutines, Algorithm 1𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}” and Algorithm 2𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}”. The first one puts the polynomial that we want to “make” monic into a form of application of the second algorithm. This second one realizes Weierstrass factorization through Hensel lifting. In the subsequent algorithms, only the “𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖\mathtt{MonicForm}” wrapping algorithm will appear (and no more “𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}” nor “𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}”).

Overview of Algorithm 1𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}

We assume in this section and the next one that T=peT=p^{e} is the power of an irreducible polynomial. The algorithm “𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}” has two effects: find the largest power of pp that divides the input polynomial (case of return at Line 1), or, if there is none, find the coefficient of highest degree that is not divided by pp (case of a return at Line 1); This coefficient is then invertible modulo TT. The algorithm scans the coefficients by decreasing degree and updates the computation with a gcd (Line 1). If the coefficient ci(x)c_{i}(x) (of yiy^{i}) is invertible modulo TT, the algorithm also outputs the largest power of pp that divides all coefficients of degree higher than ii, as well as the inverse of cic_{i} modulo TT. These output are indeed required to perform Weierstrass factorization through Hensel lifting (Algorithm 2𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}”).

It may thus be necessary to call Algorithm 1 twice: one to remove the nilpotent part, and one to find the largest coefficient that has become invertible. Then, Weierstrass factorization Algorithm 2 can be called. Let us see this through an example:

Example 6 (Algorithm 1𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}”).

Let f=3x2y2+(x2+2x)y+xf=3x^{2}y^{2}+(x^{2}+2x)y+x and p(x)=xp(x)=x, T=p3=x3T=p^{3}=x^{3}. This polynomial is nilpotent, and to “remove” the nilpotent part, running Algorithm 1𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}” gives (see the specifications):

(x,1,__)𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T).(\,x,\ \ -1,\ \ \_\_\,)\ \leftarrow\ \mathtt{WeierstrassForm}(f,\ T). (4)

Indeed, xfx\mid f but x2fx^{2}\nmid f. The second output is 1-1 meaning that there is no coefficient of ff that is invertible modulo xx (since ff is divided by xx). The third output has no importance in this case, and according to the conventions is replaced by an underscore “__”.

Then f/xf/x is not nilpotent, so that running 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm} again will output:

(x, 1,14x+12)𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f/x,x31).(\,x,\ \ 1,\ \ -\frac{1}{4}x+\frac{1}{2}\,)\leftarrow\mathtt{WeierstrassForm}(f/x,\ x^{3-1}). (5)

The second output 11 indicates the degree one in f/xf/x. Indeed, the coefficient of yy in f/xf/x is x2+2xx=x+2\frac{x^{2}+2x}{x}=x+2, which is indeed invertible modulo x3/x=x2x^{3}/x=x^{2}. The inverse modulo x2x^{2} of x+2x+2 is then 14x+12-\frac{1}{4}x+\frac{1}{2} which is the third output.

Note that the coefficient of y2y^{2} in f/xf/x is not invertible hence is divided by xx (this coefficient being 3x3x). The first output returns the highest power of xx that divides this coefficient: xx divides 3x2x\frac{3x^{2}}{x}. ∎

Input: 1. polynomial f=c0(x)+c1(x)y++cδ(x)yδk[x,y]f=c_{0}(x)+c_{1}(x)y+\dots+c_{\delta}(x)y^{\delta}\in k[x,y],
2. T=pek[x]T=p^{e}\in k[x] power of an irreducible polynomial pp.
Output: 1. g=pνg=p^{\nu} the largest power of pp that divides all the coefficients cd+1,,cδc_{d+1},\ldots,c_{\delta} (where dd is defined in 2. below).
2. the largest index dd such that the coefficient cd(x)c_{d}(x) is invertible modulo TT. If there is none, then d=1d=-1.
3. α\alpha is the inverse of cdc_{d} if d0d\geq 0, and an arbitrary value if d=1d=-1.
1
2ddegy(f)d\leftarrow\deg_{y}(f)  ;    gnewTg_{new}\leftarrow T
3 while d0d\geq 0 and gnew1g_{new}\not=1 do
4       ggnewg\leftarrow g_{new} ;   cd𝖼𝗈𝖾𝖿𝖿(f,d)c_{d}\leftarrow\mathsf{coeff}(f,\ d)
5      
      (gnew,__,α)xgcd(g,cd)(\,g_{new},\ \_\_\,,\ \alpha\,)\leftarrow\mathrm{xgcd}(g,\ c_{d})
        // xgcd=\mathrm{xgcd}\ = Extended gcd: __g+αcd=gnew\_\_g+\alpha c_{d}=g_{new},
6      
      dd1d\leftarrow d-1
        // the underscore __ replaces an unimportant output
7      
8if gnew=1g_{new}=1 then // case ff not nilpotent
9      
10      return (g,d+1,α)(\,g,\ d+1,\ \alpha\,)
11      
12else // case ff nilpotent
13       return (gnew,1, 0)(\,g_{new},\ -1,\ 0\,)
14      
Algorithm 1 (g,d,α)𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T)(\,g,\ d,\ \alpha\,)\leftarrow\mathtt{WeierstrassForm}(f,\ T)
Remark 1.

ff is nilpotent if and only if d=1d=-1 where (__,d,__)𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T)(\,\_\_,\ d,\ \_\_\,)\leftarrow\mathtt{WeierstrassForm}(f,\ T) (again, underscores “__\_\_” replace unimportant output).

Lemma 1 (Correctness of Algorithm 1𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}”).

The three output (gnew,d,α)(\,g_{new},\ d,\ \alpha\,) satisfy the specifications 1-2-3.

Proof.

We must prove that the output at Line 1 or 1 verifies the specifications 1.-2.-3. of the output.

Case of return at Line 1. Here gnew=1g_{new}=1 so that the while loop (Lines 1-1) exited on that condition and not on the condition d<0d<0. Therefore d0d\geq 0. This means that

gnew=gcd(T,cd+1,cd+2,,cδ)=1,andg=gcd(T,cd+2,,cδ)1.g_{new}=\mathrm{gcd}(T,\ c_{d+1},\ c_{d+2},\ldots,\ c_{\delta})=1,\quad\text{and}\quad g=\mathrm{gcd}(T,\ c_{d+2},\ldots,\ c_{\delta})\not=1.

Moreover the extended gcd “xgcd\mathrm{xgcd}” computation at Line 1 gives αcd+11modT\alpha c_{d+1}\equiv 1\bmod T. We have proved that the output (g,d+1,α)(\,g,\ d+1,\ \alpha\,) verifies the specifications 1.-2.-3.

Case of return at Line 1. Here gnew1g_{new}\not=1, meaning that the while loop (Lines 1-1) exited on the condition d=1d=-1. Thus gnew=gcd(T,c0,c1,,cδ)1g_{new}=\mathrm{gcd}(T,\ c_{0},\ c_{1},\ldots,\ c_{\delta})\not=1 is the largest power of pp that divides all the coefficients of ff, hence that divides ff. This proves that the output (gnew,1, 0)(\,g_{new},\ -1,\ 0\,) verifies the specifications 1.-2.-3. ∎

Weierstrass factorization through Hensel lifting

The Weierstrass preparation theorem states that a formal power series f=iciyi𝔞[[y]]f=\sum_{i}c_{i}y^{i}\in\mathfrak{a}[[y]] with coefficients (ci)i(c_{i})_{i} in a local complete ring (𝔞,𝔪)(\mathfrak{a},\mathfrak{m}), not all of them lying in 𝔪\mathfrak{m}, factorizes uniquely as f=quf=qu where q=q0++qn1yn1+ynq=q_{0}+\cdots+q_{n-1}y^{n-1}+y^{n} is monic and qi𝔪q_{i}\in\mathfrak{m}, and where u𝔞[[y]]u\in\mathfrak{a}[[y]]^{\star} is an invertible power series. In the traditional version, the degree nn of qq is equal to the smallest degree coefficient of the series ff not in 𝔪\mathfrak{m}. If ff is a polynomial, it is easy to adapt proofs so that n=deg(q)n=\deg(q) is the degree of the highest degree coefficient cnc_{n} of ff not in 𝔪\mathfrak{m}. Indeed, it suffices to consider the reverse polynomials to switch back to the the smallest degree coefficient. In our context the local complete ring is 𝔞=k[x]/pe\mathfrak{a}=k[x]/\langle p^{e}\rangle, 𝔪=p\mathfrak{m}=\langle p\rangle (indeed it is isomorphic to k[[x]]/pek[[x]]/\langle p^{e}\rangle, which is a finite quotient of the local complete ring k[[x]]k[[x]]).

Lemma 2 (Weierstrass).

Given fR[y]f\in R[y], written f=cd(x)yd++c0(x)f=c_{d}(x)y^{d}+\cdots+c_{0}(x), with cnc_{n} the coefficient of highest degree not in p\langle p\rangle (that such a coefficient exists is a pre-requirement), there exist two polynomials qq and uu defined below such that:

(1) f=quf=q\cdot u.

(2) qq is monic of degree nn, and

(3) u=u0+u1y++udnydnu=u_{0}+u_{1}y+\cdots+u_{d-n}y^{d-n} with u0pu_{0}\not\in\langle p\rangle and uipu_{i}\in\langle p\rangle for i1i\geq 1. In particular uu is a unit of R[[y]]R[[y]], so that: f,pe=q,pe\langle f,\ p^{e}\rangle=\langle q,\ p^{e}\rangle.

To compute the monic polynomial qq in practice, “special” Euclidean division [27], linear algebra, and Hensel lifting [42, Algo Q] are available. The latter is the most efficient and works in more general situations that are required in the second part of this article. This is what is used in [41, Thm. 1] for their “normalization” (whose purpose is to make polynomials monic too). Since a proof (and more) can be found in [42], it is not reproduced here. That proof relies entirely on Hensel lifting and does not involve Weierstrass preparation theorem, however Algorithm (Q) given by Musser is really a Weierstrass factorization when the modulus is the power of an irreducible polynomial. This implementation has the advantage to extend straightforwardly when the ring of coefficients is not necessarily a local ring, but a direct product of thereof — and that no division by zero occur. This feature helps to generalize the dynamic valuation as undertaken in Section 4, in that we can rely again on the same algorithm 2 when the modulus is not a power of an irreducible polynomial.

This algorithm essentially reduces to quadratic Hensel lifting (QHL). It lifts a factorization, and, as always with QHL, a Bézout identity. A standard form of QHL is described in Algorithm 15.10 of [52] and we refer to it for details. Given Nk[x]N\in k[x] and f,a,b,α,βk[x,y]f,a,b,\alpha,\beta\in k[x,y], the notation:

(a,b)𝙷𝚎𝚗𝚜𝚎𝚕𝙻𝚒𝚏𝚝(f,a,b,α,β,NN2ϵ),(\,a^{\star},\ b^{\star}\,)\leftarrow\mathtt{HenselLift}(f,\ a,\ b,\ \alpha,\ \beta,\ N\leadsto N^{2^{\epsilon}}),

assumes that:

fabmodN,αa+βb1modN,fabmodN2ϵ,aamodN,bbmodN.f\equiv ab\bmod N,\quad\alpha a+\beta b\equiv 1\bmod N,\quad f\equiv a^{\star}b^{\star}\bmod N^{2^{\epsilon}},\quad a^{\star}\equiv a\bmod N,\quad b^{\star}\equiv b\bmod N.

Here, the initial two factors of the input polynomial ff are the coefficient cdα1modTc_{d}\equiv\alpha^{-1}\bmod T of ff, and bαfmodNb\equiv\alpha f\bmod N (so that bb is a monic polynomial of degree dd modulo NN). The lifting produces the same equality modulo N2ϵN^{2^{\epsilon}}. This integer ϵ\epsilon is the smallest integer for which N2ϵN^{2^{\epsilon}} divides TT. That such an integer exists follows from sqfp(N)=sqfp(T)\mathrm{sqfp}(N)=\mathrm{sqfp}(T). The initial Bézout identity is given for free here: indeed cdα+b0=1c_{d}\alpha+b\cdot 0=1.

Input: 1. polynomial f=c0(x)+c1(x)y++cδ(x)yδk[x,y]f=c_{0}(x)+c_{1}(x)y+\dots+c_{\delta}(x)y^{\delta}\in k[x,y], with degy(f)=δd\deg_{y}(f)=\delta\geq d.
Its coefficient cd(x)c_{d}(x) of degree dd is invertible mod TT of inverse α\alpha.
Moreover, cd+1,,cδc_{d+1},\ \ldots,\ c_{\delta} are nilpotent modulo TT, that is sqfp(T)|sqfp(ci)\mathrm{sqfp}(T)|\mathrm{sqfp}(c_{i}) for i=d+1,,δi=d+1,\ \ldots,\delta
2. A monic non-constant polynomial Tk[x]T\in k[x].
3. dd a non-negative integer (defined in 1.)
4. αcd(x)1modT\alpha\equiv c_{d}(x)^{-1}\bmod T
5. a monic polynomial Nk[x]N\in k[x] that divides TT and such that sqfp(N)=sqfp(T)\mathrm{sqfp}(N)=\mathrm{sqfp}(T), equal to gcd(T,cd+1,,cδ)\mathrm{gcd}(T,\ c_{d+1},\ \ldots,\ c_{\delta}). So that if N1N\not=1 then degy(fmodN)=d\deg_{y}(f\bmod N)=d.
Output: bk[x,y]b^{\star}\in k[x,y], monic (in yy) of degree dd, and verifying b,T=f,T\langle b^{\star},\ T\rangle=\langle f,\ T\rangle.
15
bαfmodNb\leftarrow\alpha f\bmod N
  // bb is monic of degree dd
16
17cd𝖼𝗈𝖾𝖿𝖿(f,d)c_{d}\leftarrow\mathsf{coeff}(f,\ d)
18
19Let ϵ\epsilon be the smallest integer such that T|N2ϵT|N^{2^{\epsilon}}
20
(__,b)𝙷𝚎𝚗𝚜𝚎𝚕𝙻𝚒𝚏𝚝(f,cd,b,α, 0,NN2ϵ)(\,\_\_,\ b^{\star}\,)\leftarrow\mathtt{HenselLift}(f,\ c_{d},\ b,\ \alpha,\ 0,\ N\leadsto N^{2^{\epsilon}})
  // fcdbmodN,αcd+0b=1f\equiv c_{d}b\bmod N,\quad\alpha c_{d}+0\cdot b=1
21 return bmodTb^{\star}\bmod T
Algorithm 2 b𝙼𝚞𝚜𝚜𝚎𝚛𝚀(f,T,d,α,N)b\leftarrow\mathtt{MusserQ}(f,\ T,\ d,\ \alpha,\ N)
Example 7 (Algorithm 2𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}”).

With input f=x(x+1)y2+(2x+1)y+x2f=x(x+1)y^{2}+(2x+1)y+x^{2} modulo T=x2(x+1)2T=x^{2}(x+1)^{2}, d=1d=1 and α(2x+1)18x312x22x+1modT\alpha\equiv(2x+1)^{-1}\equiv-8x^{3}-12x^{2}-2x+1\bmod T, and N=x(x+1)N=x(x+1). All input’ specifications are satisfied: the coefficient x(x+1)x(x+1) of degree 2 is nilpotent modulo TT, the coefficient 2x+12x+1 of degree 1 is invertible. As expected, we have d=1d=1 and N=gcd(T,x(x+1))=x(x+1)N=\mathrm{gcd}(T,\ x(x+1))=x(x+1); As well as α(2x+1)1modT\alpha\equiv(2x+1)^{-1}\bmod T.

We have bfαy+xmodNb\equiv f\alpha\equiv y+x\bmod N. Now we lift f(2x+1)bmodN,N2,N4,f\equiv(2x+1)b\bmod N,\ N^{2},\ N^{4},\ldots until T|N2T|N^{2^{\ell}} . The Bézout identity α(2x+1)+0b=1\alpha(2x+1)+0\cdot b=1 that is also lifted is given for free. In this example one step of lifting is sufficient since N2=TN^{2}=T, yielding b=yx32x2b^{\star}=y-x^{3}-2x^{2}. Then b,T=f,T\langle b^{\star},\ T\rangle=\langle f,\ T\rangle. ∎

As already explained, Algorithm 3𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖\mathtt{MonicForm}” encapsulates the two algorithms “𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}” and “𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}” described above in one algorithm. On input f,Tf,\ T, it outputs UU the largest polynomial that divides ff, and bb monic which is “equivalent” to f/Uf/U in the sense that b,T/U=f/U,T/U\langle b,\ T/U\rangle=\langle f/U,\ T/U\rangle.

Input: 1. polynomial fk[x,y]f\in k[x,y]
2. T=pek[x]T=p^{e}\in k[x] the power of an irreducible polynomial pp.
Output: 1. bk[x,y]b\in k[x,y] is monic (in yy)
2. Monic polynomial Uk[x]U\in k[x] that divides TT and ff, such that: b,T/U=f/U,T/U\langle b,\ T/U\rangle=\langle f/U,\ T/U\rangle.
22
23(U,d,α)𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T)(\,U,\ d,\ \alpha\,)\leftarrow\mathtt{WeierstrassForm}(f,\ T)
24
25if d=1d=-1 then // Case where ff is nilpotent
       ff/Uf^{\prime}\leftarrow f/U ;    TT/UT^{\prime}\leftarrow T/U
        // Now ff^{\prime} is not nilpotent…
26      
      (N,d,α)𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T)(\,N,\ d,\ \alpha\,)\leftarrow\mathtt{WeierstrassForm}(f^{\prime},\ T^{\prime})
        // …so that d0d\geq 0
27      
      b𝙼𝚞𝚜𝚜𝚎𝚛𝚀(f,T,d,α,N)b\leftarrow\mathtt{MusserQ}(f^{\prime},\ T^{\prime},\ d,\ \alpha,\ N)
        // b,T=f,T\langle b,\ T^{\prime}\rangle=\langle f^{\prime},\ T^{\prime}\rangle
28      
29      return (b,U)(\,b,\ U\,)
30      
31else // Here ff was not nilpotent
32      
      b𝙼𝚞𝚜𝚜𝚎𝚛𝚀(f,T,d,α,U)b\leftarrow\mathtt{MusserQ}(f,\ T,\ d,\ \alpha,\ U)
        // b,T=f,T\langle b,\ T\rangle=\langle f,\ T\rangle
33      
34      return (b, 1)(\,b,\ 1\,)
35      
36
Algorithm 3 (b,U)𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖(f,T)(\,b,\ U\,)\leftarrow\mathtt{MonicForm}(f,\ T)
Lemma 3 (Correctness of Algorithm 3).

The output (b,U)(\,b,\ U\,) satisfies the equality of ideals b,T/U=f/U,T/U\langle b,\ T/U\rangle=\langle f/U,\ T/U\rangle with bk[x,y]b\in k[x,y] monic (in yy) and Uk[x]U\in k[x].

Proof.

The call to 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T)\mathtt{WeierstrassForm}(f,\ T) at Line 3 outputs (U,d,α)(\,U,\ d,\alpha\,). We must distinguish two cases:

Case of exit at Line 3. Here d0d\geq 0. According to the output’ specifications of “𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}”, U=gcd(T,cd+1,,cδ)U=\mathrm{gcd}(T,\ c_{d+1},\ldots,\ c_{\delta}) divides TT and the coefficients cd+1,,cδc_{d+1},\ldots,c_{\delta} of ff. Additionally, cdc_{d} is invertible modulo TT of inverse α\alpha. Therefore the five entries (f,T,d,α,U)(\,f,\ T,\ d,\ \alpha,\ U\,) of 𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ} at Line 3 satisfy the input’ specifications of 𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}. Its output’ specifications provide: b,T=f,T\langle b,\ T\rangle=\langle f,\ T\rangle. In conclusion, the output (b, 1)(\,b,\ 1\,) of 𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖(f,T)\mathtt{MonicForm}(f,\ T) satisfy the required specifications with U=1U=1.

Case of exit at Line 3. Here d=1d=-1, which means that, according to the output’ specifications of “𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}”, U=gcd(T,c0,,cδ)U=\mathrm{gcd}(T,\ c_{0},\ \ldots,\ c_{\delta}) divides all coefficients of ff, as well as TT. It follows also that f=f/Uf^{\prime}=f/U has an invertible coefficient modulo T=T/UT^{\prime}=T/U. Therefore the second call to “𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}” at Line 3 implies that the output (N,d,α)(\,N,\ d,\ \alpha\,) satisfy: cd/Uc_{d}/U is invertible modulo T=T/UT^{\prime}=T/U with αcd/U1modT\alpha c_{d}/U\equiv 1\bmod T^{\prime}. Additionally, N=gcd(T,cd+1/U,,cδ/U)N=\mathrm{gcd}(T^{\prime},\ c_{d+1}/U,\ldots,c_{\delta}/U) divides all the coefficients cd+1/U,,cδ/Uc_{d+1}/U,\ldots,c_{\delta}/U of ff^{\prime}. Consequently, the five entries (f,T,d,α,N)(\,f^{\prime},\ T^{\prime},\ d,\ \alpha,\ N\,) satisfy the input’ specifications of 𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ} at Line 3. The output bb hence verifies b,T=f,T\langle b,\ T^{\prime}\rangle=\langle f^{\prime},\ T^{\prime}\rangle, which is what we wanted to prove. ∎

2.4 Subresultant p.r.s

As explained in the introductory examples 1, the last non nilpotent and the first nilpotent (which may be zero according to our convention) polynomials in the modified subresultant p.r.s. need to be retrieved. The p.r.s is computed modulo pep^{e} which requires special care since very few results exist when coefficients are in a non-reduced ring. In particular the classic formula (6) may fail because of inverting a leading coefficient which may not be invertible. If such a subresultant is met, either all its coefficients are nilpotent and we have found the first nilpotent, either it has one invertible coefficient and it can be made monic (previous section); Then a subresultant computation is restarted (Line 4 of Algorithm 4). Before giving details of Algorithm 4 in the next section, the remaining of this section of preliminaries recalls the most fundamental results of the theory of subresultants.

Review

The subresultant p.r.s is a central topic in computer algebra and as such has been studied extensively; We will only recall the key results. It enjoys many convenient properties both algorithmically and theoretically.

On one hand a subresultant of two polynomials is the determinant of a certain matrix derived from the Sylvester matrix. It can be defined over any ring. But computing them in this way is costly. On the other hand, there is the subresultant p.r.s. computed through the formula (6). The main and classic result is that both objects are related through the block structure (a.k.a gap structure) theorem. Computing subresultants through a p.r.s is cheaper. The latter assumes traditionally that the input polynomials aa and bb are in a unique factorization domain.

It is possible to address polynomials having coefficients in rings of type k[x]/pek[x]/\langle p^{e}\rangle thanks to the specialization property. This is addressed in Section 3.1, here only standard definitions and results are recalled.

Definition 2.

Write njn_{j} the degrees in yy of any Euclidean p.r.s of aa and bb in (k[x])[y](k[x])[y], with n1:=degy(a)n_{1}:=\deg_{y}(a), n2:=degy(b)n_{2}:=\deg_{y}(b).

  • For 0jn210\leq j\leq n_{2}-1, the jj-th subresultant of aa and bb, written 𝖲𝗋𝖾𝗌j(a,b)\mathsf{Sres}_{j}(a,b), is defined as the polynomial of degree at most jj whose coefficients are certain minors of the Sylvester matrix (see e.g. [38, Prop. 7.7.1]).

  • For j=n2j=n_{2}, 𝖲𝗋𝖾𝗌n2(a,b):=𝗅𝖼(b)n1n21b\ \ \mathsf{Sres}_{n_{2}}(a,b):=\mathsf{lc}(b)^{n_{1}-n_{2}-1}b.

  • For n2<j<n11n_{2}<j<n_{1}-1, 𝖲𝗋𝖾𝗌j(a,b):=0\ \ \mathsf{Sres}_{j}(a,b):=0.

  • Let ν1:=degy(amodT)\nu_{1}:=\deg_{y}(a\bmod T) and ν2:=degy(bmodT)\nu_{2}:=\deg_{y}(b\bmod T) and assume ν1ν2\nu_{1}\geq\nu_{2}. For 0j<ν110\leq j<\nu_{1}-1 we define the jj-th subresultant of (amodT)(a\bmod T) and (bmodT)(b\mod T), written 𝖲j((amodT),(bmodT))\mathsf{S}_{j}((a\bmod T),\ (b\bmod T)), whose coefficients are certain minors of the Sylvester matrix of (amodT)(a\bmod T) and (bmodT)(b\bmod T).

Both subresultant families (𝖲𝗋𝖾𝗌j(a,b))0jn21(\mathsf{Sres}_{j}(a,b))_{0\leq j\leq n_{2}-1} and (𝖲j((amodT),(bmodT)))0jν21(\mathsf{S}_{j}((a\bmod T),\ (b\bmod T)))_{0\leq j\leq\nu_{2}-1} are related by the following functorial property:

Lemma 4 (Corollary 7.8.2 of [38]).

Write R=k[x]/TR=k[x]/\langle T\rangle, and ϕ:(k[x])[y]R[y]\phi:(k[x])[y]\to R[y] the reduction map. As above let n1:=degy(a)n_{1}:=\deg_{y}(a) and n2:=degy(b)n_{2}:=\deg_{y}(b) with n1n2n_{1}\geq n_{2}, and ν1:=degy(amodT)\nu_{1}:=\deg_{y}(a\bmod T) and ν2:=degy(bmodT)\nu_{2}:=\deg_{y}(b\bmod T). Assume ν1ν2\nu_{1}\geq\nu_{2}. Then for 0j<n20\leq j<n_{2},

  1. 1.

    If ν2=n2\nu_{2}=n_{2} and ν1n1\nu_{1}\leq n_{1}, then ϕ(𝖲𝗋𝖾𝗌j(a,b))=ϕ(𝗅𝖼(b))n1ν1𝖲j(ϕ(a),ϕ(b))\phi(\mathsf{Sres}_{j}(a,b))=\phi(\mathsf{lc}(b))^{n_{1}-\nu_{1}}\mathsf{S}_{j}(\phi(a),\phi(b)).

  2. 2.

    If ν2n2\nu_{2}\leq n_{2} and ν1=n1\nu_{1}=n_{1}, then ϕ(𝖲𝗋𝖾𝗌j(a,b))=ϕ(𝗅𝖼(a))n2ν2𝖲j(ϕ(a),ϕ(b))\phi(\mathsf{Sres}_{j}(a,b))=\phi(\mathsf{lc}(a))^{n_{2}-\nu_{2}}\mathsf{S}_{j}(\phi(a),\phi(b)).

  3. 3.

    If ν2<n2\nu_{2}<n_{2} and ν1<n1\nu_{1}<n_{1}, then ϕ(𝖲𝗋𝖾𝗌j(a,b))=0\phi(\mathsf{Sres}_{j}(a,b))=0.

Writing F1:=aF_{1}:=a and F2:=bF_{2}:=b, the subresultant p.r.s [F1,F2,,Fr, 0][F_{1},\ F_{2},\ \ldots,\ F_{r},\ 0] over (k[x])[y](k[x])[y] is defined through the formula below (sometimes called “First kind subresultant p.r.s” [38, Definition 7.6.4]):

F3\displaystyle F_{3} :=\displaystyle:= (1)n1n2+1𝗉𝗋𝖾𝗆(F1,F2)and lettingc3:=1,\displaystyle(-1)^{n_{1}-n_{2}+1}\mathsf{prem}(F_{1},\ F_{2})\quad\text{and letting}\quad c_{3}:=-1,
ci\displaystyle c_{i} :=\displaystyle:= (𝗅𝖼(Fi2)ci1)ni3ni2ci1fori4\displaystyle\left(\frac{\mathsf{lc}(F_{i-2})}{c_{i-1}}\right)^{n_{i-3}-n_{i-2}}c_{i-1}\quad\text{for}\quad i\geq 4 (6)
Fi\displaystyle F_{i} :=\displaystyle:= 𝗉𝗋𝖾𝗆(Fi2,Fi1)𝗅𝖼(Fi2)(ci)ni2ni1,fori4\displaystyle\frac{\mathsf{prem}(F_{i-2},\ F_{i-1})}{-\mathsf{lc}(F_{i-2})(-c_{i})^{n_{i-2}-n_{i-1}}},\quad\text{for}\quad i\geq 4
Theorem 2 (Subresultant’s chain theorem — Thm. 7.9.4 of [38]).

The subresultant p.r.s [Fi]i3[F_{i}]_{i\geq 3} and the subresultant chain (𝖲𝗋𝖾𝗌j(a,b))j=0,,n21(\mathsf{Sres}_{j}(a,b))_{j=0,\ldots,n_{2}-1} are related as follows:

𝖲𝗋𝖾𝗌nj11(a,b)=Fj,forj=3,,r.\mathsf{Sres}_{n_{j-1}-1}(a,\ b)=F_{j},\quad\text{for}\quad j=3,\ldots,r.

𝖲𝗋𝖾𝗌nj11(a,b)\mathsf{Sres}_{n_{j-1}-1}(a,\ b) is the top subresultant in the block it belongs to.

3 Gröbner basis from modified p.r.s

The algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}”, presented in paragraph 3.2, produces a minimal lexGb of the ideal a,b,pe\langle a,\ b,\ p^{e}\rangle. It is very simple if we take the modified subresultant algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” for granted: one call to “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” (Line 5), a recursive call (Line 5) and an update of the output of this recursive call (Line 5).

On the other hand the algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” is more technical, as often the case when dealing with subresultants. The rough idea summarizes as: “make subresultants monic” if their leading coefficient is not invertible modulo TT, then pursue the computations of subresultants through a recursive call, until a nilpotent subresultant is found. This simple description hides however the special care that corner cases and degree conditions require. It thus might be useful to have a look at Algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}” in prior Algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}”, as a motivation.

3.1 Subresultant p.r.s. modulo TT

This section introduces the algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}”. Running the subresultant p.r.s over k[x,y]k[x,y] yields significant and unnecessary growth in the degree in xx of the coefficients. Only the image modulo TT, that is of degree in xx bounded by that of TT, is needed. Unfortunately, the formula (6) formally works only over unique factorization domains. The classic workaround consists in taking the homomorphic image by ϕ\phi:

Proposition 1.

Let polynomials F1F_{1} and F2F_{2} in (k[x])[y](k[x])[y] of respective degrees (in yy) n1,n2n_{1},\ n_{2}, and let ϕ\phi be the homomorphism (k[x])[y]R[y](k[x])[y]\to R[y] as defined above. For a given integer 2ir+12\leq i\leq r+1, if the (𝗅𝖼(Fj1))j(\mathsf{lc}(F_{j-1}))_{j} are invertible modulo TT for j=2,,ij=2,\ldots,\ i, then the formula (6) specializes well by ϕ\phi:

Write ci¯=ϕ(ci)\overline{c_{i}}=\phi(c_{i}). For j=3j=3 then, c3¯:=1\overline{c_{3}}:=-1 and ϕ(F3):=(1)n1n2+1𝗉𝗋𝖾𝗆(ϕ(F1),ϕ(F2))\phi(F_{3}):=(-1)^{n_{1}-n_{2}+1}\mathsf{prem}(\phi(F_{1}),\ \phi(F_{2})). And, for i+1j4i+1\geq j\geq 4:

cj¯=(𝗅𝖼(ϕ(Fj2))cj1¯)nj3nj2cj1¯ϕ(Fj):=𝗉𝗋𝖾𝗆(ϕ(Fj2),ϕ(Fj1))𝗅𝖼(ϕ(Fj2))(cj¯)nj2nj1.\overline{c_{j}}=\left(\frac{\mathsf{lc}(\phi(F_{j-2}))}{\overline{c_{j-1}}}\right)^{n_{j-3}-n_{j-2}}\overline{c_{j-1}}\quad\quad\phi(F_{j}):=\frac{\mathsf{prem}(\phi(F_{j-2}),\ \phi(F_{j-1}))}{-\mathsf{lc}(\phi(F_{j-2}))(-\overline{c_{j}})^{n_{j-2}-n_{j-1}}}.

In particular 𝖲nj11(ϕ(F1),ϕ(F2))=ϕ(Fj)\mathsf{S}_{n_{j-1}-1}(\phi(F_{1}),\ \phi(F_{2}))=\phi(F_{j}) for j=3,,ij=3,\ldots,i, and can be computed modulo TT using formula (6) (index ii included although 𝗅𝖼(Fi)\mathsf{lc}(F_{i}) is not assumed invertible modulo TT).

Proof.

We need to show that ϕ\phi commutes with all operations and primitives involved in the formula (6). First of all, 𝗅𝖼(ϕ(Fj))=ϕ(𝗅𝖼(Fj))\mathsf{lc}(\phi(F_{j}))=\phi(\mathsf{lc}(F_{j})) for j=2,,i1j=2,\ldots,i-1 by assumption. Hence the Euclidean degree sequence (nj)j(n_{j})_{j} is also that of the one initiated with (ϕ(F1),ϕ(F2))(\phi(F_{1}),\phi(F_{2})) too, up to j<ij<i. Therefore, for j=2,,i1j=2,\ldots,i-1, the pseudo-division equality 𝗅𝖼(Fj1)njnj1+1Fj=qFj1+𝗉𝗋𝖾𝗆(Fj,Fj1)\mathsf{lc}(F_{j-1})^{n_{j}-n_{j-1}+1}F_{j}=qF_{j-1}+\mathsf{prem}(F_{j},\ F_{j-1}) specializes by ϕ\phi: 𝗅𝖼(ϕ(Fj1))njnj1+1ϕ(Fj)=ϕ(q)ϕ(Fj1)+𝗉𝗋𝖾𝗆(ϕ(Fj),ϕ(Fj1))\mathsf{lc}(\phi(F_{j-1}))^{n_{j}-n_{j-1}+1}\phi(F_{j})=\phi(q)\phi(F_{j-1})+\mathsf{prem}(\phi(F_{j}),\phi(F_{j-1})), whence: ϕ(𝗉𝗋𝖾𝗆(Fj1,Fj))=𝗉𝗋𝖾𝗆(ϕ(Fj),ϕ(Fj1))\phi(\mathsf{prem}(F_{j-1},\ F_{j}))=\mathsf{prem}(\phi(F_{j}),\phi(F_{j-1})), for j=2,,i1j=2,\ldots,i-1. Moreover the pseudo-quotient and pseudo-remainder are uniquely determined. Besides, the formula involves only algebraic operations which commute by definition with the homomorphism ϕ\phi. Therefore, ϕ\phi commutes as expected. In particular, although 𝗅𝖼(Fi)\mathsf{lc}(F_{i}) is not assumed to be invertible modulo TT, we still have

ϕ(Fi)=ϕ(𝗉𝗋𝖾𝗆(Fi1,Fi2)𝗅𝖼(Fi2)(ci)ni2ni1)=𝗉𝗋𝖾𝗆(ϕ(Fi1),ϕ(Fi2))𝗅𝖼(ϕ(Fi2))(ci¯)ni2ni1.\phi(F_{i})=\phi\left(\frac{\mathsf{prem}(F_{i-1},\ F_{i-2})}{-\mathsf{lc}(F_{i-2})(-c_{i})^{n_{i-2}-n_{i-1}}}\right)=\frac{\mathsf{prem}(\phi(F_{i-1}),\phi(F_{i-2}))}{-\mathsf{lc}(\phi(F_{i-2}))(-\bar{c_{i}})^{n_{i-2}-n_{i-1}}}.

Finally, the assumptions made on F1F_{1} and F2F_{2} fall into Case 1. of Lemma 4: ϕ(𝖲𝗋𝖾𝗌j(F1,F2))=𝖲j(ϕ(F1),ϕ(F2))\phi(\mathsf{Sres}_{j}(F_{1},\ F_{2}))=\mathsf{S}_{j}(\phi(F_{1}),\ \phi(F_{2})). Besides, Theorem 2 gives Fj=𝖲𝗋𝖾𝗌nj11(F1,F2)F_{j}=\mathsf{Sres}_{n_{j-1}-1}(F_{1},\ F_{2}) hence

ϕ(Fj)=𝖲nj11(ϕ(F1),ϕ(F2))forj=2,,i.\phi(F_{j})=\mathsf{S}_{n_{j-1}-1}(\phi(F_{1}),\ \phi(F_{2}))\quad\text{for}\quad j=2,\ldots,i.

Corollary 1.

With the notations as in Proposition 1, let f1:=ϕ(F1)f_{1}:=\phi(F_{1}) and f2:=ϕ(F2)f_{2}:=\phi(F_{2}). Consider the p.r.s F1,F2,,Fr,Fr+1F_{1},\ F_{2},\ldots,F_{r},\ F_{r+1} computed in (k[x])[y](k[x])[y] with Fr+1=0F_{r+1}=0. Let f1,f2,f3,,fi,fi+1f_{1},\ f_{2},\ f_{3},\ \ldots,\ f_{i},\ f_{i+1} be the one computed modulo TT as explained in Proposition 1, under the assumption that the (𝗅𝖼(Fj))1ji(\mathsf{lc}(F_{j}))_{1\leq j\leq i}’s are all invertible modulo TT. Assume that 𝗅𝖼(Fi+1)\mathsf{lc}(F_{i+1}) is not invertible modulo TT or Fi+10modTF_{i+1}\equiv 0\bmod T.

We have F1,F2,T=fj1,fj,T\langle F_{1},\ F_{2},\ T\rangle=\langle f_{j-1},\ f_{j},\ T\rangle for any 2ji+12\leq j\leq i+1.

Proof.

Over the unique factorization domain k[x]k[x], it is classical that the subresultant p.r.s verifies F1,F2=Fj1,Fj\langle F_{1},\ F_{2}\rangle=\langle F_{j-1},\ F_{j}\rangle for any 2jr+12\leq j\leq r+1. By Proposition 1, ϕ(Fj)=fj\phi(F_{j})=f_{j} for j=1,,i+1j=1,\ldots,i+1, hence:

F1,F2,T=ϕ(F1),ϕ(F2),T=ϕ(Fj1),ϕ(Fj),T=fj1,fj,T,\langle F_{1},\ F_{2},\ T\rangle=\langle\phi(F_{1}),\phi(F_{2}),\ T\rangle=\langle\phi(F_{j-1}),\ \phi(F_{j}),\ T\rangle=\langle f_{j-1},\ f_{j},\ T\rangle,

for j=2,,i+1j=2,\ldots,i+1

37
Input: 1. polynomials f1,f2k[x,y]f_{1},\ f_{2}\in k[x,y], degy(f1)degy(f2)\deg_{y}(f_{1})\geq\deg_{y}(f_{2}). The leading coefficient of f1f_{1} is invertible modulo TT, and f20f_{2}\not=0.
2. T=pek[x]T=p^{e}\in k[x], the power of an irreducible polynomial pp.
38
Output: 1-2. monic (in yy) polynomials u,vk[x,y]u,v\in k[x,y] verifying the degree condition of Proposition 2.
3-4. monic polynomials U,T1k[x]U,\ T_{1}\in k[x] such that: T1U=T,f1,f2,T=u,vU,TT_{1}U=T,\qquad\langle f_{1},\ f_{2},\ T\rangle=\langle u,\ v\,U,\ T\rangle.
39
40repeat
41       Compute the subresultant p.r.s f1,f2,,f,f+1f_{1},\ f_{2},\ldots,\ f_{\ell},\ f_{\ell+1} of f1f_{1} and f2f_{2} modulo TT (with f+1=0f_{\ell+1}=0, following Proposition 1)
42until  𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT or f+1=0f_{\ell+1}=0
43if 𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT then // 𝗅𝖼(fj)\mathsf{lc}(f_{j}) is invertible modulo TT for j<ij<i
       (b,U)𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖(fi,T)(\,b,\ U\,)\leftarrow\mathtt{MonicForm}(f_{i},\ T)
        // bb is monic and Ub,T=fi,T\langle Ub,\ T\rangle=\langle f_{i},\ T\rangle
       a(𝗅𝖼(fi1)1modT)fi1modTa\leftarrow(\mathsf{lc}(f_{i-1})^{-1}\bmod T)f_{i-1}\bmod T
        // aa is monic and a,T=fi1,T\langle a,\ T\rangle=\langle f_{i-1},\ T\rangle
44       if degx(U)>0\deg_{x}(U)>0  then // fif_{i} is nilpotent
45             return (a,b,U,T/U)(\,a,\ b,\ U,\ T/U\,)
46            
47      else // fif_{i} is not nilpotent
             return 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(a,b,T)\mathtt{LastNonNil}(a,\ b,\ T)
              // Recursive call
48            
49      
50
51// Here, all the 𝗅𝖼(f1),,𝗅𝖼(f)\mathsf{lc}(f_{1}),\ldots,\ \mathsf{lc}(f_{\ell}) are invertible modulo TT, and f+1=0f_{\ell+1}=0
return ((𝗅𝖼(f)modT)1f, 0, 1,T)(\ (\mathsf{lc}(f_{\ell})\bmod T)^{-1}f_{\ell},\ 0,\ 1,\ T\ )
Algorithm 4 (u,v,U,T1)𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(f1,f2,T)(\,u,\ v,\ U,\ T_{1}\,)\leftarrow\mathtt{LastNonNil}(f_{1},\ f_{2},\ T)
Proposition 2 (Correctness of Algorithm 4).

The output u,v,U,T1u,\ v,\ U,\ T_{1} of 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(f1,f2,T)\mathtt{LastNonNil}(f_{1},\ f_{2},\ T) verifies:

u,vU,UT1=f1,f2,TandUT1=T.\langle u,\ vU,\ UT_{1}\rangle=\langle f_{1},\ f_{2},\ T\rangle\quad\text{and}\quad UT_{1}=T.

If v=0v=0 then U=1U=1 and T1=TT_{1}=T. Moreover, we also have the following degree conditions:

ifv0thendegy(v)<degy(u)anddegy(u)<degy(f1),\text{if}\quad v\not=0\quad\text{then}\quad\deg_{y}(v)<\deg_{y}(u)\quad\text{and}\quad\deg_{y}(u)<\deg_{y}(f_{1}), (7)

except in the following corner cases:

  1. (i)

    degy(u)=degy(v)\deg_{y}(u)=\deg_{y}(v) possibly holds if uu and vv are respectively the monic form of f1f_{1} and f2f_{2} with f2f_{2} nilpotent (implying 0<degx(U)<degx(T)0<\deg_{x}(U)<\deg_{x}(T)) and degy(f2)=degy(f1)\deg_{y}(f_{2})=\deg_{y}(f_{1}).

  2. (ii)

    degy(u)=degy(f1)\deg_{y}(u)=\deg_{y}(f_{1}) possibly holds under the condition i above.

  3. (iii)

    The only other situation where degy(u)=degy(f1)\deg_{y}(u)=\deg_{y}(f_{1}) is when 𝗅𝖼(f2)\mathsf{lc}(f_{2}) is not nilpotent (equivalently is invertible) modulo TT, and 𝗅𝖼(f2)f1𝗅𝖼(f1)f2modp\mathsf{lc}(f_{2})f_{1}\equiv\mathsf{lc}(f_{1})f_{2}\bmod\langle p\rangle.

    In this case, uu is the monic form of f2f_{2} and vv that of ±f3\pm f_{3}.

Example 8 (corner cases in the degree condition).

An example of corner cases i-ii is

f1=y+p,f2=py+pmoduloT=p2.f_{1}=y+p,\qquad f_{2}=py+p\quad\text{modulo}\quad T=p^{2}.

Remark that f2f_{2} is nilpotent and (y+1,p)𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖(f2,T)(\,y+1,\ p\,)\leftarrow\mathtt{MonicForm}(f_{2},\ T). This is thus the first nilpotent subresultant and we have v=y+1v=y+1 and U=pU=p. Besides f1f_{1} is not nilpotent and already in monic form, thus u=f1u=f_{1}. Note that U=pU=p verifies 0<degx(U)<degx(T)0<\deg_{x}(U)<\deg_{x}(T). We have degy(v)=degy(y+1)=1=degy(y+p)=degy(u)\deg_{y}(v)=\deg_{y}(y+1)=1=\deg_{y}(y+p)=\deg_{y}(u) (degree equality i) and degy(u)=1=degy(f1)\deg_{y}(u)=1=\deg_{y}(f_{1}) (degree equality ii).

An example of corner case iii is when

f1=y+p,f2=ymoduloT=p2.f_{1}=y+p,\qquad f_{2}=y\quad\text{modulo}\quad T=p^{2}.

We see directly that 𝗅𝖼(f2)f1𝗅𝖼(f1)f2ymodp\mathsf{lc}(f_{2})f_{1}\equiv\mathsf{lc}(f_{1})f_{2}\equiv y\bmod\langle p\rangle. Then ±f3=𝗉𝗋𝖾𝗆(f1,f2)=p\pm f_{3}=\mathsf{prem}(f_{1},\ f_{2})=p is the first nilpotent subresultant. We thus have (v,U)𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖(f3,T)(\,v,\ U\,)\leftarrow\mathtt{MonicForm}(f_{3},\ T) with v=1v=1 and U=pU=p. Moreover u=f2u=f_{2}, being the last non nilpotent, and already in monic form. Finally, note the degree equality iii: degy(f1)=1=degy(u)\deg_{y}(f_{1})=1=\deg_{y}(u). ∎

Proof.

We start by the proof of correctness before turning to the proof of the degree conditions (7).

Proof of correctness. We investigate the three returns in the algorithm separately.

Case 1: Exit at Line 4. The algorithm does not enter Lines 4-4, which means that the if-test Line 4 was never passed: the leading coefficients 𝗅𝖼(f1),,𝗅𝖼(f)\mathsf{lc}(f_{1}),\ldots,\mathsf{lc}(f_{\ell}) in the p.r.s are all invertible modulo TT, and f+1=0f_{\ell+1}=0. The output at Line 4 is

u=(𝗅𝖼(f)modT)1fmodT,v=0,U=1,T1=T.u=(\mathsf{lc}(f_{\ell})\bmod T)^{-1}f_{\ell}\bmod T,\quad v=0,\quad U=1,\quad T_{1}=T.

Therefore UT1=TUT_{1}=T. Moreover, u,vU,T=u,T\langle u,\ vU,\ T\rangle=\langle u,\ T\rangle. Note that uu is monic verifying u,T=f,T\langle u,\ T\rangle=\langle f_{\ell},\ T\rangle. Besides, by Corollary 1, f1,f2,T=f,f+1,T\langle f_{1},\ f_{2},\ T\rangle=\langle f_{\ell},\ f_{\ell+1},\ T\rangle, and since f+1=0f_{\ell+1}=0 we get f1,f2,T=f,T\langle f_{1},\ f_{2},\ T\rangle=\langle f_{\ell},\ T\rangle. We obtain: f1,f2,T=u,T\langle f_{1},\ f_{2},\ T\rangle=\langle u,\ T\rangle as expected.

In the remaining two cases, vv is not zero, which proves the assertion that if v=0v=0 then U=1U=1, and T1=TT_{1}=T.

Case 2: Exit at Line 4. The if-test Line 4 tells that 𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT, while the 𝗅𝖼(fj)\mathsf{lc}(f_{j})s are for j<ij<i. At Line 4(b,U)𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖(fi,T)(\,b,\ U\,)\leftarrow\mathtt{MonicForm}(f_{i},\ T)” we have from the definition of the “𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖\mathtt{MonicForm}” algorithm that Ub,T=fi,T\langle Ub,\ T\rangle=\langle f_{i},\ T\rangle, with U|TU|T and bb monic. Moreover degx(U)>0\deg_{x}(U)>0 (the if-test at Line 4) implies that fif_{i} is nilpotent. On the other hand, fi1f_{i-1} is invertible modulo TT: the inversion at Line 4 is correct and aa is monic verifying a,T=fi1,T\langle a,\ T\rangle=\langle f_{i-1},\ T\rangle. By Corollary 1 we have f1,f2,T=fi1,fi,T=a,fi,T=a,Ub,T\langle f_{1},\ f_{2},\ T\rangle=\langle f_{i-1},\ f_{i},\ T\rangle=\langle a,\ f_{i},\ T\rangle=\langle a,\ Ub,\ T\rangle. This is what we wanted to prove in this case 2.

Case 3: Exit at Line 4. There, 𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT, and since degx(U)=0\deg_{x}(U)=0, fif_{i} is not nilpotent. As above, we have b,T=fi,T\langle b,\ T\rangle=\langle f_{i},\ T\rangle. Additionally, degy(b)<degy(fi)\deg_{y}(b)<\deg_{y}(f_{i}): fif_{i} is not nilpotent but 𝗅𝖼(fi)\mathsf{lc}(f_{i}) is, so the Weierstrass factorization of fif_{i} produces a monic polynomial bb of degree smaller than that of fif_{i}. And since 𝗅𝖼(fi1)\mathsf{lc}(f_{i-1}) is invertible modulo TT, a,T=fi1,T\langle a,\ T\rangle=\langle f_{i-1},\ T\rangle. The recursive call is thus made with monic polynomials aa and bb of degree smaller than that of f1f_{1} and f2f_{2}; Indeed, observe that:

degy(b)<degy(fi)degy(f2),degy(a)=degy(fi1),(hencedegy(b)<degy(a))\deg_{y}(b)<\deg_{y}(f_{i})\leq\deg_{y}(f_{2}),\qquad\deg_{y}(a)=\deg_{y}(f_{i-1}),\qquad(\text{hence}\ \deg_{y}(b)<\deg_{y}(a)) (8)

Therefore, the recursive call ultimately boils down to Case 1: its output (u,v,U,T1)(\,u,\ v,\ U,\ T_{1}\,) verifies a,b,T=u,vU,T1U\langle a,\ b,\ T\rangle=\langle u,\ vU,\ T_{1}U\rangle and T1U=TT_{1}U=T. Since a,b,T=fi1,fi,T\langle a,\ b,\ T\rangle=\langle f_{i-1},\ f_{i},\ T\rangle, and that by Corollary 1 we have f1,f2,T=fi1,fi,T\langle f_{1},\ f_{2},\ T\rangle=\langle f_{i-1},\ f_{i},\ T\rangle. We conclude that u,vU,T1U=f1,f2,T\langle u,\ vU,\ T_{1}U\rangle=\langle f_{1},\ f_{2},\ T\rangle.

Proof of the degree conditions (7). If at least two pseudo-divisions occur in the algorithm (including in recursive calls), they induce at least two strict degree decreases in the modified p.r.s computed. Both uu and vv being the monic form of the last two polynomials in that modified p.r.s, it follows that:

if v0,degy(v)<degy(u)<degy(f2)degy(f1)\text{if }v\not=0,\quad\deg_{y}(v)<\deg_{y}(u)<\deg_{y}(f_{2})\leq\deg_{y}(f_{1})

which proves the degree conditions (7). No corner cases can happen in this situation.

If exactly one pseudo-division occurs then:

  1. -1-

    either 𝗅𝖼(f2)\mathsf{lc}(f_{2}) is invertible modulo TT and f3=±𝗉𝗋𝖾𝗆(f1,f2)f_{3}=\pm\mathsf{prem}(f_{1},\ f_{2})

  2. -2-

    or not and then, letting bb be the monic form of f2f_{2} (Line 4), and aa that of f1f_{1} (Line 4), a recursive call “(u,v,U,T)𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(a,b,T)(\,u,\ v,\ U,\ T\,)\leftarrow\mathtt{LastNonNil}(a,\ b,\ T)” is performed (Line 4). But then, aa and bb being monic at least a pseudo-division should take place inside this recursive call, a contradiction. This situation 2 cannot happen in case of one pseudo-division only.

Note that f2f_{2} cannot be nilpotent for one pseudo-division to occur. The algorithm then stops, meaning that f3f_{3} is nilpotent (which may be zero according to our convention). Then vv is its monic form, and uu is the monic form of f2f_{2}. We have:

if v0,degy(v)degy(f3)<degy(f2)=degy(u)degy(f1)\text{if }v\not=0,\quad\deg_{y}(v)\leq\deg_{y}(f_{3})<\deg_{y}(f_{2})=\deg_{y}(u)\leq\deg_{y}(f_{1}) (9)

which proves the degree conditions (7). For degy(u)=degy(f1)\deg_{y}(u)=\deg_{y}(f_{1}) (possible corner cases i-ii ) to hold, necessarily degy(u)=degy(f2)=degy(f1)\deg_{y}(u)=\deg_{y}(f_{2})=\deg_{y}(f_{1}). The pseudo-division of f1f_{1} by f2f_{2} writes as:

𝗅𝖼(f2)degy(f2)degy(f1)+1f1=𝗉𝗊𝗎𝗈(f1,f2)f2±f3.\mathsf{lc}(f_{2})^{\deg_{y}(f_{2})-\deg_{y}(f_{1})+1}f_{1}=\mathsf{pquo}(f_{1},\ f_{2})f_{2}\pm f_{3}.

The degree equality degy(f1)=degy(f2)\deg_{y}(f_{1})=\deg_{y}(f_{2}) implies that 𝗉𝗊𝗎𝗈(f1,f2)=𝗅𝖼(f1)\mathsf{pquo}(f_{1},\ f_{2})=\mathsf{lc}(f_{1}), and since f30modpf_{3}\equiv 0\bmod\langle p\rangle:

𝗅𝖼(f2)f1𝗅𝖼(f1)f2modp.\mathsf{lc}(f_{2})f_{1}\equiv\mathsf{lc}(f_{1})f_{2}\bmod\langle p\rangle.

This is the corner case iii. Corner cases i-ii do not occur.

If no pseudo-division occurs at all, then f2f_{2} is already the “first nilpotent”. The polynomials uu and vv are then respectively the monic form of f1f_{1} and f2f_{2}. Since 𝗅𝖼(f1)\mathsf{lc}(f_{1}) is invertible modulo TT by assumption, u𝗅𝖼(f1)1f1modTu\equiv\mathsf{lc}(f_{1})^{-1}f_{1}\bmod T, in particular degy(u)=degy(f1)\deg_{y}(u)=\deg_{y}(f_{1}): this is corner case ii. We can then observe that:

degy(v)degy(f2)degy(f1)=degy(u).\deg_{y}(v)\leq\deg_{y}(f_{2})\leq\deg_{y}(f_{1})=\deg_{y}(u).

This proves the degree conditions (7). For degy(v)=degy(u)\deg_{y}(v)=\deg_{y}(u) to hold, the condition degy(f1)=degy(f2)\deg_{y}(f_{1})=\deg_{y}(f_{2}) is necessary, proving the situation of corner case i. ∎

3.2 Deducing the Gröbner basis

The main algorithm 5 essentially iterates the algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” through recursive calls. We refer to Example 1 in Introduction.

Input: 1.-2. polynomials a,bk[x,y]a,\ b\in k[x,y], degy(a)degy(b)\deg_{y}(a)\geq\deg_{y}(b). The leading coefficient of aa is invertible modulo T=peT=p^{e}, bb is not nilpotent modulo TT (which also means b0b\not=0 by our convention).
3. The power of an irreducible polynomial T=pek[x]T=p^{e}\in k[x]
52
Output: A minimal lexGb 𝒢\mathcal{G} of the ideal a,b,T\langle a,\ b,\ T\rangle.
53
54if aa or bb is a non-zero constant then
55      return [1][1]
56
(u,v,U,T1)𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(a,b,T)(\,u,\ v,\ U,\ T_{1}\,)\leftarrow\mathtt{LastNonNil}(a,\ b,\ T)
  // u,vU,UT1=a,b,T\langle u,\ vU,\ UT_{1}\rangle=\langle a,\ b,\ T\rangle
57 if u=1u=1 then
58      return [1][1]
59if v=0v=0 then
60      return [u,T][u,\ T]
𝒢1𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱(u,v,T1)\mathcal{G}_{1}\leftarrow\mathtt{SubresToGB}(u,\ v,\ T_{1})
  // Recursive call
𝒢[u]𝖼𝖺𝗍[Ug:g𝒢1]\mathcal{G}\leftarrow[u]\mathsf{~{}cat~{}}[U\cdot g\ :\ g\in\mathcal{G}_{1}]
  // Update of the output of the recursive call
61 return 𝒢\mathcal{G}
Algorithm 5 𝒢𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱(a,b,T)\mathcal{G}\leftarrow\mathtt{SubresToGB}(a,\ b,\ T)
Theorem 3.

The output 𝒢\mathcal{G} is a minimal lexGb of a,b,T\langle a,\ b,\ T\rangle.

Proof.

Among the four returns in the algorithm, the first three ones are base cases treated in Cases 1, 2, 3 below. The last return (Case 4) involves a recursive call and requires more care.

Case 1: Exit at Line 5. Here aa or bb is a non-zero constant, thus a,b,T=1\langle a,\ b,\ T\rangle=\langle 1\rangle and the output should be [1][1].

Case 2: Exit at Line 5. By the input’ Specification 1., aa is assumed to have an invertible leading coefficient modulo TT, and by input’ Specification 2. bb is not nilpotent (which implies that b0b\not=0 according to our convention). This legitimates the call to 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(a,b,T)\mathtt{LastNonNil}(a,\ b,\ T) at Line 5, according that aa and bb should verify these assumptions. By definition of “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}”, the output (u,v,U,T1)(\,u,\ v,\ U,\ T_{1}\,) verifies u,vU,UT1=a,b,T\langle u,\ vU,\ UT_{1}\rangle=\langle a,\ b,\ T\rangle. So that if u=1u=1 then a,b,T=1\langle a,\ b,\ T\rangle=\langle 1\rangle and the output should be [1][1]. This is precisely what returns the algorithm at Line 5.

Case 3: Exit at Line 5. Here v=0v=0, which implies U=1U=1, T1=TT_{1}=T and a,b,T=u,vT1,UT1=u,T\langle a,\ b,\ T\rangle=\langle u,\ vT_{1},\ UT_{1}\rangle=\langle u,\ T\rangle by Proposition 2. The return precisely outputs [u,T][u,\ T], which is a lexGb (actually a bivariate triangular set).

Case 4: Exit at Line 5. The recursive call at Line 5 makes sense, its input uu, vv and T1T_{1} satisfying the input’ specifications: uu and vv are monic and degy(u)degy(v)\deg_{y}(u)\geq\deg_{y}(v) (this degree inequality follows from the degree condition (7) of the output of “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}”). Here v0v\not=0, as the case v=0v=0 is treated in Case 3. By the degree condition (7) of Proposition 2 we have degy(u)<degy(a)\deg_{y}(u)<\deg_{y}(a) unless one of the corner cases ii or iii occur. In Case ii, which assumptions are that of Case i, bb is nilpotent, excluded by the input’ Specifications. And in Case iii, v=±𝗉𝗋𝖾𝗆(a,u)v=\pm\mathsf{prem}(a,\ u) which is nilpotent (maybe 0 by our convention, but the case v=0v=0 is already treated in Case 3.). Thus, by Eq. (9):

degy(v)degy(𝗉𝗋𝖾𝗆(a,u))<degy(u)degy(b)degy(a)\deg_{y}(v)\leq\deg_{y}(\mathsf{prem}(a,\ u))<\deg_{y}(u)\leq\deg_{y}(b)\leq\deg_{y}(a)

Therefore, the input (u,v,T1)(u,\ v,\ T_{1}) of the recursive call Line 5 displays in any case a degree decrease compared to the input (a,b,T)(a,\ b,\ T) of the main call: always hold the following inequalities

degy(u)degy(a),degy(v)degy(b),degy(T1)degy(T),\deg_{y}(u)\leq\deg_{y}(a),\quad\deg_{y}(v)\leq\deg_{y}(b),\quad\deg_{y}(T_{1})\leq\deg_{y}(T),

and at least one of the two strict inequalities holds

degy(u)<degy(a),degy(v)<degy(b).\quad\deg_{y}(u)<\deg_{y}(a),\qquad\deg_{y}(v)<\deg_{y}(b).

We can assume by induction that this recursive call is correct: 𝒢1\mathcal{G}_{1} is a minimal lexGb of u,v,T1\langle u,\ v,\ T_{1}\rangle. Moreover, inside the recursive call made at Line 5, the algorithm either went through Line 5 or through Line 5. If it exists at Line 5, then since u1u\neq 1, this means v=1v=1. The output is [1][1] and the final output is 𝒢1\mathcal{G}_{1} which is a minimal lexGb. Else, at Line 5, let us write the call to “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}” as:

(u0,v0,U0,T0)𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(u,v,T1),(\,u_{0},\ v_{0},\ U_{0},\ T_{0}\,)\leftarrow\mathtt{LastNonNil}(u,\ v,\ T_{1}),

and let us prove that degy(u0)<degy(u)\deg_{y}(u_{0})<\deg_{y}(u). The degree conditions (7) of the proposition 2 asserts that it is indeed the case, except maybe for the corner cases ii or iii where possibly degy(u0)=degy(u)\deg_{y}(u_{0})=\deg_{y}(u) holds. Both corner cases ii or iii imply that degy(u)=degy(v)\deg_{y}(u)=\deg_{y}(v), but this equality does not hold. Indeed degy(u)=degy(v)\deg_{y}(u)=\deg_{y}(v) holds only under Case i (as output of the call 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕(a,b,T)\mathtt{LastNonNil}(a,\ b,\ T) at Line 5 this time) where bb is assumed nilpotent. But the specifications of Algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}” prescribes bb to be nilpotent. Hence degy(v)<degy(u)\deg_{y}(v)<\deg_{y}(u) and finally degy(u0)<degy(u)\deg_{y}(u_{0})<\deg_{y}(u).

Therefore, by construction of the lexGb, the polynomial uu has a degree (in yy) larger than all polynomials constructed in 𝒢1\mathcal{G}_{1}. We can thus apply Theorem 1-(B) (to uu and 𝒢1\mathcal{G}_{1}) which allows to conclude that 𝒢:=[u]𝖼𝖺𝗍[Ug:g𝒢1]\mathcal{G}:=[u]\mathsf{~{}cat~{}}[Ug\ :\ g\in\mathcal{G}_{1}] (as defined at Line 5) is a minimal lexGb if and only if u𝒢1u\in\mathcal{G}_{1}. This is obviously the case, since 𝒢1=u,v,T1\langle\mathcal{G}_{1}\rangle=\langle u,\ v,\ T_{1}\rangle.

It remains to show that the minimal lexGb 𝒢\mathcal{G} generates the ideal a,b,T\langle a,\ b,\ T\rangle to achieve the proof of Case 4. Since u,vU,T=a,b,T\langle u,\ vU,\ T\rangle=\langle a,\ b,\ T\rangle, it suffices to show that u,vU,T=𝒢\langle u,\ vU,\ T\rangle=\langle\mathcal{G}\rangle. From u,v,TU=𝒢1\langle u,\ v,\frac{T}{U}\rangle=\langle\mathcal{G}_{1}\rangle, we obtain uU,vU,T=U𝒢1\langle uU,\ vU,\ T\rangle=\langle U\mathcal{G}_{1}\rangle. Hence 𝒢=u+U𝒢1=u+uU,vU,T=u,vU,T\langle\mathcal{G}\rangle=\langle u\rangle+\langle U\mathcal{G}_{1}\rangle=\langle u\rangle+\langle uU,\ vU,\ T\rangle=\langle u,\ vU,\ T\rangle. ∎

4 Generalizing dynamic evaluation

4.1 Splitting “invertible/nilpotent”

Part of a polynomial whose support of irreducible factors are given by another polynomial

Assume that two monic polynomials aa and bb are squarefree. Then a/gcd(a,b)a/\mathrm{gcd}(a,b) and gcd(a,b)\mathrm{gcd}(a,b) are pairwise coprime. Moreover gcd(a,b)=vp(b)>0pvp(a)\mathrm{gcd}(a,b)=\prod_{v_{p}(b)>0}p^{v_{p}(a)}, according that vp(a)=1v_{p}(a)=1 or 0. We need a similar routine when aa and bb are not squarefree. As seen in Example 2, it suffices to iterate a gcd computation until the two factors become coprime.

Definition 3.

Let 𝒫\mathcal{P} be the set of irreducible polynomials of k[x]k[x]. Write a=p𝒫pvp(a)a=\prod_{p\in\mathcal{P}}p^{v_{p}(a)} the factorization into irreducibles of ak[x]a\in k[x], and b=p𝒫pvp(b)b=\prod_{p\in\mathcal{P}}p^{v_{p}(b)} that of bk[x]b\in k[x]. The bb-component of aa, denoted a(b)a^{(b)} is the polynomial a(b):=p𝒫,vp(b)>0pvp(a)a^{(b)}:=\prod_{p\in\mathcal{P},\ v_{p}(b)>0}p^{v_{p}(a)}.

Example 9 (Isolating irreducible factors algorithm 6𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor}”).

Let a=x3(x+1)4(x+2)a=x^{3}(x+1)^{4}(x+2) and b=x4(x+1)b=x^{4}(x+1). Then a(b)=x3(x+1)4a^{(b)}=x^{3}(x+1)^{4}.

There are several ways to take the bb-component, we give a standard and easy one.

Input: 1-2. Polynomials a,bk[x]a,b\in k[x].
Output: 1-2. The bb-component a(b)a^{(b)} (Definition 3), and aa(b)\frac{a}{a^{(b)}}. They are coprime.
62
63a0aa_{0}\leftarrow a  ;    b0bb_{0}\leftarrow b  ;   c01c_{0}\leftarrow 1  ;    i0i\leftarrow 0
64 repeat
65       bi+1gcd(ai,bi)b_{i+1}\leftarrow\mathrm{gcd}(a_{i},\ b_{i})   ;     ai+1aibi+1a_{i+1}\leftarrow\frac{a_{i}}{b_{i+1}}   ;     ci+1cibi+1c_{i+1}\leftarrow c_{i}b_{i+1}   ;   ii+1i\leftarrow i+1
66      
67until bi=1b_{i}=1
return (ci,ai)(\,c_{i},\ a_{i}\,) // Write s+1s+1 the index ii at the exit of the repeat loop
Algorithm 6 (a(b),aa(b))𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛(a,b)(\,a^{(b)},\ \frac{a}{a^{(b)}}\,)\leftarrow\mathtt{IsolFactor}(a,\ b)
Lemma 5 (Correctness of Algorithm 6𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor}”).

The output cs+1,as+1c_{s+1},\ a_{s+1} are coprime polynomials that verify cs+1=cs,as+1=asc_{s+1}=c_{s},\ a_{s+1}=a_{s}, and csas=ac_{s}a_{s}=a, with cs=a(b)=p𝒫,vp(a)>0,vp(b)>0pvp(a)c_{s}=a^{(b)}=\prod_{p\in\mathcal{P},\ v_{p}(a)>0,\ v_{p}(b)>0}p^{v_{p}(a)}.

Proof.

Let s+1s+1 be the last index ii at the exit of the repeat loop, so that cs+1,as+1c_{s+1},\ a_{s+1} are the output. The exit condition of the repeat/until loop is bi=1b_{i}=1, hence bs+1=1b_{s+1}=1 with the notation we have adopted. Thus cs+1=csbs+1=csc_{s+1}=c_{s}b_{s+1}=c_{s} and as+1=as/bs+1=asa_{s+1}=a_{s}/b_{s+1}=a_{s}. We must show two things. First, that vp(cs)=vp(a)v_{p}(c_{s})=v_{p}(a) and vp(cs)>0v_{p}(c_{s})>0 is equivalent to vp(b)>0v_{p}(b)>0. Second, that as=acsa_{s}=\frac{a}{c_{s}} is coprime with csc_{s}.

If we rewrite the update line 6 in terms of pp-adic valuations, we get:

vp(bi+1)=min(vp(ai),vp(bi))vp(ai+1)=vp(ai)vp(bi+1)vp(ci+1)=vp(ci)+vp(bi+1)\begin{array}[]{rcl}v_{p}(b_{i+1})&=&\min(v_{p}(a_{i}),v_{p}(b_{i}))\\ v_{p}(a_{i+1})&=&v_{p}(a_{i})-v_{p}(b_{i+1})\\ v_{p}(c_{i+1})&=&v_{p}(c_{i})+v_{p}(b_{i+1})\end{array} (10)

With the notations of Definition 3, at initialization we have a0=p𝒫pvp(a)a_{0}=\prod_{p\in\mathcal{P}}p^{v_{p}(a)} and b0=p𝒫pvp(b)b_{0}=\prod_{p\in\mathcal{P}}p^{v_{p}(b)}. Note that for any irreducible polynomial pp such that vp(b)>0v_{p}(b)>0, the sequence of integers (vp(bi))i=0, 1,(v_{p}(b_{i}))_{i=0,\ 1,\ldots} strictly decreases to zero, regarding that bs+1=1b_{s+1}=1 and thus vp(bs+1)=0v_{p}(b_{s+1})=0.

Assume first that there exists an index i0i\geq 0 such that vp(ai)<vp(bi)()v_{p}(a_{i})<v_{p}(b_{i})\ (\star), and then take the smallest index jj that verifies this inequality. Then vp(bj+1)=min(vp(bj),vp(aj))=vp(aj)v_{p}(b_{j+1})=\min(v_{p}(b_{j}),\ v_{p}(a_{j}))=v_{p}(a_{j}) and thus vp(aj+1)=vp(aj)vp(bj+1)=0v_{p}(a_{j+1})=v_{p}(a_{j})-v_{p}(b_{j+1})=0. It follows that vp(bj+2)=min(vp(bj+1),vp(aj+1))=0v_{p}(b_{j+2})=\min(v_{p}(b_{j+1}),\ v_{p}(a_{j+1}))=0, then vp(aj+2)=vp(aj+1)=0v_{p}(a_{j+2})=v_{p}(a_{j+1})=0, and vp(cj+2)=vp(cj+1)v_{p}(c_{j+2})=v_{p}(c_{j+1}). By induction, we observe that vp(bj+2)==vp(bs+1)=0v_{p}(b_{j+2})=\cdots=v_{p}(b_{s+1})=0, that vp(aj+1)==vp(as+1)=0v_{p}(a_{j+1})=\cdots=v_{p}(a_{s+1})=0, and that vp(cj+1)==vp(cs+1)v_{p}(c_{j+1})=\cdots=v_{p}(c_{s+1}).

Besides, since jj is the smallest index for which vp(aj)<vp(bj)v_{p}(a_{j})<v_{p}(b_{j}), we have that vp(b)vp(a)v_{p}(b_{\ell})\leq v_{p}(a_{\ell}) for <j\ell<j. Consequently, vp(b+1)=min(vp(b),vp(a))=vp(b)v_{p}(b_{\ell+1})=\min(v_{p}(b_{\ell}),\ v_{p}(a_{\ell}))=v_{p}(b_{\ell}) and by induction we observe that vp(bj)=vp(bj1)==vp(b2)=vp(b1)=vp(b0)=vp(b)v_{p}(b_{j})=v_{p}(b_{j-1})=\cdots=v_{p}(b_{2})=v_{p}(b_{1})=v_{p}(b_{0})=v_{p}(b). We obtain:

vp(cs)=jvp(b)+vp(aj),andvp(aj)=vp(aj1)vp(bj)=vp(aj1)vp(b).v_{p}(c_{s})=jv_{p}(b)+v_{p}(a_{j}),\quad\text{and}\quad v_{p}(a_{j})=v_{p}(a_{j-1})-v_{p}(b_{j})=v_{p}(a_{j-1})-v_{p}(b).

By induction, vp(aj)=vp(aj1)vp(b)=vp(aj2)2vp(b)==vp(a0)jvp(b)v_{p}(a_{j})=v_{p}(a_{j-1})-v_{p}(b)=v_{p}(a_{j-2})-2v_{p}(b)=\cdots=v_{p}(a_{0})-jv_{p}(b). We get: vp(cs)=jvp(b)+vp(a0)jvp(b)=vp(a0)v_{p}(c_{s})=jv_{p}(b)+v_{p}(a_{0})-jv_{p}(b)=v_{p}(a_{0}). In conclusion, vp(cs)=vp(a)v_{p}(c_{s})=v_{p}(a) when vp(b)>0v_{p}(b)>0 and when there is a jj that satisfies ()(\star).

If there is no such jj, then the first equality in Eq. (10) implies that vp(bs+1)=vp(bs)==vp(b0)=vp(b)v_{p}(b_{s+1})=v_{p}(b_{s})=\cdots=v_{p}(b_{0})=v_{p}(b). Moreover the output bs+1b_{s+1} is equal to 1 hence vp(bs+1)=0v_{p}(b_{s+1})=0 thereby vp(b)=0v_{p}(b)=0. Additionally, it follows still from Eq. (10) that vp(c0)=vp(c1)==vp(cs+1)=0v_{p}(c_{0})=v_{p}(c_{1})=\cdots=v_{p}(c_{s+1})=0. For such an irreducible polynomial pp, the definition of the bb-component a(b)=cs+1a^{(b)}=c_{s+1} says that vp(cs+1)v_{p}(c_{s+1}) must be 0. This concludes the proof of the output’s specification 1. in any case.

Finally, let us prove that the output cs,asc_{s},\ a_{s} are coprime. From csas=ac_{s}a_{s}=a and [vp(b)>0vp(cs)=vp(a)][v_{p}(b)>0\Rightarrow v_{p}(c_{s})=v_{p}(a)], we deduce that vp(as)=0v_{p}(a_{s})=0 when vp(b)>0v_{p}(b)>0. When vp(b)=0v_{p}(b)=0 then vp(cs)=0v_{p}(c_{s})=0, and thus vp(as)=vp(a)v_{p}(a_{s})=v_{p}(a). It follows that, either (vp(as)=0(v_{p}(a_{s})=0 and vp(cs)=vp(a))v_{p}(c_{s})=v_{p}(a)) or (vp(as)=vp(a)(v_{p}(a_{s})=v_{p}(a) and vp(cs)=0)v_{p}(c_{s})=0). This means that csc_{s} and asa_{s} are coprime. ∎

Remark 2.

bb is nilpotent modulo a(b)a^{(b)}, and bb is invertible modulo aa(b)\frac{a}{a^{(b)}}. Indeed all irreducible factors of a(b)a^{(b)} are irreducible factors of bb, hence sqfp(a(b))|sqfp(b)\mathrm{sqfp}(a^{(b)})|\mathrm{sqfp}(b). And aa(b)\frac{a}{a^{(b)}} does not have any common irreducible factors with bb.

The splitting “invertible/nilpotent”

The algorithm 7𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕\mathtt{invertNil}” is the cornerstone for generalizing the dynamic evaluation from a modulus TT that is a squarefree polynomial to a general modulus. The splitting that it induces is “invertible/nilpotent” instead of “invertible/zero” in the standard dynamic evaluation. It is similar to “𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor}” algorithm except that the inverse of bb modulo aa(b)\frac{a}{a^{(b)}} is also returned.

Input: 1. Non-zero polynomial ak[x]a\in k[x]
2. Non constant monic polynomial Tk[x]T\in k[x]
Output: 1. [f1,T1][f_{1},\ T_{1}]: monic polynomial T1T_{1} and f1f_{1} such that f1f1modT1f_{1}f\equiv 1\bmod T_{1} if T11T_{1}\not=1, or f1=0f_{1}=0 if T1=1T_{1}=1,
2.[f2,T2][f_{2},\ T_{2}]: T2T_{2} monic polynomial, f2f_{2} nilpotent mod T2T_{2}, and f2amodT2f_{2}\equiv a\bmod T_{2}.
\star Condition: T=T1T2T=T_{1}T_{2}, T1T_{1} and T2T_{2} coprime.
68
69(T2,T1)𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛(T,f)(\,T_{2},\ T_{1}\,)\leftarrow\mathtt{IsolFactor}(T,\ f)
70
71f2fmodT2f_{2}\leftarrow f\bmod T_{2}  ;    f1f1modT1f_{1}\equiv f^{-1}\bmod T_{1}
72
return [[f1,T1],[f2,T2]][[f_{1},\ T_{1}],[f_{2},T_{2}]]
Algorithm 7 [[f1,T1],[f2,T2]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(a,T)[[f_{1},\ T_{1}],[f_{2},\ T_{2}]]\leftarrow\mathtt{invertNil}(a,\ T)
Proposition 3.

The algorithm 7𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕\mathtt{invertNil}” splits the polynomial TT into two coprime polynomials T1T_{1} and T2T_{2}, and outputs two polynomials f1f_{1} and f2k[x]f_{2}\in k[x] such that: f1f_{1} is invertible modulo T1T_{1} and f2f_{2} is nilpotent (maybe zero according to our convention) modulo T2T_{2}. Moreover, f1a1modT1f_{1}a\equiv 1\bmod T_{1}, and af2modT2a\equiv f_{2}\bmod T_{2}.

Remark 3.

The polynomials T1,T2,f1,f2T_{1},\ T_{2},\ f_{1},\ f_{2} are uniquely determined by aa and TT.

Proof.

The specifications of Algorithm 6𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor}” implies that T1T2=TT_{1}T_{2}=T and that T1T_{1} is coprime with T2T_{2}. Remark 2 implies that aa is nilpotent modulo T2T_{2} and invertible modulo T1T_{1}. ∎

Example 10 (Algorithm 7𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕\mathtt{invertNil}”).

Let p,qk[x]p,\ q\in k[x] be two monic and distinct irreducible polynomials of k[x]k[x], T=p2q2T=p^{2}q^{2}. Let a:=paa:=pa^{\prime} with ak[x]a^{\prime}\in k[x] coprime with pp and with qq. Then aa is invertible modulo q2q^{2}, and aa is nilpotent modulo p2p^{2}. Then [[(pamodq2)1,q2],[pamodp2,p2]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(a,T)[[(pa^{\prime}\bmod q^{2})^{-1},\ q^{2}],\ [pa^{\prime}\bmod p^{2},\ p^{2}]]\leftarrow\mathtt{invertNil}(a,\ T).

With T=p2q2T=p^{2}q^{2} as above and a=pqa=pq, then [[0, 1],[a,T]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(a,T)[[0,\ 1],\ [a,\ T]]\leftarrow\mathtt{invertNil}(a,\ T).

Still with T=p2q2T=p^{2}q^{2}, and aa invertible modulo TT then [[(amodT)1,T],[0, 1]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(a,T)[[(a\bmod T)^{-1},\ T],\ [0,\ 1]]\leftarrow\mathtt{invertNil}(a,\ T).

4.2 Monic form according to dynamic evaluation

The next fundamental operation makes polynomials monic. In the case of polynomials over a field, it suffices to invert the leading coefficient. Modulo a squarefree polynomial TT, it requires classic dynamic evaluation to handle potential zero-divisors: start with the leading coefficient, and if there is a zero branch, carry on with the next coefficient etc. until there is no zero branch.

The situation is more subtle when TT is not squarefree. This stems from the necessity to perform a Weierstrass factorization to make a polynomial monic.

Overview of Algorithm 8𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5}

It investigates all the coefficients of ff by decreasing degree through recursive calls, by splitting into an invertible branch, and a nilpotent one. It returns the inverse of the coefficient in the invertible branches, and continues with the next coefficient in the nilpotent one. That the branches do not overlap is due to the specification \star in Algorithm 7, namely the underlying polynomials T1T_{1} and T2T_{2} obtained in the splitting are coprime. The output is a compilation of the results obtained at the endpoints of all the branches. See Example 11.

The purpose of the algorithm 8𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5}” is to provide the correct input for “𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}” algorithm, like its local counterpart, Algorithm 1𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}”. It is a recursive algorithm, the main call being 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖(f,T,degy(f),T)\mathtt{WeierstrassForm}(f,\ T,\ \deg_{y}(f),\ T). Recursive calls take as third input an integer smaller than degy(f)\deg_{y}(f), and a polynomial NN that divides TT as the fourth input. The lemma below addresses the validity of the algorithm throughout recursive calls, and Corollary 2 finalizes the proof of correctness of Algorithm 5.

Lemma 6.

Assume that the algorithm is correct for a fixed polynomial f=c0(x)+c1(x)y++cδ(x)yδf=c_{0}(x)+c_{1}(x)y+\cdots+c_{\delta}(x)y^{\delta}, and for any polynomial TT, and integers 1dd0-1\leq d\leq d_{0} for a fixed integer 1d0<δ-1\leq d_{0}<\delta, and a polynomial NN, all satisfying the input’ specifications. Then the algorithm is correct with input ff, any TT and NN satisfying the input’ specifications, for the integer d=d0+1d=d_{0}+1,

Proof.

Let cdc_{d} be the coefficient of degree dd in ff (Line 8). There are four cases to investigate:

(a) cd=0c_{d}=0, return at Line 8.

(b) cd0c_{d}\not=0, cdc_{d} is invertible modulo TT, that is T2=1T_{2}=1. The return occurs at Line 8

(c) cd0c_{d}\not=0, cdc_{d} is nilpotent, that is T2=TT_{2}=T and T1=1T_{1}=1. The algorithm ends at Line 8.

(d) cd0c_{d}\not=0, cdc_{d} has an invertible part and a nilpotent part, that is T11T_{1}\not=1, T21T_{2}\not=1. Return occurs at Line 8.

Case (a). The algorithm goes directly to Line 8 where a recursive call is done with input d1d-1 (instead of dd in the main call), hence is correct by assumption: the output [[fi,Ti,di,Ni]i][[f_{i},\ T_{i},\ d_{i},\ N_{i}]_{i}] verifies the specifications. Since ff has coefficient of degree dd cd=0\ c_{d}=0 in this case, the output is the same with input dd. Moreover these specifications are unchanged with dd or d1d-1.

Case (b). The coefficient cdc_{d} is invertible modulo TT. There is no splitting at Line 8. The output [[f,T,d,a1,N]][[f,\ T,\ d,\ a_{1},\ N]] at Line 8 verifies the specification: since T1=TT_{1}=T, a1a_{1} is the inverse of the coefficient cdc_{d} modulo TT, NN is the gcd with TT of the coefficients of degree larger than dd by assumption, and sqfp(T)=sqfp(N)\mathrm{sqfp}(T)=\mathrm{sqfp}(N).

Case (c). The coefficient cdc_{d} is nilpotent hence T2=TT_{2}=T. The recursive call made at Line 8 outputs [[fi,Ti,di,Ni]i][[f_{i},\ T_{i},\ d_{i},\ N_{i}]_{i}] which verifies the specifications with input f,T,d1,gcd(N,cd)f,\ T,\ d-1,\ \mathrm{gcd}(N,\ c_{d}). One easily verifies that this output also complies with the specifications corresponding to the input f,T,d,Nf,\ T,\ d,\ N.

Case (d). There is a splitting into an invertible branch [a1,T1][a_{1},\ T_{1}] and a nilpotent one [a2,T2][a_{2},\ T_{2}] (Line 8). In the invertible branch, the algorithm returns an output similar to Case (b). In the non-invertible branch, a recursive call is performed and reduces to Case (c). The final step merges these output, which all-in-all verify the required specifications. ∎

Corollary 2.

Algorithm 8𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5}” is correct.

Proof.

The main call is made with f,T,degy(f),Tf,\ T,\ \deg_{y}(f),\ T. The proof proceeds by induction on d0=1,,degy(f)d_{0}=-1,\ldots,\deg_{y}(f). The base case corresponds to d0=1d_{0}=-1 and more precisely to:

𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T,1,gcd(T,content(f))).\mathtt{WeierstrassForm\_D5}(f,\ T,\ -1,\ \mathrm{gcd}(T,\ {\rm content}(f))).

The output at Line 8 is then [f,T,1, 0,gcd(T,content(f))][f,\ T,\ -1,\ 0,\ \mathrm{gcd}(T,\ {\rm content}(f))] and satisfies the required specifications.

The induction hypothesis assumes that the algorithm is correct for a fixed integer 1<d0<degy(f)-1<d_{0}<\deg_{y}(f): with input 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T,d,N)\mathtt{WeierstrassForm\_D5}(f,\ T,\ d,\ N) where N=gcd(T,cd+1,,cδ)N=\mathrm{gcd}(T,\ c_{d+1},\ldots,c_{\delta}), sqfp(N)=sqfp(T)\mathrm{sqfp}(N)=\mathrm{sqfp}(T), and dd is any integer d=1,,d0<degy(f)d=-1,\ldots,d_{0}<\deg_{y}(f), the algorithm is correct. Then Lemma 6 shows that the algorithm is correct for input 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T,d,N)\mathtt{WeierstrassForm\_D5}(f,\ T,\ d,\ N) where dd0+1d\leq d_{0}+1 achieving the proof by induction.∎

Input: 1. polynomial fk[x,y]f\in k[x,y],    f=c0(x)+c1(x)y++cδ(x)yδf=c_{0}(x)+c_{1}(x)y+\cdots+c_{\delta}(x)y^{\delta}
2. a non constant monic polynomial Tk[x]T\in k[x],
3. an integer d1d\geq-1,
4. if d<δd<\delta then N=gcd(T,cd+1,,cδ)N=\mathrm{gcd}(T,\ c_{d+1},\ldots\ ,\ c_{\delta}). It must also verify sqfp(N)=sqfp(T)\mathrm{sqfp}(N)=\mathrm{sqfp}(T), that is cd+1,,cδc_{d+1},\ldots,c_{\delta} are nilpotent modulo TT. And N=TN=T if dδd\geq\delta.
73
Output: 1. fifmodTif_{i}\equiv f\bmod T_{i}
2. iTi=T\prod_{i}T_{i}=T and the (Ti)(T_{i})s are pairwise coprime.
3. diδd_{i}\leq\delta is the largest integer such that cdi=𝖼𝗈𝖾𝖿𝖿(fi,di)c_{d_{i}}=\mathsf{coeff}(f_{i},\ d_{i}) is invertible modulo TiT_{i}. If such an integer does not exist then di=1d_{i}=-1.
4. ai𝖼𝗈𝖾𝖿𝖿(fi,di)1modTia_{i}\equiv\mathsf{coeff}(f_{i},d_{i})^{-1}\bmod T_{i} if di0d_{i}\geq 0 and ai=0a_{i}=0 if di=1d_{i}=-1.
5. Ni=gcd(Ti,cdi+1,,cδ)N_{i}=\mathrm{gcd}(T_{i},\ \ c_{d_{i}+1},\ldots\ ,\ c_{\delta}) is the gcd with TiT_{i} of all the coefficients of fif_{i} at a degree larger than did_{i}. In particular, degy(fimodNi)=di\deg_{y}(f_{i}\bmod N_{i})=d_{i}. Moreover, cdi+1,,cδc_{d_{i}+1},\ldots,c_{\delta} are nilpotent modulo TiT_{i}, that is sqfp(Ni)=sqfp(Ti)\mathrm{sqfp}(N_{i})=\mathrm{sqfp}(T_{i}).
74
75if d=1d=-1 then // Base case of the recursive calls
76       return [[f,T,1, 0,N]][[f,\ T,\ -1,\ 0,\ N]]
77      
78cd𝖼𝗈𝖾𝖿𝖿(f,d)c_{d}\leftarrow\mathsf{coeff}(f,d)
79
80if cd0c_{d}\not=0 then
       [[a1,T1],[a2,T2]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(cd,T)[[a_{1},\ T_{1}],\ [a_{2},\ T_{2}]]\leftarrow\mathtt{invertNil}(c_{d},\ T)
        // a1cd1modT1,a2cdmodT2a_{1}c_{d}\equiv 1\bmod T_{1},\ a_{2}\equiv c_{d}\bmod T_{2}
81       if T21T_{2}\not=1 then
82             if T11T_{1}\not=1 then // Case (d)
                   N2gcd(a2,N,T2)N_{2}\leftarrow\mathrm{gcd}(a_{2},\ N,\ T_{2})
                    // Now N2=gcd(T2,cd,cd+1,,cδ)N_{2}=\mathrm{gcd}(T_{2},\ c_{d},\ c_{d+1},\ \ldots,\ c_{\delta})
83                   f1fmodT1;f2fmodT2f_{1}\leftarrow f\bmod T_{1}~{}~{};~{}~{}~{}f_{2}\leftarrow f\bmod T_{2}
                   N1gcd(N,T1)N_{1}\leftarrow\mathrm{gcd}(N,\ T_{1})
                    // Now N1=gcd(T1,cd,cd+1,,cδ)N_{1}=\mathrm{gcd}(T_{1},\ c_{d},\ c_{d+1},\ \ldots,\ c_{\delta})
84                   return [[f1,T1,d,a1,N1]]𝖼𝖺𝗍𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f2,T2,d1,N2)[[f_{1},\ T_{1},\ d,\ a_{1},\ N_{1}]]\mathsf{~{}cat~{}}\mathtt{WeierstrassForm\_D5}(f_{2},\ T_{2},\ d-1,\ N_{2})
85            else // cdc_{d} is nilpotent (Case (c))
                   Ngcd(cd,N)N\leftarrow\mathrm{gcd}(c_{d},\ N)
                    // Now N=gcd(T,cd,cd+1,,cδ)N=\mathrm{gcd}(T,\ c_{d},\ c_{d+1},\ \ldots,\ c_{\delta})
                   return 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T,d1,N)\mathtt{WeierstrassForm\_D5}(f,\ T,\ d-1,\ N)
                    // T2=TT_{2}=T
86                  
87            
88      else // cdc_{d} is invertible (Case (b))
            return [[f,T,d,a1,N]][[f,\ T,\ d,\ a_{1},\ N]]
              // T1=TT_{1}=T
89            
90      
91else // Case (a)
92      return 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T,d1,N)\mathtt{WeierstrassForm\_D5}(f,\ T,\ d-1,\ N)
Algorithm 8 [[fi,Ti,di,ai,Ni]i]𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T,d,N)[[f_{i},\ T_{i},\ d_{i},\ a_{i},\ N_{i}]_{i}]\leftarrow\mathtt{WeierstrassForm\_D5}(f,\ T,\ d,\ N)
Example 11 (Algorithm 8𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5}”).

Consider the polynomial f=x(x+1)y2+2xyx1f=x(x+1)y^{2}+2xy-x-1 and T=x2(x+1)2T=x^{2}(x+1)^{2}. The main call is

𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,T, 2,T)the third input is 2 because f is of degree 2\mathtt{WeierstrassForm\_D5}(f,\ T,\ 2,\ T)\quad\text{the third input is $2$ because $f$ is of degree $2$}

First coefficient, that of y2y^{2}: c2(x)=x(x+1)c_{2}(x)=x(x+1). We have

[[0, 1],[x(x+1),x2(x+1)2]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(c2,T)[\,[0,\ 1],\ [x(x+1),\ x^{2}(x+1)^{2}]\,]\leftarrow\mathtt{invertNil}(c_{2},\ T)

since c2c_{2} is nilpotent modulo TT. Thus T1=1T_{1}=1, T2=TT_{2}=T and N=gcd(T,c2)=x(x+1)N=\mathrm{gcd}(T,\ c_{2})=x(x+1).

Recursive call at Line 8 is : 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(f,x2(x+1)2, 1,x(x+1))\mathtt{WeierstrassForm\_D5}(f,\ x^{2}(x+1)^{2},\ 1,\ x(x+1)).

Second coefficient, that of yy is: c1(x)=2xc_{1}(x)=2x.

[[12x1,(x+1)2],[2x,x2]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(2x,x2(x+1)2),[[-\frac{1}{2}x-1,\ (x+1)^{2}],\ [2x,\ x^{2}]]\leftarrow\mathtt{invertNil}(2x,\ x^{2}(x+1)^{2}),

thus T1=(x+1)2T_{1}=(x+1)^{2} and T2=x2T_{2}=x^{2}. Thus at Line 8-8 N1=gcd(x(x+1),(x+1)2)=x+1N_{1}=\mathrm{gcd}(x(x+1),\ (x+1)^{2})=x+1 and N2=gcd(x(x+1),x2, 2x)=xN_{2}=\mathrm{gcd}(x(x+1),x^{2},\ 2x)=x. Next consider Line 8. We obtain

𝙾𝚄𝚃=[[(1x)y2+2xyx1,(x+1)2, 1,112x,x+1]]\mathtt{OUT}=[[(-1-x)y^{2}+2xy-x-1\ ,\ \ (x+1)^{2}\ ,\ \ 1\ ,\ \ -1-\frac{1}{2}x\ ,\ \ x+1]]

that is supplemented with the recursive call 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(xy2+2xyx1,x2, 0,x)\mathtt{WeierstrassForm\_D5}(xy^{2}+2xy-x-1,\ x^{2},\ 0,\ x).

Third coefficient is c0x1modx2c_{0}\equiv-x-1\bmod x^{2}. [[1+x,x2],[0, 1]]𝚒𝚗𝚟𝚎𝚛𝚝𝙽𝚒𝚕(x1,x2)[[-1+x,\ x^{2}],\ [0,\ 1]]\leftarrow\mathtt{invertNil}(-x-1,\ x^{2}), thus T1=x2T_{1}=x^{2} and T2=1T_{2}=1. The return occurs at Line 8 with [xy2+2xyx1,x2, 0,1+x,x][xy^{2}+2xy-x-1\ ,\ \ x^{2}\ ,\ \ 0\ ,\ \ -1+x\ ,\ \ x]. Finally, 𝙾𝚄𝚃=[[f1,T1,d1,a1,N1],[f2,T2,d2,a2,N2]]\mathtt{OUT}=[[f_{1},\ T_{1},\ d_{1},\ a_{1},\ N_{1}],\ [f_{2},\ T_{2},\ d_{2},\ a_{2},\ N_{2}]] where:

f1=(1x)y2+2xyx1T1=(x+1)2d1=1a1=112xN1=x+1f2=xy2+2xyx1T2=x2d2=0a2=1+xN2=x\begin{array}[]{ccc}\begin{array}[]{rcl}f_{1}&=&(-1-x)y^{2}+2xy-x-1\\ T_{1}&=&(x+1)^{2}\\ d_{1}&=&1\\ a_{1}&=&\ -1-\frac{1}{2}x\\ N_{1}&=&x+1\end{array}&&\begin{array}[]{rcl}f_{2}&=&xy^{2}+2xy-x-1\\ T_{2}&=&x^{2}\\ d_{2}&=&0\\ a_{2}&=&-1+x\\ N_{2}&=&x\end{array}\end{array}

We have indeed T=T1T2T=T_{1}T_{2}, d1=1d_{1}=1, and d2=0d_{2}=0. Also, for i=1,2i=1,2, degy(fimodNi)=di\deg_{y}(f_{i}\bmod N_{i})=d_{i}, and sqfp(Ni)=sqfp(Ti)\mathrm{sqfp}(N_{i})=\mathrm{sqfp}(T_{i}). Moreover, ai𝖼𝗈𝖾𝖿𝖿(fi,di)1modTia_{i}\mathsf{coeff}(f_{i},\ d_{i})\equiv 1\bmod T_{i}. So that all specifications are satisfied. ∎

Overview of Algorithm 9𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{MonicForm\_D5}

Again it translates the algorithm 3𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖\mathtt{MonicForm}” to dynamic evaluation. Among the two subroutines involved, only 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5} creates splittings, indeed 𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ} does not perform divisions. Note that the description of “𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}” in Algorithm 2 does not assume TT to be the power of an irreducible polynomial. There is no need to adapt it to dynamic evaluation.

After a first call to 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5} at Line 9, 𝐖\mathbf{W} is a collection of data like the output of the local version 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖\mathtt{WeierstrassForm}. For each component W=[fi,Ti,di,αi,Ni]W=[f_{i},\ T_{i},\ d_{i},\ \alpha_{i},\ N_{i}] of 𝐖\mathbf{W} two cases must be distinguished: if di=1d_{i}=-1 then fif_{i} is nilpotent and Ni|fiN_{i}|f_{i}, or di0d_{i}\geq 0. In the former, a second call to 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5} (Line 9) is performed after dividing the input by NiN_{i}. This second call creates subbranches requiring to “project” some polynomials on these new factors (role of the call to 𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor} at Line 9).

Input: 1. polynomial ak[x,y]a\in k[x,y]
2. monic non constant polynomial Tk[x]T\in k[x]
Output: 1. bik[x,y]b_{i}\in k[x,y] is monic (in yy)
2. monic polynomials Tik[x]T_{i}\in k[x], pairwise coprime dividing TT.
3. monic polynomials Uik[x]U_{i}\in k[x], pairwise coprime dividing TT. Furthermore:
  1. (a)

    iUiTi=T\prod\nolimits_{i}U_{i}T_{i}=T and,

  2. (b)

    if Ui1U_{i}\not=1, sqfp(Ui)=sqfp(Ti)\mathrm{sqfp}(U_{i})=\mathrm{sqfp}(T_{i})

  3. (c)

    UiU_{i} divides aa modulo TiT_{i}

  4. (d)

    iUibi,UiTia,T\prod\nolimits_{i}\langle U_{i}b_{i},\ U_{i}T_{i}\rangle\simeq\langle a,\ T\rangle.

93 𝙾𝚄𝚃[]\mathtt{OUT}\leftarrow[]
94
95𝐖𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(a,T,degy(a),T){\bf W}\leftarrow\mathtt{WeierstrassForm\_D5}(a,\ T,\ \deg_{y}(a),\ T)
96
97for W𝐖W\in{\bf W} do // write W=[fi,Ti,di,αi,Ni]W=[f_{i},\ T_{i},\ d_{i},\ \alpha_{i},\ N_{i}]
98      
99      if di=1d_{i}=-1 then // fif_{i} is nilpotent and Ni|TN_{i}|T, Ni|fiN_{i}|f_{i}
100            
101            𝐙𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(fi/Ni,Ti/Ni,degy(fi),Ti/Ni)\mathbf{Z}\leftarrow\mathtt{WeierstrassForm\_D5}(f_{i}/N_{i},\ T_{i}/N_{i},\ \deg_{y}(f_{i}),\ T_{i}/N_{i})
102            Ui0NiU^{\prime}_{i0}\leftarrow N_{i}
103            
104            for Z𝐙Z\in\mathbf{Z} do // write Z=[fij,Tij,dij,αij,Nij]Z=[f_{ij},\ T_{ij},\ d_{ij},\ \alpha_{ij},\ N_{ij}]
105                  
                  bij𝙼𝚞𝚜𝚜𝚎𝚛𝚀(fij,Tij,dij,αij,Nij)b_{ij}\leftarrow\mathtt{MusserQ}(f_{ij},\ T_{ij},\ d_{ij},\ \alpha_{ij},\ N_{ij})
                    // fijf_{ij} is not nilpotent, dij0d_{ij}\geq 0
106                  
                  (Uij,Uij)𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛(Uij1,Tij)(\,U_{ij},\ U^{\prime}_{ij}\,)\leftarrow\mathtt{IsolFactor}(U^{\prime}_{ij-1},\ T_{ij})
                    // UijUij=Uij1U_{ij}U^{\prime}_{ij}=U^{\prime}_{ij-1}, Uij=Ni(Tij)U_{ij}=N_{i}^{(T_{ij})}
107                  
108                  𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍[[bij,Tij,Uij]]\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}[\ [b_{ij},\ T_{ij},\ U_{ij}]\ ]
109                  
110            
111      else // fif_{i} is not nilpotent
112            
113            bi𝙼𝚞𝚜𝚜𝚎𝚛𝚀(fi,Ti,di,αi,Ni)b_{i}\leftarrow\mathtt{MusserQ}(f_{i},\ T_{i},\ d_{i},\ \alpha_{i},\ N_{i})
114            
115            𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍[[bi,Ti, 1]]\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}[\ [b_{i},\ T_{i},\ 1]\ ]
116            
117      
118
119return 𝙾𝚄𝚃\mathtt{OUT}
120
Algorithm 9 [[bi,Ti,Ui]i]𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(a,T)[[b_{i},\ T_{i},\ U_{i}]_{i}]\leftarrow\mathtt{MonicForm\_D5}(a,\ T)
Proposition 4 (Correctness of Algorithm 9𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{MonicForm\_D5}”).

Specifications abc and d are satisfied by the output 𝙾𝚄𝚃\mathtt{OUT} of the algorithm.

Proof.

Consider W𝐖W\in\mathbf{W} at Line 9, written W=[fi,Ti,di,αi,Ni]W=[f_{i},\ T_{i},\ d_{i},\ \alpha_{i},\ N_{i}]. The specifications 1-5. of Algorithm 8𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5}” give:

1’. a,Ti=fi,Ti\langle a,\ T_{i}\rangle=\langle f_{i},\ T_{i}\rangle,

2’. iTi=T\prod_{i}T_{i}=T and the TiT_{i}s are pairwise coprime

3’. di=1d_{i}=-1 (Line 9) or di0d_{i}\geq 0 (Line 9)

4’. (not important)

5’. Ni=gcd(Ti,coeffs.offiofdegree>di)N_{i}=\mathrm{gcd}(T_{i},\ {\rm coeffs.~{}of~{}}f_{i}{\rm~{}of~{}degree~{}}>d_{i}), and sqfp(Ni)=sqfp(Ti)\mathrm{sqfp}(N_{i})=\mathrm{sqfp}(T_{i}).

Case di0d_{i}\geq 0. This concerns Line 9 and onward. This means that fif_{i} is not nilpotent modulo NiN_{i} and degy(fmodNi)=di\deg_{y}(f\bmod N_{i})=d_{i}. The output [fi,Ti,di,αi,Ni]=W𝐖[f_{i},\ T_{i},\ d_{i},\ \alpha_{i},\ N_{i}]=W\in\mathbf{W} of the first call to 𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{WeierstrassForm\_D5} at Line 9 is then ready to be used by Algorithm 𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ} at Line 9 (its specifications being satisfied). We obtain bi,Ti=fi,Ti\langle b_{i},\ T_{i}\rangle=\langle f_{i},\ T_{i}\rangle with bib_{i} monic. And consequently, by the Chinese remainder theorem and the specifications 1’-2’. above:

i,di0bi,Ti=i,di0fi,Ti=i,di0a,Tia,i,di0Ti.\prod_{i,\ d_{i}\geq 0}\langle b_{i},\ T_{i}\rangle=\prod_{i,\ d_{i}\geq 0}\langle f_{i},\ T_{i}\rangle=\prod_{i,\ d_{i}\geq 0}\langle a,\ T_{i}\rangle\simeq\langle a,\,\prod\nolimits_{i,\ d_{i}\geq 0}T_{i}\rangle.

Besides, note that the third component of the list [bi,Ti, 1][b_{i},\ T_{i},\ 1] added to 𝙾𝚄𝚃\mathtt{OUT} at Line 9 is 11, which means that Ui=1U_{i}=1. Specification c is clearly true while Specification b is void. Moreover:

i,di0Uibi,UiTia,i,di0Ti.\prod_{i,\ d_{i}\geq 0}\langle U_{i}b_{i},\ U_{i}T_{i}\rangle\simeq\langle a,\,\prod\nolimits_{i,\ d_{i}\geq 0}T_{i}\rangle. (11)

Case di=1d_{i}=-1. This concerns Lines 9-9. We then have Ni|fiN_{i}|f_{i} and Ni=gcd(Ti,content(fi))N_{i}=\mathrm{gcd}(T_{i},\ {\rm content}(f_{i})). By specification 5’. above, sqfp(Ni)=sqfp(Ti)\mathrm{sqfp}(N_{i})=\mathrm{sqfp}(T_{i}). Thus gcd(Ti,content(fiNi))=1\mathrm{gcd}(T_{i},{\rm content}(\frac{f_{i}}{N_{i}}))=1. Consequently,

for anyTijdividingTiwe havegcd(Tij,content(fiNi))=1.\text{for any}\quad T_{ij}\quad\text{dividing}\quad T_{i}\quad\text{we have}\quad\mathrm{gcd}\left(T_{ij},{\rm content}\left(\frac{f_{i}}{N_{i}}\right)\right)=1. (12)

Consider now Line 9 𝐙𝚆𝚎𝚒𝚎𝚛𝚜𝚝𝚛𝚊𝚜𝚜𝙵𝚘𝚛𝚖_𝙳𝟻(fi/Ni,Ti/Ni,degy(fi),Ti/Ni)\mathbf{Z}\leftarrow\mathtt{WeierstrassForm\_D5}(f_{i}/N_{i},\ T_{i}/N_{i},\ \deg_{y}(f_{i}),\ T_{i}/N_{i}) as well as a component Z𝐙Z\in\mathbf{Z}, written Z=[fij,Tij,dij,αij,Nij]Z=[f_{ij},\ T_{ij},\ d_{ij},\ \alpha_{ij},\ N_{ij}]. It verifies the specifications 1.-5. of Algorithm 2.

1”. fi/Ni,Tij=fij,Tij\langle f_{i}/N_{i},\ T_{ij}\rangle=\langle f_{ij},\ T_{ij}\rangle,

2”. jTij=Ti/Ni\prod_{j}T_{ij}=T_{i}/N_{i} and the (Tij)j(T_{ij})_{j}s are pairwise coprime

3”. dij0d_{ij}\geq 0

4”. (not important)

5”. Nij=gcd(Tij,coeffs.offijofdegree>dij)N_{ij}=\mathrm{gcd}(T_{ij},\ {\rm coeffs.~{}of~{}}f_{ij}{\rm~{}of~{}degree~{}}>d_{ij}), and sqfp(Nij)=sqfp(Tij)\mathrm{sqfp}(N_{ij})=\mathrm{sqfp}(T_{ij}).

Indeed, dij0d_{ij}\geq 0 holds. Otherwise Nij=gcd(Tij,content(fiNi))1N_{ij}=\mathrm{gcd}(T_{ij},{\rm content}(\frac{f_{i}}{N_{i}}))\not=1 would divide fijf_{ij}, excluded as seen above in Eq (12). Therefore, the component ZZ is ready to be used by Algorithm 2𝙼𝚞𝚜𝚜𝚎𝚛𝚀\mathtt{MusserQ}” at Line 9, its input’ specifications being satisfied by fij,Tij,dij,αij,Nijf_{ij},\ T_{ij},\ d_{ij},\ \alpha_{ij},\ N_{ij}. Its output bijb_{ij} hence verifies bij,Tij=fij,Tij\langle b_{ij},\ T_{ij}\rangle=\langle f_{ij},\ T_{ij}\rangle with bijb_{ij} monic. Specifications 1”-2”. imply, with the Chinese remainder theorem:

jbij,Tij=jfij,Tij=jfi/Ni,Tijfi/Ni,Ti/Ni.\prod_{j}\langle b_{ij},\ T_{ij}\rangle=\prod_{j}\langle f_{ij},\ T_{ij}\rangle=\prod_{j}\langle f_{i}/N_{i},\ T_{ij}\rangle\simeq\langle f_{i}/N_{i},\ T_{i}/N_{i}\rangle. (13)

Eq. (13) then implies with the Chinese remainder theorem according to Specifications 1’-2’.:

i,di=1(Nijbij,Tij)i,di=1(Nifi/Ni,Ti/Ni)i,di=1fi,Tii,di=1a,Ti\prod_{i,\ d_{i}=-1}(N_{i}\prod_{j}\langle b_{ij},\ T_{ij}\rangle)\simeq\prod_{i,\ d_{i}=-1}(N_{i}\langle f_{i}/N_{i},\ T_{i}/N_{i}\rangle)\simeq\prod_{i,\ d_{i}=-1}\langle f_{i},\ T_{i}\rangle\simeq\prod_{i,\ d_{i}=-1}\langle a,\ T_{i}\rangle (14)

Line 9 introduces the TijT_{ij}-component (Definition 3) of Uij1U^{\prime}_{ij-1}:

(Uij,Uij)𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛(Uij1,Tij),withUij=Uij1(Tij)andUi0=Ni(Line 9).\quad(\,U_{ij},\ U_{ij}^{\prime}\,)\leftarrow\mathtt{IsolFactor}(U^{\prime}_{ij-1},\ T_{ij}),\quad\text{with}\quad U_{ij}=U_{ij-1}^{\prime(T_{ij})}\ \text{and}\ U^{\prime}_{i0}=N_{i}\ \text{(Line~{}\ref{MFD5:U0})}.

The specifications of 𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor} tell that UijUij=Uij1U_{ij}U^{\prime}_{ij}=U_{ij-1}^{\prime} and UijU_{ij} is coprime with UijU_{ij}^{\prime}. We see then that

Ni=Ui0=Ui1Ui1=Ui1Ui2Ui2==Ui1UijUij, for all j1.N_{i}=U_{i0}^{\prime}=U_{i1}U_{i1}^{\prime}=U_{i1}U_{i2}U_{i2}^{\prime}=\cdots=U_{i1}\cdots U_{ij}U_{ij}^{\prime},\ \text{ for all }j\geq 1. (15)

Moreover the polynomials in the product are pairwise coprime. By definition, Uij=Uij1(Tij)=p𝒫,vp(Tij)>0pvp(Uij1)U_{ij}=U_{ij-1}^{\prime(T_{ij})}=\prod_{p\in\mathcal{P},\ v_{p}(T_{ij})>0}p^{v_{p}(U_{ij-1}^{\prime})}. Since Uij1U_{ij-1}^{\prime} is a factor in the factorization of NiN_{i} of Eq. (15), we deduce that [vp(Tij)>0vp(Uij1)=vp(Ni)][v_{p}(T_{ij})>0\Rightarrow v_{p}(U_{ij-1}^{\prime})=v_{p}(N_{i})], and thus that Uij=Ni(Tij)U_{ij}=N_{i}^{(T_{ij})}.

On the other hand, the specification 2”. above provides NijTij=TiN_{i}\prod_{j}T_{ij}=T_{i} with the (Tij)j(T_{ij})_{j}s coprime, and the specification 5’. gives sqfp(Ti)=sqfp(Ni)\mathrm{sqfp}(T_{i})=\mathrm{sqfp}(N_{i}). It follows that

jUij=jp𝒫,vp(Tij)>0pvp(Ni)=p𝒫,vp(Ti)>0pvp(Ni)=p𝒫,vp(Ni)>0pvp(Ni)=Ni,\prod_{j}U_{ij}=\prod_{j}\prod_{p\in\mathcal{P},\ v_{p}(T_{ij})>0}p^{v_{p}(N_{i})}=\prod_{p\in\mathcal{P},\ v_{p}(T_{i})>0}p^{v_{p}(N_{i})}=\prod_{p\in\mathcal{P},\ v_{p}(N_{i})>0}p^{v_{p}(N_{i})}=N_{i}, (16)

as well as sqfp(Uij)=sqfp(Tij)\mathrm{sqfp}(U_{ij})=\mathrm{sqfp}(T_{ij}) if Uij1U_{ij}\not=1. This proves Specifications b in the case di=1d_{i}=-1.

We have seen that Ni|fiN_{i}|f_{i}, hence fiNif_{i}\in\langle N_{i}\rangle. Specification 1’. thus implies that aNi,Tia\in\langle N_{i},\ T_{i}\rangle. By Eq. (16) UijU_{ij} divides NiN_{i} and since TijT_{ij} divides TiT_{i} we obtain that aUij,Tija\in\langle U_{ij},\ T_{ij}\rangle, or equivalently that UijU_{ij} divides aa modulo TijT_{ij}. This proves Specification c in the case di=1d_{i}=-1.

In Eq. (14), substituting the NiN_{i}s by jUij\prod_{j}U_{ij}s from Eq. (16), and combining with Eq. (11) yield:

i,di=1jUijbij,UijTiji,di0Uibi,UiTii,di=1a,Tii,di0a,Tia,T.\prod_{i,\ d_{i}=-1}\prod_{j}\langle U_{ij}b_{ij},\ U_{ij}T_{ij}\rangle\cdot\prod_{i,\ d_{i}\geq 0}\langle U_{i}b_{i},\ U_{i}T_{i}\rangle\simeq\prod_{i,\ d_{i}=-1}\langle a,\ T_{i}\rangle\cdot\prod_{i,\ d_{i}\geq 0}\langle a,\ T_{i}\rangle\simeq\langle a,\ T\rangle.

This proves Specification d in all cases.

Moreover Specification 2”. above implies that i,di=1jUijTij=i,di=1Ti\prod_{i,\ d_{i}=-1}\prod_{j}U_{ij}T_{ij}=\prod_{i,\ d_{i}=-1}T_{i} with the (Tij)j(T_{ij})_{j}s pairwise coprime. With Specification 2’. above iTi=T\prod_{i}T_{i}=T, we get

i,di=1jUijTiji,di0UiTi=T.\prod_{i,\ d_{i}=-1}\prod_{j}U_{ij}T_{ij}\cdot\prod_{i,\ d_{i}\geq 0}U_{i}T_{i}=T.

This proves the specification a (in all cases). ∎

5 Computation of lexGb through dynamic evaluation

5.1 Subresultant p.r.s

With the ability to make monic nilpotent polynomials occurring in the subresultant p.r.s. of aa and bb modulo TT, we are ready to generalize the algorithm 4𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕\mathtt{LastNonNil}”. The skeleton is the same as that of Algorithm 4: find the “last non nilpotent” and the “first nilpotent” polynomials in the modified subresultant p.r.s. The difference lies in the management of the splittings arising when making polynomials monic at Line 4, and from the recursive call at Lines 4. The output is a family of objects each similar to the output of the local version Algorithm 4.

Input: 1. polynomial f1k[x,y]f_{1}\in k[x,y] which has an invertible leading coefficient modulo TT.
2. polynomial f2k[x,y]f_{2}\in k[x,y], satisfies Assumption (H) (in particular is not zero).
3. TT is a monic polynomial Tk[x]T\in k[x]
Output: 1-2. monic (in yy) polynomials ai,bik[x,y]a_{i},\ b_{i}\in k[x,y] verifying the degree condition of Proposition 5.
3.-4. monic polynomials Ui,Tik[x]U_{i},T_{i}\in k[x] such that the family (TiUi)i(T_{i}U_{i})_{i} is pairwise coprime, and if Ti1T_{i}\not=1 then sqfp(Ti)=sqfp(Ui)\mathrm{sqfp}(T_{i})=\mathrm{sqfp}(U_{i}).
iTiUi=T,f1,f2,Tiai,Tibi,UiTi\prod\nolimits_{i}T_{i}U_{i}=T,\qquad\langle f_{1},\ f_{2},\ T\rangle\simeq\prod\nolimits_{i}\langle a_{i},\ T_{i}b_{i},\ U_{i}T_{i}\rangle (17)
121
122𝙾𝚄𝚃[]\mathtt{OUT}\leftarrow[]
123
124repeat
125      Compute the subresultant p.r.s f1,f2,,f,f+1f_{1},\ f_{2},\ldots,\ f_{\ell},\ f_{\ell+1} of f1f_{1} and f2f_{2} modulo TT (with f+1=0f_{\ell+1}=0, following Proposition 1).
126until  𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT or f+1=0f_{\ell+1}=0
127if 𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT then // 𝗅𝖼(fj)\mathsf{lc}(f_{j}) is invertible modulo TT for j<ij<i
       a(𝗅𝖼(fi1)1modT)fi1modTa\leftarrow(\mathsf{lc}(f_{i-1})^{-1}\bmod T)f_{i-1}\bmod T
        // aa is monic and a,T=fi1,T\langle a,\ T\rangle=\langle f_{i-1},\ T\rangle
       𝐌𝐛𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(fi,T)\mathbf{Mb}\leftarrow\mathtt{MonicForm\_D5}(f_{i},\ T)
        // Write 𝐌𝐛=[[bj,Uj,Tj]j]\mathbf{Mb}=[[b_{j},\ U_{j},\ T_{j}]_{j}]
128       for [bj,Uj,Tj]𝐌𝐛[b_{j},\ U_{j},\ T_{j}]\in\mathbf{Mb} do
129             if Tj1T_{j}\not=1 then // fif_{i} is nilpotent mod UjTjU_{j}T_{j}
130                   𝙾𝚄𝚃=𝙾𝚄𝚃𝖼𝖺𝗍[[a,bj,Tj,Uj]]\mathtt{OUT}=\mathtt{OUT}\mathsf{~{}cat~{}}[[a,\ b_{j},\ T_{j},\ U_{j}]]
131                  
132            else // fif_{i} is not nilpotent modulo UjTjU_{j}T_{j}
133                  𝙾𝚄𝚃=𝙾𝚄𝚃𝖼𝖺𝗍𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,bj,Uj)\mathtt{OUT}=\mathtt{OUT}\mathsf{~{}cat~{}}\mathtt{LastNonNil\_D5}(a,\ b_{j},\ U_{j})
134            
135      return 𝙾𝚄𝚃\mathtt{OUT}
136
137 // Here, all 𝗅𝖼(f1),,𝗅𝖼(f)\mathsf{lc}(f_{1}),\ldots,\mathsf{lc}(f_{\ell}) are invertible modulo TT, and f+1=0f_{\ell+1}=0
138 return [[(𝗅𝖼(f)modT)1f, 0, 1,T]][[(\mathsf{lc}(f_{\ell})\bmod T)^{-1}f_{\ell},\ 0,\ 1,\ T]]
Algorithm 10 [[ai,bi,Ti,Ui]i]𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(f1,f2,T)[[a_{i},\ b_{i},\ T_{i},\ U_{i}]_{i}]\leftarrow\mathtt{LastNonNil\_D5}(f_{1},\ f_{2},\ T)
Example 12 (Algorithm 10𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻\mathtt{LastNonNil\_D5}”).

Consider T=x2(x+1)2T=x^{2}(x+1)^{2}, and a=y3+(x1)y2+x(x+1)y+xa=y^{3}+(x-1)y^{2}+x(x+1)y+x and b=y3y2+yxb=y^{3}-y^{2}+y-x. The subresultant of degree 2 is S2(a,b)=xy2+(x2+x1)y+2xS_{2}(a,\ b)=xy^{2}+(x^{2}+x-1)y+2x. Since 𝗅𝖼(S2)=x\mathsf{lc}(S_{2})=x is not invertible modulo TT, the algorithm calls 𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(S2,T)\mathtt{MonicForm\_D5}(S_{2},\ T) at Line 10. It outputs two branches:

[[y2+(2x+3)y+2,(x+1)2, 1],[y2x,x2, 1]]𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(xy2+(x2+x1)y+2x,T)[[y^{2}+(2x+3)y+2,\ (x+1)^{2},\ 1],\ [y-2x,\ x^{2},\ 1]]\leftarrow\mathtt{MonicForm\_D5}(xy^{2}+(x^{2}+x-1)y+2x,\ T)

Recursive calls are then performed on each of these two branches:

1st branch: [[1, 0, 1,(x+1)2]]𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(b,y2+(2x+3)y+2,(x+1)2)[[1,\ 0,\ 1,\ (x+1)^{2}]]\leftarrow\mathtt{LastNonNil\_D5}(b,\ y^{2}+(2x+3)y+2,\ (x+1)^{2}).

2nd branch: [[y2x, 1,x,x]]𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(b,y2x,(x+1)2)[[y-2x,\ 1,\ x,\ x]]\leftarrow\mathtt{LastNonNil\_D5}(b,\ y-2x,\ (x+1)^{2}).

Finally: [[1, 0, 1,(x+1)2],[y2x, 1,x,x]]𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,b,T)[[1,\ 0,\ 1,\ (x+1)^{2}],\ [y-2x,\ 1,\ x,\ x]]\leftarrow\mathtt{LastNonNil\_D5}(a,\ b,\ T), meaning that a,b,T1, 0,(x+1)2y2x,x,x2\langle a,\ b,\ T\rangle\simeq\langle 1,\ 0,\ (x+1)^{2}\rangle\cdot\langle y-2x,\ x,\ x^{2}\rangle (actually, the latter product of ideals is equal to y,x\langle y,\ x\rangle). ∎

Proposition 5 (Correctness of Algorithm 10𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻\mathtt{LastNonNil\_D5}”).

The family [[ai,bi,Ti,Ui]i][[a_{i},\ b_{i},\ T_{i},\ U_{i}]_{i}] output by 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(f1,f2,T)\mathtt{LastNonNil\_D5}(f_{1},\ f_{2},\ T) satisfies the specifications 1-4 and Eq. (17).

We also have the degree conditions: For all jj,

degy(aj)degy(f1),and ifbj0,degy(bj)<degy(f2),degy(bj)<degy(aj)\deg_{y}(a_{j})\leq\deg_{y}(f_{1}),\quad\text{and if}\quad b_{j}\not=0,\quad\deg_{y}(b_{j})<\deg_{y}(f_{2}),\quad\deg_{y}(b_{j})<\deg_{y}(a_{j}) (18)

Moreover [degy(aj)=degy(f1)][degy(f1)=degy(f2)][\deg_{y}(a_{j})=\deg_{y}(f_{1})]\Rightarrow[\deg_{y}(f_{1})=\deg_{y}(f_{2})].

Proof.

We separate the proof of correctness, from the proof of the degree conditions, treated after.

Proof of correctness: We investigate the two returns at Line 10 and at Line 10.

Case of return at Line 10. The subresultant p.r.s. was computed modulo TT without failure until to get a zero f+1=0f_{\ell+1}=0. By Corollary 1, f1,f2,T=f,f+1,T\langle f_{1},\ f_{2},\ T\rangle=\langle f_{\ell},\ f_{\ell+1},\ T\rangle, whence the output [[u,v, 1,T]][[u,\ v,\ 1,\ T]] with u𝗅𝖼(f)1fmodTu\equiv\mathsf{lc}(f_{\ell})^{-1}f_{\ell}\bmod T, v=f+1=0v=f_{\ell+1}=0 verifies u,v,T=f1,f2,T\langle u,\ v,\ T\rangle=\langle f_{1},\ f_{2},\ T\rangle. This equality is a special easy case of Eq. (17) when the output has one component only.

Case of return at Line 10 . The subresultant p.r.s f1,f2,,f_{1},\ f_{2},\ \ldots, was correctly computed until fif_{i}, 𝗅𝖼(fi)\mathsf{lc}(f_{i}) being not invertible modulo TT. Since fi1f_{i-1} passed the if-test at Line 10, it has an invertible leading coefficient and a𝗅𝖼(fi1)1fi1modTa\equiv\mathsf{lc}(f_{i-1})^{-1}f_{i-1}\bmod T makes sense at Line 10 and fi1,T=a,T\langle f_{i-1},\ T\rangle=\langle a,\ T\rangle.

Algorithm 9𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{MonicForm\_D5}” is then called at Line 10 to “make” fif_{i} monic. The output 𝐌𝐛\mathbf{Mb} is a list of lists of three polynomials, say [[bj,Tj,Uj]j][[b_{j},\ T_{j},\ U_{j}]_{j}] verifying Tjbj,UjTj=fi,UjTj\langle T_{j}b_{j},\ U_{j}T_{j}\rangle=\langle f_{i},\ U_{j}T_{j}\rangle and jUjTj=T\prod_{j}U_{j}T_{j}=T, with bjb_{j} monic; Also the polynomials (UjTj)j(U_{j}T_{j})_{j}s are pairwise coprime and sqfp(Uj)=sqfp(Tj)\mathrm{sqfp}(U_{j})=\mathrm{sqfp}(T_{j}) if Tj1T_{j}\not=1. Next two cases occur: either fif_{i} is nilpotent modulo UjTjU_{j}T_{j} (Line 10) or not (Line 10).

In the first case, fi1f_{i-1} is the last non-nilpotent and fif_{i} is the first nilpotent polynomial met in the modified p.r.s. This is the expected result, thus the component [a,bj,Tj,Uj][a,\ b_{j},\ T_{j},\ U_{j}] is added to the output 𝙾𝚄𝚃\mathtt{OUT}. With Corollary 1, we obtain:

f1,f2,UjTj=fi1,fi,UjTj=a,Tjbj,TjUj\langle f_{1},\ f_{2},\ U_{j}T_{j}\rangle=\langle f_{i-1},\ f_{i},\ U_{j}T_{j}\rangle=\langle a,\ T_{j}b_{j},\ T_{j}U_{j}\rangle (19)

In the second case, Tj=1T_{j}=1, fif_{i} is not nilpotent modulo UjTjU_{j}T_{j}. Since 𝗅𝖼(fi)\mathsf{lc}(f_{i}) is not invertible modulo TT (Line 10), all monic forms (bj)j(b_{j})_{j} verify degy(bj)<degy(fi)\deg_{y}(b_{j})<\deg_{y}(f_{i}). Besides, degy(a)=degy(fi1)degy(f1)\deg_{y}(a)=\deg_{y}(f_{i-1})\leq\deg_{y}(f_{1}) and degy(Uj)degy(T)\deg_{y}(U_{j})\leq\deg_{y}(T). Therefore, the input (a,bj,Uj)(a,\ b_{j},\ U_{j}) of the recursive call at Line 10 displays a strict degree decrease compared to the main call with input (f1,f2,T)(f_{1},\ f_{2},\ T). We can then assume by induction that the output is correct. Write

[[ujn,vjn,Vjn,Wjn]n]𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,bj,Uj).[[u_{jn},\ v_{jn},\ V_{jn},\ W_{jn}]_{n}]\leftarrow\mathtt{LastNonNil\_D5}(a,\ b_{j},\ U_{j}).

We have nujn,Vjnvjn,WjnVjna,bj,Uj\prod_{n}\langle u_{jn},\ V_{jn}v_{jn},\ W_{jn}V_{jn}\rangle\simeq\langle a,\ b_{j},\ U_{j}\rangle. Besides, from the equalities

a,T=fi1,T,Tjbj,TjUj=fi,UjTj,Tj=1,andUj|T\langle a,\ T\rangle=\langle f_{i-1},\ T\rangle,\qquad\langle T_{j}b_{j},\ T_{j}U_{j}\rangle=\langle f_{i},\ U_{j}T_{j}\rangle,\qquad T_{j}=1,\quad\text{and}\quad U_{j}|T

in this case, we get: a,bj,Uj=fi1,fi,Uj\langle a,\ b_{j},\ U_{j}\rangle=\langle f_{i-1},\ f_{i},\ U_{j}\rangle. Corollary 1 provides the equality of ideals a,bj,Uj=f1,f2,Uj\langle a,\ b_{j},\ U_{j}\rangle=\langle f_{1},\ f_{2},\ U_{j}\rangle, and we have:

nujn,Vjnvjn,WjnVjnf1,f2,Uj.\prod_{n}\langle u_{jn},V_{jn}v_{jn},\ W_{jn}V_{jn}\rangle\simeq\langle f_{1},\ f_{2},\ U_{j}\rangle. (20)

Recall that jTjUj=T\prod_{j}T_{j}U_{j}=T and that the (UjTj)j(U_{j}T_{j})_{j} are pairwise coprime. The Chinese remainder theorem applied to Eq. (19) when Tj1T_{j}\not=1 and to Eq. (20) when Tj=1T_{j}=1 gives:

j,Tj1a,Tjbj,TjUjj,Tj=1nujn,Vjnvjn,WjnVjnf1,f2,T\prod_{j,\ T_{j}\not=1}\langle a,\ T_{j}b_{j},\ T_{j}U_{j}\rangle\ \cdot\ \prod_{j,\ T_{j}=1}\prod_{n}\langle u_{jn},\ V_{jn}v_{jn},\ W_{jn}V_{jn}\rangle\simeq\langle f_{1},\ f_{2},\ T\rangle (21)

The final output of the algorithm is then

𝙾𝚄𝚃=𝖼𝖺𝗍j,Tj1[[a,bj,Tj,Uj]]𝖼𝖺𝗍j,Tj=1𝖼𝖺𝗍𝑛[[ujn,vjn,Vjn,Wjn]].\mathtt{OUT}=\ \underset{j,\ T_{j}\not=1}{\mathsf{~{}cat~{}}}\ [[a,\ b_{j},\ T_{j},\ U_{j}]]\ \underset{j,\ T_{j}=1}{\mathsf{~{}cat~{}}}\ \ \underset{n}{\mathsf{~{}cat~{}}}\ [[u_{jn},\ v_{jn},\ V_{jn},\ W_{jn}]].

And with these notations, the isomorphism (21) above is precisely Eq. (17). This achieves the proof of correctness of the algorithm in all cases.

Proof of the degree condition. Consider one component [aj,bj,Uj][a_{j},\ b_{j},\ U_{j}]. Assume that the total number of pseudo-divisions (including those occurring in recursive calls) is at least two. This implies at least two strict degree decreases, and since aja_{j} and bjb_{j} are the monic form of the two last polynomials in the modified subresultant p.r.s, this implies:

degy(aj)<degy(f1),and ifbj0degy(bj)<degy(f2),anddegy(bj)<degy(aj),\deg_{y}(a_{j})<\deg_{y}(f_{1}),\quad\text{and if}\quad b_{j}\not=0\quad\deg_{y}(b_{j})<\deg_{y}(f_{2}),\ \ \text{and}\ \ \deg_{y}(b_{j})<\deg_{y}(a_{j}),

proving (18) in case of more than one pseudo-division.

If only one pseudo-division occurs in the algorithm, then two possibilities may happen:

  1. -1-

    either 𝗅𝖼(f2)\mathsf{lc}(f_{2}) is invertible modulo TT and f3=±𝗉𝗋𝖾𝗆(f1,f2)f_{3}=\pm\mathsf{prem}(f_{1},\ f_{2})

  2. -2-

    or not and then, let [[bj,Uj,Tj]j][[b_{j},\ U_{j},\ T_{j}]_{j}] be the monic form of f2f_{2} (Line 10), and aa that of f1f_{1} (Line 10). According to Assumption (H), f2f_{2} is not nilpotent modulo UjTjU_{j}T_{j} for any jj: the algorithm then never goes through the lines 10-10. At Line 10, a recursive call occurs: “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,bj,Uj)\mathtt{LastNonNil\_D5}(a,\ b_{j},U_{j})”, with aa and bjb_{j} monic. Inside this recursive call, another pseudo-division takes place, a contradiction.

Only Case 1 can happen. Let aa be the monic form of f2f_{2} (Line 10). Write the monic form of f3f_{3} at Line 10 as [[bj,Uj,Tj]j][[b_{j},\ U_{j},\ T_{j}]_{j}].

ifbj0,degy(bj)degy(f3)<degy(f2)=degy(a)degy(f1).\text{if}\quad b_{j}\not=0,\qquad\deg_{y}(b_{j})\leq\deg_{y}(f_{3})<\deg_{y}(f_{2})=\deg_{y}(a)\leq\deg_{y}(f_{1}).

This proves Eq (18). For degy(a)=degy(f1)\deg_{y}(a)=\deg_{y}(f_{1}) to hold, necessarily degy(f1)=degy(f2)\deg_{y}(f_{1})=\deg_{y}(f_{2}). This achieves the proof of the degree condition in the case of one pseudo-division.

If no pseudo-division at all occur, then 𝗅𝖼(f2)\mathsf{lc}(f_{2}) is not invertible modulo TT. Moreover the recursive call “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,bj,Uj)\mathtt{LastNonNil\_D5}(a,\ b_{j},\ U_{j})” at Line 10 does not involve pseudo-division neither. But since aa and bjb_{j} are monic, this cannot be the case. Thus the algorithm never reaches Line 10. It cannot reach the lines 10-10 neither: this would mean that f2f_{2} is nilpotent modulo UiTiU_{i}T_{i}, excluded by Assumption (H). The situation of no pseudo-division does not occur. ∎

Remark 4.

A component [ai,bi,Ti,Ui][a_{i},\ b_{i},\ T_{i},\ U_{i}] of the output verifies Ti=1T_{i}=1 if and only if bi=0b_{i}=0. Indeed, this occurs only at an exit Line 10. The other possibility at Line 10 is made under the condition Ti1T_{i}\not=1 (Line 10). At Line 10, we have bj0b_{j}\not=0, as an output of 𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{MonicForm\_D5} with input a non-zero polynomial.

5.2 Family of minimal lexicographic Gröbner bases from the subresultant p.r.s

We focus now on translating Algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}” to dynamic evaluation. A direct consequence is that the output is no more one lexGb, but a family of thereof.

Overview of Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}

Naively, it suffices to track divisions in the local version Algorithm 5𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱\mathtt{SubresToGB}” and to create splittings accordingly. A slight difficulty occurs in that the “𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,b,T)\mathtt{LastNonNil\_D5}(a,\ b,\ T)” algorithm assumes that aa has an invertible leading coefficient modulo TT. This assumption is too restrictive in many cases: there are some local components of TT over which this assumption is verified and others over which it is not. To circumvent this, it suffices to “make monic” aa with a call to “𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻\mathtt{MonicForm\_D5}” (Line 12) and proceed with this output. To clarify the exposition, an auxiliary algorithm 11𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}” first treats the case of a polynomial aa that has an invertible leading coefficient modulo TT, which becomes a subroutine in the main algorithm 12.

However, it is assumed that both aa and bb satisfy Assumption (H). It says that for any primary factor pep^{e} of TT, aa and bb are not nilpotent modulo pep^{e}. This assumption can likely be removed; we let if for future work.

Input: 1-2. polynomials a,bk[x,y]a,\ b\in k[x,y], degy(a)degy(b)\deg_{y}(a)\geq\deg_{y}(b). The leading coefficient of aa is invertible modulo TT.
3. Tk[x]T\in k[x] is a monic polynomial.
139
Output: Family of minimal lexGbs 𝐆=(𝒢i)i\mathbf{G}=(\mathcal{G}_{i})_{i} written (following Theorem 1) as in Eq. (22) and verifying the specifications (i)-(ii)-(iii) of Proposition 6
𝒢i=[hi1,hi2fi2,,hiμ1fiμ1,fiμ],hijk[x],fijk[x,y]moniciny,\mathcal{G}_{i}=[h_{i1},\ h_{i2}f_{i2},\ \ldots,\ h_{i\mu-1}f_{i\mu-1},\ f_{i\mu}],\quad h_{ij}\in k[x],\ f_{ij}\in k[x,y]{\rm~{}monic~{}in~{}}y, (22)
140
141if aa or bb is an invertible constant modulo TT then
142      return [[1]][[1]]
143
𝐒𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,b,T)\mathbf{S}\leftarrow\mathtt{LastNonNil\_D5}(a,\ b,\ T)
  // Write 𝐒=[[gi,hi,Ui,Ti]i]\mathbf{S}=[[g_{i},\ h_{i},\ U_{i},\ T_{i}]_{i}]
144 for [gi,hi,Ui,Ti]𝐒[g_{i},\ h_{i},\ U_{i},\ T_{i}]\in\mathbf{S} do
145       if gi1g_{i}\not=1 then // Non-trivial input: pursue computations
146             if hi=0h_{i}=0 then // Here gig_{i} is a gcd mod TiT_{i}
147                   𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍[[gi,UiTi]]\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}[[g_{i},\ U_{i}T_{i}]]
148                  
149            else
                   𝐆i𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(gi,hi,Ui)\mathbf{G}_{i}\leftarrow\mathtt{SubresToGB\_Aux}(g_{i},\ h_{i},\ U_{i})
                    // Recursive call
150                   Vi0TiV_{i0}^{\prime}\leftarrow T_{i}
151                   for Gij𝐆iG_{ij}\in\mathbf{G}_{i} do // GijG_{ij} is a minimal lexGb
                        
                          // Write Gij=[hij1,hij2fij2,,hijλ1fijλ1,fijλ]G_{ij}=[h_{ij1},\ h_{ij2}f_{ij2},\ \ldots,\ h_{ij\lambda-1}f_{ij\lambda-1},\ f_{ij\lambda}] as in Theorem 1
152                         (Vij,Vij)𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛(Vij1,hij1)(\,V_{ij},\ V_{ij}^{\prime}\,)\leftarrow\mathtt{IsolFactor}(V_{ij-1}^{\prime},\ h_{ij1})
153                         GijnewVijGij𝖼𝖺𝗍[gi]G_{ij}^{new}\ \leftarrow\ V_{ij}\cdot G_{ij}~{}\mathsf{~{}cat~{}}~{}[g_{i}]
154                        
155                  𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍[Gijnew]\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}[G_{ij}^{new}]
156                  
157            
158      
return 𝙾𝚄𝚃\mathtt{OUT}
Algorithm 11 𝐆𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(a,b,T)\mathbf{G}\leftarrow\mathtt{SubresToGB\_Aux}(a,\ b,\ T)
Proposition 6 (Correctness of Algorithm 11𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}”).

Let 𝐆=(𝒢i)i\mathbf{G}=(\mathcal{G}_{i})_{i} be the output of 𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(a,b,T)\mathtt{SubresToGB\_Aux}(a,\ b,\ T). Writing the systems (𝒢i)i(\mathcal{G}_{i})_{i} as in Eq. (22),

𝒢i=[hi1,hi2fi2,,hiμ1fiμ1,fiμ],\mathcal{G}_{i}=[\ h_{i1},\ h_{i2}f_{i2},\ \ldots,\ h_{i\mu-1}f_{i\mu-1},\ f_{i\mu}\ ],

they are minimal lexGbs verifying the specifications:

  1. (i)

    hi1h_{i1} and hj1h_{j1} are coprime. Additionally, ihi1|T\prod_{i}h_{i1}|T and isqfp(hi1)=sqfp(T)\prod_{i}\mathrm{sqfp}(h_{i1})=\mathrm{sqfp}(T).

  2. (ii)

    sqfp(hi1)=sqfp(hi2)==sqfp(hiμ1)\mathrm{sqfp}(h_{i1})=\mathrm{sqfp}(h_{i2})=\cdots=\mathrm{sqfp}(h_{i\mu-1}).

  3. (iii)

    i𝒢i=a,b,T\prod_{i}\langle\mathcal{G}_{i}\rangle=\langle a,\ b,\ T\rangle and 𝒢i+𝒢j=1\langle\mathcal{G}_{i}\rangle+\langle\mathcal{G}_{j}\rangle=\langle 1\rangle for iji\not=j.

Proof.

If the input aa or bb is an invertible constant modulo TT (Line 11) then the ideal a,b,T=1\langle a,\ b,\ T\rangle=\langle 1\rangle. The output Line 11 is then logically [[1]][[1]].

The call to 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(a,b,T)\mathtt{LastNonNil\_D5}(a,\ b,\ T) at Line 11 outputs a family [[gi,hi,Ui,Ti]i][[g_{i},\ h_{i},\ U_{i},T_{i}]_{i}] such that

gi,hiTi,TiUi=a,b,UiTi\langle g_{i},\ h_{i}T_{i},\ T_{i}U_{i}\rangle=\langle a,\ b,\ U_{i}T_{i}\rangle (23)

with the polynomials (UiTi)i(U_{i}T_{i})_{i} pairwise coprime and sqfp(Ui)=sqfp(Ti)\mathrm{sqfp}(U_{i})=\mathrm{sqfp}(T_{i}) if Ui1U_{i}\not=1.

If gi=1g_{i}=1 then the ideal gi,hiUi,TiUi=1\langle g_{i},\ h_{i}U_{i},\ T_{i}U_{i}\rangle=\langle 1\rangle and the corresponding lexGb is [1][1], which does not need to be added to the output. That is why the if-test at Line 11 discards this case.

If gi1g_{i}\not=1 and hi=0h_{i}=0 then a,b,UiTi=gi,TiUi\langle a,\ b,\ U_{i}T_{i}\rangle=\langle g_{i},\ T_{i}U_{i}\rangle, and [gi,TiUi][g_{i},\ T_{i}U_{i}] is a minimal lexGb, which is added to the output (Line 11).

Otherwise, a recursive call at Line 11 is performed. Its validity is proved in the lemma 7 hereafter: we can assume that the output 𝐆i\mathbf{G}_{i} verifies the output’s specifications.

Lemma 7.

The recursive call 𝐆i𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(gi,hi,Ui)\mathbf{G}_{i}\leftarrow\mathtt{SubresToGB\_Aux}(g_{i},\ h_{i},\ U_{i}) at Line 11 is valid.

Proof.

By the degree condition Eq. (18) of Proposition 5 related to Algorithm 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻\mathtt{LastNonNil\_D5}, we have degy(gi)>degy(hi)\deg_{y}(g_{i})>\deg_{y}(h_{i}) unless hi=0h_{i}=0. Regarding that hi0h_{i}\not=0 (else at Line 11) we have degy(gi)>degy(hi)\deg_{y}(g_{i})>\deg_{y}(h_{i}). Moreover gig_{i} is monic so the input (gi,hi,Ui)(g_{i},\ h_{i},\ U_{i}) satisfies the input’s specifications of Algorithm 11𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}”. Still from that proposition 5, degy(gi)=degy(a)\deg_{y}(g_{i})=\deg_{y}(a) possibly holds only if degy(a)=degy(b)\deg_{y}(a)=\deg_{y}(b). But then degy(hi)<degy(gi)<degy(b)\deg_{y}(h_{i})<\deg_{y}(g_{i})<\deg_{y}(b). Thus, in any situations the input (gi,hi,Ui)(g_{i},\ h_{i},\ U_{i}) presents a degree decrease compared to that of the main call (a,b,T)(a,\ b,\ T). By induction, we can assume that the output is as expected. ∎

Writing 𝐆i=(Gij)j\mathbf{G}_{i}=(G_{ij})_{j}, where (Gij)j(G_{ij})_{j} is a family of minimal lexGbs that we denote Gij=[hij1,hij2fij2,G_{ij}=[h_{ij1},\ h_{ij2}f_{ij2}, ,\ldots, hijλ1fijλ1,fijλ]\ h_{ij\lambda-1}f_{ij\lambda-1},\ f_{ij\lambda}] as in Theorem 1. They verify:

(i’) hij1h_{ij1} and hi1h_{i\ell 1} are coprime and jhij1|Ui\prod_{j}h_{ij1}|U_{i}, as well as jsqfp(hij1)=sqfp(Ui)\prod_{j}\mathrm{sqfp}(h_{ij1})=\mathrm{sqfp}(U_{i}).
(ii’) sqfp(hij1)==sqfp(hijλ1)\mathrm{sqfp}(h_{ij1})=\cdots=\mathrm{sqfp}(h_{ij\lambda-1}).
(iii’) jGij=gi,hi,Ui\prod_{j}\langle G_{ij}\rangle=\langle g_{i},\ h_{i},\ U_{i}\rangle and Gij+Gi=1\langle G_{ij}\rangle+\langle G_{i\ell}\rangle=\langle 1\rangle if jj\not=\ell.

Then a call to 𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor} has the effect of “ projecting” TiT_{i} along the (hij1)j(h_{ij1})_{j}s. We have Vij=Vij1(hij1)V_{ij}=V_{ij-1}^{\prime(h_{ij1})} where (Vij,Vij)𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛(Vij1,hij1)(\,V_{ij},\ V_{ij}^{\prime}\,)\leftarrow\mathtt{IsolFactor}(V_{ij-1}^{\prime},\ h_{ij1}), with Vi0=TiV_{i0}^{\prime}=T_{i} (Line 11). The specifications of Algorithm 6𝙸𝚜𝚘𝚕𝙵𝚊𝚌𝚝𝚘𝚛\mathtt{IsolFactor}” provides VijVij=Vij1V_{ij}V_{ij}^{\prime}=V_{ij-1}^{\prime}, the product being that of coprime polynomials. By induction we get:

Ti=Vi0=Vi1Vi1=Vi1Vi2Vi2==Vi1Vi2VijVij,for allj1.T_{i}=V_{i0}^{\prime}=V_{i1}V_{i1}^{\prime}=V_{i1}V_{i2}V_{i2}^{\prime}=\cdots=V_{i1}V_{i2}\cdots V_{ij}V_{ij}^{\prime},\quad\text{for all}\ \ j\geq 1. (24)

Moreover the factors in the product are pairwise coprime. It follows that

Vij=Vij1(hij1)=p𝒫,vp(hij1)>0pvp(Vij1)=p𝒫,vp(hij1)>0pvp(Ti)=Ti(hij1).V_{ij}=V_{ij-1}^{\prime(h_{ij1})}=\prod_{p\in\mathcal{P},v_{p}(h_{ij1})>0}p^{v_{p}(V_{ij-1}^{\prime})}=\prod_{p\in\mathcal{P},v_{p}(h_{ij1})>0}p^{v_{p}(T_{i})}=T_{i}^{(h_{ij1})}.

Since the (hij1)j(h_{ij1})_{j}s are pairwise coprime, and that jsqfp(hij1)=sqfp(Ui)\prod_{j}\mathrm{sqfp}(h_{ij1})=\mathrm{sqfp}(U_{i}), each irreducible factor of UiU_{i} appears in those of one (and only one) of hij1h_{ij1}. Moreover, Ui1U_{i}\not=1 by Remark 4, hence sqfp(Ui)=sqfp(Ti)\mathrm{sqfp}(U_{i})=\mathrm{sqfp}(T_{i}) by the output’ specifications of Algorithm 10𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻\mathtt{LastNonNil\_D5}”. Therefore

jVij=jTi(hij1)=jp𝒫,vp(hij1)>0pvp(Ti)=p𝒫,vp(Ui)>0pvp(Ti)=p𝒫,vp(Ti)>0pvp(Ti)=Ti.\prod_{j}V_{ij}=\prod_{j}T_{i}^{(h_{ij1})}=\prod_{j}\prod_{p\in\mathcal{P},\ v_{p}(h_{ij1})>0}\negthickspace\negthickspace\negthickspace p^{v_{p}(T_{i})}=\prod_{p\in\mathcal{P},\ v_{p}(U_{i})>0}\negthickspace\negthickspace\negthickspace p^{v_{p}(T_{i})}=\prod_{p\in\mathcal{P},\ v_{p}(T_{i})>0}\negthickspace\negthickspace\negthickspace p^{v_{p}(T_{i})}=T_{i}. (25)

At Line 11, Gijnew:=VijGij𝖼𝖺𝗍[gi]G_{ij}^{new}:=V_{ij}G_{ij}~{}\mathsf{~{}cat~{}}~{}[g_{i}], which rewrites using the notation above:

Gijnew:=[hij1Vij,hij2Vijfij2,,hijλ1Vijfijλ1,Vijfijλ,gi].G_{ij}^{new}:=[h_{ij1}V_{ij},\ h_{ij2}V_{ij}f_{ij2},\ \ldots,\ h_{ij\lambda-1}V_{ij}f_{ij\lambda-1},\ V_{ij}f_{ij\lambda},\ g_{i}].

Since giGijg_{i}\in\langle G_{ij}\rangle, Theorem 1-(B) implies that GijnewG_{ij}^{new} is a lexGb. The following lemma 8 shows that it is minimal.

Lemma 8.

The lexGb GijnewG_{ij}^{new} is a minimal one.

Proof.

According to Theorem 1-(B), it suffices to prove that degy(gi)\deg_{y}(g_{i}) is larger than the degree (in yy) of all the polynomials in GijG_{ij}. Consider the first recursive call at Line 11. Recall that gi1g_{i}\not=1 and hi0h_{i}\not=0. If hih_{i} is a constant (Line 11) then the recursive call outputs [[1]][[1]] and the minimality of GijG_{ij} is obvious. Else it goes to another call to 𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻\mathtt{LastNonNil\_D5} at Line 11.

[[gi,hi,Ui,Ti]]𝙻𝚊𝚜𝚝𝙽𝚘𝚗𝙽𝚒𝚕_𝙳𝟻(gi,hi,Ui).[[g_{i\ell},\ h_{i\ell},\ U_{i\ell},\ T_{i\ell}]_{\ell}]\leftarrow\mathtt{LastNonNil\_D5}(g_{i},\ h_{i},\ U_{i}).

According to the degree condition of Proposition 5, an equality degy(gi)=degy(gi)\deg_{y}(g_{i\ell})=\deg_{y}(g_{i}) can only occur if degy(hi)=degy(gi)\deg_{y}(h_{i})=\deg_{y}(g_{i}), which does not hold as seen above. ∎

This proves one output’s specification. According to the specification (ii’) above, we obtain sqfp(hij1Vij)==sqfp(hijλ1Vij)\mathrm{sqfp}(h_{ij1}V_{ij})=\cdots=\mathrm{sqfp}(h_{ij\lambda-1}V_{ij}). Moreover, all irreducible factors of Vij=Ti(hij1)V_{ij}=T_{i}^{(h_{ij1})} are irreducible factors of hij1h_{ij1} by definition. We obtain that sqfp(hijVij)=sqfp(Vij)\mathrm{sqfp}(h_{ij\ell}V_{ij})=\mathrm{sqfp}(V_{ij}) for 1λ11\leq\ell\leq\lambda-1. This proves Specification (ii).

Additionally, ijhij1Vij|iUiTi|T\prod_{i}\prod_{j}h_{ij1}V_{ij}|\prod_{i}U_{i}T_{i}|T proving the second statement of Specification (i). The first statement is that the (hij1Vij)j(h_{ij1}V_{ij})_{j}s are pairwise coprime. This follows from Eq. (24) and the specification (i’).

Besides, jGijnew=j(VijGij+gi)\prod_{j}\langle G_{ij}^{new}\rangle=\prod_{j}(\langle V_{ij}G_{ij}\rangle+\langle g_{i}\rangle). Lemma 9 in Appendix, proves that jGijnew=(jVijGij)+gi\prod_{j}\langle G_{ij}^{new}\rangle=(\prod_{j}\langle V_{ij}G_{ij}\rangle)+\langle g_{i}\rangle. This ideal is equal to (jVij)(jGij)+gi(\prod_{j}V_{ij})(\prod_{j}\langle G_{ij}\rangle)+\langle g_{i}\rangle. By the specification (iii’) and Eq. (25) above, we get: jGijnew=Tigi,hi,Ui+gi=Tigi,Tihi,TiUi,gi=gi,Tihi,TiUi\prod_{j}\langle G_{ij}^{new}\rangle=T_{i}\langle g_{i},\ h_{i},\ U_{i}\rangle+\langle g_{i}\rangle=\langle T_{i}g_{i},\ T_{i}h_{i},T_{i}U_{i},\ g_{i}\rangle=\langle g_{i},\ T_{i}h_{i},\ T_{i}U_{i}\rangle. Finally, with Eq. (23) and the Chinese remainder theorem we obtain:

a,b,Tia,b,UiTi=igi,Tihi,UiTi=i,gi1,hi=0gi,UiTii,gi1,hi0jGijnew\langle a,\ b,\ T\rangle\simeq\prod_{i}\langle a,\ b,\ U_{i}T_{i}\rangle=\prod_{i}\langle g_{i},\ T_{i}h_{i},\ U_{i}T_{i}\rangle=\prod_{i,\ g_{i}\not=1,\ h_{i}=0}\langle g_{i},\ U_{i}T_{i}\rangle\cdot\prod_{i,\ g_{i}\not=1,\ h_{i}\not=0}\prod_{j}\langle G_{ij}^{new}\rangle

which is output’s specification (iii). That they are pairwise coprime follows from the fact that the ideals (gi,Tihi,TiUi)i(\langle g_{i},\ T_{i}h_{i},\ T_{i}U_{i}\rangle)_{i} are pairwise coprime. ∎

Next the assumption that aa has an invertible leading coefficient modulo TT is lifted. It suffices to run the algorithm 9𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(a,T)\mathtt{MonicForm\_D5}(a,\ T)” (Line 12), and naively to call the previous algorithm 11𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}” on each component of that monic form. But this induces a minor issue, in that the monic forms (aj)j(a_{j})_{j} of aa may not all satisfy degy(b)degy(aj)\deg_{y}(b)\leq\deg_{y}(a_{j}), a requirement for calling “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}”. The if-test Line 12 distinguishes the jjs for which degy(aj)<degy(b)\deg_{y}(a_{j})<\deg_{y}(b) from those jjs for which degy(b)degy(aj)\deg_{y}(b)\leq\deg_{y}(a_{j}). In the former case (Lines 12-12), calling directly 𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(bj,aj,Tj)\mathtt{SubresToGB\_Aux}(b_{j},\ a_{j},\ T_{j}) does not necessarily work because bjbmodTjb_{j}\equiv b\bmod T_{j} may not have an invertible leading coefficient modulo TjT_{j} — another requirement of “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}”. Thus we make bjb_{j} monic first (Line 12). Then a last if-test (Line 12) distinguishes the cases degy(aij)<degy(bij)\deg_{y}(a_{ij})<\deg_{y}(b_{ij}) from the cases degy(aij)degy(bij)\deg_{y}(a_{ij})\geq\deg_{y}(b_{ij}), before this time calling 𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux} with all its specifications guaranteed.

Input: 1-2. polynomials a,bk[x,y]a,\ b\in k[x,y], degy(a)degy(b)\deg_{y}(a)\geq\deg_{y}(b) satisfying Assumption (H).
3. Tk[x]T\in k[x] is a monic non-constant polynomial.
159
Output: Family of minimal lexGbs 𝐆=(𝒢i)i\mathbf{G}=(\mathcal{G}_{i})_{i} written following Theorem 1 as in Eq. (26), and verifying the specifications (i)-(ii)-(iii) of Theorem 4.
𝒢i=[hi1,hi2fi2,,hiμ1fiμ1,fiμ],hijk[x],fijk[x,y]moniciny,\mathcal{G}_{i}=[h_{i1},\ h_{i2}f_{i2},\ \ldots,\ h_{i\mu-1}f_{i\mu-1},\ f_{i\mu}],\quad h_{ij}\in k[x],\ f_{ij}\in k[x,y]{\rm~{}monic~{}in~{}}y, (26)
160
161if aa or bb is a non-zero constant then
162      return [[1]][[1]]
163
164𝙾𝚄𝚃[]\mathtt{OUT}\leftarrow[]
165
𝐌𝐚𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(a,T)\mathbf{Ma}\leftarrow\mathtt{MonicForm\_D5}(a,\ T)
  // Write 𝐌𝐚=[[aj,Tj, 1]j]\mathbf{Ma}=[[a_{j},\ T_{j},\ 1]_{j}]
166 for [aj,Tj, 1]𝐌𝐚[a_{j},\ T_{j},\ 1]\in\mathbf{Ma} do
167       bjbmodTjb_{j}\leftarrow b\bmod T_{j}
168       if degy(aj)degy(bj)\deg_{y}(a_{j})\geq\deg_{y}(b_{j}) then
169             𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(aj,bj,Tj)\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}\mathtt{SubresToGB\_Aux}(a_{j},\ b_{j},\ T_{j})
170            
171      else
             𝐌𝐛j𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(bj,Tj)\mathbf{Mb}_{j}\leftarrow\mathtt{MonicForm\_D5}(b_{j},\ T_{j})
              // Write 𝐌𝐛j=[[bij,Tij, 1]i]\mathbf{Mb}_{j}=[[b_{ij},\ T_{ij},\ 1]_{i}]
172             for [bij,Tij, 1]𝐌𝐛j[b_{ij},\ T_{ij},\ 1]\in\mathbf{Mb}_{j} do
173                   aijajmodTija_{ij}\leftarrow a_{j}\bmod T_{ij}
174                   if degy(aij)degy(bij)\deg_{y}(a_{ij})\geq\deg_{y}(b_{ij}) then
175                         𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(aij,bij,Tij)\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}\mathtt{SubresToGB\_Aux}(a_{ij},\ b_{ij},\ T_{ij})
176                        
177                  else
178                         𝙾𝚄𝚃𝙾𝚄𝚃𝖼𝖺𝗍𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(bij,aij,Tij)\mathtt{OUT}\leftarrow\mathtt{OUT}\mathsf{~{}cat~{}}\mathtt{SubresToGB\_Aux}(b_{ij},\ a_{ij},\ T_{ij})
179                        
180                  
181            
182      
183if 𝙾𝚄𝚃=[]\mathtt{OUT}=[] then
184      return [[1]][[1]]
return 𝙾𝚄𝚃\mathtt{OUT}
Algorithm 12 𝐆𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻(a,b,T)\mathbf{G}\leftarrow\mathtt{SubresToGB\_D5}(a,\ b,\ T)
Theorem 4 (Correctness of Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}”).

The output 𝙾𝚄𝚃\mathtt{OUT} of 𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻(a,b,T)\mathtt{SubresToGB\_D5}(a,\ b,\ T) verifies the specifications below.

  1. (i)

    hi1h_{i1} and hj1h_{j1} are coprime. Additionally, ihi1|T\prod_{i}h_{i1}|T and isqfp(hi1)=sqfp(T)\prod_{i}\mathrm{sqfp}(h_{i1})=\mathrm{sqfp}(T).

  2. (ii)

    sqfp(hi1)=sqfp(hi2)==sqfp(hiμ1)\mathrm{sqfp}(h_{i1})=\mathrm{sqfp}(h_{i2})=\cdots=\mathrm{sqfp}(h_{i\mu-1}).

  3. (iii)

    i𝒢i=a,b,T\prod_{i}\langle\mathcal{G}_{i}\rangle=\langle a,\ b,\ T\rangle and 𝒢i+𝒢j=1\langle\mathcal{G}_{i}\rangle+\langle\mathcal{G}_{j}\rangle=\langle 1\rangle for iji\not=j.

Proof.

If aa or bb is a non-zero constant, then a,b,T=1\langle a,\ b,\ T\rangle=\langle 1\rangle so that the output [[1]][[1]] at Line 12 is correct.

By Assumption (H), for each primary factor pep^{e} of TT, amodpea\bmod p^{e} is not nilpotent. Therefore, when “making” aa monic with 𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(a,T)\mathtt{MonicForm\_D5}(a,\ T), the collection of output is always of the form [aj,Tj, 1][a_{j},\ T_{j},\ 1]. The third component is indeed a polynomial Ui1U_{i}\not=1 if and only if UiU_{i} divides aa modulo TiT_{i}. Since sqfp(Ui)=sqfp(Ti)\mathrm{sqfp}(U_{i})=\mathrm{sqfp}(T_{i}), this would imply that aa is nilpotent modulo TiT_{i}, in contradiction with Assumption (H).

The output 𝐌𝐚=[[aj,Tj,1]j]\mathbf{Ma}=[[a_{j},\ T_{j},1]_{j}] of 𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(a,T)\mathtt{MonicForm\_D5}(a,\ T) at Line 12, verify aj,Tj=a,Tj\langle a_{j},\ T_{j}\rangle=\langle a,\ T_{j}\rangle with aja_{j} monic and jTj=T\prod_{j}T_{j}=T, the (Tj)j(T_{j})_{j}s being pairwise coprime. The algorithm treats each component TjT_{j} of TT separately in the for loop Line 12-12.

Naively, a call to “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}” shall be performed with (aj,bj,Tj)(a_{j},\ b_{j},\ T_{j}), but this input does not necessarily satisfy the specifications of that algorithm if degy(aj)<degy(bj)\deg_{y}(a_{j})<\deg_{y}(b_{j}). In that case (Lines 12-12), we cannot simply switch aja_{j} with bjb_{j} by calling directly 𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡(bj,aj,Tj)\mathtt{SubresToGB\_Aux}(b_{j},\ a_{j},\ T_{j}) neither since bjb_{j} may not have a leading coefficient invertible modulo TjT_{j} (a requirement of that algorithm). Therefore we “make” bjb_{j} monic with a call to 𝙼𝚘𝚗𝚒𝚌𝙵𝚘𝚛𝚖_𝙳𝟻(bj,Tj)\mathtt{MonicForm\_D5}(b_{j},\ T_{j}) at Line 12. Since bb satisfies Assumption (H), bmodpeb\bmod p^{e} is not nilpotent for all primary factor pep^{e} of TT. Therefore, 𝐌𝐛j=[[bij,Tij, 1]i]\mathbf{Mb}_{j}=[[b_{ij},\ T_{ij},\ 1]_{i}] (third component is always 1).

bijmonicbij,Tij=bj,Tij,iTij=Tj,(Tij)ispairwisecoprime.b_{ij}{\rm~{}monic}\qquad\langle b_{ij},\ T_{ij}\rangle=\langle b_{j},\ T_{ij}\rangle,\qquad\prod\nolimits_{i}T_{ij}=T_{j},\quad(T_{ij})_{i}{\rm s~{}pairwise~{}coprime}.

Now both families (aij)(a_{ij}) and (bij)(b_{ij}) are made of polynomials having an invertible coefficient modulo TijT_{ij}, hence calls to 𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux} at Line 12 or Line 12 are correct. 𝙾𝚄𝚃\mathtt{OUT} concatenates all these minimal lexGbs. This leads to the following equalities, where the second one is deduced from Lemma 9 in Appendix.

𝒢𝙾𝚄𝚃𝒢jiaj,bij,Tijj(aj+ibij,Tij)jaj,bj,Tj=a,b,T.\prod_{\mathcal{G}\in\mathtt{OUT}}\langle\mathcal{G}\rangle\simeq\prod_{j}\prod_{i}\langle a_{j},\ b_{ij},\ T_{ij}\rangle\simeq\prod_{j}(\langle a_{j}\rangle+\prod_{i}\langle b_{ij},\ T_{ij}\rangle)\simeq\prod_{j}\langle a_{j},\ b_{j},\ T_{j}\rangle=\langle a,\ b,\ T\rangle.

This proves the first statement of the specification (iii), the second statement being that these lexGbs are pairwise coprime. Let 𝒢1\mathcal{G}_{1} and 𝒢2\mathcal{G}_{2} be two different lexGbs in 𝙾𝚄𝚃\mathtt{OUT}. If 𝒢1\mathcal{G}_{1} and 𝒢2\mathcal{G}_{2} are in the same output of a call to “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}” at Line 1212 or 12, then the output’ specifications of “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}” guarantee that 𝒢1\mathcal{G}_{1} and 𝒢2\mathcal{G}_{2} are coprime.

If 𝒢1\mathcal{G}_{1} and 𝒢2\mathcal{G}_{2} are obtained from different calls to “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}”, then the (Tj)j(T_{j})_{j}s (Line 12) are pairwise coprime, or the (Tij)ij(T_{ij})_{ij}s (Lines 12 or 12) are pairwise coprime, so that 𝒢1\mathcal{G}_{1} and 𝒢2\mathcal{G}_{2} are coprime. This ends the proof of the specification (iii).

Finally, the specifications (i)-(ii) are also satisfied according that the lexGbs are computed by calls to “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙰𝚞𝚡\mathtt{SubresToGB\_Aux}” whose output satisfy these two specifications. ∎

6 Implementation and experimental section

All algorithms are implemented in Magma v2.25-1 and can be found at http://xdahan.sakura.ne.jp/gb.html. Experiments were realized on an Intel processor Core i7-6700K clocked at 4GHz. The timings naturally compare with that of the GroebnerBasis command. We recall that a common strategy to compute a lexGb divides in two steps: first compute a Gröbner basis for the degree reverse lexicographic order (grevlex for short) then applies a change of monomial order algorithm, typically FGLM since we are constrained to systems of dimension zero. Magma is equipped with one of the best implementation of Faugère algorithm F4 [20], which is called in the first step. We report on the timing F4++FGLM, with the timing of FGLM appended inside parentheses when not negligible.

We consider only polynomials over a finite field. Rational coefficients induce large coefficients swell, and without modular methods become difficult to compare. We could have turned the Modular option off in Magma when calling a Gröbner basis computation, but for now we would rather stick to finite fields. The comparison with small size (16bits) and medium size (64bits) finite fields bring enough evidences of the advantage of the proposed algorithms.

6.1 Testing suite

We consider two families of examples, each tested over a 16-bits finite field and a 64-bits finite field. The polynomials a,ba,\ b are defined as follows:

  • First family (Tables 1-3-4): 16 polynomials a,ba,b are constructed with respect to a modulus TT whose factors are defined as follows:

    • Consider T=p1e1p2e2T=p_{1}^{e_{1}}p_{2}^{e_{2}} (two factors where p1=xp_{1}=x and p2=(x+1)p_{2}=(x+1)),

      T=p1e1p2e2p3e3T=p_{1}^{e_{1}}p_{2}^{e_{2}}p_{3}^{e_{3}} (three factors, where p1=(x+10),p2=(x+20),p3=(x+30)p_{1}=(x+10),\ \ p_{2}=(x+20),\ \ p_{3}=(x+30)), and finally

      T=p1e1p2e2p3e3p4e4T=p_{1}^{e_{1}}p_{2}^{e_{2}}p_{3}^{e_{3}}p_{4}^{e_{4}} (four factors, where p1=x,p2=(x+5),p3=(x+10),p4=(x+15)p_{1}=x,\ \ p_{2}=(x+5),\ \ p_{3}=(x+10),\ \ p_{4}=(x+15)).

    • The exponents are respectively

      (examples 1-4) (e1,e2)=(5i, 5(i+1))i=1,2,3,4(e_{1},e_{2})=(5i,\ 5(i+1))_{i=1,2,3,4} when there are two factors,

      (examples 5-11) (e1,e2,e3)=(3i1, 3i, 3i+1)i=3,4,5,6,7,8,9(e_{1},e_{2},e_{3})=(3i-1,\ 3i,\ 3i+1)_{i=3,4,5,6,7,8,9}, when there are three factors,

      (examples 12-16) (e1,e2,e3,e4)=(4i, 4i+1, 4i+2, 4i+3)i=1,2,3,4,5(e_{1},e_{2},e_{3},e_{4})=(4i,\ 4i+1,\ 4i+2,\ 4i+3)_{i=1,2,3,4,5}, when there are four factors.

    • For each pieip_{i}^{e_{i}} polynomials ai,bia_{i},b_{i} are built as follows:

      ai:=(y+pi)=1ei1(y+pi+pi2++pi++2pi+1)modpieia_{i}:=(y+p_{i})\cdot\prod_{\ell=1}^{e_{i}-1}(y+p_{i}+p_{i}^{2}+\cdots+p_{i}^{\ell}+\ell+2p_{i}^{\ell+1})\bmod p_{i}^{e_{i}}

      bi:=(y+2pi)=1ei1(y+pi+pi2++pi++pi+1)modpieib_{i}:=(y+2p_{i})\cdot\prod_{\ell=1}^{e_{i}-1}(y+p_{i}+p_{i}^{2}+\cdots+p_{i}^{\ell}+\ell+p_{i}^{\ell+1})\bmod p_{i}^{e_{i}}

    • Then the CRT is applied to construct polynomials a,ba,b modulo TT from their local images ai,bia_{i},b_{i}.

  • Second family (Tables 2-5-6): 6 polynomials a,ba,b constructed according to a modulus TT whose factors are defined as follows:

    • Consider T=q7eq6e1q1e6T=q_{7}^{e}q_{6}^{e-1}\cdots q_{1}^{e-6} where each polynomial qi=ri1ri(8i)q_{i}=r_{i1}\cdots r_{i(8-i)} and rij=x+i(i+1)/2+j2r_{ij}=x+i(i+1)/2+j-2. For example r71=x+27r_{71}=x+27 and r1j=x+1+j2=x+j1r_{1j}=x+1+j-2=x+j-1.

    • e=7,8,9,10,11,12e=7,8,9,10,11,12.

    • For each rijeir_{ij}^{e-i} polynomials aij,bija_{ij},b_{ij} are built as follows:

      aij:=(y+rij)=1ei(y+rij+rij2++rij++2rij+1)modrijeia_{ij}:=(y+r_{ij})\cdot\prod_{\ell=1}^{e-i}(y+r_{ij}+r_{ij}^{2}+\cdots+r_{ij}^{\ell}+\ell+2r_{ij}^{\ell+1})\bmod r_{ij}^{e-i}

      bij:=(y+2rij)=1ei(y+rij+rij2++rij++rij+1)modrijeib_{ij}:=(y+2r_{ij})\cdot\prod_{\ell=1}^{e-i}(y+r_{ij}+r_{ij}^{2}+\cdots+r_{ij}^{\ell}+\ell+r_{ij}^{\ell+1})\bmod r_{ij}^{e-i}

    • Then the CRT is applied to construct polynomials a,ba,b modulo TT from their local images aij,bija_{ij},b_{ij}.

The first family concerns a modulus TT with few factors of moderate exponent degrees, each exponent degrees being moderately distant. The second family targets a modulus TT having 27 factors, and a squarefree decomposition made of seven factors. The exponent degrees are distant of one, and are relatively small.

The correctness of the output of Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” was checked as follows: Take 𝒢\mathcal{G} the lexGb output by the Gröbner engine of Magma, and (𝒢i)i(\mathcal{G}_{i})_{i} the family of lexGbs output by Algorithm 12. We checked that each polynomial in 𝒢\mathcal{G} reduces to zero modulo each 𝒢i\mathcal{G}_{i}. In this way 𝒢i𝒢i\mathcal{G}\subset\prod_{i}\langle\mathcal{G}_{i}\rangle. And compared the dimension of the two vector spaces k[x,y]/𝒢k[x,y]/\langle\mathcal{G}\rangle and ik[x,y]/𝒢i\prod_{i}k[x,y]/\langle\mathcal{G}_{i}\rangle.

The two tables 1-2 summarize data attached to the system (a,b)(a,\ b) (without a modulus TT, which will turn out to be Resy(a,b)\mathrm{Res}_{y}(a,b), see next Section 6.2). This kind of input is of practical importance and the timings are not always favorable to Algorithm 12, which require a special analysis, undertaken in Section 6.4.

Description of Tables 1-2

  1. Column 1:

    refers to the example’s number. (4+7+5=164+7+5=16 examples for the 1st family, and 66 examples for the 2nd family).

  2. Column 2:

    degree 𝖣𝖤𝖦\mathsf{DEG} of the ideal generated by a,b\langle a,\ b\rangle, equal to dimk(k[x,y]/a,b)\dim_{k}(k[x,y]/\langle a,\ b\rangle).

  3. Column 3:

    degrees degy(a)\deg_{y}(a) and degy(b)\deg_{y}(b) of the input polynomials aa and bb (always equal).

  4. Column 4:

    total degrees tdeg(a)\mathrm{tdeg}(a), tdeg(b)\mathrm{tdeg}(b) of the input polynomials aa and bb (always equal).

  5. Column 5:

    deg(Resy(a,b))k[x]\deg(\mathrm{Res}_{y}(a,b))\in k[x] degree of the resultant of aa and bb.

  6. Column 6:

    sum of the degrees of the factors having multiplicity one in the factorization of Resy(a,b)\mathrm{Res}_{y}(a,b).

  7. Column 7:

    sum of the degrees of the factors having multiplicity >1>1 in the factorization of Resy(a,b)\mathrm{Res}_{y}(a,b).

  8. Column 8:

    average multiplicity of an irreducible factor of Resy(a,b)\mathrm{Res}_{y}(a,b) having multiplicity >1>1 (do not count the factor of multiplicity one).

  9. Column 9:

    number of lexGbs output by Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻′′\mathtt{SubresToGB\_D5}^{\prime\prime}. Inside parentheses, the average number of polynomials in these lexGbs.

ex.
nbr.
​​​​𝖣𝖤𝖦\mathsf{DEG}​​​​ ​​​​​​​​ degy(a)=degy(b)\begin{array}[]{c}\deg_{y}(a)\\ =\deg_{y}(b)\end{array} ​​​​​​​​ ​​​​​​​​ tdeg(a)=tdeg(b)\begin{array}[]{c}\mathrm{tdeg}(a)\\ =\mathrm{tdeg}(b)\end{array} ​​​​​​​​
degree
resultant
deg. multi-
plicity 1
deg. multi-
plicity >>1
avg. multi-
plicity >>1
#lexGbs
(avg. #poly.)
1 241 10 24 266 171 95 47.5 2 (8.5)
2 646 15 39 696 471 225 112.5 2 (14.5)
3 1251 20 54 1326 919 407 135.67 2 (18.5)
4 2056 25 69 2165 1521 635 317.5 2 (23.5)
5 281 8 28 300 196 104 34.67 3 (8)
6 581 11 40 609 415 194 64.67 3 (11)
7 989 14 52 1026 715 311 103.67 3 (14)
8 1505 17 64 1551 1096 455 151.67 3 (17)
9 2129 20 76 2184 1558 626 208.67 3 (20)
10 2861 23 88 2925 2101 824 274.67 3 (23)
11 3701 26 100 3774 2725 1049 349.67 3 (26)
12 275 7 28 273 171 102 25.5 4 (6.5)
13 725 11 48 777 523 254 63.5 4 (10.5)
14 1461 15 68 1537 1067 470 117.5 4 (14.5)
15 2453 19 88 2553 1803 750 187.5 4 (18.5)
16 3701 23 108 3825 2731 1094 273.5 4 (22.5)
Table 1: Data attached to the polynomials a,ba,\ b in the 1st family of examples
ex.
nbr.
​​​​𝖣𝖤𝖦\mathsf{DEG}​​​​ ​​​​​​​​ degy(a)=degy(b)\begin{array}[]{c}\deg_{y}(a)\\ =\deg_{y}(b)\end{array} ​​​​​​​​ ​​​​​​​​ tdeg(a)=tdeg(b)\begin{array}[]{c}\mathrm{tdeg}(a)\\ =\mathrm{tdeg}(b)\end{array} ​​​​​​​​
degree
resultant
deg. multi-
plicity 1
deg. multi-
plicity >>1
avg. multi-
plicity >>1
#lexGbs
(avg. #poly.)
1 827 7 90 1079 617 462 6.5 7 (5)
2 1301 8 119 1665 979 686 24.5 7 (6)
3 1887 9 148 2363 1425 938 33.5 7 (7)
4 2585 10 177 3173 1955 1218 43.5 7 (8)
5 3395 11 206 4095 2569 1526 54.5 7 (9)
6 4317 12 235 5129 3267 1862 66.5 7 (10)
Table 2: Data attached to the polynomials a,ba,\ b in the 2nd family of examples

6.2 Timings

Tables 3-4 display timings for the first family of 16 polynomials described in Section 6.1 (see also Table 1). The double horizontal lines separate the four polynomials TT which have two primary factors, from the seven polynomials TT that have three, and from the last five polynomials TT which have four primary factors. Tables 5-6 show the timings for the second family of 6 polynomials described in Section 6.1 (see also Table 2). We remark that the polynomials aa and bb do not have solutions at infinity: gcd(𝗅𝖼(a),𝗅𝖼(b))=1\mathrm{gcd}(\mathsf{lc}(a),\mathsf{lc}(b))=1. The four tables all have eight columns. They represent:

Description of Tables 3-4-5-6

  1. Column 1:

    timing of the algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” with input a,b,Ta,\ b,\ T.

  2. Column 2:

    timing of GroebnerBasis([a,b,T])([a,b,T]) command in Magma: F4++FGLM with FGLM in parenthesis when not negligible.

  3. Column 3:

    timing for the resultant computation r(x):=Resy(a,b)r(x):=\mathrm{Res}_{y}(a,b)

  4. Column 4:

    timing for Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” with input a,b,ra,\ b,\ r.

  5. Column 5:

    timing of GroebnerBasis([a,b])([a,b]) command in Magma: F4++FGLM with FGLM in parenthesis when not negligible.

  6. Column 6:

    timing for the squarefree decomposition of r=R1e1Rsesr=R_{1}^{e_{1}}\cdots R_{s}^{e_{s}}. Here, RiR_{i} is the product of those irreducible factors of the resultant RR that come with the same multiplicity eie_{i}.

  7. Column 7:

    total time taken for calling Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” on input (a,b,Riei)(a,\ b,\ R_{i}^{e_{i}}) for i=1,,si=1,\ldots,s.

  8. Column 8:

    total time taken for calling GroebnerBasis([a,b,Riei])([a,\ b,\ R_{i}^{e_{i}}]) for i=1,,si=1,\ldots,s.

1 2 3 4 5 6 7 8
Input: a,b,Ta,b,T Input: a,b,Resy(a,b)a,b,\mathrm{Res}_{y}(a,\ b) Input: a,ba,b Several input: a,b,Rieia,b,R_{i}^{e_{i}}
this Gb(fglm) res this Gb(fglm) sqf dec this Gb(fglm)
0.01 0 0 0.13 0.04 (0.029) 0.01 0.02 0.13(0.02)
0 0.03 0.02 2.32 0.33 (0.279) 0 0.26 0.96(0.18)
0.01 0.1 (0.009) 0.04 12.45 1.8 (1.679) 0.01 1.34 5.21(1.06)
0.02 0.36 (0.05) 0.11 48.62 6.28 (6) 0.01 5.02 14.5(3.929
0 0.01 0.01 0.08 0.06 (0.03) 0 0.02 0.2(0.02)
0 0.03 0 0.69 0.26 (0.219) 0.01 0.09 0.93(0.129)
0.01 0.1 (0.02) 0.03 2.69 0.96 (0.849) 0.01 0.34 3.79(0.509)
0.01 0.23 (0.039) 0.06 8.78 2.87 (2.65) 0.01 0.99 9.54(1.62)
0.02 0.48 (0.079) 0.1 23.58 6.96 (6.5) 0.01 2.4 22.17(4.299)
0.02 1.09 (0.17) 0.19 55.05 15.44 (14.629) 0.02 5.36 43.14(9.269)
0.03 2.06(0.3) 0.33 120.7 30.65(29.3) 0.02 11.1 40.67(17.6)
0 0.01 0 0.04 0.04 (0.03) 0 0.01 0.14(0.019)
0.01 0.07 (0.01) 0.02 0.94 0.48 (0.4) 0 0.11 2.33(0.219)
0.01 0.3 (0.039) 0.05 5.76 2.84 (2.509) 0.01 0.69 12.04(1.439)
0.01 1.07 (0.139) 0.14 23.15 10.69 (9.85) 0.02 2.41 39.24(5.92)
0.02 2.71(0.37) 0.31 76.49 30.86(28.78) 0.02 7.1 47.88(18.33)
Table 3: First family over a finite field GF(p)GF(p), pp a 16bits prime
1 2 3 4 5 6 7 8
Input: a,b,Ta,b,T Input: a,b,Resy(a,b)a,b,\mathrm{Res}_{y}(a,\ b) Input: a,ba,b Several input: a,b,Rieia,b,R_{i}^{e_{i}}
this Gb(fglm) res this Gb(fglm) sqf dec this Gb(fglm)
0.01 0.02 0.04 2.28 0.25 (0.22) 0 0.28 0.44(0.13)
0.02 0.22 (0.02) 0.21 36.13 3.83 (3.649) 0.02 3 5.21(2.23)
0.04 1.23 (0.09) 0.74 174.69 27.56 (26.65) 0.05 17.36 32.49(18)
0.09 6.17 (0.33) 1.92 592.18 121.1 (118.009) 0.08 73.91 143.42(78.74)
0.01 0.05 (0.009) 0.05 1.28 0.39 (0.339) 0 0.21 0.87(0.2)
0.01 0.27 (0.019) 0.17 10.16 3.87 (3.6) 0.02 1.06 5.55(1.79)
0.03 1.2 (0.109) 0.47 36.48 20.48 (19.39) 0.04 4.19 23.41(8.9)
0.05 3.7 (0.339) 1 107.99 60.39 (57.279) 0.07 12.22 73.15(32.88)
0.09 6.76 (0.74) 2.06 277.45 169.11 (162) 0.13 33.37 205.93(102)
0.15 27.07 (2.039) 3.45 717.37 386.3 (370.8) 0.18 77.88 508.07(245)
0.22 60.91 (4.5) 5.72 1403.83 793.41 (763.609) 0.27 166.48 939.93(513)
0.01 0.04 (0.01) 0.04 0.65 0.29 (0.239) 0.01 0.13 0.71(0.15)
0.02 0.66 (0.059) 0.26 14.41 7.54 (6.88) 0.03 1.34 15.18(4.7)
0.04 5.42 (0.399) 0.98 83.5 62.34 (58.05) 0.06 7.78 97.33(33.5)
0.09 25.44 (1.489) 2.59 296.32 273.9 (257.47) 0.14 30.87 429.38(165)
0.17 91.02 (6.909) 7 943.93 907.33 (856.36) 0.23 101.05 1383.59(624)
Table 4: First family over a finite field GF(p)GF(p), pp a 64bits prime
1 2 3 4 5 6 7 8
Input: a,b,Ta,b,T Input: a,b,Resy(a,b)a,b,\mathrm{Res}_{y}(a,\ b) Input: a,ba,b Several input: a,b,Rieia,b,R_{i}^{e_{i}}
this Gb(fglm) res this Gb(fglm) sqf dec this Gb(fglm)
0 0.77(0.03) 0.03 0.23 1.4(0.66) 0 0.06 5.09(0.36)
0 3.6(0.07) 0.07 0.63 5.1(2.39) 0.01 0.15 19.36 (1.289)
0.01 9.84(0.119) 0.13 1.53 13.08(5.969) 0.01 0.34 50.39 (3.289)
0.01 23.91(0.25) 0.23 3.16 30.47(13.699) 0.02 0.7 127.5 (7.5)
0.01 60.21(0.509) 0.37 6.32 64.96(28.7) 0.02 1.28 268(15.9)
0.02 115.72(0.97) 0.57 11.37 134.31(54.509) 0.03 2.28 527.95(27.8)
Table 5: Second family over a finite field GF(p)GF(p), pp a 16bits prime
1 2 3 4 5 6 7 8
Input: a,b,Ta,b,T Input: a,b,Resy(a,b)a,b,\mathrm{Res}_{y}(a,\ b) Input: a,ba,b Several input: a,b,Rieia,b,R_{i}^{e_{i}}
this Gb(fglm) res this Gb(fglm) sqf dec this Gb(fglm)
0.01 11.79 (0.149) 0.54 3.04 18.05(10.05) 0.04 0.86 87.28 (5.5)
0.02 90.69 (0.549) 1.29 8.27 91.21(43.519) 0.08 1.9 338.78 (20)
0.04 297.74(1.23) 2.52 18.73 243.46(135) 0.13 3.94 808.97 (60)
0.06 681.95(3.09) 4.44 37.28 560.26(326.289) 0.19 8.06 2186.52 (170)
0.09 2402 (7.8) 7.76 68.63 1375.74(899.62) 0.27 15.39 5101.74 (300)
0.13 5512.63(16.739) 12.67 134.43 2789(1909.229) 0.36 28.41 11789.98 (825)
Table 6: Second family over a finite field GF(p)GF(p), pp a 64bits prime

6.3 Comments on Tables 3-4-5-6

Columns 1-2

The Gröbner engine is unable to take full advantage of the addition of TT in the system. The comparison between the timings of the first two columns is telling: up to several thousands times faster and always more than one hundred times faster.

Columns 6-7-8

Taking the squarefree decomposition R1e1RsesR_{1}^{e_{1}}\cdots R_{s}^{e_{s}} of the resultant r=Resy(a,b)r=\mathrm{Res}_{y}(a,b) is cheap and natural. As one can expect, running Algorithm 12 on each factor found brings a clear advantage in any case, even in comparison with Column 5 F4++FGLM. This last experiment supports the conclusion that decomposing helps to alleviate the growth of internal computations.

Columns 3-4-5: preliminary comments

This is related to the computation of a lexGb of a bivariate system of two polynomials: the input is the system [a,b][a,\ b]. Column 3 displays timings (always negligible) for computing the resultant rr, and then Column 4 displays the timing taken by Algorithm 12 to find a product of lexGbs of a,b,r\langle a,\ b,\ r\rangle. This timing compares with that of GroebnerBasis([a,b])([a,b]) of Column 5. One question arises: is it faster to compute GroebnerBasis([a,b])([a,b]) or to compute GroebnerBasis([a,b,r])([a,b,r]) ? Experiments show that almost always the first is faster. That is why we have shown the timings of GroebnerBasis([a,b])([a,b]), rather than those GroebnerBasis([a,b,r])([a,b,r]) which are slower.

We observe that the situation is more balanced in this case. First the computation of rr is most often negligible. This suggests for future work to take advantage of its computation through a subresultant p.r.s of a,ba,b (not modulo a polynomial TT) and work directly on it. Second, the timings of the first family of polynomials (Tables 1-3-4 and rows 1-2-3 of Table 7) are slower in general, whereas those of the second family (Tables 2-5-6 and row 4 of Table 7) are better. To get an educated knowledge of this situation, which is of practical importance, let us provide more details.

6.4 Elements of complexity in case of input aa and bb

This section extends the above comment on the timings of Columns 3-4-5 of Tables 3-4-5-6 that concern an input aa and bb without a modulus TT. For clarity, Table 7 displays these data into 8 plots. Magma computes with F4 [20] a grevlex Gröbner basis and then applies FGLM [19] to transform it to a lexGb. The complexity of the latter is well-known, it is O(𝖣𝖤𝖦3)O(\mathsf{DEG}^{3}), where 𝖣𝖤𝖦=dimk(R[y]/a,b)\mathsf{DEG}=\dim_{k}(R[y]/\langle a,\ b\rangle) is the degree of the ideal generated by aa and bb. The complexity of the F4 algorithm is notoriously more difficult to analyze. Only the less efficient Lazard’s algorithm relying on Macaulay matrices has a known complexity upper bound, written in Eq. (27) below. The complexity results given hereafter can be found in [29] (see also [44, Section 1.5] for a nice overview and the references therein). The standard assumption in the context of [29] is:

aa and bb form a homogeneous regular sequence (R)

The examples of polynomials aa and bb in the testing suite are not homogeneous, but form a regular sequence. The complexity of Lazard’s method in the affine case is not well-understood. Nonetheless, the bounds for the homogenous case provide some indications for affine polynomials. We define the degree of regularity 𝖽reg\mathsf{d}_{\mathrm{reg}} of the ideal a,b\langle a,\ b\rangle, equal under (R) to be the smallest integer such that the Hilbert function of k[x,y]/a,bk[x,y]/\langle a,\ b\rangle becomes equal to the corresponding Hilbert polynomial. Then the number of arithmetic operations over kk to compute a grevlex Gröbner basis of a,b\langle a,\ b\rangle is lower than:

O((2+𝖽reg2)ω)=O(𝖽reg2ω)O\left(\binom{2+\mathsf{d}_{\mathrm{reg}}}{2}^{\omega}\right)=O(\mathsf{d}_{\mathrm{reg}}^{2\omega}) (27)

We refer to [52] for details about the exponent of linear algebra ω\omega. It is possibly overestimated in many situations. Considering that the Macaulay bound 𝖽reg=tdeg(a)+tdeg(b)1\mathsf{d}_{\mathrm{reg}}=\mathrm{tdeg}(a)+\mathrm{tdeg}(b)-1 holds under (R) we obtain:

O(tdeg(a)2ω+tdeg(a)ωtdeg(b)ω+tdeg(b)2ω)O(tdeg(a)2ω)O(\mathrm{tdeg}(a)^{2\omega}+\mathrm{tdeg}(a)^{\omega}\mathrm{tdeg}(b)^{\omega}+\mathrm{tdeg}(b)^{2\omega})\leq O(\mathrm{tdeg}(a)^{2\omega})

The latter inequality follows from degY(b)degy(a)\deg_{Y}(b)\leq\deg_{y}(a). Adding the cost of FGLM in 𝖣𝖤𝖦3\mathsf{DEG}^{3} yields:

O(tdeg(a)2ω+tdeg(a)ωtdeg(b)ω+tdeg(b)2ω+𝖣𝖤𝖦3)O(tdeg(a)2ω+𝖣𝖤𝖦3).O(\mathrm{tdeg}(a)^{2\omega}+\mathrm{tdeg}(a)^{\omega}\mathrm{tdeg}(b)^{\omega}+\mathrm{tdeg}(b)^{2\omega}+\mathsf{DEG}^{3})\leq O(\mathrm{tdeg}(a)^{2\omega}+\mathsf{DEG}^{3}). (28)

Even in the affine case, we can think that the time taken by F4 depends more on tdeg(a)\mathrm{tdeg}(a) and tdeg(b)\mathrm{tdeg}(b), whereas the one taken by FGLM depends exclusively on 𝖣𝖤𝖦\mathsf{DEG}. The comparison of the timings of the examples of the 1st family and of the 2nd one supports this claim:

  • Column 5 of Tables 3-4, as well as the plots in rows 1-2-3 of Table 7 in the 1st family show that FGLM occupies most of the computations. We observe that the ratio 𝖣𝖤𝖦/tdeg(a)\mathsf{DEG}/\mathrm{tdeg}(a) ranges from 10 to at least 36 (Table 1), putting a higher cost on FGLM.

  • Column 5 of Tables 5-6, as well as the plots in row 4 of Table 7 in the 2nd family shows that FGLM takes more or less half of the total time. We observe that the ratio 𝖣𝖤𝖦/tdeg(a)\mathsf{DEG}/\mathrm{tdeg}(a) ranges from 9 to around 18 (Table 1). The cost of FGLM is then less important.

[Uncaptioned image] [Uncaptioned image]
[Uncaptioned image] [Uncaptioned image]
[Uncaptioned image] [Uncaptioned image]
[Uncaptioned image] [Uncaptioned image]
Table 7: Input a,ba,b (Columns 3-4-5 of Tables 3-4-5-6). Timing against the degree 𝖣𝖤𝖦\mathsf{DEG} of the ideal. Left: 16bits field.  Right: 64bits field. Row 1: examples 1-4 of the 1st family. Row 2: examples 5-11 of the 1st family. Row 3: examples 12-16 of the 1st family. Row 4: examples of the 2nd family

In comparison, Algorithm 12𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” certainly has the subresultant as a central routine. The number of arithmetic operations in R=k[x]/TR=k[x]/\langle T\rangle to compute naively the subresultant p.r.s of aa and bb modulo TT, when divisions are possible, is well-known, upper-bounded by degy(a)degy(b)\deg_{y}(a)\deg_{y}(b). The number of arithmetic operations in kk for peforming naively any operation in RR is O(deg(T)2)O(\deg(T)^{2}). Thus the cost of computing the subresultant p.r.s modulo TT is within:

O(degy(a)degy(b)deg(T)2).O(\deg_{y}(a)\deg_{y}(b)\deg(T)^{2}). (29)

Without entering into details, other functions to make polynomials monic and to split the computations do increase the cost, but unlikely of a much higher magnitude compared to Eq (29). When T=Resy(a,b)T=\mathrm{Res}_{y}(a,b), the classical upper-bound [52, Thm. 6.22] degx(Resy(a,b))dx(degy(a)+degy(b))\deg_{x}(\mathrm{Res}_{y}(a,b))\leq d_{x}(\deg_{y}(a)+\deg_{y}(b)) where dx=max(degx(a),degy(b))d_{x}=\max(\deg_{x}(a),\ \deg_{y}(b)) yields:

O(dx2(degy(a)3degy(b)+degy(a)2degy(b)2+degy(a)degy(b)3))O(dx2degy(a)4).O(d_{x}^{2}(\deg_{y}(a)^{3}\deg_{y}(b)+\deg_{y}(a)^{2}\deg_{y}(b)^{2}+\deg_{y}(a)\deg_{y}(b)^{3}))\leq O(d_{x}^{2}\deg_{y}(a)^{4}). (30)

The latter inequality is deduced from degy(b)degy(a)\deg_{y}(b)\leq\deg_{y}(a). Thus the parameter degy(a)\deg_{y}(a) dominates the total cost.

  • Looking at Columns 3-4 of Table 1 (1st family), we observe that the ratio tdeg(a)/degy(a)\mathrm{tdeg}(a)/\deg_{y}(a) ranges from around 2 to 4, which is quite small. The estimate (28) involving tdeg(a)\mathrm{tdeg}(a) and the estimate (30) involving degy(a)\deg_{y}(a) suggest that F4 will spend less time than Algorithm 12.

  • Whereas this ratio in Columns 3-4 of Table 2 (2nd family) ranges from around 12 to 19, which is quite bigger. This indicates that Algorithm 12 will spend less time than F4.

This is certainly one main explanation behind the difference in the timings of “𝚂𝚞𝚋𝚛𝚎𝚜𝚃𝚘𝙶𝙱_𝙳𝟻\mathtt{SubresToGB\_D5}” and F4++FGLM observed in Columns 4-5 of Tables 3-4-5-6, and in Table 7.

7 Concluding Remarks

The new algorithms brought in this work open the way to various generalizations and some improvements.

Subresultant p.r.s of aa and bb

The line of works [25, 15, 6, 31, 34] that produces a triangular decomposition of the set of solutions (not ideal preserving) of aa and bb, works directly on the subresultant p.r.s of aa and bb. The present article requires a modulus TT and works on the p.r.s modulo TT. Although this kind of situations is necessary for more general incremental Euclidean algorithm-based decomposition methods, starting with the p.r.s of aa and bb directly is desirable. Besides the discussion of Section 6.4 suggests enhanced performances.

Decomposition along the yy-variable

In the case of a radical ideal, decomposing it along the yy-variable is well-known. This is a special instance of dynamic evaluation in two variables. It amounts to compute a “gcd” in yy of two bivariate polynomials. The inversions occurring in the coefficients ring k[x]k[x] required by the Euclidean algorithm are managed by dynamic evaluation in one variable, namely the xx-variable. In this way, dynamic evaluation in two variables boils down to that of one variable. To do the same for non-radical lexGbs, two complications occur: first, Hensel lifting comes into play to compensate the division required to make nilpotent polynomials non-nilpotent, second, the output may be a lexGb not necessarily a triangular set. Computing a certain decomposition (as introduced in [12]) of the ideal a,b,pe\langle a,\ b,\ p^{e}\rangle and decomposing a minimal lexGb of a,b,pe\langle a,\ b,\ p^{e}\rangle, necessarily along the yy-variable, does not differ much. Note that Lazard’s structural theorem applies in this situation too. This constitutes a necessary step towards the generalization of this work to more than two variables.

More than two variables

Besides a dynamic evaluation in two variables, a form of structure theorem for lexGbs of three variables or more becomes necessary. For now, it is known to hold in the radical case [22, 36], not sufficient for our purpose since we target non-radical ideals. Evidences that a broad class of non-radical lexGbs also holds a factorization pattern are coming out [54]. A key step in that direction lies in the development of CRT-based algorithms that reconstruct a lexGb from its primary components [13].

Beyond this first step, the idea would be a recursive algorithm on the number of variables in order to ultimately reduce to the bivariate case treated here.

Complexity

Instead of standard quadratic-time subresultant p.r.s, can half-gcd based algorithm be adapted ? This would motivate to analyze the complexity carefully. The work of [41] paves the way to this direction. However, the additional algorithms appearing here compared to [41], which is already quite sophisticated, complicate it furthermore, making the complexity analysis an interesting challenge.

References

  • [1] William Wells Adams and Philippe Loustaunau. An introduction to Gröbner bases. Number 3. American Mathematical Soc., 1994.
  • [2] Parisa Alvandi, Marc Moreno Maza, Éric Schost, and Paul Vrbik. A standard basis free algorithm for computing the tangent cones of a space curve. In CASC 2015 Proceedings, pages 45–60. Springer International Publishing, Cham, 2015.
  • [3] Winfried Auzinger and Hans J Stetter. An elimination algorithm for the computation of all zeros of a system of multivariate polynomial equations. In Numerical Mathematics Singapore 1988, pages 11–30. Springer, 1988.
  • [4] Daniel J Bates, Andrew J Sommese, Jonathan D Hauenstein, and Charles W Wampler. Numerically solving polynomial systems with Bertini. SIAM, 2013.
  • [5] Wieb Bosma, John Cannon, and Catherine Playoust. The Magma algebra system. I. The user language. Journal of Symbolic Computation, 24(3-4):235–265, 1997. Computational algebra and number theory (London, 1993).
  • [6] Yacine Bouzidi, Sylvain Lazard, Guillaume Moroz, Marc Pouget, Fabrice Rouillier, and Michael Sagraloff. Solving bivariate systems using rational univariate representations. Journal of Complexity, 37:34–75, 2016.
  • [7] Xavier Caruso. Numerical stability of Euclidean algorithm over ultrametric fields. Journal de Théorie des Nombres de Bordeaux, 29(2):503–534, 2017.
  • [8] Chengbo Chen and Marc Moreno Maza. Algorithms for computing triangular decompositions of polynomial systems. In Proceedings of ISSAC’11, pages 83–90, New York, NY, USA, 2011. ACM.
  • [9] Jin-San Cheng and Xiao-Shan Gao. Multiplicity-preserving triangular set decomposition of two polynomials. Journal of Systems Science and Complexity, 27(6):1320–1344, 2014.
  • [10] X. Dahan, M. Moreno Maza, É. Schost, and Y. Xie. On the complexity of the D5 principle. In Proc. of Transgressive Computing 2006, Granada, Spain, 2006.
  • [11] X. Dahan and É. Schost. Sharp estimates for triangular sets. In ISSAC 2004, pages 103–110. ACM Press, 2004.
  • [12] Xavier Dahan. Gcd modulo a primary triangular set of dimension zero. In Proceedings of ISSAC’17, pages 109–116, New York, NY, USA, 2017. ACM.
  • [13] Xavier Dahan. On the bit-size of non-radical triangular sets. In MACIS 2017, Vienna, Austria, November 15-17, 2017, Proceedings, pages 264–269, Cham, 2017. Springer International Publishing.
  • [14] Wolfram Decker, Gert-Martin Greuel, and Gerhard Pfister. Primary decomposition: algorithms and comparisons. In Algorithmic algebra and number theory, pages 187–220. Springer, 1999.
  • [15] Dimitrios I Diochnos, Ioannis Z Emiris, and Elias P Tsigaridas. On the asymptotic and practical complexity of solving bivariate systems over the reals. Journal of Symbolic Computation, 44(7):818–835, 2009.
  • [16] J. Della Dora, C. Dicrescenzo, and D. Duval. About a new method for computing in algebraic number fields. In EUROCAL ’85: Research Contributions from the European Conference on Computer Algebra-Volume 2, pages 289–290, London, UK, 1985. Springer-Verlag.
  • [17] D. Duval. Algebraic numbers: an example of dynamic evaluation. Journal of Symbolic Computation, 18(5):429–445, 1994.
  • [18] Ioannis Z Emiris and Victor Y Pan. Symbolic and numeric methods for exploiting structure in constructing resultant matrices. Journal of Symbolic Computation, 33(4):393 – 413, 2002.
  • [19] J. C. Faugère, P. Gianni, D. Lazard, and T. Mora. Efficient computation of zero-dimensional gröbner bases by change of ordering. Journal of Symbolic Computation, 16(4):329–344, 1993.
  • [20] Jean-Charles Faugère. A new efficient algorithm for computing Gröbner bases (F4). Journal of pure and applied algebra, 139(1-3):61–88, 1999.
  • [21] Jean-Charles Faugère. A new efficient algorithm for computing Gröbner bases without reduction to zero (F5). In Proceedings of the 2002 international symposium on Symbolic and algebraic computation, pages 75–83, 2002.
  • [22] B. Felszeghy, B. Ráth, and L. Rónyai. The lex game and some applications. Journal of Symbolic Computation, 41(6):663 – 681, 2006.
  • [23] P. Gianni, B. Trager, and G. Zacharias. Gröbner bases and primary decomposition of polynomial ideals. Journal of Symbolic Computation, 6:149–167, 1988.
  • [24] M. Giusti, G. Lecerf, and B. Salvy. A Gröbner free alternative for polynomial system solving. J. of Complexity, 17(2):154–211, 2001.
  • [25] Laureano González-Vega and M’hammed El Kahoui. An improved upper complexity bound for the topology computation of a real algebraic plane curve. Journal of Complexity, 12(4):527–544, 1996.
  • [26] Évelyne Hubert. Notes on triangular sets and triangulation-decomposition algorithms. I. Polynomial systems. In Symbolic and numerical scientific computation (Hagenberg, 2001), volume 2630 of Lecture Notes in Comput. Sci., pages 1–39. Springer, Berlin, 2003.
  • [27] Serge Lang. Algebra (revised third edition), volume 211 of Graduate Texts in Mathematics. Springer Science and Media, 2002.
  • [28] D. Lazard. Solving zero-dimensional algebraic systems. Journal of Symbolic Computation, 13:147–160, 1992.
  • [29] Daniel Lazard. Gröbner bases, Gaussian elimination and resolution of systems of algebraic equations. In J. A. van Hulzen, editor, Computer Algebra, pages 146–156, Berlin, Heidelberg, 1983. Springer Berlin Heidelberg.
  • [30] Daniel Lazard. Ideal bases and primary decomposition: case of two variables. Journal Symbolic Computation, 1(3):261–270, 1985.
  • [31] Sylvain Lazard, Marc Pouget, and Fabrice Rouillier. Bivariate triangular decompositions in the presence of asymptotes. Journal of Symbolic Computation, 82:123–133, 2017.
  • [32] F. Lemaire, M. Moreno Maza, and Y. Xie. The regularchains library. In Maple conference 2005, pages 355–368. I. Kotsireas Ed., 2005.
  • [33] Bang-He Li. A method to solve algebraic equations up to multiplicities via Ritt-Wu’s characteristic sets. Acta Analysis Functionalis Applicata, 2:97–109, 2003.
  • [34] Xin Li, Marc Moreno Maza, Raqeeb Rasheed, and Éric Schost. The modpn library: Bringing fast polynomial arithmetic into maple. Journal of Symbolic Computation, 46(7):841–858, 2011.
  • [35] Steffen Marcus, Marc Moreno Maza, and Paul Vrbik. On Fulton’s algorithm for computing intersection multiplicities. In CASC 2012, Proceedings, pages 198–211. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012.
  • [36] M. G. Marinari and T. Mora. A remark on a remark by Macaulay or enhancing Lazard structural theorem. Bull. Iranian Math. Soc., 29(1):1–45, 85, 2003.
  • [37] Esmaeil Mehrabi and Éric Schost. A softly optimal Monte Carlo algorithm for solving bivariate polynomial systems over the integers. Journal of Complexity, 34:78–128, 2016.
  • [38] B Mishra. Algorithmic Algebra. Text and monographs in Computer Science. Springer-Verlag, New York-Berlin-Heidelberg, 1993.
  • [39] T. Mora. Solving Polynomial Equation Systems I. The Kronecker-Duval Philosophy. Number 88 in Encyclopedia of Mathematics and its Applications. Cambridge University Press, 2003.
  • [40] M. Moreno Maza and R. Rioboo. Polynomial gcd computations over towers of algebraic extensions. In Proc. AAECC-11, pages 365–382. Springer, 1995.
  • [41] Guillaume Moroz and Éric Schost. A fast algorithm for computing the truncated resultant. In Proceedings of ISSAC’16, pages 341–348, New York, NY, USA, 2016. ACM.
  • [42] David R Musser. Multivariate polynomial factorization. Journal of the ACM (JACM), 22(2):291–308, 1975.
  • [43] Masayuki Noro. Modular dynamic evaluation. In Proceedings of the 2006 International Symposium on Symbolic and Algebraic Computation, ISSAC ’06, page 262–268, New York, NY, USA, 2006. Association for Computing Machinery.
  • [44] Spaenlehauer Pierre-Jean. Résolution de systèmes multi-homogènes et déterminantiels. PhD thesis, Université de Pierre et Marie Curie - Paris VI, 2012. https://members.loria.fr/PJSpaenlehauer/data/these_spaenlehauer.pdf.
  • [45] John M Pollard. Theorems on factorization and primality testing. Mathematical Proceedings of the Cambridge Philosophical Society, 76(3):521–528, 1974.
  • [46] Joseph-F. Ritt. Differential equations from an algebraic standpoint. Colloquiium publications of the AMS, 14, 1932.
  • [47] F. Rouillier. Solving zero-dimensional systems through the rational univariate representation. Appl. Algebra Eng. Commun. Computat., 9(5):433–461, 1999.
  • [48] Joris Van Der Hoeven and Grégoire Lecerf. Directed evaluation. Journal of Complexity, page 101498, 2020.
  • [49] Joris van der Hoeven and Grégoire Lecerf. Fast computation of generic bivariate resultants. Journal of Complexity, page 101499, 2020.
  • [50] Jan Verschelde. Algorithm 795: Phcpack: A general-purpose solver for polynomial systems by homotopy continuation. ACM Transactions on Mathematical Software (TOMS), 25(2):251–276, 1999.
  • [51] Gilles Villard. On computing the resultant of generic bivariate polynomials. In Proceedings of the 2018 ACM International Symposium on Symbolic and Algebraic Computation, ISSAC ’18, page 391–398, New York, NY, USA, 2018. Association for Computing Machinery.
  • [52] Jocahim von zur Gathen and Jürgen Gerhard. Modern computer algebra. Cambridge University Press, New York, NY, USA, 2003. Second Edition.
  • [53] Dongming Wang. Elimination Methods. Texts & Monographs in Symbolic Computation. Springer Vienna, 2012.
  • [54] Dongming Wang. On the connection between Ritt characteristic sets and Buchberger–Gröbner bases. Mathematics in Computer Science, 10(4):479–492, 2016.
  • [55] Wen-Tsu Wu. On zeros of algebraic equations - an application of Ritt principle. Kexue Tongbao, 5:1–5, 1986.

Appendix

In below, is proposed a version of the Chinese Remainder Theorem. Although probably not new, finding a precise reference appears to be not obvious.

Lemma 9.

Consider a family of ideals (I)L(I_{\ell})_{\ell\in L} of k[x,y]k[x,y] and a polynomial gk[x,y]g\in k[x,y]. Take a monic generator hh_{\ell} of (Ik[x])(I_{\ell}\cap k[x]) and assume that the polynomials hh_{\ell}’s are pairwise coprime. Then L(I+g)=(LI)+g\prod_{\ell\in L}(I_{\ell}+\langle g\rangle)=(\prod_{\ell\in L}I_{\ell})+\langle g\rangle.

Proof.

Write J=L(I+g)J=\prod_{\ell\in L}(I_{\ell}+\langle g\rangle). Let L1L2=LL_{1}\cup L_{2}=L be a partition of the set of indices LL and associate to it the ideal (L1I)g#L2(\prod_{\ell\in L_{1}}I_{\ell})\langle g\rangle^{\#L_{2}} where #L2\#L_{2} stands for the cardinal of L2L_{2}. We then have the equality of ideals:

J=partitions(L1,L2)ofL(L1I)g#L2.J=\sum_{{\rm partitions~{}}(L_{1},\ L_{2}){~{}\rm of~{}}L}\qquad(\prod_{\ell\in L_{1}}I_{\ell})\langle g\rangle^{\#L_{2}}. (31)

When L2=L_{2}=\emptyset, the ideal associated to the partition (L,)(L,\ \emptyset) of the set of indices LL is then A:=LIA:=\prod_{\ell\in L}I_{\ell}. As soon as L2L_{2}\not=\emptyset, the ideal associated to the partition (L1,L2)(L_{1},\ L_{2}) is (L1I)g#L2g(\prod_{\ell\in L_{1}}I_{\ell})\langle g\rangle^{\#L_{2}}\subset\langle g\rangle. Therefore we have:

Jg+A.J\subset\langle g\rangle+A.

Since AJA\subset J, it suffices to prove that gJg\in J. To this end, consider the monic polynomial hh_{\ell} generating the ideal Ik[x]I_{\ell}\cap k[x]. Let

H=L,h,for all L.H_{\ell^{\prime}}=\prod_{\ell\in L,\ \ell\not=\ell^{\prime}}h_{\ell},\qquad\text{for all }\ell^{\prime}\in L.

The polynomials HH_{\ell^{\prime}}s are product of polynomials coprime with hh_{\ell^{\prime}}, hence is coprime with hh_{\ell^{\prime}} hence invertible modulo hh_{\ell^{\prime}}. Write F:=H1modhF_{\ell^{\prime}}:=H_{\ell^{\prime}}^{-1}\bmod h_{\ell^{\prime}} in k[x]k[x] of degree smaller than that of hh_{\ell^{\prime}}. In particular degx(HF)<degx(Lh):=D\deg_{x}(H_{\ell^{\prime}}F_{\ell^{\prime}})<\deg_{x}(\prod_{\ell\in L}h_{\ell}):=D for all L\ell^{\prime}\in L. We have:

LHF=1.\sum_{\ell\in L}H_{\ell}F_{\ell}=1. (32)

Indeed, the polynomial H=LHFH=\sum_{\ell\in L}H_{\ell}F_{\ell} is of degree in xx smaller than D:=degx(Lh)D:=\deg_{x}(\prod_{\ell\in L}h_{\ell}). Because H0modhH_{\ell^{\prime}}\equiv 0\bmod h_{\ell} as soon as \ell^{\prime}\not=\ell, we have HHFmodhH\equiv H_{\ell}F_{\ell}\bmod h_{\ell} and since FH1modhF_{\ell}\equiv H_{\ell}^{-1}\bmod h_{\ell} we have HF1modhH_{\ell}F_{\ell}\equiv 1\bmod h_{\ell}, whence H1modhH\equiv 1\bmod h_{\ell}. Since the hh_{\ell} are pairwise coprime, the Chinese remainder theorem implies that H1mod(Lh)H\equiv 1\bmod(\prod_{\ell\in L}h_{\ell}). But since degx(H)<D\deg_{x}(H)<D this means H=1H=1. This ends the proof of Eq. (32).

Consider the partitions [(L{},{})]L[(L\setminus\{\ell\},\ \{\ell\})]_{\ell\in L} of LL. Their associated ideals are (L,I)g(\prod_{\ell^{\prime}\in L,\ \ell^{\prime}\not=\ell}I_{\ell^{\prime}})\langle g\rangle, for L\ell\in L. Observe that Hg(L,I)gH_{\ell}g\in(\prod_{\ell^{\prime}\in L,\ \ell^{\prime}\not=\ell}I_{\ell^{\prime}})\langle g\rangle, hence HFg(L,I)gH_{\ell}F_{\ell}g\in(\prod_{\ell^{\prime}\in L,\ \ell^{\prime}\not=\ell}I_{\ell^{\prime}})\langle g\rangle. Therefore LHFgL(L,I)g\sum_{\ell\in L}H_{\ell}F_{\ell}g\in\sum_{\ell\in L}(\prod_{\ell^{\prime}\in L,\ \ell^{\prime}\not=\ell}I_{\ell^{\prime}})\langle g\rangle. By Eq. (32), we obtain gL(L,I)gg\in\sum_{\ell\in L}(\prod_{\ell^{\prime}\in L,\ \ell^{\prime}\not=\ell}I_{\ell^{\prime}})\langle g\rangle. Finally, Eq. (31) shows that gJg\in J. ∎