Multiples of an effective degree 2 divisor on a hyperelliptic curve. Let $L$ denote the Riemann-Roch space, and $l$ its dimension.
We are given the following definition:
A curve $C$ of genus $g$ is hyperelliptic if and only if there is a degree 2 divisor $D$ such that $l(D)\ge2$
In that case, without loss
of generality we may assume $D$ is effective and that $L(D) = (1,x)$ where $(...)$ denotes span and $x$ is nonconstant.
I need to prove that $L(nD)=(1,x,x^2,...,x^n)$ for $n\le g-1$. The $\supseteq$ direction is easy.
Using ultrametric absolute values, I've shown that $1,x,...,x^n$ are linearly independent. It remains to show that $l(nD)\le n+1$, which is what I'm having trouble with. I went to my professor and was given a hint to use Riemann-Roch Theorem, but I can't figure out how to obtain that bound. Here's what I have.
Let $W$ be a canonical divisor. Then $l(nD)-l(W-nD)=2n-g+1\le n+1$ for $g\ge n$. Since $l(W-nD)\ge0$, I don't have an upper bound on $l(nD)$. If someone can help, that would be great. Thanks.
I've shown that $(g-1)D$ is canonical, but I can't use that since my proof involves the assumption that $l(nD)=n+1$.
 A: In the end, I think this comes down to a pigeonhole principle argument. First, note that (I think) you've shown that $x^n \in L(nD) \setminus L((n-1)D)$ for $n \leq g$ (see the discussion in the comments). Thus
$$
\ell(nD) - \ell((n-1)D) \geq 1
$$
for all $n \geq 1$, i.e., each time we increase $n$, the dimension has to go up by at least $1$. Now since $\deg(gD) = 2g > 2g - 2$, then $\deg(K - gD) < 0$, so
$$
\require{cancel}
\ell(gD) - \cancelto{0}{\ell(K - gD)} = 1 - g + \deg(gD) = 1 - g + 2g = g+1
$$
by Riemann-Roch. Here's a table of the values $\ell(nD)$.
$$
\begin{array}{c|c|c|c|c|c}
\ell(D) & \ell(2D) & \ell(3D) & \cdots & \ell((g-1)D) & \ell(gD)\\ \hline
2 & ? & ? & \cdots & ? & g+1
\end{array}
$$
Thus $\ell(2D) < \ell(3D) < \cdots < \ell((g-1)D)$ is a strictly increasing sequence of $g-2$ values chosen from the set $\{3, 4, \ldots, g\}$. But $\{3, 4, \ldots, g\}$ only contains $g-2$ distinct values, so there's only way this can occur: we must have
$$
\ell(2D) = 3, \ell(3D) = 4, \ldots, \ell((g-1)D) = g \, ,
$$
as desired.
