Derive Group Law on Elliptic Curve with Riemann Roch Consider $E$ be an elliptic curve and $k$ a field. I read that one way to show that $E(k)$ has an abelian group structure can be derived using Riemann Roch. Could anybody explain how it concretely provides the desired result?
My considerations:
We have a group of divisors $Div(E)$ where the divisors are formal sums $\sum_{P \in E(k)} n_P (P)$ with $n_P \in \mathbb{Z}$ and the principal divisors $div(f) = \sum_P ord_P(f) (P)$ form a subgroup of $Div(E)$; denote it by $PrDiv(E)$.
The divisor class group is the quotient $Cl(E)= Div(E)/PrDiv(E)$.
We can define canonically a map $E(k) \to Cl(E), p \to (P)-(O)$ where $O$ is the special point (=neutral element).
Obviously it suffice to show that every divisor $D$ obtained from intersection of a line $L$ with $E$ has three points (counted we multiplicies). Or in language of divisors: For $D:= L \cap E$ we have to show that $deg(D)=3$, so $D= (P) + (Q) +(R) + div(f)$ for some principal divisor $div(f)$. This would settle $P+Q=-R$.
But I have some problems to derive it with Riemann Roch:
The RR-formula is:
$$l(D)-l(K-D) = deg(D) +g-1$$
Since $E$ elliptic $g=1$ so it suffice to show $l(D)-l(K-D)=3$.
And here I stuck. I know that $l(D) := dim_kH^0(D, \mathcal{O}_D)$ but this doesn't help me. Futhermore what to do with $l(K-D)$?
Remark: I know that there are a lot of other ways to derive the group law but the point of this question is to derive it using Riemann Roch.
Background on my question: @Awenshi's comment in https://mathoverflow.net/questions/6870/why-is-an-elliptic-curve-a-group
 A: The idea is to prove that the map that you defined above (called the Abel-Jacobi map) $$\begin{align*}
  J \colon E(k) &\to \mathrm{Pic}^0(E)\\
  P &\mapsto (P)-(O)
\end{align*}$$ 
is a bijection, where $\mathrm{Pic}^0(E)$ is the subgroup of $\mathrm{Pic}(E)$ of elements of degree $0$. Then the group law of $E(k)$ will be the one that makes the map above an isomorphism of groups.
Remarks: In this context $\mathrm{Pic}(E)$ is just another notation for $\mathrm{Cl}(E)$. As $k$ may not be algebraically closed we have to recall that the degree of $D=\sum_{p\in E}n_p(P)$ is given by $\deg(D)=\sum_{p\in E}n_p[k(p):k]$ so we have $P\in E(k)$ if and only if $deg(P)=1$.


*

*Injectivity of the map came from the fact that if
$(P)-(Q)=\text{div}(f)$ then by replacing $D=(Q)$ on Riemann-Roch we
get $h^0(Q)=2-g=1$ and hence $f\in H^0(E,Q)$ must be constant. 
Over an algebraically closed field you can also proceed without R-R as here.

*Surjectivity came from the fact that if $D\in \mathrm{Div}^0(E)$ then by R-R we have $h^0(D+(O))=1$ so if  $f\in H^0(E,D+(O))$ is not constant we have $\text{div}(f)=-D-(O)+(P)$ for some $P$. As $\deg(D)=\deg(\mathrm{div}(f))=0$ we get $\deg(P)=\deg(O)=1$ hence $P\in E(k)$ and then $$P\mapsto (P)-(O)\sim D$$
Now to prove that this group law $\oplus$ coincides with the geometric group law (the one defined with lines) when $E$ is given by a Weierstrass equation $$E:Y^2Z=4X^3-aX^2-bZ^3$$ it's enough to notice that $P\oplus Q\oplus R = O$
$\iff$ $P,Q,R$ are coolinear $\iff$ there is a degree one homogeneous polynomial $F(X,Y,Z)$ with $V(F)=\{P,Q,R\}$ $\iff$ $\mathrm{div}(\frac{F}{Z})=(P)+(Q)+(R)-3(O)$
(notice that the intersection multiplicity between $V(Z)$ and $E$ is $3$, hence the $3(O)$ term) $\iff$ $P+Q+R=O$ with the addition descrived above. Notice that all the above its true when the set $\{P,Q,R\}$ degenerates with tangencies.
A: Do you know that for an elliptic curve $K$ is the zero divisor? That is, $K=\mathcal{O}_E$? If you knew this, RR implies $l(D)\geq 3$ first. Thus $D$ is an effective divisor of degree 3 and thus $l(K-D)=l(-D)=0$, since negative degree divisor can not be effective. Then, you have $l(D)=3$, which is what you want.
I do not understand your statement `so it suffices to show $l(D)-l(K-D)=3$', but isn't that what RR says, since $\deg D=3$?
