# Sufficient condition for a locally ringed space to be an affine scheme

Let $X$ be a locally ringed space. Let $\mathcal{O}$ be its structure sheaf. Let $A = \Gamma(X, \mathcal{O})$. Let $x \in X$. Let $m_x$ be the maximal ideal of $\mathcal{O}_x$. Let $f \in A$. We denote by $f_x$ the image of $f$ by the canonical homomorphism $A \rightarrow \mathcal{O}_x$. We denote by $f(x)$ the image of $f_x$ by the canonical homomorphism $\mathcal{O}_x \rightarrow \mathcal{O}_x/m_x.$ We write $X_f = \{x \in X|\ f(x) \neq 0\}$. Is the following proposition true?

Proposition

(1) $X_f$ is open for every $f \in A$.

(2) Let $f_1,\dots,f_n$ be elements of $A$. Suppose $A = (f_1,\dots,f_n)$ and $X_{f_i}$ is an affine scheme for every $i$. Then $X$ is an affine scheme.

EDIT As Zhen Lin and QiL pointed out, (2) is probably false. However, if $X$ is a Noetherian topological space, (2) is true.

EDIT2 As QiL's edited answer shows, (2) is true after all. I leave the previous EDIT as it is for the sake of honesty.

EDIT3 This is just a remark. Suppose $A = (f_1,\dots,f_n)$. I will show that $X = \bigcup X_{f_i}$. There exist $a_1,\dots,a_n \in A$ such that $1 = a_1f_1 + \cdots + a_nf_n$. Let $x \in X$. Then $1 = a_1(x)f_1(x) + \cdots + a_n(x)f_n(x)$. Hence $f_i(x) \neq 0$ for some $i$. Hence $x \in X_{f_i}$ as desired.

-
Proposition (2) is probably false. If I'm not mistaken, a punctured affine plane has a cover by open affine subsets of the form you ask for, but is not itself affine. – Zhen Lin Nov 24 '12 at 14:03
@ZhenLin I think your example is not a counter-example. Please see my EDIT. – Makoto Kato Nov 24 '12 at 19:59

(2) is true. if $X$ is a scheme quasi-compact and quasi-separated (e.g. $X$ has a finite covering by affine open subsets $U_i$ and $U_i\cap U_j$ are also covered by finitely many affine open subsets. This is an exercise in Hartshorne. Note first that under the hypothesis of (2), $X$ is a quasi-compact scheme because it is the union of the affine open subsets $X_{f_i}$. Second, as Keenan pointed out in the comment, $X$ is quasi-separated because $X_{f_i}\cap X_{f_j}$ is actually affine being a standard open subset in $X_{f_i}$ defined by $f_j|_{X_{f_i}}\in O(X_{f_i})$. This implies that for all $f\in A$, $\Gamma(X_f, O_X)=A_f$.

Now consider the canonical map $f : X\to \mathrm{Spec}A=:Y$. For any $i$, $X_{f_i}$ is then isomorphic to $Y_{f_i}$. As the $f_i$'s generate $A$, $X$ (resp. $Y$) is the union of the $X_{f_i}$'s (of the $Y_{f_i}$'s). So $f$ is isomorphism.

If $X$ is not quasi-separated, there is probably a counterexample.

-
Dear @QiL, I'm probably missing something, but it seems to me that the hypotheses of (2) imply that $X$ is quasi-separated, because $X_{f_i}\cap X_{f_j}=X_{f_if_j}$ is necessarily standard open in $X_{f_i}$, i.e., the standard open associated to the image of $f_if_j$ in $\mathscr{O}_X(X_{f_i})$. Hartshorne's exercise doesn't assume at the outset that $X$ is qs. The previous exercise, to prove that for $X$ qcqs, $\mathscr{O}_X(X_f)=\mathscr{O}_X(X)_f$, does make this assumption. – Keenan Kidwell Nov 24 '12 at 20:52
Dear @KeenanKidwell: very good ! And $X$ is quasi-compact because it is union of the $X_{f_i}$'s ! I will edit the answer. – QiL'8 Nov 24 '12 at 20:58

(1) Note $f(x) \ne 0$ iff $f_x$ is invertible in $\mathcal{O}_x$ which is equivalent to the existence of an open neighborhood $U$ of $x$ such that the restriction of $f$ to $U$ is invertible in $\Gamma(U, \mathcal{O})$. Hence $X_f$ is precisely the union of those open subsets $U$ such that $f|_U$ is invertible, and hence is open.

-
 +1 for the good concise proof. – Makoto Kato Nov 24 '12 at 13:57