# Functoriality of Morphisms to Affine Scheme

It is known that $\text{Mor}(X,Y)$ is in bijective correspondence with $\text{Hom}(\mathcal{O}_Y(Y), \mathcal{O}_X(X))$, provided $Y$ is an affine scheme. I do not understand a small but crucial part of the surjectivity statement, and my question concerns this.

Suppose $Y=\text{Spec} A$ and $X$ is covered by affine subschemes: $\{U_i=\text{Spec} B_i\}_i$. If we are given a ring morphism $\phi :A=\mathcal{O}_Y(Y)\rightarrow \mathcal{O}_X(X)$, $\phi$ can be composed with restriction maps to give $\phi_i : A \rightarrow \mathcal {O}_X(U_i) = B_i$. Then $\phi_i^{-1}$ induces affine scheme morphism $f_i:\text{Spec} B_i \rightarrow \text{Spec} A$.

Now supposedly these affine scheme morphisms should agree on intersections. If they agree, the morphisms can be glued to obtain a morphism from $X$ to $Y$, and this gives the surjectivity. But I do not understand why any two morphisms should ever agree on the intersection. Qing Liu says that they should somehow obviously agree on affine subsets of the intersection, and I do not understand why that should happen either. Could anyone please be kind enough to explain this supposed triviality to me?

If anyone still has the patience to read, let me explain what I am worried about in the supposed compatibility. You see, scheme structure of $X$ imposes no restriction whatsoever to the isomorphisms $U_i \cong \text{Spec} A_i$. If we composed some nontrivial scheme automorphism of $\text{Spec} A_i$ with this isomorphism (say, the automorphism on $\text{Spec} R[x,y]$ induced by exchange of $x$ and $y$) and replace the original morphism, then even if morphisms $\{\text{Spec} A_i\rightarrow \text{Spec} R\}$ previously agreed, the effect of the automorphism might cause the morphisms to agree no longer. Maybe such automorphism has no effect when composed with restriction map from ring of global sections?? At least this seemed to be the case when I tried this with affine subsets of projective 2-space $\mathbb P_R^2$.

• You must fix the isomorphisms $U_i \cong \operatorname{Spec} A_i$ in advance – but there is a canonical choice. Also, you can always assume that your affine open cover has the property that if $U$ is in the cover and $U'$ is an affine open subscheme of $U'$ then $U'$ is also in the cover. – Zhen Lin Oct 1 '15 at 7:24
• but even if the structure is fixed in advance, we can always construct a new scheme with $f:U_i \cong \text{Spec }A_i$ replaced by another isomorphism $f'$ such that compatibility may fail, can't we? I mean, the affine structure of a scheme imposes no restriction whatsoever as to how the affine structure is to be given. The said canonical choice need not be the case in giving the affine structure. – finnlim Oct 3 '15 at 5:02
• I think that while fixing the isomorphisms $U_i\cong\operatorname{Spec} A_i$ you also fix how their intersections mesh inside the structure sheaf. Otherwise even $\mathcal{O}_X$ is not a well-defined sheaf. – Jyrki Lahtonen Oct 3 '15 at 5:19
• could you be a bit more specific? im a bit confused here. – finnlim Oct 3 '15 at 14:54

For any affine open $W \subset U_i \cap U_i$ you will have a commutative diagram $$\begin{array} AA & {\longrightarrow} & \mathcal{O}_X(X) & {\longrightarrow} & \mathcal {O}_X(U_i) = B_i\\ & & \downarrow & & \downarrow\\ & & \mathcal {O}_X(U_j) = B_j & {\longrightarrow} &\mathcal {O}_X(U_i \cap U_i)& {\longrightarrow} &\mathcal {O}_X(W)\\ \end{array}$$ inducing a commutative diagram (since Spec is functorial)
$$\begin{array} ASpec \mathcal {O}_X(W)& {\longrightarrow} & Spec B_i\\ \downarrow & & \downarrow\\ Spec B_j & {\longrightarrow} & Spec A\\ \end{array}$$ So both morphisms agree on all affine subsets of the intersections, and so on the intersections themselves.
Regarding your last concern, better if we drop the letters $B_i$, $A$, etc? That is, replace them by $\mathcal {O}_X(U_i)$, $\mathcal {O}_Y(Y)$, etc., and only use the canonical isomorphisms $U_i = Spec \mathcal {O}_X(U_i)$ for affine open subsets.
• @heinrich I have a silly doubt. Why do we need to go to an affine open subset of $W\subset U_i\cap U_j$? From the diagram it is clear that $A\rightarrow \mathcal{O}_{X}(U_i)\rightarrow\mathcal{O}_{X}(U_i\cap U_j)$ and $A\rightarrow \mathcal{O}_{X}(U_j)\rightarrow \mathcal{O}_{X}(U_i\cap U_j)$ are same. Doesn't this imply the morphisms from $Spec(B_i)\rightarrow Spec(A)$ agree on intersections? – Babai Nov 12 '15 at 20:59