## 20.42 Internal hom in the derived category

Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $L, M$ be objects of $D(\mathcal{O}_ X)$. We would like to construct an object $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)$ of $D(\mathcal{O}_ X)$ such that for every third object $K$ of $D(\mathcal{O}_ X)$ there exists a canonical bijection

20.42.0.1
$$\label{cohomology-equation-internal-hom} \mathop{\mathrm{Hom}}\nolimits _{D(\mathcal{O}_ X)}(K, R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)) = \mathop{\mathrm{Hom}}\nolimits _{D(\mathcal{O}_ X)}(K \otimes _{\mathcal{O}_ X}^\mathbf {L} L, M)$$

Observe that this formula defines $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)$ up to unique isomorphism by the Yoneda lemma (Categories, Lemma 4.3.5).

To construct such an object, choose a K-injective complex $\mathcal{I}^\bullet$ representing $M$ and any complex of $\mathcal{O}_ X$-modules $\mathcal{L}^\bullet$ representing $L$. Then we set

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M) = \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{L}^\bullet , \mathcal{I}^\bullet )$

where the right hand side is the complex of $\mathcal{O}_ X$-modules constructed in Section 20.41. This is well defined by Lemma 20.41.7. We get a functor

$D(\mathcal{O}_ X)^{opp} \times D(\mathcal{O}_ X) \longrightarrow D(\mathcal{O}_ X), \quad (K, L) \longmapsto R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)$

As a prelude to proving (20.42.0.1) we compute the cohomology groups of $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)$.

Lemma 20.42.1. Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $L, M$ be objects of $D(\mathcal{O}_ X)$. For every open $U$ we have

$H^0(U, R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)) = \mathop{\mathrm{Hom}}\nolimits _{D(\mathcal{O}_ U)}(L|_ U, M|_ U)$

and in particular $H^0(X, R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)) = \mathop{\mathrm{Hom}}\nolimits _{D(\mathcal{O}_ X)}(L, M)$.

Proof. Choose a K-injective complex $\mathcal{I}^\bullet$ of $\mathcal{O}_ X$-modules representing $M$ and a K-flat complex $\mathcal{L}^\bullet$ representing $L$. Then $\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{L}^\bullet , \mathcal{I}^\bullet )$ is K-injective by Lemma 20.41.8. Hence we can compute cohomology over $U$ by simply taking sections over $U$ and the result follows from Lemma 20.41.6. $\square$

Lemma 20.42.2. Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $K, L, M$ be objects of $D(\mathcal{O}_ X)$. With the construction as described above there is a canonical isomorphism

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)) = R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K \otimes _{\mathcal{O}_ X}^\mathbf {L} L, M)$

in $D(\mathcal{O}_ X)$ functorial in $K, L, M$ which recovers (20.42.0.1) by taking $H^0(X, -)$.

Proof. Choose a K-injective complex $\mathcal{I}^\bullet$ representing $M$ and a K-flat complex of $\mathcal{O}_ X$-modules $\mathcal{L}^\bullet$ representing $L$. Let $\mathcal{K}^\bullet$ be any complex of $\mathcal{O}_ X$-modules representing $K$. Then we have

$\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{L}^\bullet , \mathcal{I}^\bullet )) = \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet ( \text{Tot}(\mathcal{K}^\bullet \otimes _{\mathcal{O}_ X} \mathcal{L}^\bullet ), \mathcal{I}^\bullet )$

by Lemma 20.41.1. Note that the left hand side represents $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M))$ (use Lemma 20.41.8) and that the right hand side represents $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K \otimes _{\mathcal{O}_ X}^\mathbf {L} L, M)$. This proves the displayed formula of the lemma. Taking global sections and using Lemma 20.42.1 we obtain (20.42.0.1). $\square$

Lemma 20.42.3. Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $K, L$ be objects of $D(\mathcal{O}_ X)$. The construction of $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)$ commutes with restrictions to opens, i.e., for every open $U$ we have $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K|_ U, L|_ U) = R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)|_ U$.

Proof. This is clear from the construction and Lemma 20.32.1. $\square$

Lemma 20.42.4. Let $(X, \mathcal{O}_ X)$ be a ringed space. The bifunctor $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (- , -)$ transforms distinguished triangles into distinguished triangles in both variables.

Proof. This follows from the observation that the assignment

$(\mathcal{L}^\bullet , \mathcal{M}^\bullet ) \longmapsto \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{L}^\bullet , \mathcal{M}^\bullet )$

transforms a termwise split short exact sequences of complexes in either variable into a termwise split short exact sequence. Details omitted. $\square$

Lemma 20.42.5. Let $(X, \mathcal{O}_ X)$ be a ringed space. Given $K, L, M$ in $D(\mathcal{O}_ X)$ there is a canonical morphism

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M) \otimes _{\mathcal{O}_ X}^\mathbf {L} R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, M)$

in $D(\mathcal{O}_ X)$ functorial in $K, L, M$.

Proof. Choose a K-injective complex $\mathcal{I}^\bullet$ representing $M$, a K-injective complex $\mathcal{J}^\bullet$ representing $L$, and any complex of $\mathcal{O}_ X$-modules $\mathcal{K}^\bullet$ representing $K$. By Lemma 20.41.2 there is a map of complexes

$\text{Tot}\left( \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{J}^\bullet , \mathcal{I}^\bullet ) \otimes _{\mathcal{O}_ X} \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{J}^\bullet ) \right) \longrightarrow \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{I}^\bullet )$

The complexes of $\mathcal{O}_ X$-modules $\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{J}^\bullet , \mathcal{I}^\bullet )$, $\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{J}^\bullet )$, and $\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{I}^\bullet )$ represent $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)$, $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)$, and $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, M)$. If we choose a K-flat complex $\mathcal{H}^\bullet$ and a quasi-isomorphism $\mathcal{H}^\bullet \to \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{J}^\bullet )$, then there is a map

$\text{Tot}\left( \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{J}^\bullet , \mathcal{I}^\bullet ) \otimes _{\mathcal{O}_ X} \mathcal{H}^\bullet \right) \longrightarrow \text{Tot}\left( \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{J}^\bullet , \mathcal{I}^\bullet ) \otimes _{\mathcal{O}_ X} \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{J}^\bullet ) \right)$

whose source represents $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M) \otimes _{\mathcal{O}_ X}^\mathbf {L} R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)$. Composing the two displayed arrows gives the desired map. We omit the proof that the construction is functorial. $\square$

Lemma 20.42.6. Let $(X, \mathcal{O}_ X)$ be a ringed space. Given $K, L, M$ in $D(\mathcal{O}_ X)$ there is a canonical morphism

$K \otimes _{\mathcal{O}_ X}^\mathbf {L} R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (M, L) \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (M, K \otimes _{\mathcal{O}_ X}^\mathbf {L} L)$

in $D(\mathcal{O}_ X)$ functorial in $K, L, M$.

Proof. Choose a K-flat complex $\mathcal{K}^\bullet$ representing $K$, and a K-injective complex $\mathcal{I}^\bullet$ representing $L$, and choose any complex of $\mathcal{O}_ X$-modules $\mathcal{M}^\bullet$ representing $M$. Choose a quasi-isomorphism $\text{Tot}(\mathcal{K}^\bullet \otimes _{\mathcal{O}_ X} \mathcal{I}^\bullet ) \to \mathcal{J}^\bullet$ where $\mathcal{J}^\bullet$ is K-injective. Then we use the map

$\text{Tot}\left( \mathcal{K}^\bullet \otimes _{\mathcal{O}_ X} \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{M}^\bullet , \mathcal{I}^\bullet ) \right) \to \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{M}^\bullet , \text{Tot}(\mathcal{K}^\bullet \otimes _{\mathcal{O}_ X} \mathcal{I}^\bullet )) \to \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{M}^\bullet , \mathcal{J}^\bullet )$

where the first map is the map from Lemma 20.41.3. $\square$

Lemma 20.42.7. Let $(X, \mathcal{O}_ X)$ be a ringed space. Given $K, L$ in $D(\mathcal{O}_ X)$ there is a canonical morphism

$K \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, K \otimes _{\mathcal{O}_ X}^\mathbf {L} L)$

in $D(\mathcal{O}_ X)$ functorial in both $K$ and $L$.

Proof. Choose a K-flat complex $\mathcal{K}^\bullet$ representing $K$ and any complex of $\mathcal{O}_ X$-modules $\mathcal{L}^\bullet$ representing $L$. Choose a K-injective complex $\mathcal{J}^\bullet$ and a quasi-isomorphism $\text{Tot}(\mathcal{K}^\bullet \otimes _{\mathcal{O}_ X} \mathcal{L}^\bullet ) \to \mathcal{J}^\bullet$. Then we use

$\mathcal{K}^\bullet \to \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{L}^\bullet , \text{Tot}(\mathcal{K}^\bullet \otimes _{\mathcal{O}_ X} \mathcal{L}^\bullet )) \to \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{L}^\bullet , \mathcal{J}^\bullet )$

where the first map comes from Lemma 20.41.4. $\square$

Lemma 20.42.8. Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $L$ be an object of $D(\mathcal{O}_ X)$. Set $L^\vee = R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, \mathcal{O}_ X)$. For $M$ in $D(\mathcal{O}_ X)$ there is a canonical map

20.42.8.1
$$\label{cohomology-equation-eval} M \otimes ^\mathbf {L}_{\mathcal{O}_ X} L^\vee \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M)$$

which induces a canonical map

$H^0(X, M \otimes ^\mathbf {L}_{\mathcal{O}_ X} L^\vee ) \longrightarrow \mathop{\mathrm{Hom}}\nolimits _{D(\mathcal{O}_ X)}(L, M)$

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

Proof. The map (20.42.8.1) is a special case of Lemma 20.42.5 using the identification $M = R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (\mathcal{O}_ X, M)$. $\square$

Lemma 20.42.9. Let $(X, \mathcal{O}_ X)$ be a ringed space. Let $K, L, M$ be objects of $D(\mathcal{O}_ X)$. There is a canonical morphism

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M) \otimes _{\mathcal{O}_ X}^\mathbf {L} K \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L), M)$

in $D(\mathcal{O}_ X)$ functorial in $K, L, M$.

Proof. Choose a K-injective complex $\mathcal{I}^\bullet$ representing $M$, a K-injective complex $\mathcal{J}^\bullet$ representing $L$, and a K-flat complex $\mathcal{K}^\bullet$ representing $K$. The map is defined using the map

$\text{Tot}(\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{J}^\bullet , \mathcal{I}^\bullet ) \otimes _{\mathcal{O}_ X} \mathcal{K}^\bullet ) \longrightarrow \mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathop{\mathcal{H}\! \mathit{om}}\nolimits ^\bullet (\mathcal{K}^\bullet , \mathcal{J}^\bullet ), \mathcal{I}^\bullet )$

of Lemma 20.41.5. By our particular choice of complexes the left hand side represents $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, M) \otimes _{\mathcal{O}_ X}^\mathbf {L} K$ and the right hand side represents $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L), M)$. We omit the proof that this is functorial in all three objects of $D(\mathcal{O}_ X)$. $\square$

Remark 20.42.10. Let $(X, \mathcal{O}_ X)$ be a ringed space. For $K, K', M, M'$ in $D(\mathcal{O}_ X)$ there is a canonical map

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, K') \otimes _{\mathcal{O}_ X}^\mathbf {L} R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (M, M') \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K \otimes _{\mathcal{O}_ X}^\mathbf {L} M, K' \otimes _{\mathcal{O}_ X}^\mathbf {L} M')$

Namely, by (20.42.0.1) is the same thing as a map

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, K') \otimes _{\mathcal{O}_ X}^\mathbf {L} R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (M, M') \otimes _{\mathcal{O}_ X}^\mathbf {L} K \otimes _{\mathcal{O}_ X}^\mathbf {L} M \longrightarrow K' \otimes _{\mathcal{O}_ X}^\mathbf {L} M'$

For this we can first flip the middle two factors (with sign rules as in More on Algebra, Section 15.72) and use the maps

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, K') \otimes _{\mathcal{O}_ X}^\mathbf {L} K \to K' \quad \text{and}\quad R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (M, M') \otimes _{\mathcal{O}_ X}^\mathbf {L} M \to M'$

from Lemma 20.42.5 when thinking of $K = R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (\mathcal{O}_ X, K)$ and similarly for $K'$, $M$, and $M'$.

Remark 20.42.11. Let $f : X \to Y$ be a morphism of ringed spaces. Let $K, L$ be objects of $D(\mathcal{O}_ X)$. We claim there is a canonical map

$Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, K) \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (Rf_*L, Rf_*K)$

Namely, by (20.42.0.1) this is the same thing as a map $Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, K) \otimes _{\mathcal{O}_ Y}^\mathbf {L} Rf_*L \to Rf_*K$. For this we can use the composition

$Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, K) \otimes _{\mathcal{O}_ Y}^\mathbf {L} Rf_*L \to Rf_*(R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, K) \otimes _{\mathcal{O}_ X}^\mathbf {L} L) \to Rf_*K$

where the first arrow is the relative cup product (Remark 20.28.7) and the second arrow is $Rf_*$ applied to the canonical map $R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (L, K) \otimes _{\mathcal{O}_ X}^\mathbf {L} L \to K$ coming from Lemma 20.42.5 (with $\mathcal{O}_ X$ in one of the spots).

Remark 20.42.12. Let $h : X \to Y$ be a morphism of ringed spaces. Let $K, L, M$ be objects of $D(\mathcal{O}_ Y)$. The diagram

$\xymatrix{ Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits _{\mathcal{O}_ X}(K, M) \otimes _{\mathcal{O}_ Y}^\mathbf {L} Rf_*M \ar[r] \ar[d] & Rf_*\left(R\mathop{\mathcal{H}\! \mathit{om}}\nolimits _{\mathcal{O}_ X}(K, M) \otimes _{\mathcal{O}_ X}^\mathbf {L} M\right) \ar[d] \\ R\mathop{\mathcal{H}\! \mathit{om}}\nolimits _{\mathcal{O}_ Y}(Rf_*K, Rf_*M) \otimes _{\mathcal{O}_ Y}^\mathbf {L} Rf_*M \ar[r] & Rf_*M }$

is commutative. Here the left vertical arrow comes from Remark 20.42.11. The top horizontal arrow is Remark 20.28.7. The other two arrows are instances of the map in Lemma 20.42.5 (with one of the entries replaced with $\mathcal{O}_ X$ or $\mathcal{O}_ Y$).

Remark 20.42.13. Let $h : X \to Y$ be a morphism of ringed spaces. Let $K, L$ be objects of $D(\mathcal{O}_ Y)$. We claim there is a canonical map

$Lh^*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (Lh^*K, Lh^*L)$

in $D(\mathcal{O}_ X)$. Namely, by (20.42.0.1) proved in Lemma 20.42.2 such a map is the same thing as a map

$Lh^*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \otimes ^\mathbf {L} Lh^*K \longrightarrow Lh^*L$

The source of this arrow is $Lh^*(\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \otimes ^\mathbf {L} K)$ by Lemma 20.27.3 hence it suffices to construct a canonical map

$R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \otimes ^\mathbf {L} K \longrightarrow L.$

For this we take the arrow corresponding to

$\text{id} : R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \longrightarrow R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L)$

via (20.42.0.1).

Remark 20.42.14. Suppose that

$\xymatrix{ X' \ar[r]_ h \ar[d]_{f'} & X \ar[d]^ f \\ S' \ar[r]^ g & S }$

is a commutative diagram of ringed spaces. Let $K, L$ be objects of $D(\mathcal{O}_ X)$. We claim there exists a canonical base change map

$Lg^*Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \longrightarrow R(f')_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (Lh^*K, Lh^*L)$

in $D(\mathcal{O}_{S'})$. Namely, we take the map adjoint to the composition

\begin{align*} L(f')^*Lg^*Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) & = Lh^*Lf^*Rf_*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \\ & \to Lh^*R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (K, L) \\ & \to R\mathop{\mathcal{H}\! \mathit{om}}\nolimits (Lh^*K, Lh^*L) \end{align*}

where the first arrow uses the adjunction mapping $Lf^*Rf_* \to \text{id}$ and the second arrow is the canonical map constructed in Remark 20.42.13.

Comment #7424 by Nik on

Some minor typos: some of the references read 20.38.X, although they link to 20.39.X.

Comment #7438 by Zhiyu Z on

@7424 Can you be more specific on where "20.39" reads "20.38"? There seems to be no "20.38" Tag used in the section..

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).