Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Mathlib/Combinatorics/SimpleGraph/Hamiltonian.lean
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ lemma IsHamiltonian.length_eq (hp : p.IsHamiltonian) : p.length = Fintype.card
rw [← length_support, ← List.sum_toFinset_count_eq_length, Finset.sum_congr rfl fun _ _ ↦ hp _,
← card_eq_sum_ones, hp.support_toFinset, card_univ]

/-- The length of the support of a Hamiltonian path equals the number of vertices of the graph. -/
lemma IsHamiltonian.length_support (hp : p.IsHamiltonian) : p.support.length = Fintype.card α := by
have : Inhabited α := ⟨a⟩
grind [Fintype.card_ne_zero, length_support, length_eq]

end

/-- A Hamiltonian cycle is a cycle that visits every vertex once. -/
Expand Down