Let $f:N\to M$ be a smooth map of smooth manifolds, let $E\to M$ be a smooth complex vector bundle of rank $r$, and let $\nabla$ be a smooth connection on $E$. Let $f^*E\to N$ be equipped with the pulled-back connection $f^*\nabla$. If $P$ is an $\operatorname{Ad}$-invariant complex polynomial on $\mathfrak{gl}(r,\mathbb C)$, evaluated on curvature forms by the standard Chern-Weil convention, then