Testing properties of graphs and functions

Laszlo Lovasz, Balazs Szegedy

Introduction

Graph property testing is a very active area in computer science. In its most restricted form (and this will be our concern in this paper), it studies properties of (very large) graphs that can be tested by studying a randomly chosen induced subgraph of bounded size.

To be more precise, we have to describe what kind of error is allowed. In this paper, by graph we always mean a finite simple graph. A graph property is a class of graphs invariant under isomorphism. The edit distance of two graphs G1,G2G_{1},G_{2} on the same node set is ∣E(G1)△E(G2)∣|E(G_{1})\triangle E(G_{2})|. The edit distance of a graph GG from a graph property is the minimum number of edges we have to change (add or delete) to obtain a graph with the property. If no graph with the same number of nodes has the property, then this distance is infinite.

A graph property P\mathcal{P} is testable, if there exists another property P′\mathcal{P}^{\prime} (called a test property) satisfying the following conditions:

(a) if a graph GG has property P\mathcal{P}, then for all 1≤k≤∣V(G)∣1\leq k\leq|V(G)| at least a fraction of 2/32/3 of its kk-node induced subgraphs have property P′\mathcal{P}^{\prime}, and

(b) for every ε>0\varepsilon>0 there is a kε≥1k_{\varepsilon}\geq 1 such that if GG is a graph whose edit distance from P\mathcal{P} is at least ε∣V(G)∣2\varepsilon|V(G)|^{2}, then for all kε≤k≤∣V(G)∣k_{\varepsilon}\leq k\leq|V(G)| at most a fraction of 1/31/3 of the kk-node induced subgraphs of GG have property P′\mathcal{P}^{\prime}.

The notion of testability has other variations: we may also know the number of nodes of GG, or we can take a sample whose size is growing slowly with the size of GG, etc. The definition above is in a sense the most restrictive, and it has often been referred to with adjectives like “oblivious testing” and ”order independent testing”. Since this is the only version we consider in this paper, we simplify terminology by calling it simply “testable”.

We could strengthen this definition by requiring a fraction of 1−ε1-\varepsilon instead of 2/32/3 and a fraction of ε\varepsilon instead of 1/31/3. We could also weaken it by allowing the test property P′\mathcal{P}^{\prime} to depend on ε\varepsilon. It can be seen that neither of these modifications would change the notion of testability.

A surprisingly general sufficient condition for testability was proved by Alon and Shapira : Every hereditary graph property is testable. (A graph property is hereditary, if whenever a graph has the property, then all its induced subgraphs also have the property.) Alon, Fischer, Newman and Shapira gave a characterization of testable graph properties in terms of Szemerédi partitions (which is quite involved and we don’t quote it here). In fact, Szemerédi partitions play a central role in most results of this theory.

One of the main graph theoretic results in this paper is to give another combinatorial characterization of testable properties (Theorem 3.20). It says that a graph property is testable if and only if for every graph with the property, a sufficiently large “typical” induced subgraph is “close” to having the property.

Our main goal is, however, to treat property testing in terms of the theory of convergent (dense) graph sequences and graph limits . A sequence of graphs (Gn)(G_{n}) is convergent if the density of copies of any fixed graph FF in GnG_{n} tends to a limit. It turns out that the limit of a convergent graph sequence can be represented by a symmetric measurable function W: 2→W:~^{2}\to, and that many problems and constructions in graph theory have a simpler and cleaner formulation when extended to this limit (see for a survey).

Parameter testing (or estimation) is closely related to property testing, but is in many respects simpler. This area has a very natural treatment in the framework of graph limits . The two theories are connected by a result of Fischer and Newman , who proved that the edit distance from a testable property is a testable parameter. The analytic theory of property testing is more involved than the analytic theory of parameter testing, mainly because of the different type of error that is permitted.

Above, we used the “edit distance” of two graphs in the definition of testable properties. However, there is a different distance, called the “cut distance”, which plays a central role in graph convergence; for example, a sequence of graphs is convergent if and only if it is Cauchy in an appropriately normalized cut distance. The main technical issue in the analytic theory of property testing is the interplay between these two distances; see Section 2.5 for some auxiliary results of this nature that might be interesting on their own right.

The space of limit objects (two-variable functions) with the “cut distance” is compact, a fact which is essentially equivalent to various (weak and strong) versions of Szemerédi’s Regularity Lemma . So while we do not explicitly use the Regularity Lemma, it is implicit in the utilization of the compactness of this space.

A further surprisingly general result using the edit distance is the theorem of Alon and Stav , proving that for every hereditary property, a random graph with appropriate density is the farthest from the property in edit distance. The analytic results developed in this paper allow us to state and prove a simple analytic analogue of this fact, from which the original result follows along with generalizations. Similar analytic analogues are derived for the other above mentioned results.

Preliminaries

For two graphs FF and GG, a homomorphism from FF to GG is an adjacency preserving map V(F)→V(G)V(F)\to V(G). The number of such homomorphisms is denoted by hom(F,G){\rm hom}(F,G). We’ll almost always use the normalized version of this number,

which can be interpreted as the probability that a random map V(F)→V(G)V(F)\to V(G) is a homomorphism. We denote by ind(F,G){\rm ind}(F,G) the number of those injective homomorphisms that also preserve non-adjacency (in other words, the number of induced copies of FF in GG). The normalized version of this number is

2 Functions and graphons

A function W∈WW\in\mathcal{W} is called a stepfunction, if there is a partition S1∪⋯∪SkS_{1}\cup\dots\cup S_{k} of $intomeasurablesetssuchthatinto measurable sets such thatWisconstantoneveryproductsetis constant on every product setS_{i}\times S_{j}.Thenumber. The numberkisthenumberofstepsofis the number of steps ofW$.

Let Fk\mathcal{F}_{k} denote the set of all graphs on node set [k]={1,…,k}[k]=\{1,\dots,k\}. For W∈W0W\in\mathcal{W}_{0} and F∈FkF\in\mathcal{F}_{k}, define

Two functions W1,W2∈W0W_{1},W_{2}\in\mathcal{W}_{0} are isomorphic, in notation W1≅W2W_{1}\cong W_{2}, if t(G,W1)=t(G,W2)t(G,W_{1})=t(G,W_{2}) for every graph GG. It was proved by Borgs, Chayes and Lovász that two functions are isomorphic if and only if there is a third function U∈W0U\in\mathcal{W}_{0} and two measure preserving maps ϕ1,ϕ2: →\phi_{1},\phi_{2}:~\to such that Wi(x,y)=U(ϕi(x),ϕi(y))W_{i}(x,y)=U(\phi_{i}(x),\phi_{i}(y)) for i=1,2i=1,2 and almost all x,y∈x,y\in. An isomorphism class of functions in W0\mathcal{W}_{0} is called a graphon .

A sequence of graphs (Gn)(G_{n}) with ∣V(Gn)∣→∞|V(G_{n})|\to\infty is called convergent, if t(F,Gn)t(F,G_{n}) tends to a limit for every fixed graph FF. (This is equivalent with tind(F,Gn)t_{\rm ind}(F,G_{n}) tending to a limit for every FF.) It was proved in that for every convergent sequence of graphs (Gn)(G_{n}) there is a function W∈W0W\in\mathcal{W}_{0} such that t(F,Gn)→t(F,W)t(F,G_{n})\to t(F,W) for every graph FF. We call WW the limit of the sequence, and write Gn→WG_{n}\to W. Every function in W0\mathcal{W}_{0} arises as the limit of a convergent graph sequence. Furthermore, the limit is unique up to isomorphism.

For every graph GG, we define a function WG∈W0W_{G}\in\mathcal{W}_{0} as follows. Let V(G)={1,…,n}V(G)=\{1,\dots,n\} and consider a point (x,y)∈2(x,y)\in^{2}. Define integers ii and jj such that x∈((i−1)/n,i/n]x\in((i-1)/n,i/n] and y∈((j−1)/n,j/n]y\in((j-1)/n,j/n] (if x=0x=0 we define i=0i=0, and similarly for jj). Then we set

(informally, we consider the adjacency matrix A=(aij)A=(a_{ij}) of GG, and replace each entry aija_{ij} by a square of size (1/n)×(1/n)(1/n)\times(1/n) with the constant function aija_{ij} on this square). Note that WGW_{G} depends on the labeling of the nodes of GG (but only up to a measure preserving transformation).

3 Distances of graphs and functions

As mentioned in the introduction, our results concern the interaction of two distances between graphs, the edit distance and the cut distance. Let G1G_{1} and G2G_{2} be two graphs with a common node set VV. Instead of the edit distance mentioned in the introduction, we shall use its normalized version

(here eG1(S,T)e_{G_{1}}(S,T) denotes the number of edges of GG with one endpoint in SS and the other endpoint in TT).

We consider on W\mathcal{W} the cut norm

where the supremum is taken over all measurable subsets SS and TT. (See for several useful properties of this norm.) We will also use the standard L1L_{1} norm

This defines two metrics on W0\mathcal{W}_{0} by

For every set S⊆W0S\subseteq\mathcal{W}_{0} and every c>0c>0, we define, as usual, the balls

Clearly d□≤d1d_{\square}\leq d_{1}, and hence B1(S,c)⊆B□(S,c)B_{1}(S,c)\subseteq B_{\square}(S,c). So d□d_{\square} is continuous with respect to d1d_{1}. In general, d1d_{1} is not continuous w.r.t. d□d_{\square}, but see Theorem 3.4 for a weaker statement.

For W∈W0W\in\mathcal{W}_{0} and ϕ: →\phi:~\to, set Wϕ(x,y)=W(ϕ(x),ϕ(y))W^{\phi}(x,y)=W(\phi(x),\phi(y)). We define

where ϕ\phi ranges over all invertible measure preserving maps from toto. This is a quasimetric on W0\mathcal{W}_{0}, in which UU and WW are distance 00 if and only if they are isomorphic. The metric δ□(U,W)\delta_{\square}(U,W) is defined analogously.

The main advantage of δ□\delta_{\square} over d□d_{\square} is that the space (W,δ□)(W,\delta_{\square}) is compact, as was proved in .

We can use this distance to define yet another distance between graphs:

Note that in this definition the graphs G1G_{1} and G2G_{2} do not need to have the same number of nodes, and their distance is independent of the labeling of their nodes. If it happens that V(G1)=V(G2)V(G_{1})=V(G_{2}), then clearly

The paper contains a more explicit description of this distance, and its relation to combinatorially defined distances. One of the main conclusions is that a sequence of graphs is convergent if and only if it is Cauchy in this metric. So (W0,δ□)(\mathcal{W}_{0},\delta_{\square}) is the completion of the set of graphs with distance δ□\delta_{\square}.

We summarize some further facts about homomorphism densities and distances, mostly from . Let FF be a graph with kk nodes and mm edges. For every graph GG, we have

but for the “induced” versions we only have the following approximate equality:

Lemma 4.1 in asserts that for any two functions U,W∈W0U,W\in\mathcal{W}_{0},

This implies (via the functions WGW_{G} and WHW_{H}) a similar inequality for any two graphs GG and HH:

An analogue of inequality (2) for induced densities in functions can be proved by essentially the same argument:

Using the easy inequality (1), this implies for the induced densities in graphs that

(assuming that ∣V(G)∣,∣V(H)∣>(k2)|V(G)|,|V(H)|>\binom{k}{2}.

The following result from (Theorem 4.10) provides a converse to (2):

Let U,W∈W0U,W\in\mathcal{W}_{0} and let k>1k>1 be a positive integer. Assume that for every simple graph FF on kk nodes, we have

We conclude with a lemma showing that convergence in the cut norm has good analytic properties.

Suppose that ∥Wn−W∥□→0\|W_{n}-W\|_{\square}\to 0 as n→∞n\to\infty (W,Wn∈W0W,W_{n}\in\mathcal{W}_{0}). Then for every Z∈W0Z\in\mathcal{W}_{0}

for every measurable set S⊆2S\subseteq^{2}.

If ZZ is the indicator function of a rectangle, these conclusions follow from the definition of the ∥.∥□\|.\|_{\square} norm. Hence the conclusion follows for stepfunctions, since they are linear combinations of a finite number of indicator functions of rectangles. Then it follows for all integrable functions, since they are approximable in L1(2)L_{1}(^{2}) by stepfunctions. ∎

4 WW-random graphs

Let W∈W0W\in\mathcal{W}_{0} and let FF be a graph with kk nodes. Then for every 0<ε<10<\varepsilon<1,

The following bound on the distance of a WW-random graph from WW was proved in (Theorem 4.9(ii)):

Let U∈W0U\in\mathcal{W}_{0} and let k>1k>1 be a positive integer. Then with probability at least 1−e−k2/(2log⁡k)1-e^{-k^{2}/(2\log k)}, we have

Summing this over all graphs FF on kk nodes, we get

for all graphs FF with at most kk nodes. Theorem 2.1 implies that in this case

So if we choose k=⌊log⁡(n/2)/4⌋k=\lfloor\sqrt{\log(n/2)}/4\rfloor, then

Combining with (8), we get that with probability more than 1−1/n1-1/\sqrt{n},

For the first formula, note that for 1≤i,j≤n1\leq i,j\leq n, the probability that a pair i≠ji\not=j contributes to d1(H,G′)d_{1}(H,G^{\prime}) is

Summing over all i≠ji\not=j, and taking expectation, the equality follows. The second inequality is an easy consequence:

As a useful consequence, we obtain the following fact. The Regularity Lemma implies (see e.g. ) that functions in W0\mathcal{W}_{0} can be approximated by functions of the form WGW_{G}, so that the number of nodes of GG can be bounded uniformly if the error is measured in the cut distance. Obviously, one cannot approximate all functions by functions WGW_{G} in the L1L_{1}-norm. But for every nn there is graph on nn nodes that approximates WW so that the cut distance tends to 00 uniformly, and at the same time the approximation in the L1L_{1} norm is almost as good as possible.

Let GG be a simple graph and U∈W0U\in\mathcal{W}_{0}. Then there exists a simple graph G′G^{\prime} such that

On the other hand, Lemma 2.5 implies that with probability at least 3/43/4, we have

So with positive probability, both (7) and (8) hold. ∎

5 Relating different norms

As pointed out in the introduction, the analytic problem behind property testing is to relate the cut norm and the L1L_{1} norm. In this section, which contains our main technical tools, we study this connection. Some of the lemmas below are purely analytic in nature, and may be of interest on their own right.

Suppose that ∥Un−U∥□→0\|U_{n}-U\|_{\square}\to 0 and ∥Wn−W∥□→0\|W_{n}-W\|_{\square}\to 0 as n→∞n\to\infty (U,W,Un,Wn∈W0U,W,U_{n},W_{n}\in\mathcal{W}_{0}). Then

Let σ(x,y)=sgn(U(x,y)−W(x,u))\sigma(x,y)=\hbox{\rm sgn}(U(x,y)-W(x,u)). Then

Suppose that ∥Un−U∥□→0\|U_{n}-U\|_{\square}\to 0 and ∥Wn−W∥□→0\|W_{n}-W\|_{\square}\to 0 as n→∞n\to\infty (U,W,Un,Wn∈W0U,W,U_{n},W_{n}\in\mathcal{W}_{0}). Suppose further that UU is 0−10-1 valued. Then

Combined with Lemma 2.8, the assertion follows. ∎

Suppose that ∥Un−U∥□→0\|U_{n}-U\|_{\square}\to 0 as n→∞n\to\infty (U,Un∈W0U,U_{n}\in\mathcal{W}_{0}). Then for every W∈W0W\in\mathcal{W}_{0} there is a sequence of functions Wn∈W0W_{n}\in\mathcal{W}_{0} such that ∥Wn−W∥□→0\|W_{n}-W\|_{\square}\to 0 and

First we consider the case when U≥WU\geq W. Let

and Wn=ZUnW_{n}=ZU_{n}. Trivially Wn∈W0W_{n}\in\mathcal{W}_{0}, W=ZUW=ZU, and

(using Lemma 2.2 again). Combining this with Lemma 2.8 we get that ∥Un−Wn∥1→∥U−W∥1\|U_{n}-W_{n}\|_{1}\to\|U-W\|_{1}.

The case when U≤WU\leq W follows by a similar argument, replacing U,W,…U,W,\dots by 1−U,1−W,…1-U,1-W,\dots.

Finally, in the general case, consider the function V=max⁡(U,W)V=\max(U,W). Then clearly ∥U−V∥1+∥V−W∥1=∥U−W∥1\|U-V\|_{1}+\|V-W\|_{1}=\|U-W\|_{1}. Since U≤VU\leq V, there exists a sequence (Vn)(V_{n}) of functions such that ∥Vn−V∥□→0\|V_{n}-V\|_{\square}\to 0 and ∥Vn−Un∥1→∥V−U∥1\|V_{n}-U_{n}\|_{1}\to\|V-U\|_{1}. Since V≥WV\geq W, there is a sequence (Wn)(W_{n}) of functions such that ∥Wn−W∥□→0\|W_{n}-W\|_{\square}\to 0 and ∥Wn−Vn∥1→∥W−V∥1\|W_{n}-V_{n}\|_{1}\to\|W-V\|_{1}. Hence

Using Lemma 2.8 again, the lemma follows. ∎

A fact similar to Lemma 2.8 holds for the distances δ1\delta_{1} and δ□\delta_{\square} replacing the norms ∥.∥1\|.\|_{1} and ∥.∥□\|.\|_{\square}. This does not seem to follow directly from Lemma 2.8, and the proof is more involved.

Suppose that δ□(Un,U)→0\delta_{\square}(U_{n},U)\to 0 and δ□(Wn,W)→0\delta_{\square}(W_{n},W)\to 0 as n→∞n\to\infty (U,W,Un,Wn∈W0)(U,W,U_{n},W_{n}\in\mathcal{W}_{0}). Then

Let dd denote the lim inf on the left hand side of (9). Let ε\varepsilon be an arbitrary positive number. There is a number kk (depending on UU, WW and ε\varepsilon), a partition =∪i=1kSi=\cup_{i=1}^{k}S_{i} of the unit interval into kk measurable pieces and two functions W′,U′∈W0W^{\prime},U^{\prime}\in\mathcal{W}_{0} such that both W′W^{\prime} and U′U^{\prime} are constant on every rectangle Si×SjS_{i}\times S_{j} and furthermore that ∥W−W′∥1, ∥U−U′∥1≤ε\|W-W^{\prime}\|_{1},~\|U-U^{\prime}\|_{1}\leq\varepsilon. Let nn be a natural number such that ∥Wn−W∥□ , ∥Un−U∥□≤ε/k4\|W_{n}-W\|_{\square}~,~\|U_{n}-U\|_{\square}\leq\varepsilon/k^{4} and δ1(Wn,Un)≤d+ε\delta_{1}(W_{n},U_{n})\leq d+\varepsilon. There are measure preserving transformations ρ,π:↦\rho,\pi:\mapsto such that ∥Wnρ−Unπ∥1≤d+2ε\|W_{n}^{\rho}-U_{n}^{\pi}\|_{1}\leq d+2\varepsilon. Let Si,jS_{i,j} denote the set Siρ∩SjπS_{i}^{\rho}\cap S_{j}^{\pi} for every 1≤i,j≤k1\leq i,j\leq k. It is clear that Si,jS_{i,j} is a partition of the unit interval and that both W′ρ{W^{\prime}}^{\rho} and U′π{U^{\prime}}^{\pi} are constant on each rectangle Si1,j1×Si2,j2S_{i_{1},j_{1}}\times S_{i_{2},j_{2}}. We have that

Writing Wρ−Uπ=(Wρ−W′ρ)+(W′ρ−U′π)+(U′π−Uπ)W^{\rho}-U^{\pi}=(W^{\rho}-{W^{\prime}}^{\rho})+({W^{\prime}}^{\rho}-U^{\prime\pi})+(U^{\prime\pi}-U^{\pi}) we obtain that

Using that both W′ρ{W^{\prime}}^{\rho} and U′π{U^{\prime}}^{\pi} are constant on the sets Si1,j1×Si2,j2S_{i_{1},j_{1}}\times S_{i_{2},j_{2}} we obtain that the right side of the above inequality is equal to ∥W′ρ−U′π∥1−2ε\|{W^{\prime}}^{\rho}-{U^{\prime}}^{\pi}\|_{1}-2\varepsilon. Consequently

Using that ∥Wρ−W′ρ∥1, ∥Uπ−U′π∥1≤ε\|W^{\rho}-{W^{\prime}}^{\rho}\|_{1},~\|U^{\pi}-{U^{\prime}}^{\pi}\|_{1}\leq\varepsilon we get that

Since ε>0\varepsilon>0 is arbitrary, (9) follows. ∎

Main results

We define a notion of testability for properties of functions in W0\mathcal{W}_{0} and for graphons. Formally, a function property is a subset R⊆W0\mathcal{R}\subseteq\mathcal{W}_{0}; a graphon property is a function property that is invariant under isomorphism. A function property is closed if it is closed in the ∥.∥□\|.\|_{\square} norm.

The function property of being 0-1 valued is a graphon property by the characterization of isomorphism, but it is not closed, since for a sequence of random graphs GnG_{n} with edge probability 1/21/2, the functions WGnW_{G_{n}} are 0-1 valued, but their limit in the ∥.∥□\|.\|_{\square} norm, namely the identically 1/21/2 function, is not.

A function property R\mathcal{R} is testable if there is a graph property R′\mathcal{R}^{\prime} (called a test property for R\mathcal{R}) such that

Similarly as for graph properties, the constants 1/31/3 and 2/32/3 are arbitrary, but it would not change the property if we replaced them by any two real numbers 0<a<b<10<a<b<1:

Let 0<a<b<10<a<b<1. A graphon property R\mathcal{R} is testable if and only if there is a graph property R′′\mathcal{R}^{\prime\prime} such that for every ε>0\varepsilon>0 there is a constant k(ε)k(\varepsilon) such that for every function W∈W0W\in\mathcal{W}_{0} and k≥k(ε)k\geq k(\varepsilon),

Suppose that R\mathcal{R} is testable, and let R′\mathcal{R}^{\prime} be the graph property in the definition of testability. For every simple graph FF and k≤∣V(F)∣k\leq|V(F)|, define

Let W∈RW\in\mathcal{R} and let n>kn>k be large enough. Then

Choosing nn large enough, this probability will be less than 1−b1-b, and hence

So (a) is satisfied. The proof of (b) is analogous, and so is the proof of the converse. ∎

It follows from the definition that a graphon property is testable if and only if its closure in the ∥.∥1\|.\|_{1} norm is testable. Furthermore, the closure in the ∥.∥□\|.\|_{\square} norm of a testable property is testable (but not the other way around, see example 3.6(d) below). It follows from Theorem 3.4 below (but it is not hard to see directly too) that if R\mathcal{R} is testable, then its closures in the ∥.∥1\|.\|_{1} norm and ∥.∥□\|.\|_{\square} norm coincide.

It is trivial that B1(R,ε)⊆B□(R,ε)B_{1}(\mathcal{R},\varepsilon)\subseteq B_{\square}(\mathcal{R},\varepsilon) for every R⊆W\mathcal{R}\subseteq\mathcal{W} and ε>0\varepsilon>0. A reverse containment characterizes testable graphon properties.

A graphon property R\mathcal{R} is testable if and only if for every ε>0\varepsilon>0 there is an ε′>0\varepsilon^{\prime}>0 such that B□(R,ε′)⊆B1(R,ε)B_{\square}(\mathcal{R},\varepsilon^{\prime})\subseteq B_{1}(\mathcal{R},\varepsilon).

Suppose that R\mathcal{R} is testable with test property R′\mathcal{R}^{\prime}. Let ε>0\varepsilon>0, let k=k(ε)k=k(\varepsilon) be the constant in the definition, and let ε′=2−k2\varepsilon^{\prime}=2^{-k^{2}}. Suppose that for some W∈W0W\in\mathcal{W}_{0}, we have d□(W,R)<ε′d_{\square}(W,\mathcal{R})<\varepsilon^{\prime}. Then there is a U∈RU\in\mathcal{R} such that d□(W,U)<ε′d_{\square}(W,U)<\varepsilon^{\prime}. By (4), we have for every graph FF on kk nodes

Conversely, suppose that R\mathcal{R} satisfies the condition in the proposition. Choose

Let R′\mathcal{R}^{\prime} be the graph property that a graph GG with ∣V(G)∣=n|V(G)|=n has if and only if there exists a U∈RU\in\mathcal{R} such that ∣t(F,U)−t(F,G)∣≤εn|t(F,U)-t(F,G)|\leq\varepsilon_{n} for all graphs FF with ∣V(F)∣≤kn|V(F)|\leq k_{n}. We show that (a) and (b) are satisfied.

Second, let ε>0\varepsilon>0 and suppose that d1(W,R)>εd_{1}(W,\mathcal{R})>\varepsilon. By hypothesis, there is an ε′>0\varepsilon^{\prime}>0 (depending only on ε\varepsilon) such that d□(W,R)>ε′d_{\square}(W,\mathcal{R})>\varepsilon^{\prime}.

for all graphs FF with at most knk_{n} nodes. Similarly as above, Theorem 2.5 in implies that

for all graphs FF with at most knk_{n} nodes. By Theorem 3.6 in , it follows that

If nn is large enough, this is less that ε′\varepsilon^{\prime}, contradicting the definition of ε′\varepsilon^{\prime}. ∎

We also prove the following characterization, which is a functional analogue of the characterization of Alon, Fischer, Newman and Shapira .

A graphon property R\mathcal{R} is testable if and only if for every ε>0\varepsilon>0 there is an ε′>0\varepsilon^{\prime}>0 and a finite set SS of stepfunctions such that R⊆B□(S,ε′)⊆B1(R,ε)\mathcal{R}\subseteq B_{\square}(S,\varepsilon^{\prime})\subseteq B_{1}(\mathcal{R},\varepsilon).

This theorem gives a “constructive” method of testing a testable graphon property: for every fixed error bound, it suffices to compute the d□d_{\square} distance from a finite number of stepfunctions to separate the case when W∈RW\in\mathcal{R} from the case when d1(W,R)≥εd_{1}(W,\mathcal{R})\geq\varepsilon.

First, suppose that R\mathcal{R} is testable, and let ε>0\varepsilon>0. By Theorem 3.4, there is an ε′>0\varepsilon^{\prime}>0 such that B□(R,2ε′)⊆B1(R,ε)B_{\square}(\mathcal{R},2\varepsilon^{\prime})\subseteq B_{1}(\mathcal{R},\varepsilon). For every stepfunction ss, consider the open ball B□(s,ε′)B_{\square}(s,\varepsilon^{\prime}). These balls cover the whole space, so by the compactness of (W,δ□)(\mathcal{W},\delta_{\square}) there is a finite set S0S_{0} of stepfunctions such that the corresponding balls cover the whole space. Let SS be the set of those stepfunctions in S0S_{0} for which the corresponding balls intersect R\mathcal{R}. Then clearly R⊆B□(S,ε′)\mathcal{R}\subseteq B_{\square}(S,\varepsilon^{\prime}). On the other hand, B□(U,ε′)B_{\square}(U,\varepsilon^{\prime}) intersects R\mathcal{R} for every U∈SU\in S, and hence B□(S,ε′)⊆B□(R,2ε′)⊆B1(R,ε)B_{\square}(S,\varepsilon^{\prime})\subseteq B_{\square}(\mathcal{R},2\varepsilon^{\prime})\subseteq B_{1}(\mathcal{R},\varepsilon).

Second, suppose that R\mathcal{R} satisfies the condition in the theorem, then for every ε>0\varepsilon>0 there exists an ε′>0\varepsilon^{\prime}>0 and a finite set SS of stepfunctions such that R⊆B□(S,ε′)⊆B1(R,ε/2)\mathcal{R}\subseteq B_{\square}(S,\varepsilon^{\prime})\subseteq B_{1}(\mathcal{R},\varepsilon/2). Let ε′′=εε′/6\varepsilon^{\prime\prime}=\varepsilon\varepsilon^{\prime}/6. We claim that

Indeed, let W∈B□(S,ε′+ε′′)W\in B_{\square}(\mathcal{S},\varepsilon^{\prime}+\varepsilon^{\prime\prime}). Then there is a U∈SU\in\mathcal{S} such that ∥U−W∥□<ε′+2ε′′\|U-W\|_{\square}<\varepsilon^{\prime}+2\varepsilon^{\prime\prime}. Consider Y=(1−13ε)W+13εUY=(1-\frac{1}{3}\varepsilon)W+\frac{1}{3}\varepsilon U. Then

so Y∈B□(S,ε′)Y\in B_{\square}(S,\varepsilon^{\prime}). On the other hand,

and so W∈B1(B□(S,ε′),ε/2)W\in B_{1}(B_{\square}(S,\varepsilon^{\prime}),\varepsilon/2). This proves (12), which in turn implies that

This proves that R\mathcal{R} is testable. ∎

We conclude this section with some examples of testable and non-testable function properties.

On the other hand, the complementary property Rc=W0∖{U}\mathcal{R}^{c}=\mathcal{W}_{0}\setminus\{U\} is testable; indeed, its closure is W0\mathcal{W}_{0} (either in the ∥.∥□\|.\|_{\square} norm or the ∥.∥1\|.\|_{1} norm), which is trivially testable.

(b) Let S⊆W0\mathcal{S}\subseteq\mathcal{W}_{0} be an arbitrary graphon property and let a>0a>0 be an arbitrary number. Then R=B□(S,a)\mathcal{R}=B_{\square}(\mathcal{S},a) is testable.

Indeed, for ε>0\varepsilon>0 define ε′=aε/(2−2ε)\varepsilon^{\prime}=a\varepsilon/(2-2\varepsilon). Let W∈B□(R,ε′)W\in B_{\square}(\mathcal{R},\varepsilon^{\prime}). Then W∈B□(S,a+ε′)W\in B_{\square}(\mathcal{S},a+\varepsilon^{\prime}), and so there is a U∈SU\in\mathcal{S} such that ∥U−W∥□≤a+2ε′\|U-W\|_{\square}\leq a+2\varepsilon^{\prime}. Consider Y=(1−ε)W+εUY=(1-\varepsilon)W+\varepsilon U. Then ∥Y−U∥□=∥(1−ε)(U−W)∥□≤(1−ε)(a+2ε′)=a\|Y-U\|_{\square}=\|(1-\varepsilon)(U-W)\|_{\square}\leq(1-\varepsilon)(a+2\varepsilon^{\prime})=a, so Y∈RY\in\mathcal{R}. On the other hand, ∥W−Y∥1=∥ε(W−U)∥1≤ε\|W-Y\|_{1}=\|\varepsilon(W-U)\|_{1}\leq\varepsilon, and so W∈B1(R,ε)W\in B_{1}(\mathcal{R},\varepsilon).

(c) For every fixed graph FF and 0<c<10<c<1, the property R\mathcal{R} that t(F,W)=ct(F,W)=c is testable; an appropriate test property is

Indeed, it follows from Theorem 2.3 that with probability 1−o(1)1-o(1),

Fixing two subgraph densities, however, may yield a non-testable property: for example, t(K2,W)=1/2t(K_{2},W)=1/2 and t(C4,W)=1/16t(C_{4},W)=1/16 imply that W≡1/2W\equiv 1/2 (see ).

(d) The graphon property that WW is 0-1 valued is not testable. It is closed in the ∥.∥1\|.\|_{1} norm, but its closure in the ∥.∥□\|.\|_{\square} norm is the whole set W0\mathcal{W}_{0}.

2 Graph properties vs. function properties

We want to establish the connection between testability of graph properties and graphon properties. The fact that graphons arise as limits of graph sequences suggests the following definition.

If P\mathcal{P} is a graph property, then we define its closure P‾\overline{\mathcal{P}} as the set of all functions W∈W0W\in\mathcal{W}_{0} for which there exists a sequence of graphs Gn∈PG_{n}\in\mathcal{P} with ∣V(Gn)∣→∞|V(G_{n})|\to\infty such that Gn→WG_{n}\to W (i.e., WGnW_{G_{n}} converges to WW in the δ□\delta_{\square} metric).

Clearly P‾\overline{\mathcal{P}} is closed under isomorphism, i.e. it is a graphon property. The following examples show that P‾\overline{\mathcal{P}} is not necessarily an “extension” of P\mathcal{P} in the sense that P\mathcal{P} cannot be recovered from it. Intuitively, P‾\overline{\mathcal{P}} is a nice object which is a “clean” version of P\mathcal{P}; it is an analytic profile of the property P\mathcal{P}, which eliminates all uncontrollable noise from it.

(a) Let P\mathcal{P} be the graph property that the graph doesn’t have a 4-cycle. Then only the 00 function has property P‾\overline{\mathcal{P}}. In fact, graphs without 44-cycles are sparse and property testing (in the sense of Definition 1.1) does not distinguish sparse graphs from each other.

(b) Let P\mathcal{P} be the graph property that the graph has an even number of edges. Rather counter-intuitively, this property is testable according to Definition 1.1 above, and its closure is the whole set W0\mathcal{W}_{0}.

(c) Let P\mathcal{P} be the graph property that the graph has an even number of nodes. This property is not testable, since adding a single node to a large graph changes the distribution of small induced subgraphs by very little, but changes the property. The closure of this property is again the whole set W0\mathcal{W}_{0} (which is testable).

(d) Quasirandomness is defined as a property of a sequence of graphs, but we can make it a graph property Q\mathcal{Q} (at the cost of a somewhat arbitrary choice of the error bound) as follows: a graph GG on nn nodes is quasirandom, if

The closure Q‾\overline{\mathcal{Q}} of this property consists of only one function, the identically 1/21/2 function. This singleton set of functions is not testable, since for any sequence (Gn)(G_{n}) of quasirandom graphs, ∥WGn−12∥□→0\|W_{G_{n}}-\frac{1}{2}\|_{\square}\to 0 but ∥WGn−12∥1=1/2\|W_{G_{n}}-\frac{1}{2}\|_{1}=1/2. This implies (by Theorem 3.18 below) that quasirandomness is not a testable property.

The first part of the following fact was stated in .

(a) The closure of a hereditary graph property P\mathcal{P} consists of those functions W∈W0W\in\mathcal{W}_{0} for which

for every kk. Equivalently, tind(F,W)=0t_{\rm ind}(F,W)=0 whenever F∉PF\notin\mathcal{P}.

(b) The closure of a testable graph property P\mathcal{P} consists of those functions W∈W0W\in\mathcal{W}_{0} for which

It follows from Theorem 3.5 that in the last formula, we could replace d1d_{1} by d□d_{\square}.

To show the converse, assume that W∈P‾W\in\overline{\mathcal{P}}, and let (Gn)(G_{n}) be a sequence of graphs such that Gn∈PG_{n}\in\mathcal{P} and Gn→WG_{n}\to W. We can write

so it suffices to prove that tind(F,W)=0t_{\rm ind}(F,W)=0 for F∉PF\notin\mathcal{P}. By (1), we have

for every F∈FkF\in\mathcal{F}_{k}. For F∈Fk∖PF\in\mathcal{F}_{k}\setminus\mathcal{P}, we have tind(F,Gn)=0t_{\rm ind}(F,G_{n})=0 since Gn∈PG_{n}\in\mathcal{P} and the property is hereditary. Hence by (15), in this case

If P\mathcal{P} is a hereditary graph property, then W∈P‾W\in\overline{\mathcal{P}} depends only on the support of WW.

We conclude with two lemmas on testability. We’ll say more about both (Theorems 3.20 and 3.18), but these simple lemmas will be needed before that.

Let P\mathcal{P} be a testable graph property. Then for every ε>0\varepsilon>0 there is an ε′>0\varepsilon^{\prime}>0 and a positive integer n′n^{\prime} such that if GG are two graphs with G′∈PG^{\prime}\in\mathcal{P}, δ□(G,G′)<ε′\delta_{\square}(G,G^{\prime})<\varepsilon^{\prime} and ∣V(G)∣,∣V(G′)∣≥n′|V(G)|,|V(G^{\prime})|\geq n^{\prime}, then d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon.

Let ε>0\varepsilon>0 and let k=k(ε)k=k(\varepsilon) in the definition of testability. We show that n′=9k2n^{\prime}=9k^{2} and ε′=1/k2\varepsilon^{\prime}=1/k^{2} is a good choice. Since G′G^{\prime} has property P\mathcal{P}, we have that at least 2/32/3 of its kk-node induced subgraphs have property P′\mathcal{P}^{\prime}. It follows by (5) that more than 1/31/3 of the kk-node subgraphs of GG have the property P′\mathcal{P}^{\prime}. Hence d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon by testability. ∎

If P\mathcal{P} is testable then P‾\overline{\mathcal{P}} is testable.

The converse is not true in general, but in Theorem 3.18 we will give a characterization of testable properties in terms of their closure.

It suffices to prove that if (Wn)(W_{n}) is a sequence of functions in W0\mathcal{W}_{0} such that d□(Wn,P‾)→0d_{\square}(W_{n},\overline{\mathcal{P}})\to 0, then d1(Wn,P‾)→0d_{1}(W_{n},\overline{\mathcal{P}})\to 0. We may assume that the sequence WnW_{n} is convergent, so Wn→UW_{n}\to U for some U∈W0U\in\mathcal{W}_{0} (in the δ□\delta_{\square} distance). Clearly U∈P‾U\in\overline{\mathcal{P}}, so by the definition of closure, there are graphs Hn∈PH_{n}\in\mathcal{P} such that ∣V(Hn)∣→∞|V(H_{n})|\to\infty and Hn→UH_{n}\to U.

Fix any ε>0\varepsilon>0. By Lemma 3.11, there is an ε′>0\varepsilon^{\prime}>0 such that if ∣V(G)∣,∣V(H)∣|V(G)|,|V(H)| are large enough, H∈PH\in\mathcal{P}, and δ□(G,H)<ε′\delta_{\square}(G,H)<\varepsilon^{\prime}, then d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon. Furthermore, there is an nε≥1n_{\varepsilon}\geq 1 such that if n≥nεn\geq n_{\varepsilon}, then δ□(WHn,U),δ□(Wn,U)≤ε′/3\delta_{\square}(W_{H_{n}},U),\delta_{\square}(W_{n},U)\leq\varepsilon^{\prime}/3.

Fix any n≥nεn\geq n_{\varepsilon}, and let Gn,mG_{n,m} (m=1,2,…m=1,2,\dots) be a sequence of graphs such that ∣V(Gn,m)∣→∞|V(G_{n,m})|\to\infty and Gn,m→WnG_{n,m}\to W_{n} as m→∞m\to\infty. Then

if mm is large enough, hence by the choice of ε′\varepsilon^{\prime}, we have d1(Gn,m,P)≤εd_{1}(G_{n,m},\mathcal{P})\leq\varepsilon. This means that there are graphs Jn,m∈PJ_{n,m}\in\mathcal{P} with V(Jn,m)=V(Gn,m)V(J_{n,m})=V(G_{n,m}) such that d1(Gn,m,Jn,m)≤εd_{1}(G_{n,m},J_{n,m})\leq\varepsilon. By choosing a subsequence, we can assume that Jn,m→UnJ_{n,m}\to U_{n} as m→∞m\to\infty for some Un∈P‾U_{n}\in\overline{\mathcal{P}}. Applying Lemma 2.11 we obtain that

2.2 Closure and distance

What is the relationship between the d1d_{1} distance from a property and from its closure? The following propositions summarize what we know. We say that a graph G′G^{\prime} is an equitable mm-blowup of GG if it is obtained by replacing each node of GG by mm or m+1m+1 twin copies (m≥1m\geq 1).

(a) For every hereditary graph property P\mathcal{P} and every graph GG,

(b) For every testable graph property P\mathcal{P},

(c) Let P\mathcal{P} be an arbitrary graph property and let G1,G2,…G^{1},G^{2},\dots be all equitable blowups of a graph GG. Then

Hence there is an instance of G′G^{\prime} for which G′∈PG^{\prime}\in\mathcal{P} and d1(G,G′)≤d1(WG,P)+δd_{1}(G,G^{\prime})\leq d_{1}(W_{G},\mathcal{P})+\delta. Thus d1(G,P)≤d1(G,G′)≤d1(WG,P‾)+δd_{1}(G,\mathcal{P})\leq d_{1}(G,G^{\prime})\leq d_{1}(W_{G},\overline{\mathcal{P}})+\delta. Since δ\delta is arbitrary, this proves (a).

(b) Suppose not, then there exists a sequence of graphs (Gn)(G_{n}) with ∣V(Gn)∣→∞|V(G_{n})|\to\infty such that d1(Gn,P)→ad_{1}(G_{n},\mathcal{P})\to a and d1(WGn,P‾)→bd_{1}(W_{G_{n}},\overline{\mathcal{P}})\to b, where a≠ba\not=b. We may assume that V(Gn)=[qn]V(G_{n})=[q_{n}], where qn→∞q_{n}\to\infty.

First, select graphs Hn∈PH_{n}\in\mathcal{P} such that V(Hn)=V(Gn)V(H_{n})=V(G_{n}) and d1(Gn,Hn)=d(Gn,P)d_{1}(G_{n},H_{n})=d(G_{n},\mathcal{P}). By selecting a subsequence, we may assume that the sequence HnH_{n} is convergent; let U∈W0U\in\mathcal{W}_{0} be its limit. Clearly U∈P‾U\in\overline{\mathcal{P}}. Then δ□(WHn,P‾)≤δ□(WHn,U)→0\delta_{\square}(W_{H_{n}},\overline{\mathcal{P}})\leq\delta_{\square}(W_{H_{n}},U)\to 0, and hence d□(WHn,P‾)→0d_{\square}(W_{H_{n}},\overline{\mathcal{P}})\to 0. By Theorem 3.4, this implies that d1(WHn,P‾)→0d_{1}(W_{H_{n}},\overline{\mathcal{P}})\to 0. But then in the inequality

the first term on the right hand side tends to aa, while the second tends to 00, showing that b≤ab\leq a.

Next we show that, with probability tending to 11 as n→∞n\to\infty, we have

Indeed, the left hand side is the sum of qn/2q_{n}/2 independent random variables, all 0−10-1 valued, so this follows by the Law of Large Numbers.

This implies that with probability at least 1/41/4,

With positive probability, both (18) and (19) occur, and so by (16) we have

Sending n→∞n\to\infty we see that a≤b+3εa\leq b+3\varepsilon. Since ε\varepsilon was arbitrary, it follows that a≤ba\leq b, which is a contradiction.

(c) Let ε>0\varepsilon>0, and let U∈P‾U\in\overline{\mathcal{P}} be a function such that ∥WG−U∥1≤d1(WG,U)+ε\|W_{G}-U\|_{1}\leq d_{1}(W_{G},U)+\varepsilon. Let HnH_{n} be a sequence of graphs such that Hn→UH_{n}\to U and Hn∈PH_{n}\in\mathcal{P}. Then for an appropriate labeling of the nodes of HnH_{n}, we have ∥WHn−U∥□→0\|W_{H_{n}}-U\|_{\square}\to 0. Since WGW_{G} is 0−10-1 valued, Lemma 2.9 implies that ∥WHn−WG∥1→∥U−WG∥1\|W_{H_{n}}-W_{G}\|_{1}\to\|U-W_{G}\|_{1}. Let V(G)={1,…,k}V(G)=\{1,\dots,k\} and V(Hn)={1,…,m}V(H_{n})=\{1,\dots,m\}. Choose nn large enough so that ∥WHn−WG∥1≤∥U−WG∥1+ε\|W_{H_{n}}-W_{G}\|_{1}\leq\|U-W_{G}\|_{1}+\varepsilon and m≥k/εm\geq k/\varepsilon.

Let Vi={⌊(i−1)m/k⌋+1,…,⌊im/k⌋}V_{i}=\bigl\{\lfloor(i-1)m/k\rfloor+1,\dots,\lfloor im/k\rfloor\bigr\} for i=1,…,ki=1,\dots,k. Then (V1,…,Vk)(V_{1},\dots,V_{k}) is a partition of V(Hn)V(H_{n}) into kk almost equal classes. Define a graph G′G^{\prime} on {1,…,k}\{1,\dots,k\} by connecting u∈Viu\in V_{i} to v∈Vjv\in V_{j} if and only if ij∈E(G)ij\in E(G). Then G′G^{\prime} is an equitable blowup of GG. Furthermore, WG′W_{G^{\prime}} and WGW_{G} differ only on stripes of width less than 1/m1/m along the orders of the squares on which WGW_{G} is constant, so ∥WG′−WG∥1≤2k/m≤2ε\|W_{G^{\prime}}-W_{G}\|_{1}\leq 2k/m\leq 2\varepsilon. Thus

Since ε\varepsilon was arbitrary, this proves that

To prove the converse, let a=lim inf⁡d1(Gn,P)a=\liminf d_{1}(G^{n},\mathcal{P}), and let Hn∈PH_{n}\in\mathcal{P} be chosen so that V(Hn)=V(Gn)V(H_{n})=V(G^{n}) and d1(Hn,Gn)=d1(Gn,P)d_{1}(H_{n},G^{n})=d_{1}(G^{n},\mathcal{P}). Select a subsequence such d1(Hn−Gn)→ad_{1}(H_{n}-G^{n})\to a, and choose a further subsequence so that HnH_{n} is convergent. Let Hn→U∈P‾H_{n}\to U\in\overline{\mathcal{P}}. We have δ□(WHn,U)→0\delta_{\square}(W_{H_{n}},U)\to 0 and δ□(WGn,WG)→0\delta_{\square}(W_{G^{n}},W_{G})\to 0, hence by Lemma 2.11,

Hence d1(WG,P‾)≤δ1(WG,U)≤ad_{1}(W_{G},\overline{\mathcal{P}})\leq\delta_{1}(W_{G},U)\leq a. ∎

Let P\mathcal{P} be any graph property and Gn→WG_{n}\to W, a convergent graph sequence. Then

Let Hn∈PH_{n}\in\mathcal{P} be such that V(Gn)=V(Hn)V(G_{n})=V(H_{n}) and d1(Gn,Hn)=d1(Gn,P)d_{1}(G_{n},H_{n})=d_{1}(G_{n},\mathcal{P}). We may select a subsequence so that Hn→UH_{n}\to U for some U∈W0U\in\mathcal{W}_{0}. Clearly U∈P‾U\in\overline{\mathcal{P}}. Furthermore, ∥WGn−W∥□→0\|W_{G_{n}}-W\|_{\square}\to 0 and ∥WHn−U∥□→0\|W_{H_{n}}-U\|_{\square}\to 0, so by Lemma 2.8, we have

2.3 Monotone closure

For two functions U,W∈W0U,W\in\mathcal{W}_{0} we write U⪯WU\preceq W if there exist functions U′,W′∈WU^{\prime},W^{\prime}\in\mathcal{W} such that U≅U′U\cong U^{\prime}, W≅W′W\cong W^{\prime}, and U′≤W′U^{\prime}\leq W^{\prime} almost everywhere.

Let P\mathcal{P} a graph property. By its upward closure we mean the graph property P↑\mathcal{P}^{\uparrow} consisting of those graphs that have a spanning subgraph in P\mathcal{P}. For a function property R\mathcal{R}, we define its upward closure to consist of those functions W∈W0W\in\mathcal{W}_{0} for which there exists a function U∈RU\in\mathcal{R} such that U⪯WU\preceq W. In both versions, the downward closure is defined analogously.

The following theorem, whose proof is surprisingly nontrivial, asserts that closure and upward closure commute.

First, let W∈P↑‾W\in\overline{\mathcal{P}^{\uparrow}}. Then there exists a graph sequence Gn→W∈W0G_{n}\to W\in\mathcal{W}_{0} such that GnG_{n} has a spanning subgraph Gn′∈PG_{n}^{\prime}\in\mathcal{P}. We consider the pair (Gn,Gn′)(G_{n},G_{n}^{\prime}) as the graph GnG_{n} in which the edges of Gn′G_{n}^{\prime} colored red, the remaining edges are colored blue. We may choose a subsequence of the indices so that the remaining sequence is convergent as 2-edge-colored graphs, meaning that for every 2-edge-colored simple graph FF, the sequence of densities t(F,Gn)t(F,G_{n}) of the densities of color-preserving homomorphisms is convergent. It is shown in that the limit object of a such a sequence can be described by a pair of functions U,V∈W0U,V\in\mathcal{W}_{0}, such that VV is the limit of the sequence (Gn)(G_{n}), UU is the limit of the sequence (Gn′)(G_{n}^{\prime}), and U≤VU\leq V almost everywhere. Hence V≅WV\cong W and U∈P‾U\in\overline{\mathcal{P}}. This proves that W∈(P‾)↑W\in(\overline{\mathcal{P}})^{\uparrow}.

Conversely, let W∈(P‾)↑W\in(\overline{\mathcal{P}})^{\uparrow}, then there is a U∈P‾U\in\overline{\mathcal{P}} and a V≅WV\cong W such that U≤VU\leq V. Let Gn∈PG_{n}\in\mathcal{P} be such that Gn→UG_{n}\to U. By Lemma 4.16 in , we may label the graphs GnG_{n} so that ∥WGn−U∥□→0\|W_{G_{n}}-U\|_{\square}\to 0. Let L=Ln\mathcal{L}=\mathcal{L}_{n} denote the partition of $intointoN=|V(G_{n})|equalintervalsequal intervals\{I_{1},\dots,I_{N}\},andfor, and forW\in\mathcal{W},let, letW_{\mathcal{L}}denotethefunctionobtainedbyreplacingdenote the function obtained by replacingWbyitsaverageoneachoftheintervalsby its average on each of the intervalsI_{i}\times I_{j}.Clearly. ClearlyU_{\mathcal{L}}\leq V_{\mathcal{L}}$, and

(this holds even with the L1L_{1}-norm in place of the cut norm), and so

(where the second term is 00 wherever UL=1U_{\mathcal{L}}=1). Then

Since Wn′W^{\prime}_{n} is a stepfunction that is constant on intervals I×JI\times J (I,J∈L)(I,J\in\mathcal{L}), it can be viewed as WHnW_{H_{n}} for some weighted graph HnH_{n} on [N][N]. Create a random graph Gn′G_{n}^{\prime} as follows: for 1≤i<j≤N1\leq i<j\leq N, connect ii and jj with probability equal to weight of the edge in HnH_{n}. Lemma 4.3 in implies that with probability at least 1−e−N1-e^{-N},

Trivially, GnG_{n} is a subgraph of Gn′G_{n}^{\prime} with probability 11, and (20), (21) and (23) imply that

This proves that V∈P↑‾V\in\overline{\mathcal{P}^{\uparrow}}, and so W∈P↑‾W\in\overline{\mathcal{P}^{\uparrow}}. ∎

2.4 Robustness

The following definition will be important in our characterization of testable graph properties.

A graph property P\mathcal{P} is robust, if for every ε>0\varepsilon>0 there are numbers n=n(ε)>0n=n(\varepsilon)>0 and ε′>0\varepsilon^{\prime}>0 such that if GG is a graph with ∣V(G)∣≥n(ε)|V(G)|\geq n(\varepsilon) and d1(WG,P‾)≤ε′d_{1}(W_{G},\overline{\mathcal{P}})\leq\varepsilon^{\prime}, then d1(G,P)≤εd_{1}(G,\mathcal{P})\leq\varepsilon.

Proposition 3.13(b) implies that every testable property, in particular every hereditary property, is robust. The following fact, which is an immediate consequence of Proposition 3.13, provides a combinatorial criterion for robustness.

A graph property P\mathcal{P} is robust if and only if for every ε>0\varepsilon>0 there is an ε′>0\varepsilon^{\prime}>0 and an nε≥1n_{\varepsilon}\geq 1 such that if GG is a graph with ∣V(G)∣≥nε|V(G)|\geq n_{\varepsilon} and GG has infinitely many equitable blowups G′G^{\prime} with d1(G′,P)≤ε′d_{1}(G^{\prime},\mathcal{P})\leq\varepsilon^{\prime}, then d1(G,P)≤εd_{1}(G,\mathcal{P})\leq\varepsilon.

2.5 Characterizing testability of graph properties

Our next main theorem shows the relationship between analytic and graph theoretic testability.

A graph property P\mathcal{P} is testable if and only if it is robust and its closure P‾\overline{\mathcal{P}} is testable.

We have seen that every testable graph property is robust (Proposition 3.13(b)), and that its closure is testable (Lemma 3.12). So to complete the proof, it suffices to prove that if P\mathcal{P} is robust and P‾\overline{\mathcal{P}} is testable then P\mathcal{P} is testable.

Let ε>0\varepsilon>0. By the robustness of P\mathcal{P}, there is an ε′>0\varepsilon^{\prime}>0 and kε≥1k_{\varepsilon}\geq 1 such that if ∣V(G)∣≥kε|V(G)|\geq k_{\varepsilon} and d1(WG,P‾)<ε′d_{1}(W_{G},\overline{\mathcal{P}})<\varepsilon^{\prime}, than d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon. By the testability of P‾\overline{\mathcal{P}} and Theorem 3.4, there is an ε′′>0\varepsilon^{\prime\prime}>0 such that if d□(W,P‾)<ε′′d_{\square}(W,\overline{\mathcal{P}})<\varepsilon^{\prime\prime} then d1(W,P‾)<ε′d_{1}(W,\overline{\mathcal{P}})<\varepsilon^{\prime}. By the definition of Pˉ\bar{\mathcal{P}} and by Theorem 2.9 in , there exists an nε≥kεn_{\varepsilon}\geq k_{\varepsilon} such that

(i) for every graph G∈PG\in\mathcal{P} with ∣V(G)∣≥nε|V(G)|\geq n_{\varepsilon}, we have d□(WG,P‾)<ε′′/4d_{\square}(W_{G},\overline{\mathcal{P}})<\varepsilon^{\prime\prime}/4;

Let P′\mathcal{P}^{\prime} denote the property of a graph GG that d□(WG,P‾)≤ε′′/2d_{\square}(W_{G},\overline{\mathcal{P}})\leq\varepsilon^{\prime\prime}/2 (this depends on ε\varepsilon, but as we remarked after the definition, this is OK). We claim that P′\mathcal{P}^{\prime} is a good test property for P\mathcal{P} (for the given ε\varepsilon).

Thus HH has property P′\mathcal{P}^{\prime}.

Second, suppose that d1(G,P)≥εd_{1}(G,\mathcal{P})\geq\varepsilon; we want to prove by contradiction that HH does not have the property P′\mathcal{P}^{\prime} with probability at least 2/32/3. Assume that it is not true, then with probability larger than 1/31/3, d□(WH,P‾)≤ε′′/2d_{\square}(W_{H},\overline{\mathcal{P}})\leq\varepsilon^{\prime\prime}/2. We have d□(WG,WH)≤ε′′/4d_{\square}(W_{G},W_{H})\leq\varepsilon^{\prime\prime}/4 with probability more than 2/32/3. This implies that there exists at least one induced subgraph HH of GG with nn nodes such that d□(WG,WH)<ε′′/4d_{\square}(W_{G},W_{H})<\varepsilon^{\prime\prime}/4 and d□(WH,P‾)≤ε′′/2d_{\square}(W_{H},\overline{\mathcal{P}})\leq\varepsilon^{\prime\prime}/2. We obtain that d□(WG,P‾)<ε′′d_{\square}(W_{G},\overline{\mathcal{P}})<\varepsilon^{\prime\prime}. It follows from the testability of P‾\overline{\mathcal{P}} that d1(WG,P‾)<ε′d_{1}(W_{G},\overline{\mathcal{P}})<\varepsilon^{\prime}. It follows from the robustness of P\mathcal{P} that d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon, a contradiction. ∎

A further connection between testable graph properties and graphon properties is the following fact:

For every closed testable graphon property R\mathcal{R} there exists a testable graph property P\mathcal{P} such that R=P‾\mathcal{R}=\overline{\mathcal{P}}.

Let ε>0\varepsilon>0. Since R\mathcal{R} is testable, it follows by Theorem 3.4 that there is and ε′>0\varepsilon^{\prime}>0 such that B□(R,ε′)⊆B1(R,ε)B_{\square}(\mathcal{R},\varepsilon^{\prime})\subseteq B_{1}(\mathcal{R},\varepsilon). The set R\mathcal{R}, with the distance function δ□\delta_{\square}, is a compact metric space, and hence it can be covered by a finite number of balls Bi=B□(Wi,ε′/2)B_{i}=B_{\square}(W_{i},\varepsilon^{\prime}/2), i=1,…,mi=1,\dots,m. For every 1≤i≤m1\leq i\leq m, there is a smallest positive integer nin_{i} such that if n≥nin\geq n_{i} then there is a graph GG with nn nodes such that WG∈BiW_{G}\in B_{i}. Let nε=max⁡inin_{\varepsilon}=\max_{i}n_{i}. So for every U∈RU\in\mathcal{R}, and n≥nεn\geq n_{\varepsilon} there is a graph GG with nn nodes such that (using the ii for which Bi∋U)B_{i}\ni U),

This also implies that δ1(WG,R)≤ε\delta_{1}(W_{G},\mathcal{R})\leq\varepsilon.

Clearly εn↘0\varepsilon_{n}\searrow 0 as n→∞n\to\infty, and εnε≥ε\varepsilon_{n_{\varepsilon}}\geq\varepsilon. We prove that the property P={G: δ1(WG,R)≤ε∣V(G)∣}\mathcal{P}=\{G:~\delta_{1}(W_{G},\mathcal{R})\leq\varepsilon_{|V(G)|}\} is robust and its closure is R\mathcal{R}.

First we show that R⊇P‾\mathcal{R}\supseteq\overline{\mathcal{P}}. Indeed, if W∈P‾W\in\overline{\mathcal{P}}, then there is a sequence Gn∈PG_{n}\in\mathcal{P} with ∣V(Gn)∣→∞|V(G_{n})|\to\infty such that δ□(WGn,W)→0\delta_{\square}(W_{G_{n}},W)\to 0. Since Gn∈PG_{n}\in\mathcal{P} means that δ□(WGn,R)≤δ1(WGn,R)≤ε∣V(Gn)∣→0\delta_{\square}(W_{G_{n}},\mathcal{R})\leq\delta_{1}(W_{G_{n}},\mathcal{R})\leq\varepsilon_{|V(G_{n})|}\to 0, it follows that δ□(W,R)=0\delta_{\square}(W,\mathcal{R})=0. Since R\mathcal{R} is closed, this implies that W∈RW\in\mathcal{R}.

To show that R⊆P‾\mathcal{R}\subseteq\overline{\mathcal{P}}, consider any U∈RU\in\mathcal{R}, and let ε>0\varepsilon>0. As we have seen above, there is a graph G∈PG\in\mathcal{P} with nεn_{\varepsilon} nodes such that δ□(WG,U)≤ε\delta_{\square}(W_{G},U)\leq\varepsilon and δ1(WG,R)≤ε≤εnε\delta_{1}(W_{G},\mathcal{R})\leq\varepsilon\leq\varepsilon_{n_{\varepsilon}}. So G∈PG\in\mathcal{P}, which shows that there is a function WGW_{G} with G∈PG\in\mathcal{P} arbitrarily close to UU.

To show that property P\mathcal{P} is robust, consider any graph GG with nn nodes. Choose U∈RU\in\mathcal{R} so that ∥WG−U∥1≤2d1(WG,R)\|W_{G}-U\|_{1}\leq 2d_{1}(W_{G},\mathcal{R}). By Corollary 2.7, there is a graph G~\widetilde{G} on nn nodes such that d1(G~,U)≤4∥WG−U∥1≤8d1(WG,R)d_{1}(\widetilde{G},U)\leq 4\|W_{G}-U\|_{1}\leq 8d_{1}(W_{G},\mathcal{R}) and ∥WG~−U∥□≤50log⁡log⁡n≤εn\|W_{\widetilde{G}}-U\|_{\square}\leq\frac{50}{\sqrt{\log\log n}}\leq\varepsilon_{n}. Thus G~∈P\widetilde{G}\in\mathcal{P}, and

Thus P\mathcal{P} is robust and P‾=R\overline{\mathcal{P}}=\mathcal{R} is testable. Theorem 3.18 implies that P\mathcal{P} is testable. ∎

Let us say that two graph properties P\mathcal{P} and P′\mathcal{P}^{\prime} are equivalent if their closure is the same. Theorem 3.19 implies that equivalence classes of testable graph properties are in a one to one correspondence with the testable graphon properties.

As an application of these results, we give a purely combinatorial characterization of testability, which generalizes the result of Alon and Shapira on the testability of hereditary properties, and also contains a finite analogue of Theorem 3.5.

For a graph property P\mathcal{P}, the following are equivalent:

(b) For every ε>0\varepsilon>0 there is an ε′>0\varepsilon^{\prime}>0 and an n′>0n^{\prime}>0 such that if G∈PG\in\mathcal{P}, G′G^{\prime} is any other graph such that δ□(G,G′)<ε′\delta_{\square}(G,G^{\prime})<\varepsilon^{\prime}, and ∣V(G)∣,∣V(G′)∣≥n′|V(G)|,|V(G^{\prime})|\geq n^{\prime}, then d1(G′,P)<εd_{1}(G^{\prime},\mathcal{P})<\varepsilon.

(c) For every ε>0\varepsilon>0 there is an ε0>0\varepsilon_{0}>0 and an n0>0n_{0}>0 such that if G∈PG\in\mathcal{P} and G′G^{\prime} is an induced subgraph of GG such that δ□(G,G′)<ε0\delta_{\square}(G,G^{\prime})<\varepsilon_{0} and ∣V(G′)∣≥n0|V(G^{\prime})|\geq n_{0}, then d1(G′,P)<εd_{1}(G^{\prime},\mathcal{P})<\varepsilon.

Condition (b) says that, roughly speaking, if a graph GG is close to a graph H∈PH\in\mathcal{P} in the δ□\delta_{\square} distance, then it is also close to a (possibly different) graph J∈PJ\in\mathcal{P} in edit distance. But we need to be careful: Let P\mathcal{P} be the (trivial) graph property of having at most 11 node, then a large edgeless graph will be close to P\mathcal{P} in the δ□\delta_{\square} distance, but not in d1d_{1}. The theorem shows that it is enough to add the assumption that the graphs are large enough.

Condition (c) is a weakening of Alon–Shapira condition that the graph is hereditary. Theorem 2.11 in implies that a randomly chosen kk-node induced subgraph of GG is closer to GG than 10/log⁡k10/\sqrt{\log k} in the δ□\delta_{\square} distance, with large probability. So we can think of induced subgraphs G′G^{\prime} satisfying δ□(G,G′)<ε0\delta_{\square}(G,G^{\prime})<\varepsilon_{0} as “typical”.

Lemma 3.11 says that (a)⇒\Rightarrow(b), and (b)⇒\Rightarrow(c) is trivial. To prove that (c)⇒\Rightarrow(a), we start with proving a version of the condition in the theorem for functions.

For every ε>0\varepsilon>0 there is an ε1>0\varepsilon_{1}>0 and an n1>0n_{1}>0 such that if W∈P‾W\in\overline{\mathcal{P}} and GG is graph such that ∣V(G)∣≥n1|V(G)|\geq n_{1}, tind(G,W)>0t_{\rm ind}(G,W)>0 and d□(WG,W)<ε1d_{\square}(W_{G},W)<\varepsilon_{1}, then d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon.

Given ε>0\varepsilon>0, let ε0\varepsilon_{0} and n0n_{0} be as in the condition of the theorem, and set ε1=ε0/2\varepsilon_{1}=\varepsilon_{0}/2, n1=n0n_{1}=n_{0}. Let Hn∈PH_{n}\in\mathcal{P} be a sequence of graphs such that Hn→WH_{n}\to W. Then tind(G,Hn)→tind(G,W)>0t_{\rm ind}(G,H_{n})\to t_{\rm ind}(G,W)>0, so for large enough nn, GG is an induced subgraph of HnH_{n}. Furthermore, we have δ□(G,Hn)≤δ□(WG,W)+δ□(W,WHn)→δ□(WG,W)≤ε0/2\delta_{\square}(G,H_{n})\leq\delta_{\square}(W_{G},W)+\delta_{\square}(W,W_{H_{n}})\to\delta_{\square}(W_{G},W)\leq\varepsilon_{0}/2, and so for large enough nn we have δ□(G,Hn)<ε0\delta_{\square}(G,H_{n})<\varepsilon_{0}. So the condition of the theorem implies that d1(G,P)<εd_{1}(G,\mathcal{P})<\varepsilon. This proves Claim 3.21.1.

To prove that P\mathcal{P} is testable, we use Theorem 3.18: it suffices to prove that P‾\overline{\mathcal{P}} is testable and P\mathcal{P} is robust. To prove that P‾\overline{\mathcal{P}} is testable, we use Theorem 3.4: We want to prove that if a function is close to P‾\overline{\mathcal{P}} in the ∥.∥□\|.\|_{\square} norm, then it is also close in the ∥.∥1\|.\|_{1} norm. Our next step is proving a special case of this.

For every ε>0\varepsilon>0 there is an ε2>0\varepsilon_{2}>0 such that if W∈P‾W\in\overline{\mathcal{P}} and U∈WU\in\mathcal{W} is a function such that U=WU=W wherever W(x,y)∈{0,1}W(x,y)\in\{0,1\} and d□(W,U)<ε2d_{\square}(W,U)<\varepsilon_{2}, then d1(U,P‾)<εd_{1}(U,\overline{\mathcal{P}})<\varepsilon.

We use Theorem 3.4. Let (Un)(U_{n}) be a sequence of functions in W0\mathcal{W}_{0} such that d□(Un,P‾)→0d_{\square}(U_{n},\overline{\mathcal{P}})\to 0, we want to prove that d1(Un,P‾)→0d_{1}(U_{n},\overline{\mathcal{P}})\to 0. We may assume that (Un)(U_{n}) is convergent in the δ1\delta_{1} distance, and hence applying appropriate measure preserving transformations, we may assume that there is a function W∈W0W\in\mathcal{W}_{0} such that ∥Un−W∥□→0\|U_{n}-W\|_{\square}\to 0. Let

Let ε>0\varepsilon>0 and choose n2,ε2n_{2},\varepsilon_{2} as in Claim 3.21.2, with input ε/2\varepsilon/2. Just as in the proof of Theorem 3.30, we see that ∥Un−Un′∥1→0\|U_{n}-U_{n}^{\prime}\|_{1}\to 0, so we can choose a large enough nn such that ∥Un−Un′∥1<min⁡{ε/2,ε2/2}\|U_{n}-U_{n}^{\prime}\|_{1}<\min\{\varepsilon/2,\varepsilon_{2}/2\} and also ∥Un−W∥□<ε2/2\|U_{n}-W\|_{\square}<\varepsilon_{2}/2. Then Un′=WU_{n}^{\prime}=W wherever W∈{0,1}W\in\{0,1\} and ∥Un′−W∥□≤∥Un′−Un∥□+∥Un−W∥□≤∥Un′−Un∥1+∥Un−W∥□<ε2\|U^{\prime}_{n}-W\|_{\square}\leq\|U^{\prime}_{n}-U_{n}\|_{\square}+\|U_{n}-W\|_{\square}\leq\|U^{\prime}_{n}-U_{n}\|_{1}+\|U_{n}-W\|_{\square}<\varepsilon_{2}, and so by Claim 3.21.2 we have ∥Un′−W∥1<ε/2\|U^{\prime}_{n}-W\|_{1}<\varepsilon/2. Thus ∥Un−W∥1≤∥Un′−Un∥1+∥Un−W∥1≤ε\|U_{n}-W\|_{1}\leq\|U^{\prime}_{n}-U_{n}\|_{1}+\|U_{n}-W\|_{1}\leq\varepsilon.

and so by Claim 3.21.1, we have d1(G′,P)<ε/2d_{1}(G^{\prime},\mathcal{P})<\varepsilon/2. Hence d1(G,P)≤d1(G,G′)+d1(G′,P)<εd_{1}(G,\mathcal{P})\leq d_{1}(G,G^{\prime})+d_{1}(G^{\prime},\mathcal{P})<\varepsilon, which proves that P\mathcal{P} is robust.

Using Theorem 3.18, this completes the proof of Theorem 3.20. ∎

3 Property testing vs. parameter testing

Parameter testing is a problem related to property testing, and in some respects simpler; but the main facts are often analogous. It was introduced in , where a number of different characterizations were also given (see also ). We summarize the main results about parameter testing, to point out this analogy; finally, we prove a direct connection between these notions.

A graph parameter is a function defined on isomorphism types of graphs. A graph parameter ff is testable, if for every ε>0\varepsilon>0 there is a positive integer k=k(ε)k=k(\varepsilon) such that if GG is a graph with at least kk nodes and SS is a random subset of kk nodes of GG (chosen uniformly over all kk-element sets), then

Testability of parameters is related to the convergence of graph sequences:

A graph parameter ff is testable if and only if f(Gn)f(G_{n}) converges for every convergent graph sequence (Gn)(G_{n}).

A graphon functional is a real valued function defined on graphons; equivalently, a functional defined on W0\mathcal{W}_{0} that is invariant under isomorphism. A graphon functional ff is testable, if there is a graph parameter gg such that for every ε>0\varepsilon>0 there is a positive integer k(ε)k(\varepsilon) such that for every W∈W0W\in\mathcal{W}_{0} and k≥k(ε)k\geq k(\varepsilon),

Informally, we can estimate the value of f(W)f(W) by generating a WW-random graph with sufficiently many nodes, and evaluating the graph parameter gg on this.

Testable graphon parameters have a simple characterization:

A graphon parameter is testable if and only if it is continuous in the norm ∥.∥□\|.\|_{\square}.

Conversely, if ff is continuous, then it is uniformly continuous by the compactness of W\mathcal{W}, and so for every ε>0\varepsilon>0 there is an ε′>0\varepsilon^{\prime}>0 such that if δ□(U,W)≤ε′\delta_{\square}(U,W)\leq\varepsilon^{\prime} then ∣f(U)−f(W)∣≤ε′|f(U)-f(W)|\leq\varepsilon^{\prime}. Define g(F)=f(WF)g(F)=f(W_{F}) for a graph FF. By Theorem 2.4, if kk is large enough, then with large probability,

A graph parameter is testable if and only if there is a testable graphon parameter ff such that f(WG)−g(G)→0f(W_{G})-g(G)\to 0 if ∣V(G)∣→∞|V(G)|\to\infty.

We can view this last fact as follows: Every graphon functional ff gives rise to a graph parameter f^\widehat{f} by f^(G)=f(WG)\widehat{f}(G)=f(W_{G}). This graph parameter f^\widehat{f} is testable if ff is testable, and testable graph parameters are exactly those that are “asymptotically equal” to f^\widehat{f} for some testable graphon functional ff.

Alon and Shapira proved that the edit distance from every hereditary graph property is a testable parameter. More generally, Fischer and Newman proved:

A graph property P\mathcal{P} is testable if and only if the edit distance d1(G,P)d_{1}(G,\mathcal{P}) is a testable parameter.

The following theorem gives an analogue of this result for graphons, from which Theorem 3.25 can be deduced:

A graphon property R\mathcal{R} is testable if and only if the distance d1(.,R)d_{1}(.,\mathcal{R}) is a testable functional.

The content of the theorem is that the d1d_{1} distance from a testable property is continuous function in the ∥.∥□\|.\|_{\square} norm. It is trivial that this distance is continuous in the ∥.∥1\|.\|_{1} norm for any graphon property. The second half of the proof below shows that the d1d_{1} distance from any graphon property is lower semi-continuous in the ∥.∥□\|.\|_{\square} norm.

It is easy to see that if the functional d1(.,R)d_{1}(.,\mathcal{R}) is testable then R\mathcal{R} is testable: the set {W: d1(W,R)<ε}\{W:~d_{1}(W,\mathcal{R})<\varepsilon\} is open in the ∥.∥□\|.\|_{\square} norm, and contains the compact set R‾\overline{\mathcal{R}}, so it contains a neighborhood B□(R,ε′)B_{\square}(\mathcal{R},\varepsilon^{\prime}) of R\mathcal{R} for some ε′>0\varepsilon^{\prime}>0.

Now suppose that R\mathcal{R} is testable. Let W∈W0W\in\mathcal{W}_{0} and let Wn→WW_{n}\to W. We claim that d1(Wn,R)→d1(W,R)d_{1}(W_{n},\mathcal{R})\to d_{1}(W,\mathcal{R}). We may assume that ∥Wn−W∥□→0\|W_{n}-W\|_{\square}\to 0.

Let ε>0\varepsilon>0, and let U∈RU\in\mathcal{R} be such that ∥W−U∥1≤d1(W,R)+ε\|W-U\|_{1}\leq d_{1}(W,\mathcal{R})+\varepsilon. By Lemma 2.10, there is a sequence of functions Un∈WU_{n}\in\mathcal{W} such that ∥Un−U∥□→0\|U_{n}-U\|_{\square}\to 0 and ∥Un−Wn∥1→∥U−W∥1\|U_{n}-W_{n}\|_{1}\to\|U-W\|_{1}. By the testability of R\mathcal{R} and by Theorem 3.4, it follows that ∥Un−U∥1→0\|U_{n}-U\|_{1}\to 0, and so

Since ε>0\varepsilon>0 is arbitrary, this implies that

To prove the reverse, let Vn∈RV_{n}\in\mathcal{R} be chosen so that ∥Wn−Vn∥1≤d1(Wn,R)+1/n\|W_{n}-V_{n}\|_{1}\leq d_{1}(W_{n},\mathcal{R})+1/n. By selecting a subsequence, we may assume that the sequence (Vn)(V_{n}) is convergent in the δ□\delta_{\square} distance. Let V∈W0V\in\mathcal{W}_{0} be its limit. Clearly V∈RV\in\mathcal{R}. Thus by Lemma 2.11 we have

The relations (24) and (25) prove that d1(Wn,R)→d1(W,R)d_{1}(W_{n},\mathcal{R})\to d_{1}(W,\mathcal{R}), and so d1(.,R)d_{1}(.,\mathcal{R}) is continuous. ∎

The theorem of Fischer and Newman (Theorem 3.25) is easy to derive from here. By the results of Theorem 6.1(d), it suffices to prove that for every testable property P\mathcal{P}, d1(W,P‾)d_{1}(W,\overline{\mathcal{P}}) is a continuous function of WW in the ∥.∥□\|.\|_{\square} norm, and d1(G,P)−d1(WG,P‾)→0d_{1}(G,\mathcal{P})-d_{1}(W_{G},\overline{\mathcal{P}})\to 0 if ∣V(G)∣→∞|V(G)|\to\infty. The first assertion follows from Theorem 3.26, the second, from Proposition 3.13(b).

4 Flexible properties

Let W∈W0W\in\mathcal{W}_{0}. A function U∈W0U\in\mathcal{W}_{0} is a flexing of WW if U(x,y)=W(x,y)U(x,y)=W(x,y) for all x,yx,y with W(x,y)∈{0,1}W(x,y)\in\{0,1\} (so we may change the values of WW that are strictly between 00 and 11; note that we may change these to 00 or 11, so the relation is not symmetric). We say that a function property is flexible if it is preserved under flexing. The following Proposition gives some sufficient conditions for flexibility; the proofs are straightforward and omitted.

(a) Every function property that implies that the function is 0−10-1 valued is flexible.

(b) For every graph FF, the function property {W∈W0: t(F,W)=0}\{W\in\mathcal{W}_{0}:~t(F,W)=0\} is flexible.

(c) If R\mathcal{R} is a flexible function property, then the function properties R∗={1−W: W∈R}\mathcal{R}^{*}=\{1-W:~W\in\mathcal{R}\}, R↑\mathcal{R}^{\uparrow} and R↓\mathcal{R}^{\downarrow} are flexible.

(d) The intersection and union of any set of flexible properties is flexible.

We call a graph property flexible if its closure is flexible.

(a) The graph property that GG is clique of size ⌈∣V(G)∣/2⌉\lceil|V(G)|/2\rceil, together with isolated nodes, is flexible, since its closure consists of a single graphon (represented by the function WW that is 11 if x,y≤1/2x,y\leq 1/2 and 00 otherwise).

(b) The graph property that ω(G)≥∣V(G)∣/2\omega(G)\geq|V(G)|/2 is flexible (where ω(G)\omega(G) is the size of the largest clique in GG), since it is the upward closure of the property in (a). Similarly, the property that α(G)≥∣V(G)∣/2\alpha(G)\geq|V(G)|/2 is flexible (where α(G)\alpha(G) is the size of the largest independent set in GG).

(c) The graph property that there is a labeling of the nodes by {1,…,n}\{1,\dots,n\} such that two nodes are connected if and only if their labels sum to at most nn, is flexible. Indeed, the closure of this graph property consists of a single graphon (represented by the function WW that is 11 if x+y≤1x+y\leq 1 and 00 otherwise). This closure is flexible by Proposition 3.27(a).

(d) The graph property that there is a labeling of the nodes by {1,…,n}\{1,\dots,n\} such that all pairs whose labels sum to at most nn are connected by an edge, is flexible. Indeed, this is the upward closure of the property in (c).

These and other examples follow from the following proposition:

(a) Every graph property P\mathcal{P} for which P‾\overline{\mathcal{P}} consists of 0−10-1 valued functions is flexible.

(b) If a graph property is flexible, then so are its upward and downward closures.

(c) If a graph property P\mathcal{P} is flexible, then so is the property obtained by complementing all graphs in P\mathcal{P}.

(d) Every hereditary graph property is flexible.

(a) is obvious. (b) follows from Theorem 3.15 and Proposition 3.27 (c). Assertion (c) follows from Proposition 3.27 (c). Finally, (d) follows from 3.9 (a), since if t(F,W)=0t(F,W)=0, then t(F,U)=0t(F,U)=0 for every flexing UU of WW. ∎

Our main result about flexible properties is the following.

(a) Every closed flexible graphon property is testable.

(b) Every robust flexible graph property is testable.

1. It is important to assume that the property is closed. We have seen that the function property of being 0-1 valued is flexible and it is trivially a graphon property, but it is not testable.

2. We can weaken this notion slightly in a way that we preserve testability. We say that a function property is weakly flexible if it is closed under those flexings that do not change the integral of the function. A good example for this is the property which consists of those functions whose integral is 1/21/2. One can modify the proof of Theorem 3.30 to show that every weakly flexible function property is testable.

The second assertion is an immediate consequence of the first, so we only prove (a).

Assume that d□(Wn,R)→0d_{\square}(W_{n},\mathcal{R})\to 0 but d1(Wn,R)≥εd_{1}(W_{n},\mathcal{R})\geq\varepsilon for some fixed ε>0\varepsilon>0. We can assume that WnW_{n} converges to some W∈RW\in\mathcal{R} in the ∥.∥□\|.\|_{\square} norm. Let S0=W−1(0)S_{0}=W^{-1}(0) , S1=W−1(1)S_{1}=W^{-1}(1) and let Zn∈W0Z_{n}\in\mathcal{W}_{0} denote the function which is 11 on S1S_{1}, 00 on S0S_{0} and is identical with WnW_{n} anywhere else. By flexibility, we have Zn∈RZ_{n}\in\mathcal{R}. By Lemma 2.2,

The theorem of Alon and Shapira follows easily. Let P\mathcal{P} be a hereditary graph property. By Proposition 3.29 P\mathcal{P} is flexible, and so by Theorem 3.30, its closure is testable. So it suffices to prove that P\mathcal{P} is robust, which follows from Proposition 3.13(b).

Let U,W∈W0U,W\in\mathcal{W}_{0} and consider a convex combination Z=αU+(1−α)WZ=\alpha U+(1-\alpha)W, 0<α<10<\alpha<1. Then both UU and WW are flexings of ZZ. This implies the following very useful observation:

If R\mathcal{R} is a flexible function property, then W0∖R\mathcal{W}_{0}\setminus\mathcal{R} is a convex set. □\square

The distance d1(U,R)d_{1}(U,\mathcal{R}) from a flexible function property is a concave function of UU. □\square

For every hereditary graph property P\mathcal{P} there is a number pp, 0≤p≤10\leq p\leq 1, such that for every graph GG with ∣V(G)∣=n|V(G)|=n,

The following theorem states a functional version and a generalization of this fact.

(a) For every flexible graphon property R\mathcal{R}, the maximum of d1(.,R)d_{1}(.,\mathcal{R}) is attained by a constant function.

(b) For every flexible and robust graph property P\mathcal{P} there is a number pp, 0≤p≤10\leq p\leq 1, such that for every graph GG with ∣V(G)∣=n|V(G)|=n,

By Proposition 3.29(d), Theorem 3.34 is a consequence. A further corollary is that the conclusion of Theorem 3.35 holds for the properties in Example 3.28(a),(b).

Part (a) of the theorem is an easy consequence of Proposition 3.32 and Corollary 3.33. (The proof in fact works for any norm on W\mathcal{W} instead of the norm ∥.∥1\|.\|_{1}.)

To prove part (b), let p∈p\in maximize d1(p,P‾)d_{1}(p,\overline{\mathcal{P}}) (where pp also denotes the constant pp function), and let bb denote the maximum value. It suffices to prove that

Suppose that (27) fails. Then there exists a sequence of graphs GnG_{n} with ∣V(Gn)∣→∞|V(G_{n})|\to\infty such that

We may assume that Gn→W∈W0G_{n}\to W\in\mathcal{W}_{0}. By part (a),

Since the property P\mathcal{P} is robust and flexible, it is testable, and hence by Proposition 3.13(b), we have d1(Gn,P)−d1(WGn,P‾)→0d_{1}(G_{n},\mathcal{P})-d_{1}(W_{G_{n}},\overline{\mathcal{P}})\to 0. Thus d1(WGn,P‾)→b′d_{1}(W_{G_{n}},\overline{\mathcal{P}})\to b^{\prime}. Theorem 3.26 then implies that d1(W,P‾)=b′d_{1}(W,\overline{\mathcal{P}})=b^{\prime}, a contradiction. ∎

Concluding remarks

We have mentioned after the definition of testable properties that some modifications in the definition do not change the notion of testability. Let us discuss some other possible modifications that would lead to a different, generally less interesting notion.

Examples 3.8(b) and (c) suggest that in the definition of of the edit distance, we could allow adding or removing nodes as well as adding or removing edges. This would of course change which graph properties are testable, but would not change the closure of testable properties, due to Theorem 3.20.

Example 3.8(d) is counterintuitive again, since the densities in the definition can be estimated from samples easily. The trouble is that a small error in these densities only implies that the graph is close to a quasirandom graph in the d□d_{\square} distance, not in d1d_{1}.

Acknowledgement

We are indebted to the anonymous referee for pointing out several errors and inconsistencies, and for suggesting many improvements to the presentation.

References