This file contains tests for graph invariants on 5 specific concrete graphs: 1. HouseGraph: A graph on 5 vertices. 2. K4: The complete graph on 4 vertices. 3. PetersenGraph: The Petersen graph on 10 vertices. 4. C6: The cycle graph on 6 vertices. 5. Star5: The star graph with 5 leaves (6 vertices total).
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 WrittenOnTheWallII.Test.house_cvetkovic in FormalConjectures.WrittenOnTheWallII.Test.
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. These exercises check that formal graph invariant definitions give the right values on small graphs such as the Petersen graph and six-cycle. Verified mathematics.
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
79import FormalConjectures.WrittenOnTheWallII.Test
namespace Submission
open Polynomial SimpleGraph WrittenOnTheWallII.Test
theorem solution : type_of% @WrittenOnTheWallII.Test.house_cvetkovic := by
have hA : HouseGraph.adjMatrix ℝ =
!![0, 1, 0, 1, 0; 1, 0, 1, 0, 0; 0, 1, 0, 1, 1; 1, 0, 1, 0, 1; 0, 0, 1, 1, 0] := by
ext i j
fin_cases i <;> fin_cases j <;> simp [adjMatrix_apply, HouseGraph, fromEdgeSet_adj]
have hC : (HouseGraph.adjMatrix ℝ).charpoly = X ^ 5 - 6 * X ^ 3 - 2 * X ^ 2 + 4 * X := by
rw [hA]
simp [Matrix.charpoly, Matrix.det_succ_row_zero (n := 4), Matrix.det_succ_row_zero (n := 3),
Matrix.det_fin_three, Fin.succAbove, Fin.sum_univ_succ, Matrix.charmatrix_apply,
Matrix.diagonal_apply]
ring
have hfac : (X ^ 5 - 6 * X ^ 3 - 2 * X ^ 2 + 4 * X : ℝ[X])
= X * (X - C (-2)) * (X ^ 3 - 2 * X ^ 2 - 2 * X + 2) := by
simp only [map_neg, map_ofNat]
ring
set p3 : ℝ[X] := X ^ 3 - 2 * X ^ 2 - 2 * X + 2 with hp3
have hdeg : p3.natDegree = 3 := by
rw [hp3]
compute_degree!
have hp3ne : p3 ≠ 0 := by
intro h
rw [h, natDegree_zero] at hdeg
norm_num at hdeg
-- three real roots by the intermediate value theorem
have hf : Continuous fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2 := by fun_prop
obtain ⟨r1, ⟨h1a, h1b⟩, hr1⟩ := intermediate_value_Ioo (by norm_num : (-2 : ℝ) ≤ -1)
hf.continuousOn (show (0 : ℝ) ∈ Set.Ioo ((fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2) (-2))
((fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2) (-1)) by norm_num)
obtain ⟨r2, ⟨h2a, h2b⟩, hr2⟩ := intermediate_value_Ioo' (by norm_num : (0 : ℝ) ≤ 1)
hf.continuousOn (show (0 : ℝ) ∈ Set.Ioo ((fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2) 1)
((fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2) 0) by norm_num)
obtain ⟨r3, ⟨h3a, h3b⟩, hr3⟩ := intermediate_value_Ioo (by norm_num : (2 : ℝ) ≤ 3)
hf.continuousOn (show (0 : ℝ) ∈ Set.Ioo ((fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2) 2)
((fun x : ℝ => x ^ 3 - 2 * x ^ 2 - 2 * x + 2) 3) by norm_num)
have hr1' : p3.IsRoot r1 := by simpa [hp3] using hr1
have hr2' : p3.IsRoot r2 := by simpa [hp3] using hr2
have hr3' : p3.IsRoot r3 := by simpa [hp3] using hr3
have hs : p3.roots = {r1, r2, r3} := by
have hnd : ({r1, r2, r3} : Multiset ℝ).Nodup := by
simp only [Multiset.insert_eq_cons, Multiset.nodup_cons, Multiset.mem_cons,
Multiset.mem_singleton, not_or, Multiset.nodup_singleton, and_true]
refine ⟨⟨?_, ?_⟩, ?_⟩ <;> intro h <;> linarith
have hsub : ({r1, r2, r3} : Multiset ℝ) ≤ p3.roots := by
rw [Multiset.le_iff_subset hnd]
intro x hx
rw [mem_roots hp3ne]
simp only [Multiset.insert_eq_cons, Multiset.mem_cons, Multiset.mem_singleton] at hx
rcases hx with rfl | rfl | rfl
· exact hr1'
· exact hr2'
· exact hr3'
refine (Multiset.eq_of_le_of_card_le hsub ?_).symm
have := card_roots' p3
rw [hdeg] at this
simpa using this
have hXne : (X * (X - C (-2)) : ℝ[X]) ≠ 0 :=
mul_ne_zero X_ne_zero (X_sub_C_ne_zero _)
have hroots : (HouseGraph.adjMatrix ℝ).charpoly.roots = {0} + {-2} + {r1, r2, r3} := by
rw [hC, hfac, roots_mul (mul_ne_zero hXne hp3ne), roots_mul hXne, roots_X,
roots_X_sub_C, hs]
have n1 : r1 < 0 := by linarith
have n2 : 0 < r2 := h2a
have n3 : 0 < r3 := by linarith
have ne1 : (0 : ℝ) ≠ r1 := by intro h; linarith
have ne2 : (0 : ℝ) ≠ r2 := ne_of_lt n2
have ne3 : (0 : ℝ) ≠ r3 := ne_of_lt n3
unfold cvetkovic
simp only [hroots, ← Multiset.cons_zero, Multiset.cons_add, zero_add, Multiset.insert_eq_cons,
Multiset.countP_cons, Multiset.countP_zero]
simp [n1, n2, n3, ne1, ne2, ne3, not_lt.mpr n1.le, not_lt.mpr n2.le, not_lt.mpr n3.le]
norm_num
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/4650bb67-17c8-41bb-b294-6dd21a1df634.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.WrittenOnTheWallII.Test'
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_.WrittenOnTheWallII.Test.house_cvetkovic := @_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 4650bb67-17c8-41bb-b294-6dd21a1df634.lean proof-key.pem with OpenSSL 3.