Solution (source code)

= Solution

For an <elliptic curve> over $\mathbb F_q$, where $q$ is a prime power, the <Hasse theorem for elliptic curves> is
$$
\boxed{\left|\#E(\mathbb F_q)-(q+1)\right|\leq2\sqrt q.}
$$
We prove it from the degree form on elliptic-curve endomorphisms, including the required degree facts.

A nonzero homomorphism of <elliptic curves> is a finite surjective morphism; its degree is the degree of the induced extension of <function fields>. Set the degree of the zero homomorphism to $0$. The <degree of an isogeny> is also the degree of the pullback of any point divisor: locally, a finite map of smooth curves gives a module of rank equal to the function-field degree, and its fibre length is the sum of the local multiplicities. For a composition, the tower law for <function fields> gives
$$
\deg(\alpha\circ\beta)=\deg\alpha\,\deg\beta.
$$
If the <isogeny of elliptic curves> is separable, its pullback of a nonzero <invariant differential on an elliptic curve> is nonzero. Translation invariance implies that its differential is nonzero at every point, so each fibre point has multiplicity $1$. Every fibre is a translate of the kernel. Therefore
$$
\deg\alpha=\#\ker\alpha\quad\text{for a separable isogeny.}
$$
For an inseparable isogeny, multiplicities must be retained; counting geometric kernel points alone would be incorrect.

Here is a divisor proof of the <degree parallelogram law>. On $E\times E$, let $\Delta$ be the diagonal and $\Delta^-$ the locus $P=-Q$. A Weierstrass $x$-function has a double pole at $O$, and the equation $x(P)=x(Q)$ describes $P=Q$ or $P=-Q$. Consequently
$$
\operatorname{div}(x(P)-x(Q))=\Delta+\Delta^--2(\{O\}\times E)-2(E\times\{O\}).
$$
This remains valid in characteristic $2$ using a general <Weierstrass equation of an elliptic curve>: the $x$-map still has degree $2$ and its two points are exchanged by negation. The divisor identity gives an identity of <line bundles>. Pull it back by $P\mapsto(\alpha(P),\beta(P))$ and take degrees. The diagonal is the inverse image of $O$ under subtraction and the antidiagonal under addition, so
$$
\boxed{\deg(\alpha+\beta)+\deg(\alpha-\beta)=2\deg\alpha+2\deg\beta.}
$$
Using line bundles makes this pullback argument valid even when $\alpha=\beta$, $\alpha=-\beta$ or one map is zero, when directly substituting into the rational function would fail.

Let $d_n=\deg[n]$. Applying the <degree parallelogram law> to $[n]$ and $[1]$ gives $d_{n+1}+d_{n-1}=2d_n+2$, with $d_0=0,d_1=1$. Induction gives
$$
\boxed{\deg[n]=n^2.}
$$
More generally, the same recurrence and polarization show that the degree restricted to the subgroup generated by two endomorphisms is a quadratic form: its mixed coefficient is determined by their sum or difference. This can be checked directly by the second-difference recurrence in each integer variable and the parallelogram identity in the two diagonal directions.

Let $\pi$ be the $q$-power <Frobenius isogeny of an elliptic curve>. It has degree $q$: it is purely inseparable, has one geometric point in each fibre, and sends a local parameter at the rational point $O$ to its $q$th power, giving fibre multiplicity $q$. Its pullback of any differential is zero. On the other hand, the standard addition rule for an <invariant differential on an elliptic curve> gives
$$
(1-\pi)^*\omega=\omega-\pi^*\omega=\omega.
$$
Hence $1-\pi$ is separable, and its kernel consists exactly of the points fixed by Frobenius, namely $E(\mathbb F_q)$. Put $N=\#E(\mathbb F_q)$ and $t=q+1-N$. Then
$$
\deg(1-\pi)=N,\qquad\deg\pi=q,\qquad\deg1=1,
$$
and the quadratic-form calculation gives, for all $m,n\in\mathbb Z$,
$$
\boxed{\deg(m\pi-n)=qm^2-tmn+n^2\geq0.}
$$
If $t^2>4q$, the real polynomial $X^2-tX+q$ is negative on an open interval. That interval contains a rational $n/m$ with $m\ne0$, contradicting the displayed nonnegativity after multiplication by $m^2$. Thus $t^2\leq4q$, which is precisely the <Hasse theorem for elliptic curves>.