I was reading [these](http://people.math.harvard.edu/%7Egaitsgde/grad_2009/SeminarNotes/Sept17(Bun(G)).pdf) notes by D. Gaitsgory, and I don't understand a claim he makes about relative affine schemes. Namely, on page 3 he says that if $f: Y \rightarrow X$ is an affine scheme over $X$, then there exist two vector bundles $E\_1$, $E\_2$ over $X$ together with a map $\mathrm{Tot}(E\_1) \rightarrow \mathrm{Tot}(E\_2)$ such that $Y \simeq \mathrm{Tot}(E\_1) \times\_{\mathrm{Tot}(E\_2)} X$, where $X \subset \mathrm{Tot}(E\_2)$ is the zero section. Here $X$ is projective and $f$ is quasi-projective.


I don't understand why this description exists. I agree that locally this is true (simply because $f$ is of finite type, hence we have that $f\_{\ast} \mathcal{O}\_Y$ is locally a finitely generated algebra - I am assuming $X$ is Noetherian), but I don't see why one should be able to glue the local presentations to a global one.


Thanks for the help.


Edit: In the notes everything is done relative to a scheme $S$ and $X \rightarrow S$ is assumed to be flat and projective. However, I think that solving the case $S = \mathrm{pt}$ should already give some insight on why the claim should be true.



Relative affine schemes
This is closely related to the *resolution property* [Tag [0F85](https://stacks.math.columbia.edu/tag/0F85)], so it won't be true in complete generality. Indeed, if $\mathscr F$ is a coherent sheaf on $X = S$ that cannot be given as a quotient of a vector bundle $\mathscr E$ on $S$, then $Y = \mathbf{Spec}\_X \operatorname{Sym}^\* \mathscr F$ cannot be embedded into $\mathbf V\_X(\mathscr E) = \mathbf{Spec}\_X \operatorname{Sym}^\* \mathscr E$ for any vector bundle $\mathscr E$ on $X$ (at least if $S$ is quasi-compact, to be safe). In addition, existence of $\mathscr E\_1$ and $\mathscr E\_2$ imply that $f$ is of *finite presentation*, which is not automatic (the assumptions in the notes only imply that $f$ is of finite type).


However, assuming everything is of finite presentation, it is ok when $S$ is *affine*, so in particular you can do this locally on $S$. Indeed, we can mimic the proof of [Tag [0F87](https://stacks.math.columbia.edu/tag/0F87)]: since $X$ is projective over affine, it has an ample line bundle, and we will use this to construct $\mathscr E\_1$ and $\mathscr E\_2$.


Under the equivalence of [Tag [01SA](https://stacks.math.columbia.edu/tag/01SA)], we can view $f \colon Y \to X$ as the quasi-coherent sheaf of $\mathcal O\_X$-algebras $\mathscr A = f\_\* \mathcal O\_Y$. Since $f$ is of finite presentation, there exists a finite open cover $X = U\_1 \cup \cdots \cup U\_r$ and isomorphisms
$$\mathscr A\big|\_{U\_i} \cong \mathcal O\_{U\_i}\big[x\_{i,1},\cdots,x\_{i,r\_i}\big]\big/\big(f\_{i,1},\cdots,f\_{i,s\_i}\big).$$
By property (5) of [Tag [01Q3](https://stacks.math.columbia.edu/tag/01Q3)], there exists $n \in \mathbf Z$ such that the image of
$$\mathscr E\_1 := \Gamma\big(X,\mathscr A(n)\big)\otimes \mathcal O\_X(-n) \to \mathscr A$$
contains all $x\_{i,j}$. Then the map $\phi \colon \operatorname{Sym}^\* \mathscr E\_1 \to \mathscr A$ is surjective by the choice of the $x\_{i,j}$, giving a closed immersion $Y \hookrightarrow \mathbf V\_X(\mathscr E\_1)$. Likewise, setting $\mathcal I = \ker(\phi)$ gives an $m \in \mathbf Z$ such that the image of
$$\mathscr E\_2 := \Gamma\big(X,\mathcal I(m)\big) \otimes \mathcal O\_X(-m) \to \mathcal I$$
contains elements mapping to each $f\_{i,j}$. This gives a morphism of $\mathcal O\_X$-algebras $\psi \colon \operatorname{Sym}^\* \mathscr E\_2 \to \operatorname{Sym}^\* \mathscr E\_1$ such that the extended ideal of $\operatorname{Sym}^{>0} \mathscr E\_2$ is $\mathcal I$. In other words, $Y$ is the preimage of the zero section under $\mathbf V\_X(\mathscr E\_1) \to \mathbf V\_X(\mathscr E\_2)$. $\square$


