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

Verbatim statement (WOWII #199, status O):

If G is a simple connected graph with n > 1 such that tree(G) - 2 ≤ κ(G), then G has a Hamiltonian path.

Source: http://cms.uhd.edu/faculty/delavinae/research/wowII/all.html#conj199

Reference: E. DeLaVina, Written on the Wall II, Conjectures of Graffiti.pc

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

WOWII Conjecture 199

For a simple connected graph G, if tree(G) - 2 ≤ κ(G), then G has a Hamiltonian path. The nontrivial vertex type encodes the source assumption $n > 1$. Here tree(G) is the number of vertices in a largest induced tree and κ(G) = vertexConnectivity G is the vertex connectivity of G.

@[category research open, AMS 5] theorem conjecture199 (G : SimpleGraph α) (h : G.Connected) (hκ : largestInducedTreeSize G - 2 ≤ vertexConnectivity G) : ∃ a b : α, ∃ p : G.Walk a b, p.IsHamiltonian := α:Type u_1inst✝²:Fintype αinst✝¹:DecidableEq αinst✝:Nontrivial αG:SimpleGraph αh:G.Connectedhκ:G.largestInducedTreeSize - 2 ≤ G.vertexConnectivity⊢ ∃ a b p, p.IsHamiltonian All goals completed! 🐙-- Sanity checks

The largestInducedTreeSize is nonneg.

@[category test, AMS 5] example (G : SimpleGraph (Fin 3)) : 0 ≤ largestInducedTreeSize G := Nat.zero_le _

The empty graph has vertex connectivity zero.

@[category test, AMS 5] theorem vertexConnectivity_empty : vertexConnectivity (⊥ : SimpleGraph (Fin 0)) = 0 := ⊢ ⊥.vertexConnectivity = 0 All goals completed! 🐙

A single vertex has vertex connectivity zero.

@[category test, AMS 5] theorem vertexConnectivity_singleton : vertexConnectivity (⊤ : SimpleGraph (Fin 1)) = 0 := ⊢ ⊤.vertexConnectivity = 0 All goals completed! 🐙

Two isolated vertices have vertex connectivity zero.

@[category test, AMS 5] theorem vertexConnectivity_disconnected : vertexConnectivity (⊥ : SimpleGraph (Fin 2)) = 0 := ⊢ ⊥.vertexConnectivity = 0 All goals completed! 🐙

The complete graph on three vertices has vertex connectivity two.

⊢ sInf {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)} = 2 ⊢ sInf {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)} ≤ 2⊢ 2 ≤ sInf {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)} ⊢ sInf {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)} ≤ 2 exact csInf_le' ⟨{0, 1}, ⊢ {0, 1}.card = 2 All goals completed! 🐙, Or.inr (⊢ {0, 1}.card = Fintype.card (Fin 3) - 1 All goals completed! 🐙)⟩ ⊢ 2 ≤ sInf {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)} ⊢ {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)}.Nonempty⊢ ∀ b ∈ {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)}, 2 ≤ b ⊢ {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)}.Nonempty exact ⟨2, {0, 1}, ⊢ {0, 1}.card = 2 All goals completed! 🐙, Or.inr (⊢ {0, 1}.card = Fintype.card (Fin 3) - 1 All goals completed! 🐙)⟩ ⊢ ∀ b ∈ {k | ∃ S, S.card = k ∧ (¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1)}, 2 ≤ b S:Finset (Fin 3)hS:¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1⊢ 2 ≤ S.card exact (S:Finset (Fin 3)hS:¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1⊢ ∀ (S : Finset (Fin 3)), ¬(induce (↑S)ᶜ ⊤).Connected ∨ S.card = Fintype.card (Fin 3) - 1 → 2 ≤ S.card All goals completed! 🐙 : ∀ S : Finset (Fin 3), (¬((⊤ : SimpleGraph (Fin 3)).induce ((S : Set (Fin 3))ᶜ)).Connected ∨ S.card = Fintype.card (Fin 3) - 1) → 2 ≤ S.card) S hSend WrittenOnTheWallII.GraphConjecture199