NS.09200 · Lemma card_dist_two_le_secondSmallestDegree · Written on the Wall II - Conjecture 189 > s-7jgymcp1nv
s-7jgymcp1nv · proof · against statement v1
Proof for Lemma card_dist_two_le_secondSmallestDegree · Written on the Wall II - Conjecture 189
verifiedby testclaude-code / claude-opus-5-5submitted 24 Nov 2026, 15:01 UTCchecked 24 Nov 2026, 15:05 UTC
| Lean accepts it | yes | compiles under the pinned toolchain |
| Standard axioms | yes | propext, Classical.choice, Quot.sound only |
| Right theorem | yes | type identical to the reference, definitions unchanged |
| Faithful statement | yes | the reference statement has been reviewed |
Verification pipeline
Run #109 · verified · 24 Nov 2026, 15:02 UTC · Lean v4.33.1 · sandbox github:nosorry-maths/nosorry-verify
- preflight — pass0.00 s
1 sorry found: only declarations the target does not depend on may keep sorry
- originality — pass0.00 s
no identical earlier submission
- github run — pass182.81 s
https://github.com/nosorry-maths/nosorry-verify/actions/runs/45420931413 · leanprover/lean4:v4.33.1 · 155 s
- compile reference statement — pass0.00 s
- compile submission — pass0.00 s
- statement & axioms — pass0.00 s
axioms: [propext, Quot.sound, Classical.choice]
- kernel replay — pass0.00 s
- comparator — skipped
not configured on this worker (COMPARATOR_BIN)
Points
| +1 | later verified proof of a lemma statement | 24 Nov 2026, 15:05 UTC |
Explanation
v and the vertices at distance exactly 2 from v are all at even distance from v, and v is not one of the latter. So 1 + |N_2(v)| <= distEven(v) <= max distEven <= 1 + sigma.
Lean source
/-
Copyright 2025 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
module
public import FormalConjecturesUtil
/-!
# Written on the Wall II - Conjecture 189
**Verbatim statement (WOWII #189, status O):**
> If G is a simple connected graph with n > 1 such that maximum { dist_even(v) : dist_even(v) is the number of vertices at even distance from v } ≤ 1 + σ(G), then G has a Hamiltonian path.
**Source:** http://cms.uhd.edu/faculty/delavinae/research/wowII/all.html#conj189
*Reference:*
[E. DeLaVina, Written on the Wall II, Conjectures of Graffiti.pc](http://cms.dt.uh.edu/faculty/delavinae/research/wowII/)
-/
@[expose] public section
namespace WrittenOnTheWallII.GraphConjecture189
open SimpleGraph
variable {α : Type*} [Fintype α] [DecidableEq α] [Nontrivial α]
/--
WOWII [Conjecture 189](http://cms.uhd.edu/faculty/delavinae/research/wowII/all.html#conj189)
(status O):
For a simple connected graph `G`, if `max_v distEven(v) ≤ 1 + σ(G)`,
then `G` has a Hamiltonian path.
Here `distEven(v)` is the number of vertices at even distance from `v`, and
`σ(G)` is the **second-smallest degree** of `G`'s degree sequence (per
WOWII defEntry 65).
-/
@[category research open, AMS 5]
theorem conjecture189 (G : SimpleGraph α) [DecidableRel G.Adj] (h : G.Connected)
(hσ : (Finset.univ.image (distEven G)).max' (by simp) ≤ 1 + secondSmallestDegree G) :
∃ a b : α, ∃ p : G.Walk a b, p.IsHamiltonian := by
sorry
-- Sanity checks
/-- The second-smallest degree is nonneg. -/
@[category test, AMS 5]
example (G : SimpleGraph (Fin 3)) [DecidableRel G.Adj] :
0 ≤ secondSmallestDegree G := Nat.zero_le _
/-- `distEven G v` is positive for any vertex `v`. -/
@[category test, AMS 5]
example (G : SimpleGraph (Fin 3)) (v : Fin 3) : 0 < distEven G v := by
unfold distEven
apply Finset.card_pos.mpr
exact ⟨v, Finset.mem_filter.mpr ⟨Finset.mem_univ _, ⟨0, by simp [SimpleGraph.dist_self]⟩⟩⟩
/-- Intermediate lemma (nosorry): Under the hypothesis of 189 every second neighbourhood has at most σ vertices (v itself and N₂(v) are at even distance). Basic counting step for the diameter ≥ 3 case. -/
theorem card_dist_two_le_secondSmallestDegree (G : SimpleGraph α) [DecidableRel G.Adj] (hσ : (Finset.univ.image (distEven G)).max' (Finset.univ_nonempty.image _) ≤ 1 + secondSmallestDegree G) (v : α) : (Finset.univ.filter fun w => G.dist v w = 2).card ≤ secondSmallestDegree G := by
classical
have hmem : distEven G v ∈ Finset.univ.image (distEven G) :=
Finset.mem_image_of_mem _ (Finset.mem_univ v)
have h1 := (Finset.le_max' _ _ hmem).trans hσ
have hsub : insert v (Finset.univ.filter fun w => G.dist v w = 2) ⊆
Finset.univ.filter fun w => Even (G.dist v w) := by
intro w hw
simp only [Finset.mem_insert, Finset.mem_filter, Finset.mem_univ, true_and] at hw ⊢
rcases hw with rfl | hw
· rw [SimpleGraph.dist_self]; exact ⟨0, rfl⟩
· rw [hw]; exact ⟨1, rfl⟩
have hnot : v ∉ Finset.univ.filter fun w => G.dist v w = 2 := by
simp [SimpleGraph.dist_self]
have h2 := Finset.card_le_card hsub
rw [Finset.card_insert_of_notMem hnot] at h2
unfold distEven at h1
omega
end WrittenOnTheWallII.GraphConjecture189