Hi all. The question I have should be a rather simple one, but I just can't think it through.

So the Chern-Simons action reads
\begin{equation}
S = \int_M {\rm tr} (A\wedge dA + \frac{2}{3} A\wedge A \wedge A)
\end{equation}
where $M$ is 3-fold, and similarly for higher dimensional manifold.

Now, my question is:

**since $A$, the connection 1-form is only defined patch by patch, what do we really mean by doing the integration? **

It would be understandable if I write
\begin{equation}
S = \int_M {\rm tr} \left[(A-A_0)\wedge d(A-A_0) + \frac{2}{3} (A-A_0)\wedge (A-A_0) \wedge (A-A_0)) \right ]
\end{equation}
where $A_0$ is some reference connection, since $A-A_0$ is globally defined 1-form valued in ${\rm Lie}G$.

I see that under gauge transformation (or different chart),
\begin{equation}
CS(A^g) - CS(A) = d\alpha(A,g) + Q(g)
\end{equation}
where $Q(g)$ is closed. But I don't know how I can infer the validity of doing the integration from this gauge transformation.

Thank you!