Solution (source code)

= Solution

Up to Euclidean sign conventions, the parity-even renormalizable Lagrangian is
$$
\boxed{\begin{aligned}
\mathcal L={}&\frac14F_{\mu\nu}^aF_{\mu\nu}^a
+\bar\psi(\gamma_\mu D_\mu+m)\psi
+\frac12(D_\mu\phi)^a(D_\mu\phi)^a
+\frac12M^2\phi^a\phi^a\\
&+\frac{\lambda}{4}(\phi^a\phi^a)^2
+y\,\bar\psi\phi^aT^a\psi.
\end{aligned}}
$$
The Yang-Mills term is invariant because $F_{\mu\nu}$ transforms by conjugation and the matrix trace is cyclic. Covariance of $D_\mu\psi$ makes $\bar\psi\gamma_\mu D_\mu\psi$ invariant, and the fermion mass is invariant because the factors $U^{-1}U$ cancel. Likewise $D_\mu\phi$ transforms by conjugation, so its trace norm, $\phi^a\phi^a=2\operatorname{tr}\phi^2$, and every power of that norm are invariant. Finally,
$$
\bar\psi'\phi'\psi'=\bar\psi U^{-1}(U\phi U^{-1})U\psi=\bar\psi\phi\psi,
$$
which proves gauge invariance of the <Yukawa interaction>.

Gauge invariance and power counting also permit the parity-odd Yukawa interaction $iy_5\bar\psi\gamma_5\phi\psi$, a pseudoscalar fermion mass $im_5\bar\psi\gamma_5\psi$, and the <Yang-Mills theta term>. They are absent if parity and CP are imposed. There is no nonzero cubic scalar invariant: $\operatorname{tr}\phi^3$ vanishes for $SU(2)$, equivalently $\epsilon^{abc}\phi^a\phi^b\phi^c=0$ for commuting scalar components.