Groebner bases and gradings for partial difference ideals

In this paper we introduce a working generalization of the theory of Gr\"obner bases for algebras of partial difference polynomials with constant coefficients. One obtains symbolic (formal) computation for systems of linear or non-linear partial difference equations arising, for instance, as discrete models or by the discretization of systems of differential equations. From an algebraic viewpoint, the algebras of partial difference polynomials are free objects in the category of commutative algebras endowed with the action by endomorphisms of a monoid isomorphic to $\N^r$. Then, the investigation of Gr\"obner bases in this context contributes also to the current research trend consisting in studying polynomial rings under the action of suitable symmetries that are compatible with effective methods. Since the algebras of difference polynomials are not Noetherian ones, we propose in this paper a theory for grading them that provides a Noetherian subalgebras filtration. This implies that the variants of the Buchberger's algorithm we developed for difference ideals terminate in the finitely generated graded case when truncated up to some degree. Moreover, even in the non-graded case, we provide criterions for certifying completeness of eventually finite Gr\"obner bases when they are computed within sufficiently large bounded degrees. We generalize also the concepts of homogenization and saturation, and related algorithms, to the context of difference ideals. The feasibily of the proposed methods is shown by an implementation in Maple that is the first to provide computations for systems of non-linear partial difference equations. We make use of a test set based on the discretization of concrete systems of non-linear partial differential equations.


Introduction
An important idea at the intersection of many algebraic theories consists in studying algebraic structures under the action of operators of different nature, typically automorphims and derivations.Classical roots of this idea can be found clearly in invariant and representation theory, as well as in the study of polynomial identities satisfied by associative algebras.Recently, topics like algebraic statistic [4] or entanglement theory [22] have given new impulse and applications to the research on such themes.Another fundamental source of inspiration is the theory of differential and difference algebras introduced in the pioneeristic work of Ritt [23,24] and afterwards developed by Kolchin [16], Cohn [6], Levin [21] and many others.From the point of view of computational methods, starting from the algorithms proposed by Ritt himself, a considerable advancement can be recorded in the differential case (see for instance [25]).Much less has been achieved for the algebras of difference polynomials where working algorithms can be found mainly in the linear case [12].Nevertheless, the interest for such computations is relevant because of applications in the discretization of systems of differential equations like the automatic generation of finite difference schemes or the consistency analysis of finite difference approximations [9,11,19].The present paper contributes to this research trend by concerning the development of effective methods for systems of linear or non-linear partial difference equations with constant coefficients.We provide also an implementation of such methods which is the first to allow computations in the non-linear case.Specifically, we generalize the theory of Gröbner bases and related algorithms for ideals of the algebra of partial difference polynomials.We are able to do this in a general and systematic way, by defining classes of suitable monomial orderings, by extending the Buchberger's algorithm and the concept of grading to difference ideals, by defining truncated homogeneous computations and even by introducing a suitable notion of homogenization for such ideals.First contributions to such theory can be found in [9,17,18].In particular, owing to the notion of letterplace correspondence/embedding introduced in [17,18], note that the Gröbner bases computations for ideals of the free associative algebra are a subclass of the same computations for ideals of the algebra of ordinary difference polynomials.
The algebras of partial difference polynomials are free algebras in the class of commutative algebras that are invariant under the action by endomorphisms of a monoid isomorphic to N r .Then, the study of Gröbner bases for such algebras belongs to the general investigation of computational methods for commutative rings or modules that have suitable symmetries.Moreover, from the viewpoint of applications, the algebras of partial difference polynomials are fundamental structures in the formal theory of partial difference equations where a set of unknown multivariate functions is assumed algebraically independent together with all partial shifts of them.To provide symbolic computation for systems of such equations is hence essential to introduce Gröbner bases methods.Based on a suitable definition of monomial orderings that are compatible with shifts action and the description of large classes of them, the present paper introduces variants of the Buchberger's algorithm for partial difference ideals.These procedures take advantage of the monoid symmetry essentially by killing all S-polynomials in a orbit except for a minimal one.Note that the algebras of difference polynomials are not Noetherian since they are polynomial rings in an infinite number of variables and hence termination is not generally guaranteed for the proposed algorithms.With the aim of improving this situation, we define suitable gradings that are compatible with the monoid action and provide filtrations of the algebra of partial difference polynomials with finitely generated subalgebras.We obtain therefore the termination for finitely generated graded difference ideals when computations are performed within some bounded degree.For non-graded ideals but for monomial orderings compatible with such gradings, we prove also criterions able to certify that a Gröbner basis computation performed over a suitable finite set of variables that is within a sufficiently large degree, is a complete one.Finally, the paper generalizes the notion of homogenization and saturation to difference ideals with respect to the given gradings and provides the algorithms to perfom this ideal operations.As a byproduct, one obtains an alternative algorithm to compute Gröbner bases of non-graded difference ideals via homogeneous computations.By means of an implementation in Maple, all these methods are finally experimented on difference ideals obtained by the discretization of systems of non-linear differential equations.

Algebras of partial difference polynomials
Fix K any field and let Σ be a monoid (semigroup with identity) that we denote multiplicatively.Let A be a commutative K-algebra and denote End K (A) the monoid of K-algebra endomorphisms of A. We call A a Σ-invariant algebra or briefly a Σ-algebra if there is a monoid homomorphism ρ : Σ → End K (A).In this case, we denote σ • x = ρ(σ)(x), for all σ ∈ Σ and x ∈ A. Let A, B be Σ-algebras and ϕ : A → B be a K-algebra homomorphism.We say that ϕ is a Σ-algebra , for all σ ∈ Σ and x ∈ A. Let A be a Σ-algebra and let I ⊂ A be an ideal.We call I a Σ-invariant ideal or simply a Σ-ideal if Σ • I ⊂ I. Clearly, all kernels of Σ-algebra homomorphisms are Σ-ideals.Definition 2.1.Let A be a Σ-algebra and let X ⊂ A be a subset.We say that A is Σ-generated by X if A is generated by Σ • X as K-algebra.In other words, A coincides with the smallest Σ-subalgebra of A containing X.In the same way, one defines Σ-generation for the Σ-ideals.
In the category of Σ-invariant algebras one can define free objects.In fact, let X be a set and denote x(σ) each element (x, σ) of the product set X(Σ) = X × Σ. Define P = K[X(Σ)] the polynomial algebra in the commuting variables x(σ).For any element σ ∈ Σ consider the K-algebra endomorphism σ : P → P such that x(τ ) → x(στ ), for all x(τ ) ∈ X(Σ).Then, one has a faithful monoid representation ρ : Σ → End K (P ) such that ρ(σ) = σ ad hence P is a Σ-algebra.Note that if Σ is a left-cancellative monoid then all maps ρ(σ) are injective.Proposition 2.2.Let A be a Σ-algebra and let f : X → A be any map.Then, there is a unique Σ-algebra homomorphism ϕ : P → A such that ϕ(x(1)) = f (x), for all x ∈ X.
Definition 2.3.We call P = K[X(Σ)] the free Σ-algebra generated by X.In fact, P is Σ-generated by the subset X(1).
In other words, the algebra P is an essential tool in the theory of Σ-algebras because any such algebra A that is Σ-generated by a set X can be obtained as a quotient Σ-algebra P/I, where I is a Σ-ideal of P .For instance, from the viewpoint of computational methods, if one develops them for P then such methods can be extended to any quotient P/I as it is done in the classical theory of Gröbner bases for affine algebras.Note also that if Σ is defined as the monoid Inc(N) = {f : N → N | f strictly increasing}, or some power of this, one obtains an environment for computations in algebraic statistic [4].
We want now to go in the direction of developing fundamental structures for symbolic (formal) computation on systems of partial difference equations with constant coefficients.From now on, we assume that X = {x 0 , x 1 , . ..} is a finite or countable set and Σ is a free commutative monoid generated by a finite set, say {σ 1 , . . ., σ r }.
The motivation for such name is in the formal theory of partial difference equations [6,21].In this theory, in fact, the indeterminates x i (1) are by definition algebraically independent unknown functions u i (t 1 , . . ., t r ) in the variables t j and the maps ρ(σ k ) are the shift operators u i (t 1 , . . ., t r ) → u i (t 1 , . . ., t k + h, . . ., t r ) where h is a parameter (mesh step).If σ = i σ αi i then the indeterminates x i (σ) = σ • x i (1) correspond to the (algebraically independent) shifted functions Then, a Σ-ideal I ⊂ P is also called a partial difference ideal and a Σ-basis of I corresponds to a system of partial difference equations in the unknown functions u i (t 1 , . . ., t r ).One uses the term ordinary difference when r = 1.Note that the algebras of difference polynomials are not Noetherian rings since they are polynomial rings in an infinite number of variables.One has therefore that difference ideals have bases or Σ-bases which are generally infinite.
In the next sections we generalize the Gröbner basis theory to the free Σ-algebra P = K[X(Σ)] of partial difference polynomials.Clearly, one reobtains the classical theory when Σ = {1} (r = 0) that is P = K[X].The starting point is to define monomial orderings of P which are compatible with the action of the monoid Σ.

Monomial Σ-orderings
Denote by M = Mon(P ) the set of all monomials of P .Note that even if the set X(Σ) is infinite (in fact countable), one can endow P by monomial orderings.This is an important consequence of the Higman's Lemma [15] which can be stated in the following way (see for instance [1], Corollary 2.3 and remarks at beginning of page 5175).Proposition 3.1.Let ≺ be a total ordering on M such that (i) 1 m for all m ∈ M ; (ii) ≺ is compatible with multiplication on M , that is if m ≺ n then tm ≺ tn, for any m, n, t ∈ M .Then ≺ is also a well-ordering of M that is a monomial ordering of P if and only if the restriction of ≺ to the variables set X(Σ) is a well-ordering.
Clearly, it is easy to construct well-orderings for the set X(Σ) which is in bijective correspondence to N r+1 .Note that the monoid Σ stabilizes the monomials set M since it stabilizes X(Σ).We introduce then the following notion.Definition 3.2.Let ≺ be a monomial ordering of P .We call ≺ a (monomial) Σ-ordering of P if ≺ is compatible with the Σ-action on M , that is m ≺ n implies that σ • m ≺ σ • n for all m, n ∈ M and σ ∈ Σ.
A straightforward consequence of this definition is the following result.The orderings on the variables set X(Σ) that can be extended to monomial Σ-orderings are as follows.
Definition 3.4.Let ≺ be a well-ordering of X(Σ).We call ≺ a (variable) Σranking of As for Proposition 3.3, we have that if ≺ is a Σ-ranking then u σ • u for all u ∈ X(Σ) and σ ∈ Σ.Moreover, if X is a finite set then condition u σ • u for all u, σ together with Σ-compatibility implies that ≺ is a well-ordering by applying Dickson's Lemma (or Higman's Lemma) to Σ which is isomorphic to N r .However, note that in this paper the set X may be also countable.
Owing to the decompositions X(Σ) = σ∈Σ X(σ) = xi∈X x i (Σ) of the variables set of the ring P , we can define Σ-rankings of P in a natural way.Denote by Q the monoid K-algebra defined by the free commutative monoid Σ = σ 1 , . . ., σ r .In other words, Q = K[σ 1 , . . ., σ r ] is the polynomial algebra in the commutative variables σ i .From now on, we assume that Σ is endowed with a monomial ordering < of Q.By abuse, we call < a monomial ordering of Σ. Definition 3.5.Fix < a monomial ordering of Σ.For all x i (σ), x j (τ ) ∈ X(Σ), we define: (i) x i (σ) ≺ x j (τ ) if and only if σ < τ or σ = τ and i < j.In other words, X(σ) ≺ X(τ ) when σ < τ .(ii) x i (σ) ≺ ′ x j (τ ) if and only if i < j or i = j and σ < τ .In other words, x i (Σ) ≺ ′ x j (Σ) when i < j.Clearly ≺ and ≺ ′ are both Σ-rankings of P that we call respectively weight and index Σ-ranking defined by a monomial ordering of Σ.For all x i ∈ X and σ ∈ Σ denote P (σ) = K[X(σ)], M (σ) = Mon(P (σ)) and Owing to the decompositions P = σ∈Σ P (σ) = xi∈X P (x i ), one has that a monomial m ∈ M can be uniquely written as By means of such presentations we can define block monomial orderings of P extending weight and index ranking.Recall that ρ : Σ → End K (P ) is the faithful monoid representation defined by the action of Σ over P .For any σ ∈ Σ one has that the map ρ(σ) defines an isomorphism between the monoids M (1), M (σ) and hence between the algebras P (1), P (σ).In other words, we have M (σ) = σ • M (1), P (σ) = σ • P (1).Definition 3.6.Fix ≺ a monomial ordering of the subalgebra P (1) ⊂ P and extend it to all subalgebras P (σ) (σ ∈ Σ) by the isomorphisms ρ(σ).In other words, we put σ • m ≺ σ • n if and only if m ≺ n, for any m, n ∈ M (1).Then, for all Clearly, the restriction of ≺ w to the variables of P is just the weight Σ-ranking.
Proposition 3.7.The ordering ≺ w is a Σ-ordering of P .
Note that we have also a monoid faithful representation φ : N → End K (P ) such that the endomorphism φ(i) is defined as x j (σ) → x i+j (σ) for any i, j ≥ 0 and σ ∈ Σ. Clearly φ(i) induces isomorphism between the monoids M (x 0 ), M (x i ) and the algebras P (x 0 ), P (x i ).The algebra P (x 0 ) can be easily endowed with a Σordering.For instance, since P (x 0 ) = σ∈Σ K[x 0 (σ)] one can define a lexicographic ordering as in Definition 3.6.Definition 3.8.Fix ≺ a monomial Σ-ordering of the subalgebra P (x 0 ) ⊂ P and extend it to all subalgebras P (x i ) (x i ∈ X) by the isomorphisms φ(i).For any Note that the restriction of ≺ i to the variables of P is the index Σ-ranking.Proposition 3.9.The ordering ≺ i is a Σ-ordering of P .
and m(x ip ) ≺ n(x ip ).We have clearly that m ′ (x iq ) = n ′ (x iq ).Moreover, since ≺ is a Σ-ordering of P (x 0 ) and therefore of P (x ip ), one has also m We call the above monomial Σ-orderings ≺ w , ≺ i of P respectively weight Σordering defined by a monomial ordering of P (1) and index Σ-ordering of P defined by a monomial Σ-ordering of P (x 0 ).Clearly, both these orderings depend also on a monomial ordering of Σ.Note that index Σ-orderings are suitable for generation of finite difference schemes for partial differential equations [10,11].The weight Σorderings are instead compatible with the gradings of the Σ-algebra P we introduce in Section 5.For this reason they are suitable for obtaining complete Gröbner bases from partial computations.

Gröbner Σ-bases
From now on, we consider P endowed with a monomial Σ-ordering ≺.Let and we denote as LM(G) the ideal of P generated by lm(G).
Proof.Since P is endowed with a Σ-ordering, one has that lm(σ • f ) = σ • lm(f ) for any f ∈ P, f = 0 and σ ∈ Σ.Then, Σ • lm(I) = lm(Σ • I) ⊂ lm(I) and therefore LM(I) = lm(I) is a Σ-ideal.Definition 4.2.Let I ⊂ P be a Σ-ideal and G ⊂ I.We call G a Gröbner Σ-basis of I if lm(G) is a Σ-basis of LM(I).In other words, Σ • G is a Gröbner basis of I as P -ideal.
Since the monoid Σ is assumed isomorphic to N r that is Σ-ideals are partial difference ideals, we may say that Gröbner Σ-bases are partial difference Gröbner bases [9].Another possible name is Σ-equivariant Gröbner bases [4].Simplicity and generality lead us to the previous definition that already appeared in [18].
Let f, g ∈ P, f, g = 0 and put lt(f ) = cm, lt(g) = dn with m, n ∈ M and c, d ∈ K.If l = lcm(m, n) we define as usual the S-polynomial spoly(f, g) = (l/cm)f −(l/dn)g.Clearly spoly(f, g) = −spoly(g, f ) and spoly(f, f ) = 0. Proposition 4.3.For all f, g ∈ P, f, g = 0 and for any σ Proof.Since Σ acts on the variables set X(Σ) by injective maps, it is sufficient to note that σ The following definition is a standard tool in Gröbner bases theory.
for all i, we say that f has a Gröbner representation respect to G.
is also a Gröbner representation, for any σ ∈ Σ.In fact, since ≺ is a Σ-ordering of P one has that lm(f ) lm A celebrated result from Bruno Buchberger [5] is the following.Proposition 4.5 (Buchberger's criterion).Let G be a basis of the ideal I ⊂ P .Then, G is a Gröbner basis of I if and only if for all f, g ∈ G, f, g = 0 the Spolynomial spoly(f, g) has a Gröbner representation with respect to G.
Usually the above result, see for instance [8], is stated when P is a polynomial algebra with a finite number of variables and G is a finite set.In fact, such assumptions are not needed since Noetherianity is not used in the proof, but only the existence of a monomial ordering for P .See also the comprehensive Bergman's paper [2] where the "Diamond Lemma" is proved without any restriction on the finiteness of the variables set.We want now to prove a generalization of the Buchberger's criterion for Gröbner Σ-bases of P .For this purpose it is useful to introduce the following notations.
Proof.We prove that Σ•G is a Gröbner basis of I and we make use of the Proposition 4.5.Then, consider any pair of elements σ Since ≺ is a Σ-ordering of P , we conclude that we have also the Gröbner representation spoly(σ A standard procedure in the Buchberger's algorithm is the following.

Algorithm 4.1 Reduce
Input: G ⊂ P and f ∈ P .Output: Note that the termination of Reduce is provided since ≺ is a monomial ordering of P .In particular, even if G is an infinite set, there are only a finite number of elements g ∈ G, g = 0 such that lm(g) divides lm(h) and hence lm(g) lm(h).It is well-known that if Reduce(f, G) = 0 then f has a Gröbner representation with respect to G.Moreover, if Reduce(f, G) = h = 0 then clearly one has Reduce(f, G ∪ {h}) = 0. Therefore, from Proposition 4.7 it follows immediately the correctness of the following algorithm.

Algorithm 4.2 SigmaGBasis
Input: H, a Σ-basis of a Σ-ideal Clearly, all well-known criteria (product criterion, chain criterion, etc) can be applied to SigmaGBasis to shorten the number of S-polynomials to be considered.In fact, one can understand this algorithm as the usual Buchberger's procedure applied to the basis Σ • H, where an additional criterion to avoid "useless pairs" is given by Proposition 4.7.Owing to Non-Noetherianity of the ring P , note that the termination of SigmaGBasis is not provided in general and this is, in fact, one of the main problems in differential/difference algebra.Nevertheless, in the next section we introduce some suitable grading for the algebra P which provides that a truncated version of the algorithm SigmaGBasis with homogeneous input stops in a finite number of steps.Some variant of the algorithm SigmaGBasis appeared in [9] and before in [17,18] for the ordinary difference case.

An illustrative example
In this section we apply the algorithm SigmaGBasis to a simple example in order to provide a concrete computation with it.Let X = {x, y}, Σ = σ 1 , σ 2 and consider the algebra of partial difference polynomials P = K[X(Σ)].To simplify the notation, we identify the monoid (Σ, •) with (N 2 , +) by means of the isomorphism σ i 1 σ j 2 → (i, j).Then, we denote the variables of P as x(i, j), y(i, j), for all i, j ≥ 0. We consider now the Σ-ideal (difference ideal) I ⊂ P that is Σ-generated by the difference polynomials In other words, this Σ-basis (difference basis) encodes a system of non-linear difference equations with constant coefficients in two unknown bivariate functions.By symbolic (formal) computations, we want to substitute this system with a completion of it, namely a Gröbner Σ-basis.We may want to do this for the purposes of checking membership of other equations to the Σ-ideal, elimination of unknowns, etc.The main problem is that such basis may be infinite, but it is not the case for this example.We fix then the degrevlex ordering on Σ (σ 1 > σ 2 ) and the lex monomial ordering on K[x, y] (x ≻ y) that is on P (0, 0) = K[x(0, 0), y(0, 0)].A weight Σ-ordering (Definition 3.6) is hence defined on P and we use it for computing a Gröbner Σ-basis of I.Such basis consists of the elements g 1 , g 2 together with the difference polynomials Note that in all these elements the first monomial is the leading one with respect to the given monomial ordering of P .Let us see how the algorithm SigmaGBasis is able to obtain such Gröbner Σ-basis.Since the Σ-ideal I is Σ-generated by G = {g 1 , g 2 } then I is generated as an ideal of P by Σ • G that are the polynomials for all i, j ≥ 0. By applying the product criterion, we have to consider three kinds of S-polynomials spoly((i, j + 1) The Σ-criterion implies therefore that one has to reduce with respect to the basis Σ • G just the S-polynomials The reduction of the S-polynomial s 1 leads to the new element g 3 and the current Σ-basis of I is now G = {g 1 , g 2 , g 3 }.The additional S-polynomials that survive to product and Σ-criterion are We have that s 4 → 0 and s 2 → g 4 with respect to Σ • G.The Σ-basis is then G = {g 1 , g 2 , g 3 , g 4 } and one has a new S-polynomial Finally, we have that all S-polynomials s 3 , s 5 , s 6 , s 7 reduce to zero with respect to Σ • G and hence G is a Gröbner Σ-basis of I.Note that G is in fact a minimal such basis and also that in this simple example there is no use of the chain criterion that can be always applied together with the other criteria.
It is important to note that if X is a finite set and < is a sequential ordering of Σ then the sequence {P (σ) | σ ∈ Σ} is a filtration of P consisting of Noetherian subalgebras.For such reason, from now on we assume Σ be endowed with a sequential monomial ordering.Proposition 6.4.The weight function satisfies the following properties: To prove (ii) it is sufficient to note that the weight of a monomial does not depend on the exponents of the variables occuring in it.
Note that the property (i) implies that the map w is a homomorphism with respect to the action of Σ on M and Σ.In other words, one has that σP τ ⊂ P στ for any σ ∈ Σ, τ ∈ Σ.Moreover, the property (ii) means that w is also a monoid homomorphism from (M, lcm) to ( Σ, +).Definition 6.5.Let I be an ideal of P .We call I a w-graded ideal if I = σ I σ with I σ = I ∩ P σ .In this case, if I is also a Σ-ideal then σ • I τ ⊂ I στ for all σ ∈ Σ, τ ∈ Σ.
Owing to the w-grading of P , one can show that a truncated version of the algorithm SigmaGBasis admits termination.If f, g ∈ P, f = g are w-homogeneous elements then the S-polynomial h = spoly(f, g) is clearly w-homogeneous too.Moreover, by property (ii) of Proposition 6.4, we have that w(h) = w(f ) + w(g) and hence if w(f ), w(g) ≤ δ then also w(h) ≤ δ, for some δ ∈ Σ.By means of this remark, one obtains immediately the following result.Proposition 6.6 (Truncated termination over the weight).Let I ⊂ P be a wgraded Σ-ideal and fix δ ∈ Σ. Assume I has a w-homogeneous basis H such that H δ = {f ∈ H | w(f ) ≤ δ} is a finite set.Then, there is a w-homogeneous Gröbner Σ-basis G of I such that G δ is also a finite set.In other words, if we consider for the algorithm SigmaGBasis a selection strategy of the S-polynomials based on their weights ordered by <, we obtain that the δ-truncated version of SigmaGBasis stops in a finite number of steps.
Proof.First of all, note that the algorithm SigmaGBasis computes essentially a subset G of a Gröbner basis Σ • G obtained by applying the Buchberger's algorithm to the basis Σ•H of I.Moreover, by Proposition 6.4 the elements of Σ•H and hence of Σ • G are all w-homogeneous.Denote Since < is a sequential monomial order of Σ and H δ is a finite set one has that H ′ δ is also a finite set.We consider therefore X δ the finite set of variables of P occurring in the elements of H ′ δ and define P (δ) = K[X δ ] ⊂ P .In fact, the δtruncated algorithm SigmaGBasis computes a subset of a Gröbner basis of the ideal I (δ) ⊂ P (δ) generated by H ′ δ .By Noetherianity of the finitely generated polynomial ring P (δ) we clearly obtain termination.
Clearly the above result provides algorithmic solution to the ideal membership for finitely generated w-graded Σ-ideals.Note that if r = 0 that is Σ = {1} then the algorithm SigmaGBasis coicides with classical Buchberger's algorithm and Proposition 6.6 states that if I is a finitely generated ideal of P = P 0 ⊕ P 1 = K[x 0 , x 1 , . ..] then I has also a finite Gröbner basis.According with the above proof, this is a consequence of the fact that the Buchberger's algorithm runs over the finite number of variables occuring in the generators of I.
We call ord the order function of P .
For any monomial m = x i1 (δ 1 ) α1 • • • x i k (δ k ) α k different from 1 we have that ord(m) = max(deg(δ 1 ), . . ., deg(δ k )).Clearly, the order function defines a grading P = d∈ N P d of the algebra P over the commutative monoid ( N, max).Define P (d) = i≤d P i = deg(σ)≤d P (σ) which is a subalgebra of P .Then, if X is a finite set we have that the sequence {P (d) | d ∈ N} is a filtration of P with Noetherian subalgebras where Proof.For m = 1 one has ord(σ Consider now f, g ∈ P, f = g ord-homogeneous elements.The S-polynomial h = spoly(f, g) is clearly ord-homogeneous and ord(h) = max(ord(f ), ord(g)).Then ord(f ), ord(g) ≤ d implies that ord(h) ≤ d, for some d ∈ N and one proves the following result as for Proposition 6.6.Proposition 6.11 (Truncated termination over the order).Let I ⊂ P be a ordgraded Σ-ideal and fix d ∈ N. Assume I has a ord-homogeneous basis of H such that H d = {f ∈ H | ord(f ) ≤ d} is a finite set.Then, there is ord-homogeneous Gröbner Σ-basis G ⊂ I such that G d is also a finite set.In other words, if we consider for SigmaGBasis a selection strategy of the S-polynomials based on their orders, we have that the d-truncated version of SigmaGBasis terminates in a finite number of steps.
By means of weight and order functions one has criterions, also in the non-graded case, that provide that a Gröbner Σ-basis is the eventually finite complete one even if it has been computed within some bounded weight or order for the algebra P that is over a finite number of variables.This is of course important because actual computations can be only performed in such a way.As before, we fix a sequential monomial ordering < on Σ. Definition 6.12.Let ≺ be a monomial Σ-ordering of P .We call ≺ compatible with the weight function if w(m) < w(n) implies that m ≺ n, for all m, n ∈ M .In a similar way, one defines when ≺ is compatible with the order function.Proposition 6.13.Let ≺ w be a weight Σ-ordering as in Definition 3.6.Then ≺ w is compatible with the weight function.In particular, if the monomial order < of Σ is compatible with deg then ≺ w is also compatible with the order function.
Proposition 6.14 (Finite Σ-criterion).Assume the Σ-ordering of P be compatible with the weight function.Let G ⊂ P be a finite set and denote I the Σ-ideal generated by G.Moreover, define δ = max < {w(lm(g)) | g ∈ G}.Then, G is a Gröbner Σ-basis of I if and only if for all f, g ∈ G and for any σ, τ ∈ Σ such that gcd(σ, τ ) = 1 and gcd(σ•lm(f ), τ •lm(g)) = 1, the S-polynomial spoly(σ•f, τ •g) has a Gröbner representation with respect to the finite set Σ δ 2 • G.In the same way, if the Σ-ordering of P is compatible with the order function and d = max{ord(lm(g)) | g ∈ G}, then G is a Gröbner Σ-basis of I when the above S-polynomials have a Gröbner representation with respect to Σ 2d • G.
for all ν.We want to bound the elements ν ∈ Σ with respect to the ordering <.Put m = lm(f ), n = lm(g) and hence lm(σ Then, there is a variable x i (σα) = x i (τ β) that divides u where x i (α) divides m and hence α ≤ w(m) ≤ δ and x i (β) divides n and therefore β ≤ w(n) ≤ δ.Then σα = τ β and one has that In a similar way, one argues for the order function.
The above criterion implies that with respect to Σ-orderings compatible with weight or order functions one has an algorithm able to compute a finite Gröbner Σ-basis, whenever this exists, in a finite number of steps.In practice, this results in an adaptative procedure that keeps the bound δ 2 (2d) for the elements of Σ to be applied to the generators, constantly updated with respect to the maximal weight δ (order d) of the leading monomials of the current generators.In particular, note that the bound is δ (d) when forming S-polynomials and δ 2 (2d) for reductions.

Homogenizing with respect to order function
The purpose of this section is to analyze (de)homogenization processes in the context of Σ-ideals.Such methods are generally developed to have structures and computations that are homogeneous with respect to some grading, even if the input data are not such.Besides to the theoretical advantages as the concept of projective closure, these techniques usually imply computational advantages (see for instance [3]).Note that for Σ-ideals one can develop these methods for both w-grading and ord-grading, but we will concentrate on the second one.Univariate homogenizations are usually more efficient than multivariate ones because leading monomials are preserved by the homogenization process.
Let t be a new variable disjoint by X. Define X = X ∪ {t}, X(Σ) = X × Σ, P = K[ X(Σ)] and finally M = Mon( P ).Consider the algebra endomorphism ϕ : P → P such that x i (σ) → x i (σ) and t(σ) → 1, for all i, σ.Clearly ϕ 2 = ϕ and P = ϕ( P ).Moreover, one has that ϕ is a Σ-algebra endomorphism.Then ϕ defines a bijective correspondence between all Σ-ideals of P and Σ-ideals of P containing ker ϕ = t(1) − 1 Σ .Definition 7.1.Denote by N = N ord the largest ord-graded Σ-ideal contained in ker ϕ that is the ideal generated by all ord-homogeneous elements f ∈ P such that ϕ(f ) = 0. Proposition 7.2.The ideal N ⊂ P is generated by the elements Proof.Let f ∈ P be a ord-homogeneous element such that ϕ(f ) = 0. Since the polynomials of type (i),(ii) clearly belongs to N , we have to prove that f is congruent to 0 modulo (i),(ii).Assume first that all variables of f belong to Therefore, one has that f is congruent modulo (ii) to By applying identity (i) it follows that f is congruent to ( i c i )t(σ) = 0 for some fixed σ such that deg(σ) = d.
Consider now the general case when the variables of f belong to X(Σ).Fix σ ∈ Σ such that deg(σ) = d.Modulo the identities (i),(ii), one has that f is congruent to a polynomial f ′ whose monomials are either of type m ∈ M such that ord(m) = d or of type t(σ)n where n ∈ M, ord(n) < d.We show that in fact f ′ = 0. Denote f ′ = t(σ)g − h where g, h are polynomials in P , h is ord-homogeneous and ord(h) = d.Since 0 = ϕ(f ′ ) = g − h one has that f ′ = (t(σ) − 1)g.If we assume g = 0 then the monomials n of g are such that ord(n) = d which is a contradiction.
We want now to define a bijective correspondence between all Σ-ideals of P and some class of ord-graded Σ-ideals of P containing N .Definition 7.3.Let I be any Σ-ideal of P .We define I * ⊂ P the largest ordgraded Σ-ideal contained in the preimage ϕ −1 (I) that is I * is the ideal generated by all ord-homogeneous elements in ϕ −1 (I).Clearly N = 0 * ⊂ I * .We call I * the ord-homogenization of the Σ-ideal I.
We call topord(f ) the top order of f and f * its ord-homogenization.Hence, if d ′ = d then h is congruent exactly to f * .Otherwise, the polynomial h is congruent to t(σ)f * .In both cases, we conclude that g is congruent modulo N ⊂ J to an element of J and therefore g ∈ J.
If I ⊂ P is a Σ-ideal one has clearly that ϕ(I * ) = I.Moreover, if J ⊂ P is a ord-graded Σ-ideal containing N then in general J ⊂ ϕ(J) * .Definition 7.6.Let N ⊂ J ⊂ P be a ord-graded Σ-ideal.
∈ N, f ord-homogeneous + N .Then J ⊂ J ′ ⊂ P is a ord-graded Σ-ideal that we call the saturation of J. Definition 7.7.Let J ⊂ P be a ord-graded Σ-ideal containing N .We say that J is saturated if J coincides with its saturation ϕ(J) * that is for any ord-homogeneous element f ∈ J, f / ∈ N one has that ϕ(f ) * ∈ J.If I is a Σ-ideal of P then its ord-homogenization I * is clearly a saturated ideal.
Therefore, a bijective correspondence is given between all Σ-ideals of P and the saturated ord-graded Σ-ideals of P containing N .
We want now to analyze the behaviour of Gröbner Σ-bases under homogenization and dehomogenization.Note that the arguments of Proposition 7.2 implies clearly that the polynomials (i),(ii) are in fact a Gröbner basis of the ideal N with respect to any monomial ordering of P .For this reason we introduce the following notion.
all its monomials are normal modulo N .Definition 7.9.Let ≺ be a Σ-ordering of P compatible with the order function.We call ≺ a ord-homogenization Σ- It is easy to define one of the above orderings.Fix for instance the lex or degrevlex monomial order on the polynomial ring P (1) = K[x 0 (1), x 1 (1), . . ., t(1)] where x 0 (1) > x 1 (1) > . . .> t(1).Moreover, fix a monomial ordering on Σ which is compatible with deg and define the weight Σ-ordering ≺ w of P as in Definition 3.6.Clearly ≺ w is a ord-homogenization Σ-ordering.
From now on, we assume P be endowed with a ord-homogenization Σ-ordering.
Proof.By definition, the monomials p, q are of type m ∈ M or t(σ)m with deg(σ) > ord(m).Since ≺ is a ord-homogenization order, when comparing two of such monomials of the same order one has only the following cases: m ≺ n, t(σ)m ≺ t(σ)n or t(σ)m ≺ n.Then, we have to prove ϕ(p) = m ≺ n = ϕ(q) only when t(σ)m ≺ n.This follows immediately from ≺ is compatible with the order function and ord(m) < ord(n) = deg(σ).
Proof.The first part of the statement follows immediately from Proposition 7.10.Moreover, if σ ∈ Σ, deg(σ) = topord(f ) then t(σ) cannot appear in the leading monomial of f * and hence lm(f * ) = lm(f ).Definition 7.12.Let N ⊂ J ⊂ P be a Σ-ideal.Moreover, let G ⊂ J be a subset of polynomials in normal form modulo N .We say that G is a Gröbner Σ-basis of Proof.Since G is a Gröbner Σ-basis of J modulo N we have that for any ordhomogeneous polynomial f ∈ J, f = 0 in normal form modulo N there is an element g ∈ G and σ ∈ Σ such that σ • lm(g) | lm(f ).Then, by applying the Σ-algebra endomorphism ϕ one obtains that σ • lm(ϕ(g)) | lm(ϕ(f )) that is ϕ(G) is a Gröbner Σ-basis of ϕ(J).Proposition 7.14.Let I ⊂ P be a Σ-ideal and let G be a Gröbner Σ-basis of I. Then G * = {g * | g ∈ G} is a ord-homogeneous Gröbner basis of I * modulo N .Moreover, one has that lm(G * ) = lm(G).
By the above propositions we obtain immediately what follows.
Let I ⊂ P be any Σ-ideal.The previous results suggest an alternative method to calculate a Gröbner Σ-basis of I which is based only on ord-homogeneous computations.Assume H is any Σ-basis of I and denote as before H * = {f * | f ∈ H}.Clearly J = H * Σ + N is a ord-homogeneous Σ-ideal of P containing N such that ϕ(J) = I.Assume now we compute G a ord-homogeneous Gröbner Σ-basis of J modulo N .Then, ϕ(G) is a Gröbner Σ-basis of I.Note that by using a ord-based selection strategy for the S-polynomials, the Gröbner Σ-basis G can be obtained order by order automatically minimal that is σ • lm(f ) not divides lm(g) for all f, g ∈ G, f = g and σ ∈ Σ.This is clearly a computational advantage, but since generally lm(G) = lm(ϕ(G)) one has that ϕ(G) may be not minimal.In the worst case, the ideal J may have an infinite and hence uncomputable minimal Gröbner Σ-bases but I just a finite one.This is clearly not the case when one considers a saturated ideal J ′ = I * since we have lm(G ′ ) = lm(ϕ(G ′ )) when G ′ is a minimal Gröbner Σ-basis of J ′ .Note that this nice property depends on the fact that we deal with a univariate homogenization.A drawback is that if one computes the saturation J ′ by means of the ideal J according to Corollary 7.15, one has again to compute a Gröbner Σ-basis of J.Then, a better approach consists in computing "on the fly" the Gröbner Σ-basis of J ′ starting from the generating set {f * | f ∈ H}.In other words, any time that a new generator g of the ord-homogeneous Gröbner Σ-basis arises from the reduction of an S-polynomial, we saturate g that is we substitute this polynomial with ϕ(g) * .In formal terms, the algorithm one obtains is the following one.

Testing and timings
In this section we present a set of tests for the algorithms SigmaGBasis and SigmaGBasis2 which is based on an experimental implementation of them in the language of Maple.This is actually the first implementation of algorithms for computing Gröbner bases of systems of linear or non-linear partial difference equations.Note that for the linear case one has the packages LDA (Linear Difference Algebra) [12] and Ore algebra[shift algebra] in the Maple distribution.The main idea that lead us when coding the proposed algorithms is that they can be considered variants of the classical Buchberger's algorithm where some amount of computations can be avoided by means of the symmetry defined by the monoid Σ.In fact, as explained in the previous sections, a "basic" approach to calculate a Gröbner Σ-basis of a Σ-ideal I generated by a Σ-basis H consists in applying the Buchberger's algorithm to the basis Σ • H.One obtains therefore a Gröbner basis G ′ of I from which a Gröbner Σ-basis G ⊂ G ′ can be extracted such that Σ • lm(G) = lm(G ′ ).Clearly, chain and coprime criterions can be used in the usual way in the procedure.Then, the algorithm SigmaGBasis can be understood as the variant that prescribes the application also of the Σ-criterion (Proposition 4.7) to the S-polynomials spoly(σ •f, τ •g) and to add the set of all shifts Σ • h to the current basis when a new element h arises from the reduction of an S-polynomial.Then, the Gröbner Σ-basis of I is simply the union of the initial basis H with the new elements h.Recall that the procedure is correct only if one uses a monomial Σ-ordering.Clearly, from the set Σ is infinite it follows that actual computations can be only performed with a finite subset of Σ that is over a finite set of variables of P = K[X(Σ)].Typically, one fixes a bound d for the degree of the elements of Σ that is for the order of the variables x i (σ).Owing to the finite Σ-criterion (Proposition 6.14), a basis obtained with a monomial ordering compatible with the order function is certified to be a complete Gröbner Σ-basis if the order bound is at least the double of the maximum top order of its elements.
In addition to the basic procedure for the computation of Gröbner Σ-bases and the algorithm SigmaGBasis, for the experiments we consider also a variant of the latter method where the Σ-criterion is suppressed but one continues to shift the reduced form of the S-polynomials.This procedure is tested to the aim of understanding the contribution of any of the implemented strategies.Finally, we propose an implementation of the algorithm SigmaGBasis2 based on the saturation of a Σ-ideal with respect to the grading defined by the order function.In practice, once one has homogenized the initial generators, the saturation ϕ(h) * is performed before the application of shifting, for each new element h obtained by the reduction of an S-polynomial.In output one returns the dehomogenization of the computed basis.Note that this procedure is correct only if one uses a Σ-ordering which is compatible with the order function and if the polynomials are kept in normal form modulo N during the computations.
The monomial Σ-orderings of P that we consider for the tests are defined in the following way.One has initially to fix a monomial ordering for Σ and we choose degrevlex in order to provide compatibility with the degree.Then, one fixes a monomial ordering, for us lex, over the subring P (1) = K[X(1)] or P (x 0 ) = K[x 0 (Σ)] that is extended as a block ordering to the polynomial ring P = K[X(Σ)] according to the choice of a variables ranking based on weight or index respectively.We distinguish these two cases in the examples by the letters "w" and "i".The integer that comes before these letters refers to the fixed order bound.Note that the algorithm SigmaGBasis2 is compatible only with rankings of type weight.
For the basic variant of the Gröbner Σ-bases algorithm, one can clearly use any implementation of the Buchberger's algorithm as, for instance, the one contained in the package Groebner of Maple.We have preferred instead to develop ourselves all different variants in order to have the same implementation and hence the same efficiency, for the fundamental subroutines of the algorithms.In this way, for the basic version we have been also able to access to important parameters of the computation as the total number of S-polynomial reductions.This number is for us the sum of the actual S-polynomials with the initial generators that are interreduced.Note that our implementation of the Buchberger's algorithm is in fact generally comparable with the built-in ones of Maple.For instance, the test falkow-6w-basic takes 9 hours, but using Groebner[Basis] it takes 11 hours with method=buchberger and 8.5 hours with method=maplef4.Other parameters that are considered for the experiments are the number of input and output generators.Note that for the basic algorithm we count generators and not Σ-generators.Finally, the parameter "minout" refers to the number of elements of a minimal Gröbner Σ-basis We give now some details about the examples we have used.All the examples are non-linear systems of ordinary or partial difference equations with constant coefficients which are of interest in literature.For instance, the tests falkow are obtained by the discretization of the Falkowich-Karman equation which is a non-linear twodimensional differential equation describing transonic flow in gas dynamics.The discretization we used are equations (41) in [11].Then, the navier examples are based on equations e 1 , e 2 , e 3 , e 4 of the system (13) in the paper [10] that are a finite difference scheme corresponding to the discretization (9) of the Navier-Stokes equations for two-dimensional viscous incompressible fluid flows.The tests heat are the discretization of the one-dimensional heat equation as described in the equations (10) and (11) of [20].Finally, eq26 and eq27 are the equations (2.6) and (2.7) at page 24 of [14] which are examples of ordinary difference equations that have periodic solutions.
By analyzing the experiments, it is sufficiently clear that the strategy implemented in SigmaGBasis is the safest one and hence on the average, the most efficient one.In fact, by decreasing the number of S-polynomials this strategy avoids the dramatical effects of involved reductions as for the tests falkow-6w and navier-8w.For simpler examples the four strategies appear essentially equivalent.The algorithms SigmaGBasis and SigmaGBasis2 lead to practically identical computations but the latter method suffers of some overhead which is probably due to our still experimental implementation.For instance, even if the normal form modulo the ideal N is described in the Definition 7.8, in our implementation we obtain it by computations that is by adding a Gröbner basis of N to the input basis for SigmaGBasis2.
The proposed algorithms usually provide only partial informations about the structure of Gröbner Σ-bases since they are in general infinite.Nevertheless, it is interesting to note that by means of the finite Σ-criterion we have been able to certify that the examples falkow, navier and heat have finite bases with respect to the weight ranking.In particular, the elements of the Gröbner basis of falkow have maximum top order equal to 4 and hence they are certified in order 8 in about 4 minutes.The example navier has max top order equal to 6 and its certification is obtained in order 12 in less than one hour.Finally, the example heat has max top order 2 and it gets certification in order 4 in 0 seconds.

Conclusions and future directions
This paper shows that one can not only generalize in a systematic way the Gröbner bases theory and related algorithms to the algebras of partial difference polynomials but also make these methods really work by introducing suitable gradings for such algebras.In fact, weight and order functions provide a Noetherian subalgebras filtration that implies termination and completeness certification for actual computations that are performed within some bounded degree that is over a finite number of variables.We have then developed the first implementation of a variant of the Buchberger's algorithm for systems of linear or non-linear partial difference equations.Even if such implementation is just experimental, the approach corresponding to the algorithm SigmaGBasis is strong enough to let it able to work with discretizations of real world systems of non-linear differential equations.
In this paper we consider difference equations with constant coefficients and hence a next step along this line of research is to extend the proposed methods to systems of difference equations with non-constant coefficients that is to assume that Σ acts on the base field K in a non-trivial way.Moreover, since the algebras of partial difference polynomials are free objects in the category of commutative algebras endowed with the action of a monoid Σ isomorphic to N r , a natural future direction consists in extending the ideas introduced here to other types of monoid symmetry over commutative algebras as the ones used, for instance, in algebraic statistic [4].Starting from Gröbner bases, classical directions are the computation of the Hilbert series and free resolutions that one may generalize to partial difference ideals or other types of invariant ideals.Finally, we aim to have the proposed algorithms implemented in the kernel of computer algebra systems in order to tackle involved problems related with the discretization of systems of partial differential equations [9,11,12].
. All examples have been computed with Maple 12 running on a server with a four core Intel Xeon at 3.16GHz and 64 GB RAM.The timings are given in hour-minute-second format.