TITLE: Adjunction for varieties with higher codimension
QUESTION [9 upvotes]: For $X \subseteq \mathbb{P}^n$ a smooth hypersurface, the canonical divisor $K_X$ can be computed as
$$
K_X = (K_{\mathbb{P}^n} + X)|_X.
$$
Is there a similar formula where $X$ is of higher codimension?
If necessary we can assume $X$ to be a surface over the complex numbers, in particular it is a complex analytic manifold.
Thanks!

REPLY [7 votes]: The principle of adjunction is much more general than just a formula for the canonical class, it holds at the level of total Chern classes for any submanifold $X$ of a complex manifold $Z$ (the canonical class is just the negative of the first Chern class of $X$). More precisely, the more general form of adjunction at the level of Chern classes is $$c(X)=c(Z)/c(N),$$ where $N$ is the normal bundle to $X$ in $Z$ (this follows from the exact sequence of vector bundles in Georges' answer along with the fact that Chern classes are multiplicative with respect to exact sequences). In the special case $X\subset \mathbb{P}^n$ is a complete intersection (i.e., $X$ is the zero locus of the system $F_1=\cdots =F_k=0$ and $X$ has codimension $k$), adjunction easily yields a nice formula for the total Chern class of $X$, from which can you can extract (among other invariants) not only the canonical class of $X$ but it's topological Euler characteristic as well. In particular (if you know a little bit about Chern classes, or if not see chapter 3 of Fulton's "Intersection theory"), if we denote the class of a hyperplane in $\mathbb{P}^n$ by $H$ and the degree of the hypersurface $F_i=0$ by $d_i$, then $c(\mathbb{P}^n)=(1+H)^{n+1}$ and $c(N)=(1+d_1H)\cdots(1+d_kH)$, thus $$c(X)=\frac{(1+H)^{n+1}}{(1+d_1H)\cdots(1+d_kH)}\cdot d_1\cdots d_kH^k$$ (we multiply by $d_1\cdots d_kH^k$ as this is the class of $X$ in $\mathbb{P}^n$). The $i$th Chern class of $X$ is then just the term of degree $k+i$ in the power series expansion of $\frac{(1+H)^{n+1}}{(1+d_1H)\cdots(1+d_kH)}\cdot d_1\cdots d_kH^k$. In particular, $K_X=-(n+1-d_1-\cdots - d_k)H^{k+1}$ and the topological Euler characteristic is the degree of the $(n-k)$th Chern class of $X$, namely the coefficient of $H^n$ in the power series expansion of $c(X)$.
As I stated earlier, all of this can be found in much greater detail in chapter 3 of Fulton's book.