Let $X$ be a curve over an algebraically closed field $k$. Why does non-constant $f\in \Gamma(\mathcal{O}_X(nP),X)$ mean that $f$ has a pole of order $n$? I have seen this used in the proof that for every point $P$ on $X$ there exists a non-constant rational function $f$ that is regular everywhere except for $P$.
By definition, if $f\in \Gamma(\mathcal{O}_X(nP),X)$, then $(f)+nP\geq 0$, which implies that $v_P(f)\geq -n$. But this is not necessarily an equality, so why do we have such a pole? This inequality alone doesn't preclude the possibility that $v_P(f)$ is a positive number. What am I missing?
Suppose $X$ is a complete curve. Then for all $n\ge1$ there is an injection $\Gamma(X,\mathcal O_X((n-1)P))\hookrightarrow\Gamma(X,\mathcal O_X(nP))$, from the injection of sheaves $\mathcal O_X((n-1)P)\to\mathcal O_X(nP)$ together with the fact that $\Gamma(X,-)$ is left exact. Here $\Gamma(X,\mathcal O_X((n-1)P))$ consists of functions $f$ that are regular away from $P$ and such that $v_P(f)\ge-(n-1)$. Thus, $\Gamma(X,\mathcal O_X(nP))\setminus \Gamma(X,\mathcal O_X((n-1)P))$ consists of the functions $f$ that are regular away from $P$ and such that $v_p(f)=n$ exactly.
Thus, to have a $f$ with pole of order exactly $n$ at $P$ we need $\Gamma(X,\mathcal O_X((n-1)P))\hookrightarrow\Gamma(X,\mathcal O_X(nP))$ to be a proper injection. One criteria that assures this is $n\ge 2g$. Indeed, by Riemann-Roch we have $\dim\Gamma(X,\mathcal O_X(nP))=n-g+1$ and $\dim\Gamma(X,\mathcal O_X((n-1)P))=n-g$.
Note that as a special case, when $X=\mathbb P^1$, Riemann-Roch tells us $\Gamma(X,\mathcal O_X(P))$ is $2$-dimensional and $\Gamma(X,\mathcal O_X)=\mathbb C$, the space of constant functions, is $1$-dimensinoal. Thus any non-constant function in $\Gamma(X,\mathcal O_X(P))$ has a pole of order exactly $1$, which may be what you were referring to.