sum of trace for representations of finite groups Recently I am reading something about trace formula, and I want to prove Frobenius reciprocity from trace formula for a finite group. And I come across the following two formulas which I can't prove.
Assume $G$ is a finite group, and $(\pi,V)$ is a representation of $G$. Let $V^G$ be the subspace of $V$ consisted of elements which are fixed by $g$ for all $g\in G$. Then I want to know if we can prove
$$\sum_{g\in G}\operatorname{tr}(\pi(g))=|G|\dim V^G.$$
Moreover, for any $\gamma\in G$, let
$$G_\gamma=\{g\in G丨g\gamma=\gamma g\},$$
and $S$ be a set consisted of representatives of conjuate classes of $G$.
Can we prove
$$\sum_{g\in G}\operatorname{tr}(\pi(g))=\sum_{\gamma \in S} \frac{|G|}{|G_\gamma|}\operatorname{tr}(\pi(\gamma))?$$
Thanks very much!

Just to add to Adam Higgins's point a matrix $A$ with $A^2=A$ is called idempotent (involutive is $A^2=I$). Of course as Pedro Tamaroff says it is diagonalizable with eigenvalues 1 or 0.  This follows from the Jordan Canonical form although it is an easy case.
