AFTD Auto-Formalizing Theoretical Domains

distance_multiplicity

def

The multiplicity of a distance r in a finite subset S of a metric space is the number of 2-element subsets of S whose two elements have distance r.

Statement

open Classical in
noncomputable def distance_multiplicity {E : Type*} [PseudoMetricSpace E]
    (S : Finset E) (r : ℝ) : ℕ
Defined in
arXiv:2610.38368, Section 1
Verified
01 Nov 2026
Axioms
none listed
Used by 1
  • is_crescent_configurationA finite subset S of Euclidean space ℝ^d is a crescent configuration if it is in general position and the set of its distinct pairwise…

Read back from the Lean

For a pseudo-metric space E, a finite subset S of E, and a real number r, distance_multiplicity S r is defined as the number of 2-element subsets u ⊆ S for which there exist distinct elements x, y ∈ u with dist x y = r (that is, the number of unordered pairs of distinct elements in S at distance r).

Written by a model that saw only the Lean, never the English above. If the two disagree, that is worth a challenge.

Lean source view module on GitHub

open Classical in
/-- The multiplicity of a distance r among pairs of distinct points in S. -/
noncomputable def distance_multiplicity {E : Type*} [PseudoMetricSpace E]
    (S : Finset E) (r : ℝ) : ℕ :=
  ((S.powersetCard 2).filter (fun u => ∃ x ∈ u, ∃ y ∈ u, x ≠ y ∧ dist x y = r)).card
See it in the graphDiscuss this resultChallenge it