**Proof.**
Suppose that we have maps of complexes of $p^{-1}\mathcal{O}_ S$-modules

\[ \mathcal{F}_1^\bullet \to \mathcal{F}_2^\bullet \to \mathcal{F}_3^\bullet \to \mathcal{F}_1^\bullet [1] \]

Then by the functoriality of the cup product we obtain a commutative diagram

\[ \xymatrix{ R\Gamma (X, \mathcal{F}_1^\bullet ) \otimes _ A^\mathbf {L} R\Gamma (Y, \mathcal{G}^\bullet ) \ar[r] \ar[d] & R\Gamma (X \times _ S Y, \text{Tot}(p^{-1}\mathcal{F}_1^\bullet \otimes _{f^{-1}\mathcal{O}_ S} q^{-1}\mathcal{G}^\bullet )) \ar[d] \\ R\Gamma (X, \mathcal{F}_2^\bullet ) \otimes _ A^\mathbf {L} R\Gamma (Y, \mathcal{G}^\bullet ) \ar[r] \ar[d] & R\Gamma (X \times _ S Y, \text{Tot}(p^{-1}\mathcal{F}_2^\bullet \otimes _{f^{-1}\mathcal{O}_ S} q^{-1}\mathcal{G}^\bullet )) \ar[d] \\ R\Gamma (X, \mathcal{F}_3^\bullet ) \otimes _ A^\mathbf {L} R\Gamma (Y, \mathcal{G}^\bullet ) \ar[r] \ar[d] & R\Gamma (X \times _ S Y, \text{Tot}(p^{-1}\mathcal{F}_3^\bullet \otimes _{f^{-1}\mathcal{O}_ S} q^{-1}\mathcal{G}^\bullet )) \ar[d] \\ R\Gamma (X, \mathcal{F}_1^\bullet [1]) \otimes _ A^\mathbf {L} R\Gamma (Y, \mathcal{G}^\bullet ) \ar[r] & R\Gamma (X \times _ S Y, \text{Tot}(p^{-1}\mathcal{F}_1^\bullet [1] \otimes _{f^{-1}\mathcal{O}_ S} q^{-1}\mathcal{G}^\bullet )) } \]

If the original maps form a distinguished triangle in the homotopy category of complexes of $p^{-1}\mathcal{O}_ S$-modules, then the columns of this diagram form distinguished triangles in $D(A)$.

Suppose that $\mathcal{F}^ n = 0$ for $n < i$. Then we may consider the termwise split short exact sequence of complexes

\[ 0 \to \sigma _{\geq i + 1}\mathcal{F}^\bullet \to \mathcal{F}^\bullet \to \mathcal{F}^ i[-i] \to 0 \]

where the truncation is as in Homology, Section 12.15. This produces the distinguished triangle

\[ \sigma _{\geq i + 1}\mathcal{F}^\bullet \to \mathcal{F}^\bullet \to \mathcal{F}^ i[-i] \to (\sigma _{\geq i + 1}\mathcal{F}^\bullet )[1] \]

where the final arrow is given by the boundary map $\mathcal{F}^ i \to \mathcal{F}^{i + 1}$. It follows from the discussion above that it suffices to prove the lemma for $\mathcal{F}^ i[-i]$ and $\sigma _{\geq i + 1}\mathcal{F}^\bullet $. Since $\sigma _{\geq i + 1}\mathcal{F}^\bullet $ has fewer nonzero terms, by induction, if we can prove the lemma if $\mathcal{F}^\bullet $ is nonzero only in single degree, then the lemma follows. Thus we may assume $\mathcal{F}^\bullet $ is nonzero only in one degree.

Assume $\mathcal{F}^\bullet $ is the complex which has an $S$-flat quasi-coherent $\mathcal{O}_ X$-module $\mathcal{F}$ sitting in degree $0$ and is zero in other degrees. Observe that $R\Gamma (X, \mathcal{F})$ has finite tor dimension by Lemma 36.22.3 for example. Say it has tor amplitude in $[i, j]$. Pick $N \gg 0$ and consider the distinguished triangle

\[ \sigma _{\geq N + 1}\mathcal{G}^\bullet \to \mathcal{G}^\bullet \to \sigma _{\leq N}\mathcal{G}^\bullet \to (\sigma _{\geq N + 1}\mathcal{G}^\bullet )[1] \]

in the homotopy category of complexes of $b^{-1}\mathcal{O}_ S$-modules on $Y$. Now observe that both

\[ R\Gamma (X, \mathcal{F}) \otimes _ A^\mathbf {L} R\Gamma (Y, \sigma _{\geq N + 1}\mathcal{G}^\bullet ) \quad \text{and}\quad R\Gamma (X \times _ S Y, \mathcal{F} \otimes _{f^{-1}\mathcal{O}_ S} q^{-1}\sigma _{\geq N + 1}\mathcal{G}^\bullet )) \]

have vanishing cohomology in degrees $\leq N + i$. Thus, using the arguments given above, if we want to prove our statement in a given degree, then we may assume $\mathcal{G}^\bullet $ is bounded. Repeating the arguments above one more time we may also assume $\mathcal{G}^\bullet $ is nonzero only in one degree. This case is handled by Lemma 36.22.5.
$\square$

## Comments (2)

Comment #4650 by Johan on

Comment #4667 by Johan on