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.Star5_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
47import FormalConjectures.WrittenOnTheWallII.Test
namespace Submission
open Polynomial SimpleGraph WrittenOnTheWallII.Test
set_option maxHeartbeats 4000000 in
theorem charpoly_explicit :
Matrix.charpoly (!![0,1,1,1,1,1; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0] : Matrix (Fin 6) (Fin 6) ℝ) = X^4 * (X^2 - C 5) := by
have hc : Matrix.charmatrix (!![0,1,1,1,1,1; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0] : Matrix (Fin 6) (Fin 6) ℝ) = (!![X, -C 1, -C 1, -C 1, -C 1, -C 1; -C 1, X, 0, 0, 0, 0; -C 1, 0, X, 0, 0, 0; -C 1, 0, 0, X, 0, 0; -C 1, 0, 0, 0, X, 0; -C 1, 0, 0, 0, 0, X] : Matrix (Fin 6) (Fin 6) ℝ[X]) := by
ext i j
fin_cases i <;> fin_cases j <;> simp
rw [Matrix.charpoly, hc]
simp [Matrix.det_succ_row_zero, Fin.sum_univ_succ, Fin.succAbove, map_ofNat]
ring
set_option maxHeartbeats 4000000 in
theorem charpoly_star5 : Matrix.charpoly (Star5.adjMatrix ℝ) = X^4 * (X^2 - C 5) := by
have hB : Matrix.reindex finSumFinEquiv finSumFinEquiv (Star5.adjMatrix ℝ) = (!![0,1,1,1,1,1; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0; 1,0,0,0,0,0] : Matrix (Fin 6) (Fin 6) ℝ) := by
have t : ∀ i : Fin 6, (finSumFinEquiv : Fin 1 ⊕ Fin 5 ≃ Fin 6).symm i =
![Sum.inl 0, Sum.inr 0, Sum.inr 1, Sum.inr 2, Sum.inr 3, Sum.inr 4] i := by decide
ext i j
fin_cases i <;> fin_cases j <;> simp [t, Star5, completeBipartiteGraph]
have h := Matrix.charpoly_reindex finSumFinEquiv (Star5.adjMatrix ℝ)
rw [hB, charpoly_explicit] at h
exact h.symm
theorem solution : type_of% @WrittenOnTheWallII.Test.Star5_cvetkovic := by
have h5 : (0:ℝ) < √5 := Real.sqrt_pos.mpr (by norm_num)
have hfac : (X^2 - C (5:ℝ)) = (X - C (√5)) * (X - C (-√5)) := by
rw [show (C (5:ℝ)) = C (√5 * √5) from by rw [Real.mul_self_sqrt (by norm_num)]]
simp only [C_mul, C_neg]
ring
have hne1 : (X - C (√5)) * (X - C (-√5)) ≠ 0 :=
mul_ne_zero (X_sub_C_ne_zero _) (X_sub_C_ne_zero _)
have hne2 : X ^ 4 * ((X - C (√5)) * (X - C (-√5))) ≠ 0 :=
mul_ne_zero (pow_ne_zero _ X_ne_zero) hne1
have hroots : (X ^ 4 * (X ^ 2 - C (5:ℝ))).roots = 4 • ({0} : Multiset ℝ) + ({√5} + {-√5}) := by
rw [hfac, roots_mul hne2, roots_mul hne1, roots_X_pow, roots_X_sub_C, roots_X_sub_C]
unfold cvetkovic
simp only [charpoly_star5, hroots]
have h5' : -√5 < (0:ℝ) := by linarith
simp only [Multiset.countP_add, Multiset.countP_nsmul, ← Multiset.cons_zero, Multiset.countP_cons, Multiset.countP_zero]
have hn : ¬ (√5 < (0:ℝ)) := not_lt.mpr h5.le
norm_num [h5, h5', h5.ne, h5'.ne, h5.ne', h5'.ne', hn]
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/a37fd836-ccaf-4b20-ba42-f64ab685caee.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.Star5_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 a37fd836-ccaf-4b20-ba42-f64ab685caee.lean proof-key.pem with OpenSSL 3.