TITLE: Is there a Serre intersection formula in analytic geometry?
QUESTION [14 upvotes]: There is the famous Serre intersection formula in algebraic geometry using the Tor functor (see for example here). I would like to know if there is such a formula in analytic (i.e. complex) geometry. Thanks.  
In somewhat more detail: given two subvarieties of complementary codimensions in a smooth projective variety, the intersection number between them can be computed in terms of an alternating sum involving the Tor function, no matter if their intersection is transversal (and more generally, proper) or not. My question is then how far we can do so for compact complex manifolds. Is there any subtlety of using sheaf theory and so on in this general case? I would expect there is no such, the generalization should go through.
But I see no references on this topic (either on the Serre intersection formula in the compact complex manifolds setting or the more general topic of subtlety in using sheaf theory in this general setting), so I would like to know.

REPLY [6 votes]: Serre's formula works in the analytic category as well. If X is a smooth complex manifold, there is a ring structure on the Grothendieck group $K(X)$ of coherent sheaves given by the usual formula
$$ [\mathcal{F}] . [\mathcal{G}]=\sum_{i \geq 0} (-1)^i [\mathrm{Tor}^i_{\mathcal{O}_X}(\mathcal{F}, \mathcal{G})].$$ 
The Chern character $ch \colon K(X) \rightarrow H^*(X, \mathbb{Q})$ is a ring morphism. If $Z$ and $W$ are two complex subvarieties of $X$ of codimensions $p$ and $q$, write
$$ ch(\mathcal{O}_Z). ch(\mathcal{O}_W)=\sum_{i \geq 0} (-1)^i ch\,(\mathrm{Tor}^i_{\mathcal{O}_X}(\mathcal{O}_Z, \mathcal{O}_W)).$$ 
Now $ch(\mathcal{O}_Z)=[Z] + \,\mathrm{classes\,in}\, H^k(X, \mathbb{Q})$ for $k>2p$ and similarly for $W$. Hence the term with the smallest cohomological degree appearing in  $ch(\mathcal{O}_Z). ch(\mathcal{O}_W)$ is exactly the homological intersection of $Z$ and $W$ in $H^{2(p+q)}(X, \mathbb{Q})$. This proves that
$$[Z]. [W]=\sum_{i \geq 0} (-1)^i ch_{p+q}(\mathrm{Tor}^i_{\mathcal{O}_X}(\mathcal{O}_Z, \mathcal{O}_W)).$$
Next recall that if $\mathcal{F}$ is a coherent sheaf whose support consists of irreducible components $D_i$ of codimension $\geq d$, then 
$$ch_d(\mathcal{F})=\sum_{codim(D_i)=d} \ell_i(\mathcal{F})\, [D_i^{red}]$$
where $\ell_i(\mathcal{F})$ is the length of $\mathcal{F}$ at the generic point of $D_i$. This gives Serre's formula (at least over $\mathbb{Q}$).