Formal Verification of a Computer-Assisted Proof in Celestial Mechanics
Abstract
Albouy, Fu and Sun conjectured in 2008 that four positive masses admit, for each cyclic order of the bodies, exactly one convex central configuration up to similarity; the question is Problem 10 of a 2012 list of open problems on the n-body problem. We recently proved the conjecture by reducing it to an inequality for a trace at the real zeros of an equation in four variables; a branch and bound that starts from a grid of 136,448 boxes establishes the inequality. In this paper we describe a formalization of the whole proof in Lean 4 and Mathlib in which Lean's kernel checks the computation, using decide +kernel, so that no compiler has to be trusted. Our checker stores an interval as two natural numbers in a biased fixed-point format. The kernel can then hand all the arithmetic to GMP. Functions are enclosed over boxes by first-order slopes. An unverified search records the decisions for each box in one natural number, and the checker replays them. We write each formula once over a type class; evaluating it at a type that pairs a real number with an interval then proves the enclosure correct. Checking the 3418 certificate theorems takes 7.6 hours of processor time, and the independent type checker nanoda accepts the proof. A version rebuilt on one eighth of the boxes passed three type checkers in 2.9 hours on a public registry of formal proofs.
In plain words
Albouy, Fu and Sun conjectured in 2008 that four masses, arranged in a given order, have exactly one convex shape in which they can spin together rigidly. An earlier paper proved the conjecture with a computer calculation. This paper checks the whole proof, including that calculation, inside the core checker of the proof assistant Lean, so no compiler needs to be trusted. The trick is to store each number range as two whole numbers, so the checker can hand the arithmetic to a fast library. A second checker, which does its own arithmetic, accepts the proof too.
Formal statement and axioms
Each main result as stated in Lean, copied verbatim from the published package, with the axioms that the proof rests on. Lean v4.35.0-rc3, Mathlib c55e6e786f49. The package.
C4.theoremA
theorem theoremA (m : Masses) (hm : ∀ i, 0 < m i) :
∃ q, IsCC m q ∧ Order1234 q ∧ ∀ q', IsCC m q' → Order1234 q' → Similar q q'Definitions used in the statement
def Order1234 (q : Conf) : Prop :=
0 < area q 0 * area q 2 ∧ 0 < area q 1 * area q 3 ∧ area q 0 * area q 1 < 0def Similar (q q' : Conf) : Prop :=
∃ a b : ℝ, ∃ t : V2, a ^ 2 + b ^ 2 ≠ 0 ∧ (q' = simc a b t q ∨ q' = simc a b t (mirror q))def simc (a b : ℝ) (t : V2) (q : Conf) : Conf :=
fun i => (a * (q i).1 - b * (q i).2 + t.1, b * (q i).1 + a * (q i).2 + t.2)def mirror (q : Conf) : Conf := fun i => ((q i).1, -(q i).2)def IsCC : Prop :=
CollisionFree q ∧
∃ lam : ℝ, ∀ i, (∑ j, (m i * m j * ss q i j) • (q j - q i)) + (lam * m i) • (q i - cm m q) = 0def CollisionFree : Prop := ∀ i j, i ≠ j → q i ≠ q jnoncomputable def ss (i j : Fin 4) : ℝ := 1 / (Rs q i j * rr q i j)noncomputable def rr (i j : Fin 4) : ℝ := Real.sqrt (Rs q i j)def Rs (i j : Fin 4) : ℝ := dot (q i - q j) (q i - q j)def dot (u v : V2) : ℝ := u.1 * v.1 + u.2 * v.2noncomputable def cm : V2 := (mtot m)⁻¹ • ∑ i, m i • q idef mtot : ℝ := m 0 + m 1 + m 2 + m 3def area (l : Fin 4) : ℝ :=
match l with
| 0 => tri q 1 2 3
| 1 => -tri q 0 2 3
| 2 => tri q 0 1 3
| 3 => -tri q 0 1 2def tri (i j k : Fin 4) : ℝ := cross (q j - q i) (q k - q i) / 2def cross (u v : V2) : ℝ := u.1 * v.2 - u.2 * v.1abbrev Conf := Fin 4 → V2abbrev Masses := Fin 4 → ℝabbrev V2 := ℝ × ℝAxioms, as Lean reports them. Recorded in the published file.
'C4.theoremA' depends on axioms: [propext, Classical.choice, Quot.sound]