Is the sum of the orders of the zeros and poles of a meromorphic function 0? Suppose $f$ is a meromorphic function on a compact Riemann surface. How do I go about showing that the sum of the orders of the poles and zeros of $f$ is 0? This really surprises me because I cannot see a reason as to why there should be any relation between the poles and the zeros of a meromorphic function. Perhaps a compact Riemann surface gives some sort of symmetry structure? I am a bit lost - any help is appreciated. 
 A: Let $X$ be a compact Riemann surface and $f$ be meromorphic on $X$. Its divisor of zero/poles $$div(f) = \sum_{l=1}^L n_l P_l$$  let $U \subset X$ be a fundamental domain : an open $U \subset X$ which is homeomorphic to a simply connected domain and such that $X = U \cup \partial U$.  Choose it such that $f$ has no zero/pole on $\partial U$ and think to $\partial U$ not as a subset of $X$ but as the curve enclosing $U$. With the residue theorem / argument principle $$ \deg(div(f))=\sum_{l=1}^L n_l = \int_{\partial U} \frac{df}{2i \pi f}$$
Topologically $X$ is obtained by gluing some edges of $\partial U$ together, that is $\partial U = \bigcup_{j=1}^J\gamma_j$ and each piece of curve $\gamma_i$ is glued to some other $\gamma_j$. The 
 complex topology induces an orientation, thus when we glue $\gamma_i,\gamma_j$ together, they must appear in reverse direction in the boundary of $U$ (since otherwise $U$ would contain twice the points "on the left side" of $\gamma_i$). Whence $\int_{\gamma_i}+\int_{\gamma_j} =0$ and  $$\int_{\partial U} \frac{df}{2i \pi f} = 0$$
A: I found a nice argument in the book an introduction to Riemann surfaces available in Springer.

Proposition. For a nontrivial meromorphic function $f$ (i.e., $f$ is not everywhere zero) on a compact Riemann surface $X$, counting multiplicities, the number of zeros is equal to the number of poles. More precisely, if $Z$ is the set of zeros, $P$ is the set of poles, $\mu_p$ is the order of the zero at each point $p\in Z$, and $\nu_p$ is the order of the pole at each point $p\in P$, then
$$\sum_{p\in Z\cup P}\operatorname{ord}_pf = \sum_{p\in Z}\mu_p-\sum_{p\in P}\nu_p =0.$$

Proof. For $r>0$ sufficiently small, the local representation of meromorphic functions allows us to fix disjoint local holomorphic charts $\{(U_p,\Phi_p = z_p,\Delta(0;2r))\}_{p\in Z\cup P}$ in $X$ such that for each point $p\in Z\cup P$, we have $z_p(p) = 0$ and on $U_p$,
$$f =\begin{cases}
z_p^{\mu_p} & p\in Z,\\
z_p^{-\nu_p} & p\in P.\\
\end{cases}$$
Thus the meromorphic $1$-form $\theta = df/f$ satisfies, on $U_p$,
$$\theta = \begin{cases}
\mu_p\cdot z_p^{-1}\cdot dz_p & p\in Z,\\
-\nu_p\cdot z_p^{-1}\cdot dz_p & p\in P.\\
\end{cases}$$
Stokes's theorem now gives
\begin{align*}
\sum_{p\in Z}2\pi i\mu_p -\sum_{p\in P}2\pi i\nu_p & = \sum_{p\in Z\cup P}\int_{\partial\Phi_p^{-1}(\Delta(0;r))}\theta\\
& = -\int_{X\setminus\bigcup_{p\in Z\cup P}\Phi_p^{-1}(\overline{\Delta(0;r)})}d\theta = 0.\\
\end{align*}
