{
  "id": "623",
  "ident": "NS.00623",
  "slug": "erdos-1087",
  "title": "Erdős Problem 1087",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $f(n)$ be minimal such that every set of $n$ points in $\\mathbb{R}^2$ contains at most $f(n)$\nmany sets of four points which are 'degenerate' in the sense that some pair are the same distance\napart. Estimate $f(n)$ - in particular, is it true that $f(n)\\leq n^{3+o(1)}$?\n\nHere a set of four points is degenerate if two of its six pairwise distances are equal, and\n$f(n)\\leq n^{3+o(1)}$ is read as $f(n) \\ll n^{3+\\varepsilon}$ for every $\\varepsilon > 0$.",
  "subjects": [
    "math.MG",
    "msc:52"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos1087.erdos_1087",
  "statement_lean": "theorem erdos_1087 :\n    ∀ ε > (0 : ℝ), (fun n : ℕ ↦ (f n : ℝ)) =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (3 + ε)",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Erdős Problem 1087\n\n*References:*\n- [erdosproblems.com/1087](https://www.erdosproblems.com/1087)\n- [ErPu71] Erdős, P. and Purdy, G., *Some extremal problems in geometry*. J. Combinatorial Theory\n  Ser. A 10 (1971), 246-252.\n-/\n\n@[expose] public section\n\nopen Filter Asymptotics\nopen scoped EuclideanGeometry\n\nnamespace Erdos1087\n\n/-- A finite set of points has a repeated distance if two of its pairs of points are the same\ndistance apart, that is, if it determines fewer distinct distances than it has pairs. -/\ndef HasRepeatedDistance (S : Finset ℝ²) : Prop :=\n  distinctDistances S < S.card.choose 2\n\nopen scoped Classical in\n/-- The number of degenerate four-element subsets of `P`, that is, those in which two of the six\npairwise distances are equal. -/\nnoncomputable def degenerateCount (P : Finset ℝ²) : ℕ :=\n  ((P.powersetCard 4).filter HasRepeatedDistance).card\n\n/-- $f(n)$: the maximum, over all sets of $n$ points in the plane, of the number of degenerate\nfour-element subsets. The set of values is nonempty and bounded by $\\binom{n}{4}$, so `sSup` is\na true maximum. -/\nnoncomputable def f (n : ℕ) : ℕ :=\n  sSup {m : ℕ | ∃ P : Finset ℝ², P.card = n ∧ degenerateCount P = m}\n\n/-- A set of `n` points has at most $\\binom{n}{4}$ degenerate four-element subsets. -/\n@[category API, AMS 52]\ntheorem degenerateCount_le (P : Finset ℝ²) : degenerateCount P ≤ P.card.choose 4 := by\n  classical\n  unfold degenerateCount\n  exact (Finset.card_filter_le _ _).trans (Finset.card_powersetCard 4 P).le\n\n/-- A set of points has at most `f n` degenerate four-element subsets. -/\n@[category API, AMS 52]\ntheorem degenerateCount_le_f (P : Finset ℝ²) : degenerateCount P ≤ f P.card := by\n  refine le_csSup ⟨P.card.choose 4, ?_⟩ ⟨P, rfl, rfl⟩\n  rintro m ⟨Q, hQ, rfl⟩\n  exact hQ ▸ degenerateCount_le Q\n\n/--\nLet $f(n)$ be minimal such that every set of $n$ points in $\\mathbb{R}^2$ contains at most $f(n)$\nmany sets of four points which are 'degenerate' in the sense that some pair are the same distance\napart. Estimate $f(n)$ - in particular, is it true that $f(n)\\leq n^{3+o(1)}$?\n\nHere a set of four points is degenerate if two of its six pairwise distances are equal, and\n$f(n)\\leq n^{3+o(1)}$ is read as $f(n) \\ll n^{3+\\varepsilon}$ for every $\\varepsilon > 0$.\n-/\n@[category research open, question, AMS 52]\ntheorem erdos_1087 :\n    ∀ ε > (0 : ℝ), (fun n : ℕ ↦ (f n : ℝ)) =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (3 + ε) := by\n  sorry\n\n/--\nErdős and Purdy [ErPu71] proved\n$$n^3\\log n \\ll f(n) \\ll n^{7/2}.$$\n\nThis is the lower bound.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_1087.variants.lower :\n    (fun n : ℕ ↦ (n : ℝ) ^ 3 * Real.log n) =O[atTop] fun n : ℕ ↦ (f n : ℝ) := by\n  sorry\n\n/--\nErdős and Purdy [ErPu71] proved\n$$n^3\\log n \\ll f(n) \\ll n^{7/2}.$$\n\nThis is the upper bound.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_1087.variants.upper :\n    (fun n : ℕ ↦ (f n : ℝ)) =O[atTop] fun n : ℕ ↦ (n : ℝ) ^ (7 / 2 : ℝ) := by\n  sorry\n\nend Erdos1087\n",
  "statement_hash": "e155eef0ec6f4efaaf17d0f89c9a2988426ec5a6a38e6b9c4a2de200696d1ab5",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}