Question about inclusion map of an open set of a scheme

affine-schemesalgebraic-geometryschemes

I am getting confused with a very basic concept about schemes and I would appreciate clarifications.
Let $(X, O_X)$ be a scheme. I have two affine open subsets $U' \subseteq U$ and say $(U, O_X|_U) \cong \operatorname{Spec}S$
and $(U', O_X|_{U'}) \cong \operatorname{Spec}R$.

Since $U' \subseteq U$ we have a morhphism of schemes $(U', O_X|_{U'}) \to (U, O_X|_{U})$, where the map of underlying sets is an inclusion $U' \to U$ and the map of sheaves is the restriction maps of $X$.

Taking the map of global sections gives
$$
\phi: S \cong \Gamma(U, O_{X}) \to \Gamma( U', O_X|_{U'} ) \cong R
$$

and I know that this induces
$\operatorname{Spec}R \to \operatorname{Spec}S$ where the map of underlying sets is given by taking $\phi^{-1}$.

I am sure that $\operatorname{Spec}R \to \operatorname{Spec}S$ is really the "same" as the open immersion $(U', O_X|_{U'}) \to (U, O_X|_{U})$ I started with. How can I show that this is indeed the case?

Best Answer

Originally posted in the comments:

What you're doing here is applying these functors back to back, right? You can write $\operatorname{Spec} \phi$ as $\operatorname{Spec} \Gamma(U',\mathcal{O}_X) \to \operatorname{Spec} \Gamma(U,\mathcal{O}_X)$ and therefore $\operatorname{Spec} \phi: \operatorname{Spec} R \to \operatorname{Spec} S$ is isomorphic to $U'\to U$ because $\operatorname{Spec}\circ \Gamma$ is isomorphic to the identity functor.

Related Question