Ideal of functions vanishing on a plane algebraic curve Note: The specific question I am asking in this post is marked $(*)$ below.

Let $k$ be a field and let $P\in k[X,Y]$ be an irreducible polynomial. Denote by $$\mathcal{V}(P) = \big\{(x,y)\in k^2\ |\ P(x,y)=0\big\}$$ the vanishing locus of $P$. When $k$ is algebraically closed, Hilbert's Nullstellensatz implies that the ideal of polynomials vanishing on the zero locus of $P$ is the ideal generated by $P$: $$\mathcal{I}\big(\mathcal{V}(P)\big) = \sqrt{(P)} = (P).$$ As $P$ is irreducible, it generates a prime ideal in $k[X,Y]$, so $\mathcal{V}(P)$ is irreducible when $k$ is algebraically closed.
When $k$ is not algebraically closed, the latter statement is no longer necessarily true:

*

*An irreducible polynomial $P\in k[X,Y]$ whose zero set in $\mathbb{R}^2$ is not irreducible.

But in that example, $\mathcal{V}(P)$ is finite. And in Exercise 3 on page 24 of Perrin's textbook Algebraic Geometry: an introduction, the author says that, if one assumes additionally that $\mathcal{V}(P)$ is infinite, then the ideal of polynomials vanishing on the zero locus of $P$ coincides with the ideal generated by $P$: $$\mathcal{I}\big(\mathcal{V}(P)\big) = (P).$$
Here is how Perrin phrases it:
Link to the image.
Since the ideal generated by $P$ is still prime in $k[X,Y]$, this proves that $\mathcal{V}(P)$ is irreducible when $P\in k[X,Y]$ and $\mathcal{V}(P)$ is infinite.
However, I am not sure how to prove that \begin{equation}(*)\quad \big(P\ \mathrm{irreducible\ in}\ k[X,Y]\ \mathrm{and}\ \mathcal{V}(P)\ \mathrm{infinite\ in}\ k^2\big) \  \Rightarrow \  \mathcal{I}(\mathcal{V}(P)) = (P).\end{equation} It has to be specific to two variables, because there are counter-examples in higher dimension:

*

*Zero set of homogeneous polynomials over the reals.

Would anyone have some pointers? I am interested in the statement for $k$ an abstract (infinite) field, but if there is a specific argument over $\mathbb{R}$, it would also be interesting.
 A: You can find a proof of this result in the book Algebraic Curves by Fulton. The approach taken there consists of two steps:

*

*Show that if two polynomials $P,Q \in k[X,Y]$ are coprime, then $\mathcal{V}(P,Q)$ is a finite set of points.

*Deduce $(*)$ as a corollary.

To prove the first statement, we observe that $P$ and $Q$ are still coprime in $k(X)[Y]$ by Gauss's lemma, so there exist polynomials $R,S \in k(X)[Y]$ such that $RP+SQ = 1$. Clearing denominators, we find that $AP+BQ = D$ is a polynomial in $k[X]$ for some $A,B \in k[X,Y]$. Now, if $(a,b) \in \mathcal{V}(P,Q)$, then $a$ is a root of $D$, so there are only finitely many possibilities for $a$. Repeating the same argument with $X$ and $Y$ interchanged, we find that there are only finitely many possibilities for $b$ as well.
To deduce $(*)$, we only need to prove that $\mathcal{I}(\mathcal{V}(P)) \subseteq (P)$, since the other inclusion always holds. If $Q \in \mathcal{I}(\mathcal{V}(P))$, then $\mathcal{V}(P,Q) = \mathcal{V}(P)$ is infinite, so by 1. we must conclude that $P$ and $Q$ have a factor in common. But $P$ is irreducible, so this factor must be $P$ itself, i.e. $Q \in (P)$.
