On the VC Dimension of First-Order Logic
with Counting and Weight Aggregation
Abstract
We prove optimal upper bounds on the Vapnik–Chervonenkis density of formulas in the extensions of first-order logic with counting () and with weight aggregation () on nowhere dense classes of (vertex- and edge-)weighted finite graphs. This lifts a result of Pilipczuk, Siebertz, and Toruńczyk [14] from first-order logic on ordinary finite graphs to substantially more expressive logics on weighted finite graphs. Moreover, this proves that every formula and every formula has bounded Vapnik–Chervonenkis dimension on nowhere dense classes of weighted finite graphs; thereby, it lifts a result of Adler and Adler [1] from first-order logic to and .
Generalising another result of Pilipczuk, Siebertz, and Toruńczyk [14], we also provide an explicit upper bound on the ladder index of and formulas on nowhere dense classes. This shows that nowhere dense classes of weighted finite graphs are -stable and -stable.
Keywords and phrases:
VC dimension, VC density, stability, nowhere dense graphs, first-order logic with weight aggregation, first-order logic with countingCopyright and License:
![[Uncaptioned image]](x1.png)
2012 ACM Subject Classification:
Theory of computation Finite Model TheoryAcknowledgements:
We thank the anonymous reviewers for their valuable comments that helped to improve the presentation of this paper.Funding:
This work was funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) – project number 541000908 (gefördert durch die Deutsche Forschungsgemeinschaft (DFG) – Projektnummer 541000908).Editors:
Jörg Endrullis and Sylvain SchmitzSeries and Publisher:

1 Introduction
The Vapnik–Chervonenkis dimension (for short: VC dimension) is a measure for the complexity of set systems; it was introduced in the 1970s [19, 17, 16] and has been widely studied since then. It is formally defined as follows. Let be a set and let be a family of subsets of . A set is shattered by if every subset of can be obtained as the intersection of with some , i. e., . The VC dimension of is the maximum size of a set that is shattered by (or , if this maximum does not exist).
Given a logical formula with its free variables partitioned into a -tuple and an -tuple , the VC dimension of on a graph is defined as the VC dimension of the family , where for we let
We say that has bounded VC dimension on a class of graphs if there is a number such that for every the VC dimension of on is at most . In the following, all graphs considered in this paper are finite.
Motivated by applications on the learnability of concept classes in the model of Probably Approximately Correct (PAC) learning, Grohe and Turán [9] showed that every first-order formula has bounded VC dimension on classes of graphs of bounded local clique-width (this, in particular, includes planar graphs). Adler and Adler [1] generalised this to all nowhere dense classes of graphs. The notion of nowhere dense classes was introduced by Nešetřil and Ossona de Mendez [12, 11] as a formalisation of classes of “sparse” graphs. It subsumes and extends many well-known classes of sparse graphs, including planar graphs, trees, classes of graphs of bounded tree-width or bounded degree, and all classes that exclude a fixed topological minor. It is a robust notion that has numerous equivalent characterisations; for details we refer to the book [13].
The goal of the present paper is to lift Adler and Adler’s result [1] from first-order logic FO to the substantially more expressive logics and (introduced in [8, 5]) that enrich FO by mechanisms for counting and for weight aggregation. An obstacle in achieving this is that the proof in [1] relies on model-theoretic results of [15] based on the compactness of FO – and these are not available for or . Fortunately, Pilipczuk, Siebertz and Toruńczyk [14] presented a different, constructive proof of Adler and Adler’s result. Their proof is based on Gaifman locality and Feferman–Vaught decompositions of FO. Similar locality results and decompositions were achieved for and in [8, 5].
The logic FOC (first-order logic with counting terms) was introduced in [10] and further studied in [8, 3]. This logic extends FO by the ability to formulate counting terms that evaluate to integers, and by numerical predicates that allow to compare counting terms. If is a formula with free variables and , then is a counting term with free variables that specifies the number of tuples that satisfy the formula . Apart from this, every fixed integer is a counting term; and if and are counting terms, then so are and . The results of terms can be combined into a formula by means of numerical predicates: an -ary numerical predicate is an -ary relation on the integers (e. g. is the binary relation consisting of all pairs of integers where ). The logic FOC allows formulas of the form that evaluate to “true” if and only if the -tuple of integers obtained by evaluating the counting terms belongs to the relation .
The logic FOWA (first-order logic with weight aggregation) was introduced in [5]. Formulas and terms of this logic are evaluated on weighted graphs, which extend ordinary undirected graphs by assigning weights (i. e., elements from particular rings or abelian groups) to vertices or edges present in the graph. Pairs that do not occur as edges of the graph receive the weight 0, i. e., the neutral element of the ring or abelian group. FOWA extends FO by the ability to formulate (weight aggregation) terms that evaluate to elements in the given ring (or abelian group), and by predicates that allow to compare these terms. Every fixed element of the ring or abelian group is a term, as well as every expression of the form or ; the latter yields the weight of vertex and edge , respectively. If is a formula with free variables and , then is a (weight aggregation) term with free variables that specifies the sum (w.r.t. the ring or abelian group) of the weights of all tuples for which the formula is satisfied. More generally, instead of a single expression , the term may also refer to a product (w.r.t. the given ring) of such expressions and fixed elements of the ring. Analogously as for FOC, terms can be combined using the operations present in the ring or abelian group; and the results of terms can be combined into a formula by means of predicates on the ring or abelian group: a formula of the form expresses that the -tuple of elements in the ring or abelian group obtained by evaluating the terms belongs to the relation .
FOC can be viewed as a special case of FOWA where the ring is the ring of integers, and every vertex of the graph is equipped with the weight . Thus, all results that are available for (fragments of) FOWA immediately translate into analogous results on (the corresponding fragment of) FOC (but not necessarily vice versa).
For each number , the fragments and of FOC and FOWA restrict subformulas of the form to have at most free variables.
In this paper, we follow the approach of Pilipczuk, Siebertz and Toruńczyk [14] and extend it to FOC and FOWA by utilising results of van Bergerem and Schweikardt [5] and Grohe and Schweikardt [8]. Our main results are as follows.
-
(1)
There is a formula of that has unbounded VC dimension on the class of unranked trees of height (note that is nowhere dense). (Theorem 3.1)
-
(2)
Every formula of or has bounded VC dimension on every nowhere dense class of weighted graphs. (Corollary 5.3)
Result (1) is obtained by representing arbitrary graphs via unranked trees of height 3 in the same way as in [8]. Then, arbitrary FO formulas on can be translated into corresponding formulas on . By applying this translation to the formula , which has unbounded VC dimension on the class of all graphs, one obtains Result (1).
For obtaining Result (2), we combine the approach of [14] with the locality results of [8, 5]. This allows us to lift the following key result of [14] from FO to and .
-
(3)
For every nowhere dense class of weighted graphs, for every formula of or , and for and every , there exists a number such that for every and every non-empty , we have , where . (Theorem 5.1)
As an immediate consequence of this, by definition, we obtain the following result.
-
(4)
Every formula of or has VC density at most on every nowhere dense class of weighted graphs. (Corollary 5.2)
Here, the VC density of on is defined as the infimum of all reals such that , for all and all (where constants hidden in the -notation may depend on ). We want to remark that Result (4) implies Result (2), because the VC dimension is finite if and only if the VC density is finite (see, e. g., [2]).
For proving Result (3), we rely on a technical main lemma (see Lemma 4.1). The same statement was proven in [14] for FO instead of . Lifting this from FO to (and ) was one of the main technical obstacles we had to overcome in this paper.
From [14], we know that the bounds provided by Results (3) and (4) are optimal (since FO is included in and ) and, furthermore, that Results (2)–(4) cannot be extended to classes that are not nowhere dense but closed under taking subgraphs.
As another application of our main technical lemma (Lemma 4.1), we provide upper bounds (Theorem 6.1) on the ladder index, which is defined as follows. For a formula , a -ladder of length in a weighted graph is a sequence such that and for all , and, for all , it holds that if and only if . The smallest for which there is no -ladder of length in is called the ladder index of in .
A class of graphs is called stable if the ladder index of every first-order formula in every graph from is bounded by a constant depending only on and [18]. Adler and Adler [1] showed that every nowhere dense class of graphs is stable. Using our bound on the ladder index (Theorem 6.1), we obtain the following result, which also implies Result (2).
-
(5)
Every nowhere dense class of weighted graphs is -stable and -stable, that is, the ladder index of every formula (and therefore also of every formula) in every weighted graph from is bounded by a constant depending only on and . (Corollary 6.2)
The remainder of the paper is structured as follows. Section 2 provides the necessary background on graphs, nowhere dense classes, the logics FOC and FOWA, and the locality results that are known for these logics and used in our proofs. Section 3 presents the proof of Result (1). Section 4 is devoted to the main technical lemma (Lemma 4.1). In Section 5, we utilise this lemma to prove our Results (2)–(4). Section 6 proves Result (5) based on Lemma 4.1. We conclude in Section 7.
2 Preliminaries
We let , , , denote the sets of integers, non-negative integers, positive integers, and positive rationals, respectively. For , we let and . For a -tuple , we write to denote its length . We denote the power set of a set by .
A group is a set equipped with a binary operator that is associative (i. e. for all ) and has a neutral element (i. e. for all ) such that each has an inverse (i. e. ); we write for this . A group is abelian if is commutative (i. e. for all ). A ring is a set equipped with two binary operators (addition) and (multiplication) such that is an abelian group with neutral element , is associative and has a neutral element , and multiplication is distributive with respect to addition, i. e. and for all . A ring is commutative if is commutative.
When referring to an abelian group (or ring), we will usually write (or ), we denote the neutral element of the group by , and denotes the inverse of an element in (and we denote the neutral element of the ring for by ).
-Graphs
A (simple, undirected and finite) graph consists of a finite set (the vertices of ) and a set of subsets of of size 2 (the edges of ).
A graph signature is a finite set consisting of a symbol and a finite number of further symbols. The symbol as arity , while all other symbols have arity . Let be a graph signature. A -graph consists of a graph , and a relation for every . Note that relations of arity 1 are subsets of , and since for every set , there exist only two relations of arity 0, namely and . We identify the latter with true and the former with false.
The order of a -graph is .
Weighted -Graphs
Let be a graph signature. Let be a collection of rings and/or abelian groups. Let be a finite set of weight symbols such that each has an associated arity and a type . A -graph (or, -weighted -graph) is a -graph that is enriched, for every , by an interpretation , which satisfies the following edge condition for all with : if for , and , then .
Standard notions used for graphs are defined for -graphs by referring to their Gaifman graph . In particular, a path between two vertices and in is a path between and in the graph , and the distance between vertices and is their distance in the graph . The degree is the maximum degree of .
For a set , the induced subgraph of on is the -graph with vertex set , edge set , relations for every , and weights for every and every . For a -graph and a set , we let .
For a number , the -ball around a vertex is , and the -ball around a set is . The -neighbourhood around is the -graph . For a tuple we let and for .
Let be a graph signature with , and let be a finite set of weight symbols with . A -graph is a -expansion of a -graph if , for all , and for every . If is a -expansion of the -graph , then is the -reduct of .
Let and be two -graphs with . The disjoint union of and is the -graph with vertex set , and for all , and weight functions as follows: For all unary we have for all and for all . For all binary we have for all , for all , and for all , where .
Nowhere Dense Classes
For , we write for the complete graph on vertices. A depth- minor of a graph is a subgraph of a graph obtained from by contracting mutually vertex-disjoint connected subgraphs of radius at most to single vertices.
As mentioned in Section 1, the notion of nowhere dense classes of graphs is a robust notion that has numerous equivalent characterisations; for an overview we refer to the introduction of [14]; details can be found in the book [13]. For the purpose of this paper, the following characterisation serves as our definition of the notion.
Definition 2.1.
A class of graphs is nowhere dense if there is a function such that for every , no graph contains the complete graph as a depth- minor. A class of -graphs is nowhere dense if and only if the class is nowhere dense.
The following theorem was proved in [14] (there, it was formulated for classes of graphs; here we adapted the formulation to classes of -graphs). We will use this result for proving our results on VC density in Section 5. The result uses the following notion. Let be a -graph, let , and let . We say that and are -separated by (in ) if every path of length at most in from a vertex in to a vertex in contains a vertex from . This notion naturally extends to tuples and for any by considering the sets and , and it thereby also naturally extends to sets of tuples and .
Theorem 2.2 (Uniform quasi-wideness for tuples [14, Theorem 2.9]).
Let , and let be a class of -graphs whose Gaifman graph does not include as a depth- minor. For every , there is a number and a polynomial computable from , and with the following property.
For every , every , and every set with , there are sets and with and such that all distinct are -separated by in .
The Weight Aggregation Logic FOWA
Fix a countably infinite set vars of variables. A -interpretation consists of a -graph and an assignment . For , elements , and distinct variables , we write for the interpretation , where is the assignment with for every and for all .
Recall that is a collection of rings and/or abelian groups. An -predicate collection is a 4-tuple , where is a countable set of predicate names and, to each , assigns an arity , type assigns a type , and assigns a semantics . For the remainder of this paper, fix an -predicate collection .
For every that is not a ring but just an abelian group, a -product of type is either an element in or an expression of the form , where is of type and either and is a single variable, or and for distinct variables .
For every ring , a -product of type is an expression of the form , where , and for each , either or there exists a with and either and is of the form for a variable or and is of the form for distinct variables . By , we denote the set of all variables that occur in a -product . The syntax and semantics of first-order logic with weight aggregation FOWA is defined as follows.
Definition 2.3.
For , the set of formulas and -terms is built according to the following rules.
-
(1)
and are formulas for and with .
-
(2)
If , , , , and is a tuple of pairwise distinct variables, then is a formula.
-
(3)
If and are formulas, then and are also formulas.
-
(4)
If is a formula and , then is a formula.
-
(5)
If is a formula, , , , , and is a tuple of pairwise distinct variables, then is a formula.
-
(6)
If , , and are -terms with , then is a formula.
-
(7)
For every and every , is an -term of type .
-
(8)
For every , every of type , and every tuple of pairwise distinct variables in vars, is an -term of type .
-
(9)
If and are -terms of the same type , then and are also -terms of type ; furthermore, if is a ring (and not just an abelian group), then also is an -term of type .
-
(10)
If is a formula, , and is a -product of type , then is an -term of type .
Let be a -interpretation. For a formula or -term from , the semantics is defined as follows.
-
(1)
if , and otherwise; if , and otherwise; for all with , we have if , and otherwise; for all with , we have if , and otherwise.
-
(2)
if , and otherwise.
-
(3)
and .
-
(4)
.
-
(5)
if , and otherwise. As usual, if .
-
(6)
if , and otherwise.
-
(7)
for for some .
-
(8)
.
-
(9)
, for .
-
(10)
, where , and if is of type .
An expression is a formula or an -term. The set of an expression is defined as the set of all variables in vars that occur in . The free variables of are inductively defined as follows.
-
(1)
and for .
-
(2)
.
-
(3)
and .
-
(4)
.
-
(5)
,
-
(6)
.
-
(7)
for for some .
-
(8)
.
-
(9)
for .
-
(10)
.
We write to indicate that . A sentence is a formula without free variables, and a ground -term is an -term without free variables.
For a formula and a -interpretation , we write to indicate that . Likewise, indicates that . For a formula , a -graph , and a tuple , we write or to indicate that for one (and hence every) assignment with for all . Furthermore, we set if , and otherwise. Similarly, for an -term , we write to denote . The fragments and of FOWA are defined as follows.
Definition 2.4.
As pointed out in [5], can be viewed as an extension of first-order logic with modulo-counting quantifiers, and FOWA and can be viewed as extensions of the counting logics FOC and of [10] and [8]. In fact, every formula in FOC can be viewed as a formula in FOWA.
Note that first-order logic FO is the restriction of where only rules (1), (3), and (4) can be applied. As usual, we write and as shorthands for and . The quantifier rank of an expression is defined as the maximum nesting depth of constructs using rules (4) and (5) in order to construct . The aggregation depth of is defined as the maximum nesting depth of term constructions using rule (10) in order to construct .
Example 2.5.
Consider the following setting. consists of a single ring, the ring of integers with the natural addition and multiplication. consists of a single predicate, the binary equality predicate with . consists of a single weight symbol , and . Furthermore, . We interpret a -graph as a flow network, where indicates the flow through edge in the direction from to , and indicates the flow through edge in the direction from to .
The fact that a node is a source node, i.e., all edges incident with have weight 0 in the direction into , can be described by the formula Similarly, is an formula expressing that node is a target node, i.e., all edges incident with have weight 0 in the direction outgoing from . Furthermore, is a term of which specifies the total flow through edges incoming into node . Moreover, is a term of which specifies the total flow through edges going out of node . Thus, is a formula expressing that for node , the incoming flow is equal to its outgoing flow. Finally, is a formula expressing the following: for nodes if and only if is a feasible flow for the flow network with source and sink nodes and , i.e., for all vertices the incoming flow is equal to its outgoing flow.
Locality Results
For proving the main results (2)–(5) stated in Section 1, we heavily rely on the following two locality results achieved in [5].
Theorem 2.6 (Feferman–Vaught decompositions for [5, Theorem 4.3]).
Let , and let , be tuples of pairwise distinct variables. For every formula with free variables among , there is a finite, non-empty set of pairs of formulas with and such that the following holds. For all -graphs and with and all and , we have if and only if there is a pair with and .
Furthermore, all formulas occurring in have quantifier rank at most , and they only use those and that occur in and only those -terms that occur in or that are of the form for an with where is finite and occurs in .
Moreover, there is an algorithm that computes upon input of , , and .
For stating the second locality result, we need the following notation of local formulas. Let . A FOWA formula with free variables is -local (around ) if for every -graph and all , we have . A formula is local if it is -local for some .
Theorem 2.7 (Localisation Theorem for [5, Theorem 4.7]).
Let . For every formula of , there is an , an extension of with relation symbols of arity , and an formula that is a Boolean combination of -local formulas and statements of the form for a -ary relation symbol such that the following holds. There is an algorithm that, upon input of a -graph , computes in time a -expansion of such that, for all , it holds that if and only if . Furthermore, , , and are computable from .
3 has Unbounded VC Dimension
This section proves main result (1) stated in Section 1. Let . Let consist of the integer ring , and let consist of a unary weight symbol . We identify a graph with a -graph by letting for all . For a formula , we write for the weight aggregation term for . Note that this term evaluates to the number of tuples for which the formula is satisfied when assigning the variables the vertices . Let be the predicate collection consisting only of the equality predicate , where . The logic considered in [8] precisely corresponds to the logic , and corresponds to , for .
Theorem 3.1.
Let be the class of undirected, unranked trees of height at most 3. There is an formula such that, for every , there exist and with and . In particular, this implies that has unbounded VC dimension on .
Proof.
Recall the notions introduced at the beginning of Section 1. In particular, we write as a shorthand for .
Let be the class of all graphs. The proof of [8, Theorem 4.1] associates with every a tree and an injective mapping from to . Furthermore, the construction presented there allows associating with every formula an formula such that the following is true for every :
-
1.
For all , we have: .
-
2.
For all with or , we have: .
This implies that for all and all we
have:
.
Hence, , and thus
(1) |
Consider the FO formula . For every , there is a graph and a set with and . For example, we could use the graph with , , and . Let , and note that . From Equation 1, we obtain that . Therefore, . Choosing to be the formula thus proves the first statement of Theorem 3.1. The second statement of the theorem is an immediate consequence of its first statement and the definition of the notion of VC dimension.
4 Bound on the Number of Types
In this section, we prove the main technical tool for this paper. For that, we use the following notation. For every , with , and for a tuple , we let be the tuple obtained from by keeping only entries at positions contained in .
Lemma 4.1.
There are computable functions and such that, for every formula , every , every -graph , and all that are -separated by a set of size at most , we have .
Proof.
Let , , and . W.l.o.g., we assume that , , , and only contain elements that occur in . Using Theorem 2.7, from , we can compute an , an extension of with relation symbols of arity , and an formula that is a Boolean combination of -local formulas and statements of the form for a -ary relation symbol such that the following holds. For every -graph , there is a -expansion of such that for all and , it holds that if and only if . We set . Note that, for all , we have that .
Let . We extend and to be able to remove a set of vertices of size at most from and encode the missing information in the remaining graph. For that, for every , we introduce a new -ary relation symbol for every unary relation symbol , we introduce the new unary relation symbol , and we introduce the new -ary relation symbol . Analogously, for every , we introduce two new unary weight symbols for every binary weight symbol . In addition, for all , for all weight symbols , for all that occur in (and may be infinite) and all if is finite, we add the new -ary relation symbol if is a unary weight symbol, and we add the new -ary relation symbol if is a binary weight symbol. Let and denote the resulting signature and the resulting set of weight symbols, respectively. Note that both and are finite.
Claim 4.2.
Let be a -graph, let be pairwise distinct vertices with , let , and let for some .
There is a -expansion of such that for every mapping , there is a formula , where is obtained from by dropping all variables with , with the following properties.
For all , we have that if and only if , where is obtained from by dropping all elements that are contained in , and maps to if , and it maps to if .
Further, for a fixed formula and a fixed mapping , the formulas are structurally identical. That is, the syntax trees of all the formulas have the same inner nodes, and the leaf nodes that do not represent constants from rule (7) coincide. Hence, the dependence on and is only reflected in the use of different constants for rule (7).
Proof.
Let be a -graph, let be pairwise distinct vertices with , let , and let for some .
We use the new relation symbols and to encode whether and , and we let include all vertices such that . The relation symbols and are used to encode whether and . Finally, the unary weight symbols and are used to encode the weights and for all . Formally, we let be the -expansion of with
-
if and only if and , for all unary and ,
-
, for all ,
-
, for all ,
-
if and only if and , for all ,
-
if and only if and , for all unary and all that occur in and all if is finite,
-
if and only if and , for all binary and all that occur in and all if is finite,
-
, for all binary and ,
-
, for all binary and , and
-
, for all binary , , and .
Next, for every mapping , we recursively construct a formula , where is obtained from by dropping all variables with . Intuitively, if , then this indicates that the variable should be replaced by the vertex . For all and , we let be the mapping with for all and . Moreover, for and , we analogously define .
-
(1)
If is of the form , then we let if , if , and else. If is of the form , or is of the form and , or is of the form and , then we let . If is of the form and , then we let . If is of the form and and , then we let . If is of the form and and , then we let . If is of the form and , then we let .
-
(2)
If is of the form and , or is of the form and , then we let . If is of the form and , then we let . If is of the form and , then we let . If is of the form and and , then we let . If is of the form and and , then we let .
-
(3)
If is of the form , then we recursively construct and , and we let . If is of the form , then we recursively construct , and we let .
-
(4)
If is of the form , then we recursively construct for all . We let .
-
(5)
If is of the form for a unary weight symbol of finite type , then we recursively construct for all . We let
If is of the form for a binary weight symbol of finite type , then we recursively construct for all . We let
-
(6)
Finally, if is of the form , then are terms according to rules (7)–(9), and they have at most one free variable, say . If , then we let . Otherwise, we let be the terms obtained from by replacing every occurrence of a term of the form by the constant and every occurrence of a term of the form by the constant . We set .
It follows from the construction that, for all , we have if and only if , where is obtained from by dropping all elements that are contained in , and maps to if , and it maps to if .
Moreover, for a fixed formula and a fixed mapping , the formulas are structurally identical. That is, the syntax trees of all the formulas have the same inner nodes, and even the leaf nodes that do not represent constants from some abelian group or ring (rule (7)) coincide. Hence, the dependence on and is only reflected in the use of different constants for rule (7).
Let , let be pairwise distinct vertices with such that and are -separated in (and thus also in ) by the set , and let . W.l.o.g., we may assume that every vertex from is contained in some path from to in of length at most , so .
By applying 4.2 to , , and , we obtain a -expansion of and, for every mapping , a formula . Since is -separated from by , there is no path from to in . Hence, there are -graphs and such that , , and .
Let and . We have if and only if . Moreover, since is a Boolean combination of -local formulas and statements of the form for a -ary relation symbol , we have that if and only if if and only if . Furthermore, by 4.2, it holds that if and only if , where and are obtained from and , respectively, by dropping all entries that are contained in , and is defined by if and or and , and if and or and . Let and be the tuples of variables obtained analogously from and , respectively.
Using Theorem 2.6, we obtain a Feferman–Vaught decomposition of w.r.t. , that is, a set of pairs of formulas such that if and only if there is a pair in such that and . Since the structure of is independent of and , and only the used constants might differ, it is easy to see from the proof of Theorem 2.6 (see [5] for details) that the size of only depends on and , and that it is independent of and . Furthermore, the number of mappings only depends on and (recall that ), so we can let be an upper bound on the number of pairs in the decomposition for all , , and .
All in all, we have if and only if there is a pair in such that and . Hence, for every , only depends on
-
which vertices of are contained in and
-
which formulas of pairs in any of the are satisfied by , where is obtained from by dropping all entries that are contained in , and ranges over all mappings with, for all , if , and if .
Since the number of possibilities for both can be bounded in terms of and , there is a function such that . This is the statement of Lemma 4.1.
5 VC Density and VC Dimension
In this section, we prove Results (2)–(4) stated in Section 1. Our main result of this section is the following.
Theorem 5.1.
Let be a nowhere dense class of -graphs, and let be a formula. For every , there exists a constant such that for every and every non-empty , we have .
As discussed in the introduction, this immediately implies the following bound on the VC density of formulas.
Corollary 5.2.
Let be a nowhere dense class of -graphs, and let be a formula. The VC density of on is at most .
Moreover, this implies that the VC dimension of formulas on nowhere dense classes is bounded.
Corollary 5.3.
Let be a nowhere dense class of -graphs, and let be a formula. It holds that has bounded VC dimension on .
Proof.
As described in the introduction, Corollary 5.2 already implies Corollary 5.3, since the VC dimension is finite if and only if the VC density is finite (see, e. g., [2]). However, since we find it short and instructive, we also give a proof of Corollary 5.3 based on Theorem 5.1.
Let , , let , and let be the constant from Theorem 5.1 applied to , , and . Moreover, let be such that for all .
Let and such that . Let be the set of vertices appearing in any tuple in . We have . Moreover, we have . Hence, by Theorem 5.1, we have . This shows that , so is not shattered by . Thus, the VC dimension of is less than . Since does not depend on , this proves that has bounded VC dimension on .
For the proof of Theorem 5.1, we rely on the following lemma on the neighbourhood complexity in nowhere dense graph classes. Let be a -graph, and let . For vertices and , a path from to in is called -avoiding if all vertices on the path except for are not contained in . For an and , the -projection of on , denoted by , is the set of all vertices that are connected to by an -avoiding path of length at most .
Lemma 5.4 ([6, Lemmas 21 and 22]).
Let be a nowhere dense class of graphs. There is a function and an algorithm111In [6], the authors even show that this can be computed by a polynomial-time algorithm. However, running-time bounds are not relevant for our purposes. that, given a graph , , , and , computes a set , called the -closure of w.r.t. , with the following properties.
-
1.
,
-
2.
, and
-
3.
for all .
Moreover, for all , it holds that
-
4.
.
We can now prove Theorem 5.1.
Proof of Theorem 5.1.
The proof is similar to the proof of the analogous result for first-order logic in [14], using Lemma 4.1 instead of the corresponding result for FO.
Let be a nowhere dense class of -graphs, let be a formula, and let . Let , , let and be the functions from Lemma 4.1, let be the function from Definition 2.1, and let and . We have that no graph contains as a depth- minor.
By Theorem 2.2, there is a number and a polynomial such that, for every graph , every , and every set with , there are sets and with and such that all distinct are -separated by in . Let be the degree of .
Let , and let be a non-empty set of vertices. We set , and we let be the -closure of w.r.t. , obtained via Lemma 5.4. We shall prove that
() |
where omits factors depending only on and . Since , we have . Moreover, by Lemma 5.4, we have , and we have by the choice of , so
which is the statement of Theorem 5.1.
It remains to prove ( ‣ 5). Recall that . We partition the tuples based on their projection into sets . That is, two tuples are contained in the same set for some if and only if . By Item 4 of Lemma 5.4, there are at most different projections of vertices in on , so we have . Hence, to prove ( ‣ 5), it suffices to show that
() |
for all , since then .
Let , and let be the -projection of on for any (and, due to the definition of , for all) . By Item 3 of Lemma 5.4, we have .
Let be a maximal subset of such that all pairwise distinct tuples from have different types . Note that . Now let be the maximum number with . Then .
By Theorem 2.2, as described above, there are sets and with and such that all distinct are -separated by in .
We partition into two sets , where contains all tuples that are -separated by from , and contains the remaining tuples. By Lemma 4.1, since all tuples in are -separated by from , and all tuples in have distinct types, we know that . Moreover, for every tuple , there is a vertex such that and are not -separated by in . Note that we can choose to be contained in . Moreover, since all tuples in are mutually -separated by in , we know that for two distinct tuples , the vertices in connected to them by paths of length at most avoiding must also be distinct. This shows that . Combined, we obtain that . Furthermore, since , we have
where the last inclusion holds because by the choice of . This proves ( ‣ 5), which, as discussed above, implies the statement of Theorem 5.1.
6 Stability
In this section, we provide the following bound on the ladder index of formulas and formulas on nowhere dense classes of weighted graphs. Based on this, we prove Result (5) stated in Section 1.
Theorem 6.1.
There are computable functions and such that, for every formula , for every , and for every -graph excluding as a depth- minor, the ladder index of in is at most .
Proof.
The proof is similar to the proof of the analogous statement in [14] for first-order formulas. Let and be the functions from Lemma 4.1. We set .
Let be a formula, let , and let be the class of -graphs excluding as a depth- minor. Let , and let be the number and be the polynomial computed from , , and using Theorem 2.2. Moreover, let . (Note that and can be computed from and .) We show that every -ladder in every graph has length less than .
Towards a contradiction, suppose there are a graph and tuples and that form a -ladder in , that is, if and only if . In particular, the tuples are pairwise distinct, and the same holds for the tuples . Let . By Theorem 2.2, for , since , there are sets and with and such that all distinct are -separated by in . Let . Let be an alternating partition of , that is, for all successive , there is exactly one with . Note that . Let be the set of vertices appearing in a tuple with , and let be the set of vertices appearing in a tuple with . Since all distinct are -separated by in , it also holds that the sets and are -separated by in .
Now we can apply Lemma 4.1 to and , and we obtain . Hence, there are two indices with such that . Let with . Then if and only if , so if and only if . However, this contradicts and being a -ladder, because we need to have (since ) and (since ). This shows that there is no -ladder in of size at least , so the ladder index of in is at most .
We call a class of weighted graphs -stable (-stable) if the ladder index of every () formula in every weighted graph from is bounded by a constant depending only on and .
Corollary 6.2.
Every nowhere dense class of weighted graphs is -stable and -stable.
Proof.
Let be a nowhere dense class of -graphs, let be a formula in , and let and . By Definition 2.1, there is a function such that for all and , it holds that does not contain as a depth- minor.
Let and be the functions from Theorem 6.1. For all , we have that does not contain as a depth- minor. Thus, by Theorem 6.1, for every , the ladder index of in is at most , which only depends on and .
7 Final Remarks
In this paper, we have presented upper bounds on the VC dimension and the ladder index as well as optimal bounds on the VC density of formulas in the first-order logic with counting and the first-order logic with weight aggregation on nowhere dense classes of vertex- and edge-weighted graphs. This lifts results of Adler and Adler [1] and results of Pilipczuk, Siebertz, and Toruńczyk [14] from first-order logic to substantially more expressive logics.
In [4], van Bergerem, Grohe, and Ritzert combined the result by Adler and Adler with the fixed-parameter tractable (fpt) model-checking result for FO on nowhere dense graph classes [7] to prove learnability results for FO on nowhere dense graph classes in the Probably Approximately Correct (PAC) learning framework. We remark that, by combining our results on the VC dimension for formulas with the fpt model-checking result for by Grohe and Schweikardt [8], we also obtain fpt PAC learnability for -definable concepts over nowhere dense graph classes. We are currently working on lifting these model-checking and learnability results from to .
References
- [1] Hans Adler and Isolde Adler. Interpreting nowhere dense graph classes as a classical notion of model theory. Eur. J. Comb., 36:322–330, 2014. doi:10.1016/j.ejc.2013.06.048.
- [2] Matthias Aschenbrenner, Alf Dolich, Deirdre Haskell, Dugald Macpherson, and Sergei Starchenko. Vapnik–Chervonenkis density in some theories without the independence property, I. Transactions of the American Mathematical Society, 368(8):5889–5949, August 2016. doi:10.1090/tran/6659.
- [3] Steffen van Bergerem. Learning concepts definable in first-order logic with counting. In 34th Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2019, Vancouver, BC, Canada, June 24–27, 2019, pages 1–13. IEEE, 2019. doi:10.1109/LICS.2019.8785811.
- [4] Steffen van Bergerem, Martin Grohe, and Martin Ritzert. On the parameterized complexity of learning first-order logic. In PODS 2022: International Conference on Management of Data, Philadelphia, PA, USA, June 12–17, 2022, pages 337–346. ACM, 2022. doi:10.1145/3517804.3524151.
- [5] Steffen van Bergerem and Nicole Schweikardt. Learning concepts described by weight aggregation logic. In 29th EACSL Annual Conference on Computer Science Logic, CSL 2021, Ljubljana, Slovenia (Virtual Conference), January 25–28, 2021, volume 183 of LIPIcs, pages 10:1–10:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2021. doi:10.4230/LIPIcs.CSL.2021.10.
- [6] Kord Eickmeyer, Archontia C. Giannopoulou, Stephan Kreutzer, O-joung Kwon, Michał Pilipczuk, Roman Rabinovich, and Sebastian Siebertz. Neighborhood complexity and kernelization for nowhere dense classes of graphs. In 44th International Colloquium on Automata, Languages, and Programming, ICALP 2017, July 10–14, 2017, Warsaw, Poland, volume 80 of LIPIcs, pages 63:1–63:14. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2017. doi:10.4230/LIPICS.ICALP.2017.63.
- [7] Martin Grohe, Stephan Kreutzer, and Sebastian Siebertz. Deciding first-order properties of nowhere dense graphs. J. ACM, 64(3):17:1–17:32, 2017. doi:10.1145/3051095.
- [8] Martin Grohe and Nicole Schweikardt. First-order query evaluation with cardinality conditions. In Proceedings of the 37th ACM SIGMOD-SIGACT-SIGAI Symposium on Principles of Database Systems, PODS 2018, Houston, TX, USA, June 10–15, 2018, pages 253–266. ACM, 2018. doi:10.1145/3196959.3196970.
- [9] Martin Grohe and György Turán. Learnability and definability in trees and similar structures. Theory Comput. Syst., 37(1):193–220, 2004. doi:10.1007/s00224-003-1112-8.
- [10] Dietrich Kuske and Nicole Schweikardt. First-order logic with counting. In 32nd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2017, Reykjavík, Iceland, June 20–23, 2017, pages 1–12. IEEE Computer Society, 2017. doi:10.1109/LICS.2017.8005133.
- [11] Jaroslav Nešetřil and Patrice Ossona de Mendez. First order properties on nowhere dense structures. J. Symb. Log., 75(3):868–887, 2010. doi:10.2178/jsl/1278682204.
- [12] Jaroslav Nešetřil and Patrice Ossona de Mendez. On nowhere dense graphs. Eur. J. Comb., 32(4):600–617, 2011. doi:10.1016/j.ejc.2011.01.006.
- [13] Jaroslav Nešetřil and Patrice Ossona de Mendez. Sparsity – Graphs, Structures, and Algorithms, volume 28 of Algorithms and combinatorics. Springer, 2012. doi:10.1007/978-3-642-27875-4.
- [14] Michał Pilipczuk, Sebastian Siebertz, and Szymon Toruńczyk. On the number of types in sparse graphs. In Proceedings of the 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, LICS 2018, Oxford, UK, July 09–12, 2018, pages 799–808. ACM, 2018. doi:10.1145/3209108.3209178.
- [15] Klaus-Peter Podewski and Martin Ziegler. Stable graphs. Fundamenta Mathematicae, 100(2):101–107, 1978. URL: http://eudml.org/doc/210953.
- [16] Norbert Sauer. On the density of families of sets. J. Comb. Theory A, 13(1):145–147, 1972. doi:10.1016/0097-3165(72)90019-2.
- [17] Saharon Shelah. A combinatorial problem: stability and order for models and theories in infinitary languages. Pacific Journal of Mathematics, 41(1):247–261, 1972. doi:10.2140/pjm.1972.41.247.
- [18] Katrin Tent and Martin Ziegler. A Course in Model Theory. Lecture Notes in Logic. Cambridge University Press, 2012. doi:10.1017/CBO9781139015417.
- [19] Vladimir Naumovich Vapnik and Alexey Ya. Chervonenkis. On the uniform convergence of relative frequencies of events to their probabilities. Theory of Probability and its Applications, 16:264–280, 1971. doi:10.1137/1116025.