The simple gravity pendulum: motions, energy, and the period
DefinitionPendulumDefsThis is the model on which the whole mission rests: the simple gravity pendulum of Pendulum (mechanics), together with the two periods that the mission compares.
Let be the magnitude of the gravitational field and the length of the rod, and let denote the angle between the rod and the downward vertical at time .
- Motions. A motion of the pendulum is a triple of functions from to such that is differentiable with derivative at every time, is differentiable with derivative at every time, and the equation of motion (Eq. 1 of the article)
holds at every time. Carrying the angular velocity and the angular acceleration as explicit functions, rather than as formal second derivatives, keeps every differentiability requirement visible in the statements that use the model.
-
Harmonic motions. For a real number , a harmonic motion of angular frequency is the same kind of triple satisfying the linear equation instead. This is the small-angle model obtained from Eq. 1 by replacing with , and it is also the model of the compound pendulum.
-
Energy. The mechanical energy of a motion, per unit of , is
-
The small-angle period. , Huygens's law for the period.
-
The complete elliptic integral of the first kind.
defined as an integral over the interval .
- The exact period. For an amplitude ,
which is Eq. 3 of the article.
Together these fix the vocabulary of the mission: every milestone and the goal theorem are statements about motions in sense 1 or 2, and the two period functions are the quantities whose relationship the mission establishes.
Formalization Note The two notions of motion are predicates on triples of real functions, so a hypothesis that something is a motion carries its own differentiability. is defined by an interval integral with no integrability hypothesis attached; for the integrand is not integrable and the definition returns a junk value, so every statement about in this mission restricts the modulus. Likewise the period functions use real division and square roots, which are total in Lean: for or they return junk values, and the statements that use them assume and .
/-
Definition block of the draft Prove2Me mission
**Pendulum (mechanics) I: The Exact Period of the Simple Gravity Pendulum**.
Source: Wikipedia, *Pendulum (mechanics)*, revision 1374595895
(the PDF supplied with this project).
This is the Lean code uploaded as the platform definition item `PendulumDefs`.
-/
import Mathlib
namespace Pendulum
/-! ### Definitions -/
/-- `IsMotion g l theta omega alpha` says that `theta` is a motion of the simple gravity
pendulum of length `l` in a uniform gravitational field of magnitude `g`:
`omega` is its angular velocity, `alpha` its angular acceleration, and the equation of
motion `θ'' = -(g/l) sin θ` (Eq. 1) holds at every time. -/
structure IsMotion (g l : ℝ) (theta omega alpha : ℝ → ℝ) : Prop where
hasDerivAt_theta : ∀ t, HasDerivAt theta (omega t) t
hasDerivAt_omega : ∀ t, HasDerivAt omega (alpha t) t
equation : ∀ t, alpha t = -(g / l) * Real.sin (theta t)
/-- `IsHarmonicMotion w theta omega alpha` says that `theta` solves the harmonic oscillator
equation `θ'' = -w² θ`, with angular velocity `omega` and angular acceleration `alpha`. -/
structure IsHarmonicMotion (w : ℝ) (theta omega alpha : ℝ → ℝ) : Prop where
hasDerivAt_theta : ∀ t, HasDerivAt theta (omega t) t
hasDerivAt_omega : ∀ t, HasDerivAt omega (alpha t) t
equation : ∀ t, alpha t = -(w ^ 2) * theta t
/-- The mechanical energy of the pendulum per unit of `m * l ^ 2`:
`E = ω²/2 - (g/l) cos θ`. -/
noncomputable def energy (g l : ℝ) (theta omega : ℝ → ℝ) (t : ℝ) : ℝ :=
omega t ^ 2 / 2 - (g / l) * Real.cos (theta t)
/-- The small-angle period `T₀ = 2π √(l/g)` (Huygens's law). -/
noncomputable def smallAnglePeriod (g l : ℝ) : ℝ := 2 * Real.pi * Real.sqrt (l / g)
/-- The complete elliptic integral of the first kind,
`K(k) = ∫₀^{π/2} dφ / √(1 - k² sin² φ)`. -/
noncomputable def ellipticK (k : ℝ) : ℝ :=
∫ u in (0 : ℝ)..(Real.pi / 2), (Real.sqrt (1 - k ^ 2 * Real.sin u ^ 2))⁻¹
/-- The exact period of a simple pendulum of length `l` in gravity `g` released from rest at
amplitude `theta0`: `T = 4 √(l/g) K(sin(θ₀/2))` (Eq. 3). -/
noncomputable def exactPeriod (g l theta0 : ℝ) : ℝ :=
4 * Real.sqrt (l / g) * ellipticK (Real.sin (theta0 / 2))
end Pendulum
Read-back
What the Lean code literally says, in plain math · non-blind: written by the drafting agent (Aristotle by Harmonic)
Non-blind read-back — not independent testimony. This read-back was written by the same agent that drafted the Lean statement it describes, at the explicit instruction of the proposal's owner. It was not produced by an independent auditor reading the code blind, so it is not independent evidence that the formalization is faithful: an author who knows what the code is meant to say tends to read that meaning into it. Please audit the statement against the source directly, and treat this text only as a convenience rendering.
This bundle introduces six declarations in a namespace for the pendulum, all phrased over the real numbers.
Motions. For real parameters and and three functions , the predicate IsMotion holds exactly when all three of the following hold: for
every real , is differentiable at with derivative ; for every real ,
is differentiable at with derivative ; and for every real ,
Nothing requires or to be positive, or even nonzero: if then is by the real-division convention, and the predicate then says that vanishes identically.
Harmonic motions. For a real and the same kind of triple, the predicate
IsHarmonicMotion holds exactly when and everywhere, and for
every real , . Again is unrestricted; is allowed and then
the condition is that vanishes identically.
Energy. For real , functions and a time , the quantity energy is
the real number
It is a function of the time ; no relation between and is imposed in the definition itself.
Small-angle period. For real , the quantity smallAnglePeriod is
, where the square root is the real square root, which returns on negative
arguments. For the quotient is and the value is .
Complete elliptic integral. For a real , ellipticK is the interval integral
taken with respect to Lebesgue measure on the oriented interval from to . The integrand uses the real square root (zero on negative arguments) and real inversion (with ), so for the integrand takes the value wherever ; for the function is not integrable near the points where the radicand vanishes and the integral evaluates to the default value rather than diverging.
Exact period. For real , the quantity exactPeriod is
with the previous declaration and the same junk-value conventions for the square root and the quotient.
No claim is asserted by any of these six declarations; they are definitions only.