Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Erdős Problem 502

Source:Erdős Problems
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

What is the size of the largest A⊆RnA\subseteq \mathbb{R}^n such that there are only two distinct distances between elements of AA? That is, #{∣x−y∣:x≠y∈A}=2.\# \{ \lvert x-y\rvert : x\neq y\in A\} = 2.

Asked to Erdős by Coxeter. Bannai, Bannai, and Stanton [BBS83] have proved that ∣A∣≤(n+22).\lvert A\rvert \leq \binom{n+2}{2}. A simple proof of this upper bound was given by Petrov and Pohoata [PePo21].

The exact maximum is not known in general: a lower bound of (n+12)\binom{n+1}{2} follows from the construction of Alweiss (see [503]).

Subjects:Metric Geometry (math.MG)
MSC classes:51, 52
Tags:formal_proof
Cite as:NS.02323 [math.MG] · NS.02323v1 for this version
Declaration:Erdos502.erdos_502
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:55ed0c4ceed43b02839235e43e51490fe5e442ccb2fbc7336605559310e9af60
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/502.lean

Formal statement

theorem erdos_502 (n : ℕ) (A : Set (ℝ^n)) (hA : A.Finite)
    (hA2 : {d : ℝ | ∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ dist x y = d}.ncard = 2) :
    A.ncard ≤ (n + 2).choose 2
Show the full Challenge.lean (59 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 502

*References:*
- [erdosproblems.com/502](https://www.erdosproblems.com/502)
- [Er61] Erdős, Paul, *Some unsolved problems*. Magyar Tud. Akad. Mat. Kutató Int. Közl. (1961),
  221-254.
- [BBS83] Bannai, Eiichi and Bannai, Etsuko and Stanton, Dennis, *An upper bound for the
  cardinality of an $s$-distance subset in real Euclidean space. II*. Combinatorica (1983),
  147-152.
- [PePo21] Petrov, Fedor and Pohoata, Cosmin, *A remark on sets with few distances in
  $\mathbb{R}^d$*. Proc. Amer. Math. Soc. (2021), 569-571.
-/

@[expose] public section

open scoped EuclideanGeometry

namespace Erdos502

set_option linter.style.formal_proof_palomar false in
/--
What is the size of the largest $A\subseteq \mathbb{R}^n$ such that there are only two distinct
distances between elements of $A$? That is,
$$\# \{ \lvert x-y\rvert : x\neq y\in A\} = 2.$$

Asked to Erdős by Coxeter. Bannai, Bannai, and Stanton [BBS83] have proved that
$$\lvert A\rvert \leq \binom{n+2}{2}.$$
A simple proof of this upper bound was given by Petrov and Pohoata [PePo21].

The exact maximum is not known in general: a lower bound of $\binom{n+1}{2}$ follows from the
construction of Alweiss (see [503]). -/
@[category research solved, AMS 51 52, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/1d7b3f00780b85ed0462e79a1cd5650ee9055655/src/v4.29.1/ErdosProblems/Erdos502.lean"]
theorem erdos_502 (n : ℕ) (A : Set (ℝ^n)) (hA : A.Finite)
    (hA2 : {d : ℝ | ∃ x ∈ A, ∃ y ∈ A, x ≠ y ∧ dist x y = d}.ncard = 2) :
    A.ncard ≤ (n + 2).choose 2 := by
  sorry

end Erdos502

To prove it: keep every definition of Challenge.lean unchanged and prove Erdos502.erdos_502 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_erdos_502 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch erdos-502
nosorry submit erdos-502 nosorry/erdos-502/Solution.lean --wait

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.