Zulip Chat Archive
Stream: graph theory
Topic: Andrasfai-Erdos-Sos theorem
John Talbot (Jan 28 2025 at 13:58):
@Lian Tattersall and I have formalized the Andrasfai-Erdos-Sos theorem from extremal graph theory:
If is a -clique-free graph with vertices and minimum degree then is -colorable.
We have a draft PR here: https://github.com/leanprover-community/mathlib4/pull/21127
Our current plan is to split this up into small pieces to submit, starting with minor additions to existing mathlib files.
Any comments/advice would be very helpful!
Kevin Buzzard (Jan 28 2025 at 14:19):
@Bhavik Mehta this was what you missed at LLL on Friday because you were teaching my Lean course (now referred to as "your lean course") :-)
John Talbot (Jan 30 2025 at 15:14):
The proof we are following (due to Stefan Brandt) starts by assuming the graph is maximally clique-free, and then splits into cases depending on whether or not the graph is complete-multi-partite.
This led us to introduce two new definitions:
abbrev MaxCliqueFree (G : SimpleGraph α) (r : ℕ) : Prop :=
Maximal (fun H => H.CliqueFree r) G
abbrev IsCompletePartite (G : SimpleGraph α) : Prop :=
Transitive (fun u v => ¬G.Adj u v)
Are these reasonable definitions to add to mathlib?
Mauricio Collares (Jan 30 2025 at 20:28):
I think I've only seen the first one in the proof you're formalizing, but perhaps I'm just forgetting other applications. The second one is very natural, but I'd argue the equivalence between "G is complete partite" and Transitive (fun u v => ¬G.Adj u v)
is a theorem
.
John Talbot (Jan 31 2025 at 09:51):
I'll sketch how we use the two definitions below, but if we were going to have our IsCompletePartite
definition as a theorem what definition should we be using? (The transitivity of non-adjacency seemed like the most natural definition to us.)
----- Sketch proof
The basic idea in Brandt's proof is that if is any maximally -free graph, then either is complete-partite and hence has at most parts, or contains a 5-wheel-like-subgraph (see below for definition).
Using the definition of IsCompletePartite
any non-complete partite graph must contain 3 distinct vertices such that is the only edge induced by .
Since and are not edges, the MaxCliqueFree
condition implies the existence of sets and such that are all -cliques.
The proof then considers a 5-wheel-like subgraph of , which is the subgraph induced by .
For example, if (triangle-free case) then and are disjoint 1-cliques and this subgraph is a copy of .
Mauricio Collares (Jan 31 2025 at 12:46):
John Talbot said:
I'll sketch how we use the two definitions below, but if we were going to have our
IsCompletePartite
definition as a theorem what definition should we be using? (The transitivity of non-adjacency seemed like the most natural definition to us.)
I was thinking that it would be nice to have a theorem
saying " satisfies Transitive (fun u v => ¬G.Adj u v)
iff is isomorphic to a docs#SimpleGraph.completeMultipartiteGraph". But I think that this theorem would justify using transitivity of non-adjacency as a definition, so I don't have a preference for what the actual def
should be.
Bhavik Mehta (Jan 31 2025 at 14:12):
Yes, I think so too. I would have guessed that being isomorphic to a docs#SimpleGraph.completeMultipartiteGraph is a better definition, but that could create universe issues, so your definition might be nicer here.
John Talbot (Jan 31 2025 at 14:55):
Thanks! So I've made a draft-PR with our definition but will now try to make the suggested alternative definition work for us: https://github.com/leanprover-community/mathlib4/pull/21293
Bhavik Mehta (Jan 31 2025 at 17:33):
To be clear, I think the definition in terms of transitive is the correct one, but that we should also have equivalence with the other ones
John Talbot (Feb 04 2025 at 11:00):
We now have a version of the AES proof that mainly uses facts about completeMultipartiteGraph
and has the equivalence:
lemma isCompletePartite_iff : G.IsCompletePartite ↔ ∃ (ι : Type u) (V : ι → Type u)
(_ : ∀ i, Nonempty (V i)), Nonempty (G ≃g (completeMultipartiteGraph V)) := by
So for example we have:
theorem notCliqueFree_le_card_completeMultipartiteGraph {ι : Type*} [Fintype ι] (V : ι → Type*)
[∀ i, Nonempty (V i)] (hc : n ≤ Fintype.card ι ) :
¬ (completeMultipartiteGraph V).CliqueFree n := by
theorem CompleteMultipartiteGraph.chromaticNumber {ι : Type*} [Fintype ι] (V : ι → Type*)
[∀ i, Nonempty (V i)] : (completeMultipartiteGraph V).chromaticNumber = Fintype.card ι := by
theorem CompleteMultipartiteGraph.colorable_of_cliqueFree {ι : Type*} {V : ι → Type*}
[∀ i, Nonempty (V i)] (hc : (completeMultipartiteGraph V).CliqueFree n) :
(completeMultipartiteGraph V).Colorable (n - 1) := by
https://github.com/leanprover-community/mathlib4/pull/21413
Does this look reasonable?
Lian Tattersall (Feb 22 2025 at 23:21):
Hi, @John Talbot and I formalised the Andrasfai Erdos Sos theorem:
If is a -clique-free graph with vertices and minimum degree then is -colourable.
Brandt's proof of this theorem involves constructing a supergraph of that is maximally -clique free and showing that is colourable.
To do this in LEAN we used the following lemma to prove that such a supergraph exists. It's slightly more general and replaces being ' clique free' with any predicate on graphs with the same vertex set as .
variable {V : Type*} {G : SimpleGraph V} [Fintype V]
/-- If `V` is finite and `P G` holds then there exists a maximal supergraph `H` of `G`
for which `P H` holds. --/
lemma exists_maximal_supergraph (P : SimpleGraph V → Prop) (hG : P G) :
∃ H, G ≤ H ∧ Maximal P H :=
let ⟨_ , ⟨h1, h2⟩, hm⟩ := wellFounded_gt.has_min {H | G ≤ H ∧ P H} ⟨_, ⟨le_rfl, hG⟩⟩
⟨_, ⟨h1, h2, fun _ hk hf ↦ (eq_of_ge_of_not_gt hf (hm _ ⟨h1.trans hf, hk⟩)).le⟩⟩
We were wondering if this was something that you wanted to add to mathlib or if we should have it as a private lemma.
Also we were wondering if SimpleGraph V
could be replaced with an ordered Fintype
Thanks
Peter Nelson (Feb 23 2025 at 00:11):
Does docs#Finite.exists_le_maximal give what you want?
John Talbot (Feb 23 2025 at 14:18):
Yes that is exactly what we should be using, thanks!
Last updated: May 02 2025 at 03:31 UTC