I'm studying Riemann surfaces and I just met the geometric interpretation of Riemann-Roch according to which $$ dim(span(D))=deg D- l(D) $$
where $D$ is a positive divisor and $span(D)$ is the intersection of every hyperplane intersecting the image of $supp(D)$ via the canonincal map $\phi$ with proper multiplicity. I see that it is always assumed that the Riemann surface $X$ is not hyperellip^tic so that $\phi$ is an embedding. It is possible to generalize this to the hyperelliptic case?
I tried to repeat the argument for an explicit example: the hyperelliptic curve of genus 3 arising by considering $y^2 = x^8+1$. Take the points $p_1 = (1,0),\ p_2=(-1,0),\ p_3=(i,0),\ p_4=(-i,0) $ and consider the positive divisor $D = p_1+p_2+p_3+p_4$. Consider now the canonical map $\phi:(x,y)\rightarrow (1:x:x^2)\in\Bbb{P}^1$, so that the images of the $p_i$ are $$ \phi(p_1) = (1:1:1)\\ \phi(p_2) = (1:-1:1)\\ \phi(p_3) = (1:i:-1)\\ \phi(p_4) = (1:-i:-1) $$ It seems to me that the only linear combination annihilating them is $-x_0+x_1-ix_2+ix_3$, so I would say that the smallest linear subspace of $\Bbb{P}^3$ containing the images is $$ H: -x_0+x_1-ix_2+ix_3=0 $$ whose dimension is 2. By algebraic Riemann-Roch I know that $l(D)=1+4-3=2$ and so, in fact, I get $2 = 4-2$. First question: is this argument right? Second question: if previous answer is "yes", how does it differ from non-hyperelliptic case?
Now I consider a divisor whose support is made of point where tha canonical map fails to be an embedding. Consider $D'=q_1+q_2+q_3+q_4$ where $q_1=(0,1),\ q_2=(0,-1),\ q_3=(1,\sqrt{2}),\ q_4=(1,-\sqrt{2})$. Now we get $$ \phi(q_1)=\phi(q_2) = (1:0:0)\\ \phi(q_3)=\phi(q_4) = (1:1:1) $$ And we have two hyperplanes $H_1,\ H_2$ annihilating them, namely $$ H_1 = x_0-x_1\\ H_2 = x_2-x_3 $$ $H_1\cap H_2$ should be the projective line given by $(x:x:y:y)$, so it has dimension 1, but again $degD' = 4$ and $l(D')=2$ and $1\neq 4-2$
Am I missing something? Thank you for any hint!
First, yes, the geometric interpretation of Riemann-Roch works for hyper-elliptic curve.
You seems to be confused with the target of the canonical map. The canonical map for a genus 3 curve has target $\mathbb P^2$, instead of $\mathbb P^3$. The map is given by $(x,y)\mapsto x\mapsto (1:x:x^2)$ as composite of projection to the $x$-line and the degree-$2$ Veronese embedding. So for the divisor $D$ in your first example, $\text{Span}(D)=\mathbb P^2$, and the formula reads
$$2=4-l(D),$$ so $l(D)=2$.
For the divisor $D'$ in your second example, it actually coincides with the canonical divisor $K_X$ on $X$, so $\text{Span}(D')=\mathbb P^1$, and the formula reads
$$1=4-l(D'),$$ so $l(D')=3$, which coincides with the genus of the curve. You know $h^0(K_X)=3$, so the formula is correct.