Canonical testers in the dense graph model #
A tester in the dense graph model is canonical if it samples a uniformly random set of s
vertices, queries all pairs among them and accepts if and only if the induced subgraph has some
fixed graph property D Goldreich and Trevisan, §2.3. Goldreich and
Trevisan show that every one-sided tester, adaptive or not, can be converted into a canonical
one-sided tester with 2 q sample vertices and hence (2 q).choose 2 queries Goldreich and
Trevisan, Theorem 2 and Theorem 4.5. This file formalizes this one-sided
half of their theorem.
A graph property in their sense is closed under relabelling the vertices (IsInvariant); the
model's distance is then relabelling-invariant too (editDist_comap_equiv, IsFar.comap).
canonicalTester n s hs D samples a uniform permutation σ of Fin n, queries all pairs among
σ 0, …, σ (s - 1) (queryInduced) and accepts if and only if the induced labelled graph on
Fin s has property D. It makes s.choose 2 queries (isQueryBounded_canonicalTester). The
sample is the ordered prefix of a uniform permutation; when D is closed under relabelling, as in
the theorem below, this is the same as sampling a uniform s-set of vertices.
The main theorem, isOneSidedTester_canonicalTester, takes a one-sided tester T for an
invariant property P with proximity ε and query bound q. It returns the canonical tester with
min (2 q) n sample vertices and the decision property InducedOf P: the graph on the sample is
an induced subgraph of some graph with property P. That tester is one-sided for P with the same
proximity and (2 q).choose 2 queries. InducedOf P is the least decision property possible: a
canonical tester accepts every graph with property P with probability one exactly when its
decision property holds on all labelled induced subgraphs of graphs with property P
(acceptProb_canonicalTester_eq_one_iff). The proximity ε enters only through IsFar.comap, so
the theorem holds equally with Goldreich and Trevisan's normalization of the distance.
Source mapping #
The following locators refer to the journal version [GT03].
- §2.1, the definition of a graph property and Claim 2.1 (relabelling preserves distance):
IsInvariantandIsFar.comap. - §2.3, the definition of a canonical tester and Theorem 2, one-sided part:
canonicalTesterandisOneSidedTester_canonicalTester. - §4.1, Lemma 4.1, proof: the uniform relabelling
π, chosen on the fly, and the count of at most2 quncovered vertices. Goldreich and Trevisan first convertTinto a vertex-uncovering tester. We instead runTitself against the lazily sampled permutation ofCslib.RandomPermutationand argue by induction on the query bound. - §4.2.1–§4.2.2, Claims 4.2 and 4.3, one-sided parts: for a one-sided tester, the decision is a
deterministic property of the induced subgraph, closed under isomorphism. Here it is
InducedOf P. - §4.3, Theorem 4.5, one-sided case: a sample of
2 qvertices suffices.
Proof outline #
Let G be ε-far from P and relabel it by a uniform permutation π. Every relabelled copy
is ε-far (IsFar.comap), so T accepts it with probability at most 1 / 3, and so does the
average over π. Sample π lazily, one image at a time, and record the k-th vertex of G
that is uncovered at position k; these positions again follow a uniform permutation. If a run of
T rejects, the vertices of G uncovered by that run do not induce a subgraph of any graph with
property P. Otherwise one-sidedness, applied to a relabelled graph with property P that
agrees with G on the run, would force acceptance. A run uncovers at most 2 q vertices (two per
query). Hence the probability that the first 2 q positions induce a subgraph of a graph with
property P is at most the acceptance probability of T. This comparison is proved by
induction on the query bound. The canonical tester accepts exactly in this event, because a
graph with property P that agrees with G on the sample can be relabelled so that the sample
sits at its first positions.
Main definitions #
Cslib.DenseGraphTesting.IsInvariant: a property of graphs onFin nclosed under relabelling.Cslib.DenseGraphTesting.InducedOf: a graph that is an induced subgraph of some graph with a given property.Cslib.DenseGraphTesting.queryInduced: query all pairs among a sequence of vertices and return the induced labelled graph.Cslib.DenseGraphTesting.canonicalTester: sample a uniform set of vertices, query the induced subgraph and decide by a fixed property.
Main results #
Cslib.DenseGraphTesting.IsFar.comap: relabelling preserves the distance to an invariant property.Cslib.DenseGraphTesting.isInvariant_inducedOf: the decision propertyInducedOf Pis closed under relabelling.Cslib.DenseGraphTesting.acceptProb_canonicalTester: the acceptance probability of a canonical tester.Cslib.DenseGraphTesting.acceptProb_canonicalTester_eq_one_iff: a canonical tester is perfectly complete exactly when its decision property contains the induced subgraphs of the property.Cslib.DenseGraphTesting.isOneSidedTester_canonicalTester: every one-sided tester withqqueries for an invariant property yields a canonical one-sided tester with(2 q).choose 2queries.Cslib.DenseGraphTesting.OneSidedTestable.canonical: the same for a family of properties.
Limitations #
Only the one-sided half of Goldreich and Trevisan's theorem is formalized. The two-sided half
(canonical testers with O(q) sample vertices and O(q²) queries, by error reduction and their
Lemma 4.4) is not. The decision property InducedOf P depends on the number n of vertices
through P, as Goldreich and Trevisan allow (their footnote 6). Whether it can be replaced by P
itself (their §4.2.4), as for properties closed under induced subgraphs (their Proposition D.2, due
to Alon) and graph partition properties (Corollary 5.9), is not addressed. The theorems bound
queries, not running time.
References #
Graph properties and relabelling #
A property of graphs on Fin n is invariant (a graph property in the sense of Goldreich and
Trevisan) when it is closed under relabelling the vertices.
The labelled graph K on Fin s is an induced subgraph of some graph on Fin n with property
P. This is the decision property of the canonical tester.
The decision property InducedOf P is itself closed under relabelling, whatever P is.
Relabelling a graph preserves its distance to an invariant property Goldreich and Trevisan, Claim 2.1.
Querying an induced subgraph #
Extend a graph on Fin m by a last vertex adjacent to the vertices i with r i.
Query all m.choose 2 pairs among w 0, …, w (m - 1) and return the induced labelled graph on
Fin m.
queryInduced returns the induced labelled subgraph G.comap w.
Canonical testers #
The canonical tester with s sample vertices and decision property D: sample a uniform
permutation σ of Fin n, query all pairs among σ 0, …, σ (s - 1) and accept if and only if the
induced labelled graph on Fin s has property D Goldreich and Trevisan,
§2.3. When D is closed under relabelling this is the same as sampling a
uniform s-set of vertices.
A canonical tester with s sample vertices makes s.choose 2 queries.
The acceptance probability of a canonical tester is the probability that the induced subgraph
on the first s positions of a uniform permutation has the decision property.
A canonical tester accepts every graph with property P with probability one if and only if
its decision property holds on every labelled induced subgraph of a graph with property P. In
particular InducedOf P is the least decision property of a perfectly complete canonical tester
with s sample vertices.
Lazy relabelling caches #
The relabelling π is sampled lazily by Cslib.RandomPermutation.answer; a cache lists the
pairs (u, π u) uncovered so far, newest first.
Soundness #
The canonical tester theorem #
Canonical testers, the one-sided half of Goldreich and Trevisan, Theorem 2 and
Theorem 4.5. A one-sided tester for an invariant property P with
proximity ε and q queries yields the canonical tester with min (2 q) n sample vertices and
decision property InducedOf P, which is one-sided for P with the same proximity and
(2 q).choose 2 queries.
Canonical testers for a family of properties. If every P n is invariant and the family
is one-sided testable with q ε queries, then for every ε > 0 and every n the canonical tester
with min (2 q ε) n sample vertices and decision property InducedOf (P n) is a one-sided tester
for P n with (2 q ε).choose 2 queries Goldreich and Trevisan,
Theorem 2.