Sheaf Theory: Structure sheaf of fiber product scheme

Let $X = Spec(A)$ and $Y = Spec(B)$ be affine schemes where $A$ and $B$ are $k$-algebras. Then it is known that their fiber product is given by \begin{equation} X\times_{Spec(k)} Y = Spec(A\otimes_k B). \end{equation} Then I guess the structure sheaf $\mathscr{O}_{X\times_{Spec(k)} Y}$ is just a usual structure sheaf defined on each basic open sets $D(h) \subset X\times_{Spec(k)} Y, h \in A\otimes_k B$ by $\mathscr{O}_{X\times_{Spec(k)} Y}(D(h)) = (A\otimes_k B)_h$ and extended to arbitrary open subset $U \subset X\times_{Spec(k)} Y$ by the projective limit $\mathscr{O}_{X\times_{Spec(k)} Y}(U) = \varprojlim_{D(h) \subset U} \mathscr{O}_{X\times_{Spec(k)} Y}(D(h))$. Then is it true or not that

1. $\mathscr{O}_{X\times_{Spec(k)} Y} = p^{-1}_X \mathscr{O}_X \otimes_k p^{-1}_Y\mathscr{O}_Y$? ($p_{X,Y}: X\times_{Spec(k)} Y \rightarrow X,Y$ are the projections).
2. The basis of the topology of $X\times_{Spec(k)} Y$ is given by $\{D(f)\times_{spec(k)}D(g) = Spec(A_f\otimes_k B_g)|f \in A, g \in B\}$?

How do I show that these are true, or otherwise, what is the nicest way to relate $\mathscr{O}_{X\times_{Spec(k)} Y}$ to $\mathscr{O}_X$ and $\mathscr{O}_Y$?

I was hoping that (1.) is true and it seems to me that if (2.) were true it wouldn't be too hard to proof (1.). My thought on this is that for a basic open sets of type $h = f\otimes_k g$ it is quite clear that $D(f\otimes_k g) = Spec((A \otimes_k B)_{f\otimes_k g}) = Spec(A_f\otimes_k B_g) = D(f)\times_{Spec(k)}D(g)$. But I have no idea what do say when $h$ is not a pure tensor.

Neither of these claims are true, and the reason is essentially that "The topology on $X\times Y$ is not the product topology". This is more or less the claim you're making in part $2)$, and then this failure causes $1)$ to fail. The fact that the topology isn't just the product topology is maybe not entirely surprising at the level of schemes (since the product itself isn't even the product as sets), but I think it is relatively surprising if you're thinking about this on the level of classical varieties, where you can just define the set of the product as the usual product, but then have to work harder to define the topology. This difference is because one of the main advantages of using schemes rather than classical varieties is that the points of a scheme contain a lot of information about the topology then the points of the classical variety (which are just the closed points of the scheme).

An example where $2)$ fails is where $X = Y = \mathbb{A}^1_k$, with $k = \bar{k}$ for simplicity. Then any non-empty open set in $\mathbb{A}^1_k$ is just the complement of a finite set of (closed) points. Explicitly, any open set is of the form $D(f)$ for some $f$ and corresponds to the complement of the roots of $f$. Then the product $D(f) \times_k D(g) = \pi_X^{-1}(D(f)) \cap \pi_Y^{-1}(D(g))$ corresponds to the complement of a finite union of lines in $\mathbb{A}^2_k$, corresponding to vertical lines corresponding to the roots of $f$ and horizontal lines corresponding to the roots of $g$. Note that a union of sets of this form is still of this form, so the topology generated by these sets is simply their union. In particular, there are many open sets not of is form, e.g. the diagonal $D(X-Y)$, so the actual topology is much richer than the product topology.

Moreover, $1)$ is also not true. You could probably just compute the product of the preimage sheaves in the example above, but there is an easier way that fits in with the philosophy used above that the product of schemes is more than just the naïve product. As well as the topology not being the product topology, the set is not even the product of the sets! In particular, there may be distinct points in the product that project to the same points in $X$ and $Y$. To see that this is a problem, note that:

$$(\pi^{-1}_X \mathcal{O}_X \otimes \pi^{-1}_Y\mathcal{O}_Y)_z \cong (\pi^{-1}_X \mathcal{O}_X)_z \otimes_k (\pi^{-1}_Y\mathcal{O}_Y)_z \cong \mathcal{O}_{X, \pi_X(z)} \otimes_k \mathcal{O}_{Y,\pi_Y(z)}$$

And so in particular, points with the same projections to $X$ and $Y$ should have the same stalks. However, with our example above, notice that the primes $(X-Y)$ and $(0)$ both map to the generic point under either projection to $\mathbb{A}^1$, and so the stalks of the product sheaf at both points are the same. However, the stalks of the structure sheaf are different (and we can even see this without calculation, the local rings have different dimensions since the closures of the two points have different codimension in $\mathbb{A}^2_k$).

As Paf points out in the comments to your question, you can look at this post on mathoverflow for a little more discussion on what the points of the fibre product are, and what stalks of the structure sheaf of the product are at said points. In particular there are a wealth of points that where the product sheaf will have the same stalks, but the structure sheaf won't. Notice that the same argument will extend to show that we can't even replace the tensor product of the preimage sheaves with the tensor product of the pullback sheaves, or any other reasonable extension.

• This is such a great answer. Thank you for writing this! The fact that $(x-y)$ and $(0)$ both project to the generic point of $\mathbb{A}^{1}$ is not a hard fact, but I wish algebraic geometry books would mention these facts rather explicitly. – Prism Aug 2 '16 at 16:28
• @Prism I'm glad you thought it was useful! Yeah, most texts I've read focus on the construction of the fibre product either via functors or (in some sense equivalently) via "gluing by universal property" which ends up with a relatively inexplicit description of the points and topology. Perhaps this is because thinking about things in this way is the "wrong way" to be thinking, with the "right way" being the functor of points approach, that is an object is best understood "relatively" by the morphisms it admits, rather than "absolutely" by it's points (or other internal structures). – Tom Oldfield Aug 3 '16 at 4:41
• I think this is especially true for the fibre product, since this is defined exactly by the allowable morphisms from an arbitrary scheme to it. From this perspective, the fact that the projections to each factor don't determine the points of the fibre product is uninteresting, because two morphisms to the fibre product agree exactly when the projections of these morphisms agree. – Tom Oldfield Aug 3 '16 at 4:44