/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilErdős Problem 94
References:
[Er92e] Erdős, Pál, Some Unsolved problems in Geometry, Number Theory and Combinatorics. Eureka (1992), 44-48.
[Er97c] Erdős, Paul, Some of my favorite problems and results. The mathematics of Paul Erdős, I (1997), 47-67.
[LeTh95] Lefmann, Hanno and Thiele, Torsten, Point sets with distinct distances. Combinatorica (1995), 379-408.
open Filter EuclideanGeometrynamespace Erdos94The regular $n$-gon inscribed in the unit circle.
noncomputable def regularNGon (n : ℕ) : Finset ℝ² :=
(Finset.range n).image fun k : ℕ =>
!2[Real.cos (2 * Real.pi * k / n), Real.sin (2 * Real.pi * k / n)]Suppose $n$ points in $\mathbb{R}^2$ determine a convex polygon and the set of distances between them is ${u_1,\ldots,u_t}$. Suppose $u_i$ appears as the distance between $f(u_i)$ many pairs of points. Then $$\sum_i f(u_i)^2 \ll n^3.$$
In [Er97c] Erdős claims that Fishburn solved this, but gives no reference.
@[category research solved, AMS 5 52, formal_proof using lean4 at "https://github.com/plby/lean-proofs/blob/main/src/v4.29.1/ErdosProblems/Erdos94.lean"]
theorem erdos_94 : ∃ C > (0 : ℝ), ∀ P : Finset ℝ², ConvexIndep (P : Set ℝ²) →
∑ u ∈ distanceSet P, (distanceMultiplicity P u : ℝ) ^ 2 ≤ C * (P.card : ℝ) ^ 3 := ⊢ ∃ C > 0, ∀ (P : Finset ℝ²), ConvexIndep ↑P → ∑ u ∈ distanceSet P, ↑(distanceMultiplicity P u) ^ 2 ≤ C * ↑P.card ^ 3
All goals completed! 🐙Note it is trivial that $\sum f(u_i)=\binom{n}{2}$.
@[category test, AMS 5 52]
theorem erdos_94.variants.sum_multiplicity (P : Finset ℝ²) :
∑ u ∈ distanceSet P, distanceMultiplicity P u = P.card.choose 2 := P:Finset ℝ²⊢ ∑ u ∈ distanceSet P, distanceMultiplicity P u = P.card.choose 2
All goals completed! 🐙Lefmann and Theile [LeTh95] prove a stronger version of this question, that $$\sum_i f(u_i)^2 \ll n^3$$ under the weaker assumption that no three points are on a line.
@[category research solved, AMS 5 52]
theorem erdos_94.variants.no_three_on_a_line : ∃ C > (0 : ℝ), ∀ P : Finset ℝ²,
NonTrilinear (P : Set ℝ²) →
∑ u ∈ distanceSet P, (distanceMultiplicity P u : ℝ) ^ 2 ≤ C * (P.card : ℝ) ^ 3 := ⊢ ∃ C > 0, ∀ (P : Finset ℝ²), NonTrilinear ↑P → ∑ u ∈ distanceSet P, ↑(distanceMultiplicity P u) ^ 2 ≤ C * ↑P.card ^ 3
All goals completed! 🐙Erdős and Fishburn also make the stronger conjecture that $\sum f(u_i)^2$ is maximal for the regular $n$-gon (for large enough $n$).
@[category research open, AMS 5 52]
theorem erdos_94.variants.regular_ngon : ∀ᶠ n : ℕ in atTop, ∀ P : Finset ℝ²,
P.card = n → ConvexIndep (P : Set ℝ²) →
∑ u ∈ distanceSet P, (distanceMultiplicity P u : ℝ) ^ 2 ≤
∑ u ∈ distanceSet (regularNGon n), (distanceMultiplicity (regularNGon n) u : ℝ) ^ 2 := ⊢ ∀ᶠ (n : ℕ) in atTop,
∀ (P : Finset ℝ²),
P.card = n →
ConvexIndep ↑P →
∑ u ∈ distanceSet P, ↑(distanceMultiplicity P u) ^ 2 ≤
∑ u ∈ distanceSet (regularNGon n), ↑(distanceMultiplicity (regularNGon n) u) ^ 2
All goals completed! 🐙end Erdos94