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
14 changes: 14 additions & 0 deletions Mathlib/Combinatorics/SimpleGraph/Paths.lean
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,20 @@ lemma IsTrail.isCycle_cycleBypass {w : G.Walk v v} (hw : w ≠ .nil) (hw' : w.Is
w.cycleBypass.IsCycle :=
(w.isCircuit_def.mpr ⟨hw', hw⟩).isCycle_cycleBypass

omit [DecidableEq V] in
/-- For every vertex that lies on some circuit there exists a shortest cycle among circuits
containing that vertex.

For circuits not fixed to a specific vertex use `exists_girth_eq_length` and
`IsCircuit.girth_le_length`. -/
theorem exists_isCycle_forall_isCircuit_length_le_length {v : V}
(h : ∃ p : G.Walk v v, p.IsCircuit) :
∃ p : G.Walk v v, p.IsCycle ∧ ∀ p' : G.Walk v v, p'.IsCircuit → p.length ≤ p'.length := by
have ⟨p, hmin⟩ := exists_minimalFor_of_wellFoundedLT IsCircuit length h
classical
refine ⟨p.cycleBypass, hmin.prop.isCycle_cycleBypass, fun p' hp' ↦ ?_⟩
grw [p.length_cycleBypass_le_length, hmin.le hp']

end Walk

/-! ### Mapping paths -/
Expand Down
Loading