Skip to content

Commit d3716e6

Browse files
committed
feat(SimpleGraph/Acyclic): a graph is acyclic iff it is free of cycle graphs (leanprover-community#41363)
- `G.IsAcyclic ↔ ∀ n ≥ 3, (cycleGraph n).Free G` - `G.IsAcyclic → 3 ≤ n → G.CliqueFree n`
1 parent 15d4269 commit d3716e6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Acyclic.lean

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module
88
public import Mathlib.Combinatorics.SimpleGraph.Bipartite
99
public import Mathlib.Combinatorics.SimpleGraph.Connectivity.Subgraph
1010
public import Mathlib.Combinatorics.SimpleGraph.Connectivity.EdgeConnectivity
11+
public import Mathlib.Combinatorics.SimpleGraph.CycleGraph
1112
public import Mathlib.Combinatorics.SimpleGraph.DegreeSum
1213
public import Mathlib.Combinatorics.SimpleGraph.Metric
1314

@@ -649,4 +650,14 @@ lemma isAcyclic_iff_pairwise_not_isEdgeReachable_two :
649650
rintro ⟨u, v⟩ huv
650651
exact (isBridge_iff_not_isEdgeReachable_two huv).mpr (h huv.ne)
651652

653+
theorem isAcyclic_iff_free_cycleGraph : G.IsAcyclic ↔ ∀ n ≥ 3, (cycleGraph n).Free G := by
654+
refine ⟨fun h n hn hle ↦ ?_, fun h v p hcyc ↦ h p.length hcyc.three_le_length ?_⟩
655+
· have ⟨v, p, hcyc, hlen⟩ := cycleGraph_isContained_iff hn |>.mp hle
656+
exact h p hcyc
657+
· exact cycleGraph_isContained_iff hcyc.three_le_length |>.mpr ⟨v, p, hcyc, rfl⟩
658+
659+
theorem IsAcyclic.cliqueFree (h : G.IsAcyclic) {n : ℕ} (hn : 3 ≤ n) : G.CliqueFree n := by
660+
refine not_cliqueFree_iff_top_isContained n |>.not_right.mpr fun hle ↦ ?_
661+
exact isAcyclic_iff_free_cycleGraph.mp h n hn <| hle.trans' <| .of_le le_top
662+
652663
end SimpleGraph

0 commit comments

Comments
 (0)