/- 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

@[expose] public sectionnamespace WrittenOnTheWallII.GraphConjecture189open SimpleGraphvariable {α : Type*} [Fintype α] [DecidableEq α] [Nontrivial α]

WOWII Conjecture 189 (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' (α:Type u_1inst✝³:Fintype αinst✝²:DecidableEq αinst✝¹:Nontrivial αG:SimpleGraph αinst✝:DecidableRel G.Adjh:G.Connected⊢ (Finset.image G.distEven Finset.univ).Nonempty All goals completed! 🐙) ≤ 1 + secondSmallestDegree G) : ∃ a b : α, ∃ p : G.Walk a b, p.IsHamiltonian := α:Type u_1inst✝³:Fintype αinst✝²:DecidableEq αinst✝¹:Nontrivial αG:SimpleGraph αinst✝:DecidableRel G.Adjh:G.Connectedhσ:(Finset.image G.distEven Finset.univ).max' ⋯ ≤ 1 + G.secondSmallestDegree⊢ ∃ a b p, p.IsHamiltonian All goals completed! 🐙-- 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 := α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αinst✝:Nontrivial αG:SimpleGraph (Fin 3)v:Fin 3⊢ 0 < G.distEven v α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αinst✝:Nontrivial αG:SimpleGraph (Fin 3)v:Fin 3⊢ 0 < {w | Even (G.dist v w)}.card α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αinst✝:Nontrivial αG:SimpleGraph (Fin 3)v:Fin 3⊢ {w | Even (G.dist v w)}.Nonempty exact ⟨v, Finset.mem_filter.mpr ⟨Finset.mem_univ _, ⟨0, α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αinst✝:Nontrivial αG:SimpleGraph (Fin 3)v:Fin 3⊢ G.dist v v = 0 + 0 All goals completed! 🐙⟩⟩⟩end WrittenOnTheWallII.GraphConjecture189