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

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

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

90 Structures and first-order logic

If ϕ contains no occurrence of the primitive symbols, then ϕ has the form R(t1, . . . , tn) or t1 = t2 where t1, . . . , tn are V-terms. That is, ϕ is atomic. Since ϕ is a sentence, each ti is variable-free. Since M is a V-structure and each ti is a variable-free V-term, M interprets each ti as an element ai of the universe U of M . By the definition of |=, M |= t1 = t2 if and only if a1 and a2 are the same element of U , and M |= R(t1, . . . , tn) if and only if the tuple (a1, . . . , an) is in the subset of U n that the interpretation of M assigns to R.

In either case, we see that M |= ϕ or M |= ¬ϕ and not both.

We have verified () for any vocabulary V, any V-structure M , and any atomic V-sentence ϕ. Now suppose that we have shown this for any V-sentence containing at most m total occurences of ¬, , and . This is our induction hypothesis.

Suppose ϕ has the form ¬ψ or ψ θ. By our induction hypothesis, () holds for both ψ and θ. By the semantics of ¬ and , the above statement also holds for ϕ. Finally, suppose that ϕ has the form ψ(x). By the semantics of , M |= ϕ if and only if MC |= ψ(c) for some constant c in the vocabulary of MC . Again by our induction hypothesis, the above statement holds for ψ(c), and therefore it holds for ϕ as well.

It follows from induction that () holds for all sentences ϕ.

This proposition, although quite elementary, is of fundamental importance. This proposition verifies that first-order logic avoids the ambiguities and paradoxes that arise in natural languages. In any set of first-order sentences describing a given structure, there is nothing contradictory.

Definition 2.87 A set of sentences Γ is said to be consistent if no contradiction can be derived from Γ.

The word “derived” is formally defined for first-order logic in the next chapter, but the idea is analogous to the notion of “derived” for propositional logic.

Definition 2.88 A theory is a consistent set of sentences. If T is a theory, then

M od(T ) is called an elementary class.

Let V be a vocabulary. Then a V-theory is a consistent set of V-sentences. A V-theory T is a complete theory if it is maximal in the following sense: any set of V-sentences that contains T as a proper subset is not consistent. This agrees with our previous definition of “complete theory.”

Model theory studies theories and models and the interaction between them. Understanding the theory of a structure lends insight into the structure. The theory describes the structure. On the other hand, understanding the models of a theory lends insight into the theory. A theory T can be classified based on various properties of M od(T ).

Structures and first-order logic

91

We continue our study of model theory in Chapters 4–6. Chapter 4 considers the properties of first-order logic that make it an appropriate language for model theory. In Chapter 5 we focus on theories and consider some properties that a theory may or may not posses. In Chapter 6, we consider individual models of a theory that have special properties. Prior to this, in Chapter 3, we consider the basic problem of determining whether a given sentence of first-order logic is satisfiable. Toward this aim we develop formal proofs and resolution for first-order logic.

Exercises

2.1. Let V be the vocabulary {+, <, 1, 2, 3} where + is a binary function, < is a binary relation, and 1, 2, and 3 are constants. We write (x + y) for +(x, y) and x < y for < (x, y). Consider the following V-formulas:

1.x y((x + y) = 1)

2.(x < 1)

3.((1 + 1) = 2)

4.2 < 1

5.x(2 < 1) (x + 2 < x + 1)

6.x y z(x + y = z)

7.x y z(((x + 3 = y) (x + 3 = z)) (y = z))

8.x y z(((x + y = 3) (x + z = 3)) (y = z))

9.x y(((x + 3) < (y + 3)) (x < y))

10.x y((x < 2) ((x + 3) = 4))

(a)Which of these 10 formulas are sentences?

(b)Which of these 10 formulas are satisfiable?

(c)Which of these 10 formulas are tautologies?

(d)Let N+ be the V-structure having universe N that interprets the symbols of V in the usual way. Which of the above sentences does N+ model?

(e)Let R+ be the V-structure having universe R that interprets the symbols of V in the usual way. Which of the above sentences does R+ model?

(f)List the terms occurring in the above formulas.

(g)For each of the ten formulas, state the number of subformulas. How many atomic subformulas does each formula have?

92

Structures and first-order logic

2.2.Let V be the vocabulary consisting of a binary relation P and a unary relation F . Interpret P (x, y) as “x is a parent of y” and F (x) as “x is female.”

(a)Define a V-formula ϕB (x, y) that says that x is a brother of y.

(b)Define a V-formula ϕA(x, y) that says that x is an aunt of y.

(c)Define a V-formula ϕC (x, y) that says that x and y are cousins.

(d)Define a V-formula ϕO(x) that says that x is an only child.

(e)Define a V-formula ϕT (x) that says that x has exactly two brothers.

(f)Give an example of a family relationship that cannot be defined by a V-formula.

2.3.The finite spectrum of a first-order sentence ϕ is the set of natural numbers n such that ϕ has a model of size M . Find a first-order sentence ϕ having S as a finite spectrum for each of the following sets S:

(a)S is the set of even natural numbers.

(b)S is the set of odd natural numbers.

(c)S is the set of prime numbers.

(d)S is the set of perfect squares.

2.4.Refer to Example 2.27.

(a)Show that ϕ1 is not a consequence of ϕ2 and ϕ3.

(b)Show that ϕ3 is not a consequence of ϕ1 and ϕ2.

2.5.Let Vgp be the vocabulary {+, 0} where + is a binary function and 0 is a constant. We use the notation x + y to denote the term +(x, y). Consider the following V-sentences.

x y z(x + (y + z) = (x + y) + z)

x((x + 0 = x) (0 + x = x))

x( y(x + y = 0) z(z + x = 0)),

Let γ be the conjunction of these three sentences.

(a)Show that γ is satisfiable by exhibiting a model.

(b)Show that γ is not a tautology.

(c)Let α be the sentence x y((x + y) = (y + x)). Show that α is not a consequence of γ.

(d)Show that γ is not equivalent to the conjunction of any two of the above three sentences.

Structures and first-order logic

93

2.6.A first-order formula ϕ(x) is said to be satisfiable if and only if the sentence(x) is satisfiable. Prove that a formula ϕ(x) is a tautology if and only if the sentence (x) is a tautology.

2.7.Let VN = {+, ·, 1}. Let N be the VN -structure having underlying set N that interprets this vocabulary in the usual manner.

(a)Define a VN -formula ε(x) such that, for any a N, N |= ε(a) if and only if a is even.

(b)Define a VN -formula π(x) such that, for any a N, N |= π(a) if and only if a is prime.

(c)Define a VN -formula µ(x, y) such that, for any a and b in N, N |= µ(a, b) if and only if a and b are relatively prime (that is, the greatest common divisor of a and b is 1).

(d)Define a VN -formula ν(x, y, z) such that, for any a, b, and c in N, N |= ν(a, b, c) if and only if c is the least number divisible by both a and b.

2.8.Goldbach’s conjecture states that every even integer greater than 2 is the sum of two primes. Whether or not this is true is an open question of number theory. State Golbach’s conjecture as a Var-sentence where Var = {+, ·, 0, 1}.

2.9. Let Var = {+, ·, 0, 1} be the vocabulary of arithmetic. Let R be the Var-structure that has universe R and interprets the vocabulary in the usual manner.

(a)Define a Var-formula α(x) such that, for any a R, R |= α(a) if and only if a is positive.

(b)Define a Var-formula β(x, y) such that, for any a and b in R, A |= β(a, b) if and only if a ≤ b.

(c)Define a Var-formula γ(x) such that, for any a in R, R |= γ(a) if and only if the absolute value of a is less than 1.

2.10. Let Var and R be as in the previous exercise. Let V+ = Var {f } be

the expansion

of

Var obtained by adding a unary function f .

Define

a V+-sentence

ζ

such that, for any expansion R+ of R to

a V+-

structure, R+ |= ζ if and only if R+ interprets f as a continuous function.

2.11.Let A and B be definable subsets of structure M . Suppose that A and B are both sets of n-tuples of elements from the underlying set of M .

(a)Show that A B is definable.

(b)Show that A ∩ B is definable.

(c)Show that A − B = {a|a A and a B} is definable.

94

Structures and first-order logic

2.12.Let UM be the underlying set for structure M . Suppose that A (UM )3 and B (UM )3 are definable subsets of M .

(a)Show that A × B (UM )6 is definable.

(b)Suppose we rearrange the order of the n-tuples. Consider the set of all (z, x, y) such that (x, y, z) is in A. Show that this set is definable.

(c)Show that C (UM )2 is definable where C is the set of ordered pairs (x, y) such that (x, y, z) is in A for some z.

(d)Show that D (UM )2 is definable where D is the set of ordered pairs (x, y) such that both (x, y, z) A for some z and (x, y, z) B for some z.

(e)Show that E (UM )2 is definable where E is the set of ordered pairs (x, y) such that, for some z, (x, y, z) is in both A and B.

2.13.We define the distance d(a, b) between two vertices a and b of a graph as the least number of edges in a path from a to b. If no such path exists, then d(a, b) = . Recall that VG is the vocabulary of graphs.

(a)Show that, for any n N, there exists a VG-formula δn(x, y) so that, for any graph G, G |= δn(a, b) if and only if d(a, b) = n. (Define the formulas δn(x, y) by induction on n.)

(b)Does there exist a VG-formula δ(x, y) so that, for any graph G, G |= δ(a, b) if and only if d(a, b) = ? Explain your answer.

2.14.(a) Define a VG-sentence ϕ such that ϕ has arbitrarily large finite models

and, for any model G, G is a connected graph.

(b)Find a connected graph that does not model the sentence ϕ you found in part (a).

2.15.(a) Define a VG-sentence ϕ such that ¬ϕ has arbitrarily large finite models and, G |= ϕ for any connected graph G.

(b)Find a graph that is not connected and models the sentence ϕ from part (a).

2.16.(a) Define a VG-sentence ϕ such that ϕ has arbitrarily large finite models and, for any finite model G of ϕ, |G| is even.

(b)Find a finite graph G such that |G| is even and G does not model the sentence ϕ from part (a).

2.17.(a) Define a VG-sentence ϕ such that ¬ϕ has arbitrarily large finite models and, for any finite graph G, if |G| is even, then G |= ϕ.

(b)Find a finite model G for the sentence ϕ from in part (a) such that |G| is odd.

Structures and first-order logic

95

2.18.(a) Explain the di erence between the first-order prefixes x y and x y.

(b)Explain the di erence between the first-order prefixes x y z and

x y z.

(c)Explain the di erence between the first-order prefixes x y z w and

x y z w.

2.19.Show that the sentences x y z(R(x, y) R(x, z) R(y, z) ) and

x y z(R(x, y) R(x, z) R(y, z) )

are not equivalent by exhibiting a graph that models one but not both of these sentences.

2.20.For each n N, ≥n denotes a counting quantifier. Intuitively, ≥n means “there exists at least n such that.” First-order logic with counting quantifiers is the logic obtained by adding these quantifiers (for each n N) to the fixed symbols of first-order logic. The syntax and semantics of this logic are defined as follows.

Syntax: for any formula ϕ of first-order logic with counting quantifiers,≥nis also a formula.

Semantics: M |= ≥nϕ(x) if and only if M |= ϕ(ai) for each of n distinct elements a1, a2, . . . , an in the universe of M .

(a)Using counting quantifiers, define a sentence ϕ7 such that M |= ϕ7 if and only if |M | > 7.

(b)Using counting quantifiers, define a sentence ϕ23 such that M |= ϕ23 if and only if |M | ≤ 23.

(c)Using counting quantifiers, define a sentence ϕ45 such that M |= ϕ45 if and only if |M | = 45.

(d)Define a first-order sentence ϕ (not using counting quantifiers) that is equivalent to the sentence ≥nx(x = x).

(e)Show that every formula using counting quantifiers is equivalent to a formula that does not use counting quantifiers. Conclude that firstorder logic with counting quantifiers has the same expressive power as first-order logic.

2.21.Suppose we are presented with a graph G that has multiple edges. This means that there may be more than one edge between two vertices of G (so, by our strict definition of “graph,” a graph with multiple edges is not a graph). Describe G as a first-order V-structure for a suitable vocabulary V.

2.22.Let Kn be the n-clique for some n N. Then any graph having at most n vertices is a subgraph of Kn.

96

Structures and first-order logic

(a)How many substructures does Kn have?

(b)How many substructures does Kn have up to isomorphism?

(c)How many elementary substructures does Kn have?

2.23.Define an infinite structure having exactly n substructures where n is a natural number greater than 1.

2.24.Let G be Graph 1 from Section 2.4.1.

(a)How many sentences are in the diagram of G?

|

G.

(b) Find a sentence ϕG such that H = ϕG if and only if H =

2.25.Repeat Exercise 2.24 with Graph 4 from Section 2.4.1.

2.26.Prove Proposition 2.68.

2.27.Prove Proposition 2.80.

2.28.(a) Let N = (N|S, 1). Show that any proper substructure of N is not

elementarily equivalent to N .

(b)Let N< be the structure (N| <) from Section 2.4.3. Show that any infinite substructure of N< is elementarily equivalent to N< but no proper substructure is an elementary substructure of N<.

2.29.Let A, B, and C be V-structures with A B C. For each of the following, either prove the statement or provide a counter-example.

(a)If A B and B C, then A C.

(b)If A C and B C, then A B.

(c)If A B and A C, then B C.

2.30.Let V be the vocabulary {s, P } consisting of a unary function s and a unary relation P . Let M be the V-structure with universe N that interprets s as

the successor function and P as the predicate “even.” That is, for natural numbers a and b, M |= s(a) = b if and only if a + 1 = b, and M |= P (a) if and only if a is even.

Let N be the V-structure with universe N that interprets s as the successor function and P as the predicate “odd.” That is, N interprets s the same way as M , but N |= P (a) if and only if a is odd.

(a)Show that there exist embeddings f1 : M → N and f2 : N → M .

(b)Show that M and N are not isomorphic.

2.31.Define structures M and N in the same vocabulary so that there exist

elementary embeddings f : M N and g : N M , but M

→ → = N .

2.32. Using the fact that existential formulas are preserved under extensions, prove that universal formulas are preserved under substructures.

Structures and first-order logic

97

2.33.Let M and N be V-structures. A function f : M → N is said to be a homomorphism if it preserves atomic V-formulas. Suppose that f is onto (i.e each element in the universe of N is in the range of f ). Let ϕ be a V-formula that does not contain the symbols ¬, , nor . Show that f preserves ϕ.

2.34.Let M be a V-structure having underlying set U . For any n-tuple a¯ = (a1, . . . , an) of elements from U , let a¯ be the substructure of M generated

by a¯. That is, the underlying set of a¯ is the smallest subset of U that contains each ai and also contains all of the constants of V and is closed

V ¯

under each function of . Let a¯ and b be two n-tuples of elements from U . Show that the following are equivalent:

(i)For every quantifier-free V-formula ϕx), M |= ϕa) if and only if

| ¯

M = ϕ(b).

¯

(ii)a¯ = b .

2.35.Let N be the structure (N|S) that interprets the binary relation S as the successor relation. Show that N has uncountably many non-isomorphic substructures.

2.36.Let A be a set. Prove that the following are equivalent.

(i)A is infinite.

(ii)|N| ≤ |A|.

(iii)|A B| = |A| for any finite set B.

(iv)|PF (A)| = |A| where PF (A) is the set of all finite subsets of A.

(v)There exists a function f : A → A that is one-to-one but not onto.

(vi)For any B with |B| < |A| and any function f : A → B, there exists b B such that f (a) = b for infinitely many a A.

2.37.Find a V<-sentence ϕ so that the only models of ϕ interpret < as a dense linear order. Show that ϕ has only infinite models.

2.38.Let Vf be the vocabulary consisting of a single unary function f . Find a Vf -sentence that has only infinite models.

2.39.Find a set of sentences that has only uncountable models.

2.40.(a) Let F be the set of all finite strings of letters of the alphabet. Show

that F is countable.

(b)Let I be the set of all infinite strings of letters of the alphabet. Show that I is uncountable.

2.41.(a) Let U = {1, 2, 3}. List the elements of P(U ).

(b)Show that for any finite set U , if |U | = n then |P(U )| = 2n.

98

Structures and first-order logic

(c)Show that the power set of the natural numbers P(N) and the real numbers R have the same size.

2.42.Let F be the set of all functions from N to N. Show that F and R have the same size.

2.43. Box A contains infinitely many ping pong balls that are numbered 1, 2, 3, . . .

(a)Reach into box A and take out 100 balls and put them in your lap. Then put one back. Repeat this. Take out another 100 balls, put them in your lap, and then put one back. Suppose we do this countably many times. How many balls will you have in your lap?

(b)Suppose you began, in part (a), by taking out balls numbered 1–100 and then put ball 1 back. Suppose you then removed balls 101–200 and put ball 2 back. Then you took balls 201–300 into your lap, found ball 3, and put it back. And so forth. After doing this countably many times, which balls are left in your lap?

(c)Now suppose that we repeatedly remove 99 balls from box A and never return any of these balls to the box. First we take balls 1–99 into our lap and, instead of putting ball 1 back, we take a marker, add two zeros, and turn it into 100. We then take balls 101–199 out of A, take ball 2 from our lap, turn it into 200, and keep them all in our lap. After repeating this countably many times, how many balls are in your lap and what numbers do they have on them?

(d)Do the processes in (b) and (c) have di erent results? If so, explain why this is the case (if not, look at (b) and (c) again). Note that after each stage, we have the same numbered balls in our lap. Suppose someone else put the ping pong balls in our lap and we do not know if a marker was used or not. What then? Why should the use of a marker a ect the outcome?

3Proof theory

As with any logic, the semantics of first-order logic yield rules for deducing the truth of one sentence from that of another. In this chapter, we develop both formal proofs and resolution for first-order logic. As in propositional logic, each of these provides a systematic method for proving that one sentence is a consequence of another.

Recall the Consequence problem for propositional logic. Given formulas F and G, the problem is to decide whether or not G is a consequence of F . From Chapter 1, we have three approaches to this problem:

We could compute the truth table for the formula F → G. If the truth values are all 1s then we conclude that F → G is a tautology and G is a consequence of F . Otherwise, G is not a consequence of F .

Using Tables 1.5 and 1.6, we could try to formally derive G from {F }. By the Completeness Theorem for propositional logic, G is a consequence of F if and only if {F } G.

We could use resolution. By Theorem 1.76, G is a consequence of F if and only if Res(H) where H is a formula in CNF equivalent to (F ¬G).

Using these methods not only can we determine whether one formula is a consequence of another, but also we can determine whether a given formula is a tautology or a contradiction. A formula F is a tautology if and only if F is a consequence of (A ¬A) if and only if ¬F is a contradiction.

In this chapter, we consider the analogous problems for first-order logic. Given formulas ϕ and ψ, how can we determine whether ψ is a consequence of ϕ? Equivalently, how can we determine whether a given formula is a tautology or a contradiction? We present three methods for answering these questions.

In Section 3.1, we define a notion of formal proof for first-order logic by extending Table 1.5.

In Section 3.3, we “reduce” formulas of first-order logic to sets of formulas of propositional logic where we use resolution as defined in Chapter 1.

Finally, in Section 3.4, we modify the notion of resolvents and develop resolution for first-order logic.