TITLE: Deciding if a polynomial can be expressed as a rational function of other polynomials
QUESTION [5 upvotes]: Let $R = \mathbb{C}[x_1,x_2,x_3,x_4]$ be a polynomial ring and consider the polynomials $f_i = (x_i-x_{i+1})^2, i = 1,2,3$ and $f_4 = (x_4 - x_1)^2$ in $R$. Also, let $f = (x_1 - x_3)^2$.
I want to prove that $f$ is in the subfield $\mathbb{C}(f_1,f_2,f_3,f_4)$ of $\text{Frac}(R) = \mathbb{C}(x_1,x_2,x_3,x_4)$. I can show this geometrically: let $V \subseteq \mathbb{C}^4$ be the Zariski closure of the image of $\mathbb{C^4}$ under $(f_1,f_2,f_3,f_4)$ (viewed as a polynomial map) and similarly let $V'\subseteq \mathbb{C}^5$ be the closure of the image of $\mathbb{C}^4$ under $(f_1,f_2,f_3,f_4,f)$. These are irreducible varieties. Now we can consider the projection $\pi : V' \rightarrow V$. I can show that this is generically one-to-one, which (as far as I know) implies that the varieties are birational, so they have the same function fields, and this is equivalent to what we wanted to show.
I wonder if there is an algebraic way to show this. I'm not a hundred percent sure what I want "algebraic" to mean here - as a first approximation, I'm looking for a proof that does not use the notion of a variety. Also, as far as I can tell, the above proof does not explicitly give me a rational function $g$ with $f = g(f_1,f_2,f_3,f_4)$. (Well, it is possibly hidden in the proof of "generically one-to-one -> birational", but I feel there should be an easier way to find $g$ in this case.)

How can we find a rational function $g$ with $f = g(f_1,f_2,f_3,f_4)$?

I would prefer a proof which is an example of a general method, rather than an "ad-hoc" or "tricky" solution that only works in this particular case, though I would also be interested in the latter.

What kind of "algebraic" tools are there to show that a given polynomial is in the field of rational functions generated by some other polynomials? Can we use somehow the fact that in this case the polynomials are homogenous of degree two?

REPLY [5 votes]: In this case $$ f = \frac{(f_1-f_2+f_3-f_4)(f_1 - f_2 - f_3 + f_4)}{2(f_1+f_2-f_3-f_4)}.$$
This is obtained as one of the elements (as denominator times $f$ minus numerator) in a Gröbner basis of the ideal $$(f_1-(x_1–x_2)^2, \ldots, f_4-(x_4-x_1)^2, f-(x_1-x_3)^2)$$ where $f_1, \ldots, f_4, f$ are treated as indeterminates with a (lexicographical) ordering $$\{f_1, \ldots, f_4\} < f < \{x_1, \ldots, x_4\}.$$