Is there error in proof of lemma on Riemann-Roch space of divisor $D$? 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?
 A: 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.
A: The problem seems to be that the choice of $\mathbb{k}$ is not algebraically closed. As you noted, for example, $\sqrt{2} \in \bar{\mathbb{Q}}$, where $\bar{\mathbb{Q}}$ denotes the algebraic closure of $\mathbb{Q}$. Also, $P_0 \in \bar{\mathbb{k}}$, so just heuristically it seems unlikely that the result could hold for $\mathbb{k}$ as opposed to $\bar{\mathbb{k}}$ unless $\mathbb{k}$ was algebraically closed at the outset. Perhaps the result might hold if $P_0 \in \mathbb{k}$. In short, the result seems to assume that the field $\mathbb{k}$ is algebraically closed.
This would not be that surprising, since Bezout's theorem requires the field to be algebraically closed, and, if I am not mistaken, Bezout's theorem is necessary to prove Riemann-Roch.
The author, Steven Galbraith, seems to make implicit the assumption that $\mathbb{k}$ is always algebraically closed at the beginning of chapter 7. I quote (from page 123, the first of chapter 7):

We start by introducing the theory of singular points on varieties. Then we define
  uniformizers and the valuation of a function at a point on a curve. When working over
  a field $\mathbb{k}$ that is not algebraically closed it turns out to be necessary to consider not just
  points on C defined over $\mathbb{k}$ but also those defined over $\bar{\mathbb{k}}$ (alternatively, one can generalise
  the notion of point to places of degree greater than one; see [588] for details). We then
  discuss divisors, principal divisors and the divisor class group. The hardest result is that
  the divisor of a function has degree zero; the proof for general curves is given in Chapter 8.
  Finally, we discuss the “chord and tangent” group law on elliptic curves.

There might be more information/clarification about these issues in a newer edition of his book.
The standard example for the field $\mathbb{k}$ in algebraic geometry, or at least the most basic one, is $\mathbb{C}$, not $\mathbb{Q}$ or $\mathbb{R}$, despite the fact that the latter two are also of characteristic zero, because $\mathbb{C}$ is algebraically closed. Complex projective space is much more interesting than real projective space.
If I am not mistaken (and I may be) this lemma is just a more generalized version of Theorem 3.5.20 (p. 164) of Garrity et al's Algebraic Geometry: A Problem Solving Approach -- the result stated there is limited to $\mathbb{C}$, and the proof is exercises 3.5.22-3.5.31  (it's really quite elementary). The reason stated for working with $\mathbb{C}$ in that book is that $\mathbb{C}$ is algebraically closed.
