TITLE: Self intersection and deformations
QUESTION [5 upvotes]: Suppose I have a smooth projective surface $S$ and a curve $C\subset S$. The self-intersection of $C$ is by definition the degree of the restriction to $C$ of the normal bundle of $C$ inside $S$.
By the very definition, if I deform $C$ inside $S$ then the self intersection does not change. Now, I wonder if this stays constant if I deform the surface as well, but keeping it smooth. More precisely: let us fix $S$ smooth first and deform $C$ to $C'\subset S$ and then deform $S$ to $S''$ via a smooth family. Let $C''\subset S''$ the deformation of $C'$ obtained through the deformation $S \to S''$. Does $(C\cdot C)=(C'' \cdot C'')$ always hold?

REPLY [5 votes]: I think that, if the curve does not disappear, then the answer is positive.
In fact, let $\pi \colon \mathcal{X} \to \Delta$ your deformation of surfaces over a disk, with $S_1= \pi^{-1}(t_1)$ and $S_2 = \pi^{-1}(t_2)$. The assumption that $C_1 \subset S_1$ deforms to $C_2 \subset S_2$ along $\pi$ means that there exists a line bundle $\mathcal{L}$ on the total space $\mathcal{X}$ such that $$\mathcal{L}|_{S_1}=\mathcal{O}_{S_1} (C_1), \quad \mathcal{L}|_{S_2}=\mathcal{O}_{S_2} (C_2).$$
Therefore we have $$(C_1 \cdot C_1) = \mathcal{L} \cdot \mathcal{L} \cdot S_1 = \mathcal{L} \cdot \mathcal{L} \cdot S_2 = (C_2 \cdot C_2),$$
since any two fibers of $\pi \colon \mathcal{X} \to \Delta $ are clearly numerically equivalent.