writing the difference of two algebraic sets as an algebraic set Let $S$ be an algebraic set of $k^n$, where $k$ is a field and let $f \in k[x] \doteq k[x_1,\cdots,x_n]$. I am interested in expressing $Y \doteq S-Z(f)$ as an algebraic set, i.e. as the zero set of some polynomials. Intuitively i can see that $Y$ corresponds to $(I_S)_f\doteq I_S \left(k[x] \right)_f$, that is the ideal generated by the vanishing ideal of $S$ in the localized ring $\left(k[x] \right)_f$. In other words $Y=Z((I_S)_f)$. The problem with this expression is that $(I_S)_f$ is not an ideal in a polynomial ring, so that i am not sure whether $Y$ is an algebraic set, strictly speaking. Any way to resolve this?
 A: First note that $Y$ is not, in general, cut out by polynomial equation in $k^n$. What is true, is that you can "embed" $Y$ in an affine space ($k^{n+1}$) such that you get a zero set of some polynomials.
You had the right idea of using the ideal generated by the vanishing ideal of $S$ in the localized ring $(k[x])_f$. Now what I think Youngsu meant in his comment, is that $k[x]_f\equiv k[x][t]/(tf-1)$ and therefore this $Y$ you have defined is a closed subset of the affine variety corresponding to $k[x][t]/(tf-1)$. If you have not yet learned this, you can observe that the ideal $<I_S>+(tf-1)\subset k[x][t]$ will cut out a subset that if you project the $t$ coordinate to $0$ you will obtain exactly the intersection you wanted.
EDIT: I will explain the last sentence in more details: Let $I_S=I(S)\subset k[x]$, and we denote by $<I_S>\subset k[x][t]$ the ideal generated by $I_S$. Let $I=<I_S>+(tf-1)$. We have the projection $\pi:k^{n+1}\to k^n$ defined by $(x_1,\ldots,x_n,t)\mapsto (x_1,\ldots,x_n)$, and my claim is that $\pi(V(I))=Y$. 
To prove this, first note that $V(I)=V(<I_S>)\cap V(tf-1)$. Now, $$V(<I_S>)=V(I_S)=\{(x_1,\ldots,x_n,t)\in k^{n+1}|\forall g\in I_S. g(x_1,\ldots,x_n,t)=g(x_1,\ldots,x_n)=0\}=\{(x_1,\ldots,x_n,t)|(x_1,\ldots,x_n)\in V(I_S)\subset k^n\}.$$
And, (this part is very important to understand and remember), $$V(tf-1)=\{(x_1,\ldots,x_n,t)|t\cdot f(x_1,\ldots,x_n)=1\}=\{(x_1,\ldots,x_n,\frac{1}{f(x_1,\ldots,x_n)})|f(x_1,\ldots,x_n)\ne 0\}.$$
So in total we get $$V(I)=\{(x_1,\ldots,x_n,\frac{1}{f(x_1,\ldots,x_n)})|(x_1,\ldots,x_n)\in Y\}$$ and we see that $\pi(V(I))=Y$.
