Geometric genus of a surface In Beauville's Complex Algebraic Surfaces Chapter III, the geometric genus of a surface $S$ is given as $$p_g(S) = h^2(S,\mathcal{O}_S) = h^0(S,\mathcal{O}_S(K)),$$ where the second equality is by Serre duality. I have some questions about this:

*

*I know that $K$ is the canonical divisor of $S$, but what is the difference between $\mathcal{O}_S$ and $\mathcal{O}_S(K)$, and how do we interpret them?

The statement of Serre duality given in the book is as follows:

Let $S$ be a surface, and $L$ a line bundle on $S$. Let $\omega_S$ be the line bundle of differential $2$-forms on $S$. Then $H^2(S,\omega_S)$ is a $1$-dimensional vector space; for $0 \leq i \leq 2$, the cup-product pairing $$H^i(S,L) \times H^{2-i}(S,\omega_S \otimes L^{-1}) \rightarrow H^2(S,\omega_S) \cong \mathbb{C}$$ defines a duality.



*I know $h^i$ refers to the dimension of $H^i$ and $\omega_S$ in this case is $K$, but how does $h^2(S,\mathcal{O}_S) = h^0(S,\mathcal{O}_S(K))$ follow from Serre duality?

 A: *

*If I remember it correctly, $\mathcal O_S (A)$  is the line bundle corresponding to a Cartier divisor $A$ on $S$, and for the nonsingular $\Bbb C$ case, Weil divisors and Cartier divisors are in $1$-$1$ correspondence, and at least $\mathcal O_S(K) \cong \omega_S$ as line bundles on $S$.

*Take $L = \mathcal O_S, i = 2$ in the Serre duality statement, then perfect pairing implies
$$
\mathrm H^2(S, \mathcal O_S) \cong (\mathrm H^0(S, \mathcal O_S(K)))^* \tag{$\star$}
$$ where $^*$ means the dual $\Bbb C$-vector space. And for  finitely dimensional $\Bbb C$-vector spaces $V$, $\dim_{\Bbb C} V^* = \dim_{\Bbb C} V$. Thus $$h^2 (S, \mathcal O_S) = h^0 (S, \mathcal O_S(K)).$$
Update
Perfect paring basically means every $\alpha \in \mathrm H^2 (S, \mathcal O_S)$ determines uniquely one $\Bbb C$-map $\alpha \smile (-)\colon \mathrm H^0 (S, \mathcal O_S (K)) \to \Bbb C$, i.e. $$\alpha \longleftrightarrow \alpha \smile (-) \in \operatorname{Hom}_{\Bbb C} (\mathrm H^0(S, \mathcal O_S (K) ), \Bbb C) =: (\mathrm H^0 (S, \mathcal O_S (K)))^*,$$ and such correspondence is also $\Bbb C$-linear, hence $(\star)$.
