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 669 · linesWithPointsFor_subset_linesWithAtLeastPointsFor

Source:Erdős Problems
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

A line through exactly kk points of SS is a line through at least kk points of SS.

Subjects:Metric Geometry (math.MG)
MSC classes:52
Cite as:NS.02789 [math.MG] · NS.02789v1 for this version
Declaration:Erdos669.linesWithPointsFor_subset_linesWithAtLeastPointsFor
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
Statement hash:18af5af86d1308eed70ba8ac9ad6c30685c4325fb593384c44d9525fc8614587
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/ErdosProblems/669.lean

Formal statement

theorem linesWithPointsFor_subset_linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) :
    EuclideanGeometry.linesWithPointsFor k S ⊆ linesWithAtLeastPointsFor k S
Show the full Challenge.lean (247 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Erdős Problem 669

*References:*
- [erdosproblems.com/669](https://www.erdosproblems.com/669)
- [BGS74] Burr, Stefan A. and Grünbaum, Branko and Sloane, N. J. A., *The orchard problem*.
  Geometriae Dedicata (1974), 397-424.
- [Er97f] Erdős, Paul, *Some unsolved problems*. Combinatorics, geometry and probability
  (Cambridge, 1993) (1997), 1-10.
-/

@[expose] public section

open Filter
open scoped Topology EuclideanGeometry

namespace Erdos669

/--
The set of lines in $\mathbb{R}^2$ containing at least $k$ points of $S$. It is the analogue of
`EuclideanGeometry.linesWithPointsFor`, which asks for exactly $k$ points. Only lines spanned by two
distinct points of $S$ are counted, so the definition is meant for $k \geq 2$.
-/
noncomputable def linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) : Set (AffineSubspace ℝ ℝ²) :=
  let determined_lines := { affineSpan ℝ {p, q} | (p ∈ S) (q ∈ S) (_ : p ≠ q) }
  { L ∈ determined_lines | k ≤ (↑L ∩ S).ncard }

/--
The set of numbers of distinct lines through at least $k$ points, taken over all sets of $n$
points in $\mathbb{R}^2$.
-/
noncomputable def lineCountsAtLeast (k n : ℕ) : Set ℕ :=
  {m | ∃ S : Finset ℝ², S.card = n ∧ (linesWithAtLeastPointsFor k (S : Set ℝ²)).ncard = m}

/--
The set of numbers of distinct lines through exactly $k$ points, taken over all sets of $n$
points in $\mathbb{R}^2$.
-/
noncomputable def lineCountsExactly (k n : ℕ) : Set ℕ :=
  {m | ∃ S : Finset ℝ², S.card = n ∧
    (EuclideanGeometry.linesWithPointsFor k (S : Set ℝ²)).ncard = m}

/-- A set of lines, each spanned by two points of `S`, has at most `S.card ^ 2` elements. -/
@[category API, AMS 52]
private lemma ncard_le_sq (S : Finset ℝ²) (T : Set (AffineSubspace ℝ ℝ²))
    (hT : ∀ L ∈ T, ∃ p ∈ S, ∃ q ∈ S, affineSpan ℝ {p, q} = L) : T.ncard ≤ S.card ^ 2 := by
  have hfin : ((S : Set ℝ²) ×ˢ (S : Set ℝ²)).Finite := S.finite_toSet.prod S.finite_toSet
  have hcard : ((S : Set ℝ²) ×ˢ (S : Set ℝ²)).ncard = S.card ^ 2 := by
    rw [Set.ncard_prod, Set.ncard_coe_finset, sq]
  have hsub : T ⊆ (fun pq : ℝ² × ℝ² => affineSpan ℝ {pq.1, pq.2}) ''
      ((S : Set ℝ²) ×ˢ (S : Set ℝ²)) := by
    intro L hL
    obtain ⟨p, hp, q, hq, rfl⟩ := hT L hL
    exact ⟨(p, q), Set.mk_mem_prod (Finset.mem_coe.2 hp) (Finset.mem_coe.2 hq), rfl⟩
  exact (Set.ncard_le_ncard hsub (hfin.image _)).trans
    ((Set.ncard_image_le hfin).trans hcard.le)

/--
The counts are bounded: a line through two or more points of an $n$-point set is spanned by an
ordered pair of its points, and there are at most $n^2$ ordered pairs. The set is also nonempty,
since $n$-point sets exist, so the `sSup` in `Erdos669.maxLinesAtLeast` is attained.
-/
@[category test, AMS 52]
theorem lineCountsAtLeast_bddAbove (k n : ℕ) : BddAbove (lineCountsAtLeast k n) := by
  refine ⟨n ^ 2, ?_⟩
  rintro _ ⟨S, rfl, rfl⟩
  refine ncard_le_sq S _ ?_
  rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩
  exact ⟨p, Finset.mem_coe.1 hp, q, Finset.mem_coe.1 hq, rfl⟩

/--
The same bound for lines through exactly $k$ points, so the `sSup` in `Erdos669.maxLinesExactly`
is attained as well.
-/
@[category test, AMS 52]
theorem lineCountsExactly_bddAbove (k n : ℕ) : BddAbove (lineCountsExactly k n) := by
  refine ⟨n ^ 2, ?_⟩
  rintro _ ⟨S, rfl, rfl⟩
  refine ncard_le_sq S _ ?_
  rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩
  exact ⟨p, Finset.mem_coe.1 hp, q, Finset.mem_coe.1 hq, rfl⟩

/--
A line through exactly $k$ points of $S$ is a line through at least $k$ points of $S$.
-/
@[category test, AMS 52]
theorem linesWithPointsFor_subset_linesWithAtLeastPointsFor (k : ℕ) (S : Set ℝ²) :
    EuclideanGeometry.linesWithPointsFor k S ⊆ linesWithAtLeastPointsFor k S := by
  rintro L ⟨hL, hk⟩
  exact ⟨hL, hk.ge⟩

/--
$F_k(n)$: the largest number of distinct lines passing through at least $k$ of the points, over
all sets of $n$ points in $\mathbb{R}^2$. This is the least $m$ such that any $n$ points have at
most $m$ such lines. See `Erdos669.lineCountsAtLeast_bddAbove`.
-/
noncomputable def maxLinesAtLeast (k n : ℕ) : ℕ :=
  sSup (lineCountsAtLeast k n)

/--
$f_k(n)$: the largest number of distinct lines passing through exactly $k$ of the points, over
all sets of $n$ points in $\mathbb{R}^2$. This is the least $m$ such that any $n$ points have at
most $m$ such lines. See `Erdos669.lineCountsExactly_bddAbove`.
-/
noncomputable def maxLinesExactly (k n : ℕ) : ℕ :=
  sSup (lineCountsExactly k n)

def erdos_669.parts.i.answer : ℕ → Option ℝ := sorry

/--
Let $F_k(n)$ be minimal such that for any $n$ points in $\mathbb{R}^2$ there exist at most
$F_k(n)$ many distinct lines passing through at least $k$ of the points, and $f_k(n)$ similarly
but with lines passing through exactly $k$ points.

Estimate $f_k(n)$ and $F_k(n)$ - in particular, determine $\lim F_k(n)/n^2$ and
$\lim f_k(n)/n^2$.

This part asks for $\lim F_k(n)/n^2$ for $k \geq 3$ (the case $k = 2$ is trivial). The
original question [Er97f, Problem 16] asks for the limits "if they exist", so the answer allows
nonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none`
otherwise.
-/
@[category research open, question value, AMS 52]
theorem erdos_669.parts.i :
    ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ,
      erdos_669.parts.i.answer k = some x ↔
        Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x) := by
  sorry

def erdos_669.parts.ii.answer : ℕ → Option ℝ := sorry

/--
Let $F_k(n)$ be minimal such that for any $n$ points in $\mathbb{R}^2$ there exist at most
$F_k(n)$ many distinct lines passing through at least $k$ of the points, and $f_k(n)$ similarly
but with lines passing through exactly $k$ points.

Estimate $f_k(n)$ and $F_k(n)$ - in particular, determine $\lim F_k(n)/n^2$ and
$\lim f_k(n)/n^2$.

This part asks for $\lim f_k(n)/n^2$ for $k \geq 3$ (the case $k = 2$ is trivial). The
original question [Er97f, Problem 16] asks for the limits "if they exist", so the answer allows
nonexistence: the answer at $k$ is `some x` if the limit exists and equals $x$, and `none`
otherwise.
-/
@[category research open, question value, AMS 52]
theorem erdos_669.parts.ii :
    ∀ k : ℕ, 3 ≤ k → ∀ x : ℝ,
      erdos_669.parts.ii.answer k = some x ↔
        Tendsto (fun n : ℕ => (maxLinesExactly k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 x) := by
  sorry

/--
Trivially $f_k(n)\leq F_k(n)$.
-/
@[category research solved, AMS 52]
theorem erdos_669.variants.exactly_le_atLeast (k n : ℕ) :
    maxLinesExactly k n ≤ maxLinesAtLeast k n := by
  refine csSup_le' ?_
  rintro _ ⟨S, hS, rfl⟩
  have hfin : (linesWithAtLeastPointsFor k (S : Set ℝ²)).Finite := by
    refine ((S.finite_toSet.prod S.finite_toSet).image
      (fun pq : ℝ² × ℝ² => affineSpan ℝ {pq.1, pq.2})).subset ?_
    rintro L ⟨⟨p, hp, q, hq, -, rfl⟩, -⟩
    exact ⟨(p, q), Set.mk_mem_prod hp hq, rfl⟩
  exact le_csSup_of_le (lineCountsAtLeast_bddAbove k n) ⟨S, hS, rfl⟩
    (Set.ncard_le_ncard (linesWithPointsFor_subset_linesWithAtLeastPointsFor k _) hfin)

/--
$f_2(n)=F_2(n)=\binom{n}{2}$.
-/
@[category research solved, AMS 52]
theorem erdos_669.variants.k_two (n : ℕ) :
    maxLinesExactly 2 n = n.choose 2 ∧ maxLinesAtLeast 2 n = n.choose 2 := by
  sorry

/--
The problem with $k=3$ is the classical 'Orchard problem' of Sylvester. Burr, Grünbaum, and Sloane
[BGS74] have proved that
$$f_3(n)=\frac{n^2}{6}-O(n)$$
and
$$F_3(n)=\frac{n^2}{6}-O(n).$$

This is the statement for $f_3$.
-/
@[category research solved, AMS 52]
theorem erdos_669.variants.burr_grunbaum_sloane_exactly :
    (fun n : ℕ => (maxLinesExactly 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop]
      (fun n : ℕ => (n : ℝ)) := by
  sorry

/--
The problem with $k=3$ is the classical 'Orchard problem' of Sylvester. Burr, Grünbaum, and Sloane
[BGS74] have proved that
$$f_3(n)=\frac{n^2}{6}-O(n)$$
and
$$F_3(n)=\frac{n^2}{6}-O(n).$$

This is the statement for $F_3$.
-/
@[category research solved, AMS 52]
theorem erdos_669.variants.burr_grunbaum_sloane_atLeast :
    (fun n : ℕ => (maxLinesAtLeast 3 n : ℝ) - (n : ℝ) ^ 2 / 6) =O[atTop]
      (fun n : ℕ => (n : ℝ)) := by
  sorry

/--
There is a trivial upper bound of $F_k(n) \leq \binom{n}{2}/\binom{k}{2}$.
-/
@[category research solved, AMS 52]
theorem erdos_669.variants.upper_bound (k n : ℕ) (hk : 2 ≤ k) :
    (maxLinesAtLeast k n : ℝ) ≤ (n.choose 2 : ℝ) / (k.choose 2 : ℝ) := by
  sorry

/--
There is a trivial upper bound of $F_k(n) \leq \binom{n}{2}/\binom{k}{2}$, and hence
$$\lim F_k(n)/n^2 \leq \frac{1}{k(k-1)}.$$
See also [101](https://www.erdosproblems.com/101).

Here the limit is assumed to exist and is called `L`.
-/
@[category research solved, AMS 52]
theorem erdos_669.variants.limit_le (k : ℕ) (hk : 2 ≤ k) (L : ℝ)
    (hL : Tendsto (fun n : ℕ => (maxLinesAtLeast k n : ℝ) / (n : ℝ) ^ 2) atTop (𝓝 L)) :
    L ≤ 1 / ((k : ℝ) * ((k : ℝ) - 1)) := by
  sorry

end Erdos669

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

nosorry desk erdos-669--lineswithpointsfor-subset-lineswithatleastpointsfor      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch erdos-669--lineswithpointsfor-subset-lineswithatleastpointsfor
nosorry submit erdos-669--lineswithpointsfor-subset-lineswithatleastpointsfor nosorry/erdos-669--lineswithpointsfor-subset-lineswithatleastpointsfor/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.