Question on ring of regular functions of a finite type variety I think the following statement is true but I cannot prove it:

If $X$ is a variety of finite type, then $\Gamma(X,O_X)$ is finite generated algebra.

Any help is appreciated.
 A: This is not true, unfortunately. Basically, the issue is that all one can get is that the ring of regular functions is a subring of a finitely-generated ring via the sheaf condition on $\mathcal{O}_X$, but this doesn't mean that the subring is finitely generated.
Here is a specific counterexample, taken from Ravi Vakil's useful note. Let $E$ be an elliptic curve over some infinite ground field $k$, $N$ a degree 0 non-torsion invertible sheaf on $E$, and $P$ an invertible sheaf on $E$ of degree at least 3. Now, consider $Y$, the total space of $N\oplus P^*$. Claim: this is a nonsingular quasiaffine threefold with an infinitely generated ring of regular functions.
We refer the reader to Vakil's note for the proof of non-finite generation and explain the quasiaffineness below, since it's what matters for showing that this scheme is of finite type.
To prove that $Y$ is quasiaffine, note that $P$ gives an embedding $E\hookrightarrow \Bbb P^{\deg P - 1}$. Let $A$ be the affine cone over this and $B$ the complement of the origin. Then there's a natural morphism $\pi:B\to E$ which expresses $B$ as the total space of $P^*$ over $E$. Extend $\pi^*P^*$, an invertible sheaf on $B$, to a coherent sheaf $M$ on $A$ by taking the reflexive hull (which works since $A\setminus B$ is codimension $\geq 2$ in $A$). Now let $Z$ be the spectrum of the symmetric algebra of $M$ - this is affine, and it contains $Y$ as an open subscheme.
We'll show that $Y$ is finite type over the ground field. We start by establishing a fact about $Z$: it's the spectrum of a finitely-generated $k$-algebra, as it's $\operatorname{Spec} Sym(M(A))$, and $M(A)$ is finitely generated module over $\mathcal{O}_A(A)$, itself a finitely generated $k$-algebra. This means that $Z$ is finite type over $k$ and noetherian.
To show that $Y$ is of finite type, we recall that any open immersion is locally of finite type since it is locally an isomorphism, so $Y\to Z$ and $Z\to \operatorname{Spec} k$ are both locally of finite type and so $Y$ is locally of finite type over $\operatorname{Spec} k$. Next, in order to show that $Y\to \operatorname{Spec} k$ is quasicompact, it suffices to show that $Y$ is a quasicompact topological space. But this is clear: as $Z$ is noetherian, and any subset of a noetherian topological space is quasicompact, $Y$ is also quasicompact. So $Y\to \operatorname{Spec} k$ is locally of finite type and quasicompact, so it's of finite type.
