Chordal graphs
Lax560391.ChordalGraphs · concepts/Lax560391/ChordalGraphs.lean · lax-560391
No public endorsements yet.
Loading review…
Sign in with ORCIDNatural Language Statement
Definition
A graph is chordal if it has no induced cycle of length at least four. Empty and disconnected graphs are allowed.
Concept map
Lean source view on GitHub
| 1 | import Mathlib.Combinatorics.SimpleGraph.Basic |
| 2 | |
| 3 | /-! |
| 4 | --- |
| 5 | title: Chordal graphs |
| 6 | type: definition |
| 7 | --- |
| 8 | A graph is chordal if it has no induced cycle of length at least four. |
| 9 | Empty and disconnected graphs are allowed. |
| 10 | -/ |
| 11 | |
| 12 | namespace Lax560391.ChordalGraphs |
| 13 | |
| 14 | /-- The next vertex index, wrapping from the last index to zero. -/ |
| 15 | def cyclicSucc (n : ℕ) (hn : 0 < n) (i : Fin n) : Fin n := |
| 16 | ⟨(i.val + 1) % n, Nat.mod_lt _ hn⟩ |
| 17 | |
| 18 | /-- A chordless cycle of length at least four. -/ |
| 19 | def HasInducedLongCycle {V : Type} (G : SimpleGraph V) : Prop := |
| 20 | ∃ n : ℕ, ∃ hn : 4 ≤ n, |
| 21 | let next := cyclicSucc n (lt_of_lt_of_le (by decide : 0 < 4) hn) |
| 22 | ∃ f : Fin n ↪ V, |
| 23 | (∀ i : Fin n, G.Adj (f i) (f (next i))) ∧ |
| 24 | (∀ i j : Fin n, i ≠ j → j ≠ next i → i ≠ next j → |
| 25 | ¬ G.Adj (f i) (f j)) |
| 26 | |
| 27 | /-- No induced cycle of length at least four. -/ |
| 28 | def IsChordal {V : Type} (G : SimpleGraph V) : Prop := |
| 29 | ¬ HasInducedLongCycle G |
| 30 | |
| 31 | end Lax560391.ChordalGraphs |
| 32 |
Builds on
none
From Mathlib
Discussion
Ask a question or add context. Endorsements and structured flags are kept in the review panel above.
0 comments