TITLE: A cohomological variant of the second Riemann's extension theorem
QUESTION [5 upvotes]: Let $X$ be a connected compact complex manifold, $U$ an open subset of $X$ such that the complement of $U$ in $X$ is an analytic subset of codimension at least 2 in $X$. Let $O_X$ (resp. $O_U$) be the sheaf of holomorphic functions on $X$ (resp. on $U$). If $n$ is a nonnegative integer then there is a natural  homomorphism of complex vector spaces
$$r_n: H^n(X,O_X) \to H^n(U,O_U).$$
The second Riemann extension theorem actually asserts that $r_n$ is an isomorphism for $n=0$. I am looking for a reference where it is proven that $r_n$ is  an isomorphism, say, for $n=1$ or $2$ (may be, under some additional assumptions). Thanks!

REPLY [3 votes]: For the first cohomology statement, you need the codimension to be at least three and for the first and second cohomology, codimension four. This theorem was proved by G Scheja in [1]. You can also find a proof in the book by Banica and Stanasila ([2] Chapter II, §II.3 pages 66-67).
References
[1] Constantin Banica, Octavian Stanasila, Algebraic methods in the global theory of complex spaces. Rev. English ed. (English) Bucuresti: Editura Academiei; London-New York-Sydney: John Wiley&Sons, pp. 296 (1976), MR0463470, Zbl 0334.32001.
[2] Günter Scheja, "Riemannsche Hebbarkeitssätze für Cohomologieklassen" (German) Mathematische Annalen 144, 345-360 (1961), MR0148941, Zbl 0112.38001.