Unit packings, upper density, the sphere-packing and lattice-packing constants
DefinitionTenChallenges_SpherePackingThe definitions behind Challenge 7 of the Ten Challenges benchmark, in with the Euclidean distance and Lebesgue measure.
- Unit packing. A set is a unit packing if for all distinct ; the open unit balls about its points are then pairwise disjoint.
- Upper density. For any set ,
an extended nonnegative real number. 3. Sphere-packing constant. . 4. Lattice-packing constant. . The separation condition makes discrete, so these are exactly the full-rank lattices with minimum distance at least .
These are the standard objects of the sphere packing problem; the density and constants are reusable for any packing statement.
Formalization Note. The space is EuclideanSpace ℝ (Fin d), the measure its volume, densities live in ℝ≥0∞, and the limit superior is along Filter.atTop on the real radius . The suprema are indexed suprema over all sets, respectively all additive subgroups, satisfying the stated conditions.
import Mathlib.Analysis.Normed.Lp.MeasurableSpace
import Mathlib.MeasureTheory.Measure.Haar.OfBasis
open MeasureTheory Metric Filter
open scoped ENNReal
/-- Sets of points in `ℝᵈ`. -/
abbrev PointSet (d : ℕ) := Set (EuclideanSpace ℝ (Fin d))
noncomputable section
variable {d : ℕ} (C : PointSet d)
/-- A set of centres `C ⊆ ℝ^d` is a *unit packing* if distinct centres are at
distance at least `2` (the open unit balls around the centres are disjoint). -/
def IsUnitPacking : Prop :=
∀ ⦃x⦄, x ∈ C → ∀ ⦃y⦄, y ∈ C → x ≠ y → 2 ≤ dist x y
/-- The (upper) density of a packing `C`: the `limsup` as `R → ∞` of the fraction
of the ball `B(0, R)` filled by the unit balls centred at the points of `C`. -/
def upperDensity : ℝ≥0∞ :=
limsup (fun R : ℝ =>
volume ((⋃ x ∈ C, ball x 1) ∩ ball 0 R)
/ volume (ball (0 : EuclideanSpace ℝ (Fin d)) R)) atTop
/-- The sphere-packing constant `Δ_d`: the supremum of densities over all unit
packings of `ℝᵈ`. -/
def spherePackingConstant (d : ℕ) : ℝ≥0∞ :=
⨆ (C : PointSet d) (_ : IsUnitPacking C), upperDensity C
/-- The lattice packing constant `Δᴸ_d`: the supremum of densities over unit
packing subgroups spanning `ℝᵈ`. The separation condition ensures discreteness. -/
def latticePackingConstant (d : ℕ) : ℝ≥0∞ :=
⨆ (L : AddSubgroup (EuclideanSpace ℝ (Fin d)))
(_ : IsUnitPacking (L : PointSet d))
(_ : Submodule.span ℝ (L : PointSet d) = ⊤),
upperDensity (L : PointSet d)
end
Read-back
What the Lean code literally says, in plain math · claude-fable-5-1
This file introduces five definitions, all parametrised by a natural number . Throughout, denotes the Euclidean space of real -tuples with the Euclidean () distance ; for this space consists of the single point . The measure on is the default volume of a finite-dimensional real inner-product space: the translation-invariant (Haar) measure normalised so that the parallelepiped spanned by an orthonormal basis has measure , i.e. standard Lebesgue measure; in dimension it gives the one-point space total mass . Values of lie in the extended non-negative reals , and all suprema, quotients and limsups below are taken in .
Point sets. A point set in dimension is an arbitrary subset . No measurability, discreteness, countability or finiteness is required.
Unit packing. A point set is a unit packing iff
The inequality is non-strict (distinct centres at distance exactly are allowed). The empty set and every singleton are unit packings, since the condition is then vacuous; for every subset of the one-point space is a unit packing.
Upper density. For a point set its upper density is
where ranges over all real numbers, is the open ball, and is the origin. The following conventions are part of the formula:
- The quotient is division in , with and . Hence for , , and for every (including ).
- The limsup is the limsup in the complete lattice along : the infimum of all such that the ratio is for all sufficiently large ; equivalently . It always exists (possibly ) and ignores the values of the ratio for small .
- For , , so numerator and denominator are both and the ratio is ; this has no effect on the limsup.
- is applied as an outer measure; no measurability of is assumed (the union of open balls is open in any case).
- For and the denominator is positive and finite and the numerator is at most the denominator, so the ratio lies in and . If the union is empty and .
- For : for every and , so and .
Sphere-packing constant. For ,
Formally this is an indexed supremum over all point sets and then over all proofs that is a unit packing; when is not a unit packing the inner supremum has an empty index set and contributes the bottom element , so the value is exactly the supremum of over unit packings. The index set is never empty, since is a unit packing. There is no requirement that be discrete, countable, measurable, non-empty or of any particular structure. Edge case : the unit packings are and , so .
Lattice packing constant. For ,
Here ranges over all additive subgroups of (subsets containing and closed under addition and negation; nothing else is assumed, in particular no discreteness, closedness, finite generation or -basis). " is a unit packing" means that the underlying set of satisfies the unit-packing condition above, i.e. for all distinct ; is the upper density of that underlying set. is the smallest real linear subspace of containing the set , and it is required to equal the whole space. As before the supremum is formally over and over proofs of the two side conditions, with each failed condition contributing , so is the supremum of over the subgroups satisfying both conditions, and it would equal if no subgroup satisfied both. Edge case : the only subgroup is ; it is a unit packing, its span is the whole (trivial) space, and , so .
Confirmed by the mission captain (proposal self-audit).