A Tropical F5 algorithm

Let K be a field equipped with a valuation. Tropical varieties over K can be defined with a theory of Gr{\"o}bner bases taking into account the valuation of K. While generalizing the classical theory of Gr{\"o}bner bases, it is not clear how modern algorithms for computing Gr{\"o}bner bases can be adapted to the tropical case. Among them, one of the most efficient is the celebrated F5 Algorithm of Faug{\`e}re. In this article, we prove that, for homogeneous ideals, it can be adapted to the tropical case. We prove termination and correctness. Because of the use of the valuation, the theory of tropical Gr{\"o}b-ner bases is promising for stable computations over polynomial rings over a p-adic field. We provide numerical examples to illustrate time-complexity and p-adic stability of this tropical F5 algorithm.


Introduction
The theory of tropical geometry is only a few decades old. It has nevertheless already proved to be of significant value, with applications in algebraic geometry, 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öbner bases, but before Chan and Maclagan's definition of tropical Gröbner bases taking into account the valuation in [C13,CM13], computations were only available over fields with trivial valuation where standard Gröbner bases techniques applied.
In this document, we show that following this definition, an F5 algorithms can be performed to compute tropical Gröbner bases.
Our motivations are twofold. Our first objective is to provide with the F5 algorithm a fast algorithm for tropical geometry purposes. Indeed, for classical Gröbner bases, the F5 algorithm, along with the F4, is recognized as among the fastest available nowadays.
Secondly, while our algorithms are valid and implemented for computations over Q, we aim at computation over fields with valuation that might not be effective, such as Q p or Q((t)). Indeed, in [V15], the first author has studied the computation of tropical Gröbner bases over such fields through a Matrix-F5 algorithm. For some special term orders, the numerical stability is then remarkable. Hence, our second objective in designing a tropical F5 algorithm is to pave the way for an algorithm that could at the same time be comparable to the fast methods for classical Gröbner bases, have a termination criterion and still benefit from the stability that can be obtained for tropical Gröbner bases.

Related works on tropical Gröbner bases
We refer to the book of Maclagan and Sturmfels [MS15] for an introduction to computational tropical algebraic geometry.
The computation of tropical varieties over Q with trivial valuation is available in the Gfan package by Anders Jensen (see [Gfan]), by using standard Gröbner bases computations. Yet, for computation of tropical varieties over general fields, with non-trivial valuation, such techniques are not readily available. Then Chan and Maclagan have developed in [CM13] a way to extend the theory of Gröbner bases to take into account the valuation and allow tropical computations. Their theory of tropical Gröbner bases is effective and allows, with a suitable division algorithm, a Buchberger algorithm. Following their work, a Matrix-F5 algorithm has been proposed in [V15].

Main idea and results
Let G ′ be a finite subset of homogeneous polynomials of A := k[X 1 , . . . , X n ] for k a field with valuation. 1 We assume that G ′ is a tropical Gröbner basis of the ideal I ′ it spans for a given tropical term order ≤ . Let f 1 ∈ A be homogeneous. We are interested in computing a tropical Gröbner basis of I = I ′ + f 1 . In this homogeneous context, following Lazard [L83], we can perform computations in I d = I ∩k[X 1 , . . . , X n ] d . I d can be written as a vector space as I d = x α f 1 , |x α | + |f 1 | = d + I ′ d , with | | denoting total degree. The second 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 the vector space I d by ordering the possible x α . The main idea of the F5 algorithm of Faugère [F02] is to use knowledge of this filtration to prevent unnecessary computations. Our main result is then: Theorem 1.1. The Tropical F5 algorithm (Algorithm 1 on page 18) computes a tropical Gröbner basis of I. If f 1 is not a zero-divisor in A/I ′ then no polynomial reduces to zero during the computation.

Notations
Let k be a field with valuation val. The polynomial ring k[X 1 , . . . , X n ] will be denoted by A. Let T be the set of monomials of A. For u = (u 1 , . . . , u n ) ∈ Z n ≥0 , we write x u for X u 1 1 . . . X un n and |x u | for its degree. For d ∈ N, A d is the vector space 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 ≤ 1 a monomial order on A, we define ≤ a tropical term order as in the following definition: Definition 1.2. Given a, b ∈ k * and x α and x β two monomials in A, we write 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. A tropical Gröbner bases of I (see [CM13,V15]) is then a subset of I such that its leading monomials generate as a monoid LM(I). We denote by NS(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 a tropical Gröbner basis of the ideal I ′ it spans. Let f 1 ∈ A be homogeneous. We are interested in computing a tropical Gröbner basis of I = I ′ + f 1 .

Signature
Contrary to the Buchberger or the F4 algorithm, the F5 algorithm relies on tags attached to polynomial so as to avoid unnecessary computation thanks to this extra information. Those tags are called signature, and they are decisive for the F5 criterion, which is one of the main ingredients of the F5 algorithm.
In this section, we provide a definition for the notion of signature we need for the F5 algorithm and deduce some of its first properties.
Definition 2.1 (Syzygies). Let v be the following k-linear map defined by the multiplication by f 1 : Let Syz f 1 = Ker(v), LM(Syz f 1 ) be the leading monomials of the polynomials in Syz f 1 and NS(Syz f 1 ) = T \ LM(Syz f 1 ) the normal set of monomials for the module of syzygies.
Proof. We can prove this claim degree by degree. The method is quite similar to what was developped in Section 3.2 of [V15] . . , f αu is under (row)-echelon form. Let g α 1 , . . . , g αu ∈ A d be the corresponding reduced row-echelon form: Remark 2.3. Clearly, LM(I ′ ) ⊂ LM(Syz f 1 ), and this is an equality if f 1 is not a zero-divisor in A/I ′ .
We can now proceed to define the notion of signature. It relies on a special 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: Proposition 2.5. ≤ sign defines a total order on T. It is degree-refining. At a given degree, any x α in LM(I ′ ) or LM(Syz f 1 ) is bigger than any x β / ∈ LM(Syz f 1 ).
We can define naturally LM sign (g) for any g ∈ A. We should remark that in 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 Proposition 2.7. The signature is well-defined.
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 ensure that the signature takes value in (T \ LM(I ′ )) ∪ {0} , see Prop. 2.11 below.
With the fact that we can decompose an equality by degree, we have the following lemma: Lemma 2.10. If p ∈ I \ I ′ is homogeneous of degree d, then deg(S(p)) = deg(p) − deg(f 1 ).
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 Proof. Let S(f ) = σ. By definition of S, we have f = ασf 1 + gf 1 + h with α ∈ k * = k \ {0}, LM(g) < sign ασ and h ∈ I ′ . If tσ ∈ NS(Syz f 1 ), then we get directly that the leading term of the normal form (modulo G ′ ) of αtσf 1 + tgf 1 + th is tσ and in this case S(tf ) = tσ = tS(f ), otherwise we can provide a syzygy. In the other case, the normal form has a strictly smaller leading term, and we get that S(tf ) < sign tS(f ).
We then have the following property, and two last lemmas to understand the behaviour of signature.
Proposition 2.13. The following mapping Φ is a bijection: Φ : Proof. It can be proved directly by computing a tropical row-echelon form of some Macaulay matrix (see Definition 4.4).

Tropical S-Gröbner bases
The notion of signature allows the definition of a natural filtration of the vector space I by degree and signature: Definition 3.1 (Filtration by signature). For d ∈ Z ≥0 and x α ∈ T ∩ I d , we define the vector space Then we define the filtration by signature, Our goal in this section and the following is to define tropical Gröbner bases that are compatible with this filtration by signature. It relies on the notion 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, if there are t ∈ T and α ∈ k * such that: 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-irreducible with respect to σ ∈ T, or up to σ, if there is no h ∈ I which S-reduces it with respect to σ. If σ is not specified, then we mean σ = S(f ). If there is no ambiguity, we might omit the S − .
Remark 3.4. This definition clearly depends on I, I ′ , and the given monomial ordering.
In order to better understand what are S-irreducible polynomials, we have the following: Theorem 3.5. Let f ∈ I and x α ∈ T such that: We prove the converse result by contradiction. We assume that f = 0 and Corollary 3.6. If g ∈ I and x α ∈ T are such that 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 be used for easy computation of the signatures of irreducible polynomials as we can see on the following example: Example 3.7. We assume that z 4 ∈ G ′ and z 3 , x 4 and x 2 y 2 ∈ NS(I ′ ). We assume that we have h 1 = xy 5 + y 5 z, h 2 = x 3 y 2 z − y 6 and h 3 = x 4 y 2 + y 6 such that S(h 1 ) = x 2 y, S(h 2 ) = x 3 and S(h 3 ) = z 3 and all of them are S-irreducible. We assume that x 4 > sign x 2 y 2 and Φ(x 4 y 2 z) = x 4 . Then, zh 3 = yh 1 + xh 2 = x 4 y 2 z + y 6 z. Its signature is xS(h 2 ) = x 4 , and not z 4 . With our assumptions, the polynomial zh 3 is irreducible up to S(zh 3 ) = x 4 , whereas up to z 4 , it is not.
In other words, it is possible that the polynomial We now have enough definitions to write down the notion of S-Gröbner bases, which will be a computational key point for the F5 algorithm.
Definition 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 there is 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 avoid misshapes like that of Example 3.7. We can nevertheless remark that thanks to 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öbner bases, allowing one of the main ideas of the F5 algorithm: compute tropical S-Gröbner basis instead of tropical Gröbner basis.
To that intent, we use the following two propositions.
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: 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 such that 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 Proposition 3.10, tg is irreducible. The result is proved.
We can now prove the desired connection between tropical S-Gröbner bases and tropical Gröbner bases.
Proposition 3.12. If G is a tropical S-Gröbner basis, then G is a tropical Gröbner basis of I, for < .
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 F5 algorithm.
Proposition 3.13. Every tropical S-Gröbner basis contains a finite tropical S-Gröbner basis.
be a mapping. By Dickson's lemma, there exists some finite set J ⊂ L such that the monoid generated by the image of V is generated by We claim that H = H 0 ∪ G ′ is a finite tropical S-Gröbner basis. We have taken 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öbner basis, 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 exists some 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 hypothesis that 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.
The elements of H 0 we have used are of special importance, hence we give them 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- 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 polynomials with 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).

Linear algebra and tropical S-Gröbner bases
When the initial polynomials from which we would like to compute a Gröbner basis are homogeneous, the connection between linear algebra and Gröbner bases is well known. . . , f s ) to be the matrix whose rows are the polynomials x α i,j f i written in the basis B n,d of A d . We note that Im(Mac d (f 1 , . . . , f s )) = f 1 , . . . , f s ∩ A d .  (f 1 , . . . , f s )).
By echelon basis, we mean the following Definition 4.3. Let g 1 , . . . , 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 written in B n,d . Then we say that (g 1 , . . . , g r ) is an echelon basis of Im(M) if there is a permutation matrix P such that P M is under row-echelon form.
In other words, G = (g 1 , . . . , g s ) is a Gröbner basis of I if and only if for all d, an echelon (linear) basis of I d is contained in the set {x α g i , i ∈ 1, s , 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-echelon form and echelon basis. 2. The first non-zero coefficient of a row corresponds to the leading term of the polynomial corresponding to this row.
We can then define a tropical echelon basis: Definition 4.5 (Tropical echelon basis). Let g 1 , . . . , 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 written in B n,d . Then we say that g 1 , . . . , g r is a tropical echelon basis of a vector space V ⊂ A d if there are two permutation matrices P, Q such that P MQ 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 polynomials 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 1 |, the set contains a tropical echelon basis of I d,≤x α .
Proof. Using Proposition 3.10, it is clear that if G satisfy the above-written condition, then it satisfies Definition 3.8 of tropical S-GB. The converse is also easy using Proposition 3.11 on an echelon basis of I d,≤x α and remarking that to get an echelon basis, it is enough to reach all the leading monomials of I d,≤x α .
An easy consequence of the previous theorem is the following result of existence: Proposition 4.7. Given G ′ and f 1 , consisting of homogeneous polynomials, there exists a tropical S-GB for I = G ′ , f 1 .
Proof. It is enough to compute a tropical echelon basis for all the I d,≤x α , by tropical row-echelon form computation (see [V15]), and take the set of all these polynomials.
Even with Proposition 3.13, the idea of the proof of Proposition 4.7 is not enough to obtain an efficient algorithm. This is why we introduce the F5 criterion and design an F5 algorithm.

Fcriterion
In this section, we explain a criterion, the F5 criterion, which yields an efficient 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 1 , g 2 ∈ I, not both in I ′ , let Spol(g 1 , g 2 ) = u 1 g 1 − u 2 g 2 be the S-polynomial of g 1 and g 2 , where u i = lcm(LM (g 1 ),LM (g 2 )) LT (g i ) . We say that (g 1 , g 2 ) is a normal pair if: 1. the g i 's are primitive S-irreducible polynomials.

Theorem 5.3 (F5 criterion).
Suppose that G is a set of S-irreducible homogeneous polynomials of I such that: 2. if f 1 / ∈ I ′ , there exists g ∈ G such that S(g) = 1.
3. for any g 1 , g 2 ∈ G such that (g 1 , g 2 ) 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 1 , g 2 )).
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 Buchberger criterion. We need three lemmas, the first two being very classical.
Lemma 5.6. Let P 1 , . . . , P r ∈ A, c 1 , . . . , 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 1 P 1 + · · · + c r P r . If LT (P ) < β, then there exist some c i,j ∈ k such that P = i,j c i,j Spol(P i , P j ) and LT (c i,j Spol(P i , P j )) < β.
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 1 , . . . , g r ∈ G, Q 1 , . . . , Q r ∈ A such that for all i and x α a monomial of Proof. It is clear by linear algebra. One can form a Macaulay matrix in degree d whose rows corresponds to polynomials τ g with τ ∈ T, g ∈ G such that S(τ g) = τ S(g) ≤ σ. Only one per non-zero signature, and each of them reaching an element of LM(I d,≤σ ). It is then enough to stack f at the bottom of this matrix and perform a tropical LUP form computation (see Algorithm 3) to read the Q i on the reduction of f.
We can now provide a proof of Theorem 5.3.
Proof. We prove this result by induction on σ ∈ T such that G is an S-GB up 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 be irreducible 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 primitive 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, 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 there exists h 0 , t 0 in I × T \ {1} such that h 0 is S-irreducible and LM(t 0 h 0 ) = LM(g ′ ) and t 0 S(h 0 ) = S(g ′ ) = S(t 0 h 0 ). We have S(h 0 ) ≤ sign S(g ′ ) < sign σ. Hence, we can apply the S-GB property for h 0 and we obtain g ′ 0 , τ 0 in G × T such that LM(h 0 ) = LM(τ 0 g ′ 0 ) and S(h 0 ) = S(τ 0 g ′ 0 ) = τ 0 S(g ′ 0 ). We then have LM(g ′ ) = LM(t 0 τ 0 g ′ 0 ) and S(g ′ ) = t 0 τ 0 S(g ′ 0 ) = S(t 0 τ 0 g ′ 0 ), with deg(LM(g ′ )) > deg(LM(g ′ 0 )). As a consequence, this process can only be applied a finite number of times before we obtain a g ′ k ∈ G which is primitive 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 's are primitive S-irreducible.
Among all such possible way of writing P as r i=1 Q i g i , we define β as the 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 τ in the terms of Q i such that LT (τ g i ) = β and S(τ g i ) ≤ σ.
We now show that LT (P ) < β leads to a contradiction.
In that case, we can write that: As LT (P ) < β and this is also the case for the two last summands in the second part of the previous equation, Thanks to Lemma 5.6 and 2.14, there are some c j,k ∈ k and x β j,k = lcm(LM(g j ), LM(g k )) such that Moreover, we have for all j, k involved, S(x β 0 −β j,k Spol(g j , g k )) ≤ σ and LT (c j,k x β 0 −β 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 apply Lemma 5.8 to obtain c j,k x β 0 −β j,k Spol(g j , g k ) = i Q j,k i g i such that for all i and x γ monomial of Q j,k i LT (Q j,k i g i ) < β and x γ S(g i ) = S(x γ g i ) ≤ σ. All in all, we obtain someQ i such that P = iQ i g i and for all i LT (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 we work with homogeneous entry polynomials, for S-GB up to a given degree (i.e. d − S-GB).

A tropical F5 algorithm
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 not seem to be easy. Indeed, the second condition require some knowledge on LM(Syz f 1 ) which we usually do not have. There are two natural ways to handle this question: Firstly, we could keep track during the algorithm of the syzygies encountered, and use a variable L as a place holder for their leading monomials. The second condition can then be replaced by LM(u i )S(g i ) / ∈ L . This is what is used in [AP]. Another way is to only consider the trivial syzygies. This amounts to take L = LM(I ′ ) and use the same replacement for the second condition. This is what is used in [F02] and [F15].
We opt for the second choice (only handling trivial syzygies). This give rise to the notion of admissible pair.
We can then remark that handling admissible pairs instead of normal pairs 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 its admissible pairs then it is an S-GB.
In the general case, LM(Syz f 1 ) is not known in advance. However, it can be determined inductively on signatures. This is how the following algorithm 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 computed, we can decide whether S(x α g) = x α S(g), or else x α g happens to be reduced to zero. In the following, we certify inductively whether for a processed 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 admissibles pairs or not once condition 3 of 6.1 is certified. Using this idea, we provide a first version of an F5 algorithm in Algorithm 1, using Algorithm 2 for Symbolic Preprocessing.
Remark 6.3. Only signature zero is allowed to appear multiple times in the matrix in construction.
Algorithm 1: A first F5 algorithm input : G ′ a tropical GB of I ′ consisting of homogeneous polynomials, f 1 an homogeneous polynomial, not in I ′ output: The reason is the following: because of Proposition 3.10, for an irreducible polynomial with a given signature, its leading monomial is determined by its signature. After performing the tropical row-echelon form computation, all rows corresponds to irreducible polynomials, hence two rows produced with the same signature are redundant: either they will produce the same leading monomial or they would reduce to zero. The tropical LUP form computation to obtain a row-echelon matrix, with no 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.
Proof. Termination: Assuming correctness, after (theoretically) performing the algorithm for all degree d in N, we obtain an S-GB. Since by Proposition 3.13 all S-GB contain a finite S-GB then at some degree d we have computed a finite S-GB. As a consequence, all S-pairs from degree d + 1 to degree 2d (at most) will not yield any new polynomial in G (no new leading monomial), and thus there will be no S-pair of degree more than 2d, which proves the termination of the algorithm.
Correctness: We proceed by induction on the signature to prove that the result of Algorithm 1 is a tropical S-GB. The result is clear for signature ≤ sign 1.
For the induction step, we assume that the result is proved up to signature ≤ sign x α , with |x α f 1 | = d. Let x β be the smallest guessed signature of M d of signature > sign x α .
We first remark that if there are rows of guessed signature > sign x β that are of true signature < sign x β then: 1. We can conclude that there is no normal pair popped from B with second half of a pair with signature x γ such that x α < sign x γ < sign x β because of condition 2 of Definition 5.1 (which prevents such signature to drop). 2. Using the F5 Criterion Theorem 5.3, it proves that we have in G (and the rows of M d up to signature x α that are added to G) an S-GB up to signature < sign x β . 3. As a consequence, using Theorem 4.6 the Symbolic Preprocessing has produced exactly enough rows of guessed (and true) signature < sign x β from G to S-reduce the row of guessed signature x β . Indeed, since we have an S-GB up to < sign x β , all necessary leading monomials could be attained by product monomialpolynomial of G with guessed signature < sign x β or through the echelon form up to < sign x β of M d . The last consequence is of course also true if there 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 of guessed signature x β : 1. The row reduces to zero. Then the signature x β is not possible. We then have in G an S-GB up to signature ≤ sign x β . 2. The row does not reduce to zero. Then, depending on whether the reduced row provide 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 that the output of Algorithm 1 is indeed an S-GB.
To conclude the proof of Theorem 1.1, the main result on the efficiency of the F5 algorithm is still valid for its tropical version: Proposition 6.5. If f 1 is not a zero-divisor in A/I ′ , then all the processed matrices M d are (left-) injective. In other words, no row reduces to zero.
Proof. In this case, LM(Syz f 1 ) = LM(I ′ ). Hence, with the choice of rows of M d avoiding guessed signature in LM(Syz f 1 ) no syzygy can be produced.
Remark 6.6 (Rewritability). Thanks to Theorem 5.3, it is possible to replace the polynomials in P in the call to Symbolic-Preprocessing on Line 8 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 α , the algorithm 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 reduced to the same polynomial. By induction, it proves all of them can be replaced at 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 has been the most reduced to produce a polynomial of signature S(tg) for the upcoming reduction. Taking the x β g (g ∈ G) of signature x α such that g has the biggest signature possible is a first reasonnable idea. 2 It actually can lead to a substantial reduction of the running time of the F5 algorithm.

Implementation and numerical results
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 tropical Gröbner basis of I given by F = (P 1 , . . . , P s ) by performing complete computation succesively for (P 1 ), (P 1 , P 2 ), (P 1 , P 2 , P 3 ), . . . adding a polynomial at a time playing the part f 1 played in the rest of the article. As we only deal with homogeneous polynomials, it is also possible to do the global computation degree by degree, and at a given degree iteratively on the initial polynomials. By indexing accordingly the signatures, as in [F02], the algorithm can be adapted straightforwardly. This is what has been chosen in the implementation we have achieved.
We have gathered some numerical results in the following array. Timings are in seconds of CPU time. 3 We have compared ours with that of the algorithms of Chan and Maclagan in [CM13] (in Macaulay 2) and Markwig and Ren in [MY15] (in Singular), provided in [MY15]. A dot means that the computation could not complete. Entry systems are homogenized. Base field is Q.
Katsura 3 4 5 6 7 Cyclic 4 5 6 [CM13] ≤ 1 ≤ 1 5 74 513 • 4 353 • Loss in precision has also been estimated in the following setting. For a given p, we take three polynomials with random coefficients in Z p (using the Haar measure) in Q p [x, y, z] of degree 2 ≤ d 1 ≤ d 2 ≤ d 3 ≤ 4. For any given choice of d i 's, we repeat the experiment 50 times. Coefficients 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 precision O(p N −m ). We compute the total mean and max on those m's on the obtained tropical GB. Results are compiled in the following array as couples of mean and max, with D = d 1 + d 2 + d 3 − 2 the Macaulay bound.

Future works
In this article, we have investigated the main step for a complete F4-style tropical F5 algorithm. We would like to understand more deeply the Rewritten critertion of [F02]. We would also like to understand the natural extension of our work to a Tropical F4 and to a Tropical F5 for non-homogeneous entry polynomials.