# Question about divisors on a compact Riemann surface

I am trying to prove the following question from here without relying on the Riemann-Roch theorem.

Let $$X$$ be a compact Riemann surface, and let $$D$$ be a divisor on $$X$$.

(i) If $$\mathrm{deg}(D) = 0$$, show that $$\mathrm{dim}(L(D))$$ is equal to $$0$$ or $$1$$, with the latter occurring if and only if $$D$$ is principal. Furthermore, any non-zero element of $$L(D)$$ has divisor $$-D$$.

(ii) If $$\mathrm{deg}(D) \geq 0$$, establish the bound $$\mathrm{dim}(L(D)) \leq \mathrm{deg}(D) + 1$$.

Here is my work so far:

If $$D = 0$$ then we have that $$L(0) = 0$$ as $$X$$ is compact, with the opening mapping theorem, implies that $$L(0)$$ is the space of constant functions. However, I am not sure what to do even for the simple case where $$D = (P) - (Q)$$. any $$f \in L(D)$$ must have at least a simple zero at $$Q$$ and at most a simple pole at $$P$$. How can I get further information about $$f$$? Similarly, the only one that I could prove so far for (ii) is the case when $$D$$ is trivial.

Thank you so much for your help.

i) If $$\deg D=0$$ and $$\dim L(D)>0$$, then $$D$$ is linearly equivalent to some effective divisor $$D'$$, having the same degree: $$\deg D'=0$$. But there is only one such divisor: $$D'=0$$ and so $$D$$ is principal.
Moreover $$0=D'=D+(f)$$, so $$(f)=-D$$.
Now assume that for any divisor $$D$$ of degree $$n\geq 0$$ it holds $$\dim L(D) \leq n+1$$, and let $$D'$$ be a divisor of degree $$n+1$$. Write it as $$D+p$$ ($$p\in X$$ a point) and apply Lemma 19: $$\dim L(D+p)\stackrel{Lemma \, 19}\leq 1+\dim L(D) \leq 1+1+\deg D= 1+ (n+1)$$