Binary star dynamics: two-body system, center of mass, relative Kepler problem, conic orbit
DefinitionCelestialMechanics_binary_star_dynamicsThis file fixes the kinematic and dynamical vocabulary used throughout the mission, following Section 4.16 of Fitzpatrick's Celestial Mechanics.
Motion takes place in with the Euclidean norm. A pair of trajectories is a Newtonian gravitational two-body system with constant and masses when both trajectories are twice continuously differentiable, the stars never coincide, and, writing and , Newton's second law holds for each star under the gravitational force of Eq. (4.108),
The center of mass is .
A curve solves the relative (one-body) Kepler problem with gravitational parameter when it is twice continuously differentiable, never zero, and satisfies Eq. (4.110), .
Finally, a curve is a Keplerian conic orbit with major radius , eccentricity and angular momentum per unit reduced mass , with polar description , when is differentiable, the motion lies in the - plane as in Eq. (4.112), , and Eqs. (4.113)-(4.114) hold:
import Mathlib
noncomputable section
namespace CelestialMechanics
/-- Physical space: `ℝ³` with the Euclidean norm. -/
abbrev Space := EuclideanSpace ℝ (Fin 3)
/-- `IsNewtonianTwoBody G m₁ m₂ r₁ r₂` says that the trajectories `r₁, r₂ : ℝ → ℝ³` form a
Newtonian gravitational two-body system with gravitational constant `G` and masses `m₁, m₂`:
both trajectories are twice continuously differentiable, the two bodies never occupy the same
point, and each obeys Newton's second law under the inverse-square attraction of the other,
the force on the second body being `-(G m₁ m₂ / ‖r‖³) r` with `r = r₂ - r₁`. -/
def IsNewtonianTwoBody (G m₁ m₂ : ℝ) (r₁ r₂ : ℝ → Space) : Prop :=
ContDiff ℝ 2 r₁ ∧ ContDiff ℝ 2 r₂ ∧ (∀ t, r₁ t ≠ r₂ t) ∧
(∀ t, m₁ • iteratedDeriv 2 r₁ t =
(G * m₁ * m₂ / ‖r₂ t - r₁ t‖ ^ 3) • (r₂ t - r₁ t)) ∧
(∀ t, m₂ • iteratedDeriv 2 r₂ t =
(-(G * m₁ * m₂) / ‖r₂ t - r₁ t‖ ^ 3) • (r₂ t - r₁ t))
/-- The center of mass `(m₁ r₁ + m₂ r₂) / (m₁ + m₂)` of the two bodies. -/
def centerOfMass (m₁ m₂ : ℝ) (r₁ r₂ : ℝ → Space) : ℝ → Space :=
fun t => (m₁ / (m₁ + m₂)) • r₁ t + (m₂ / (m₁ + m₂)) • r₂ t
/-- `IsKeplerRelative G M r` says that `r : ℝ → ℝ³` solves the equivalent one-body Kepler
problem with gravitational parameter `G M`: it is twice continuously differentiable, never
zero, and satisfies `r'' = -(G M / ‖r‖³) r`. -/
def IsKeplerRelative (G M : ℝ) (r : ℝ → Space) : Prop :=
ContDiff ℝ 2 r ∧ (∀ t, r t ≠ 0) ∧
∀ t, iteratedDeriv 2 r t = (-(G * M) / ‖r t‖ ^ 3) • r t
/-- `IsConicOrbit a e h rad th r` says that the curve `r : ℝ → ℝ³` is the Keplerian conic with
major radius `a`, eccentricity `e` and angular momentum per unit reduced mass `h`, described
in polar coordinates `rad` (radius) and `th` (true anomaly): the motion takes place in the
`x`-`y` plane, `rad = a (1 - e²) / (1 + e cos th)`, and `th' = h / rad²`. -/
def IsConicOrbit (a e h : ℝ) (rad th : ℝ → ℝ) (r : ℝ → Space) : Prop :=
Differentiable ℝ th ∧
(∀ t, rad t = a * (1 - e ^ 2) / (1 + e * Real.cos (th t))) ∧
(∀ t, deriv th t = h / rad t ^ 2) ∧
(∀ t, r t 0 = rad t * Real.cos (th t)) ∧
(∀ t, r t 1 = rad t * Real.sin (th t)) ∧
(∀ t, r t 2 = 0)
end CelestialMechanics
Read-back
What the Lean code literally says, in plain math · same agent as the drafter (non-blind)
Provenance note — this read-back is NOT blind. It was written by the same agent that drafted the Lean statements in this proposal, working from the source material and from its own formalization intent. It is therefore self-testimony, not independent auditor testimony, and must not be read as independent confirmation that the Lean code says what the prose says. An auditor should check the Lean statement directly, or commission a blind read-back from an agent that has seen only the code.
This file introduces five declarations over the real numbers; throughout, space means equipped with the Euclidean () norm , and a trajectory means an arbitrary function from (thought of as time, with no restriction to an interval) to that space.
1. Two-body predicate. For real numbers and trajectories , the predicate asserts the conjunction of five conditions: is twice continuously differentiable; is twice continuously differentiable; for every real , ; for every real ,
and for every real ,
Here denotes the second iterated derivative. The masses and are unconstrained reals at this point: nothing forces them positive, and with or the two force equations reduce to and to the requirement that both second derivatives be annihilated only in the sense stated. The separation is never zero, so the denominators are never zero.
2. Center of mass. For reals and trajectories , this is the trajectory . If the divisions return the junk value , so the definition then yields the identically zero trajectory.
3. Relative Kepler predicate. For reals and a trajectory , it asserts: is twice continuously differentiable; for every real ; and for every real ,
Again and are arbitrary reals.
4. Conic-orbit predicate. For reals , real-valued functions of time and a trajectory , it asserts the conjunction of six conditions: is differentiable on all of ; for every ,
for every , ; and, writing the three Cartesian components of as , for every : , , and . Nothing here requires , , , or ; if at some time the first equation forces (division by zero returns ), and then the second equation forces at that time. The predicate constrains completely in terms of and , but says nothing on its own about differentiability of or of beyond what follows from these equations.
5. Ambient convention. The three Cartesian components are indexed by , and the norm used everywhere is the Euclidean one, so .