In mathematics, any Lagrangian system generally admits gauge symmetries, though it may happen that they are trivial.
In theoretical physics, the notion of gauge symmetries depending on parameter functions is a cornerstone of contemporary field theory. It comes from gauge theory on principal bundles whose vertical automorphisms, called the gauge transformations, are gauge symmetries of the Yang – Mills Lagrangian of gauge fields. Gauge symmetries of gravitation theory are general covariant transformations.
A gauge symmetry of a Lagrangian L is defined as a differential operator on some vector bundle E taking its values in the linear space of (variational or exact) symmetries of L. Therefore, a gauge symmetry of L depends on sections of E and their partial derivatives. For instance, this is the case of gauge symmetries in classical field theory.
Gauge symmetries possess the following two peculiarities.
(i) Being Lagrangian symmetries, gauge symmetries of a Lagrangian satisfy first Noether’s theorem, but the corresponding conserved current Jμ takes a particular superpotential form Jμ = Wμ + dνUνμ where the first term Wμ vanishes on solutions of the Euler – Lagrange equations and the second one is a boundary term, where Uνμ is called a superpotential.
(ii) In accordance with second Noether’s theorem there is one-to-one correspondence between the gauge symmetries of a Lagrangian and the Noether identities which the Euler–Lagrange operator satisfies. Consequently, gauge symmetries characterize the degeneracy of a Lagrangian system.
Note that, in quantum field theory, a generating functional fail to be invariant under gauge transformations, and gauge symmetries are replaced with the BRST symmetries, depending on ghosts and acting both on fields and ghosts.
G.Gaichetta, L.Mangiarotti, G.Sardanashvily, Advanced Classical Field Theory (WS, 2009)
G.Gaichetta, L.Mangiarotti, G.Sardanashvily, On the notion of gauge symmetries of generic Lagrangian field theory, arXiv: 0807.3003