09.05.03 · classical-mech / canonical

Generating Functions for Canonical Transformations: Four Types (F1, F2, F3, F4)

shipped3 tiersLean: nonepending prereqs

Anchor (Master): Arnold, Mathematical Methods of Classical Mechanics, 2e (1989), §48; Marsden-Ratiu, Introduction to Mechanics and Symmetry, Ch. 2.7

Intuition Beginner

A canonical transformation is a relabelling of phase space -- new names for the same physical states -- that preserves Hamilton's equations. Unit 09.05.01 established what these transformations are and why they matter. This unit answers the practical question: how do you actually construct one?

You could write down the transformation equations directly and then verify that the Poisson brackets are preserved -- a tedious calculation involving cross-derivatives. There is a better way. Every canonical transformation can be encoded in a single scalar function called a generating function. You specify one function of variables -- half old, half new -- and the transformation equations emerge by taking derivatives. The generating function is a "potential" for the canonical transformation, just as an electrostatic potential encodes the electric field: differentiate in the right directions and the transformation pops out.

Why four types? The generating function takes of the phase-space variables as its independent arguments. There are four natural choices, corresponding to which half of the old set and which half of the new set you pick:

Type Independent variables Derived variables

Each type picks one member from the old pair and one from the new pair for each degree of freedom. The four types are related by Legendre transforms -- changing which variables you treat as "independent" in the same way that switching from to in thermodynamics is a Legendre transform.

Not every canonical transformation can be written in every type. The identity transformation is singular in the parameterisation (because and are not independent near the identity) but perfectly regular in the parameterisation. The exchange transformation is regular in but singular in . Having all four types ensures you can always find one that works for the transformation you need.

The strategic payoff: instead of searching for good coordinates by trial and error, you search for a good generating function -- a scalar optimisation problem. The Hamilton-Jacobi equation, perturbation theory, and action-angle variables all reduce to choosing the right generating function.

Visual Beginner

Imagine the graph of a canonical transformation plotted in a combined space. The graph is a -dimensional surface inside a -dimensional space. A generating function describes this surface by choosing which variables are "inputs" and which are "outputs," then writing the surface as the graph of a scalar potential.

For , the inputs are old positions and new momenta ; the outputs are old momenta and new positions . The transformation equations say: the old momentum is the slope of along the -direction, and the new position is the slope of along the -direction.

The four types correspond to the four projections of the graph onto coordinate -planes. A projection is regular (one-to-one) precisely when the corresponding generating function exists. Where one projection folds over and becomes singular, another projection remains regular -- this is why we need all four.

Worked example Beginner

The identity transformation

The simplest canonical transformation is doing nothing: . The type-2 generating function is . Applying the type-2 rules: and . Confirmed: the identity.

This might seem like a tautology, but it has deep consequences. A generating function close to the identity, , generates a canonical transformation close to the identity -- a small perturbation. This is the starting point for canonical perturbation theory and for the Hamilton-Jacobi method.

The exchange transformation

Consider swapping position and momentum: . This is canonical because , preserving the fundamental bracket.

Using the type-1 form with the rules and : the exchange requires and , i.e., . The first equation gives . The second gives , so is constant. Therefore .

Now try type 2. The exchange has , but requires and as independent variables. Since , these are dependent -- the type-2 generating function does not exist. This is exactly why we need all four types: the exchange is singular in type 2 but regular in type 1.

Rotation in phase space

The transformation , is a rotation by angle in the plane. The generating function produces exactly this rotation. Taking derivatives:

. Setting this equal to and solving: .

. Substituting : .

The Poisson bracket is . Canonical.

Check your understanding Beginner

Formal definition Intermediate+

The generating-function principle

A curve satisfies Hamilton's equations if and only if the action integral is stationary 09.04.02. After a canonical transformation to with new Hamiltonian , the action must be , also stationary. Two integrals with the same stationary points differ at most by an exact differential :

The function is the generating function. Its natural arguments depend on which variables are chosen as independent.

Type 1:

Choose as independent variables. Expanding and matching coefficients:

The first two equations define the canonical transformation implicitly. The third relates the old and new Hamiltonians. For time-independent transformations, . The regularity condition is that the mixed Hessian , ensuring the equations can be solved for in terms of .

Type 2:

Legendre-transform in the -variables: . Then , giving:

Type 2 is the most widely used because depends on old positions and new momenta -- the natural variables for the Hamilton-Jacobi equation 09.05.02. The type-2 generating function satisfying is the Hamilton-Jacobi function.

Type 3:

Legendre-transform in the -variables: . Then:

Type 3 is useful when old momenta are the natural independent variables, for instance in the momentum representation.

Type 4:

Legendre-transform in both and : . Then:

Type 4 is the least commonly used but is essential when both positions are dependent. The exchange transformation is naturally expressed in type 4 as : and , giving .

Summary of regularity conditions

Each type requires an invertibility condition on the transformation:

Type Independent vars Regularity condition

Any canonical transformation sufficiently close to the identity satisfies the type-2 condition, which is why type 2 works for perturbation theory.

The symplectic condition

A transformation is canonical if and only if the Jacobian matrix satisfies the symplectic condition:

This is equivalent to the preservation of the fundamental Poisson brackets 09.04.03: , , .

Key derivation Intermediate+

Theorem. The transformation defined by a type-2 generating function is automatically symplectic.

Proof. The generating function guarantees . The old canonical 1-form is with . The new canonical 1-form is with .

From , take the exterior derivative of both sides:

So . The transformation is symplectic. The key fact: the two canonical 1-forms differ by an exact form , whose exterior derivative vanishes (). The argument for types 1, 3, and 4 is identical up to sign conventions.

Bridge. This derivation is the foundation for the Hamilton-Jacobi equation 09.05.02, which is the PDE that a type-2 generating function must satisfy to trivialise the Hamiltonian (). The symplecticity guaranteed here is the reason the Hamilton-Jacobi method works: the generating function automatically produces a canonical transformation, so the simplified Hamiltonian still governs a genuine Hamiltonian system. The same construction appears in canonical perturbation theory, where the near-identity transformation that eliminates fast oscillations is specified by its type-2 generating function.

Exercises Intermediate+

Lean formalization Intermediate+

The generating-function formalism is a central missing piece in Mathlib's Hamiltonian mechanics. The specific ingredients needed are:

  1. The definition of a nonlinear canonical transformation as a symplectomorphism satisfying .
  2. Generating functions of each type as formal objects: a smooth function of mixed variables with nonsingular mixed Hessian.
  3. The transformation equations (e.g., , ) and the proof that the resulting map is symplectic.
  4. The Legendre-transform relations between the four types.
  5. The regularity conditions under which each type exists.
  6. The Lagrangian-submanifold interpretation: the graph of a symplectomorphism is Lagrangian in the product, and a Lagrangian submanifold transverse to a fibration is locally the graph of an exact 1-form.

Items (1)--(3) are within reach given existing Mathlib infrastructure (smooth maps, exterior derivatives, the symplectic group). Item (6) requires the theory of Lagrangian submanifolds, which is absent. No Lean module ships with this unit.

Advanced results Master

Generating functions as symplectomorphism classification

The four types of generating function are not merely a calculational device -- they classify canonical transformations by the topology of their graph in the product manifold. Let be the product symplectic manifold with . The graph of a symplectomorphism is a Lagrangian submanifold .

The four types correspond to four Lagrangian fibrations of (projections onto coordinate -planes). A generating function of type exists when is transverse to the -th fibration. The Maslov index quantifies the obstruction to a single generating function being globally smooth: as you move around the Lagrangian submanifold, it may become tangent to a given fibration, causing the generating function to blow up. The transition between charts (different types) is governed by the Maslov class in .

For the harmonic oscillator on the circle, the Maslov index is 2 (two caustics per period), which produces the correction in the WKB quantisation condition.

Time-dependent generating functions

A canonical transformation can depend explicitly on time: . The extended phase space carries the contact form and the extended symplectic form . A transformation is canonical in the extended sense if it preserves .

Proposition (Time-dependent generating functions). A time-dependent canonical transformation is locally generated by via , , with the new Hamiltonian .

Proof. The closed 1-form on the extended phase space, with and , satisfies when preserves . Locally for some , giving the three relations.

Time-dependent generating functions arise naturally when changing to a rotating or accelerating frame. Setting recovers the Hamilton-Jacobi equation.

Hamilton-Jacobi as the type-2 generating function

The deepest application of generating functions is the Hamilton-Jacobi equation. Choose a type-2 generating function such that the new Hamiltonian vanishes: . The relation gives:

This is the Hamilton-Jacobi equation 09.05.02. Its solution (where are integration constants) generates a canonical transformation that entirely trivialises the dynamics: implies and , so the new variables are constants. The system is solved by quadrature from the generating function.

Jacobi's theorem establishes the equivalence: solving the Hamilton's ODEs is equivalent to solving the single first-order PDE for . The PDE is generally harder to solve, but when separation of variables applies (as it does for all Liouville-integrable systems), it reduces to independent ODEs -- a dramatic simplification.

Time evolution as a generating function

The time- evolution map is a canonical transformation. Its type-1 generating function is Hamilton's principal function , defined as the action evaluated along the classical trajectory from at time to at time :

Hamilton's principal function satisfies and . The classical action is the generating function of the classical flow. This is the deep connection between the action principle and canonical transformations: the variational principle selects trajectories that are integral curves of the generating function of the time-evolution symplectomorphism.

Synthesis. The generating-function framework unifies the algebraic, geometric, and topological aspects of canonical transformations. The four types arise from the choice of Lagrangian splitting on the product manifold. The symplecticity of the transformation follows from the exactness of the generating-function differential (). The topological obstructions to a global generating function are measured by the Maslov class. The central insight is that a canonical transformation is completely determined by a single scalar function, and all transformation equations follow by differentiation. The Hamilton-Jacobi equation exploits this by choosing the generating function that trivialises the dynamics, reducing mechanics to the problem of solving one PDE.

Full proof set Master

Proposition 1 (Generating function guarantees symplecticity). The transformation defined by any of the four types of generating function is symplectic.

Proof. For type 2: implies , so . For type 1: implies , giving the same result. Types 3 and 4 differ only by signs in the 1-form identity, which cancel upon taking .

Proposition 2 (Existence of a generating function for any symplectomorphism). Let be a symplectomorphism. If at a point, then locally there exists generating .

Proof. The graph satisfies where . So is Lagrangian in . The 1-form restricts to a closed form on (since ). By the Poincare lemma, locally. The condition ensures serve as local coordinates on .

Proposition 3 (Legendre relations between the four types). , , , where the dependent variables in each expression are eliminated using the type-1 transformation equations.

Proof. Start from . Add to both sides: . The left side is , so . Subtract : , so . Both transforms together give .

Proposition 4 (Infinitesimal canonical transformations). The generating function generates, to first order in , the infinitesimal canonical transformation , . The function is the generator of the transformation.

Proof. . . The transformation differs from the identity by . Expressing and substituting: , giving and . This is the Hamiltonian flow generated by , evaluated at parameter .

Connections Master

  • Canonical transformations 09.05.01 are the symplectomorphisms whose generating functions are developed here. Unit 09.05.01 defines the structure; this unit provides the construction tool.
  • Poisson brackets 09.04.03 are preserved by every canonical transformation generated by the functions in this unit. The symplectic condition is equivalent to preservation of the canonical Poisson algebra.
  • Hamilton-Jacobi equation 09.05.02 is the PDE satisfied by the type-2 generating function that trivialises the Hamiltonian (). The HJ equation is the most important application of the generating-function framework.
  • Point transformations 09.05.04 are canonical transformations with the particularly simple type-2 generating function . Every configuration-space coordinate change lifts to a canonical transformation via this formula.
  • Action-angle variables 09.06.01 are constructed using a type-2 generating function that satisfies the Hamilton-Jacobi equation and separates the conserved actions from the cyclic angles.

Historical & philosophical context Master

The concept of generating functions for canonical transformations was introduced by Carl Gustav Jacob Jacobi in his Vorlesungen uber Dynamik (lectures delivered 1842--1843, published posthumously 1866). Jacobi recognised that the Hamilton-Jacobi equation -- the PDE satisfied by the generating function of the trivialising transformation -- reduces the problem of solving Hamilton's equations to the problem of solving a single first-order nonlinear PDE. This "Jacobi's theorem" established the equivalence between the Hamilton-Jacobi PDE and the ODE system of Hamilton's equations, and it became the dominant approach to solving mechanical problems in the 19th century.

William Rowan Hamilton had earlier (1833--1834) introduced what is now called Hamilton's principal function -- the type-1 generating function of the time-evolution map -- as the solution of a variational problem. Hamilton's insight was that the action functional, evaluated on classical trajectories, satisfies a first-order PDE (the Hamilton-Jacobi equation in its time-dependent form). Jacobi sharpened this by showing that any complete integral of the HJ equation (a solution depending on arbitrary constants) generates a canonical transformation that solves the mechanical problem, whether or not the function was obtained from an action integral.

The four-type classification was systematised in the early 20th century. The standard textbook presentation is due to Goldstein (Classical Mechanics, 1950, now in its 3rd edition). Landau and Lifshitz (Mechanics, 1976) develop primarily the type-2 generating function, which they denote , because it connects most directly to the Hamilton-Jacobi equation.

The Lagrangian-submanifold interpretation is due to Weinstein (1971) and is developed in Arnold's Mathematical Methods (1974, English translation 1978). This geometric viewpoint reveals that the four types are not arbitrary conventions but reflect the four natural Lagrangian fibrations of the product symplectic manifold . The Maslov class, introduced by Maslov (1972) and developed by Leray, Hormander, and others, quantifies the topological obstruction to a globally smooth generating function of a single type.

The philosophical significance of generating functions is the reduction of a high-dimensional geometric problem (finding a symplectomorphism) to a scalar function. This is a recurring pattern in mathematical physics: potentials encode vector fields, actions encode trajectories, and generating functions encode coordinate changes. In each case the scalar object is easier to manipulate and optimise than the vector or tensor object it generates. The transition from quantum to classical mechanics (the WKB approximation, path integrals) relies on the generating function as the bridge between the quantum amplitude and the classical trajectory.

Bibliography Master

  • Jacobi, C. G. J., Vorlesungen uber Dynamik (Georg Reimer, 1866). Generating functions, the Hamilton-Jacobi equation, Jacobi's theorem.
  • Hamilton, W. R., "On a General Method in Dynamics" (1834). Hamilton's principal function as the generating function of time evolution.
  • Goldstein, H., Poole, C. P. & Safko, J. L., Classical Mechanics, 3rd ed. (Pearson, 2002). The standard four-type treatment.
  • Landau, L. D. & Lifshitz, E. M., Mechanics, 3rd ed. (Pergamon, 1976), §45--46.
  • Arnold, V. I., Mathematical Methods of Classical Mechanics, 2nd ed. (Springer GTM 60, 1989), §48.
  • Marsden, J. E. & Ratiu, T. S., Introduction to Mechanics and Symmetry, 2nd ed. (Springer TAM 17, 1999), Ch. 2.7.
  • Weinstein, A., "Symplectic manifolds and their Lagrangian submanifolds," Advances in Mathematics 6 (1971), 329--346.
  • Maslov, V. P., Theorie des perturbations et methodes asymptotiques (Dunod, 1972). The Maslov class and singular generating functions.
  • Abraham, R. & Marsden, J. E., Foundations of Mechanics, 2nd ed. (Addison-Wesley, 1978), §3.4--3.5.
  • Taylor, J. R., Classical Mechanics (University Science Books, 2005), Ch. 13.5.