Defining the Rank of a Projective Module I am trying to understand the definition of rank for a projective module over a noncommutative ring. The definition I am using is:

A sufficient condition for the rank of a free module over a ring $R$ to be uniquely defined is the existence of a homomorphism $\phi:R \to k$ into a skew-field $k$. In this case the concept of the rank of a module can be extended to projective modules as follows. The homomorphism $\phi$  induces a homomorphism of the groups of projective classes $\phi:K_0 R \to K_0 k \approx k$, and the rank of a projective module $P$ is by definition the image of a representative of $P$ in ${\bf Z}$. 

What I can't see is how this homomorphism is defined, and why $K_0 k \approx k$. Can anyone spell this out please?
 A: If $R$ is a ring and $R^m\simeq R^n$ as $R$-modules, it does not follow that $m=n$. An easy example is when $R$ is the endomorphism ring of an infinite-dimensional vector space $V=\mathbb{C}\oplus \mathbb{C}\oplus\mathbb{C}\oplus\cdots$: indeed, since $V\simeq V\oplus V$ as $\mathbb{C}$-vector spaces, you can show $R\simeq R^2$ as right $R$-modules.
A ring $R$ has the invariant basis number property (IBN) if $R^m\simeq R^n$ as $R$-modules implies $m=n$. This is a very fluid property: if $R\rightarrow K$ is a unital ring homomorphism and $K$ has IBN, then $R$ has IBN. In particular, since all fields have IBN (linear algebra), and any commutative ring has $R\rightarrow R/m$ for a maximal ideal $m$, it follows that all commutative rings have IBN. It's one of my personal favorite exercises to show that all noetherian rings have IBN.
Since the map $n\mapsto R^n$ induces a map $\mathbb{Z}\rightarrow K_0(R)$, you can view the failure of IBN as the non-injectivity of this map. Since every module over a field $K$ is free, this map is both injective and surjective, and you get $K_0(K)\simeq \mathbb{Z}$.
Your definition of rank seems highly dependent on the choice of map $R\rightarrow K$, so let me give you the one I'm familiar with.
You can define rank for commutative connected (noetherian?) rings $R$ as follows. If $P$ is a finitely-generated projective $R$-module, it might not be free. But if $p$ is a prime ideal, then $P_p:=P\otimes R_p$ is finitely-generated projective over the local ring $R_p$, hence it is actually free: so $P_p\simeq R_p^n$ for some $n$. But a priori, $n=n(p)$ may depend on $p$, so we get a map $$n=n_P : \mathrm{Spec}(R)\rightarrow \mathbb{N}.$$ It can be shown that this map is continuous when $\mathrm{Spec}(R)$ has teh Zariski topology, so since $\mathbb{N}$ is discrete, it follows that $n_P$ is constant on the connected components of $R$. So if $R$ has no idempotents, then $\mathrm{Spec}(R)$ is connected, so the map $n_P$ must be constant: this constant is called the rank of $P$.
