Kronecker delta confusion I'm confused about the Kronecker delta. In the context of four-dimensional spacetime, multiplying the metric tensor by its inverse, I've seen (where the upstairs and downstairs indices are the same):
$$g^{\mu\nu}g_{\mu\nu}=\delta_{\nu}^{\nu}=\delta_{0}^{0}+\delta_{1}^{1}+\delta_{2}^{2}+\delta_{3}^{3}=1+1+1+1=4.$$
 But I've also seen (where the upstairs and downstairs indices are different):
$$g^{\mu\nu}g_{\nu\lambda}=\delta_{\lambda}^{\mu}=\left(\begin{array}{cccc}
1 & 0 & 0 & 0\\
0 & 1 & 0 & 0\\
0 & 0 & 1 & 0\\
0 & 0 & 0 & 1
\end{array}\right).$$
How can there be two different answers to (what appears to me to be) the same operation, ie multiplying the metric tensor by its inverse? Apologies if I've got this completely wrong.
 A: In terms of your ordinary matrix multiplication, you have, for the case of a 4x4 matrix $M = g_{ab}$:
$M\cdot M^{-1} = I$, which is the same thing as $g_{ab} g^{bc} = \delta_{a}{}^{c}$
and 
$Tr\left(M\cdot M^{-1}\right) = 4$, which is the same thing as $g_{ab}g^{ab} = \delta_{a}{}^{a} = 4$
A: It's useful to know how matrix multiplication is defined:
For $n \times n$  matrices, $A$ and $B$, denote the entry in the $i$th row and $j$th column by  $A^i_j$ and $B^i_j$ respectively. Then for $C = AB$, the entries are given by $$C^i_j = A^i_kB^k_j$$ (summation convention of course), which you can check by working out a few examples. 
Now when we have a matrix and it's inverse, multiplying them together yields the identity matrix, or using the definition above:
$$A^i_k (A^{-1})^k_j = \delta^i_j,$$ since the entries of the identity matrix are given by the Kronecker delta symbol.
The trace of a matrix $A$ is simply given by $Tr(A) = A^i_i$. In the case where the matrix $C$ is a product, combining the two formulas (for trace and matrix multiplication), it's trace would be given by $Tr(C) = C^i_i = A^i_kB^k_i$, which is what you're doing in the first case.
