Relative affine schemes I was reading these 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.
 A: This is closely related to the resolution property [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]: 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], 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], 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$
