Integral of a gauged topological term as a map from principal bundles I am reading this paper and on pp.14 left-hand side eqn (63) reads
$$\int_{M^d}{W_{top}^d(A)} \in U(1)$$
where $W_{top}^d(A)$ is a topological term obtained by integrating out the matter field $g$ from a gauged ($G$-symmetry twisted) topological Lagrangian $L_{top}^d[g^{-1}(\partial + iA)g]$ thus the path integral/partition function is given by $$Z(A) = e^{i2\pi \int_{M^d}{W_{top}^d(A)}}$$
Note that we are treating $A$ as a non-dynamical probe field and the spacetime manifold $M^d$ is boundaryless
The author claims that the integral in eqn (63) can be viewed as a group (since the matter field takes value in $G$) cocycle since it is a map from the principal $G$-bundles over the spacetime manifold $M^d$ to $U(1)$.  This does not seem obvious to me and I am seeking help to clarify this claim.  Thanks!
I am also wondering, if we do not integrate out the matter field $g$ can we still interpret the path integral as a map from some bundle, given that the matter field can be viewed as sections of the associated vector bundle?
 A: As a topological invariant, the integral is invariant under perturbations $A\mapsto A+\delta A$ of $A$. Since each $A$ is the connection on some $G$-principal bundle over $M^d$ and the space of connections on a given bundle is an affine vector space hence contractible and in particular connected, every connection on a given bundle can be reached by repeatedly perturbing every other connection. Therefore, the integral is constant for all $A$ coming from the same bundle and it's a really just a function of equivalence classes of principal bundles.
Since those classes are given by (homotopy classes of) maps $M^d \to \mathrm{B}G$ from the manifold into the classifying space, which are $d$-cycles in $\mathrm{B}G$ (they are (singular) cycles because a manifold is boundaryless), it is a function assigning values in $\mathrm{U}(1)$ to $d$-cycles. If it is trivial on $d$-boundaries, which I think it should be but can't currently prove, then it is a function $H^d(\mathrm{B}G)\to \mathrm{U}(1)$ and since $\mathrm{U}(1)$ is a divisible group, its ext functor vanishes and by the universal coefficient theorem we have that this is actually a $\mathrm{U}(1)$-valued $d$-cocycle.
Since the $d$-th cohomology of $\mathrm{B}G$ is the $d$-th group cohomology of $G$, this would explain that the integral can be viewed as a group cocycle if we can show that it is zero on $d$-boundaries in $\mathrm{B}G$.
