Equal-circle packing constants in the unit square
DefinitionCirclePackingConstantsDefines admissible packings of congruent disks in the unit square, the supremal radius , and the covered-area constant .
import Mathlib
noncomputable section
namespace CirclePackingConstants
abbrev Point := ℝ × ℝ
/-- Squared Euclidean distance in Cartesian coordinates. -/
def sqDist (p q : Point) : ℝ :=
(p.1 - q.1) ^ 2 + (p.2 - q.2) ^ 2
/-- Coordinate containment conditions for a disk center in the unit square. -/
def InInnerSquare (r : ℝ) (p : Point) : Prop :=
r ≤ p.1 ∧ p.1 ≤ 1 - r ∧ r ≤ p.2 ∧ p.2 ≤ 1 - r
/-- `n` equal disks of radius `r` fit in the unit square with disjoint interiors. -/
def Packable (n : ℕ) (r : ℝ) : Prop :=
0 ≤ r ∧ r ≤ 1 / 2 ∧
∃ p : Fin n → Point,
(∀ i, InInnerSquare r (p i)) ∧
∀ i j, i ≠ j → (2 * r) ^ 2 ≤ sqDist (p i) (p j)
/-- The supremum of radii admitted by `Packable`. -/
def r_n (n : ℕ) : ℝ := sSup {r : ℝ | Packable n r}
/-- The optimal covered-area fraction for `n` equal disks in the unit square. -/
def c_n (n : ℕ) : ℝ := (n : ℝ) * Real.pi * (r_n n) ^ 2
end CirclePackingConstants
Read-back
What the Lean code literally says, in plain math · gpt-6-astra
Point. A point is an ordered pair of real numbers, so the type of points is .
sqDist. For any two points and in , define their squared distance by . No distinctness assumption is imposed; in particular, this value is zero when .
InInnerSquare. For any real number and any point , the predicate means that and . The boundary inequalities are inclusive. There is no assumption that is nonnegative; negative values are permitted, whereas for no point satisfies the predicate.
Packable. For every natural number , including zero, and every real number , the predicate means that and there exists a family of points indexed by such that and for every index , and for every pair of distinct indices . Equality in the separation inequality is allowed. Distinct indices are not independently required to have distinct points, so coincident points are allowed when . For the family is empty and all indexed conditions are vacuous, leaving exactly .
r_n. For every natural number , including zero, define to be the real supremum of the set of all real numbers for which holds.
c_n. For every natural number , including zero, define , where is cast to a real number.
Confirmed by the mission captain (proposal self-audit).