Skip to content

Commit cb2a7a3

Browse files
committed
extract Basic.lean stuff to separate PR
1 parent d3b8fde commit cb2a7a3

3 files changed

Lines changed: 18 additions & 27 deletions

File tree

Mathlib/Combinatorics/SimpleGraph/Basic.lean

Lines changed: 12 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -406,14 +406,6 @@ 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-
417409
@[gcongr]
418410
theorem support_mono {G G' : SimpleGraph V} (h : G ≤ G') : G.support ⊆ G'.support :=
419411
SetRel.dom_mono fun _uv huv ↦ h huv
@@ -448,10 +440,6 @@ theorem support_of_subsingleton [Subsingleton V] : G.support = ∅ :=
448440
/-- `G.neighborSet v` is the set of vertices adjacent to `v` in `G`. -/
449441
def neighborSet (v : V) : Set V := {w | G.Adj v w}
450442

451-
variable {G} in
452-
theorem nonempty_neighborSet : (G.neighborSet v).Nonempty ↔ ∃ u, G.Adj v u :=
453-
.rfl
454-
455443
instance neighborSet.memDecidable (v : V) [DecidableRel G.Adj] :
456444
DecidablePred (· ∈ G.neighborSet v) :=
457445
inferInstanceAs <| DecidablePred (Adj G v)
@@ -794,31 +782,26 @@ theorem neighborSet_compl (G : SimpleGraph V) (v : V) :
794782
ext w
795783
simp [and_comm, eq_comm]
796784

797-
variable (v) in
798-
theorem neighborSet_subset_compl : G.neighborSet v ⊆ {v}ᶜ := by
799-
simp
800-
785+
-- #38747
801786
variable (v) in
802787
theorem neighborSet_ne_univ : G.neighborSet v ≠ .univ :=
803788
Set.ne_univ_iff_exists_notMem _ |>.mpr ⟨v, G.notMem_neighborSet_self⟩
804789

805-
variable {G} in
806-
@[gcongr]
807-
theorem neighborSet_mono {G' : SimpleGraph V} (hle : G ≤ G') (v : V) :
808-
G.neighborSet v ⊆ G'.neighborSet v :=
809-
fun _ hadj ↦ hle hadj
810-
790+
-- #38747
811791
@[simp]
812792
theorem neighborSet_top : neighborSet ⊤ v = {v}ᶜ := by
813793
grind [mem_neighborSet, top_adj]
814794

795+
-- #38747
815796
@[simp]
816797
theorem neighborSet_bot : neighborSet ⊥ v = ∅ := by
817798
grind [mem_neighborSet, bot_adj]
818799

800+
-- #38747
819801
theorem eq_bot_iff_neighborSet : G = ⊥ ↔ ∀ v, G.neighborSet v = ∅ := by
820802
simp [eq_bot_iff_forall_not_adj, Set.eq_empty_iff_forall_notMem]
821803

804+
-- #38747
822805
variable {G} in
823806
theorem Adj.nontrivial (hadj : G.Adj u v) : Nontrivial V :=
824807
⟨u, v, hadj.ne⟩
@@ -860,10 +843,6 @@ theorem commonNeighbors_top_eq {v w : V} :
860843
ext u
861844
simp [commonNeighbors, eq_comm, not_or]
862845

863-
@[simp]
864-
theorem commonNeighbors_bot_eq : commonNeighbors ⊥ u v = ∅ := by
865-
simp [commonNeighbors]
866-
867846
section Incidence
868847

869848
variable [DecidableEq V]
@@ -951,26 +930,32 @@ attribute [simp] IsIsolated.neighborSet_eq_empty
951930
lemma mem_support_iff_not_isIsolated : v ∈ G.support ↔ ¬ G.IsIsolated v := by
952931
simp [mem_support, IsIsolated]
953932

933+
-- #38747
954934
theorem notMem_support_iff_isIsolated : v ∉ G.support ↔ G.IsIsolated v := by
955935
simp [mem_support_iff_not_isIsolated]
956936

937+
-- #38747
957938
variable {G} in
958939
theorem exists_adj_iff_not_isIsolated : (∃ u, G.Adj v u) ↔ ¬G.IsIsolated v := by
959940
simp [IsIsolated]
960941

942+
-- #38747
961943
@[simp]
962944
theorem IsIsolated.of_subsingleton [Subsingleton V] (G : SimpleGraph V) (v : V) :
963945
G.IsIsolated v :=
964-
fun _ hadj ↦ not_nontrivial V <| hadj.nontrivial
946+
fun _ hadj ↦ not_nontrivial V hadj.nontrivial
965947

948+
-- #38747
966949
variable {G} in
967950
theorem nontrivial_of_not_isIsolated (h : ¬G.IsIsolated v) : Nontrivial V :=
968951
exists_adj_iff_not_isIsolated.mpr h |>.elim fun _ ↦ Adj.nontrivial
969952

953+
-- #38747
970954
variable {G} in
971955
theorem Adj.not_isIsolated_left (h : G.Adj u v) : ¬G.IsIsolated u :=
972956
exists_adj_iff_not_isIsolated.mp ⟨_, h⟩
973957

958+
-- #38747
974959
variable {G} in
975960
theorem Adj.not_isIsolated_right (h : G.Adj u v) : ¬G.IsIsolated v :=
976961
h.symm.not_isIsolated_left

Mathlib/Combinatorics/SimpleGraph/Maps.lean

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,11 @@ theorem mapEdgeSet.injective (hinj : Function.Injective f) : Function.Injective
390390
repeat rw [Subtype.mk_eq_mk]
391391
apply Sym2.map.injective hinj
392392

393+
@[gcongr]
394+
theorem _root_.SimpleGraph.neighborSet_mono (hle : G₁ ≤ G₂) (v : V) :
395+
G₁.neighborSet v ⊆ G₂.neighborSet v :=
396+
subset_preimage_neighborSet v <| .ofLE hle
397+
393398
/-- Every graph homomorphism from a complete graph is injective. -/
394399
theorem injective_of_top_hom (f : (⊤ : SimpleGraph V) →g G') : Function.Injective f := by
395400
intro v w h

Mathlib/Combinatorics/SimpleGraph/StronglyRegular.lean

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ theorem bot_strongly_regular : (⊥ : SimpleGraph V).IsSRGWith (Fintype.card V)
6464
of_not_adj v w _ := by
6565
simp only [card_eq_zero, Fintype.card_ofFinset, forall_true_left, not_false_iff, bot_adj]
6666
ext
67+
-- #38747
6768
simp
6869

6970
theorem IsSRGWith.ediam_eq_two [Nontrivial V] (h : G.IsSRGWith n k ℓ μ) (ht : G ≠ ⊤) (hm : μ ≠ 0) :

0 commit comments

Comments
 (0)