The Gröbner walk returns the reduced Gröbner basis for the target order and stops full
This proof shows: correctness, termination.
Let K be a field, R=K[x1,…,xn], and I⊆R an ideal. For a nonnegative weight w and a monomial order >, write (w;>) for the order that compares w-weights first and breaks ties by >; it is a monomial order because w≥0. A polynomial is w-homogeneous if all its terms have the same w-weight. LM>(f) is the leading monomial of f for >, and LM>(J) is the monomial ideal spanned by the leading monomials of the elements of an ideal J. We use one known theorem: an ideal has only finitely many distinct monomial ideals LM>(I) as > runs over all monomial orders (Mora and Robbiano 1988; Sturmfels, Gröbner Bases and Convex Polytopes, Theorem 1.2).
Lemma 1 (comparing initial ideals). If >a and >b are monomial orders with LM>a(I)⊆LM>b(I), then the two ideals are equal.
Proof. Suppose m∈LM>b(I) but m∈/LM>a(I). Reduce a polynomial of I with leading monomial m by the Gröbner basis for >b, leaving its leading term: this gives f∈I with f=m+(monomials not in LM>b(I)). Those monomials are not in the smaller ideal LM>a(I) either, and neither is m. So every monomial of f=0 is standard for >a, and LM>a(f)∈/LM>a(I), which contradicts f∈I. □
Lemma 2 (initial ideals). For w≥0 and any monomial order >:
- every w-homogeneous element of inw(I) is 0 or inw(f) for some f∈I, and inw(I) is spanned by such elements;
- LM(w;>)(I)=LM>(inw(I))=LM(w;>)(inw(I));
- the reduced Gröbner basis of inw(I), for any order, consists of w-homogeneous polynomials.
Proof. (1) An element of inw(I) is ∑iqiinw(fi) with fi∈I. Its w-homogeneous component of weight c is h=∑iqi′inw(fi), where qi′ is the part of qi of weight c−w⋅(weight of inwfi). Then f=∑iqi′fi∈I equals h plus terms of weight less than c, so h=inw(f) if h=0.
(2) For f∈I, LM(w;>)(f)=LM>(inw(f)), since (w;>) first selects the terms of largest weight. With (1), the leading monomials of elements of inw(I) for > are the leading monomials of their w-homogeneous components, which are the LM>(inw(f)). This gives the first equality. For a w-homogeneous h, LM(w;>)(h)=LM>(h), which gives the second.
(3) Let J=inw(I) and h an element of its reduced Gröbner basis. Let hc be the w-homogeneous component of h that contains LM(h); by (1), hc∈J, and LM(hc)=LM(h). All monomials of h−hc are non-leading monomials of h, so they are standard for J. Since h−hc∈J, it is 0. □
Lemma 3 (one step). Suppose that at line L4, G is the reduced Gröbner basis of I for Mold, and LMMold(g) is a monomial of inw(g) for every g∈G. Then lines L4 to L6 make G the reduced Gröbner basis of I for Mnew=(w;Mt).
Proof. By hypothesis, LMMold(g)=LM(w;Mold)(g) for every g∈G. So LMMold(I), which these monomials generate, is contained in LM(w;Mold)(I), and by Lemma 1 the two are equal. By Lemma 2(2) this is LMMold(inw(I)). The inw(g) lie in inw(I) and their leading monomials for Mold generate this ideal, so they form a Gröbner basis of inw(I) for Mold.
The ideal ⟨inw(g)⟩ is therefore inw(I), and line L4 computes its reduced Gröbner basis H for Mnew. Take h∈H; it is w-homogeneous of some weight c, by Lemma 2(3). Division by a Gröbner basis leaves remainder 0 on an element of the ideal, so line L5 writes h=∑gpginw(g). Each step of the division subtracts a multiple axμinw(g) whose leading monomial is a monomial of the current dividend, which stays w-homogeneous of weight c; so every term of pginw(g) has weight c. Then
h′=g∑pgg=h+g∑pg(g−inw(g)), and every term of the sum has weight less than c. So h′∈I, inw(h′)=h, and LMMnew(h′)=LMMnew(h) because Mnew compares weights first. These monomials generate LMMnew(inw(I)), which by Lemma 2(2) with >=Mt equals LMMnew(I). So the h′ form a Gröbner basis of I for Mnew, and the interreduction at line L6 (removing elements whose leading monomial is divisible by another's, reducing tails and making the result monic) turns it into the reduced one. □
Lemma 4 (the invariant). The hypothesis of Lemma 3 holds at every execution of line L4. The value u of line L8 satisfies 0<u≤1.
Proof. At the first execution, w=σ is the first row of Mold=Ms, so LMMs(g) has the largest σ-weight among the terms of g and lies in inσ(g).
After lines L4 to L6, G is reduced for Mnew=(w;Mt) by Lemma 3. Let g∈G, α=LMMnew(g), and β=α a monomial of g; put a=w⋅(α−β) and b=τ⋅(α−β). Then a≥0. If b<0, then a>0: if a=0, the tie is broken by Mt, whose first row is τ, so α>Mtβ forces b≥0. So each candidate a/(a−b) of line L8 lies in (0,1), and 0<u≤1. The next weight is w′=(1−u)w+uτ≥0, and
w′⋅(α−β)=(1−u)a+ub≥0, which is clear if b≥0 and holds if b<0 because u≤a/(a−b). So α is a monomial of inw′(g), and line L9 sets Mold=Mnew, for which α is the leading monomial. Replacing w′ by a positive multiple, as the implementation does, changes neither initial forms nor the order (w′;Mt). □
Lemma 5 (termination). The loop runs a finite number of times.
Proof. Write w(s)=(1−s)σ+sτ for s∈[0,1]. Every weight used is a positive multiple of some w(s), because a nonnegative combination of a multiple of w(s) and τ is a multiple of a point of the segment from w(s) to τ. Let s0=0<s1<s2<⋯ be the parameters of the weights used; they increase strictly because u>0, unless w(sk) is already a multiple of τ, in which case no candidate exists, u=1, and the next step has w=τ and stops. Let L(s)=LM(w(s);Mt)(I).
The set of s with L(s)=L∗ for a fixed monomial ideal L∗ is an interval. Let G∗ be the reduced Gröbner basis for an order with that initial ideal; each g∈G∗ is αg plus monomials outside L∗. If L(s)=L∗, the reduced basis for (w(s);Mt) is G∗, since a reduced basis is determined by its initial ideal (each element is m minus the unique combination of standard monomials congruent to m modulo I). Its leading monomials are then the αg, because the other monomials are not in L∗. Conversely, if LM(w(s);Mt)(g)=αg for all g∈G∗, then L∗⊆L(s) and Lemma 1 gives equality. So L(s)=L∗ exactly when, for every g∈G∗ and every other monomial β of g, either w(s)⋅(αg−β)>0, or it is 0 and αg>Mtβ. Each condition defines an interval of s, since w(s) is affine in s; so does their intersection.
At step k the algorithm computes the reduced basis Gk for (w(sk);Mt). The step from sk to sk+1 is chosen at a value where some g∈Gk and monomial β satisfy w(sk+1)⋅(αg−β)=0 and τ⋅(αg−β)<0, so β>(w(sk+1);Mt)αg. By the characterization above, L(sk+1)=L(sk). Since each value of L occupies an interval of s and the sk increase, the values L(s0),L(s1),… are pairwise distinct. By the theorem of Mora and Robbiano there are finitely many, so the loop stops. □
Theorem. Let G be the reduced Gröbner basis of I for Ms, where the first rows of Ms and Mt are nonnegative. Then GROEBNER-WALK(G,Ms,Mt) terminates and returns the reduced Gröbner basis of I for Mt.
Proof. By Lemma 5 the loop ends, and it can only end at line L7, with w=τ. By Lemmas 3 and 4, at that moment G is the reduced Gröbner basis of I for (τ;Mt). Since τ is the first row of Mt, the order (τ;Mt) is the order Mt, so G is the reduced Gröbner basis for Mt. ■