An algebraic vector bundle is trivialized by open sets. How many does one need?

This is true if we assume that the vector bundles has constant rank (it is clearly false if we allow vector bundles to have different ranks at different points). Let $U_1$ be an open dense subset of $X$ over which $E$ is trivial, and let $H_1$ be a hypersurface containing the complement of $U_1$. Then $E$ is trivial over $X \smallsetminus H_1$. Now, it is easy to see that there exists an open subset $U_2$ of $X$, containing the generic points of all the components of $H_1$, over which $E$ is trivial (this follows from the fact that a projective module of constant rank over a semi-local ring is free). Let $H_2$ be a hypersurface in $X$ containing the complement of $U_2$, but not containing any component of $H_1$. Then we let $U_3$ be an open subset of $X$ containing the generic points of the components of $H_1 \cap H_2$, and let $H_3$ be a hypersurface containing the complement of $U_3$, but not the generic points of the components of $H_1 \cap H_2$. After we get to $H_{n+1}$, the intersection $H_1 \cap \dots \cap H_{n+1}$ will be empty, and the complements of the $H_i$ will give the desired cover.

[Edit]: now that I think about it, you don't even need the hypersurfaces, just define the $H_i$ to be complement of the $U_i$.


This is an answer to Georges' updated question at the end of his post.

An equivalent formulation of the question is the following:

Question Let $L$ be an ample Cartier divisor on a projective scheme $X$ and suppose there exist effective divisors $D_1, D_2$ such that $L\sim D_1-D_2$. Then is it true that $X\setminus \left({\rm supp}\,D_1 \cup {\rm supp}\,D_2\right)$ is affine?

I think this is true in some cases, but not in general.

Claim 1 The answer to the question is YES if $X$ is a projective curve.

Proof Both $D_1$ and $D_2$ are effective and hence ample and similarly so is $A=D_1+D_2$. Clearly $X\setminus \left({\rm supp}\,D_1 \cup {\rm supp}\,D_2\right)=X\setminus {\rm supp}\, A$, which is affine. $\square$

Claim 2 There are many examples for smooth projective varieties for which there exists $L, D_1, D_2$ as above such that $X\setminus \left({\rm supp}\,D_1 \cup {\rm supp}\,D_2\right)$ is not affine. In fact, this happens on any smooth projective surface containing a $(-1)$-curve.

Remark I am pretty sure one does not need smoothness and there are also singular examples. (Actually the example below only needs one smooth point.)

Proof Let $Y$ be an arbitrary projective variety (reduced) of dimension at least $2$ and $H$ an effective (very) ample Cartier divisor on $Y$. Let $\sigma : X\to Y$ be the blow up of a smooth point $p\in Y$ that is not contained in $H$ and let the exceptional divisor of $\sigma$ be $E\subset X$.

Then for some $m>0$ positive integer, $L=m\sigma^*H-E$ is ample. (I suspect that most people know this, but if you need a hint for this statement, an explicit estimate on $m$ can be found in Lemma 2 of this answer to another MO question.)

Now let $D_1=m\sigma^*H$ and $D_2=E$. Notice that by the choice of the point that was blown up, $D_1$ and $D_2$ are disjoint. It follows that $X\setminus \left({\rm supp}\,D_1 \cup {\rm supp}\,D_2\right)\simeq (Y\setminus {\rm supp}\, H)\setminus \{p\}$. Furthermore, since $H$ is ample on $Y$, it follows that $Y\setminus {\rm supp}\, H$ is affine, and hence $(Y\setminus {\rm supp}\, H)\setminus \{p\}$ is not. $\square$

It is actually true, that for any line bundle there always exists a rational section for which the complement of its divisor is affine.

Claim 3 Let $L$ be an arbitrary Cartier divisor on a projective scheme $X$. Then there exist effective very ample divisors $D_1, D_2$ such that $L\sim D_1-D_2$.

Proof Choose an arbitrary ample Cartier divisor $A$ on $X$. For large enough $r_1\gg 0$ $L+r_1A$ is basepoint-free by the definition (or one of the basic properties depending on what you choose as definition) of ampleness. Then for an even larger $r\gg r_1$ we may assume that $L+rA$ is both basepoint-free and ample and hence very ample and also that $rA$ is very ample as well. Now choose $D_1=L+rA$ and $D_2=rA$. $\square$

And we get as an easy consequence:

Corollary With the notation of Claim 3, we may choose $D_1$ and $D_2$ such that $X\setminus \left({\rm supp}\,D_1 \cup {\rm supp}\,D_2\right)$ is affine.

Proof Replace $D_1$ and $D_2$ with general members of their complete linear systems. Then we may assume that they do not have a common component and hence ${\rm supp}\,(D_1+D_2)={\rm supp}\,D_1 \cup {\rm supp}\,D_2$. Since $D_1+D_2$ is also ample, this proves that claim. $\square$