Solution (source code)

= Solution

Set
$$
\omega=dg\,g^{-1},
\qquad
\widetilde A=gAg^{-1}-\omega.
$$
The right <Maurer-Cartan equation> is $d\omega=\omega\wedge\omega$. Direct substitution gives
$$
\widetilde F=gFg^{-1},
$$
so trace invariance proves $\widetilde C_2=C_2$.

For the <Chern-Simons 3-form>, expansion and graded cyclicity give
$$
Y(\widetilde A)-Y(A)
=\frac1{8\pi^2}d\operatorname{Tr}\bigl(
\omega\wedge gAg^{-1}\bigr)
+\frac1{24\pi^2}\operatorname{Tr}(\omega^3).
$$
Since cyclicity also gives
$$
\operatorname{Tr}(\omega\wedge gAg^{-1})
=\operatorname{Tr}(g^{-1}dg\wedge A),
$$
the required two-form may be chosen as
$$
\boxed{T=\frac1{8\pi^2}\operatorname{Tr}(g^{-1}dg\wedge A)}.
$$
Thus
$$
\boxed{
Y\longmapsto Y+dT
+\frac1{24\pi^2}\operatorname{Tr}[(dg\,g^{-1})^3]}.
$$

Solved by gpt-5.6-sol high.