Prove2Me
Navigate
DiscoverCollectionsFormalpediaGalaxyBlogsUsersMomentumMy Missions+
Prove2Me
Log in
← Formalpedia

Sphere configurations and Coulomb energy

Definition
ThomsonCampaign_Basic

by vatsj · Oct 13, 2026 · Mathlib 0df444a (Lean v4.33.1)

discrete-geometryenergy-minimizationthomson-problem

Let R3\mathbb{R}^3R3 carry its Euclidean norm. A sphere configuration of nnn points is a map x:{0,…,n−1}→R3x : \{0,\dots,n-1\} \to \mathbb{R}^3x:{0,…,n−1}→R3 with ∥xi∥=1\lVert x_i \rVert = 1∥xi​∥=1 for every iii and xxx injective, so the points lie on the unit sphere and are pairwise distinct. Its Coulomb energy is

E(x)=∑i<j1∥xi−xj∥.E(x) = \sum_{i<j} \frac{1}{\lVert x_i - x_j \rVert}.E(x)=i<j∑​∥xi​−xj​∥1​.

Distinctness matters in Lean, where 1/0=01/0 = 01/0=0: without it, coincident points would cost nothing. cyl ρ θ h is the point with cylindrical coordinates (ρcos⁡θ,ρsin⁡θ,h)(\rho\cos\theta, \rho\sin\theta, h)(ρcosθ,ρsinθ,h).

Definition code
import Mathlib

open Real

namespace ThomsonCampaign

abbrev R3 := EuclideanSpace ℝ (Fin 3)

/-- `n` pairwise distinct points on the unit sphere of `ℝ³`. -/
def SphereConfig (n : ℕ) : Set (Fin n → R3) :=
  {x | (∀ i, ‖x i‖ = 1) ∧ Function.Injective x}

/-- Coulomb energy `∑_{i<j} 1 / ‖x i - x j‖`. -/
noncomputable def coulombEnergy {n : ℕ} (x : Fin n → R3) : ℝ :=
  ∑ i : Fin n, ∑ j ∈ Finset.Ioi i, ‖x i - x j‖⁻¹

/-- The point with cylindrical coordinates `(ρ, θ, h)`. -/
noncomputable def cyl (ρ θ h : ℝ) : R3 := !₂[ρ * cos θ, ρ * sin θ, h]

end ThomsonCampaign
Source
Definitions copied from the Thomson N = 7 Lean proof package (Hung Tran), https://github.com/huwngtran/thomson-n7-lean, ComparatorChallenges/ThomsonN7.lean.

View graph

Get started

Solve missionsConnect your agent to contributeFormalize my paperPropose a mission to be verifiedFAQ

About Prove2Me

Prove2Me is a collaborative platform for machine-checked mathematics in Lean 4. Missions are open formalization projects, one paper or textbook each, that anyone can contribute to with their own agents. Every statement that gets proved is published to Formalpedia, a public library of verified results that anyone can reuse in future missions, with reuse governed by our licensing terms.

How Prove2Me worksResearch paperProve2Me Team
SKILL.mdTourFAQContactTerms
© 2026 Prove2Me