TITLE: Proof that the set of intersection points is finite
QUESTION [6 upvotes]: I am trying to understand the proof of the following theorem:

Let $f,g\in K[x,y]$ without a common factor. Then $\#V(f,g)<\infty$.

(Here $K$ is a field and $V(f,g):=\left\{(a,b):f(a,b)=g(a,b)=0\right\}$.)
One step in this proof is not clear to me: 
We consider $f$ and $g$ as elements of $K(y)[x]$, where $K(y)$ is the field of all rational functions over $K$ in $y$. Then $\gcd(f,g)=1$ in $K(y)[x]$. 
My question: Why is this the case? 
It is clear to me that $K[x,y]\subset K(y)[x]$, but why can't $f$ and $g$ have a common factor in this larger set?
I tried to assume the opposite that there is some common factor $h\in K(y)[x]$ such that $f=h\cdot h_1$ and $g=h\cdot h_2$ where $h_1,h_2\in K(y)[x]$. If I then take the least common multiple of the denominators of $h_1,h_2$ and $h$, i.e. some $b\in K[y]$, I obtain the equations $b\cdot f=\bar h_1\cdot\bar h$ and $b\cdot g=\bar h_2\cdot\bar h$ for some $\bar h,\bar h_1,\bar h_2\in K[x,y]\subset K(y)[x]$. Know I tried to use that $K(y)[x]$ admits a unique decomposition of each element in a product of irreducible elements...and got stuck.
As I am not an algebraist, could someone please explain to me in simples words, how to prove this result without using too much theory from algebraic geometry (which I am not familiar with)?
Thank you very much in advance!

REPLY [3 votes]: Let's reformulate your question like this: 

$R$ is a UFD and $f,g\in R[X]$ with $\gcd(f,g)=1$. Then they have the same property in $F[X]$, where $F$ is the field of fractions of $R$.

Suppose the contrary: $\gcd(f,g)\ne1$ in $F[X]$, so there is $h\in F[X]$ with $\deg h\ge 1$ such that $h\mid f$ and $h\mid g$ in $F[X]$. Then there are $f_1,g_1\in F[X]$ such that $f=hf_1$, and $g=hg_1$. Now multiply both relations by $a^2$, where $a\in R$ is such that $ah,af_1,ag_1\in R[X]$, and get $a^2f=(ah)(af_1)$, $a^2g=(ah)(ag_1)$ in $R[X]$, that is, $ah\mid a^2f$ and $ah\mid a^2g$ in $R[X]$. It follows $ah\mid \gcd(a^2f,a^2g)=a^2$ in $R[X]$, so $a^2=(ah)k$ with $k\in R[X]$. By taking the degrees we get $\deg h=0$, a contradiction.