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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202import FormalConjectures.ErdosProblems.«91»
namespace Submission
open Finset EuclideanGeometry Filter Erdos91
theorem solution : type_of% @Erdos91.erdos_91.test.equiTriangle_unique_optimal := by-- Pure algebra: u = q - p and s = (2w - u) / √3 (w = r - p) are orthogonal of length d.
have core : ∀ u0 u1 w0 w1 s0 s1 d t : ℝ, 0 < d → 0 < t → t ^ 2 = 3 →
s0 * t = 2 * w0 - u0 → s1 * t = 2 * w1 - u1 →
u0 ^ 2 + u1 ^ 2 = d ^ 2 → w0 ^ 2 + w1 ^ 2 = d ^ 2 →
(w0 - u0) ^ 2 + (w1 - u1) ^ 2 = d ^ 2 →
u0 * s0 + u1 * s1 = 0 ∧ s0 ^ 2 + s1 ^ 2 = d ^ 2 ∧ u0 ^ 2 + s0 ^ 2 = d ^ 2 ∧
u1 ^ 2 + s1 ^ 2 = d ^ 2 ∧ u0 * u1 + s0 * s1 = 0 := by
intro u0 u1 w0 w1 s0 s1 d t hd ht ht2 hs0 hs1 hu2 hw hC3
have hu : u0 * s0 + u1 * s1 = 0 := by
have h1 : t * (u0 * s0 + u1 * s1) = 0 := by
linear_combination u0 * hs0 + u1 * hs1 + hw - hC3
exact (mul_eq_zero.mp h1).resolve_left ht.ne'
have hs : s0 ^ 2 + s1 ^ 2 = d ^ 2 := by
have h3 : 3 * (s0 ^ 2 + s1 ^ 2 - d ^ 2) = 0 := by
linear_combination (-(s0 ^ 2 + s1 ^ 2)) * ht2 + (s0 * t + (2 * w0 - u0)) * hs0
+ (s1 * t + (2 * w1 - u1)) * hs1 + 2 * hw - hu2 + 2 * hC3
linarith
have hD2 : (u0 * s1 - u1 * s0) ^ 2 = d ^ 4 := by
linear_combination (s0 ^ 2 + s1 ^ 2) * hu2 + d ^ 2 * hs - (u0 * s0 + u1 * s1) * hu
have hA : d ^ 2 * s0 = -(u1 * (u0 * s1 - u1 * s0)) := by
linear_combination (-s0) * hu2 + u0 * hu
have hB : d ^ 2 * s1 = u0 * (u0 * s1 - u1 * s0) := by
linear_combination (-s1) * hu2 + u1 * hu
have hd4 : d ^ 4 ≠ 0 := pow_ne_zero 4 hd.ne'
have hsq0 : s0 ^ 2 = u1 ^ 2 := by
have h : d ^ 4 * (s0 ^ 2 - u1 ^ 2) = 0 := by
linear_combination (d ^ 2 * s0 - u1 * (u0 * s1 - u1 * s0)) * hA + u1 ^ 2 * hD2
have := (mul_eq_zero.mp h).resolve_left hd4
linarith
have hsq1 : s1 ^ 2 = u0 ^ 2 := by
have h : d ^ 4 * (s1 ^ 2 - u0 ^ 2) = 0 := by
linear_combination (d ^ 2 * s1 + u0 * (u0 * s1 - u1 * s0)) * hB + u0 ^ 2 * hD2
have := (mul_eq_zero.mp h).resolve_left hd4
linarith
have hr01 : u0 * u1 + s0 * s1 = 0 := by
have h : d ^ 4 * (u0 * u1 + s0 * s1) = 0 := by
linear_combination (-(u0 * u1)) * hD2 + (d ^ 2 * s1) * hA
+ (-(u1 * (u0 * s1 - u1 * s0))) * hB
exact (mul_eq_zero.mp h).resolve_left hd4
exact ⟨hu, hs, by linarith, by linarith, hr01⟩
-- The equilateral triangle with unit side has exactly one distance.
have hcardE : equiTriangle.card = 3 := by
simp [equiTriangle, Finset.mem_insert, Finset.mem_singleton]
have hdist : distinctDistances equiTriangle = 1 := by
unfold distinctDistances distanceSet equiTriangle
have eucl_dist_one_of_sq : ∀ {x y : ℝ²}, dist x y ^ 2 = 1 → dist x y = 1 := by
intro x y h; nlinarith [dist_nonneg (x := x) (y := y), sq_nonneg (dist x y)]
have hd01 : dist (!₂[(0 : ℝ), 0]) (!₂[(1 : ℝ), 0]) = 1 := eucl_dist_one_of_sq <| by
rw [EuclideanSpace.dist_sq_eq, Fin.sum_univ_two]; simp [Real.dist_eq]
have hd02 : dist (!₂[(0 : ℝ), 0]) (!₂[(1 : ℝ) / 2, Real.sqrt 3 / 2]) = 1 :=
eucl_dist_one_of_sq <| by
rw [EuclideanSpace.dist_sq_eq, Fin.sum_univ_two, Real.dist_eq, Real.dist_eq]
simp only [Matrix.cons_val_zero, Matrix.cons_val_one]
nlinarith [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), Real.sqrt_nonneg 3,
sq_abs ((0 : ℝ) - 1 / 2), sq_abs ((0 : ℝ) - Real.sqrt 3 / 2)]
have hd12 : dist (!₂[(1 : ℝ), 0]) (!₂[(1 : ℝ) / 2, Real.sqrt 3 / 2]) = 1 :=
eucl_dist_one_of_sq <| by
rw [EuclideanSpace.dist_sq_eq, Fin.sum_univ_two, Real.dist_eq, Real.dist_eq]
simp only [Matrix.cons_val_zero, Matrix.cons_val_one]
nlinarith [Real.sq_sqrt (show (3 : ℝ) ≥ 0 by norm_num), Real.sqrt_nonneg 3,
sq_abs ((1 : ℝ) - 1 / 2), sq_abs ((0 : ℝ) - Real.sqrt 3 / 2)]
suffices h : ({!₂[(0 : ℝ), 0], !₂[(1 : ℝ), 0], !₂[(1 : ℝ) / 2, Real.sqrt 3 / 2]} :
Finset ℝ²).offDiag.image (fun (pair : ℝ² × ℝ²) => dist pair.1 pair.2) = {1} by
simp only [h, Finset.card_singleton]
refine Finset.eq_singleton_iff_unique_mem.mpr ⟨Finset.mem_image.mpr
⟨⟨!₂[0, 0], !₂[1, 0]⟩, by simp [Finset.mem_offDiag], hd01⟩, fun d hd => ?_⟩
obtain ⟨⟨a, b⟩, hab, rfl⟩ := Finset.mem_image.mp hd
simp only [Finset.mem_offDiag, Finset.mem_insert, Finset.mem_singleton] at hab
obtain ⟨ha, hb, _⟩ := hab
rcases ha with rfl | rfl | rfl <;> rcases hb with rfl | rfl | rfl <;> first
| contradiction | exact hd01 | exact hd02 | exact hd12
| (rw [dist_comm]; first | exact hd01 | exact hd02 | exact hd12)
-- Hence every 3-point set with minimal distinct distances has at most one distance.
intro A hA
unfold IsOptimal at hA
obtain ⟨hcard, hopt⟩ := hA
have hle : distinctDistances A ≤ 1 := by
rw [hopt]
unfold minimalDistinctDistances
exact Nat.sInf_le ⟨equiTriangle, hcardE, hdist⟩
obtain ⟨p, q, r, hpq, hpr, hqr, rfl⟩ := Finset.card_eq_three.mp hcard
have hle' : (distanceSet ({p, q, r} : Finset ℝ²)).card ≤ 1 := hle
have hmem : ∀ x y : ℝ², x ∈ ({p, q, r} : Finset ℝ²) → y ∈ ({p, q, r} : Finset ℝ²) →
x ≠ y → dist x y ∈ distanceSet ({p, q, r} : Finset ℝ²) := by
intro x y hx hy hxy
unfold distanceSet
exact Finset.mem_image.mpr ⟨(x, y), Finset.mem_offDiag.mpr ⟨hx, hy, hxy⟩, rfl⟩
have hone := Finset.card_le_one.mp hle'
have hd_qr : dist q r = dist p q :=
hone _ (hmem q r (by simp) (by simp) hqr) _ (hmem p q (by simp) (by simp) hpq)
have hd_pr : dist p r = dist p q :=
hone _ (hmem p r (by simp) (by simp) hpr) _ (hmem p q (by simp) (by simp) hpq)
obtain ⟨d, hd_def⟩ : ∃ d, d = dist p q := ⟨_, rfl⟩
have hd : 0 < d := hd_def ▸ dist_pos.mpr hpq
have hdist2 : ∀ x y : ℝ², dist x y ^ 2 = (x 0 - y 0) ^ 2 + (x 1 - y 1) ^ 2 := by
intro x y
rw [EuclideanSpace.dist_eq, Real.sq_sqrt (by positivity), Fin.sum_univ_two,
Real.dist_eq, Real.dist_eq, sq_abs, sq_abs]
have hC1 : (q 0 - p 0) ^ 2 + (q 1 - p 1) ^ 2 = d ^ 2 := by
have h := hdist2 p q
rw [← hd_def] at h
linear_combination -h
have hC2 : (r 0 - p 0) ^ 2 + (r 1 - p 1) ^ 2 = d ^ 2 := by
have h := hdist2 p r
rw [hd_pr, ← hd_def] at h
linear_combination -h
have hC3 : ((r 0 - p 0) - (q 0 - p 0)) ^ 2 + ((r 1 - p 1) - (q 1 - p 1)) ^ 2 = d ^ 2 := by
have h := hdist2 q r
rw [hd_qr, ← hd_def] at h
linear_combination -h
have htpos : 0 < Real.sqrt 3 := by positivity
have ht : Real.sqrt 3 ^ 2 = 3 := Real.sq_sqrt (by norm_num)
obtain ⟨s0, hs0def⟩ : ∃ s, s = (2 * (r 0 - p 0) - (q 0 - p 0)) / Real.sqrt 3 := ⟨_, rfl⟩
obtain ⟨s1, hs1def⟩ : ∃ s, s = (2 * (r 1 - p 1) - (q 1 - p 1)) / Real.sqrt 3 := ⟨_, rfl⟩
have hs0 : s0 * Real.sqrt 3 = 2 * (r 0 - p 0) - (q 0 - p 0) := by
rw [hs0def]; exact div_mul_cancel₀ _ htpos.ne'
have hs1 : s1 * Real.sqrt 3 = 2 * (r 1 - p 1) - (q 1 - p 1) := by
rw [hs1def]; exact div_mul_cancel₀ _ htpos.ne'
obtain ⟨hur, hss, hr0, hr1, hr01⟩ := core (q 0 - p 0) (q 1 - p 1) (r 0 - p 0) (r 1 - p 1)
s0 s1 d (Real.sqrt 3) hd htpos ht hs0 hs1 hC1 hC2 hC3
-- The affine map sending the unit triangle to {p, q, r}, and its inverse.
obtain ⟨Hf, hHf⟩ : ∃ f : ℝ² → ℝ², ∀ y, f y = !₂[p 0 + y 0 * (q 0 - p 0) + y 1 * s0,
p 1 + y 0 * (q 1 - p 1) + y 1 * s1] :=
⟨fun y => _, fun y => rfl⟩
obtain ⟨Gf, hGf⟩ : ∃ g : ℝ² → ℝ², ∀ z, g z = !₂[((z 0 - p 0) * (q 0 - p 0) + (z 1 - p 1) * (q 1 - p 1)) / d ^ 2,
((z 0 - p 0) * s0 + (z 1 - p 1) * s1) / d ^ 2] :=
⟨fun z => _, fun z => rfl⟩
have hleft : ∀ y, Gf (Hf y) = y := by
intro y
ext i
fin_cases i
· simp only [hGf, hHf]
simp
field_simp
linear_combination y 0 * hC1 + y 1 * hur
· simp only [hGf, hHf]
simp
field_simp
linear_combination y 0 * hur + y 1 * hss
have hright : ∀ z, Hf (Gf z) = z := by
intro z
ext i
fin_cases i
· simp only [hGf, hHf]
simp
field_simp
linear_combination (z 0 - p 0) * hr0 + (z 1 - p 1) * hr01
· simp only [hGf, hHf]
simp
field_simp
linear_combination (z 0 - p 0) * hr01 + (z 1 - p 1) * hr1
have hdil : ∀ y z, dist (Hf y) (Hf z) = d * dist y z := by
intro y z
rw [EuclideanSpace.dist_eq, EuclideanSpace.dist_eq, Fin.sum_univ_two, Fin.sum_univ_two]
simp only [hHf, Real.dist_eq, sq_abs]
rw [← Real.sqrt_sq hd.le, ← Real.sqrt_mul (sq_nonneg d)]
congr 1
simp
linear_combination (y 0 - z 0) ^ 2 * hC1 + 2 * (y 0 - z 0) * (y 1 - z 1) * hur
+ (y 1 - z 1) ^ 2 * hss
have hedist : ∀ y z, edist (Hf y) (Hf z) = ENNReal.ofReal d * edist y z := by
intro y z
rw [edist_dist, edist_dist, hdil, ENNReal.ofReal_mul hd.le]
let H : ℝ² ≃ᵈ ℝ² :=
{ toFun := Hf, invFun := Gf, left_inv := hleft, right_inv := hright,
edist_eq' := ⟨Real.toNNReal d, (Real.toNNReal_pos.mpr hd).ne', hedist⟩ }
have h0 : H !₂[0, 0] = p := by
show Hf _ = p
rw [hHf]
ext i
fin_cases i <;> simp
have h1 : H !₂[1, 0] = q := by
show Hf _ = q
rw [hHf]
ext i
fin_cases i <;> simp
have h2 : H !₂[1 / 2, Real.sqrt 3 / 2] = r := by
show Hf _ = r
rw [hHf]
ext i
fin_cases i
· simp
linear_combination (1 / 2 : ℝ) * hs0
· simp
linear_combination (1 / 2 : ℝ) * hs1
have hHimg : Set.image H (↑equiTriangle : Set ℝ²) = ↑({p, q, r} : Finset ℝ²) := by
have hE : (↑equiTriangle : Set ℝ²) =
{!₂[(0 : ℝ), 0], !₂[(1 : ℝ), 0], !₂[(1 : ℝ) / 2, Real.sqrt 3 / 2]} := by
simp [equiTriangle]
rw [hE, Set.image_insert_eq, Set.image_insert_eq, Set.image_singleton, h0, h1, h2]
simp
refine ⟨H.symm, ?_⟩
rw [← hHimg, Set.image_image]
simp
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/d94f4666-57b3-4173-b6bb-631ab384e02e.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.equiTriangle_unique_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 d94f4666-57b3-4173-b6bb-631ab384e02e.lean proof-key.pem with OpenSSL 3.