/-
Copyright 2025 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 FormalConjecturesUtil
open Filteropen EuclideanGeometrynamespace Erdos107The set of $N$ such that any $N$ points in the plane, no three on a line, contain a convex $n$-gon.
def cardSet (n : ℕ) := { N | ∀ (pts : Finset ℝ²), pts.card = N → NonTrilinear (pts : Set ℝ²) →
HasConvexNGon n pts }
The function $f(n)$ specified in erdos_107.
noncomputable def f (n : ℕ) : ℕ :=
sInf (cardSet n)Let $f(n)$ be minimal such that any $f(n)$ points in $ℝ^2$, no three on a line, contain $n$ points which form the vertices of a convex $n$-gon. Prove that $f(n) = 2^{n-2} + 1$.
@[category research open, AMS 52]
theorem erdos_107 : answer(sorry) ↔ ∀ n ≥ 3, f n = 2^(n - 2) + 1 := ⊢ True ↔ ∀ n ≥ 3, f n = 2 ^ (n - 2) + 1
All goals completed! 🐙For every $n ≥ 3$, there exists $N$ such that any $N$ points, no three on a line, contain a convex $n$-gon.
@[category research solved, AMS 52]
theorem nonempty_cardSet : ∀ n ≥ 3, (cardSet n).Nonempty := ⊢ ∀ n ≥ 3, (cardSet n).Nonempty
All goals completed! 🐙Depending on details of definitions, the statement is false or trivial for $n < 3$.
this:∀ (P : Set ℝ²), HasConvexNGon 0 P⊢ f 0 = 0
simp [f, cardSet, this] All goals completed! 🐙Three distinct non-collinear points form a convex-independent set.
@[category API, AMS 52]
private lemma convexIndep_triple_of_not_collinear {a b c : ℝ²}
(hab : a ≠ b) (hac : a ≠ c) (hbc : b ≠ c)
(hcoll : ¬ Collinear ℝ ({a, b, c} : Set ℝ²)) :
ConvexIndep ({a, b, c} : Set ℝ²) := by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c}
intro x hx hmem a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})⊢ False
-- The point `x` lies in the affine span of `{a, b, c} \ {x}` because it
-- lies in the convex hull of that two-element set.
apply hcoll a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})⊢ Collinear ℝ {a, b, c}
have hx_aff : x ∈ affineSpan ℝ (({a, b, c} : Set ℝ²) \ {x}) :=
convexHull_subset_affineSpan _ hmem a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})⊢ Collinear ℝ {a, b, c}
rw [show ({a, b, c} : Set ℝ²) = insert x (({a, b, c} : Set ℝ²) \ {x}) from
(Set.insert_sdiff_self_of_mem hx).symm, a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})⊢ Collinear ℝ (insert x ({a, b, c} \ {x})) a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})⊢ Collinear ℝ ({a, b, c} \ {x})
collinear_insert_iff_of_mem_affineSpan hx_aff a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})⊢ Collinear ℝ ({a, b, c} \ {x}) a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})⊢ Collinear ℝ ({a, b, c} \ {x})] a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hx:x ∈ {a, b, c}hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})⊢ Collinear ℝ ({a, b, c} \ {x})
-- The two-element complement is collinear.
simp only [Set.mem_insert_iff, Set.mem_singleton_iff] at hx a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}x:ℝ²hmem:x ∈ (convexHull ℝ) ({a, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, c} \ {x})hx:x = a ∨ x = b ∨ x = c⊢ Collinear ℝ ({a, b, c} \ {x})
rcases hx with rfl | rfl | rfl inl b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})⊢ Collinear ℝ ({x, b, c} \ {x})inr.inl a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})⊢ Collinear ℝ ({a, x, c} \ {x})inr.inr a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})⊢ Collinear ℝ ({a, b, x} \ {x})
· inl b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})⊢ Collinear ℝ ({x, b, c} \ {x}) rw [show ({x, b, c} : Set ℝ²) \ {x} = ({b, c} : Set ℝ²) by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c} inl b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})⊢ Collinear ℝ {b, c} ext b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})x✝:ℝ²⊢ x✝ ∈ {x, b, c} \ {x} ↔ x✝ ∈ {b, c}inl b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})⊢ Collinear ℝ {b, c}; aesop All goals completed! 🐙inl b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})⊢ Collinear ℝ {b, c}]inl b:ℝ²c:ℝ²hbc:b ≠ cx:ℝ²hab:x ≠ bhac:x ≠ chcoll:¬Collinear ℝ {x, b, c}hmem:x ∈ (convexHull ℝ) ({x, b, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({x, b, c} \ {x})⊢ Collinear ℝ {b, c}
exact collinear_pair ℝ b c All goals completed! 🐙
· inr.inl a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})⊢ Collinear ℝ ({a, x, c} \ {x}) rw [show ({a, x, c} : Set ℝ²) \ {x} = ({a, c} : Set ℝ²) by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c} inr.inl a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})⊢ Collinear ℝ {a, c} ext a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})x✝:ℝ²⊢ x✝ ∈ {a, x, c} \ {x} ↔ x✝ ∈ {a, c}inr.inl a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})⊢ Collinear ℝ {a, c}; aesop All goals completed! 🐙inr.inl a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})⊢ Collinear ℝ {a, c}]inr.inl a:ℝ²c:ℝ²hac:a ≠ cx:ℝ²hab:a ≠ xhbc:x ≠ chcoll:¬Collinear ℝ {a, x, c}hmem:x ∈ (convexHull ℝ) ({a, x, c} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, x, c} \ {x})⊢ Collinear ℝ {a, c}
exact collinear_pair ℝ a c All goals completed! 🐙
· inr.inr a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})⊢ Collinear ℝ ({a, b, x} \ {x}) rw [show ({a, b, x} : Set ℝ²) \ {x} = ({a, b} : Set ℝ²) by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chcoll:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c} inr.inr a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})⊢ Collinear ℝ {a, b} ext a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})x✝:ℝ²⊢ x✝ ∈ {a, b, x} \ {x} ↔ x✝ ∈ {a, b}inr.inr a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})⊢ Collinear ℝ {a, b}; aesop All goals completed! 🐙inr.inr a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})⊢ Collinear ℝ {a, b}]inr.inr a:ℝ²b:ℝ²hab:a ≠ bx:ℝ²hac:a ≠ xhbc:b ≠ xhcoll:¬Collinear ℝ {a, b, x}hmem:x ∈ (convexHull ℝ) ({a, b, x} \ {x})hx_aff:x ∈ affineSpan ℝ ({a, b, x} \ {x})⊢ Collinear ℝ {a, b}
exact collinear_pair ℝ a b All goals completed! 🐙
@[category test, AMS 52]
theorem f_three_eq : f 3 = 3 := by ⊢ f 3 = 3
-- The substantive bound: 3 ∈ cardSet 3.
have hmem3 : (3 : ℕ) ∈ cardSet 3 := by
intro pts hpts hnontri pts:Finset ℝ²hpts:pts.card = 3hnontri:NonTrilinear ↑pts⊢ HasConvexNGon 3 ↑pts hmem3:3 ∈ cardSet 3⊢ f 3 = 3
obtain ⟨a, b, c, hab, hac, hbc, rfl⟩ := Finset.card_eq_three.mp hpts a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}⊢ HasConvexNGon 3 ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3
refine ⟨{a, b, c}, by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}⊢ {a, b, c}.card = 3 hmem3:3 ∈ cardSet 3⊢ f 3 = 3 simp [hab, hac, hbc] All goals completed! 🐙 hmem3:3 ∈ cardSet 3⊢ f 3 = 3, subset_refl _, ?_⟩
have hcoerce : (({a, b, c} : Finset ℝ²) : Set ℝ²) = ({a, b, c} : Set ℝ²) := by ⊢ f 3 = 3 a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3 simp a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3 a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3
have hmem : ∀ {y : ℝ²}, y ∈ ({a, b, c} : Set ℝ²) →
y ∈ (({a, b, c} : Finset ℝ²) : Set ℝ²) := fun h => hcoerce ▸ h a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3
have hnc : ¬ Collinear ℝ ({a, b, c} : Set ℝ²) :=
hnontri (hmem (by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}⊢ a ∈ {a, b, c} a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3 simp All goals completed! 🐙 a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3)) (hmem (by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}⊢ b ∈ {a, b, c} a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3 simp All goals completed! 🐙 a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3)) (hmem (by a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}⊢ c ∈ {a, b, c} a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3 simp All goals completed! 🐙 a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3)) hab hbc hac a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep ↑{a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3
rw [hcoerce a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c} a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3] a:ℝ²b:ℝ²c:ℝ²hab:a ≠ bhac:a ≠ chbc:b ≠ chpts:{a, b, c}.card = 3hnontri:NonTrilinear ↑{a, b, c}hcoerce:↑{a, b, c} = {a, b, c}hmem:∀ {y : ℝ²}, y ∈ {a, b, c} → y ∈ ↑{a, b, c}hnc:¬Collinear ℝ {a, b, c}⊢ ConvexIndep {a, b, c} hmem3:3 ∈ cardSet 3⊢ f 3 = 3
exact convexIndep_triple_of_not_collinear hab hac hbc hnc hmem3:3 ∈ cardSet 3⊢ f 3 = 3 hmem3:3 ∈ cardSet 3⊢ f 3 = 3
refine le_antisymm (Nat.sInf_le hmem3) (le_csInf ⟨3, hmem3⟩ fun N hN => ?_) hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3⊢ 3 ≤ N
-- A set with fewer than 3 points contains no 3-element subset.
by_contra! hlt hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3⊢ False
let f : ℕ → ℝ² := fun i => EuclideanSpace.single 0 (i : ℝ) hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑i⊢ False
let pts : Finset ℝ² := (Finset.range N).image f hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)⊢ False
have hinj : Function.Injective f := fun i j hij => by hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)i:ℕj:ℕhij:f i = f j⊢ i = j hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective f⊢ False
have := congrArg (fun v : ℝ² => v 0) hij hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)i:ℕj:ℕhij:f i = f jthis:(f i).ofLp 0 = (f j).ofLp 0⊢ i = j hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective f⊢ False; simpa [f] using this hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective f⊢ False hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective f⊢ False
have hpts_card : pts.card = N := by ⊢ f 3 = 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ False
simp [pts, Finset.card_image_of_injOn hinj.injOn] hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ False hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ False
have hnontri : NonTrilinear (pts : Set ℝ²) := by ⊢ f 3 = 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False
apply Set.triplewise_of_encard_lt hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ (↑pts).encard < 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False
rw [Set.encard_coe_eq_coe_finsetCard, hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ ↑pts.card < 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ ↑N < 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False hpts_card hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ ↑N < 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ ↑N < 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False] hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = N⊢ ↑N < 3 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False
exact_mod_cast hlt hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑pts⊢ False
obtain ⟨S, hScard, hSsub, _⟩ := hN pts hpts_card hnontri hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑ptsS:Finset ℝ²hScard:S.card = 3hSsub:↑S ⊆ ↑ptsright✝:ConvexIndep ↑S⊢ False
have : S.card ≤ pts.card := Finset.card_le_card (by hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑ptsS:Finset ℝ²hScard:S.card = 3hSsub:↑S ⊆ ↑ptsright✝:ConvexIndep ↑S⊢ S ⊆ pts hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑ptsS:Finset ℝ²hScard:S.card = 3hSsub:↑S ⊆ ↑ptsright✝:ConvexIndep ↑Sthis:S.card ≤ pts.card⊢ False exact_mod_cast hSsub All goals completed! 🐙 hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑ptsS:Finset ℝ²hScard:S.card = 3hSsub:↑S ⊆ ↑ptsright✝:ConvexIndep ↑Sthis:S.card ≤ pts.card⊢ False) hmem3:3 ∈ cardSet 3N:ℕhN:N ∈ cardSet 3hlt:N < 3f:ℕ → ℝ² := fun i ↦ EuclideanSpace.single 0 ↑ipts:Finset ℝ² := Finset.image f (Finset.range N)hinj:Function.Injective fhpts_card:pts.card = Nhnontri:NonTrilinear ↑ptsS:Finset ℝ²hScard:S.card = 3hSsub:↑S ⊆ ↑ptsright✝:ConvexIndep ↑Sthis:S.card ≤ pts.card⊢ False
omega All goals completed! 🐙namespace variantsErdős and Szekeres proved the bounds $$ 2^{n-2} + 1 ≤ f(n) ≤ \binom{2n-4}{n-2} + 1 $$ ([ErSz60] and [ErSz35] respectively).
[ErSz60] Erdős, P. and Szekeres, G., On some extremum problems in elementary geometry. Ann. Univ. Sci. Budapest. Eötvös Sect. Math. (1960/61), 53-62.
[ErSz35] Erdős, P. and Szekeres, G., A combinatorial problem in geometry. Compos. Math. (1935), 463-470.
@[category research solved, AMS 52]
theorem ersz_bounds :
∀ n ≥ 3, 2^(n - 2) + 1 ≤ f n ∧ f n ≤ Nat.choose (2 * n - 4) (n - 2) + 1 := by ⊢ ∀ n ≥ 3, 2 ^ (n - 2) + 1 ≤ f n ∧ f n ≤ (2 * n - 4).choose (n - 2) + 1
sorry All goals completed! 🐙Suk [Su17] proved $$ f(n) ≤ 2^{(1+o(1))n}. $$
[Su17] Suk, Andrew, On the Erdős-Szekeres convex polygon problem. J. Amer. Math. Soc. (2017), 1047-1053.
@[category research solved, AMS 52]
theorem su_bound :
∃ r : ℕ → ℝ, r =o[atTop] (fun n => (n : ℝ)) ∧
∀ n ≥ 3, (f n : ℝ) ≤ 2^(n + r n) := by ⊢ ∃ r, (r =o[atTop] fun n ↦ ↑n) ∧ ∀ n ≥ 3, ↑(f n) ≤ 2 ^ (↑n + r n)
sorry All goals completed! 🐙The current best bound is due to Holmsen, Mojarrad, Pach, and Tardos [HMPT20], who prove $$ f(n) ≤ 2^{n+O(\sqrt{n\log n})}. $$
[HMPT20] Holmsen, Andreas F. and Mojarrad, Hossein Nassajian and Pach, János and Tardos, Gábor, Two extensions of the Erdős-Szekeres problem. J. Eur. Math. Soc. (JEMS) (2020), 3981-3995.
@[category research solved, AMS 52]
theorem hmpt_bound :
∃ r : ℕ → ℝ, r =O[atTop] (fun n => Real.sqrt (n * Real.log n)) ∧
∀ n ≥ 3, (f n : ℝ) ≤ 2^(n + r n) := by ⊢ ∃ r, (r =O[atTop] fun n ↦ √(↑n * Real.log ↑n)) ∧ ∀ n ≥ 3, ↑(f n) ≤ 2 ^ (↑n + r n)
sorry All goals completed! 🐙end Erdos107.variants