Rank of projective module defined as the smallest $n$ such that $P$ is a direct summand of $R^n$

Over a commutative ring $R$, the rank of a projective module $P$ is defined by looking at the map $\text{rank}(P) : \text{Spec}(R) \rightarrow \mathbb{N}_0$ given by $\mathfrak{p}\mapsto \text{rank}_{R_\mathfrak{p}}(P\otimes_RR_\mathfrak{p})$. This makes sense since $P\otimes_RR_\mathfrak{p}$ is projective over $R_\mathfrak{p}$, hence free because $R_\mathfrak{p}$ is local. This map is continuous, so it must be locally constant since $\mathbb{N}_0$ is discrete. If $\text{Spec}(R)$ is connected (i.e. $R$ has no nontrivial idempotents) then this map is constant; finally, the rank of $P$ is defined to be this constant.

Why can't we just define $\text{rank}(P)$ to be the least $n$ such that $P$ is a direct summand of $R^n$ (if $P$ is finitely-generated)? This is well-defined and doesn't require connectedness. Is this useful/used?

• Perhaps I should ask you to clarify: are you asking for situations in which the minimal $n$ such that $P$ is a direct summand of $R^n$ is useful information to have? I have interpreted your question to be rather why this isn't used as the definition of rank (answer below: because it's not equal to the rank). Please do let me know if I am mistaken. Oct 28 '14 at 15:01
• Yes. I'm also wondering if there's a connection to the actual notion of "rank". Oct 29 '14 at 23:23
• The connection is just that there is an inequality: the minimal $n$ such that a projective module $P$ embeds in $R^n$ is at least as big as $\mathrm{rank}(P)$. You could also define the minimal such $n$ as the minimal number of generators for $P$ as an $R$-module. Since for each $m$ there exists a ring $R$ and a projective module of rank one that requires at least $m$ generators there is no inequality in the other direction. Oct 31 '14 at 16:10

You could of course make that definition, but you should call it something other than rank: if $P$ is any projective module that is not free, then it is not a direct summand of $R^{\mathrm{rank}(P)}$ (rank is additive and its complement would therefore be rank $0$ projective, hence $0$). For an explicit example, you have to start with $R$ something other than a polynomial ring (all finitely generated projectives over polynomial rings are free). For an arithmetic example, take any ring $R$ of algebraic integers that is not a UFD (for instance, $R=\mathbb{Z}[\sqrt{-5}]$), and a non-principal ideal $I$ (for instance, $I=(1+\sqrt{-5},2)$). Then $I$ is locally free of rank $1$ since its localizations at prime ideals are all principal, but is not a summand of $R$. For a geometric example, take the coordinate ring of an affine part of an elliptic curve, and any non-trivial line bundle on it. For instance, you could take your ring $R=\mathbb{C}[x,y]/(y^2-x(x-1)(x+1))$ and your module to be the ideal $I=(x,y)$ generated by $x$ and $y$. In analogy with the number ring case, this ideal is locally principal (all localizations of $R$ are regular one-dimensional local rings, hence PIDs) and hence locally free of rank one, but it is not a summand of $R$.
In the geometric case (affine varieties over an algebraically closed field), projective modules correspond to vector bundles, and your definition is asking for the smallest $n$ such that the vector bundle corresponding to your projective is a summand of a trivial vector bundle of rank $n$. Framed this way, it shouldn't be surprising that your definition is different from the rank (which is the fiber dimension of your bundle).