Skip to content

feat(ClassicalMechanics): the small-angle regime of the simple pendulum as a harmonic oscillator - #1572

Open
aadarwal wants to merge 7 commits into
leanprover-community:masterfrom
aadarwal:pendulum/pr5-small-angle
Open

feat(ClassicalMechanics): the small-angle regime of the simple pendulum as a harmonic oscillator#1572
aadarwal wants to merge 7 commits into
leanprover-community:masterfrom
aadarwal:pendulum/pr5-small-angle

Conversation

@aadarwal

@aadarwal aadarwal commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Toward #883. The small-angle regime.

Stacked. Base is the Hamiltonian PR #1570 (branch pendulum/pr3-hamiltonian, bda52edb);
this PR is independent of #1571 by design — no common Lean file (the two do both edit the
Overview paragraph of SimplePendulum/API-map.yaml; whichever merges second needs a
one-paragraph hand-merge). The commits belonging to this PR are the last four
(deb72686..b7bb4508).

One new module, Physlib/ClassicalMechanics/Pendulum/SimplePendulum/SmallAngle.lean (584 added
lines, of which 146 are Lean code — 31 declarations), plus Physlib.lean and two API-map rows.
The single concept: the linearized simple pendulum is the harmonic oscillator of mass
I = m ℓ² and spring constant m g ℓ
— so its solution theory is inherited rather than
reproved — together with the cubic bound that says how far the linearization is from the truth.

Section Contents
A toHarmonicOscillator; its frequency is SimplePendulum.ω = √(g/ℓ) — the mass cancels
B LinearizedEquationOfMotion (θ̈ + ω² θ = 0); its smoothness-free Newton form; the smooth-lift equivalence with the oscillator's equation of motion (with the totalized-variational caveat spelled out)
C inherited trajectories: existence, @[simp] initial-data lemmas, uniqueness (linearized_unique), the closed form, and releasedFromRest — the cosine motion, genuinely at rest at t = 0
D smallAnglePeriod = 2π √(ℓ/g) (as derived by Huygens, 1673) — mass- and amplitude-free; periodicity; the conserved energy in closed form
E the error of the linearization: the exact difference m g ℓ (θ − sin θ); the cubic bounds ≤ m g ℓ ‖θ‖³/6 (normed and coordinate forms, via Real.abs_sub_sin_le); and the capstone norm_equationOfMotion_residual_lea small-angle motion solves the pendulum's own equation of motion up to a cubically small residual

Every statement and docstring keeps the linearized/true boundary explicit — nothing claims
small-angle results for the true pendulum beyond the quantified E-section bounds. The API map now
records: "the classical amplitude-dependent period formula follows in later modules; its
identification with the nonlinear return time remains open."

Reviewer reading order: the module doc (i–iv); §A–B (the smoothness split); skim §C–D (one-to-
three-line transfers, following DampedHarmonicOscillator.toUndamped); read §E closely — it is
where the PR says what the linearization costs.

Verification: full lake build + complete linter battery pass; axiom audit clean; the
Landau–Lifshitz citations were verified by the author against the printed sources.

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

@github-actions github-actions Bot added the large label Aug 23, 2026
@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 5 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>
… linearized equation of motion

- toHarmonicOscillator (m := inertia, k := m g l) with simp projections and
  toHarmonicOscillator_omega
- LinearizedEquationOfMotion with its Newton form (smoothness-free) and the
  equivalence with the oscillator's equation of motion for smooth lifts
- imports HarmonicOscillator.Basic only (no Solution API used in this commit;
  the next commit extends the import)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Codex GPT-5.6 <noreply@openai.com>
…m the harmonic oscillator

- Import HarmonicOscillator.Solution (re-exporting Basic) to inherit the
  oscillator's solution theory.
- smallAngleTrajectory: the small-angle motion of given initial conditions as
  the trajectory of the associated harmonic oscillator, with smoothness
  (smallAngleTrajectory_contDiff) and its initial data at time 0
  (smallAngleTrajectory_at_zero, smallAngleTrajectory_velocity_at_zero).
- Existence and uniqueness: smallAngleTrajectory_linearizedEquationOfMotion and
  linearized_unique, both transferred through linearizedEquationOfMotion_iff;
  uniqueness routes the separate initial-data hypotheses into the conjunction
  taken by HarmonicOscillator.InitialConditions.trajectories_unique.
- releasedFromRest: the motion released from rest at angle θ₀ in the
  fun_prop-friendly cosine-smul shape, identified with the trajectory of
  ⟨single 0 θ₀, 0⟩ (releasedFromRest_eq), with its initial angle, vanishing
  initial angular velocity, and the linearized equation of motion.
- Module doc: key results and table of contents extended for section C.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Codex GPT-5.6 <noreply@openai.com>
…y and the cubic linearization bound

- Section D: smallAnglePeriod as the period of the associated harmonic
  oscillator, with the closed forms 2π/ω and 2π √(ℓ/g), positivity, the
  periodicity of every small-angle trajectory and of releasedFromRest, and
  the constant energy ½ (I ‖v₀‖² + m g ℓ ‖θ₀‖²) of a small-angle trajectory,
  transferred in its exact closed form from
  HarmonicOscillator.InitialConditions.trajectory_energy.
- Section E: the cubic linearization bound
  |τ(θ) + m g ℓ θ| ≤ m g ℓ |θ|³/6 via Real.abs_sub_sin_le, the exact vector
  difference torque_sub_toHarmonicOscillator_force, and
  gradLagrangian_sub_toHarmonicOscillator identifying the difference of the
  variational gradients of the two actions with the difference of torque and
  linearized force, the inertial terms cancelling.
- Task-2 review fold-ins: @[fun_prop] on smallAngleTrajectory_contDiff,
  @[simp] on the four at-zero lemmas, and the two small-angle docstring
  qualifiers; module doc ii/iii extended with the new sections.
- API map: two new rows (the small-angle limit; the relation between the
  full and the linearized dynamics) and the overview clause brought up to
  date.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Co-authored-by: Codex GPT-5.6 <noreply@openai.com>
…ngle module

- extend the Overview through the inherited solution theory, the mass- and
  amplitude-free period 2π√(ℓ/g), and the cubic measure of what the
  linearization discards
- prose fixes: the pendulum "is approximated by" its associated oscillator;
  the released-from-rest periodicity docstring describes the linearized
  motion; the energy docstring names the initial angle as ‖IC.x₀‖
- Huygens: drop the historically inverted pendulum-clocks clause, keep the
  isochrony attribution, and add Horologium Oscillatorium (1673) to the
  references
- state the rotational Newton form of the linearized equation with S.inertia
- new lemmas: smallAngleTrajectory_eq (the closed form),
  norm_torque_sub_toHarmonicOscillator_force_le (the normed cubic bound), and
  norm_equationOfMotion_residual_le (new subsection E.3: a small-angle motion
  nearly solves the pendulum's own equation of motion)
- reorder E.1 exact-difference-first and derive the coordinate bound from the
  exact difference instead of recomputing the torque
- dot-notation for the associated oscillator's force and gradLagrangian sites
- API map: the classical amplitude-dependent period formula follows in later
  modules; its identification with the nonlinear return time remains open

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/pr5-small-angle branch from 7e1e043 to b7bb450 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