File: Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean

full_name: SimpleGraph.Walk.IsHamiltonian
code: /-- A hamiltonian path is a walk `p` that visits every vertex exactly once. Note that while
this definition doesn't contain that `p` is a path, `p.isPath` gives that. -/
def IsHamiltonian (p : G.Walk a b) : Prop 
goal: Prop

full_name: SimpleGraph.Walk.IsHamiltonian.map
code: lemma IsHamiltonian.map {H : SimpleGraph β} (f : G →g H) (hf : Bijective f) (hp : p.IsHamiltonian) :
    (p.map f).IsHamiltonian 
goal: (SimpleGraph.Walk.map f p).IsHamiltonian

full_name: SimpleGraph.Walk.IsHamiltonian.mem_support
code: /-- A hamiltonian path visits every vertex. -/
@[simp] lemma IsHamiltonian.mem_support (hp : p.IsHamiltonian) (c : α) : c ∈ p.support 
goal: c ∈ p.support

full_name: SimpleGraph.Walk.IsHamiltonian.support_toFinset
code: /-- The support of a hamiltonian walk is the entire vertex set. -/
lemma IsHamiltonian.support_toFinset (hp : p.IsHamiltonian) : p.support.toFinset = Finset.univ 
goal: p.support.toFinset = Finset.univ

full_name: SimpleGraph.Walk.IsHamiltonian.length_eq
code: /-- The length of a hamiltonian path is one less than the number of vertices of the graph. -/
lemma IsHamiltonian.length_eq (hp : p.IsHamiltonian) : p.length = Fintype.card α - 1 
goal: p.length = Fintype.card α - 1

full_name: SimpleGraph.Walk.IsHamiltonian.isPath
code: /-- Hamiltonian paths are paths. -/
lemma IsHamiltonian.isPath (hp : p.IsHamiltonian) : p.IsPath 
goal: p.IsPath

full_name: SimpleGraph.Walk.IsPath.isHamiltonian_of_mem
code: /-- A path whose support contains every vertex is hamiltonian. -/
lemma IsPath.isHamiltonian_of_mem (hp : p.IsPath) (hp' : ∀ w, w ∈ p.support) :
    p.IsHamiltonian 
goal: p.IsHamiltonian

full_name: SimpleGraph.Walk.IsPath.isHamiltonian_iff
code: lemma IsPath.isHamiltonian_iff (hp : p.IsPath) : p.IsHamiltonian ↔ ∀ w, w ∈ p.support 
goal: p.IsHamiltonian ↔ ∀ (w : α), w ∈ p.support

full_name: SimpleGraph.Walk.IsHamiltonianCycle
code: /-- A hamiltonian cycle is a cycle that visits every vertex once. -/
structure IsHamiltonianCycle (p : G.Walk a a) extends p.IsCycle : Prop :=
  isHamiltonian_tail : (p.tail toIsCycle.not_nil).IsHamiltonian
goal: Prop

full_name: SimpleGraph.Walk.IsHamiltonianCycle.isHamiltonian_tail
code: /-- A hamiltonian cycle is a cycle that visits every vertex once. -/
structure IsHamiltonianCycle (p : G.Walk a a) extends p.IsCycle : Prop :=
  isHamiltonian_tail : (p.tail toIsCycle.not_nil).IsHamiltonian
goal: (p.tail ⋯).IsHamiltonian

full_name: SimpleGraph.Walk.IsHamiltonianCycle.isCycle
code: lemma IsHamiltonianCycle.isCycle (hp : p.IsHamiltonianCycle) : p.IsCycle 
goal: p.IsCycle

full_name: SimpleGraph.Walk.IsHamiltonianCycle.map
code: lemma IsHamiltonianCycle.map {H : SimpleGraph β} (f : G →g H) (hf : Bijective f)
    (hp : p.IsHamiltonianCycle) : (p.map f).IsHamiltonianCycle 
goal: (SimpleGraph.Walk.map f p).IsHamiltonianCycle

full_name: SimpleGraph.Walk.isHamiltonianCycle_isCycle_and_isHamiltonian_tail
code: lemma isHamiltonianCycle_isCycle_and_isHamiltonian_tail  :
    p.IsHamiltonianCycle ↔ ∃ h : p.IsCycle, (p.tail h.not_nil).IsHamiltonian 
goal: p.IsHamiltonianCycle ↔ ∃ (h : p.IsCycle), (p.tail ⋯).IsHamiltonian

full_name: SimpleGraph.Walk.isHamiltonianCycle_iff_isCycle_and_support_count_tail_eq_one
code: lemma isHamiltonianCycle_iff_isCycle_and_support_count_tail_eq_one :
    p.IsHamiltonianCycle ↔ p.IsCycle ∧ ∀ a, (support p).tail.count a = 1 
goal: p.IsHamiltonianCycle ↔ p.IsCycle ∧ ∀ (a_1 : α), List.count a_1 p.support.tail = 1

full_name: SimpleGraph.Walk.IsHamiltonianCycle.mem_support
code: /-- A hamiltonian cycle visits every vertex. -/
lemma IsHamiltonianCycle.mem_support (hp : p.IsHamiltonianCycle) (b : α) :
    b ∈ p.support 
goal: b ∈ p.support

full_name: SimpleGraph.Walk.IsHamiltonianCycle.length_eq
code: /-- The length of a hamiltonian cycle is the number of vertices. -/
lemma IsHamiltonianCycle.length_eq (hp : p.IsHamiltonianCycle) :
    p.length = Fintype.card α 
goal: p.length = Fintype.card α

full_name: SimpleGraph.Walk.IsHamiltonianCycle.count_support_self
code: lemma IsHamiltonianCycle.count_support_self (hp : p.IsHamiltonianCycle) :
    p.support.count a = 2 
goal: List.count a p.support = 2

full_name: SimpleGraph.Walk.IsHamiltonianCycle.support_count_of_ne
code: lemma IsHamiltonianCycle.support_count_of_ne (hp : p.IsHamiltonianCycle) (h : a ≠ b) :
    p.support.count b = 1 
goal: List.count b p.support = 1

full_name: SimpleGraph.IsHamiltonian
code: /-- A hamiltonian graph is a graph that contains a hamiltonian cycle.

By convention, the singleton graph is considered to be hamiltonian. -/
def IsHamiltonian (G : SimpleGraph α) : Prop 
goal: Prop

full_name: SimpleGraph.IsHamiltonian.mono
code: lemma IsHamiltonian.mono {H : SimpleGraph α} (hGH : G ≤ H) (hG : G.IsHamiltonian) :
    H.IsHamiltonian 
goal: H.IsHamiltonian

full_name: SimpleGraph.IsHamiltonian.connected
code: lemma IsHamiltonian.connected (hG : G.IsHamiltonian) : G.Connected 
goal: G.Connected