Given a 4-dimensional compact manifold (torsion free), the Euler characteristic is defined as: $$E_4 ~=~ \int \epsilon_{abcd}R^{ab} \wedge R^{cd}$$ with $R^{ab}$ is the curvature 2-form. Perturb the connection 1-form (represent by $\delta \omega^{ab}$), $E_4$ should be unchanged. How can I proof that, and what will be change if the manifold is not torsion free anymore? Given that: Connection 1-form from torsion-free condition: $$T^a ~=~ De^a ~=~ de^a + \omega^a_b \wedge e^b ~=~ 0$$ and $$\omega^{ab} ~=~ \delta^{ac} \omega^b_c.$$ Curvature 2-form: $$R^{ab} ~=~ D\omega^{ab} ~=~ d\omega^{ab} + \omega^a_c \wedge \omega^{cb}.$$ Gauss-Bonnet term appears as a topological term in some theoretical gravitational actions. I don't see why it's unchanged, so I post this question of mine here.