Long horizon. A proof would show every three-colouring of a complete graph on four n minus three vertices contains a single-coloured n-cycle, for all n. 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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241import FormalConjectures.ErdosProblems.«556»
namespace Submission
open SimpleGraph
/-- Block index of a vertex when `4 (k+1)` vertices are cut into four blocks of size `k+1`. -/def part {m : ℕ} (k : ℕ) (u : Fin m) : ℕ := u.val / (k + 1)
lemma part_lt {m k : ℕ} (hm : m ≤ 4 * (k + 1)) (u : Fin m) : part k u < 4 := by
unfold part
apply Nat.div_lt_of_lt_mul
have := u.isLt
omega
lemma cyc_consec (k i : ℕ) (hi : i + 1 < k + 2) :
(cycleGraph (k + 2)).Adj ⟨i + 1, hi⟩ ⟨i, by omega⟩ := by
rw [cycleGraph_adj]
left
apply Fin.ext
rw [Fin.sub_val_of_le (Fin.mk_le_mk.2 (by omega))]
simp
lemma cyc_wrap (k : ℕ) :
(cycleGraph (k + 2)).Adj ⟨k + 1, by omega⟩ ⟨0, by omega⟩ := by
rw [cycleGraph_adj]
right
apply Fin.ext
rw [Fin.coe_sub_iff_lt.2 (Fin.mk_lt_mk.2 (by omega))]
simp
/-- An odd cycle does not embed into a graph whose edges join vertices of different colour. -/lemma not_contained_of_bip {V : Type*} (G : SimpleGraph V) (f : V → Bool)
(hf : ∀ u v, G.Adj u v → f u ≠ f v) (k : ℕ) (hodd : Odd (k + 2)) :
¬ cycleGraph (k + 2) ⊑ G := by
rintro ⟨φ⟩
have hc : ∀ i (hi : i < k + 2),
f (φ ⟨i, hi⟩) = (f (φ ⟨0, by omega⟩) != decide (i % 2 = 1)) := by
intro i
induction i with
| zero => intro hi; simp
| succ i ih =>
intro hi
have h1 : f (φ ⟨i + 1, hi⟩) ≠ f (φ ⟨i, by omega⟩) :=
hf _ _ (φ.toHom.map_rel (cyc_consec k i hi))
rw [ih (by omega)] at h1
cases hA : f (φ ⟨0, by omega⟩) <;> cases hB : f (φ ⟨i + 1, hi⟩) <;>
cases hC : decide (i % 2 = 1) <;> simp_all <;> omega
have hwrap : f (φ ⟨k + 1, by omega⟩) ≠ f (φ ⟨0, by omega⟩) :=
hf _ _ (φ.toHom.map_rel (cyc_wrap k))
rw [hc (k + 1) (by omega)] at hwrap
have heven : (k + 1) % 2 = 0 := by
obtain ⟨t, ht⟩ := hodd
omega
simp [heven] at hwrap
/-- A cycle of length `k+2` does not embed into a graph whose edges stay inside one block
of size `k+1`. -/
lemma not_contained_of_part {m : ℕ} (G : SimpleGraph (Fin m)) (k : ℕ)
(hG : ∀ u v, G.Adj u v → part k u = part k v) :
¬ cycleGraph (k + 2) ⊑ G := by
rintro ⟨φ⟩
have hc : ∀ i (hi : i < k + 2), part k (φ ⟨i, hi⟩) = part k (φ ⟨0, by omega⟩) := by
intro i
induction i with
| zero => intro hi; rfl
| succ i ih =>
intro hi
have h1 : part k (φ ⟨i + 1, hi⟩) = part k (φ ⟨i, by omega⟩) :=
hG _ _ (φ.toHom.map_rel (cyc_consec k i hi))
rw [h1, ih (by omega)]
let g : Fin (k + 2) → Fin (k + 1) := fun i => ⟨(φ i).val % (k + 1), Nat.mod_lt _ (by omega)⟩
have hinj : Function.Injective g := by
intro i j hij
have hm : (φ i).val % (k + 1) = (φ j).val % (k + 1) := congrArg Fin.val hij
have hd : part k (φ i) = part k (φ j) := by
rw [hc i.val i.isLt, hc j.val j.isLt]
have e1 := Nat.div_add_mod (φ i).val (k + 1)
have e2 := Nat.div_add_mod (φ j).val (k + 1)
unfold part at hd
rw [hm, hd] at e1
apply φ.injective
apply Fin.ext
show (φ i).val = (φ j).val
omega
have := Fintype.card_le_of_injective g hinj
simp at this
lemma adj_of_pair {V : Type*} [DecidableEq V] (G : SimpleGraph V) {x y : V}
(h : ∃ a ∈ ({x, y} : Finset V), ∃ b ∈ ({x, y} : Finset V), G.Adj a b) : G.Adj x y := by
obtain ⟨a, ha, b, hb, hab⟩ := h
simp only [Finset.mem_insert, Finset.mem_singleton] at ha hb
rcases ha with rfl | rfl <;> rcases hb with rfl | rfl
· exact absurd hab G.irrefl
· exact hab
· exact hab.symm
· exact absurd hab G.irrefl
lemma pair_subset {V : Type*} [DecidableEq V] {T : Finset V} {x y : V}
(hx : x ∈ T) (hy : y ∈ T) : ({x, y} : Finset V) ⊆ T := by
intro z hz
simp only [Finset.mem_insert, Finset.mem_singleton] at hz
rcases hz with rfl | rfl <;> assumption
lemma adj_of_true {V : Type*} [DecidableEq V] (G : SimpleGraph V) {x y : V}
{inst : Decidable (∃ a ∈ ({x, y} : Finset V), ∃ b ∈ ({x, y} : Finset V), G.Adj a b)}
(h : @decide _ inst = true) : G.Adj x y :=
adj_of_pair G (@of_decide_eq_true _ inst h)
lemma not_adj_of_false {V : Type*} [DecidableEq V] (G : SimpleGraph V) {x y : V}
{inst : Decidable (∃ a ∈ ({x, y} : Finset V), ∃ b ∈ ({x, y} : Finset V), G.Adj a b)}
(h : @decide _ inst = false) : ¬ G.Adj x y := fun hadj => by
rw [decide_eq_false_iff_not] at h
exact h ⟨x, by simp, y, by simp, hadj⟩
/-- A set of `n` vertices that are pairwise adjacent in `G` spans a copy of `C_n`. -/lemma cycle_of_clique {V : Type*} [LinearOrder V] (G : SimpleGraph V) (n : ℕ) (S : Finset V)
(hS : S.card = n) (h : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → G.Adj x y) :
cycleGraph n ⊑ G := by
let e := S.orderEmbOfFin hS
refine ⟨Copy.mk ⟨e, fun {a b} hab => ?_⟩ e.injective⟩
exact h _ (S.orderEmbOfFin_mem hS a) _ (S.orderEmbOfFin_mem hS b)
(e.injective.ne ((cycleGraph n).ne_of_adj hab))
/-- The three colour classes on `Fin m`: side-crossing edges, edges between blocks on the
same side, and edges inside one block. -/
def col (k m : ℕ) : Fin 3 → SimpleGraph (Fin m) := ![
fromRel fun u v => part k u < 2 ∧ 2 ≤ part k v,
fromRel fun u v => part k u < part k v ∧ (part k u < 2 ↔ part k v < 2),
fromRel fun u v => part k u = part k v]
lemma col_isEdgeColouring (k m : ℕ) : (⊤ : SimpleGraph (Fin m)).IsEdgeColouring (col k m) := by
unfold IsEdgeColouring
refine ⟨?_, ?_⟩
· ext u v
rw [top_adj, iSup_adj]
constructor
· intro huv
by_cases hs : part k u = part k v
· exact ⟨2, (fromRel_adj _ _ _).2 ⟨huv, Or.inl hs⟩⟩
by_cases hside : (part k u < 2 ↔ part k v < 2)
· rcases lt_or_gt_of_ne hs with h | h
· exact ⟨1, (fromRel_adj _ _ _).2 ⟨huv, Or.inl ⟨h, hside⟩⟩⟩
· exact ⟨1, (fromRel_adj _ _ _).2 ⟨huv, Or.inr ⟨h, hside.symm⟩⟩⟩
· by_cases h1 : part k u < 2
· have h2 : ¬ part k v < 2 := fun h2 => hside ⟨fun _ => h2, fun _ => h1⟩
exact ⟨0, (fromRel_adj _ _ _).2 ⟨huv, Or.inl ⟨h1, by omega⟩⟩⟩
· have h2 : part k v < 2 := by
by_contra h2
exact hside ⟨fun h => absurd h h1, fun h => absurd h h2⟩
exact ⟨0, (fromRel_adj _ _ _).2 ⟨huv, Or.inr ⟨h2, by omega⟩⟩⟩
· rintro ⟨i, hi⟩
exact (col k m i).ne_of_adj hi
· intro i j hij
rw [disjoint_left]
intro x y hxi hyj
fin_cases i <;> fin_cases j <;> simp [col, fromRel_adj] at hxi hyj hij <;> omega
lemma not_col (k N : ℕ) (hN : N ≤ 4 * (k + 1)) (hodd : Odd (k + 2)) (i : Fin 3) :
¬ cycleGraph (k + 2) ⊑ col k N i := by
fin_cases i
· refine not_contained_of_bip _ (fun u => decide (part k u < 2)) ?_ k hodd
intro u v h
simp only [col, fromRel_adj] at h
rcases h.2 with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> simp <;> omega
· refine not_contained_of_bip _ (fun u => decide (part k u % 2 = 1)) ?_ k hodd
intro u v h
simp only [col, fromRel_adj] at h
have b1 := part_lt hN u
have b2 := part_lt hN v
rcases h.2 with ⟨h1, h2⟩ | ⟨h1, h2⟩ <;> simp <;> omega
· refine not_contained_of_part _ k ?_
intro u v h
simp only [col, fromRel_adj] at h
rcases h.2 with h | h <;> omega
open Classical in
/-- Ramsey step: any 3-colouring of `K_m` with `m` large contains a monochromatic `C_n`. -/lemma ramsey_cycle (n m : ℕ)
(hm : ((n + n).choose n + n).choose ((n + n).choose n) ≤ m)
(cc : Fin 3 → SimpleGraph (Fin m)) (hcc : (⊤ : SimpleGraph (Fin m)).IsEdgeColouring cc) :
∃ i, cycleGraph n ⊑ cc i := by
unfold IsEdgeColouring at hcc
obtain ⟨hcov, -⟩ := hcc
have cover : ∀ x y : Fin m, x ≠ y → ∃ i, (cc i).Adj x y := by
intro x y hxy
have h : (⊤ : SimpleGraph (Fin m)).Adj x y ↔ (⨆ i, cc i).Adj x y := by rw [hcov]
rw [top_adj, iSup_adj] at h
exact h.mp hxy
have hV : ((n + n).choose n + n).choose ((n + n).choose n) ≤
(Finset.univ : Finset (Fin m)).card := by
simpa using hm
have hR1 : Combinatorics.Diagonal.HasRamseyProperty
(((n + n).choose n + n).choose ((n + n).choose n)) ((n + n).choose n) n :=
Combinatorics.Diagonal.hasRamseyProperty_choose _ _
have hR2 : Combinatorics.Diagonal.HasRamseyProperty ((n + n).choose n) n n :=
Combinatorics.Diagonal.hasRamseyProperty_choose _ _
rcases hR1 (fun e : Finset (Fin m) => decide (∃ x ∈ e, ∃ y ∈ e, (cc 0).Adj x y))
Finset.univ hV with
⟨S, -, hScard, hS⟩ | ⟨S, -, hScard, hS⟩
· -- no colour-0 edge inside S
have hnot0 : ∀ x ∈ S, ∀ y ∈ S, x ≠ y → ¬ (cc 0).Adj x y := by
intro x hx y hy hxy
have h1 : decide (∃ a ∈ ({x, y} : Finset (Fin m)), ∃ b ∈ ({x, y} : Finset (Fin m)),
(cc 0).Adj a b) = false := hS {x, y} (pair_subset hx hy) (Finset.card_pair hxy)
exact not_adj_of_false (cc 0) h1
rcases hR2 (fun e : Finset (Fin m) => decide (∃ x ∈ e, ∃ y ∈ e, (cc 1).Adj x y)) S
(le_of_eq hScard.symm) with
⟨T, hTsub, hTcard, hT⟩ | ⟨T, hTsub, hTcard, hT⟩
· refine ⟨2, cycle_of_clique (cc 2) n T hTcard fun x hx y hy hxy => ?_⟩
obtain ⟨i, hi⟩ := cover x y hxy
have h1 : decide (∃ a ∈ ({x, y} : Finset (Fin m)), ∃ b ∈ ({x, y} : Finset (Fin m)),
(cc 1).Adj a b) = false := hT {x, y} (pair_subset hx hy) (Finset.card_pair hxy)
fin_cases i
· exact absurd hi (hnot0 x (hTsub hx) y (hTsub hy) hxy)
· exact absurd hi (not_adj_of_false (cc 1) h1)
· exact hi
· exact ⟨1, cycle_of_clique (cc 1) n T hTcard fun x hx y hy hxy =>
adj_of_true (cc 1) (hT {x, y} (pair_subset hx hy) (Finset.card_pair hxy))⟩
· exact ⟨0, cycle_of_clique (cc 0) n S hScard fun x hx y hy hxy =>
adj_of_true (cc 0) (hS {x, y} (pair_subset hx hy) (Finset.card_pair hxy))⟩
theorem solution : type_of% @Erdos556.erdos_556.variants.odd_lower_bound := by
intro n hn hodd
obtain ⟨k, rfl⟩ : ∃ k, n = k + 2 := ⟨n - 2, by omega⟩
by_contra hlt
push_neg at hlt
have hne : Set.Nonempty {N : ℕ | ∀ c : Fin 3 → SimpleGraph (Fin N),
(⊤ : SimpleGraph (Fin N)).IsEdgeColouring c → ∃ i, cycleGraph (k + 2) ⊑ c i} :=
⟨_, fun c hc => ramsey_cycle (k + 2) _ le_rfl c hc⟩
have key : ∀ N, N ≤ 4 * (k + 1) → ¬ ∀ c : Fin 3 → SimpleGraph (Fin N),
(⊤ : SimpleGraph (Fin N)).IsEdgeColouring c → ∃ i, cycleGraph (k + 2) ⊑ c i := by
intro N hN h
obtain ⟨i, hi⟩ := h (col k N) (col_isEdgeColouring k N)
exact not_col k N hN hodd i hi
unfold multicolourRamsey at hlt
exact key _ (by omega) (Nat.sInf_mem hne)
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/e2bab4c2-d820-4161-92ca-88c2910e58f7.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.«556»'
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_.Erdos556.erdos_556.variants.odd_lower_bound := @_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 e2bab4c2-d820-4161-92ca-88c2910e58f7.lean proof-key.pem with OpenSSL 3.