A simple theorem in Hamiltonian mechanics is pointed out. One consequence is a generalization of the classical result that symmetries are generated by Poisson brackets of conserved functionals. General applications are discussed. Special emphasis is given to the Kadomtsev-Petviashvili equation.