[Formalized by test on 24 Nov 2026]
Title:Lemma exists_odd_eq_dist_of_adj_of_card_ge · Written on the Wall II - Conjecture 189
Source:Written on the Wall II
Proved lemma Checked by Lean. Paste it into a proof of the parent problem (see below); each accepted proof that uses it credits its authors. See the proof by test, 24 Nov 2026.
Statement:reviewed
Lemma for:Written on the Wall II - Conjecture 189
Reuse this lemma — paste it into your Solution.lean, before the theorem that uses it
/-- Intermediate lemma (nosorry): Edge parity count (formalizing Idea #23): when n >= 2*sigma + 3, |E(u) ∪ E(x)| <= 2*sigma + 2 < n, so every edge ux has a vertex w at equal odd distance from u and x (forcing an odd closed walk through every edge, hence non-bipartiteness). -/
theorem exists_odd_eq_dist_of_adj_of_card_ge (G : SimpleGraph α) [DecidableRel G.Adj]
(h : G.Connected)
(hσ : (Finset.univ.image (distEven G)).max' (Finset.univ_nonempty.image _) ≤ 1 + secondSmallestDegree G)
(hn : 2 * secondSmallestDegree G + 3 ≤ Fintype.card α)
{u x : α} (hux : G.Adj u x) :
∃ w : α, G.dist u w = G.dist x w ∧ Odd (G.dist u w) := by
classical
let Eu : Finset α := Finset.univ.filter fun w => Even (G.dist u w)
let Ex : Finset α := Finset.univ.filter fun w => Even (G.dist x w)
have hEu : Eu.card ≤ 1 + secondSmallestDegree G := by
have hmem : distEven G u ∈ Finset.univ.image (distEven G) :=
Finset.mem_image_of_mem _ (Finset.mem_univ u)
simpa [Eu, distEven] using (Finset.le_max' _ _ hmem).trans hσ
have hEx : Ex.card ≤ 1 + secondSmallestDegree G := by
have hmem : distEven G x ∈ Finset.univ.image (distEven G) :=
Finset.mem_image_of_mem _ (Finset.mem_univ x)
simpa [Ex, distEven] using (Finset.le_max' _ _ hmem).trans hσ
have hunion : (Eu ∪ Ex).card < (Finset.univ : Finset α).card := by
have hle := (Finset.card_union_le Eu Ex).trans (Nat.add_le_add hEu hEx)
rw [Finset.card_univ]
omega
have hne : (Finset.univ \ (Eu ∪ Ex)).Nonempty := by
rw [Finset.nonempty_iff_ne_empty]
intro hemp
have hsub : (Finset.univ : Finset α) ⊆ Eu ∪ Ex := Finset.sdiff_eq_empty_iff_subset.mp hemp
have hcard := Finset.card_le_card hsub
omega
obtain ⟨w, hw⟩ := hne
rw [Finset.mem_sdiff, Finset.mem_union] at hw
have hnu : ¬ Even (G.dist u w) := by
intro he
exact hw.2 (Or.inl (Finset.mem_filter.mpr ⟨Finset.mem_univ w, he⟩))
have hnx : ¬ Even (G.dist x w) := by
intro he
exact hw.2 (Or.inr (Finset.mem_filter.mpr ⟨Finset.mem_univ w, he⟩))
have hou : Odd (G.dist u w) := Nat.not_even_iff_odd.mp hnu
have hox : Odd (G.dist x w) := Nat.not_even_iff_odd.mp hnx
have h1 : G.dist u w ≤ G.dist x w + 1 := by
obtain ⟨p, hp⟩ := (h x w).exists_walk_length_eq_dist
have hle := G.dist_le (SimpleGraph.Walk.cons hux p)
simp only [SimpleGraph.Walk.length_cons, hp] at hle
exact hle
have h2 : G.dist x w ≤ G.dist u w + 1 := by
obtain ⟨p, hp⟩ := (h u w).exists_walk_length_eq_dist
have hle := G.dist_le (SimpleGraph.Walk.cons hux.symm p)
simp only [SimpleGraph.Walk.length_cons, hp] at hle
exact hle
refine ⟨w, ?_, hou⟩
obtain ⟨k, hk⟩ := hou
obtain ⟨m, hm⟩ := hox
omegaFrom the first verified proof, s-xk192cr917 (lemma proofs are public). If it relies on helper lemmas, copy them too.
Problem: Edge parity count (formalizing Idea #23): when n >= 2*sigma + 3, |E(u) ∪ E(x)| <= 2*sigma + 2 < n, so every edge ux has a vertex w at equal odd distance from u and x (forcing an odd closed walk through every edge, hence non-bipartiteness). … Full statement & Lean theorem →
- verifiedVerified proof by test2 d