-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathUniversalVerts.lean
More file actions
74 lines (61 loc) · 3.29 KB
/
UniversalVerts.lean
File metadata and controls
74 lines (61 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/-
Copyright (c) 2024 Pim Otte. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Pim Otte
-/
import Mathlib.Combinatorics.SimpleGraph.Clique
import Mathlib.Combinatorics.SimpleGraph.Matching
import Mathlib.Combinatorics.SimpleGraph.Connectivity.Represents
/-!
# Universal Vertices
This file defines the set of universal vertices: those vertices that are connected
to all others. In addition, it describes results when considering connected components
of the graph where universal vertices are deleted. This particular graph plays a role
in the proof of Tutte's Theorem.
## Main definitions
* `G.universalVerts` is the set of vertices that are connected to all other vertices.
* `G.deleteUniversalVerts` is the subgraph of `G` with the universal vertices removed.
-/
assert_not_exists Field TwoSidedIdeal
namespace SimpleGraph
variable {V : Type*} {G : SimpleGraph V}
/--
The set of vertices that are connected to all other vertices.
-/
def universalVerts (G : SimpleGraph V) : Set V := {v : V | ∀ ⦃w⦄, v ≠ w → G.Adj w v}
lemma isClique_universalVerts (G : SimpleGraph V) : G.IsClique G.universalVerts :=
fun _ _ _ hy hxy ↦ hy hxy.symm
/--
The subgraph of `G` with the universal vertices removed.
-/
@[simps!]
def deleteUniversalVerts (G : SimpleGraph V) : Subgraph G :=
(⊤ : Subgraph G).deleteVerts G.universalVerts
lemma Subgraph.IsMatching.exists_of_universalVerts [Finite V] {s : Set V}
(h : Disjoint G.universalVerts s) (hc : s.ncard ≤ G.universalVerts.ncard) :
∃ t ⊆ G.universalVerts, ∃ (M : Subgraph G), M.verts = s ∪ t ∧ M.IsMatching := by
obtain ⟨t, ht⟩ := Set.exists_subset_card_eq hc
refine ⟨t, ht.1, ?_⟩
obtain ⟨f⟩ : Nonempty (s ≃ t) := by
rw [← Cardinal.eq, ← t.cast_ncard t.toFinite, ← s.cast_ncard s.toFinite, ht.2]
letI hd := Set.disjoint_of_subset_left ht.1 h
have hadj (v : s) : G.Adj v (f v) := ht.1 (f v).2 (hd.ne_of_mem (f v).2 v.2)
exact Subgraph.IsMatching.exists_of_disjoint_sets_of_equiv hd.symm f hadj
lemma disjoint_image_val_universalVerts (s : Set G.deleteUniversalVerts.verts) :
Disjoint (Subtype.val '' s) G.universalVerts := by
simpa [deleteUniversalVerts, Subgraph.deleteVerts_verts, ← Set.disjoint_compl_right_iff_subset,
Set.compl_eq_univ_diff] using Subtype.coe_image_subset _ s
/-- In this lemma we consider components after deleting universal vertices. If we take
one such component and remove both a set of representatives of odd components and a subset
of universal vertices, then an even number of vertices remain. -/
lemma even_ncard_image_val_supp_sdiff_image_val_rep_union {t : Set V}
{s : Set G.deleteUniversalVerts.verts} (K : G.deleteUniversalVerts.coe.ConnectedComponent)
(h : t ⊆ G.universalVerts)
(hrep : ConnectedComponent.Represents s G.deleteUniversalVerts.coe.oddComponents) :
Even (Subtype.val '' K.supp \ (Subtype.val '' s ∪ t)).ncard := by
simp only [← Set.diff_inter_diff, ← Set.image_diff Subtype.val_injective,
sdiff_eq_left.mpr <| Set.disjoint_of_subset_right h (disjoint_image_val_universalVerts _),
Set.inter_diff_distrib_right, Set.inter_self, Set.diff_inter_self_eq_diff,
← Set.image_inter Subtype.val_injective, Set.ncard_image_of_injective _ Subtype.val_injective,
K.even_ncard_supp_sdiff_rep hrep]
end SimpleGraph