Lemma 37.48.3. Let $X$ be a quasi-affine scheme. Let $f : U \to X$ be an integral morphism. Then $U$ is quasi-affine and the diagram

$\xymatrix{ U \ar[r] \ar[d] & \mathop{\mathrm{Spec}}(\Gamma (U, \mathcal{O}_ U)) \ar[d] \\ X \ar[r] & \mathop{\mathrm{Spec}}(\Gamma (X, \mathcal{O}_ X)) }$

is cartesian.

Proof. The scheme $U$ is quasi-affine because integral morphisms are affine, affine morphisms are quasi-affine, a scheme is quasi-affine if and only if the structure morphism to $\mathop{\mathrm{Spec}}(\mathbf{Z})$ is quasi-affine, and compositions of quasi-affine morphisms are quasi-affine. The first two statements follow immediately from the definition and the third is Morphisms, Lemma 29.13.4. Set $U' = X \times _{\mathop{\mathrm{Spec}}(\Gamma (X, \mathcal{O}_ X))} \mathop{\mathrm{Spec}}(\Gamma (U, \mathcal{O}_ U))$ and consider the extended diagram

$\xymatrix{ U \ar[r]_ j \ar[rd] & U' \ar[d] \ar[r] & \mathop{\mathrm{Spec}}(\Gamma (U, \mathcal{O}_ U)) \ar[d] \\ & X \ar[r] & \mathop{\mathrm{Spec}}(\Gamma (X, \mathcal{O}_ X)) }$

The morphism $j$ is closed by Morphisms, Lemma 29.41.7 combined with the fact that an integral morphism is universally closed (Morphisms, Lemma 29.44.7) and the fact that the vertical arrows are in the diagram are separated. On the other hand, $j$ is open because the horizontal arrows in the diagram of the lemma are open by Properties, Lemma 28.18.4. Thus $j$ identifies $U$ with an open and closed subscheme of $U'$. If $U \not= U'$ then $U$ isn't dense in $U'$ and a fortiori not dense in the spectrum of $\Gamma (U, \mathcal{O}_ U)$. However, the scheme theoretic image of $U$ in $\mathop{\mathrm{Spec}}(\Gamma (U, \mathcal{O}_ U))$ is $\mathop{\mathrm{Spec}}(\Gamma (U, \mathcal{O}_ U))$ because any ideal in $\Gamma (U, \mathcal{O}_ U)$ cutting out a closed subscheme through which $U$ factors would have to be zero. Hence $U$ is dense in $\mathop{\mathrm{Spec}}(\Gamma (U, \mathcal{O}_ U))$ for example by Morphisms, Lemma 29.6.3. Thus $U = U'$ and we win. $\square$

In your comment you can use Markdown and LaTeX style mathematics (enclose it like $\pi$). A preview option is available if you wish to see how it works out (just click on the eye in the toolbar).