Suppose $i\_Z \hookrightarrow X$ be a closed immersion, with $Z$ and $X$ being smooth varieties over $\mathbb{C}$, and $c, d$ are the dimensions of $Z$ and $X$ respectively.


$\textbf{Question}:$ Is it true that $L\_n i^\*\_{Z} \mathcal{F} = 0$ for any $n>d-c$ and $\mathcal{F}\in Coh(X)$ ? 


The reason I ask is the following inconsistency I encounter (suppose $d=2$ and $c=1$ for simplicity), 
\begin{equation}
E\_2^{p,q}:= Ext\_Z^p(L\_q i^\*\_{Z}\mathcal{F},\mathcal{O}\_Z) \Longrightarrow E^{p+q}\_{\infty} = Ext\_Z^{p+q}(L i^\*\_{Z}\mathcal{F},\mathcal{O}\_Z)=Ext\_X^{p+q}(\mathcal{F},i\_{Z \*} \mathcal{O}\_Z).
\end{equation} 


Note that $E\_2^{1,2}$ survives to infinity, so $Ext\_X^{3}(\mathcal{F},i\_{Z \*} \mathcal{O}\_Z) \ne 0$, this is absurd because $X$ is a surface and $Ext\_X^3 = 0$. But this must be true for any curve $Z\subset X$, and any sheaf over that (not just the structure sheaf $\mathcal{O}\_Z$). So I got the question above.


This is puzzling for me because in general there is a resolution by locally free sheaves (again I just assume $d=2$),


\begin{equation}
0 \longrightarrow V^{2}\longrightarrow V^1 \longrightarrow V^0 \longrightarrow \mathcal{F}\longrightarrow 0,
\end{equation}
and $L\_n i\_Z^\* \mathcal{F} = \mathcal{H}^{-n} i\_Z^\* (V^{\bullet})$, so why if $n=2$ the corresponding cohomology should be zero?



Highest derived inverse image
Since $i\_\*$ is exact, we get isomorphisms
$$i\_\*L\_ji^\* \mathscr F \cong L\_j(i\_\*i^\*) \mathscr F.$$
Moreover, $i\_\*$ is faithful (in fact, it has a left inverse $i^\*$), thus to show that $L\_ji^\* \mathscr F$ vanishes for $j > \dim(X) - \dim(Z)$, it suffices to show the same statement for $L\_j(i\_\*i^\*)\mathscr F$. But the functor $i\_\*i^\*$ can also be described as $-\otimes\_{\mathcal O\_X} \mathcal O\_Z$, so its derived functor is
$$\mathscr Tor\_j^{\mathcal O\_X}(-,\mathcal O\_Z) = \underline H^{-j}\left(-\overset{\mathbb L}{\underset{\mathcal O\_X}\otimes}\mathcal O\_Z\right).$$
Now $\mathscr Tor(-,\mathcal O\_Z)$ (equivalently, $-\otimes^{\mathbb L} \mathcal O\_Z$) can be computed using a resolution for $\mathcal O\_Z$ instead.



> 
> **Lemma.** *Let $i \colon Z \to X$ be a regular closed immersion of Noetherian schemes that is locally cut out by $\leq n$ equations. Then $\mathcal O\_Z \in D(\mathcal O\_X)$ has [tor amplitude](https://stacks.math.columbia.edu/tag/0652) $[-n,0]$.*
> 
> 
> 


For example, a smooth subvariety $Z$ of a smooth variety $X$ is a regular immersion that is locally cut out by $\dim X - \dim Z$ equations [Tag [0E9J](https://stacks.math.columbia.edu/tag/0E9J)]. See also Hartshorne, Theorem II.8.17.


*Proof.* The statement is local on $X$ [Tag [08BS](https://stacks.math.columbia.edu/tag/08BS)], so we may assume that $X = \operatorname{Spec} A$ is affine and $Z$ is cut out by an ideal $I = (f\_1,\ldots,f\_n)$. Then we may take the Koszul resolution
$$K\_\bullet(A,f\_1,\ldots,f\_n) \stackrel\simeq\to \mathcal O\_Z[0] = A/I[0].$$
This is a resolution of length $n$ by free $A$-modules, showing that $A/I$ has tor amplitude $[-n,0]$ in $D(A)$ by [Tag [0654](https://stacks.math.columbia.edu/tag/0654)]. $\square$


If you prefer a less derived argument, what we're really doing is computing $\mathscr Tor\_j(-,\mathcal O\_Z)$ by locally using the Koszul resolution of $\mathcal O\_Z$ associated with a regular sequence cutting out $Z$; this can be done in a none-fancy setting.


