This is a problem from Ideals, Varieties, and Algorithms by Cox et. al.

$V\subset \mathbb{P}^n(k)$ is irreducible, prove that $\dim(V)$ is the transcendence degree of $k(V)$ over $k$, where $k(V)$ is the rational function field defined on $V$.

The hint says reduce to the affine case.

So I used the fact that $\dim(V)=\dim(V^a)-1$ where $V^a$ is $V$ considered as an affine variety. We know that $\dim(V^a)$ is the transcendence degree of $k(V^a)$ over $k$. It is also the largest number of elements in $k(V^a)$ that are algebraically independent in $k$.

Suppose this number is $d$. Then we can find $\phi_1,\dots, \phi_d\in k(V^a)$ that are algebraically independent in $k$.

I need to show that we can only find $d-1$ of them in $k(V)$ that are algebraically independent. So these $d$ elements are algebraically dependent in $k(V)$. How to find this polynomial, and how to show we have to remove one of them to make them independent?

Thank you for any help!