Solution (source code)

= Solution

Contract the Riemann tensor to obtain
$$
R_{\mu\nu}=R^\alpha{}_{\mu\alpha\nu},
\qquad R=g^{\mu\nu}R_{\mu\nu},
$$
and define the <Einstein tensor>
$$
G_{\mu\nu}=R_{\mu\nu}-\frac12Rg_{\mu\nu}.
$$
Contracting the differential Bianchi identity twice, using the curvature symmetries and metric compatibility, gives the <contracted Bianchi identity>
$$
\nabla_\nu R_\mu{}^\nu=\frac12\nabla_\mu R.
$$
It follows immediately that
$$
\boxed{\nabla_\nu G_\mu{}^\nu=0}.
$$
The Einstein equations with cosmological constant are
$$
G_{\mu\nu}+\Lambda g_{\mu\nu}=\kappa T_{\mu\nu}.
$$
Since $\nabla g=0$, the left side is divergence-free, so consistency requires and implies the local conservation law $\nabla^\nu T_{\mu\nu}=0$.