hcju/stacksqa huggingface dataset:
The ring $\mathcal{O}_{X, x}$ is a discrete valuation ring by Algebra, Lemma \ref{algebra-lemma-characterize-smooth-over-field}. Since $x$ is closed $\kappa(x)$ is finite over $k$. Hence if $\kappa(x)/k$ is separable, then any uniformizer $s$ maps to a nonzero element of $\Omega_{X/k, x} \otimes_{\mathcal{O}_{X, x}} \kappa(x)$ by Algebra, Lemma \ref{algebra-lemma-computation-differential}. Since $\Omega_{X/k, x}$ is free of rank $1$ over $\mathcal{O}_{X, x}$ the result follows.
The relative frobenius morphism $F_{X/k} : X \to X^{(p)}$ is constructed in Varieties, Section \ref{varieties-section-frobenius}. Observe that $X^{(p)}$ is a smooth proper curve over $k$ as a base change of $X$. The morphism $F_{X/k}$ has degree $p$ by Varieties, Lemma \ref{varieties-lemma-inseparable-deg-p-smooth}. Thus $k(X^{(p)})$ and $k(Y)$ are both subfields of $k(X)$ with $[k(X) : k(Y)] = [k(X) : k(X^{(p)})] = p$. To prove the lemma it suffices to show that $k(Y) = k(X^{(p)})$ inside $k(X)$. See Theorem \ref{theorem-curves-rational-maps}. \medskip\noindent Write $K = k(X)$. Consider the map $\text{d} : K \to \Omega_{K/k}$. It follows from Lemma \ref{lemma-generically-etale} that both $k(Y)$ is contained in the kernel of $\text{d}$. By Varieties, Lemma \ref{varieties-lemma-relative-frobenius-omega} we see that $k(X^{(p)})$ is in the kernel of $\text{d}$. Since $X$ is a smooth curve we know that $\Omega_{K/k}$ is a vector space of dimension $1$ over $K$. Then More on Algebra, Lemma \ref{more-algebra-lemma-p-basis}. implies that $\Ker(\text{d}) = kK^p$ and that $[K : kK^p] = p$. Thus $k(Y) = kK^p = k(X^{(p)})$ for reasons of degree.
Pick two $k$-linearly independent elements $s, t \in V$. Then $f = s/t$ is the rational function defining the morphism $X \to \mathbf{P}^1_k$ corresponding to the linear series $(\mathcal{L}, ks + kt)$. If this morphism is not generically \'etale, then $f \in k(X^{(p)})$ by Proposition \ref{proposition-unwind-morphism-smooth}. Now choose a basis $s_0, \ldots, s_r$ of $V$ and let $\mathcal{L}' \subset \mathcal{L}$ be the invertible sheaf generated by $s_0, \ldots, s_r$. Set $f_i = s_i/s_0$ in $k(X)$. If for each pair $(s_0, s_i)$ we have $f_i \in k(X^{(p)})$, then the morphism $$ \varphi = \varphi_{(\mathcal{L}', (s_0, \ldots, s_r)} : X \longrightarrow \mathbf{P}^r_k = \text{Proj}(k[T_0, \ldots, T_r]) $$ factors through $X^{(p)}$ as this is true over the affine open $D_+(T_0)$ and we can extend the morphism over the affine part to the whole of the smooth curve $X^{(p)}$ by Lemma \ref{lemma-extend-over-normal-curve}. Introducing notation, say we have the factorization $$ X \xrightarrow{F_{X/k}} X^{(p)} \xrightarrow{\psi} \mathbf{P}^r_k $$ of $\varphi$. Then $\mathcal{N} = \psi^*\mathcal{O}_{\mathbf{P}^1_k}(1)$ is an invertible $\mathcal{O}_{X^{(p)}}$-module with $\mathcal{L}' = F_{X/k}^*\mathcal{N}$ and with $\psi^*T_0, \ldots, \psi^*T_r$ $k$-linearly independent (as they pullback to $s_0, \ldots, s_r$ on $X$). Finally, we have $$ d = \deg(\mathcal{L}) \geq \deg(\mathcal{L}') = \deg(F_{X/k}) \deg(\mathcal{N}) = p \deg(\mathcal{N}) $$ as desired. Here we used Varieties, Lemmas \ref{varieties-lemma-check-invertible-sheaf-trivial}, \ref{varieties-lemma-degree-pullback-map-proper-curves}, and \ref{varieties-lemma-inseparable-deg-p-smooth}.
Set $\omega = \Omega_{X/k}$. By Lemma \ref{lemma-genus-smooth} this has degree $2g - 2$ and has $g$ global sections. Thus we have a $\mathfrak g^{g - 1}_{2g - 2}$. By the trivial Lemma \ref{lemma-linear-series-trivial-existence} there exists a $\mathfrak g^1_{2g - 2}$ and by Lemma \ref{lemma-g1d} we obtain a morphism $$ \varphi : X \longrightarrow \mathbf{P}^1_k $$ of some degree $d \leq 2g - 2$. Since $\varphi$ is flat (Lemma \ref{lemma-flat}) and finite (Lemma \ref{lemma-finite}) it is finite locally free of degree $d$ (Morphisms, Lemma \ref{morphisms-lemma-finite-flat}). Pick any rational point $t \in \mathbf{P}^1_k$ and any point $x \in X$ with $\varphi(x) = t$. Then $$ d \geq [\kappa(x) : \kappa(t)] = [\kappa(x) : k] $$ for example by Morphisms, Lemmas \ref{morphisms-lemma-finite-locally-free-universally-bounded} and \ref{morphisms-lemma-characterize-universally-bounded}. Thus if $k$ is perfect (for example has characteristic zero or is finite) then the lemma is proved. Thus we reduce to the case discussed in the next paragraph. \medskip\noindent Assume that $k$ is an infinite field of characteristic $p > 0$. As above we will use that $X$ has a $\mathfrak g^{g - 1}_{2g - 2}$. The smooth proper curve $X^{(p)}$ has the same genus as $X$. Hence its genus is $> 0$. We conclude that $X^{(p)}$ does not have a $\mathfrak g^{g - 1}_d$ for any $d \leq g - 1$ by Lemma \ref{lemma-grd-inequalities}. Applying Lemma \ref{lemma-inseparable-linear-system} to our $\mathfrak g^{g - 1}_{2g - 2}$ (and noting that $2g - 2/p \leq g - 1$) we conclude that possibility (2) does not occur. Hence we obtain a morphism $$ \varphi : X \longrightarrow \mathbf{P}^1_k $$ which is generically \'etale (in the sense of the lemma) and has degree $\leq 2g - 2$. Let $U \subset X$ be the nonempty open subscheme where $\varphi$ is \'etale. Then $\varphi(U) \subset \mathbf{P}^1_k$ is a nonempty Zariski open and we can pick a $k$-rational point $t \in \varphi(U)$ as $k$ is infinite. Let $u \in U$ be a point with $\varphi(u) = t$. Then $\kappa(u)/\kappa(t)$ is separable (Morphisms, Lemma \ref{morphisms-lemma-etale-over-field}), $\kappa(t) = k$, and $[\kappa(u) : k] \leq 2g - 2$ as before.
After shrinking $X$ we may assume there is an \'etale morphism $\pi : X \to \mathbf{A}^1_k$, see Morphisms, Lemma \ref{morphisms-lemma-smooth-etale-over-affine-space}. Then we can consider the diagram of local rings $$ \xymatrix{ \mathcal{O}_{X_{\overline{k}}, \overline{x}} & \mathcal{O}_{\mathbf{A}^1_{\overline{k}}, \pi(\overline{x})} \ar[l] \\ \mathcal{O}_{X, x} \ar[u] & \mathcal{O}_{\mathbf{A}^1_k, \pi(x)} \ar[l] \ar[u] } $$ The horizontal arrows have ramification index $1$ as they correspond to \'etale morphisms. Moreover, the extension $\kappa(x)/\kappa(\pi(x))$ is separable hence $\kappa(x)$ and $\kappa(\pi(x))$ have the same inseparable degree over $k$. By multiplicativity of ramification indices it suffices to prove the result when $x$ is a point of the affine line. \medskip\noindent Assume $X = \mathbf{A}^1_k$. In this case, the local ring of $X$ at $x$ looks like $$ \mathcal{O}_{X, x} = k[t]_{(P)} $$ where $P$ is an irreducible monic polynomial over $k$. Then $P(t) = Q(t^q)$ for some separable polynomial $Q \in k[t]$, see Fields, Lemma \ref{fields-lemma-irreducible-polynomials}. Observe that $\kappa(x) = k[t]/(P)$ has inseparable degree $q$ over $k$. On the other hand, over $\overline{k}$ we can factor $Q(t) = \prod (t - \alpha_i)$ with $\alpha_i$ pairwise distinct. Write $\alpha_i = \beta_i^q$ for some unique $\beta_i \in \overline{k}$. Then our point $\overline{x}$ corresponds to one of the $\beta_i$ and we conclude because the ramification index of $$ k[t]_{(P)} \longrightarrow \overline{k}[t]_{(t - \beta_i)} $$ is indeed equal to $q$ as the uniformizer $P$ maps to $(t - \beta_i)^q$ times a unit.
Choose an affine open neighbourhood $\Spec(A)$ of $x$ in $X$. Let $\Spec(A') \subset X'$ be the inverse image. By construction we have a fibre product diagram $$ \xymatrix{ \prod\nolimits_{i = 1, \ldots, n} k'_i & A' \ar[l] \\ k' \ar[u] & A \ar[u] \ar[l] } $$ Since everything is finite over $A$ we see that the diagram remains a fibre product diagram after completion with respect to the maximal ideal $\mathfrak m \subset A$ corresponding to $x$ (Algebra, Lemma \ref{algebra-lemma-completion-flat}). Finally, apply Algebra, Lemma \ref{algebra-lemma-completion-finite-extension} to identify the completion of $A'$.
Let $U \subset X$ be the maximal open set over which $f$ is an isomorphism. Then $X \setminus U = \{x_1, \ldots, x_n\}$ with $x_i \in X(k)$. We will consider factorizations $X' \to Y \to X$ of $f$ such that both morphisms are finite and $$ \mathcal{O}_X \subset g_*\mathcal{O}_Y \subset f_*\mathcal{O}_{X'} $$ where $g : Y \to X$ is the given morphism. By assumption $\mathcal{O}_{X, x} \to (f_*\mathcal{O}_{X'})_x$ is an isomorphism onless $x = x_i$ for some $i$. Hence the cokernel $$ f_*\mathcal{O}_{X'}/\mathcal{O}_X = \bigoplus \mathcal{Q}_i $$ is a direct sum of skyscraper sheaves $\mathcal{Q}_i$ supported at $x_1, \ldots, x_n$. Because the displayed quotient is a coherent $\mathcal{O}_X$-module, we conclude that $\mathcal{Q}_i$ has finite length over $\mathcal{O}_{X, x_i}$. Hence we can argue by induction on the sum of these lengths, i.e., the length of the whole cokernel. \medskip\noindent If $n > 1$, then we can define an $\mathcal{O}_X$-subalgebra $\mathcal{A} \subset f_*\mathcal{O}_{X'}$ by taking the inverse image of $\mathcal{Q}_1$. This will give a nontrivial factorization and we win by induction. \medskip\noindent Assume $n = 1$. We abbreviate $x = x_1$. Consider the finite $k$-algebra extension $$ A = \mathcal{O}_{X, x} \subset (f_*\mathcal{O}_{X'})_x = B $$ Note that $\mathcal{Q} = \mathcal{Q}_1$ is the skyscraper sheaf with value $B/A$. We have a $k$-subalgebra $A \subset A + \mathfrak m_A B \subset B$. If both inclusions are strict, then we obtain a nontrivial factorization and we win by induction as above. If $A + \mathfrak m_A B = B$, then $A = B$ by Nakayama, then $f$ is an isomorphism and there is nothing to prove. We conclude that we may assume $B = A + \mathfrak m_A B$. Set $C = B/\mathfrak m_A B$. If $C$ has more than $2$ $k$-subalgebras, then we obtain a subalgebra between $A$ and $B$ by taking the inverse image in $B$. Thus we may assume $C$ has exactly $2$ $k$-subalgebras. Thus $C = k \times k$ or $C = k[\epsilon]$ by Lemma \ref{lemma-no-in-between-over-k}. In this case $f$ is correspondingly the glueing two points or the squishing of a tangent vector.
The map $\Pic(X) \to \Pic(X')$ is surjective by Varieties, Lemma \ref{varieties-lemma-surjective-pic-birational-finite}. Using the short exact sequence $$ 0 \to \mathcal{O}_X^* \to f_*\mathcal{O}_{X'}^* \xrightarrow{ab^{-1}} x_*k^* \to 0 $$ we obtain $$ H^0(X', \mathcal{O}_{X'}^*) \xrightarrow{ab^{-1}} k^* \to H^1(X, \mathcal{O}_X^*) \to H^1(X, f_*\mathcal{O}_{X'}^*) $$ We have $H^1(X, f_*\mathcal{O}_{X'}^*) \subset H^1(X', \mathcal{O}_{X'}^*)$ (for example by the Leray spectral sequence, see Cohomology, Lemma \ref{cohomology-lemma-Leray}). Hence the kernel of $\Pic(X) \to \Pic(X')$ is the cokernel of $ab^{-1} : H^0(X', \mathcal{O}_{X'}^*) \to k^*$. If $a$ and $b$ are on different connected components of $X'$, then $ab^{-1}$ is surjective. Because $k$ is algebraically closed any regular function on a reduced connected proper scheme over $k$ comes from an element of $k$, see Varieties, Lemma \ref{varieties-lemma-proper-geometrically-reduced-global-sections}. Thus $ab^{-1}$ is zero if $X'$ is proper and $a$ and $b$ are on the same connected component.
The map $\Pic(X) \to \Pic(X')$ is surjective by Varieties, Lemma \ref{varieties-lemma-surjective-pic-birational-finite}. Using the short exact sequence $$ 0 \to \mathcal{O}_X^* \to f_*\mathcal{O}_{X'}^* \xrightarrow{\vartheta} x_*k \to 0 $$ of Example \ref{example-squish-tangent-vector} we obtain $$ H^0(X', \mathcal{O}_{X'}^*) \xrightarrow{\vartheta} k \to H^1(X, \mathcal{O}_X^*) \to H^1(X, f_*\mathcal{O}_{X'}^*) $$ We have $H^1(X, f_*\mathcal{O}_{X'}^*) \subset H^1(X', \mathcal{O}_{X'}^*)$ (for example by the Leray spectral sequence, see Cohomology, Lemma \ref{cohomology-lemma-Leray}). Hence the kernel of $\Pic(X) \to \Pic(X')$ is the cokernel of the map $\vartheta : H^0(X', \mathcal{O}_{X'}^*) \to k$. Because $k$ is algebraically closed any regular function on a reduced connected proper scheme over $k$ comes from an element of $k$, see Varieties, Lemma \ref{varieties-lemma-proper-geometrically-reduced-global-sections}. Thus the final statement of the lemma.
Since the residue field of $A$ is separably closed, the number of branches of $A$ is equal to the number of geometric branches of $A$, see More on Algebra, Definition \ref{more-algebra-definition-number-of-branches}. The inequality holds by Varieties, Lemma \ref{varieties-lemma-delta-number-branches-inequality}. Assume equality holds. We may replace $A$ by the completion of $A$; this does not change the number of branches or the $\delta$-invariant, see More on Algebra, Lemma \ref{more-algebra-lemma-one-dimensional-number-of-branches} and Varieties, Lemma \ref{varieties-lemma-delta-same-after-completion}. Then $A$ is strictly henselian, see Algebra, Lemma \ref{algebra-lemma-complete-henselian}. By Varieties, Lemma \ref{varieties-lemma-delta-number-branches-inequality-sh} we see that $A$ is a wedge of complete discrete valuation rings. Each of these is isomorphic to $k[[t]]$ by Algebra, Lemma \ref{algebra-lemma-regular-complete-containing-coefficient-field}. Hence $A$ is as in (\ref{equation-multicross}).
The equivalence of (1) and (2) is Lemma \ref{lemma-multicross-algebra}. \medskip\noindent Assume (3). We will argue by descending induction on $i$ that all singularities of $U_i$ are multicross. This is true for $U_n$ as $U_n$ has no singular points. If $U_i$ is gotten from $U_{i + 1}$ by glueing $a, b \in U_{i + 1}$ to a point $c \in U_i$, then we see that $$ \mathcal{O}_{U_i, c}^\wedge \subset \mathcal{O}_{U_{i + 1}, a}^\wedge \times \mathcal{O}_{U_{i + 1}, b}^\wedge $$ is the set of elements having the same residue classes in $k$. Thus the number of branches at $c$ is the sum of the number of branches at $a$ and $b$, and the $\delta$-invariant at $c$ is the sum of the $\delta$-invariants at $a$ and $b$ plus $1$ (because the displayed inclusion has codimension $1$). This proves that (2) holds as desired. \medskip\noindent Assume the equivalent conditions (1) and (2). We may choose an open $U \subset X$ such that $x$ is the only singular point of $U$. Then we apply Lemma \ref{lemma-factor-almost-isomorphism} to the normalization morphism $$ U^\nu = U_n \to U_{n - 1} \to \ldots \to U_1 \to U_0 = U $$ All we have to do is show that in none of the steps we are squishing a tangent vector. Suppose $U_{i + 1} \to U_i$ is the smallest $i$ such that this is the squishing of a tangent vector $\theta$ at $u' \in U_{i + 1}$ lying over $u \in U_i$. Arguing as above, we see that $u_i$ is a multicross singularity (because the maps $U_i \to \ldots \to U_0$ are glueing of pairs of points). But now the number of branches at $u'$ and $u$ is the same and the $\delta$-invariant of $U_i$ at $u$ is $1$ bigger than the $\delta$-invariant of $U_{i + 1}$ at $u'$. By Lemma \ref{lemma-multicross-algebra} this implies that $u$ cannot be a multicross singularity which is a contradiction.
The map $\mathcal{O}_{X, x} \to \mathcal{O}_{X, x}^\wedge$ is flat and unramified in the sense that $\kappa(x) = \mathcal{O}_{X, x}^\wedge/\mathfrak m_x \mathcal{O}_{X, x}^\wedge$. (See More on Algebra, Section \ref{more-algebra-section-permanence-completion}.) Thus $X$ is Gorenstein implies $\mathcal{O}_{X, x}$ is Gorenstein, implies $\mathcal{O}_{X, x}^\wedge$ is Gorenstein by Dualizing Complexes, Lemma \ref{dualizing-lemma-flat-under-gorenstein}. Thus it suffices to show that the ring $A$ in (\ref{equation-multicross}) with $n \geq 2$ is Gorenstein if and only if $n = 2$. \medskip\noindent If $n = 2$, then $A = k[[x, y]]/(xy)$ is a complete intersection and hence Gorenstein. For example this follows from Duality for Schemes, Lemma \ref{duality-lemma-gorenstein-lci} applied to $k[[x, y]] \to A$ and the fact that the regular local ring $k[[x, y]]$ is Gorenstein by Dualizing Complexes, Lemma \ref{dualizing-lemma-regular-gorenstein}. \medskip\noindent Assume $n > 2$. If $A$ where Gorenstein, then $A$ would be a dualizing complex over $A$ (Duality for Schemes, Definition \ref{duality-definition-gorenstein}). Then $R\Hom(k, A)$ would be equal to $k[n]$ for some $n \in \mathbf{Z}$, see Dualizing Complexes, Lemma \ref{dualizing-lemma-find-function}. It would follow that $\Ext^1_A(k, A) \cong k$ or $\Ext^1_A(k, A) = 0$ (depending on the value of $n$; in fact $n$ has to be $-1$ but it doesn't matter to us here). Using the exact sequence $$ 0 \to \mathfrak m_A \to A \to k \to 0 $$ we find that $$ \Ext^1_A(k, A) = \Hom_A(\mathfrak m_A, A)/A $$ where $A \to \Hom_A(\mathfrak m_A, A)$ is given by $a \mapsto (a' \mapsto aa')$. Let $e_i \in \Hom_A(\mathfrak m_A, A)$ be the element that sends $(f_1, \ldots, f_n) \in \mathfrak m_A$ to $(0, \ldots, 0, f_i, 0, \ldots, 0)$. The reader verifies easily that $e_1, \ldots, e_{n - 1}$ are $k$-linearly independent in $\Hom_A(\mathfrak m_A, A)/A$. Thus $\dim_k \Ext^1_A(k, A) \geq n - 1 \geq 2$ which finishes the proof. (Observe that $e_1 + \ldots + e_n$ is the image of $1$ under the map $A \to \Hom_A(\mathfrak m_A, A)$.)
Let $\Pic^0(X) \subset \Pic(X)$ denote the subgroup of invertible sheaves of degree $0$. In other words, there is a short exact sequence $$ 0 \to \Pic^0(X) \to \Pic(X) \xrightarrow{\deg} \mathbf{Z} \to 0. $$ The group $\Pic^0(X)$ is the $k$-points of the group scheme $\underline{\Picardfunctor}^0_{X/k}$, see Picard Schemes of Curves, Lemma \ref{pic-lemma-picard-pieces}. The same lemma tells us that $\underline{\Picardfunctor}^0_{X/k}$ is a $g$-dimensional abelian variety over $k$ as defined in Groupoids, Definition \ref{groupoids-definition-abelian-variety}. Thus we conclude by the results of Groupoids, Proposition \ref{groupoids-proposition-review-abelian-varieties}.
Assume $g \geq 2$. First we may choose a finite separable extension of degree at most $2g - 2$ such that $X$ acquires a rational point. Thus we may assume $X$ has a $k$-rational point $x \in X(k)$ but now we have to prove the lemma with $[k' : k] \leq \leq (n^{2g})!$. Let $k \subset k^{sep} \subset \overline{k}$ be a separable algebraic closure inside an algebraic closure. By Lemma \ref{lemma-torsion-picard-smooth-projective} we have $$ \Pic(X_{\overline{k}})[n] \cong (\mathbf{Z}/n\mathbf{Z})^{\oplus 2g} $$ By Picard Schemes of Curves, Lemma \ref{pic-lemma-torsion-descends} we conclude that $$ \Pic(X_{k^{sep}})[n] \cong (\mathbf{Z}/n\mathbf{Z})^{\oplus 2g} $$ By Picard Schemes of Curves, Lemma \ref{pic-lemma-torsion-descends} there is a continuous action $$ \text{Gal}(k^{sep}/k) \longrightarrow \text{Aut}(\Pic(X_{k^{sep}})[n] $$ and the lemma is true for the fixed field $k'$ of the kernel of this map. The kernel is open because the action is continuous which implies that $k'/k$ is finite. By Galois theory $\text{Gal}(k'/k)$ is the image of the displayed arrow. Since the permutation group of a set of cardinality $n^{2g}$ has cardinality $(n^{2g})!$ we conclude by Galois theory that $[k' : k] \leq (n^{2g})!$. (Of course this proves the lemma with the bound $|\text{GL}_{2g}(\mathbf{Z}/n\mathbf{Z})|$, but all we want here is that there is some bound.) \medskip\noindent If the genus is $1$, then there is no upper bound on the degree of a finite separable field extension over which $X$ acquires a rational point (details omitted). Still, there is such an extension for example by Varieties, Lemma \ref{varieties-lemma-smooth-separable-closed-points-dense}. The rest of the proof is the same as in the case of $g \geq 2$.
This is immediate from the definition and the fact that an irreducible component $\overline{Z}$ of $X_{\overline{k}}$ maps onto an irreducible component $Z$ of $X$ (Varieties, Lemma \ref{varieties-lemma-image-irreducible}) of the same dimension (Morphisms, Lemma \ref{morphisms-lemma-dimension-fibre-after-base-change} applied to the generic point of $\overline{Z}$).
Part (1) is immediate from Lemma \ref{lemma-bound-geometric-genus}. If $X' \to X$ is proper birational, then it is finite and an isomorphism over a dense open (see Varieties, Lemmas \ref{varieties-lemma-finite-in-codim-1} and \ref{varieties-lemma-modification-normal-iso-over-codimension-1}). Hence $X'_{\overline{k}} \to X_{\overline{k}}$ is an isomorphism over a dense open. Thus the irreducible components of $X'_{\overline{k}}$ and $X_{\overline{k}}$ are in bijective correspondence and the corresponding components have isomorphic function fields. In particular these components have isomorphic nonsingular projective models and hence have the same geometric genera. This proves (2). Part (3) follows from (1) and (2) and the fact that $X^\nu \to X_{red}$ is birational (Morphisms, Lemma \ref{morphisms-lemma-normalization-birational}).
Consider the exact sequence $$ 0 \to \mathcal{G} \to \mathcal{O}_X \to f_*\mathcal{O}_Y \to \mathcal{F} \to 0 $$ of coherent sheaves on $X$. By assumption $\mathcal{F}$ is supported in finitely many closed points and hence has vanishing higher cohomology (Varieties, Lemma \ref{varieties-lemma-chi-tensor-finite}). On the other hand, we have $H^2(X, \mathcal{G}) = 0$ by Cohomology, Proposition \ref{cohomology-proposition-vanishing-Noetherian}. It follows formally that the induced map $H^1(X, \mathcal{O}_X) \to H^1(X, f_*\mathcal{O}_Y)$ is surjective. Since $H^1(X, f_*\mathcal{O}_Y) = H^1(Y, \mathcal{O}_Y)$ (Cohomology of Schemes, Lemma \ref{coherent-lemma-relative-affine-cohomology}) we conclude the lemma holds.
If $f : X' \to X$ is proper birational, then it is finite and an isomorphism over a dense open (see Varieties, Lemmas \ref{varieties-lemma-finite-in-codim-1} and \ref{varieties-lemma-modification-normal-iso-over-codimension-1}). Thus the inequality by Lemma \ref{lemma-genus-goes-down}. Assume $X$ is reduced. Then $\mathcal{O}_X \to f_*\mathcal{O}_{X'}$ is injective and we obtain a short exact sequence $$ 0 \to \mathcal{O}_X \to f_*\mathcal{O}_{X'} \to \mathcal{F} \to 0 $$ Under the assumptions given in the second statement, we conclude from the long exact cohomology sequence that $H^0(X, \mathcal{F}) = 0$. Then $\mathcal{F} = 0$ because $\mathcal{F}$ is generated by global sections (Varieties, Lemma \ref{varieties-lemma-chi-tensor-finite}). and $\mathcal{O}_X = f_*\mathcal{O}_{X'}$. Since $f$ is affine this implies $X = X'$.
Varieties, Lemma \ref{varieties-lemma-regular-functions-proper-variety} implies $\kappa$ is a field and a finite extension of $k$. By Fields, Lemma \ref{fields-lemma-separable-degree} we have $[\kappa : k]_s = |\Mor_k(\kappa, \overline{k})|$ and hence $\Spec(\kappa \otimes_k \overline{k})$ has $[\kappa : k]_s$ points each with residue field $\overline{k}$. Thus $$ C_{\overline{k}} = \bigcup\nolimits_{t \in \Spec(\kappa \otimes_k \overline{k})} C_t $$ (set theoretic union). Here $C_t = C \times_{\Spec(\kappa), t} \Spec(\overline{k})$ where we view $t$ as a $k$-algebra map $t : \kappa \to \overline{k}$. The conclusion is that $g_{geom}(C/k) = \sum_t g_{geom}(C_t/\overline{k})$ and the sum is over an index set of size $[\kappa : k]_s$. We have $$ H^0(C_t, \mathcal{O}_{C_t}) = \overline{k} \quad\text{and}\quad \dim_{\overline{k}} H^1(C_t, \mathcal{O}_{C_t}) = \dim_\kappa H^1(C, \mathcal{O}_C) $$ by cohomology and base change (Cohomology of Schemes, Lemma \ref{coherent-lemma-flat-base-change-cohomology}). Observe that the normalization $C_t^\nu$ is the disjoint union of the nonsingular projective models of the irreducible components of $C_t$ (Morphisms, Lemma \ref{morphisms-lemma-normalization-in-terms-of-components}). Hence $\dim_{\overline{k}} H^1(C_t^\nu, \mathcal{O}_{C_t^\nu})$ is equal to $g_{geom}(C_t/\overline{k})$. By Lemma \ref{lemma-genus-goes-down} we have $$ \dim_{\overline{k}} H^1(C_t, \mathcal{O}_{C_t}) \geq \dim_{\overline{k}} H^1(C_t^\nu, \mathcal{O}_{C_t^\nu}) $$ and this finishes the proof.