Skip to content

Commit 5d6602e

Browse files
committed
feat(Combinatorics/SimpleGraph/Hamiltonian): p.getVert is surjective
1 parent bba67ba commit 5d6602e

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ end
7474
theorem isHamiltonian_iff_support_get_bijective : p.IsHamiltonian ↔ (p.support.get ·).Bijective :=
7575
p.support.get_bijective_iff.symm
7676

77+
theorem IsHamiltonian.getVert_surjective (hp : p.IsHamiltonian) : (p.getVert ·).Surjective := by
78+
intro v
79+
have ⟨n, h⟩ := List.mem_iff_get.mp <| p.support.one_le_count_iff.mp <| le_of_eq <| hp v |>.symm
80+
refine ⟨n, p.getVert_eq_support_getElem ?_ |>.trans h⟩
81+
have := p.length_support
82+
cutsat
83+
7784
/-- A Hamiltonian cycle is a cycle that visits every vertex once. -/
7885
structure IsHamiltonianCycle (p : G.Walk a a) : Prop extends p.IsCycle where
7986
isHamiltonian_tail : p.tail.IsHamiltonian

0 commit comments

Comments
 (0)