Long horizon. This asks whether planar point sets minimizing the number of distinct distances always have at least two non-similar optimal shapes. Knowledge itself.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120import FormalConjectures.ErdosProblems.«91»
namespace Submission
open Erdos91 Finset
lemma sq_dist_coord (x y : EuclideanSpace ℝ (Fin 2)) :
dist x y ^ 2 = (x 0 - y 0) ^ 2 + (x 1 - y 1) ^ 2 := by
rw [EuclideanSpace.dist_sq_eq, Fin.sum_univ_two, Real.dist_eq, Real.dist_eq, sq_abs, sq_abs]
lemma dist_eq_of_sq_eq {x y : EuclideanSpace ℝ (Fin 2)} {r : ℝ} (hr : 0 ≤ r)
(h : dist x y ^ 2 = r ^ 2) : dist x y = r :=
(pow_left_inj₀ dist_nonneg hr two_ne_zero).mp h
lemma gram_three_zero (A B C D E F s : ℝ) (hA : A = s) (hB : B = s) (hC : C = s)
(hD : D = s / 2) (hE : E = s / 2) (hF : F = s / 2)
(hG : A * (B * C - F ^ 2) - D * (D * C - F * E) + E * (D * F - B * E) = 0) :
s = 0 := by
rw [hA, hB, hC, hD, hE, hF] at hG
have h3 : s ^ 3 = 0 := by linear_combination 2 * hG
exact pow_eq_zero_iff (by norm_num) |>.mp h3
/-- Four points of the plane cannot be pairwise at the same distance. -/lemma four_points_not_equidistant (a b c d : EuclideanSpace ℝ (Fin 2)) (s : ℝ)
(h1 : dist a b ^ 2 = s) (h2 : dist a c ^ 2 = s) (h3 : dist a d ^ 2 = s)
(h4 : dist b c ^ 2 = s) (h5 : dist b d ^ 2 = s) (h6 : dist c d ^ 2 = s) : s = 0 := by
rw [sq_dist_coord] at h1 h2 h3 h4 h5 h6
have hA : (b 0 - a 0) ^ 2 + (b 1 - a 1) ^ 2 = s := by linear_combination h1
have hB : (c 0 - a 0) ^ 2 + (c 1 - a 1) ^ 2 = s := by linear_combination h2
have hC : (d 0 - a 0) ^ 2 + (d 1 - a 1) ^ 2 = s := by linear_combination h3
have hD : (b 0 - a 0) * (c 0 - a 0) + (b 1 - a 1) * (c 1 - a 1) = s / 2 := by
linear_combination (1 / 2) * h1 + (1 / 2) * h2 - (1 / 2) * h4
have hE : (b 0 - a 0) * (d 0 - a 0) + (b 1 - a 1) * (d 1 - a 1) = s / 2 := by
linear_combination (1 / 2) * h1 + (1 / 2) * h3 - (1 / 2) * h5
have hF : (c 0 - a 0) * (d 0 - a 0) + (c 1 - a 1) * (d 1 - a 1) = s / 2 := by
linear_combination (1 / 2) * h2 + (1 / 2) * h3 - (1 / 2) * h6
exact gram_three_zero _ _ _ _ _ _ s hA hB hC hD hE hF (by ring)
/-- Any four points of the plane determine at least two distinct distances. -/lemma two_le_distinctDistances_of_card_four (points : Finset (EuclideanSpace ℝ (Fin 2)))
(hc : points.card = 4) : 2 ≤ distinctDistances points := by
by_contra! hlt
have hone : (distanceSet points).card ≤ 1 := by
unfold distinctDistances at hlt
omega
have hconst : ∀ x ∈ points, ∀ y ∈ points, ∀ z ∈ points, ∀ w ∈ points,
x ≠ y → z ≠ w → dist x y = dist z w := by
intro x hx y hy z hz w hw hxy hzw
have hmem : ∀ p ∈ points, ∀ q ∈ points, p ≠ q → dist p q ∈ distanceSet points :=
fun p hp q hq hpq =>
Finset.mem_image.mpr ⟨(p, q), Finset.mem_offDiag.mpr ⟨hp, hq, hpq⟩, rfl⟩
exact Finset.card_le_one.mp hone _ (hmem x hx y hy hxy) _ (hmem z hz w hw hzw)
have h2 : 2 < points.card := by rw [hc]; norm_num
obtain ⟨a, ha, b, hb, c, hc', hab, hac, hbc⟩ := Finset.two_lt_card.mp h2
have h3 : ({a, b, c} : Finset (EuclideanSpace ℝ (Fin 2))).card < points.card := by
rw [hc]; exact lt_of_le_of_lt Finset.card_le_three (by norm_num)
obtain ⟨d, hd, hdn⟩ := Finset.exists_mem_notMem_of_card_lt_card h3
simp only [Finset.mem_insert, Finset.mem_singleton, not_or] at hdn
obtain ⟨hda, hdb, hdc⟩ := hdn
have had : a ≠ d := fun h => hda h.symm
have hbd : b ≠ d := fun h => hdb h.symm
have hcd : c ≠ d := fun h => hdc h.symm
have e1 := hconst a ha b hb a ha c hc' hab hac
have e2 := hconst a ha b hb a ha d hd hab had
have e3 := hconst a ha b hb b hb c hc' hab hbc
have e4 := hconst a ha b hb b hb d hd hab hbd
have e5 := hconst a ha b hb c hc' d hd hab hcd
have h2 : dist a c ^ 2 = dist a b ^ 2 := by rw [e1]
have h3 : dist a d ^ 2 = dist a b ^ 2 := by rw [e2]
have h4 : dist b c ^ 2 = dist a b ^ 2 := by rw [e3]
have h5 : dist b d ^ 2 = dist a b ^ 2 := by rw [e4]
have h6 : dist c d ^ 2 = dist a b ^ 2 := by rw [e5]
have hz := four_points_not_equidistant a b c d (dist a b ^ 2) rfl h2 h3 h4 h5 h6
exact hab (dist_eq_zero.mp ((pow_eq_zero_iff two_ne_zero).mp hz))
lemma distanceSet_unitSquare :
distanceSet unitSquare = {1, Real.sqrt 2} := by
ext r
constructor
· intro hr
obtain ⟨⟨p, q⟩, hpq, rfl⟩ := Finset.mem_image.mp hr
obtain ⟨hp, hq, hne⟩ := Finset.mem_offDiag.mp hpq
dsimp only at hne ⊢
simp only [unitSquare, Finset.mem_insert, Finset.mem_singleton] at hp hq ⊢
rcases hp with rfl | rfl | rfl | rfl <;> rcases hq with rfl | rfl | rfl | rfl <;>
first
| exact absurd rfl hne
| (left; apply dist_eq_of_sq_eq zero_le_one; rw [sq_dist_coord]; norm_num; done)
| (right; apply dist_eq_of_sq_eq (Real.sqrt_nonneg 2)
rw [sq_dist_coord, Real.sq_sqrt zero_le_two]; norm_num)
· intro hr
simp only [Finset.mem_insert, Finset.mem_singleton] at hr
rcases hr with rfl | rfl
· refine Finset.mem_image.mpr ⟨(!₂[0, 0], !₂[1, 0]), ?_, ?_⟩
· simp [unitSquare, Finset.mem_offDiag]
· dsimp only; apply dist_eq_of_sq_eq zero_le_one; rw [sq_dist_coord]; norm_num
· refine Finset.mem_image.mpr ⟨(!₂[0, 0], !₂[1, 1]), ?_, ?_⟩
· simp [unitSquare, Finset.mem_offDiag]
· dsimp only; apply dist_eq_of_sq_eq (Real.sqrt_nonneg 2)
rw [sq_dist_coord, Real.sq_sqrt zero_le_two]; norm_num
lemma card_unitSquare : unitSquare.card = 4 := by
simp [unitSquare]
lemma distinctDistances_unitSquare : distinctDistances unitSquare = 2 := by
unfold distinctDistances
rw [distanceSet_unitSquare, Finset.card_pair]
intro h
nlinarith [Real.sq_sqrt (show (0 : ℝ) ≤ 2 by norm_num), Real.sqrt_nonneg 2]
theorem solution : type_of% @Erdos91.erdos_91.test.unitSquare_optimal := by
refine ⟨card_unitSquare, ?_⟩
rw [distinctDistances_unitSquare]
unfold minimalDistinctDistances
apply le_antisymm
· exact le_csInf ⟨_, unitSquare, card_unitSquare, rfl⟩ (by
rintro m ⟨points, hc, rfl⟩
exact two_le_distinctDistances_of_card_four points hc)
· exact Nat.sInf_le ⟨unitSquare, card_unitSquare, distinctDistances_unitSquare⟩
end Submission
Check it yourself
Project
formal-conjectures
Commit
f606af160664c5a10952e9a957b100a1cd45bbeb
Lean
leanprover/lean4:v4.33.1
Mathlib
0df444a360eaa60ab8c11dca51a86af692955474
With Git and Elan installed, put the download in a fresh working directory and run this there. Use a disposable environment. Lean prints the axioms at the end. The checker allows propext, Classical.choice, and Quot.sound.
(
set -eu
proof="$PWD/cb9c89dc-ad89-41ef-a80b-cf4de309e4a1.lean"
git clone https://github.com/google-deepmind/formal-conjectures.git formal-conjectures
git -C formal-conjectures checkout --detach f606af160664c5a10952e9a957b100a1cd45bbeb
cd formal-conjectures
elan toolchain install leanprover/lean4:v4.33.1
lake +leanprover/lean4:v4.33.1 exe cache get
lake +leanprover/lean4:v4.33.1 build '+FormalConjectures.ErdosProblems.«91»'
check_dir="$(mktemp -d)"
trap 'rm -f "$check_dir/Check.lean"; rmdir "$check_dir"' EXIT
printf "%s\n" "import Lean" > "$check_dir/Check.lean"
cat "$proof" >> "$check_dir/Check.lean"
cat >> "$check_dir/Check.lean" <<'SOLVE_CHECK'
example : type_of% @_root_.Erdos91.erdos_91.test.unitSquare_optimal := @_root_.Submission.solution
#print axioms Submission.solution
SOLVE_CHECK
lake +leanprover/lean4:v4.33.1 env lean "$check_dir/Check.lean"
)
Download the receipt verifier and public key. Run python3 verify-proof.py certificate.json cb9c89dc-ad89-41ef-a80b-cf4de309e4a1.lean proof-key.pem with OpenSSL 3.