{
  "id": "2790",
  "ident": "NS.02790",
  "slug": "erdos-669",
  "title": "Erdős Problem 669",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $F_k(n)$ be minimal such that for any $n$ points in $\\mathbb{R}^2$ there exist at most\n$F_k(n)$ many distinct lines passing through at least $k$ of the points, and $f_k(n)$ similarly\nbut with lines passing through exactly $k$ points.\n\nEstimate $f_k(n)$ and $F_k(n)$ - in particular, determine $\\lim F_k(n)/n^2$ and\n$\\lim f_k(n)/n^2$.\n\nThis part asks for $\\lim F_k(n)/n^2$ for $k \\geq 3$ (the case $k = 2$ is trivial). The\noriginal question [Er97f, Problem 16] asks for the limits \"if they exist\", so the answer allows\nnonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none`\notherwise.",
  "subjects": [
    "math.MG",
    "msc:52"
  ],
  "tags": [
    "question"
  ],
  "collection": "erdos",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "Erdos669.erdos_669.parts.i",
  "statement_lean": "theorem erdos_669.parts.i :\n    ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ,\n      erdos_669.parts.i.answer k = some x ↔\n        Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x)",
  "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 669\n\n*References:*\n- [erdosproblems.com/669](https://www.erdosproblems.com/669)\n- [BGS74] Burr, Stefan A. and Grünbaum, Branko and Sloane, N. J. A., *The orchard problem*.\n  Geometriae Dedicata (1974), 397-424.\n- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability\n  (Cambridge, 1993) (1997), 1-10.\n-/\n\n@[expose] public section\n\nopen Filter\nopen scoped Topology EuclideanGeometry\n\nnamespace Erdos669\n\n/--\nThe set of lines in $\\mathbb{R}^2$ containing at least $k$ points of $S$. It is the analogue of\n`EuclideanGeometry.linesWithPointsFor`, which asks for exactly $k$ points. Only lines spanned by two\ndistinct points of $S$ are counted, so the definition is meant for $k \\geq 2$.\n-/\nnoncomputable def linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) : Set (AffineSubspace ℝ ℝ²) :=\n  let determined_lines := { affineSpan ℝ {p, q} | (p ∈ S) (q ∈ S) (_ : p ≠ q) }\n  { L ∈ determined_lines | k ≤ (↑L ∩ S).ncard }\n\n/--\nThe set of numbers of distinct lines through at least $k$ points, taken over all sets of $n$\npoints in $\\mathbb{R}^2$.\n-/\nnoncomputable def lineCountsAtLeast (k n : ℕ) : Set ℕ :=\n  {m | ∃ S : Finset ℝ², S.card = n ∧ (linesWithAtLeastPointsFor k (S : Set ℝ²)).ncard = m}\n\n/--\nThe set of numbers of distinct lines through exactly $k$ points, taken over all sets of $n$\npoints in $\\mathbb{R}^2$.\n-/\nnoncomputable def lineCountsExactly (k n : ℕ) : Set ℕ :=\n  {m | ∃ S : Finset ℝ², S.card = n ∧\n    (EuclideanGeometry.linesWithPointsFor k (S : Set ℝ²)).ncard = m}\n\n/-- A set of lines, each spanned by two points of `S`, has at most `S.card ^ 2` elements. -/\n@[category API, AMS 52]\nprivate lemma ncard_le_sq (S : Finset ℝ²) (T : Set (AffineSubspace ℝ ℝ²))\n    (hT : ∀ L ∈ T, ∃ p ∈ S, ∃ q ∈ S, affineSpan ℝ {p, q} = L) : T.ncard ≤ S.card ^ 2 := by\n  have hfin : ((S : Set ℝ²) ×ˢ (S : Set ℝ²)).Finite := S.finite_toSet.prod S.finite_toSet\n  have hcard : ((S : Set ℝ²) ×ˢ (S : Set ℝ²)).ncard = S.card ^ 2 := by\n    rw [Set.ncard_prod, Set.ncard_coe_finset, sq]\n  have hsub : T ⊆ (fun pq : ℝ² × ℝ² => affineSpan ℝ {pq.1, pq.2}) ''\n      ((S : Set ℝ²) ×ˢ (S : Set ℝ²)) := by\n    intro L hL\n    obtain ⟨p, hp, q, hq, rfl⟩ := hT L hL\n    exact ⟨(p, q), Set.mk_mem_prod (Finset.mem_coe.2 hp) (Finset.mem_coe.2 hq), rfl⟩\n  exact (Set.ncard_le_ncard hsub (hfin.image _)).trans\n    ((Set.ncard_image_le hfin).trans hcard.le)\n\n/--\nThe counts are bounded: a line through two or more points of an $n$-point set is spanned by an\nordered pair of its points, and there are at most $n^2$ ordered pairs. The set is also nonempty,\nsince $n$-point sets exist, so the `sSup` in `Erdos669.maxLinesAtLeast` is attained.\n-/\n@[category test, AMS 52]\ntheorem lineCountsAtLeast_bddAbove (k n : ℕ) : BddAbove (lineCountsAtLeast k n) := by\n  refine ⟨n ^ 2, ?_⟩\n  rintro _ ⟨S, rfl, rfl⟩\n  refine ncard_le_sq S _ ?_\n  rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩\n  exact ⟨p, Finset.mem_coe.1 hp, q, Finset.mem_coe.1 hq, rfl⟩\n\n/--\nThe same bound for lines through exactly $k$ points, so the `sSup` in `Erdos669.maxLinesExactly`\nis attained as well.\n-/\n@[category test, AMS 52]\ntheorem lineCountsExactly_bddAbove (k n : ℕ) : BddAbove (lineCountsExactly k n) := by\n  refine ⟨n ^ 2, ?_⟩\n  rintro _ ⟨S, rfl, rfl⟩\n  refine ncard_le_sq S _ ?_\n  rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩\n  exact ⟨p, Finset.mem_coe.1 hp, q, Finset.mem_coe.1 hq, rfl⟩\n\n/--\nA line through exactly $k$ points of $S$ is a line through at least $k$ points of $S$.\n-/\n@[category test, AMS 52]\ntheorem linesWithPointsFor_subset_linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) :\n    EuclideanGeometry.linesWithPointsFor k S ⊆ linesWithAtLeastPointsFor k S := by\n  rintro L ⟨hL, hk⟩\n  exact ⟨hL, hk.ge⟩\n\n/--\n$F_k(n)$: the largest number of distinct lines passing through at least $k$ of the points, over\nall sets of $n$ points in $\\mathbb{R}^2$. This is the least $m$ such that any $n$ points have at\nmost $m$ such lines. See `Erdos669.lineCountsAtLeast_bddAbove`.\n-/\nnoncomputable def maxLinesAtLeast (k n : ℕ) : ℕ :=\n  sSup (lineCountsAtLeast k n)\n\n/--\n$f_k(n)$: the largest number of distinct lines passing through exactly $k$ of the points, over\nall sets of $n$ points in $\\mathbb{R}^2$. This is the least $m$ such that any $n$ points have at\nmost $m$ such lines. See `Erdos669.lineCountsExactly_bddAbove`.\n-/\nnoncomputable def maxLinesExactly (k n : ℕ) : ℕ :=\n  sSup (lineCountsExactly k n)\n\ndef erdos_669.parts.i.answer : ℕ → Option ℝ := sorry\n\n/--\nLet $F_k(n)$ be minimal such that for any $n$ points in $\\mathbb{R}^2$ there exist at most\n$F_k(n)$ many distinct lines passing through at least $k$ of the points, and $f_k(n)$ similarly\nbut with lines passing through exactly $k$ points.\n\nEstimate $f_k(n)$ and $F_k(n)$ - in particular, determine $\\lim F_k(n)/n^2$ and\n$\\lim f_k(n)/n^2$.\n\nThis part asks for $\\lim F_k(n)/n^2$ for $k \\geq 3$ (the case $k = 2$ is trivial). The\noriginal question [Er97f, Problem 16] asks for the limits \"if they exist\", so the answer allows\nnonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none`\notherwise.\n-/\n@[category research open, question value, AMS 52]\ntheorem erdos_669.parts.i :\n    ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ,\n      erdos_669.parts.i.answer k = some x ↔\n        Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x) := by\n  sorry\n\ndef erdos_669.parts.ii.answer : ℕ → Option ℝ := sorry\n\n/--\nLet $F_k(n)$ be minimal such that for any $n$ points in $\\mathbb{R}^2$ there exist at most\n$F_k(n)$ many distinct lines passing through at least $k$ of the points, and $f_k(n)$ similarly\nbut with lines passing through exactly $k$ points.\n\nEstimate $f_k(n)$ and $F_k(n)$ - in particular, determine $\\lim F_k(n)/n^2$ and\n$\\lim f_k(n)/n^2$.\n\nThis part asks for $\\lim f_k(n)/n^2$ for $k \\geq 3$ (the case $k = 2$ is trivial). The\noriginal question [Er97f, Problem 16] asks for the limits \"if they exist\", so the answer allows\nnonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none`\notherwise.\n-/\n@[category research open, question value, AMS 52]\ntheorem erdos_669.parts.ii :\n    ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ,\n      erdos_669.parts.ii.answer k = some x ↔\n        Tendsto (fun n : ℕ => (maxLinesExactly k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x) := by\n  sorry\n\n/--\nTrivially $f_k(n)\\leq F_k(n)$.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_669.variants.exactly_le_atLeast (k n : ℕ) :\n    maxLinesExactly k n ≤ maxLinesAtLeast k n := by\n  refine csSup_le' ?_\n  rintro _ ⟨S, hS, rfl⟩\n  have hfin : (linesWithAtLeastPointsFor k (S : Set ℝ²)).Finite := by\n    refine ((S.finite_toSet.prod S.finite_toSet).image\n      (fun pq : ℝ² × ℝ² => affineSpan ℝ {pq.1, pq.2})).subset ?_\n    rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩\n    exact ⟨(p, q), Set.mk_mem_prod hp hq, rfl⟩\n  exact le_csSup_of_le (lineCountsAtLeast_bddAbove k n) ⟨S, hS, rfl⟩\n    (Set.ncard_le_ncard (linesWithPointsFor_subset_linesWithAtLeastPointsFor k _) hfin)\n\n/--\n$f_2(n)=F_2(n)=\\binom{n}{2}$.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_669.variants.k_two (n : ℕ) :\n    maxLinesExactly 2 n = n.choose 2 ∧ maxLinesAtLeast 2 n = n.choose 2 := by\n  sorry\n\n/--\nThe problem with $k=3$ is the classical 'Orchard problem' of Sylvester. Burr, Grünbaum, and Sloane\n[BGS74] have proved that\n$$f_3(n)=\\frac{n^2}{6}-O(n)$$\nand\n$$F_3(n)=\\frac{n^2}{6}-O(n).$$\n\nThis is the statement for $f_3$.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_669.variants.burr_grunbaum_sloane_exactly :\n    (fun n : ℕ => (maxLinesExactly 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop]\n      (fun n : ℕ => (n : ℝ)) := by\n  sorry\n\n/--\nThe problem with $k=3$ is the classical 'Orchard problem' of Sylvester. Burr, Grünbaum, and Sloane\n[BGS74] have proved that\n$$f_3(n)=\\frac{n^2}{6}-O(n)$$\nand\n$$F_3(n)=\\frac{n^2}{6}-O(n).$$\n\nThis is the statement for $F_3$.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_669.variants.burr_grunbaum_sloane_atLeast :\n    (fun n : ℕ => (maxLinesAtLeast 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop]\n      (fun n : ℕ => (n : ℝ)) := by\n  sorry\n\n/--\nThere is a trivial upper bound of $F_k(n) \\leq \\binom{n}{2}/\\binom{k}{2}$.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_669.variants.upper_bound (k n : ℕ) (hk : 2 ≤ k) :\n    (maxLinesAtLeast k n : ℝ) ≤ (n.choose 2 : ℝ) / (k.choose 2 : ℝ) := by\n  sorry\n\n/--\nThere is a trivial upper bound of $F_k(n) \\leq \\binom{n}{2}/\\binom{k}{2}$, and hence\n$$\\lim F_k(n)/n^2 \\leq \\frac{1}{k(k-1)}.$$\nSee also [101](https://www.erdosproblems.com/101).\n\nHere the limit is assumed to exist and is called `L`.\n-/\n@[category research solved, AMS 52]\ntheorem erdos_669.variants.limit_le (k : ℕ) (hk : 2 ≤ k) (L : ℝ)\n    (hL : Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 L)) :\n    L ≤ 1 / ((k : ℝ) * ((k : ℝ) - 1)) := by\n  sorry\n\nend Erdos669\n",
  "statement_hash": "18af5af86d1308eed70ba8ac9ad6c30685c4325fb593384c44d9525fc8614587",
  "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."
}