I have a question regarding the trace of a linear map $f: V \to V$. As usual, one can define the trace of this map by considering the trace of matrix representation of $f$, that is, choosing a basis for $V$ and describing $f$ as a matrix relative to this basis, and taking the trace of this square matrix.
What I don't get, and is something appearing in my book, is how comes that the trace is then equal to:
$$Tr(f)=\sum_{e_i}\langle f(e_i),e_i\rangle$$
where $\langle \;\_ \;, \;\_ \;\rangle$ stands for an inner product and $e_i$'s form an orthonormal basis.
Thanks in advance for your help.
Let $A$ be the matrix representation of $f$ with respect to the basis $\{e_i\}$. Then, the trace of $f$ is the sum of the diagonal entries of $A$, of which the $i$-th diagonal entry is $e_i^T A e_i = (e_i^T A) e_i = (A e_i)^T e_i = \langle A e_i, e_i\rangle = \langle f(e_i),e_i\rangle$.
So, you sum up all the $\langle f(e_i),e_i\rangle $'s to get the trace.