Skip to content

Commit 330cb1d

Browse files
committed
chore(SimpleGraph/Girth): namespace egirth_le_length under IsCycle
1 parent d3716e6 commit 330cb1d

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Girth.lean

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,11 @@ noncomputable def egirth (G : SimpleGraph α) : ℕ∞ :=
4040
lemma le_egirth {n : ℕ∞} : n ≤ G.egirth ↔ ∀ a (w : G.Walk a a), w.IsCycle → n ≤ w.length := by
4141
simp [egirth]
4242

43-
lemma egirth_le_length {a} {w : G.Walk a a} (h : w.IsCycle) : G.egirth ≤ w.length :=
43+
lemma Walk.IsCycle.egirth_le_length {a} {w : G.Walk a a} (h : w.IsCycle) : G.egirth ≤ w.length :=
4444
le_egirth.mp le_rfl a w h
4545

46+
@[deprecated (since := "2026-07-05")] alias egirth_le_length := Walk.IsCycle.egirth_le_length
47+
4648
lemma Walk.IsCircuit.egirth_le_length {a} {w : G.Walk a a} (hwc : w.IsCircuit) :
4749
G.egirth ≤ w.length := by
4850
classical
@@ -52,7 +54,7 @@ lemma Walk.IsCircuit.egirth_le_length {a} {w : G.Walk a a} (hwc : w.IsCircuit) :
5254
have hwlg' : w'.length < G.egirth := by
5355
grw [w.length_cycleBypass_le_length]
5456
exact hlg
55-
exact not_le_of_gt hwlg' (SimpleGraph.egirth_le_length hwc')
57+
exact not_le_of_gt hwlg' hwc'.egirth_le_length
5658

5759
@[simp]
5860
lemma egirth_eq_top : G.egirth = ⊤ ↔ G.IsAcyclic := by simp [egirth, IsAcyclic]
@@ -87,7 +89,7 @@ theorem egirth_top (h : 3 ≤ ENat.card α) : egirth (⊤ : SimpleGraph α) = 3
8789
{ edges_nodup := by aesop
8890
ne_nil := by aesop
8991
support_nodup := by aesop }
90-
grw [egirth_le_length this]
92+
grw [this.egirth_le_length]
9193
simp [hw]
9294

9395
@[gcongr only]
@@ -96,7 +98,7 @@ lemma IsContained.egirth_le (h : G ⊑ G') : G'.egirth ≤ G.egirth := by
9698
· simp [hacyc.egirth_eq_top]
9799
obtain ⟨a, w, hw, hwl⟩ := exists_egirth_eq_length.mpr hacyc
98100
rw [hwl, ← w.length_map h.some.toHom]
99-
exact egirth_le_length <| hw.map h.some.injective
101+
exact hw.map h.some.injective |>.egirth_le_length
100102

101103
@[gcongr only]
102104
lemma Iso.egirth_eq (f : G ≃g G') : G.egirth = G'.egirth :=
@@ -114,8 +116,10 @@ acyclic.
114116
noncomputable def girth (G : SimpleGraph α) : ℕ :=
115117
G.egirth.toNat
116118

117-
lemma girth_le_length {a} {w : G.Walk a a} (h : w.IsCycle) : G.girth ≤ w.length :=
118-
ENat.coe_le_coe.mp <| G.egirth.coe_toNat_le_self.trans <| egirth_le_length h
119+
lemma Walk.IsCycle.girth_le_length {a} {w : G.Walk a a} (h : w.IsCycle) : G.girth ≤ w.length :=
120+
ENat.coe_le_coe.mp <| G.egirth.coe_toNat_le_self.trans h.egirth_le_length
121+
122+
@[deprecated (since := "2026-07-05")] alias girth_le_length := Walk.IsCycle.girth_le_length
119123

120124
lemma three_le_girth (hG : ¬ G.IsAcyclic) : 3 ≤ G.girth :=
121125
ENat.toNat_le_toNat three_le_egirth <| egirth_eq_top.not.mpr hG

0 commit comments

Comments
 (0)