I'm looking for a way to prove the following proposition, which is an exercise from a book about Algebraic Geometric Codes that I'm trying to read:
If $\mathcal P$ is a set of $n$ points in $\Bbb F_q$ (a field with cardinality $q$) and $g_i(x)=\prod_{P_j\in\mathcal P,P_j\neq P_i} (x-P_j)^{-1}$, then for any polynomial $f$ with $\deg f\leq n-2$ we have that $$\sum_{P_i\in\mathcal P}f(P_i)g_i(P_i)=0 $$
Note that this is somewhat similar to the residue formula over $\Bbb C$ in the sense that the function $g$ is holomorphic everywhere except for a finite set of points (maybe including the point at infinity in the case of $\Bbb C$), and because we may think of the $i$'th summand as $\text{Res}_{P_i}fg$ where $g=\prod_{P_i\in\mathcal P}(x-P_i)^{-1}$
I tried to mimic the residue formula proof for $\Bbb C$ but I couldn't make sense of how to cope with the integral along a circle (what is the radius, and how to even translate these points to being inside/outside of a circle).