There exists a triangle-free graph on 25 vertices such that at least 25 edges must be removed to make it bipartite. The balanced blow-up of C5 with five parts of size 5 witnesses this.
Stored at check time. Anyone can fetch and re-check this answer.
Verdict
Lean checked the assigned statement and its axiom dependencies.
Checking program
Lean checking program 0.2.0
Lean toolchain
leanprover/lean4:v4.33.1
Library
formal-conjectures at f606af160664
Statement
Exact statement of Erdos23.erdos_23.variants.n5_tight in FormalConjectures.ErdosProblems.«23».
Axioms used
Classical.choice, Quot.sound, propext
Axioms allowed
propext, Classical.choice, Quot.sound. Any other axiom or placeholder is turned down.
Human confirmation
Not needed; the checking program's verdict settles this problem.
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
103import FormalConjectures.ErdosProblems.«23»
namespace Submission
open SimpleGraph
/-- The block (of 5 consecutive vertices) containing a vertex of `Fin 25`. -/def part (u : Fin 25) : Fin 5 := ⟨u.val / 5, by have := u.isLt; omega⟩
/-- Vertex number `x` in block `k`. -/def vtx (k x : Fin 5) : Fin 25 := ⟨5 * k.val + x.val, by have := k.isLt; have := x.isLt; omega⟩
/-- The balanced blow-up of `C5`: blocks `k` and `k + 1` are completely joined. -/def blowC5 : SimpleGraph (Fin 25) := SimpleGraph.fromRel fun u v => part u + 1 = part v
lemma part_vtx (k x : Fin 5) : part (vtx k x) = k := by
apply Fin.ext
show (5 * k.val + x.val) / 5 = k.val
have := x.isLt
omega
lemma vtx_inj {k x k' x' : Fin 5} (h : vtx k x = vtx k' x') : k = k' ∧ x = x' := by
have h1 : 5 * k.val + x.val = 5 * k'.val + x'.val := congrArg Fin.val h
have := k.isLt; have := x.isLt; have := k'.isLt; have := x'.isLt
exact ⟨Fin.ext (by omega), Fin.ext (by omega)⟩
lemma ne_succ (k : Fin 5) : k ≠ k + 1 := by revert k; decide
lemma succ_succ_ne : ∀ k k' : Fin 5, k = k' + 1 → k + 1 = k' → False := by decide
lemma lin_inj : ∀ a b a' b' k : Fin 5, a + k * b = a' + k * b' →
a + (k + 1) * b = a' + (k + 1) * b' → a = a' ∧ b = b' := by decide
/-- Cycle number `(a, b)` of the decomposition: its edge between blocks `k` and `k + 1`. -/def cycEdge (a b k : Fin 5) : Sym2 (Fin 25) :=
s(vtx k (a + k * b), vtx (k + 1) (a + (k + 1) * b))
lemma cycEdge_adj (a b k : Fin 5) :
blowC5.Adj (vtx k (a + k * b)) (vtx (k + 1) (a + (k + 1) * b)) := by
rw [blowC5, fromRel_adj]
refine ⟨fun h => ?_, Or.inl ?_⟩
· have h1 := congrArg part h
rw [part_vtx, part_vtx] at h1
exact ne_succ k h1
· rw [part_vtx, part_vtx]
lemma cycEdge_inj {a b a' b' k k' : Fin 5} (h : cycEdge a b k = cycEdge a' b' k') :
a = a' ∧ b = b' := by
unfold cycEdge at h
rcases Sym2.eq_iff.1 h with ⟨h1, h2⟩ | ⟨h1, h2⟩
· obtain ⟨hk, h1'⟩ := vtx_inj h1
obtain ⟨-, h2'⟩ := vtx_inj h2
subst hk
exact lin_inj a b a' b' k h1' h2'
· exact (succ_succ_ne k k' (vtx_inj h1).1 (vtx_inj h2).1).elim
lemma no_triangle : ∀ p q r : Fin 5, (p + 1 = q ∨ q + 1 = p) → (q + 1 = r ∨ r + 1 = q) →
(p + 1 = r ∨ r + 1 = p) → False := by decide
lemma blowC5_triangle_free : blowC5.CliqueFree 3 := by
rintro t ht
obtain ⟨u, v, w, huv, huw, hvw, rfl⟩ := is3Clique_iff.1 ht
rw [blowC5, fromRel_adj] at huv huw hvw
exact no_triangle _ _ _ huv.2 hvw.2 huw.2
lemma no_odd_cycle (f : Fin 5 → Fin 2) (hf : ∀ k, f k ≠ f (k + 1)) : False := by
have h0 : f 0 ≠ f 1 := hf 0
have h1 : f 1 ≠ f 2 := hf 1
have h2 : f 2 ≠ f 3 := hf 2
have h3 : f 3 ≠ f 4 := hf 3
have h4 : f 4 ≠ f 0 := hf 4
have := (f 0).isLt; have := (f 1).isLt; have := (f 2).isLt; have := (f 3).isLt
have := (f 4).isLt
simp only [ne_eq, Fin.ext_iff] at h0 h1 h2 h3 h4
omega
lemma cycle_has_missing (H : SimpleGraph (Fin 25)) (hH : H.IsBipartite) (a b : Fin 5) :
∃ k, ¬ H.Adj (vtx k (a + k * b)) (vtx (k + 1) (a + (k + 1) * b)) := by
by_contra hcon
push_neg at hcon
obtain ⟨c⟩ := hH
exact no_odd_cycle (fun k => c (vtx k (a + k * b))) fun k => c.valid (hcon k)
open scoped Classical in
theorem solution : type_of% @Erdos23.erdos_23.variants.n5_tight := by
refine ⟨blowC5, blowC5_triangle_free, fun H _ hH => ?_⟩
have hk : ∀ p : Fin 5 × Fin 5, ∃ k : Fin 5,
cycEdge p.1 p.2 k ∈ blowC5.edgeFinset \ H.edgeFinset := by
rintro ⟨a, b⟩
obtain ⟨k, hk⟩ := cycle_has_missing H hH a b
exact ⟨k, Finset.mem_sdiff.2 ⟨mem_edgeFinset.2 ((mem_edgeSet _).2 (cycEdge_adj a b k)),
fun h => hk ((mem_edgeSet _).1 (mem_edgeFinset.1 h))⟩⟩
choose kf hkf using hk
have hinj : Set.InjOn (fun p : Fin 5 × Fin 5 => cycEdge p.1 p.2 (kf p))
((Finset.univ : Finset (Fin 5 × Fin 5)) : Set (Fin 5 × Fin 5)) := by
rintro ⟨a, b⟩ - ⟨a', b'⟩ - h
obtain ⟨h1, h2⟩ := cycEdge_inj h
exact Prod.ext h1 h2
have hcard := Finset.card_le_card_of_injOn (s := Finset.univ)
(t := blowC5.edgeFinset \ H.edgeFinset) (fun p : Fin 5 × Fin 5 => cycEdge p.1 p.2 (kf p))
(fun p _ => hkf p) hinj
simpa using hcard
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/0a00270f-3a1a-4933-a534-33799229a191.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.erdos_23.variants.n5_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 0a00270f-3a1a-4933-a534-33799229a191.lean proof-key.pem with OpenSSL 3.