Two Primes Suffice for Definable Graph Canonisation
Abstract
We study inflationary fixed-point logic on finite simple graphs with unordered vertices and an ordered number sort. For a prime $r$, the quantifier $M_r$ tests whether the number of relations satisfying a formula is nonzero modulo $r$. For any distinct primes $p$ and $q$, the logic with $M_p$ and $M_q$ defines the adjacency matrix of a canonical copy on the number sort. On labelled inputs this matrix is computable in deterministic polynomial time with an oracle that tests whether the number of satisfying assignments of a Boolean circuit is nonzero modulo $p$. For each prime $p$, the logic with $M_p$ alone cannot define a canonical copy on all graphs. The primes also differ on Boolean queries. There is a single first-order formula $β(S)$ on vertex sets such that $M_q S β(S)$ is undefinable with $M_p$ alone whenever $p \ne q$. For a positive integer-valued function $g$, consider the class of all graphs $G$ with at most $g(|V(G)|)$ automorphisms. For each fixed prime $p$, the logic with $M_p$ canonises this class exactly when $g$ is bounded.