Solution (source code)

= Solution

A connection on $TM$ is a <metric connection> for $g$ if for all smooth <vector fields> $X,Y,Z$,
$$
\boxed{X\bigl(g(Y,Z)\bigr)=g(\nabla_XY,Z)+g(Y,\nabla_XZ).}
$$
Equivalently, its induced <covariant derivative> of the metric satisfies $\nabla g=0$. This is also called a <metric-compatible connection>.