hcju/stacksqa huggingface dataset:
Proof of (1). You can prove this by repeating the proof of Lemma \ref{lemma-compare-higher-direct-image-proper} part (1); we will instead deduce the result from this. As $\epsilon_{Y, *}$ is the identity functor on underlying presheaves, it reflects isomorphisms. Lemma \ref{lemma-comparison-ph-etale} shows that $\epsilon_{Y, *} \circ a_Y^{-1} = \pi_Y^{-1}$ and similarly for $X$. To show that the canonical map $a_Y^{-1}f_{small, *}\mathcal{F} \to f_{big, ph, *}a_X^{-1}\mathcal{F}$ is an isomorphism, it suffices to show that \begin{align*} \pi_Y^{-1}f_{small, *}\mathcal{F} & = \epsilon_{Y, *}a_Y^{-1}f_{small, *}\mathcal{F} \\ & \to  \epsilon_{Y, *}f_{big, ph, *}a_X^{-1}\mathcal{F} \\ & = f_{big, \etale, *} \epsilon_{X, *}a_X^{-1}\mathcal{F} \\ & = f_{big, \etale, *}\pi_X^{-1}\mathcal{F} \end{align*} is an isomorphism. This is part (1) of Lemma \ref{lemma-compare-higher-direct-image-proper}. \medskip\noindent To see (2) we use that \begin{align*} R\epsilon_{Y, *}Rf_{big, ph, *}a_X^{-1}K & = Rf_{big, \etale, *}R\epsilon_{X, *}a_X^{-1}K \\ & = Rf_{big, \etale, *}\pi_X^{-1}K \\ & = \pi_Y^{-1}Rf_{small, *}K \\ & = R\epsilon_{Y, *} a_Y^{-1}Rf_{small, *}K \end{align*} The first equality by the commutative diagram in Lemma \ref{lemma-push-pull-ph-etale} and Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-derived-pushforward-composition}. Then second equality is Lemma \ref{lemma-cohomological-descent-etale-ph}. The third is Lemma \ref{lemma-compare-higher-direct-image-proper} part (2). The fourth is Lemma \ref{lemma-cohomological-descent-etale-ph} again. Thus the base change map $a_Y^{-1}(Rf_{small, *}K) \to Rf_{big, ph, *}(a_X^{-1}K)$ induces an isomorphism $$ R\epsilon_{Y, *}a_Y^{-1}Rf_{small, *}K \to R\epsilon_{Y, *}Rf_{big, ph, *}a_X^{-1}K $$ The proof is finished by the following remark: consider a map $\alpha : a_Y^{-1}L \to M$ with $L$ in $D^+(Y_\etale)$ having torsion cohomology sheaves and $M$ in $D^+((\textit{Spaces}/Y)_{ph})$. If $R\epsilon_{Y, *}\alpha$ is an isomorphism, then $\alpha$ is an isomorphism. Namely, we show by induction on $i$ that $H^i(\alpha)$ is an isomorphism. This is true for all sufficiently small $i$. If it holds for $i \leq i_0$, then we see that $R^j\epsilon_{Y, *}H^i(M) = 0$ for $j > 0$ and $i \leq i_0$ by Lemma \ref{lemma-comparison-ph-etale} because $H^i(M) = a_Y^{-1}H^i(L)$ in this range. Hence $\epsilon_{Y, *}H^{i_0 + 1}(M) = H^{i_0 + 1}(R\epsilon_{Y, *}M)$ by a spectral sequence argument. Thus $\epsilon_{Y, *}H^{i_0 + 1}(M) = \pi_Y^{-1}H^{i_0 + 1}(L) = \epsilon_{Y, *}a_Y^{-1}H^{i_0 + 1}(L)$. This implies $H^{i_0 + 1}(\alpha)$ is an isomorphism (because $\epsilon_{Y, *}$ reflects isomorphisms as it is the identity on underlying presheaves) as desired.
This follows from Lemma \ref{lemma-ML-cohomology-powers-ideal} as follows. Set $M = H^p(X, \mathcal{F})$, $M_n = H^p(X, \mathcal{F}/I^n\mathcal{F})$, and denote $N_n = \Im(M \to M_n)$. By Lemma \ref{lemma-ML-cohomology-powers-ideal} parts (2) and (3) we see that $(M_n)$ is a Mittag-Leffler system with $N_n \subset M_n$ equal to the image of $M_k$ for all $k \gg n$. It follows that $\lim M_n = \lim N_n$ as topological modules (with limit topologies). On the other hand, the $N_n$ form an inverse system of quotients of the module $M$ and hence $\lim N_n$ is the completion of $M$ with respect to the topology given by the kernels $K_n = \Ker(M \to N_n)$. By Lemma \ref{lemma-ML-cohomology-powers-ideal} part (1) we have $K_n \subset I^{n - c}M$ and since $N_n \subset M_n$ is annihilated by $I^n$ we have $I^n M \subset K_n$. Thus the topology defined using the submodules $K_n$ as a fundamental system of open neighbourhoods of $0$ is the same as the $I$-adic topology and we find that the induced map $M^\wedge = \lim M/I^nM \to \lim N_n = \lim M_n$ is an isomorphism of topological modules\footnote{ To be sure, the limit topology on $M^\wedge$ is the same as its $I$-adic topology as follows from Algebra, Lemma \ref{algebra-lemma-hathat-finitely-generated}. See More on Algebra, Section \ref{more-algebra-section-topological-ring}.}.
Write $U = \Spec(A)$ for some ring $A$. In other words, $f_1, \ldots, f_n$ are elements of $A$ which generate the unit ideal of $A$. Write $\mathcal{F}|_U = \widetilde{M}$ for some $A$-module $M$. Clearly the {\v C}ech complex $\check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F})$ is identified with the complex $$ \prod\nolimits_{i_0} M_{f_{i_0}} \to \prod\nolimits_{i_0i_1} M_{f_{i_0}f_{i_1}} \to \prod\nolimits_{i_0i_1i_2} M_{f_{i_0}f_{i_1}f_{i_2}} \to \ldots $$ We are asked to show that the extended complex \begin{equation} \label{equation-extended} 0 \to M \to \prod\nolimits_{i_0} M_{f_{i_0}} \to \prod\nolimits_{i_0i_1} M_{f_{i_0}f_{i_1}} \to \prod\nolimits_{i_0i_1i_2} M_{f_{i_0}f_{i_1}f_{i_2}} \to \ldots \end{equation} (whose truncation we have studied in Algebra, Lemma \ref{algebra-lemma-cover-module}) is exact. It suffices to show that (\ref{equation-extended}) is exact after localizing at a prime $\mathfrak p$, see Algebra, Lemma \ref{algebra-lemma-characterize-zero-local}. In fact we will show that the extended complex localized at $\mathfrak p$ is homotopic to zero. \medskip\noindent There exists an index $i$ such that $f_i \not \in \mathfrak p$. Choose and fix such an element $i_{\text{fix}}$. Note that $M_{f_{i_{\text{fix}}}, \mathfrak p} = M_{\mathfrak p}$. Similarly for a localization at a product $f_{i_0} \ldots f_{i_p}$ and $\mathfrak p$ we can drop any $f_{i_j}$ for which $i_j = i_{\text{fix}}$. Let us define a homotopy $$ h : \prod\nolimits_{i_0 \ldots i_{p + 1}} M_{f_{i_0} \ldots f_{i_{p + 1}}, \mathfrak p} \longrightarrow \prod\nolimits_{i_0 \ldots i_p} M_{f_{i_0} \ldots f_{i_p}, \mathfrak p} $$ by the rule $$ h(s)_{i_0 \ldots i_p} = s_{i_{\text{fix}} i_0 \ldots i_p} $$ (This is ``dual'' to the homotopy in the proof of Cohomology, Lemma \ref{cohomology-lemma-homology-complex}.) In other words, $h : \prod_{i_0} M_{f_{i_0}, \mathfrak p} \to M_\mathfrak p$ is projection onto the factor $M_{f_{i_{\text{fix}}}, \mathfrak p} = M_{\mathfrak p}$ and in general the map $h$ equal projection onto the factors $M_{f_{i_{\text{fix}}} f_{i_1} \ldots f_{i_{p + 1}}, \mathfrak p} = M_{f_{i_1} \ldots f_{i_{p + 1}}, \mathfrak p}$. We compute \begin{align*} (dh + hd)(s)_{i_0 \ldots i_p} & = \sum\nolimits_{j = 0}^p (-1)^j h(s)_{i_0 \ldots \hat i_j \ldots i_p} + d(s)_{i_{\text{fix}} i_0 \ldots i_p}\\ & = \sum\nolimits_{j = 0}^p (-1)^j s_{i_{\text{fix}} i_0 \ldots \hat i_j \ldots i_p} + s_{i_0 \ldots i_p} + \sum\nolimits_{j = 0}^p (-1)^{j + 1} s_{i_{\text{fix}} i_0 \ldots \hat i_j \ldots i_p} \\ & = s_{i_0 \ldots i_p} \end{align*} This proves the identity map is homotopic to zero as desired.
We are going to apply Cohomology, Lemma \ref{cohomology-lemma-cech-vanish-basis}. As our basis $\mathcal{B}$ for the topology of $X$ we are going to use the affine opens of $X$. As our set $\text{Cov}$ of open coverings we are going to use the standard open coverings of affine opens of $X$. Next we check that conditions (1), (2) and (3) of Cohomology, Lemma \ref{cohomology-lemma-cech-vanish-basis} hold. Note that the intersection of standard opens in an affine is another standard open. Hence property (1) holds. The coverings form a cofinal system of open coverings of any element of $\mathcal{B}$, see Schemes, Lemma \ref{schemes-lemma-standard-open}. Hence (2) holds. Finally, condition (3) of the lemma follows from Lemma \ref{lemma-cech-cohomology-quasi-coherent-trivial}.
According to Cohomology, Lemma \ref{cohomology-lemma-describe-higher-direct-images} the sheaf $R^if_*\mathcal{F}$ is the sheaf associated to the presheaf $V \mapsto H^i(f^{-1}(V), \mathcal{F}|_{f^{-1}(V)})$. By assumption, whenever $V$ is affine we have that $f^{-1}(V)$ is affine, see Morphisms, Definition \ref{morphisms-definition-affine}. By Lemma \ref{lemma-quasi-coherent-affine-cohomology-zero} we conclude that $H^i(f^{-1}(V), \mathcal{F}|_{f^{-1}(V)}) = 0$ whenever $V$ is affine. Since $S$ has a basis consisting of affine opens we win.
Assume $X$ has affine diagonal. Let $U, V \subset X$ be affine opens. Then $U \cap V = \Delta^{-1}(U \times V)$ is affine. Thus (2) holds. It is immediate that (2) implies (3). Conversely, if there is a covering of $X$ as in (3), then $X \times X = \bigcup U_i \times U_{i'}$ is an affine open covering, and we see that $\Delta^{-1}(U_i \times U_{i'}) = U_i \cap U_{i'}$ is affine. Then $\Delta$ is an affine morphism by Morphisms, Lemma \ref{morphisms-lemma-characterize-affine}. The final assertion follows from Schemes, Lemma \ref{schemes-lemma-characterize-separated}.
By Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type} every quasi-coherent sheaf of ideals is a directed colimit of quasi-coherent sheaves of ideals of finite type. By Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit} taking cohomology on $X$ commutes with directed colimits. Hence we see that $H^1(X, \mathcal{I}) = 0$ for every quasi-coherent sheaf of ideals on $X$. In other words we see that Lemma \ref{lemma-quasi-compact-h1-zero-covering} applies.
This is proved in exactly the same way as Lemma \ref{lemma-quasi-compact-h1-zero-covering}. Let $x \in X$ be a closed point. Let $U \subset X$ be an affine open neighbourhood of $x$ such that $\mathcal{L}|_U \cong \mathcal{O}_U$. Write $U = \Spec(A)$ and let $\mathfrak m \subset A$ be the maximal ideal corresponding to $x$. Set $Z = X \setminus U$ and $Z' = Z \cup \{x\}$. By Schemes, Lemma \ref{schemes-lemma-reduced-closed-subscheme} there are quasi-coherent sheaves of ideals $\mathcal{I}$, resp.\ $\mathcal{I}'$ cutting out the reduced closed subschemes $Z$, resp.\ $Z'$. Consider the short exact sequence $$ 0 \to \mathcal{I}' \to \mathcal{I} \to \mathcal{I}/\mathcal{I}' \to 0. $$ For every $n \geq 1$ we obtain a short exact sequence $$ 0 \to \mathcal{I}' \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n} \to \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n} \to \mathcal{I}/\mathcal{I}' \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n} \to 0. $$ By our assumption we may pick $n$ such that $H^1(X, \mathcal{I}' \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n}) = 0$. Since $x$ is a closed point of $X$ and $x \not \in Z$ we see that $\mathcal{I}/\mathcal{I}'$ is supported at $x$. In fact, the restriction of $\mathcal{I}/\mathcal{I'}$ to $U$ corresponds to the $A$-module $A/\mathfrak m$. Since $\mathcal{L}$ is trivial on $U$ we see that the restriction of $\mathcal{I}/\mathcal{I}' \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n}$ to $U$ also corresponds to the $A$-module $A/\mathfrak m$. Hence we see that $\Gamma(X, \mathcal{I}/\mathcal{I'} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n}) = A/\mathfrak m$. By our choice of $n$ we see there exists a global section $s \in \Gamma(X, \mathcal{I} \otimes_{\mathcal{O}_X} \mathcal{L}^{\otimes n})$ which maps to the element $1 \in A/\mathfrak m$. Clearly we have $x \in X_s \subset U$ because $s$ vanishes at points of $Z$. This implies that $X_s = D(f)$ where $f \in A$ is the image of $s$ in $A \cong \Gamma(U, \mathcal{L}^{\otimes n})$. In particular $X_s$ is affine. \medskip\noindent Consider the union $W = \bigcup X_s$ over all $s \in \Gamma(X, \mathcal{L}^{\otimes n})$ for $n \geq 1$ such that $X_s$ is affine. Obviously $W$ is open in $X$. By the arguments above every closed point of $X$ is contained in $W$. The closed subset $X \setminus W$ of $X$ is also quasi-compact (see Topology, Lemma \ref{topology-lemma-closed-in-quasi-compact}). Hence it has a closed point if it is nonempty (see Topology, Lemma \ref{topology-lemma-quasi-compact-closed-point}). This would contradict the fact that all closed points are in $W$. Hence we conclude $X = W$. This means that $\mathcal{L}$ is ample by Properties, Definition \ref{properties-definition-ample}.
Let $V \subset Y$ be an affine open subscheme. We have to show that $U = f^{-1}(V)$ is affine. The inclusion morphism $V \to Y$ is quasi-compact by Schemes, Lemma \ref{schemes-lemma-quasi-compact-permanence}. Hence the base change $U \to X$ is quasi-compact, see Schemes, Lemma \ref{schemes-lemma-quasi-compact-preserved-base-change}. Thus any quasi-coherent sheaf of ideals $\mathcal{I}$ on $U$ extends to a quasi-coherent sheaf of ideals on $X$, see Properties, Lemma \ref{properties-lemma-extend-trivial}. Since the formation of $R^1f_*$ is local on $Y$ (Cohomology, Section \ref{cohomology-section-locality}) we conclude that $R^1(U \to V)_*\mathcal{I} = 0$ by the assumption in the lemma. Hence by the Leray Spectral sequence (Cohomology, Lemma \ref{cohomology-lemma-Leray}) we conclude that $H^1(U, \mathcal{I}) = H^1(V, (U \to V)_*\mathcal{I})$. Since $(U \to V)_*\mathcal{I}$ is quasi-coherent by Schemes, Lemma \ref{schemes-lemma-push-forward-quasi-coherent}, we have $H^1(V, (U \to V)_*\mathcal{I}) = 0$ by Lemma \ref{lemma-quasi-coherent-affine-cohomology-zero}. Thus we find that $U$ is affine by Lemma \ref{lemma-quasi-compact-h1-zero-covering}.
First we argue by induction that $P$ holds for {\it separated} quasi-compact opens $W \subset X$. Namely, such an open can be written as $W = U_1 \cup \ldots \cup U_n$ and we can do induction on $n$ using property (2) with $U = U_1 \cup \ldots \cup U_{n - 1}$ and $V = U_n$. This is allowed because $U \cap V = (U_1 \cap U_n) \cup \ldots \cup (U_{n - 1} \cap U_n)$ is also a union of $n - 1$ affine open subschemes by Schemes, Lemma \ref{schemes-lemma-characterize-separated} applied to the affine opens $U_i$ and $U_n$ of $W$. Having said this, for any quasi-compact open $W \subset X$ we can do induction on the number of affine opens needed to cover $W$ using the same trick as before and using that the quasi-compact open $U_i \cap U_n$ is separated as an open subscheme of the affine scheme $U_n$.
First proof. By induction on $t$. If $t = 1$ the result follows from Lemma \ref{lemma-quasi-coherent-affine-cohomology-zero}. If $t > 1$ write $X = U \cup V$ with $V$ affine open and $U = U_1 \cup \ldots \cup U_{t - 1}$ a union of $t - 1$ open affines. Note that in this case $U \cap V =  (U_1 \cap V) \cup \ldots (U_{t - 1} \cap V)$ is also a union of $t - 1$ affine open subschemes. Namely, since the diagonal is affine, the intersection of two affine opens is affine, see Lemma \ref{lemma-affine-diagonal}. We apply the Mayer-Vietoris long exact sequence $$ 0 \to H^0(X, \mathcal{F}) \to H^0(U, \mathcal{F}) \oplus H^0(V, \mathcal{F}) \to H^0(U \cap V, \mathcal{F}) \to H^1(X, \mathcal{F}) \to \ldots $$ see Cohomology, Lemma \ref{cohomology-lemma-mayer-vietoris}. By induction we see that the groups $H^i(U, \mathcal{F})$, $H^i(V, \mathcal{F})$, $H^i(U \cap V, \mathcal{F})$ are zero for $i \geq t - 1$. It follows immediately that $H^i(X, \mathcal{F})$ is zero for $i \geq t$. \medskip\noindent Second proof. Let $\mathcal{U} : X = \bigcup_{i = 1}^t U_i$ be a finite affine open covering. Since $X$ is has affine diagonal the multiple intersections $U_{i_0 \ldots i_p}$ are all affine, see Lemma \ref{lemma-affine-diagonal}. By Lemma \ref{lemma-cech-cohomology-quasi-coherent} the {\v C}ech cohomology groups $\check{H}^p(\mathcal{U}, \mathcal{F})$ agree with the cohomology groups. By Cohomology, Lemma \ref{cohomology-lemma-alternating-usual} the {\v C}ech cohomology groups may be computed using the alternating {\v C}ech complex $\check{\mathcal{C}}_{alt}^\bullet(\mathcal{U}, \mathcal{F})$. As the covering consists of $t$ elements we see immediately that $\check{\mathcal{C}}_{alt}^p(\mathcal{U}, \mathcal{F}) = 0$ for all $p \geq t$. Hence the result follows.
Let $X = \bigcup U_i$ be a finite affine open covering. Set $U = \coprod U_i$ and denote $j : U \to X$ the morphism inducing the given open immersions $U_i \to X$. Since $U$ is an affine scheme and $X$ has affine diagonal, the morphism $j$ is affine, see Morphisms, Lemma \ref{morphisms-lemma-affine-permanence}. For every $\mathcal{O}_X$-module $\mathcal{F}$ there is a canonical map $\mathcal{F} \to j_*j^*\mathcal{F}$. This map is injective as can be seen by checking on stalks: if $x \in U_i$, then we have a factorization $$ \mathcal{F}_x \to (j_*j^*\mathcal{F})_x \to (j^*\mathcal{F})_{x'} = \mathcal{F}_x $$ where $x' \in U$ is the point $x$ viewed as a point of $U_i \subset U$. Now if $\mathcal{F}$ is quasi-coherent, then $j^*\mathcal{F}$ is quasi-coherent on the affine scheme $U$ hence has vanishing higher cohomology by Lemma \ref{lemma-quasi-coherent-affine-cohomology-zero}. Then $H^p(X, j_*j^*\mathcal{F}) = 0$ for $p > 0$ by Lemma \ref{lemma-relative-affine-cohomology} as $j$ is affine. This proves (1). Finally, we see that the map $H^p(X, \mathcal{F}) \to H^p(X, j_*j^*\mathcal{F})$ is zero and part (2) follows from Homology, Lemma \ref{homology-lemma-efface-implies-universal}.
Note that since $X$ is quasi-separated the numbers $t(\bigcap_{i \in I} U_i)$ are finite. Let $\mathcal{U} : X = \bigcup_{i = 1}^t U_i$. By Cohomology, Lemma \ref{cohomology-lemma-cech-spectral-sequence} there is a spectral sequence $$ E_2^{p, q} = \check{H}^p(\mathcal{U}, \underline{H}^q(\mathcal{F})) $$ converging to $H^{p + q}(U, \mathcal{F})$. By Cohomology, Lemma \ref{cohomology-lemma-alternating-usual} we have $$ E_2^{p, q} = H^p(\check{\mathcal{C}}_{alt}^\bullet( \mathcal{U}, \underline{H}^q(\mathcal{F})) $$ The alternating {\v C}ech complex with values in the presheaf $\underline{H}^q(\mathcal{F})$ vanishes in high degrees by Lemma \ref{lemma-vanishing-nr-affines}, more precisely $E_2^{p, q} = 0$ for $p + q \geq d$. Hence the result follows.
Consider the Leray spectral sequence $E_2^{p, q} = H^p(S, R^qf_*\mathcal{F})$ converging to $H^{p + q}(X, \mathcal{F})$, see Cohomology, Lemma \ref{cohomology-lemma-Leray}. By Lemma \ref{lemma-quasi-coherence-higher-direct-images} we see that the sheaves $R^qf_*\mathcal{F}$ are quasi-coherent. By Lemma \ref{lemma-quasi-coherent-affine-cohomology-zero} we see that $E_2^{p, q} = 0$ when $p > 0$. Hence the spectral sequence degenerates at $E_2$ and we win. See also Cohomology, Lemma \ref{cohomology-lemma-apply-Leray} (2) for the general principle.
The vanishing of higher direct images is Lemma \ref{lemma-relative-affine-vanishing}. The statement is local on $S$ and $S'$. Hence we may assume $X = \Spec(A)$, $S = \Spec(R)$, $S' = \Spec(R')$ and $\mathcal{F} = \widetilde{M}$ for some $A$-module $M$. We use Schemes, Lemma \ref{schemes-lemma-widetilde-pullback} to describe pullbacks and pushforwards of $\mathcal{F}$. Namely, $X' = \Spec(R' \otimes_R A)$ and $\mathcal{F}'$ is the quasi-coherent sheaf associated to $(R' \otimes_R A) \otimes_A M$. Thus we see that the lemma boils down to the equality $$ (R' \otimes_R A) \otimes_A M = R' \otimes_R M $$ as $R'$-modules.
In case $X$ is separated, choose an affine open covering $\mathcal{U} : X = \bigcup_{i \in I} U_i$ and recall that $$ \check{H}^p(\mathcal{U}, \mathcal{F}) = H^p(X, \mathcal{F}), $$ see Lemma \ref{lemma-cech-cohomology-quasi-coherent}. Let $\mathcal{V} : Y = \bigcup_{i \in I} g^{-1}(U_i)$ be the corresponding affine open covering of $Y$. The opens $V_i = g^{-1}(U_i) = U_i \times_{\Spec(A)} \Spec(B)$ are affine and $Y$ is separated. Thus we obtain $$ \check{H}^p(\mathcal{V}, \mathcal{G}) = H^p(Y, \mathcal{G}). $$ We claim the map of {\v C}ech complexes $$ \check{\mathcal{C}}^\bullet(\mathcal{U}, \mathcal{F}) \otimes_A B \longrightarrow \check{\mathcal{C}}^\bullet(\mathcal{V}, \mathcal{G}) $$ is an isomorphism. Namely, as $B$ is finitely presented as an $A$-module we see that tensoring with $B$ over $A$ commutes with products, see Algebra, Proposition \ref{algebra-proposition-fp-tensor}. Thus it suffices to show that the maps $\Gamma(U_{i_0 \ldots i_p}, \mathcal{F}) \otimes_A B \to \Gamma(V_{i_0 \ldots i_p}, \mathcal{G})$  are isomorphisms which follows from Lemma \ref{lemma-affine-base-change}. Since $A \to B$ is flat, the same thing remains true on taking cohomology. \medskip\noindent In the general case we argue in exactly the same way using affine open covering $\mathcal{U} : X = \bigcup_{i \in I} U_i$ and the corresponding covering $\mathcal{V} : Y = \bigcup_{i \in I} V_i$ with $V_i = g^{-1}(U_i)$ as above. We will use the {\v C}ech-to-cohomology spectral sequence Cohomology, Lemma \ref{cohomology-lemma-cech-spectral-sequence}. The spectral sequence has $E_2$-page $E_2^{p, q} = \check{H}^p(\mathcal{U}, \underline{H}^q(\mathcal{F}))$ and converges to $H^{p + q}(X, \mathcal{F})$. Similarly, we have a spectral sequence with $E_2$-page $E_2^{p, q} = \check{H}^p(\mathcal{V}, \underline{H}^q(\mathcal{G}))$ which converges to $H^{p + q}(Y, \mathcal{G})$. Since the intersections $U_{i_0 \ldots i_p}$ are separated, the result of the previous paragraph gives isomorphisms $\Gamma(U_{i_0 \ldots i_p}, \underline{H}^q(\mathcal{F})) \otimes_A B \to \Gamma(V_{i_0 \ldots i_p}, \underline{H}^q(\mathcal{G}))$. Using that $- \otimes_A B$ commutes with products and is exact, we conclude that $\check{H}^p(\mathcal{U}, \underline{H}^q(\mathcal{F})) \otimes_A B \to \check{H}^p(\mathcal{V}, \underline{H}^q(\mathcal{G}))$ is an isomorphism. Using that $A \to B$ is flat we conclude that $H^i(X, \mathcal{F}) \otimes_A B \to H^i(Y, \mathcal{G})$ is an isomorphism for all $i$ and we win.
Recall that $R^pf_*\mathcal{F}$ is the sheaf associated to $U \mapsto H^p(f^{-1}U, \mathcal{F})$, see Cohomology, Lemma \ref{cohomology-lemma-describe-higher-direct-images}. Recall that the colimit is the sheaf associated to the presheaf colimit (taking colimits over opens). Hence we can apply Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit} to $H^p(f^{-1}U, -)$ where $U$ is affine to conclude. (Because the basis of affine opens in $f^{-1}U$ satisfies the assumptions of that lemma.)
Consider the resolution $\mathcal{F} \to {\mathfrak C}^\bullet(\mathcal{U}, \mathcal{F})$ of Cohomology, Lemma \ref{cohomology-lemma-covering-resolution}. We have an equality of complexes $\check{\mathcal{C}}^\bullet(\mathcal{U}, f, \mathcal{F}) = f_*{\mathfrak C}^\bullet(\mathcal{U}, \mathcal{F})$ of quasi-coherent $\mathcal{O}_S$-modules. The morphisms $j_{i_0 \ldots i_p} : U_{i_0 \ldots i_p} \to X$ and the morphisms $f_{i_0 \ldots i_p} : U_{i_0 \ldots i_p} \to S$ are affine by Morphisms, Lemma \ref{morphisms-lemma-affine-permanence} and Lemma \ref{lemma-affine-diagonal}. Hence $R^qj_{i_0 \ldots i_p *}\mathcal{F}_{i_0 \ldots i_p}$ as well as $R^qf_{i_0 \ldots i_p *}\mathcal{F}_{i_0 \ldots i_p}$ are zero for $q > 0$ (Lemma \ref{lemma-relative-affine-vanishing}). Using $f \circ j_{i_0 \ldots i_p} = f_{i_0 \ldots i_p}$ and the spectral sequence of Cohomology, Lemma \ref{cohomology-lemma-relative-Leray} we conclude that $R^qf_*(j_{i_0 \ldots i_p *}\mathcal{F}_{i_0 \ldots i_p}) = 0$ for $q > 0$. Since the terms of the complex ${\mathfrak C}^\bullet(\mathcal{U}, \mathcal{F})$ are finite direct sums of the sheaves $j_{i_0 \ldots i_p *}\mathcal{F}_{i_0 \ldots i_p}$ we conclude using Leray's acyclicity lemma (Derived Categories, Lemma \ref{derived-lemma-leray-acyclicity}) that $$ Rf_* \mathcal{F} = f_*{\mathfrak C}^\bullet(\mathcal{U}, \mathcal{F}) = \check{\mathcal{C}}^\bullet(\mathcal{U}, f, \mathcal{F}) $$ as desired.
In fact we may define $U_i' = (g')^{-1}(U_i) = U_{i, S'}$ no matter whether $S'$ is affine over $S$ or not. Let $\mathcal{U}' : X' = \bigcup U_i'$ be the induced covering of $X'$. In this case we claim that $$ g^*\check{\mathcal{C}}^\bullet(\mathcal{U}, f, \mathcal{F}) = \check{\mathcal{C}}^\bullet(\mathcal{U}', f', \mathcal{F}') $$ with $\check{\mathcal{C}}^\bullet(\mathcal{U}', f', \mathcal{F}')$ defined in exactly the same manner as in Lemma \ref{lemma-separated-case-relative-cech}. This is clear from the case of affine morphisms (Lemma \ref{lemma-affine-base-change}) by working locally on $S'$. Moreover, exactly as in the proof of Lemma \ref{lemma-separated-case-relative-cech} one sees that there is an isomorphism $$ \check{\mathcal{C}}^\bullet(\mathcal{U}', f', \mathcal{F}') \longrightarrow Rf'_*\mathcal{F}' $$ in $D^{+}(S')$ since the morphisms $U_i' \to X'$ and $U_i' \to S'$ are still affine (being base changes of affine morphisms). Details omitted.