# From polynomial ideal over $\mathbb{Q}$ to polynomial ideal over $\mathbb{Z}$

Is there an algorithm to compute, given a polynomial ideal $I\subset \mathbb{Q}[x_1,\dotsc,x_n]$, the ideal $I\cap \mathbb{Z}[x_1,\dotsc,x_n]$ in $\mathbb{Z}[x_1,\dotsc,x_n]$?

The input and output can be given via a finite set of generators. From chapter 10 of book "Gröbner bases" by Becker and Weispfenning, I am familiar with Gröbner bases over PID, and in particular understand how to compute the intersection of polynomial ideals over PID (though it is not explicitly mentioned in the book, as far as I can see). However, $\mathbb{Z}[x_1,\dotsc,x_n]$ is not an ideal in $\mathbb{Q}[x_1,\dotsc,x_n]$. It is tempting to work in the ring $\frac{1}{D}\mathbb{Z}[x_1,\dotsc,x_n]$ for large very composite integer $D$, but how large is large enough?

I am aware that I am replying to an old question that has been satisfactorily answered, but I think it might be worth while pointing out, for the completeness of MathOverflow, that the question is discussed (in slightly greater generality, and with an example) as corollary 4.4.5 in the book An Introduction to Gröbner Bases by William Adams and Philippe Loustaunau (AMS 1994, Graduate Studies in Mathematics 3). The method is the same as in the approved answer, but formulated in a slightly different way. Their statements (very slightly reworded) are:

Proposition 4.4.1 [computation of the saturation]: Let $R$ be an integral domain and $I$ a non-zero ideal of $A = R[x_1,\ldots,x_n]$. Let $g\in A$, $g\neq 0$. Let $w$ be a new variable. Consider the ideal $\langle I,wg-1\rangle$ of $A[w]$. Then $I A_g \cap A = \langle I, wg-1\rangle \cap A$ where $A_g = A[\frac{1}{g}]$.

(Note that the intersection $\langle I, wg-1\rangle \cap A$ in $A[w]$ can be computed using an elimination order on the variables: it is theorem 4.3.6 in that book.)

Proposition 4.4.4: Let $R$ be an integral domain with $k$ its quotient field. Let $I$ be a non-zero ideal of $A = R[x_1,\ldots,x_n]$ and let $G = \{g_1,\ldots,g_t\}$ be a Gröbner basis for $I$ with respect to some term ordering. Let $s$ be the product of the leading coefficients of $g_1,\ldots,g_t$. Then $$I k[x_1,\ldots,x_n] \cap R[x_1,\ldots,x_n] = IR_s[x_1,\ldots,x_n] \cap R[x_1,\ldots,x_n]$$

(This is essentially what the approved answer to this question explains.)

Corollary 4.4.5: Let $R$ be an integral domain in which linear equations are algorithmically solvable and let $k$ be its quotient field. Let $I$ be an ideal of $A = R[x_1,\ldots,x_n]$. Then we can compute generators for the ideal $I k[x_1,\ldots,x_n] \cap R[x_1,\ldots,x_n]$.

(This follows immediately from the above results.)

Let J be a finitely generated ideal in $A = \mathbf{Z}[x_1,\dotsc,x_n]$. (Take your ideal $I$ and scale its generators to clear denominators.) The ideal you want is then $$J' = \{f\in A: \exists n\in\mathbf{Z}. n\neq 0 \text{ and } nf\in J\}.$$ To find a finite list of generators for $J'$ we do the following.

1. Compute a Groebner basis for $J$, and let $N$ be the product of the leading coefficients of the elements of the Groebner basis.

2. Compute a finite list of generators for the saturation $(J:N^\infty)$ of $J$ with respect to $N$. One can compute such generators using Groebner bases in several ways, which you can probably look up easily.

We have $J' = (J:N^\infty)$, and so we have the desired generators for $J'$.

Here is why it works: it is clear that $(J:N^\infty)$ is contained in $J'$. To see the reverse inclusion we argue as follows. Note that the ring $(A/J)_N$ (invert $N$) is free over $\mathbf{Z}[1/N]$, since when we invert $N$ the Groebner basis for $J$ becomes monic, and the division algorithm allows us to reduce elements of $A$ uniquely to sums standard monomials modulo $J$. Consequently, for any non-zero $d\in\mathbf{Z}[1/N]$ and any $f\in (A/J)_N$, if we have $df = 0$, then we may conclude that $f=0$.

Now let $f\in J'$: we have $f\in A$ and $nf\in J$ for some $n\in\mathbf{Z}$ with $n\neq 0$. We then have $nf = 0$ in $(A/J)_N$, and so we may conclude that $f=0$ in $(A/J)_N$. The kernel of $A/J\to (A/J)_N$ is the image modulo $J$ of the saturation $(J:N^\infty)$; we thus have $f\in (J:N^\infty)$, as desired.

• Aha, the trick is not to work with large $D$ as suggested in my question, but with "symbolically large" D, which is what saturation does. Today I learned why saturation is nice! – Boris Bukh Jul 30 '15 at 19:03
{"ft_lang_label":"__label__en","ft_lang_prob":0.8590672,"math_prob":0.9996371,"size":1841,"snap":"2020-34-2020-40","text_gpt3_token_len":570,"char_repetition_ratio":0.14371258,"word_repetition_ratio":0.055172414,"special_character_ratio":0.30146658,"punctuation_ratio":0.15479116,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9999925,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-08-13T08:32:44Z\",\"WARC-Record-ID\":\"<urn:uuid:50d1ca1e-dcb2-424e-99a3-8b812edf79fb>\",\"Content-Length\":\"134341\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:e597a8c9-bf3d-4de7-8213-07756b6d8e9a>\",\"WARC-Concurrent-To\":\"<urn:uuid:7b59bfcb-faf5-48cb-a4e0-1eafaa03e348>\",\"WARC-IP-Address\":\"151.101.129.69\",\"WARC-Target-URI\":\"https://mathoverflow.net/questions/212653/from-polynomial-ideal-over-mathbbq-to-polynomial-ideal-over-mathbbz\",\"WARC-Payload-Digest\":\"sha1:55PMC7D64YDZ4ZIH73TC7DUBI4EK22J4\",\"WARC-Block-Digest\":\"sha1:5EKUM4DGTHSOTVJ4WTHRPIU46FIILBMN\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-34/CC-MAIN-2020-34_segments_1596439738964.20_warc_CC-MAIN-20200813073451-20200813103451-00233.warc.gz\"}"}