aa r X i v : . [ c s . S C ] M a y A Tropical F5 algorithm
Tristan Vaccon ∗ , Kazuhiro Yokoyama † Abstract
Let K be a field equipped with a valuation. Tropical varieties over K can be defined with a theory of Gröbner bases taking into accountthe valuation of K . While generalizing the classical theory of Gröbnerbases, it is not clear how modern algorithms for computing Gröbnerbases can be adapted to the tropical case. Among them, one of themost efficient is the celebrated F5 Algorithm of Faugère.In this article, we prove that, for homogeneous ideals, it can beadapted to the tropical case. We prove termination and correctness.Because of the use of the valuation, the theory of tropical Gröb-ner bases is promising for stable computations over polynomial ringsover a p -adic field. We provide numerical examples to illustrate time-complexity and p -adic stability of this tropical F5 algorithm. The theory of tropical geometry is only a few decades old. It has neverthe-less already proved to be of significant value, with applications in algebraicgeometry, combinatorics, computer science, and non-archimedean geometry(see [MS15], [EKL06]) and even attempts at proving the Riemann hypothesis(see [C15]).Effective computation over tropical varieties make decisive usage of Gröb-ner bases, but before Chan and Maclagan’s definition of tropical Gröbnerbases taking into account the valuation in [C13, CM13], computations were ∗ Université de Limoges, [email protected] † Rikkyo University, [email protected] Q , we aim at computation over fields with valuation that mightnot be effective, such as Q p or Q (( t )) . Indeed, in [V15], the first author hasstudied the computation of tropical Gröbner bases over such fields through aMatrix-F5 algorithm. For some special term orders, the numerical stabilityis then remarkable. Hence, our second objective in designing a tropical F5algorithm is to pave the way for an algorithm that could at the same timebe comparable to the fast methods for classical Gröbner bases, have a termi-nation criterion and still benefit from the stability that can be obtained fortropical Gröbner bases.
We refer to the book of Maclagan and Sturmfels [MS15] for an introductionto computational tropical algebraic geometry.The computation of tropical varieties over Q with trivial valuation isavailable in the Gfan package by Anders Jensen (see [Gfan]), by using stan-dard Gröbner bases computations. Yet, for computation of tropical varietiesover general fields, with non-trivial valuation, such techniques are not read-ily available. Then Chan and Maclagan have developed in [CM13] a way toextend the theory of Gröbner bases to take into account the valuation andallow tropical computations. Their theory of tropical Gröbner bases is effec-tive and allows, with a suitable division algorithm, a Buchberger algorithm.Following their work, a Matrix-F5 algorithm has been proposed in [V15]. Let G ′ be a finite subset of homogeneous polynomials of A := k [ X , . . . , X n ] for k a field with valuation. We assume that G ′ is a tropical Gröbner basis e.g. Q or Q p with p -adic valuation, or Q [[ X ]] with X -adic
2f the ideal I ′ it spans for a given tropical term order ≤ . Let f ∈ A behomogeneous. We are interested in computing a tropical Gröbner basis of I = I ′ + h f i . In this homogeneous context, following Lazard [L83], we canperform computations in I d = I ∩ k [ X , . . . , X n ] d . I d can be written as a vectorspace as I d = h x α f , | x α | + | f | = d i + I ′ d , with | | denoting total degree. Thesecond summand is already well-known as G ′ is a tropical Gröbner basis.Thanks to this way of writing the first summand, we can then filtrate thevector space I d by ordering the possible x α . The main idea of the F5 algorithmof Faugère [F02] is to use knowledge of this filtration to prevent unnecessarycomputations. Our main result is then:
Theorem 1.1.
The Tropical F5 algorithm (Algorithm 1 on page 18) com-putes a tropical Gröbner basis of I. If f is not a zero-divisor in A/I ′ thenno polynomial reduces to zero during the computation. Let k be a field with valuation val. The polynomial ring k [ X , . . . , X n ] will bedenoted by A. Let T be the set of monomials of A. For u = ( u , . . . , u n ) ∈ Z n ≥ ,we write x u for X u . . . X u n n and | x u | for its degree. For d ∈ N , A d is the vectorspace of polynomials in A of degree d. Given a mapping f : U → V, Im ( f ) denote the image of f. For a matrix
M, Rows ( M ) is the list of its rows, and Im ( M ) denotes the left-image of M ( n.b. Im ( M ) = span ( Rows ( M ) ). For w ∈ Im ( val ) n ⊂ R n and ≤ a monomial order on A, we define ≤ a tropicalterm order as in the following definition: Definition 1.2.
Given a, b ∈ k ∗ and x α and x β two monomials in A , we write ax α ≥ bx β if val ( a ) + w · α < val ( b ) + w · β , or val ( a ) + w · α = val ( b ) + w · β and x α ≥ x β .This is a total term order on A. We can then define accordingly for f ∈ A its highest term, denoted by LT ( f ) , and the corresponding monomial LM ( f ) . These defintions extend naturally to LM ( I ) and LT ( I ) for I an ideal of A. Atropical Gröbner bases of I (see [CM13, V15]) is then a subset of I such thatits leading monomials generate as a monoid LM ( I ) . We denote by
N S ( I ) the set of monomials T \ LM ( I ) . We will write occasionally tropical GB .Let G ′ be a finite subset of homogeneous polynomials of A that is atropical Gröbner basis of the ideal I ′ it spans. Let f ∈ A be homogeneous.We are interested in computing a tropical Gröbner basis of I = I ′ + h f i . cknowledgements We thank Jean-Charles Faugère, Pierre-Jean Spaenlehauer, Masayuki Noro,Naoyuki Shinohara and Thibaut Verron for fruitful discussions.
Contrary to the Buchberger or the F4 algorithm, the F5 algorithm relies ontags attached to polynomial so as to avoid unnecessary computation thanksto this extra information. Those tags are called signature , and they aredecisive for the F5 criterion, which is one of the main ingredients of the F5algorithm.In this section, we provide a definition for the notion of signature we needfor the F5 algorithm and deduce some of its first properties.
Definition 2.1 (Syzygies) . Let v be the following k -linear map defined bythe multiplication by f : v : A → A/I ′ f . Let
Syz f = Ker ( v ) , LM ( Syz f ) be the leading monomials of the polynomi-als in Syz f and N S ( Syz f ) = T \ LM ( Syz f ) the normal set of monomialsfor the module of syzygies. Proposition 2.2. h v ( N S ( Syz f )) i = Im ( v ) . Proof.
We can prove this claim degree by degree. The method is quitesimilar to what was developped in Section 3.2 of [V15]. Let d ∈ N . Let α , . . . , α u be LM ( Syz f ) ∩ A d . Let f α , . . . , f α u ∈ A d be such that for all i, f α i ∈ Ker ( v ) and LM ( f α i ) = α i . Then, written in the basis U d =( LM ( Syz f ) ∩ A d ) ∪ ( N S ( Syz f ) ∩ A d ) , f α , . . . , f α u is under (row)-echelonform. Let g α , . . . , g α u ∈ A d be the corresponding reduced row-echelon form:we have LM ( g α i ) = α i , g α i ∈ Ker ( v ) and the only monomial of g α i not in N S ( Syz f ) is α i . Now, clearly, if f ∈ A d , by reduction by the g α i ’s, thereexists some g ∈ A d such that v ( f ) = v ( g ) and LM ( g ) ∈ N S ( Syz f ) . Remark 2.3.
Clearly, LM ( I ′ ) ⊂ LM ( Syz f ) , and this is an equality if f isnot a zero-divisor in A/I ′ .
4e can now proceed to define the notion of signature. It relies on aspecial order on the monomials of A , which is not a monomial order: Definition 2.4.
Let x α and x β be monomials in T. We write that x α ≤ sign x β if: 1. if | x α | < | x β | .
2. if | x α | = | x β | , x α ∈ N S ( Syz f ) and x β / ∈ N S ( Syz f ) .
3. if | x α | = | x β | , x α , x β ∈ N S ( Syz f ) and x α ≤ x β
4. if | x α | = | x β | , x α , x β / ∈ N S ( Syz f ) and x α ≤ x β . Proposition 2.5. ≤ sign defines a total order on T. It is degree-refining. Ata given degree, any x α in LM ( I ′ ) or LM ( Syz f ) is bigger than any x β / ∈ LM ( Syz f ) . We can define naturally LM sign ( g ) for any g ∈ A. We should remark thatin the general case, LM sign ( g ) = LM ( g ) . Definition 2.6 (Signature) . For p ∈ I, using the convention that LM sign (0) =0 , we define the signature of p, denoted by S ( p ) , to be S ( p ) = min ≤ sign { LM sign ( g ) for g ∈ A s.t. ( g f − p ) ∈ I ′ } . Proposition 2.7.
The signature is well-defined.
Remark 2.8.
Clearly, p ∈ I ′ if and only if S ( p ) = 0 . Similarly, if f / ∈ I ′ then S ( f ) = 1 . Remark 2.9.
This definition is an extension to the tropical case of that of[F15]. For trivial valuation, it coincides (after projection on last component)with that of [AP, F02] for elements in I \ I ′ . We have modified it to ensurethat the signature takes value in ( T \ LM ( I ′ )) ∪ { } , see Prop. 2.11 below.With the fact that we can decompose an equality by degree, we have thefollowing lemma: Lemma 2.10. If p ∈ I \ I ′ is homogeneous of degree d, then deg( S ( p )) =deg( p ) − deg( f ) . roposition 2.11. For any p ∈ I \ I ′ , S ( p ) ∈ N S ( Syz f ) . Proof.
This is a direct consequence of Proposition 2.2.This proposition can be a little refined.
Lemma 2.12.
Let t ∈ T, f ∈ I \ I ′ then S ( tf ) = tS ( f ) ⇔ tS ( f ) ∈ N S ( Syz f ) S ( tf ) < sign tS ( f ) ⇔ tS ( f ) ∈ LM ( Syz f ) . Proof.
Let S ( f ) = σ. By definition of S, we have f = ασf + gf + h with α ∈ k ∗ = k \ { } , LM ( g ) < sign ασ and h ∈ I ′ . If tσ ∈ N S ( Syz f ) , thenwe get directly that the leading term of the normal form (modulo G ′ ) of αtσf + tgf + th is tσ and in this case S ( tf ) = tσ = tS ( f ) , otherwise we canprovide a syzygy. In the other case, the normal form has a strictly smallerleading term, and we get that S ( tf ) < sign tS ( f ) . We then have the following property, and two last lemmas to understandthe behaviour of signature.
Proposition 2.13.
The following mapping Φ is a bijection : Φ : LM ( I ) \ LM ( I ′ ) → N S ( Syz f ) x α min ≤ sign { S ( x α + g ) , with g s.t. x α + g ∈ I and LT ( g ) < x α } , Proof.
It can be proved directly by computing a tropical row-echelon formof some Macaulay matrix (see Definition 4.4).
Lemma 2.14.
Let f , f ∈ I \ I ′ be such that LM ( f ) > LM ( f ) and S ( f ) = S ( f ) = σ. Then there exist α, β ∈ k ∗ such that S ( αf + βf ) < sign σ. Lemma 2.15.
Let f , f ∈ I be such that S ( f ) > S ( f ) . Then for any α ∈ k ∗ , β ∈ k, S ( αf + βf ) = S ( f ) . Tropical S -Gröbner bases The notion of signature allows the definition of a natural filtration of thevector space I by degree and signature: Definition 3.1 (Filtration by signature) . For d ∈ Z ≥ and x α ∈ T ∩ I d , wedefine the vector space I d, ≤ x α := { f ∈ I d , S ( f ) ≤ x α } . Then we define the filtration by signature, I = ( I d, ≤ x α ) d ∈ Z ≥ , x α ∈ T ∩ I d . Our goal in this section and the following is to define tropical Gröbnerbases that are compatible with this filtration by signature. It relies on thenotion of S -reduction and irreducibility. Definition 3.2 ( S -reduction) . Let f, g ∈ I, h ∈ I and σ ∈ T. We say that f S -reduces to g with respect to σ and with h,f → h S ,σ g if there are t ∈ T and α ∈ k ∗ such that: • LT ( g ) < LT ( f ) , LM ( g ) = LM ( f ) and f − αth = g and • S ( th ) < sign σ. If σ is not specified, then we mean σ = S ( f ) . It is then natural to define what is an S -irreducible polynomial. Definition 3.3 ( S -irreducible polynomial) . We say that f ∈ I is S -irreduciblewith respect to σ ∈ T, or up to σ, if there is no h ∈ I which S -reduces itwith respect to σ. If σ is not specified, then we mean σ = S ( f ) . If there isno ambiguity, we might omit the S − . Remark 3.4.
This definition clearly depends on
I, I ′ , and the given mono-mial ordering.In order to better understand what are S -irreducible polynomials, wehave the following: Theorem 3.5.
Let f ∈ I and x α ∈ T such that: f is S -irreducible with respect to x α , • f = ( cx α + u ) f + h with c ∈ k, u ∈ A with LT ( u ) < cx α , h ∈ I ′ . Then f = 0 if and only if x α ∈ LM ( Syz f ) . Moreover, if f = 0 , then x α = S ( f ) = Φ( LM ( f )) . Proof.
Suppose f = 0 , then f = ( cx α + u ) f + h, hence x α ∈ LM ( Syz f ) . We prove the converse result by contradiction. We assume that f = 0 and x α ∈ LM ( Syz f ) . Let t = LM ( f ) and x β = Φ( t ) ∈ N S ( Syz f ) . We have x β < sign x α . There exists g ∈ I such that LM ( g ) = t and S ( g ) = x β . Since x β < x α , g is an S -reductor for f with respect to x α . This contradictsthe fact that f is irreducible. Hence f = 0 . For the additional fact when f = 0 , ssume x α ∈ N S ( Syz f ) . Then necessarily, x α = S ( f ) . Suppose nowthat x α = Φ( LM ( f )) . Then S ( f ) > Φ( LM ( f )) . Therefore there exists apolynomial g ∈ I such that t = LM ( g ) = LM ( f ) and Φ( t ) = S ( g ) =Φ( LM ( f )) < S ( f ) . It follows that g is an S -reductor of f, which leads to f being not S -irreducible. Corollary 3.6. If g ∈ I and x α ∈ T are such that x α g = 0 is S -irreducibleup to x α S ( g ) then S ( x α g ) = x α S ( g ) . The previous results show that the right notion of S -irreducibility for f a polynomial is up to S ( f ) . Nevertheless, the previous corollary can not beused for easy computation of the signatures of irreducible polynomials as wecan see on the following example:
Example 3.7.
We assume that z ∈ G ′ and z , x and x y ∈ N S ( I ′ ) . Weassume that we have h = xy + y z, h = x y z − y and h = x y + y such that S ( h ) = x y, S ( h ) = x and S ( h ) = z and all of them are S -irreducible. We assume that x > sign x y and Φ( x y z ) = x . Then, zh = yh + xh = x y z + y z. Its signature is xS ( h ) = x , and not z . With our assumptions, the polynomial zh is irreducible up to S ( zh ) = x , whereas up to z , it is not.In other words, it is possible that the polynomial x α f is irreducible, upto S ( x α f ) , even though S ( x α f ) < x α S ( f ) . We now have enough definitions to write down the notion of S -Gröbnerbases, which will be a computational key point for the F5 algorithm.8 efinition 3.8 (Tropical S -Gröbner basis) . We say that G ⊂ I is a tropical S -Gröbner basis (or tropical S − GB, or just S − GB for short when thereis no amibuity) of I with respect to G ′ , I ′ , and a given tropical term order if G ′ = { g ∈ G s.t. S ( g ) = 0 } and for each S -irreducible polynomial f ∈ I \ I ′ , there exists g ∈ G and t ∈ T such that LM ( tg ) = LM ( f ) and tS ( g ) = S ( f ) . Remark 3.9.
Unlike in Arri and Perry’s paper [AP], we ask for tS ( g ) = S ( f ) instead of the weaker condition S ( tg ) = S ( f ) . The main reason is to avoidmisshapes like that of Example 3.7. We can nevertheless remark that thanksto Lemma 2.12, then tS ( g ) = S ( f ) implies that S ( tg ) = tS ( g ) = S ( f ) . We prove in this Section that tropical S -Gröbner bases are tropical Gröb-ner bases, allowing one of the main ideas of the F5 algorithm: computetropical S -Gröbner basis instead of tropical Gröbner basis.To that intent, we use the following two propositions. Proposition 3.10.
A polynomial f is S -irreducible iff S ( f ) = Φ( LM ( f )) . Proof.
By definition, if S ( f ) = Φ( LM ( f )) , then clearly f is S -irreducible.Regarding to the converse, if S ( f ) > sign Φ( LM ( f )) , then there exists g ∈ I such that LM ( g ) = LM ( f ) and S ( g ) = Φ( LM ( f )) , and then g S -reduces f . Proposition 3.11. If G is a tropical S -Gröbner basis, then for any nonzero f ∈ I \ I ′ , there exists g ∈ G and t ∈ T such that: • LM ( tg ) = LM ( f ) • S ( tg ) = tS ( g ) = S ( f ) if f is irreducible, and S ( tg ) = tS ( g ) < sign S ( f ) otherwise.Hence, there is an S -reductor for f in G if f is not irreducible.Proof. If f is irreducible, this is a result of Definition 3.8.Let us assume that f is not S -irreducible. We take h S -irreducible suchthat LM ( h ) = LM ( f ) . Thanks to Proposition 3.10, it exists, and S ( h ) < sign S ( f ) . So h is an S -reductor of f. There are then t ∈ T and g ∈ G such that tLM ( g ) = LM ( h ) = LM ( f ) and tS ( g ) = S ( tg ) = S ( h ) . With Proposition3.10, tg is irreducible. The result is proved.9e can now prove the desired connection between tropical S -Gröbnerbases and tropical Gröbner bases. Proposition 3.12. If G is a tropical S -Gröbner basis, then G is a tropicalGröbner basis of I, for < . Proof.
Let t ∈ LM ( I ) \ LM ( I ′ ) . With Proposition 2.13, there exist σ ∈ N S ( Syz f ) such that Φ − ( σ ) = t and f ∈ I \ I ′ such that LM ( f ) = t and S ( f ) = σ. By Proposition 3.11, there exists g ∈ G, u ∈ T such that LM ( ug ) = LM ( f ) = t. Hence, the span of { LM ( g ) , g ∈ G } contains LM ( I ) \ LM ( I ′ ) , and G ⊃ G ′ . Therefore G is a tropical Gröbner basis of I. And we can also prove some finiteness result on tropical S -Gröbner bases,which can be usefully applied to the problem of the termination of the F5algorithm. Proposition 3.13.
Every tropical S -Gröbner basis contains a finite tropical S -Gröbner basis.Proof. Let G = { g i } i ∈ L be a tropical S -Gröbner basis. Let V : G → T ⊕ Tg i ( LM ( g i ) , S ( g i )) be a mapping. By Dickson’s lemma, there exists some finite set J ⊂ L suchthat the monoid generated by the image of V is generated by H = { g i } i ∈ J . We claim that H = H ∪ G ′ is a finite tropical S -Gröbner basis. We havetaken the union with G ′ to avoid any issue with G ′ being non-minimal. Let f ∈ I \ I ′ be an S -irreducible polynomial. Since G is a tropical S -Gröbnerbasis, there exists g i ∈ G and t ∈ T such that tS ( g i ) = S ( tg i ) = S ( f ) and tLM ( g i ) = LM ( tg i ) = LM ( f ) . If i ∈ J, we are fine. Otherwise, there existssome j ∈ J and u, v ∈ T such that LM ( g i ) = uLM ( g j ) and S ( g j ) = vS ( g j ) . Three cases are possible. If u = v, then t ′ = ut ∈ T satisfies t ′ LM ( g j ) = LM ( f ) and t ′ S ( g j ) = S ( f ) and we are fine. If u < sign v then t ′ = ut ∈ T satisfies t ′ LM ( g j ) = LM ( f ) and t ′ S ( g j ) < S ( f ) , contradicting the hypothesisthat f is S -irreducible. If u > sign v, then for t ′ = vt ∈ T, we can take some α ∈ k such that p = f − αt ′ g j satisfies LM ( p ) = LM ( f ) but S ( p ) < S ( f ) , contradicting the irreducibility of f. As a consequence, we have proved that H is a tropical S -Gröbner basis. 10he elements of H we have used are of special importance, hence we givethem a special name. Definition 3.14.
We say that a non-zero polynomial f ∈ I \ I ′ , S -irreducible(with respect to S ( f ) ), is primitive S -irreducible if there are no poly-nomials f ′ ∈ I \ I ′ and terms t ∈ T \ { } such that f ′ is S -irreducible, LM ( tf ′ ) = LM ( f ) and S ( tf ′ ) = S ( f ) . The proof of Proposition 3.13 implies that we can obtain a finite tropical S -Gröbner basis by keeping a subset of primitive S -irreducible polynomialswith different leading terms. Also, it proves there exists a finite tropical S -Gröbner basis with only primitive S -irreducible polynomials (in its I \ I ′ part). S -Gröbner bases When the initial polynomials from which we would like to compute a Gröbnerbasis are homogeneous, the connection between linear algebra and Gröbnerbases is well known.
Definition 4.1.
Let c n,d = (cid:16) n + d − n − (cid:17) , and B n,d = ( x d i ) ≤ i ≤ c n,d be themonomials of A d . Then for f , . . . , f s ∈ A homogeneous polynomials, with | f i | = d i , and d ∈ N , we define M ac d ( f , . . . , f s ) to be the matrix whose rowsare the polynomials x α i,j f i written in the basis B n,d of A d .We note that Im ( M ac d ( f , . . . , f s )) = h f , . . . , f s i ∩ A d . Theorem 4.2 ([L83]) . For an homogeneous ideal I = h f , . . . , f s i , ( f , . . . , f s ) is a Gröbner basis of I for a monomial order ≤ if and only if: for all d ∈ N ,written in a decreasingly ordered B n,d (according to ≤ ), M ac d ( f , . . . , f s ) contains an echelon basis of Im ( M ac d ( f , . . . , f s )) . By echelon basis , we mean the following Definition 4.3.
Let g , . . . , g r be homogeneous polynomials of degree d . Let M be the matrix whose i -th row is the row vector corresponding to g i writtenin B n,d . Then we say that ( g , . . . , g r ) is an echelon basis of Im ( M ) if thereis a permutation matrix P such that P M is under row-echelon form.11n other words, G = ( g , . . . , g s ) is a Gröbner basis of I if and only iffor all d, an echelon (linear) basis of I d is contained in the set { x α g i , i ∈ J , s K , x α ∈ T, | x α g i | = d } . We have an analogous property for tropical Gröbner bases and tropical S -GB. It follows from the study in [V15] of a tropical Matrix-F5 algorithm.We first need to adapt to the tropical setting the definitions of row-echelonform and echelon basis. Definition 4.4 (Tropical row-echelon form) . Let M be a l × m matrix whichis a Macaulay matrix, written in the basis B n,d of the monomials of A ofdegree d. We say that ( P, Q ) ∈ GL n ( k ) × GL m ( k ) , Q being a permutationmatrix, realize a tropical row-echelon form of M if:1. P M Q is upper-triangular and under row-echelon form.2. The first non-zero coefficient of a row corresponds to the leading termof the polynomial corresponding to this row.We can then define a tropical echelon basis : Definition 4.5 (Tropical echelon basis) . Let g , . . . , g r be homogeneous poly-nomials of degree d . Let M be the matrix whose i -th row is the row vectorcorresponding to g i written in B n,d . Then we say that g , . . . , g r is a tropicalechelon basis of a vector space V ⊂ A d if there are two permutation ma-trices P, Q such that
P M Q realizes a tropical row-echelon form of M and span ( Rows ( M )) = V. This can be adapted to the natural filtration of the vector space I by ( I d,x α ) d,x α we have defined in 3.1. Theorem 4.6.
Suppose that G is a set of S -irreducible homogeneous poly-nomials of the homogeneous ideal I such that { g ∈ G, S ( g ) = 0 } = G ′ . Then G is a tropical S -Gröbner basis of I if and only if for all x α ∈ T, taking d = | x α | + | f | , the set { x β g, irreducible s.t. g ∈ G, x β ∈ T, | x β g | = d, x β S ( g ) = S ( x β g ) ≤ x α } contains a tropical echelon basis of I d, ≤ x α . roof. Using Proposition 3.10, it is clear that if G satisfy the above-writtencondition, then it satisfies Definition 3.8 of tropical S -GB. The converse isalso easy using Proposition 3.11 on an echelon basis of I d, ≤ x α and remarkingthat to get an echelon basis, it is enough to reach all the leading monomialsof I d, ≤ x α . An easy consequence of the previous theorem is the following result ofexistence:
Proposition 4.7.
Given G ′ and f , consisting of homogeneous polynomials,there exists a tropical S -GB for I = h G ′ , f i . Proof.
It is enough to compute a tropical echelon basis for all the I d, ≤ x α , bytropical row-echelon form computation (see [V15]), and take the set of allthese polynomials.Even with Proposition 3.13, the idea of the proof of Proposition 4.7 isnot enough to obtain an efficient algorithm. This is why we introduce theF5 criterion and design an F5 algorithm. In this section, we explain a criterion, the F5 criterion, which yields anefficient algorithm to compute tropical Gröbner bases.We need a slightly different notion of S -pairs, called here normal pairs. Definition 5.1 (Normal pair) . Given g , g ∈ I, not both in I ′ , let Spol ( g , g ) = u g − u g be the S -polynomial of g and g , where u i = lcm ( LM ( g ) ,LM ( g )) LT ( g i ) . We say that ( g , g ) is a normal pair if:1. the g i ’s are primitive S -irreducible polynomials.2. S ( u i g i ) = LM ( u i ) S ( g i ) for i = 1 , . S ( u g ) = S ( u g ) . Remark 5.2.
With this definition, if ( g , g ) is a normal pair, using Lemma2.15, S ( Spol ( g , g )) = max( S ( u g ) , S ( u g )) holds. Moreover, if S ( u g ) >S ( u g ) then u = 1 as if otherwise, g would be an S -reductor of g . There-fore S ( Spol ( g , g )) > max ( S ( g ) , S ( g )) . heorem 5.3 (F5 criterion) . Suppose that G is a set of S -irreducible ho-mogeneous polynomials of I such that:1. { g ∈ G, S ( g ) = 0 } = G ′ .
2. if f / ∈ I ′ , there exists g ∈ G such that S ( g ) = 1 .
3. for any g , g ∈ G such that ( g , g ) is a normal pair, there exists g ∈ G and t ∈ T such that tg is S -irreducible and tS ( g ) = S ( tg ) = S ( Spol ( g , g )) . Then G is a S -Gröbner basis of I. Remark 5.4.
The converse result is clearly true.
Remark 5.5.
The g given in the second condition is primitive S -irreducible,by definition and using Lemma 2.10.Theorem 5.3 is an analogue of the Buchberger criterion for tropical S -Gröbner bases. To prove it, we adapt the classical proof of the Buchbergercriterion. We need three lemmas, the first two being very classical. Lemma 5.6.
Let P , . . . , P r ∈ A, c , . . . , c r ∈ k and β a term in A , σ ∈ T be such that for all i LC ( P i ) = 1 , LT ( c i P i ) = β, P i ∈ I and S ( P i ) ≤ σ. Let P = c P + · · · + c r P r . If LT ( P ) < β, then there exist some c i,j ∈ k such that P = P i,j c i,j Spol ( P i , P j ) and LT ( c i,j Spol ( P i , P j )) < β. Lemma 5.7.
Let x α , x β , x γ , x δ ∈ T and P, Q ∈ A be such that LM ( x α P ) = LM ( x β Q ) = x γ and x δ = lcm ( LM ( P ) , LM ( Q )) . Then
Spol ( x α P, x β Q ) = x γ − δ Spol ( P, Q ) . Lemma 5.8.
Let G be an S -Gröbner basis of I up to signature < σ ∈ T. Let f ∈ I, homogeneous of degree d , be such that S ( f ) ≤ σ. Then there exist r ∈ N , g , . . . , g r ∈ G, Q , . . . , Q r ∈ A such that for all i and x α a monomialof Q i , S ( x α g i ) = x α S ( g i ) ≤ σ and LT ( Q i g i ) ≤ LT ( f ) . The x α S ( g i ) ’s are alldistinct, when non-zero.Proof. It is clear by linear algebra. One can form a Macaulay matrix indegree d whose rows corresponds to polynomials τ g with τ ∈ T, g ∈ G suchthat S ( τ g ) = τ S ( g ) ≤ σ. Only one per non-zero signature, and each of themreaching an element of LM ( I d, ≤ σ ) . It is then enough to stack f at the bottomof this matrix and perform a tropical LUP form computation (see Algorithm3) to read the Q i on the reduction of f.
14e can now provide a proof of Theorem 5.3.
Proof.
We prove this result by induction on σ ∈ T such that G is an S -GBup to σ. It is clear for σ = 1 . Let us assume that G is an S -GB up to signature < σ for some some σ ∈ T. We can assume that all g ∈ G satisfy LC ( g ) = 1 . Let P ∈ I beirreducible and such that S ( P ) = σ. We prove that there is τ ∈ T, g ∈ G such that LM ( P ) = LM ( τ g ) and τ S ( g ) = σ. Our second assumption for G implies that there exist at least one prim-itive S -irreducible g ∈ G and some τ ∈ T such that τ S ( g ) = S ( f ) = σ. If LM ( τ g ) = LM ( f ) we are done. Otherwise, by Lemma 2.14, there exist some a, b ∈ k ∗ such that S ( af + bτ g ) = σ ′ for some σ ′ < sign σ. We can apply Lemma 5.8 to af + bτ g and obtain that there exist r ∈ N ,Q i ∈ A, g i ∈ G such that P = P ri =1 Q i g i , LT ( Q i g i ) ≤ P and for all i, and x γ monomial of Q i , the x γ S ( g i ) = S ( x γ g i ) ≤ sign σ are all distinct. We remarkthat LT ( P ) ≤ max i ( LT ( g i Q i )) . We denote by m i := LT ( g i Q i ) . Moreover, we can assume that all the g i ’s are primitive S -irreducible.Indeed, if among them some g ′ is not primitive S -irreducible, then thereexists h , t in I × T \ { } such that h is S -irreducible and LM ( t h ) = LM ( g ′ ) and t S ( h ) = S ( g ′ ) = S ( t h ) . We have S ( h ) ≤ sign S ( g ′ ) < sign σ. Hence, we can apply the S -GB property for h and we obtain g ′ , τ in G × T such that LM ( h ) = LM ( τ g ′ ) and S ( h ) = S ( τ g ′ ) = τ S ( g ′ ) . We then have LM ( g ′ ) = LM ( t τ g ′ ) and S ( g ′ ) = t τ S ( g ′ ) = S ( t τ g ′ ) , with deg( LM ( g ′ )) > deg( LM ( g ′ )) . As a consequence, this process can onlybe applied a finite number of times before we obtain a g ′ k ∈ G which isprimitive S -irreducible and some b ∈ T such that LM ( bg ′ k ) = LM ( τ g ) and bS ( g ′ k ) = S ( bg ′ k ) = σ ′ < sign σ = S ( τ g ) . Thus, we can assume that all the g i ’sare primitive S -irreducible.Among all such possible way of writing P as P ri =1 Q i g i , we define β asthe minimum of the max i ( LT ( g i Q i )) ’s. β exists thanks to Lemma 2.10 of[CM13].If LT ( P ) = β, then we are done. Indeed, there is then some i and τ inthe terms of Q i such that LT ( τ g i ) = β and S ( τ g i ) ≤ σ. We now show that LT ( P ) < β leads to a contradiction.15n that case, we can write that: P = X m i = β Q i g i + X m i <β Q i g i , = X m i = β LT ( Q i ) g i + X m i = β ( Q i − LT ( Q i )) g i + X m i <β Q i g i . As LT ( P ) < β and this is also the case for the two last summands in thesecond part of the previous equation, LT ( P m i = β LT ( Q i ) g i ) < β. We write LT ( Q i ) = c i x α i , with c i ∈ k and β = c x β for some c ∈ k. Thanks to Lemma5.6 and 2.14, there are some c j,k ∈ k and x βj,k = lcm ( LM ( g j ) , LM ( g k )) suchthat X m i = β LT ( Q i ) g i = X m i ,m j = β c j,k x β − β j,k Spol ( g j , g k ) . Moreover, we have for all j, k involved, S ( x β − β j,k Spol ( g j , g k )) ≤ σ and LT ( c j,k x β − β j,k Spol ( g j , g k )) < σ. If there is j, k such that S ( Spol ( g j , g k )) = σ, then, by the way the Q i were chosen (distinct signatures, multiplicativity of the signatures), the pair ( g j , g k ) is normal and the third assumption is enough to conclude.Otherwise, we have for all j, k involved, S ( Spol ( g j , g k )) < σ. We can applyLemma 5.8 to obtain c j,k x β − β j,k Spol ( g j , g k ) = P i Q j,ki g i such that for all i and x γ monomial of Q j,ki LT ( Q j,ki g i ) < β and x γ S ( g i ) = S ( x γ g i ) ≤ σ. All in all, we obtain some ˜ Q i such that P = P i ˜ Q i g i and for all iLT ( ˜ Q i g i ) < β. This contradicts with the definition of β as a minimum.So LT ( P ) = β, which concludes the proof. Remark 5.9.
This theorem holds for S -GB up to a given signature or, as wework with homogeneous entry polynomials, for S -GB up to a given degree( i.e. d − S -GB). Theorem 5.3 gives a first idea on how to do a Buchberger-style algorithm for S -GB. Yet, deciding in advance whether a pair is a normal pair does notseem to be easy. Indeed, the second condition require some knowledge on LM ( Syz f ) which we usually do not have. There are two natural ways to16andle this question: Firstly, we could keep track during the algorithm of thesyzygies encountered, and use a variable L as a place holder for their leadingmonomials. The second condition can then be replaced by LM ( u i ) S ( g i ) / ∈h L i . This is what is used in [AP]. Another way is to only consider the trivialsyzygies. This amounts to take h L i = LM ( I ′ ) and use the same replacementfor the second condition. This is what is used in [F02] and [F15].We opt for the second choice (only handling trivial syzygies). This giverise to the notion of admissible pair. Definition 6.1 (Admissible pair) . Given g , g ∈ I, not both in I ′ , let Spol ( g , g ) = u g − u g be the S -polynomial of g and g . We have u i = lcm ( LM ( g ) ,LM ( g )) LT ( g i ) . We say that ( g , g ) is an admissible pair if:1. the g i ’s are primitive S -irreducible polynomials.2. if S ( g i ) = 0 , then LM ( u i ) S ( g i ) / ∈ LM ( I ′ ) . S ( u g ) = S ( u g ) . We can then remark that handling admissible pairs instead of normalpairs is harmless, as the latter is a subset of the former.
Lemma 6.2.
If a set G satisfies the conditions of Theorem 5.3 for all itsadmissible pairs then it is an S -GB. In the general case, LM ( Syz f ) is not known in advance. However, itcan be determined inductively on signatures. This is how the followingalgorithm will proceed. From a polynomial g, the signature of x α g will be guessed as x α S ( g ) , and after an S -GB up to signature < x α S ( g ) is com-puted, we can decide whether S ( x α g ) = x α S ( g ) , or else x α g happens to bereduced to zero. In the following, we certify inductively whether for a pro-cessed x α g, the guessed signature x α S ( g ) equals the true signature S ( x α g ) . Similarly, guessed admissible pairs are inductively certified to be true ad-missibles pairs or not once condition 3 of 6.1 is certified. Using this idea, weprovide a first version of an F5 algorithm in Algorithm 1, using Algorithm 2for Symbolic Preprocessing.
Remark 6.3. Only signature zero is allowed to appear multiple times inthe matrix in construction. 17 lgorithm 1:
A first F5 algorithm input : G ′ a tropical GB of I ′ consisting of homogeneouspolynomials, f an homogeneous polynomial, not in I ′ output: A tropical S -GB G of I ′ + h f i G ← { (0 , g ) for g in G ′ } ; f ← f mod G ′ (classical reduction) ; G ← G ∪ { (1 , f ) } ; B ← { guessed admissible pairs of G } ; d ← ; while B = ∅ do P receives the pop of the guessed admissible pairs in B ofdegree d ; Write them in a Macaulay matrix M d , along with their S -reductors obtained from G (one per non-zero signature) by Symbolic-Preprocessing ( P, G ) (Algorithm 2); Apply
Algorithm 3 to compute the U in the tropical LUPform of M (no choice of pivot) ; Add to G all the polynomials obtained from f M that providenew leading monomial up to their signature ; Add to B the corresponding new admissible pairs ; d ← d + 1 ; Return G ; 18he reason is the following: because of Proposition 3.10, for an irreduciblepolynomial with a given signature, its leading monomial is determined by itssignature. After performing the tropical row-echelon form computation, allrows corresponds to irreducible polynomials, hence two rows produced withthe same signature are redundant: either they will produce the same leadingmonomial or they would reduce to zero. Algorithm 2:
Symbolic-Preprocessing input : P , a set of admissible pairs of degree d and G , a S -GB upto degree d − output: A Macaulay matrix of degree d D ← the set of the leading monomials of the polynomials in P ; C ← the set of the monomials of the polynomials in P ; U ← the polynomials of P ; while C = D do m ← max( C \ D ) ; D ← D ∪ { m } ; V ← ∅ ; for g ∈ G do if LM ( g ) | m then V ← V ∪ { ( g, mLM ( g ) ) } ; ( g, δ ) ← the element of V with δg of smallest signature , withtie-breaking by taking minimal δ (for degree then for ≤ sign ) ; U ← U ∪ { δg } ; D ← D ∪ { monomials of δg } ; M ← the polynomials of U, written in Macaulay matrix of degree d and ordered by increasing signature, with no repetition ofsignature outside of signature (choosing smallest leadingmonomial to break a tie of signature) ; Return M ;The tropical LUP form computation to obtain a row-echelon matrix, withno choice of pivot, is described in Algorithm 3. See [V15] for more details.The result we want to prove is then: Theorem 6.4.
Algorithm 1 computes an S -GB of I. lgorithm 3: The tropical LUP algorithm input : M , a Macaulay matrix of degree d in A , with n row rowsand n col columns, and mon a list of monomials indexingthe columns of M. output: f M , the U of the tropical LUP-form of M f M ← M ; if n col = 1 or n row = 0 or M has no non-zero entry then Return f M ; else for i = 1 to n row do Find j such that f M i,j has the greatest term f M i,j x mon j for ≤ of the row i ; Swap the columns and j of f M , and the and j entries of mon ; By pivoting with the first row, eliminates the coefficientsof the other rows on the first column; Proceed recursively on the submatrix f M i ≥ ,j ≥ ; Return f M ; 20 roof. Termination:
Assuming correctness, after (theoretically) perform-ing the algorithm for all degree d in N , we obtain an S -GB. Since by Propo-sition 3.13 all S -GB contain a finite S -GB then at some degree d we havecomputed a finite S -GB. As a consequence, all S -pairs from degree d + 1 todegree d (at most) will not yield any new polynomial in G (no new leadingmonomial), and thus there will be no S -pair of degree more than d, whichproves the termination of the algorithm. Correctness:
We proceed by induction on the signature to prove thatthe result of Algorithm 1 is a tropical S -GB. The result is clear for signature ≤ sign . For the induction step, we assume that the result is proved up to signature ≤ sign x α , with | x α f | = d. Let x β be the smallest guessed signature of M d ofsignature > sign x α . We first remark that if there are rows of guessed signature > sign x β thatare of true signature < sign x β then: We can conclude that there is nonormal pair popped from B with second half of a pair with signature x γ suchthat x α < sign x γ < sign x β because of condition 2 of Definition 5.1 (whichprevents such signature to drop). Using the F5 Criterion Theorem 5.3,it proves that we have in G (and the rows of M d up to signature x α thatare added to G ) an S -GB up to signature < sign x β . As a consequence,using Theorem 4.6 the Symbolic Preprocessing has produced exactly enoughrows of guessed (and true) signature < sign x β from G to S -reduce the rowof guessed signature x β . Indeed, since we have an S -GB up to < sign x β , all necessary leading monomials could be attained by product monomial-polynomial of G with guessed signature < sign x β or through the echelonform up to < sign x β of M d . The last consequence is of course also true ifthere is no such row with a gap between the guessed and the true signature.Two possibilities can occur for the result of the reduction of the row ofguessed signature x β : The row reduces to zero. Then the signature x β isnot possible. We then have in G an S -GB up to signature ≤ sign x β . Therow does not reduce to zero. Then, depending on whether the reduced rowprovide a new leading monomial for I ≤ sign x β , we add it to G. We then have in G an S -GB up to signature ≤ sign x β . This concludes the proof by induction.We then can apply the modified F5 Criterion, Lemma 6.2 to conclude thatthe output of Algorithm 1 is indeed an S -GB.To conclude the proof of Theorem 1.1, the main result on the efficiencyof the F5 algorithm is still valid for its tropical version:21 roposition 6.5. If f is not a zero-divisor in A/I ′ , then all the processedmatrices M d are (left-) injective. In other words, no row reduces to zero.Proof. In this case, LM ( Syz f ) = LM ( I ′ ) . Hence, with the choice of rows of M d avoiding guessed signature in LM ( Syz f ) no syzygy can be produced. Remark 6.6 (Rewritability) . Thanks to Theorem 5.3, it is possible to re-place the polynomials in P in the call to Symbolic-Preprocessing on Line8 of Algorithm 1. They can be replaced by any other multiple of element of G of the same signature. Indeed, if one of them, h, is of signature x α , thealgorithm computes a tropical S -Gröbner basis up signature < x α . Hence, h can be replaced by any other polynomial of same signature, it will be reducedto the same polynomial. By induction, it proves all of them can be replacedat the same time. This paves the way for the Rewritten techniques of [F02].The idea, as far as we understand it, is then to use the polynomial that hasbeen the most reduced to produce a polynomial of signature S ( tg ) for theupcoming reduction. Taking the x β g ( g ∈ G ) of signature x α such that g has the biggest signature possible is a first reasonnable idea. It actually canlead to a substantial reduction of the running time of the F5 algorithm.
A toy implementation of our algorithms in Sagemath [Sage] is available on https://gist.github.com/TristanVaccon . Remark 7.1.
It is possible to apply Algorithm 1 to compute a tropicalGröbner basis of I given by F = ( P , . . . , P s ) by performing complete com-putation succesively for ( P ) , ( P , P ) , ( P , P , P ) , . . . adding a polynomialat a time playing the part f played in the rest of the article. As we onlydeal with homogeneous polynomials, it is also possible to do the global com-putation degree by degree, and at a given degree iteratively on the initialpolynomials. By indexing accordingly the signatures, as in [F02], the algo-rithm can be adapted straightforwardly. This is what has been chosen in theimplementation we have achieved.We have gathered some numerical results in the following array. Timingsare in seconds of CPU time. We have compared ours with that of the Indeed, such a g is at first glance the most reduced possible. Everything was performed in a guest Ubuntu 14.04 inside a Virtual Machine, with 4processors and 29 GB of RAM. Q . Katsura 3 4 5 6 7 Cyclic 4 5 6[CM13] ≤ • • • • • • • [MY15] ≤ ≤ ≤ • • ≤ ≤ • Trop. F5 ≤ • • Loss in precision has also been estimated in the following setting. Fora given p, we take three polynomials with random coefficients in Z p (us-ing the Haar measure) in Q p [ x, y, z ] of degree ≤ d ≤ d ≤ d ≤ . For any given choice of d i ’s, we repeat the experiment 50 times. Coeffi-cients of the initial polynomials are all given at some high enough precision O ( p N ) . Coefficients of the output tropical GB are known at individual pre-cision O ( p N − m ) . We compute the total mean and max on those m ’s on theobtained tropical GB. Results are compiled in the following array as cou-ples of mean and max, with D = d + d + d − the Macaulay bound. w = [0 , , D = 4 p = 2 (.3,8) (.4,11) (.1,10) (.1,11) (.1,13) (.1,9) (.2,12)3 (.1,4) (.1,5) (.2,7) (.1,13) (.1,16) (.1,5) (0,6)101 (0,1) (0,0) (0,0) (0,1) (0,1) (0,0) (0,1)65519 (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) w = [1 , − , D = 4 p = 2 (.2,7) (.5,12) (3.3,45) (3.5,29) (3.7,24) (4.8,85) (4.8,86)3 (1.5,13) (1.2,9) (4.2,20) (3.6,19) (4.3,22) (6,33) (5.8,43)101 (.1,2) (.1,3) (.1,4) (.1,4) (0,3) (.2,5) (.3,6)65519 (0,0) (0,0) (0,0) (0,0) (0,0) (0,0) (0,0)As for Tropical Matrix-F5, a weight differing from w = [0 , , yieldsbigger loss in precision. Regarding to precision in row-reduction, in F5, thisweight always use the best pivot on each row. For Matrix-F5, it is always thebest pivot available in the matrix. In view of our data, we can observe thatthe loss in precision for Tropical F5 on these examples, even though it is,as expected, bigger, has remained reasonnable compared to the one of [V15]that allowed full choice of pivot. 23 Future works
In this article, we have investigated the main step for a complete F4-styletropical F5 algorithm. We would like to understand more deeply the Rewrit-ten critertion of [F02]. We would also like to understand the natural extensionof our work to a Tropical F4 and to a Tropical F5 for non-homogeneous entrypolynomials.
References [AP] Alberto Arri and John Perry. The F5 criterion revised. Journal of SymbolicComputation, 2011, plus corrigendum in 2017.[C13] Chan, Andrew J., Gröbner bases over fields with valuations and tropicalcurves by coordinate projections, PhD Thesis, University of Warwick, August2013.[CM13] Chan, Andrew J. and Maclagan, Diane Gröbner bases over fields withvaluations, http://arxiv.org/pdf/1303.0729 , 2013.[C15] Connes, Alain, An essay on the Riemann Hypothesis, http://arxiv.org/pdf/1509.05576 , 2015.[EKL06] Einsiedler, Manfred and Kapranov, Mikhail and Lind, Douglas Non-archimedean amoebas and tropical varieties, Journal für die reine und ange-wandte Mathematik (Crelles Journal), 2006.[F02] Jean-Charles Faugère. A new efficient algorithm for computing Gröbnerbases without reduction to zero (F5), Proceedings of the 2002 internationalsymposium on Symbolic and algebraic computation, ISSAC ’02, Lille, France.[F15] Jean-Charles Faugère. Résolution de systèmespolynomiaux en utilisant les bases de Gröbner, , 2015.[Gfan] Jensen, Anders N. Gfan, a software system forGröbner fans and tropical varieties, Available at http://home.imf.au.dk/jensen/software/gfan/gfan.html .[L83] Daniel Lazard. Gröbner-Bases, Gaussian Elimination and Resolution of Sys-tems of Algebraic Equations, Proceedings of the European Computer AlgebraConference on Computer Algebra, EUROCAL ’83. MS15] Maclagan, Diane and Sturmfels, Bernd, Introduction to tropical geome-try, Graduate Studies in Mathematics, volume 161, American MathematicalSociety, Providence, RI, 2015, ISBN 978-0-8218-5198-2.[MY15] Markwig, Thomas and Ren, Yue Computing tropical varieties over fieldswith valuation, http://arxiv.org/pdf/1612.01762