TITLE: Trace of the identity map in a projective module
QUESTION [6 upvotes]: 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$?

REPLY [2 votes]: Let $A$ be the matrix with entries $m_i^*(m_j)$, and put $B(x)=xA+I-A$ 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/(1-e_i)\simeq Re_i$ and $M=M/(1-e_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)$.