Lemma 21.7.1. Let $(\mathcal{C}, \mathcal{O})$ be a ringed site. Let $U$ be an object of $\mathcal{C}$.

1. If $\mathcal{I}$ is an injective $\mathcal{O}$-module then $\mathcal{I}|_ U$ is an injective $\mathcal{O}_ U$-module.

2. For any sheaf of $\mathcal{O}$-modules $\mathcal{F}$ we have $H^ p(U, \mathcal{F}) = H^ p(\mathcal{C}/U, \mathcal{F}|_ U)$.

Proof. Recall that the functor $j_ U^{-1}$ of restriction to $U$ is a right adjoint to the functor $j_{U!}$ of extension by $0$, see Modules on Sites, Section 18.19. Moreover, $j_{U!}$ is exact. Hence (1) follows from Homology, Lemma 12.29.1.

By definition $H^ p(U, \mathcal{F}) = H^ p(\mathcal{I}^\bullet (U))$ where $\mathcal{F} \to \mathcal{I}^\bullet$ is an injective resolution in $\textit{Mod}(\mathcal{O})$. By the above we see that $\mathcal{F}|_ U \to \mathcal{I}^\bullet |_ U$ is an injective resolution in $\textit{Mod}(\mathcal{O}_ U)$. Hence $H^ p(U, \mathcal{F}|_ U)$ is equal to $H^ p(\mathcal{I}^\bullet |_ U(U))$. Of course $\mathcal{F}(U) = \mathcal{F}|_ U(U)$ for any sheaf $\mathcal{F}$ on $\mathcal{C}$. Hence the equality in (2). $\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).