Gauge invariance of Chern-Simons functional integral for a 3-manifold with boundary I am trying to understand how the functional integral for Chern-Simons theory for a possibly non-compact 3-manifold with boundary is made gauge invariant.
For a compact 3-manifold, $M$, without boundary, it is well known (see, for example, section 2 of this reference), that for a compact simple Lie group $G$ and trivial principal G-bundle $P\rightarrow M$, one may define the Chern-Simons action
\begin{equation}
S[A]=\frac{k}{4\pi}\int_M\textrm{Tr}\bigg(A\wedge dA+\frac{2}{3}A\wedge A\wedge A\bigg).
\end{equation}
Here, the group, $\mathcal{G}$, of gauge transformations of $P$, is isomorphic to the group of smooth maps from $M$ to $G$. Under a gauge transformation $g\in \mathcal{G}$, the action changes by the sum of a boundary term and $\textrm{deg}(g)$, which labels the corresponding component of $\mathcal{G}$. The group, $\pi_0(\mathcal{G})$, of components is isomorphic to the group of homotopy classes of maps from $M$ to $G$, which for simply connected $G$ is isomorphic to $\pi_3(G)$. Since $G$ is simple, $\pi_3(G)\cong\mathbb{Z}$. Thus,  upon requiring that $k$ is quantized, we find that the integrand of the functional integral, $e^{iS}$, is invariant under gauge transformations.
My question is, how does one extend this to the case where $M$ has a boundary, and is possibly noncompact? The example I have in mind is $M=D\times \mathbb{R}$, where $D$ is the disk. In this paper, it is explained that for gauge invariance, one first chooses one of the boundary components of the connection, $A$, to be zero, and with such a boundary condition the functional integral is invariant only under gauge transformations
which are one at the boundary. This requirement is also alluded to below equation 3.18 of this paper by Dijkgraaf and Witten. 
It is clear to me that the aforementioned boundary term that arises via gauge transformation will vanish via the boundary condition. 
However, it is not clear to me why we require that $g$ be 1 at the boundary for gauge invariance. 
Firstly, why do we need to impose another boundary condition on $g$, i.e., in addition to the constraint required to preserve the boundary condition on $A$ under gauge transformations? Secondly, why would another constant value for $g$ at the boundary not suffice? I would think that any common value for $g$ along the boundary would imply that we are effectively studying $M$ with boundary points identified, which is a closed 3-manifold, for which we can apply the arguments of the second paragraph above.
 A: It's not necessary to consider only gauge transformations that are constant on the boundary.  However, you won't get that the CS invariant is well-defined, even modulo integers (which is what I understand the word quantized to signify). The usual proof of this invariance shows that the change in CS under a gauge transformation is the integral of a certain closed 3-form over the 3-manifold. With the correct normalization, this is an integral for closed 3-manifolds, but there is no reason for it to be so when the boundary is non-empty.
The fix for this issue was sorted out in the late 1980s. See Ramadas, T., Singer, I. and Weitsman, J., Some comments on Chern-Simons gauge theory, Comm. Math. Phys. 126 (1989), 409-420. The CS invariant becomes a section of a certain U(1) bundle over the moduli space of connections mod gauge on the boundary. This makes precise the observation that the failure for the CS invariant to change by an integer just depends on the restriction of the gauge transformation to the boundary. As far as my limited understanding goes, this is viewed as the right notion of quantized in this situation, and there is quite a bit of literature on the subject. A nice treatment (maybe helpful for mathematicians) of the geometry is in C. Herald, Legendrian Cobordism and Chern-Simons Theory on 3-Manifolds with Boundary, Comm. Anal. Geom. 2, Number 3, 337-413, 1994.
