I'll address your first question, in some computational detail; although I cannot do better than the answers which have already been given in terms of what is conceptually going on.

Let $G$ be a 1-connected Lie group with Lie algebra $\mathfrak{g}$. We assume that the group admits a bi-invariant metric or, equivalently, that the Lie algebra admits an ad-invariant inner product, denoted $\operatorname{Tr}$ by the traditional abuse of notation in the Physics literature. Let $M$ be an orientable 3-manifold which, for simplicitly, I will take without boundary. Then every principal $G$-bundle on $M$ is trivial and choosing a trivialisation once and for all we can identify connections with $\mathfrak{g}$-valued one-forms on $M$. Let $A$ be one such connection.

In this language, the Chern-Simons action for $A$ can be written as
$$I[A] = \frac{k}{4\pi} \int_M \operatorname{Tr}\left(A \wedge dA + \frac23 A \wedge A \wedge A\right).$$
There is of course some abuse of notation here. Both $A$ and $dA$ are $\mathfrak{g}$-valued, whence the first term in the action is the composition of their wedge product with the ad-invariant inner product on $\mathfrak{g}$. This results in a 3-form, which can be integrated on $M$. The second term is perhaps best understood if one rewrites
$$\frac23 \operatorname{Tr} A \wedge A \wedge A = \frac13 \operatorname{Tr} [A , A] \wedge A,$$
where $[A,A]$ is the composition of wedging and the Lie bracket on $\mathfrak{g}$, hence it is again a $\mathfrak{g}$-valued 2-form, and the second term in the action is (up to the factor of one-third) again the composition of the wedge product of $[A,A]$ and $A$ with the ad-invariant inner product.
(Notice that $[A,A]$ is not zero, because although $[-,-]$ is antisymmetric, so is $\wedge$ between two one-forms.)

Now let us vary $I$:
$$\delta I = \frac{k}{4\pi} \int_M \operatorname{Tr} \left ( \delta A \wedge dA + A \wedge d \delta A + 2 \delta A \wedge A \wedge A \right).$$
Using the fact that $d$ is an odd derivation, we have that
$$\operatorname{Tr}(A \wedge d \delta A) = - d \operatorname{Tr}(A \wedge \delta A) + \operatorname{Tr}(dA \wedge \delta A)$$
whence,
$$\delta I = \frac{k}{2\pi} \int_M \operatorname{Tr} \left ( \delta A \wedge \left( dA + A \wedge A \right) \right) + \frac{k}{4\pi} \int_{\partial M} \operatorname{Tr} (\delta A \wedge A)$$
The boundary term drops out because we have assumed $\partial M = \emptyset$. In summary, the Euler-Lagrange equation is the flatness of the curvature $F = dA + A \wedge A$, which can also be written as $F = dA + \frac12 [A,A]$.

Under a gauge transformation $g:M \to G$,
$$A \mapsto A^g = g A g^{-1} - dg g^{-1}.$$
Again there's some abuse of notation in that one is assuming that $\mathfrak{g}$ is a matrix Lie algebra, but this only notational and it's perfectly possible to write this in a way that makes sense in general; namely,
$$A^g = \operatorname{Ad}_g A + g^*\theta$$
where $\theta$ is the *right*-invariant Maurer-Cartan form on $G$.

In order to vary the action is perhaps best to write it in an equivalent way; namely,
$$I[A] = \frac{k}{4\pi} \int_M \operatorname{Tr}\left(A \wedge F - \frac13 A \wedge A \wedge A\right),$$
since the curvature transforms covariantly: $F^g = g F g^{-1}$.

The next calculation is a little long and I will not reproduce it here. It is not difficult: just plug in the expressions for $A^g$ and $F^g$ into the action $I[A^g]$ and expand using the fact that $\operatorname{Tr}$ is Ad-invariant. One must also use the Maurer-Cartan structure equation $d\theta = - \theta \wedge \theta$. The result of the calculation is
$$I[A^g]-I[A]= \frac{k}{4\pi} \int_M \operatorname{Tr}\left( d(g^{-1} dg \wedge A) + \frac13 (dg g^{-1})^3 \right)$$
where the first term vanishes by Stokes's theorem since $M$ has no boundary, leaving
$$I[A^g]-I[A]= \frac{k}{12\pi} \int_M \operatorname{Tr}\left( (dg g^{-1})^3 \right)$$

If $G$ is a compact simple group, then one can rescale the inner product $\operatorname{Tr}$ in such a way that
$$\frac{1}{12\pi} \int_M \operatorname{Tr}\left( (dg g^{-1})^3 \right) \in \mathbb{Z}$$
whence the Chern-Simons path integral is gauge-invariant provided that $k \in \mathbb{Z}$ as well, in units where $\hbar =1$.

This post imported from StackExchange MathOverflow at 2014-06-30 07:41 (UCT), posted by SE-user José Figueroa-O'Farrill