hcju/stacksqa huggingface dataset:
By Lemma \ref{lemma-compute-symbol-M} it suffices to show the relation when $M = A/\mathfrak q$ for some prime $\mathfrak q \subset A$ with $\dim(A/\mathfrak q) = 1$. \medskip\noindent In case $M = A/\mathfrak q$ we may replace $A$ by $A/\mathfrak q$ and $a, b$ by their images in $A/\mathfrak q$. Hence we may assume $A = M$ and $A$ a local Noetherian domain of dimension $1$. The reason is that the residue field $\kappa$ of $A$ and $A/\mathfrak q$ are the same and that for any $A/\mathfrak q$-module $M$ the determinant taken over $A$ or over $A/\mathfrak q$ are canonically identified. See Lemma \ref{lemma-determinant-quotient-ring}. \medskip\noindent It suffices to show the relation when both $a, b$ are in the maximal ideal. Namely, the case where one or both are units follows from Lemmas \ref{lemma-symbol-when-one-is-a-unit} and \ref{lemma-symbol-when-equal}. \medskip\noindent Choose an extension $A \subset A'$ and factorizations $a = ta'$, $b = tb'$ as in Lemma \ref{lemma-Noetherian-domain-dim-1-two-elements}. Note that also $b - a = t(b' - a')$ and that $A' = (a', b') = (a', b' - a') = (b' - a', b')$. Here and in the following we think of $A'$ as an $A$-module and $a, b, a', b', t$ as $A$-module endomorphisms of $A'$. We will use the notation $d^A_{A'}(a', b')$ and so on to indicate $$ d^A_{A'}(a', b') = \det\nolimits_\kappa(A'/a'b'A', a', b') $$ which is defined by Lemma \ref{lemma-pre-symbol}. The upper index ${}^A$ is used to distinguish this from the already defined symbol $d_{A'}(a', b')$ which is different (for example because it has values in the residue field of $A'$ which may be different from $\kappa$). By Lemma \ref{lemma-symbol-compare-modules} we see that $d_A(a, b) = d^A_{A'}(a, b)$, and similarly for the other combinations. Using this and multiplicativity we see that it suffices to prove $$ d^A_{A'}(a', b' - a') d^A_{A'}(b', b') = d^A_{A'}(b', b' - a') d^A_{A'}(a', b') $$ Now, since $(a', b') = A'$ and so on we have $$ \begin{matrix} A'/(a'(b' - a')) & \cong & A'/(a') \oplus A'/(b' - a') \\ A'/(b'(b' - a')) & \cong & A'/(b') \oplus A'/(b' - a') \\ A'/(a'b') & \cong & A'/(a') \oplus A'/(b') \end{matrix} $$ Moreover, note that multiplication by $b' - a'$ on $A/(a')$ is equal to multiplication by $b'$, and that multiplication by $b' - a'$ on $A/(b')$ is equal to multiplication by $-a'$. Using Lemmas \ref{lemma-periodic-determinant-easy-case} and \ref{lemma-periodic-determinant} we conclude $$ \begin{matrix} d^A_{A'}(a', b' - a') & = & \det\nolimits_\kappa(b'|_{A'/(a')})^{-1} \det\nolimits_\kappa(a'|_{A'/(b' - a')}) \\ d^A_{A'}(b', b' - a') & = & \det\nolimits_\kappa(-a'|_{A'/(b')})^{-1} \det\nolimits_\kappa(b'|_{A'/(b' - a')}) \\ d^A_{A'}(a', b') & = & \det\nolimits_\kappa(b'|_{A'/(a')})^{-1} \det\nolimits_\kappa(a'|_{A'/(b')}) \end{matrix} $$ Hence we conclude that $$ (-1)^{\text{length}_A(A'/(b'))} d^A_{A'}(a', b' - a') = d^A_{A'}(b', b' - a') d^A_{A'}(a', b') $$ the sign coming from the $-a'$ in the second equality above. On the other hand, by Lemma \ref{lemma-periodic-determinant-sign} we have $d^A_{A'}(b', b') = (-1)^{\text{length}_A(A'/(b'))}$ and the lemma is proved.
Write $x = a/b$ with $a, b \in A$. The hypothesis implies, since $1 - x = (b - a)/b$, that also $b - a \not = 0$. Hence we compute $$ d_A(x, 1 - x) = d_A(a, b - a)d_A(a, b)^{-1}d_A(b, b - a)^{-1}d_A(b, b) $$ Thus we have to show that $d_A(a, b - a) d_A(b, b) = d_A(b, b - a) d_A(a, b)$. This is Lemma \ref{lemma-symbol-is-steinberg-prepare}.
The condition that $\mathfrak q$ is a minimal prime in the support of $M$ implies that $l = \text{length}_{R_\mathfrak q}(M_\mathfrak q)$ is finite (see Algebra, Lemma \ref{algebra-lemma-support-point}). Hence we can find $y_1, \ldots, y_l \in M_{\mathfrak q}$ such that $\langle y_1, \ldots, y_i\rangle / \langle y_1, \ldots, y_{i - 1}\rangle \cong \kappa(\mathfrak q)$ for $i = 1, \ldots, l$. We can find $f_i \in R$, $f_i \not \in \mathfrak q$ such that $f_i y_i$ is the image of some element $z_i \in M$. Moreover, as $R$ is Noetherian we can write $\mathfrak q = (g_1, \ldots, g_t)$ for some $g_j \in R$. By assumption $g_j y_i \in \langle y_1, \ldots, y_{i - 1} \rangle$ inside the module $M_{\mathfrak q}$. By our choice of $z_i$ we can find some further elements $f_{ji} \in R$, $f_{ij} \not \in \mathfrak q$ such that $f_{ij} g_j z_i \in \langle z_1, \ldots, z_{i - 1} \rangle$ (equality in the module $M$). The lemma follows by taking $$ x_1 = f_{11}f_{12}\ldots f_{1t}z_1, \quad x_2 = f_{11}f_{12}\ldots f_{1t}f_{21}f_{22}\ldots f_{2t}z_2, $$ and so on. Namely, since all the elements $f_i, f_{ij}$ are invertible in $R_{\mathfrak q}$ we still have that $R_{\mathfrak q}x_1 + \ldots + R_{\mathfrak q}x_i / R_{\mathfrak q}x_1 + \ldots + R_{\mathfrak q}x_{i - 1} \cong \kappa(\mathfrak q)$ for $i = 1, \ldots, l$. By construction, $\mathfrak q x_i \in \langle x_1, \ldots, x_{i - 1}\rangle$. Thus $\langle x_1, \ldots, x_i\rangle / \langle x_1, \ldots, x_{i - 1}\rangle$ is an $R$-module generated by one element, annihilated $\mathfrak q$ such that localizing at $\mathfrak q$ gives a $q$-dimensional vector space over $\kappa(\mathfrak q)$. Hence it is isomorphic to $R/\mathfrak q$.
Recall that $H^0(M, 0, \psi) = \Coker(\psi)$ and $H^1(M, 0, \psi) = \Ker(\psi)$, see remarks above Definition \ref{definition-periodic-length}. The lemma follows by combining Proposition \ref{proposition-length-determinant-periodic-complex} with Lemma \ref{lemma-periodic-determinant-easy-case}. \medskip\noindent Alternative proof. Reduce to the case $\text{Supp}(M) = \{\mathfrak m, \mathfrak q\}$ as in the proof of Proposition \ref{proposition-length-determinant-periodic-complex}. Then directly combine Lemmas \ref{lemma-key-lemma} and \ref{lemma-good-sequence-exists} to prove this specific case of Proposition \ref{proposition-length-determinant-periodic-complex}. There is much less bookkeeping in this case, and the reader is encouraged to work this out. Details omitted.
Since the tame symbols $d_{A_{\mathfrak q}}(f, g)$ are additive (Lemma \ref{lemma-multiplicativity-symbol}) and the order functions $\text{ord}_{A/\mathfrak q}$ are additive (Algebra, Lemma \ref{algebra-lemma-ord-additive}) it suffices to prove the formula when $f = a \in A$ and $g = b \in A$. In this case we see that we have to show $$ \sum\nolimits_{\text{height}(\mathfrak q) = 1} \text{ord}_{A/\mathfrak q}(\det\nolimits_\kappa(A_{\mathfrak q}/(ab), a, b)) = 0 $$ By Proposition \ref{proposition-length-determinant-periodic-complex} this is equivalent to showing that $$ e_A(A/(ab), a, b) = 0. $$ Since the complex $A/(ab) \xrightarrow{a} A/(ab) \xrightarrow{b} A/(ab) \xrightarrow{a} A/(ab)$ is exact we win.
Let $\{W_j\}_{j \in J}$ be the collection of irreducible components of $\text{Supp}(\mathcal{F})$ which have $\delta$-dimension $k + 1$. Note that $\{W_j\}$ is a locally finite collection of closed subsets of $X$ by Lemma \ref{lemma-length-finite}. For every $j$, let $\xi_j \in W_j$ be the generic point. Set $$ f_j = \det\nolimits_{\kappa(\xi_j)} (\mathcal{F}_{\xi_j}, \varphi_{\xi_j}, \psi_{\xi_j}) \in R(W_j)^*. $$ See Definition \ref{definition-periodic-determinant} for notation. We claim that $$ - [H^0(\mathcal{F}, \varphi, \psi)]_k + [H^1(\mathcal{F}, \varphi, \psi)]_k = \sum (W_j \to X)_*\text{div}(f_j) $$ If we prove this then the lemma follows. \medskip\noindent Let $Z \subset X$ be an integral closed subscheme of $\delta$-dimension $k$. To prove the equality above it suffices to show that the coefficient $n$ of $[Z]$ in $ [H^0(\mathcal{F}, \varphi, \psi)]_k - [H^1(\mathcal{F}, \varphi, \psi)]_k $ is the same as the coefficient $m$ of $[Z]$ in $ \sum (W_j \to X)_*\text{div}(f_j) $. Let $\xi \in Z$ be the generic point. Consider the local ring $A = \mathcal{O}_{X, \xi}$. Let $M = \mathcal{F}_\xi$ as an $A$-module. Denote $\varphi, \psi : M \to M$ the action of $\varphi, \psi$ on the stalk. By our choice of $\xi \in Z$ we have $\delta(\xi) = k$ and hence $\dim(\text{Supp}(M)) = 1$. Finally, the integral closed subschemes $W_j$ passing through $\xi$ correspond to the minimal primes $\mathfrak q_i$ of $\text{Supp}(M)$. In each case the element $f_j \in R(W_j)^*$ corresponds to the element $\det_{\kappa(\mathfrak q_i)}(M_{\mathfrak q_i}, \varphi, \psi)$ in $\kappa(\mathfrak q_i)^*$. Hence we see that $$ n = - e_A(M, \varphi, \psi) $$ and $$ m = \sum \text{ord}_{A/\mathfrak q_i} (\det\nolimits_{\kappa(\mathfrak q_i)}(M_{\mathfrak q_i}, \varphi, \psi)) $$ Thus the result follows from Proposition \ref{proposition-length-determinant-periodic-complex}.
By Lemma \ref{lemma-cycles-k-group} we have $Z_k(X) = K_0(\textit{Coh}_{\leq k}(X)/\textit{Coh}_{\leq k - 1}(X))$ compatible with the map of Lemma \ref{lemma-from-chow-to-K}. Thus, suppose we have an element $[A] - [B]$ of $K_0(\textit{Coh}_{\leq k}(X)/\textit{Coh}_{\leq k - 1}(X))$ which maps to zero in $B_k(X)$, i.e., maps to zero in $K_0(\textit{Coh}_{\leq k + 1}(X)/\textit{Coh}_{\leq k - 1}(X))$. We have to show that $[A] - [B]$ corresponds to a cycle rationally equivalent to zero on $X$. Suppose $[A] = [\mathcal{A}]$ and $[B] = [\mathcal{B}]$ for some coherent sheaves $\mathcal{A}, \mathcal{B}$ on $X$ supported in $\delta$-dimension $\leq k$. The assumption that $[A] - [B]$ maps to zero in the group $K_0(\textit{Coh}_{\leq k + 1}(X)/\textit{Coh}_{\leq k - 1}(X))$ means that there exists coherent sheaves $\mathcal{A}', \mathcal{B}'$ on $X$ supported in $\delta$-dimension $\leq k - 1$ such that $[\mathcal{A} \oplus \mathcal{A}'] - [\mathcal{B} \oplus \mathcal{B}']$ is zero in $K_0(\textit{Coh}_{k + 1}(X))$ (use part (1) of Homology, Lemma \ref{homology-lemma-serre-subcategory-K-groups}). By part (2) of Homology, Lemma \ref{homology-lemma-serre-subcategory-K-groups} this means there exists a $(2, 1)$-periodic complex $(\mathcal{F}, \varphi, \psi)$ in the category $\textit{Coh}_{\leq k + 1}(X)$ such that $\mathcal{A} \oplus \mathcal{A}' = H^0(\mathcal{F}, \varphi, \psi)$ and $\mathcal{B} \oplus \mathcal{B}' = H^1(\mathcal{F}, \varphi, \psi)$. By Lemma \ref{lemma-maps-between-coherent-sheaves} this implies that $$ [\mathcal{A} \oplus \mathcal{A}']_k \sim_{rat} [\mathcal{B} \oplus \mathcal{B}']_k $$ This proves that $[A] - [B]$ maps to a cycle rationally equivalent to zero by the map $$ K_0(\textit{Coh}_{\leq k}(X)/\textit{Coh}_{\leq k - 1}(X)) \longrightarrow Z_k(X) $$ of Lemma \ref{lemma-cycles-k-group}. This is what we had to prove and the proof is complete.
Since $M$ has no embedded associated primes, and since the support of $M$ is $\Spec(A)$ we see that $\text{Ass}(M) = \{\mathfrak q_1, \ldots, \mathfrak q_t\}$. Hence $a$, $b$ are nonzerodivisors on $M$. Note that \begin{align*} & \text{length}_A(M/(a/b)IM) \\ & = \text{length}_A(bM/aIM) \\ & = \text{length}_A(M/aIM) - \text{length}_A(M/bM) \\ & = \text{length}_A(M/aM) + \text{length}_A(aM/aIM) - \text{length}_A(M/bM) \\ & = \text{length}_A(M/aM) + \text{length}_A(M/IM) - \text{length}_A(M/bM) \end{align*} as the injective map $b : M \to bM$ maps $(a/b)IM$ to $aIM$ and the injective map $a : M \to aM$ maps $IM$ to $aIM$. Hence the left hand side of the equation of the lemma is equal to $$ \text{length}_A(M/aM) - \text{length}_A(M/bM). $$ Applying the second formula of Lemma \ref{lemma-additivity-divisors-restricted} with $x = a, b$ respectively and using Algebra, Definition \ref{algebra-definition-ord} of the $\text{ord}$-functions we get the result.
Recall from Divisors, Lemma \ref{divisors-lemma-make-maps-regular-section} the existence of injective maps $1 : \mathcal{I}\mathcal{F} \to \mathcal{F}$ and $s : \mathcal{I}\mathcal{F} \to \mathcal{F} \otimes_{\mathcal{O}_X}\mathcal{L}$ whose cokernels are supported on a closed nowhere dense subsets $T$. Denote $\mathcal{Q}_i$ there cokernels as in the lemma. We conclude that $\dim_\delta(\text{Supp}(\mathcal{Q}_i)) \leq k$. By Divisors, Lemmas \ref{divisors-lemma-pullback-meromorphic-sections-defined} and \ref{divisors-lemma-meromorphic-sections-pullback} the pullbacks $s_i$ are defined and are regular meromorphic sections for $\mathcal{L}|_{X_i}$. The equality of cycles in (4) implies the equality of cycle classes in (4). Hence the only remaining thing to show is that $$ [\mathcal{Q}_2]_k - [\mathcal{Q}_1]_k = \sum m_i(X_i \to X)_*\text{div}_{\mathcal{L}|_{X_i}}(s_i) $$ holds in $Z_k(X)$. To see this, let $Z \subset X$ be an integral closed subscheme of $\delta$-dimension $k$. Let $\xi \in Z$ be the generic point. Let $A = \mathcal{O}_{X, \xi}$ and $M = \mathcal{F}_\xi$. Moreover, choose a generator $s_\xi \in \mathcal{L}_\xi$. Then we can write $s = (a/b) s_\xi$ where $a, b \in A$ are nonzerodivisors. In this case $I = \mathcal{I}_\xi = \{x \in A \mid x(a/b) \in A\}$. In this case the coefficient of $[Z]$ in the left hand side is $$ \text{length}_A(M/(a/b)IM) - \text{length}_A(M/IM) $$ and the coefficient of $[Z]$ in the right hand side is $$ \sum \text{length}_{A_{\mathfrak q_i}}(M_{\mathfrak q_i}) \text{ord}_{A/\mathfrak q_i}(a/b) $$ where $\mathfrak q_1, \ldots, \mathfrak q_t$ are the minimal primes of the $1$-dimensional local ring $A$. Hence the result follows from Lemma \ref{lemma-no-embedded-points-modules}.
Since $Y$ is regular of finite dimension, the construction in Remark \ref{remark-perf-Z-regular} applies. We have the resolution property for $Y$ by Derived Categories of Schemes, Lemma \ref{perfect-lemma-regular-resolution-property} and the construction in Remark \ref{remark-localized-chern-character-K} applies. We have that $Y$ is locally equidimensional (Lemma \ref{lemma-locally-equidimensional}) and thus the ``fundamental cycle'' $[Y]$ is defined as an element of $\CH_*(Y)$, see Remark \ref{remark-fundamental-class}. Combining this with the map $\CH_k(X) \to \text{gr}_kK'_0(X)$ constructed above we see that it suffices to prove \begin{enumerate} \item If $\mathcal{F}$ is a coherent $\mathcal{O}_X$-module whose support has $\delta$-dimension $\leq k$, then the composition above sends $[\mathcal{F}]$ into $\bigoplus_{k' \leq k} \CH_{k'}(X) \otimes \mathbf{Q}$. \item If $Z \subset X$ is an integral closed subscheme of $\delta$-dimension $k$, then the composition above sends $[\mathcal{O}_Z]$ to an element whose degree $k$ part is the class of $[Z]$ in $\CH_k(X) \otimes \mathbf{Q}$. \end{enumerate} Namely, if this holds, then our maps induce maps $\text{gr}_kK'_0(X) \otimes \mathbf{Q} \to CH_k(X) \otimes \mathbf{Q}$ which are inverse to the canonical maps  $\CH_k(X) \otimes \mathbf{Q} \to \text{gr}_k K'_0(X) \otimes \mathbf{Q}$ given above the proposition. \medskip\noindent Given a coherent $\mathcal{O}_X$-module $\mathcal{F}$ the composition above sends $[\mathcal{F}]$ to $$ ch(X \to Y, \mathcal{F}[0]) \cap [Y] \in \CH_*(X) \otimes \mathbf{Q} $$ If $\mathcal{F}$ is (set theoretically) supported on a closed subscheme $Z \subset X$, then we have $$ ch(X \to Y, \mathcal{F}[0]) = (Z \to X)_* \circ ch(Z \to Y, \mathcal{F}[0]) $$ by Lemma \ref{lemma-loc-chern-shrink-Z}. We conclude that in this case we end up in the image of $\CH_*(Z) \to \CH_*(X)$. Hence we get condition (1). \medskip\noindent Let $Z \subset X$ be an integral closed subscheme of $\delta$-dimension $k$. The composition above sends $[\mathcal{O}_Z]$ to the element $$ ch(X \to Y, \mathcal{O}_Z[0]) \cap [Y] = (Z \to X)_* ch(Z \to Y, \mathcal{O}_Z[0]) \cap [Y] $$ by the same argument as above. Thus it suffices to prove that the degree $k$ part of $ch(Z \to Y, \mathcal{O}_Z[0]) \cap [Y] \in \CH_*(Z) \otimes \mathbf{Q}$ is $[Z]$. Since $\CH_k(Z) = \mathbf{Z}$, in order to prove this we may replace $Y$ by an open neighbourhood of the generic point $\xi$ of $Z$. Since the maximal ideal of the regular local ring $\mathcal{O}_{X, \xi}$ is generated by a regular sequence (Algebra, Lemma \ref{algebra-lemma-regular-ring-CM}) we may assume the ideal of $Z$ is generated by a regular sequence, see Divisors, Lemma \ref{divisors-lemma-Noetherian-scheme-regular-ideal}. Thus we deduce the result from Lemma \ref{lemma-actual-computation}.
We will use that smooth morphisms are local complete intersection morphisms whose gysin maps are defined (see Section \ref{section-koszul}). In particular we have $g^! \in A^{-d}(Y \to Z)$. Then we can send $c \in A^p(X \to Y)$ to $c \circ g^! \in A^{p - d}(X \to Z)$. \medskip\noindent Conversely, let $c' \in A^{p - d}(X \to Z)$. Denote $res(c')$ the restriction (Remark \ref{remark-restriction-bivariant}) of $c'$ by the morphism $Y \to Z$. Since the diagram $$ \xymatrix{ X \times_Z Y \ar[r]_{\text{pr}_2} \ar[d]_{\text{pr}_1} & Y \ar[d]^g \\ X \ar[r]^f & Z } $$ is cartesian we find $res(c') \in A^{p - d}(X \times_Z Y \to Y)$. Let $\Delta : Y \to Y \times_Z Y$ be the diagonal and denote $res(\Delta^!)$ the restriction of $\Delta^!$ to $X \times_Z Y$ by the morphism $X \times_Z Y \to Y \times_Z Y$. Since the diagram $$ \xymatrix{ X \ar[r] \ar[d] & X \times_Z Y \ar[d] \\ Y \ar[r]^-\Delta & Y \times_Z Y } $$ is cartesian we see that $res(\Delta^!) \in A^d(X \to X \times_Z Y)$. Combining these two restrictions we obtain $$ res(\Delta^!) \circ res(c') \in A^p(X \to Y) $$ Thus we have produced maps $A^p(X \to Y) \to A^{p - d}(X \to Z)$ and $A^{p - d}(X \to Z) \to A^p(X \to Y)$. To finish the proof we will show these maps are mutually inverse. \medskip\noindent Let us start with $c \in A^p(X \to Y)$. Consider the diagram $$ \xymatrix{ X \ar[d] \ar[r] & Y \ar[d] \\ X \times_Z Y \ar[r] \ar[d]^{\text{pr}_1} & Y \times_Z Y \ar[r]_{p_2} \ar[d]^{p_1} & Y \ar[d]^g \\ X \ar[r]^f & Y \ar[r]^g & Z } $$ whose squares are carteisan. The lower two square of this diagram show that $res(c \circ g^!) = res(c) \cap p_2^!$ where in this formula $res(c)$ means the restriction of $c$ via $p_1$. Looking at the upper square of the diagram and using Lemma \ref{lemma-lci-gysin-commutes} we get $c \circ \Delta^! = res(\Delta^!) \circ res(c)$. We compute \begin{align*} res(\Delta^!) \circ res(c \circ g^!) & = res(\Delta^!) \circ res(c) \circ p_2^! \\ & = c \circ \Delta^! \circ p_2^! \\ & = c \end{align*} The final equality by Lemma \ref{lemma-diagonal-identity}. \medskip\noindent Conversely, let us start with $c' \in A^{p - d}(X \to Z)$. Looking at the lower rectangle of the diagram above we find $res(c') \circ g^! = \text{pr}_1^! \circ c'$. We compute \begin{align*} res(\Delta^!) \circ res(c') \circ g^! & = res(\Delta^!) \circ \text{pr}_1^! \circ c' \\ & = c' \end{align*} The final equality holds because the left two squares of the diagram show that $\text{id} = res(\Delta^! \circ p_1^!) = res(\Delta^!) \circ \text{pr}_1^!$. This finishes the proof.
Let $x \in X$ be such that $\mathcal{F}$ is flat at $x$ over $S$. We have to find an open neighbourhood of $x$ such that $\mathcal{F}$ restricts to a $S$-flat finitely presented module on this neighbourhood. The problem is local on $X$ and $S$, hence we may assume that $X$ and $S$ are affine. As $\mathcal{F}_x$ is a finitely presented $\mathcal{O}_{X, x}$-module by Lemma \ref{lemma-finite-type-flat-at-point-local} we conclude from Algebra, Lemma \ref{algebra-lemma-construct-fp-module-from-stalk} there exists a finitely presented $\mathcal{O}_X$-module $\mathcal{F}'$ and a map $\varphi : \mathcal{F}' \to \mathcal{F}$ which induces an isomorphism $\varphi_x : \mathcal{F}'_x \to \mathcal{F}_x$. In particular we see that $\mathcal{F}'$ is flat over $S$ at $x$, hence by openness of flatness More on Morphisms, Theorem \ref{more-morphisms-theorem-openness-flatness} we see that after shrinking $X$ we may assume that $\mathcal{F}'$ is flat over $S$. As $\mathcal{F}$ is of finite type after shrinking $X$ we may assume that $\varphi$ is surjective, see Modules, Lemma \ref{modules-lemma-finite-type-surjective-on-stalk} or alternatively use Nakayama's lemma (Algebra, Lemma \ref{algebra-lemma-NAK}). By Lemma \ref{lemma-bourbaki-finite-type-general-base} we have $$ \text{WeakAss}_X(\mathcal{F}') \subset \bigcup\nolimits_{s \in \text{WeakAss}(S)} \text{Ass}_{X_s}(\mathcal{F}'_s) $$ As $\text{WeakAss}(S)$ is finite by assumption and since $\text{Ass}_{X_s}(\mathcal{F}'_s)$ is finite by Divisors, Lemma \ref{divisors-lemma-finite-ass} we conclude that $\text{WeakAss}_X(\mathcal{F}')$ is finite. Using Algebra, Lemma \ref{algebra-lemma-silly} we may, after shrinking $X$ once more, assume that $\text{WeakAss}_X(\mathcal{F}')$ is contained in the generalization of $x$. Now consider $\mathcal{K} = \Ker(\varphi)$. We have $\text{WeakAss}_X(\mathcal{K}) \subset \text{WeakAss}_X(\mathcal{F}')$ (by Divisors, Lemma \ref{divisors-lemma-ses-weakly-ass}) but on the other hand, $\varphi_x$ is an isomorphism, also $\varphi_{x'}$ is an isomorphism for all $x' \leadsto x$. We conclude that $\text{WeakAss}_X(\mathcal{K}) = \emptyset$ whence $\mathcal{K} = 0$ by Divisors, Lemma \ref{divisors-lemma-weakly-ass-zero}.
We will use without further mention that $\mathcal{F}$ is universally pure over $S$, see Lemma \ref{lemma-finite-type-flat-pure-along-fibre-is-universal}. By Lemma \ref{lemma-iso-sheaf} and Descent, Lemmas \ref{descent-lemma-closed-immersion} and \ref{descent-lemma-descent-data-sheaves} the question is local for the \'etale topology on $S$. Hence it suffices to prove, given $s \in S$, that there exists an \'etale neighbourhood of $(S, s)$ so that the theorem holds. \medskip\noindent Using Lemma \ref{lemma-finite-presentation-flat-along-fibre} and after replacing $S$ by an elementary \'etale neighbourhood of $s$ we may assume there exists a commutative diagram $$ \xymatrix{ X \ar[dr] & & X' \ar[ll]^g \ar[ld] \\ & S & } $$ of schemes of finite presentation over $S$, where $g$ is \'etale, $X_s \subset g(X')$, the schemes $X'$ and $S$ are affine, $\Gamma(X', g^*\mathcal{F})$ a projective $\Gamma(S, \mathcal{O}_S)$-module. Note that $g^*\mathcal{F}$ is universally pure over $S$, see Lemma \ref{lemma-affine-locally-projective-pure}. Hence by Lemma \ref{lemma-criterion} we see that the open $g(X')$ contains the points of $\text{Ass}_{X/S}(\mathcal{F})$ lying over $\Spec(\mathcal{O}_{S, s})$. Set $$ E = \{t \in S \mid \text{Ass}_{X_t}(\mathcal{F}_t) \subset g(X') \}. $$ By More on Morphisms, Lemma \ref{more-morphisms-lemma-relative-assassin-constructible} $E$ is a constructible subset of $S$. We have seen that $\Spec(\mathcal{O}_{S, s}) \subset E$. By Morphisms, Lemma \ref{morphisms-lemma-constructible-containing-open} we see that $E$ contains an open neighbourhood of $s$. Hence after replacing $S$ by a smaller affine neighbourhood of $s$ we may assume that $\text{Ass}_{X/S}(\mathcal{F}) \subset g(X')$. \medskip\noindent Since we have assumed that $u$ is surjective we have $F_{iso} = F_{inj}$. From Lemma \ref{lemma-universally-separating} it follows that $u : \mathcal{F} \to \mathcal{G}$ is injective if and only if $g^*u : g^*\mathcal{F} \to g^*\mathcal{G}$ is injective, and the same remains true after any base change. Hence we have reduced to the case where, in addition to the assumptions in the theorem, $X \to S$ is a morphism of affine schemes and $\Gamma(X, \mathcal{F})$ is a projective $\Gamma(S, \mathcal{O}_S)$-module. This case follows immediately from Lemma \ref{lemma-flattening-module-map}. \medskip\noindent To see that $Z$ is of finite presentation if $\mathcal{G}$ is of finite presentation, combine Lemma \ref{lemma-iso-sheaf} part (4) with Limits, Remark \ref{limits-remark-limit-preserving}.
It is clear that (1) implies (2) as $\mathcal{F}_{x'}$ is a localization of $\mathcal{F}_x$ for every point which specializes to $x$. Set $A = \mathcal{O}_{S, s}$, $B = \mathcal{O}_{X, x}$ and $N = \mathcal{F}_x$. Let $\Sigma \subset B$ be the multiplicative subset of $B$ of elements which act as nonzerodivisors on $N/\mathfrak m_AN$. Assumption (2) implies that $\Sigma^{-1}N$ is $A$-flat by the description of $\Spec(\Sigma^{-1}N)$ in Lemma \ref{lemma-homothety-spectrum}. On the other hand, the map $N \to \Sigma^{-1}N$ is injective modulo $\mathfrak m_A$ by construction. Hence applying Lemma \ref{lemma-upstairs-finite-type-injective-into-flat-mod-m} we win.