hcju/stacksqa huggingface dataset:
We first define the left vertical arrow. Namely, choose a map $c : I \to J$ such that $U_i \subset f^{-1}(V_{c(i)})$ for all $i \in I$. In degree $p$ we define the map by the rule $$ \gamma(s)_{i_0 \ldots i_p} = \varphi(s)_{c(i_0) \ldots c(i_p)} $$ This makes sense because $\varphi$ does indeed induce maps $\mathcal{G}(V_{c(i_0) \ldots c(i_p)}) \to \mathcal{F}(U_{i_0 \ldots i_p})$ by assumption. It is also clear that this defines a morphism of complexes. Choose injective resolutions $\mathcal{F} \to \mathcal{I}^\bullet$ on $X$ and $\mathcal{G} \to J^\bullet$ on $Y$. According to the proof of Lemma \ref{lemma-cech-cohomology} we introduce the double complexes $A^{\bullet, \bullet}$ and $B^{\bullet, \bullet}$ with terms $$ B^{p, q} = \check{\mathcal{C}}^p(\mathcal{V}, \mathcal{J}^q) \quad \text{and} \quad A^{p, q} = \check{\mathcal{C}}^p(\mathcal{U}, \mathcal{I}^q). $$ As in Remark \ref{remark-explain-arrow} above we also choose an injective resolution $f_*\mathcal{I} \to (\mathcal{J}')^\bullet$ on $Y$ and a morphism of complexes $\beta : \mathcal{J} \to (\mathcal{J}')^\bullet$ making (\ref{equation-choice}) commutes. We introduce some more double complexes, namely $(B')^{\bullet, \bullet}$ and $(B''){\bullet, \bullet}$ with $$ (B')^{p, q} = \check{\mathcal{C}}^p(\mathcal{V}, (\mathcal{J}')^q) \quad \text{and} \quad (B'')^{p, q} = \check{\mathcal{C}}^p(\mathcal{V}, f_*\mathcal{I}^q). $$ Note that there is an $f$-map of complexes from $f_*\mathcal{I}^\bullet$ to $\mathcal{I}^\bullet$. Hence it is clear that the same rule as above defines a morphism of double complexes $$ \gamma : (B'')^{\bullet, \bullet} \longrightarrow A^{\bullet, \bullet}. $$ Consider the diagram of complexes $$ \xymatrix{ \check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}) \ar[r] & \text{Tot}(A^{\bullet, \bullet}) & & & \Gamma(X, \mathcal{I}^\bullet) \ar[lll]^{qis} \ar@{=}[ddl]\\ \check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G}) \ar[r] \ar[u]^\gamma & \text{Tot}(B^{\bullet, \bullet}) \ar[r]^\beta & \text{Tot}((B')^{\bullet, \bullet}) & \text{Tot}((B'')^{\bullet, \bullet}) \ar[l] \ar[llu]_{s\gamma} \\ & \Gamma(Y, \mathcal{J}^\bullet) \ar[u]^{qis} \ar[r]^\beta & \Gamma(Y, (\mathcal{J}')^\bullet) \ar[u] & \Gamma(Y, f_*\mathcal{I}^\bullet) \ar[u] \ar[l]_{qis} } $$ The two horizontal arrows with targets $\text{Tot}(A^{\bullet, \bullet})$ and $\text{Tot}(B^{\bullet, \bullet})$ are the ones explained in Lemma \ref{lemma-cech-cohomology}. The left upper shape (a pentagon) is commutative simply because (\ref{equation-choice}) is commutative. The two lower squares are trivially commutative. It is also immediate from the definitions that the right upper shape (a square) is commutative. The result of the lemma now follows from the definitions and the fact that going around the diagram on the outer sides from $\check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G})$ to $\Gamma(X, \mathcal{I}^\bullet)$ either on top or on bottom is the same (where you have to invert any quasi-isomorphisms along the way).
Let $\mathcal{U}$ be an open covering of $X$. By Lemma \ref{lemma-cech-spectral-sequence} there is an exact sequence $$ 0 \to \check{H}^1(\mathcal{U}, \mathcal{F}) \to H^1(X, \mathcal{F}) \to \check{H}^0(\mathcal{U}, \underline{H}^1(\mathcal{F})) $$ Thus the map is injective. To show surjectivity it suffices to show that any element of $\check{H}^0(\mathcal{U}, \underline{H}^1(\mathcal{F}))$ maps to zero after replacing $\mathcal{U}$ by a refinement. This is immediate from the definitions and the fact that $\underline{H}^1(\mathcal{F})$ is a presheaf of abelian groups whose sheafification is zero by locality of cohomology, see Lemma \ref{lemma-kill-cohomology-class-on-covering}.
Choose injective resolutions $\mathcal{F}^\bullet \to \mathcal{I}^\bullet$ and $(g')^*\mathcal{F}^\bullet \to \mathcal{J}^\bullet$. By Lemma \ref{lemma-pushforward-injective-flat} we see that $(g')_*\mathcal{J}^\bullet$ is a complex of injectives representing $R(g')_*(g')^*\mathcal{F}^\bullet$. Hence by Derived Categories, Lemmas \ref{derived-lemma-morphisms-lift} and \ref{derived-lemma-morphisms-equal-up-to-homotopy} the arrow $\beta$ in the diagram $$ \xymatrix{ (g')_*(g')^*\mathcal{F}^\bullet \ar[r] & (g')_*\mathcal{J}^\bullet \\ \mathcal{F}^\bullet \ar[u]^{adjunction} \ar[r] & \mathcal{I}^\bullet \ar[u]_\beta } $$ exists and is unique up to homotopy. Pushing down to $S$ we get $$ f_*\beta : f_*\mathcal{I}^\bullet \longrightarrow f_*(g')_*\mathcal{J}^\bullet = g_*(f')_*\mathcal{J}^\bullet $$ By adjunction of $g^*$ and $g_*$ we get a map of complexes $g^*f_*\mathcal{I}^\bullet \to (f')_*\mathcal{J}^\bullet$. Note that this map is unique up to homotopy since the only choice in the whole process was the choice of the map $\beta$ and everything was done on the level of complexes.
The base change map of Lemma \ref{lemma-base-change-map-flat-case} gives a canonical map $(Rf_*E)_y \to R\Gamma(f^{-1}(y), E|_{f^{-1}(y)})$. To prove this map is an isomorphism, we represent $E$ by a bounded below complex of injectives $\mathcal{I}^\bullet$. Set $Z = f^{-1}(\{y\})$. The assumptions of Lemma \ref{lemma-cohomology-of-closed} are satisfied, see Topology, Lemma \ref{topology-lemma-separated}. Hence the restrictions $\mathcal{I}^n|_Z$ are acyclic for $\Gamma(Z, -)$. Thus $R\Gamma(Z, E|_Z)$ is represented by the complex $\Gamma(Z, \mathcal{I}^\bullet|_Z)$, see Derived Categories, Lemma \ref{derived-lemma-leray-acyclicity}. In other words, we have to show the map $$ \colim_V \mathcal{I}^\bullet(f^{-1}(V)) \longrightarrow \Gamma(Z, \mathcal{I}^\bullet|_Z) $$ is an isomorphism. Using Lemma \ref{lemma-cohomology-of-closed} we see that it suffices to show that the collection of open neighbourhoods $f^{-1}(V)$ of $Z = f^{-1}(\{y\})$ is cofinal in the system of all open neighbourhoods. If $f^{-1}(\{y\}) \subset U$ is an open neighbourhood, then as $f$ is closed the set $V = Y \setminus f(X \setminus U)$ is an open neighbourhood of $y$ with $f^{-1}(V) \subset U$. This proves the lemma.
We argue exactly as in the proof of Theorem \ref{theorem-proper-base-change} and we find it suffices to show $(f_*\mathcal{F})_y = \Gamma(X_y, \mathcal{F}|_{X_y})$. Then we argue as in Lemma \ref{lemma-proper-base-change} to reduce this to the $p = 0$ case of Lemma \ref{lemma-cohomology-of-closed} for sheaves of sets. The first part of the proof of Lemma \ref{lemma-cohomology-of-closed} works for sheaves of sets and this finishes the proof. Some details omitted.
The case $p = 0$ is Sheaves, Lemma \ref{sheaves-lemma-descend-opens}. \medskip\noindent In this paragraph we show that we can find a map of systems $(\gamma_i) : (\mathcal{F}_i, \varphi_a) \to (\mathcal{G}_i, \psi_a)$ with $\mathcal{G}_i$ an injective abelian sheaf and $\gamma_i$ injective. For each $i$ we pick an injection $\mathcal{F}_i \to \mathcal{I}_i$ where $\mathcal{I}_i$ is an injective abelian sheaf on $X_i$. Then we can consider the family of maps $$ \gamma_i : \mathcal{F}_i \longrightarrow \prod\nolimits_{b : k \to i} f_{b, *}\mathcal{I}_k = \mathcal{G}_i $$ where the component maps are the maps adjoint to the maps $f_b^{-1}\mathcal{F}_i \to \mathcal{F}_k \to \mathcal{I}_k$. For $a : j \to i$ in $\mathcal{I}$ there is a canonical map $$ \psi_a : f_a^{-1}\mathcal{G}_i \to \mathcal{G}_j $$ whose components are the canonical maps $f_b^{-1}f_{a \circ b, *}\mathcal{I}_k \to f_{b, *}\mathcal{I}_k$ for $b : k \to j$. Thus we find an injection $\{\gamma_i\} : \{\mathcal{F}_i, \varphi_a) \to (\mathcal{G}_i, \psi_a)$ of systems of abelian sheaves. Note that $\mathcal{G}_i$ is an injective sheaf of abelian groups on $X_i$, see Lemma \ref{lemma-pushforward-injective-flat} and Homology, Lemma \ref{homology-lemma-product-injectives}. This finishes the construction. \medskip\noindent Arguing exactly as in the proof of Lemma \ref{lemma-quasi-separated-cohomology-colimit} we see that it suffices to prove that $H^p(X, \colim f_i^{-1}\mathcal{G}_i) = 0$ for $p > 0$. \medskip\noindent Set $\mathcal{G} = \colim f_i^{-1}\mathcal{G}_i$. To show vanishing of cohomology of $\mathcal{G}$ on every quasi-compact open of $X$, it suffices to show that the {\v C}ech cohomology of $\mathcal{G}$ for any covering $\mathcal{U}$ of a quasi-compact open of $X$ by finitely many quasi-compact opens is zero, see Lemma \ref{lemma-cech-vanish-basis}. Such a covering is the inverse by $p_i$ of such a covering $\mathcal{U}_i$ on the space $X_i$ for some $i$ by Topology, Lemma \ref{topology-lemma-descend-opens}. We have $$ \check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{G}) = \colim_{a : j \to i} \check{\mathcal{C}}^\bullet(f_a^{-1}(\mathcal{U}_i), \mathcal{G}_j) $$ by the case $p = 0$. The right hand side is a filtered colimit of complexes each of which is acyclic in positive degrees by Lemma \ref{lemma-injective-trivial-cech}. Thus we conclude by Algebra, Lemma \ref{algebra-lemma-directed-colimit-exact}.
Recall that $\underline{A}$ is the constant sheaf as defined in Sheaves, Definition \ref{sheaves-definition-constant-sheaf}. It is clear that for any nonempty open $U \subset X$ we have $\underline{A}(U) = A$ as $X$ is irreducible (and hence $U$ is connected). We will show that the higher {\v C}ech cohomology groups $\check{H}^p(\mathcal{U}, \underline{A})$ are zero for any open covering $\mathcal{U} : U = \bigcup_{i\in I} U_i$ of an open $U \subset X$. Then the lemma will follow from Lemma \ref{lemma-cech-vanish}. \medskip\noindent Recall that the value of an abelian sheaf on the empty open set is $0$. Hence we may clearly assume $U_i \not = \emptyset$ for all $i \in I$. In this case we see that $U_i \cap U_{i'} \not = \emptyset$ for all $i, i' \in I$. Hence we see that the {\v C}ech complex is simply the complex $$ \prod_{i_0 \in I} A \to \prod_{(i_0, i_1) \in I^2} A \to \prod_{(i_0, i_1, i_2) \in I^3} A \to \ldots $$ We have to see this has trivial higher cohomology groups. We can see this for example because this is the {\v C}ech complex for the covering of a $1$-point space and {\v C}ech cohomology agrees with cohomology on such a space. (You can also directly verify it by writing an explicit homotopy.)
Let $S = \coprod_{U \subset X} \mathcal{F}(U)$ where $U$ runs over the quasi-compact opens of $X$. For any finite subset $A = \{s_1, \ldots, s_n\} \subset S$, let $\mathcal{F}_A$ be the subsheaf of $\mathcal{F}$ generated by all $s_i$ (see Modules, Definition \ref{modules-definition-generated-by-local-sections}). Note that if $A \subset A'$, then $\mathcal{F}_A \subset \mathcal{F}_{A'}$. Hence $\{\mathcal{F}_A\}$ forms a system over the directed partially ordered set of finite subsets of $S$. By Modules, Lemma \ref{modules-lemma-generated-by-local-sections-stalk} it is clear that $$ \colim_A \mathcal{F}_A = \mathcal{F} $$ by looking at stalks. By Lemma \ref{lemma-quasi-separated-cohomology-colimit} we have $$ H^p(X, \mathcal{F}) = \colim_A H^p(X, \mathcal{F}_A) $$ Hence it suffices to prove the vanishing for the abelian sheaves $\mathcal{F}_A$. In other words, it suffices to prove the result when $\mathcal{F}$ is generated by finitely many local sections over quasi-compact opens of $X$. \medskip\noindent Suppose that $\mathcal{F}$ is generated by the local sections $s_1, \ldots, s_n$. Let $\mathcal{F}' \subset \mathcal{F}$ be the subsheaf generated by $s_1, \ldots, s_{n - 1}$. Then we have a short exact sequence $$ 0 \to \mathcal{F}' \to \mathcal{F} \to \mathcal{F}/\mathcal{F}' \to 0 $$ From the long exact sequence of cohomology we see that it suffices to prove the vanishing for the abelian sheaves $\mathcal{F}'$ and $\mathcal{F}/\mathcal{F}'$ which are generated by fewer than $n$ local sections. Hence it suffices to prove the vanishing for sheaves generated by at most one local section. These sheaves are exactly the quotients of the sheaves $j_!\underline{\mathbf{Z}}_U$ where $U$ is a quasi-compact open of $X$. \medskip\noindent Assume now that we have a short exact sequence $$ 0 \to \mathcal{K} \to j_!\underline{\mathbf{Z}}_U \to \mathcal{F} \to 0 $$ with $U$ quasi-compact open in $X$. It suffices to show that $H^q(X, \mathcal{K})$ is zero for $q \geq d + 1$. As above we can write $\mathcal{K}$ as the filtered colimit of subsheaves $\mathcal{K}'$ generated by finitely many sections over quasi-compact opens. Then $\mathcal{F}$ is the filtered colimit of the sheaves $j_!\underline{\mathbf{Z}}_U/\mathcal{K}'$. In this way we reduce to the case that $\mathcal{K}$ is generated by finitely many sections over quasi-compact opens. Note that $\mathcal{K}$ is a subsheaf of $\underline{\mathbf{Z}}_X$. Thus by Lemma \ref{lemma-subsheaf-of-constant-sheaf} there exists a finite filtration of $\mathcal{K}$ whose successive quotients $\mathcal{Q}$ fit into a short exact sequence $$ 0 \to j''_!\underline{\mathbf{Z}}_W \to j'_!\underline{\mathbf{Z}}_V \to \mathcal{Q} \to 0 $$ with $j'' : W \to X$ and $j' : V \to X$ the inclusions of quasi-compact opens. Hence the vanishing of $H^p(X, \mathcal{Q})$ for $p > d$ follows from our assumption (in the lemma) on the vanishing of the cohomology groups of $j''_!\underline{\mathbf{Z}}_W$ and $j'_!\underline{\mathbf{Z}}_V$. Returning to $\mathcal{K}$ this, via an induction argument using the long exact cohomology sequence, implies the desired vanishing for it as well.
Recall that $\underline{\mathbf{Z}}(V) = \mathbf{Z}$ for any nonempty open $V$ of $X$ (see proof of Lemma \ref{lemma-irreducible-constant-cohomology-zero}). If $\mathcal{H} = 0$, then the lemma holds with $d = 0$. If $\mathcal{H} \not = 0$, then there exists a nonempty open $U \subset X$ such that $\mathcal{H}(U) \not = 0$. Say $\mathcal{H}(U) = n\mathbf{Z}$ for some $n \geq 1$. Hence we see that $\underline{n\mathbf{Z}}_U \subset \mathcal{H}|_U \subset \underline{\mathbf{Z}}_U$. If the first inclusion is strict we can find a nonempty $U' \subset U$ and an integer $1 \leq n' < n$ such that $\underline{n'\mathbf{Z}}_{U'} \subset \mathcal{H}|_{U'} \subset \underline{\mathbf{Z}}_{U'}$. This process has to stop after a finite number of steps, and hence we get the lemma.
From Topology, Lemma \ref{topology-lemma-make-spectral-space} we see that $W = \lim U$ where the limit is over the quasi-compact opens containing $E$. Each $U$ is a spectral space by Topology, Lemma \ref{topology-lemma-spectral-sub}. Thus we may apply Lemma \ref{lemma-colimit} to conclude that (1) holds. The same proof works for part (2) except we use Topology, Lemma \ref{topology-lemma-make-spectral-space-minus}.
Observe that $E = \bigcap V$ where $V$ runs over the quasi-compact open neighbourhoods of $y$ in $Y$. Hence $f^{-1}(E) = \bigcap f^{-1}(V)$. This implies that $f^{-1}(E) = \lim f^{-1}(V)$ as topological spaces. Since $f$ is spectral, each $f^{-1}(V)$ is a spectral space too (Topology, Lemma \ref{topology-lemma-spectral-sub}). We conclude that $f^{-1}(E)$ is a spectral space and that $$ H^p(f^{-1}(E), \mathcal{F}|_{f^{-1}(E)}) = \colim H^p(f^{-1}(V), \mathcal{F}) $$ by Lemma \ref{lemma-colimit}. On the other hand, the stalk of $R^pf_*\mathcal{F}$ at $y$ is given by the colimit on the right.
Any open covering of $X$ can be refined by a finite disjoint union decomposition with open parts, see Topology, Lemma \ref{topology-lemma-profinite-refine-open-covering}. Hence if $\mathcal{F} \to \mathcal{G}$ is a surjection of abelian sheaves on $X$, then $\mathcal{F}(X) \to \mathcal{G}(X)$ is surjective. In other words, the global sections functor is an exact functor. Therefore its higher derived functors are zero, see Derived Categories, Lemma \ref{derived-lemma-right-derived-exact-functor}.
Let ${\mathcal I}^\bullet$ be a bounded below complex of injectives. The map (\ref{equation-global-sections-to-cech}) for $\mathcal{I}^\bullet$ is a map $\Gamma(X, {\mathcal I}^\bullet) \to \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet))$. This is a quasi-isomorphism of complexes of abelian groups as follows from Homology, Lemma \ref{homology-lemma-double-complex-gives-resolution} applied to the double complex $\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet)$ using Lemma \ref{lemma-injective-trivial-cech}. Suppose ${\mathcal F}^\bullet \to {\mathcal I}^\bullet$ is a quasi-isomorphism of ${\mathcal F}^\bullet$ into a bounded below complex of injectives. Since $R\Gamma(X, {\mathcal F}^\bullet)$ is represented by the complex $\Gamma(X, {\mathcal I}^\bullet)$ we obtain the map of the lemma using $$ \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal F}^\bullet)) \longrightarrow \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^\bullet)). $$ We omit the verification of functoriality and compatibilities. To construct the spectral sequence of the lemma, choose a Cartan-Eilenberg resolution $\mathcal{F}^\bullet \to \mathcal{I}^{\bullet, \bullet}$, see Derived Categories, Lemma \ref{derived-lemma-cartan-eilenberg}. In this case $\mathcal{F}^\bullet \to \text{Tot}(\mathcal{I}^{\bullet, \bullet})$ is an injective resolution and hence $$ \text{Tot}(\check{\mathcal{C}}^\bullet({\mathcal U}, \text{Tot}({\mathcal I}^{\bullet, \bullet}))) $$ computes $R\Gamma(X, \mathcal{F}^\bullet)$ as we've seen above. By Homology, Remark \ref{homology-remark-triple-complex} we can view this as the total complex associated to the triple complex $\check{\mathcal{C}}^\bullet({\mathcal U}, {\mathcal I}^{\bullet, \bullet})$ hence, using the same remark we can view it as the total complex associate to the double complex $A^{\bullet, \bullet}$ with terms $$ A^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p({\mathcal U}, \mathcal{I}^{q, m}) $$ Since $\mathcal{I}^{q, \bullet}$ is an injective resolution of $\mathcal{F}^q$ we can apply the first spectral sequence associated to $A^{\bullet, \bullet}$ (Homology, Lemma \ref{homology-lemma-ss-double-complex}) to get a spectral sequence with $$ E_1^{n, m} = \bigoplus\nolimits_{p + q = n} \check{\mathcal{C}}^p(\mathcal{U}, \underline{H}^m(\mathcal{F}^q)) $$ which is the $n$th term of the complex $\text{Tot}(\check{\mathcal{C}}^\bullet(\mathcal{U}, \underline{H}^m(\mathcal{F}^\bullet))$. Hence we obtain $E_2$ terms as described in the lemma. Convergence by Homology, Lemma \ref{homology-lemma-first-quadrant-ss}.
The map $\mathcal{O}' \to \SheafHom(\mathcal{I}, \mathcal{I})$ factors through $\mathcal{O}$ as $\mathcal{I} \cdot \mathcal{I} = 0$ by assumption. Hence $\mathcal{I}$ is a sheaf of $\mathcal{O}$-modules and this defines the $R$-module structure on $M$. The boundary map is additive hence it suffices to prove the Leibniz rule. Let $f \in R$. Choose an open covering $\mathcal{U} : X = \bigcup U_i$ such that there exist $f_i \in \mathcal{O}'(U_i)$ lifting $f|_{U_i} \in \mathcal{O}(U_i)$. Observe that $f_i - f_j$ is an element of $\mathcal{I}(U_i \cap U_j)$. Then $\partial(f)$ corresponds to the {\v C}ech cohomology class of the $1$-cocycle $\alpha$ with $\alpha_{i_0i_1} = f_{i_0} - f_{i_1}$. (Observe that by Lemma \ref{lemma-cech-h1} the first {\v C}ech cohomology group with respect to $\mathcal{U}$ is a submodule of $M$.) Next, let $g \in R$ be a second element and assume (after possibly refining the open covering) that $g_i \in \mathcal{O}'(U_i)$ lifts $g|_{U_i} \in \mathcal{O}(U_i)$. Then we see that $\partial(g)$ is given by the cocycle $\beta$ with $\beta_{i_0i_1} = g_{i_0} - g_{i_1}$. Since $f_ig_i \in \mathcal{O}'(U_i)$ lifts $fg|_{U_i}$ we see that $\partial(fg)$ is given by the cocycle $\gamma$ with $$ \gamma_{i_0i_1} = f_{i_0}g_{i_0} - f_{i_1}g_{i_1} = (f_{i_0} - f_{i_1})g_{i_0} + f_{i_1}(g_{i_0} - g_{i_1}) = \alpha_{i_0i_1}g + f\beta_{i_0i_1} $$ by our definition of the $\mathcal{O}$-module structure on $\mathcal{I}$. This proves the Leibniz rule and the proof is complete.
If $\mathcal{K}_x^\bullet$ is K-flat for all $x \in X$ then we see that $\mathcal{K}^\bullet$ is K-flat because $\otimes$ and direct sums commute with taking stalks and because we can check exactness at stalks, see Modules, Lemma \ref{modules-lemma-abelian}. Conversely, assume $\mathcal{K}^\bullet$ is K-flat. Pick $x \in X$ $M^\bullet$ be an acyclic complex of $\mathcal{O}_{X, x}$-modules. Then $i_{x, *}M^\bullet$ is an acyclic complex of $\mathcal{O}_X$-modules. Thus $\text{Tot}(i_{x, *}M^\bullet \otimes_{\mathcal{O}_X} \mathcal{K}^\bullet)$ is acyclic. Taking stalks at $x$ shows that $\text{Tot}(M^\bullet \otimes_{\mathcal{O}_{X, x}} \mathcal{K}_x^\bullet)$ is acyclic.
By Modules, Lemma \ref{modules-lemma-flat-tor-zero} for every complex $\mathcal{L}^\bullet$ we obtain a short exact sequence $$ 0 \to \text{Tot}(\mathcal{L}^\bullet \otimes_{\mathcal{O}_X} \mathcal{K}_1^\bullet) \to \text{Tot}(\mathcal{L}^\bullet \otimes_{\mathcal{O}_X} \mathcal{K}_1^\bullet) \to \text{Tot}(\mathcal{L}^\bullet \otimes_{\mathcal{O}_X} \mathcal{K}_1^\bullet) \to 0 $$ of complexes. Hence the lemma follows from the long exact sequence of cohomology sheaves and the definition of K-flat complexes.
The existence of the diagram and properties (1), (2), (3) follows immediately from Modules, Lemma \ref{modules-lemma-module-quotient-flat} and Derived Categories, Lemma \ref{derived-lemma-special-direct-system}. The induced map $\colim \mathcal{K}_n^\bullet \to \mathcal{G}^\bullet$ is a quasi-isomorphism because filtered colimits are exact.
Choose a diagram as in Lemma \ref{lemma-resolution-by-direct-sums-extensions-by-zero}. Each complex $\mathcal{K}_n^\bullet$ is a bounded above complex of flat modules, see Modules, Lemma \ref{modules-lemma-j-shriek-flat}. Hence $\mathcal{K}_n^\bullet$ is K-flat by Lemma \ref{lemma-bounded-flat-K-flat}. Thus $\colim \mathcal{K}_n^\bullet$ is K-flat by Lemma \ref{lemma-colimit-K-flat}. The induced map $\colim \mathcal{K}_n^\bullet \to \mathcal{G}^\bullet$ is a quasi-isomorphism and termwise surjective by construction. Property (3) of Lemma \ref{lemma-resolution-by-direct-sums-extensions-by-zero} shows that $\colim \mathcal{K}_n^m$ is a direct sum of flat modules and hence flat which proves the final assertion.
Choose a quasi-isomorphism $\mathcal{K}^\bullet \to \mathcal{F}^\bullet$ with $\mathcal{K}^\bullet$ a K-flat complex, see Lemma \ref{lemma-K-flat-resolution}. Consider the commutative diagram $$ \xymatrix{ \text{Tot}(\mathcal{K}^\bullet \otimes_{\mathcal{O}_X} \mathcal{P}^\bullet) \ar[r] \ar[d] & \text{Tot}(\mathcal{K}^\bullet \otimes_{\mathcal{O}_X} \mathcal{Q}^\bullet) \ar[d] \\ \text{Tot}(\mathcal{F}^\bullet \otimes_{\mathcal{O}_X} \mathcal{P}^\bullet) \ar[r] & \text{Tot}(\mathcal{F}^\bullet \otimes_{\mathcal{O}_X} \mathcal{Q}^\bullet) } $$ The result follows as by Lemma \ref{lemma-K-flat-quasi-isomorphism} the vertical arrows and the top horizontal arrow are quasi-isomorphisms.