I am trying to understand the proof that the Levi-Civita connection is torsion free. In the notes in theorem 6.8 it is written that
$g(\nabla_XY, Z) - g(\nabla_YX, Z) = g(Z, [X,Y])$
proves that connection is torsion free. My question is how do we show that the above relation satisfies the 0 torsion definition
$\nabla_XY - \nabla_YX = [X, Y]$?
Swap the two arguments in the $g$ on the right-hand side, and move it to the left. Now you have $$ g(\nabla_XY, Z) - g(\nabla_YX, Z) - g( [X,Y], Z) = 0 $$ Use the bilinearity of $g$ to change that into $$ g(\nabla_XY- \nabla_YX - [X,Y], Z) = 0. $$
Since this holds for every $Z$, and $g$ is nondegenerate, you get that $$ \nabla_XY- \nabla_YX - [X,Y] = 0. $$