@@ -23,7 +23,6 @@ one edge, and the edges of the subgraph represent the paired vertices.
23
23
24
24
* `SimpleGraph.Subgraph.IsMatching`: `M.IsMatching` means that `M` is a matching of its
25
25
underlying graph.
26
- denoted `M.is_matching`.
27
26
28
27
* `SimpleGraph.Subgraph.IsPerfectMatching` defines when a subgraph `M` of a simple graph is a
29
28
perfect matching, denoted `M.IsPerfectMatching`.
@@ -36,7 +35,7 @@ one edge, and the edges of the subgraph represent the paired vertices.
36
35
37
36
* Tutte's Theorem
38
37
39
- * Hall's Marriage Theorem (see Combinatorics.Hall.Basic)
38
+ * Hall's Marriage Theorem (see `Mathlib. Combinatorics.Hall.Basic` )
40
39
-/
41
40
42
41
open Function
@@ -156,28 +155,28 @@ lemma even_card_of_isPerfectMatching (c : ConnectedComponent G) (hM : M.IsPerfec
156
155
lemma odd_matches_node_outside {u : Set V} {c : ConnectedComponent (Subgraph.deleteVerts ⊤ u).coe}
157
156
(hM : M.IsPerfectMatching) (codd : Odd (Nat.card c.supp)) :
158
157
∃ᵉ (w ∈ u) (v : ((⊤ : G.Subgraph).deleteVerts u).verts), M.Adj v w ∧ v ∈ c.supp := by
159
- by_contra! h
160
- have hMmatch : (M.induce c.supp).IsMatching := by
161
- intro v hv
162
- obtain ⟨w, hw⟩ := hM.1 (hM.2 v)
163
- obtain ⟨⟨v', hv'⟩, ⟨hv , rfl⟩⟩ := hv
164
- use w
165
- have hwnu : w ∉ u := fun hw' ↦ h w hw' ⟨v', hv'⟩ (hw.1 ) hv
166
- refine ⟨⟨⟨⟨v', hv'⟩, hv, rfl⟩, ?_, hw.1 ⟩, fun _ hy ↦ hw.2 _ hy.2 .2 ⟩
167
- apply ConnectedComponent.mem_coe_supp_of_adj ⟨⟨v', hv'⟩, ⟨hv, rfl⟩⟩ ⟨by trivial, hwnu⟩
168
- simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.mem_diff, Set.mem_univ, true_and,
169
- Subgraph.induce_adj, hwnu, not_false_eq_true, and_self, Subgraph.top_adj, M.adj_sub hw.1 ,
170
- and_true] at hv' ⊢
171
- trivial
172
-
173
- apply Nat.odd_iff_not_even.mp codd
174
- haveI : Fintype ↑(Subgraph.induce M (Subtype.val '' supp c)).verts := Fintype.ofFinite _
175
- have hMeven := Subgraph.IsMatching.even_card hMmatch
176
- haveI : Fintype (c.supp) := Fintype.ofFinite _
177
- simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.toFinset_image,
178
- Nat.card_eq_fintype_card, Set.toFinset_image,
179
- Finset.card_image_of_injective _ (Subtype.val_injective), Set.toFinset_card] at hMeven ⊢
180
- exact hMeven
158
+ by_contra! h
159
+ have hMmatch : (M.induce c.supp).IsMatching := by
160
+ intro v hv
161
+ obtain ⟨w, hw⟩ := hM.1 (hM.2 v)
162
+ obtain ⟨⟨v', hv'⟩, ⟨hv , rfl⟩⟩ := hv
163
+ use w
164
+ have hwnu : w ∉ u := fun hw' ↦ h w hw' ⟨v', hv'⟩ (hw.1 ) hv
165
+ refine ⟨⟨⟨⟨v', hv'⟩, hv, rfl⟩, ?_, hw.1 ⟩, fun _ hy ↦ hw.2 _ hy.2 .2 ⟩
166
+ apply ConnectedComponent.mem_coe_supp_of_adj ⟨⟨v', hv'⟩, ⟨hv, rfl⟩⟩ ⟨by trivial, hwnu⟩
167
+ simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.mem_diff, Set.mem_univ, true_and,
168
+ Subgraph.induce_adj, hwnu, not_false_eq_true, and_self, Subgraph.top_adj, M.adj_sub hw.1 ,
169
+ and_true] at hv' ⊢
170
+ trivial
171
+
172
+ apply Nat.odd_iff_not_even.mp codd
173
+ haveI : Fintype ↑(Subgraph.induce M (Subtype.val '' supp c)).verts := Fintype.ofFinite _
174
+ have hMeven := Subgraph.IsMatching.even_card hMmatch
175
+ haveI : Fintype (c.supp) := Fintype.ofFinite _
176
+ simp only [Subgraph.induce_verts, Subgraph.verts_top, Set.toFinset_image,
177
+ Nat.card_eq_fintype_card, Set.toFinset_image,
178
+ Finset.card_image_of_injective _ (Subtype.val_injective), Set.toFinset_card] at hMeven ⊢
179
+ exact hMeven
181
180
182
181
end Finite
183
182
end ConnectedComponent
0 commit comments