hcju/stacksqa huggingface dataset:
As a topological space we set $Y \amalg_Z X$ equal to the pushout of the diagram in the category of topological spaces (Topology, Section \ref{topology-section-colimits}). This is just the pushout of the underlying sets (Topology, Lemma \ref{topology-lemma-colimits}) endowed with the quotient topology. On $Y \amalg_Z X$ we have the maps of sheaves of rings $$ b_*\mathcal{O}_Y \longrightarrow c_*\mathcal{O}_Z \longleftarrow a_*\mathcal{O}_X $$ and we can define $$ \mathcal{O}_{Y \amalg_Z X} = b_*\mathcal{O}_Y \times_{c_*\mathcal{O}_Z} a_*\mathcal{O}_X $$ as the fibre product in the category of sheaves of rings. To prove that we obtain a scheme we have to show that every point has an affine open neighbourhood. This is clear for points not in the image of $c$ as the image of $c$ is a closed subset whose complement is isomorphic as a ringed space to $(Y \setminus j(Z)) \amalg (X \setminus i(Z))$. \medskip\noindent A point in the image of $c$ corresponds to a unique $y \in Y$ in the image of $j$. By Lemma \ref{lemma-prepare-pushout-along-closed-immersion-and-integral} we find affine opens $U \subset X$ and $V \subset Y$ with $y \in V$ and $i^{-1}(U) = j^{-1}(V)$. Since the construction of the first paragraph is clearly compatible with restriction to compatible open subschemes, to prove that it produces a scheme we may assume $X$, $Y$, and $Z$ are affine. \medskip\noindent If $X = \Spec(A)$, $Y = \Spec(B)$, and $Z = \Spec(C)$ are affine, then More on Algebra, Lemma \ref{more-algebra-lemma-points-of-fibre-product} shows that $Y \amalg_Z X = \Spec(B \times_C A)$ as topological spaces. To finish the proof that $Y \times_Z X$ is a scheme, it suffices to show that on $\Spec(B \times_C A)$ the structure sheaf is the fibre product of the pushforwards. This follows by applying More on Algebra, Lemma \ref{more-algebra-lemma-diagram-localize} to principal affine opens of $\Spec(B \times_C A)$. \medskip\noindent The discussion above shows the scheme $Y \amalg_X Z$ has an affine open covering $Y \amalg_X Z = \bigcup W_i$ such that $U_i = a^{-1}(W_i)$, $V_i = b^{-1}(W_i)$, and $\Omega_i = c^{-1}(W_i)$ are affine open in $X$, $Y$, and $Z$. Thus $a$ and $b$ are affine. Moreover, if $A_i$, $B_i$, $C_i$ are the rings corresponding to $U_i$, $V_i$, $\Omega_i$, then $A_i \to C_i$ is surjective and $W_i$ corresponds to $A_i \times_{C_i} B_i$ which surjects onto $B_i$. Hence $b$ is a closed immersion. The ring map $A_i \times_{C_i} B_i \to A_i$ is integral by More on Algebra, Lemma \ref{more-algebra-lemma-fibre-product-integral} hence $a$ is integral. The diagram is cartesian because $$ C_i \cong B_i \otimes_{B_i \times_{C_i} A_i} A_i $$ This follows as $B_i \times_{C_i} A_i \to B_i$ and $A_i \to C_i$ are surjective maps whose kernels are the same. \medskip\noindent Finally, we can apply Lemmas \ref{lemma-basic-example-pushout} and \ref{lemma-pushout-fpqc-local} to conclude our construction is a pushout in the category of schemes.
We will prove this by induction on the affine stratification number $n$. If $n = 0$, then $X$ is affine and the result is Cohomology of Schemes, Lemma \ref{coherent-lemma-quasi-coherent-affine-cohomology-zero}. Assume $n > 0$. By Definition \ref{definition-affine-stratification-number} there is an affine scheme $U$ and an affine open immersion $j : U \to X$ such that the complement $Z$ has affine stratification number $n - 1$. As $U$ and $j$ are affine we have $H^p(X, j_*(\mathcal{F}|_U)) = 0$ for $p > 0$, see Cohomology of Schemes, Lemmas \ref{coherent-lemma-relative-affine-cohomology} and \ref{coherent-lemma-relative-affine-vanishing}. Denote $\mathcal{K}$ and $\mathcal{Q}$ the kernel and cokernel of the map $\mathcal{F} \to j_*(\mathcal{F}|_U)$. Thus we obtain an exact sequence $$ 0 \to \mathcal{K} \to \mathcal{F} \to j_*(\mathcal{F}|_U) \to \mathcal{Q} \to 0 $$ of quasi-coherent $\mathcal{O}_X$-modules (see Schemes, Section \ref{schemes-section-quasi-coherent}). A standard argument, breaking our exact sequence into short exact sequences and using the long exact cohomology sequence, shows it suffices to prove $H^p(X, \mathcal{K}) = 0$ and $H^p(X, \mathcal{Q}) = 0$ for $p \geq n$. Since $\mathcal{F} \to j_*(\mathcal{F}|_U)$ restricts to an isomorphism over $U$, we see that $\mathcal{K}$ and $\mathcal{Q}$ are supported on $Z$. By Properties, Lemma \ref{properties-lemma-quasi-coherent-colimit-finite-type} we can write these modules as the filtered colimits of their finite type quasi-coherent submodules. Using the fact that cohomology of sheaves on $X$ commutes with filtered colimits, see Cohomology, Lemma \ref{cohomology-lemma-quasi-separated-cohomology-colimit}, we conclude it suffices to show that if $\mathcal{G}$ is a finite type quasi-coherent module whose support is contained in $Z$, then $H^p(X, \mathcal{G}) = 0$ for $p \geq n$. Let $Z' \subset X$ be the scheme theoretic support of $\mathcal{G} \oplus \mathcal{O}_Z$; we may and do think of $\mathcal{G}$ as a quasi-coherent module on $Z'$, see Morphisms, Section \ref{morphisms-section-support}. Then $Z'$ and $Z$ have the same underlying topological space and hence the same affine stratification number, namely $n - 1$. Hence $H^p(X, \mathcal{G}) = H^p(Z', \mathcal{G})$ (equality by Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}) vanishes for $p \geq n$ by induction hypothesis.
Note that since $Y$ is separated, the morphism $X \to Y$ is affine (Morphisms, Lemma \ref{morphisms-lemma-affine-permanence}). The function $\int_f w$ attains its maximum $d$ by Lemma \ref{lemma-max-int-w}. We will use induction on $d$. Consider the open subscheme $Y_d = \{y \in Y \mid (\int_f w)(y) = d\}$ of $Y$ and recall that $f^{-1}(Y_d) \to Y_d$ is finite, see Lemma \ref{lemma-max-int-finite}. By Lemma \ref{lemma-affineness-of-large-open} for every affine open $W \subset Y$ we have that $Y_d \cap W$ is affine (this uses that $W \times_Y X$ is affine, being affine over $X$). Hence $Y_d \to Y$ is an affine morphism of schemes. We conclude that $f^{-1}(Y_d) = Y_d \times_Y X$ is an affine scheme being affine over $X$. Then $f^{-1}(Y_d) \to Y_d$ is surjective and hence $Y_d$ is affine by Limits, Lemma \ref{limits-lemma-affine}. Set $X' = X \setminus f^{-1}(Y_d)$ and $Y' = Y \setminus Y_d$ viewed as closed subschemes of $X$ and $Y$. Since $X'$ is closed in $X$ it is affine. Since $Y'$ is closed in $Y$ it is separated. The morphism $f' : X' \to Y'$ is surjective and $w$ induces a weighting $w'$ of $f'$, see Lemma \ref{lemma-weighting-base-change}. By induction $Y'$ has an affine stratification of length $\leq$ the number of distinct values of $\int_{f'} w'$ and the proof is complete.
We claim that Homology, Lemma \ref{homology-lemma-adjoint-get-abelian} applies to the categories $\mathcal{A} = \textit{Ab}(\mathcal{C})$ and $\mathcal{B} = \textit{PAb}(\mathcal{C})$, and the functors $a : \mathcal{A} \to \mathcal{B}$ (inclusion),  and $b : \mathcal{B} \to \mathcal{A}$ (sheafification). Let us check the assumptions of Homology, Lemma \ref{homology-lemma-adjoint-get-abelian}. Assumption (1) is that $\mathcal{A}$, $\mathcal{B}$ are additive categories, $a$, $b$ are additive functors, and $a$ is right adjoint to $b$. The first two statements are clear and adjointness is Sites, Section \ref{sites-section-sheaves-algebraic-structures} ($\epsilon$). Assumption (2) says that $\textit{PAb}(\mathcal{C})$ is abelian which we saw in Section \ref{section-abelian-pre-sheaves} and that sheafification is left exact, which is Sites, Section \ref{sites-section-sheaves-algebraic-structures} ($\zeta$). The final assumption is that $ba \cong \text{id}_\mathcal{A}$ which is Sites, Section \ref{sites-section-sheaves-algebraic-structures} ($\delta$). Hence Homology, Lemma \ref{homology-lemma-adjoint-get-abelian} applies and we conclude that $\textit{Ab}(\mathcal{C})$ is abelian. \medskip\noindent In the proof of Homology, Lemma \ref{homology-lemma-adjoint-get-abelian} it is shown that $\Ker(\varphi)$ and $\Coker(\varphi)$ are equal to the sheafification of the kernel and cokernel of $\varphi$ as a morphism of abelian presheaves. This proves (4). Since the kernel is a equalizer (i.e., a limit) and since sheafification commutes with finite limits, we conclude that (2) holds. \medskip\noindent Statement (2) implies (3). Statement (4) implies (5) by our description of sheafification. The characterization of exactness in (6) follows from (2) and (5), and the fact that the sequence is exact if and only if $\Im(\mathcal{F} \to \mathcal{G}) = \Ker(\mathcal{G} \to \mathcal{H})$.
By Lemma \ref{lemma-limits-colimits-abelian-presheaves} limits and colimits of abelian presheaves exist, and are described by taking limits and colimits on the level of sections over objects. \medskip\noindent Let $\mathcal{I} \to \textit{Ab}(\mathcal{C})$, $i \mapsto \mathcal{F}_i$ be a diagram. Let $\lim_i \mathcal{F}_i$ be the limit of the diagram as an abelian presheaf. By Sites, Lemma \ref{sites-lemma-limit-sheaf} this is an abelian sheaf. Then it is quite easy to see that $\lim_i \mathcal{F}_i$ is the limit of the diagram in $\textit{Ab}(\mathcal{C})$. This proves limits exist and (2) holds. \medskip\noindent By Categories, Lemma \ref{categories-lemma-adjoint-exact}, and because sheafification is left adjoint to the inclusion functor we see that $\colim_i \mathcal{F}$ exists and is the sheafification of the colimit in $\textit{PAb}(\mathcal{C})$. This proves colimits exist and (4) holds. \medskip\noindent Finite direct sums are the same thing as finite products in any abelian category. Hence (3) follows from (2). \medskip\noindent Proof of (5). The statement means that given a system $0 \to \mathcal{F}_i \to \mathcal{G}_i \to \mathcal{H}_i \to 0$ of exact sequences of abelian sheaves over a directed set $I$ the sequence $0 \to \colim \mathcal{F}_i \to \colim \mathcal{G}_i \to \colim \mathcal{H}_i \to 0$ is exact as well. A formal argument using Homology, Lemma \ref{homology-lemma-check-exactness} and the definition of colimits shows that the sequence $\colim \mathcal{F}_i \to \colim \mathcal{G}_i \to \colim \mathcal{H}_i \to 0$ is exact. Note that $\colim \mathcal{F}_i \to \colim \mathcal{G}_i$ is the sheafification of the map of presheaf colimits which is injective as each of the maps $\mathcal{F}_i \to \mathcal{G}_i$ is injective. Since sheafification is exact we conclude.
This follows from Sites, Lemma \ref{sites-lemma-morphism-topoi-comes-from-morphism-sites}, and Sites, Remarks \ref{sites-remark-morphism-topoi-comes-from-morphism-sites} and \ref{sites-remark-equivalence-topoi-comes-from-morphism-sites}. You just have to carry along the sheaves of rings. Some details omitted.
This follows from Lemma \ref{lemma-adjointness-tensor-restrict-presheaves} and the fact that $\Hom_{\mathcal{O}_2}( \mathcal{O}_2 \otimes_{\mathcal{O}_1} \mathcal{G}, \mathcal{F} ) = \Hom_{\mathcal{O}_2}( \mathcal{O}_2 \otimes_{p, \mathcal{O}_1} \mathcal{G}, \mathcal{F} )$ because $\mathcal{F}$ is a sheaf.
First we note that we have $$ \Mor_{\textit{Ab}(\mathcal{C})}(f^{-1}\mathcal{G}, \mathcal{F}) = \Mor_{\textit{Ab}(\mathcal{D})}(\mathcal{G}, f_*\mathcal{F}). $$ by Sites, Proposition \ref{sites-proposition-functoriality-algebraic-structures-topoi}. Suppose that $\alpha : f^{-1}\mathcal{G} \to \mathcal{F}$ and $\beta : \mathcal{G} \to f_*\mathcal{F}$ are morphisms of abelian sheaves which correspond via the formula above. We have to show that $\alpha$ is $f^{-1}\mathcal{O}$-linear if and only if $\beta$ is $\mathcal{O}$-linear. For example, suppose $\alpha$ is $f^{-1}\mathcal{O}$-linear, then clearly $f_*\alpha$ is $f_*f^{-1}\mathcal{O}$-linear, and hence (as restriction is a functor) is $\mathcal{O}$-linear. Hence it suffices to prove that the adjunction map $\mathcal{G} \to f_*f^{-1}\mathcal{G}$ is $\mathcal{O}$-linear. Using that both $f_*$ and $f^{-1}$ commute with products (on sheaves of sets) this comes down to showing that $$ \xymatrix{ \mathcal{O} \times \mathcal{G} \ar[r] \ar[d] & f_*f^{-1}(\mathcal{O} \times \mathcal{G}) \ar[d] \\ \mathcal{G} \ar[r] & f_*f^{-1}\mathcal{G} } $$ is commutative. This holds because the adjunction mapping $\text{id}_{\Sh(\mathcal{D})} \to f_*f^{-1}$ is a transformation of functors. We omit the proof of the implication $\beta$ linear $\Rightarrow$ $\alpha$ linear.
Note that we have $$ \Mor_{\textit{Mod}(\mathcal{O})}( \mathcal{O} \otimes_{f^{-1}f_*\mathcal{O}} f^{-1}\mathcal{G}, \mathcal{F}) = \Mor_{\textit{Mod}(f^{-1}f_*\mathcal{O})}( f^{-1}\mathcal{G}, \mathcal{F}_{f^{-1}f_*\mathcal{O}}) $$ by Lemma \ref{lemma-adjointness-tensor-restrict}. Hence the result follows from Lemma \ref{lemma-adjoint-push-pull-modules}.
This follows from the work we did before: \begin{eqnarray*} \Hom_{\mathcal{O}_\mathcal{C}}(f^*\mathcal{G}, \mathcal{F}) & = & \Mor_{\textit{Mod}(\mathcal{O}_\mathcal{C})}( \mathcal{O}_\mathcal{C} \otimes_{f^{-1}\mathcal{O}_\mathcal{D}} f^{-1}\mathcal{G}, \mathcal{F}) \\ & = & \Mor_{\textit{Mod}(f^{-1}\mathcal{O}_\mathcal{D})}( f^{-1}\mathcal{G}, \mathcal{F}_{f^{-1}\mathcal{O}_\mathcal{D}}) \\ & = & \Hom_{\mathcal{O}_\mathcal{D}}(\mathcal{G}, f_*\mathcal{F}). \end{eqnarray*} Here we use Lemmas \ref{lemma-adjointness-tensor-restrict} and \ref{lemma-adjoint-push-pull-modules}.
Above we have seen that $\textit{Mod}(\mathcal{O})$ is an additive category, with kernels and cokernels and that $\textit{Mod}(\mathcal{O}) \to \textit{Ab}(\mathcal{C})$ preserves kernels and cokernels. By Homology, Definition \ref{homology-definition-abelian-category} we have to show that image and coimage agree. This is clear because it is true in $\textit{Ab}(\mathcal{C})$. The lemma follows.
The final statement follows from the first as filtered colimits are exact in $\textit{Ab}(\mathcal{C})$ by Lemma \ref{lemma-limits-colimits-abelian-sheaves}. Let $\mathcal{I} \to \textit{Mod}(\mathcal{C})$, $i \mapsto \mathcal{F}_i$ be a diagram. Let $\lim_i \mathcal{F}_i$ be the limit of the diagram in $\textit{Ab}(\mathcal{C})$. By the description of this limit in Lemma \ref{lemma-limits-colimits-abelian-sheaves} we see immediately that there exists a multiplication $$ \mathcal{O} \times \lim_i \mathcal{F}_i \longrightarrow \lim_i \mathcal{F}_i $$ which turns $\lim_i \mathcal{F}_i$ into a sheaf of $\mathcal{O}$-modules. It is easy to see that this is the limit of the diagram in $\textit{Mod}(\mathcal{C})$. Let $\colim_i \mathcal{F}_i$ be the colimit of the diagram in $\textit{PAb}(\mathcal{C})$. By the description of this colimit in the proof of Lemma \ref{lemma-limits-colimits-abelian-presheaves} we see immediately that there exists a multiplication $$ \mathcal{O} \times \colim_i \mathcal{F}_i \longrightarrow \colim_i \mathcal{F}_i $$ which turns $\colim_i \mathcal{F}_i$ into a presheaf of $\mathcal{O}$-modules. Applying sheafification we get a sheaf of $\mathcal{O}$-modules $(\colim_i \mathcal{F}_i)^\#$, see Lemma \ref{lemma-sheafification-presheaf-modules}. It is easy to see that $(\colim_i \mathcal{F}_i)^\#$ is the colimit of the diagram in $\textit{Mod}(\mathcal{O})$, and by Lemma \ref{lemma-limits-colimits-abelian-sheaves} forgetting the $\mathcal{O}$-module structure is the colimit in $\textit{Ab}(\mathcal{C})$.
Since $f_* : \textit{Ab}(\mathcal{C}) \to \textit{Ab}(\mathcal{D})$ is a right adjoint we already know that it transforms a short exact sequence $0 \to \mathcal{F}_1 \to \mathcal{F}_2 \to \mathcal{F}_3 \to 0$ of abelian sheaves on $\mathcal{C}$ into an exact sequence $$ 0 \to f_*\mathcal{F}_1 \to f_*\mathcal{F}_2 \to f_*\mathcal{F}_3 $$ see Categories, Sections \ref{categories-section-exact-functor} and \ref{categories-section-adjoint} and Homology, Section \ref{homology-section-functors}. Hence it suffices to prove that the map $f_*\mathcal{F}_2 \to f_*\mathcal{F}_3$ is surjective. If (1), (2) holds, then this is clear from the definitions. By Sites, Lemma \ref{sites-lemma-exactness-properties} we see that either (3) or (4) formally implies (1), hence in these cases we are done also.
The second formula follows formally from the first, since if $\mathcal{F}$ and $\mathcal{G}$ are abelian sheaves then \begin{align*} \Mor_{\textit{Ab}(\mathcal{C})}(\mathcal{F}, g^{-1}\mathcal{G}) & = \Mor_{\textit{PAb}(\mathcal{D})}(g_{p!}\mathcal{F}, \mathcal{G}) \\ & = \Mor_{\textit{Ab}(\mathcal{D})}(g_!\mathcal{F}, \mathcal{G}) \end{align*} by the universal property of sheafification. \medskip\noindent To prove the first formula, let $\mathcal{F}$, $\mathcal{G}$ be abelian presheaves. To prove the lemma we will construct maps from the group on the left to the group on the right and omit the verification that these are mutually inverse. \medskip\noindent Note that there is a canonical map of abelian presheaves $\mathcal{F} \to u^pg_{p!}\mathcal{F}$ which on sections over $U$ is the natural map $\mathcal{F}(U) \to \colim_{u(U) \to u(U')} \mathcal{F}(U')$, see Sites, Lemma \ref{sites-lemma-recover}. Given a map $\alpha : g_{p!}\mathcal{F} \to \mathcal{G}$ we get $u^p\alpha : u^pg_{p!}\mathcal{F} \to u^p\mathcal{G}$. which we can precompose by the map $\mathcal{F} \to u^pg_{p!}\mathcal{F}$. \medskip\noindent Note that there is a canonical map of abelian presheaves $g_{p!}u^p\mathcal{G} \to \mathcal{G}$ which on sections over $V$ is the natural map $\colim_{V \to u(U)} \mathcal{G}(u(U)) \to \mathcal{G}(V)$. It maps a section $s \in u(U)$ in the summand corresponding to $t : V \to u(U)$ to $t^*s \in \mathcal{G}(V)$. Hence, given a map $\beta : \mathcal{F} \to u^p\mathcal{G}$ we get a map $g_{p!}\beta : g_{p!}\mathcal{F} \to g_{p!}u^p\mathcal{G}$ which we can postcompose with the map $g_{p!}u^p\mathcal{G} \to \mathcal{G}$ above.
Compare with Sites, Lemma \ref{sites-lemma-preserve-equalizers}. Assume (a), (b), and (c). We already know that $g_!$ is right exact as it is a left adjoint, see Categories, Lemma \ref{categories-lemma-exact-adjoint} and Homology, Section \ref{homology-section-functors}. We have $g_! = (g_{p!}\ )^\#$. We have to show that $g_!$ transforms injective maps of abelian sheaves into injective maps of abelian presheaves. Recall that sheafification of abelian presheaves is exact, see Lemma \ref{lemma-limits-colimits-abelian-sheaves}. Thus it suffices to show that $g_{p!}$ transforms injective maps of abelian presheaves into injective maps of abelian presheaves. To do this it suffices that colimits over the categories $(\mathcal{I}_V^u)^{opp}$ of Sites, Section \ref{sites-section-functoriality-PSh} transform injective maps between diagrams into injections. This follows from Sites, Lemma \ref{sites-lemma-almost-directed} and Algebra, Lemma \ref{algebra-lemma-almost-directed-colimit-exact}.
The map $g^{-1}g_*\mathcal{F} \to \mathcal{F}$ is an isomorphism by Sites, Lemma \ref{sites-lemma-back-and-forth} and the fact that pullback and pushforward of abelian sheaves agrees with pullback and pushforward on the underlying sheaves of sets. \medskip\noindent Pick $U \in \Ob(\mathcal{C})$. We will show that $g^{-1}g_!\mathcal{F}(U) = \mathcal{F}(U)$. First, note that $g^{-1}g_!\mathcal{F}(U) = g_!\mathcal{F}(u(U))$. Hence it suffices to show that $g_!\mathcal{F}(u(U)) = \mathcal{F}(U)$. We know that $g_!\mathcal{F}$ is the (abelian) sheaf associated to the presheaf $g_{p!}\mathcal{F}$ which is defined by the rule $$ V \longmapsto \colim_{V \to u(U')} \mathcal{F}(U') $$ with colimit taken in $\textit{Ab}$. If $V = u(U)$, then, as $u$ is fully faithful this colimit is over $U \to U'$. Hence we conclude that $g_{p!}\mathcal{F}(u(U) = \mathcal{F}(U)$. Since $u$ is cocontinuous and continuous any covering of $u(U)$ in $\mathcal{D}$ can be refined by a covering (!) $\{u(U_i) \to u(U)\}$ of $\mathcal{D}$ where $\{U_i \to U\}$ is a covering in $\mathcal{C}$. This implies that $(g_{p!}\mathcal{F})^+(u(U)) = \mathcal{F}(U)$ also, since in the colimit defining the value of $(g_{p!}\mathcal{F})^+$ on $u(U)$ we may restrict to the cofinal system of coverings $\{u(U_i) \to u(U)\}$ as above. Hence we see that $(g_{p!}\mathcal{F})^+(u(U)) = \mathcal{F}(U)$ for all objects $U$ of $\mathcal{C}$ as well. Repeating this argument one more time gives the equality $(g_{p!}\mathcal{F})^\#(u(U)) = \mathcal{F}(U)$ for all objects $U$ of $\mathcal{C}$. This produces the desired equality $g^{-1}g_!\mathcal{F} = \mathcal{F}$.
This Lemma is the analogue of Sites, Lemma \ref{sites-lemma-have-left-adjoint}. From Sites, Lemma \ref{sites-lemma-adjoint-functors} we see that the categories $\mathcal{I}_V^u$ have an initial object. Thus the underlying set of a colimit of a system of abelian groups over $(\mathcal{I}_V^u)^{opp}$ is the colimit of the underlying sets. Whence the agreement of $g_!^{\Sh}$ and $g_!$ by our construction of $g_!$ in Definition \ref{definition-g-shriek}. The exactness and (2) follow immediately from the corresponding statements of Sites, Lemma \ref{sites-lemma-have-left-adjoint}.
The $\mathcal{O}$-module structure on the presheaf is defined as follows. If $f \in \mathcal{O}(V)$ and $s \in \mathcal{G}(V \xrightarrow{\varphi} U)$, then we define $f \cdot s = fs$ where $f \in \mathcal{O}_U(\varphi : V \to U) = \mathcal{O}(V)$ (because $\mathcal{O}_U$ is the restriction of $\mathcal{O}$ to $\mathcal{C}/U$). \medskip\noindent Similarly, let $\alpha : \mathcal{G} \to \mathcal{F}|_U$ be a morphism of $\mathcal{O}_U$-modules. In this case we can define a map from the presheaf of the lemma into $\mathcal{F}$ by mapping $$ \bigoplus\nolimits_{\varphi \in \Mor_\mathcal{C}(V, U)} \mathcal{G}(V \xrightarrow{\varphi} U) \longrightarrow \mathcal{F}(V) $$ by the rule that $s \in \mathcal{G}(V \xrightarrow{\varphi} U)$ maps to $\alpha(s) \in \mathcal{F}(V)$. It is clear that this is $\mathcal{O}$-linear, and hence induces a morphism of $\mathcal{O}$-modules $\alpha' : j_{U!}\mathcal{G} \to \mathcal{F}$ by the properties of sheafification of modules (Lemma \ref{lemma-sheafification-presheaf-modules}). \medskip\noindent Conversely, let $\beta : j_{U!}\mathcal{G} \to \mathcal{F}$ by a map of $\mathcal{O}$-modules. Recall from Sites, Section \ref{sites-section-localize} that there exists an extension by the empty set $j^{Sh}_{U!} : \Sh(\mathcal{C}/U) \to \Sh(\mathcal{C})$ on sheaves of sets which is left adjoint to $j_U^{-1}$. Moreover, $j^{Sh}_{U!}\mathcal{G}$ is the sheaf associated to the presheaf $$ V \longmapsto \coprod\nolimits_{\varphi \in \Mor_\mathcal{C}(V, U)} \mathcal{G}(V \xrightarrow{\varphi} U) $$ Hence there is a natural map $j^{Sh}_{U!}\mathcal{G} \to j_{U!}\mathcal{G}$ of sheaves of sets. Hence precomposing $\beta$ by this map we get a map of sheaves of sets $j^{Sh}_{U!}\mathcal{G} \to \mathcal{F}$ which by adjunction corresponds to a map of sheaves of sets $\beta' : \mathcal{G} \to \mathcal{F}|_U$. We claim that $\beta'$ is $\mathcal{O}_U$-linear. Namely, suppose that $\varphi : V \to U$ is an object of $\mathcal{C}/U$ and that $s, s' \in \mathcal{G}(\varphi : V \to U)$, and $f \in \mathcal{O}(V) = \mathcal{O}_U(\varphi : V \to U)$. Then by the discussion above we see that $\beta'(s + s')$, resp.\  $\beta'(fs)$ in $\mathcal{F}|_U(\varphi : V \to U)$ correspond to $\beta(s + s')$, resp.\ $\beta(fs)$ in $\mathcal{F}(V)$. Since $\beta$ is a homomorphism we conclude. \medskip\noindent To conclude the proof of the lemma we have to show that the constructions $\alpha \mapsto \alpha'$ and $\beta \mapsto \beta'$ are mutually inverse. We omit the verifications.
Since $j_{U!}$ is a left adjoint to $j_U^*$ we see that it is right exact (see Categories, Lemma \ref{categories-lemma-exact-adjoint} and Homology, Section \ref{homology-section-functors}). Hence it suffices to show that if $\mathcal{G}_1 \to \mathcal{G}_2$ is an injective map of $\mathcal{O}_U$-modules, then $j_{U!}\mathcal{G}_1 \to j_{U!}\mathcal{G}_2$ is injective. The map on sections of presheaves over an object $V$ (as in Lemma \ref{lemma-extension-by-zero}) is the map $$ \bigoplus\nolimits_{\varphi \in \Mor_\mathcal{C}(V, U)} \mathcal{G}_1(V \xrightarrow{\varphi} U) \longrightarrow \bigoplus\nolimits_{\varphi \in \Mor_\mathcal{C}(V, U)} \mathcal{G}_2(V \xrightarrow{\varphi} U) $$ which is injective by assumption. Since sheafification is exact by Lemma \ref{lemma-sheafification-exact} we conclude $j_{U!}\mathcal{G}_1 \to j_{U!}\mathcal{G}_2$ is injective and we win.