Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Boolos et al. Computability and Logic, 5ed, CUP, 2007.pdf
Скачиваний:
593
Добавлен:
10.08.2013
Размер:
2.33 Mб
Скачать

22

Second-Order Logic

Suppose that, in addition to allowing quantifications over the elements of a domain, as in ordinary first-order logic, we allow also quantification over relations and functions on the domain. The result is called second-order logic. Almost all the major theorems we have established for first-order logic fail spectacularly for second-order logic, as is shown in the present short chapter. This chapter and those to follow generally presuppose the material in section 17.1. (They are also generally independent of each other, and the results of the present chapter will not be presupposed by later ones.)

Let us begin by recalling some of the major results we have established for first-order logic.

The compactness theorem: If every finite subset of a set of sentences has a model, the whole set has a model.

The (downward) Lowenheim¨–Skolem theorem: If a set of sentences has a model, it has an enumerable model.

The upward Lowenheim¨–Skolem theorem: If a set of sentences has an infinite model, it has a nonenumerable model.

The (abstract) Godel¨ completeness theorem: The set of valid sentences is semirecursive.

All of these results fail for second-order logic, which involves an extended notion of sentence, with a corresponding extension of the notion of truth of a sentence in an interpretation. In introducing these extended notions, we stress at the outset that we change neither the definition of language nor the definition of interpretation: a language is still an enumerable set of nonlogical symbols, and an interpretation of a language is still a domain together with an assignment of a denotation to each nonlogical symbol in the language. The only changes will be that we add some new clauses to the definition of what it is to be a sentence of a language, and correspondingly some new clauses to the definition of what it is for a sentence of a language to be true in an interpretation.

What is a second-order sentence? Let us refer to what we have been calling ‘variables’ as individual variables. We now introduce some new kinds of variable: relation variables and function variables. Just as we have one-, two-, three-, and more-place predicates or relation symbols and function symbols, we have one-, two-, three-, and more-place relation variables and function variables. (Since one-place relations are

279

280

SECOND-ORDER LOGIC

just sets, one-place relation variables may be called set variables.) We suppose that no symbol of any sort is also a symbol of any other sort. We extend the definition of formula by allowing relation or function variables to occur in those positions in formulas where previously only relation symbols (a.k.a. predicates) or function symbols (respectively!) could occur, and also by allowing the new kinds of variable to occur after and in quantifications. Free and bound occurrences are defined for the new kinds of variable exactly as they were for defined for individual variables. Sentences, as always, are formulas in which no variables (individual, relation, or function) occur free. A second-order formula, then, is a formula that contains at least one occurrence of a relation or function variable, and a second-order sentence is a second-order formula that is a sentence. A formula or sentence of a language, whether firstor second-order, is, as before, one whose nonlogical symbols all belong to the language.

22.1 Example (Second-order sentences). (In the following examples we use u as a oneplace function variable, and X as a one-place relation variable.)

In first-order logic we could identify a particular function as the identity function:x f (x) = x. But in second-order logic we can assert the existence of the identity function: u x u(x) = x.

Similarly, where in first-order logic we could assert that two particular indviduals share a property (Pc & Pd), in second-order logic we can assert that every two individuals share some property or other: x y X(Xx & Xy).

Finally, in first-order logic we can assert that if two particular individuals are identical, then they must either both have or both lack a particular property: c = d (Pc Pd). But in second-order logic we can define identity through Leibniz’s law of the identity of indiscernibles: c = d X (Xc Xd).

Each of the three second-order sentences above is valid: true in each of its interpretations.

When is a second-order sentence S true in an interpretation M? We answer this question by adding four more clauses (for universal and existential quantifications involving relation and function variables) to the definition of truth in an interpretation given in section 9.3. For a universal quantification XF(X) involving a relation variable, the clause reads as follows. First we define what it is for a relation R (of the appropriate number of places) on the domain of M to satisfy F(X): R does so if, on expanding the language by adding a new relation symbol P (of the appropriate number of places) to the language, and expanding the interpretation M to an interpretation MRP of the expanded language by taking R as the denotation of P, the sentence F(P) becomes true. Then we define XF(X) to be true in Mif and only if every relation R (of the appropriate number of places) on the domain of Msatisfies F(X). The clauses for existential quantifications and for function symbols are similar. The definitions of validity, satisfiability, and implication are also unchanged for second-order sentences. Any sentence, firstor second-order, is valid if and only if true in all its interpretations, and satisfiable if and only if true in at least one of them. A set of sentences implies a sentence D if and only if there is no interpretation in which all the sentences in are true but D false.

SECOND-ORDER LOGIC

281

(The foregoing gives the standard notion of interpretation and truth for secondorder logic. In the literature nonstandard notions, euphemistically called ‘general’, are sometimes considered, where an interpretation has separate domains of individuals and of relations and functions. These will not be considered here.)

22.2 Example (The definition of identity). The Leibniz definition of identity in Example 22.1 is unnecessarily complicated, since the following simpler Whitehead–Russell definition will do:

c = d X(Xc Xd)

We don’t need a biconditional on the right!

Proof: Pc Pd or Pc Pd is true in an interpretation just in case the set P denotes either fails to contain the individual c denotes or contains the one d denotes. Hence a set R satisfies Xc Xd just in case it either fails to contain the individual c denotes or contains the one d denotes. Hence X(Xc Xd) is true just in case every set either fails to contain the individual c denotes or contains the one d denotes. If c and d denote the same individual, this must be so for every set, while if c and d do not denote the same individual, then it will fail to be so for the set whose one and only element is the individual c denotes. Thus X(Xc Xd) is true just in case c and d denote the same individual, which is to say, if and only if c = d is true. (Intuitively, the Whitehead–Russell definition is valid because among the properties of a is the property of being identical with a; hence if the individual b is to have all the properties of a, it must in particular have the property of being identical with a.)

22.3 Example (The ‘axiom’ of enumerability). Let Enum be the sentence

z u X((X z & x(X x Xu(x))) x X x).

Then Enum is true in an interpretation if and only if its domain is enumerable.

Proof: First suppose Enum is true in an interpretation M. This means there exists an individual a in |M| and a one-place function f on |M| that satisfy

X((X z & x(X x Xu(x))) x X x).

Thus, if we add a constant 0 and let it denote a, and a one-place function symbol and let it denote f , then

X((X0 & x(X x X x )) x X x)

is true. This means every subset A of |M| satisfies

(X0 & x(X x X x )) x X x.

In particular this is so for the enumerable subset A of |M| whose elements are all and only a, f (a), f ( f (a)), f ( f ( f (a))), and so on. Thus if we add a one-place predicate N and let it denote A, then

(N0 & x(Nx Nx )) xNx

282

SECOND-ORDER LOGIC

is true. But N0 is true, since the individual a that is the denotation of 0 is in the set A that is the denotation of N, and x(Nx Nx ) is true, since if any individual is in A, so is the value obtained when the function f that is the denotation of is applied to that individual as argument. Hence xNx must be true, and this means that every individual in the domain is in A, so the domain, being just A, is enumerable.

Conversely, suppose that the domain of an interpretation M is enumerable. Fix an enumeration of its elements: m0, m1, m2, and so on. Let a be m0, and let f be the function that given mi as argument yields mi+1 as value, and add a constant 0 and a one-place function symbol to denote a and f . Given any subset A of the domain, suppose we add a one-place predicate N to denote A. Then if N0 is true, a = m0 must belong to A, and if x(Nx Nx ) is true, then whenever mi belongs to A, f (mi ) = mi+1 must belong to A. So if both are true, every element m0, m1, m2, . . .

of the domain must belong to A, and therefore xNx is true. Thus

(N0 & x(Nx Nx )) xNx

is true if N is taken to denote A, and therefore A satisfies

(X0 & x(X x X x )) x X x

and since this is true for any A,

X((X0 & x(X x X x )) x X x)

is true, and therefore

z u X((X z & x(X x Xu(x))) x X x)

or Enum is true in M.

22.4 Example (The ‘axiom’ of infinity). Let Inf be the sentence

z u( x z = u(x) & x y(u(x) = u(y) x = y)).

Then Inf is true in an interpretation if and only if its domain is infinite. The proof is left to the reader.

22.5 Proposition. The downward and upward Lowenheim¨ –Skolem theorems both fail for second-order logic.

Proof: Inf & Enum and Inf & Enum are both second-order sentences having infinite but no finite models. The former has only nonenumerable models, contrary to the downward Lowenheim¨ –Skolem theorem; the latter only denumerable models, contrary to the upward Lowenheim¨ –Skolem theorem.

It is an immediate consequence of the downward and upward Lowenheim¨ –Skolem theorems that if a first-order sentence or set of such sentences has an infinite model, then it has nonisomorphic infinite models. Even this corollary of the Lowenheim¨ – Skolem theorems fails for second-order logic, as the next example shows.

SECOND-ORDER LOGIC

283

22.6 Example (Second-order arithmetic). Let PII be the conjunction of the axioms of Q (as in section 16.2) with the following sentence Ind, called the axiom of induction:

X((X0 & x(X x X x )) x X x).

Then an interpretation of the language of arithmetic is a model of PII if and only if it is isomorphic to the standard interpretation.

Proof: We have already in effect seen in the proof of Example 22.3 that in any model of Ind, the domain will consist precisely of the denotations of the terms 0, 0 , 0 , . . . , which is to say, of the numerals 0, 1, 2, . . . , as we usually abbreviate those terms. We have also seen in section 16.2 that in any model of the axioms of Q, all the following will be true for natural numbers m, n, and p:

m = n

if

m = n

m <n

if

m < n

m <n

if

m n

m + n = p

if

m + n = p

m + n = p

if

m + n = p

m · n = p

if

m · n = p

m · n = p

if

m · n = p.

Now let Mbe a model of PII. Every element of |M| is the denotation of at least one m, because M is a model of Ind, and of at most one m, because M is a model of the axioms of Q and therefore of m = n whenever m = n, by the first fact on the list above. We can therefore define a function j from |M| to the natural numbers by letting the value of j for the argument that is the denotation of m by m. By the other six facts on the list above, j will be an isomorphism between M and the standard interpretation.

Conversely, PII is easily seen to be true in the standard interpretation, and the proof of the isomorphism theorem (Proposition 12.5) goes through essentially unchanged for second-order logic, so any interpretation isomorphic to the standard interpretation will also be an model of PII.

22.7 Proposition. The compactness theorem fails for second-order logic.

Proof: As in the construction of a nonstandard model of first-order arithmetic, add a constant c to the language of arithmetic and consider the set

= {PII, c = 0, c = 1, c = 2, . . . }.

Every finite subset 0 has a model obtained by expanding the standard interpretation to assign a suitable denotation to c—any number bigger than all those mentioned in0 will do. But itself does not, because in any model of PII every element is the denotation of one of the terms 0, 1, 2, and so on.

22.8 Proposition. The (abstract) Godel¨ completeness theorem fails for second-order logic: The set of valid sentences of second-order logic is not semirecursive (or even arithmetical).

284

SECOND-ORDER LOGIC

Proof: A first-order sentence A of the language of arithmetic is true in the standard interpretation if and only if it is true in all interpretations isomorphic to the standard one, and hence by the preceding example if and only if it is true in all models of PII, or equivalently, if and only if PII A is valid. The function taking (the code number of) a first-order sentence A to (the code number of) the second-order sentence PII A is clearly recursive. (Compare the proof of Theorem 17.6.) Hence if the set of (code numbers of) valid second-order sentences were semirecursive, the set of (code numbers of) sentences of the language of arithmetic true in the standard interpretation would be also. But the latter set is not arithmetical (by Theorem 17.3) and a fortiori not semirecursive.

Proposition 22.8 is sometimes formulated as follows: ‘Second-order logic is incomplete’. A more accurate formulation would be: ‘No sound proof procedure for second-order logic is complete’. (After all, it’s not the logic that’s incomplete, but candidate proof procedures.)

We conclude this chapter with a preview of the next. Recall that a set S of natural numbers is arithmetically definable, or simply arithmetical, if there is a first-order formula F(x) of the language of arithmetic such that S consists of just those m for which F(m) is true in the standard interpretation, or equivalently, just those m that satisfy F(x) in the standard interpretation. A set S of natural numbers is analytically definable or analytical if there is a firstor second-order formula φ(x) of the language of arithmetic such that S consists of just those m that satisfy φ(x) in the standard interpretation. Let us, for the space of this discussion, use the word class for sets of sets of natural numbers. Then a class of sets of natural numbers is arithmetical if there is a second-order formula F(X) with no bound relation or function variables such that

consists of just those sets M that satisfy F(X ) in the standard intepretation. A class

of sets of natural numbers is analytical if there is a second-order formula φ(X) such that consists of just those sets M that satisfy φ(X) in the standard interpretation. We have seen that recursive and semirecursive sets are arithmetical, but that the set of (code numbers of) first-order sentences of the language of arithmetic that are true in the standard interpretation is not arithmetical. It can similarly be shown that the set of firstand second-order sentences true in the standard interpretation is not analytical.

However, the set V of (code numbers of) first-order sentences true in the standard interpretation is analytical. This follows from the fact, to be proved in the next chapter,

that the class {V } of sets of natural numbers whose one and only member is the set V is arithmetical. The latter result means that there is a second-order formula F(X) with no bound relation or function variables such that V is the one and only set that satisfies F(X) in the standard interpretation. From this it follows that V is precisely the set of m that satisfy X(F(X) & X x); and this shows that, as asserted, V is analytical. It will also be shown that the class of arithmetical sets of natural numbers is not arithmetical. (Again, this class can be shown to be analytical.) In order to keep the next chapter self-contained and independent of this one, a different definition of arithmetical class will be given there, not presupposing familiarity with second-order logic. However, the reader who is familiar with second-order logic should have no difficulty recognizing that this definition is equivalent to the one given here.