Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Hedman. A First Course in Logic, 2004 (Oxford)

.pdf
Скачиваний:
140
Добавлен:
10.08.2013
Размер:
7.17 Mб
Скачать

390

Beyond first-order logic

that ϕ0 holds for some interpretation of R. As was pointed out in Example 9.3, the second-order sentence ϕ is a V-sentence. So for every V-structure M , either M |= ϕ or M |= ¬ϕ. To determine which is the case, let us consider what ϕ0 and ϕ say.

Let P (M ) = {a U |M |= P (a)} and let Q(M ) = {a U |M |= Q(a)}.

The sentence ϕ0 says that for each x in P (M ) there exists a unique y in Q(M ) such that R(x, y) holds. Note that if this is true, then there must be at least as many elements in Q(M ) as in P (M ). The sentence ϕ says that ϕ0 holds for some interpretation of R. This sentence is true in M if and only if

|P (M )| ≤ |Q(M )|.

Recall Examples 4.73 and 4.74 from Section 4.7. In Example 4.73 it was shown that no set of first-order sentences can express |P (M )| = |Q(M )|. This is a consequence of the Downward L¨owenheim–Skolem theorem. Clearly, we can modify ϕ in the previous example to obtain a second-order sentence that holds in a structure M if and only if P (M ) and Q(M ) have the same size. In Example 4.74, it was shown that the graph-theoretic property of connectedness cannot be expressed in first-order logic. We now show that this, too, can be expressed in second-order logic.

Example 9.5 Let VR = {R} be the vocabulary of graphs. We write a secondorder VR-sentence ϕcon that holds in a graph G if and only if G is connected. This sentence asserts that there exists a linear order with certain properties. Recall that a binary relation L(x, y) is a linear order if and only if the following three sentences hold:

x y(L(x, y) L(y, x) y = x)

x y(L(x, y) → ¬L(y, x))

x y z((L(x, y) L(y, z)) → L(x, z)).

Let ϕlo(L) be the conjunction of these sentences.

To define the sentence ϕcon we make the following observation: G is connected if and only if the vertices of G can be linearly ordered so that for each vertex v, if v is not the first vertex, then there exists a previous vertex in the order adjacent to v. We express this as follows:

L2(ϕlo(L) x( yL(y, x) → y(L(y, x) R(y, x)))).

Let ϕcon be this sentence.

Example 9.4 implies that the Downward L¨owenheim–Skolem theorem fails in second-order logic. The previous example implies the failure of compactness. The next two examples demonstrate these failures in a direct way. We show that

Beyond first-order logic

391

there exist second-order sentences expressing that “the universe is infinite” and “the universe is uncountable.”

Example 9.6 We demonstrate a second-order sentence ϕinf that holds in a structure if and only if the structure is infinite. Let ϕ0 be the conjunction of the following first-order sentences:

1.x yR(x, y).

2.x y z(R(x, y) R(x, z) → y = z).

3.x y z(R(x, y) R(z, y) → x = z).

4.y x¬R(x, y).

Let M |= ϕ0. By sentences 1 and 2, we can view R(x, y) as a function on the universe of M . Given any x in the universe, this function outputs the unique y for which R(x, y) holds. Sentence 3 asserts that this function is one-to-one. By sentence 4, this function is not onto. This is only possible if M is infinite (any one to one function from a finite set to itself must be onto). So, if M |= ϕ0, then M must be infinite. Let ϕinf be the sentence R2ϕ0. Infinite structures and only infinite structures model this sentence.

Example 9.7 We demonstrate a second-order sentence ϕuncount that holds in a structure if and only if the structure is uncountable. Let Q(x) be a unary relation. In the manner demonstrated in the previous example, we can write a second-order sentence ϕ(Q) that holds if and only if Q(x) defines a finite set. Let ϕlo(L) be the sentence from Example 9.5 asserting that the binary relation L defines a linear order. Now let ϕcount be the sentence:

L2(ϕlo(L)) x Q1 y((Q(y) → L(y, x)) → ϕ(Q)).

Suppose M |= ϕcount. The sentence ϕcount says that we can linearly order the elements of the universe of M in such a way that each element has only finitely many predecessors. This is possible if and only if the universe is at most countable. So M |= ϕcount if and only if M is countable. Let ϕuncount be ¬ϕcount.

We see that second-order logic does not share the properties of firstorder logic discussed in Chapter 4. The previous examples show that the two main results of Chapter 4, the Compactness theorem and the Downward L¨owenheim–Skolem theorem, are not true in second-order logic. From the failure of compactness, we can deduce the failure of completeness (this was also shown in Section 8.1). There is no algorithmic way to determine whether or not a given second-order sentence is a consequence of a given set of second-order sentences. Likewise, there is no method for determining whether or not a structure models a certain second-order sentence, or whether or not two given structures

392

Beyond first-order logic

model the same second-order sentences, and so forth. In short, second-order logic is too expressive to admit a useful model theory.

Because second-order logic is too powerful, it is natural to consider various fragments of second-order logics. Monadic second-order logic is the fragment that only allows second-order quantification over unary relations. So in monadic second-order logic, one can consider subsets of the universe U of a structure, but not subsets of U n for n > 1. In weak monadic second-order logic, one can consider only finite subsets of U . We now turn our attention to other extensions of first-order logic.

9.2 Infinitary logics

The logic Lω1ω is the extension of first-order logic which allows countable con-

junctions. That is, we have the following rule for forming formulas. (R2) If

1, ϕ2, ϕ3, . . .} is a countable set of formulas, then i ϕi is also a formula. This is in addition to the rules of first-order logic which state that any

atomic formula is a formula and

(R1) If ϕ is a formula then so is ¬ϕ, and

(R3) If ϕ is a formula, then so is for any variable v.

Note that countable disjunctions are also allowed since ¬ ϕi ≡ ¬ϕi.

Let M be a first-order structure. If the vocabulary of M is countable, then there is a single sentence of Lω1ω that describes M up to first-order elementary equivalence. Namely, the conjunction of the sentences in T h(M ) is a Lω1ω sentence. Moreover, Lω1ω sentences can state precisely which types are realized in M . For each k-type p S(T h(M )), there exists a Lω1ω sentence of the formx1 · · · xkp(x1, . . . , xk). It follows immediately from Proposition 6.27 that the logic Lω1ω describes countable homogeneous structures up to isomorphism. As we shall show, Lω1ω describes any countable structure, whether homogeneous or not, up to isomorphism.

Definition 9.8 Structures M and N are said to be Lω1ω-elementarily equivalent, denoted M ≡Lω1ω N , if M and N model the same Lω1ω sentences.

We show that countable structures are Lω1ω-elementarily equivalent if and only if they are isomorphic. To show this, we consider pebble games. Pebble games provide a method for determining whether or not two given structures in the same relational vocabulary are equivalent with respect to various logics including first-order logic and Lω1ω. Pebble games also serve as a useful tool for the finite-variable logics of Section 10.2.

Beyond first-order logic

393

Let M and N be structures in the relational vocabulary V. There are various pebbles games that can be played on M and N . Each pebble game is played by two players named Spoiler and Duplicator. The disjoint union of the underlying sets of M and N serves as the game board for the pebble games. Let A and B denote the underlying sets of M and N , respectively. Since we may change the names of elements (using subscripts, for example) there is no loss of generality in assuming that A and B are disjoint. In each game, Spoiler and Duplicator alternately place pebbles on elements of A and B. Spoiler’s goal is to show that the two structures are somehow di erent. In contrast, Duplicator’s objective is to show that M and N are partially isomorphic.

Definition 9.9 Let M and N be structures in the same relational vocabulary V. Let f : M → N be a function that has as its domain a subset of UM (the underlying set of M ). This function is called a partial isomorphism if it preserves literals. That is, M |= ϕ(a1, . . . , ak) if and only if M |= ϕ(f (a1), . . . , f (ak)) for all k-tuples from the domain of f and all atomic V-formulas. (If the domain of f happens to be all of UM , then f is an isomorphism.)

Each pebble game is played with a specified number of pairs of pebbles. Each pair has a distinct color. A specified number of rounds comprises each game. In each round, Spoiler first chooses a color; mauve, say. Spoiler places a mauve pebble on an element of one of the structures. Duplicator completes the round by taking the other mauve pebble and placing it on an element of the opposite structure. The color of the pebbles determines a one-to-one correspondence between those elements of A and those of B which have pebbles on them. After any round, if this one-to-one correspondence is not a partial isomorphism, then Spoiler wins the game. Duplicator’s goal is defensive; to prevent Spoiler from winning.

The Ehrenfeucht–Fraisse game of length m played on structures M and N is denoted EFm(M , N ). It is played with m pairs of pebbles and comprises m rounds. Spoiler places di erent colored pebbles in each round. After m rounds, all of the pebbles have been placed and the game is over.

Proposition 9.10 Let V be a relational vocabulary and let M and N be V-structures. The following are equivalent:

(i)Duplicator can always prevent Spoiler from winning EFm(M , N ).

(ii)For any V-sentence ϕ in prenex normal form having at most m variables, M |= ϕ if and only if N |= ϕ.

Proof idea Suppose that M |= (x) and N |= x¬ϕ(x). If ϕ is quantifierfree, then Spoiler can win EF1(M , N ) by placing her pebble on an element of M such that M |= ϕ(a). Since N |= x¬ϕ(x) Duplicator cannot match this move.

394 Beyond first-order logic

The proposition can be proved by induction on m by extending this idea. We leave the details as Exercise 9.10.

Corollary 9.11 Let V be a relational vocabulary and let M and N be V- structures. Then M ≡ N if and only if, for each m N, Duplicator prevents Spoiler from winning EFm(M , N ).

Proof This follows immediately from the previous proposition and the fact that every sentence of first-order logic is equivalent to a sentence in prenex normal form.

In the definition of EFm(M , N ), we allow the possibility that m = ω, in which case play continues indefinitely. If at any point during the game the correspondence given by the color of the pebbles is not a partial isomorphism, Spoiler wins. This game provides the following characterization of Lω1ω-equivalence.

Proposition 9.12 Let V be a countable relational vocabulary and let M and N be V-structures. Then M ≡Lω1ω N if and only if Duplicator can always prevent Spoiler from winning EFω(M , N ).

We do not prove this proposition. Intuitively, the proof of Proposition 9.12 is similar to the proof of Proposition 9.10. We use Proposition 9.12 to show that two countable structures are Lω1ω-equivalent if and only if they are isomorphic.

Proposition 9.13 Let V be a relational vocabulary and let M and N be countable

V

-structures. Then M

Lω1

 

 

N .

 

 

 

 

ω

N if and only if M =

 

Proof Suppose that M

Lω1

 

 

N using a back-and-forth

 

 

ω N . We prove that M =

argument. Let UM and UN denote the underlying sets of M and N , respectively. Enumerate these sets as

UM = {a1, a2, a3, . . .} and UN = {b1, b2, b3, . . .}.

We construct an isomorphism f : M → N step-by-step. We use the fact that Duplicator can match Spoiler’s moves to prevent her from winning EFω(M , N ) (Proposition 9.12). In odd numbered rounds of the game (including the first round of play) Spoiler finds the least i such that ai does not have a pebble on it, and then places a pebble on that element (so she chooses a1 in round 1). Duplicator matches Spoiler’s move by placing a pebble on some element of UM . Likewise, in even numbered rounds, Spoiler finds the least i such that bi does not have a pebble on it, and then places a pebble on that element. In choosing elements in this way, Spoiler guarantees that every element of UN and UM will eventually have a pebble. The color of the pebbles determine a function f : M → N . Since Duplicator matches Spoiler, this function is a partial isomorphism. Since it is one-to-one and onto, it is an isomorphism.

Beyond first-order logic

395

Theorem 9.14 (Scott) Let V be a countable vocabulary and let M be a countable V-structure. There exists a single sentence of Lω1ω that describes M up to isomorphism.

To prove Scott’s theorem, one describes a countable set of Lω1ω-sentences TEF that allow Duplicator to prevent Spoiler from winning EFω(M , N ) for any model N of TEF . For a full proof, refer to [16].

Example 9.15 By Scott’s theorem, the first-order theory of the structure N = (N|+, ·, 1) is a consequence of a single sentence of Lω1ω. We describe such a sentence ΦScott. Recall the axioms ΓN from Section 8.1. Let ΦScott be the conjunction of the sentences in ΓN together with the following sentence of Lω1ω:

x(x = 1 x = (1 + 1) x = ((1 + 1) + 1) x = (((1 + 1) + 1) + 1) · · · ).

Since the sentences ΓN define multiplication and addition on the natural numbers, any model of ΦScott is isomorphic to N.

From this example and G¨odel’s First Incompleteness theorem, it follows that Lω1ω, like second-order logic, does not have completeness. That is, there is no formal system of deduction that is both sound and complete for Lω1ω (this also follows from the failure of compactness). Unlike second-order logic, the Downward L¨owenheim–Skolem theorem, the Tarski–Vaught criterion, and preservation theorems are true for Lω1ω (see Exercise 9.7).

As the title of this section suggests, there are infinitary logics other than Lω1ω. For any infinite ordinals α and β, the logic Lαβ is defined as follows. Any formula of first-order logic is a formula of Lαβ . Moreover, we have the following rules:

(R1) If ϕ is a formula then so is ¬ϕ.

(R2) If i|i < β} is a set of formulas, then i<β ϕi is a formula.

(R3) If ϕ is a formula and (xi|i < α) is a (possibly infinite) tuple of elements, then (xi|i < α)ϕ is a formula.

So Lωω is another name for first-order logic.

The logic Lω1ω holds a unique place among infinitary logics since it shares some of the properties of first-order logic (such as the Downward L¨owenheim– Skolem theorem). In particular, pebble games provide a useful characterization of Lω1ω-equivalence. Other infinitary logics are not so nice. Since they can quantify over infinite sets, the logics Lαβ for α > ω have an expressive power comparable to second-order logic.

9.3 Fixed-point logics

We consider expansions of first-order logic that allow for inductive definitions. Inductive definitions are common in mathematics and computer science. We have

396

Beyond first-order logic

used inductive definitions in this book to define primitive recursive functions, formulas of propositional and first-order logic, and other notions.

Example 9.16 Consider the notion of a connected component of a graph. We define this concept inductively as follows. Let v be a vertex of a graph G. Let C0(v) = {v}. For each n N, Cn(v) = {x|G |= R(x, y) for some y Cn−1(v)}. If G is a finite graph, then Cm(v) = Cm+1(v) for some m. If this is the case,

then Cm(v) is the connected component of v in G. In any case, the connected

component of v in G is defined as n N Cn(v).

Although first-order logic can define the sets Cm(x) for each m, it cannot define the notion of a connected component (see Example 4.74). In this sense, first-order logic is not closed under inductive definitions. Second-order logic and infinitary logics are closed in this manner (see Exercise 9.15). We now consider logics that include various fixed-point operators. Intuitively, these logics are minimal expansions of first-order logic that are closed under inductive definitions. There is more than one way to make the notion of “inductive definition” precise. Each corresponds to a di erent fixed-point operator.

Inflationary fixed-point logic (IFP)

An operator is similar to a function. A function from set A to set B outputs an element f (a) B given an element a A as input. The definition of function requires that A and B are sets. The notion of an operator extends this notion to classes of objects other than sets. We consider certain operators defined on the class of first-order structures.

Let ϕ(x1, . . . , xk) be a first-order formula in the vocabulary V {P } containing the k-ary relation P . We define an operator Oϕ,P on (V {P })-structures. Given a (V {P })-structure M as input, the operator Oϕ,P outputs the (V {P })-structure Oϕ,P (M ) defined as follows. The underlying set of Oϕ,P (M ) is the same as M and Oϕ,P (M ) interprets V the same way as M . So as V- structures, Oϕ,P (M ) is identical to M . The interpretation of P may not be the same.

The structure Oϕ,P (M ) interprets P as P (M ) ϕ(M ), where P (M ) and ϕ(M ) denote the subsets of M defined by P x) and ϕx), respectively.

Now let N be a V-structure. We may view N as a (V {P })-structure that interprets P as the empty set. That is, let N0 be the expansion of N to V {P } such that N0 |= x¯¬P x). Then N and N0 are essentially the same structure. The operator Oϕ,P generates a sequence of structures. For each i N, let Ni+1 = Oϕ,P (Ni). Consider the sequence N0, N1, N2, N3, . . . . If N is a finite structure, then Nm+1 = Nm for some m N. This is because, if Nm+1

Beyond first-order logic

397

and Nm are not the same, then the set defined by P x) in Nm+1 is larger than the set defined in Nm. This can happen for only finitely many m if N

is finite. If N is infinite, then we continue the sequence. For each ordinal α,

let Nα interpret P as β<α P (Nβ ). Eventually, Nα+1 must equal Nα for some α. We refer to such a structure as the fixed-point for the operator Oϕ,P on N . We let Nf denote this fixed-point structure.

Example 9.17 Let G be a graph. Then G is a structure in the vocabulary VR = {R}. Let P be a binary relation and let ϕ(x, y) be the (VR {P })-formula

x = y z(R(x, z) P (z, y)).

Let G0, G1, G2, . . . be the sequence of (VR {P })-structures generated by the operator Oϕ,P . Then

G0 interprets P (x, y) as the empty relation,

G1 interprets P (x, y) as the relation x = y,

G2 interprets P (x, y) as the relation x = y R(x, y),

and so forth. For each i N, Gi |= P (a, b) if and only if there exists a path from a to b in G of length at most i − 1. Let Gf denote the fixed-point of this sequence. Then Gf |= P (a, b) if and only if a is in the connected component of b in the graph G.

Whereas G is bi-definable with each Gi, it may not be bi-definable with Gf . As was demonstrated in Example 4.74, first-order logic can express that there exists a path between x and y of length i N, but it cannot express that there exists a path. So the fixed-point structure may contain a definable subset that is not definable in the original structure G.

We now define inf lationary fixed-point logic (denoted IFP ). Let N be a firstorder V-structure. In the logic IFP, every subset of N that is definable in some fixed-point structure Nf is definable in N . The logic IFP is the least extension of first-order logic with this property.

More precisely, the syntax of IFP is defined by the following rule together with the rules (R1), (R2), and (R3) from first-order logic:

(RIF P ) For any k-ary relation P , any (V {P })-formula ϕ(x1, . . . , xk) in k free variables, and any V-terms t1,. . . ,tk,

[if pϕ,P ](t1, . . . , tk) is a V-formula of IFP.

For any V-structure N , N |= [if pϕ,P ](t1, . . . , tk) means the tuple (t1, . . . , tk) is in the set defined by P (x1, . . . , xk) in the fixed-point structure Nf of the operator Oϕ,P on N . This defines the semantics of IFP.

398 Beyond first-order logic

Partial fixed-point logic (PFP)

We obtain variations of IFP by varying the operator Oϕ,P . By definition, the structure Oϕ,P (M ) interprets P as P (M ) ϕ(M ). It follows that the set defined by P is increasing in the sequence N1, N2, N3, . . . defined above. That is, for

each i, P (Ni) P (Ni+1). The word “inflationary”

refers to this fact.

 

pfp

pfp

 

Now suppose we modify the operator Oϕ,P . Let Oϕ,P

be such that Oϕ,P

(M )

interprets P as ϕ(M ) instead of P (M ) ϕ(M ). Again consider the chain of structures N1, N2, N3,. . . generated by Oϕpf,Pp (Ni) = Ni+1. Unlike the inflationary operator, it is not necessarily true that P (Ni) P (Ni+1). Because of this, there is no guarantee that a fixed-point exists for this operator.

Example 9.18 Let V = {≤, S, 1} and let M be the structure (N| ≤, S, 1) that interprets the binary relation S as the successor relation and interprets and 1 in the obvious way. Let N be any model of T h(M ). Let P be a unary relation and let ϕ(x) be the following (V {P })-sentence:

(x = 1) y(P (y) S(y, x) z(P (z) (z ≤ y))).

This formula says that either x = 1 or x is the successor of the greatest element y

for which P (y) holds. Let N0 the expansion of N that interprets P as the empty relation. Let Ni = Oϕpf,Pp (Ni−1) for each i N.

Then P (N1) = {1}, P (N2) = {1, 2}, P (N3) = {1, 3}, P (N4) = {1, 4}, and so forth. We see that there is no fixed-point structure for this sequence. In contrast, if the sequence N1, N2, N3,. . . is instead generated by the inflationary operator, then P (Nm) = {1, 2, 3, . . . , m} for each m N. The inflationary fixed-point structure interprets P (x) as “x is the nth successor of 1 for some n.”

Partial fixed-point logic, denoted PFP, is defined the same way as IFP using

Opfp O

ϕ,P in place of ϕ,P . The logic PFP can express that a term is in the fixedpoint Nf of this operatorprovided this fixed point exists. The syntax of PFP is defined by the following rule together with the rules (R1), (R2), and (R3) from first-order logic.

(RP F P ) For any k-ary relation P , any (V {P })-formula ϕ(x1, . . . , xk) in k free variables, and any V-terms t1,. . . ,tk,

[pf pϕ,P ](t1, . . . , tk) is a V-formula of PFP.

For any V-structure N , N |= [pf pϕ,P ](t1, . . . , tk) means that the fixed-point structure Nf of the operator Oϕ,P on N exists and the tuple (t1, . . . , tk) is in the set defined by P (x1, . . . , xk) in Nf .

Beyond first-order logic

399

Example 9.19 We show that PFP, like IFP, can express that there exists a path between vertices of a graph. Recall P and ϕ from Example 9.17. Since ϕ(x, y) is the formula x = y z(R(x, z) P (z, y)) we see that P (M ) ϕ(M ) for any {P , R}-structure M . For this reason, the operators Oϕ,P and Oϕpf,Pp are identical.

Least fixed-point logic (LFP)

Let ϕ be a formula in a vocabulary containing the relation P . The relation P is said to have a negative occurrence in ϕ if ϕ is equivalent to a formula in

¬ ¯

conjunctive prenex normal form in which the literal P (t) occurs as a subformula

¯

for some tuple of terms t. We say that ϕ is positive in P if P has no negative occurences in ϕ.

Example 9.20 The formula (x = 1) y(P (y) S(y, x) z(P (z) (z ≤ y)))

from Example 9.18 is not positive in P . The subformula P (z) (z ≤ y) is equivalent to ¬P (z) (z ≤ y).

Let N1, N2, N3,. . . be the sequence generated by Oϕpf,Pp . If ϕ is positive in P , then we have P (N1) P (N2) P (N3) . . . and the fixed-point structure exists. Least Fixed-Point Logic, denoted LFP, is the variation of PFP that allows [pf pϕ,P ](t1, . . . , tk) as a formula only if ϕ is positive in P . This formula is interpreted the same way in LFP as in PFP. Clearly, every formula of LFP is also a formula of PFP. Whether or not the converse is true is an open question. The following theorem relates this open question to a question from complexity theory.

Theorem 9.21 (Abiteboul–Vianu) LFP is equivalent to PFP on finite structures if and only if PSPACE = P.

This theorem indicates a close relationship between fixed-point logics and complexity classes. Indeed, the development of fixed-point logics over the last two decades has been primarily motivated by complexity theory. A theorem of Immerman and Vardi states that, in some sense, LFP is equivalent to the class P. We shall state this theorem precisely in Section 10.3 where we discuss the subject of descriptive complexity.

Note the phrase “on finite structures” in the previous theorem. This means that for any sentence ϕ of LFP there exists a sentence ψ of PFP such that M |= ϕ if and only if M |= ψ for any finite structure M . Likewise, Shelah and Gurevich showed in 1986 that LFP and IFP are equivalent on finite structures. This result was improved in 2003 by Stephan Kreutzer who proved the following remarkable fact.

Theorem 9.22 (Kreutzer) LFP is equivalent to IFP.