Lemma 20.34.6. Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $i : Z \to X$ be the inclusion of a closed subset. Denote $j : U = X \setminus Z \to X$ the inclusion of the complement. There is a distinguished triangle

$i_*R\mathcal{H}_ Z(K) \to K \to Rj_*(K|_ U) \to i_*R\mathcal{H}_ Z(K)$

in $D(\mathcal{O}_ X)$ functorial for $K$ in $D(\mathcal{O}_ X)$.

Proof. Choose a K-injective complex $\mathcal{I}^\bullet$ all of whose terms are injective $\mathcal{O}_ X$-modules representing $K$. See Section 20.28. Recall that $\mathcal{I}^\bullet |_ U$ is a K-injective complex of $\mathcal{O}_ U$-modules, see Lemma 20.32.1. Hence each of the derived functors in the distinguished triangle is gotten by applying the underlying functor to $\mathcal{I}^\bullet$. Hence it suffices to prove that for an injective $\mathcal{O}_ X$-module $\mathcal{I}$ we have a short exact sequence

$0 \to i_*\mathcal{H}_ Z(\mathcal{I}) \to \mathcal{I} \to j_*(\mathcal{I}|_ U) \to 0$

This follows from Lemma 20.8.1 and the definitions. $\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).