hcju/stacksqa huggingface dataset:
We can compute tor dimension at stalks, see Cohomology, Lemma \ref{cohomology-lemma-tor-amplitude-stalk}. If $x' \in X'$ with image $x \in X$, then $$ (L(g')^*E)_{x'} = E_x \otimes_{\mathcal{O}_{X, x}}^\mathbf{L} \mathcal{O}_{X', x'} $$ Let $s' \in S'$ and $s \in S$ be the image of $x'$ and $x$. Since $X$ and $S'$ are tor independent over $S$, we can apply More on Algebra, Lemma \ref{more-algebra-lemma-base-change-comparison} to see that the right hand side of the displayed formula is equal to $E_x \otimes_{\mathcal{O}_{S, s}}^\mathbf{L} \mathcal{O}_{S', s'}$ in $D(\mathcal{O}_{S', s'})$. Thus (1) follows from More on Algebra, Lemma \ref{more-algebra-lemma-pull-tor-amplitude}. To see (2) observe that flatness of $\mathcal{G}$ is equivalent to the condition that $\mathcal{G}[0]$ has tor amplitude in $[0, 0]$. Applying (1) we conclude.
Note that the lemma is supposed to hold for all $K \in D(\mathcal{O}_Z)$. Observe that $i_*$ and $i'_*$ are exact functors and hence $Ri_*$ and $Ri'_*$ are computed by applying $i_*$ and $i'_*$ to any representatives. Thus the base change map $$ Lf^*(Ri_*(K)) \longrightarrow Ri'_*(Lg^*(K)) $$ on stalks at a point $z' \in Z'$ with image $z \in Z$ is given by $$ K_z \otimes_{\mathcal{O}_{X, z}}^\mathbf{L} \mathcal{O}_{X', z'} \longrightarrow K_z \otimes_{\mathcal{O}_{Z, z}}^\mathbf{L} \mathcal{O}_{Z', z'} $$ This map is an isomorphism by More on Algebra, Lemma \ref{more-algebra-lemma-base-change-comparison} and the assumed tor independence.
[First proof] This follows from the following sequence of isomorphisms \begin{align*} Rf_*(Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M) & = Ra_*Rp_*(Lp^*K \otimes_{\mathcal{O}_{X \times_S Y}}^\mathbf{L} Lq^*M) \\ & = Ra_*(K \otimes_{\mathcal{O}_X}^\mathbf{L} Rp_*Lq^*M) \\ & = Ra_*(K \otimes_{\mathcal{O}_X}^\mathbf{L} La^*Rb_*M) \\ & = Ra_*K \otimes_{\mathcal{O}_S}^\mathbf{L} Rb_*M \end{align*} The first equality holds because $f = a \circ p$. The second equality by Lemma \ref{lemma-cohomology-base-change}. The third equality by Lemma \ref{lemma-compare-base-change}.  The fourth equality by Lemma \ref{lemma-cohomology-base-change}. We omit the verification that the composition of these isomorphisms is the same as the map (\ref{equation-kunneth}). If $S$ is affine, then the source and target of the arrow (\ref{equation-kunneth-global}) are the result of applying $R\Gamma(S, -)$ to the source and target of (\ref{equation-kunneth}) and we obtain the final statement; details omitted.
We may write $$ \mathcal{F}^\bullet = (\mathcal{F}^a \to \ldots \to \mathcal{F}^b) $$ Arguing by induction on $b - a$ and considering the distinguished triangle $$ \mathcal{F}^b[-b] \to (\mathcal{F}^a \to \ldots \to \mathcal{F}^b) \to (\mathcal{F}^a \to \ldots \to \mathcal{F}^{b - 1}) \to \mathcal{F}^b[-b + 1] $$ and using More on Algebra, Lemma \ref{more-algebra-lemma-K-flat-two-out-of-three} we reduce to the case where $\mathcal{F}^\bullet$ consists of a single quasi-coherent $\mathcal{O}_X$-module $\mathcal{F}$ placed in degree $0$. In this case the {\v C}ech complex for $\mathcal{F}$ and $\mathcal{U}$ is homotopy equivalent to the alternating {\v C}ech complex, see Cohomology, Lemma \ref{cohomology-lemma-alternating-usual}. Since $U_{i_0 \ldots i_p}$ is always affine, we see that $\mathcal{F}(U_{i_0 \ldots i_p})$ is $A$-flat. Hence $\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F})$ is a bounded complex of flat $A$-modules and hence K-flat by More on Algebra, Lemma \ref{more-algebra-lemma-derived-tor-quasi-isomorphism}.
In this case we have $R\SheafHom(K, K') = K' \otimes^\mathbf{L} K^\vee$, $R\SheafHom(M, M') = M' \otimes^\mathbf{L} M^\vee$, and $$ R\SheafHom(K \boxtimes M, K' \boxtimes M') = (K' \otimes^\mathbf{L} K^\vee) \boxtimes (M' \otimes^\mathbf{L} M^\vee) $$ See Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex} and we also use that being perfect is preserved by pullback and by tensor products. Hence this case follows from Lemma \ref{lemma-kunneth}. (We omit the verification that with these identifications we obtain the same map.)
The second arrow in (2) comes from the equality $$ R\Gamma(U, K) \otimes_{\mathcal{O}_X(U)}^\mathbf{L} \mathcal{O}_{X'}(U') = R\Gamma(U', L(g')^*K) $$ of Lemma \ref{lemma-quasi-coherence-pullback} and the given arrow $L(g')^*K \to K'$. The first arrow of (2) is More on Algebra, Equation (\ref{more-algebra-equation-comparison-map}). It is clear that (2) implies (3). Observe that (1) is local on $X'$. Therefore it suffices to show that if $X$, $S$, $S'$, $X'$ are affine, then (1) is equivalent to the condition that $$ R\Gamma(X, K) \otimes_{\mathcal{O}_S(S)}^\mathbf{L} \mathcal{O}_{S'}(S') \to R\Gamma(X, K) \otimes_{\mathcal{O}_X(X)}^\mathbf{L} \mathcal{O}_{X'}(X') \to R\Gamma(X', K') $$ is an isomorphism in $D(\mathcal{O}_{S'}(S'))$. Say $S = \Spec(R)$, $X = \Spec(A)$, $S' = \Spec(R')$, $X' = \Spec(A')$, $K$ corresponds to the complex $M^\bullet$ of $A$-modules, and $K'$ corresponds to the complex $N^\bullet$ of $A'$-modules. Note that $A' = A \otimes_R R'$. The condition above is that the composition $$ M^\bullet \otimes_R^\mathbf{L} R' \to M^\bullet \otimes_A^\mathbf{L} A' \to N^\bullet $$ is an isomorphism in $D(R')$. Equivalently, it is that for all $i \in \mathbf{Z}$ the map $$ H^i(M^\bullet \otimes_R^\mathbf{L} R') \to H^i(M^\bullet \otimes_A^\mathbf{L} A') \to H^i(N^\bullet) $$ is an isomorphism. Observe that this is a map of $A \otimes_R R'$-modules, i.e., of $A'$-modules. On the other hand, (1) is the requirement that for compatible primes $\mathfrak q' \subset A'$, $\mathfrak q \subset A$, $\mathfrak p' \subset R'$, $\mathfrak p \subset R$ the composition $$ H^i(M^\bullet_\mathfrak q \otimes_{R_\mathfrak p}^\mathbf{L} R'_{\mathfrak p'}) \otimes_{(A_\mathfrak q \otimes_{R_\mathfrak p} R'_{\mathfrak p'})} A'_{\mathfrak q'} \to H^i(M^\bullet_{\mathfrak q} \otimes_{A_\mathfrak q}^\mathbf{L} A'_{\mathfrak q'}) \to H^i(N^\bullet_{\mathfrak q'}) $$ is an isomorphism. Since $$ H^i(M^\bullet_\mathfrak q \otimes_{R_\mathfrak p}^\mathbf{L} R'_{\mathfrak p'}) \otimes_{(A_\mathfrak q \otimes_{R_\mathfrak p} R'_{\mathfrak p'})} A'_{\mathfrak q'} = H^i(M^\bullet \otimes_R^\mathbf{L} R') \otimes_{A'} A'_{\mathfrak q'} $$ is the localization at $\mathfrak q'$, we see that these two conditions are equivalent by Algebra, Lemma \ref{algebra-lemma-characterize-zero-local}.
We could prove this using the same method as in the proof of Lemma \ref{lemma-compare-base-change} but instead we will prove it using the induction principle and relative Mayer-Vietoris. \medskip\noindent To check the map is an isomorphism we may work locally on $S'$. Hence we may assume $g : S' \to S$ is a morphism of affine schemes. In particular $X$ is a quasi-compact and quasi-separated scheme. We will use the induction principle of Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle} to prove that for any quasi-compact open $U \subset X$ the similarly constructed map $Lg^*R(U \to S)_*K|_U \to R(U' \to S')_*K'|_{U'}$ is an isomorphism. Here $U' = (g')^{-1}(U)$. \medskip\noindent If $U \subset X$ is an affine open, then we find that the result is true by assumption, see Lemma \ref{lemma-single-complex-base-change-condition} part (2) and the translation into algebra afforded to us by Lemmas \ref{lemma-affine-compare-bounded} and \ref{lemma-quasi-coherence-pullback}. \medskip\noindent The induction step. Suppose that $X = U \cup V$ is an open covering with $U$, $V$, $U \cap V$ quasi-compact such that the result holds for $U$, $V$, and $U \cap V$. Denote $a = f|_U$, $b = f|_V$ and $c = f|_{U \cap V}$. Let $a' : U' \to S'$, $b' : V' \to S'$ and $c' : U' \cap V' \to S'$ be the base changes of $a$, $b$, and $c$. Using the distinguished triangles from relative Mayer-Vietoris (Cohomology, Lemma \ref{cohomology-lemma-unbounded-relative-mayer-vietoris}) we obtain a commutative diagram $$ \xymatrix{ Lg^*Rf_*K \ar[r] \ar[d] & Rf'_* K' \ar[d] \\ Lg^*Ra_* K|_U \oplus Lg^*Rb_* K|_V \ar[r] \ar[d] & Ra'_* K'|_{U'} \oplus Rb'_* K'|_{V'} \ar[d] \\ Lg^*Rc_* K|_{U \cap V} \ar[r] \ar[d] & Rc'_* K'|_{U' \cap V'} \ar[d] \\ Lg^*Rf_* K[1] \ar[r] & Rf'_* K'[1] } $$ Since the 2nd and 3rd horizontal arrows are isomorphisms so is the first (Derived Categories, Lemma \ref{derived-lemma-third-isomorphism-triangle}) and the proof of the lemma is finished.
The statement makes sense as the complexes involved have quasi-coherent cohomology sheaves by Lemmas \ref{lemma-quasi-coherence-pullback}, \ref{lemma-quasi-coherence-tensor-product}, and \ref{lemma-quasi-coherence-internal-hom} and Cohomology, Lemmas \ref{cohomology-lemma-pseudo-coherent-pullback} and \ref{cohomology-lemma-perfect-pullback}. Having said this, we can check the maps (\ref{equation-bc}) are isomorphisms in case (1) by computing the source and target of (\ref{equation-bc}) using the transitive property of tensor product, see More on Algebra, Lemma \ref{more-algebra-lemma-triple-tensor-product}. The map in (2) and (3) is the composition $$ L(g')^*R\SheafHom(E, K) \to R\SheafHom(L(g')^*E, L(g')^*K) \to R\SheafHom(L(g')^*E, K') $$ where the first arrow is Cohomology, Remark \ref{cohomology-remark-prepare-fancy-base-change} and the second arrow comes from the given map $L(g')^*K \to K'$. To prove the maps (\ref{equation-bc}) are isomorphisms one represents $E_x$ by a bounded complex of finite projective $\mathcal{O}_{X. x}$-modules in case (2) or by a bounded above complex of finite free modules in case (3) and computes the source and target of the arrow. Some details omitted.
The statement means the following. Let $g : S' \to S$ be a morphism of schemes and consider the base change diagram $$ \xymatrix{ X' \ar[r]_{g'} \ar[d]_{f'} & X \ar[d]^f \\ S' \ar[r]^g & S } $$ in other words $X' = S' \times_S X$. The lemma asserts that $$ Lg^*Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet) \longrightarrow Rf'_*\left( L(g')^*E \otimes^\mathbf{L}_{\mathcal{O}_{X'}} (g')^*\mathcal{G}^\bullet \right) $$ is an isomorphism. Observe that on the right hand side we do {\bf not} use the derived pullback on $\mathcal{G}^\bullet$. To prove this, we apply Lemmas \ref{lemma-single-complex-base-change} and \ref{lemma-single-complex-base-change-condition-inherited} to see that it suffices to prove the canonical map $$ L(g')^*\mathcal{G}^\bullet \to (g')^*\mathcal{G}^\bullet $$ satisfies the equivalent conditions of Lemma \ref{lemma-single-complex-base-change-condition}. This follows by checking the condition on stalks, where it immediately follows from the fact that $\mathcal{G}^\bullet_x \otimes_{\mathcal{O}_{S, s}} \mathcal{O}_{S', s'}$ computes the derived tensor product by our assumptions on the complex $\mathcal{G}^\bullet$.
The statement means the following. Let $g : S' \to S$ be a morphism of schemes and consider the base change diagram $$ \xymatrix{ X' \ar[r]_{g'} \ar[d]_{f'} & X \ar[d]^f \\ S' \ar[r]^g & S } $$ in other words $X' = S' \times_S X$. The lemma asserts that $$ Lg^*Rf_*R\SheafHom(E, \mathcal{G}^\bullet) \longrightarrow R(f')_*R\SheafHom(L(g')^*E, (g')^*\mathcal{G}^\bullet) $$ is an isomorphism. Observe that on the right hand side we do {\bf not} use the derived pullback on $\mathcal{G}^\bullet$. To prove this, we apply Lemmas \ref{lemma-single-complex-base-change} and \ref{lemma-single-complex-base-change-condition-inherited} to see that it suffices to prove the canonical map $$ L(g')^*\mathcal{G}^\bullet \to (g')^*\mathcal{G}^\bullet $$ satisfies the equivalent conditions of Lemma \ref{lemma-single-complex-base-change-condition}. This was shown in the proof of Lemma \ref{lemma-base-change-tensor}.
By Lemma \ref{lemma-direct-image-coherent} we see that $Rf_*E$ is an object of $D^b_{\textit{Coh}}(\mathcal{O}_S)$. Hence $Rf_*E$ is pseudo-coherent (Lemma \ref{lemma-identify-pseudo-coherent-noetherian}). Hence it suffices to show that $Rf_*E$ has finite tor dimension, see Cohomology, Lemma \ref{cohomology-lemma-perfect}. By Lemma \ref{lemma-tor-qc-qs} it suffices to check that $Rf_*(E) \otimes_{\mathcal{O}_S}^\mathbf{L} \mathcal{F}$ has universally bounded cohomology for all quasi-coherent sheaves $\mathcal{F}$ on $S$. Bounded from above is clear as $Rf_*(E)$ is bounded from above. Let $T \subset X$ be the union of the supports of $H^i(E)$ for all $i$. Then $T$ is proper over $S$ by assumptions (1) and (2), see Cohomology of Schemes, Lemma \ref{coherent-lemma-union-closed-proper-over-base}. In particular there exists a quasi-compact open $X' \subset X$ containing $T$. Setting $f' = f|_{X'}$ we have $Rf_*(E) = Rf'_*(E|_{X'})$ because $E$ restricts to zero on $X \setminus T$. Thus we may replace $X$ by $X'$ and assume $f$ is quasi-compact. Moreover, $f$ is quasi-separated by Morphisms, Lemma \ref{morphisms-lemma-finite-type-Noetherian-quasi-separated}. Now $$ Rf_*(E) \otimes_{\mathcal{O}_S}^\mathbf{L} \mathcal{F} = Rf_*\left(E \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F}\right) = Rf_*\left(E \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L} f^{-1}\mathcal{F}\right) $$ by Lemma \ref{lemma-cohomology-base-change} and Cohomology, Lemma \ref{cohomology-lemma-variant-derived-pullback}. By assumption (3) the complex $E \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L} f^{-1}\mathcal{F}$ has cohomology sheaves in a given finite range, say $[a, b]$. Then $Rf_*$ of it has cohomology in the range $[a, \infty)$ and we win.
The object $K$ is perfect by Lemma \ref{lemma-perfect-direct-image}. We check the lemma applies: Locally $E$ is isomorphic to a finite complex of finite free $\mathcal{O}_X$-modules. Hence locally $E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet$ is isomorphic to a finite complex whose terms are of the form $$ \bigoplus\nolimits_{i = a, \ldots, b} (\mathcal{G}^i)^{\oplus r_i} $$ for some integers $a, b, r_a, \ldots, r_b$. This immediately implies the cohomology sheaves $H^i(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G})$ are coherent. The hypothesis on the tor dimension also follows as $\mathcal{G}^i$ is flat over $f^{-1}\mathcal{O}_S$.
Since $E$ is a perfect complex there exists a dual perfect complex $E^\vee$, see Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}. Observe that $R\SheafHom(E, \mathcal{G}^\bullet) = E^\vee \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet$. Thus the perfectness of $K$ follows from Lemma \ref{lemma-tensor-perfect}.
We claim that Lemma \ref{lemma-perfect-direct-image} applies. Conditions (1) and (2) are immediate. Condition (3) is local on $X$. Thus we may assume $X$ and $S$ affine and $E$ represented by a strictly perfect complex of $\mathcal{O}_X$-modules. Since $\mathcal{O}_X$ is flat as a sheaf of $f^{-1}\mathcal{O}_S$-modules we find that condition (3) is satisfied.
We have $$ \mathcal{G}^\bullet \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F} = \mathcal{G}^\bullet \otimes_{f^{-1}\mathcal{O}_S}^\mathbf{L} f^{-1}\mathcal{F} = \mathcal{G}^\bullet \otimes_{f^{-1}\mathcal{O}_S} f^{-1}\mathcal{F} = \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F} $$ the first equality by Cohomology, Lemma \ref{cohomology-lemma-variant-derived-pullback}, the second as $\mathcal{G}^n$ is a flat $f^{-1}\mathcal{O}_S$-module, and the third by definition of pullbacks. Hence we obtain \begin{align*} H^i(X, E \otimes^\mathbf{L}_{\mathcal{O}_X} (\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})) & = H^i(X, E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet \otimes_{\mathcal{O}_X}^\mathbf{L} Lf^*\mathcal{F}) \\ & = H^i(S, Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet \otimes^\mathbf{L}_{\mathcal{O}_X} Lf^*\mathcal{F})) \\ & = H^i(S, Rf_*(E \otimes^\mathbf{L}_{\mathcal{O}_X} \mathcal{G}^\bullet) \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}) \\ & = H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F})  \end{align*} The first equality by the above, the second by Leray (Cohomology, Lemma \ref{cohomology-lemma-before-Leray}), and the third equality by Lemma \ref{lemma-cohomology-base-change}. The statement on boundary maps means the following: Given a short exact sequence $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$ of quasi-coherent $\mathcal{O}_S$-modules, the isomorphisms fit into commutative diagrams $$ \xymatrix{ H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3) \ar[r] \ar[d]_\delta & H^i(X, E \otimes^\mathbf{L}_{\mathcal{O}_X} (\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3)) \ar[d]^\delta \\ H^{i + 1}(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1) \ar[r] & H^{i + 1}(X, E \otimes^\mathbf{L}_{\mathcal{O}_X} (\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1)) } $$ where the boundary maps come from the distinguished triangle $$ K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1 \to K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_2 \to K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3 \to K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1[1] $$ and the distinguished triangle in $D(\mathcal{O}_X)$ associated to the short exact sequence $$ 0 \to \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1 \to \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_2 \to \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3 \to 0 $$ of complexes of $\mathcal{O}_X$-modules. This sequence is exact because $\mathcal{G}^n$ is flat over $S$. We omit the verification of the commutativity of the displayed diagram.
As in the proof of Lemma \ref{lemma-ext-perfect} let $E^\vee$ be the dual perfect complex and recall that $K = Rf_*(E^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}^\bullet)$. Since we also have $$ \Ext^i_{\mathcal{O}_X}(E, \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}) = H^i(X, E^\vee \otimes^\mathbf{L}_{\mathcal{O}_X} (\mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F})) $$ by construction of $E^\vee$, the existence of the isomorphisms follows from Lemma \ref{lemma-compute-tensor-perfect} applied to $E^\vee$ and $\mathcal{G}^\bullet$. The statement on boundary maps means the following: Given a short exact sequence $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$ then the isomorphisms fit into commutative diagrams $$ \xymatrix{ H^i(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3) \ar[r] \ar[d]_\delta & \Ext^i_{\mathcal{O}_X}(E, \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3) \ar[d]^\delta \\ H^{i + 1}(S, K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1) \ar[r] & \Ext^{i + 1}_{\mathcal{O}_X}(E, \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1) } $$ where the boundary maps come from the distinguished triangle $$ K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1 \to K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_2 \to K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_3 \to K \otimes^\mathbf{L}_{\mathcal{O}_S} \mathcal{F}_1[1] $$ and the distinguished triangle in $D(\mathcal{O}_X)$ associated to the short exact sequence $$ 0 \to \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_1 \to \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_2 \to \mathcal{G}^\bullet \otimes_{\mathcal{O}_X} f^*\mathcal{F}_3 \to 0 $$ of complexes. This sequence is exact because $\mathcal{G}$ is flat over $S$. We omit the verification of the commutativity of the displayed diagram.
For every open $U_0 \subset S_0$ consider the condition $P$ that the canonical map $$ \colim_{i \geq 0} \Hom_{D(\mathcal{O}_{U_i})}(E_i|_{U_i}, K_i|_{U_i}) \longrightarrow \Hom_{D(\mathcal{O}_U)}(E|_U, K|_U) $$ is an isomorphism, where $U = f_0^{-1}(U_0)$ and $U_i = f_{i0}^{-1}(U_0)$. We will prove $P$ holds for all quasi-compact opens $U_0$ by the induction principle of Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}. Condition (2) of this lemma follows immediately from Mayer-Vietoris for hom in the derived category, see Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris-hom}. Thus it suffices to prove the lemma when $S_0$ is affine. \medskip\noindent Assume $S_0$ is affine. Say $S_0 = \Spec(A_0)$, $S_i = \Spec(A_i)$, and $S = \Spec(A)$. We will use Lemma \ref{lemma-affine-compare-bounded} without further mention. \medskip\noindent In case (1) the object $E_0^\bullet$ corresponds to a finite complex of finite projective $A_0$-modules, see Lemma \ref{lemma-perfect-affine}. We may represent the object $K_0$ by a K-flat complex $K_0^\bullet$ of $A_0$-modules. In this situation we are trying to prove $$ \colim_{i \geq 0} \Hom_{D(A_i)}(E_0^\bullet \otimes_{A_0} A_i, K_0^\bullet \otimes_{A_0} A_i) \longrightarrow \Hom_{D(A)}(E_0^\bullet \otimes_{A_0} A, K_0^\bullet \otimes_{A_0} A) $$ Because $E_0^\bullet$ is a bounded above complex of projective modules we can rewrite this as $$ \colim_{i \geq 0} \Hom_{K(A_0)}(E_0^\bullet, K_0^\bullet \otimes_{A_0} A_i) \longrightarrow \Hom_{K(A_0)}(E_0^\bullet, K_0^\bullet \otimes_{A_0} A) $$ Since there are only a finite number of nonzero modules $E_0^n$ and since these are all finitely presented modules, this map is an isomorphism. \medskip\noindent In case (2) the object $E_0$ corresponds to a bounded above complex $E_0^\bullet$ of finite free $A_0$-modules, see Lemma \ref{lemma-pseudo-coherent-affine}. We may represent $K_0$ by a finite complex $K_0^\bullet$ of flat $A_0$-modules, see Lemma \ref{lemma-tor-dimension-affine} and More on Algebra, Lemma \ref{more-algebra-lemma-tor-amplitude}. In particular $K_0^\bullet$ is K-flat and we can argue as before to arrive at the map $$ \colim_{i \geq 0} \Hom_{K(A_0)}(E_0^\bullet, K_0^\bullet \otimes_{A_0} A_i) \longrightarrow \Hom_{K(A_0)}(E_0^\bullet, K_0^\bullet \otimes_{A_0} A) $$ It is clear that this map is an isomorphism (only a finite number of terms are involved since $K_0^\bullet$ is bounded).
For every open $U_0 \subset S_0$ consider the condition $P$ that the functor $$ \colim_{i \geq 0} D_{perf}(\mathcal{O}_{U_i}) \longrightarrow D_{perf}(\mathcal{O}_U) $$ is an equivalence where ${}_{perf}$ indicates the full subcategory of perfect objects and where $U = f_0^{-1}(U_0)$ and $U_i = f_{i0}^{-1}(U_0)$. We will prove $P$ holds for all quasi-compact opens $U_0$ by the induction principle of Cohomology of Schemes, Lemma \ref{coherent-lemma-induction-principle}. First, we observe that we already know the functor is fully faithful by Lemma \ref{lemma-descend-homomorphisms}. Thus it suffices to prove essential surjectivity. \medskip\noindent We first check condition (2) of the induction principle. Thus suppose that we have $S_0 = U_0 \cup V_0$ and that $P$ holds for $U_0$, $V_0$, and $U_0 \cap V_0$. Let $E$ be a perfect object of $D(\mathcal{O}_S)$. We can find $i \geq 0$ and $E_{U, i}$ perfect on $U_i$ and $E_{V, i}$ perfect on $V_i$ whose pullback to $U$ and $V$ are isomorphic to $E|_U$ and $E|_V$. Denote $$ a : E_{U, i} \to (Rf_{i, *}E)|_{U_i} \quad\text{and}\quad b : E_{V, i} \to (Rf_{i, *}E)|_{V_i} $$ the maps adjoint to the isomorphisms $Lf_i^*E_{U, i} \to E|_U$ and $Lf_i^*E_{V, i} \to E|_V$. By fully faithfulness, after increasing $i$, we can find an isomorphism $c : E_{U, i}|_{U_i \cap V_i} \to E_{V, i}|_{U_i \cap V_i}$ which pulls back to the identifications  $$ Lf_i^*E_{U, i}|_{U \cap V} \to E|_{U \cap V} \to Lf_i^*E_{V, i}|_{U \cap V}. $$ Apply Cohomology, Lemma \ref{cohomology-lemma-glue} to get an object $E_i$ on $S_i$ and a map $d : E_i \to Rf_{i, *}E$ which restricts to the maps $a$ and $b$ over $U_i$ and $V_i$. Then it is clear that $E_i$ is perfect and that $d$ is adjoint to an isomorphism $Lf_i^*E_i \to E$. \medskip\noindent Finally, we check condition (1) of the induction principle, in other words, we check the lemma holds when $S_0$ is affine. Say $S_0 = \Spec(A_0)$, $S_i = \Spec(A_i)$, and $S = \Spec(A)$. Using Lemmas \ref{lemma-affine-compare-bounded} and \ref{lemma-perfect-affine} we see that we have to show that $$ D_{perf}(A) = \colim D_{perf}(A_i) $$ This is clear from the fact that perfect complexes over rings are given by finite complexes of finite projective (hence finitely presented) modules. See More on Algebra, Lemma \ref{more-algebra-lemma-colimit-perfect-complexes} for details.