hcju/stacksqa huggingface dataset:
Let $\Delta : X \to X \times_R X$ be the diagonal morphism and set $\mathcal{O}_\Delta = \Delta_*\mathcal{O}_X$. Since $\Delta$ is a closed immersion have a short exact sequence $$ 0 \to \mathcal{I} \to  \mathcal{O}_{X \times_R X} \to \mathcal{O}_\Delta \to 0 $$ Since $\mathcal{K}$ is flat over $X$, the pullback $\text{pr}_{23}^*\mathcal{K}$ to $X \times_R X \times_R Y$ is flat over $X \times_R X$ and we obtain a short exact sequence $$ 0 \to  \text{pr}_{12}^*\mathcal{I} \otimes \text{pr}_{23}^*\mathcal{K} \to \text{pr}_{12}^*\mathcal{O}_{X \times_R X} \otimes \text{pr}_{23}^*\mathcal{K} \to \text{pr}_{12}^*\mathcal{O}_\Delta \otimes \text{pr}_{23}^*\mathcal{K} \to 0 $$ on $X \times_R X \times_R Y$. Thus, by Lemma \ref{lemma-persistence-exactness} we obtain a surjection $$ \text{pr}_{13, *}( \text{pr}_{12}^*\mathcal{O}_{X \times_R X} \otimes \text{pr}_{23}^*\mathcal{K}) \to \text{pr}_{13, *}( \text{pr}_{12}^*\mathcal{O}_\Delta \otimes \text{pr}_{23}^*\mathcal{K}) $$ By flat base change ( Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}) the source of this arrow is equal to $\mathcal{O}_X \boxtimes F(\mathcal{O}_X)$. On the other hand the target is equal to $$ \text{pr}_{13, *}( \text{pr}_{12}^*\mathcal{O}_\Delta \otimes \text{pr}_{23}^*\mathcal{K}) = \text{pr}_{13, *} (\Delta \times \text{id}_Y)_* \mathcal{K} = \mathcal{K} $$ which finishes the proof. The first equality holds for example by Cohomology, Lemma \ref{cohomology-lemma-projection-formula-closed-immersion} and the fact that $\text{pr}_{12}^*\mathcal{O}_\Delta = (\Delta \times \text{id}_Y)_*\mathcal{O}_{X \times_R Y}$.
The existence and uniqueness of the extension is a general fact, see Categories, Lemma \ref{categories-lemma-extend-functor-by-colim}. To see that the lemma applies observe that coherent modules are of finite presentation (Modules, Lemma \ref{modules-lemma-coherent-finite-presentation}) and hence categorically compact objects of $\textit{Mod}(\mathcal{O}_X)$ by Modules, Lemma \ref{modules-lemma-finite-presentation-quasi-compact-colimit}. Finally, every quasi-coherent module is a filtered colimit of coherent ones for example by Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}. \medskip\noindent Assume $F$ is additive. If $\mathcal{F} = \bigoplus_{j \in J} \mathcal{H}_j$ with $\mathcal{H}_j$ quasi-coherent, then $\mathcal{F} = \colim_{J' \subset J\text{ finite}} \bigoplus_{j \in J'} \mathcal{H}_j$. Denoting the extension of $F$ also by $F$ we obtain \begin{align*} F(\mathcal{F}) & = \colim_{J' \subset J\text{ finite}} F(\bigoplus\nolimits_{j \in J'} \mathcal{H}_j) \\ & = \colim_{J' \subset J\text{ finite}} \bigoplus\nolimits_{j \in J'} F(\mathcal{H}_j) \\ & = \bigoplus\nolimits_{j \in J} F(\mathcal{H}_j) \end{align*} Thus $F$ commutes with arbitrary direct sums. \medskip\noindent Suppose $0 \to \mathcal{F} \to \mathcal{F}' \to \mathcal{F}'' \to 0$ is a short exact sequence of quasi-coherent $\mathcal{O}_X$-modules. Then we write $\mathcal{F}' = \bigcup \mathcal{F}'_i$ as the union of its coherent submodules, see Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type}. Denote $\mathcal{F}''_i \subset \mathcal{F}''$ the image of $\mathcal{F}'_i$ and denote $\mathcal{F}_i = \mathcal{F} \cap \mathcal{F}'_i = \Ker(\mathcal{F}'_i \to \mathcal{F}''_i)$. Then it is clear that $\mathcal{F} = \bigcup \mathcal{F}_i$ and $\mathcal{F}'' = \bigcup \mathcal{F}''_i$ and that we have short exact sequences $$ 0 \to \mathcal{F}_i \to \mathcal{F}_i' \to \mathcal{F}_i'' \to 0 $$ Since the extension commutes with filtered colimits we have $F(\mathcal{F}) = \colim_{i \in I} F(\mathcal{F}_i)$, $F(\mathcal{F}') = \colim_{i \in I} F(\mathcal{F}'_i)$, and $F(\mathcal{F}'') = \colim_{i \in I} F(\mathcal{F}''_i)$. Since filtered colimits are exact (Modules, Lemma \ref{modules-lemma-limits-colimits}) we conclude that exactness properties of $F$ are inherited by its extension.
By Zariski's main theorem we can find an open immersion $j : V \to Y$ over $X$ with $\pi : Y \to X$ finite, see More on Morphisms, Lemma \ref{more-morphisms-lemma-quasi-finite-separated-pass-through-finite}. Since $\pi$ is affine the functor $\pi_*$ is exact and faithful on the category of coherent $\mathcal{O}_X$-modules. Hence we see that $j_*\mathcal{K}$ is coherent and that $R^qj_*\mathcal{K}$ is zero for $q > 0$. In other words, we reduce to the case discussed in the next paragraph. \medskip\noindent Assume $f$ is an open immersion. We may replace $X$ by the scheme theoretic closure of $V$. Assume $X \setminus V$ is nonempty to get a contradiction. Choose a generic point $\xi \in X \setminus V$ of an irreducible component of $X \setminus V$. Looking at the situation after base change by $\Spec(\mathcal{O}_{X, \xi}) \to X$ using flat base change and using Local Cohomology, Lemma \ref{local-cohomology-lemma-finiteness-pushforwards-and-H1-local} we reduce to the algebra problem discussed in the next paragraph. \medskip\noindent Let $(A, \mathfrak m)$ be a Noetherian local ring. Let $M$ be a finite $A$-module whose support is $\Spec(A)$. Then $H^i_\mathfrak m(A) \not = 0$ for some $i$. This is true by Dualizing Complexes, Lemma \ref{dualizing-lemma-depth} and the fact that $M$ is not zero hence has finite depth.
Let $\mathcal{K}$ be as in (2). By Lemma \ref{lemma-functor-quasi-coherent-from-affine-diagonal} the functor $F$ given by (\ref{equation-FM-QCoh}) is exact and $k$-linear. Moreover, $F$ sends $\textit{Coh}(\mathcal{O}_X)$ into $\textit{Coh}(\mathcal{O}_Y)$ for example by Cohomology of Schemes, Lemma \ref{coherent-lemma-support-proper-over-base-pushforward}. \medskip\noindent Let us construct the quasi-inverse to the construction. Let $F$ be as in (1). By Lemma \ref{lemma-functor-coherent} we can extend $F$ to a $k$-linear exact functor on the categories of quasi-coherent modules which commutes with arbitrary direct sums. By Lemma \ref{lemma-functor-quasi-coherent-from-affine-diagonal} the extension corresponds to a unique quasi-coherent module $\mathcal{K}$, flat over $X$, such that $R^q\text{pr}_{2, *}(\text{pr}_1^*\mathcal{F} \otimes_{\mathcal{O}_{X \times Y}} \mathcal{K}) = 0$ for $q > 0$ for all quasi-coherent $\mathcal{O}_X$-modules $\mathcal{F}$. Since $F(\mathcal{O}_X)$ is a coherent $\mathcal{O}_Y$-module, we conclude from Lemma \ref{lemma-functor-quasi-coherent-from-separated} that $\mathcal{K}$ is coherent. \medskip\noindent For a closed point $x \in X$ denote $\mathcal{O}_x$ the skyscraper sheaf at $x$ with value the residue field of $x$. We have $$ F(\mathcal{O}_x) = \text{pr}_{2, *}(\text{pr}_1^*\mathcal{O}_x \otimes \mathcal{K}) = (x \times Y \to Y)_*(\mathcal{K}|_{x \times Y}) $$ Since $x \times Y \to Y$ is finite, we see that the pushforward along this morphism is faithful. Hence if $y \in Y$ is in the image of the support of $\mathcal{K}|_{x \times Y}$, then $y$ is in the support of $F(\mathcal{O}_x)$. \medskip\noindent Let $Z \subset X \times Y$ be the scheme theoretic support $Z$ of $\mathcal{K}$, see Morphisms, Definition \ref{morphisms-definition-scheme-theoretic-support}. We first prove that $Z \to Y$ is quasi-finite, by proving that its fibres over closed points are finite. Namely, if the fibre of $Z \to Y$ over a closed point $y \in Y$ has dimension $> 0$, then we can find infinitely many pairwise distinct closed points $x_1, x_2, \ldots$ in the image of $Z_y \to X$. Since we have a surjection $\mathcal{O}_X \to \bigoplus_{i = 1, \ldots, n} \mathcal{O}_{x_i}$ we obtain a surjection $$ F(\mathcal{O}_X) \to \bigoplus\nolimits_{i = 1, \ldots, n} F(\mathcal{O}_{x_i}) $$ By what we said above, the point $y$ is in the support of each of the coherent modules $F(\mathcal{O}_{x_i})$. Since $F(\mathcal{O}_X)$ is a coherent module, this will lead to a contradiction because the stalk of $F(\mathcal{O}_X)$ at $y$ will be generated by $< n$ elements if $n$ is large enough. Hence $Z \to Y$ is quasi-finite. Since $\text{pr}_{2, *}\mathcal{K}$ is coherent and $R^q\text{pr}_{2, *}\mathcal{K} = 0$ for $q > 0$ we conclude that $Z \to Y$ is finite by Lemma \ref{lemma-characterize-finite}.
By Lemma \ref{lemma-pushforward-invertible-pre} there exists a section $s' : Y  \to X$ such that $\mathcal{F} = s'_*\mathcal{L}$. Since $s'(Y)$ and $s(Y)$ have the same underlying closed subset and since both are reduced closed subschemes of $X$, they have to be equal. Hence $s = s'$ and the lemma holds.
By Lemma \ref{lemma-functor-coherent-over-field} we obtain a coherent $\mathcal{O}_{X \times Y}$-module $\mathcal{K}$ which is flat over $X$ with support finite over $Y$ such that $F$ is given by the restriction of the functor (\ref{equation-FM-QCoh}) to $\textit{Coh}(\mathcal{O}_X)$. If we can show that $F(\mathcal{O}_X)$ is an invertible $\mathcal{O}_Y$-module, then by Lemma \ref{lemma-pushforward-invertible-pre} we see that $\mathcal{K} = s_*\mathcal{L}$ for some section $s : Y \to X \times Y$ of $\text{pr}_2$ and some invertible $\mathcal{O}_Y$-module $\mathcal{L}$. This will show that $F$ has the form indicated with $f = \text{pr}_1 \circ s$. Some details omitted. \medskip\noindent It remains to show that $F(\mathcal{O}_X)$ is invertible. We only sketch the proof and we omit some of the details. For a closed point $x \in X$ we denote $\mathcal{O}_x$ in $\textit{Coh}(\mathcal{O}_X)$ the skyscraper sheaf at $x$ with value $\kappa(x)$. First we observe that the only simple objects of the category $\textit{Coh}(\mathcal{O}_X)$ are these skyscraper sheaves $\mathcal{O}_x$. The same is true for $Y$. Hence for every closed point $y \in Y$ there exists a closed point $x \in X$ such that $\mathcal{O}_y \cong F(\mathcal{O}_x)$. Moreover, looking at endomorphisms we find that $\kappa(x) \cong \kappa(y)$ as finite extensions of $k$. Then $$ \Hom_Y(F(\mathcal{O}_X), \mathcal{O}_y) \cong \Hom_Y(F(\mathcal{O}_X), F(\mathcal{O}_x)) \cong \Hom_X(\mathcal{O}_X, \mathcal{O}_x) \cong \kappa(x) \cong \kappa(y) $$ This implies that the stalk of the coherent $\mathcal{O}_Y$-module $F(\mathcal{O}_X)$ at $y \in Y$ can be generated by $1$ generator (and no less) for each closed point $y \in Y$. It follows immediately that $F(\mathcal{O}_X)$ is locally generated by $1$ element (and no less) and since $Y$ is reduced this indeed tells us it is an invertible module.
Let $K \in D^b(\mathcal{A})$. We will show $F(K)$ is isomorphic to $F'(K)$. We can represent $K$ by a bounded complex $A^\bullet$ of objects of $\mathcal{A}$. After replacing $K$ by a translation we may assume $A^i = 0$ for $i > 0$. Choose $n \geq 0$ such that $A^{-i} = 0$ for $i > n$. The objects $$ M_i = (A^{-i} \to \ldots \to A^0)[-i],\quad i = 0, \ldots, n $$ form a Postnikov system in $D^b(\mathcal{A})$ for the complex $A^\bullet = A^{-n} \to \ldots \to A^0$ in $D^b(\mathcal{A})$. See Derived Categories, Example \ref{derived-example-key-postnikov}. Since both $F$ and $F'$ are exact functors of triangulated categories both $$ F(M_i) \quad\text{and}\quad F'(M_i) $$ form a Postnikov system in $\mathcal{D}$ for the complex $$ F(A^{-n}) \to \ldots \to F(A^0) = F'(A^{-n}) \to \ldots \to F'(A^0) $$ Since all negative $\Ext$s between these objects vanish by assumption we conclude by uniqueness of Postnikov systems (Derived Categories, Lemma \ref{derived-lemma-existence-postnikov-system}) that $F(K) = F(M_n[n]) \cong F'(M_n[n]) = F'(K)$.
Denote $F_r$ and $F_l$ the right and left adjoints of $F$. For $E \in S$ choose a distinguished triangle $$ E \to F_r(F(E)) \to C \to E[1] $$ where the first arrow is the unit of the adjunction. For $E' \in S$ we have $$ \Hom(E', F_r(F(E))[i]) = \Hom(F(E'), F(E)[i]) = \Hom(E', E[i]) $$ The last equality holds by assumption (4). Hence applying the homological functor $\Hom(E', -)$ (Derived Categories, Lemma \ref{derived-lemma-representable-homological}) to the distinguished triangle above we conclude that $\Hom(E', C[i]) = 0$ for all $i \in \mathbf{Z}$ and $E' \in S$. By assumption (2) we conclude that $C = 0$ and $E = F_r(F(E))$. \medskip\noindent For $K \in \Ob(\mathcal{D})$ choose a distinguished triangle $$ F_l(F(K)) \to K \to C \to F_l(F(K))[1] $$ where the first arrow is the counit of the adjunction. For $E \in S$ we have $$ \Hom(F_l(F(K)), E[i]) = \Hom(F(K), F(E)[i]) = \Hom(K, F_r(F(E))[i]) = \Hom(K, E[i]) $$ where the last equality holds by the result of the first paragraph. Thus we conclude as before that $\Hom(C, E[i]) = 0$ for all $E \in S$ and $i \in \mathbf{Z}$. Hence $C = 0$ by assumption (3). Thus $F$ is fully faithful by Categories, Lemma \ref{categories-lemma-adjoint-fully-faithful}.
Since $\mathcal{F}$ is supported at $x$ we have $$ \Hom_X(\mathcal{F}, M) = \Hom_{\mathcal{O}_{X, x}}(\mathcal{F}_x, M_x) $$ and similarly we have $$ H^0(X, M \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{F}'[-d_x]) = \text{Tor}^{\mathcal{O}_{X, x}}_{d_x}(M_x, \mathcal{F}'_x) $$ Thus it suffices to show that given a Noetherian regular local ring $A$ of dimension $d$ and a finite length $A$-module $N$, if $N'$ is the Matlis dual to $N$, then there exists a functorial isomorphism $$ \Hom_A(N, K) = \text{Tor}^A_d(K, N') $$ for $K$ in $D_{perf}(A)$. We can write the left hand side as $H^0(R\Hom_A(N, A) \otimes_A^\mathbf{L} K)$ by More on Algebra, Lemma \ref{more-algebra-lemma-dual-perfect-complex} and the fact that $N$ determines a perfect object of $D(A)$. Hence the formula holds because $$ R\Hom_A(N, A) = R\Hom_A(N, A[d])[-d] = N'[-d] $$ by Dualizing Complexes, Lemma \ref{dualizing-lemma-dualizing-finite-length} and the fact that $A[d]$ is a normalized dualizing complex over $A$ ($A$ is Gorenstein by Dualizing Complexes, Lemma \ref{dualizing-lemma-regular-gorenstein}).
Observe that $H^i(X, K \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{O}_x)$ is equal to $K_x  \otimes_{\mathcal{O}_{X, x}}^\mathbf{L} \kappa(x)$. Hence part (5) follows from More on Algebra, Lemma \ref{more-algebra-lemma-cut-complex-in-two}. Part (6) follows from part (5). Part (1) follows from part (5), Lemma \ref{lemma-duality-at-point}, and the fact that the Matlis dual of $\kappa(x)$ is $\kappa(x)$. Part (2) follows from part (1). Part (3) follows from part (5) and the fact that $\Ext^i(K, \mathcal{O}_x) = H^i(X, K^\vee \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{O}_x)$ by Cohomology, Lemma \ref{cohomology-lemma-dual-perfect-complex}. Part (4) follows from part (3) and the fact that $K \cong (K^\vee)^\vee$ by the lemma just cited.
By Lemma \ref{lemma-get-fully-faithful-geometric} it suffices to show that the maps $$ F : \Ext^i_X(\mathcal{O}_x, \mathcal{O}_{x'}) \longrightarrow \Ext^i_Y(F(\mathcal{O}_x), F(\mathcal{O}_{x'})) $$ are isomorphisms for all $i \in \mathbf{Z}$ and all closed points $x, x' \in X$. By assumption, the source and the target are isomorphic. If $x \not = x'$, then both sides are zero and the result is true. If $x = x'$, then it suffices to prove that the map is either injective or surjective. For $i < 0$ both sides are zero and the result is true. For $i = 0$ any nonzero map $\alpha : \mathcal{O}_x \to \mathcal{O}_x$ of $\mathcal{O}_X$-modules is an isomorphism. Hence $F(\alpha)$ is an isomorphism too and so $F(\alpha)$ is nonzero. Thus the result for $i = 0$. For $i = 1$ a nonzero element $\xi$ in $\Ext^1(\mathcal{O}_x, \mathcal{O}_x)$ corresponds to a nonsplit short exact sequence $$ 0 \to \mathcal{O}_x \to \mathcal{F} \to \mathcal{O}_x \to 0 $$ Since $F(\mathcal{F}) \cong \mathcal{F}$ we see that $F(\mathcal{F})$ is a nonsplit extension of $\mathcal{O}_x$ by $\mathcal{O}_x$ as well. Since $\mathcal{O}_x \cong F(\mathcal{O}_x)$ is a simple $\mathcal{O}_X$-module and $\mathcal{F} \cong F(\mathcal{F})$ has length $2$, we see that in the distinguished triangle $$ F(\mathcal{O}_x) \to F(\mathcal{F}) \to F(\mathcal{O}_x) \xrightarrow{F(\xi)} F(\mathcal{O}_x)[1] $$ the first two arrows must form a short exact sequence which must be isomorphic to the above short exact sequence and hence is nonsplit. It follows that $F(\xi)$ is nonzero and we conclude for $i = 1$. For $i > 1$ composition of ext classes defines a surjection $$ \Ext^1(F(\mathcal{O}_x), F(\mathcal{O}_x)) \otimes \ldots \otimes \Ext^1(F(\mathcal{O}_x), F(\mathcal{O}_x)) \longrightarrow \Ext^i(F(\mathcal{O}_x), F(\mathcal{O}_x)) $$ See Duality for Schemes, Lemma \ref{duality-lemma-regular-ideal-ext}. Hence surjectivity in degree $1$ implies surjectivity for $i > 0$. This finishes the proof.
Denote $H : \textit{Coh}(\mathcal{O}_X) \to \textit{Coh}(\mathcal{O}_Y)$ the restriction of $F$. Since $F$ is an exact functor of triangulated categories, we see that $H$ is an exact functor of abelian categories. Of course $H$ is $k$-linear as $F$ is. By Lemma \ref{lemma-functor-coherent-over-field} we obtain a coherent $\mathcal{O}_{X \times Y}$-module $\mathcal{K}$ which is flat over $X$ and has support finite over $Y$. Let $F'$ be the Fourier-Mukai functor defined using $\mathcal{K}$ so that $F'$ restricts to $H$ on $ \textit{Coh}(\mathcal{O}_X)$. The functor $F'$ sends $D^b_{\textit{Coh}}(\mathcal{O}_X)$ into $D^b_{\textit{Coh}}(\mathcal{O}_Y)$ by Lemma \ref{lemma-fourier-mukai-Coh}. Observe that $F$ and $F'$ satisfy the first and second condition of Lemma \ref{lemma-sibling-fully-faithful} and hence are siblings.
By Lemma \ref{lemma-noah-pre} the functor $F$ is fully faithful. We claim that Lemma \ref{lemma-preserves-Coh} applies to $F$. Namely, for every coherent $\mathcal{O}_X$-module $\mathcal{F}$ with $\dim(\text{Supp}(\mathcal{F})) = 0$ there is an isomorphism of $k$-vector spaces $$ \Hom_X(\mathcal{F}, M) = \Hom_X(F(\mathcal{F}), F(M)) \cong \Hom_X(\mathcal{F}, F(M)) $$ functorial in $M$ in $D_{perf}(\mathcal{O}_X)$. The first equality because $F$ is fully faithful.
Recall that $F$ has both adjoints, see Lemma \ref{lemma-always-right-adjoints}. In particular the essential image $\mathcal{A} \subset D_{perf}(\mathcal{O}_Y)$ of $F$ satisfies the equivalent conditions of Derived Categories, Lemma \ref{derived-lemma-right-adjoint}. We claim that $G$ factors through $\mathcal{A}$. Since $\mathcal{A} = {}^\perp(\mathcal{A}^\perp)$ by Derived Categories, Lemma \ref{derived-lemma-right-adjoint} it suffices to show that $\Hom_Y(G(M), N) = 0$ for all $M$ in $D_{perf}(\mathcal{O}_X)$ and $N \in \mathcal{A}^\perp$. We have $$ \Hom_Y(G(M), N) = \Hom_X(M, G_r(N)) $$ where $G_r$ is the right adjoint to $G$. Since $G(\mathcal{F}) \cong F(\mathcal{F})$ for $\mathcal{F}$ as in (1) we see that $\Hom_X(\mathcal{F}, G_r(N)) = 0$ by the same formula and the fact that $N$ is in the right orthogonal to the essential image $\mathcal{A}$ of $F$. Of course, the same vanishing holds for $\Hom_X(\mathcal{F}, G_r(N)[i])$ for any $i \in \mathbf{Z}$. Thus $G_r(N) = 0$ by Lemma \ref{lemma-orthogonal-point-sheaf} and the claim holds. \medskip\noindent Apply Lemma \ref{lemma-noah} to the functor $H = F^{-1} \circ G$ which makes sense because the essential image of $G$ is contained in the essential image of $F$ by the previous paragraph and because $F$ is fully faithful. We obtain an automorphism $f : X \to X$ and an invertible $\mathcal{O}_X$-module $\mathcal{L}$ such that the functor $H' : K \mapsto f^*K \otimes \mathcal{L}$ is a sibling of $H$. In particular $H$ is an auto-equivalence by Lemma \ref{lemma-sibling-faithful} and $H$ induces an auto-equivalence of $\textit{Coh}(\mathcal{O}_X)$ (as this is true for its sibling functor $H'$). Thus the quasi-inverses $H^{-1}$ and $(H')^{-1}$ exist, are siblings (small detail omitted), and $(H')^{-1}$ sends $M$ to $(f^{-1})^*(M \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{L}^{\otimes -1})$ which is a Fourier-Mukai functor (details omitted). Then of course $F = G \circ H^{-1}$ is a sibling of $G \circ (H')^{-1}$. Since compositions of Fourier-Mukai functors are Fourier-Mukai by Lemma \ref{lemma-compose-fourier-mukai} we conclude.
Let $i$ be the minimal integer such that the cohomology sheaf $H^i(K)$ is nonzero. Let $\mathcal{E}$ and $\mathcal{G}$ be finite locally free $\mathcal{O}_X$-modules. Then \begin{align*} H^i(X \times X, K \otimes_{\mathcal{O}_{X \times X}}^\mathbf{L} (\mathcal{E} \boxtimes \mathcal{G})) & = H^i(X, R\text{pr}_{2, *}(K \otimes_{\mathcal{O}_{X \times X}}^\mathbf{L} (\mathcal{E} \boxtimes \mathcal{G}))) \\ & = H^i(X, \Phi_K(\mathcal{E}) \otimes_{\mathcal{O}_X}^\mathbf{L} \mathcal{G}) \\ & \cong H^i(X, \mathcal{E} \otimes \mathcal{G}) \end{align*} which is zero if $i < 0$. On the other hand, we can choose $\mathcal{E}$ and $\mathcal{G}$ such that there is a surjection $\mathcal{E}^\vee \boxtimes \mathcal{G}^\vee \to H^i(K)$ by Lemma \ref{lemma-on-product}. In this case the left hand side of the equalities is nonzero. Hence we conclude that $H^i(K) = 0$ for $i < 0$. \medskip\noindent Let $i$ be the maximal integer such that $H^i(K)$ is nonzero. The same argument with $\mathcal{E}$ and $\mathcal{G}$ support of dimension $0$ shows that $i \leq 0$. Hence we conclude that $K$ is given by a single coherent $\mathcal{O}_{X \times X}$-module $\mathcal{K}$ sitting in degree $0$. \medskip\noindent Since $R\text{pr}_{2, *}(\text{pr}_1^*\mathcal{F} \otimes \mathcal{K})$ is $\mathcal{F}$, by taking $\mathcal{F}$ supported at closed points we see that the support of $\mathcal{K}$ is finite over $X$ via $\text{pr}_2$. Since $R\text{pr}_{2, *}(\mathcal{K}) \cong \mathcal{O}_X$ we conclude by Lemma \ref{lemma-pushforward-invertible-pre} that $\mathcal{K} = s_*\mathcal{O}_X$ for some section $s : X \to X \times X$ of the second projection. Then $\Phi_K(M) = f^*M$ where $f = \text{pr}_1 \circ s$ and this can happen only if $s$ is the diagonal morphism as desired.
To see this suppose we have $X, Y, Z$ and $K \in D_{perf}(\mathcal{O}_{X \times_S Y})$ and $M \in D_{perf}(\mathcal{O}_{Y \times_S Z})$. Denote $K' \in D_{perf}(\mathcal{O}_{X' \times_{S'} Y'})$ and $M' \in D_{perf}(\mathcal{O}_{Y' \times_{S'} Z'})$ their pullbacks as in the statement of the lemma. The diagram $$ \xymatrix{ X' \times_{S'} Y' \times_{S'} Z' \ar[r] \ar[d]_{\text{pr}'_{13}} & X \times_S Y \times_S Z \ar[d]^{\text{pr}_{13}} \\ X' \times_{S'} Z' \ar[r] & X \times_S Z } $$ is cartesian and $\text{pr}_{13}$ is proper and smooth. By Derived Categories of Schemes, Lemma \ref{perfect-lemma-flat-proper-perfect-direct-image-general} we see that the derived pullback by the lower horizontal arrow of the composition $$ R\text{pr}_{13, *}( L\text{pr}_{12}^*K \otimes_{\mathcal{O}_{X \times_S Y \times_S Z}}^\mathbf{L} L\text{pr}_{23}^*M) $$ indeed is (canonically) isomorphic to $$ R\text{pr}'_{13, *}( L(\text{pr}'_{12})^*K' \otimes_{\mathcal{O}_{X' \times_{S'} Y' \times_{S'} Z'}}^\mathbf{L} L(\text{pr}'_{23})^*M') $$ as desired. Some details omitted.
Let $K' \in D_{perf}(\mathcal{O}_{Y \times_S X})$ be the object assumed to exist in Definition \ref{definition-relative-equivalence-kernel}. Denote $K'_1$ the pullback of $K'$ by $Y_1 \times_{S_1} X_1 \to Y \times_S X$. Then it suffices to prove that we have $$ \Delta_{X_1/S_1, *}\mathcal{O}_X \cong R\text{pr}_{13, *}(L\text{pr}_{12}^*K_1 \otimes_{\mathcal{O}_{X_1 \times_{S_1} Y_1 \times_{S_1} X_1}}^\mathbf{L} L\text{pr}_{23}^*K_1') $$ in $D(\mathcal{O}_{X_1 \times_{S_1} X_1})$ and similarly for the other condition. Since $$ \xymatrix{ X_1 \times_{S_1} Y_1 \times_{S_1} X_1 \ar[r] \ar[d]_{\text{pr}_{13}} & X \times_S Y \times_S X \ar[d]^{\text{pr}_{13}} \\ X_1 \times_{S_1} X_1 \ar[r] & X \times_S X } $$ is cartesian it suffices by Derived Categories of Schemes, Lemma \ref{perfect-lemma-flat-proper-perfect-direct-image-general} to prove that $$ \Delta_{X_1/S_1, *}\mathcal{O}_{X_1} \cong L(X_1 \times_{S_1} X_1 \to X \times_S X)^*\Delta_{X/S, *}\mathcal{O}_X  $$ This in turn will be true if $X$ and $X_1 \times_{S_1} X_1$ are tor independent over $X \times_S X$, see Derived Categories of Schemes, Lemma \ref{perfect-lemma-compare-base-change}. This tor independence can be seen directly but also follows from the more general More on Morphisms, Lemma \ref{more-morphisms-lemma-case-of-tor-independence} applied to the square with corners $X, X, X, S$ and its base change by $S_1 \to S$.