Let $A$ be a commutative algebra (over the complex numbers, with a unit) and let $M$ be a finitely generated projective $A$module, and let $m_1,\ldots,m_n$ be a set of generators of $M$. The Dual Basis Theorem states that there exists $m_1^\ast,\ldots,m_n^\ast\in M^\ast$ such that $x=\sum m_i^\ast(x)m_i$ for all $x\in M$. This implies that one can write the identity map on $M$ as the tensor $\mathbf{1}=\sum m_i^\ast\otimes m_i$ and one defines $\operatorname{tr}\mathbf{1}=\sum m_i^\ast(m_i)$. What are the properties of $\operatorname{tr}\mathbf{1}$? Is there any relation to, for instance, the rank of $M$? When is it proportional to the unit element in $A$?
More abstractly: Let $A$ be a commutative unital ring and let $M$ be a f.g. projective $A$module. The rank $rk_P(M)$ of $M$ at a prime ideal may be defined as the vector space dimension of $K\otimes_A M$ where $K$ is the residue field. Because projective modules of local rings are free, this is a locally constant function of the prime (so a constant if $A$ is a domain). The trace of the identity of $M$ is the unique element of $A$ such that in every local ring $A_P$ it goes to $rk_P(M)1$.
For any homomorphism $\varphi : A \to \mathbb C$, $\varphi({\rm tr}({\bf 1}))$ will be the corresponding trace for the finitedimensional vector space $M \otimes_A \mathbb C$, and hence be equal to the rank of $M$ at $\varphi$.
So, if $A$ is some algebra of continuous functions on a connected space, then the trace ${\rm tr}({\bf 1})$ is a constant function, equal to the rank of $M$. In general, ${\rm tr}({\bf 1})$ is integervalued locally constant.

$\begingroup$ Thank you for the answers! Concerning your example with the algebra of functions: Assuming $A$ is NOT a domain (like smooth functions on a manifold), what are the algebraic conditions for ${\rm tr}(\mathbf{1})$ to be proportional to the unit element? Restrictions on the ring and/or module? $\endgroup$ – Joakim Arnlind Jun 9 '11 at 14:06

$\begingroup$ That is not so clear. Already $A= \mathbb C \oplus \mathbb C$ and $M = \mathbb C \oplus 0$ shows that nonconstant functions can occur easily. I do not think that there is anything more to say than that the rank is the same at each point. $\endgroup$ – Andreas Thom Jun 9 '11 at 14:26

$\begingroup$ Ok. A trivial followup question (which I could probably look up myself, but anyway ...): When is the rank a global invariant (for modules over rings that are not necessarily domains)? $\endgroup$ – Joakim Arnlind Jun 9 '11 at 14:47

$\begingroup$ maybe a stupid comment: $tr(\mathsf{1})$ coincides with the matrix trace of $P$ if you realize $M$ via a projection $P \in M_n(A)$, i.e. $M = PA^n$. Now this is seen to be an invariant quite easily. It only depends on the iso class of the projective module (in fact, it should only depend on the $K_0$class of it). It carries a lot of interesting information: if e.g. $A$ is the formal deformation quantization of a symplectic manifold, Fedosov's index theorem computes $tr(P)$ in terms of topological data of the corresponding vector bundle (Fedosov's book). This generalizes AtiyahSinger... $\endgroup$ – Stefan Waldmann Jun 9 '11 at 15:02
Let $A$ be the matrix with entries $m_i^*(m_j)$, and put $B(x)=xA+IA$ and $f(x)=\det(B(x))$. We find that $A^2=A$, and $B(xy)=B(x)B(y)$, and $f(xy)=f(x)f(y)\in R[x,y]$. We also have $f(1)=1$. It follows that $f(x)=\sum_{i=0}^ne_ix^i$ for some elements $e_i\in R$ which are orthogonal idempotents, ie $e_ie_j=\delta_{ij}e_i$ and $\sum_ie_i=1$. If we put $R_i=R/(1e_i)\simeq Re_i$ and $M=M/(1e_i)M\simeq e_iM$ we see that $R=\prod_iR_i$ as rings and $M=\prod_iM_i$ as modules. Moreover, $M_i$ is locally free of rank $i$ over $R_i$.
We also have $\text{tr}(1)=\text{tr}(A)=f'(1)=\sum_iie_i$, so $\text{tr}(1)$ maps to $i$ in $R_i$. It is cleaner to work with the elements $e_i$ because they distinguish the different $R_i$ even in a finite characteristic situation, which is not true for $\text{tr}(1)$.

$\begingroup$ Dear Neil: I'd be most grateful if you could tell me whether what I wrote here is correct. $\endgroup$ – PierreYves Gaillard Aug 7 '14 at 11:37

$\begingroup$ PS. I think $M=M/(1e_i)M$ should be $M_i=M/(1e_i)M$. $\endgroup$ – PierreYves Gaillard Aug 8 '14 at 5:49