Local picture is explained in
- Landau-Lifschitz, Mechanics, vol I. of Course of theoretical physics, chapter 23, Canonical transformations
Suppose we choose a Lagrangean submanifold, what gives the splitting between submanifold coordinates , and the corresponding moment where the Hamiltonian is and , . The canonical transformation by definition preserves the equations of motion; let the new coordinates be and momenta and the new Hamiltonian is . Thus both variations
vanish. Here we of course write . Subtracting the left and right hand side variations we get that the difference must be a (variation of the integral of the) total differential of a function, which can be chosen as a function of some set of old and new coordinates in a consistent way. For example in 1 dimension, we have 4 possibilities of one new and one old generalized coordinate.
therefore if then , , , what gives the relation between the old and new coordinates and momenta and the new Hamiltonian , which must be expressed in terms of .
If then we add , use the Leibniz rule and we see that for the generating function of the “second kind”, the total differential
and , , . A similar analysis can be done straightfowardly for other possibilities of the choice of arguments.
An invariant picture of generating functions on symplectic manifolds is in
C. Viterbo, Symplectic topology as the geometry of generating functions, Math. Ann. 292 (1992), 685–710, MR1157321, doi
L. Traynor, Symplectic homology via generating function, Geom. Funct. Anal. 4 (1994) 718-748, MR1302337, doi
An adaption of generating functions to the setup of symplectic micromorphisms is in
- Alberto S. Cattaneo, Benoit Dherin, Alan Weinstein, Symplectic microgeometry II: generating functions, arxiv/1103.0672