How to prove the number of poles minus the number of zeros is $2-2g$? I want to show that, for all differentials on the same Riemann surface S the
number of poles minus the number of zeros, counting multiplicities, always equals $2-2g$. It says this can be deduced from the following result:

By Riemann-Roch theorem we know that the dimension of holomorphic differentials on  Riemann surface $S$ equals $g(S)$, the genus of $S$, and that the $g$ elements of any basis cannot have common zeros.

I have no idea.

The number you want to compute is $$\deg K_S,$$ the degree of the canonical divisor. This appears in the Riemann-Roch formula: $$h^0(K_S)=\deg K_S+1-g+h^0(K_S-K_S).$$ Now you need to use:


*

*your knowledge of $h^0(K_S)=g$, and

*$h^0(K_S-K_S)=h^0(\mathcal O_S)=1$. 


Then you get $\deg K_S=2g-2$.
