Solution (source code)

= Solution

The set $\widetilde P$ contains zero. It is closed under negatives because $-f\in P$ whenever $f\in P$. If $f,g\in P$ and $n,m>0$, then
$$
\frac fn+\frac gm=\frac{mf+ng}{nm}\in\widetilde P,
$$
since $P$ is an <ideal> of $\mathbb Z[t]$. Also, any $q\in\mathbb Q[t]$ can be written $q=h/d$ with $h\in\mathbb Z[t]$ and $d>0$, giving
$$
q\frac fn=\frac{hf}{dn}\in\widetilde P.
$$
This proves that $\widetilde P$ is an <ideal> of $\mathbb Q[t]$.

Clearly $P\subseteq\widetilde P\cap\mathbb Z[t]$, by taking denominator one. Conversely, if $h\in\widetilde P\cap\mathbb Z[t]$, then $nh\in P$ for some positive <integer> $n$. The condition $P\cap\mathbb Z=\{0\}$ implies $n\notin P$. Since $P$ is a <prime ideal>, $nh\in P$ forces $h\in P$. Hence
$$
\boxed{\widetilde P\cap\mathbb Z[t]=P.}
$$
In particular, $\widetilde P$ is nonzero because it contains the nonzero <ideal> $P$, and it is proper: otherwise its intersection with $\mathbb Z[t]$ would contain $1$. This is the concrete <extension of an ideal> and <contraction of an ideal> calculation for the <localization> that inverts nonzero <integers>.