Gröbner Basis

Theorem
Let $F$ be a finite set of polynomials.

Let $SP \left({f_1, f_2}\right)$ be the $S$-polynomial of $f_1$ and $f_2$.

Let $g$ be a polynomial.

Let $RF \left({g}\right)$ be the reduced form of $g$.

Then $F$ is a Gröbner basis :
 * $\forall f_1, f_2 \in F \left({RF \left({F, SP \left({f_1, f_2}\right)}\right) = 0}\right)$

Necessary Condition
Let $F$ be a Gröbner basis.

Let $f_1, f_2 \in F$.

Then:
 * $SP \left({f_1, f_2}\right) \in Ideal \left({F}\right)$

That is:
 * $SP \left({f_1, f_2}\right) \equiv_F 0$

By the relation between reduction and congruence this implies that:
 * $SP \left({f_1, f_2}\right) \leftrightarrow_F^* 0$

Hence:
 * $RF \left({F, SP \left({f_1, f_2}\right)}\right) = RF \left({F, 0}\right) = 0$

because $F$ is a Gröbner basis (and because of the equivalence between the Church-Rosser property and the normal form Church-Rosser property).

Sufficient Condition
Let:
 * $\forall f_1, f_2 \in F \left({RF \left({F, SP \left({f_1, f_2}\right)}\right) = 0}\right)$

By the generalized Newman lemma and:
 * $\gets_F \mathop \subseteq \succ$

it suffices to prove local connectibility.

That is, it suffices to prove that under the assumption:
 * $g_1 \to_F h \gets_F g_2$

we have:
 * $g_1 \stackrel{\prec h} {\longleftrightarrow^*_F} g_2$

Let $LPP \left({f}\right)$ be the leading power product of $f$.

Then by the assumption, there exist $f_1, f_2 \in F$ and $t_1, t_2 \in S \left({h}\right)$ with:
 * $LPP \left({f_1}\right) | t_1$

and:
 * $LPP \left({f_2}\right) | t_2$

such that:
 * $h \rightarrow_{f_1, t_1} g_1$

and:
 * $h \rightarrow_{f_2, t_2} g_2$

Now we have three cases.

Case $t_1 \succ t_2$:

In this case:

and:

where:
 * $u_1 := \dfrac {t_1} {LPP \left({f_1}\right)}$

and:
 * $u_2 := \dfrac {t_2} {LPP \left({f_1}\right)}$

Furthermore:

Now:
 * $g_1 = h - C \left({h, t_1}\right) \cdot u_1 \cdot f_1$

and:
 * $g_{1, 2} = g_2 - C \left({h, t_1}\right) \cdot u_1 \cdot f_1$

and, by assumption:
 * $h \to_F g_2$

Hence, by sum semi-compatibility:
 * $g_1 \downarrow_{\stackrel{*} {F} } g_{1, 2}$

and hence:
 * $g_1 \stackrel{\prec h}{\longleftrightarrow^{*}_F} g_2$

(Note that, in general, $g_1 \to_{f_1} g_{1, 2}$ need not be the case. Why not?)

Case $t_1 \prec t_2$:

Analogous.

Case $t := t_1 = t_2$:

In this case:
 * $g_1 = H \left({h, t}\right) + 0 \cdot t + L \left({h, t}\right) - C \left({h, t}\right) \cdot u_1 \cdot R \left({f_1}\right)$

and:
 * $g_2 = H \left({h, t}\right) + 0 \cdot t + L \left({h, t}\right) - C \left({h, t}\right) \cdot u_2 \cdot R \left({f_2}\right)$

Hence:

where:
 * $v := t / LCM \left({LPP \left({f_1}\right), LPP \left({f_2}\right)}\right)$

We have assumed that:
 * $RF \left({F, SP \left({f_1, f_2}\right)}\right) = 0$

That is:
 * $SP \left({f_1, f_2}\right) \to_{\stackrel{\ast}{F}} 0$

Hence,by product compatibility:
 * $g_1 - g_2 = - C \left({h, t}\right) \cdot v \cdot SP \left({f_1, f_2}\right) \to_{\stackrel{*}{F}} 0$

This means that there exists a sequence $p \in P^{\ast}$ such that:

and:
 * $p_{\left\vert{p}\right\vert} = 0 $

Furthermore note that, because of $\to_F \subseteq \succ$:
 * $\forall 1 \le i < \left\vert{p}\right\vert: p_i\preceq g_1 -g_2 \prec h$

Thus, by sum semi-compatibility applied to $(1)$:
 * $g_1 = p_1 + g_2$


 * $\forall 1 \le i < \left\vert{p}\right\vert: p_i + g_2 \downarrow_{\stackrel{*}{F} } p_{i+1} + g_2$


 * $g_2 = p_{\left\vert{p}\right\vert} + g + 2$

Also, we have:
 * $\forall 1 \le i < \left\vert{p}\right\vert: p_i + g_2 \prec h$

because:
 * $\forall 1 \le i < \left\vert{p}\right\vert: H \left({p_i + g_2, t}\right) = H \left({h, t}\right) \wedge C \left({p_i + g_2, t}\right) = 0$

Thus, summarizing:
 * $g_1 \stackrel{\prec h} {\longleftrightarrow^{*}_F} g_2$ also in this case.

Buchberger's Algorithm
Input: a finite set of polynomials $F$

Output: $GB \left({F}\right)$, a Gröbner bases of $Ideal \left({F}\right)$ GB \left({F, B}\right) & : h = 0 \\ GB \left({F \cup h, B \cup \left\{ {h, f | f \in F}\right\} }\right) & : \text{otherwise} \end{cases}$
 * $Grobner$-$Basis \left({F}\right) := GB \left({F, \left\{ {f_1, f_2}\right\} | f_1, f_2 \in F}\right)$
 * $GB \left({F, \varnothing}\right) := F$
 * $GB \left({F, \left\{ {f_1, f_2}\right\} \cup B}\right) := \begin{cases}

where:
 * $h := RF \left({F, SP \left({f_1, f_2}\right)}\right)$