Gauge invariance and Gauss's law in $U(1)$ E&M theory I am reading an article: Stable Gapless Bose Liquid Phases without Any Symmetry (and also see Pretko's paper on the same subject). There, the authors wrote that Gauss's laws are associated with different gauge transformations as summarized in table 1 of Ref. 1. I am not quite sure how the authors obtained the Gauss's laws only from the gauge transformation of the vector potential. Take the simplest case rank-1 (the classical E&M) theory for example. The gauge transformation
\begin{equation}
A_i \to A_i + \partial_i \lambda,
\end{equation}
where $\lambda$ is a scalar function of spacetime is accompanied by a corresponding change in the electrostatic potential $\phi \to \phi - \partial_t \lambda$ for the electric field to be invariant. How does this imply Gauss's law $\partial_i E^i =\nabla \cdot \vec{E} =0$? Are there some hidden assumptions? (e.g. for the classical pure E&M theory $L = \int d^4 x E^2+B^2$, it is known that in the Coulomb gauge, $\nabla \cdot \vec{E} = 0$) Could someone please help?
 A: Take the variational derivative of the Maxwell action (the one you have written down) w.r.t. $A_0$ to get the Gauss law.
The relation to gauge transformations lies within the theory of constrained systems. Pass to the Hamiltonian formulation by applying the field-theoretic Legendre transform. In the temporal gauge $A_0 = 0$, your canonical coordinates will be the spatial components of the vector potential $\vec{A}$, and canonical momenta will be the components of the electric field $\vec{E}$. Gauge symmetry induces a first-class constraint on the canonical momenta, which are fixed by the Lagrange multiplier $A_0$ (which is why the variational derivative w.r.t. $A_0$ gives you the Gauss law). Also, the integrated Gauss law constraint generates gauge transformations on the phase space through Poisson brackets.
Another interesting and related observation is that in the naive quantum theory where the canonical momenta is replaced with (variational) derivatives
$$
E^i = - i \hbar \frac{\delta}{\delta A_i},
$$
The quantum constraint equation
$$
\left( \nabla_i E^i \right) \Psi[\vec{A}] = 0
$$
implies that $\Psi[\vec{A}]$ is a gauge invariant functional.
UPD: I will explain why the quantum constraint equation is equivalent to postulating gauge-invariance of the wave function.
Let's rewrite the smeared constraint equation:
$$ -i \hbar \int d^4 x f(x) \nabla_i \frac{\delta}{\delta A_i} \Psi[A] = 0. $$
Here $f(x)$ is an arbitrary smearing function, and by canonical quantization,
$$ E^i = -i \hbar \frac{\delta}{\delta A_i} $$
is the canonical momentum.
Integrate by parts:
$$ i \hbar \int d^4 x \nabla_i f(x) \cdot \frac{\delta}{\delta A_i} \Psi[A] = 0. $$
Now to see that this is equivalent to imposing gauge invariance, consider an infinitesimal gauge transformation:
$$ A_i \mapsto A_i + \nabla_i f(x). $$
The wave functional changes according to
$$ \Psi[A] \mapsto \Psi[A + \nabla f] = \Psi[A] + \int d^4 x \nabla_i f(x) \cdot \frac{\delta \Psi[A]}{\delta A_i} + \mathcal{O}(f^2). $$
(This is analogous to the Taylor expansion for function, except that we get an integral over the 3-space instead of a sum over variables)
When the gauge transformation is infenitesimal, the quadratic in $f$ term vanishes. Gauge invariance is achieved when the linear term also vanishes, that is, when
$$ \int d^4 x \nabla_i f \cdot \frac{\delta \Psi[A]}{\delta A_i} = 0. $$
Now see that this is exactly the equation that the quantum constraint is imposing.
