I have been reading the book Algebraic Geometric Codes: Basic Notions by Tsfasman, Vladut and Nogin. They give a residue formula like this:

Let $\mathbb{k}$ be an algebraically closed field and $X$ be a smooth projective curve over $\mathbb{k}$. Let $\omega$ be a rational differential form on $X$. Then,

$\displaystyle\sum_{P \in X}^{} Res_P(\omega) = 0$

Here $P$ denotes the points on the curve $X$ and $Res_P(\omega)$ denotes the residues of $\omega$ at points $P$.

I know that this can easily be derived with the help of Green's/Stoke's theorems in case where $\mathbb{k} = \mathbb{C}$ , as $X$ will then have the natural structure of a Riemann surface and things like integrals will start making sense. But, I am unable to prove it for an arbitrary algebraically closed field $\mathbb{k}$ other than $\mathbb{C}$.