Let $X$ be a compact Kahler manifold of complex dimension $n$ and let $Y\subset X$ be an open subset such that $V:=X\setminus Y$ is of complex codimension 2.


I know that by Hartogs' theorem follows $H^{2,0}(X)\simeq H^{2,0}(Y)$ but i read that it is also true $H^2(X,\mathbb{C})= H^2(Y,\mathbb{C})$ i.e. the homology ($2n-2$)-classes of $X$ don't vary if i cut out a closed subset of real dimension $2n-4$.


I can't understand exactly why this is true.. maybe because if i have a ($2n-2$)-cycle $\sigma$ which intersects $V$ then i can always find a cohomologus cycle $\sigma'$ which doesn't intersect $V$? But why is that?


thank you



Second cohomology on an open subset with complement of codimension 2
By Poincaré duality, this is equivalent to say that the natural map $H^{2n-2}\_c(Y)\rightarrow H^{2n-2}(X)$ is bijective. This map appears in a long exact sequence
$$\ldots H^{2n-3}(X-Y)\rightarrow H^{2n-2}\_c(Y)\rightarrow H^{2n-2}(X)\rightarrow H^{2n-2}(X-Y)\ldots $$Since $X-Y$ has real dimension $\leq 2n-4$, the spaces on both sides are zero, hence the result.


