Suppose I have a morphism of affine schemes $(f, f^\sharp) : \operatorname{Spec} A \to \operatorname{Spec} B$, then my question is - why does the diagonal morphism $(\Delta_f, \Delta_f^\sharp) : \operatorname{Spec} A \to \operatorname{Spec} A \times_{\operatorname{Spec} B} \operatorname{Spec} A = \operatorname{Spec} (A \otimes_B A)$ correspond the following morphism of rings $\phi : A \otimes_B A \to A$ given by $\phi(a \otimes a') = a\cdot a'$?
This was my attempt to try and asnwer that. I know that we have the result that $$\operatorname{Hom}_{\textsf{Sch}}\left(\operatorname{Spec} A, \operatorname{Spec} (A \otimes_B A)\right) \cong \operatorname{Hom}_{\textsf{Ring}}(A \otimes_B A, A)$$ with the bijection given by $(g, g^\sharp) \mapsto g^\sharp_{\operatorname{Spec} A}$ so one possible way to show that the diagonal morphism does correspond to the claimed morphism of rings would be to show that ${\Delta_f}_{_{\operatorname{Spec} A}}^\sharp = \phi$ but I was unable to actually verify this.
Another thing I was thinking of was the following. If I let $(p_1, p_1^\sharp) : \operatorname{Spec} (A \otimes_B A) \to \operatorname{Spec} A$ denote the projection map that comes with the fibered product, then we know that $p_1 \circ \Delta_f = 1_{\operatorname{Spec} A}$ the identity map on $\operatorname{Spec} A$. Now I guess, (but I cannot show), that the morphism $(p_1, p_1^\sharp)$ corresponds to the morphism of rings $\iota : A \to A \otimes_B A$ given by $\iota(a) = a \otimes_B 1_A$, because then we see that $\phi \circ \iota = 1_A$ the identity map on $A$.
If it were the case that the morphism $(p_1, p_1^\sharp)$ corresponds to $\iota$, then since taking global sections is a contravariant functor (and really what that bijection above is) I would see that ${\Delta_f}_{_{\operatorname{Spec} A}}^\sharp\circ \iota = 1_A$ as well, but this isn't enough to prove that ${\Delta_f}_{_{\operatorname{Spec} A}}^\sharp = \phi$.
So I have in addition two further follow up questions in addition to the original one:
- How does one prove that the morphism $(p_1, p_1^\sharp)$ corresponds to $\iota$?
- Is there a more efficient way to prove that a morphism of schemes corresponds to a morphism of rings?
If it is relevant, you can assume that the construction of the fibered product I am working with is the same one given in Theorem 3.3 in Hartshorne's book.