Confusion in a step of the proof of Strong Hilbert's Nullstellensatz. I am reading the book by Fulton on Algebraic Curves.There is a very important theorem and in fact a milestone theorem which is called Hilbert's Nullstellensatz.Let for a subset $S$ of $K[x_1,x_2,...,x_n]$  where $K$ is an algebraic closed field,$Z(S)$ denote the set of all common zeros in $\mathbb A^n_K$ of polynomials in $S$  and for $T\subset \mathbb A^n_K$,let $\mathbf I(T)$ denote the polynomials which vanish on $T$.Then Hilbert's Nullstellensatz states that $\mathbf I(Z(I)=\sqrt{I}$ for any ideal $I$.It says that if a polynomial $g$ vanishes on the zero set of $f_1,f_2,...,f_r$ then some power of $g$ is generated by $f_1,...,f_r$.I am having problem in understanding the proof of this theorem as given in the book which is as follows:
Let $g\in \mathbf I(Z(I))$,but $I$ is an ideal of $K[x_1,x_2,...,x_n]$ which is Noetherian.So,$I=\langle f_1,f_2,...,f_r\rangle$ where $f_i\in K[x_1,x_2,...,x_n]$.So, $g\in \mathbf I(Z(f_1,...,f_r))$ .Now let $J=\langle f_1,...,f_r,x_{n+1}g-1 \rangle\subset K[x_1,x_2,...,x_n,x_{n+1}]$ then $Z(J)$ is empty in $\mathbb A^{n+1}_K$  because $g$ vanishes whenever $f_1,...,f_r$ vanish.So,by weak Nullstellensatz $1\in J$ which implies that $1=\sum A_i(x_1,...,x_{n+1})f_i+B(x_1,...,x_{n+1})(x_{n+1}g-1)$.Now let $y=1/x_{n+1}$ and multiplying the equation by a high power of y we get, $y^N=\sum A_i(x_1,x_2,...,x_n,y)f_i+B(x_1,...,x_n,y)(g-y)$.Now substituting $g$ for $y$ we get the desired result as $g^N=\sum A_i(x_1,...,x_n)f_i$.
Actually I have problem in understanding the last two steps where they put $y=1/x_{n+1}$ and then in the last line put $g$ in place of $y$.Can someone tell me what we are doing basically and how to make it logically rigorous?
 A: So let's start from the equation
$$
1=\sum A_i(x_1,...,x_{n+1})f_i+B(x_1,...,x_{n+1})(x_{n+1}g-1)
$$
taking place in $K[x_1,\ldots,x_{n+1}]$. We can see this polynomial ring as $K[x_{n+1}][x_1,\ldots,x_n]$, and then, as $K[x_{n+1}]$ is a domain, we have a natural injection $K[x_{n+1}][x_1,\ldots,x_n]\to K(x_{n+1})[x_1,\ldots,x_n]$. In this latter ring, the same equation holds, but now $x_{n+1}$ is inveritble. Now, we have a natural injection $\iota:K[y][x_1,\ldots,x_n]\to K(x_{n+1})[x_1,\ldots,x_n]$, sending $y\to 1/x_{n+1}$ and fixing $K$ and the other variables. Now as stated in the proof, for every polynomial $P\in K(x_{n+1})[x_1,\ldots,x_n]$, there exists an $N_P>0$ such that $(1/x_{n+1})^{N_P}P$ has a preimage under $\iota$, i.e. $(1/x_{n+1})^{N_P}P=\iota(Q)$ for some $Q\in K[y][x_1,\ldots,x_n]$. Moreover, if $N\geq N_P$, then $(1/x_{n+1})^{N}P=\iota(y^{N-N_P}Q)$. For example, for the polynomial $P=x_{n+1}g-1$ we may choose $N_P=1$ and then we have $(1/x_{n+1})(x_{n+1}g-1)=\iota(g-y)$.
Now let $N$ be greater than any $N_{A_i}$ and also greater than $N_B+1$. Let $\tilde{A}_i$ be the preimage of $(1/x_{n+1})^N A_i$ and let $\tilde{B}$ be the preimage of $(1/x_{n+1})^{N-1}B$. Then we have
$$
(1/x_{n+1})^N \sum A_i(x_1,...,x_{n+1})f_i+B(x_1,...,x_{n+1})(x_{n+1}g-1)=\iota\left(\sum \tilde{A}_i(x_1,...,x_{n},y)f_i+\tilde{B}(x_1,...,x_{n},y)(g-y)\right).
$$
But the LHS is also equal to $(1/x_{n+1})^N=\iota(y^N)$. Hence, as $\iota$ is injective, we obtain
$$
y^N=\sum \tilde{A}_i(x_1,...,x_{n},y)f_i+\tilde{B}(x_1,...,x_{n},y)(g-y),
$$
and this equation takes place in $K[y][x_1,\ldots,x_n]$. At last, there is a morphism $K[y][x_1,\ldots,x_n]\to K[x_1,\ldots,x_n]$ sending $y$ to $g$ and fixing $K$ and the other variables. Applying this morphism to the above equation, we obtain
$$
g^N=\sum \tilde{A}_i(x_1,...,x_{n},g)f_i+\tilde{B}(x_1,...,x_{n},g)(g-g)=\sum \tilde{A}_i(x_1,...,x_{n},g)f_i
$$
and conclude the proof.
Note that there is a slight error in what you wrote: you went from $1=\sum A_i(x_1,...,x_{n+1})f_i+B(x_1,...,x_{n+1})(x_{n+1}g-1)$ to $y^N=\sum A_i(x_1,...,x_{n},y)f_i+B(x_1,...,x_{n},y)(g-y)$. But the preimage of $(1/x^{n+1})^N A_i$ under the natural inclusion isn't $A_i(x_1,...,x_{n},y)$, but $\tilde{A}_i=y^N A_i(x_1,...,x_{n},1/y)$, which by choice of $N$ really is a polynomial in $y$. And similar for $B$.
