Are projective modules over an artinian ring free? Quoting a comment to this question:

By a theorem of Serre, if $R$ is a commutative artinian ring, every projective module [over $R$] is free. (The theorem states that for any commutative noetherian ring $R$ and projective module $P$ [over $R$], if $\operatorname{rank}(P) > \dim(R)$, then there exists a projective [$R$-module] $Q$ with $\operatorname{rank}(Q)=\dim(R)$ such that $P\cong R^k \oplus Q$ where $k=\operatorname{rank}(P)−\dim(R)$.)

When $R$ is a PID, this is in Lang's Algebra (Section III.7), and when $R$ is local this is a famous theorem of Kaplansky.  But in spite of a reasonable effort, I can't seem to find any other reference to this theorem of Serre.  Does anyone know of one?  Is there any other way to show that every projective module over an artinian ring is free?
 A: Let $R$ be any commutative ring whose projective modules are all free, and let $e\notin \{0,1\}$ be an idempotent of $R$. 
Then $eR$ and $(1-e)R$ are both projective, hence free of some rank 1 or more, and $eR\oplus(1-e)R=R$, so that we have $R^n\cong R$ as $R$ module for some natural number $n\geq 2$. This is absurd since commutative rings have IBN.
This shows that $R$ cannot have any nontrivial idempotents.
Since an Artinian ring without nontrivial idempotents is local, you can see now the dramatic failure of Artinian rings to have the "projective implies free" property, except in the "good" local case.
A: Sorry to show up late to this party, but you were quoting my comment and somehow I missed it.
Yes, a condition was overlooked: we must presume that $P$ has constant rank, alternatively, $\operatorname{Spec}(A)$ is connected, or $A$ has no non-trivial idempotents, etc.
This result is Serre's Splitting Theorem which states that a projective $A$-module, $P$, of constant rank $r \geq d+1$ where $d=\dim(A)$ must contain a unimodular element (SST) [not to be left out: $P$ will also be cancellative under this condition (Bass's Cancellation Theorem)].
$P$ containing a unimodular element $p \in P$ is equivalent to a surjection $P \twoheadrightarrow A$, giving us kernel $Q$ (which will also be projective), and because the surjection splits we have $P \simeq A \oplus Q$. Repeat this splitting until the rank of the resulting kernel matches the dimension of $A$. 
As a result, projective $A$-modules for which $\operatorname{rank}(P)=\dim(A)$ are called projective modules of top-rank.
For further reference: see T.Y. Lam's Serre's Problem on Projective Modules (esp. p.291-2)
