Long horizon. The open question asks whether every triangle-free graph on 5n vertices becomes bipartite after deleting at most n squared edges. 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
152import FormalConjectures.ErdosProblems.«23»
namespace Submission
open SimpleGraph Finset Erdos23
/-- Arithmetic core: five classes of size `n`, class `i` holding `x i` vertices of colour `0`.
The same-coloured pairs between consecutive classes add up to at least `n ^ 2`. -/
theorem cyc_bound (n x0 x1 x2 x3 x4 : ℕ) (g0 : x0 ≤ n) (g1 : x1 ≤ n) (g2 : x2 ≤ n)
(g3 : x3 ≤ n) (g4 : x4 ≤ n) :
n ^ 2 ≤ x0 * x1 + (n - x0) * (n - x1) + (x1 * x2 + (n - x1) * (n - x2))
+ (x2 * x3 + (n - x2) * (n - x3)) + (x3 * x4 + (n - x3) * (n - x4))
+ (x4 * x0 + (n - x4) * (n - x0)) := by
have a0 : (0:ℤ) ≤ x0 := by positivity
have a1 : (0:ℤ) ≤ x1 := by positivity
have a2 : (0:ℤ) ≤ x2 := by positivity
have a3 : (0:ℤ) ≤ x3 := by positivity
have a4 : (0:ℤ) ≤ x4 := by positivity
have b0 : (0:ℤ) ≤ n - x0 := by omega
have b1 : (0:ℤ) ≤ n - x1 := by omega
have b2 : (0:ℤ) ≤ n - x2 := by omega
have b3 : (0:ℤ) ≤ n - x3 := by omega
have b4 : (0:ℤ) ≤ n - x4 := by omega
zify [g0, g1, g2, g3, g4]
nlinarith [mul_nonneg a0 a1, mul_nonneg a1 a2, mul_nonneg a2 a3, mul_nonneg a3 a4,
mul_nonneg a4 a0, mul_nonneg a0 b1, mul_nonneg a1 b0, mul_nonneg a1 b2, mul_nonneg a2 b1,
mul_nonneg a2 b3, mul_nonneg a3 b2, mul_nonneg a3 b4, mul_nonneg a4 b3, mul_nonneg a4 b0,
mul_nonneg a0 b4, mul_nonneg b0 b1, mul_nonneg b1 b2, mul_nonneg b2 b3, mul_nonneg b3 b4,
mul_nonneg b4 b0, mul_nonneg a0 b2, mul_nonneg a2 b0, mul_nonneg a1 b3, mul_nonneg a3 b1,
mul_nonneg a2 b4, mul_nonneg a4 b2, mul_nonneg a3 b0, mul_nonneg a0 b3, mul_nonneg a4 b1,
mul_nonneg a1 b4]
/-- Two colourings `p` (of one class) and `q` (of the next) of `Fin n`, with colours in `Fin 2`:
the same-coloured pairs number `R p * R q + (n - R p) * (n - R q)`, where `R` counts colour `0`. -/
theorem pair_count {n : ℕ} (p q : Fin n → Fin 2) :
(univ.filter (fun ab : Fin n × Fin n => p ab.1 = q ab.2)).card
= (univ.filter (fun a => p a = 0)).card * (univ.filter (fun b => q b = 0)).card
+ (n - (univ.filter (fun a => p a = 0)).card)
* (n - (univ.filter (fun b => q b = 0)).card) := by
have hp := card_filter_add_card_filter_not (s := (univ : Finset (Fin n)))
(fun a => p a = 0)
have hq := card_filter_add_card_filter_not (s := (univ : Finset (Fin n)))
(fun b => q b = 0)
simp only [card_univ, Fintype.card_fin] at hp hq
have hp' : (univ.filter (fun a => ¬ p a = 0)).card
= n - (univ.filter (fun a => p a = 0)).card := by omega
have hq' : (univ.filter (fun b => ¬ q b = 0)).card
= n - (univ.filter (fun b => q b = 0)).card := by omega
have hset : univ.filter (fun ab : Fin n × Fin n => p ab.1 = q ab.2)
= (univ.filter (fun a => p a = 0) ×ˢ univ.filter (fun b => q b = 0))
∪ (univ.filter (fun a => ¬ p a = 0) ×ˢ univ.filter (fun b => ¬ q b = 0)) := by
ext ⟨a, b⟩
simp only [mem_filter, mem_univ, true_and, mem_union, mem_product]
have key : ∀ x y : Fin 2, x = y ↔ (x = 0 ∧ y = 0) ∨ (¬ x = 0 ∧ ¬ y = 0) := by decide
exact key _ _
rw [hset, card_union_of_disjoint, card_product, card_product, hp', hq']
rw [Finset.disjoint_left]
rintro ⟨a, b⟩ h1 h2
simp only [mem_product, mem_filter, mem_univ, true_and] at h1 h2
exact h2.1 h1.1
theorem solution : type_of% @Erdos23.blowupC5_tight := by
intro n _hn H _hH hBip
classical
obtain ⟨c⟩ := hBip
have hne : ∀ i : ZMod 5, i ≠ i + 1 := by decide
have hsym : ∀ i j : ZMod 5, i + 1 = j → j + 1 = i → False := by decide
have hfive : ∀ f : ZMod 5 → ℕ, ∑ i : ZMod 5, f i = f 0 + f 1 + f 2 + f 3 + f 4 :=
fun f => Fin.sum_univ_five f
have hadj : ∀ (i : ZMod 5) (a b : Fin n), (blowupC5 n).Adj (i, a) (i + 1, b) := by
intro i a b
unfold blowupC5
rw [fromRel_adj]
refine ⟨fun h => hne i (congrArg Prod.fst h), ?_⟩
dsimp only
exact Or.inl (by simp)
have hmem : ∀ (i : ZMod 5) (a b : Fin n),
s((i, a), (i + 1, b)) ∈ (blowupC5 n).edgeFinset := fun i a b => by
rw [mem_edgeFinset, mem_edgeSet]
exact hadj i a b
have hnotH : ∀ (i : ZMod 5) (a b : Fin n), c (i, a) = c (i + 1, b) →
s((i, a), (i + 1, b)) ∉ H.edgeFinset := by
intro i a b h hH'
rw [mem_edgeFinset, mem_edgeSet] at hH'
exact c.valid hH' h
have hinj : ∀ i : ZMod 5, Function.Injective
(fun ab : Fin n × Fin n => s((i, ab.1), (i + 1, ab.2))) := by
rintro i ⟨a, b⟩ ⟨a', b'⟩ h
simp only [Sym2.eq_iff, Prod.mk.injEq] at h
rcases h with ⟨⟨_, ha⟩, ⟨_, hb⟩⟩ | ⟨⟨h1, _⟩, _⟩
· rw [ha, hb]
· exact absurd h1 (hne i)
have hdisj : ∀ i j : ZMod 5, ∀ a b a' b' : Fin n,
s((i, a), (i + 1, b)) = s((j, a'), (j + 1, b')) → i = j := by
intro i j a b a' b' h
simp only [Sym2.eq_iff, Prod.mk.injEq] at h
rcases h with ⟨⟨h1, _⟩, _⟩ | ⟨⟨h1, _⟩, ⟨h2, _⟩⟩
· exact h1
· exact (hsym i j h2 h1.symm).elim
-- monochromatic pairs between classes `i` and `i + 1`
let S : ZMod 5 → Finset (Fin n × Fin n) := fun i =>
univ.filter (fun ab => c (i, ab.1) = c (i + 1, ab.2))
have hsub : (univ : Finset (ZMod 5)).biUnion
(fun i => (S i).image (fun ab => s((i, ab.1), (i + 1, ab.2))))
⊆ (blowupC5 n).edgeFinset \ H.edgeFinset := by
intro e he
simp only [mem_biUnion, mem_image, mem_univ, true_and] at he
obtain ⟨i, ab, hab, rfl⟩ := he
rw [mem_sdiff]
exact ⟨hmem i ab.1 ab.2, hnotH i ab.1 ab.2 (mem_filter.1 hab).2⟩
have hcard_eq : ((univ : Finset (ZMod 5)).biUnion
(fun i => (S i).image (fun ab => s((i, ab.1), (i + 1, ab.2))))).card
= ∑ i : ZMod 5, (S i).card := by
rw [card_biUnion]
· exact Finset.sum_congr rfl fun i _ => card_image_of_injective _ (hinj i)
· intro i _ j _ hij
show Disjoint _ _
rw [Finset.disjoint_left]
intro e he he'
simp only [mem_image] at he he'
obtain ⟨ab, _, rfl⟩ := he
obtain ⟨cd, _, hcd⟩ := he'
exact hij (hdisj j i cd.1 cd.2 ab.1 ab.2 hcd).symm
have hpair : ∀ i : ZMod 5, (S i).card
= (univ.filter (fun a => c (i, a) = 0)).card * (univ.filter (fun b => c (i + 1, b) = 0)).card
+ (n - (univ.filter (fun a => c (i, a) = 0)).card)
* (n - (univ.filter (fun b => c (i + 1, b) = 0)).card) :=
fun i => pair_count (fun a => c (i, a)) (fun b => c (i + 1, b))
have e0 : (0 : ZMod 5) + 1 = 1 := by decide
have e1 : (1 : ZMod 5) + 1 = 2 := by decide
have e2 : (2 : ZMod 5) + 1 = 3 := by decide
have e3 : (3 : ZMod 5) + 1 = 4 := by decide
have e4 : (4 : ZMod 5) + 1 = 0 := by decide
have h0 := hpair 0
have h1 := hpair 1
have h2 := hpair 2
have h3 := hpair 3
have h4 := hpair 4
rw [e0] at h0
rw [e1] at h1
rw [e2] at h2
rw [e3] at h3
rw [e4] at h4
have hle : ∀ i : ZMod 5, (univ.filter (fun a => c (i, a) = 0)).card ≤ n := fun i => by
simpa using card_filter_le (univ : Finset (Fin n)) (fun a => c (i, a) = 0)
have hb := cyc_bound n _ _ _ _ _ (hle 0) (hle 1) (hle 2) (hle 3) (hle 4)
have hsum : n ^ 2 ≤ ∑ i : ZMod 5, (S i).card := by
rw [hfive (fun i => (S i).card), h0, h1, h2, h3, h4]
linarith
have hfin := card_le_card hsub
rw [hcard_eq] at hfin
exact le_trans hsum hfin
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/b0f36d6f-9ae3-49f8-9185-caee98862fde.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.«23»'
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_.Erdos23.blowupC5_tight := @_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 b0f36d6f-9ae3-49f8-9185-caee98862fde.lean proof-key.pem with OpenSSL 3.