@@ -3,16 +3,20 @@ Copyright (c) 2024 John Talbot and Lian Bremner Tattersall. All rights reserved.
33Released under Apache 2.0 license as described in the file LICENSE.
44Authors: John Talbot, Lian Bremner Tattersall
55-/
6+ import Mathlib.Algebra.BigOperators.Ring.Finset
7+ import Mathlib.Algebra.Order.BigOperators.Group.Finset
68import Mathlib.Combinatorics.SimpleGraph.CompleteMultipartite
9+ import Mathlib.Tactic.Linarith
10+ import Mathlib.Tactic.Ring
711/-!
812# Five-wheel like graphs
913
1014This file defines an `IsFiveWheelLike` structure in a graph, and describes properties of these
1115structures as well as graphs which avoid this structure. These have two key uses:
1216* We use them to prove that a maximally `Kᵣ₊₁`-free graph is `r`-colorable iff it is
13- complete-multipartite: `colorable_iff_isCompleteMultipartite_of_maximal_cliqueFree`
17+ complete-multipartite: `colorable_iff_isCompleteMultipartite_of_maximal_cliqueFree`.
1418* They play a key role in Brandt's proof of the Andrásfai-Erdős-Sós theorem, which is where they
15- first appeared.
19+ first appeared. We give this proof below, see `colorable_of_cliqueFree_lt_minDegree`.
1620
1721 If `G` is maximally `Kᵣ₊₂`-free and `¬ G.Adj x y` (with `x ≠ y`) then there exists an `r`-set `s`
1822 such that `s ∪ {x}` and `s ∪ {y}` are both `r + 1`-cliques.
@@ -30,7 +34,7 @@ This leads to the definition of an `IsFiveWheelLike` structure which can be foun
3034`exists_isFiveWheelLike_of_maximal_cliqueFree_not_isCompleteMultipartite`).
3135
3236One key parameter in any such structure is the number of vertices common to all of the cliques: we
33- denote this quantity by `k = #(s ∩ t)` (and we will refer to such a structure as `Wᵣ,ₖ` below.)
37+ denote this quantity by `k = #(s ∩ t)` (and we will refer to such a structure as `Wᵣ,ₖ` below.)
3438
3539The first interesting cases of such structures are `W₁,₀` and `W₂,₁`: `W₁,₀` is a 5-cycle,
3640while `W₂,₁` is a 5-cycle with an extra central hub vertex adjacent to all other vertices
@@ -61,6 +65,11 @@ Although `#(s ∩ t)` can easily be derived from `s` and `t` we include the `IsF
6165`card_inter : #(s ∩ t) = k` to match the informal / paper definitions and to simplify some
6266statements of results and match our definition of `IsFiveWheelLikeFree`.
6367
68+ The vertex set of an `IsFiveWheel` structure `Wᵣ,ₖ` is `{v, w₁, w₂} ∪ s ∪ t : Finset α`.
69+ We will need to refer to this consistently and choose the following formulation:
70+ `{v} ∪ ({w₁} ∪ ({w₂} ∪ (s ∪ t)))` which is definitionally equal to
71+ `insert v <| insert w₁ <| insert w₂ <| s ∪ t`.
72+
6473## References
6574
6675* [B. Andrasfái, P Erdős, V. T. Sós
@@ -70,12 +79,16 @@ statements of results and match our definition of `IsFiveWheelLikeFree`.
7079* [S. Brandt **On the structure of graphs with bounded clique number**
7180 https://doi.org/10.1007/s00493-003-0042-z][ brandt2003 ]
7281 -/
82+
83+ local notation "‖" x "‖" => Fintype.card x
84+
7385open Finset SimpleGraph
7486
7587variable {α : Type *} {a b c : α} {s : Finset α} {G : SimpleGraph α} {r k : ℕ}
7688
7789namespace SimpleGraph
7890
91+ section withDecEq
7992variable [DecidableEq α]
8093
8194private lemma IsNClique.insert_insert (h1 : G.IsNClique r (insert a s))
@@ -101,6 +114,7 @@ An `IsFiveWheelLike r k v w₁ w₂ s t` structure in `G` consists of vertices `
101114multipartite then `G` will contain such a structure : see
102115`exists_isFiveWheelLike_of_maximal_cliqueFree_not_isCompleteMultipartite`.)
103116-/
117+ @[grind]
104118structure IsFiveWheelLike (G : SimpleGraph α) (r k : ℕ) (v w₁ w₂ : α) (s t : Finset α) :
105119 Prop where
106120 /-- `{v, w₁, w₂}` induces the single edge `w₁w₂` -/
@@ -121,7 +135,7 @@ lemma exists_isFiveWheelLike_of_maximal_cliqueFree_not_isCompleteMultipartite
121135 obtain ⟨v, w₁, w₂, p3⟩ := exists_isPathGraph3Compl_of_not_isCompleteMultipartite hnc
122136 obtain ⟨s, h1, h2, h3, h4⟩ := exists_of_maximal_cliqueFree_not_adj h p3.ne_fst p3.not_adj_fst
123137 obtain ⟨t, h5, h6, h7, h8⟩ := exists_of_maximal_cliqueFree_not_adj h p3.ne_snd p3.not_adj_snd
124- exact ⟨_, _, _, _, _, p3, h1, h5, h2, h6, h3, h4, h7, h8, rfl⟩
138+ exact ⟨_, _, _, _, _, p3, h1, h5, h2, h6, h3, h4, h7, h8, rfl⟩
125139
126140/-- `G.FiveWheelLikeFree r k` means there is no `IsFiveWheelLike r k` structure in `G`. -/
127141def FiveWheelLikeFree (G : SimpleGraph α) (r k : ℕ) : Prop :=
@@ -137,10 +151,12 @@ include hw
137151 let ⟨p2, d1, d2, d3, d4, c1, c2, c3, c4, hk⟩ := hw
138152 ⟨p2.symm, d2, d1, d4, d3, c3, c4, c1, c2, by rwa [inter_comm]⟩
139153
154+ @[grind]
140155lemma fst_notMem_right : w₁ ∉ t :=
141156 fun h ↦ hw.isPathGraph3Compl.not_adj_fst <| hw.isNClique_right.1 (mem_insert_self ..)
142157 (mem_insert_of_mem h) hw.isPathGraph3Compl.ne_fst
143158
159+ @[grind]
144160lemma snd_notMem_left : w₂ ∉ s := hw.symm.fst_notMem_right
145161
146162/--
@@ -170,9 +186,11 @@ lemma not_colorable_succ : ¬ G.Colorable (r + 1) := by
170186 apply (C.valid _ hcx.symm).elim
171187 exact hw.isNClique_left.1 (by simp) (by simp [hx]) fun h ↦ hw.notMem_left (h ▸ hx)
172188
189+ @[grind]
173190lemma card_left : s.card = r := by
174191 simp [← Nat.succ_inj, ← hw.isNClique_left.2 , hw.notMem_left]
175192
193+ @[grind]
176194lemma card_right : t.card = r := hw.symm.card_left
177195
178196lemma card_inter_lt_of_cliqueFree (h : G.CliqueFree (r + 2 )) : k < r := by
@@ -219,4 +237,211 @@ theorem colorable_iff_isCompleteMultipartite_of_maximal_cliqueFree
219237 exists_isFiveWheelLike_of_maximal_cliqueFree_not_isCompleteMultipartite h hc
220238 exact hw.not_colorable_succ
221239
240+ end withDecEq
241+
242+ section AES
243+ variable {i j n : ℕ} {d x v w₁ w₂ : α} {s t : Finset α}
244+
245+ section Counting
246+
247+ /--
248+ Given lower bounds on non-adjacencies from `W` into `X`,`Xᶜ` we can bound the degree sum over `W`.
249+ -/
250+ private lemma sum_degree_le_of_le_not_adj [Fintype α] [DecidableEq α] [DecidableRel G.Adj]
251+ {W X : Finset α} (hx : ∀ x ∈ X, i ≤ #{z ∈ W | ¬ G.Adj x z})
252+ (hxc : ∀ y ∈ Xᶜ, j ≤ #{z ∈ W | ¬ G.Adj y z}) :
253+ ∑ w ∈ W, G.degree w ≤ #X * (#W - i) + #Xᶜ * (#W - j) := calc
254+ _ = ∑ v, #(G.neighborFinset v ∩ W) := by
255+ simp_rw [degree, card_eq_sum_ones]
256+ exact sum_comm' (by simp [and_comm, adj_comm])
257+ _ ≤ _ := by
258+ simp_rw [← union_compl X, sum_union disjoint_compl_right (s₁ := X), neighborFinset_eq_filter,
259+ filter_inter, univ_inter, card_eq_sum_ones X, card_eq_sum_ones Xᶜ, sum_mul, one_mul]
260+ gcongr <;> grind [filter_card_add_filter_neg_card_eq_card]
261+
262+ end Counting
263+
264+ namespace IsFiveWheelLike
265+
266+ variable [DecidableEq α] (hw : G.IsFiveWheelLike r k v w₁ w₂ s t) (hcf : G.CliqueFree (r + 2 ))
267+
268+ include hw hcf
269+
270+ /--
271+ If `G` is `Kᵣ₊₂`-free and contains a `Wᵣ,ₖ` together with a vertex `x` adjacent to all of its common
272+ clique vertices then there exist (not necessarily distinct) vertices `a, b, c, d`, one from each of
273+ the four `r + 1`-cliques of `Wᵣ,ₖ`, none of which are adjacent to `x`.
274+ -/
275+ private lemma exist_not_adj_of_adj_inter (hW : ∀ ⦃y⦄, y ∈ s ∩ t → G.Adj x y) :
276+ ∃ a b c d, a ∈ insert w₁ s ∧ ¬ G.Adj x a ∧ b ∈ insert w₂ t ∧ ¬ G.Adj x b ∧ c ∈ insert v s ∧
277+ ¬ G.Adj x c ∧ d ∈ insert v t ∧ ¬ G.Adj x d ∧ a ≠ b ∧ a ≠ d ∧ b ≠ c ∧ a ∉ t ∧ b ∉ s := by
278+ obtain ⟨a, ha, haj⟩ := hw.isNClique_fst_left.exists_not_adj_of_cliqueFree_succ hcf x
279+ obtain ⟨b, hb, hbj⟩ := hw.isNClique_snd_right.exists_not_adj_of_cliqueFree_succ hcf x
280+ obtain ⟨c, hc, hcj⟩ := hw.isNClique_left.exists_not_adj_of_cliqueFree_succ hcf x
281+ obtain ⟨d, hd, hdj⟩ := hw.isNClique_right.exists_not_adj_of_cliqueFree_succ hcf x
282+ exact ⟨_, _, _, _, ha, haj, hb, hbj, hc, hcj, hd, hdj, by grind⟩
283+
284+ variable [DecidableRel G.Adj]
285+
286+ /--
287+ If `G` is `Kᵣ₊₂`-free and contains a `Wᵣ,ₖ` together with a vertex `x` adjacent to all but at most
288+ two vertices of `Wᵣ,ₖ`, including all of its common clique vertices, then `G` contains a `Wᵣ,ₖ₊₁`.
289+ -/
290+ lemma exists_isFiveWheelLike_succ_of_not_adj_le_two (hW : ∀ ⦃y⦄, y ∈ s ∩ t → G.Adj x y)
291+ (h2 : #{z ∈ {v} ∪ ({w₁} ∪ ({w₂} ∪ (s ∪ t))) | ¬ G.Adj x z} ≤ 2 ) :
292+ ∃ a b, G.IsFiveWheelLike r (k + 1 ) v w₁ w₂ (insert x (s.erase a)) (insert x (t.erase b)) := by
293+ obtain ⟨a, b, c, d, ha, haj, hb, hbj, hc, hcj, hd, hdj, hab, had, hbc, hat, hbs⟩ :=
294+ hw.exist_not_adj_of_adj_inter hcf hW
295+ -- Let `W` denote the vertices of the copy of `Wᵣ,ₖ` in `G`
296+ let W := {v} ∪ ({w₁} ∪ ({w₂} ∪ (s ∪ t)))
297+ have ⟨hca, hdb⟩ : c = a ∧ d = b := by
298+ by_contra! hf
299+ apply h2.not_gt <| two_lt_card_iff.2 _
300+ by_cases h : a = c
301+ · exact ⟨a, b, d, by grind⟩
302+ · exact ⟨a, b, c, by grind⟩
303+ simp_rw [hca, hdb, mem_insert] at *
304+ have ⟨has, hbt, hav, hbv, haw, hbw⟩ : a ∈ s ∧ b ∈ t ∧ a ≠ v ∧ b ≠ v ∧ a ≠ w₂ ∧ b ≠ w₁ := by grind
305+ have ⟨hxv, hxw₁, hxw₂⟩ : v ≠ x ∧ w₁ ≠ x ∧ w₂ ≠ x := by
306+ refine ⟨?_, ?_, ?_⟩
307+ · by_cases hax : x = a <;> rintro rfl
308+ · grind
309+ · exact haj <| hw.isNClique_left.1 (mem_insert_self ..) (mem_insert_of_mem has) hax
310+ · by_cases hax : x = a <;> rintro rfl
311+ · grind
312+ · exact haj <| hw.isNClique_fst_left.1 (mem_insert_self ..) (mem_insert_of_mem has) hax
313+ · by_cases hbx : x = b <;> rintro rfl
314+ · grind
315+ · exact hbj <| hw.isNClique_snd_right.1 (mem_insert_self ..) (mem_insert_of_mem hbt) hbx
316+ -- Since `x` is not adjacent to `a` and `b` but is adjacent to all but at most two vertices
317+ -- from `W` we have `∀ w ∈ W, w ≠ a → w ≠ b → G.Adj w x`
318+ have wa : ∀ ⦃w⦄, w ∈ W → w ≠ a → w ≠ b → G.Adj w x := by
319+ intro _ hz haz hbz
320+ by_contra! hf
321+ apply h2.not_gt
322+ exact two_lt_card.2 ⟨_, by simp [has, hcj], _, by simp [hbt, hdj], _,
323+ mem_filter.2 ⟨hz, by rwa [adj_comm] at hf⟩, hab, haz.symm, hbz.symm⟩
324+ have ⟨h1s, h2t⟩ : insert w₁ s ⊆ W ∧ insert w₂ t ⊆ W := by grind
325+ -- We now check that we can build a `Wᵣ,ₖ₊₁` by inserting `x` and erasing `a` and `b`
326+ refine ⟨a, b, ⟨by grind, by grind, by grind, by grind, by grind, ?h5, ?h6, ?h7, ?h8, ?h9⟩⟩
327+ -- Check that the new cliques are indeed cliques
328+ case h5 => exact hw.isNClique_left.insert_insert_erase has hw.notMem_left fun _ hz hZ ↦
329+ wa ((insert_subset_insert _ fun _ hx ↦ (by simp [hx])) hz) hZ
330+ fun h ↦ hbv <| (mem_insert.1 (h ▸ hz)).resolve_right hbs
331+ case h6 => exact hw.isNClique_fst_left.insert_insert_erase has hw.fst_notMem fun _ hz hZ ↦
332+ wa (h1s hz) hZ fun h ↦ hbw <| (mem_insert.1 (h ▸ hz)).resolve_right hbs
333+ case h7 => exact hw.isNClique_right.insert_insert_erase hbt hw.notMem_right fun _ hz hZ ↦
334+ wa ((insert_subset_insert _ fun _ hx ↦ (by simp [hx])) hz)
335+ (fun h ↦ hav <| (mem_insert.1 (h ▸ hz)).resolve_right hat) hZ
336+ case h8 => exact hw.isNClique_snd_right.insert_insert_erase hbt hw.snd_notMem fun _ hz hZ ↦
337+ wa (h2t hz) (fun h ↦ haw <| (mem_insert.1 (h ▸ hz)).resolve_right hat) hZ
338+ case h9 =>
339+ -- Finally check that this new `IsFiveWheelLike` structure has `k + 1` common clique
340+ -- vertices i.e. `#((insert x (s.erase a)) ∩ (insert x (s.erase b))) = k + 1`.
341+ rw [← insert_inter_distrib, erase_inter, inter_erase, erase_eq_of_notMem <|
342+ notMem_mono inter_subset_left hbs, erase_eq_of_notMem <| notMem_mono inter_subset_right hat,
343+ card_insert_of_notMem (fun h ↦ G.irrefl (hW h)), hw.card_inter]
344+
345+ /--
346+ If `G` is a `Kᵣ₊₂`-free graph with `n` vertices containing a `Wᵣ,ₖ` but no `Wᵣ,ₖ₊₁`
347+ then `G.minDegree ≤ (2 * r + k) * n / (2 * r + k + 3)`
348+ -/
349+ lemma minDegree_le_of_cliqueFree_fiveWheelLikeFree_succ [Fintype α]
350+ (hm : G.FiveWheelLikeFree r (k + 1 )) : G.minDegree ≤ (2 * r + k) * ‖α‖ / (2 * r + k + 3 ) := by
351+ let X : Finset α := {x | ∀ ⦃y⦄, y ∈ s ∩ t → G.Adj x y}
352+ let W := {v} ∪ ({w₁} ∪ ({w₂} ∪ (s ∪ t)))
353+ -- Any vertex in `X` has at least 3 non-neighbors in `W` (otherwise we could build a bigger wheel)
354+ have dXle : ∀ x ∈ X, 3 ≤ #{z ∈ W | ¬ G.Adj x z} := by
355+ intro _ hx
356+ by_contra! h
357+ obtain ⟨_, _, hW⟩ := hw.exists_isFiveWheelLike_succ_of_not_adj_le_two hcf
358+ (by simpa [X] using hx) <| Nat.le_of_succ_le_succ h
359+ exact hm hW
360+ -- Since `G` is `Kᵣ₊₂`- free and contains a `Wᵣ,ₖ` every vertex is not adjacent to at least one
361+ -- wheel vertex.
362+ have one_le (x : α) : 1 ≤ #{z ∈ {v} ∪ ({w₁} ∪ ({w₂} ∪ (s ∪ t))) | ¬ G.Adj x z} :=
363+ let ⟨_, hz⟩ := hw.isNClique_fst_left.exists_not_adj_of_cliqueFree_succ hcf x
364+ card_pos.2 ⟨_, mem_filter.2 ⟨by grind, hz.2 ⟩⟩
365+ -- Since every vertex has at least one non-neighbor in `W` we now have the following upper bound
366+ -- `∑ w ∈ W, H.degree w ≤ #X * (#W - 3) + #Xᶜ * (#W - 1)`
367+ have bdW := sum_degree_le_of_le_not_adj dXle (fun y _ ↦ one_le y)
368+ -- By the definition of `X`, any `x ∈ Xᶜ` has at least one non-neighbour in `X`.
369+ have xcle : ∀ x ∈ Xᶜ, 1 ≤ #{z ∈ s ∩ t | ¬ G.Adj x z} := by
370+ intro x hx
371+ apply card_pos.2
372+ obtain ⟨_, hy⟩ : ∃ y ∈ s ∩ t, ¬ G.Adj x y := by
373+ contrapose! hx
374+ simpa [X] using hx
375+ exact ⟨_, mem_filter.2 hy⟩
376+ -- So we also have an upper bound on the degree sum over `s ∩ t`
377+ -- `∑ w ∈ s ∩ t, H.degree w ≤ #Xᶜ * (#(s ∩ t) - 1) + #X * #(s ∩ t)`
378+ have bdX := sum_degree_le_of_le_not_adj xcle (fun _ _ ↦ Nat.zero_le _)
379+ rw [compl_compl, tsub_zero, add_comm] at bdX
380+ rw [Nat.le_div_iff_mul_le <| Nat.add_pos_right _ zero_lt_three]
381+ have Wc : #W + k = 2 * r + 3 := by
382+ change #(insert _ <| insert _ <| insert _ _) + _ = _
383+ grind [card_insert_of_notMem, card_inter_add_card_union]
384+ -- The sum of the degree sum over `W` and twice the degree sum over `s ∩ t`
385+ -- is at least `G.minDegree * (#W + 2 * #(s ∩ t))` which implies the result
386+ calc
387+ _ ≤ ∑ w ∈ W, G.degree w + 2 * ∑ w ∈ s ∩ t, G.degree w := by
388+ simp_rw [add_assoc, add_comm k, ← add_assoc, ← Wc, add_assoc, ← two_mul, mul_add,
389+ ← hw.card_inter, card_eq_sum_ones, ← mul_assoc, mul_sum, mul_one, mul_comm 2 ]
390+ gcongr with i <;> exact minDegree_le_degree ..
391+ _ ≤ #X * (#W - 3 + 2 * k) + #Xᶜ * ((#W - 1 ) + 2 * (k - 1 )) := by grind
392+ _ ≤ _ := by
393+ by_cases hk : k = 0 -- so `s ∩ t = ∅` and hence `Xᶜ = ∅`
394+ · have Xu : X = univ := by
395+ rw [← hw.card_inter, card_eq_zero] at hk
396+ exact eq_univ_of_forall fun _ ↦ by simp [X, hk]
397+ subst k
398+ rw [add_zero] at Wc
399+ simp [Xu, Wc, mul_comm]
400+ have w3 : 3 ≤ #W := two_lt_card.2 ⟨_, mem_insert_self .., _, by simp [W], _, by simp [W],
401+ hw.isPathGraph3Compl.ne_fst, hw.isPathGraph3Compl.ne_snd, hw.isPathGraph3Compl.fst_ne_snd⟩
402+ have hap : #W - 1 + 2 * (k - 1 ) = #W - 3 + 2 * k := by omega
403+ rw [hap, ← add_mul, card_add_card_compl, mul_comm, two_mul, ← add_assoc]
404+ gcongr
405+ omega
406+
407+ end IsFiveWheelLike
408+
409+ variable [DecidableEq α]
410+
411+ /-- **Andrasfái-Erdős-Sós** theorem
412+
413+ If `G` is a `Kᵣ₊₁`-free graph with `n` vertices and `(3 * r - 4) * n / (3 * r - 1) < G.minDegree`
414+ then `G` is `r + 1`-colorable, e.g. if `G` is `K₃`-free and `2 * n / 5 < G.minDegree` then `G`
415+ is `2`-colorable.
416+ -/
417+ theorem colorable_of_cliqueFree_lt_minDegree [Fintype α] [DecidableRel G.Adj]
418+ (hf : G.CliqueFree (r + 1 )) (hd : (3 * r - 4 ) * ‖α‖ / (3 * r - 1 ) < G.minDegree) :
419+ G.Colorable r := by
420+ match r with
421+ | 0 | 1 => aesop
422+ | r + 2 =>
423+ -- There is an edge maximal `Kᵣ₊₃`-free supergraph `H` of `G`
424+ obtain ⟨H, hle, hmcf⟩ := @Finite.exists_le_maximal _ _ _ (fun H ↦ H.CliqueFree (r + 3 )) G hf
425+ -- If `H` is `r + 2`-colorable then so is `G`
426+ apply Colorable.mono_left hle
427+ -- Suppose, for a contradiction, that `H` is not `r + 2`-colorable
428+ by_contra! hnotcol
429+ -- so `H` is not complete-multipartite
430+ have hn : ¬ H.IsCompleteMultipartite := fun hc ↦ hnotcol <| hc.colorable_of_cliqueFree hmcf.1
431+ -- Hence `H` contains `Wᵣ₊₁,ₖ` but not `Wᵣ₊₁,ₖ₊₁`, for some `k < r + 1`
432+ obtain ⟨k, _, _, _, _, _, hw, hlt, hm⟩ :=
433+ exists_max_isFiveWheelLike_of_maximal_cliqueFree_not_isCompleteMultipartite hmcf hn
434+ classical
435+ -- But the minimum degree of `G`, and hence of `H`, is too large for it to be `Wᵣ₊₁,ₖ₊₁`-free,
436+ -- a contradiction.
437+ have hD := hw.minDegree_le_of_cliqueFree_fiveWheelLikeFree_succ hmcf.1 <| hm _ <| lt_add_one _
438+ have : (2 * (r + 1 ) + k) * ‖α‖ / (2 * (r + 1 ) + k + 3 ) ≤ (3 * r + 2 ) * ‖α‖ / (3 * r + 5 ) := by
439+ apply (Nat.le_div_iff_mul_le <| Nat.succ_pos _).2
440+ <| (mul_le_mul_iff_right₀ (_ + 2 ).succ_pos).1 _
441+ rw [← mul_assoc, mul_comm (2 * r + 2 + k + 3 ), mul_comm _ (_ * ‖α‖)]
442+ apply (Nat.mul_le_mul_right _ (Nat.div_mul_le_self ..)).trans
443+ nlinarith
444+ exact (hd.trans_le <| minDegree_le_minDegree hle).not_ge <| hD.trans <| this
445+
446+ end AES
222447end SimpleGraph
0 commit comments