Solution (source code)

= Solution

Fix the coefficient-column convention: write the <local frame> as a row $e=(e_1,\ldots,e_r)$ and a section as $s=eu$ for a column $u$ of functions. Define the <connection matrix> $\theta=(\theta_{ij})$ by
$$
\nabla e_j=\sum_i e_i\theta_{ij},\qquad \nabla(eu)=e(du+\theta u).
$$
Each entry is a smooth one-form. Define the <curvature form of a connection> by
$$
R^E(X,Y)s=\nabla_X\nabla_Ys-\nabla_Y\nabla_Xs-\nabla_{[X,Y]}s.
$$
The same Leibniz cancellations as for tangent-bundle curvature show that this is linear over <smooth functions> in $X,Y,s$. Thus it is a two-form with values in the <endomorphisms> of $E$. Its <curvature matrix> $\Theta=(\Theta_{ij})$ is specified by $R^E(X,Y)e_j=\sum_i e_i\Theta_{ij}(X,Y)$.

The <covariant exterior derivative> on coefficient forms is $d+\theta\wedge$. Squaring it on $u$ gives
$$
(d+\theta\wedge)^2u=d\theta\,u-\theta\wedge du+\theta\wedge du+\theta\wedge\theta\,u.
$$
Therefore the <Cartan curvature matrix equation> is
$$
\boxed{\Theta=d\theta+\theta\wedge\theta,\qquad\Theta_{ij}=d\theta_{ij}+\sum_k\theta_{ik}\wedge\theta_{kj}.}
$$
Matrix-valued wedge products here combine <matrix> multiplication with the <wedge product of differential forms>, in the stated order.

Using $d^2=0$ and the <graded Leibniz rule>,
$$
d\Theta=d\theta\wedge\theta-\theta\wedge d\theta.
$$
On the other hand, associativity of the <endomorphism-valued exterior product> gives
$$
\begin{aligned}
\Theta\wedge\theta-\theta\wedge\Theta
&=d\theta\wedge\theta+\theta\wedge\theta\wedge\theta
-\theta\wedge d\theta-\theta\wedge\theta\wedge\theta\\
&=d\theta\wedge\theta-\theta\wedge d\theta.
\end{aligned}
$$
The cubic terms cancel, proving the requested <Bianchi identity>
$$
\boxed{d\Theta=\Theta\wedge\theta-\theta\wedge\Theta.}
$$