I heard that Weil proved the Riemann hypothesis for finite fields. Where can I found the details of the proof? I found the following sketch but I was unable to fill the details:
Motivation: I try to understand the elementary theory of finite fields but I'm not an expert of algebraic geometry, it would be nice to get some hints what should I study before I can understand schemes so well that I understand the proof.
Let $C,E$ be two proper smooth curves over a field $k$, and $f:C\to E$ a finite morphism. Let us set $X=C\times_{\operatorname{Spec}k}E$. Let us consider the graph $\Gamma_f\subseteq X$ of $f$ endowed with the reduced closed subscheme structure.
(a) Let $p_1:X\to C$ and $p_2:X\to E$ denote the projections. Then $p_1$ induces an isomorphism $\varphi:\Gamma_f\simeq C$. Show that $\omega_{X/K}\simeq p_1^*\omega_{C/k}\otimes p_2^*\omega_{E/k}$ and that $\omega_{X/k}|_ {\Gamma_F}\simeq \varphi^*\omega_{C/k}\otimes \varphi^*f^*\omega_{E/k}$.
(b) Show that
$$\operatorname{deg}_k\omega_{X/k}\mid_{\Gamma_f}=2g(C)-2+(\operatorname{deg} f)(2g(E)-2).$$
Deduce from this that $\Gamma_f^2=(\operatorname{deg} f)(2-2g(E))$.
(c) Let us henceforth suppose that $C=E$. Let $\Delta\subset X$ denote the diagonal. Show that $\Delta^2=2-2g(C)$.
(d) Let us suppose that $f\ne \operatorname{Id}_C$. Let $x\in X(k)\cap \Delta\cap \Gamma_f$, let $y=p_1(x)$, and let $t$ be a uniformizing parameter for $\mathcal{O}_{C,y}$. Show that
$$i_x(\Gamma_f,\Delta)=\operatorname{length}\mathcal{O}_{C,y}/(\sigma(t)-t),$$
where $\sigma$ is the automorphism of $\mathcal{O}_{C,y}$ induced by $f$.
(e) Let us take a finite field $k=\mathbb{F}_{p^r}$ of characteristic $p>0$, and let $f:C\to C$ be the Frobenius $F_C^r$. Show that the divisors $\Gamma_f,\Delta$ meet transversally and that $\Gamma_f\cap\Delta\subseteq X(k)$. Deduce from this that the cardinal $N$ of $C(k)$ is given by $N=\Gamma_f\cdot \Delta$.