# Morphisms of global sections and Morphisms of Schemes

Question is as follows :

Let $A$ be a ring and let $(X,\mathcal{O}_X)$ be a scheme. Given a morphism $f:X\rightarrow \text{Spec}(A)$ we have an associated map on sheaves $f^{\#}:\mathcal{O}_{\text{Spec}(A)}\rightarrow f_* \mathcal{O}_X$. Taking global sections, we obtain a homomorphism $A\rightarrow \mathcal{O}_X(X)$. Thus there is a natural map $\alpha: \text{Hom}_{\text{Schemes}}(X,\text{Spec}(A))\rightarrow \text{Hom}_{\text{Rings}}(A,\mathcal{O}_X(X)).$ Show that $\alpha$ is bijective.

I need help with showing the map is surjective.

What I have done so far is :

Suppose we are given a scheme $(X,\mathcal{O}_X)$ and a ring homomoprhism $\varphi: A\rightarrow \mathcal{O}_X(X)$. We construct a morphism of schemes $(f,f^{\#}):(X,\mathcal{O}_X)\rightarrow (\text{Spec}(A),\mathcal{O}_{\text{Spec}(A)})$.

We first define morphism of topological spaces $f:X\rightarrow \text{Spec}(A)$. Let $x\in X$, we want to assign a prime ideal $P$ in $A$.

Let $X=\text{Spec}(B)$ and $x=\mathfrak{P}\in X=\text{Spec}(B)$, as we have a ring homomorphism $$\varphi : A\rightarrow \mathcal{O}_X(X)=O_{\text{Spec}(B)}(\text{Spec}(B))=B$$ $\varphi^{-1}(\mathfrak{P})$ is a prime ideal in $A$ and we define $f(x)=\varphi^{-1}(\mathfrak{P})$. This defines a morphism of topological spaces $\text{Spec}(B)\rightarrow \text{Spec}(A)$.

Suppose $X$ is an arbitrary scheme, given $x\in X$ there is no natural choice of prime ideal in $\mathcal{O}_X(X)$ whose inverse in $A$ defines a function $X\rightarrow \text{Spec}(A)$.

Given $x\in X$ we have local ring $\mathcal{O}_x$ which has unique maximal ideal $\mathfrak{m}_x$ which is in particular a parime ideal. We have canonical ring homomorphism $O_X(X)\xrightarrow{\pi} \mathcal{O}_x$ with $s\mapsto s_x$. So, $\pi^{-1}(\mathfrak{m}_x)$ is a prime ideal in $\mathcal{O}_X(X)$, and its inverse image under $\varphi$ namely $\varphi^{-1}(\pi^{-1}(\mathfrak{m}_x))$ is a prime ideal in $A$. We thus have a map $f:X\rightarrow \text{Spec}(A)$ with $x\rightarrow \varphi^{-1}(\pi^{-1}(\mathfrak{m}_x))$.

We prove that $f:X\rightarrow \text{Spec}(A)$ is a continuous map. It suffices to prove $f^{-1}(D(a))$ is an open set in $X$ for each $a\in A$ as $\{D(a)\}_{a\in A}$ is a basis for topology on $\text{Spec}(A)$. We have \begin{align*} f^{-1}(D(a))&=\{x\in X: f(x)\in D(a)\}\\ &=\{x\in X: a\notin f(x)\}\\ &=\{x\in X: a\notin \varphi^{-1}(\pi^{-1}(\mathfrak{m}_x))\}\\ &=\{x\in X: \varphi(a)\notin \pi^{-1}(\mathfrak{m}_x)\}\\ &=\{x\in X: \pi(\varphi(a))\notin \mathfrak{m}_x\}\\ &=\{x\in X: \varphi(a)_x\notin \mathfrak{m}_x\}=X_{\varphi(a)} \end{align*}

Result : Let $Y$ be a scheme, $b\in \mathcal{O}_Y(Y)$ and $Y_b=\{x\in Y : b_x\notin \mathfrak{m}_x\}$. Then $Y_f$ is an open set in $Y$.

Here, $\varphi(a)\in \mathcal{O}_X(X)$. Thus, $X_{\varphi(a)}$ is an open subset of $X$ i.e., $f^{-1}(D(a))$ is an open subset of $X$. So, $f$ is a continuous function.

We now construct morphism of schemes $f^{\#}:\mathcal{O}_{\text{Spec}(A)}\rightarrow f_*\mathcal{O}_X$.

It suffices (hopefully) to define morphisms $$f^{\#}(D(a)):\mathcal{O}_{\text{Spec}(A)}(D(a))\rightarrow f_*\mathcal{O}_X(D(a))=\mathcal{O}_X(f^{-1}(D(a)))=\mathcal{O}_X(X_{\varphi(a)}).$$ As $\mathcal{O}_{\text{Spec}(A)}(D(a))=A_a$, it boils down to defining morphism $f^{\#}(D(a)):A_a\rightarrow \mathcal{O}_X(X_{\varphi(a)})$. We have (??) $\mathcal{O}_X(X_{\varphi(a)})\cong (\mathcal{O}_X)_{\varphi(a)}$ where the right side component is localization of the ring $\mathcal{O}_X(X)$ at $\varphi(a)$. So, it boils down to defining morphism $f^{\#}(D(a)):A_a\rightarrow \mathcal{O}_X(X)_{\varphi(a)}$. Given $\varphi: A\rightarrow \mathcal{O}_X(X)$, we have induced map $A_a\rightarrow \mathcal{O}_X(X)_{\varphi(a)}$ for each $a\in A$. Set $f^{\#}(D(a)): A_a\rightarrow \mathcal{O}_X(X)_{\varphi(a)}$ to be the localization map obtained from $\varphi$.

Only serious gap in this is the assumption that $\mathcal{O}_X(X_{\varphi(a)})\cong (\mathcal{O}_X)_{\varphi(a)}$. While trying to solve this, I thought this has to be true and proceeded assuming this. But I could not prove this. It is however true when $X$ is quasi compact and quasi separated but otherwise I can not use this.

Any suggestions regarding this is welcome.

$$(\mathcal{O}_X)_{\varphi(a)} \rightarrow \mathcal{O}(X_{\varphi(a)}),$$ and $f^{\sharp}$ should be defined as the composition
$$A_a\rightarrow(\mathcal{O}_X)_{\varphi(a)} \rightarrow \mathcal{O}(X_{\varphi(a)}).$$