Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions LeanPool/CircularArcChoosability.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/-
Copyright (c) 2026 Ming-Chih Kao. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ming-Chih Kao
-/
module

public import LeanPool.CircularArcChoosability.ChromaticNumber

/-!
# Circular-arc graphs are chromatic-choosable

Source: arxiv:2611.20947, url:https://github.com/koolkao/tao-circular-arc-lean/tree/9caa3a4b6f3a6573e2c131ed03342c025069d401
Authors: Ming-Chih Kao
Status: verified
Main declarations: `CircularArcChoosability.isKChoosable_of_colorable`,
`CircularArcChoosability.tao_theorem_1_1`
Tags: graph-theory, list-colouring, choosability, circular-arc-graphs, combinatorial-nullstellensatz
MSC: 05C15
-/

/-!
## Mathematical overview

`CircularArcChoosability.isKChoosable_of_colorable` proves R. Tao's theorem (arXiv:2611.20947,
Theorem 1.1): a finite `k`-colourable circular-arc graph is `k`-choosable, so its list chromatic
number equals its chromatic number (the Prowse–Woodall conjecture, MathOverflow 456166).
`CircularArcChoosability.tao_theorem_1_1` restates it with arcs of `AddCircle 1`, Mathlib's
`SimpleGraph.chromaticNumber` and a list chromatic number defined from scratch.

`Coefficient` proves an equal-size case of Schauz's coefficient formula, `GraphPolynomial` the
graph-polynomial argument through Mathlib's combinatorial Nullstellensatz, `ArcExtension` the
extension of each arc to the next start of its colour class (encoded as a strict minimiser of
the forward distance), and `Main` assembles them.
-/
119 changes: 119 additions & 0 deletions LeanPool/CircularArcChoosability/ArcExtension.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
/-
Copyright (c) 2026 Ming-Chih Kao. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ming-Chih Kao
-/
module

public import Mathlib.Algebra.Order.Archimedean.Real.Basic
public import Mathlib.Basic.Finite.Defs
import Mathlib.Data.Finset.Max
import Mathlib.Data.Fintype.EquivFin

/-!
# Arc extension (Tao, arXiv:2611.20947, proof of Theorem 1.1)

Arcs on `ℝ / ℤ`: start `a v`, length `ℓ v`; `x` is on arc `v` when `fract (x - a v) ≤ ℓ v`.
A colouring `f` has disjoint arcs inside each colour class (`hdisj`).

Tao extends each arc `X_v` to the half-open arc `T_v` from its start to the next start of its
colour class (the whole circle for a singleton class). We never build `T_v` as a set: a point `x`
lies on `T_w` exactly when `w` is the strict minimiser of `fract (x - a z)` over its colour class
(`InT`), i.e. the start of `w` is the last start of its class before `x`. Then
`Q v = {w | InT w (a v)}`, and we prove:
* `inT_of_onArc`: `X_w ⊆ T_w`;
* `inT_edge`: two half-open arcs through a common point: one contains the start of the other;
* `exists_inT` and `inT_unique`: each colour class has exactly one `T_w` through each point.
-/

@[expose] public section

open Int

namespace CircularArcChoosability

/-- The forward-distance identity on the circle. -/
theorem fract_sub_eq {x a b : ℝ} (h : fract (x - b) ≤ fract (x - a)) :
fract (b - a) = fract (x - a) - fract (x - b) := by
rw [Int.fract_eq_iff]
refine ⟨by linarith, by linarith [fract_lt_one (x - a), fract_nonneg (x - b)],
⌊x - a⌋ - ⌊x - b⌋, ?_⟩
simp only [Int.fract, Int.cast_sub]
ring

/-- Adding forward distances that stay below one lap. -/
theorem fract_add_eq {x a b : ℝ} (h : fract (b - a) + fract (x - b) < 1) :
fract (x - a) = fract (b - a) + fract (x - b) := by
rw [Int.fract_eq_iff]
refine ⟨by linarith [fract_nonneg (b - a), fract_nonneg (x - b)], h,
⌊b - a⌋ + ⌊x - b⌋, ?_⟩
simp only [Int.fract, Int.cast_add]
ring

variable {V α : Type*} (a : V → ℝ) (f : V → α)

/-- `x` lies on the extended arc `T_w`: the start of `w` is strictly the last start of its colour
class before `x` (going forward around the circle). -/
def InT (w : V) (x : ℝ) : Prop :=
∀ z, f z = f w → z ≠ w → fract (x - a w) < fract (x - a z)

variable {a f}

/-- Two extended arcs through a common point: one contains the start of the other. -/
theorem inT_edge {u w : V} {x : ℝ} (hu : InT a f u x) (hw : InT a f w x) :
InT a f u (a w) ∨ InT a f w (a u) := by
-- the general case, with `w`'s start closer before `x`
have key : ∀ u w : V, InT a f u x → fract (x - a w) ≤ fract (x - a u) → InT a f u (a w) := by
intro u w hu hle z hz hzu
rw [fract_sub_eq hle]
by_contra hlt
push Not at hlt
have hsum : fract (a w - a z) + fract (x - a w) < 1 := by
linarith [fract_lt_one (x - a u)]
have := fract_add_eq hsum
linarith [hu z hz hzu]
rcases le_total (fract (x - a w)) (fract (x - a u)) with h | h
· exact Or.inl (key u w hu h)
· exact Or.inr (key w u hw h)

variable (ℓ : V → ℝ) (hℓ : ∀ v, 0 ≤ ℓ v)
(hdisj : ∀ u v, u ≠ v → f u = f v → ∀ x, ¬ (fract (x - a u) ≤ ℓ u ∧ fract (x - a v) ≤ ℓ v))
include hℓ hdisj

/-- `X_w ⊆ T_w`. -/
theorem inT_of_onArc {w : V} {x : ℝ} (hx : fract (x - a w) ≤ ℓ w) : InT a f w x := by
intro z hz hzw
by_contra hlt
push Not at hlt
have h1 := fract_sub_eq hlt
refine hdisj z w hzw hz (a z) ⟨by simpa using hℓ z, ?_⟩
rw [h1]; linarith [fract_nonneg (x - a z)]

/-- Starts inside a colour class are distinct on the circle. -/
theorem fract_ne_of_same_class {z w : V} (hz : f z = f w) (hzw : z ≠ w) (x : ℝ) :
fract (x - a z) ≠ fract (x - a w) := by
intro h
have h1 := fract_sub_eq h.le
refine hdisj z w hzw hz (a z) ⟨by simpa using hℓ z, ?_⟩
rw [h1, h, sub_self]; exact hℓ w

/-- Each nonempty colour class has a vertex whose extended arc passes through `x`. -/
theorem exists_inT [Finite V] (x : ℝ) (w₀ : V) : ∃ w, f w = f w₀ ∧ InT a f w x := by
classical
have := Fintype.ofFinite V
obtain ⟨w, hw, hmin⟩ := Finset.exists_min_image (Finset.univ.filter fun z => f z = f w₀)
(fun z => fract (x - a z)) ⟨w₀, by simp⟩
simp only [Finset.mem_filter, Finset.mem_univ, true_and] at hw hmin
refine ⟨w, hw, fun z hz hzw => lt_of_le_of_ne (hmin z (hz.trans hw)) ?_⟩
exact (fract_ne_of_same_class ℓ hℓ hdisj hz hzw x).symm

omit hℓ hdisj in
/-- At most one vertex of each colour class has its extended arc through `x`. -/
theorem inT_unique {w w' : V} {x : ℝ} (h : InT a f w x) (h' : InT a f w' x) (hf : f w = f w') :
w = w' := by
by_contra hne
have := h w' hf.symm (Ne.symm hne)
have := h' w hf hne
linarith

end CircularArcChoosability
92 changes: 92 additions & 0 deletions LeanPool/CircularArcChoosability/ChromaticNumber.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/-
Copyright (c) 2026 Ming-Chih Kao. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ming-Chih Kao
-/
module

public import LeanPool.CircularArcChoosability.Main
public import Mathlib.Topology.Instances.AddCircle.Defs

/-!
# Tao's Theorem 1.1 in the language of the paper (arXiv:2611.20947v1)

Restated from the paper's text without the project's encodings: "For every circular-arc graph
`G`, `χ(G) = χ_L(G)`." Here:
* a circular-arc graph is the intersection graph of a finite SET of nonempty closed arcs of the
circle `AddCircle (1 : ℝ)`, so distinct vertices carry distinct arcs;
* a closed arc is the image of a closed interval `[a, a + ℓ]` (`ℓ ≥ 0`) under `ℝ → ℝ / ℤ`;
* `χ` is Mathlib's `SimpleGraph.chromaticNumber`;
* `χ_L` is the least `k` for which every `k`-list assignment has a proper list colouring (lists of
naturals, colourings as plain functions).

`isKChoosable_of_colorable` allows repeated arcs (an indexed family), which is slightly more
general; the injectivity hypothesis is simply dropped when applying it.
-/

@[expose] public section

open SimpleGraph

namespace CircularArcChoosability

/-- The closed arc of `ℝ / ℤ` covered by `[a, a + ℓ]`. -/
def closedArc (a ℓ : ℝ) : Set (AddCircle (1 : ℝ)) :=
(QuotientAddGroup.mk : ℝ → AddCircle (1 : ℝ)) '' Set.Icc a (a + ℓ)

/-- `G` is the intersection graph of a (finite) SET of nonempty closed arcs: distinct vertices
carry distinct arcs, as in the paper. -/
def IsCAGraph {V : Type*} (G : SimpleGraph V) : Prop :=
∃ a ℓ : V → ℝ, (∀ v, 0 ≤ ℓ v) ∧ Function.Injective (fun v => closedArc (a v) (ℓ v)) ∧
∀ u v, u ≠ v → (G.Adj u v ↔ (closedArc (a u) (ℓ u) ∩ closedArc (a v) (ℓ v)).Nonempty)

/-- `G` is `k`-choosable (plain functions as colourings). -/
def Choosable {V : Type*} (G : SimpleGraph V) (k : ℕ) : Prop :=
∀ L : V → Finset ℕ, (∀ v, (L v).card = k) →
∃ c : V → ℕ, (∀ v, c v ∈ L v) ∧ ∀ u v, G.Adj u v → c u ≠ c v

/-- The list chromatic number. -/
noncomputable def chiL {V : Type*} (G : SimpleGraph V) : ℕ := sInf {k | Choosable G k}

theorem mem_closedArc_iff (a ℓ x : ℝ) (_hℓ : 0 ≤ ℓ) :
(x : AddCircle (1 : ℝ)) ∈ closedArc a ℓ ↔ Int.fract (x - a) ≤ ℓ := by
constructor
· rintro ⟨y, ⟨hy1, hy2⟩, hyx⟩
obtain ⟨n, hn⟩ := AddSubgroup.mem_zmultiples_iff.1 ((QuotientAddGroup.eq).1 hyx)
have hxy : x - a = (y - a) + n := by simp at hn; linarith
rw [hxy, Int.fract_add_intCast]
have h0 : (0 : ℝ) ≤ ⌊y - a⌋ := Int.cast_nonneg (Int.floor_nonneg.2 (by linarith))
unfold Int.fract; linarith
· intro h
refine ⟨a + Int.fract (x - a), ⟨by linarith [Int.fract_nonneg (x - a)], by linarith⟩, ?_⟩
rw [QuotientAddGroup.eq, AddSubgroup.mem_zmultiples_iff]
exact ⟨⌊x - a⌋, by simp only [zsmul_eq_mul, mul_one]; unfold Int.fract; ring⟩

theorem isCAGraph_iff {V : Type*} (G : SimpleGraph V) :
IsCAGraph G → IsCircularArcGraph G := by
rintro ⟨a, ℓ, hℓ, -, h⟩
refine ⟨a, ℓ, hℓ, fun u v huv => (h u v huv).trans ?_⟩
constructor
· rintro ⟨p, hu, hv⟩
obtain ⟨x, rfl⟩ := QuotientAddGroup.mk_surjective p
exact ⟨x, (mem_closedArc_iff _ _ _ (hℓ u)).1 hu, (mem_closedArc_iff _ _ _ (hℓ v)).1 hv⟩
· rintro ⟨x, hu, hv⟩
exact ⟨x, (mem_closedArc_iff _ _ _ (hℓ u)).2 hu, (mem_closedArc_iff _ _ _ (hℓ v)).2 hv⟩

/-- **Tao, Theorem 1.1.** For every (finite) circular-arc graph `G`, `χ(G) = χ_L(G)`. -/
theorem tao_theorem_1_1 {V : Type*} [Finite V] (G : SimpleGraph V) (hG : IsCAGraph G) :
G.chromaticNumber = (chiL G : ℕ∞) := by
have hCA := isCAGraph_iff G hG
have hcol : ∀ k, G.Colorable k → Choosable G k := fun k hk L hL => by
obtain ⟨C, hC⟩ := isKChoosable_of_colorable G hCA k hk L hL
exact ⟨C, hC, fun u v h => C.valid h⟩
have hch : ∀ k, Choosable G k → G.Colorable k := fun k hk => by
obtain ⟨c, hc, hp⟩ := hk (fun _ => Finset.range k) (fun _ => Finset.card_range k)
exact ⟨Coloring.mk (fun v => ⟨c v, Finset.mem_range.1 (hc v)⟩)
fun h heq => hp _ _ h (congrArg Fin.val heq)⟩
have hset : {k | Choosable G k} = {k | G.Colorable k} :=
Set.ext fun k => ⟨hch k, hcol k⟩
rw [chiL, hset, Colorable.chromaticNumber_eq_sInf (colorable_chromaticNumber_of_fintype G)]

end CircularArcChoosability

92 changes: 92 additions & 0 deletions LeanPool/CircularArcChoosability/Coefficient.lean
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
/-
Copyright (c) 2026 Ming-Chih Kao. All rights reserved.
Released under Apache 2.0 license as described in the file LICENSE.
Authors: Ming-Chih Kao
-/
module

public import Mathlib.Algebra.MvPolynomial.Degrees
public import Mathlib.Data.Fintype.BigOperators
import Mathlib.Algebra.BigOperators.Field
import Mathlib.LinearAlgebra.Lagrange

/-!
# A coefficient formula (Tao, arXiv:2611.20947, Lemma 3.1; a case of Schauz's formula)

For `k`-element sets `B v ⊆ K` and a polynomial `F` in the variables `x_v` of total degree at
most `|V| (k - 1)`, the coefficient of `∏ x_v ^ (k - 1)` in `F` is
`∑_{c ∈ ∏ B_v} F(c) / ∏_v ∏_{a ∈ B_v ∖ {c v}} (c v - a)`.
-/

@[expose] public section

open Finset MvPolynomial

namespace CircularArcChoosability

/-- The one-variable identity, from Lagrange interpolation (`Lagrange.coeff_eq_sum`). -/
theorem sum_pow_div_prod {K : Type*} [Field K] [DecidableEq K] (B : Finset K) (n : ℕ)
(hn : n < B.card) :
∑ b ∈ B, b ^ n / ∏ a ∈ B.erase b, (b - a) = if n = B.card - 1 then 1 else 0 := by
have h := Lagrange.coeff_eq_sum (s := B) (v := id) (Set.injOn_id _)
(P := Polynomial.X ^ n) (by rw [Polynomial.degree_X_pow]; exact_mod_cast hn)
simp only [Polynomial.coeff_X_pow, Polynomial.eval_pow, Polynomial.eval_X, id] at h
rw [← h]
split_ifs with h1 h2 h2 <;> first | rfl | (exfalso; omega)

/-- The constant exponent vector `v ↦ m`. -/
noncomputable def constExp (σ : Type*) [Fintype σ] (m : ℕ) : σ →₀ ℕ :=
Finsupp.equivFunOnFinite.symm fun _ => m

@[simp] theorem constExp_apply {σ : Type*} [Fintype σ] (m : ℕ) (v : σ) : constExp σ m v = m := rfl

theorem coeff_eq_sum {σ K : Type*} [Fintype σ] [DecidableEq σ] [Field K] [DecidableEq K]
(k : ℕ) (hk : 1 ≤ k) (B : σ → Finset K) (hB : ∀ v, (B v).card = k)
(F : MvPolynomial σ K) (hF : F.totalDegree ≤ Fintype.card σ * (k - 1)) :
F.coeff (constExp σ (k - 1)) =
∑ c ∈ Fintype.piFinset B, eval c F / ∏ v, ∏ a ∈ (B v).erase (c v), (c v - a) := by
set M := constExp σ (k - 1)
-- rewrite the right side monomial by monomial
have hR : ∀ c : σ → K, eval c F / ∏ v, ∏ a ∈ (B v).erase (c v), (c v - a) =
∑ N ∈ F.support, F.coeff N * ∏ v, ((c v) ^ (N v) / ∏ a ∈ (B v).erase (c v), (c v - a)) := by
intro c
rw [eval_eq', Finset.sum_div]
refine Finset.sum_congr rfl fun N _ => ?_
rw [Finset.prod_div_distrib, mul_div_assoc]
simp_rw [hR]
rw [Finset.sum_comm]
have key : ∀ N ∈ F.support,
∑ c ∈ Fintype.piFinset B,
F.coeff N * ∏ v, ((c v) ^ (N v) / ∏ a ∈ (B v).erase (c v), (c v - a)) =
if N = M then F.coeff M else 0 := by
intro N hN
rw [← Finset.mul_sum, ← Finset.prod_univ_sum (t := B)
(f := fun v b => b ^ (N v) / ∏ a ∈ (B v).erase b, (b - a))]
split_ifs with hNM
· subst hNM
rw [Finset.prod_eq_one, mul_one]
intro v _
rw [sum_pow_div_prod _ _ (by simp [M, hB]; omega)]
simp [M, hB]
· -- some exponent is below `k - 1`
have hdeg := le_totalDegree hN
rw [Finsupp.sum_fintype _ _ (fun _ => rfl)] at hdeg
obtain ⟨v, hv⟩ : ∃ v, N v < k - 1 := by
by_contra! hall
apply hNM
have hsum : ∑ v, N v = ∑ _v : σ, (k - 1) := by
apply le_antisymm
· simp only [Finset.sum_const, Finset.card_univ, smul_eq_mul]; omega
· exact Finset.sum_le_sum fun v _ => hall v
have := (Finset.sum_eq_sum_iff_of_le (fun v _ => hall v)).1 hsum.symm
ext v
simp [M, (this v (Finset.mem_univ v)).symm]
rw [Finset.prod_eq_zero (Finset.mem_univ v), mul_zero]
rw [sum_pow_div_prod _ _ (by rw [hB]; omega)]
simp [hB]; omega
rw [Finset.sum_congr rfl key, Finset.sum_ite_eq']
split_ifs with h
· rfl
· exact MvPolynomial.notMem_support_iff.1 h

end CircularArcChoosability
Loading
Loading