"Trivial" geometry behind the intersection pairing on surfaces

Here is a simple way to connect ($\star$) to your geometric intuition.

Suppose $C$ and $D$ are two curves on your surface. There exists an exact sequence, $$ 0 \to \mathcal O_{X}(-C-D) \to \mathcal O_X(-C)\oplus \mathcal O_X(-D) \to O_X \to \mathcal O_{C \cap D} \to 0,$$ where $\mathcal O_{C \cap D}$ is the skyscraper sheaf supported on the intersection points of $C$ and $D$ with stalks of dimension equal to the intersection multiplicity at each intersection point.

[To spell out the above morphisms more explicitly, suppose that ${\rm Spec \ } A \subset X$ is a open affine on which $C$ and $D$ are the vanishing loci of $f$ and $g$ in $A$ respectively. Then the associated exact sequence of modules over ${\rm Spec \ } A$ is $$ 0 \to A \overset{(-g,f)}{\to} A^{\oplus 2}\overset{(f,g)}{\to} A \to A/(f,g) \to 0.$$ Indeed, the stalk at an intersection point $x \in C \cap D$ is $A_x/(f,g)$, whose dimension is the standard definition of the intersection multiplicity of $C$ and $D$ at $x$. ]

Anyway, your intuitive notion of intersection pairing is that $C.D$ is the number of points in $C\cap D$ counted with multiplicity. But this is exactly the same thing as the number of global sections of $\mathcal O_{C \cap D}$. Since $\mathcal O_{C \cap D}$ is a skyscraper sheaf, its higher cohomologies vanish, so this is the same as the Euler characteristic $\chi(\mathcal O_{C \cap D})$. But then, by the above exact sequence, this Euler characteristic is equal to $\chi(\mathcal O_X) - \chi(\mathcal O_X(-C)) - \chi(\mathcal O_X(-D)) + \chi(\mathcal O_X(-C-D)),$ which agrees with your $(\star)$.


Your questions are a frequent reaction to the "rabbit-out-of-a-hat" type of proof. The reason for doing it that way is a matter of exposition. A more natural approach would be step-by-step. First, for two nonsingular curves $C$ and $D$, meeting transversally, define $C.D$ to the the number of intersection points. Next, keeping $C$ fixed, let's show this depends only on the linear equivalence class of $D$. This is because if $D \sim D'$ on the surface, then $C.D \sim C.D'$ as divisors on $C$. And then we know that linearly equivalent divisors on a curve have the same degree. This will still work if $D$ becomes singular, as long as its intersection with $C$ is a finite set of points.

Maybe you can work out the rest for yourself. If you start with arbitrary divisors, any such is a difference of effective curves, and using Bertini's theorem, you can take them to be nonsingular. This gives a definition for any two divisors, but you have to show it is independent of the choices made. By the time you work this all out in complete detail, perhaps you can appreciate the choice of Hartshorne to take the more efficient "rabbit-out-of-a-hat" method.

Of course Kenny's answer to your question is quite excellent.