hcju/stacksqa huggingface dataset:
(Please see the remark below for a different approach avoiding the material on finite groupoids.) We can replace $X$ by an quasi-compact neighbourhood of $x$, hence we may assume $X$ is quasi-compact, separated, and Noetherian. There exists a scheme $U$ and a finite surjective morphism $U \to X$, see Limits of Spaces, Proposition \ref{spaces-limits-proposition-there-is-a-scheme-finite-over}. Let $R = U \times_X U$. Then $j : R \to U \times_S U$ is an equivalence relation and we obtain a groupoid scheme $(U, R, s, t, c)$ over $S$ with $s, t$ finite and $U$ Noetherian and separated. Let $\{u_1, \ldots, u_n\} \subset U$ be the set of points mapping to $x$.  Then $\dim(\mathcal{O}_{U, u_i}) \leq 1$ by Decent Spaces, Lemma \ref{decent-spaces-lemma-dimension-local-ring-quasi-finite}. \medskip\noindent By More on Groupoids, Lemma \ref{more-groupoids-lemma-find-affine-codimension-1} there exists an $R$-invariant affine open $W \subset U$ containing the orbit $\{u_1, \ldots, u_n\}$. Since $U \to X$ is finite surjective the continuous map $|U| \to |X|$ is closed surjective, hence submersive by Topology, Lemma \ref{topology-lemma-closed-morphism-quotient-topology}. Thus $f(W)$ is open and there is an open subspace $X' \subset X$ with $f : W \to X'$ a surjective finite morphism. Then $X'$ is an affine scheme by Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-image-affine-finite-morphism-affine-Noetherian} and the proof is finished.
Since every algebraic space is the union of its quasi-compact open subspaces, we see that the first part of the lemma follows from the second part (some details omitted). Thus we assume $X$ is quasi-compact and we assume given an extension $k \subset K$ with $K_K$ representable. Write $K = \bigcup A$ as the colimit of finitely generated $k$-subalgebras $A$. By Limits of Spaces, Lemma \ref{spaces-limits-lemma-limit-is-scheme} we see that $X_A$ is a scheme for some $A$. Choose a maximal ideal $\mathfrak m \subset A$. By the Hilbert Nullstellensatz (Algebra, Theorem \ref{algebra-theorem-nullstellensatz}) the residue field $k' = A/\mathfrak m$ is a finite extension of $k$. Thus we see that $X_{k'}$ is a scheme. If $k' \supset k$ is not separable, let $k' \supset k'' \supset k$ be the subextension found in Fields, Lemma \ref{fields-lemma-separable-first}. Since $k'/k''$ is purely inseparable, by Lemma \ref{lemma-scheme-after-purely-inseparable-base-change} the algebraic space $X_{k''}$ is a scheme. Since $k''|k$ is separable the proof is complete.
It follows from the construction of $Y = X/G$ in Properties of Spaces, Lemma \ref{spaces-properties-lemma-quotient} that the morphism $X \to Y$ is surjective and \'etale. Of course we have $X \times_Y X = X \times G$ hence the morphism $X \to Y$ is even finite \'etale. It is also surjective. Thus the lemma follows from Decent Spaces, Lemma \ref{decent-spaces-lemma-when-quotient-scheme-at-point}.
Since every algebraic space is the union of its quasi-compact open subspaces, we may assume $X$ is quasi-compact (some details omitted). Recall (Fields, Definition \ref{fields-definition-transcendence}) that the assumption on the extension $K/k$ signifies that $K$ is the fraction field of a polynomial ring (in possibly infinitely many variables) over $k$. Thus $K = \bigcup A$ is the union of subalgebras each of which is a localization of a finite polynomial algebra over $k$. By Limits of Spaces, Lemma \ref{spaces-limits-lemma-limit-is-scheme} we see that $X_A$ is a scheme for some $A$. Write $$ A = k[x_1, \ldots, x_n][1/f] $$ for some nonzero $f \in k[x_1, \ldots, x_n]$. \medskip\noindent If $k$ is infinite then we can finish the proof as follows: choose $a_1, \ldots, a_n \in k$ with $f(a_1, \ldots, a_n) \not = 0$. Then $(a_1, \ldots, a_n)$ define an $k$-algebra map $A \to k$ mapping $x_i$ to $a_i$ and $1/f$ to $1/f(a_1, \ldots, a_n)$. Thus the base change $X_A \times_{\Spec(A)} \Spec(k) \cong X$ is a scheme as desired. \medskip\noindent In this paragraph we finish the proof in case $k$ is finite. In this case we write $X = \lim X_i$ with $X_i$ of finite presentation over $k$ and with affine transition morphisms (Limits of Spaces, Lemma \ref{spaces-limits-lemma-relative-approximation}). Using Limits of Spaces, Lemma \ref{spaces-limits-lemma-limit-is-scheme} we see that $X_{i, A}$ is a scheme for some $i$. Thus we may assume $X \to \Spec(k)$ is of finite presentation. Let $x \in |X|$ be a closed point. We may represent $x$ by a closed immersion $\Spec(\kappa) \to X$ (Decent Spaces, Lemma \ref{decent-spaces-lemma-decent-space-closed-point}). Then $\Spec(\kappa) \to \Spec(k)$ is of finite type, hence $\kappa$ is a finite extension of $k$ (by the Hilbert Nullstellensatz, see Algebra, Theorem \ref{algebra-theorem-nullstellensatz}; some details omitted). Say $[\kappa : k] = d$. Choose an integer $n \gg 0$ prime to $d$ and let $k \subset k'$ be the extension of degree $n$. Then $k'/k$ is Galois with $G = \text{Aut}(k'/k)$ cyclic of order $n$. If $n$ is large enough there will be $k$-algebra homomorphism $A \to k'$ by the same reason as above. Then $X_{k'}$ is a scheme and $X = X_{k'}/G$ (Lemma \ref{lemma-base-change-by-Galois}). On the other hand, since $n$ and $d$ are relatively prime we see that $$ \Spec(\kappa) \times_{X} X_{k'} = \Spec(\kappa) \times_{\Spec(k)} \Spec(k') = \Spec(\kappa \otimes_k k') $$ is the spectrum of a field. In other words, the fibre of $X_{k'} \to X$ over $x$ consists of a single point. Thus by Lemma \ref{lemma-when-quotient-scheme-at-point} we see that $x$ is in the schematic locus of $X$ as desired.
If $k \subset K$ is an extension, then the base change $X_K$ is decent (Decent Spaces, Lemma \ref{decent-spaces-lemma-representable-named-properties}) and locally of finite type over $K$ (Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-base-change-finite-type}). By Lemma \ref{lemma-scheme-after-purely-inseparable-base-change} it suffices to prove that $X$ becomes a scheme after base change to the perfection of $k$, hence we may assume $k$ is a perfect field (this step isn't strictly necessary, but makes the other arguments easier to think about). By covering $X$ by quasi-compact opens we see that it suffices to prove the lemma in case $X$ is quasi-compact (small detail omitted). In this case $|X|$ is a sober topological space (Decent Spaces, Proposition \ref{decent-spaces-proposition-reasonable-sober}). Hence it suffices to show that every closed point in $|X|$ is contained in the schematic locus of $X$ (use Properties of Spaces, Lemma \ref{spaces-properties-lemma-subscheme} and Topology, Lemma \ref{topology-lemma-quasi-compact-closed-point}). \medskip\noindent Let $x \in |X|$ be a closed point. By Decent Spaces, Lemma \ref{decent-spaces-lemma-decent-space-closed-point} we can find a closed immersion $\Spec(l) \to X$ representing $x$. Then $\Spec(l) \to \Spec(k)$ is of finite type (Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-composition-finite-type}) and we conclude that $l$ is a finite extension of $k$ by the Hilbert Nullstellensatz (Algebra, Theorem \ref{algebra-theorem-nullstellensatz}). It is separable because $k$ is perfect. Thus the scheme $$ \Spec(l) \times_X X_{\overline{k}} = \Spec(l) \times_{\Spec(k)} \Spec(\overline{k}) = \Spec(l \otimes_k \overline{k}) $$ is the disjoint union of a finite number of $\overline{k}$-rational points. By assumption (3) we can find an affine open $W \subset X_{\overline{k}}$ containing these points. \medskip\noindent By Lemma \ref{lemma-when-scheme-after-base-change} we see that $X_{k'}$ is a scheme for some finite extension $k'/k$. After enlarging $k'$ we may assume that there exists an affine open $U' \subset X_{k'}$ whose base change to $\overline{k}$ recovers $W$ (use that $X_{\overline{k}}$ is the limit of the schemes $X_{k''}$ for $k' \subset k'' \subset \overline{k}$ finite and use Limits, Lemmas \ref{limits-lemma-descend-opens} and \ref{limits-lemma-limit-affine}). We may assume that $k'/k$ is a Galois extension (take the normal closure Fields, Lemma \ref{fields-lemma-normal-closure} and use that $k$ is perfect). Set $G = \text{Gal}(k'/k)$. By construction the $G$-invariant closed subscheme $\Spec(l) \times_X X_{k'}$ is contained in $U'$. Thus $x$ is in the schematic locus by Lemmas \ref{lemma-base-change-by-Galois} and \ref{lemma-when-quotient-scheme-at-point}.
Because we are over a field relative dimension of $X/k$ is the same as the dimension of $X$. Hence by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-locally-quasi-finite-rel-dimension-0} we see that (1) and (2) are equivalent. Hence it follows from Lemma \ref{lemma-locally-finite-type-dim-zero} (and trivial implications) that (1) -- (4) are equivalent. Finally, Varieties, Lemma \ref{varieties-lemma-algebraic-scheme-dim-0} shows that (1) -- (4) are equivalent with (5).
Assume $Y$ is locally quasi-finite over $k$. By Lemma \ref{lemma-locally-quasi-finite-over-field} we see that $Y = \coprod \Spec(A_i)$ where each $A_i$ is an Artinian local ring finite over $k$. By Decent Spaces, Lemma \ref{decent-spaces-lemma-monomorphism-toward-disjoint-union-dim-0-rings} we see that $X$ is a scheme. Consider $X_i = f^{-1}(\Spec(A_i))$. Then $X_i$ has either one or zero points. If $X_i$ has zero points there is nothing to prove. If $X_i$ has one point, then $X_i = \Spec(B_i)$ with $B_i$ a zero dimensional local ring and $A_i \to B_i$ is an epimorphism of rings. In particular $A_i/\mathfrak m_{A_i} = B_i/\mathfrak m_{A_i}B_i$ and we see that $A_i \to B_i$ is surjective by Nakayama's lemma, Algebra, Lemma \ref{algebra-lemma-NAK} (because $\mathfrak m_{A_i}$ is a nilpotent ideal!). Thus $B_i$ is a finite local $k$-algebra, and we conclude by Lemma \ref{lemma-locally-quasi-finite-over-field} that $X \to \Spec(k)$ is locally quasi-finite.
Recall that the local ring $\mathcal{O}_{X, \overline{x}}$ is the strict henselization of $\mathcal{O}_{U, u}$, see Properties of Spaces, Lemma \ref{spaces-properties-lemma-describe-etale-local-ring}. By Varieties, Lemma \ref{varieties-lemma-geometrically-reduced-at-point} we find that $U$ is geometrically reduced at $u$ if and only if $\mathcal{O}_{U, u}$ is geometrically reduced over $k$. Thus we have to show: if $A$ is a local $k$-algebra, then $A$ is geometrically reduced over $k$ if and only if $A^{sh}$ is geometrically reduced over $k$. We check this using the definition of geometrically reduced algebras (Algebra, Definition \ref{algebra-definition-geometrically-reduced}). Let $K/k$ be a field extension. Since $A \to A^{sh}$ is faithfully flat (More on Algebra, Lemma \ref{more-algebra-lemma-dumb-properties-henselization}) we see that $A \otimes_k K \to A^{sh} \otimes_k K$ is faithfully flat (Algebra, Lemma \ref{algebra-lemma-flat-base-change}). Hence if $A^{sh} \otimes_k K$ is reduced, so is $A \otimes_k K$ by Algebra, Lemma \ref{algebra-lemma-descent-reduced}. Conversely, recall that $A^{sh}$ is a colimit of \'etale $A$-algebra, see Algebra, Lemma \ref{algebra-lemma-strict-henselization}. Thus $A^{sh} \otimes_k K$ is a filtered colimit of \'etale $A \otimes_k K$-algebras. We conclude by Algebra, Lemma \ref{algebra-lemma-reduced-goes-up}.
Choose an \'etale morphism $U \to X$ where $U$ is a scheme and a point $u \in U$ mapping to $x \in |X|$. By Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian} we may choose a point $u' \in U_{k'} = U \times_X X_{k'}$ mapping to both $u$ and $x'$. By Lemma \ref{lemma-geometrically-reduced-at-point} the lemma follows from the lemma for $U, u, u'$ which is Varieties, Lemma \ref{varieties-lemma-geometrically-reduced-upstairs}.
Let $y \in |Y|$ be represented by a morphism $\Spec(K) \to Y$ be a morphism where $K$ is a field. The fibre of $|X \times_k Y| \to |Y|$ over $y$ is the image of $|Y_K| \to |X \times_k Y|$ by Properties of Spaces, Lemma \ref{spaces-properties-lemma-points-cartesian}. Thus these fibres are connected by our assumption that $Y$ is geometrically connected. By Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-space-over-field-universally-open} the map $|p|$ is open. Thus we may apply Topology, Lemma \ref{topology-lemma-connected-fibres-connected-components} to conclude.
Since $k$ is separably algebraically closed we see that $k'$ is geometrically connected over $k$, see Algebra, Lemma \ref{algebra-lemma-separably-closed-connected-implies-geometric}. Hence $Z = \Spec(k')$ is geometrically connected over $k$ by Varieties, Lemma \ref{varieties-lemma-affine-geometrically-connected}. Since $X_{k'} = Z \times_k X$ the result is a special case of Lemma \ref{lemma-bijection-connected-components}.
Choose a scheme $U$ and a surjective \'etale morphism $U \to X$. Choose a quasi-compact open $W \subset U_{\overline{k}}$ whose image in $X_{\overline{k}}$ is $V$. This is possible because $|U_{\overline{k}}| \to |X_{\overline{k}}|$ is continuous and because $|U_{\overline{k}}|$ has a basis of quasi-compact opens. We can apply Varieties, Lemma \ref{varieties-lemma-Galois-action-quasi-compact-open} to $W \subset U_{\overline{k}}$ to obtain the lemma.
Let $T \subset |X|$ be the image of $\overline{T}$. Since $|X_{\overline{k}}| \to |X|$ is surjective, the statement means that $T$ is closed and that its inverse image is $\overline{T}$. Choose a scheme $U$ and a surjective \'etale morphism $U \to X$. By the case of schemes (see Varieties, Lemma \ref{varieties-lemma-closed-fixed-by-Galois}) there exists a closed subset $T' \subset |U|$ whose inverse image in $|U_{\overline{k}}|$ is the inverse image of $\overline{T}$. Since $|U_{\overline{k}}| \to |X_{\overline{k}}|$ is surjective, we see that $T'$ is the inverse image of $T$ via $|U| \to |X|$. By our construction of the topology on $|X|$ this means that $T$ is closed. In the same manner one sees that $\overline{T}$ is the inverse image of $T$.
By Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-proper-over-affine-cohomology-finite} we see that $A = H^0(X, \mathcal{O}_X)$ is a finite dimensional $k$-algebra. This proves (1). \medskip\noindent Then $A$ is a product of local rings by Algebra, Lemma \ref{algebra-lemma-finite-dimensional-algebra} and Algebra, Proposition \ref{algebra-proposition-dimension-zero-ring}. If $X = Y \amalg Z$ with $Y$ and $Z$ open subspaces of $X$, then we obtain an idempotent $e \in A$ by taking the section of $\mathcal{O}_X$ which is $1$ on $Y$ and $0$ on $Z$. Conversely, if $e \in A$ is an idempotent, then we get a corresponding decomposition of $|X|$. Finally, as $|X|$ is a Noetherian topological space (by Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-finite-presentation-noetherian} and Properties of Spaces, Lemma \ref{spaces-properties-lemma-Noetherian-topology}) its connected components are open. Hence the connected components of $|X|$ correspond $1$-to-$1$ with primitive idempotents of $A$. This proves (2). \medskip\noindent If $X$ is reduced, then $A$ is reduced (Properties of Spaces, Lemma \ref{spaces-properties-lemma-reduced-space}). Hence the local rings $A_i = k_i$ are reduced and therefore fields (for example by Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}). This proves (3). \medskip\noindent If $X$ is geometrically reduced, then same thing is true for $A \otimes_k \overline{k} = H^0(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}})$ (see Cohomology of Spaces, Lemma \ref{spaces-cohomology-lemma-flat-base-change-cohomology} for equality). This implies that $k_i \otimes_k \overline{k}$ is a product of fields and hence $k_i/k$ is separable for example by Algebra, Lemmas \ref{algebra-lemma-characterize-separable-field-extensions} and \ref{algebra-lemma-geometrically-reduced-finite-purely-inseparable-extension}. This proves (4). \medskip\noindent If $X$ is geometrically connected, then $A \otimes_k \overline{k} = H^0(X_{\overline{k}}, \mathcal{O}_{X_{\overline{k}}})$ is a zero dimensional local ring by part (2) and hence its spectrum has one point, in particular it is irreducible. Thus $A$ is geometrically irreducible. This proves (5). Of course (5) implies (6). \medskip\noindent If $X$ is geometrically reduced and connected, then $A = k_1$ is a field and the extension $k_1/k$ is finite separable and geometrically irreducible. However, then $k_1 \otimes_k \overline{k}$ is a product of $[k_1 : k]$ copies of $\overline{k}$ and we conclude that $k_1 = k$. This proves (7). Of course (7) implies (8).
Let $s \in H^0(X, \mathcal{L})$ and $t \in H^0(X, \mathcal{L}^{\otimes - 1})$ be nonzero sections. Let $x \in |X|$ be a point in the support of $s$. Choose an affine \'etale neighbourhood $(U, u) \to (X, x)$ such that $\mathcal{L}|_U \cong \mathcal{O}_U$. Then $s|_U$ corresponds to a nonzero regular function on the reduced (because $X$ is reduced) scheme $U$ and hence is nonvanishing in a generic point of an irreducible component of $U$. By Decent Spaces, Lemma \ref{decent-spaces-lemma-decent-generic-points} we conclude that the generic point $\eta$ of $|X|$ is in the support of $s$. The same is true for $t$. Then of course $st$ must be nonzero because the local ring of $X$ at $\eta$ is a field (by aforementioned lemma the local ring has dimension zero, as $X$ is reduced the local ring is reduced, and Algebra, Lemma \ref{algebra-lemma-minimal-prime-reduced-ring}). However, we have seen that $K = H^0(X, \mathcal{O}_X)$ is a field in Lemma \ref{lemma-proper-geometrically-reduced-global-sections}. Thus $st$ is everywhere nonzero and we see that $s : \mathcal{O}_X \to \mathcal{L}$ is an isomorphism.
Choose $V \to Y$ surjective \'etale with $V$ a scheme. Then $U = X \times_Y V$ is a scheme and $U \to V$ is integral (and surjective if $f$ is surjective). By Properties of Spaces, Lemma \ref{spaces-properties-lemma-dimension-decent-invariant-under-etale} we have $\dim(X) = \dim(U)$ and $\dim(Y) = \dim(V)$. Thus the result follows from the case of schemes which is Morphisms, Lemma \ref{morphisms-lemma-integral-dimension}.
Recall that $|X|$ and $|Y|$ are irreducible sober topological spaces, see discussion following Definition \ref{definition-integral-algebraic-space}. Thus the fact that $f$ is dominant means that $|f|$ maps $x$ to $y$. Moreover, $x \in |X|$ is the unique point at which the local ring of $X$ has dimension $0$, see Decent Spaces, Lemma \ref{decent-spaces-lemma-decent-generic-points}. By Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-dimension-formula-general} we see that the dimension of the local ring of $X$ at any point $x' \in |X|$ is at most the dimension of the local ring of $Y$ at $y' = f(x')$ plus the transcendence degree of $x/y$. Since the dimension of $X$, resp.\ dimension of $Y$ is the supremum of the dimensions of the local rings at $x'$, resp.\ $y'$ (Properties of Spaces, Lemma \ref{spaces-properties-lemma-dimension}) we conclude the inequality holds. \medskip\noindent Assume $f$ is proper. Let $V \subset Y$ be a nonempty quasi-compact open subspace. If we can prove the equality for the morphism $f^{-1}(V) \to V$, then we get the equality for $X \to Y$. Thus we may assume that $X$ and $Y$ are quasi-compact. Observe that $X$ is quasi-separated as a locally Noetherian decent algebraic space, see Decent Spaces, Lemma \ref{decent-spaces-lemma-locally-Noetherian-decent-quasi-separated}. Thus we may choose $Y' \to Y$ finite surjective where $Y'$ is a scheme, see Limits of Spaces, Proposition \ref{spaces-limits-proposition-there-is-a-scheme-finite-over}. After replacing $Y'$ by a suitable closed subscheme, we may assume $Y'$ is integral, see for example the more general Lemma \ref{lemma-alteration-contained-in}. By the same lemma, we may choose a closed subspace $X' \subset X \times_Y Y'$ such that $X'$ is integral and $X' \to X$ is finite surjective. Now $X'$ is also locally Noetherian (Morphisms of Spaces, Lemma \ref{spaces-morphisms-lemma-locally-finite-type-locally-noetherian}) and we can use Limits of Spaces, Proposition \ref{spaces-limits-proposition-there-is-a-scheme-finite-over} once more to choose a finite surjective morphism $X'' \to X'$ with $X''$ a scheme. As before we may assume that $X''$ is integral. Picture $$ \xymatrix{ X'' \ar[d] \ar[r] & X \ar[d]^f \\ Y' \ar[r] & Y } $$ By Lemma \ref{lemma-integral-dimension} we have $\dim(X'') = \dim(X)$ and $\dim(Y') = \dim(Y)$. Since $X$ and $Y$ have open neighbourhoods of $x$, resp.\ $y$ which are schemes, we readily see that the generic points $x'' \in X''$, resp.\ $y' \in Y'$ are the unique points mapping to $x$, resp.\ $y$ and that the residue field extensions $\kappa(x'')/\kappa(x)$ and $\kappa(y')/\kappa(y)$ are finite. This implies that the transcendence degree of $x''/y'$ is the same as the transcendence degree of $x/y$. Thus the equality follows from the case of schemes whicn is Morphisms, Lemma \ref{morphisms-lemma-alteration-dimension}.
Choose a scheme $U$ and a surjective \'etale morphism $U \to X$. The morphism $U \to \Spec(k)$ is smooth as a composition of an \'etale (hence smooth) morphism and a smooth morphism (see Morphisms of Spaces, Lemmas \ref{spaces-morphisms-lemma-etale-smooth} and \ref{spaces-morphisms-lemma-composition-smooth}). Hence $U$ is regular by Varieties, Lemma \ref{varieties-lemma-smooth-regular}. By Properties of Spaces, Definition \ref{spaces-properties-definition-type-property} this means that $X$ is regular.
Choose a scheme $U$ and a surjective \'etale morphism $U \to X$. The morphism $U \to \Spec(k)$ is smooth as a composition of an \'etale (hence smooth) morphism and a smooth morphism (see Morphisms of Spaces, Lemmas \ref{spaces-morphisms-lemma-etale-smooth} and \ref{spaces-morphisms-lemma-composition-smooth}). Hence we can apply Varieties, Lemma \ref{varieties-lemma-smooth-separable-closed-points-dense} to see that the closed points of $U$ whose residue fields are finite separable over $k$ are dense. This implies the lemma by our definition of the topology on $|X|$.
The formula makes sense: the sheaves $R^if_*\mathcal{G}$ are coherent and only a finite number of them are nonzero, see Cohomology of Spaces, Lemmas \ref{spaces-cohomology-lemma-proper-pushforward-coherent} and \ref{spaces-cohomology-lemma-vanishing-higher-direct-images}. By Cohomology on Sites, Lemma \ref{sites-cohomology-lemma-Leray} there is a spectral sequence with $$ E_2^{p, q} = H^p(X, R^qf_*\mathcal{G}) $$ converging to $H^{p + q}(Y, \mathcal{G})$. By finiteness of cohomology on $X$ we see that only a finite number of $E_2^{p, q}$ are nonzero and each $E_2^{p, q}$ is a finite dimensional vector space. It follows that the same is true for $E_r^{p, q}$ for $r \geq 2$ and that $$ \sum (-1)^{p + q} \dim_k E_r^{p, q} $$ is independent of $r$. Since for $r$ large enough we have $E_r^{p, q} = E_\infty^{p, q}$ and since convergence means there is a filtration on $H^n(Y, \mathcal{G})$ whose graded pieces are $E_\infty^{p, q}$ with $p + 1 = n$ (this is the meaning of convergence of the spectral sequence), we conclude.