Skip to content

feat(ClassicalMechanics): pendulum trajectories on the configuration circle and the bridge to physical space - #1571

Open
aadarwal wants to merge 5 commits into
leanprover-community:masterfrom
aadarwal:pendulum/pr4-geometric-bridge
Open

feat(ClassicalMechanics): pendulum trajectories on the configuration circle and the bridge to physical space#1571
aadarwal wants to merge 5 commits into
leanprover-community:masterfrom
aadarwal:pendulum/pr4-geometric-bridge

Conversation

@aadarwal

@aadarwal aadarwal commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Toward #883 — closes the tracker's trajectory and Lagrangian requirements: with this PR the parent
pendulum API map has no N/A rows left.

Stacked. Base is the Hamiltonian PR #1570 (branch pendulum/pr3-hamiltonian, bda52edb).
The commits belonging to this PR are the last two (865163fb, f113b6bb), touching two new
modules, Physlib.lean, and both API maps. Please review after #1570.

Two new modules under SimplePendulum/Geometric/:

Trajectory.leanTrajectory := Time → ConfigurationSpace; Trajectory.ofLift (the
trajectory described by a lift of the angle) with: invariance under whole-turn shifts
(ofLift_add_int_mul_two_pi), ofLift_eq_iff (two lifts give the same trajectory iff at each
time
they differ by whole turns — the quantifiers are ∀ t, ∃ n; the uniform-n version is
false), continuity, and contMDiff_ofLift (a C^n lift describes a C^n curve in the circle —
forward direction only; the converse needs the covering-map lift and is deferred honestly); the
bob's position along a trajectory with the rod-length constraint.

PhysicalSpace.leanspaceTrajectory (the bob's position for a fixed pendulum), its
velocity (ℓ cos θ, ℓ sin θ)·θ̇ and speed ℓ²θ̇², and the payoff identities under
Differentiable ℝ θ: kineticEnergy_eq_space (½ I θ̇² = ½ m ‖v‖²), potentialEnergy_eq_height
(V = m g h, h from the bottom of the swing), lagrangian_eq_spacethe chart Lagrangian of
#1564 is the constrained Lagrangian of a point mass on the circle of radius ℓ
— and
energy_eq_space.

deriv_sin_coord/deriv_cos_coord are general chain-rule facts kept local to keep this PR to one
file pair; happy to promote them to Time/Derivatives.lean in a follow-up if preferred.

Reviewer reading order: Trajectory.lean §A (check ofLift_eq_iff's quantifiers), §B, §C;
then PhysicalSpace.lean §A–B (the global-Differentiable hypothesis comes from the Time.deriv
API), §C (the four identities); the API maps last — the parent's trajectory and Lagrangian rows
flip to done, the Lagrangian row citing both the definition (SimplePendulum.lagrangian,
Basic.lean) and the identification proved here.

Verification: full lake build + complete linter battery pass; axiom audit clean; the two new
modules' imports verified minimal.

Developed with assistance from AI; all mathematics and proofs were reviewed and verified to compile.

@github-actions

Copy link
Copy Markdown
Contributor

Thank you for this pull-request (PR). If this is your first PR, welcome to the community!

Below is what will happen next. Please read carefully if you are not familiar with the process. You may open other PRs while this one is being reviewed, and can stack PRs on top of each other, so don't let these steps slow you down.

  1. Some automated checks will be run on your PR. You can see the results of these checks at the buttom of your PR page. If any of these checks fail, you will need to fix the issues before your PR can be merged. You can learn more about these here, including how to run them locally, which is sometimes quicker than relying on the GitHub Actions. If you have never had a PR merged before, you may have to wait for a reviewer to manually start these checks (this is for security).

  2. A reviewer will look at your PR and may ask you to make changes. This may happen a couple of days after you submit your PR, so you may need to be patient. But it should not be longer than that - if it is please bring it to the attention of the community on the Zulip. The level of review will depend on where your PR is submitted. If it is submitted to ./Physlib or ./QuantumInfo, the review will be more thorough than if it is submitted to ./PhyslibAlpha. You can find out more about what the review process is looking for in our review guidelines. If a reviewer adds an awaiting-author label to your PR, address the review comments, then please remove that label by adding a comment with -awaiting-author. This helps us keep track of reviews.

  3. The reviewer will either approve your PR, or request more changes (in which case we return to step 2). Once your PR is approved, it will be merged by a maintainer, this should happen shortly after approval, though you may get more comments at this stage.

Tip: The easiest way to get have a fast review is to submit a PR that is small and self-contained, and has clear documentation explaining why things are the way they are in your chages.

If you have any problems or questions, please reach out to the community on the Zulip.

aadarwal and others added 2 commits August 25, 2026 13:13
…ian and Hamilton's equations

New module Physlib.ClassicalMechanics.Pendulum.SimplePendulum.Hamiltonian (imported from
Physlib.lean), with the Hamiltonian formulation of the simple pendulum:

- toCanonicalMomentum: the canonical momentum p = dL/dtheta-dot = I theta-dot, as a linear
  equivalence between velocities and momenta, with its value toCanonicalMomentum_eq.
- hamiltonian: the Legendre transform of the Lagrangian, with hamiltonian_eq computing it as
  the momentum-space kinetic energy plus the potential energy, hamiltonian_contDiff for its
  joint smoothness, and the partial gradients gradient_hamiltonian_position_eq and
  gradient_hamiltonian_momentum_eq.
- hamiltonian_eq_energy: along any lift of the angle the Hamiltonian, evaluated on the
  canonical momentum of the lift, is the energy.
- hamiltonEqOp: the Hamilton-equations operator of the Hamiltonian on momentum-angle phase
  space.
- equationOfMotion_iff_hamiltonEqOp_eq_zero: for a smooth lift of the angle the equation of
  motion is equivalent to Hamilton's equations.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Add section B to SimplePendulum/Hamiltonian.lean: equationOfMotion_tfae proves that, for a
smooth lift of the angle, the pointwise equation of motion, the vanishing of the variational
derivative of the action, Hamilton's equations, the Lagrangian variational principle and the
Hamiltonian variational principle are all equivalent. Update the module doc (Key results
bullet and TOC entry for section B) and the API map (Hamiltonian-formulation requirement row,
Overview kept consistent).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
aadarwal and others added 3 commits August 26, 2026 11:56
…miltonian module

- Rename `toCanonicalMomentum` to `canonicalMomentum` (the `to` prefix is for maps into a
  different type); `toCanonicalMomentum_eq` becomes `canonicalMomentum_eq`.
- Inline the four one-line proofs of the linear equivalence.
- Drop the sub-subsection heading that introduced a single lemma.

Requested by review on leanprover-community#1570.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Codex GPT-5.6 <noreply@openai.com>
…t and its smoothness

Add SimplePendulum/Geometric/Trajectory.lean:

- Trajectory: trajectories of the pendulum as curves Time → ConfigurationSpace, with
  Trajectory.ofLift sending a lift of the angle to the trajectory it describes on the circle
  (ofLift_apply).
- ofLift_add_int_mul_two_pi and ofLift_eq_iff: two lifts describe the same trajectory exactly
  when they differ by a whole number of turns at each time.
- continuous_ofLift and contMDiff_ofLift: the trajectory described by a continuous (resp. C^n)
  lift is continuous (resp. a C^n curve in the configuration circle).
- Trajectory.toSpace: the physical position of the bob along a trajectory, with toSpace_ofLift,
  the rod-length constraint norm_toSpace and continuous_toSpace.
- The geometric velocity as an mfderiv into the circle's tangent bundle is deferred to a later
  module, documented in prose; in this PR velocities are computed in physical space.
- Register the module in Physlib.lean (sorted after Geometric.Basic).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Codex GPT-5.6 <noreply@openai.com>
…tification of the lifted energies and Lagrangian with the bob's

Add SimplePendulum/Geometric/PhysicalSpace.lean:

- spaceTrajectory: the bob's position in the plane along a lifted trajectory, defined through
  Trajectory.toSpace, with spaceTrajectory_eq, the coordinate lemmas spaceTrajectory_apply_zero
  and spaceTrajectory_apply_one, and the rod-length constraint norm_spaceTrajectory (equal to
  ℓ, the length being positive).
- differentiable_spaceTrajectory and deriv_spaceTrajectory: the bob's velocity along a
  differentiable lift, computed componentwise via the chain-rule lemmas deriv_sin_coord and
  deriv_cos_coord; norm_sq_deriv_spaceTrajectory gives the square of the speed, ℓ² θ̇².
- kineticEnergy_eq_space, potentialEnergy_eq_height, lagrangian_eq_space and energy_eq_space:
  the chart kinetic energy, potential energy, Lagrangian and energy of SimplePendulum.Basic
  are those of the bob in physical space, exhibiting the chart Lagrangian as the constrained
  Lagrangian of a point mass on the circle of radius ℓ.
- Register the module in Physlib.lean (sorted between Geometric.Basic and Geometric.Trajectory).
- API maps: mark the trajectory rows done in SimplePendulum/API-map.yaml and
  Pendulum/API-map.yaml, add the identification row to SimplePendulum/API-map.yaml, and mark
  the Lagrangian row of Pendulum/API-map.yaml done.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Codex GPT-5.6 <noreply@openai.com>
@aadarwal
aadarwal force-pushed the pendulum/pr4-geometric-bridge branch from 6c5b180 to f113b6b Compare August 26, 2026 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blocked-by-PR This PR depends on another PR large

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants