We consider the length of the longest word definable in FO and MSO via a formula of size n. For both logics we obtain as an upper bound for this number an exponential tower of height linear in n. We prove this by counting types with respect to a fixed quantifier rank. As lower bounds we obtain for both FO and MSO an exponential tower of height in the order of a rational power of n. We show these lower bounds by giving concrete formulas defining word representations of levels of the cumulative hierarchy of sets. For the two-variable fragment of FO we obtain quadratic lower and upper bounds for the definability numbers of quantifier rank k fragments. In addition, we consider the Löwenheim–Skolem and Hanf numbers of these logics on words and obtain similar bounds for these as well.
We consider the succinctness of defining words. More precisely, if we allow formulas of size up to n in some logic, we want to know the length of the longest word definable by such formulas.
This question is not very interesting for all formalisms. An example where this is the case is given by regular expressions. There is no smaller regular expression that defines a word than the word itself. This result is spelled out at least in the survey [3]. However, the situation is completely different for monadic second-order logic MSO over words with linear order and unary predicates for the letters. Even though MSO has the same expressive power as regular expressions over words, it is well-known that MSO is non-elementarily more succinct. This follows from the results in the PhD thesis [16] of Stockmeyer. In fact, he proved that the problem whether the language defined by a given star-free generalized regular expression has non-empty complement is of non-elementary complexity with respect to the length of the expression. Since star-free generalized expressions can be polynomially translated into first-order logic FO, it follows that already FO is non-elementarily more succinct than regular expressions. In the article [15], Reinhardt uses a variation of Stockmeyer’s method for proving similar non-elementary succinctness gaps between finite automata and the logics MSO and FO.
In this paper our focus is in the definability of words in MSO and FO. As far as we know, this aspect of succinctness has not been considered previously in the context of words. We show that these logics can define words of non-elementary length via formulas of polynomial size.
In order to argue about definability via formulas of bounded size, we define the size n fragments and that include only formulas of size up to n. We also define similar quantifier rank k fragments and and use them to prove our upper bounds. Both of these types of fragments are essentially finite in the sense that they contain only a finite number of non-equivalent formulas. We call the length of the longest word definable in a fragment the definability number of that fragment. Using this concept, our initial question is reframed as studying the definability numbers of and .
The definability number of a fragment is closely related to the Löwenheim–Skolem and Hanf numbers of the fragment. The Löwenheim–Skolem number of a fragment is the smallest number m such that each satisfiable formula in the fragment has a model of size at most m. The Hanf number is the smallest number l such that any formula with a model of size greater than l has arbitrarily large models. These were originally defined for extensions of first-order logic in the context of model theory of infinite structures, but they are also meaningful in the context of finite structures. For a survey on Löwenheim–Skolem and Hanf numbers both on infinite and finite structures see [2]. For previous research on finite Löwenheim–Skolem type results see [5] and [6].
We also consider the definability numbers of quantifier rank k fragments of first-order logic with two variables . In the context of words, the number of variables is an important parameter for first-order logic. Over words, three variables suffice to define any first-order definable property [9]. On the other hand, one variable offers very limited expressive power. Thus, two variables is naturally a very interesting and well-studied case. The expressive power of two variables over words has been shown to be the same as unary temporal logic [4] as well as one quantifier alternation in [17]. By combining the results of [17] with those of [14], we see that two variables also corresponds to unambiguous regular languages.
Aside from what we have already mentioned, related work includes the article [12] of Pikhurko and Verbitsky, where they consider the complexity of single finite structures. They study the minimal quantifier rank in FO of both defining a single finite structure and separating it from other structures of the same size. In [11] the same authors and Spencer consider quantifier rank and formula size required to define single graphs in FO. The survey [13] by Pikhurko and Verbitsky covers the above work and more on the logical complexity of single graphs in FO. By logical complexity they mean minimal quantifier rank, number of variables and length of a defining formula as functions of the size of the graph. They give an extensive account of these measures and relate them to each other, the Ehrenfeucht–Fraïssé game and the Weisfeiler–Lehman algorithm. An important difference between our approach and theirs is that we take formula size as the parameter and look for the longest definable word, whereas they do the opposite.
Our contributions are upper and lower bounds for the definability, Löwenheim–Skolem and Hanf numbers of the size n fragments of FO and MSO on words. The upper bounds in Section 3 are obtained by counting types with respect to the quantifier rank fragment. The upper bounds for both FO and MSO are expressions containing exponential towers of height . The lower bounds in Sections 4 and 5 are given by concrete polynomial size formulas that define words of non-elementary length based on the cumulative hierarchy of sets. The lower bounds are exponential towers of height for FO and for MSO, respectively.
An anonymous referee pointed out that lower bounds similar to ours can be obtained by adapting the method used by Reinhardt in [15], which in turn is based on the work of Stockmeyer [16]. However, our formulas are based on the cumulative hierarchy of sets instead of the binary counters used in Stockmeyer and Reinhardt. Furthermore, we emphasize defining single words and relate the bounds to Löwenheim–Skolem and Hanf numbers.
Note that our results only apply in the context of words. If finite structures over arbitrary finite vocabularies are allowed, then there are no computable upper bounds for the Löwenheim–Skolem or Hanf numbers of the size n fragments of FO. For the Löwenheim–Skolem number, this follows from Trakhtenbrot’s theorem1
Trakhtenbrot’s theorem states that the finite satisfiability problem of FO is undecidable. Hence there cannot exist any computable upper bound for the size of models that need to be checked to see whether a given formula is satisfiable.
(see, e.g., [10]), and for the Hanf number, this follows from a result of Grohe in [5]. Clearly the same applies for the size n fragments of MSO as well.
This paper is an extended version of the conference contribution [7]. In this version we have obtained tighter upper bounds on the numbers of types and thus definability numbers of and in Section 3. For , the upper bound in [7] was , using the modified exponential tower notation defined in this version. The new bound of gets rid of the polynomial on top of the tower and introduces a square root. For the bound in [7] was . The new bound of reduces the top polynomial to a linear one and introduces a third root. In addition, we have added the entirely new Section 6, where we investigate the definability numbers of two variable logics .
Preliminaries
The logics we consider in this paper are first-order logic FO and monadic second-order logic MSO and their (typically finite) fragments. The syntax and semantics of these are standard and well known. We direct the reader to [1] and [10] for in-depth introductions of these logics. In terms of structures we limit our consideration to words of the two letter alphabet .
When we say that a word satisfies a logical sentence, we mean the natural corresponding word model does. A word model is a finite structure with linear order and unary predicates and for the two symbols. Since we only consider words over the two letter alphabet Σ, we will tacitly assume that all formulas of are in the vocabulary of the corresponding word models (and similarly for -formulas). We denote the length of a word by . We will also assume that all word models w with have domain . We will use the notation also elsewhere.
For and , an a-chain is a maximal subword of w that consists of consecutive letters a. Since we operate on the two letter alphabet , we have a-chains and b-chains, which we also collectively refer to as chains. For example, the word consists of three chains: two a-chains of lengths 2 and 1, with a b-chain of length 3 in between.
To work with formulas of and with free variables, we define the notion of an -interpretation , where , is a tuple of sets of points in w, and is a tuple of points in w. Naturally if w is the empty word ε, then and no points can be interpreted. For a formula with second-order variables and first-order variables , we also define the truth relation as , where the operator / denotes interpreting the variables on the right as the values on the left. For we similarly define s-interpretations and the truth relation .
The size of a formula is defined recursively as follows:
for atomic φ,
,
,
.
For the size n fragment of , denoted , consists of the formulas of with size at most n. Size as well as size n fragments are defined in the same way for .
The quantifier rank of a formula is defined recursively as follows:
for atomic φ,
,
,
.
For , the quantifier rank k fragment of , denoted , consists of the formulas with . The quantifier rank k fragment of is defined in the same way and denoted .
Note that both size n fragments and quantifier rank k fragments are essentially finite in the sense that they contain only finitely many non-equivalent formulas.
For each (finite) fragment L of or , we define the relation on nonempty Σ-words as
Clearly is an equivalence relation on . We denote the set of equivalence classes of shortly by and define a notation for the number of these classes.
For each (finite) fragment L of or , we denote the number of equivalence classes of by , i.e.
Note that each equivalence class of is uniquely determined by a subset of L-sentences, which we call the L-type of w.
For quantifier rank fragments and we define similar concepts also for formulas with free variables.
We define the relation on -interpretations as
The relation is defined in the same way for s-interpretations.
The set of equivalence classes of over -interpretations is denoted by and the number of these classes is denoted by . Furthermore, the set of equivalence classes of over s-interpretations is denoted by and the number of these classes is denoted by .
Note that and , since the empty word ε is taken into account in and , but not in and .
We also consider two-variable first order logic . The syntax and semantics of this logic are defined identically to with the exception that only two variables, x and y, are used. For some of the proofs we utilize a standard Ehrenfeucht–Fraïssé or pebble game found in the literature, see [1,10]. The game has two players, whom we call Spoiler and Duplicator. The parameters of the game are the quantifier rank and two word models w and v.
The two-pebble EF-game is denoted by . The game is played for k rounds and features two pairs of pebbles that start the game off the board. In each round, Spoiler picks up one of either pair of pebbles and moves it on a point p in w or q in v. Duplicator responds by moving the other pebble of the pair to a point q in v or p in w, respectively. After a round, let , and , be the points with pebbles on them. Duplicator wins if after each round, the map is a partial isomorphism between w and v. Otherwise Spoiler wins.
The game characterizes the equivalence of structures for formulas up to quantifier rank k. Using our notation of quantifier rank fragments, we get the following theorem.
Duplicator has a winning strategy forif and only if.
In order to discuss words of non-elementary length and make our bounds precise, we define the exponential tower function as well as the modified exponential tower function , where the number ℓ is on top of the tower. Note that the modified exponential tower is essentially one level higher than the ordinary one since the 1 on top of the ordinary tower is not considered for the height.
The exponential tower function is defined recursively by setting and . The modified exponential tower function is defined recursively by setting and .
Definability, Löwenheim–Skolem and Hanf numbers
Löwenheim–Skolem and Hanf numbers were originally introduced for studying the behaviour of extensions of first-order logic on infinite structures. See the article [2] of Ebbinghaus for a nice survey on the infinite case. As observed in [5], with suitable modifications, it is possible to give meaningful definitions for these numbers also on finite structures. We will now give such definitions for finite fragments L of and , and in addition, we introduce the closely related definability number of L.
We say that a sentence defines a word if and for all . For a fragment L of or , we denote by the set of words definable in L, i.e.
Let φ be a sentence in over Σ-words. If it has a model, we denote by the minimal length of a model of φ: . If φ has no models, we stipulate . Furthermore, we denote by the maximum length of a model of φ, assuming the maximum is well-defined. If the maximum is not defined, i.e., if φ has no models or has arbitrarily long models, we stipulate .
Let L be a finite fragment of or with .
The definability number of L is .
The Löwenheim–Skolem number of L is .
The Hanf number of L is .
Thus, is the length of the longest L-definable word. Note further that is the smallest number m such that every that has a model, has a model of length at most m. Similarly is the smallest number ℓ such that if has a model of length greater than ℓ, then it has arbitrarily long models.
Since every sentence φ of defines a regular language over Σ, and there is an effective translation from to equivalent finite automata, it is clear that we can compute the numbers and from φ. Consequently, for any finite fragment L of , and can be computed from L.
As we mentioned in the Introduction, and are not computable from n if we consider arbitrary finite models instead of words. Clearly the same holds also for the fragments , and .
It follows immediately from Definition 2.9 that the definability number of any finite fragment of is bounded above by its Löwenheim–Skolem number and its Hanf number:
If L is a finite fragment of, then.
It suffices to observe that if , then , where is the sentence that defines w. □
Note that all three cases for the relationship between and are possible. In fact, for any positive integers m and n there is a finite fragment L of such that and , as we show in the next example.
Let be the sentence , and let be the sentence . Then clearly , , , and . Thus, and for the fragment .
Numbers of types and upper bounds
In this section we estimate the number of types for quantifier rank fragments and . Using these estimates we obtain upper bounds for definability numbers, Löwenheim–Skolem numbers and Hanf numbers of both quantifier rank k fragments and size n fragments and .
Definability and types
To count types we must work with -interpretations. Let be an -interpretation and let be an -interpretation. We assume these interpretations have the same second-order variables and no common first-order variables. We define the catenation of and as the -interpretation , where , and for each . Note that for interpretations with different second-order variables we can interpret all missing variables as empty sets before applying this definition.
It is well-known that equivalence of words up to a quantifier rank is preserved in catenation. We formulate this for formulas with free variables:
Letfor some.In particular, ifand, then.
The claim is proved by a straightforward game argument similarly to Proposition 3.1.4 in [1]. □
Using Theorem 3.1, we get the following upper bounds for the numbers and in terms of the quantifier rank of φ:
Letfor some. If φ is a sentence of L, then.
If for all words such that , the claim is trivial. Assume then that and . Then there are two initial segments u and of w such that and . Let v and be the corresponding end segments, i.e., . Then by Theorem 3.1, , and similarly , and hence and .
Since , we see that w is not the shortest word satisfying φ. The argument applies to any word w with , and hence we conclude that . On the other hand , and hence w is neither the longest word satisfying φ. Applying this argument repeatedly, we see that φ is satisfied in arbitrarily long words, and hence . □
From Propositions 2.10 and 3.2 we immediately obtain the following upper bound for the definability numbers of quantifier rank fragments of :
Letand. Then, and consequently.
This upper bound for the definability, Löwenheim–Skolem and Hanf numbers shows that the quantifier rank fragments L of and behave quite tamely on words: Clearly every union of equivalence classes of is definable by a sentence of L and every sentence defines a union of equivalence classes. Hence the number of non-equivalent sentences in L is . Thus, any collection of representatives of non-equivalent sentences of L necessarily contains sentences of size close to . However, in spite of this, it is not possible to define words that are longer than by sentences of L.
This shows that quantifier rank is not a good starting point if we want to prove interesting succinctness results for definability. Hence we turn our attention to the size n fragments and . Note first that for any , is trivially contained in , and similarly, is contained in . A simple argument shows that this can be improved by a factor of 2:
For any,and.
Let with . Thus at least of the size of φ comes from quantifiers, leaving at most for the rest of the formula. We may assume all variables are different. For variables to occur at least once in an atomic subformula of φ, it would take at least atomic formulas and connectives ∧ or ∨ between them. In total, this would require φ to be of size at least . Thus, only n variables of φ occur in some atomic formula. Removing the quantifications of the rest of the variables gives an equivalent formula of quantifier rank n.
The same argument works for as second-order variables P must also occur in atomic formulas to have an effect on the semantics of the formula. □
Note that we have not tried to be optimal in the formulation of Lemma 3.4. We believe that with a more careful analysis, could be replaced with , and possibly with an even larger number.
For any,and.
Number of -types
As we have seen in the previous subsection, the numbers of -types and -types give upper bounds for the corresponding definability, Löwenheim–Skolem and Hanf-numbers. It is well known that on finite relational structures, for this number is bounded above by an exponential tower of height with a polynomial, that depends on the vocabulary, on top (see, e.g., [13] for the case of graphs). It is straightforward to generalize this type of upper bound to . In this subsection and the next one, we carry out a more careful analysis and obtain tighter bounds on the class of Σ-words.
Recall that denotes the number of -types of Σ-words w, where we include the case . To obtain upper bounds for , we also need to consider the number of -types of 1-interpretations . We start by showing that -equivalence of 1-interpretations reduces to -equivalence of corresponding initial and end segments of the words, and -equivalence of words reduces to -equivalence of 1-interpretations arising from the words.
Let be a Σ-word, and let . We denote the initial segment of w by and the end segment by . Furthermore, we denote the single letter word by .
Assume that,,,, and. Then
if and only if,, and.
if and only if for everythere issuch that, and vice versa, for everythere issuch that.
(a) Assume first that the conditions
, , and
hold. Then , , and trivially , and hence by Theorem 3.1, .
On the other hand, if , then and for some sentence . This means that and , where is the relativization of φ to the set of elements smaller than x, i.e., is obtained from φ by replacing each existential subformula by , and each universal subformula by . Since the quantifier rank of ψ is the same as that of φ, we see that . Similarly, if , then . It is also immediately clear that if , then . Thus, if does not hold, then .
Claim (b) is just the standard back-and-forth characterization for (see [1] Theorem 2.3.3). □
We consider next the number of equivalence classes of words with respect , and . In the proof of the following lemma, we denote the set of letters that occur in a word by . Thus, e.g., and .
,, and.
Clearly all words are equivalent with respect to , as there are no quantifier-free sentences. Hence . Furthermore, it is easy to see that two words are equivalent with respect to if and only if . Thus, . (Note that ∅ corresponds to the equivalence class containing only the empty word.)
To prove that we give a list of 97 Σ-words, and show that every word is -equivalent with one of the words in the list. We list the words in groups based on the total number of chains.
the empty word ε (the unique word without a- or b-chains)
and for
and for
and for and
and for
and for .
Clearly group (1) contains 6 words, group (2) contains 18 words, group 3 contains 24 words, group (4) contains 32 words, and group (5) contains 16 words. Thus there are words in the list.
Our goal is now to prove that for any there is a word v in the list such that . We divide the proof into cases according to the total number of chains in w. By the obvious symmetry, we can omit cases where the first letter of w is b.
In the proof we use the following observations. By Lemma 3.6, to prove that and are -equivalent it suffices to show that there is a relation such that , , and the condition
, , and
holds for any pair . We say that the relation is total on w and v if and .
Moreover, as noted above, two words and are -equivalent if an only if . Thus, the condition above can be replaced with the condition
, , and .
Assume now that . We have the following cases based on the number of chains in w.
The case is trivial.
Assume that for some . If , then w is in the list, and hence the claim holds. If , we let . Then the following hold:
for all and ,
for any , and ,
for any , and .
Thus defining , we see that , and whenever . Hence we have .
Assume next that for some . Let , where and . Then v is in group (2), and by case (1), and . Hence follows from Theorem 3.1.
Assume then that for some . Let , where , and . Then v is in group (3). Let consist of pairs of points that are in corresponding positions in corresponding chains, i.e., , where
,
,
.
Thus, relates the first a in the chain to the first a in , and the rest of the a’s in to the second a in (note however, that if , then the second part in is empty.) Similarly, relates the first and last b in the chain to the first and last b, resp., in , and all other b’s in to the second b in . Finally, is similar to , except that the last a’s in the chains and are related.
Clearly R is total on w and v. We show now that holds for all pairs in R. For all pairs it is obvious that , as R respects the correspondence between chains. For the pair we have and . For pairs in the second part of we have and ; these are also the values of , , , for the first pair in , unless , in which case . The case is symmetric to the previous one, and for pairs in the second part of we have . Finally, the pairs in are handled symmetrically to those in .
Assume then that for some . Let , where , , and . Then v is in group (4). Using the same idea as in case (3), we relate the first points in the first chains and with the first elements of and , respectively, and the rest of the points in these chains (if any) with the second elements in and . The points in the last two chains , , and are related in a symmetric way. Thus, we define by setting
,
,
,
.
Clearly R is total on w and v, and with a similar argument as in case (3), we can verify that holds for all pairs .
Assume then that for some . This time we let , where , , and . Then v is in group (5). We define again relations , , , and between the corresponding chains with a similar idea as in the previous cases:
,
,
,
,
.
However, this time we need one more relation that does not respect corresponding chains: if , we need to relate the first b’s in the chain to the second b in . Thus we define
.
We leave it to the reader to verify that the relation is total on w and v, and all pairs satisfy the condition .
Assume then that , where and for all . By case (4), it suffices to show that , where , and . To show this we let R be the bijection that maps the j-th a in w to the j-th a in and the j-th b in w to the j-th b in . Then R is total on w and , and it is easy to verify that holds for all pairs .
The case in which w is of the form for some is handled in the same way by reducing to case (5).
□
In fact we can show that all the words listed in (0)–(5) in the proof above are non-equivalent, and thus . We did not include the straightforward (but tedious) proof here, as we only need the upper bound.
Lemma 3.7 serves as the basis in proving a recursive upper bound for the numbers in Theorem 3.11. In the next two lemmas, we provide the recursion formula for these numbers needed in the induction step.
For any,.
Let , , , and . By Lemma 3.6(a), if and only if , , and . Clearly this means that there is a one-to-one correspondence between the set and the set , and consequently we get . □
Let w be a Σ-word with . We denote the set of all -equivalence classes of pairs , , by . Note that .
For any,.
Let w and v be Σ-words. It follows from Lemma 3.6(b) that if , then . In other words, the -type of w is uniquely determined by the set . Hence . □
For any,. Hence also.
By Lemma 3.7, and . On the other hand, and . Hence the claim holds for and .
For , we prove the stronger claim
by induction on k. In the case we have by Lemma 3.7, and , and hence holds.
Assume then that , and the claim holds for k. Using Lemma 3.10 we get the following estimates:
Thus, the claim holds for . □
As a corollary to the above result on the number of types, we obtain upper bounds on the definability, Löwenheim–Skolem and Hanf numbers of .
For any,.
Via Corollary 3.5 we obtain similar upper bounds for the same numbers of size n fragments .
For any,.
Number of -types
In this subsection we prove an upper bound for the number of -types of Σ-words. Recall that we denote by the number of -types of interpretations of the form , and by the number of -types of interpretations . We proceed with similar steps as in the previous subsection: we compute first the numbers and . Then we prove a recursion formula for in terms of . This proof is based on reducing to and to , in analogue with Lemmas 3.9 and 3.10.
For any,and.
All -interpretations are equivalent with respect to , as there are no formulas that do not contain any first-order variables. Hence .
To prove the second claim, we introduce first some auxiliary notions. Let be an -interpretation. The atomic profile of p in is , where . Note that here the letter a is treated via the predicate and the letter b is then handled as the complement of . Furthermore, the total atomic profile of is , where .
Observe now that two -interpretations and cannot be separated in by any formula starting with a second-order quantifier. Thus, and are equivalent with respect to if and only if for every p in w there is q in v (and vice versa, for every q in v there is p in w) such that . Clearly holds if and only if . Thus we see that if and only if . In other words, the set uniquely determines the -equivalence class of . Note further that for any subset there exists an -interpretation such that . Thus we conclude that . □
We prove next the analogue of Lemma 3.9 for . In the proof we use the following notation: if is an -interpretation and for , then for each , and . The notations and are defined analogously.
For any,.
Assume that and are -interpretations. With a similar argument as in the proof of Lemma 3.6(a), we see that if and only if the condition
holds. Thus, we see that there is a one-to-one correspondence between the sets and , and hence . □
Next we prove the recursion formula for the numbers ; note that while the subscript reduces to k on the right hand side, the superscript r increases to . Fortunately this is not a problem, as we will see in the proof of Theorem 3.17.
Let be an -interpretation with . We denote the set of all -equivalence classes of -interpretations , , by and the set of all -equivalence classes of -interpretations , , by . Note that and .
For any,.
Let and be interpretations, where and . Using again the standard back-and-forth argument, if and only if the following conditions hold:
for every there is such that ,
for every there is such that ,
for every there is such that , and
for every there is such that .
(This is a straightforward generalization for of the back-and-forth argument of in Theorem 2.3.3 of [1].)
Thus, if and , then . This means that the -type of is uniquely determined by the two sets and , and consequently which is equal to by Lemma 3.15.
Clearly , and hence . The claim follows from this since by Lemma 3.14, and clearly for any . □
For anyand,. In particular,.
We prove that the claim holds for any r by induction on k. By Lemma 3.14, we have and . On the other hand, we have and , since . Thus, the claim holds for and .
Assume then that , and the claim holds for k and any r. Using Lemma 3.16 we get the following estimates:
Thus, the claim holds for . □
We can now formulate the upper bounds for definability, Löwenheim–Skolem and Hanf numbers for quantifier rank k fragments of .
For any,.
Using Corollary 3.5 we get the following upper bounds of the same numbers for the size n fragments of .
For any,.
In the next two sections we will prove lower bounds for the definability numbers of and by providing explicit polynomial size sentences that define words that are of exponential tower length.
Lower bounds for FO
In order to obtain a lower bound for we need a relatively small -formula that defines a long word. The long word we define has to do with the cumulative hierarchy of finite sets.
The finite levels of the cumulative hierarchy are defined by and . We represent finite sets as words using only braces { and } in a straightforward fashion. For example is encoded as and as . has two possible encodings: and . It is well known that . Thus the encodings of have length at least . We will define one such word via an -formula of polynomial size with respect to i.
For the encoding, we will consider a to be the left brace { and b the right brace }. For readability, we define formulas and that say x is a left or right brace, respectively. We also define that says y is the successor of x.
As each set in the encoding can be identified by its outermost braces, the formula mostly operates on pairs of variables. For readability we adopt the convention , and similarly for different letters, to denote these pairs. To ensure that our formula defines a single encoding of , we also define a linear order on encoded sets and require that the elements are in that order.
We define our formula recursively in terms of many subformulas. We briefly list the meanings and approximate sizes of each subformula involved:
: the common core formula used in the formulas and defined below. States that every brace y between and has a pair z such that the pair satisfies θ. In practice, θ will be another step of a similar recursion. The variables s and t are used to deal with both cases and at once, making the formula smaller.
: correctly encodes a set in , possibly with repetition. Size linear in i.
: is an element of . Size linear in i. Assumes that encodes a set in and encodes a set in . The part with is used to ensure that is an element of and not for example an element of an element.
: and encode the same set, possibly in a different order. Size . Assumes and encode sets in . The two implications on the second line are used to deal with the symmetry of and at once, making the formula smaller.
: the -greatest element of the symmetric difference of and is in . Size . Defines a linear order for encoded sets in . The set is in , is not in and is larger than any that is in but not in .
: correctly encodes a set in with no repetition and with the elements in the linear order given by the formula . Size . Ensures that only a singular word satisfies our formula.
: States that . Size . Assumes and encode sets in and encodes a set in . The first line states that , the second line states and the two final lines state .
: encodes the set . Size . States that is an ordered encoding, , and for all and , we have .
: the entire word is the ordered encoding of the set . Size .
The formula defines a word w that, as an encoding of the set , has length at least . The size of is and thus . Let c be a constant such that so . As we want to relate the length of w to the size of , we set and obtain the following result:
For some constantthere are infinitely manysatisfying
Proposition 2.10 immediately gives the same bound for the Hanf number.
For some constantthere are infinitely manysatisfying
By omitting the subformula from the above we get a formula of size that is no longer satisfied by only one word but still only has large models. With this formula we obtain a lower bound for the Löwenheim–Skolem number.
For somethere are arbitrarily largesatisfying
Lower bounds for MSO
In this section, we define a similar formula for MSO as we did above for FO. The formula again defines an encoding of but for MSO our formula is of size compared to the of FO. We achieve this by quantifying a partition of so called levels for the braces and thus the encoded sets and using a different method to define only a single encoding. The monadic predicates are used throughout the formulas and only quantified at the beginning of the recursion.
The level of the entire encoded set will be equal to the maximum depth of braces inside the set. The level of an element of a set will always be one less than the level of the parent set. This means that there will be instances of the same set with different levels in our encoding. For example in the encoding the outermost braces are in , both of the elements are in and the empty set in the second element is in .
We again define our formula in terms of many subformulas and briefly list the meaning and size of each subformula:
: encodes a set of level i. Size constant. Here we only require that there are no braces of the same level between and , leaving the rest to the formula below.
: The relations define the levels of sets as intended and there are no odd braces without pairs. Size . States that every brace has a level, no brace has two different levels, every set encloses only braces of lower levels and every brace has a pair of the same level to form a set.
: is an element of . Size constant. Assumes encodes a set of level i and encodes a set of level .
: and encode the same set. Size linear in i. Assumes and encode sets of level i. Similar to the FO case.
: States that . Size linear in i. Assumes and encode sets of level i and encodes a set of level . Similar to the FO case.
: encodes the set . Size . Assumes the level partition is given. Similar to the FO case with no ordering.
: Quantifies the level partition and states the subword from x to y encodes . Size .
We now have a formula that says the subword from x to y encodes the set . There are still multiple words that satisfy this formula, since different orders of the sets and even repetition are still allowed. To pick out only one such word, we use a lexicographic order, where a shorter word always precedes a longer one.
Let be the formula obtained from by replacing each occurrence of with and with . We define the final formula of size that says the entire word model is the least word in the lexicographic order that satisfies the property of . We check that no lexicographically smaller word satisfies by quantifying the word under consideration on top of the same word model using the variables and for the two letters. We first ensure that and partition the model and then use as the cut-off point for the possibly shorter word we want to quantify. If we check the lexicographic order with z as the first different symbol. Finally we state that the quantified word does not satisfy .
We have used the lexicographic order here to select only one of the possible words that satisfy our property. Note that this can be done for any property. The size of such a formula will depend polynomially on the size of the alphabet, as well as linearly on the size of the formula defining the property in question.
We obtain the lower bound for the definability number as in the FO case.
For some constantthere are infinitely manysatisfying
We get the same bounds for and via Proposition 2.10.
For some constantthere are infinitely manysatisfying
Two-variable logic
In this section we prove upper and lower bounds on the definability numbers of quantifier rank k fragments of first-order logic with two variables .
For the upper bound on we use the k-round, 2-pebble EF-game . For details on the game, see for example [1]. We prove two separate lemmas that together allow us to show that a long enough word cannot be separated from a shorter one with two variables and quantifier rank k.
Letand letcontain an a-chain of length at leastand letbe obtained from w by removing from such a chain all other letters but the first k and the lastletters. Then.
We consider the k-round 2-pebble EF-game . If w and v are as in the claim, then each point has a directly corresponding point in w as v is obtained by removing points from w. We denote this corresponding point by . Note that for the shortened chain, the correspondence is between the first k letters and the last letters of the chain in each word. We denote the subword of w consisting of only the long a-chain of the claim with u. With fixed we call the part of u excluding the first m letters and the last letters the middle part of u. When Spoiler moves one of the pebbles we call the other pair of pebbles that is not moved the stationary pebbles.
We describe a strategy for Duplicator in . We show that the strategy maintains both partial isomorphism and the following conditions with m rounds left in the game:
If the stationary pebbles are not in the middle part of u on either side, then they are on a pair .
Otherwise, the stationary pebbles are in the middle part of u on both sides.
Note that the above conditions hold in the starting position as there are no stationary pebbles.
Consider the next move in a k-round 2-pebble game with words w and v as in the claim with rounds left to play and assume the conditions above hold.
If Spoiler moves on a stationary pebble, then Duplicator responds with the point, where the other stationary pebble is. This clearly maintains partial isomorphism. Below we assume that Spoiler always moves on a different point.
If Spoiler moves anywhere but the middle part of u, then Duplicator responds with the corresponding point according to f, resulting in a pair . This along with the conditions clearly maintains partial isomorphism.
For the rest of the proof, assume Spoiler moves in the middle part of u in w or v. If , then there are no stationary pebbles. Duplicator responds with the k-th letter of u in the opposite word. Partial isomorphism clearly holds.
Assume and the stationary pebbles are on the pair , where i is the m-th letter of the chain u in v. Now Duplicator responds with the -th letter from the end of u in the opposite word. The new pair is to the right of the old one in both words so partial isomorphism is maintained.
If and the stationary pebbles are on a pair , where i is not the m-th letter of the chain u in v, then Duplicator moves to the m-th letter of u in the opposite word. This clearly maintains partial isomorphism.
Finally assume and that the stationary pebbles are in the middle part of u in both words. Now if the move of Spoiler is to the left of the stationary pebble in one of the words, Duplicator responds with the m-th letter of u in the opposite word. If the move of Spoiler is to the right of the stationary pebble, Duplicator responds with the -th letter from the end of u in the opposite word. Clearly this maintains partial isomorphism.
It remains to show that conditions 1 and 2 are maintained by this strategy. When Spoiler picks up a pebble for the next move, condition 1 clearly holds as Duplicator has respected the correspondence f. For condition 2 we see that Duplicator has responded to moves in the middle part of u with either the m-th letter of u or the -th letter from the end of u. In the following position with rounds left, these points are in the middle part of u in both words. Thus conditions 1 and 2 are maintained.
Since Duplicator has a winning strategy for the game , by Theorem 2.6, we obtain . □
Letand letwith at leastchains. Ifis obtained from w by removing all other chains except the first k and the last k chains, then.
We again consider . If w starts and ends with the same letter , then we remove the last c-chain from w and use the resulting and corresponding for the proof instead. When we have obtained , we can use Theorem 3.1 to obtain . By symmetry we assume that w starts with a and ends with b.
For words w and v as in the claim, each point has a directly corresponding point in w as v was obtained by shortening w. We denote this point by . When Spoiler moves one of the pebbles we call the other pair of pebbles that is not moved the stationary pebbles.
We describe a strategy for Duplicator in . We show that the strategy maintains both partial isomorphism and the following conditions with m rounds left in the game:
If one stationary pebble is on a point within the first or last m chains of w, then the corresponding pebble is on .
Otherwise, neither of the stationary pebbles is within the first and last m chains of w or v, that is, the stationary pebbles are in the middle part of w and v.
Note that the above conditions hold in the starting position as there are no stationary pebbles.
Consider the next move in an k-round 2-pebble game with words w and v as in the claim with rounds left to play and assume the conditions hold.
If Spoiler moves on a stationary pebble, then Duplicator responds with the point, where the other stationary pebble is. This clearly maintains partial isomorphism. Below we assume that Spoiler always moves on a different point.
If Spoiler moves within the first or last m chains in w or v, then Duplicator responds with the corresponding point, resulting in a pair . If the stationary pebbles follow the correspondence f, then clearly partial isomorphism holds. Otherwise the stationary pebbles are in the middle part of both w and v and partial isomorphism holds because the corresponding points i and are both either on the left or the right side of the words.
For the rest of the proof, assume Spoiler moves on a letter in the middle part of , that is, not within the first or last m chains. Let , be the opposite word, where Duplicator moves. If , then there are no stationary pebbles and Duplicator moves in the k-th chain in u. Partial isomorphism trivially holds.
If and the stationary pebbles are on a pair , where i is in the m-th chain in v, then Duplicator moves to the m-th chain from the end in u. Now partial isomorphism holds as the pair is to the left of the middle part of t and the last m chains of u.
If and the stationary pebbles are on a pair , where i is not in the m-th chain in v, then Duplicator moves to the m-th chain in u. This clearly maintains partial isomorphism.
Finally assume and that the stationary pebbles are somewhere in the middle part of both w and v as in condition 2. Now if the move of Spoiler is to the left of the stationary pebble in t, then Duplicator moves to the m-th chain in u. If the move is to the right of the stationary pebble in t, then Duplicator moves to the m-th chain from the end of u. Clearly this maintains partial isomorphism.
It remains to show that conditions 1 and 2 still hold, when Spoiler picks up a pebble in the following position. Clearly condition 1 holds since Duplicator has respected the correspondence f. For condition 2 we see that Duplicator has responded to moves in the middle part of either word by playing in the m-th chain counting from the beginning or end of the other word. In the following position with rounds left, these pebbles are not within the first and last chains of w or v. Thus the conditions 1 and 2 are maintained by this strategy.
Since Duplicator has a winning strategy for the game , by Theorem 2.6, we obtain . □
The two above lemmas allow us to prove the following theorem as a lower bound to the Löwenheim–Skolem number, Hanf number and definability number of .
For any,,and hence also.
Let be a word with . Since , by the pigeonhole principle there is a chain with length at least or at least chains. Now by Lemmas 6.1 and 6.2, there is a shorter word with . Recall that for a formula φ, is the length of the shortest model of φ. We obtain for all and therefore .
For the Hanf number, consider a word with . Since , there is a chain with length at least or at least chains. In the first case, by increasing the length of this long chain one can obtain words w with arbitrary length that are by Lemma 6.1 equivalent with v. In the second case, by increasing the number of chains one can again obtain words w of arbitrary length that are by Lemma 6.2 equivalent with v. Thus . □
For the lower bound on we give a formula that defines a word of quadratic length. We begin with some auxiliary formulas. Our target word starts with a and ends with b and this is reflected in the formulas. We define all auxiliary formulas with the free variable x and the understanding that the roles of x and y can be switched in nested formulas, when necessary.
The formula states that x is in an a-chain that is at least the m-th one from the left. Similarly, the formula states that x is in at least the m-th b-chain. Our target word starts with a and this causes some differences between the two formulas.
As a counterpart to the above, the formula states that x is in at most the m-th a-chain from the left. The formula says the same for b.
By combining the above formulas we obtain the formula which states that the point x is in the m-th a-chain of the word.
We also define corresponding formulas , and that say the point x is in the m-th a-chain from the right, or the end of the word. These formulas are obtained from the -formulas by switching the roles of a and b as well as the direction of each instance of the linear order. Formulas , and are obtained in the same way by switching in the -formulas the roles of a and b as well as the direction of the linear order.
The quantifier rank of the formulas and is , while for the formulas and it is .
We move on to formulas that specify the length of each chain in the word.
The formula states that x is the ℓ-th symbol in the m-th a-chain from the left. The formulas , and are defined in the same way, using the appropriate subformulas for a or b and left or right.
The formula states that x is in the m-th a-chain of the word, which has length ℓ. In fact x is the last letter of the chain but we do not use this going forward.
We define in the same way the formulas for b-chains as well as and for the m-th chain from the end of the word. The quantifier rank of the formulas and is , while for the formulas and it is .
We are now ready to define the full formula φ of quantifier rank k, which defines a word w with chains of both a and b. For simplicity, we assume that k is even. The length of the chains decreases by one for each chain as they approach the middle of the word w.
To see that φ defines a single word w, note that the first two lines fix the middle chains of both a and b as length one. The following lines set the length of each chain to the left and to the right of these middle chains. Thus all chains are fixed and only a single word satisfies φ. Assuming k is even, the length of the word w that φ defines is . This proves the following theorem:
For any even,.
Conclusion
We considered the definability number, the Löwenheim–Skolem number and the Hanf number on words in the size n fragments of first-order logic and monadic second-order logic. We obtained exponential towers of various heights as upper and lower bounds for each of these numbers.
For , we obtained the bounds
for some constant c. As corollaries, we obtained the same bounds for and . In addition, by modifying the formula we used for the lower bounds, we obtained a slightly better lower bound of for .
In the case of , the bounds are similarly
for a different constant c. We again immediately obtained the same bounds for and .
The gaps between the lower bounds and upper bounds we have proved are quite big. In absolute terms, they are actually huge, as each upper bound is non-elementary with respect to the corresponding lower bound. However, it is more fair to do the comparison in the iterated logarithmic scale, which reduces the gap to be only polynomial. Nevertheless, a natural task for future research is to look for tighter lower and upper bounds.
For first-order logic with two variables, we obtained the following bounds for the definability numbers of the quantifier rank k fragments for even
The same bounds hold also for the Hanf number, whereas for the Löwenheim–Skolem number the upper bound is . We see that the situation for is completely different from full or as the bounds are not even exponential, not to speak of exponential towers.
Finally, we remark that an exponential tower upper bound for the number of types in the quantifier rank fragments of some logic can be obtained completely generically as in the Appendix of the pre-print [8]. The argument in [8] works in the same way irrespective of the type of quantifiers allowed in . Thus, it can be applied for example in the case where is the extension of with some generalized quantifier (or a finite set of generalized quantifiers). Assuming further that the quantifier rank fragments L of satisfy Theorem 3.1, we can obtain this way an exponential tower upper bound for the numbers , and . On the other hand, note that if the quantifier rank fragments L satisfy Theorem 3.1, then each is an invariant equivalence relation, and hence can only define regular languages. Therefore it seems that our technique for proving upper bounds cannot be used for logics with expressive power beyond regular languages.
Footnotes
Acknowledgements
Miikka Vilander was supported by the Academy of Finland projects Explaining AI via Logic (XAILOG), grant number 345612 (Kuusisto) and Theory of computational logics, grant numbers 352419, 352420, 353027, 324435 and 328987. We would also like to thank an anonymous reviewer for an improvement on the results of Theorem as well as all of their other hard work.
References
1.
H.Ebbinghaus and J.Flum, Finite Model Theory, 2nd edn, Perspectives in Mathematical Logic, Springer, 1995. ISBN 978-3-540-60149-4.
2.
H.-D.Ebbinghaus, Löwenheim–Skolem theorems, in: Philosophy of Logic, D.M.Gabbay, P.Thagard, J.Woods and D.Jacquette, eds, Handbook of the Philosophy of Science, Elsevier Science, 2006. ISBN 9780080466637.
3.
K.Ellul, B.Krawetz, J.Shallit and M.Wang, Regular expressions: New results and open problems, J. Autom. Lang. Comb.10(4) (2005), 407–437. doi:10.25596/jalc-2005-407.
4.
K.Etessami, M.Y.Vardi and T.Wilke, First-order logic with two variables and unary temporal logic, Inf. Comput.179(2) (2002), 279–295. doi:10.1006/inco.2001.2953.
5.
M.Grohe, Some remarks on finite Löwenheim–Skolem theorems, Math. Log. Q.42 (1996), 569–571. doi:10.1002/malq.19960420145.
6.
M.Grohe, Large finite structures with few -types, Inf. Comput.179(2) (2002), 250–278. doi:10.1006/inco.2002.2954.
7.
L.Hella and M.Vilander, Defining long words succinctly in FO and MSO, in: Revolutions and Revelations in Computability – 18th Conference on Computability in Europe, CiE 2022, Proceedings, Swansea, UK, July 11–15, 2022, U.Berger, J.N.Y.Franklin, F.Manea and A.Pauly, eds, Lecture Notes in Computer Science, Vol. 13359, Springer, 2022, pp. 125–138. doi:10.1007/978-3-031-08740-0_11.
8.
L.Hella and M.Vilander, Defining long words succinctly in FO and MSO, pre-print, 2022. doi:10.48550/arxiv.2202.10180.
9.
N.Immerman and D.Kozen, Definability with bounded number of bound variables, Inf. Comput.83(2) (1989), 121–139. doi:10.1016/0890-5401(89)90055-2.
10.
L.Libkin, Elements of Finite Model Theory, Texts in Theoretical Computer Science. An EATCS Series, Springer, 2004. ISBN 3-540-21202-7. doi:10.1007/978-3-662-07003-1.
11.
O.Pikhurko, J.Spencer and O.Verbitsky, Succinct definitions in the first order theory of graphs, Ann. Pure Appl. Log.139(1–3) (2006), 74–109. doi:10.1016/j.apal.2005.04.003.
12.
O.Pikhurko and O.Verbitsky, Descriptive complexity of finite structures: Saving the quantifier rank, J. Symb. Log.70(2) (2005), 419–450. doi:10.2178/jsl/1120224721.
13.
O.Pikhurko and O.Verbitsky, Logical complexity of graphs: A survey, in: Model Theoretic Methods in Finite Combinatorics – AMS-ASL Joint Special Session, Washington, DC, USA, January 5–8, 2009, M.Grohe and J.A.Makowsky, eds, Contemporary Mathematics, Vol. 558, American Mathematical Society, 2009, pp. 129–180. doi:10.1090/conm/558/11050.
14.
J.Pin and P.Weil, Ponynominal closure and unambiguous product, Theory Comput. Syst.30(4) (1997), 383–422. doi:10.1007/BF02679467.
15.
K.Reinhardt, The complexity of translating logic to finite automata, in: Automata, Logics, and Infinite Games: A Guide to Current Research [Outcome of a Dagstuhl Seminar, February 2001], E.Grädel, W.Thomas and T.Wilke, eds, Lecture Notes in Computer Science, Vol. 2500, Springer, 2001, pp. 231–238. doi:10.1007/3-540-36387-4_13.
16.
L.J.Stockmeyer, The complexity of decision problems in automata theory and logic, PhD thesis, Massachusetts Institute of Technology, 1974.
17.
D.Thérien and T.Wilke, Over words, two variables are as powerful as one quantifier alternation, in: Proceedings of the Thirtieth Annual ACM Symposium on the Theory of Computing, Dallas, Texas, USA, May 23–26, 1998, J.S.Vitter, ed., ACM, 1998, pp. 234–240. doi:10.1145/276698.276749.