Proofs: Buchberger's algorithm
These are the human proofs of Buchberger's algorithm, at full length.
Buchberger's algorithm stops and returns a Gröbner basis full
This proof shows: correctness, termination.
We use the notation of the page. is a field, is a monomial order on , and . For , is the lcm of and . An lcm-representation of by is an equation with whenever . We use two facts.
- Division (D). Division of by a list stops and gives , where no term of is divisible by any , and and whenever these are nonzero. (See multivariate division.)
- Buchberger's criterion (BC). A finite set of nonzero generators of is a Gröbner basis of if each of its S-polynomials has an lcm-representation. The product criterion: if and are coprime, has an lcm-representation by . (Both are proved on the page Buchberger's criteria.)
Invariants. At each test of line L3:
(I1) Each is a nonzero element of , and generates .
(I2) For each pair that is not in , has an lcm-representation by .
Initialization. After lines L1 and L2, holds the nonzero , which are in and generate (a zero generator adds nothing). Every pair is in , so (I2) holds with nothing to check.
Maintenance. Consider one round, with the pair removed at line L4. An lcm-representation by a list stays one when the list grows, since we may take for new elements. So (I2) for old pairs not in stays true, and we only check the pair and the new pairs.
- If line L5 skips the pair, the product criterion gives an lcm-representation of by .
- Otherwise line L6 gives, by (D), with . The leading terms of the two parts of cancel, so or . If , the sum is an lcm-representation (if all are and the empty sum is one). If , line L8 appends as , and is an lcm-representation, because .
- For (I1): is a combination of elements of , so , and when it is appended. Adding an element of to a generating set of keeps it a generating set.
- Line L9 puts each new pair into , so (I2) does not speak about them.
Exit. When line L3 finds , (I2) covers all pairs , and (I1) says that is a finite set of nonzero generators of . By (BC), is a Gröbner basis of . It contains the nonzero elements of by line L1, and line L10 returns it. If has no nonzero element, is empty, which is the Gröbner basis of by convention.
Termination. Let , a monomial ideal.
Step 1: each run of line L8 makes strictly larger. The new is a nonzero remainder, so by (D) no with divides any term of , in particular . A monomial lies in a monomial ideal exactly when one of the generating monomials divides it. So , and .
Step 2: line L8 runs finitely often. Suppose it ran infinitely often. Then is an infinite strictly increasing chain of ideals of . Its union is an ideal, and by the Hilbert basis theorem (or by Dickson's lemma for monomial ideals) it is generated by finitely many elements. Each of them lies in some , so all of them lie in one , and then , a contradiction.
Step 3: the loop stops. Let be the final length of , which exists by Step 2. Each round removes exactly one pair from at line L4, and pairs enter only at lines L2 and L9, with each time and each pair at most once. So receives at most pairs in total, and the number of rounds is at most . Each round stops, because division stops by (D).
Remark. The proof gives no bound on , because the chain argument of Step 2 is not quantitative. This is why the complexity section gives only bounds for the problem.