Skip to content

Commit 08c4c3b

Browse files
committed
feat(Combinatorics/SimpleGraph/Basic): G.edgeSet ⊆ s.sym2 ↔ G.support ⊆ s
1 parent 4049cbf commit 08c4c3b

2 files changed

Lines changed: 19 additions & 4 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Basic.lean

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,14 @@ def support : Set V :=
406406
theorem mem_support {v : V} : v ∈ G.support ↔ ∃ w, G.Adj v w :=
407407
Iff.rfl
408408

409+
variable {G} in
410+
theorem Adj.mem_support_left (hadj : G.Adj u v) : u ∈ G.support :=
411+
G.mem_support.mpr ⟨v, hadj⟩
412+
413+
variable {G} in
414+
theorem Adj.mem_support_right (hadj : G.Adj u v) : v ∈ G.support :=
415+
hadj.symm.mem_support_left
416+
409417
@[gcongr]
410418
theorem support_mono {G G' : SimpleGraph V} (h : G ≤ G') : G.support ⊆ G'.support :=
411419
SetRel.dom_mono fun _uv huv ↦ h huv
@@ -563,6 +571,15 @@ theorem adj_iff_exists_edge {v w : V} : G.Adj v w ↔ v ≠ w ∧ ∃ e ∈ G.ed
563571
theorem adj_iff_exists_edge_coe : G.Adj a b ↔ ∃ e : G.edgeSet, e.val = s(a, b) := by
564572
simp only [mem_edgeSet, exists_prop, SetCoe.exists, exists_eq_right]
565573

574+
@[simp]
575+
theorem edgeSet_subset_sym2_iff {s : Set V} :
576+
G.edgeSet ⊆ s.sym2 ↔ G.support ⊆ s := by
577+
refine ⟨fun h u hu ↦ ?_, fun h e hadj ↦ ?_⟩
578+
· have ⟨v, huv⟩ := hu
579+
exact (Set.mk_mem_sym2_iff.mp <| h huv).left
580+
· cases e
581+
exact ⟨h hadj.mem_support_left, h hadj.mem_support_right⟩
582+
566583
variable (G G₁ G₂)
567584

568585
theorem edge_other_ne {e : Sym2 V} (he : e ∈ G.edgeSet) {v : V} (h : v ∈ e) :

Mathlib/Combinatorics/SimpleGraph/Finite.lean

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,10 +567,8 @@ variable {s : Set V} [DecidablePred (· ∈ s)] [Fintype V] {G : SimpleGraph V}
567567

568568
lemma edgeFinset_subset_sym2_of_support_subset (h : G.support ⊆ s) :
569569
G.edgeFinset ⊆ s.toFinset.sym2 := by
570-
simp_rw [subset_iff, Sym2.forall,
571-
mem_edgeFinset, mem_edgeSet, mk_mem_sym2_iff, Set.mem_toFinset]
572-
intro _ _ hadj
573-
exact ⟨h ⟨_, hadj⟩, h ⟨_, hadj.symm⟩⟩
570+
rw [← coe_subset, coe_sym2, edgeFinset, Set.coe_toFinset, Set.coe_toFinset]
571+
exact edgeSet_subset_sym2_iff.mpr h
574572

575573
instance : DecidablePred (· ∈ G.support) :=
576574
inferInstanceAs <| DecidablePred (· ∈ { v | ∃ w, G.Adj v w })

0 commit comments

Comments
 (0)