@@ -234,21 +234,26 @@ lemma disjiUnion_supp_toFinset_eq_supp_toFinset {G' : SimpleGraph V} (h : G ≤
234234
235235end Fintype
236236
237- lemma ConnectedComponent.odd_card_supp_iff_odd_subcomponents [Finite V] {G'}
237+ /-- The odd components are the connected components of odd cardinality. This definition excludes
238+ infinite components. -/
239+ abbrev oddComponents : Set G.ConnectedComponent := {c : G.ConnectedComponent | Odd c.supp.ncard}
240+
241+ lemma ConnectedComponent.odd_oddComponents_ncard_subset_supp [Finite V] {G'}
238242 (h : G ≤ G') (c' : ConnectedComponent G') :
239- Odd c'.supp.ncard ↔
240- Odd {c : ConnectedComponent G | c.supp ⊆ c'.supp ∧ Odd c.supp.ncard}.ncard := by
243+ Odd {c ∈ G.oddComponents | c.supp ⊆ c'.supp}.ncard ↔ Odd c'.supp.ncard := by
241244 simp_rw [← Set.Nat.card_coe_set_eq]
242245 classical
243246 cases nonempty_fintype V
244- rw [Nat.card_eq_card_toFinset, ← disjiUnion_supp_toFinset_eq_supp_toFinset h]
245- simp only [Finset.card_disjiUnion, Set.toFinset_card]
247+ rw [Nat.card_eq_card_toFinset c'.supp , ← disjiUnion_supp_toFinset_eq_supp_toFinset h]
248+ simp only [Finset.card_disjiUnion, Set.toFinset_card, Fintype.card_ofFinset ]
246249 rw [Finset.odd_sum_iff_odd_card_odd, Nat.card_eq_fintype_card, Fintype.card_ofFinset]
247- simp only [Nat.card_eq_fintype_card, Finset.filter_filter]
250+ congr! 2
251+ ext c
252+ simp only [Set.toFinset_setOf, mem_filter, mem_univ, true_and, ← Set.ncard_coe_Finset, coe_filter,
253+ mem_supp_iff, and_comm (a := _ ⊆ _)]
248254 rfl
249255
250- lemma odd_card_iff_odd_components [Finite V] : Odd (Nat.card V) ↔
251- Odd {c : ConnectedComponent G | Odd c.supp.ncard}.ncard := by
256+ lemma odd_ncard_oddComponents [Finite V] : Odd G.oddComponents.ncard ↔ Odd (Nat.card V) := by
252257 classical
253258 cases nonempty_fintype V
254259 rw [Nat.card_eq_fintype_card]
@@ -259,24 +264,22 @@ lemma odd_card_iff_odd_components [Finite V] : Odd (Nat.card V) ↔
259264 (fun x _ y _ hxy ↦ Set.disjoint_toFinset.mpr (pairwise_disjoint_supp_connectedComponent _ hxy))]
260265 simp_rw [Set.toFinset_card, ← Nat.card_eq_fintype_card, ← Finset.coe_filter_univ,
261266 Set.ncard_coe_Finset, Set.Nat.card_coe_set_eq]
262- exact (Finset.odd_sum_iff_odd_card_odd (fun x : G.ConnectedComponent ↦ x.supp.ncard))
267+ exact (Finset.odd_sum_iff_odd_card_odd (fun x : G.ConnectedComponent ↦ x.supp.ncard)).symm
263268
264- lemma ncard_odd_components_mono [Finite V] {G' : SimpleGraph V} (h : G ≤ G') :
265- {c : ConnectedComponent G' | Odd c.supp.ncard}.ncard
266- ≤ {c : ConnectedComponent G | Odd c.supp.ncard}.ncard := by
269+ lemma ncard_oddComponents_mono [Finite V] {G' : SimpleGraph V} (h : G ≤ G') :
270+ G'.oddComponents.ncard ≤ G.oddComponents.ncard := by
267271 have aux (c : G'.ConnectedComponent) (hc : Odd c.supp.ncard) :
268- {c' : G.ConnectedComponent | c'.supp ⊆ c .supp ∧ Odd c' .supp.ncard }.Nonempty := by
272+ {c' : G.ConnectedComponent | Odd c'.supp.ncard ∧ c' .supp ⊆ c .supp}.Nonempty := by
269273 refine Set.nonempty_of_ncard_ne_zero fun h' ↦ ?_
270274 simpa [-Nat.card_eq_fintype_card, -Set.coe_setOf, h']
271- using (c.odd_card_supp_iff_odd_subcomponents _ h).mp hc
272- let f : {c : ConnectedComponent G' | Odd (Nat.card c.supp)} →
273- {c : ConnectedComponent G | Odd (Nat.card c.supp)} :=
274- fun ⟨c, hc⟩ ↦ ⟨(aux c hc).choose, (aux c hc).choose_spec.2 ⟩
275+ using (c.odd_oddComponents_ncard_subset_supp _ h).2 hc
276+ let f : G'.oddComponents → G.oddComponents :=
277+ fun ⟨c, hc⟩ ↦ ⟨(aux c hc).choose, (aux c hc).choose_spec.1 ⟩
275278 refine Finite.card_le_of_injective f fun c c' fcc' ↦ ?_
276279 simp only [Subtype.mk.injEq, f] at fcc'
277280 exact Subtype.val_injective (ConnectedComponent.eq_of_common_vertex
278- ((fcc' ▸ (aux c.1 c.2 ).choose_spec.1 ) (ConnectedComponent.nonempty_supp _).some_mem)
279- ((aux c'.1 c'.2 ).choose_spec.1 (ConnectedComponent.nonempty_supp _).some_mem))
281+ ((fcc' ▸ (aux c.1 c.2 ).choose_spec.2 ) (ConnectedComponent.nonempty_supp _).some_mem)
282+ ((aux c'.1 c'.2 ).choose_spec.2 (ConnectedComponent.nonempty_supp _).some_mem))
280283
281284end WalkCounting
282285
0 commit comments