TITLE: Maps to projective space determined by a line bundle
QUESTION [22 upvotes]: The following should be pretty standard for any algebraic geometer.
Let $X$ be a compact complex variety, and let $L$ be a line bundle on $X$.  We say $L$ is 'generated by global sections' if for every point $p$ in $X$, there is a global section of $L$ which doesn't vanish.  If this is true, then $L$ determines a map to a projective space in the following way.  The global sections of $L$ are finite dimensional, so choose a basis $(a_i)$.  Then send a point $p$ in $X$ to the projective point 
$$
[a_1(p):a_2(p):...:a_n(p)]
$$  
It should be noted that $a_i(p)$ is only a point in the fiber of $L$ over $p$, and not a complex number. By choosing an isomorphism from the fiber over $p$ to $\mathbb{C}$, the $a_i(p)$ can be identified with complex numbers.  The ambiguity introduced in choosing this isomorphism dissappears when taking the projective coordinates.
This constructions is remarkably ad hoc for something that ends up being foundational in algebraic geometry.  It requires the variety be over $\mathbb{C}$, and requires that some inconsequential choices be made enroute.
My question is, what are nicer, more intrinsically algebraic ways to construct this map?  Three ways this construction could be nicer:

It could work over other fields, or possibly even over $\mathbb{Z}$ (though then its less clear what a line bundle should be).
It could give a good intuitive justification of why this map is a natural and powerful thing to look at.
It could lend itself to generalizations in different directions.  For instance, a rank n vector bundle V with 'enough global sections' (in some sense) should determine a map from X to $Hom_{\mathbb{C}}(\Gamma(V),\mathbb{C}^n)//GL(n)$ (where this is a GIT quotient).

Aside.  Is there even a good name for this construction?  The "map to projective space determined by a line bundle" is a bit long-winded.

REPLY [11 votes]: This answer is meant as (1) the stacky answer Ben anticipated, and (2) an answer addressing the generalization to higher rank bundles. The basic thing I assume you know (or are willing to take as definition) is that a morphism from $X$ to a quotient stack $[Y/G]$ is equivalent to the data of a $G$-torsor $P\to X$, and a $G$-equivariant morphism $P\to Y$. For $BG=[*/G]$, it's just the data of a $G$-torsor, since there's only one possible choice of map to a point.
First, the stacky interpretation. A choice of a line bundle $\mathcal L$ on a scheme $X$ is equivalent to a morphism to the stack $\def\GG{\mathbb G} B\GG_m$; the $\GG_m$-torsor is the complement of the zero section in the total space $\mathbb V(\mathcal L)$. A choice of a line bundle together with $n$ sections is equivalent to a morphism $f:X\to\def\AA{\mathbb A} [\AA^n/\GG_m]$; the $\GG_m$ torsor is the complement of the zero section of $\mathcal L$, and the $n$ map to $\AA^n$ is given by the $n$ regular functions which are the pullbacks of the sections. The condition that $f$ misses the one stacky point of $[\AA^n/\GG_m]$ (i.e. the point where the $\GG_m$ doesn't act freely)—and therefore factors through the open subscheme $[(\AA^n\smallsetminus 0)/\GG_m]=\mathbb P^{n-1}$ —is precisely the condition that the sections do not all vanish at the same point.
Now the generalization. A rank $k$ vector bundle $\def\E{\mathcal E} \E$ on a scheme $X$ is equivalent to a morphism to the stack $BGL_k$; the $GL_k$-torsor is the sheaf $\def\O{\mathcal O} Isom(\O^k,\E)$. A vector bundle together with a choice of $n$ sections is equivalent to a morphism $f:X\to [(\AA^k)^n/GL_k]$; again, the $GL_k$-torsor is $Isom(\O^k,\E)$, and the $k\cdot n$ regular functions on the torsor are given by the pullback of the $n$ sections of $\E$, and the fact that the pullback of $\E$ is canonically identified with $\O^k$. Regarding $(\AA^k)^n$ as the space of $k\times n$ matrices, the stacky locus of $[(\AA^k)^n/GL_k]$ (i.e. the points with non-trivial stabilizers) is the locus where the rank of the matrix is less than $k$. So the condition that $f$ misses the stacky locus is equivalent to the condition that the $n$ given sections span the fiber of $\E$ at any point. The non-stacky locus is the open subscheme $[${$k\times n$ matrices of rank $k$}$/GL_k]$, the Grassmannian of $k$-planes in $n$-space, $Gr(k,n)$. We therefore have the following interpretation.

A vector bundle $\E$ on a scheme $X$, together with $n$ sections $s_1,\dots, s_n$ which span every fiber is equivalent to a morphism $X\to Gr(k,n)$.

If you don't want to dirty things up by choosing the sections, you can replace $(\AA^k)^n$ by $Hom(\Gamma(\E),\mathbb C^k)$ everywhere. The non-stacky locus is then the space of surjective linear maps. Then it looking at kernels, it looks like you naturally get $Gr(n-k,n)$ instead of (the isomorphic) $G(k,n)$. I'm sure this has something to do with a dualization involved in forming the total space of a locally free sheaf; it still regularly confuses me, so I'll just leave this thread loose.