  Phase gradient metagratings/metasurfaces (PGMs) have provided a new paradigm
for light manipulations. In this work, we will show the existence of gauge
invariance in PGMs, i.e., the diffraction law of PGMs is independent of the
choice of initial value of abrupt phase shift that induces the phase gradient.
This gauge invariance ensures the well-studied ordinary metallic grating that
can be regarded as a PGM, with its diffraction properties that can fully
predicted by generalized diffraction law with phase gradient. The generalized
diffraction law presents a new insight for the famous effect of Wood's
Anomalies and Rayleigh conjecture.
