# Vakil's Foundations of Algebraic Geometry, Exercise 7.3.F

$\DeclareMathOperator{\Spec}{Spec}$ I'm having trouble with the exercise in the title, which states

"Suppose $Z$ is a closed subset of an affine scheme $\Spec A$ locally cut out by one equation. (In other words, $\Spec A$ can be covered by smaller open sets, and on each such set Z is cut out by one equation.) Show that the complement $Y$ of $Z$ is affine."

The comment above the exercise is "The affine-locality of affine morphisms has some nonobvious consequences, as shown in the next exercise.". This let me think that I am supposed to use the fact that Spec A affine implies that

$$\Spec A \to \Spec \mathbb{Z}$$

is affine but I cannot see how this is supposed to prove the statement. I can see that if $Z$ is so defined I can find an open cover $U_i$ of $\Spec A$ where on every $U_i \cap Z = V(f_i)$ for every $i$ but I cannot find a way forward from there.

A hint would be really appreciated. Thanks.

Edit: If I am not mistaken it should follow obviously from the lemma proved here http://stacks.math.columbia.edu/tag/07ZT

Edit: Fixed typo $D(f_i) \to V(f_i)$

• It's not completely clear to me what "cut out by one equation" means, but I don't think your interpretation is correct : if $U_i\cap Z = D(f_i)$, then $Z$ is open since each $D(f_i)$ is open. I would rather say that there is an open cover by some $D(a_i)$ such that $Z\cap D(a_i) = V(f_i)\cap D(a_i)$ for some $f_i\in \Spec A[a_i^{-1}]$. – Captain Lama Apr 9 '16 at 10:30
• Sorry, my mistake. I wanted to write $V(f_i)$ not $D(f_i)$ – Diego Fioravanti Apr 9 '16 at 10:39
• I think the idea is rather to use that $Z\to \Spec A$ is affine. – Captain Lama Apr 9 '16 at 11:21
• I thought about that too, but I cannot see how it should be used. Using the affinity of that map one can prove that there is an affine cover of $Z$ but then what ? I am really struggling to see how this can be used to prove anything about ${Z}^c$ – Diego Fioravanti Apr 9 '16 at 17:36
• Yes, the Stacks Project reference is exactly what you need. – Georges Elencwajg Apr 9 '16 at 19:33

I think it is not the morphism $\operatorname{Spec}(A)\rightarrow \operatorname{Spec}\mathbb{Z}$ that should be considered, but rather the inclusion $\iota: U \rightarrow \operatorname{Spec}(A)$, where $U$ is the complement of $Z$. Using the result that a morphism being affine is an affine local property, we hope to find an affine open cover $V_i$ of $\operatorname{Spec}(A)$, where $U$ intersect each affine open piece (i.e. $\iota^{-1}(V_i)$) is also affine, which would then tell us that $U = \iota^{-1}(\operatorname{Spec}(A)$ is also affine.
The hypothesis says that we may cover $\operatorname{Spec}(A)$ by open subschemes $V_i$, such that $Z\cap V_i$ is locally cut out by some element of $\mathcal{O}_X(V_i)$. By covering each of the $V_i$ with affine pieces if necessary and considering the restriction of each element of $\mathcal{O}_X(V_i)$, we may therefore assume that the $V_i$ are affine open subsets of $\operatorname{Spec}(A)$, say $V_i \cong \operatorname{Spec}(A_i)$, and $Z\cap V_i = V(f_i)$ for some $f_i \in A_i$. In particular, the inclusion $U \cap V_i$ is just the inclusion of the distinguished affine open subset $D(f_i)$, and so is affine, as desired.