Showing algebraic dependence of meromorphic functions on a compact Riemann surface I have been given the following question to do: Let $f,g$ be meromorphic functions on a compact Riemann Surface $R$. Show that there is some polynomial such that $P(f,g) = 0$ (i.e. show that any two meromorphic functions 
on $R$ are algebraically dependent). I have seen this result over the torus which follows from looking  at the Weierstrass $\wp$ function, however I have no idea how to generalise that to every compact Riemann Surface.

There is a hint which says I should let $d = m+n$ where $m,n$ are the valencies of $f,g$ respectively and consider $P(f,g) = \sum\limits_{j = 0}^d\sum\limits_{k = 0}^d a_{jk}f(z)^jg(z)^k$ and show that this has at most $d^2$ poles and that I can choose the $a_{jk}$ so that $P(f,g)$ has at least $d^2+2d$ roots and so is constant by the valency theorem. 

Showing that there are at most $d^2$ poles is easy but I don't know how to select the $a_{jk}$ to get $d^2+2d$ roots. I don't see whether I should try and find them explicitly (seems hard) or use some indirect argument (but I can't see where to start). Any help is much appreciated.
You can prove that there exists two polynomial $p,q\in \mathbb{C}[x,y]$ such that 

$ord_a(\frac{p(f,g)}{q(f,g)})\geq 0$ for every $a\in X$

so it is an olomorphic function on $X$ that is  a Compact R.S. so there exist a costant $c$ such that 

$\frac{p(f,g)}{q(f,g)})=c$

Then 

$p(f,g)-cq(f,g)=0$

But I don’t know how built these two polynomials.
We can indicate $\{a_1,\dots , a_n\}$ the set of the poles of $f$ and $\{b_1,\dots b_m\}$ the set of the poles of $g$. 

If $l:=ord_b(g)&lt;0$ and $ord_b(f)\geq 0$ then you have that 

$ord_b((f-f(b))^l g)\geq 0$ 

So you can resolve the problem in this particular case.
You can prove that there exists two polynomial $p,q\in \mathbb{C}[x,y]$ such that 

$ord_a(\frac{p(f,g)}{q(f,g)})\geq 0$ for every $a\in X$

so it is an olomorphic function on $X$ that is  a Compact R.S. so there exist a costant $c$ such that 

$\frac{p(f,g)}{q(f,g)})=c$

Then 

$p(f,g)-cq(f,g)=0$

But I don’t know how built these two polynomials.
We can indicate $\{a_1,\dots , a_n\}$ the set of the poles of $f$ and $\{b_1,\dots b_m\}$ the set of the poles of $g$. 

If $l:=ord_b(g)&lt;0$ and $ord_b(f)\geq 0$ then you have that 

$ord_b((f-f(b))^l g)\geq 0$ 

So you can resolve the problem in this particular case.