Let $X$ be a smooth projective curve over an Algebraically closed field $k$. Let $D=\sum_i n_i [P_i]\ge 0$ be an effective Weil divisor on $X$ where $P_i$ s are finitely many closed points of $X$.
Consider the projective space $\mathbb P^1=\mathbb A^1\cup \{\infty\}$ where $\infty=(1:0)$ and the closed points of $\mathbb A^1$ are those $(a:1)$.
Let $f\in k(X)$ be a non-constant rational function such that $D + div(f)\ge 0$ (i.e. $f$ is a non-constant rational function in the Riemann-Roch space of $D$) , so $f$ is regular everywhere on $X$ except possibly at the finitely many points $P_i$ . Now $f\in k(X)$ , so $f$ induces a rational map $f(=(f:1)): X\to \mathbb P^1$ (so any pole $P$ of $f$ gets mapped to $\infty$) and moreover it is a Surjective finite morphism since $f$ is not constant, so let $\deg f=[k(X): f^*(k(\mathbb P^1))]$.
My question is: What is the relation between $\deg f$ and $\deg D$ ? Is it true that $\deg f \le \deg D$ ?
(I'm mostly interested in the case where the divisor $D$ is supported at a single point i.e. $D=n[P]$ for some $n>0$ ).
My try: Consider the simplest case $D=n[P]$ with $n>0$. Call the point $(0:1)$ of $\mathbb P^1$ to be $0$. Now for $Q\in X$, we have $v_Q(f)>0$ iff $f(Q)=0$ and $v_Q(f)<0$ iff $f(Q)=\infty$. Now $P$ is the possibly only point in $X$ whose image under $f$ is $\infty$. We know that $\deg f=\deg f^*\{\infty\}$ , where $f^*\{\infty\}$ is the divisor on $X$ defined as $v[P]$, where $v=v_P(t\circ f)$ where $t\in k(\mathbb P^1)$ is a uniformizer of the local ring of $\mathbb P^1$ at the point $\infty$ , so $t\circ f \in k(X)$ (here $f$ is being considered as $(f:1): X \to \mathbb P^1$ ) . Now if I can show $v_P(t\circ f)$ is just $- v_P(f)$ where in the later case $f$ is just considered as a member of $k(X)$, then I'm done. Unfortunately, I'm unsure if this last point holds ...
The divisor of $f$ is of the form $E_1-E_2$ where $E_1$, $E_2$ are two effective divisors with disjoint support such that $\deg(f) = \deg(E_1) = \deg(E_2)$. If $div(f)+D = E_1-E_2+D$ is effective then $D-E_2$ is effective by the disjointness assumption. This shows that $\deg(f) = \deg(E_2)\leq \deg(D)$. This is not always an equality however: $D'-D$ is effective then $H^0(\mathcal{O}(D))\subset H^0(\mathcal{O}(D'))$.