Solution (source code)

= Solution

Choose a <Weierstrass equation of an elliptic curve>, with origin $O$ at infinity. For $P,Q$, draw their chord, or the tangent if they coincide, and call its third intersection $R$, counted with <intersection multiplicity>. The line through $R$ and $O$ gives a third point $S$; define $P+Q=S$. This is the <chord-and-tangent group law>. The inverse of an affine point on $y^2+a_1xy+a_3y=x^3+a_2x^2+a_4x+a_6$ is $(x,-y-a_1x-a_3)$, obtained from its vertical line through $O$. These conventions give identity $O$, and cover tangent and flex cases by multiplicity.

Here is a proof of associativity, without assuming that the geometric construction already defines a group. Work first over an <algebraic closure> and use <divisors on an algebraic curve>. The <Riemann-Roch theorem> says $\ell(D)-\ell(K_E-D)=\deg D+1-g$. For a smooth genus-one curve the <canonical divisor> has degree zero, so every degree-one divisor has $\ell(D)=1$. Thus every <divisor class> of degree one has a unique effective representative, necessarily a single point. Existence follows from a nonzero section; uniqueness follows because two distinct effective representatives would give linearly independent sections in the same one-dimensional space. Consequently
$$
E\longrightarrow\operatorname{Pic}^0(E),\qquad P\longmapsto[(P)-(O)]
$$
is a bijection: add $(O)$ to any degree-zero <divisor class>, and use its unique degree-one representative.

A line through $P,Q,R$ cuts out a divisor linearly equivalent to $3(O)$, since the line at infinity has triple intersection at the Weierstrass flex $O$. Equivalently, the ratio of the line equation to that of the line at infinity has <principal divisor> $(P)+(Q)+(R)-3(O)$. Thus the three corresponding degree-zero classes sum to zero. Applying the same fact to $O,R,S$ shows that the point produced by the chord-and-tangent process satisfies
$$
[(P+Q)-(O)]=[(P)-(O)]+[(Q)-(O)].
$$
Addition of divisors modulo <principal divisors> is associative. The two parenthesizations of $P+Q+T$ therefore have identical classes; injectivity of the displayed bijection makes them the same point. Hence \b[the chord-and-tangent law is associative]. This is <associativity of the chord-and-tangent law via divisor classes>. Its construction is defined over the original field, so the same conclusion holds for its <rational points>.