Sphere configurations and Coulomb energy
DefinitionThomsonCampaign_Basicdiscrete-geometryenergy-minimizationthomson-problem
Let carry its Euclidean norm. A sphere configuration of points is a map with for every and injective, so the points lie on the unit sphere and are pairwise distinct. Its Coulomb energy is
Distinctness matters in Lean, where : without it, coincident points would cost nothing.
cyl ρ θ h is the point with cylindrical coordinates .
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.