hcju/stacksqa huggingface dataset:
The implications (3) $\Rightarrow$ (2) $\Rightarrow$ (1) are immediate. The implication (1) $\Rightarrow$ (4) follows from Lemma \ref{lemma-regular-alteration-implies}. Observe that a normal one dimensional scheme is regular hence the implication (4) $\Rightarrow$ (2) is clear as well. Thus it remains to show that the equivalent conditions (1), (2), and (4) imply (3). \medskip\noindent Let $f : X \to Y$ be a resolution of singularities. Since the dimension of $Y$ is one we see that $f$ is finite by Varieties, Lemma \ref{varieties-lemma-finite-in-codim-1}. We will construct factorizations $$ X \to \ldots \to Y_2 \to Y_1 \to Y $$ where $Y_i \to Y_{i - 1}$ is a blowing up of a closed point and not an isomorphism as long as $Y_{i - 1}$ is not regular. Each of these morphisms will be finite (by the same reason as above) and we will get a corresponding system $$ f_*\mathcal{O}_X \supset \ldots \supset f_{2, *}\mathcal{O}_{Y_2} \supset f_{1, *}\mathcal{O}_{Y_1} \supset \mathcal{O}_Y $$ where $f_i : Y_i \to Y$ is the structure morphism. Since $Y$ is Noetherian, this increasing sequence of coherent submodules must stabilize (Cohomology of Schemes, Lemma \ref{coherent-lemma-acc-coherent}) which proves that for some $n$ the scheme $Y_n$ is regular as desired. To construct $Y_i$ given $Y_{i - 1}$ we pick a singular closed point $y_{i - 1} \in Y_{i - 1}$ and we let $Y_i \to Y_{i - 1}$ be the corresponding blowup. Since $X$ is regular of dimension $1$ (and hence the local rings at closed points are discrete valuation rings and in particular PIDs), the ideal sheaf $\mathfrak m_{y_{i - 1}} \cdot \mathcal{O}_X$ is invertible. By the universal property of blowing up (Divisors, Lemma \ref{divisors-lemma-universal-property-blowing-up}) this gives us a factorization $X \to Y_i$. Finally, $Y_i \to Y_{i - 1}$ is not an isomorphism as $\mathfrak m_{y_{i - 1}}$ is not an invertible ideal.
Let $Y_n \to Y_{n - 1} \to \ldots \to Y_1 \to Y$ be the sequence of blowups given to us by Lemma \ref{lemma-resolve-curve}. Let $X_n \to X_{n - 1} \to \ldots \to X_1 \to X$ be the corresponding sequence of blowups of $X$. This works because the strict transform is the blowup by Divisors, Lemma \ref{divisors-lemma-strict-transform}.
Since $\mathcal{O}_{X, p} \to \mathcal{O}_{Y, p}$ is surjective and $\mathcal{O}_{Y, p}$ is a discrete valuation ring, we can pick an element $x_1 \in \mathfrak m_p$ mapping to a uniformizer in $\mathcal{O}_{Y, p}$. Choose an affine open $U = \Spec(A)$ containing $p$ such that $x_1 \in A$. Let $\mathfrak m \subset A$ be the maximal ideal corresponding to $p$. Let $I, J \subset A$ be the ideals defining $Y, Z$ in $\Spec(A)$. After shrinking $U$ we may assume that $\mathfrak m = I + (x_1)$, in other words, that $V(x_1) \cap U \cap Y = \{p\}$ scheme theoretically. We conclude that $p$ is an effective Cartier divisor on $Y$ and since $Y'$ is the blowing up of $Y$ in $p$ (Divisors, Lemma \ref{divisors-lemma-strict-transform}) we see that $Y' \to Y$ is an isomorphism by Divisors, Lemma \ref{divisors-lemma-blow-up-effective-Cartier-divisor}. The relationship $\mathfrak m = I + (x_1)$ implies that $\mathfrak m^n \subset I + (x_1^n)$ hence we can define a map $$ \psi : A[\textstyle{\frac{\mathfrak m}{x_1}}] \longrightarrow A/I $$ by sending $y/x_1^n \in A[\frac{\mathfrak m}{x_1}]$ to the class of $a$ in $A/I$ where $a$ is chosen such that $y \equiv ax_1^n \bmod I$. Then $\psi$ corresponds to the morphism of $Y \cap U$ into $X'$ over $U$ given by $Y' \cong Y$. Since the image of $x_1$ in $A[\frac{\mathfrak m}{x_1}]$ cuts out the exceptional divisor we conclude that $m_q(Y', E) = 1$. Finally, since $J \subset \mathfrak m$ implies that the ideal $J' \subset A[\frac{\mathfrak m}{x_1}]$ certainly contains the elements $f/x_1$ for $f \in J$. Thus if we choose $f \in J$ whose image $\overline{f}$ in $A/I$ has minimal valuation equal to $m_p(Y \cap Z)$, then we see that $\psi(f/x_1) = \overline{f}/x_1$ in $A/I$ has valuation one less proving the last part of the lemma.
It follows from Lemma \ref{lemma-blowup-curve} that we may assume $Y_i$ is a regular curve for $i = 1, \ldots, n$. For every $i \not = j$ and $p \in Y_i \cap Y_j$ we have the invariant $m_p(Y_i \cap Y_j)$ (\ref{equation-multiplicity}). If the maximum of these numbers is $> 1$, then we can decrease it (Lemma \ref{lemma-blowup-nonsingular-curves-meeting-at-point}) by blowing up in all the points $p$ where the maximum is attained. If the maximum is $1$ then we can separate the curves using the same lemma by blowing up in all these points $p$.
Let $D \subset Z$ be the largest effective Cartier divisor contained in $Z$. Then $\mathcal{I}_Z \subset \mathcal{I}_D$ and the quotient is supported in closed points by Divisors, Lemma \ref{divisors-lemma-codim-1-part}. Thus we can write $\mathcal{I}_Z = \mathcal{I}_{Z'} \mathcal{I}_D$ where $Z' \subset X$ is a closed subscheme which set theoretically consists of finitely many closed points. Applying Lemma \ref{lemma-make-ideal-principal} we find a sequence of blowups as in the statement of our lemma such that $\mathcal{I}_{Z'}\mathcal{O}_{X_n}$ is invertible. This proves the lemma.
Let $X' \to X$ be a blowup in a closed point $p$. Then the inverse image $Z' \subset X'$ of $Z$ is supported on the strict transform of $Z$ and the exceptional divisor. The exceptional divisor is a regular curve (Lemma \ref{lemma-blowup}) and the strict transform $Y'$ of each irreducible component $Y$ is either equal to $Y$ or the blowup of $Y$ at $p$. Thus in this process we do not produce additional singular components of dimension $1$. Thus it follows from Lemmas \ref{lemma-turn-into-effective-Cartier} and \ref{lemma-blowup-curves} that we may assume $Z$ is an effective Cartier divisor and that all irreducible components $Y$ of $Z$ are regular. (Of course we cannot assume the irreducible components are pairwise disjoint because in each blowup of a point of $Z$ we add a new irreducible component to $Z$, namely the exceptional divisor.) \medskip\noindent Assume $Z$ is an effective Cartier divisor whose irreducible components $Y_i$ are regular. For every $i \not = j$ and $p \in Y_i \cap Y_j$ we have the invariant $m_p(Y_i \cap Y_j)$ (\ref{equation-multiplicity}). If the maximum of these numbers is $> 1$, then we can decrease it (Lemma \ref{lemma-blowup-nonsingular-curves-meeting-at-point}) by blowing up in all the points $p$ where the maximum is attained (note that the ``new'' invariants $m_{q_i}(Y'_i \cap E)$ are always $1$). If the maximum is $1$ then, if $p \in Y_1 \cap \ldots \cap Y_r$ for some $r > 2$ and not any of the others (for example), then after blowing up $p$ we see that $Y'_1, \ldots, Y'_r$ do not meet in points above $p$ and $m_{q_i}(Y'_i, E) = 1$ where $Y'_i \cap E = \{q_i\}$. Thus continuing to blowup points where more than $3$ of the components of $Z$ meet, we reach the situation where for every closed point $p \in X$ there is either (a) no curves $Y_i$ passing through $p$, (b) exactly one curve $Y_i$ passing through $p$ and $\mathcal{O}_{Y_i, p}$ is regular, or (c) exactly two curves $Y_i$, $Y_j$ passing through $p$, the local rings $\mathcal{O}_{Y_i, p}$, $\mathcal{O}_{Y_j, p}$ are regular and $m_p(Y_i \cap Y_j) = 1$. This means that $\sum Y_i$ is a strict normal crossings divisor on the regular surface $X$, see \'Etale Morphisms, Lemma \ref{etale-lemma-strict-normal-crossings}.
Let $b : X \to X'$ be a contraction of $E$. As a topological space $X'$ is the quotient of $X$ by the relation identifying all points of $E$ to one point. Namely, $b$ is proper (Divisors, Lemma \ref{divisors-lemma-blowing-up-projective} and Morphisms, Lemma \ref{morphisms-lemma-locally-projective-proper}) and surjective, hence defines a submersive map of topological spaces (Topology, Lemma \ref{topology-lemma-closed-morphism-quotient-topology}). On the other hand, the canonical map $\mathcal{O}_{X'} \to b_*\mathcal{O}_X$ is an isomorphism. Namely, this is clear over the complement of the image point $x \in X'$ of $E$ and on stalks at $x$ the map is an isomorphism by part (4) of Lemma \ref{lemma-cohomology-of-blowup}. Thus the pair $(X', \mathcal{O}_{X'})$ is constructed from $X$ by taking the quotient as a topological space and endowing this with $b_*\mathcal{O}_X$ as structure sheaf. \medskip\noindent Given $\varphi$ we can let $\varphi' : X' \to Y$ be the unique map of topological spaces such that $\varphi = \varphi' \circ b$. Then the map $$ \varphi^\sharp : \varphi^{-1}\mathcal{O}_Y = b^{-1}((\varphi')^{-1}\mathcal{O}_Y) \to \mathcal{O}_X $$ is adjoint to a map $$ (\varphi')^\sharp : (\varphi')^{-1}\mathcal{O}_Y \to b_*\mathcal{O}_X = \mathcal{O}_{X'} $$ Then $(\varphi', (\varphi')^\sharp)$ is a morphism of ringed spaces from $X'$ to $Y$ such that we get the desired factorization. Since $\varphi$ is a morphism of locally ringed spaces, it follows that $\varphi'$ is too. Namely, the only thing to check is that the map $\mathcal{O}_{Y, y} \to \mathcal{O}_{X', x}$ is local, where $y \in Y$ is the image of $E$ under $\varphi$. This is true because an element $f \in \mathfrak m_y$ pulls back to a function on $X$ which is zero in every point of $E$ hence the pull back of $f$ to $X'$ is a function defined on a neighbourhood of $x$ in $X'$ with the same property. Then it is clear that this function must vanish at $x$ as desired.
Recall that there exists an isomorphism $\mathbf{P}^1_k \to E$ such that the normal sheaf of $E$ in $X$ pulls back to $\mathcal{O}(-1)$. Then $H^0(E, \mathcal{O}_E) = k$. We will denote $\mathcal{O}_n(iE)$ the restriction of the invertible sheaf $\mathcal{O}_X(iE)$ to $E_n$ for all $n \geq 1$ and $i \in \mathbf{Z}$. Recall that $\mathcal{O}_X(-nE)$ is the ideal sheaf of $E_n$. Hence for $d \geq 0$ we obtain a short exact sequence $$ 0 \to \mathcal{O}_E(-(d + n)E) \to \mathcal{O}_{n + 1}(-dE) \to \mathcal{O}_n(-dE) \to 0 $$ Since $\mathcal{O}_E(-(d + n)E) = \mathcal{O}_{\mathbf{P}^1_k}(d + n)$ the first cohomology group vanishes for all $d \geq 0$ and $n \geq 1$. We conclude that the transition maps of the system $H^0(E_n, \mathcal{O}_n(-dE))$ are surjective. For $d = 0$ we get an inverse system of surjections of rings such that the kernel of each transition map is a nilpotent ideal. Hence $A = \lim H^0(E_n, \mathcal{O}_n)$ is a local ring with residue field $k$ and maximal ideal $$ \lim \Ker(H^0(E_n, \mathcal{O}_n) \to H^0(E, \mathcal{O}_E)) = \lim H^0(E_n, \mathcal{O}_n(-E)) $$ Pick $x, y$ in this kernel mapping to a $k$-basis of $H^0(E, \mathcal{O}_E(-E)) = H^0(\mathbf{P}^1_k, \mathcal{O}(1))$. Then $x^d, x^{d - 1}y, \ldots, y^d$ are elements of $\lim H^0(E_n, \mathcal{O}_n(-dE))$ which map to a basis of $H^0(E, \mathcal{O}_E(-dE)) = H^0(\mathbf{P}^1_k, \mathcal{O}(d))$. In this way we see that $A$ is separated and complete with respect to the linear topology defined by the kernels $$ I_n = \Ker(A \longrightarrow H^0(E_n, \mathcal{O}_n)) $$ We have $x, y \in I_1$, $I_d I_{d'} \subset I_{d + d'}$ and $I_d/I_{d + 1}$ is a free $k$-module on $x^d, x^{d - 1}y, \ldots, y^d$. We will show that $I_d = (x, y)^d$. Namely, if $z_e \in I_e$ with $e \geq d$, then we can write $$ z_e = a_{e, 0} x^d + a_{e, 1} x^{d - 1}y + \ldots + a_{e, d}y^d + z_{e + 1} $$ where $a_{e, j} \in (x, y)^{e - d}$ and $z_{e + 1} \in I_{e + 1}$ by our description of $I_d/I_{d + 1}$. Thus starting with some $z = z_d \in I_d$ we can do this inductively $$ z = \sum\nolimits_{e \geq d} \sum\nolimits_j a_{e, j} x^{d - j} y^j $$ with some $a_{e, j} \in (x, y)^{e - d}$. Then $a_j = \sum_{e \geq d} a_{e, j}$ exists (by completeness and the fact that $a_{e, j} \in I_{e - d}$) and we have $z = \sum a_{e, j} x^{d - j} y^j$. Hence $I_d = (x, y)^d$. Thus $A$ is $(x, y)$-adically complete. Then $A$ is Noetherian by Algebra, Lemma \ref{algebra-lemma-completion-Noetherian}. It is clear that the dimension is $2$ by the description of $(x, y)^d/(x, y)^{d + 1}$ and Algebra, Proposition \ref{algebra-proposition-dimension}. Since the maximal ideal is generated by two elements it is regular.
Since $E = \mathbf{P}^1_k$ we see that the Picard group of $E$ is $\mathbf{Z}$, see Divisors, Lemma \ref{divisors-lemma-Pic-projective-space-UFD}. Hence we can think of the last map as $\mathcal{L} \mapsto \mathcal{L}|_E$. The degree of the restriction of $\mathcal{O}_X(E)$ to $E$ is $-1$ by definition of exceptional curves of the first kind. Combining these remarks we see that it suffices to show that $\Pic(X') \to \Pic(X)$ is injective with image the invertible sheaves restricting to $\mathcal{O}_E$ on $E$. \medskip\noindent Given an invertible $\mathcal{O}_{X'}$-module $\mathcal{L}'$ we claim the map $\mathcal{L}' \to b_*b^*\mathcal{L}'$ is an isomorphism. This is clear everywhere except possibly at the image point $x \in X'$ of $E$. To check it is an isomorphism on stalks at $x$ we may replace $X'$ by an open neighbourhood at $x$ and assume $\mathcal{L}'$ is $\mathcal{O}_{X'}$. Then we have to show that the map $\mathcal{O}_{X'} \to b_*\mathcal{O}_X$ is an isomorphism. This follows from Lemma \ref{lemma-cohomology-of-blowup} part (4). \medskip\noindent Let $\mathcal{L}$ be an invertible $\mathcal{O}_X$-module with $\mathcal{L}|_E = \mathcal{O}_E$. Then we claim  (1) $b_*\mathcal{L}$ is invertible and (2) $b^*b_*\mathcal{L} \to \mathcal{L}$ is an isomorphism. Statements (1) and (2) are clear over $X' \setminus \{x\}$. Thus it suffices to prove (1) and (2) after base change to $\Spec(\mathcal{O}_{X', x})$. Computing $b_*$ commutes with flat base change (Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}) and similarly for $b^*$ and formation of the adjunction map. But if $X'$ is the spectrum of a regular local ring then $\mathcal{L}$ is trivial by the description of the Picard group in Lemma \ref{lemma-blowup-pic}. Thus the claim is proved. \medskip\noindent Combining the claims proved in the previous two paragraphs we see that the map $\mathcal{L} \mapsto b_*\mathcal{L}$ is an inverse to the map $$ \Pic(X') \longrightarrow \Ker(\Pic(X) \to \Pic(E)) $$ and the lemma is proved.
Observe that $\mathcal{L}|_E = \mathcal{O}(n)$ by Divisors, Lemma \ref{divisors-lemma-Pic-projective-space-UFD}. Use induction, the long exact cohomology sequence associated to the short exact sequence $$ 0 \to \mathcal{L} \to \mathcal{L}(E) \to \mathcal{L}(E)|_E \to 0, $$ and use the fact that $H^1(\mathbf{P}^1, \mathcal{O}(d)) = 0$ for $d \geq -1$ and $H^0(\mathbf{P}^1, \mathcal{O}(d)) = 0$ for $d \leq -1$. Some details omitted.
Both cases follow from Lemma \ref{lemma-contract-ample} using standard results on ample invertible modules and (quasi-)projective morphisms. \medskip\noindent Proof of (2). Projectivity of $f$ means that $f$ is proper and there exists an $f$-ample invertible module $\mathcal{L}$, see Morphisms, Lemma \ref{morphisms-lemma-projective-is-quasi-projective-proper} and Definition \ref{morphisms-definition-quasi-projective}. Let $U \subset S$ be an affine open containing the image of $E$. By Lemma \ref{lemma-contract-ample} there exists a contraction $c : f^{-1}(U) \to V'$ of $E$ and an ample invertible module $\mathcal{N}'$ on $V'$ whose pullback to $f^{-1}(U)$ is equal to $\mathcal{L}(nE)|_{f^{-1}(U)}$. Let $v \in V'$ be the closed point such that $c$ is the blowing up of $v$. Then we can glue $V'$ and $X \setminus E$ along $f^{-1}(U) \setminus E = V' \setminus \{v\}$ to get a scheme $X'$ over $S$. The morphisms $c$ and $\text{id}_{X \setminus E}$ glue to a morphism $b : X \to X'$ which is the contraction of $E$. The inverse image of $U$ in $X'$ is proper over $U$. On the other hand, the restriction of $X' \to S$ to the complement of the image of $v$ in $S$ is isomorphic to the restriction of $X \to S$ to that open. Hence $X' \to S$ is proper (as being proper is local on the base by Morphisms, Lemma \ref{morphisms-lemma-proper-local-on-the-base}). Finally, $\mathcal{N}'$ and $\mathcal{L}|_{X \setminus E}$ restrict to isomorphic invertible modules over $f^{-1}(U) \setminus E = V' \setminus \{v\}$ and hence glue to an invertible module $\mathcal{L}'$ over $X'$. The restriction of $\mathcal{L}'$ to the inverse image of $U$ in $X'$ is ample because this is true for $\mathcal{N}'$. For affine opens of $S$ avoiding the image of $v$, we see that the same is true because it holds for $\mathcal{L}$. Thus $\mathcal{L}'$ is $(X' \to S)$-relatively ample by Morphisms, Lemma \ref{morphisms-lemma-characterize-relatively-ample} and (2) is proved. \medskip\noindent Proof of (3). We can write $X$ as an open subscheme of a scheme $\overline{X}$ projective over $S$ by Morphisms, Lemma \ref{morphisms-lemma-quasi-projective-open-projective}. By (2) there is a contraction $b : \overline{X} \to \overline{X}'$ and $\overline{X}'$ is projective over $S$. Then we let $X' \subset \overline{X}$ be the image of $X \to \overline{X}'$; this is an open as $b$ is an isomorphism away from $E$. Then $X \to X'$ is the desired contraction. Note that $X'$ is quasi-projective over $S$ as it has an $S$-relatively ample invertible module by the construction in the proof of part (2).
By Chow's lemma (Cohomology of Schemes, Lemma \ref{coherent-lemma-chow-Noetherian}) there exists a proper morphism $\pi : X' \to X$ which is an isomorphism over a dense open $U \subset X$ such that $X' \to S$ is H-quasi-projective. By Lemma \ref{lemma-extend-rational-map-blowing-up} there exists a sequence of blowups in closed points $$ X_n \to \ldots \to X_1 \to X_0 = X $$ and an $S$-morphism $X_n \to X'$ extending the rational map $U \to X'$. Observe that $X_n \to X$ is projective by Divisors, Lemma \ref{divisors-lemma-blowing-up-projective} and Morphisms, Lemma \ref{morphisms-lemma-composition-projective}. This implies that $X_n \to X'$ is projective by Morphisms, Lemma \ref{morphisms-lemma-projective-permanence}. Hence $X_n \to S$ is quasi-projective by Morphisms, Lemma \ref{morphisms-lemma-composition-quasi-projective} (and the fact that a projective morphism is quasi-projective, see Morphisms, Lemma \ref{morphisms-lemma-projective-quasi-projective}). By Lemma \ref{lemma-contract-when-quasi-projective} (and uniqueness of contractions Lemma \ref{lemma-contraction-unique}) we conclude  that $X_{n - 1}, \ldots, X_0 = X$ are quasi-projective over $S$ as desired.
Let $U \subset X$ be open and let $f : U \to Y$ be the given $S$-rational map (which is invertible as an $S$-rational map). By Lemma \ref{lemma-extend-rational-map-blowing-up} we can factor $f$ as $X_n \to \ldots \to X_1 \to X_0 = X$ and $f_n : X_n \to Y$. Since $X_n$ is proper over $S$ and $Y$ separated over $S$ the morphism $f_n$ is proper. Clearly $f_n$ is birational. Hence $f_n$ is a composition of contractions by Lemma \ref{lemma-proper-birational-regular-surfaces}. We omit the proof of the converse.
In this proof we will use the identification $D(A) = D_\QCoh(\mathcal{O}_S)$ to identify quasi-coherent $\mathcal{O}_S$-modules with $A$-modules. Moreover, we may assume that $\omega_A^\bullet$ is normalized, see Dualizing Complexes, Section \ref{dualizing-section-dualizing-local}. Since $X$ is a Noetherian normal $2$-dimensional scheme it is Cohen-Macaulay (Properties, Lemma \ref{properties-lemma-normal-dimension-2-Cohen-Macaulay}). Thus $\omega_X^\bullet = \omega_X[2]$ (Duality for Schemes, Lemma \ref{duality-lemma-dualizing-module-CM-scheme} and the normalization in Duality for Schemes, Example \ref{duality-example-proper-over-local}). If the proposition is false, then we can find a nonzero map $R^1f_*\omega_X \to \kappa$. In other words we obtain a nonzero map $\alpha : Rf_*\omega_X^\bullet \to \kappa[1]$. Applying $R\Hom_A(-, \omega_A^\bullet)$ we get a nonzero map $$ \beta : \kappa[-1] \longrightarrow Rf_*\mathcal{O}_X $$ which is impossible by Lemma \ref{lemma-R1-injective}. To see that $R\Hom_A(-, \omega_A^\bullet)$ does what we said, first note that $$ R\Hom_A(\kappa[1], \omega_A^\bullet) = R\Hom_A(\kappa, \omega_A^\bullet)[-1] = \kappa[-1] $$ as $\omega_A^\bullet$ is normalized and we have $$ R\Hom_A(Rf_*\omega_X^\bullet, \omega_A^\bullet) = Rf_*R\SheafHom_{\mathcal{O}_X}(\omega_X^\bullet, \omega_X^\bullet) = Rf_*\mathcal{O}_X $$ The first equality by Duality for Schemes, Example \ref{duality-example-iso-on-RSheafHom-noetherian} and the fact that $\omega_X^\bullet = f^!\omega_A^\bullet$ by construction, and the second equality because $\omega_X^\bullet$ is a dualizing complex for $X$ (which goes back to Duality for Schemes, Lemma \ref{duality-lemma-shriek-dualizing}).
Assume $U \to X$ is surjective \'etale where $U$ is a scheme. Let $V \to X$ be an \'etale morphism where $V$ is a scheme. Then $$ U \leftarrow U \times_X V \rightarrow V $$ are \'etale morphisms of schemes with the arrow to $V$ surjective. Hence we can use Duality for Schemes, Lemma \ref{duality-lemma-descent-ascent} to see that if $K|_U$ is a dualizing complex for $U$, then $K|_V$ is a dualizing complex for $V$.
By Duality for Schemes, Lemma \ref{duality-lemma-affine-duality} we have a canonical isomorphism $$ \widetilde{R\Hom_A(K, L)} = R\SheafHom_{\mathcal{O}_X}(\widetilde{K}, \widetilde{L}) $$ in $D(\mathcal{O}_X)$. There is a canonical map $$ \epsilon^*R\Hom_{\mathcal{O}_X}(\widetilde{K}, \widetilde{L}) \longrightarrow R\SheafHom_{\mathcal{O}_\etale}(\epsilon^*\widetilde{K}, \epsilon^*\widetilde{L}) $$ in $D(\mathcal{O}_\etale)$, see Cohomology on Sites, Remark \ref{sites-cohomology-remark-prepare-fancy-base-change}. We will show the left and right hand side of this arrow have isomorphic cohomology sheaves, but we will omit the verification that the isomorphism is given by this arrow. \medskip\noindent We may assume that $L$ is given by a finite complex $I^\bullet$ of injective $A$-modules. By induction on the length of $I^\bullet$ and compatibility of the constructions with distinguished triangles, we reduce to the case that $L = I[0]$ where $I$ is an injective $A$-module. Recall that the cohomology sheaves of $R\SheafHom_{\mathcal{O}_\etale}(\epsilon^*\widetilde{K}, \epsilon^*\widetilde{L}))$ are the sheafifications of the presheaf sending $U$ \'etale over $X$ to the $i$th ext group between the restrictions of $\epsilon^*\widetilde{K}$ and $\epsilon^*\widetilde{L}$ to $U_\etale$. See Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-section-RHom-over-U}. If $U = \Spec(B)$ is affine, then this ext group is equal to $\text{Ext}^i_B(K \otimes_A B, L \otimes_A B)$ by the equivalence of Derived Categories of Spaces, Lemma \ref{spaces-perfect-lemma-derived-quasi-coherent-small-etale-site} and Derived Categories of Schemes, Lemma \ref{perfect-lemma-affine-compare-bounded} (this also uses the compatibilities detailed in Derived Categories of Spaces, Remark \ref{spaces-perfect-remark-match-total-direct-images}). Since $A \to B$ is \'etale, we see that $I \otimes_A B$ is an injective $B$-module by Dualizing Complexes, Lemma \ref{dualizing-lemma-injective-goes-up}. Hence we see that \begin{align*} \Ext^n_B(K \otimes_A B, I \otimes_A B) & = \Hom_B(H^{-n}(K \otimes_A B), I \otimes_A B) \\ & = \Hom_{A_f}(H^{-n}(K) \otimes_A B, I \otimes_A B) \\ & = \Hom_A(H^{-n}(K), I) \otimes_A B \\ & = \text{Ext}^n_A(K, I) \otimes_A B \end{align*} The penultimate equality because $H^{-n}(K)$ is a finite $A$-module, see More on Algebra, Lemma \ref{more-algebra-lemma-pseudo-coherence-and-base-change-ext}. Therefore the cohomology sheaves of the left and right hand side of the equality in the lemma are the same.