Equidistant witnesses and distance-degree counts
DefinitionEsgk_EquidistantWitnessCountscombinatoricsdiscrete-geometrydistinct-distances
For an indexed configuration of points in the plane, let be its set of distance values and the number of configuration points at distance from (the public definitions OrderedDistanceValues and DistanceOutNeighborsAtValue). This module defines five counting objects.
EquidistantWitnesses P a b: for a finite set and points , the points with .IndexedEquidistantWitnesses p i j: the indices with .OrderedPairWitnessTotal p: the sum of the sizes of these index sets over all ordered pairs of distinct indices,
ApexEqualDistancePairs p x: the ordered pairs of distinct indices, both different from , with .DistanceDegreeFallingMass p: the sum
For an injective configuration the witness total equals the falling mass: both count the triples of indices with and . These counts compare equidistant witnesses with the number of distinct distances.
Formalization Note Indices are elements of Fin n. In the falling mass, is natural-number subtraction; the product is when in either convention.
Definition code
/-
Copyright (c) 2026 Adam McKenna. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Adam McKenna
-/
import Definitions.Def_Esgk_DistanceDesign
import Definitions.Def_Esgk_Energy
import Definitions.Def_Esgk_Foundation
namespace Esgk
open EuclideanGeometry
open scoped BigOperators
variable {α : Type*}
noncomputable def EquidistantWitnesses (P : Finset Point) (a b : Point) : Finset Point :=
P.filter (fun x => dist x a = dist x b)
noncomputable def IndexedEquidistantWitnesses {n : ℕ}
(p : Config n) (i j : Fin n) : Finset (Fin n) :=
Finset.univ.filter (fun x => dist (p x) (p i) = dist (p x) (p j))
noncomputable def OrderedPairWitnessTotal {n : ℕ} (p : Config n) : ℕ :=
∑ ij ∈ (Finset.univ : Finset (Fin n)).offDiag,
(IndexedEquidistantWitnesses p ij.1 ij.2).card
noncomputable def ApexEqualDistancePairs {n : ℕ}
(p : Config n) (x : Fin n) : Finset (Fin n × Fin n) :=
((Finset.univ.erase x).offDiag).filter
(fun ab => dist (p x) (p ab.1) = dist (p x) (p ab.2))
noncomputable def DistanceDegreeFallingMass {n : ℕ} (p : Config n) : ℕ :=
∑ r ∈ OrderedDistanceValues p,
∑ x, (DistanceOutNeighborsAtValue p x r).card *
((DistanceOutNeighborsAtValue p x r).card - 1)
end Esgk