TITLE: Is there error in proof of lemma on Riemann-Roch space of divisor $D$?
QUESTION [8 upvotes]: I'm reading Steven Galbraith "Mathematics of Public Key Cryptography" and can't understand lemma 8.4.2 on page 154 that necessary for proof of Riemann-Roch theorem.
Suppose $C$ $-$ curve over $\mathbb k$.
We want to prove that if $D' \ge D$ then $dim_{\mathbb k} (\mathscr L_{\mathbb k} (D')/\mathscr L_{\mathbb k}(D)) \le \deg(D') - \deg(D)$. Where $L_{\mathbb k}(D)$ $-$ Riemann-Roch space of $D$, i.e. $\mathscr L_{\mathbb k} (D) = \{f \in \mathbb k(C)^∗ : v_P(f) \ge -n_P\ for\ all\ P \in C(\mathbb k)\} \cup \{0\}$. In order to prove that we are trying to prove following fact:
Let $P_0 \in C(\overline{\mathbb k})$. Then $dim_{\mathbb k}(\mathscr L_{\mathbb k} (D + P_0)/\mathscr L_{\mathbb k} (D)) \le 1$.
Proof is following:

Write $D = \sum_{P \in C(\overline{\mathbb k})} n_P(P)$. Note that
  $\mathscr L_{\mathbb k} (D)$ is a $\mathbb k$-vector subspace of
  $\mathscr L_{\mathbb k} (D + P_0)$. Let $t \in k(C)^∗$ be a function
  such that $v_{P_0} (f) = n_{P_0} + 1$ (e.g., take $t$ to be a power of
  a uniformizer at $P_0$). If $f \in \mathscr L_{\mathbb k} (D + P_0)$
  then $ft \in O_{P,k}(C)$. We therefore have a $\mathbb k$-linear map
  $\psi : \mathscr L_{\mathbb k} (D + P_0) → \mathbb k$ given by
  $\psi(f) = (ft)(P_0)$. The kernel of $\psi$ is $\mathscr L_{\mathbb k} (D)$ and
  the first part of the statement follows.

Let consider following example
$$C(\mathbb Q) = V(y=0),\ f = \frac{x^2-xz}{x^2-2},\ t = \frac{x^2-2}{z^2},\ P_0 = (\sqrt{2}:0:1) \in C(\overline{\mathbb Q}).$$
Hence $ft = \frac{x^2-xz}{z^2}$ and $ft(P_0) = 2 - \sqrt{2} \notin \mathbb Q$. And we cannot say that $\psi : \mathscr L_{\mathbb Q} (D + P_0) → \mathbb Q$. 
Is that error in book or I don't understand something?

REPLY [3 votes]: We're talking about irreducible projective curves here: $C\subset \mathbb{P}_{\overline{k}}^n$. What it means that $C$ is defined over $k$ is just that the ideal defining $C$ in $\overline{k}[x_0,\ldots,x_n]$ actually has $k$-coefficients. Likewise, the rational functions of $C$ defined over $k$, $k(C)$, are just the rational functions of $C$ (elements of $\overline{k}(C)$, by definition) with $k$-coefficients.
Fact— Since $C$ is (geometrically) irreducible, $\overline{k}\otimes_k k(C)$ is an integral domain (cf. Bourbaki, Algèbre V, §17.4 Prop. 4). This easily implies that the canonical map $\overline{k}\otimes_k k(C)\to\overline{k}(C)$ is injective.
The Riemann-Roch space $\mathscr{L}_k(D)$ of a divisor $D = \sum_{p\in C(\overline{k})} n_pp$ on a curve $C$ defined over $k$ is the $k$-vector space of $k$-rational functions $f\in k(C)^\times$ such that $v_p(f)\geq -n_p$ for all $p\in C(\overline{k})$ (and $0\in k(C)$).
Note that the condition over $k$ is the same as the one over $\overline{k}$, except that we restrict to rational functions defined over $k$; thus, $\mathscr{L}_k(D) = \mathscr{L}_{\overline{k}}(D)\cap k(C)\subset \overline{k}(C)$.
Observation— Up to minor typos, the OPs proof is correct in case $k = \overline{k}$ is algebraically closed or, more generally, if $p_0\in C(k)$.
Therefore, $\dim_{\overline{k}}\mathscr{L}_{\overline{k}}(D+p_0)\leq \dim_{\overline{k}}\mathscr{L}_{\overline{k}}(D)+1$.
Now we are ready to prove the general case. In fact, it's really just linear algebra from here on.
Let $f,g\in\mathscr{L}_k(D+p_0)$ be linearly independent over $k$.
We'll prove that $f-g\in \mathscr{L}_k(D)$.
By the above mentioned fact, $f$ and $g$ are also $\overline{k}$-linearly independent when considered as elements in $\mathscr{L}_{\overline{k}}(D+p_0)$.
Since $\dim_{\overline{k}}\mathscr{L}_{\overline{k}}(D+p_0)\leq \dim_{\overline{k}}\mathscr{L}_{\overline{k}}(D)+1$, we have to have $f-g\in \mathscr{L}_{\overline{k}}(D)$. But then $f-g\in \mathscr{L}_{\overline{k}}(D)\cap k(C) = \mathscr{L}_{k}(D)$, as claimed.