Proofs: Multivariate division algorithm
These are the human proofs of Multivariate division algorithm, at full length.
The division algorithm stops and returns a valid quotient and remainder full
This proof shows: correctness, termination.
Fix a field , a monomial order on , a polynomial and nonzero . We write , and for the leading monomial, term and coefficient for , and we use two facts about a monomial order. (O1) If then for each , by compatibility with multiplication. (O2) There is no infinite strictly descending sequence of monomials, because is a well-ordering.
Invariant. At each test of line L2:
(D1) . (D2) No term of is divisible by any . (D3) If , then . Each monomial of each is at most .
Initialization. Line L1 sets , and . Then (D1) reads , (D2) holds because has no terms, and (D3) holds because and each .
Maintenance, division step. Assume and that line L5 finds the first with . Let , a term . Lines L6 and L7 replace by and by . The sum becomes , so (D1) still holds. The remainder does not change, so (D2) holds. The term , so by the product rule for leading terms. Each other monomial of is with , so by (O1) with strict inequality (a monomial order is compatible with strict inequality too, because it is a total order and times two distinct monomials gives two distinct monomials). So in the term cancels and every other monomial is smaller than the old . Hence the new is or has . The new monomials of are those of , all at most . So (D3) holds.
Maintenance, remainder step. Assume and no divides . Lines L11 and L12 add to and subtract it from . The sum does not change, so (D1) holds. The new term of is not divisible by any , and the monomial is not yet in , because every earlier term of was a leading monomial of an earlier and these are strictly larger (see below). So (D2) holds. The new is or has a smaller leading monomial. So (D3) holds.
Termination. In both steps, the new is or . Suppose the loop of line L2 ran forever. Then the leading monomials of in successive passes would form an infinite strictly descending sequence, which (O2) forbids. So the loop stops after finitely many passes, and the inner loop of line L4 stops after at most steps in each pass. For a graded order the number of passes is at most the number of monomials of degree at most , which is , because the leading monomials of are distinct monomials of degree at most (the degree argument is in the Complexity section of the page). This gives an explicit bound in that case.
The output. When the loop stops, . Then (D1) is , (D2) is condition 2 of the output, and (D3) gives condition 3: if then its leading monomial is one of its monomials, so it is at most . If , the loop does not run and the output is , , which meets the specification.
Uniqueness for a Gröbner basis. Let be a Gröbner basis of , and let be two outputs of the algorithm for with two orders of the divisors or two choices at line L5. Then . If , then is divisible by some , by the definition of a Gröbner basis. But is a monomial of or of , and by (D2) no divides it. This is a contradiction, so . If , then , and the same argument with gives .