# Open covering of a scheme and global sections

Let $X$ be a scheme. For a global section $f\in\Gamma(X,\mathcal O_X)$, let $X_f=\{x\in X\mid f_x\not\in\mathfrak m_x\}$. For $f_1,...,f_n\in\Gamma(X,\mathcal O_X)$, I wish to know if the following claim is true: $$X_{f_1}\cup\cdots\cup X_{f_n}=X\iff (f_1,...,f_n)=\Gamma(X,\mathcal O_X).$$

In the case that $X={\rm Spec}\ A$ is an affine scheme, $X_f$ is just the distinguished open subset $D(f)$, and the claim can be proven easily.

In general, I can show only one direction. Suppose $(f_1,...,f_n)=\Gamma(X,\mathcal O_X)$. Fix $x\in X$ and let $\rho_x:\Gamma(X,\mathcal O_X)\to\mathcal O_{X,x}$ be the natural map. Then $\rho_x^{-1}(\mathfrak m_x)$ is a prime ideal of $\Gamma(X,\mathcal O_X)$, so $f_i\not\in\rho_x^{-1}(\mathfrak m_x)$ for some $i$. But then $(f_i)_x=\rho_x(f_i)\not\in\mathfrak m_x$ and so $x\in X_{f_i}$. Since $x$ was chosen arbitrarily, $X=X_{f_1}\cup\cdots\cup X_{f_n}$.

Is the other direction of the claim true? If not, what is a counterexample?

The converse fails. Let $X$ be the affine plane over a field $k$ minus the origin. This is a non-affine scheme with $\Gamma(X,\mathscr{O}_X)=\Gamma(\mathbf{A}_k^2,\mathscr{O}_{\mathbf{A}_k^2})=k[T_1,T_2]$ (the restriction map in the other direction is an isomorphism and this is the inverse). We have $X_{T_i}=D(T_i)\cap X$ for $i=1,2$. If $\mathfrak{p}$ is any prime of $k[T_1,T_2]$ other than the maximal ideal $(T_1,T_2)$ (which is the closed point we have removed), then $\mathfrak{p}$ is in one of the $X_{T_i}$. So $X=X_{T_1}\cup X_{T_2}$. But the global sections $T_1,T_2$ do not generate the unit ideal in $\Gamma(X,\mathscr{O}_X)$.
For a general scheme $X$ and any invertible $\mathscr{O}_X$-module $\mathscr{L}$, we can define, for any global section $s\in\Gamma(X,\mathscr{L})$, the set $X_s=\{x\in X:s_x\notin\mathfrak{m}_x\mathscr{L}_x\}$. This is an open set, the locus where (roughly speaking) $s$ gives a basis for $\mathscr{L}$, and $s$ gives a trivializing section on $X_s$, i.e., the map $1\mapsto s\vert_{X_s}:\mathscr{O}_X\vert_{X_s}\to\mathscr{L}\vert_{X_s}$ is an isomorphism. For a collection of sections $s_i\in\Gamma(X,\mathscr{L})$, we say that the $s_i$ generate $\mathscr{L}$ if the induced map $\mathscr{O}_X^{(I)}\to\mathscr{L}$ is surjective. Since surjectivity of a map of $\mathscr{O}_X$-modules can be checked on stalks, one has that the $s_i$ generate $\mathscr{L}$ if and only if $X=\bigcup_i X_{s_i}$. The example above shows that, on a non-affine scheme $X$, it's possible for global sections of even the trivial invertible sheaf $\mathscr{O}_X$ to generate $\mathscr{O}_X$ in the aforementioned sense without generating the unit ideal in $\Gamma(X,\mathscr{O}_X)$.