Affine Schemes and Basic Open Sets

Reading through a proof that a scheme is locally Noetherian if and only if every open, affine subscheme is induced by a Noetherian ring I came across the following which did not seem as obvious to me as it did to the person writing the proof.

Suppose $X=\mathrm{Spec} \ A$ is an affine scheme, and $U=\mathrm{Spec} \ B$ is an open, affine subscheme. Furthermore, if for some $f\in A$, $X_{f}\subset U$, letting $g$ be the image of $f$ in $B$ (via the restriction map), is it the case that $X_{f}=U_{g}$?

The restriction of $X$ to $U$ is isomorphic to $(\mathrm{Spec} \ B, \mathcal{O}_{\mathrm{Spec} \ B})$, but the associated homeomorphism could be quite complicated, so although $X_{f}$ will be mapped to an open set, I'm not sure why it would necessarily be $U_{g}$. Any help would be much appreciated.

Yes, this is true. Note that $X_f$ is just the set of points $p\in X$ such that the image of $f$ in the stalk $\mathcal{O}_{X,p}$ is not in the maximal ideal. On the other hand, $U_g$ is the set of points $p\in U$ such that the image of $g$ in the stalk $\mathcal{O}_{U,p}$ is not in the maximal ideal. But these two conditions are identical: the stalks $\mathcal{O}_{X,p}$ and $\mathcal{O}_{U,p}$ are the same, and the image of $f$ in $\mathcal{O}_{X,p}$ is the same as the image of $g$ in $\mathcal{O}_{U,p}$ since $g$ is the restriction of $f$.

(Note that none of this has anything to do with affine schemes in particular. The same argument would apply if $(X,\mathcal{O}_X)$ was any locally ringed space, with $f\in \mathcal{O}_X(X)$ some global section and $g$ the restriction of $f$ to $\mathcal{O}_X(U)$.)

• Am I right in thinking then that this relies, in an essential way, on a scheme morphism taking the maximal ideal in a stalk to the corresponding maximal ideal in the corresponding stalk? Is there are a way to prove this result without referencing stalks? – MadChickenMan Feb 12 '18 at 0:33
• Well, not really, because we aren't talking about arbitrary scheme morphisms: we're only talking about open subschemes, for which the stalks are trivially isomorphic (and so in particular send the maximal ideal to the maximal ideal). – Eric Wofsey Feb 12 '18 at 0:40
• If you want to avoid mentioning stalks, you can just cover $U$ by subsets that are distinguished open subsets of both $\operatorname{Spec} A$ and $\operatorname{Spec} B$. The intersection of $X_f$ with each such set is just the distinguished open subset defined by the restriction of $f$, and similarly for $U_g$. But the restriction of $f$ and the restriction of $g$ are the same, and so the intersections of $X_f$ and $U_g$ with each of our sets covering $U$ is the same. – Eric Wofsey Feb 12 '18 at 0:43
• Or, you can say that $X_f$ is the union of all open subsets of $X$ on which the restriction of $f$ is invertible. This definition obviously gives the same answer when you apply it to $U_g$. – Eric Wofsey Feb 12 '18 at 0:44
• Really, how you say it just depends on your definition/what you know about $X_f$. In all cases, the point is that the definition just involves properties of restrictions of $f$, and the restrictions of $f$ are the same as the restrictions of $g$. – Eric Wofsey Feb 12 '18 at 0:45