Formalisation of Caro-Wei type lower bounds for graph parameters.
The general definition is as follows: a function
Conceptually, they are the bounds that only depend on the degree distribution of the graph.
More specifically, we will only consider parameters of the form (where
where
For instance, if
First of all, here is the definition of a graph parameter:
a function that associates to every (finite) graph
structure GraphParameter where
toFun : {V : Type} → [DecidableEq V] → [Fintype V] →
SimpleGraph V → [DecidableRel G.Adj] → Finset V → Prop
invariant : ∀ {V V' : Type} [DecidableEq V] [DecidableEq V'] [Fintype V] [Fintype V']
(G : SimpleGraph V) [DecidableRel G.Adj] (G' : SimpleGraph V') [DecidableRel G'.Adj]
(φ : G.graph ≃g G'.graph) (s : Finset V), toFun G s ↔ toFun G' (s.image φ.toFun)The Lean definition provided in this module is:
def IsCaroWeiTypeLowerBound (f : ℕ → ℝ) (π : GraphParameter) :=
∀ {V : Type} [DecidableEq V] [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj],
∃ s : Finset V, π.toFun G s ∧ ∑ v, f (G.graph.degree v) ≤ #sThis structure is used instead of SimpleGraph so that SimpleGraph.degree can be used.
Recall that SimpleGraph.degree is defined by:
SimpleGraph.degree.{u} {V : Type u} (G : SimpleGraph V) (v : V) [Fintype ↑(G.neighborSet v)] : ℕAnd Fintype ↑(G.neighborSet v) can be automatically deduced by Fintype V and DecidableRel G.Adj.
Caro-Wei's theorem (1979, 1981) states that
In Lean, this theorem is formalised by (see IndepSet.lean):
namespace CaroWeiType
def IndepSet : GraphParameter where
toFun := fun G s ↦ G.graph.IsIndepSet s
invariant := sorry -- ...
-- Conceptually: noncomputable abbrev cw_bound : ℕ → ℝ := fun d ↦ (d + 1 : ℝ)⁻¹
-- but cw_bound is actually definde as `aks_bound 0` (see below)
theorem IndepSet_LowerBound_iff (f : ℕ → ℝ) :
IsCaroWeiTypeLowerBound f (GraphParameter.IndepSet) ↔ f ≤ cw_bound :=
sorry -- ...The proof in itself just consists in (1) the equivalence of
Alon-Kahn-Seymour's theorem (1987) states that if
and this bound is tight (as witnessed by by the complete graphs).
This is formalised as follows (see Degenerate.lean):
namespace SimpleGraph
abbrev IsDegenerateSet {V : Type*} [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj] (k : ℕ)
(s : Finset V) :=
∀ t ⊆ s, t ≠ ∅ → ∃ x ∈ t, {y ∈ t | G.Adj x y}.card ≤ k
namespace CaroWeiType
def DegenerateSet (k : ℕ) : GraphParameter where
toFun := fun G s ↦ G.graph.IsDegenerateSet k s
invariant := sorry -- ...
noncomputable def aks_bound (k : ℕ) (d : ℕ) : ℝ :=
min 1 ((k + 1) * (d + 1 : ℝ)⁻¹)
theorem kDegenerateSet_LowerBound_iff (f : ℕ → ℝ) :
∀ k : ℕ,
IsCaroWeiTypeLowerBound f (GraphParameter.DegenerateSet k)
↔ f ≤ aks_bound k :=
sorry -- ...Joret-Petit's theorem (2025) states that if
where
Furthermore, all those functions are tight, and no other extremal function exists.
Definiing this in Lean requires the definition of a linear forest and of a caterpillar:
variable {V : Type*} [DecidableEq V] [Fintype V] (G : SimpleGraph V) [DecidableRel G.Adj]
def InducesForest (s : Finset V) : Prop :=
G.IsDegenerateSet 1 s
def InducesLinearForest (s : Finset V) : Prop :=
G.InducesForest s ∧ ∀ x ∈ s, G.degree_in s x ≤ 2
def InducesCaterpillar (s : Finset V) : Prop :=
G.InducesLinearForest <| s \ {x ∈ s | G.degree_in s x = 1}The theorem is therefore:
def BoundedDegreeCaterpillar (k : ℕ) : GraphParameter where
toFun := fun G s ↦ G.graph.InducesCaterpillar s ∧ ∀ v ∈ s, G.graph.degree_in s v ≤ k
invariant := sorry -- ...
private noncomputable def φ (k : ℕ) (ε : ℝ) : ℕ → ℝ := by
intro d
if hd : d = 0 then exact 1
else if d = 1 then exact 1 - ε
else if 2 ≤ d ∧ d ≤ k then exact 2 / (d + 1 : ℝ)
else exact min ((k + 1) * ε) (2 / (d + 1 : ℝ))
theorem BoundedDegreeCaterpillar_LowerBound_iff (f : ℕ → ℝ) :
∀ k : ℕ, 2 ≤ k →
(IsCaroWeiTypeLowerBound f (GraphParameter.BoundedDegreeCaterpillar k)
↔ ∃ ε : ℝ, 0 ≤ ε ∧ ε ≤ 2 / ((k + 1) * (k + 2 : ℝ)) ∧ f ≤ φ k ε) :=
sorry -- ...See the LICENSE (copied from https://github.com/non-ai-licenses/non-ai-licenses/tree/main)
- Generic definition
- proof for independent sets (Caro-Wei)
- proof for
$k$ -degenerate induced subgraphs (Alon-Khhan-Seymour) - Proof for caterpillars of max degree at most
$k$ (Joret-Petit)
- Bound for induced forests of stars
- Get rid of
ℝand useℚinstead so thatnoncomputablecan be removed everywhere. (This probably will require a heavy refactor and using severaldef's all around)