A formalism for nonlinear inversion of seismic surface waves