Abstract
The Kadomstev-Petviashvili (KP) equation is a well-known modulation equation normally derived by starting with the trivial state and an appropriate dispersion relation. In this paper it is shown that the KP equation is also the relevant modulation equation for bifurcation from periodic travelling waves when the wave action flux has a critical point. Moreover, the emergent KP equation arises in a universal form, with the coefficients determined by the components of the conservatio n of wave action. The theory is derived for a general class of partial differential equations generated by a Lagrangian using phase modulation. The theory extends to any space dimension and time, but the emphasis in the paper is on the ca se of 3+1. Motivated by light bullets and quantum vortex dynamics, the theory is illustrated by showing how defocussing NLS in 3+1 bifurcates to KP in 3+1 at criticality. The generalization to $N>3$ is also discussed.