While studying linear algebra, I found that:
Let $A$ be an $m \times n$ Matrix (with $m>n$) then the trace $tr(A(A^T A)^{-1} A^T)$ equals the number of columns of $A$.
Does this hold in general and if so: why?
If the number of columns is 1, the trace seems to be 1, too.
I think that each columns acts like some kind of adding 1, but I can't explain why.
You might already know that $tr(CD) = tr(DC)$ (if not try proving it with the definition of the trace). Now take $C := A$ and $D := (A^T A)^{-1} A^T$ and apply said rule. Now think about what $(A^T A)^{-1}$ is (supposing that $(A^T A)$ is invertible).
Solution: