hcju/stacksqa huggingface dataset:
We replace $S$ by $\Spec(\mathcal{O}_{S, s})$ and $T$ by the base change to $\Spec(\mathcal{O}_{S, s})$. Then $T$ is locally Noetherian and hence $\mathcal{O}_{T, t}$ is Noetherian. Set $A = \mathcal{O}_{S, s}^\wedge$, $\mathfrak m = \mathfrak m_A$, and $B = \mathcal{O}_{T, t}^\wedge$. By More on Algebra, Lemma \ref{more-algebra-lemma-flat-completion} we see that $A \to B$ is flat. Since $\mathcal{O}_{T, t}/\mathfrak m_s \mathcal{O}_{T, t} = \mathcal{O}_{T_s, t}$ we see that $B/\mathfrak m B = \mathcal{O}_{T_s, t}^\wedge$. By assumption (4) and Lemma \ref{lemma-split-node} we conclude there exist $\overline{u}, \overline{v} \in B/\mathfrak m B$ such that the map $$ (A/\mathfrak m)[[x, y]] \longrightarrow B/\mathfrak m B,\quad x \longmapsto \overline{u}, x \longmapsto \overline{v} $$ is surjective with kernel $(xy)$. \medskip\noindent Assume we have $n \geq 1$ and $u, v \in B$ mapping to $\overline{u}, \overline{v}$ such that $$ u v = h + \delta $$ for some $h \in A$ and $\delta \in \mathfrak m^nB$. We claim that there exist $u', v' \in B$ with $u - u', v - v' \in \mathfrak m^n B$ such that $$ u' v' = h' + \delta' $$ for some $h' \in A$ and $\delta' \in \mathfrak m^{n + 1}B$. To see this, write $\delta = \sum f_i b_i$ with $f_i \in \mathfrak m^n$ and $b_i \in B$. Then write $b_i = a_i + u b_{i, 1} + v b_{i, 2} + \delta_i$ with $a_i \in A$, $b_{i, 1}, b_{i, 2} \in B$ and $\delta_i \in \mathfrak m B$. This is possible because the residue field of $B$ agrees with the residue field of $A$ and the images of $u$ and $v$ in $B/\mathfrak m B$ generate the maximal ideal. Then we set $$ u' = u - \sum b_{i, 2}f_i,\quad v' = v - \sum b_{i, 1}f_i $$ and we obtain $$ u'v' = h + \delta - \sum (b_{i, 1}u + b_{i, 2}v)f_i + \sum c_{ij}f_if_j = h + \sum a_if_i + \sum f_i \delta_i + \sum c_{ij}f_if_j $$ for some $c_{i, j} \in B$. Thus we get a formula as above with $h' = h + \sum a_if_i$ and $\delta' = \sum f_i \delta_i + \sum c_{ij}f_if_j$. \medskip\noindent Arguing by induction and starting with any lifts $u_1, v_1 \in B$ of $\overline{u}, \overline{v}$ the result of the previous paragraph shows that we find a sequence of elements $u_n, v_n \in B$ and $h_n \in A$ such that $u_n - u_{n + 1} \in \mathfrak m^n B$, $v_n - v_{n + 1} \in \mathfrak m^n B$, $h_n - h_{n + 1} \in \mathfrak m^n$, and such that $u_n v_n - h_n \in \mathfrak m^n B$. Since $A$ and $B$ are complete we can set $u_\infty = \lim u_n$, $v_\infty = \lim v_n$,  and $h_\infty = \lim h_n$, and then we obtain $u_\infty v_\infty = h_\infty$ in $B$. Thus we have an $A$-algebra map $$ A[[x, y]]/(xy - h_\infty) \longrightarrow B $$ sending $x$ to $u_\infty$ and $v$ to $v_\infty$. This is a map of flat $A$-algebras which is an isomorphism after dividing by $\mathfrak m$. It is surjective modulo $\mathfrak m$ and hence surjective by completeness and Algebra, Lemma \ref{algebra-lemma-completion-generalities}. Then we can apply Algebra, Lemma \ref{algebra-lemma-mod-injective} to conclude it is an isomorphism.
Any curve, e.g.\ $X$, is Cohen-Macaulay. If $H^1(X, \mathcal{I}\mathcal{L})$ is nonzero, then there is a nonzero map $\mathcal{I}\mathcal{L} \to \omega_X$, see Lemma \ref{lemma-duality-dim-1-CM}. Since $\mathcal{I}\mathcal{L}$ is torsion free, this map is injective. Since a field is Gorenstein and $X$ is reduced, we find that the Gorenstein locus $U \subset X$ of $X$ is nonempty, see Duality for Schemes, Lemma \ref{duality-lemma-gorenstein}. This lemma also tells us that $\omega_X|_U$ is invertible. In this way we see we have a short exact sequence $$ 0 \to \mathcal{I}\mathcal{L} \to \omega_X \to \mathcal{Q} \to 0 $$ where the support of $\mathcal{Q}$ is zero dimensional. Hence we have \begin{align*} 0 & \leq \dim \Gamma(X, \mathcal{Q})\\ & = \chi(\mathcal{Q}) \\ & = \chi(\omega_X) - \chi(\mathcal{I}\mathcal{L}) \\ & = \chi(\omega_X) - \deg(\mathcal{L}) - \chi(\mathcal{I}) \\ & = 2g - 2 - \deg(\mathcal{L}) + \deg(Z) \end{align*} by Lemmas \ref{lemma-euler} and \ref{lemma-rr}, by (\ref{equation-genus}), and by Varieties, Lemmas \ref{varieties-lemma-chi-tensor-finite} and \ref{varieties-lemma-degree-on-proper-curve}. We have also used that $\deg(Z) = \dim_k \Gamma(Z, \mathcal{O}_Z) = \chi(\mathcal{O}_Z)$ and the short exact sequence $0 \to \mathcal{I} \to \mathcal{O}_X \to \mathcal{O}_Z \to 0$. The lemma follows.
The vanishing of $H^1(X, \mathcal{I}\mathcal{L})$ follows from Lemma \ref{lemma-h1-nonzero-degree-leq-2g-2}. If $H^0(X, \mathcal{I}\mathcal{L}) = 0$, then $\chi(\mathcal{I}\mathcal{L}) = 0$. From the short exact sequence $0 \to \mathcal{I}\mathcal{L} \to \mathcal{L} \to \mathcal{O}_Z \to 0$ we conclude $\deg(\mathcal{L}) = g - 1 + \deg(Z)$. Thus $g - 1 + \deg(Z) > 2g - 2 + \deg(Z)$ which implies $g = 0$ hence (2) holds. If $Z = \emptyset$ in case (2), then $\mathcal{L}^{-1}$ is an invertible sheaf of degree $1$. This implies there is an isomorphism $X \to \mathbf{P}^1_k$ and $\mathcal{L}^{-1}$ is the pullback of $\mathcal{O}_{\mathbf{P}^1}(1)$ by Lemma \ref{lemma-genus-zero-positive-degree}.
Let $Z \subset X$ be the closed subscheme cut out by the global sections of $\mathcal{L}$. By Lemma \ref{lemma-degree-more-than-2g-2} we see that $Z \not = X$. Let $\mathcal{I} \subset \mathcal{O}_X$ be the ideal sheaf cutting out $Z$. Consider the short exact sequence $$ 0 \to \mathcal{I}\mathcal{L} \to \mathcal{L} \to \mathcal{O}_Z \to 0 $$ If $Z \not = \emptyset$, then $H^1(X, \mathcal{I}\mathcal{L})$ is nonzero as follows from the long exact sequence of cohomology. By Lemma \ref{lemma-duality-dim-1-CM} this gives a nonzero and hence injective map $$ \mathcal{I}\mathcal{L} \longrightarrow \omega_X $$ In particular, we find an injective map $H^0(X, \mathcal{L}) = H^0(X, \mathcal{I}\mathcal{L}) \to H^0(X, \omega_X)$. This is impossible as $$ \dim_k H^0(X, \mathcal{L}) = \dim_k H^1(X, \mathcal{L}) + \deg(\mathcal{L}) + 1 - g \geq g + 1 $$ and $\dim H^0(X, \omega_X) = g$ by (\ref{equation-genus}).
Global generation by Lemma \ref{lemma-degree-more-than-2g}. If $\mathcal{I} \subset \mathcal{O}_X$ is the ideal sheaf of $Z$, then $H^1(X, \mathcal{I}\mathcal{L}) = 0$ by Lemma \ref{lemma-h1-nonzero-degree-leq-2g-2}. Hence surjectivity.
If $H^1(X, \mathcal{I}\mathcal{L})$ is nonzero, then there is a nonzero map $\varphi : \mathcal{I}\mathcal{L} \to \omega_X$, see Lemma \ref{lemma-duality-dim-1-CM}. Let $Y \subset X$ be the union of the irreducible components $C$ of $X$ such that $\varphi$ is nonzero in the generic point of $C$. Then $Y$ is a reduced closed subscheme. Let $\mathcal{J} \subset \mathcal{O}_X$ be the ideal sheaf of $Y$. Since $\mathcal{J}\mathcal{I}\mathcal{L}$ has no embedded associated points (as a submodule of $\mathcal{L}$) and as $\varphi$ is zero in the generic points of the support of $\mathcal{J}$ (by choice of $Y$ and as $X$ is reduced), we find that $\varphi$ factors as $$ \mathcal{I}\mathcal{L} \to \mathcal{I}\mathcal{L}/\mathcal{J}\mathcal{I}\mathcal{L} \to \omega_X $$ We can view $\mathcal{I}\mathcal{L}/\mathcal{J}\mathcal{I}\mathcal{L}$ as the pushforward of a coherent sheaf on $Y$ which by abuse of notation we indicate with the same symbol. Since $\omega_Y = \SheafHom(\mathcal{O}_Y, \omega_X)$ by Lemma \ref{lemma-closed-immersion-dim-1-CM} we find a map $$ \mathcal{I}\mathcal{L}/ \mathcal{J}\mathcal{I}\mathcal{L}  \to \omega_Y $$ of $\mathcal{O}_Y$-modules which is injective in the generic points of $Y$. Let $\mathcal{I}' \subset \mathcal{O}_Y$ be the ideal sheaf of $Z \cap Y$. There is a map $\mathcal{I}\mathcal{L}/\mathcal{J}\mathcal{I}\mathcal{L} \to \mathcal{I}'\mathcal{L}|_Y$ whose kernel is supported in closed points. Since $\omega_Y$ is a Cohen-Macaulay module, the map above factors through an injective map $\mathcal{I}'\mathcal{L}|_Y \to \omega_Y$. We see that we get an exact sequence $$ 0 \to \mathcal{I}'\mathcal{L}|_Y \to \omega_Y \to \mathcal{Q} \to 0 $$ of coherent sheaves on $Y$ where $\mathcal{Q}$ is supported in dimension $0$ (this uses that $\omega_Y$ is an invertible module in the generic points of $Y$). We conclude that $$ 0 \leq \dim \Gamma(Y, \mathcal{Q}) = \chi(\mathcal{Q}) = \chi(\omega_Y) - \chi(\mathcal{I}'\mathcal{L}) = -2\chi(\mathcal{O}_Y) - \deg(\mathcal{L}|_Y) + \deg(Z \cap Y) $$ by Lemma \ref{lemma-euler} and Varieties, Lemma \ref{varieties-lemma-chi-tensor-finite}. If $Y$ is connected, then this proves the lemma. If not, then we repeat the last part of the argument for one of the connected components of $Y$.
Let $X' \subset X$ be as in the example. Then we have a short exact sequence $$ 0 \to \omega_C \to \omega_X|_C \to \mathcal{O}_{C \cap X'} \to 0 $$ See Lemmas \ref{lemma-closed-subscheme-reduced-gorenstein}, \ref{lemma-facts-about-nodal-curves}, and \ref{lemma-closed-subscheme-nodal-curve}. With $k'$ as in the example we see that $\deg(\omega_C) = -2[k' : k]$ as $C \cong \mathbf{P}^1_{k'}$ by Proposition \ref{proposition-projective-line} and $\deg(C \cap X') = [k' : k]$. Hence $\deg(\omega_X|_C) = -[k' : k]$ which is negative.
Let $x \in C$ and $k' = \kappa(x)$ be as in the example. Observe that $C \cong \mathbf{P}^1_{k'}$ by Proposition \ref{proposition-projective-line}. Since $k'/k$ is finite separable, we see that $k' \otimes_k K = K'_1 \times \ldots \times K'_n$ is a finite product of finite separable extensions $K'_i/K$. Set $C_i = \mathbf{P}^1_{K'_i}$ and denote $x_i \in C_i$ the inverse image of $x$. Then $C_K = \coprod C_i$ and $X'_K \cap C_i = x_i$ as desired.
Let $Y \subset X$ be as in the statement. Then $k' = H^0(Y, \mathcal{O}_Y)$ is a field and a finite extension of $k$ and $[k' : k]$ divides all numerical invariants below associated to $Y$ and coherent sheaves on $Y$, see Varieties, Lemma \ref{varieties-lemma-divisible}. Let $Z \subset X$ be as in Lemma \ref{lemma-closed-subscheme-reduced-gorenstein}. We will use the results of this lemma and of Lemmas \ref{lemma-facts-about-nodal-curves} and \ref{lemma-closed-subscheme-nodal-curve} without further mention. Then we get a short exact sequence $$ 0 \to \omega_Y \to \omega_X|_Y \to \mathcal{O}_{Y \cap Z} \to 0 $$ See Lemma \ref{lemma-closed-subscheme-reduced-gorenstein}. We conclude that $$ \deg(\omega_X|_Y) = \deg(Y \cap Z) + \deg(\omega_Y) = \deg(Y \cap Z) - 2\chi(Y, \mathcal{O}_Y) $$ Hence, if the lemma is false, then $$ 2[k' : k] > \deg(Y \cap Z) + \dim_k H^1(Y, \mathcal{O}_Y) $$ Since $Y \cap Z$ is nonempty and by the divisiblity mentioned above, this can happen only if $Y \cap Z$ is a single $k'$-rational point of the smooth locus of $Y$ and $H^1(Y, \mathcal{O}_Y) = 0$. If $Y$ is irreducible, then this implies $Y$ is a rational tail. If $Y$ is reducible, then since $\deg(\omega_X|_Y) = -[k' : k]$ we find there is some irreducible component $C$ of $Y$ such that $\deg(\omega_X|_C) < 0$, see Varieties, Lemma \ref{varieties-lemma-degree-in-terms-of-components}. Then the analysis above applied to $C$ gives that $C$ is a rational tail.
By Lemma \ref{lemma-facts-about-nodal-curves} we find that $X$ is Gorenstein, i.e., $\omega_X$ is an invertible $\mathcal{O}_X$-module. \medskip\noindent If the genus of $X$ is zero, then $\deg(\omega_X) < 0$, hence if $X$ has more than one irreducible component, we get a contradiction with Lemma \ref{lemma-no-rational-tail}. In the irreducible case we see that $X$ is isomorphic to an irreducible plane conic and $\omega_X^{\otimes -1}$ is very ample by Lemma \ref{lemma-genus-zero}. \medskip\noindent If the genus of $X$ is $1$, then $\omega_X$ has a global section and $\deg(\omega_X|_C) = 0$ for all irreducible components. Namely, $\deg(\omega_X|_C) \geq 0$ for all irreducible components $C$ by Lemma \ref{lemma-no-rational-tail}, the sum of these numbers is $0$ by Lemma \ref{lemma-genus-gorenstein}, and we can apply Varieties, Lemma \ref{varieties-lemma-degree-in-terms-of-components}. Then $\omega_X \cong \mathcal{O}_X$ by Varieties, Lemma \ref{varieties-lemma-no-sections-dual-nef}. \medskip\noindent Assume the genus $g$ of $X$ is greater than or equal to $2$. If $X$ is irreducible, then we are done by Lemma \ref{lemma-degree-more-than-2g}. Assume $X$ reducible. By Lemma \ref{lemma-no-rational-tail} the inequalities of Lemma \ref{lemma-global-generation} hold for every $Y \subset X$ as in the statement, except for $Y = X$. Analyzing the proof of Lemma \ref{lemma-global-generation} we see that (in the reducible case) the only inequality used for $Y = X$ are $$ \deg(\omega_X^{\otimes m}) > -2 \chi(\mathcal{O}_X) \quad\text{and}\quad \deg(\omega_X^{\otimes m}) + \chi(\mathcal{O}_X) > \dim_k H^1(X, \mathcal{O}_X) $$ Since these both hold under the assumption $g \geq 2$ and $m \geq 2$ we win.
We proceed by contracting rational tails until there are none left. Then we see that (1), (2), (3) hold by Lemma \ref{lemma-no-rational-tail-semiample-genus-geq-2}. \medskip\noindent Uniqueness. To see that $f : X \to X'$ is independent of the choices made, it suffices to show: any rational tail $C \subset X$ is mapped to a point by $X \to X'$; some details omitted. If not, then we can find a section $s \in \Gamma(X', \omega_{X'}^{\otimes 2})$ which does not vanish in the generic point of the irreducible component $f(C)$. Since in each of the contractions $X_i \to X_{i + 1}$ we have a section $X_{i + 1} \to X_i$, there is a section $X' \to X$ of $f$. Then we have an exact sequence $$ 0 \to \omega_{X'} \to \omega_X \to \omega_X|_{X''} \to 0 $$ where $X'' \subset X$ is the union of the irreducible components contracted by $f$. See Lemma \ref{lemma-closed-subscheme-reduced-gorenstein}. Thus we get a map $\omega_{X'}^{\otimes 2} \to \omega_X^{\otimes 2}$ and we can take the image of $s$ to get a section of $\omega_X^{\otimes 2}$ not vanishing in the generic point of $C$. This is a contradiction with the fact that the restriction of $\omega_X$ to a rational tail has negative degree (Lemma \ref{lemma-rational-tail-negative}). \medskip\noindent The statement on base field extensions follows from Lemma \ref{lemma-rational-tail-field-extension}. Some details omitted.
Let $X' \subset X$ be as in the example. Then we have a short exact sequence $$ 0 \to \omega_C \to \omega_X|_C \to \mathcal{O}_{C \cap X'} \to 0 $$ See Lemmas \ref{lemma-closed-subscheme-reduced-gorenstein}, \ref{lemma-facts-about-nodal-curves}, and \ref{lemma-closed-subscheme-nodal-curve}. With $k''/k'/k$ as in the example we see that $\deg(\omega_C) = -2[k' : k]$ as $C$ has genus $0$ (Lemma \ref{lemma-rr}) and $\deg(C \cap X') = [k'' : k] = 2[k' : k]$. Hence $\deg(\omega_X|_C) = 0$.
You can prove this by direct computation, but we prefer to use the characterization of $\omega_X$ as the coherent $\mathcal{O}_X$-module which represents the functor $\textit{Coh}(\mathcal{O}_X) \to \textit{Sets}$, $\mathcal{F} \mapsto \Hom_k(H^1(X, \mathcal{F}), k) = H^1(X, \mathcal{F})^\vee$, see Lemma \ref{lemma-duality-dim-1-CM} or Duality for Schemes, Lemma \ref{duality-lemma-dualizing-module-proper-over-A}. \medskip\noindent To be precise, denote $\mathcal{C}_Y$ the category whose objects are invertible $\mathcal{O}_Y$-modules and whose maps are $\mathcal{O}_Y$-module homomorphisms. Denote $\mathcal{C}_X$ the category whose objects are invertible $\mathcal{O}_X$-modules $\mathcal{L}$ with $\mathcal{L}|_C \cong \mathcal{O}_C$ and whose maps are $\mathcal{O}_Y$-module homomorphisms. We claim that the functor $$ c^* : \mathcal{C}_Y \to \mathcal{C}_X $$ is an equivalence of categories. Namely, by More on Morphisms, Lemma \ref{more-morphisms-lemma-bijection-on-Pic} it is essentially surjective. Then the projection formula (Cohomology, Lemma \ref{cohomology-lemma-projection-formula}) shows $c_*c^*\mathcal{N} = \mathcal{N}$ and hence $c^*$ is an equivalence with quasi-inverse given by $c_*$. \medskip\noindent We claim $\omega_X$ is an object of $\mathcal{C}_X$. Namely, we have a short exact sequence $$ 0 \to \omega_C \to \omega_X|_C \to \mathcal{O}_{C \cap X'} \to 0 $$ See Lemma \ref{lemma-closed-subscheme-reduced-gorenstein}. Taking degrees we find $\deg(\omega_X|_C) = 0$ (small detail omitted). Thus $\omega_X|_C$ is trivial by Lemma \ref{lemma-genus-zero-pic} and $\omega_X$ is an object of $\mathcal{C}_X$. \medskip\noindent Since $R^1c_*\mathcal{O}_X = 0$ the projection formula shows that $R^1c_*c^*\mathcal{N} = 0$ for $\mathcal{N} \in \Ob(\mathcal{C}_Y)$. Therefore the Leray spectral sequence (Cohomology, Lemma \ref{cohomology-lemma-apply-Leray}) the diagram $$ \xymatrix{ \mathcal{C}_Y \ar[rr]_{c^*} \ar[dr]_{H^1(Y, -)^\vee} & & \mathcal{C}_X \ar[ld]^{H^1(X, -)^\vee} \\ & \textit{Sets} } $$ of categories and functors is commutative. Since $\omega_Y \in \Ob(\mathcal{C}_Y)$ represents the south-east arrow and $\omega_X \in \Ob(\mathcal{C}_X)$ represents the south-east arrow we conclude by the Yoneda lemma (Categories, Lemma \ref{categories-lemma-yoneda}).
It suffices to show that $\deg(\omega_X|_C) > 0$ for every irreducible component $C$ of $X$, see Varieties, Lemma \ref{varieties-lemma-ampleness-in-terms-of-degrees-components}. If $X = C$ is irreducible, this follows from $g \geq 2$ and Lemma \ref{lemma-genus-gorenstein}. Otherwise, set $k' = H^0(C, \mathcal{O}_C)$. This is a field and a finite extension of $k$ and $[k' : k]$ divides all numerical invariants below associated to $C$ and coherent sheaves on $C$, see Varieties, Lemma \ref{varieties-lemma-divisible}. Let $X' \subset X$ be the closure of $X \setminus C$ as in Lemma \ref{lemma-closed-subscheme-reduced-gorenstein}. We will use the results of this lemma and of Lemmas \ref{lemma-facts-about-nodal-curves} and \ref{lemma-closed-subscheme-nodal-curve} without further mention. Then we get a short exact sequence $$ 0 \to \omega_C \to \omega_X|_C \to \mathcal{O}_{C \cap X'} \to 0 $$ See Lemma \ref{lemma-closed-subscheme-reduced-gorenstein}. We conclude that $$ \deg(\omega_X|_C) = \deg(C \cap X') + \deg(\omega_C) = \deg(C \cap X') - 2\chi(C, \mathcal{O}_C) $$ Hence, if the lemma is false, then $$ 2[k' : k] \geq \deg(C \cap X') + 2\dim_k H^1(C, \mathcal{O}_C) $$ Since $C \cap X'$ is nonempty and by the divisiblity mentioned above, this can happen only if either \begin{enumerate} \item[(a)] $C \cap X'$ is a single $k'$-rational point of $C$ and $H^1(C, \mathcal{O}_C) = 0$, and \item[(b)] $C \cap X'$ has degree $2$ over $k'$ and $H^1(C, \mathcal{O}_C) = 0$. \end{enumerate} The first possibility means $C$ is a rational tail and the second that $C$ is a rational bridge. Since both are excluded the proof is complete.
We proceed by contracting rational bridges until there are none left. Then $\omega_{X'}$ is ample by Lemma \ref{lemma-no-rational-bridge-ample-genus-geq-2}. \medskip\noindent Denote $f : X \to X'$ the composition. By Lemma \ref{lemma-rational-bridge-canonical} and induction we see that $f^*\omega_{X'} = \omega_X$. We have $f_*\mathcal{O}_X = \mathcal{O}_{X'}$ because this is true for contraction of a rational bridge. Thus the projection formula says that $f_*f^*\mathcal{L} = \mathcal{L}$ for all invertible $\mathcal{O}_{X'}$-modules $\mathcal{L}$. Hence $$ \Gamma(X', \omega_{X'}^{\otimes m}) = \Gamma(X, \omega_X^{\otimes m}) $$ for all $m$. Since $X'$ is the Proj of the direct sum of these by Morphisms, Lemma \ref{morphisms-lemma-proper-ample-is-proj} we conclude that the morphism $X \to X'$ is completely canonical. \medskip\noindent Let $K/k$ be an extension of fields, then $\omega_{X_K}$ is the pullback of $\omega_X$ (Lemma \ref{lemma-sanity-check-duality}) and we have $\Gamma(X, \omega_X^{\otimes m}) \otimes_k K$ is equal to $\Gamma(X_K, \omega_{X_K}^{\otimes m})$ by Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}. Thus formation of $f : X \to X'$ commutes with base change by $K/k$ by the arguments given above. Some details omitted.
The fibres of $c$ are geometrically connected by More on Morphisms, Theorem \ref{more-morphisms-theorem-stein-factorization-Noetherian}. In particular $c$ is surjective. There are finitely many closed points $y = y_1, \ldots, y_r$ of $Y$ where $X_y$ has dimension $1$ and over $Y \setminus \{y_1, \ldots, y_r\}$ the morphism $c$ is an isomorphism. Some details omitted; hint: outside of $\{y_1, \ldots, y_r\}$ the morphism $c$ is finite, see Cohomology of Schemes, Lemma \ref{coherent-lemma-characterize-finite}. \medskip\noindent Let us carefully construct a map $b : c^*\omega_Y \to \omega_X$. Denote $f : X \to \Spec(k)$ and $g : Y \to \Spec(k)$ the structure morphisms. We have $f^!k = \omega_X[1]$ and $g^!k = \omega_Y[1]$, see Lemma \ref{lemma-duality-dim-1} and its proof. Then $f^! = c^! \circ g^!$ and hence $c^!\omega_Y = \omega_X$. Thus there is a functorial isomorphism $$ \Hom_{D(\mathcal{O}_X)}(\mathcal{F}, \omega_X) \longrightarrow \Hom_{D(\mathcal{O}_Y)}(Rc_*\mathcal{F}, \omega_Y) $$ for coherent $\mathcal{O}_X$-modules $\mathcal{F}$ by definition of $c^!$\footnote{As the restriction of the right adjoint of Duality for Schemes, Lemma \ref{duality-lemma-twisted-inverse-image} to $D^+_\QCoh(\mathcal{O}_Y)$.}. This isomorphism is induced by a trace map $t : Rc_*\omega_X \to \omega_Y$ (the counit of the adjunction). By the projection formula (Cohomology, Lemma \ref{cohomology-lemma-projection-formula}) the canonical map $a : \omega_Y \to Rc_*c^*\omega_Y$ is an isomorphism. Combining the above we see there is a canonical map $b : c^*\omega_Y \to \omega_X$ such that $$ t \circ Rc_*(b) = a^{-1} $$ In particular, if we restrict $b$ to $c^{-1}(Y \setminus \{y_1, \ldots, y_r\})$ then it is an isomorphism (because it is a map between invertible modules whose composition with another gives the isomorphism $a^{-1}$). \medskip\noindent Choose $m \in \mathbf{Z}$ as in (3) consider the map $$ b^{\otimes m} : \Gamma(Y, \omega_Y^{\otimes m}) \longrightarrow \Gamma(X, \omega_X^{\otimes m}) $$ This map is injective because $Y$ is reduced and by the last property of $b$ mentioned in its construction. By Riemann-Roch (Lemma \ref{lemma-rr}) we have $\chi(X, \omega_X^{\otimes m}) =\chi(Y, \omega_Y^{\otimes m})$. Thus $$ \dim_k \Gamma(Y, \omega_Y^{\otimes m}) \geq \dim_k \Gamma(X, \omega_X^{\otimes m}) = \chi(X, \omega_X^{\otimes m}) $$ and we conclude $b^{\otimes m}$ induces an isomorphism on global sections. So $b^{\otimes m} : c^*\omega_Y^{\otimes m} \to \omega_X^{\otimes m}$ is surjective as generators of $\omega_X^{\otimes m}$ are in the image. Hence $b^{\otimes m}$ is an isomorphism. Thus $b$ is an isomorphism.