Documentation

CslibFrontier.Logics.FirstOrder.FiniteVariable.ColorRefinement

The Immerman–Lander theorem: C² and color refinement #

On finite simple graphs, color refinement (1-dimensional Weisfeiler–Leman) started from the constant coloring fun _ => () characterizes equivalence in the two-variable counting logic C² over FirstOrder.Language.graph.

In Hella's bijective 2-pebble game, moving one pebble while the other rests on v in G and w in H asks for a bijection f : V ≃ W carrying v to w, neighbors of v to neighbors of w, and colors of the previous round to equal colors. Because SimpleGraph.refineColoring records a vertex's old color together with the multiset of old colors of its neighbors, while a bijection on V and W must also match the non-neighbors of each color, such a bijection exists (SimpleGraph.exists_equiv_adj_iff_refineColoring_eq) if and only if v and w receive the same refined color and the two graphs have the same color histogram in the previous round (compare [CFI92], Section 5, where 1-dimensional Weisfeiler–Leman explicitly records counts across every adjacency relation including non-adjacency). When no other pebble is placed, moving a pebble simply matches the vertices color by color, which is equality of the previous round's color histograms (Equiv.exists_apply_eq_iff_map_univ_eq).

Simultaneous induction over the placed-pebble set S : Set (Fin 2) therefore identifies winning positions of the (n + 1)-round bijective 2-pebble game with round-n color histograms and round-(n + 1) vertex colors (bijPebbleWins_graph_iff), with specializations to ∅, {i} and Set.univ. Note the round-index shift on sentences: the first round of the bijective game from ∅ already tests equal order (colorHistogram _ 0), while one round of neighbor counting corresponds to quantifier rank 2 (colorHistogram _ 1).

Combining the game equivalence with the Hintikka characterization of C^k on finite structures (Cslib.Logic.FO.bijPebbleWins_iff_forall_realize_iff) gives the Immerman–Lander theorem both for single vertices (forall_realize_countingFormula_singleton_le_iff, forall_realize_countingFormula_singleton_iff) and for sentences (forall_realize_countingFormula_empty_le_iff, forall_realize_countingFormula_empty_iff). By stabilization on the disjoint union (SimpleGraph.forall_colorHistogram_eq_iff and SimpleGraph.forall_refinementColoring_eq_iff), C²-equivalence across all quantifier ranks reduces to round |V| + |W| (forall_realize_countingFormula_empty_iff_card_add_card, forall_realize_countingFormula_singleton_iff_card_add_card).

Because GenFormula.Realize takes a total assignment Fin 2 → V, sentence statements quantifying over assignments are vacuous when V or W is empty; the graph-level sentence equivalences therefore assume [Nonempty V] [Nonempty W]. All results assume only [Fintype] and [LocallyFinite], with no decidable-adjacency requirement, so they apply directly to disjoint unions G ⊕g H.

Main results #

References #

Fiber bijections for one round of color refinement #

theorem SimpleGraph.exists_equiv_adj_iff_refineColoring_eq {V : Type u_1} {W : Type u_2} {β : Type u_3} [Fintype V] [Fintype W] {G : SimpleGraph V} [G.LocallyFinite] {H : SimpleGraph W} [H.LocallyFinite] {χ : V → β} {ψ : W → β} {v : V} {w : W} :
(∃ (f : V ≃ W), ∀ (c : V), (c = v ↔ f c = w) ∧ (G.Adj v c ↔ H.Adj w (f c)) ∧ χ c = ψ (f c)) ↔ G.refineColoring χ v = H.refineColoring ψ w ∧ Multiset.map χ Finset.univ.val = Multiset.map ψ Finset.univ.val

A bijection f : V ≃ W carrying v to w, neighbors of v to neighbors of w, and χ-colors to ψ-colors exists if and only if v and w receive the same refined color and χ and ψ have the same overall multiset of colors.

theorem Cslib.Logic.FO.partialIsoOn_graph_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} {m : ℕ} {S : Set (Fin m)} {a : Fin m → V} {b : Fin m → W} :
PartialIsoOn FirstOrder.Language.graph S a b ↔ ∀ i ∈ S, ∀ j ∈ S, (a i = a j ↔ b i = b j) ∧ (G.Adj (a i) (a j) ↔ H.Adj (b i) (b j))

On simple graphs, placed pebbles in S form a partial isomorphism iff equality and adjacency agree on all pairs in S.

Bijective 2-pebble game and color refinement #

theorem Cslib.Logic.FO.bijPebbleWins_graph_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] (m : ℕ) (S : Set (Fin 2)) (a : Fin 2 → V) (b : Fin 2 → W) :
BijPebbleWins FirstOrder.Language.graph m S a b ↔ PartialIsoOn FirstOrder.Language.graph S a b ∧ (∀ j ∈ S, G.refinementColoring (fun (x : V) => ()) m (a j) = H.refinementColoring (fun (x : W) => ()) m (b j)) ∧ ∀ k < m, G.colorHistogram (fun (x : V) => ()) k = H.colorHistogram (fun (x : W) => ()) k

Bijective 2-pebble game and color refinement. For every round count m and placed-pebble set S : Set (Fin 2), Duplicator wins the m-round bijective 2-pebble game on two finite simple graphs from (S, a, b) if and only if the placed pebbles form a partial isomorphism, each placed pebble has the same round-m color in G and H, and the color histograms agree in every round < m.

theorem Cslib.Logic.FO.bijPebbleWins_graph_empty_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {n : ℕ} {a : Fin 2 → V} {b : Fin 2 → W} :
BijPebbleWins FirstOrder.Language.graph (n + 1) ∅ a b ↔ G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

With no pebbles placed, Duplicator wins the (n + 1)-round bijective 2-pebble game on two finite simple graphs if and only if their round-n color histograms agree.

theorem Cslib.Logic.FO.bijPebbleWins_graph_singleton_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {n : ℕ} {i : Fin 2} {a : Fin 2 → V} {b : Fin 2 → W} :
BijPebbleWins FirstOrder.Language.graph (n + 1) {i} a b ↔ G.refinementColoring (fun (x : V) => ()) (n + 1) (a i) = H.refinementColoring (fun (x : W) => ()) (n + 1) (b i) ∧ G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

With one pebble placed at index i, Duplicator wins the (n + 1)-round bijective 2-pebble game on two finite simple graphs if and only if a i and b i have the same round-(n + 1) color and the round-n color histograms agree.

theorem Cslib.Logic.FO.bijPebbleWins_graph_univ_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {n : ℕ} {a : Fin 2 → V} {b : Fin 2 → W} :
BijPebbleWins FirstOrder.Language.graph (n + 1) Set.univ a b ↔ PartialIso FirstOrder.Language.graph a b ∧ (∀ (j : Fin 2), G.refinementColoring (fun (x : V) => ()) (n + 1) (a j) = H.refinementColoring (fun (x : W) => ()) (n + 1) (b j)) ∧ G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

With both pebbles placed, Duplicator wins the (n + 1)-round bijective 2-pebble game on two finite simple graphs if and only if (a, b) is a partial isomorphism, each pebble has the same round-(n + 1) color in G and H, and the round-n color histograms agree.

theorem Cslib.Logic.FO.bijPebbleWinsForever_graph_empty_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {a : Fin 2 → V} {b : Fin 2 → W} :
BijPebbleWinsForever FirstOrder.Language.graph ∅ a b ↔ ∀ (n : ℕ), G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

With no pebbles placed, Duplicator wins the infinite bijective 2-pebble game on two finite simple graphs if and only if their color histograms agree in every round.

theorem Cslib.Logic.FO.bijPebbleWinsForever_graph_singleton_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {i : Fin 2} {a : Fin 2 → V} {b : Fin 2 → W} :
BijPebbleWinsForever FirstOrder.Language.graph {i} a b ↔ (∀ (n : ℕ), G.refinementColoring (fun (x : V) => ()) n (a i) = H.refinementColoring (fun (x : W) => ()) n (b i)) ∧ ∀ (n : ℕ), G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

With one pebble placed at index i, Duplicator wins the infinite bijective 2-pebble game on two finite simple graphs if and only if a i and b i receive the same color in every round and the color histograms agree in every round.

The Immerman–Lander theorem (C² and color refinement) #

theorem Cslib.Logic.FO.forall_realize_countingFormula_singleton_le_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {n : ℕ} {i : Fin 2} {v : V} {w : W} :
(∀ (φ : FiniteVariable.CountingFormula FirstOrder.Language.graph 2), FiniteVariable.GenFormula.quantifierRank φ ≤ n + 1 → ↑(FiniteVariable.GenFormula.freeVars φ) ⊆ {i} → ((FiniteVariable.GenFormula.Realize φ fun (x : Fin 2) => v) ↔ FiniteVariable.GenFormula.Realize φ fun (x : Fin 2) => w)) ↔ G.refinementColoring (fun (x : V) => ()) (n + 1) v = H.refinementColoring (fun (x : W) => ()) (n + 1) w ∧ G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

Immerman–Lander theorem, bounded-rank vertex form ([IL90a]; [CFI92], Section 5, Theorem 5.2). Two vertices v of G and w of H satisfy the same C² formulas of quantifier rank at most n + 1 in the single free variable xᵢ if and only if v and w have the same round-(n + 1) color and G and H have the same round-n color histogram.

theorem Cslib.Logic.FO.forall_realize_countingFormula_singleton_iff {V : Type u_1} {W : Type u_2} {G : SimpleGraph V} {H : SimpleGraph W} [Fintype V] [Fintype W] [G.LocallyFinite] [H.LocallyFinite] {i : Fin 2} {v : V} {w : W} :
(∀ (φ : FiniteVariable.CountingFormula FirstOrder.Language.graph 2), ↑(FiniteVariable.GenFormula.freeVars φ) ⊆ {i} → ((FiniteVariable.GenFormula.Realize φ fun (x : Fin 2) => v) ↔ FiniteVariable.GenFormula.Realize φ fun (x : Fin 2) => w)) ↔ (∀ (n : ℕ), G.refinementColoring (fun (x : V) => ()) n v = H.refinementColoring (fun (x : W) => ()) n w) ∧ ∀ (n : ℕ), G.colorHistogram (fun (x : V) => ()) n = H.colorHistogram (fun (x : W) => ()) n

Immerman–Lander theorem, vertex form ([IL90a]; [CFI92], Section 5, Theorem 5.2). Two vertices v of G and w of H satisfy the same C² formulas in the single free variable xᵢ if and only if v and w receive the same color in every round of color refinement and G and H have the same color histogram in every round.

Immerman–Lander theorem, stabilized vertex form. Two vertices v of G and w of H satisfy the same C² formulas in xᵢ if and only if their colors and the graphs' color histograms agree in round |V| + |W|.

If G and H have the same round-n color histogram, then they agree on every C² sentence of quantifier rank at most n + 1 under any assignments.

Immerman–Lander theorem, bounded-rank sentence form ([IL90a]; [CFI92], Section 5, Theorem 5.2). Two nonempty finite simple graphs satisfy the same C² sentences of quantifier rank at most n + 1 if and only if their round-n color histograms agree. Nonemptiness is needed because GenFormula.Realize takes a total assignment Fin 2 → V, making universal quantification over assignments vacuous when V or W is empty.

Immerman–Lander theorem, sentence form ([IL90a]; [CFI92], Section 5, Theorem 5.2; [Imm99], Section 12.5). Two nonempty finite simple graphs satisfy the same C² sentences if and only if their color histograms agree in every round of color refinement.

Immerman–Lander theorem, stabilized sentence form. Two nonempty finite simple graphs satisfy the same C² sentences if and only if their color histograms agree in round |V| + |W|.