# Computing lcm with Groebner basis.

I have the instructions to compute the lcm of two multivariate polynomials ideals. My course follows the spirit of "Ideals, Varieties and Algorithms" by Cox et alii. However, my recipe doesn't convince me fully. Let me explain myself:

Given $F,G \in K[X_1,\ldots,X_n]$ polynomials with coefficient in a field, then it holds that $\langle F \rangle \cap \langle G \rangle = \langle lcm(F,G) \rangle$.

Therefore, to compute a $lcm(F,G)$ I should compute a Groebner basis of the intersection $\langle F \rangle \cap \langle G \rangle$. This can be done with following procedure:

1. Compute the ideal $\langle TF,(1-T)G \rangle$ in $K[T,X_1,\ldots,X_n]$
2. Then, given a Groebner basis $\mathbb{G}$ of $\langle TF,(1-T)G \rangle$ with respect to lexicographic order and variable ordering $T > X_1 > \ldots > X_n$, $\mathbb{G} \cap K[X_1,\ldots,X_n]$ is a Groebner basis of the intersection.

My question is: how does this imply that $\mathbb{G} \cap K[X_1,\ldots,X_n]$ is precisely the lcm of the two polynomials?

My thoughts

Ok, so reducing to a minimal Groebner basis solves the problem since in that case I would have that the generator element needs to be the lcm.

Basically, if $G$ is a Gröbner basis of the ideal $I$ in $k[x_1,...,x_n]$ with respect to the lex order $x_1>x_2>...>x_n$ then $G\cap k[x_2,...,x_n]$ is a Gröbner basis of the ideal $I\cap k[x_2,...,x_n]$ of $k[x_2,..,x_n]$ with respect to the lex order $x_2>...>x_n$.
Now when you compute a Gröbner basis of the ideal $I=(TF,(1-T)G)$ and intersect with $k[x_1,...,x_n]$, what you get is a Gröbner basis of the ideal $J=I\cap k[x_1,...,x_n]$.
We need to show that $J=(F)\cap (G)$. Note that if $H = F\cdot P = G\cdot Q\in (F)\cap (G)$ for some polynomials $P$ and $Q$, then we also have $H=T\cdot F\cdot P+(1-T)\cdot G\cdot Q$ which implies that $H\in I$. Conversely, if $H\in J$ then $H=T\cdot F\cdot P+(1-T)\cdot G\cdot Q$ for some polynomials $P,Q$ so $H=G\cdot Q + T\cdot (F\cdot P-G\cdot Q)$. Since $H$ does not have the variable $T$, we get $H=G\cdot Q$ and $G\cdot Q = F\cdot P$ so $H\in (F)\cap (G)$.
About your last question. You asked why the intersection of the Gröbner basis with the ring $k[x_1,...,x_n]$ has only one element. This is not necessarily true, but it is almost true. The intersection $G\cap k[x_1,...,x_n]$ is a Gröbner basis of the principal ideal $(F)\cap (G)$, so there exists a polynomial in this Gröbner basis which is again a Gröbner basis for the ideal (or just compute the reduced Gröbner basis from the given Gröbner basis to find the generating polynomial of the intersection).