Lemma 20.32.2. Let $X$ be a ringed space. Let $U \subset X$ be an open subspace. For $K$ in $D(\mathcal{O}_ X)$ we have $H^ p(U, K) = H^ p(U, K|_ U)$.

Proof. Let $\mathcal{I}^\bullet$ be a K-injective complex of $\mathcal{O}_ X$-modules representing $K$. Then

$H^ q(U, K) = H^ q(\Gamma (U, \mathcal{I}^\bullet )) = H^ q(\Gamma (U, \mathcal{I}^\bullet |_ U))$

by construction of cohomology. By Lemma 20.32.1 the complex $\mathcal{I}^\bullet |_ U$ is a K-injective complex representing $K|_ U$ and the lemma follows. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).