This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Β), (A = Β), provided we have already written the strings A and B. (4) At any step—and for any choice of variable χ—we may write the string ((Vx)A), provided we have already written the string A. "V" is called the universal quantifier and is pronounced "for all". The string "(Vx)" we pronounce "for all x". We say that the subformula A in ((\/χ)Λ) is the scope "(Vx)". • 4.1.11 Remark, (a) Case (4) in 4.1.10 is new. It did not occur in Definition 1.1.3. We say that χ in ((Vx)/1) is a quantified variable (we also call it bound, but more on this shortly). In a firstorder language, we are allowed to quantify only firstorder variables, as we call the object variables. We are not allowed to quantify seconder higher) order variables such as names of predicates or functions. For example, we have no way, in a firstorder language, to write down a formula that says "for all functions / . . . " . (b) Since cases (2)(3) in the above definition are the same as in 1.1.3 and since, moreover, AF includes all Boolean variables and constants, it follows that every formulacalculation in the sense of 1.1.3 is also valid according to 4.1.10. •
122
EXTENDING BOOLEAN LOGIC
The picky reader will probably ask: "You said '[F]or example, we have no way, in a firstorder language, to write down a formula that says "for all functions / . . . " . ' But surely in set theory, which has been repeatedly mentioned as an 'applied case' of firstorder logic, we must be able to say things like 'for all functions / . . . ' ? " Well, yes, we can. What I meant is that a firstorder language does not have the ability to say "(V/)", where / is a function symbol. However, in set theory, functions are not symbols of the alphabet, but are defined, as we say extensionally?" i.e., as sets of ordered pairs, pairs themselves being defined (implemented) as certain sets. Now, axiomatic set theory has normally just one type of variable, "set". We can certainly say "(Vx)" if χ is an object (set) variable. Since a function, extensionally, is a set, I can say "(for all functions)(...)" by saying instead "(Vx)(x is a function —> ...)". 1
95
4.1.12 Example. In the first step of any formulacalculation, only requirement (1) of Definition 4.1.10 is applicable, since the other three require the existence of prior steps. Thus in the first step we may write only an atomic formula. In all other steps, all the requirements (l)(4) are applicable. Here is a calculation (the comma is not part of the calculation; it just separates strings written in various steps): P,T,(T),
9
Verify that the above obeys Definition 4.1.10. Here is a more interesting one: P,q,(pVq),(.P*q),
((pVg) Ξ q), ((pAq)
=p), ( ( ( p V g ) = q) = ({pAq)
= p))
Both previous calculations are also calculations in the sense of 1.1.3 and were written down in an earlier example. Here are a few that are not, but which are valid calculations as far as 4.1.10 is concerned: P,((Vz)p) χ = a, ((Vx)x = o),p, (((\/x)x = a) A p), u = v, (u = υ —> (((Vx)x = a) A p)) Recall that "a" is a constant. χy,
(ix = y), ((Vz)(>x = y))
x = y, ((Vx)x = y), ((Vx)((Vx)x = y)) ^That is, by what they include as members—not behaviorally or "intentionally". ^'Normally via Kuratowski's definition, by which the ordered pair "(x, y)" is an abbreviation of the set {{x},{x,y}}.
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
123
Particularly important are the first—p, ((Vz)p)—and the last two calculations: The first two of these exemplify that we do not care whether a variable ζ occurs in "A" before we form "(Vz) A". The "A" here were ρ and (12: = y) respectively. The last one illustrates that it is allowed to place one (Vx) immediately in front of another. Of course, why these actions are legal is implicit in (4) of 4.1.10: Absolutely no restrictions are placed on either χ or A (other than A must be already written). • 4.1.13 Definition. (FirstOrder Formulae) A string A over the alphabet 4.1.2 will be called a firstorder formula or a wellformedformula iff it is a string written at some step of some formulacalculation conducted as per 4.1.10. The set of firstorder formulae we will denote by WFF. A member of WFF is often called a "wff' (or just a formula). • My apologies to the reader for using "WFF" and "wff" both for the firstorder formulae of Part II and for the Boolean expressions of Part I. In my defense, "WFF" from now on will be in the former (Part II) sense exclusively, and, in any case, any Boolean expression is also a wff in the new (4.1.13) sense as we remarked above (cf. 4.1.11 (b)). As in the cases of Boolean formulae, and members of Term, a string is a wff (member of the set WFF defined 4.1.13) iff this can be certified by showing that the string is put together using certain strings that we already know are in WFF. And again, as was done twice before, this leads to a recursive (inductive) definition of WFF: 4.1.14 Definition. (Recursive Definition of WFF) WFF is defined as the smallest set of strings that contains all the members of AF and moreover satisfies: (1) If A is in WFF, then so are (>A) and ((Vx)A). (2) If A and Β are in WFF, then so are (Α Λ Β), (A V Β), (A β ) , and (A = B). • Clearly, the complexity of wff increases every time we perform a step (2), (3), or (4), in a formulacalculation (4.1.10). Thus we define 4.1.15 Definition. (Complexity of Members of WFF) The complexity of a wff is the total number of occurrences of V, ι, Λ, V, —>, = in the formula, counting each repetition as a new occurrence. • 4.1.16 Example, χ = y and ρ have complexity 0 each. ((Va;)((V?/)(ix = y))) has complexity 3. ((Vt/)((>x = y) Λ ρ)) and (((Vy)(ix = y)) Λ ρ) each have complexity 3. But as an aside, note that in the first of the last two examples ρ is in the scope of (Vy), whereas in the second it is not. •
124
EXTENDING BOOLEAN LOGIC
4.1.17 Definition. (The Existential Quantifier) We introduce a new symbol in the metatheory—an abbreviation, that is, not a formal symbol—3, called the existential quantifier, pronounced "there exists" or "for some": For any formula A, the string ((3x)A)—a string of the metatheory this is; not a string of WFF—abbreviates the formal string (member of WFF) (<(Vx)(iy4)). • 4.1.18 Remark. (For the reader who will consult [17]: Notation Translation) Where we write ((Vx)A) and ((3x)A), [17] uses (Vx I : A) and (3x  : A) respectively
(1)
If you are wondering, "What on earth do both "" and ":" do, one next to the other?" the reason is that (1) is a special case of (VxB : A) and (3xB : A) which in the standard notation of the computer science and mathematical literature— which we follow—are written as ((Vx)(B > A)) and ((3x)(B Λ A)) respectively. An expression like ((Vx)A) we pronounce "for all x, A holds". An expression like ((3x),4) we pronounce "for some x, A holds", but also "there exists an x, such that A holds". In an expression such as ((Vx)A), χ stands for a specific variable among x, y, z'gg , etc., where we either do not know which, or do not care. Thus, intuitively, it says "for all values of χ . . . " , not "for all variables x, x" ,y&r . . . ". Similarly, by "for some x, A holds" we understand "for some value of x, A holds". This pronunciation, as well as the clarification regarding "value", are consistent with the intended meaning of quantifiers. This intended meaning not only tells us what is the right way to pronounce ((Vx)A) but will also guide us to choose appropriate logical axioms (next section) that capture this intended meaning purely syntactically. I emphasize that our main task in predicate calculus will be to calculate theorems, that is, to write proofs. Semantic ideas—with the exception of those borrowed from Boolean logic—will have absolutely no role in the writing of our proofs. However, keeping our intuition informed and active, in particular understanding what an expression like ((Vx)A) is meant to say, will often assist our imagination toward discovering proofs. Anything goes in the discovery stage, even consulting the Oracle at Delphi. The actual writing stage is, however, restricted to be syntactic (except as noted in the previous paragraph). • g
96
^How we guess the next step is our business. However, we write and document a proof according to rules.
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
125
Before we go on, and in the interest of making notation friendlier (and sloppier), we augment Remark 1.1.11 here to take care of the additional symbols of firstorder languages: 4.1.19 Remark. (Priorities and Bracket Reduction) Our previous agreement (in Remark 1.1.11) on how to be sloppy and get away with it remains essentially the same, now augmented to take care of V as well: Certain brackets are redundant—and hence can be removed—from a formula written according to Definitions 4.1.13 and 4.1.14, still allowing it to say the same thing as before: (1) Outermost brackets are redundant. As in 1.1. 11, for the next two cases it is easiest to think of the process in reverse: how to reinsert correctly (as per Definition 4.1.13) any omitted brackets. (2) Any other pair of brackets is redundant, if its presence (as dictated by 4.1.13) can be understood from the priority, or precedence, of the connectives. Higherpriority connectives bind before lowerpriority ones. That is, if we have a situation where a subformula A of a formula has already been reconstructed as per 4.1.13, and is claimed by two distinct connectives ο and o, among those in (*) below, as in " . . . ο A ο ...", then the higherpriority connective "glues" first. This means that the implied brackets are (reinserted as) " . . . ο A) ο . . . " or " . . . ο (A ο . . . " according as ο or ο has the higher priority respectively. The order of priorities (decreasing from left to right, but (Vx) and  i having equal priority) is agreed to be: (*)
(3) In a situation like " . . . ο A ο ..."—where A has already been reconstructed as per 4.1.13, and ο is any connective listed in (*) above, other than or (Vx)— the right ο acts before the left. Thus the implied bracketing is " . . . ο (A ο...". Similarly, i>A is short for >(vl), .(Vx)A is short for >((Vx)A), (Vx)>.A is short for (Vx)(A), and (Vx)(Vy)A is short for (Vx)((Vy)4). We say that all connectives are right associative. This applies to (3x) as well when this abbreviation is used; after all, the convention of this remark applies to metatheoretical notation. It is important to emphasize: (a) This "agreement" results in a shorthand notation. Most of the strings depicted by this notation are not correctly written formulae, but this is fine: Our agreement allows us to decipher the shorthand and uniquely recover the correctly written formula we had in mind. (b) The agreement on removing brackets is a syntactic agreement.
126
EXTENDING BOOLEAN LOGIC
In particular, right associativity says simply that, e.g., ρ V q V r is shorthand for ( ρ V ( < ? V r ) ) rather than ( ( p V g ) V r ) . • 4.1.20 Example. Here are some examples of simplified notation: (1) Instead of (u = ν —> (((Vx)x = α) Λ ρ ) ) we may write simply u —ν
—> (Vx)x =
α Λρ
In the simplified notation the inexperienced reader may have some trouble readily seeing that ρ is not in the scope of (Vx). The rule of thumb is Whenever in doubt, use extra brackets! (2) Instead of ((Vz)(>x = y)) we write simply (Vz).x = y (3) Instead of ((Vx)((Vx)x = y)) we may write (Vx)(Vx)x = y Note that we do not want to eliminate the brackets around a quantifier, treating "(Vx)"—and the defined "(3x)"—as compound symbols. • If "(Vx) A" is meant to say that "for all values of x, A holds", then this is analogous to !=1
which says, "For all integer values of i—from 1 to 4 inclusive—compute the result i and then add all these four results." That is, compute 2
l + 2 + 3 + 4 2
2
2
2
Note that in expression (1) we are not allowed to substitute values into i. That is, something like
Σ " 3
(2)
3=1
is totally meaningless as it would say, "For all integer values of 3—from 1 to 4 inclusive—compute the result 3 and then add all these four results." Nonsense!— "3" cannot obtain any values other than 3. Thus, i in (1) is unavailable for substitution. We say that it is a bound variable. On the other hand, the expression 2
4
£ ( i + x)
(3)
2
i=l
means (1 + x) + (2 + x) + (3 + x) + (4 + x ) 2
2
2
2
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
127
Thus we may, if we wish, substitute specific values into x, say, 9, and compute (1 + 9 ) + (2 + 9 ) + (3 + 9 ) + (4 + 9 ) 2
2
2
2
for short i=1
Thus χ in (3) is available for substitution, or as we say, free. Analogously, χ is bound in the expression below, while ζ is free: (Vx)x = 2 We capture this by a definition. 4.1.21 Definition. (Bound and Free Occurrences) An occurrence of a variable χ in a formula A is characterized by the position—from left to right: first, second, etc.—where χ occurs as a substring in A (cf. 1.3.6). For example, the 3rd occurrence of χ in the following formula is shown boxed: χ — y —»x = j/V (Vfx])a: = ζ We say that an occurrence of χ in A is bound iff the occurrence is the χ that occurs in a substring (Vx) of A, or if it occurs in the scope of some (Vx) that occurs in A. An occurrence of χ in A that is not bound is called free. Below I show all bound occurrences of χ in the foregoing example (singly boxed): y
\x\ = y V ($x$x\
=ζ
We usually count bound occurrences—and free occurrences—from left to right, separately, thus, we have above two bound occurrences, shown boxed, and two free occurrences, shown doubly boxed. We also have two free occurrences of y and one of z. • 4.1.22 Remark. We sometimes say, "The nth bound occurrence of χ belongs to—or is bound to—the mth occurrence of (Vx) in the formula A." What do we mean by that? We mean one of the following: (1) The nth bound occurrence of χ is the χ in the mth occurrence of (Vx), or (2) The scope of the mth occurrence of (Vx) is the shortest among the scopes, of any (Vx), which contain the nth bound occurrence of x. Thus, in
(VQ3) ( Ξ = y ν (vb])[b] =
z Λ
Ξ = ν)
the three boxed bound χ belong to the first (leftmost) (Va;) while the doubly boxed ones belong to the second one.
128
EXTENDING BOOLEAN LOGIC
Similarly, in (Vx)(Vx)@ = ?/
(1)
the boxed χ belongs to the second (rightmost) (Vx). This process of finding where a bound variable χ belongs—to which (Vx)—hinges on formulacalculations: An χ belongs to that (Vx) that took away its freedom in the course of a formulacalculation. For example, a formulacalculation for (1)—with reduced bracket notation—is χ = y, (Vx)x = y, (Vx)(Vx)x = y
•
This process of finding to which "(Vx)" a bound variable χ belongs is analogous to that of finding the "blockhead" where a local variable χ is declared in a language like Algol or Pascal: One goes back (leftward in the program string) until one reaches the first occurrence of a declaration for x. 4.1.23 Definition. (Subformulae) We define the concept "B is a subformula of A" inductively: (1) A is atomic. Means that the strings A and Β are identical. (2) A is *C. Means that either Β is the same string as A, or it is a subformula of C. (3) A is (Vx)C. Means that either Β is the same string as A, or it is a subformula of C. (4) A is C ο £), where ο e {Λ, V, — = } . Means that either Β is the same string as A, or it is a subformula of C, or of D (or both). • 4.1.24 Exercise. Show by induction on A, that if we replace any (possibly all) occurrences of a subformula of A by some Boolean variable, then the resulting string is a formula. • 4.1.25 Remark. (Abstractions) We saw that every Boolean expression as defined in 1.1.5 is also a firstorder wff, as defined in 4.1.13 (cf. 4.1.11). The former is a special case of the latter. Much more useful to us, it turns out, is the fact that Boolean expressions are abstractions of firstorder formulae. We already said so in the preamble of the current chapter (p. 113), but we will now make the case; the why and how. First the how: To "abstract" means to discard information that you do not need so that you can focus on what really matters unhindered by unnecessary details. We can view (firstorder) formulae as Boolean formulae if we become oblivious to the presence of all nonBoolean elements—those that speak of objects—and concentrate instead on the Boolean structure, that is, how the Boolean connectives Λ, V, —>, Ξ connect things up. The nonBoolean elements are, of course: The (object) variables, constants, predicates, functions, "=", and "V"
(1)
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
129
How do we become oblivious to such elements of syntax—as enumerated in (1)—that occur in a firstorder formula ΑΊ We implement our unconcern by covering those elements up! That is, by first identifying the shortest possible subformulae of A that contain such symbols and then replacing said subformulae by new Boolean variables. 91
Important! In the actual implementation of this procedure we do not really replace these subformulae by new symbols. They themselves, as written, are (names of) these new Boolean variables, a fact that automatically satisfies the remark in the preceding footnote. Just like the existing Boolean variables of the alphabet, such as P777999. these too are compound symbols—such as "x — y" or "(Vx)x = z"—the elementary subsymbols of which, e.g., "(, V, χ ", are invisible to Boolean logic as separate syntactic entities, just like the individual subsymbols " 7,9, ' " of P'77'7999 are invisible as symbols of any structural significance vis a vis 1.1.3. Exercise 4.1.24 guarantees that these substitutions of subformulae by Boolean variables generate formulae. Of course, viewing a firstorder subformula as a new Boolean variable, in effect, substitutes the subformula by the said variable. In essence we are saying: / do not care what these subformulae of A say about objects. I am only interested in how these subformulae interconnect via  1 , Λ, V, —> and =, that is, in the Boolean structure of A. For example (using simplified notation), if A is ρ —• χ = y V (\/χ)φχ Λ q (Note that q is not in the scope of (Vx)) then the abstraction is ρ » ρ' V ρ" Λ q where I used metavariables, in order to emphasize the form of the "abstraction", p ' for "x = y" and p " for "(Ϋχ}φχ". Needless to say, I view p ' and p " as distinct, and different from any Boolean variables of alphabet 4.1.2—the former because, by inspection, the actual names "x = y" and "(\/χ)φχ" these metavariables stand for are distinct strings; the latter by the "Important" italicized remark above. 77m obvious comment does not deserve repetition. If A is χ
= y —» χ = y V ζ = ν
(1)
then the abstraction is ρ
ρ Vq
again using the metavariables only for notational emphasis that indicates our indifference to the exact firstorder structure of χ — y and ζ = v. ""New" means that they do not already occur in A as members offirstorderalphabet 4.1.2.
130
EXTENDING BOOLEAN LOGIC
Note that the abstraction of (1) is a tautology. A more interesting example is the following, which shows that some of the shortest subformulae that contain nonBoolean elements will be totally suppressed in the final abstraction: (\/x)(x = y * (Vz)z = a V q) is just a (new) Boolean variable, p , since the shortest subformulae that contain nonBoolean elements have been identified (via enclosing boxes) as follows: (Vx)( χ = y
—•
(Vz)z = a  v
(2)
so that the abstraction process, in slow motion, and working from inside out is: First obtain ι ( V x ) ( q ' ^ , (Vz)q" V
(3)
(Vx)(q'.q"'V ) 9
and finally take care of this last box and call it, say, "p". Similarly we handle an A that is ρ —> χ = y V (\/χ)(φχ A q)—q in the scope of (Vx)
(4) (5)
Then the abstraction is marked as χ = V V (Vx)( φχ
Aq)
and in the final stage yields ρ
ρ' V p "
It should be clear (cf. 4.1.26) that the subformulae of the following two types, (a) atomic—but not Boolean or (b) of the form ((Vx)A), are precisely the ones that get abstracted into (i.e., name) new Boolean variables. Not all such identified subformulae of some formula A need appear in the final result of the abstraction of A (cf. (3) and (4) above; q', q", q" are lost). Subformulae of the types (a) and (b) are called prime (e.g., [45, 53]). But why do we want to abstract"? Abstractions are extremely useful in predicate logic. On one hand, we have the obvious benefit, simplification. On the other, by allowing us to view firstorder formulae as Boolean formulae, abstractions enable us to use, in predicate logic, all the semantic (truth table) and syntactic (proof) techniques that we have learned in Part I—including 3.2.1. To be sure, additional techniques that allow us to handle "V" and " ="— which abstraction totally hides from view—will be necessary, so we must not expect to reduce predicate calculus totally to propositional calculus! Thus, in the context of firstorder logic, we have a new view of Boolean variables:
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
131
A Boolean variable denotes a statement about objects, but we either do not know what it says, or we do not care what it says about these objects. With only a modicum of practice, we will find that we do not have to rewrite a formula, introducing new Boolean metavariables, in order to view it abstractly. For example, we should be able to see at once the (final) boxed stage that identifies the Boolean structure of (5): ρ —> Ι χ = y ΙV (Vx) (φχ Λ q) By the way, boxing the shortest subformulae in our process of abstraction is important as it maximizes the number of Boolean connectives that remain "uncovered". We suppress details about objects but keep all the detail of the Boolean structure. • 4.1.26 Exercise. Verify the statement I made earlier, in 4.1.25, namely, "It should be clear that the subformulae of the following two types, (a) atomic—but not Boolean or (b) of the form ((Vx) A), are precisely the ones that get abstracted into (i.e., name) new Boolean variables." Namely, show that any nonBoolean symbol of a formula belongs to a shortest subformula of the type (a) or (b). • We may now define: 4.1.27 Definition. (Tautologies and Tautological Implications) We say that a firstorder formula A is a tautology, and write (=,a A, iff the abstraction of A is a tautology. In firstorder logic, we write Γ  = , A iff the abstractions of the formulae in Γ tautologically imply the abstraction of A. • Ut
ωυ
Before we leave the section on language, we need a few more definitions, notably concepts of substitution. As in algebra, we want to be able to substitute an object for a variable that accepts such substitutions (i.e., it is a free variable). But for the purpose of applying Leibniz we also want to be able to substitute a formula A into a Boolean variable ρ (cf. 1.3.15). For any terms s and t and variable x, the notation (in the metatheory) "s[x := i]" will denote the result of replacing all original occurrences of χ in s by t. Similarly, for any formula A, variable χ and term t, the (informal) name A[x := i] will mean the result of replacing all original free occurrences of χ in A by t. In the case of a formula A, we must be careful when to allow such a substitution to take place. For example, (3x)>x = y says, intuitively, that no matter what the (value of) y, there is a (value of) χ that is different. We expect that the meaning that we just expressed in English should be independent of what name we use for the free variable y. Yet, if we allowed substitutions of terms into y recklessly we would in particular allow the substitution
132
EXTENDING BOOLEAN LOGIC
which results into (3x)<x = x. But this has a totally different meaning from the original: It says that there is a (value) χ that is not equal to itself, a clearly absurd suggestion! This motivates us to disallow the completion of the operation of substitution if it results in a free variable χ getting in the scope of (Vx)—getting captured, as we say. This is taken care of in the following (recursive!) definition, which has two parts: one for s[x := t] and one for A[x := t]. In order to read the following definitions on substitution correctly—"operations" such as [x := t], [ρ := B] and [ρ \ B]—we emphasize that the operation takes place in the metatheory and has the highest priority against all other "formal or informal operations" such asV, 3, = , ι, Λ, V, —», =. For example, (3x)A[p := B] means (3x){A[p := Β}} and t = s[x := s'] means t = {s[x := s']}, where the symbols " { , } " are here metabrackets inserted to indicate order of application of "operations". By abuse of notation—"(i = s)" being illegal—we write (t = s)[x := s'} for {f = s}[x : = a'}. Once more, these operations are /e/rassociative, e.g., A[p := B][q := C] means {A[p := B}}[q := C\.
4.1.28 Definition. (Substitution of Terms into Variables) In what follows, we allow "= " to appear only formally, thus unlike Definition 1.3.15, instead of also using "= " metatheoretically, we will use the verb is for equality between strings. In the interest of generality, the definitions are given in terms of the metavariables χ and y that name arbitrary variables. Since χ and y name arbitrary variables, it is conceivable that they name the same variable. If we want to claim the opposite, we must explicitly say so: "x and y are different" or "x (not y)". (1) The meaning of "s[x := t}"—i.e., its expansion is given by induction (recursion) on the complexity of the term s:
s[x := t] is <
/(«i[x:= t],.
. ,s„[x:=i])
if s is a constant or a variable (not x) if s is χ ifsis/(si,...,s„)
where we used the notation with brackets and commas (cf. 4.1.6) in the general case above. (2) The definition says that we are to replace every free occurrence of χ in A by i, but if for some y that occurs in (—free, of course—there is a subformula (Vy)B of A where χ occurs free, then we abort the operation and declare A[x := i] undefined.
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
133
The meaning (expansion) of "A[x := t]" is given by induction (recursion) on the complexity of the formula A. We use reducedbrackets notation, as usual: 0(si [x := t],...,
s [x := t]) n
S i [ x := t] = s 2 [ x := t]
.C[x:=t] C[x := t] ο D[x := t] A A[x := t] is < ( V y ) B [ x : = t ]
undefined
if A is <£(si,. . . , s „ ) if A is s\ = s if A is >C if A is C ο D if A is one of ρ, T, ± , (Vx)B ifAis(Vy)B, where y(not x) does not occur in t or χ is not free in Β if A is (Vy)B, where y(not x) does occur in t and χ is free in Β 2
where ο above is one of Λ, V, —», Ξ. In each case above, the lefthand side, A\x : = i], is defined iff all the needed righthand side substitutions are defined—e.g., C[x := t] and D[x := t\ in the case of o. • The definition is pretty natural: In (I) the middle case (where s is x) is obvious. The case where s a constant is too: You cannot change the constant! As for when s is a y—that is, other than χ—then there is no change in s either, for we are asking to change χ but s neither contains, nor is, x. The last (inductive) case is also pretty understandable: How would one go about plugging a 3 into χ in, say, cos(sin(x))—i.e., what are the steps to do cos(sin(a;)) [x := 3]? Well, we work from inside out: We first plug the 3 into the χ of sin(x)—to obtain sin(3)— and then we apply cos to sin(3) to get cos(sin(3)). The last case of (1) simply generalizes this example: Think of cos as " / " , take η = 1, and then think of sin(a;) as " s i " and 3 as "r". In (2) the points to emphasize are: (a) If A is (Vx)B then, intuitively, A does not depend on χ—χ is not free. So we can plug t into χ by doing nothing: We do not change A. (b) In the case before the last we are told that to form A[x := t\ we just form B[x := i] first, and then we add the quantifier (Vy) up in front—as long as no variable in t gets captured (p. 132) by this (Vy). Of course, the only variable that can ever belong to (Vy)—cf. 4.1.22—is y itself, so the condition "y(not x) does not occur in t" is sufficient (but not necessary) to avoid capture. The condition "x is not free in B" is also sufficient by itself as then ((Vy)B^ [x := t] is just (Vy)B—same as before the substitution. See Exercise 4.1.33 below. (c) In the last case, there will be capture—if we go ahead with the substitution— since at least one occurrence of χ is free in B. Thus, at least one χ of Β will be
134
EXTENDING BOOLEAN LOGIC
replaced by t causing a y in (to bind with the (Vy). We have agreed that in this case we must abort (cf. the discussion following 4.1.27). Thus we say that the substitution as requested cannot be performed. For short, the result of the operation "A[x := t}" in this case is unavailable; it is undefined. We conclude our syntactic preliminaries by expanding Definition 1.3.15 to firstorder languages. As we said before, we need something like "replace all occurrences of ρ in a formula A by the formula B" in order to make the Leibniz rule formulation friendly. It turns out that we will need two concepts of formula substitution, one of which will be denoted analogously with A{x :— t] as A[p := B], and, also analogously, it will not be allowed to proceed in case of variable capture; it will be undefined ("impossible") in that case. We may call this substitution conditional. We will also benefit from the presence of an "unconditional" substitution, one that we allow to proceed regardless of any capture. This will be denoted by A[p \ B]. At this point, having two types of substitution into Boolean variables may look like an extra burden, but I promise that the usefulness of both will be evident before too long. 4.1,29 Definition. (Unconditional Substitution) The unconditional substitution of a formula into all occurrences of a Boolean variable ρ in a formula A is denoted by A[p \ B] and is defined almost exactly as in 1.3.15, by adjusting the atomic case and by adding a clause for "(Vx)". f
A[p\B)\s
Β A l^C\p\B] C[p\B}oD[p\B} (Vx)C[p\B]
if if if if if
A is ρ A is in AF but is not ρ A is iC A is Co D A is (Vx)C
• The above is straightforward. The inductive cases go through without restrictions, and what they do is to apply the substitution to the immediate subformulae of A, and then apply the appropriate connective (Boolean, or the quantifier, as the case may be). The immediate subformula of (Vx)C is C, i.e., the formula on which we applied "(Vx)" to get (Vx)C during the relevant formulacalculation. Case one is clear cut, but so is the second: The only way an atomic formula A can contain ρ is to be p. So if it is not, plugging Β to ρ is irrelevant; it does not change A. The conditional substitution is defined similarly to the unconditional one, but the former will disallow the last case in the definition above if capture occurs. This will render the result of the operation >4[p := B] undefined. 4.1.30 Definition. (Conditional Substitution) Conditional substitution of a formula into all occurrences of a Boolean variable ρ in a formula A is denoted by A[p := B].
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
135
The result of this substitution will be undefined if capture of a variable occurs at any step. Below we will use reducedbracket notation:
Β A A[p :=
B] is {
.C[p:=B] C[p := Β] ο D[p := B] (Vx)C[p := B\
if A is ρ if A is in AF but is not ρ if A is .C if A is C ο D if Λ is (Vx)C and χ is not free in Β else undefined
In each case above, the lefthand side, A[p := B], will be defined iff so are all the contributing substitutions in the righthand side. • Intuitively, it is immediately evident that whenever A[p := B] is defined, then it is expanded (stands for) as the same string that A[p \ B] stands for. We can actually prove this by induction on the complexity of A. For atomic A this is obvious, indeed the "whenever" is superfluous: Both A[p := B] and A[p \ B] are defined in this case, period. We have three more cases, precisely the ones in 4.1.30 and 4.1.29: (1) Suppose A is iC. Let A[p := B] be defined. By 4.1.30 this is 
(*)
By 4.1.29, A[p \ B] is .C[p \ B]. By (*), A[p \ B] and A[p := B] are the same. (2) Suppose A is C ο D (o is any of Λ, V, —>, =). This case is similar to the previous, so I leave it to the reader. (3) Suppose A is (Vx)C Let A[p := B) be defined. By 4.1.30, this is (Vx)C[p := B], and C[p := B] is defined, and χ is not free in
B.
Now, the I.H. applies to the less complex C (immediate subformula of A), hence by the middle conjunct of the preceding statement, again (*) above holds. By Definition 4.1.29—which is totally indifferent to "and χ is not free in Β"—A[p \ B] is (Vx)C[p \ B]. By (*), A[p \ B] and A[p := B) are the same once more. We are done. 4.1.31 Example. We calculate a few substitutions according to Definitions 4.1.28, 4.1.29, and 4.1.30. (1) (x = y)[y ~ x]. This (by 4.1.28) is x[y := x] = y[y := x], which again by 4.1.28 is χ = χ. (2) ^(Va;)x = y^ [y := x\. Using 4.1.28, this is undefined because it falls under the last case in the definition (part (2)).
136
EXTENDING BOOLEAN LOGIC
(3) (Vx)(x = y)\y := x\. According to our redundantbrackets convention, this is (Vx){(x = y)\y := x]}. This does not ask that we form the substitution in (2) above, it rather asks (in a roundabout way, using (1) above), "Apply (Vx) to χ = χ", which is fine. The final answer is (Vx)x = x. 98
(4) ( ( V a O i V y W * , » ) ) [ ! , : = x\. According to 4.1.28, we are asked to do ((Vj/)
•
4.1.32 Exercise. Prove by induction on the complexity of A that A[p \ B] i s a formula, and that so are A[x := t] and A[p := B] whenever defined. • 99
4.1.33 Exercise. Prove by induction on the complexity of A that if χ is not free in A, then, for any term i, A[x := t] is A. • 4.1.34 Exercise. Intuitively, A[x := x] is A since we change nothing in A when we replace χ by x. But just for the sake of doing yet another proof by induction, prove by induction on the complexity of A that indeed A[x := x] expands as A. • 4.1.35 Example. This is an important example, as we will quote it in the crucial "dummy renaming metatheorem" later on (6.4.4). Assume that ζ does not occur in A (as either a free or a bound variable). As we say, ζ is fresh. That A[x := z][z := x] should be just A is pretty much "obvious", right? Pause. The term obvious is very useful in mathematics. It leads to the technique of proof by intimidation. You just say, "It is obvious", and no one who does not want his intelligence questioned will dare ask you "why"! ''This is because (x = y) [y := x] is χ = χ by part (1) above. "is here is argot for expands as.
THE FIRSTORDER LANGUAGE OF PREDICATE LOGIC
137
You change χ into ζ and then ζ back into x. This should get you back to where you started, namely, A. Shouldn't it? Well, let A be (Vz)x = z. Then A[x := z] is undefined (i.e., not a formula) and therefore so is A[x := z][z := x]. Or, let A be χ = ζ. Then A\x := z] is ζ = ζ and A[x := z][z := x] is χ = χ—which is not A, unless χ and ζ denote the same variable. Thus the stated condition is necessary. But is it sufficient? Yes, as we see by induction on the complexity of A—under the stated condition—i.e., A[x := z][z := x] expands as A
(1)
Implicit in (I) is that both substitutions A[x := z] and {A[x := z]}[z := x] are defined, where { } are metabrackets indicating here a completed operation. We look only at the case of distinct variables χ and z, since otherwise we are looking at A\x := x][x := x], which is A, because A[x := x] is also A (4.1.34). To handle the atomic case we need to handle the case of terms, since, e.g., t = s is one of the atomic cases. So we prove first, by induction on the complexity of terms t, that ί[χ := ζ] [ζ := χ] is t as long as ζ does not occur in t
(2)
There are three cases (Definition 4.1.28, part (1)): Case 1: t is x. Then £[x := z] is ζ and z[z := x] is x; thus t[x := z][z := x] is x, that is, t. Case 2: t is y, other than χ—and also other than ζ by hypothesis—or ί is a constant a. Then £[x := z] is t (y or o), and since y is not ζ, i[z := x]—i.e., i[x := z][z := x]—is still ί in either case (y or a). Case3: tis/(si,... ,s ). Nowi[x := z][z := x ] i s / ( s i [ x := z][z := x ] , . . . , s „ [ x := z][z := x]), which by the I.H.—applicable since all the Si are less complex than t—is / ( s i , s ) , that is, t. n
n
Now that (2) is proved, we turn to (1). For A atomic—following part (2) of 4.1.28—we find that the claim is trivial in the cases where A is other than t = s or φ(β\,s ). Even these cases are immediate with (2) settled. For example, (t = s)[x := z][z := x] is t[x := z][z := x] = s[x := z][z := x], which by (2) above is t = s. The claim also clearly "propagates" with the Boolean formation rules. That is, (cf. 4.1.10, parts (2) and (3)) if the immediate subformulae of A—i.e., β if Λ is >B; Β and C if A is Β ο C, where ο is one of Λ, V, —>, Ξ—satisfy the claim, then so does A itself. Consider then the two subcases where A is either (Vx)B or (Vw)B where w and χ are different. Note that under our assumptions, the subcase (Vz)B does not apply. In the first subcase A[x := z] is A (cf. 4.1.28, 3rd case from the bottom). Since, by assumption, ζ is not free in A, we get that A\x := z][z := x]—that is, A[x := x]—is just A (Exercise 4.1.33). n
138
EXTENDING BOOLEAN LOGIC
The second subcase now is displayed in the calculation below: A[x := z][z := x] is ((Vw)fi) [x := z][z := x] is ((Vw)B[x := z]) [z := x] by 4.1.28 + I.H. is (Vw)B[x := z][z := x]
by 4.1.28 + I.H.
is (Vw)B
by I.H.
100
is A
•
One last useful syntactic concept that we need to formulate our axioms is that of partial generalization. 4.1.36 Definition. We say that β is a partial generalization of A if Β is formed by prefixing A with zero or more expressions such as (Vx) for any choice of the bound variable x. • 4.1.37 Example. Here is a list of some partial generalizations of χ = ζ:
χ—ζ
(Vw)x = ζ
(\/χ)(\/χ)χ = ζ
(Vx)(Vz)x = ζ
(Vz)(Vx)x = ζ (Vz)(Vz)(Vz)(Vx)(Vz)x = ζ
Π
The preceding definition may be rephrased recursively: 4.138 Alternative Definition. A is a partial generalization of A. If β is a partial generalization of A, then the same is true of ((Vx)£?) for any choice of the bound variable x. • 4.2
A X I O M S A N D R U L E S O F F I R S T  O R D E R LOGIC
At the beginning of Section 1.4, I said "Boolean logic is a (crude) vehicle through which we formulate and explore mathematical truth." To this end, the axioms of Boolean logic determine how the Boolean connectives and the constants _L and Τ behave. They postulate the α priori truths from which we proceed to discover more and more truths in mathematics. Note how I used the qualifier crude and elaborated further on (p. 113) that "I regret to say that [Boolean logic] is totally insufficient [toward discovering mathematical truth]" because it manipulates mathematical statements "by name" only, and is thus incapable of seeing inside the firstorder structure of the statements; therefore it does not allow us to talk about objects, quantifiers, or equality. '""The I.H. relevance stems from the italicized remark following (I) on p. 137.
AXIOMS AND RULES OF FIRSTORDER LOGIC
139
Enter firstorder logic. Its axioms must still determine the behavior of Boolean connectives and constants, but they must also tell us how the quantifier "V" and equality " = " behave. Naturally, then, the axiom set for firstorder logic includes all the axioms of Boolean logic. Just as in the case of Boolean logic, one chooses the axioms of predicate calculus very carefully so that they express "universally acceptable"—i.e., applicationindependent—principles. As such, an axiom like "(Vx)(>a: + 1 = 0)"—while valuable for the study of the application known as number theory, which is about the properties of natural numbers—has no place as an acceptable universal principle, and will not be included. 101
4.2.1 Definition. (Logical Axiom Schemata of Predicate Logic) In what follows, A,B,C stand for arbitrary formulae, and χ for an arbitrary variable. The set of logical axioms of firstorder logic consists of all possible partial generalizations of the formulae in the following groups, AxlAx6: Axl. This group contains all tautologies (cf. 4.1.27). For example, ρ V >p, χ = 0 V <x = 0 and r —> r V q are each included. So is ^Ι = 5 = Ι =
X
5 Ξ 1 .
Although we present predicate calculus in a format suitable/or all applications, we have already said that in examples we reserve the right to use symbols from specific applications, such as the "0"—or the "5", short for SSSSSO—of the language where number theory is spoken.
Ax2. This group contains all formulae of the form (Vx)yl + j4[x : = i\. It has the name specialization axiom but also substitution axiom. Ax3. This group contains all formulae of the form (Vx)(A —> B) —> (Vx)A —• (Vx)B (I have used least parenthesized notation; cf. 4.1.19). Ax4. This group contains all formulae of the form A —* (Vx) A, where χ is not free in A. Thus χ = 0 —» (Vy)x — 0 is included but ζ = 5 —• (Vz)z = 5 is not. Ax5. This group contains all formulae of the form χ = x. The name of this axiom group is "identity axiom (group)". Again we have infinitely many axioms in the group, even before the application of partial generalization, because there are infinitely many instances of the metavariable x. Ax6. This group contains all formulae of the form t = s —» (A[x := t] = A[x :— s]). It is called the "Leibniz axiom (group) for equality". ""For example, (Vx)(ix + 1 = 0) is a false statement about the real numbers, for it would say that "for every real number χ it is true that if you add 1 to it, the result will be different from zero". Yet 1 + (—1) = 0. This axiom is actually included as a special or nonlogical axiom, if one wants to just do number theory. It is part of the socalled Peano axioms for number theory or arithmetic.
140
EXTENDING BOOLEAN LOGIC
We will denote by Λι the set of all logical firstorder axioms defined here in order to distinguish it from the Λ of l .4.4. Think of the subscript " I " as a reminder that we are talking about /storder axioms here! • Of course, Λ is a proper (i.e., not equal) subset of group Axl. Even though it may look like overkill to include all tautologies in group Axl, doing so has both a technical and practical basis. This approach is encountered in the literature, e.g., [13, 33, 50, 51, 53]. The foundation here is that of [50, 51]. In a correctly founded firstorder logic we can certainly prove Post's theorem. Thus, technically, whether or not we include all tautologies as axioms, we will have them as theorems, anyway. Practically, Post's theorem already, in Part I, has given us the license to invoke without proof, within a formal proof, whichever tautologies are known to us exactly in the same manner that we invoke axioms. Moreover, the technical demands of writing predicate calculus proofs justify our putting to rest the untilnow meticulous syntactic proofs of tautologies and tautological implications that we practiced in Part I, and to concentrate instead on mastering the difficulties that are peculiar to the handling of quantifiers and other nonBoolean elements. Rest assured that whichever such tautologies (or tautological implications) we invoke in practice are of a very trivial nature and are readily recognizable as such.
4.2.2 Remark. We argue here, intuitively, of course, that the axioms listed above are indeed universal principles, unbiased by considerations specific to particular theories. (1) That the axioms in group Axl express universally true principles stems from our intuitive understanding of the term tautology. (2) The name specialization of Ax2 stems from what it says: "If a statement (here A) is true for all (values) of x, then it must be true of any special value (that we are allowed to plug into x." The principle in quotes is valid no matter what application of logic we may have in mind. Which part says "that we are allowed""} The "[χ := i]" part, of course, as you will recall from 4.1.28. Definition 4.1.28 keeps Ax2 honest, and true, since substitution is not always allowed. For example, take A to be (By)^x = y. The formula in (*) below is not included in group Ax2, since we are not allowed to perform the substitution "((3y)ix = y) [x •= V}"toget "(3y)^y = y". This is just as well, because (*) states an invalid principle! It states, "If for every value of χ there is a value of y that is different, then there is some value of y that is different from itself." 102
(Va;)(3y)^x = y » (3y)^y = y Theory was defined on p. 116.
(*)
AXIOMS AND RULES OF FIRSTORDER LOGIC
141
Why is (*) invalid? Because the i/part does have true instances—e.g., no matter which real number you pick, I can find one that is different—but the then part is never true! (3) Let us see now why, intuitively, every instance of the schema (Vx)(A
B)
(Vx)A > (Vx)S
H)
of group Ax3 expresses a universally valid principle. Well, let us freeze for our discussion the formulae A and Β and the variable x. Statement ($) says: If (Vx)(A + β ) holds
(i)
if (Vx) A holds
(ii)
(Vx) S holds
(iii)
and then Let us then suppose the informal statements (i) and (ii) and conclude (iii). Statement (i) says, in words, "Any value of χ that makes A true, also makes Β true." Statement (ii) says, "A holds for all values of x." Hence, by (i), Β holds for all values of x; we have got (iii)! (4) The universal validity of the principle expressed by the schema in group Ax4 is easy to verify: You see, if χ is not free in A, this means, intuitively, that what A says is independent ofχ.. Therefore proclaiming "For all x, A holds" or just "A holds" makes no difference. Have I not just argued that A = (Vx) A is a correct universal principle? Yes, I did! Note, however, that mathematicians (and logicians) prefer to say as little as necessary in their axioms. This is why the group Ax4 is formulated as above, with "—>" rather than with "=". The <— direction need not be stated since it can be proved formally to follow from Ax2. For now, in outline, let me only indicate that such a "proof would be based on the following observations: (Vx)A —• A[x := x] is in Ax2 and we know that A[x := x] is just A (cf. 4.1.34). (5) The schema χ = χ expresses an obviously valid universal principle: An object is the same (equal) as itself, no matter what this object may be. (6) Schema Ax6 also expresses a universally valid principle. It says, "If two objects ί and s are the same, then for any property A, either both t and s have the property, or neither does." At the informal level, the intuitive concept of property is synonymous with that of statement. Indeed, a statement Ρ determines a property, shared by all objects that make Ρ true. Conversely, a property Ρ determines the statement "x has P". The origins of Ax6 are traced back to Leibniz's characterization of equality between objects. He suggested that two objects are equal iff they have exactly the same properties. In symbols, Leibniz's statement is captured by 103
t = s = (VP)(P[x := t] Ξ Ρ[χ := s}) In a PingPong argument; cf. 3.4.5.
(**)
142
EXTENDING BOOLEAN LOGIC
Of course, the language of firstorder logic does not allow us to write (V)—let alone (VP). So how can we translate (**) into our firstorder language? Our translation is forgetful. First, we forget the <— direction of (**) and are content with stating just t = > (VP)(P[x := t] = P[x := s]) s
(* * *)
Second, not being allowed to use "(VP)" to express "for all P", we do the next best thing: We exhaustively postulate all the infinitely many formulae of the form t = s^ (P[x := t\ = P[x := β])
(1)
For each instance of the syntactic variables t, s, x, and Ρ we obtain a formula of the form (%), in essence replacing the intuitive concept of property or statement by the formal one of formula. But (^) is precisely the schema Ax6! Unfortunately, this latter compromise, going from (* * *) to Ax6, is also forgetful. It is a fact that we will not establish here (it uses a bit of a set theory argument) that there are far more properties than there arefirstorderformulae; thus our "representation", or "coding", of the former by the latter is far too coarse. Thus, saying, on one hand, for all properties P, which is the meaning of (* * *), and, on the other hand, for all formulae P, which is the meaning of schema (1), i.e., Ax6, are two very different things! Oh well, not to worry about this. As it turns out, and this is rather surprising after all this hacking at (**), we have retained enough in Ax6 to still be able to prove the usual properties of equality, such as symmetry (x = y —> y = x) and transitivity (x = y Λ y = ζ > χ = z). • (1) Just as in our discussion of Ax2 we observe that the definition of substitution (4.1.28), which has an "undefined" or "don't do it!" case, keeps Ax6 honest: By disallowing substitution in certain cases we disallow incorrect instances of the axiom schema. For, imagine that A is (3ν)·χ = y. We can try Ax6 on this formula, taking t and χ to be the variable χ and s to be the variable y: x = y+ (jj3y)^x
= yj[x := χ] Ξ {{3y)^x = y^[x :=
(2)
However, "((3y)>x = y) [x := x]" is just (3y)^x = y (cf. 4.1.34), but "((By)>x = y)[x := y\" is undefined by 4.1.28. This means that (2) does not translate into χ = V > ((3y)>x = y= [3y)^y = y)
(3)
in other words, we cannot proclaim (3) as a member of axiom group Ax6. This is just as well, because (3) is unacceptable! Let us see why, arguing intuitively (intelligently, but loosely). Now "(3y)^y = y" says, "There is a value of y that is not equal to itself." This is a falsehood. Thus, (3) simplifies into χ = y *  (3y)^x = y 
(4)
AXIOMS AND RULES OF FIRSTORDER LOGIC
143
a simplification that uses principle (4) in the list of universal principles given in 1.4.4, and thus also included in Axl. Pause. You surely have noticed that when I argue nontechnically—when 1 am not writing a proof, that is—I avoid saying "axioms" and rather say "principles". Recall that 3 is just an abbreviation (4.1.17), so (4) really says
104
χ = y > (Vy)x = y
(5)
Do you believe (5)? If you do, then you must also accept any special case of it, such as 0 = 0 —• (Vy)0 = y. Unfortunately, to the left of "—»" I have a "true" statement but to the right I have a "false" one. So the special case topples, bringing down with it the general case (5). (2) Ax6 must not be confused with the Leibniz Rule (Infl of 1.4.2) of Part I (which we will reintroduce shortly for predicate calculus). Ax6 is about object equality, "= ". In Part I we had no objects to talk about. Theorem [SFL) of Section 3.4, which [17] nicknamed the Leibniz axiom, has no connection with axiom schema Ax6 beyond a superficial structural similarity—if, that is, one forgets the fundamental difference between " Ξ " and "=". Moreover, while {SFL) is provable, as we saw, within propositional calculus, schema Ax6 is known not to follow from the other axioms of predicate calculus. We next turn to the primary rules of inference for predicate logic. We have augmented the logical axiom set of Boolean logic (1.4.4) by adding axiom groups Ax2Ax6—and that mysterious "partial generalization" whose purpose will be clear soon. We have added just enough axioms to the Boolean case so that all the properties of objects, quantifiers, and equality can be reasoned about without introducing any new rules of inference! We will use in firstorder logic the very same rules we introduced in 1.4.2, namely Infl and Inf2. Now this must be interpreted to mean that we apply rules Infl and Inf2 to the Boolean abstractions (4.1.25) of firstorder formulae—after all, these are Boolean or propositional rules, that is, they apply to Boolean formulae. Therefore we must view firstorder formulae as Boolean ones in order to make sense of applying these rules to them. This is not hard to do: The form of Inf2 remains the same in the firstorder case, namely, A,A
^
= B
.
{Eqn)
since the abstraction of a firstorder formula Α Ξ Β will still look like A = Β—no change in shape—because abstractions do not eliminate Boolean connectives, unless these are in the scope of a quantifier. The " Ξ " of A = Β is not in any such scope A tiny leap of faith, this. In slow motion, "i(3j/)«c = y" is short for "  i  i ( V j i )  i  > a : losing the double negations, yields "(Vy)x = y". Intuitively, anyway! l 0 4
=
y", which,
144
EXTENDING BOOLEAN LOGIC
(Why?). In other words: We do not need to explicitly convertfirstorderformulae to their abstractions in order to apply Infl (equanimity). We apply it directly. We must be more careful with Infl: A=Β C[p := A\ = C(p := B\ Since this rule is applied to Boolean abstractions of firstorder formulae, any "p" that occurs in C must be "visible" in the abstraction; that is, it must not occur within the scope of a quantifier in C. Thus the rule, without any reference to abstractions, is stated as A=Β C[p:=A\
= C\p:=B]' provided that ρ is not in the scope of a quantifier in C
(BL)
We will call this rule BL for Boolean Leibniz. 4.2.3 Remark. (1) The qualifier "Boolean" in BL is important as, on one hand, it reminds us of its origin and in particular the restriction on p , and, on the other hand, it distinguishes it from derived Leibniz rules that we will soon prove and use. These derived rules do allow us to replace a Boolean variable ρ that does occur in the scope of a quantifier in C, so they act beyond the Boolean structure of formulae. (2) Why is it a good thing not to add new (primary) rules of inference? Because since the Boolean axioms are a part (subset) of the firstorder axioms, keeping the rule set invariant means that anything we can prove in Boolean logic we can still prove in firstorder logic as long as the concept of proof remains the same (it does). We will keep all our Boolean theorems! • In summary, 4.2.4 Definition. (FirstOrder Rules of Inference) The primary firstorder logic's rules of inference are Eqn and BL above. • 4.2.5 Remark. We can rewrite BL as C[p\A]
A= Β = C\p\B]' provided that ρ is not in the scope of a quantifier in C
(BL)
the reason being that the restriction stated makes capture of a free variable by a quantifier impossible during the two substitutions in the conclusion part of the rule. We have seen (p. 135) that—under nocapture conditions—the formulae C[p := A) and C[p \ A] are identical strings. Nevertheless, we will retain the original notation for BL for a reason we will explain later. •
AXIOMS AND RULES OF FIRSTORDER LOGIC
145
We are ready to calculate (theorems) once again! As promised earlier on in our discussion here, the concepts of theoremcalculation (proof) and theorem remain exactly the same as in Part I. We repeat the definitions here, for the record, word for word: 4.2.6 Definition. (TheoremCalculations—or Proofs) Let Γ be an arbitrary, given, set of formulae. A theoremcalculation (or proof) from Γ is any finite (ordered) sequence of formulae that we may write respecting the following two requirements: 105
In any stage we may write down Prl Any member of Λι or Γ. Any member of Γ that is not also in Λι we will call a nonlogical axiom. Pr2 Any formula that appears in the denominator of an instance of a rule InflInf2 as long as all the formulae in the numerator of the same instance of the (same) rule have already been written down at an earlier stage. We may call a prooffrom Γ by the alternative name Γ proof.
•
4.2.7 Definition. (Theorems) Any formula A that appears in a Γproof is called a Γtheorem. We write Γ h A to indicate this. If Γ is empty (Γ = 0)—i.e., we have no special assumptions—then we simply write h A and call A just "a theorem". Caution! We may also do this out of laziness and call a Γtheorem just "a theorem", if the context makes clear which Γ Φ 0 we have in mind. We say that A is an absolute, or logical theorem whenever Γ is empty. • Note that, once again (cf. practice in Part I), in the configuration "h A" we take Λι for granted and do not mention it to the left of Κ 4.2.8 Exercise. It is a good place here to redo Exercise 1.4.11, so that you can check your understanding of the concepts proof and theorem. Once again, for exactly the same reason as in Part I (What was the reason?) we have (verify!): (1) A h A, for any A. (2) Γ h A, if A e Γ. (3) I B, for any axiom B. • 4.2.9 Remark. This remark retells 1.4.8. A Γproof of a formula A is, by definition, a sequence of formulae S i , . . . , B , A, C\,..., C n
m
with proprieties as stated in 4.2.6. It is trivial that if we discard the part " C j , . . . , C " of the sequence, then B ...,B ,A (1) m
u
n
In Part II, formulae means firstorder formulae unless otherwise indicated.
146
EXTENDING BOOLEAN LOGIC
is still a proof. The reason is that every formula in a proof is either legitimized outright—without reference to any other formulae—or is legitimized by reference to formulae to its left. Thus (1) too proves A, since A occurs in it. This technicality allows us to stop a proof once we have written down the formula that we want to prove. • So, 4.2.7 tells us what kind of theorems we have: (1) Anything in Λι
UT.
1 0 6
(2) For any formula C and variable ρ—not in the scope of any quantifier of C— C[p := A] = C[p := B], provided A = Β was written down already, therefore is a (Γ) theorem. (3) Β (any B), provided A = Β and A were written down already and therefore are both (Γ) theorems. The above is a recursive definition of (Γ) theorems, and is worth recording (compare with Definition 4.1.14). 4.2.10 Definition. (Theorems, Inductively) A formula Ε is a Γtheorem iff it fulfills one of the following: Thl
Ε
is in K
X
U
Γ.
Th2 For some formula C and variable ρ—not in the scope of any quantifier of C—Ε is C[p := Α] Ξ C[p := B], and (we know that) A = Β is a (Γ) theorem. Th3 (We know that) A = Ε and A are (Γ) theorems.
•
The concept of proof defined in 4.2.6 is that of Hilbertstyle proof, which we will arrange vertically—just as in Part I—with annotations. All that we said in Section 1.4 carries over here unchanged. In particular note Example 1.4.13. Note that wherever in the proofs that we wrote in Part I we said "by Leibniz ", or just "Leib", we will here replace it with "by BL", or just "BL", and the proof will remain valid. In particular, part (d) in 1.4.13 establishes h Α Ξ A. Even though that proof carries over unchanged here, we have in the new setting a more immediate proof: For any A, A = A is a member of Axl. Moving to the results of Chapter 1, again, everything we did there carries over unchanged. In particular 2.1.1, 2.1.4 and Corollary 2.1.6—which allows us to use alreadyproved theorems in proofs—hold, as well as "the other Eqn" (2.1.11). Just for the record, "Eqn + Leib Merged" (2.1.16) is still valid and still equivalent (as powerful as) Eqn and BL combined. This rule, transcribed in firstorder logic, will now have the condition "where ρ does not occur in the scope of any quantifier ofC". 107
W e explained the notation "Λ U Γ" in 1.3.14 on p. 36, item (3). l t will turn out that the restriction "where ρ does not occur in the scope of any quantifier of C" can be removed from BL to obtain a valid—for firstorder logic—derived Leibniz rule. But I am ahead of myself. l06
I07
AXIOMS AND RULES OF FIRSTORDER LOGIC
147
Redundant true (2.1.21) and the extremely important metatheorem 2.1.23 remain, of course, valid—the former for a nowtrivial reason (the relevant schema is a member of Axl). We do not need to add anything new to what we already said about the equational proof methodology (Section 2.2) nor need we reiterate that all the results of Sections 2.4 and 2.5 remain valid. Note that the proof of modus ponens, which we gave in Boolean logic (2.5.3), is also valid in firstorder logic. The deduction theorem (2.6.1) holds in firstorder logic exactly as stated originally (2.6.1). To see this, note that the proof of the "main lemma" (2.6.2) goes through pretty much unchanged (remember to say "BL" where we said "Leib" before). We need only to rephrase the basis case as follows: Basis. D has complexity 0: So it is one of: (1) p: Then we must show A —• (B = C) \ A > (B = C) and we are done by 1.4.11. (2) q (other than p), or Τ or _L, or d>(f 1 , . . . , t ) or t = s: By reference to 4.1.30 we see that we need to establish that A > (B = C) h A > (D Ξ D). Well, start with h D = D (Axl). By (3) in 2.5.1, and 2.1.4, h A > (D = D). We are done by 2.1.1. n
// is worth noting that a really simple alternative proof of the deduction theorem can be given for firstorder logic using the tools of the next chapter. It is extremely important to emphasize, especially for the reader who encountered alternative, very complex versions in the literature that: The deduction theorem in our version of firstorder logic is exactly the same as in the Boolean (prepositional) case. Are those very complex versions wrong, then? No. The small print here is that it is possible to found firstorder logic somewhat differently: with fewer axioms but with the addition of a primary rule called unconstrained or strong generalization:
In a sofounded firstorder logic, the deduction theorem is ugly—that is, it has cumbersome restrictions (cf. [35, 45, 52, 53]). The approach in the present volume is analogous to that in [2, 13, 50, 51], where the primary rules are, essentially, propositional. The trick is, rather than adopting rule (1), to encode it in the axioms (Ax3, Ax4) and to have these axioms and the only two primary rules, Eqn and BL, simulate a somewhat weaker version of (I). The side benefit: We can have a userfriendly deduction theorem that reads and applies exactly as in the Boolean case! Needless to say, the related results, 2.6.6 and 2.6.7, hold in firstorder logic.
148
EXTENDING BOOLEAN LOGIC
The most crucial result that carries over from Boolean to predicate calculus is Post's Theorem: //Γ f= „ A, then Γ h A. In our particular foundation offirstorder logic, the special case of Γ = 0 is direct from Axl: If Ntaut A then A belongs to Axl, hence h A /flI
Even the case of nonempty, but finite, Γ follows easily from Axl and MP, as we see in the next chapter—hence so does 3.3.1. The (meta)proof of the infinite ("general") case given in Section 3.2 caries over unchanged as long as one remembers to work throughout with Boolean abstractions (4.1.25) of firstorder formulae. In particular, the amended alphabet (3) of p. 94 is still correct, if one were to repeat the proof, since a Boolean abstraction contains none of the symbols that cannot occur in a Boolean formula (such as =, V, x" , φ', etc.). Corollary 3.3.1 is important for the user, and we will continue to rely on it heavily. 3
Very Important! Although we have 3.2.1 in predicate calculus, we must not expect to have the very same soundness result of 3.1.3. In fact, note that h χ = χ (Definitions 4.2.1 and 4.2.7), but Χ=& χ = χ. Indeed, the Boolean abstraction of "χ = χ" is just some Boolean variable, say, p. A Boolean variable, of course, is not a tautology. Μ
So, is predicate logic not sound? In fact, it is. That is, its rules preserve truth and its axioms are true. However, the truth concept in predicate calculus is narrower than that of tautology and tautological implication, as is to be expected: Tautologies (and tautological implications) speak of the broadest possible, most abstract concept of truth, one that is oblivious to the presence of (object) variables, constants, predicates, functions, quantifiers, and equality (between objects) and therefore cannot describe mathematical truth in its full variety. A different definition of truth (and "preservation of truth"—socalled logical implication) is necessary for predicate calculus. More on this in the chapter on firstorder semantics (Chapter 8).
4.3
ADDITIONAL E X E R C I S E S
1. In the formula =χ find to which "(Vx)", if any, each occurrence of χ belongs. Here " < " and " > " are just some nonlogical symbols (predicates of arity 2) of the alphabet. 2. Consider the following (not fully parenthesized) formula, in the firstorder language of arithmetic where 0 is a nonlogical constant symbol: (Vx)ar = 0 V (Vx)x = 0
(1)
ADDITIONAL EXERCISES
149
(a) Identify all the prime subformulae of the above, and display them by boxing as in 4.1.25. (b) Using boxing indicate the Boolean abstraction of the formula. (c) Can you prove formula (1) in predicate logic without the benefit of any nonlogical axioms that speak of "0"? 3. Find the results of the following substitutions. For item (a), work it out according to the inductive definition 4.1.28 step by step; for the others, just give the answer and explain the reasons if the result is undefined: (a) g[f{x),f(y))[x ·'= ] (where / is a unary function symbol, g is a binary function symbol, and 7 is a nonlogical constant symbol) 7
(b) (f(x) < 7)[x := 7] (as above, plus we have a nonlogical binary predicate symbol < , in connection with which we are using infix notation) (c) ((Vx)(/(x) < 7))[x := 7] (d) ( ( V j , ) ( / ( x ) < 7 ) ) [ x : = 7 ] (e) ((Vx)(Vj,)(/(7) < g{x,y)))[z
:=
(f) ((Vx)(Vy)(/(z) < g{x,y)))[z
:= g(y,7)]
(g) ((Vx)(V2/)(Vz)(/(z) < g{x,y)))[z
g(yj)\ ~g{yj)\
4. Consider the language (i.e., set of strings) over alphabet 4.1.2 that is defined as follows: • A Pformulacalculation consists of a finite sequence of steps. In each step we may write: (a) An atomic formula of 4.1.8 (b) A formula of the form ((Vx)A) for any A in the WFF of 4.1.13 (c) (>A), provided A has already been written (d) (Α ο Β)—for any ο e {Λ, V, —>, Ξ}—provided A and Β have already been written • We define a Pformula as any string that appears in a Pformulacalculation. • We define the complexity of a Pformula as the total number of connectives (counting repetitions) from {>, Λ, V, —*, =} that appear in the formula but not in any subformula of type (b). Prove that the set of all Pformulae over the alphabet of 4.1.2 is the same as the set WFF of 4.1.13 over the same alphabet. Hint. First, verify that the definition of Pformulacalculation differs from 4.1.10 in one essential aspect. Then, by induction on the complexity of Pformulae, prove that every such formula is in WFF. By induction on the complexity of formulae of WFF, prove that every such formula is a Pformula.
150
EXTENDING BOOLEAN LOGIC
5. Prove—by induction on terms—that for any terms t and s, if s is a prefix of i, then the strings t and s must be identical. 6. Prove that any nonempty proper prefix of a firstorder formula must have an excess of left brackets. 7. Prove the unique readability of firstorder formulae; that is, for every such formula its immediate predecessors are uniquely defined. 8. Is (Va;)(Vy)a; = y —» (Vj/)?/ = y an instance of Ax2? Why? 9. Give a proof of h (Vx)(Vy)x = y —> (Vy)?/ = y.
CHAPTER 5
TWO EQUIVALENT LOGICS
This brief chapter aims to develop a few more useful tools that we will employ, among others, in the proof of the crucial 6.1.1. Recall Remark 2.1.17. In exactly the same manner, two different foundations of predicate logic over the same firstorder language—two "different logics"—are equivalent iff they have the same absolute theorems. With half a minute's reflection, and using the deduction theorem, we see that equivalent logics also have the same "relative theorems". That is, fixing a set of assumptions Γ, one logic proves a formula A from the assumptions Γ iff the other does. Pause. How could we have two logics over the same language? Well, just think of the ingredients: We can choose different logical axioms, or different primary rules of inference, or both! Here are the two logics over the language of Section 4.1 that we want to compare: (1) Our logic as given by 4.2.1 and 4.2.4 (cf. [50, 51]) (2) The logic given exactly as in (1) above, except that ifj only primary rule is MP (cf. [13], although in Enderton's exposition the Boolean variables and constants are absent) Mathematical Logic. By George Tourlakis Copyright © 2008 John Wiley & Sons, Inc.
151
152
TWO EQUIVALENT LOGICS
We note that 2.1.1, 2.1.4 and 2.1.6 depend only on the general concept of proof and not on the choice of logical axioms or rules of inference. Thus Both logics above, (I) and (2), satisfy 2.1.1, 2.1.4 and 2.1.6. 5.0.1 Lemma. Post's theorem (3.2.1) holds in logic (2) for finite Γ. Proof. Indeed, let A A ,A ,...,A u
2
3
\=
n
Β
am
(i)
We will show A A, U
A ,...,A
2
3
hΒ
n
(ii)
By 1.3.14(2), (i) yields htaut
Μ
>
A > A »...> 2
3
A
n
(iii)
Β
Thus Αχ —» A —• A —> ... —> A —> Β is an axiom of logic (2). We can therefore write the following Hilbert proof—in the logic (2)—of Β from the hypotheses A A ,A ,...,A : 2
u
2
3
3
n
n
(1)
Ai
(hypothesis)
(2)
A
(hypothesis)
(3)
A
3
(hypothesis)
A
n
(hypothesis)
(n)
2
(η + 1)
Ai —> A —* A > ... > A —> Β (axiom)
(n + 2)
A^
(n + 3)
A ^...*A ^B
{(2,n + 2) + MP)
(n + 4)
Ai^...^A ^B
.((3,n + 3) + MP)
(n + n)
A„>B
((n  1, η + η  1) + MP)
Β
{(n,n + n)+MP)
(n + n+l)
2
2
3
A^ 3
3
n
A^ n
Β
n
n
((l,n+l)
+ MP)
•
5.0.2 Lemma. Logic (2) has BL and Eqn as derived rules of inference. Proof. Indeed, we know from Part I (3.1.1) that A, A = Β (= , Β and A = Β \= t C[p := Α] Ξ C[p := B], where in the latter case A, Β and C are abstractions of firstorder formulae. By the previous lemma we can replace (= , by h; that is, BL and Eqn are derived rules of logic (2). • BU
Uu
5.0.3 Metatheorem. Logics (1) and (2) are equivalent.
au
TWO EQUIVALENT LOGICS
153
Proof. The two have the same axioms. Now, the axioms plus the rules BL and Eqn of the first can simulate the rule MP of the second. Conversely, the axioms plus the rule MP of the second can simulate the rules BL and Eqn of the first (5.0.2). • Why did we bother to prove the above metatheorem? How is it useful? Because the metatheory of logic (2) is simpler, i.e., logic (2) is easier to talk and argue about. This was the main reason. We can gauge its usefulness in Chapter 6 where we prove the generalization (derived) rule. An immediate taste of the facilitation provided by 5.0.3 is offered by the next exercise. 5.0.4 Exercise. Invoking 5.0.3—and thus arguing about logic (2) rather than logic (1) —give an easy, short, and 2.6.2independent proof of the deduction theorem (exactly as stated in 2.6.1) for firstorder logic. Needless to say, this will not be circular: We did not use the (firstorder) deduction theorem toward any of the results of this chapter. •
This page intentionally left blank
CHAPTER 6
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
In this chapter we finally bring quantifiers, in particular "V", to the fore; thus we really start doing predicate logic! By predicate logic we understand either logic (I) or (2) of the previous chapter. It does not matter which one, as they are equivalent! (5.0.3). We will be sure to use logic (2) when we prove facts about logic.
6.1
I N S E R T I N G A N D R E M O V I N G " (Vx)"
6.1.1 Metatheorem. (Weak Generalization) Let Γ I A and let moreover χ not occur free in any formula found in the set Γ. Then Γ h (Vx) A as well. Proof. The (meta)proof is, essentially, a construction that takes a Γproof of A in logic (2) and transforms it step by step into a valid Γproof of (Vx) A—still in logic (2). The metatool employed is once again induction on natural numbers, indeed, induction on the length of a Γproof that includes A. Basis (shortest possible proof). A occurs in a proof of length 1. Then A is one of the following: Mathematical Logic. By George Tourlakis Copyright © 2008 John Wiley & Sons. Inc.
155
156
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
(1) Axiom. Then—since all partial generalizations of all formulae found in groups AxlAx6 are also axioms—(Vx) A is also an axiom. But then (cf. 4.2.6 and 4.2.7) (Vx)A is a Γtheorem. (2) In Γ. By hypothesis, A has no free χ occurrences. Thus A —> (Vx) A is an axiom (group Ax4). Since Γ h A and Γ h A (Vx)A (cf. 4.2.6 and 4.2.7), we have Γ h (Vx) A by an application of MP. We now take as I.H. the truth of the claim for any A that appears in a proof of length η or less. Let us establish the case where A appears in a proof of length η + 1. We have three cases: (i) A is not the last formula of the proof. Then we are done by the I.H. (ii) A is the last formula in the proof, but is an axiom or in Γ. Then we are done by the Basis argument. (iii) None of the above. So A was obtained by MP, that is, Β occurs in the proof, and so does Β —• A for some formula B. Since both Β and Β —+ A occur in Γproofs of lengths η or less, the I.H. kicks in and we have Γ h (Vx)B
(*)
and Γ h (Vx)(B > A)
(**)
Γ h (Vx)(B > A) > (Vx)B > (Vx)A
(* * *)
Now
by Ax3 and 4.2.6 and 4.2.7, thus, by MP (twice)—from (*), (**), and (* * *)— Γ h (Vx)A • (1) The proof we just gave justifies the—at first sight mysterious—requirement that along with the formulae in the groups AxlAx6 we include all their partial generalizations, too, as logical axioms. This was used in step 1 of the basis. (2) The above metatheorem was proved under a premise that at first sight might appear awfully restrictive: "No formula in Γ has a free x." Surely this restriction is close to impossible to meet—rendering the metatheorem "mostly inapplicable"—when one has infinitely many formulae in Γ. How are we to be sure that some particular variable is not free in every single one of them? It is irrelevant; see below. 108
There are significant practical cases where Γ is infinite; e.g., Peano arithmetic and Zermelo/Fraenkel set theory have infinitely many nonlogical axioms. In the case of these two theories (cf. p. 116) we have some other tricks that neutralize the problem of an infinite Γ. Although infinitely many, we can choose the nonlogical axioms so that they do not have free variables at all. 108
INSERTING AND REMOVING "(Vx)"
157
6.1.2 Corollary. If there is a proof of A from Γ, where all the formulae from Γ used in the proof have no free x, then Γ h (Vx) A. Proof. Let B\,..., B be all the formulae from Γ used in the proof. (1) By assumption, none of them has χ free. ( 2 ) B y 4 . 2 . 6 a n d 4 . 2 . 7 , B . . . , B h A. By (1) and (2) and Metatheorem 6.1.1, B ..., B h (Vx)A By 2.1.1, Γ h (Vx)A as well. • n
u
n
u
n
Thus, without loss of generality, we can always pretend that the Γ in 6.1.1 is finite, for even if it is not, in every single proof only a finite part of it is used, anyway. 6.1.3 Corollary. IfV A, then V (Vx)A Proof. This is immediate by taking Γ = 0. Surely, you can't find an A in this Γ with a free χ in it!
•
6.1.4 Remark. Two important remarks need to be made here: (1) Metatheorem 6.1.1, and in particular Corollary 6.1.2, allow us to insert the formula (Vx)A at any point after A was written in a Γproof as long as whatever formulae of Γ were invoked in the proof contain no free x. This is all right simply because in a Γproof we can insert any Γtheorem we happen to know of—cf. 2.1.6. We do know that (Vx) A is a Γtheorem as soon as we learn that A is\ (6.1.1) Similarly, the metatheorem's second corollary, 6.1.3, allows us to insert (Vx)A in any proof, as long as we already know that A is an absolute theorem (this may have been established by the proof we are working on, or by some previous proof—a lemma, for example). (2) One must be careful not to confuse the derived rule "if h A, then h (Vx) A* with "A h (Vx)A'. The former rule, weak generalization, imposes a constraint on the premise A in its use: Once we have A we may write down (Vx) A but this step is constrained by how A was obtained. A cannot be arbitrary; rather it must be an absolute theorem. The latter rule, called strong or unconstrained generalization, allows us to write (Vx)A once we have A (written down, that is) regardless of how A was obtained. There are no conditions! A could have very well been an arbitrary hypothesis. Is this distinction between the two rules "real"? Yes! We just saw that our logic ((1) or (2) on p. 151—it does not matter which) does allow weak generalization. We will see later on that it does not allow strong generalization. The reason is that if we had A h (Vx)A in our logic, then we would also have—by the deduction theorem—h A —* (Vx) A Semantic considerations in Chapter 8 will show this to be impossible (cf. also the discussion of formula (5) on p. 143). • A closely related and extremely useful derived rule is trivially derived from first principles:
158
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
6.1.5 Metatheorem. (Specialization Rule) (Sfx)A h A[x := t] Proof. Of course, if the expression "A[x := t}" ends up being undefined, then we have nothing to prove. Here is a Hilbertstyle proof: (Six) A
(1)
(hypothesis)
(2)
(Vx)A A[x ~ t]
(Ax2)
(3)
A[x:=t]
((1,2) + M P )
•
6.1.6 Corollary. (S/x)A h A Proof. Take ί to be χ in 6.1.5 (cf. 4.1.34).
•
Corollary 6.1.6 and Metatheorem 6.1.1 (or Corollary 6.1.3)—which we will refer to as spec and gen respectively in annotations—are a team that makes life extremely easy in Hubert proofs when it comes to dealing with the quantifier V. Corollary 6.1.6 lets us unconditionally remove the leftmost quantifier in the course of a proof. This action uncovers whatever Boolean connectives were buried in the scope of the removed quantifier so that we can—in the subsequent steps of the proof—apply the purely Boolean techniques of Part I. Before the end of the proof, if the targeted theorem requires us to do so, we can reintroduce the removed quantifier using 6.1.1 (or 6.1.3 as appropriate)—conditions for insertion, of course, apply. 109
This comment may appear too general now, but it will gain complete clarity as we progress, presenting several examples where the comment is put to use. Here is the first such example: 6.1.7 Theorem. (Distributivity of V over Λ) 1 (Vx)(A Λ Β) = (Vx)Α A (Vx)B Proof. We use a PingPong argument (cf. 3.4.5) to prove h (Vx) (Α Λ Β) —> (Vx) A A (Six) Β and h (Six)A A (Six) Β > (Vx)(A Λ Β). Below we label "(»)" and "(<)" the two directions that we have to do: (~0
(1)
(S/x)(AAB)
(hypothesis)
(2)
AAB
((1) +spec (6.1.6))
(3)
A
(4)
Β
((2) Ncam (3) + 3.3.1) ((2) + tautological implication)
(5)
(S/x)A
((3) + gen (6.1.1; Okay: Hypothesis has no free x))
(6)
(Vx)B (Six) A A (Vx)B
((4) + gen (6.1.1; Okay: Hypothesis has no free x))
(7)
((5,6) + tautological implication)
""Recall that the Boolean abstraction of a formula of the form (Vx) A is a Boolean variable, say p. Thus all the Boolean connectives of A are invisible in the abstraction.
INSERTING AND REMOVING
"(Vx)" 159
Note. Annotation of use of Post's theorem (usually invoked in the form of 3.3.1) might take the form given in step (3), "(2) \ = (3)", but the ones in steps (4) and (7) are equally acceptable. Μ
( H (Vx)A
(1) (2)
Λ
(Vx)B
(hypothesis)
(Vx)A
((1) + tautological implication)
(3)
(Vx)B
((1) + tautological implication)
(4)
A
((2) + spec)
(5)
Β
((3) + spec)
(6)
AAB
((4, 5) + tautological implication)
(7)
(Vx)(A Λ Β)
((6) + gen (6.1.1); Okay: Line (1) has no free x)
•
Easy and natural, was it not? Worth Stating: We applied Post's theorem in the proof above, and we will be increasingly doing so in future proofs. But how do we know when At,...,A
n
Κ, , Β Η
(*)
holds, in order to apply Post's theorem—which allows us to state and use the derived m\eA ...,A \ΒΊ This is a practical, not a theoretical question, and it has a simple answer: In practice, (*) should be trivial to verify using semantic ideas, or trivial for us to "see" outright—as, e.g., certainly A = Β  = A —» Β is. In any case where such verification is not outright obvious, (*) should be justified separately from—i.e., outside of—the proof where it is used. How? Semantically (=taut) syntactically (h)—it is all the same by Post's theorem—use whichever approach is easier to you. u
n
ωιη
o
r
6.1.8Theorem. ( (Vx)(Vy)A Ξ (Vy)(Vx)A Proof. Another PingPong argument:
(1)
(Vx)(Vy)A
(hypothesis)
(2) (3)
(Vy)A A
((1) +spec (6.1.6)) ((2) +spec)
(4) (5)
(Vx) A (Vy)(Vx)A
((3) + 6.1.1—line (1) has no free x) ((4)+ 6.1.1—line (1) has no free y)
( H The proof can be reversed, (5) to (1), with a straightforward change of annotation. Exercise! •
160
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
6.1.9 Metatheorem. (VMonotonicity) / / Γ h A > B, then Γ h (Vx) A > (Vx)B, provided that no formula in Γ has a free x. Proof
(1)
Λ —» β
(2)
(Vx)(A » β )
(3)
(Vx)(A
(theorem from Γ; we start where its proof finished) ((1) + gen (6.1.1)—restriction on Γ makes this okay)
Β) 
(Vx)A > (Vx)B (4)
(axiom)
(Vx)i4» (Vx)B
((2,3) + MP)
•
Why "monotonicity"? Well, one may view "—>" as an analogue of " < " . You see, < satisfies "x < y iff max(x, y) = y" while —> satisfies (Axl) "A —> Β = A V β Ξ β". If you next think of "V" as analogous to "max"—not a terribly far fetched suggestion, since many reasonable people think of t as 1 and f as 0 (certainly the designers of the languages PL/1 and C do)— then you see my point. But then the metatheorem says that if A is "less than or equal to" B, then (Vx)yt is "less than or equal to" (Vx)B. If you finally intuitively think of "(Vx)" as a "function" (in the algebraic sense) of the "argument" A, then the jargon "monotonicity of V" makes sense. So there. A silly comment, justifying a silly terminology. In annotations Amon will stand for Vmonotonicity. 6.1.10 Corollary. IfY A^B, then h (Vx)A > (Vx)B. Proof. Just take Γ = 0.
•
6.1.11 Corollary. / / Γ Y A = B, then also Γ h (Vx)A Ξ (Vx)B, as long as Γ has no formulae with free x. Proof
(1)
ΑΞ β
(2)
A^B
<(1) h^ut (2) + 3.3.1) < ( l ) h ™ , ( 3 ) + 3.3.1)
(proved from Γ; now continue the proof)
(3)
B^A
(4)
(Vx)A
(Vx)B
((2) + Amon (6.1.9))
(5)
(Vx)B » (Vx)A
((3) + Amon (6.1.9))
(6)
(VxMMVx)B
((4,5) K u * (6) + 3.3.1)
•
6.1.12 CoroDary. IfY A = B, then also Y (Vx) Α Ξ (Vx)fl. Proof Just take Γ = 0.
•
INSERTING AND REMOVING "(Vx)"
161
Corollaries 6.1.11 and 6.1.12 are forms of the Leibniz rule that, for the first time so far, allow us to replace a Boolean variable that occurs inside the scope of a quantifier, and moreover they allow us to do so not caring if capture occurs! For example, think of 6.1.12 as "if h A = B,thenh C [ p \ A ] = C[p\B}— where C is (Vx)p". Can we extend 6.1.11 and 6.1.12 to hold for any formula C? You bet! We do so in the next section, but first let me make a few more comments on the generalization rule(s). 6.1.13 Remark. (1) Is the name generalization for the rule described in 6.1.1 apt? Yes. The rule is used in everyday math practice, where to prove that "a formula A that depends on the variable χ holds for all values of x" we do instead the following: We prove that "A holds for an arbitrary value of χ—in other words, a value that we have made no special assumptions about". We then generalize and conclude—since the value of χ that we used was unbiased—that A holds for all values of x. Which part in 6.1.1 formally says that when we proved A we did not take into account any special value of x? It is the part that says that our assumptions (Γ) do not even talk about x, that is, χ is not referenced in them at all, because χ is not free. (2) Is (Vx)A the "same as" the formula below? Λ(0)
Λ
Λ
Λ(2)
Λ
Λ(3)
Λ • • ·
(i)
where I am using here the shorthand A(k) for A[x := k]. No, for some obvious and for some more esoteric reasons. First the obvious: Obvious 1. 0 , 1 , 2 , . . . are nonlogical symbols. A logical expression such as (Vx)A that is meant to make sense for all applications of logic—not just for number theory and other theories that speak of the integers—has no business being defined by (or being "equivalent" to) an expression that refers to such nonlogical symbols. Obvious 2. Classical logic, that is, the logic we develop and use in this volume— which, by the way, is the logic used by mathematicians, computer scientists, etc.—does not allow infinitely long formulae like (i). There are esoteric reasons according to which even if we remove the two objections above by cleverly tweaking question (2), the answer remains "no". Okay, let us tweak the original question and ask instead: Would "(Vx) A" when its use is restricted to number theory mean (i) above? This bypasses objection 1 above by restricting the question. Let us next remove objection 2 above (Obvious 2) and rephrase, asking instead— without reference to infinitely long formulae—the intuitively equivalent question: Is it true in number theory that we have both (ii) and (Hi) below? (Vx)A h A(k), for all
> 0
(it)
162
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
A(0),A(l),A(2),...h
(Vx)A
(iii)
Well, we do have (ii) by 6.1.5. However we do not have (iii): A result of Kurt Godel ([16]) known as "the first incompleteness theorem" has as a corollary that there are formulae A of number theory for which all the premises in (iii) are theorems of number theory, but (VX)j4 is not. • For the reader who will not easily let go: "But," you say, "if the nonlogical axioms of (Peano) number theory characterize Ν and the various operations and relations on it (e.g., +, x, <) uniquely, then surely (iii) ought to hold since the hypothesis part says that A is true of each natural number. Surely, (Vx)A says the same thing?" This is precisely where the problem lies! You see, it is known that firstorder logic (over the language of Peano arithmetic and equipped with Peano's axioms) is incapable of uniquely characterising Ν equipped with its operations and relations. That is, there are supersets of Ν that contain infinitely many other "numbers"—but where S, +, χ, < and all standard operations on numbers still make sense. More concretely, these sets equipped with analogues of the operations and relations S, + , x , < also satisfy all the Peano axioms of number theory! Clearly, on such sets, saying that the lefthand side of I in (iii) holds is not enough guarantee that the righthand side also holds, because the lefthand side of h does not say that A holds for all numbers (it says so only for the natural numbers, and is silent about the additional numbers). The team of spec and gen also allows us to work with "simultaneous substitution": For example, if I have proved A that has χ and y (and perhaps other variables that I do not care about) free, and if t and s are any terms, can I then conclude that after I substitute t and s into χ and y simultaneously I will obtain a theorem? 6.1.14 Example. First, I should be clear what this "simultaneous" means: Suppose that A is χ = y. Let " i " be y and "s" be x. Then, (x = y)[x := t][y := s] is χ = χ while (x = y)[y := s][x := t] is y = y The result depends on the order of the two substitutions. On the other hand, if we drop t and s into the χ and y slots simultaneously, so that neither of the two substitutions has the time to mess up the other, then we get y = x. In effect, the "simultaneous substitution" is (or can be simulated by) a sequence of consecutive substitutions performed with the help of fresh variables: Pick two new variables, ζ and w. Then do (x = y)\x := z][y := w][z := t][w := s] or (x = y)[x := z][y := w][w := s][z := t] Both work, i.e., yield y = x. Verify!
INSERTING AND REMOVING "(Vx)"
163
In the general case (of two simultaneous substitutions)—that involves any formula A, any substitution slots χ and y, and terms t and s—the new (distinct) variables ζ and w are chosen to be fresh with respect to all of A, t, s. Then, a bit of reflection (or an induction on the complexity of A) shows that A[x := z][y := w][z := t][w := s] and A[x := z][y := w][w := s][z := i] yield the same string," corresponding to the intuitive understanding of "simultaneous substitution into χ and y". • 0
6.1.15 Definition. (Simultaneous Substitution) The expression A [ x i , . . . , x := £ , , . . . , i ] r
(1)
r
denotes simultaneous substitution of the terms 11,..., t into the variables Χ ι , . . . , x in the following sense: Let z j , . . . , z be distinct new variables that do not occur at all (either as free or bound) in any of A, t\,..., t , Then (1) is short for
r
r
r
T
A[xi := z i ] . . . [x := z ][zi := ti]... r
r
[z := t ] r
(2)
r
where in the interest of generality our notation employed the metavariables Xj and Z;.
•
This "simultaneity" that the definition is talking about is not in the physical time sense, but it rather means that effecting the substitutions sequentially, we are nevertheless guaranteed that none of the t, that have already replaced an χ*—in two steps, via Zj—are subsequently altered by virtue of some tj being substituted into one of t / s variables. This cannot happen since none of the U contains any Zj. In effect, we have—through 6.1.15—simulated what we intuitively understand as "simultaneous substitution": The substitution of the i j into the Xj is order independent. 6.1.16 Exercise. Given a formula A, if ζ is fresh, then A[x := z] is defined (cf. 4.1.28). Hint. Induction on A. • 6.1.17 Exercise. Suppose that A[x := t] is defined. If ζ is fresh, then A[x ·.= z][z := t] is also defined, and has the same result as A[x:= t}. Hint. Induction on A. • 6.1.18 Exercise. Definition 6.1.15 yields the same string, unaffected by permutations within the groups "[xi := z i ] . . . [x := z ] " and "[zi := i i ] . . . [z := i ] " in (2). The definition is also unaffected by the choice of fresh variables z i , . . . , z . Hint. Induction on A. • r
r
r
r
r
"And so do
A[y •— w ] [ x := z][z := t][w := s] and A\y := w ] [ x := z ] [ w := s][x := t].
164
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
6.1.19 Metatheorem. (Substitution Theorem) Ifh A and f , . . . ,t are any terms, then \~ A\x ,..., x := t ,..., t \ as well. (
x
x
r
r
r
Of course, if the substitution is not defined, then there is nothing to prove. Proof. By 6.1.15 we need to prove that if z i , . . . , z A. 11,..., t , then we have
r
are fresh with respect to
T
h A[x := Z i ] . . . [ x := z ][zi. := t ]... r
x
r
x
[z := t \ r
r
The above follows by applying the metatheorem below 2r times: If h A and A\x := i] is defined, then h A\x ·.= t], where t is any term The above has a trivial proof (Hubert style, but not written down rigidly): I have h (Vx)A by 6.1.3. An application of 6.1.5 yields h A[x := f.].
•
6.1.20 Corollary. If Τ h A and there is a proof of this fact that uses formulae from Γ that have no free x i , . . . , x then Γ h A[xi,..., x := t\,... ,t ] as well. r >
r
r
Proof. Let us fix attention to one such proof that uses hypotheses from Γ where none of x i , . . . , x occur free. Say, B\,..., B are the hypotheses used. Thus, by definition of proof (4.2.6) r
m
B
U
. . . , B
M
(1)
\  A
Applying the deduction theorem to (1) m times, we get V
B
B,
A
m
(2)
By 6.1.19 we get I ( B I
—»...+ B
—>
M
Aj[x := z i ] . . . [ x : = z ] [ z ! : = t \... [ z : = t \ {
r
x
r
r
r
(3)
where the z* are fresh. Since none of the x* or Zi appear free in the Bj, (3) can be rewritten as (remember the priority of the "(x := . . . ] " notation!) I B i —» . . . —» B
m
—> A[xi := z , ] . . . [ x := z ] [ z , := t ]... r
r
x
[ z := t ] r
r
(4)
Applying MP to (4), m times, yields A[x : = z i ] . . . [ x
Bi,...,B rm
x
:= z ] [ z i := i i ] . . . [ z := i ]
r
r
r
r
The above yields what we want, by hypothesis strengthening (2.1.1): Γ h A[x : = z i ] . . . [ x : = z ][zi. := i i ] . . . [ z := t ] x
r
r
r
r
•
LEIBNIZ RULES THAT AFFECT QUANTIFIER SCOPES
6.2
165
L E I B N I Z R U L E S THAT A F F E C T QUANTIFIER S C O P E S
6.2.1 Metatheorem. (Weak Leibniz—"WL") IfYA C[p\B}.
= B, then h C[p \ A] =
Proof. Knowing that the result holds in the "simple case" of 6.1.12—cf. also the remarks following the proof of 6.1.12—we are motivated to provide a proof by induction on the complexity of C. Basis. In the case of formula complexity 0 we have two subcases of interest: (1) C is p . Then we must show "if h A = B, then h A = B". There is nothing to do! (2) C is not p , i.e., it is one of the following: q ( Φ ρ), t = s, φ(ίι,..., t ), T, 1. Then we must show "if h A = B, then h C = C". Since h C = C holds anyway (Axl), the //part is redundant and we are done. n
The complex cases: (i) C is .£>. By I.H. Η D[p \A]= D[p \ B\\ hence h ^D[p \ Α] Ξ ^D[p \ B] by tautological implication (3.3.1) and thus I (>D)[p \ Α] Ξ (>£>)[p \ B] (cf. 4.1.29). (ii) CisDoE, where ο e {Λ, V, =}. By I.H. h D[p \A] = D[p \ B) and h E[p\A\ = £ [ p \ B ] ; h e n c e h D[p\A]oE[p\A] Ξ D[p\B]oE[p\B] by tautological implication and thus h [DoE)[p\A] = [DoE)[p\B] by 4.1.29. (iii) C is (Vx)D. This is "the interesting case". By I.H. h D\p \A} = D[p \ B}. By 6.1.12, h (Vx)D[p \ A] = (Vx)Z?[p \ B], which Definition 4.1.29 allows us to rewrite as h ((Vx)£>)[p \ Λ] = ((Vx)D)[p\B] • In [51 ] I called the WLrule "WLUS" (Weak Leibniz with unconditional substitution). I now prefer the simpler "WL". But why "weak"? Because unlike BL, which allows us to apply it regardless of where, or how, we got the hypothesis A = B, we will not apply WL unless we know that the hypothesis is an absolute theorem. Bad things will happen if we ignore this restriction: We can end up contradicting things we know. Ignoring the restriction means that no matter why we were allowed to write down A = Β in a proof we may next write, for any C, C\p \ A] = C[p \ B]. In other words, that A = BhC[p\A]
= C[p\B}
(i)
is a derived rule. But if that is so, then I can also derive the "rule" below A h (Vx)yl
(ii)
166
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
which I know is impossible in our logic (cf. 6.1.4). Here is how to get (ii) from (i): First note that h (Vx)T = T. Indeed, a trivial PingPong argument (cf. 3.4.5) suffices, noting that (Vx)T —> Τ is in Ax2 while—as Τ has no free χ—Τ —»(Vx)T is in Ax4. Secondly, (1)
A
(2)
A=T
((1) + tautological implication)
(3)
(Vx)A = (Vx)T
((2) + rule (i); "Cpart" is (Vx)p)
(4)
(Vx)A = Τ
((3) + h (Vx)T = Τ + tautological implication)
(5)
(Vx)A
((4) + tautological implication)
(hypothesis)
WL is perhaps the most useful Leibniz rule in predicate logic, as it allows total freedom in substituting "equivalents for equivalents". The price to pay for this freedom is, of course, the restriction on how the premise is obtained. By analyzing the proof of WL one readily sees that we can be a bit less restrictive in the assumption, as follows: 6.2.2 Corollary. (A More Generous WL) If Τ h A = Β and if none of the bound variables of C occur free in the formulae ο/Γ, then Γ h C[p \ Α] Ξ C[p \ B] as well. Proof. The proof is exactly the same as that of WL on p. 165. We change all "h" there by "Γ h" here and note that there are no changes in the Basis part. All the induction step cases regarding Boolean connectives are handled by tautological implication once more. The interesting case is when C is once again (Vx)Z). The I.H. here yields Γ Y D[p \ A] = D[p \ B]. Now the assumption guarantees that Γformulae have no free x, so 6.1.11 applies: r\Cyii)D\p\A]
=
Cyx)D\p\B)
In view of 4.1.29, this is what we want. In practice, one finds 6.2.1 used more often than 6.2.2.
•
We next strengthen BL. This is a "strong" Leibniz in that the hypothesis A = Β can be plucked out of the blue without any restriction on its origin. On the other hand, we have an annoying side condition that ρ must not be in the scope of a quantifier of C. Well, we can drop the side condition from BL, but we have to continue using "conditional substitution" (4.1.30) as the discussion following the proof of 6.2.1 made clear. 6.23 Metatheorem. (Strong Leibniz—"SL") A = BY C[p := A] = C[p := B] Again, it goes without saying that if the right hand side of I is undefined then we have nothing to prove as the expression "C[p := A] = C[p := B]" does not
LEIBNIZ RULES THAT AFFECT QUANTIFIER SCOPES
167
denote any formula. I will not remind us again of this understanding of use of the metanotations "[p := A]"and"[x := t\" since it has been already established enough times. Proof. The proof is by induction on the complexity of C. It is similar, but not identical, to the proof of WL (6.2.1). Basis. In the case of formula complexity 0 we have two subcases of interest: (1) C is p. Then we must show Α Ξ Β Y A = B, which holds by 1.4.11. (2) C is not p , i.e., it is one of the following: q ( φ ρ), t = s, φ ( ί \ , t ), T, _L. Then we must show A = Β h C = C. This follows from h C = C (Axl) and 2.1.1. n
The complex cases: (i) C is  Z ) . By I.H. A = Β h D[p ϊ = A] = D[p := B]; hence Α Ξ Β Ι  Ό [ ρ := Α] Ξ ι£>[ρ := Β] by tautological implication, and thus Α Ξ Β h hD)[p := A] = (D)[p := B] (cf. 4.1.30). (ii) C is D ο £ . By I.H. Λ Ξ J5 h D[p := A] = D[p := β] and Α Ξ β h E[p := yl] Ξ E[p := β ] ; hence vl = Β h £>[p := /I] ο J5[p := /I] = D[p := Β] ο E[p •— B] by tautological implication and thus A = BY (Do E)\p := Α] Ξ (DoE)[p := β ] by 4.1.30. (iii) C is (Vx)£>. This is "the interesting case". By I.H. A = Β h D\p := Λ] Ξ D\p := Β}. Since C[p := A] and C[p := β ] are defined, Definition 4.1.30 implies that χ is not free in either A or B. Therefore (cf. 4.1.21) it is not free in A = B. By 6.1.11, A = Β Y (Vx)£>[p := A] = (Vx)D(p := β ] , which 4.1.30 allows us to rewrite as Α Ξ β I ((Vx)D)[p := A] = ((Vx)D)[p := β]. • In [51] I called this rule "SLCS" (Strong Leibniz with conditional substitution). I now prefer the simpler "SL". Note that we may from now on, conveniently, forget BL and—as far as rules of type Leibniz are concerned—to use only WL and SL since the latter subsumes BL. This last observation justifies the concluding sentence in Remark 4.2.5. 6.2.4 Corollary. D^>(A = B)hD>
(C[p := Α] Ξ C[p := β])
Proof. We use the deduction theorem to prove instead D • (A = β ) , D Y C[p := A] = C[p := β] Indeed
(1) (2)
D D > (A = B)
(hypothesis) (hypothesis)
168
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
(3)
A =B
(4)
C[p := Α]
((1,2) +MP) Ξ
C[p := B]
((3) + SL)
Note how SL (rather than WL) is applicable, because line (3) does not necessarily contain an absolute theorem. • 6.2.5 Remark. (1) The previous proof is not circular, as one might carelessly assume by the proved statement's similarity to 2.6.2. Indeed, Exercise 5.0.4 promises— within predicate logic—a direct, short and easy, and oblivious to 2.6.2, proof of the deduction theorem. Note as well that 6.2.4 extends 2.6.2 since the latter can deal only with " p " that are not in the scope of some quantifier that occurs in C (Boolean logic knows nothing about such scopes). (2) An alternative proof of 6.2.4 extends the statement to Do{A
= B)\Do(C\p~A\
= C[p:=B])
(*)
where ο is any of V, Λ, =: Note that SL and the deduction theorem yield
h (A
ee
B) + (C[p := A]
EE
C[p := B])
By tautological implication we get \ Do(A
= Β) ^ Do (C[p := A] = C[p := B])
By MP we get (*). 6.3
•
T H E L E I B N I Z R U L E S "8.12"
This section is meant as no more than extra homework since we will never use the two tools that we discuss here. The tag "8.12" in the section title refers to the one used for the "twin" rules Leibniz in [17], p. 148. These, reproduced verbatim from loc. cit. but recast in standard quantifier notation and using the metavariables χ and p, are
and
A= B (Vx)(C[p := A] —> D) ee (Vx)(C7[p := B]  D)
(8.12a)
D > (Α Ξ Β) (Vx)(D  C[p := A}) = (Vx)(D  C[p := B])
(8.126)
This section will prove valid forms of these two rules. 6.3.1 Remark. (1) Refer to 4.1.18 once more if you plan to go to the source [17]. (2) The rules (8.12a) and (8.12b) are axiomatically given in [17] as the primary rules for quantifiers. As we will see here this is totally unnecessary for us to imitate,
t h e leibniz r u l e s "8.12"
169
because—with a correction—these are provable rules, that is, they are derived rules, just like "gen", "WL" and "SL" are in our logic. (3) Are there any constraints on the premises of these rules? If so, what might they be? Indeed, there must be constraints; otherwise either rule can derive "A h (Vx).A", which we know is unprovable in our logic. • 6.3.2 Exercise. (I) Show that unless the premise in (8.12a) has restrictions on how it is obtained, (8.12a) implies strong generalization, and is therefore invalid. Hint. Experiment, taking β to be the formula T, D to be the formula _L, and C to be the formula >p. (H) Show that unless the premise in (8.12b) has restrictions on how it is obtained, (8.12b) implies strong generalization, and is therefore invalid. Hint. Experiment, taking Β to be the formula T, D to be the formula T, and C to be the formula p . Using the hints, you will produce, in each question (I) and (II), a Hilbertstyle proof (1)
A
(hypothesis)
(n)
(Vx)/i
(some appropriate reason)
•
6.3.3 Metatheorem. (The Valid "8.12a") 7/Γ h A = B, then Γ h (Vx)(C[p := A] —» D) = (Vx)(C[p := B] —• D), provided no formula of Γ has a free x. Proof. (1)
A = Β
(2)
(C[p:=A]+D)
(from Γ; we now continue the proof) =
(C[p := B] > D) (3)
((1) and SL + 3.3.1 to add
£>")
(Vx)(C[p := A]* D) = (Vx)(C[p := B] —> D)
((2) and 6.1.11; restriction on Γ used)
•
Note how in step (2) above SL—unlike WL—affords us the luxury not to worry whether A = Β is an absolute theorem. Here, in general, it is not. 6.3.4 Corollary. IfhA B]  D). Proof. Take Γ = 0.
= B, then h (Vx)(C[p := A] * D) = (Vx)(C[p := •
6.3.5 Metatheorem. (The Valid "8.12b") IfT\D+(A = B), then Γ h (Vx)(£> —> C[p := A]) = (Vx)(D —• C[p := B}), provided no formula of Γ has a free x.
170
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
Proof. The hypothesis yields—via 6.2.4 followed by 3.3.1: Γ I (Z>  C{p := A}) = (D
> C[p := B\)
We are done by an application of 6.1.11.
•
6.3.6 Corollary. IfY D > (A ~ B), then h (Vx)(£> > C[p := C[p := fl]).
Α]) Ξ (VX)(D >
•
Proof. Take Γ = 0. 6.4
ADDITIONAL U S E F U L T O O L S
The authors of [ 17] introduce several theoremschemata for quantifiers in their Chapter 8, which nevertheless they present as "axioms" and offer without proof. We will prove in this section that all these "axioms" are actually provable in our setting. All are useful additions to our toolbox and embody standard techniques of predicate logic such as the "variant theorem" (also known as the dummy renaming theorem) used to rename bound variables, and the socalled prenex operations used to bubble quantifiers from the interior of a formula all the way to its left boundary (cf. for example, 6.4.1, 6.4.2, 6.4.3). The inquisitive reader who will want to explore the detailed presentation of these metatheorems in the cited source will benefit from a word of caution: First, all these socalled axioms about "generalized quantifiers" are provable from first principles. Second, some of them—those that speak about the "other" quantifiers, Σ d Π > that is, the generalized sum and product (of natural numbers)—do not even belong to pure logic but belong to number theory. ' Thus the "unified" notation "*" intended by [17] to express properties of all "quantifiers", 3, V, Π — w i t h i n pure logic—can do so only for 3 and V. The why is straightforward: In predicate logic—when we are not employing it within a specific application such as number theory—statements involving Σ, f ] a n
11
that also rely on special properties of these symbols have no place.
First, statements involving properties of the nonlogical symbols such as J2, f j cannot be logical axioms, nor can they be absolute theorems, by definition. Second, all these statements regarding these two ( ^ , FJ) symbols happen to be provable, but this is achievable only after one has introduced the Peano axioms, which, incidentally, do not even refer to Σ, Π these are not primitive symbols of the language of arithmetic! The symbols ^ and fj—after a lot of work and acrobatics— can be defined in (Peano) number theory as secondary nonlogical symbols, and then all their properties as stated in Chapter 8 of [17] can be proved. However, I promise not to do any of this work here since this volume is about the methods and tools of nonapplied (i.e., pure) logic." a
s
2
'"Chapter 8 of [17] also conflates the "quantifiers" \J and Γ along with the others. The properties of these are provable in axiomatic set theory. " The ambitious reader who wants to see how all this is done—in detail—may look up [53]. 2
ADDITIONAL USEFUL TOOLS
171
Well, then, for the sake of exercise, but also to enrich further our logical toolbox, let us prove all these results in the balance of this section. It is fair to warn that in the context of predicate logic Hilbertstyle proofs have the edge over equationalstyle proofs. The former are amenable to the methodology of removing/inserting quantifiers so that between the removal and insertion one can use Boolean techniques, notably the allpowerful Post's theorem (3.2.1—usually in the form 3.3.1). The technique of removing/inserting quantifiers is not well suited to equational proofs partly because "A" and "(Vx),4" cannot be connected with "Ξ"—indeed not even with "—>" in one direction—in general. Of course, as always we will apply "the most natural proof style" for the problem at hand, but be aware that "most natural" is a subjective assessment! Before we embark on proofs of the results advertised at the beginning of this section, I would like to expand a bit on equational methodology. Our equational proofs so far have been based on a sequence of equivalences
A Ξ A , A = A ,..., x
2
2
3
ΞΞ A
Α ι η
n
that we know are, each, Γtheorems (p. 62). We showed that we have 2.2.1 and its corollaries, which allow an equational proof to establish Γ h A\ = A , and thus n
TVΑχ ffiTY A . n
Our extension allows any one of the = symbols to be replaced by —>. In this case, by Post's theorem (3.2.1), we have just Γ h Αχ —• A . If we also know that Γ h Λι, then MP shows that Γ h A as well. The layout is n
n
Αχ ο (annotation)
A
2
ο (annotation)
A 1 n
ο (annotation)
A
n
ο (annotation)
Ai n+
where " o " in each instance is—independently of the other instances—one of or =Φ. The symbol => in this layout occurs only on the left margin; it is an alias for "— but it is conjunctional. That is,
172
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
A => (annotation) Β => (annotation) C means "A  + B , B  > C"—which are two separate formulae—not "A —> Β —» C". The latter is, of course, short for (A —> (B —> C)). We now embark on our task. 6.4,1 Theorem, h (Vx)(/1 —> β ) Ξ (A —• (Vx)fi), provided χ is not free in A. Proof We use a PingPong argument (cf. 3.4.5) in conjunction with the deduction theorem. (—>) I want r (Vx)(A 
B) > (A
(Vx)B)
but I'd rather (cf. 2.6.1) prove (Vx)(A
β ) h Λ  * (Vx)B
and, indeed, I'd rather (cf. 2.6.1 again!) prove (Vx)(A» B J . ^ h
(Vx)B
Okay, let's do it! (Never forget the discussion following 6.1.6 on p. 158.) (1)
(Vx)(i4  » β )
(2)
A
(hypothesis)
(3)
A^B
((1) + spec (6.1.6))
(4)
β
((2, 3) + MP)
(5)
(Vx)B
((4) + gen (6.1.1); Okay since (1,2) have no free x)
(hypothesis)
(«—) I want I (Λ * (Vx)fi) > (Vx)(A > β ) I might as well do (cf. 2.6.1) the easier A > (Vx)B h (Vx)(y4 > β )
(1)
Seeing that /I —• (\/χ)β has no free χ, I can prove the still easier (no quantifiers in righthand side!) A > (Vx)B hA>B (2)
ADDITIONAL USEFUL TOOLS
173
and then apply 6.1.1 to conclude. The deduction theorem allows me to prove something even simpler: A^{Vx)B,Ah Β (3) Here it goes (proof of (3)): (1)
A —• (Vx)B
(hypothesis)
(2)
A
(hypothesis)
(3)
(Vx)S
((1,2) +MP)
(4)
Β
((3) +spec)
•
We can also give an equational proof of the (—») direction—extended in this section to allow both the conjunctional and => in the left margin—as follows:
H )
(νχ)μ 
B)
=> (Ax3) (Vx)A » (Vx)B & (SL: "Numerator:" Ax4 + (Vx)A > A (PingPong); "Cpart" is ρ » (Vx)fi)
A > (Vx)B 6.4.2 Corollary, h (Vx)(4 V Β) = A V (Vx)B, provided χ is not free in A. Proof. (Equational) (yx){AvB) (WL and h ^ V f l Ξ —*A —> Β (tautology!); "Cpart" is (Vx)p)
( V x ) M  B) <=> (6.4.1) Ά
(Vx)B
Φί (tautology, hence a theorem) A V (Vx)J3
•
Most of the results we prove here have interesting duals where V and 3 are interchanged (and so are Λ and V). The first one we prove with a routine (equational) calculation, but we will leave the proof of the majority of these duals to the reader. Recall the definition of the informal (logical) symbol 3 (4.1.17): (3χ)Λ is short for i(Vx)u4
Now, h ι(\/χ)ιΛ ΞΞ  i ( V x )  i / l (member of Axl). We may choose.to use the 3abbreviation in, say, the lefthand side of ΞΞ to obtain h (3x)A ΞΞ  , ( V x )  ^ We will frequently use this absolute theorem in what follows, often in connection with WL, and will nickname it "definition of 3".
174
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
6.4.3 Corollary, h (3χ)(Λ Λ Β) = Α Λ (3x)B, provided χ is not free in A . Proof Below we use WL when capture may in general happen. Of course, in such a case, the hypothesis of the rule has to be an absolute theorem "h X = Y". (3χ)(ΑΛΒ) <=*· (definition of 3) i(Vx).(/l Λ Β) & (WL and deMorgan; "Cpart" is >(Vx)p) (Vx)(^/lVB) (SL and 6.4.2—no free χ in >A; "Cpart" is >p) ^ A V (Vx).B) (deMorgan) Λ .(Vx^B
^A
Ο (tautology) /l Λ .(Vx).B ^ (SL and definition of 3; "Cpart" is Λ Λ p) Λ Λ (3x)B
•
Here are the remaining results we promised (in quotes are the nicknames that the authors of [17] give to some of these results): 1. "Empty range", h (Vx)(_L —» Α) Ξ Τ. By redundant true we just prove h (Vx)(J_ —• A). Since h _L —> A (in Axl) we are done by an application of 6.1.3. 2. "One point rule". Provided that χ is not free in the term t, h (Vx)(a: = t —> A) = A[x := f]. We employ a PingPong argument. (—•) Note that since there is no free χ in i, (x = t » A)[x := t]
is
t = t > A[x := t]
Thus A)
(1)
(Vx)(a:  t
(2)
(Vx)(x = x)
(3)
t = t
(4)
(Vx)(x =
(1)
x = t^
ί = ί + i4[x := ί]
(Ax2) (partial generalization of Ax5) ((2)+ 6.1.5)
t^A)
(ΑΞ
A\x := t]
A[x:=t})
((1,3)+ 3.3.1)
(Ax6)
ADDITIONAL USEFUL TOOLS
(2)
A[x := t] > χ = t > A
(3)
(Vx)A[x := t\ > (Vx)(x = ί —+ >1)
(4)
A[x := t] » (Vx)(x = ί > Λ)
175
((1) +3.3.1) ((2) + 6.1.10—(2) is absolute) <(3) + Ax4 +3.3.1)
Note that Ax4 is applicable in step (4) since there is no free χ in A[x := t] 3. "One point rule—3version". h (3x)(x = t A A ) = A[x := t] if χ is not free in t. Exercise! (Hint. Use an equational calculation and the Vversion of the one point rule.) 4. "Distributiviry of V over Λ". h (Vx)(4 —* B) A (Vx)(vl *· C) = (Vx)(>4 >
SAC). We calculate a proof as follows: (Vx)(>l^B)A(Vx)(^^C) (6.1.7) (Vx)((A>B)A(A^C))
Φ> (6.1.11 + tautology (Axl) (A > S) Λ (A
C) = (A  . Β Λ C))
(Vx)(A —* Β AC) We could also invoke WL itself above, but 6.1.11 is simpler and invoking it involves writing less annotation. The metatheorem that we just proved generalizes 6.1.7 to the case of the "bounded" or "relativized" quantifier V. The authors of [17] write the metatheorem thus (Vxyl : Β) Λ (Vx\A : C) ΞΞ (\fx\A
:BAC)
while the corresponding notation in [2] is (Vx) BA(Vx) B A
=
A
(Vx) (BAC) A
The general notation for bounded quantification is not much in use in the literature. However, special cases are used, such as "(Vx) v4" and also "(Vx € y)A'\ which mean (Vx)(x € y —* A ) , and " ( V x ) A " and also "(Vx < y)A" that mean (Vx)(x < y —• A ) . €y
5. The proof of the dual of the above, "distributivity of 3 over V", is left to the reader. It states: h (3x)(A Α Β) V (3x)(A AC) = (3x) ^AA(BV
C)). In the notation
of [2] it is written as: h (3χ),ιΒ V (3x) C
C).
A
= (3x)„ (By
6. "Range split", where range in [17] refers to the A of (Vx)^B.
176
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
h (Vx)(/i V Β > C) = (Vx)(yt —> C) Λ (Vx)(B > C), or, in Bourbaki's notation, h ( V X ^ V B C = ( V x ^ C Λ (Vx) C. B
We calculate as follows: (Vx)(/t»C)A(Vx)(B>C) (6.1.7) (Vx)((AC)A(BC)) Ο (6.1.11 and the tautology (A > C) Λ (B > C) Ξ ((Χ V B) > C))
(Vx)((yWB)^c) 7. "Interchange of dummies"—as bound variables are called in [ 17]. This generalizes 6.1.8 to the case of bounded quantifiers. It states, h (Vx)(.A —• (Vy)(B —> C)) Ξ (Vy)(B —> (VX)(J4 —» C)), on the condition that y is not free in /I and χ is not free in B. To highlight the relationship to 6.1.8 I also write the above in [2]notation: l(Vx)>i(Vy) C = ( V y ) ( V x ) C B
B
A
Let us now calculate: (νχ)(Λ > (Vy)(B 
O )
^ (6.1.11 + 6.4.1—no free y in A) ( V x ) ( V y ) M  (B > C)) (WL + obvious tautology; "Cpart" (Vx)(Vy)p)
(*)
(Vx)(Vy)(B » (Λ » C)) (6.1.8) (Vy)(Vx)(B  μ  C)) •ΦΦ· (6.1.11 +6.4.1—no free χ in B) (Vy)(B »
(Vx)(A
^ C))
Note. Step (*) uses WL rather than the simpler 6.1.11 since the latter deals with a single V up in front. 8. The dual of the above is h (3χ)(Λ Λ (3y)(B Λ C)) = (3y)(B Λ (3χ)(Λ Λ C)), on the condition that y is not free in A and χ is not free in B. It can be trivially proved using the "3definition" and an equational argument. Exercise! 9. "Nesting", h (Vx)(Vy)(A Λ Β —• C) condition that y is not free in A.
Ξ (VX)(A
> (Vy)(B > C)), on r/ie
ADDITIONAL USEFUL TOOLS
177
(Vx)(A  (Vy)(B  C)) (6.1.11 + 6.4.1—no free y in A) (Vx)(Vy)(A
(B * C))
{WL + obvious tautology; "Cpart" (Vx)(Vy)p) (Vx)(Vy)(AAB^C) 10. The 3dual of the above is h (3x)(3y)(/4 Λ Β Λ C) Ξ (3χ)(Λ Λ (3y)(B Λ C)), on /ne condition that y is not free in A. It is easy to prove equationally. Exercise! The next metatheorem was given the nickname dummy renaming in [17] (where it is axiom (8.21)). Elsewhere in the literature (e.g., [45]), one refers to the metatheorem as the variant metatheorem." By either nickname it simply states something that we expect at the intuitive level, something we would be prepared to shrug off by saying, referring to the bound variable, "What's in a name?" After all, we know that Σ Γ = ι * Σ £ = ι k . Indeed, under some simple and not so restrictive conditions, a bound variable can be provably renamed without changing a formula's provability. 3
2=
2
6.4.4 Theorem. (Dummy Renaming for V) If ζ does not occur in A—i.e., neither free, nor bound—then \ (Vx)>l = (Vz)v4[x := z]. The practical usefulness of the above is when ζ does not occur in (Vx)yl either, i.e., when ζ φ χ as well, for if ζ and χ are the same, then the theorem becomes the trivial tautology (Vx)^ = (Vx)A (cf. 4.1.34). Proof. We go PingPong:
(1) (2) (3)
(Vx)A —»;4[x := ζ] (Vz)(Vx)A (Vz)A\x := zj
(Ax2: ζ is fresh for A; no capture: A[x := z] defined) {(1) +Amon (6.1.10))
(Vx)A > (Vz)A[x := z]
((2) + h (\/x)A * (Vz)(Vx)A from Ax4 + 3.3.1)
" A variant of (Vx)A is (VZ)J4[X := z] for some fresh z. 3
178
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
( H (1)
(νζ)Λ(χ := ζ] » A\x := ζ][ζ := χ]
(Αχ2—Λ[χ := ζ][ζ := χ] defined, cf. 4.1.35)
(2)
(Vz)4[x := ζ] > .4
(3)
(Vx)(Vz)yi[x := ζ] » (Vx)A
(4)
((1) rewritten—by 4.1.35, Λ [χ := ζ] [ζ := χ] is Α) ((2) + Amon)
(νζ)Λ[χ := ζ] + (Vx)A
{(3) + h (Vz)A[x := ζ] > (Vx)(Vz)A[x := ζ] from Αχ4; no free χ in (Vz)/l[x := ζ]); + 3.3.1)
•
6.4.5 Corollary. (Dummy Renaming for 3) If ζ does not occur in A, then h (3X)J4 Ξ (3z)A[x := z]. Proof. Exercise!
•
6.4.6 Exercise. Show that h (Vx)(Vx)/l = (Vx)A
•
6.4.7 Exercise. With two examples (within logic) show that the restriction according to which ζ in 6.4.4 must be neither free nor bound in A is necessary. • Equipped with the dummy renaming metatheorem we can stop worrying about "capture". For example, whenever we plan to do A[x := i] we can always settle for A'[x := t] instead, where A' is obtained from A by replacing all of the latter's bound variables by fresh ones (with respect to A, t). An induction on the complexity of A along with the pair WL + 6.4.4 yields h A = A'. This yields the metatheorem (cf. 6.1.19) "if h A, then h A'[x := t], if A' is chosen as above" (because under the circumstances, I A implies I A' to begin with; on the other hand, A'[x ·— t] is defined).
6.5
I N S E R T I N G AND R E M O V I N G " ( 3 χ Γ
Inserting and removing (3x) is an analogous acrobatic to that of inserting and removing (Vx), performed for the same reason: to reduce a proof, as much as possible, to one where Post's theorem can be liberally applied. It is a technique that is very often used in everyday math, and is quite powerful. First, to insert 3 is rather trivial. We have the following tools: 6.5.1 Theorem. (Dual of Ax2) h A[x := f] > {3x)A Proof. A[x := t]
>
[3x)A
INSERTING AND REMOVING'(3χ)
179
Φ> (SL + "3def" (p. 173); "Cpart" is A[x := t]  • p) A[x := t]  • .(Vx).A Φί> (tautology) (Vx).X >  A [ x := t]
•
6.5.2 Corollary. (Dual of the Specialization Rule) A[x := t] h (3x)A Proo/ 6.5.1 and MP.
•
6.5.3 Corollary. A I (3x)A By 6.5.2, taking t to be x. Now let us turn to removing 3. We will need a few tools at first.
PTOO/
•
6.5.4 Metatheorem. (V Introduction) If χ does not occur free either in Γ or in A, thenTh A> Β iffTh A> (Vx)B. Proof. Only (/direction. We are assuming Γ h A —> B. 6.1.9 yields Γ h (Vx)A —> (Vx)B. By the condition on A, I have h Λ —• (Vx)A (Ax4). I am done by tautological implication. Pause. This was a Hubert proof written in freestyle, just as a mathematician or computer scientist would have written it—not vertically, and not fully numbered. So is the following. direction: A tautological implication of (Vx)B —> Β (Ax2) is h (A  . (Vx)B) —» (A > Β) Thus, if I have Γ h A > (Vx)B, then (1) and MP yield Γ h A —• B .
(1) •
6.5.5 Corollary. (3 Introduction) If χ does not occur free either in Γ or in B, then Γ h A —» Β iff Τ h (3x)A > B. Note that the condition switched from A to B. Proo/
direction: h A —> (3x)A by 6.5.1. This yields h ((3x)A * B) —> (A—* B)
(2)
by tautological implication. If we now assume Γ h (3x)A —» B, then (2) and MP yield Γ h A > B . On/y i/direction: (1)
A —» Β
(Γproved; we continue the proof)
(2)
^Β>Ά
((1) +taut, implication (3.3.1))
(3)
.B > (Vx)A
((2) + 6.5.4—conditions met)
(4)
.(Vx)>A
((3) + taut, implication)
Β
180
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
Line (4) really says "(3x)A
—> B".
•
Corollary 6.5.5 is really the ticket to the technique of removing (3x): 6.5.6 Metatheorem. (Auxiliary Variable Metatheorem) Assume that Γ h (3x)A Moreover, assume that Γ + A[x := z] h B, where ζ is fresh with respect to Γ, (3x)A and B. Then Γ h Β as well. Proof. We can argue as follows: By the deduction theorem, Γ h i [ x := ζ] > B . Thus, from 6.5.5, Γ Η (3z)A[x := ζ] > B. We can now calculate equationally (from hypotheses Γ): (3z)A[x : = z ]  . B & (SL + 6.4.5; ζ is fresh for A ; "Cpart" is ρ > Β) (3x)A
•
Β
(SL + 2.1.23; "Cpart" is ρ —> B) Τ —> Β <=> (tautology) B
•
(1) The seemingly weaker hypothesis that "z is fresh with respect to Γ, A , and B " also lets the proof through as we immediately see from the first step (first <^·). Obtaining the first line of the equational proof only requires ζ not to occur free in Γ U {B}. However, note that • Under the weaker hypothesis, if ζ is x, then the theorem trivializes to 2.1.6, by the dual of "h Α Ξ (Vx)A when χ not free in A " and 4.1.34. We learn nothing new. • Thus, the case of practical importance is when there is a nontrivial (3x)prefix that the metatheorem teaches us how to "remove"; i.e., a prefix that actually binds some free χ in A . But then ζ is not χ if the former does not occur in A . Therefore, in the "interesting case", the weaker restriction "z is fresh with respect to A " is the same as the one stated in the metatheorem: "z is fresh with respect to (3x) A'. (2) Very Important! There is nothing cryptic about the metatheorem, which is actually used a lot by folks who write in mathematics, in computer science, and in other fields where mathematical reasoning is called for. The intuition behind it is this: If I know that {3x)A holds, then this tells me, intuitively, that for some (value of) x,A(x) holds." 4
' Where, by "A(x)" I simply want to draw attention, notationally, to A's dependence on x. l4
INSERTING AND REMOVING "(3x)"
181
So, even though I do not know (or care) which value makes A(x) hold, I can name ζ any such a value and say, "Okay then, let ζ be one of those values of χ that make A(x) hold"; for short I assume A(z)\ This additional—auxiliary—assumption helps a lot toward proving B: (a) Because more assumptions make proofs easier! (b) This assumption is potentially easier to manipulate with Boolean techniques than (3x)A is, because unlike the latter whose Boolean abstraction (4.1.25) is just a formula of the form >p, A\x := z] (or A(z)) may have Boolean connectives that I can profitably use in conjunction with Post's theorem. The metatheorem guarantees that once this auxiliary assumption, A[x := z], has served its purpose, it drops put of the picture, leaving us with just the fact Γ h B. Intuitively, this is because the assumption A(z) is an alternative way to say "(3x) A", this way: "Some unspecified but fixed value ζ of χ makes A(x) hold"—so it does not really add anything new that Γ did not already know about. Recall that Γ can prove (3x)A Pause. How exactly does the metatheorem suggest the intuitive interpretation that ζ is fixed? By inserting "A[x := z]" in a proof of Β as an auxiliary hypothesis. This hypothesis disallows us from using generalization (Vz) anywhere in the proof below the point of insertion—review 6.1.1. Therefore, ζ behaves like a constant, being unavailable for universal quantification (generalization)! This metatheorem is a mathematical phenomenon entirely analogous to what happens with induction over N: There we want to prove £?(n) from some assumptions Γ, and for arbitrary n. Out of the blue we add an assumption, that &(k) holds for all k < n, and use it in our proof. But when the dust settles we say that we have proved ^(n) only from Γ, not from Γ + "^(fc) holds for all k < n". The additional assumption (I.H.) is gone! 6.5.7 Corollary. Assume that h (3x)A. Moreover, assume that A[x := z] I B, where ζ is fresh with respect to (3x)A and B. Then h Β as well. Proof. Take Γ = 0.
•
6.5.8 Corollary. Assume that A[x := z] h B, where ζ is fresh with respect to (3x) A and B. Then (3x)A h Β as well. Proof. Take Γ = {(3x)A}.
•
6.5.9 Remark. In the examples that follow toward illustrating the use of 6.5.6 and its corollaries, we eliminate the existential prefix from a formula (3x)A that occurs in a proof from Γ, say at line (n), by introducing—anywhere below line (n)—the formula A[x := z] with the terse annotation auxiliary hypothesis associated with (n); ζ fresh. According to the requirements of 6.5.6, "z fresh" means all three below: (i) ζ does not occur in any hypotheses (auxiliary or not) written before this step.
182
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
(ii) ζ does not occur in the alreadywritten existential formula {3x)A (the "associate" of A[x := z]). (iii) ζ does not occur in the formula we want to prove. In practice, if we interpret "z fresh" more strongly, as (iii) plus it does not occur in any formula written in the proof before this step, then we are covered. • 6.5.10 Example. We prove here, just for practice, that h (3x)(Vy)A —> (Vy)(3x)A I'll give you two proofs: First proof: I use deduction theorem, so I prove (Bx)(Vy)A instead:
h (Vy)(3x)/t
(1) (2)
(3x)(Vy)/l (Vy)A[x := z]
(auxiliary hypothesis associated with (1); ζ fresh)
(3)
A\x := z]
((2) + spec)
(4)
(3x)A
((3)+ 6.5.2)
(5)
(Vy)(3x)/t
((4) + 6.1.1—lines (1,2) [hypotheses] have no free y)
(hypothesis)
By 6.5.6 (or 6.5.8; Γ = {(3x)(Vy)/l}), the "auxiliary" hypothesis (2) drops out, and we have that line (1), alone, proves line (5). In effect, what the proof does is so obvious as to be dull: It removes quantifiers—using appropriate tools—and reinserts them in a different order. You must be sure to annotate the auxiliary hypothesis as such. It is dead wrong to say that line (2) follows from line (1). Second proof: From I A —• (3x)A (i.e., 6.5.1) we get h (Vy)>4 —> (Vy)(3x)/1 by 6.1.10. Corollary 6.5.5 yields h (3x)(Vy)A * (Vy)(3x)A • 6.5.11 Example. We prove that {3x)(A > B), (Vx)A h (3x)B. (1)
(3x)(A  • B)
(hypothesis)
(2)
(Wx)A
(hypothesis)
(3)
A[x := z] —• B[x := z]
(aux. hypothesis associated with (1); ζ is fresh)
(4)
A[x:=z]
((2)+ 6.1.5)
(5)
B[x := z]
((3, 4) + MP)
(6)
(3x)B
((5)+ 6.5.2)
Lines (I) + (2) prove (6) by 6.5.6. I'll stop making this pedantic assertion at the end of proofs by auxiliary hypothesis/variable. We know that the auxiliary hypothesis drops out. No more reminders! •
INSERTING AND REMOVING "(3x)"
183
6.5.12 Example. It is instructive to look at an alternative proof that uses proof by contradiction (cf. 2.6.7). So rather than establishing (3x)(A > B),(Vx)A h (3x)B, we will attempt (3x)(A  • Β), (Vx)A,  ( 3 x ) B h 1 instead: (1) (2)
(3x)(A + Β)
(hypothesis)
(Vx)A
(hypothesis)
(3)
^(3x)B
(hypothesis)
(4)
.(Vx).B
((3) + writing in full the abbreviation "3")
(5)
(Vx)B
((4) + tautological implication (3.3.1)
(6)
A
((2)+ 6.1.6)
(7)
>B
((5)+ 6.1.6)
(8)
(A 
(9)
(Vx)^(A
((6, 7) + tautological implication)
B) B)
((8) + gen; Okay since (1, 2, 3) have no free
(10)
^(3x)(A + B)
((9) + 3abbrev. + tautol. implication)
(11)
_!_
{(1, 10)+ 2.5.7)
6.5.13 Example. We establish (Vx)(A > B), (Ex)A F (3x)B. (1) (2)
(Vx)(A > B)
(hypothesis)
(3x)A
(hypothesis)
(3)
A[x := z]
(auxiliary hypothesis associated with (2); ζ fresh)
(4)
A[x := z] —• B[x := z]
((1) +spec (6.1.5))
(5)
B[x := z)
((3,4) + MP)
(6)
(3x)B
((5)+ 6.5.2)
•
6.5.14 Remark. An experienced mathematician or computer scientist who never took a course in formal logic(!) would probably argue the above almost identically, however they would most likely opt for intuitively acceptable semantic terminology. They would also probably prefer to write A(x) and B(x)—over the terse A and Β— to draw attention to our interest in the variable x. The argument would go something like this: Assume that (Vx) (A(x) —• B(x)) and (3x) A(x) are true. The truth of the latter implies that for some value o/x, say c, A(c) is true. The truth of the first assumption (for all the values o/x) implies—in particular—that A(c) —> B(c) is true. Modus ponens yields the truth of B(c). But then it is true to say (3x)B. Our formal methods achieve the following:
184
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
(1) Ratify the above informal technique for handling 3. We have already noted that the "auxiliary variable" behaves formally like a constant throughout the proof, so it is all right that our fictitious computer scientist used an "auxiliary constant" c—cf. Pause on p. 181. (2) Make the technique available to the nonexpert—the experts can fend for themselves without the benefit of formal rules; the latter mostly benefit beginners. (3) Avoid errors that might creep into a loose semantic approach (see next example!). By the way, our fictitious mathematician wrote a Hilbert proof but did so in a rather condensed style, without numbering. This condensed informal Hilbert style is very common in mathematical practice. If a proof is longer, then numbers are inserted only where needed so that one can later refer back to earlier statements. • 6.5.15 Example. Let us prove the schema h (3x)A Λ (3x)B —• (3x){A Α Β). We will do this posturing as "experienced computer scientists or mathematicians". Thus, we will attempt to imitate the condensed Hilbert style of proof given above, using semantic terminology rather than formal (i.e., syntactic) methods: Assume that (3χ)Λ(χ) and ( 3 x ) B ( x ) " are true. Thus, for some value of x, say c, we have A(c) and B(c) are true. But then so is A(c) A B(c). Suppressing reference to the specific c, it is true to state (3x) (A(x) A B(x)). 5
This is nice, crisp, and short. And wrong! We will see in Chapter 8 that (3χ)Α Λ (3x)B > (3χ)(Λ. Λ Β) is not a theorem schema. What went wrong? Well, an inexperienced person arguing semantically often makes this kind of error (I have seen it over and over again): "Thus, for some value of x, say c, we have A(c) and B(c) are true." Surely, the truth of (3χ)Λ(χ) and (3x)B(x) does not imply that the same c makes both A(c) and B(c) true! We should have said that some c and some d (possibly different) make A(c) and B{d) true. Note how we cannot now conclude (3χ)(Λ(χ) B(x)) as we are saved by the "(possibly different)" qualification. Would formal techniques be safer? Yes! Λ
(1)
(3χ)ΛΛ(3χ)Β
(hypothesis)
(2)
{3x)A
((1) + tautological implication)
(3)
(3x)£?
((1) + tautological implication)
(4)
A[x := z]
(auxiliary hypothesis associated with (2); ζ fresh)
(5)
B[x := w]
(auxiliary hypothesis associated with (3); w fresh)
" The experienced mathematician takes (at least) two things for granted and thus unworthy of explicit mention: (1) The deduction theorem (2) "Hypothesis splitting" (2.5.2), where a hypothesis X AY splits into two hypotheses X and Y 5
INSERTING AND REMOVING "(3x)"
185
Thus, by the requirement for "freshness" (cf. Remark 6.5.9), the "auxiliary variables" ζ and w are distinct. The variable ζ is the formal counterpart of c above, while w formalizes d. Clearly, we cannot continue the formal argument in the fallacious way of our original informal argument. • 6.5.16 Example. Our last example has a famous name attached to it: Bertrand Russell. We show that for any predicate φ of arity 2 (i.e., one that accepts two arguments) \^{3yWx){
= 4{x,x))
(R)
By the tautology >A = A —» ± it suffices that we show instead h (3y)Cyx)(4>{x,y) = ιφ(χ,χ))

±
(1)
(3y)(Vx)(<£(x,j/) =.<£(x,x))
(hypothesis)
(2)
(Vx)((x, ζ) ΞΞ ,φ(χ,χ)) φ{ζ,ζ) = ^φ{ζ,ζ)
(aux. hypothesis for (1);
(3) (4)
_L
((3) + tautological implication)
ζ
fresh)
((2) +spec)
If we take φ(χ, y) to be "x e y"—where e is the "is a member o f predicate of set theory, then (R) that we just proved (for any predicate of arity 2) becomes I i(3t/)(Vx)(x ey = x^x)
(R')
Translated in English (R') says that there is no set y that contains all those sets that satisfy χ ^ χ (are not members of themselves). Very remarkably, the nonexistence of such a set y—a situation known as "Russell's paradox" —has just been proved within pure logic without using a single set theory axiom! • 116
There is a result analogous to the "auxiliary variable metatheorem" (6.5.6), named the auxiliary constant metatheorem, to which we now turn our attention. It makes formally explicit the role of the auxiliary variable as a "constant" (cf. Pause on p. 181). We will not need the auxiliary constant metatheorem except in the Appendix to Part II. 6.5.17 Lemma. Assume that no formula in Γ contains the constant c and that Γ h A. Moreover, let χ be a variable that does not occur in A. Then Γ h A', where A' is obtained from A by replacing all the occurrences of c in it by x. Proof. The proof, given by induction on the length of a proof of A from Γ for logic 2 of Chapter 5 is very similar to that of 6.1.1. Throughout, the result of replacing c in a formula Β by χ will be denoted by B'. "The "paradox" exists in Cantor's informal—or as we say, naive—set theory that leads us to believe that every collection of objects is a set. 1
186
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
For proofs of length one we have two cases: (1) A e Γ. Then A' is A since A cannot contain c. Thus Γ h A'. (2) A 6 Λι (4.2.1). There are six subcases where A is a partial generalization of one of the following: (i) Tautology Β (group Axl). The tautology is determined by how the Boolean connectives connect Boolean variables, constants, and prime formulae inside B. The former two remain invariant as c is replaced by x. The prime formulae are of three types, (Vy)C, t = s, or 4>(t\,...,t ). The replacement of c by by χ leaves these types invariant, say, (Vy)C', t' = s', or <j>(t\,..., t' ). Thus we end up with a tautology B'. n
n
(ii) Formula (Vy)B —> B\y := t] (group Ax2). Replacing c by χ results in a formula still in group Ax2: (Vy)B' > B'[y := t'\. Note that B'{y ~ t'j is still defined, for χ cannot be captured (if it entered t'), being new for A. (iii) Formula (Vy)(B > C) (Vy)B — (Vy)C (group Ax3). Replacing c by χ results in a formula still in group Ax3: (Vy)(B' —* C) —• (Vy)B' —» (Vy)C'. (iv) Formula Β —> (Vy)B, when y is not free in Β (group Ax4). Replacing c by χ results in a formula B ' —> (Vy)B' still in group Ax4, noting that y, being different from x, is still not free in B ' . (v) Formula y = y (group Ax5). This contains no c, so it remains invariant upon replacing c by x. (vi) Formula t = s —• (A[y •— t] = A[y := s]) (group Ax6). Replacing c by χ results in a formula still in group Ax6: t' = s' + (A'[y := ί'] Ξ ,4[y := s']). Note that A'[y := ί'] and A[y := s'] are still defined, for χ cannot be captured (if it entered t' or s'), being new for A. Assume the claim for proofs of length η where A appears. We now go to the case of length η + 1. If A appeared before the end, then we are done by the I.H. If it appears for the first time at the end and it is in Γ U Λ χ, then the case already has been argued. Let then A be the result of MP; that is, the formulae Β and Β —> A (for some B) appear before it in the proof. By I.H., Γ h B' and Γ h B ' > A'; thus Γ h A' by MP. • 6.5.18 Corollary. Assume that Γ h A and that there is a proof certifying this, which uses no formula from Γ that contains the constant c. Moreover, let χ be a variable that does not occur in A. Then Γ h A', where A' is obtained by A by replacing all the occurrences of c in it by x. Proof. Let Δ be the set of all the formulae from Γ that appear in said proof. By 6.5.17, A h A'. We get Γ h A' by 2.1.1. •
ADDITIONAL EXERCISES
187
6.5.19 Metatheorem. (Auxiliary Constant Metatheorem) Let c be a constant that does not appear in the formulae A or B. Assume that Γ h (3x)A. Moreover, let Γ + A [χ := c] h B, with a proof where the formulae invoked from Γ do not contain the constant c. Then Γ h Β as well. Proof. Let Δ be the set of all formulae of Γ invoked in the certification of Γ + A [x := c] h Β as in the statement of 6.5.19. Thus, Δ + A [χ := c] h B. By the deduction theorem, Δ h A[x := c]  > f i . Let ζ be new for Δ U {A, B}. Thus, from 6.5.17, Δ h A[x := z] > B. Hence, Δ I (3z)A[x := ζ] — Β by 6.5.5 (this part needs that ζ is not free in Δ, nor in B). By 6.4.5 and an application of SL we get Δ h (3x)A > B ; hence Γ h (3x)A > B . By MP we have Γ h B . • 6.6
ADDITIONAL E X E R C I S E S
1. Show that h (Vx)(A —> B ) —> (3x)A > (3x)B.
B/nr. Use 4.1.17 to eliminate " 3 " . 2. Show that h (Vx)(A > (Β
ΞΞ
C)) » ((Vx)(A —> Β)
Ξ (VX)(A
> C ) ) .
3. Show that h (Vx)((A V 5 )  * C )  > (Vx)(A » C). 4. Show that h (Vx)(A  » ( Β Λ C))
(Vx)(A > B ) .
5. State and prove the 3dual of 6.1.8. 6. Prove the following version of the relativized Vmonotonicity, which in the notation of [2] (cf. p. 175) is h
 C) > ( V x ) B A
(VxUC
while in standard notation it reads h (Vx)(A —> Β —> C) » (Vx)(A —> B ) —» (Vx)(A > C)
7. Prove h (3Χ)
Λ Λ Β
(?ΞΞ
(3x) (BAC) A
Hint. Translate first to standard notation. 8. This relativizes 6.4.2. Prove h A V ( V x ) C ΞΞ (Vx)β(A V C), as long as χ not free in A B
//mi. Translate first to standard notation. 9. This relativizes 6.4.3. Prove h Α Λ ( 3 x ) = ( 3 x ) ( Α Λ C), as long as χ not free in A s
188
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
Hint. Translate first to standard notation. 10. Prove h (3x) B A
V (3x) C A
= (3x) (B A
V C)
Hint. Translate first to standard notation. 11. Prove that if χ is not free in A, then I A = (3x) A 12. Prove the one point rule—3version: h (3x)(x = t Λ A) = A[x := t\ if χ is not free in t. 13. Prove Κ (3x)(A Λ (3y)(B Λ C)) = [3y){B Λ (3x){A Λ C)), on the condition that y is not free in A and χ is not free in B. 14. This is the dual of result 6 on p. 175. Prove h (3x) C AvB
= (3x) C A
V (3x) C. B
Hint. Translate to standard notation first. 15. Prove h (3x)(3y)(A Λ β Λ C) = (3χ)(Λ Λ (3y)(B Λ C)), on ffie condition that y is not free in A. 16. Prove dummy renaming for 3: If ζ does not occur in A, then ( (3χ)Α Ξ (3ζ)Λ[χ := ζ]. 17. Here is a suggested proof of V (Vx)(3y)A 
(3y)(Vx)A
(*)
We split the —> and go via the deduction theorem: (1) (2)
(Vx)(3yM
(3)
A[y := z]
(auxiliary hypothesis associated with (2); ζ is fresh)
(4)
(Vx),4[y := z]
((3) + gen; Okay: χ is not free in hypothesis line (1))
(5)
(3y)(VxM
((4) + 6.5.2)
(hypothesis) ((l) + spec)
Now, you should not believe (*) (cf. 8.2.11). However, you are asked not simply to dismiss the proof because of 8.2.11, but rather to find precisely in which step it went wrong, and why said step is wrong. 18. Prove using the auxiliary variable metatheorem: h (3χ)(Λ —> Β) —> (Vx)A —> (3x)B. 19. Prove using the auxiliary variable metatheorem: h (3x)B —• (3χ)(Λ V Β). 20. Prove the dual of Exercise 3: (In [2] notation) h (3x)^C » 21. Let φ be a predicate of arity 2.
(3x) C. AvB
ADDITIONAL EXERCISES
189
I claim φ(χ, y) h φ^, χ) via 6.1.19. • Am I right or wrong in my (oneline) claim + proof, and why exactly? • If I am wrong in my proof, it might still be possible to provide a different correct proof. Well, either provide such a correct proof, or definitively show that φ(χ, y) h 0(y, x) is not a theorem schema (if this is what you will end up doing, it will require tools from 8.2.3). 22. Prove h (3x)(A > (Vx)A). 23. Prove h x = y A y = z—>x = z. 24. Prove h (Vx)B —> A = (3x)(B > A), provided that χ is not free in A. Hint. Be mindful of the priorities of the connectives. Use an equational proof. 25. Prove that the following is an absolute theorem schema on the condition that χ is not free in B: (Vx)(A » B) = (3x)A B. Hint. Be mindful of the priorities of the connectives. Use an equational proof. 26. Prove h (3x)A > ({Bx) (B A
V C ) s B v {Bx) C), A
if χ is not free in B.
Hint. Be mindful of connective priorities. Then translate in standard notation before embarking on a proof. 27. This relativizes Exercise 24. Prove h (3x)A > C)), if χ is not free in C.
((Vx)^B
+ C
ΞΞ (3Χ)Λ(Β +
Hint. Be mindful of connective priorities. Then translate in standard notation before embarking on a proof. 28. Professor N. A. Ive has submitted the following claim for publication: h Α
ΞΞ
(Vx)A
(1)
He offered the following proof, and I quote: "We know (generalization + specialization) that hAiffh(Vx)A
(*)
By the metatheorem that says 'for any two (absolute) theorems, Β and C, we have h B = C\ it follows from (*) that h Α ΞΞ (Vx) A." Hmm. We know from the text that (1) is wrong, so the question is: Precisely which step is wrong in Professor Ive's proof, and why? 29. Let φ be a predicate of arity 2. • Explain why (Vi)(Vy)<^>(x, y) —» (Vj/)^>(y, y) is not an instance of Ax2.
190
GENERALIZATION AND ADDITIONAL LEIBNIZ RULES
• Nevertheless, prove that (Vx)(V?/)<£(a:,i/) —> theorem!
^ν)Φ{ν,ν)
is an absolute
30. Let φ, φ be predicates of one variable. Prove V φ(χ) >
(Vi,)(v>(») »
(Vz)^( )) 2
(Vi)0(x)
31. Let , 0 be any unary (of arity 1) predicates, and c an (object) constant. Prove h (Vx)(0(x)
V(a;)), (Vz)<£(«) h V(c)
32. (a) For any predicate φ of arity 2 prove I Cyz)(yy)
(3x) B". A
35. Consider the following formula, in a language with a nonlogical function symbol / of arity 1: (Va:)(s = / ( s ) ^ / ( * ) = / ( / ( * ) ) ) (1) (a) What is the Boolean abstraction of this formula? (Indicate by boxing.) (b) Is the abstraction a tautology? Why? (c) Whether or not the abstraction is a tautology, can you prove (1) in firstorder logic? Hint. While this exercise is selfcontained in its present context, you may benefit by peeking in the next chapter. 36. Assume that Γ h A and that there is a proof certifying this where no formula from Γ used in it contains the constant c. Then for some variable χ we have Γ h (Vx)A', where A' is obtained by A by replacing all the occurrences of c in it by x. 37. Assume that h (3x)A Moreover, assume that Α[κ := c] h B, where c is a constant that does not occur in A or B. Then I Β as well. 38. Assume that A[x := c] h B, where c is a constant that does not occur in A or B. Then (3χ)Λ h Β as well. 39. Revisit and formally reprove all the examples in Section 6.5 that follow 6.5.8, but this time do so using a proof "by auxiliary constant" (cf. 6.5.19, and Exercises 37 and 38 above) to eliminate the leading existential quantifier.
CHAPTER 7
PROPERTIES OF EQUALITY
You will recall our brief discussion of "SFL" (SingleFormula Leibniz) in Section 3.4 of Part I. That was in the context of Boolean logic. Axiom 6 below (cf. 4.2.1) t = s > (A[z := t] = A[z := s}) is a counterpart of SFL for equality of objects. We explore here some of the consequences of Ax5Ax6, including another counterpart of SFL, where the types of expressions on either side of —> are nonBoolean. 7.0.1 Lemma. h x = y  » y = xandr χ = y —• y = ζ —> χ = z. Proof. For h x = y—»y = x here is a Hilbertstyle proof: χ = y —> (χ = χ
x = y—»x = x—»y = x
{(1) + tautological implication (3.3.1))
(3)
χ
χ
(Ax5)
(4)
χ
y»y = x
((2, 3) + tautological implication (3.3.1))
ΞΞ
y = x)
(Ax6: "A" is ζ = x, "t" is χ and " s " is y)
(1) (2)
I leave the second proof to the reader as an easy exercise. Mathematical Logic. By George Tourlakis Copyright © 2008 John Wiley & Sons, Inc.
• 191
192
PROPERTIES OF EQUALITY
7.0.2Exercise. Proveh χ = y —>y = z—> χ = z.
•
7.0.3 Lemma. For any function symbol f of arity n, h χ = y  + / ( Z i , . . . , Z;, X, z
i + 2
, . . . , z„) = / ( z i , . . . , z ; , y , z
i + 2
, . . . , z„)
Proo/ This is a Hubert proof in a relaxed style. Let A stand for the formula /(Zl, . . . , Z i , X , Z 2 , . . . ,Z„) = / ( Z i , . . . , Z i , y , Z i i +
+ 2
, ...,z„)
Then, by Ax6, h χ = y »^/(zi,... ,Zj,x,z 2,... , z ) = /(zi,... ,Zi,y,z i +
n
/(zi,... ,Zi,y,z
i + 2
i + 2
, . . . ,z„) =
, . . . ,z„) = /(zi,... ,Zj,y,z,
+ 2
,... ,z )) n
The subformula " / ( z i , . . . , Z i , y , z , . . . , z „ ) = / ( z j , . . . , Z i , y , z , . . . , z „ ) " can be dropped. Why? By (Ax5) w = w is an axiom. By 6.1.19 we get j + 2
i + 2
h /(Zi,. . . ,Zj,y,Z 2, ••·,Zn) = / ( ^ l ,· · •,Zi,y,Z 2, • · · , Z ) i +
i +
n
"Redundant true" does the rest.
•
7.0.4 Corollary. For any function symbol f of arity n, χ = y h /(zi,.. .,Zi,x,z
i + 2
, . . . ,z„) = / ( ζ ι , . , . , Ζ ί ^ , ζ ^ , . . . ,z„)
Proo/ By MP and 7.0.3.
•
7.0.5 Corollary. For any function symbol f of arity n, Ι χ ι = y i  »
•x
n
= y
n
* /(χι,...,χ ) =
f(yi,,y ) n
η
Proof. (Sketch) Move all the Xj = y j to the left of "H" and prove instead xi = y i , . . . , x „ = y
n
h / ( x i , . . . ,x„) = / ( y i , . . . ,y„)
This is a legitimate approach by the deduction theorem. Then we deduce using Corollary 7.0.4 / ( x i , . . . , x „ ) = / ( y i , x , . . . , x „ ) fromxi =
y
1
2
/ ( y i , X 2 ,   •, x ) = / ( y i , y 2 , X 3 ,    ,Xn) fromx n
2
= y
/ ( y i , y 2 , x 3 ,   •, χ ) = Z(yi,y2,y3,x4, · •, χ ) fromx η
η
3
2
= y
3
PROPERTIES OF EQUALITY
193
Finally, / ( y i , V 2 , . . . , y „  i , x „ ) = / ( y i , V 2 , . . . , y n  i , y ) from x = y n
n
n
Transitivity (Lemma 7.0.1) does the rest.
•
7.0.6 Corollary. For any function symbol f of arity n, and any terms U and s,, i =
1,2,...,n,
h ti = si >
•t
n
= s
n
> (f{h,..
.,£„) = / ( s i , . . .
,s Yj n
Proof. By 7.0.5 and the substitution theorem (6.1.19).
•
7.0.7 Corollary. For any function symbol f of arity n, and any terms ti and Si, i = 1,2,
...,n, t\ = Si, ... ,t
n
= s h /(ίι,...,ί„) = /(si,...,s ) n
n
Proof. By 7.0.6 and η applications of MP.
•
7.0.8 Theorem. For any terms t, t', s, we have that h t = t' —> s[x := t] = s[x := t'}.
Proof. We do induction on the complexity of the term s (cf. 4.1.6). Basis I.
s is a constant or a variable other than x. Then the claim reads μ t = t' > s = s
and follows by a tautological implication from h s = s. The latter is correct by Ax5 and an application of 6.1.19. Bail's 2.
s is the variable x. The claim now reads h t = t' > ί = £'
and is correct (Axl). Induction step, s is / ( i i , . . . , f ) . where / is a function symbol of arity η and = 1,..., n, are terms. n
ti,i
We proceed via the deduction theorem, so we add the hypothesis t = t' and embark upon proving f(ti,...,t )[x:=t} n
= f(t ...,t ){x:= u
n
if]
that is (cf. 4.1.28) f(t
x
(x := t],. • •, i„[x := t]) = / ( t i [χ := ί ' ] , . . . , i„[x := t'])
(0)
ί = t'
(hypothesis)
194
PROPERTIES OF EQUALITY
(1)
i i [ x := t] = t,[x := £']
{(0) + I.H. + MP)
(2)
i [x:=r.] = i [ x : = £']
{(0) + I.H. + MP)
(η)
i [ x := t] = ί [ χ := ί']
((0) + I.H. + MP)
(n+1)
2
n
2
η
/ ( ί ι [ χ : = ί ] , . . . , ί [ χ :=*]) = Β
/(i [x:=i'],...,i„[x:=t']) 1
((l)(n) +7.0.7)
•
Theorem 7.0.8 is an SFL counterpart where both sides of —» are of nonBoolean type.
CHAPTER 8
FIRSTORDER SEMANTICS—VERY NAIVELY
This chapter is on naive semantics. That is, we see here what these abstract, "meaningless", strings—the firstorder formulae—actually say. Specifically, we will see what it means, and how, to compute truth values of such formulae. 1 would like to emphasize the qualifier naive. In the more advanced literature one defines semantics rigorously: either defining the truth or falsehood of formulae within informal mathematics—that is, in the metatheory—a process originated by Tarski and nicknamed Tarski semantics, or defining the truth or falsehood of formulae of the original language within some other formal theory, T, possibly over a different language, in which case one speaks of formal semantics. In formal semantics, formulae of the original language are first translated into formulae over the language of T. Then one defines that a formula in the original language is "true" iff its translation is provable in Τ (cf. [45, 53, 54]). Here we do neither, but instead imitate Tarski informal semantics, albeit in a very simple and purposely sloppy (8.1.2) manner. But this will do for our purpose, which is to learn to easily build counterexamples that expose fallacious statements in predicate logic. Central to all this is the concept of an interpretation. Until now, we treated formulae as "meaningless strings of symbols" that we knew how to manipulate Mathematical Logic. By George Tourlakis Copyright © 2008 John Wiley & Sons, Inc.
195
196
FIRSTORDER SEMANTICS—VERY NAIVELY
syntactically—even to prove formally—with our logical axioms and rules of inference. But how can we give mathematical meaning to these symbols and formulae? 8.1
INTERPRETATIONS
An interpretation of a formula is inherited from the interpretation of the symbols of the language where it belongs via a process that we will describe below (8.1.2). It is a tool that when applied to any formula in the language will produce an interpreted mathematical formula of the metatheory—the "meaning" or "semantics" of the original. As was the case in propositional logic, where the semantics of a formula (in that case, its truth value) is not unique but, in general, depends on the chosen state, an analogous situation holds in the firstorder case: The "meaning" of a formula is not unique. An interpretation of a firstorder language is a pair of two components, a non empty set D—called the domain or underlying set of the interpretation—and a translator M, which is a mapping that assigns an appropriate mathematical object to each of the following elements of the language: nonlogical symbols, _L and T, each object variable and each propositional variable. Let me stress that the choices of both D and Μ are entirely up to us. 117
We usually denote the pair (D, M) with the same capital letter that names the domain, but in German calligraphic typesetting; that is, 3). Clearly, the name 33 does not uniquely determine an interpretation (as neither does D) since an interpretation also depends on M. However, the context will fend off possible ambiguities. 8.1.1 Definition. (Interpreting a Language—Step 1: Translating the Alphabet) An interpretation Σ) = (D, M) that we choose gives meaning to ±, T, to all object and Boolean variables, and to all nonlogical symbols of the alphabet as follows, where the result of the translation " M ( . . . ) " is written as ".. (1) For each free variable x, x —i.e., the translation M(x)—is some member of D. B
(2) For each Boolean variable p, p (3) T
B
= t and ±
c
=
B
is some member of {t, f } .
f.
(4) For each object constant c of the alphabet, its translation c® is some member of D. (5) For each function / of the alphabet, the translation f is a mathematical function of the metatheory with the same arity as the formal / . / ° takes its inputs from D and has its output values in D. v
" We recall, of course, that a firstorder language consists of three significant sets: the alphabet. Term, and WFF. 7
INTERPRETATIONS
197
(6) For each predicate φ of the alphabet, the translation φΡ is a relation of the same arity as φ that takes its inputs from D and has its output values in {t, f}. Note that the Boolean connectives, the symbol "— ", and the brackets are not translated into something else; they retain their standard fixed meaning and notation. • The next definition describes the inheritance mechanism through which any formula of the language inherits an interpretation that was given to its alphabet. 8.1.2 Definition. (Interpreting a Language—Step 2: Translating a Formula) Given a formula A over some firstorder language, and an interpretation X> = (D, M) of the language. The interpretation or translation of A via © is α mathematical formula of the metatheory that we denote by A , which is constructed as follows: v
(i) We replace each occurrence of _L, Τ in A by lP , T —i.e., 1
V
f, t—respectively.
(ii) We replace each occurrence of a Boolean variable ρ in A with the specific truth value p given by the interpretation of the language. B
(iii) We replace each occurrence of a free variable χ in A with the specific value xP from D. (iv) We replace each occurrence of (Vx) in A by (Vx G D), which means "for all values of χ in D". Nonlogical elements of A: (v) We replace each occurrence of an object constant c in A with the specific value c from D. v
(vi) We replace each occurrence of a function / in A with the specific function which has inputs from D and output values in D.
f, v
(vii) We replace each occurrence of predicate φ in A with the specific relation φΡ, which has inputs from D and output in {t, f}. (viii) We emphasize once more what was left unsaid in the transformations (i)(vii) above: Every Boolean connective, =, and brackets are translated as themselves.
• (1) A translation A® does not have any free variables or any Boolean variables; thus we cannot make any substitutions into variables that may alter A . All its object variables are bound. Indeed—by construction—each free variable χ and each Boolean variable ρ of the original ("meaningless") A has been everywhere replaced by the value x from D and p from {t, f} respectively. This is good, because it ensures that A has a determinate truth value, t or f. We will be writing Α = t or A = f respectively. v
v
s
23
Έ
B
198
FIRSTORDER SEMANTICS—VERY NAIVELY
(2) Definition 8.1.2 imitates Tarski semantics in that the translation results are metamathematical objects. It also differs in a significant way: The rigorous definition of Tarski semantics does not effect a texteditorlike "find/replace" textual substitution in A toward constructing its metamathematical analogue, the formula A . Rather, by induction on the formula A, it computes the truth value of A®, which is induced by the language interpretation, directly (cf. [45, 13, 35, 29, 53]). Thus our approach also borrows from, but is far from being the same as, the process that defines formal semantics. The latter does have an intermediate interpretation step that produces a formal formula, which one next will check for provability in some theory. Our intermediate interpretation as defined here instead produces an informal formula of metamathematics, which one next checks for its metamathematical truth. I believe the reader understands at the intuitive level how to compute the truth value of simple mathematical formulae that have no free variables. Thus, in the userfriendly and natural 8.1.2 I am content only to show how we compute the metamathematical counterpart of a "meaningless" formula. v
It is useful for the discussion in the next section to also have a concept of a partially translated formula that may have some free variables over D. 8.1.3 Definition. (Partial Translation of a Formula) Given a formula A over a firstorder language and an interpretation, D, of the language, we may decide, in the application of the translation 8.1.2, to select some particular finite set of formal object variables x, y,z'g,... of the language, which we want to exempt—that is, all their occurrences in A—from step (iii) of 8.1.2, thus leaving them untranslated as we go from A to its metamathematical counterpart. Of course, x, y , Z 3 , . • • may or may not actually all occur free in A. If, say, χ does not occur free in A, then χ does not occur free in the partially translated formula, either. Otherwise, it is a free variable in the latter. In any case, the resulting mathematical formula of the metatheory where the x i , . . . , x„ have not been translated—called the partial translation of A by 3) with respect to the variables X i , . . . ,x„—will be denoted by A^ to indicate the possible free occurrence of X i , . . . , x in it. We view the x i , . . . , x in the formula A® of the metatheory as variables that vary over D. Omission of the qualifier partial will mean the full interpretation/translation—a formula with no free variables—as per 8.1.2. • X n
n
n
x
8.1.4 Remark. It follows that ((Vx)A) is (Vx € D)A® since the variable χ of A is not translated as part of the translation process of (Vx) A—it is not free in (Vx) A • T>
8.1.5 Example. Consider the formula φ(χ, χ), where φ is a 2ary predicate in some firstorder language. Here are a few possible interpretations: (a) D = Ν (the natural numbers, {0,1,2,...}), φΡ =<. In this context I mean " < " as the "less than" relation on natural numbers. Thus, (φ(χ,χ)) happened to take
is this formula over Ν: = 42, then (φ(χ, x))
V
χ® < χ . Ώ
For example, if we
is specifically "42 < 42".
INTERPRETATIONS
By the way, we see that
( φ ( χ , χ ) )
= f no matter how we chose
ν
199
x '. v
Here are two partial interpretations, the first having exempted the variables y, z, the second having exempted x: (i) ( φ ( χ , χ ) ) \
is χ® < x . Exempting y and ζ from the translation (8.1.3) v
/ y,z
makes no difference to the result as neither y nor ζ occur free in φ(χ, χ). (ii)
is χ <
^4>(x,xYj
x.
(b) D = Ν, φ® = < (the "less than or equal" relation on N). Thus, (φ{χ, χ ) )
is this formula over N:
Ώ
the choice of χ®, we have (φ(χ, x ) ) (c)
V
I
S
< x ° . Clearly, no matter what
= t.
=€.
Ω = {0,{0}},φ
Ώ
By " e " here I mean the concrete "is a member o f relation of set theory. Thus,
( φ ΐ χ , χ ) )
7
is this formula over D:
3
€ ar°'.
x®
Note that every choice of X makes this false (f). Indeed, 0 e 0 is false because (the right copy of) 0 has no members (it is not a set), and {0} e {0} is false because (the right copy of) {0} contains the element "0", not the element "{0}"— these two are different, one is of type "number" the other is of type "set". • S
The symbols " < , <, e" are nonlogical and have no fixed intrinsic meaning. That is why we had to say, when we chose them to interpret "φ" above, what we mean by them. For example, we said that we mean " e " to be the "is a member o f relation of set theory. 8.1.6 Example. Consider the formula } { x ) = f(y) —> χ = y, where / is a 1ary (unary) function in some language. Here are a few possible interpretations: (1) D = N, f ( x ) = χ + 1 for all values of χ in D (i.e., in N). v
Thus,
(f{x)
=
f(y)^>x
is this formula over N:
= y)
V
χ» + 1 = „» + 1  X
S
Note how every choice of x
v
= y°
and y® makes this formula true.
(2) D = Z , where Ζ is the set of all integers, { . . . ,  2 ,  1 , 0 , 1 , 2 , . . . } . We take here f®(x) = x for all χ in Z. 2
Thus, (f(x) = f(y) —> χ = y)
Tl
\s this formula over Z:
200
FIRSTORDER SEMANTICS—VERY NAIVELY
The above is true for some, and false for some other, choices of x example, it is false for x =  2 and y° = 2.
and y®. For
v
v
And here are two partial interpretations: (i) (/(*) = f(y)  χ = yf
is χ = [y ? 2
x
v
=
^ χ
ν°.
(ii) (f(x) = f(y) >x = y)® is x = y > χ = y. 2
•
2
y
The moral from the above is: There are some interpretations of "f (x) = f(y) —» χ = y" that are (i.e., have truth value) false (ΐ). 8.1.7 Example. In this example we will consider, in order, two different interpretations with different domains D, each a finite subset of N. Consider the formula x = y > (Vx)x = y
(1)
Here are a few possible interpretations: (1) D=
{3}, i
3 3
=3,y
v
=3.
Since there is only one element in D, my only option is to set "x "y® = 3", as I did above.
v
= 3" and
Thus, formula (1) is interpreted as the following formula over D: 3 = 3 —> (Vx
G
D)x = 3
(2)
By the way, formula (2) has value t because "3 = 3" is t and so is "(Vx £ D)x = 3", since it says "all values χ in D equal 3". (2) This time I take D = {3,5}, and again X = 3 and y s3
v
= 3.
Thus, formula (1) is interpreted as the following formula over this D: 3 = 3—» (Vx € D)x = 3
(3)
Now, formula (3) is f, because "3 = 3" is t as before, but this time "(Vx € D)x = 3" is f, since it still says "all values χ in D equal 3", which fails—D now has two elements: It is not true that both are equal to 3. The moral is: There is some interpretation where formula (1) above is interpreted as false (f). •
8.1.8 Example. Let us look at a few interpretations of (Vx)(x £y = x£z)^>y
= z
(1)
201
SOUNDNESS IN PREDICATE LOGIC
(1) If we take D to be the "collection" of all sets, and € (which we still denote as "€"), then we get 118
(Vx e D)(x ey™ = x€z )^y v
Ώ
to mean "belongs to"
= z
v
v
which is set theory's requirement (socalled axiom of extensionality) that two sets, y® and z°, are equal if they have the same elements. This interpretation of formula (1) is therefore true for any choice of sets y® and z®. (2) Take now D = Ν and € = < , where once more " < " is the relation "less than" on N. Then, formula (1) is interpreted into: B
(Vx e N)(x < y° = χ < ζ ) » y* = ζ Ώ
Ώ
which is obviously true no matter how we chose the numbers t / and z . s
D
(3) Take D = Ν and e = , where by "" we denote the relation "divides" (with remainder 0). For example, 2 13 and 2 1 1 are false, but 214 and 210 are true. I )
Then, formula (1) is interpreted into: (\/xeN){x\y
v
= x\z'°)^y®
= ζ
Ώ
which is also obviously true for all choices of the numbers y ,z . It says: "Two natural numbers, y° and z , are equal if they have precisely the same divisors". z
v
v
However, (4) Take D = Ζ and e = v
. Now, (1) is interpreted into:
(yxeZ)(x\y =x\z°)^y =z D
D
v
We note that unlike the previous interpretations of (1), the current interpretation may be false. For example, this is so if y®  2 a n d z =  2 . The interpretation is then the formula s
(VxeZ)(x2sx 2)>2 = 2 which is false, for the hypothesis (Vx e Z)(x 1 2 = χ   2) is true (2 and  2 do have the same divisors), but the conclusion 2 =  2 is false. • 8.2
S O U N D N E S S IN P R E D I C A T E L O G I C
8.2.1 Definition. (Universally—or Logically, or Absolutely—Valid Formulae) If A = t, for some A and 2), we will say that A is true in the interpretation Ί) or that 2) is a model of A. We write this briefly as: 35
HD
A
(1)
' '"Small print: We are no! interested here in esoteric issues such as: "But this D is too 'large' and is thus not a set."
202
FIRSTORDER SEMANTICS—VERY NAIVELY
A firstorder formula, A, is universally valid—or just valid—iff it has as a model every interpretation of the language where the formula belongs, i.e., (1) holds for all interpretations 3) of the language of A. We indicate that A is universally valid by dropping the 3) subscript from (1), writing \=A (V)
• Note the absence of the subscript "taut" from notation (V) above. This is for good reason: = χ = χ is correct, but it is not the case that (=ta t χ = x. For the latter says of the abstraction, say p, of χ = χ that j=ta ρ—a clearly incorrect metamathematical statement, because I may take a state ν with v(p) = f. The former says that for any 3? and any choice of the value x° in D 1 have x° = χ —clearly true! U
Ut
33
8.2.2 Remark. All axioms in 4.2.1 are universally valid. We have already argued this claim early on at a very intuitive level in 4.2.2 and we are going to elaborate further here in the light of Definitions 8.1.2 and 8.1.3 without however getting into a 100% rigorous proof that requires a much more careful Definition 8.1.2 (we return to this topic and give such a definition, and a rigorous proof, in the Appendix, Section A.l). Valid Axioms 1: Axl. It is easy to see that all axioms in group Axl are valid. Indeed, more generally, we argue in outline that if haut A, then \= A
(1)
That the converse of (1) is false was already discussed taking A to be χ = χ as a counterexample. Now, why is (1) a true metamathematical statement? Well, let us assume \=
aM
A
(2)
Of course, in the context of predicate calculus, (2) refers to the abstraction of A (cf. 4.1.27). In that abstraction—we are told by (2)—any arbitrary assignment of values to the Boolean variables and prime subformulae of A will lead to a computed truth value of (the abstraction of) A equal tot. 1 1 9
Let us now see what happens when we fix a 3) and try to compute the truth value of A . Well, the abstraction of A has exactly the same Boolean structure as that of A, because all the Boolean connectives and brackets are translated as themselves. Therefore the abstraction of A is also a tautology! v
v
1 l9
Prime subformulae were defined in 4.1.25.
v
SOUNDNESS IN PREDICATE LOGIC
203
We next note: (a) A prime subformula of A has one of the forms φ(ί\,..., t ), t — s,or((Vx)B). Upon translation of A into A , these prime subformulae are transformed into i = s , 4i°(tf,...,t ) and ((Vx 6 D)B®) respectively, i.e., into prime subformulae of A . On the other hand, a Boolean variable ρ of A becomes a subformula p of A (that is, the metamathematical Boolean constant t or f). We may think of it as a "virtual" ρ to which we decided (by virtue of our choice of D) to assign the value n
33
33
33
33
33
3 3
33
(b) Now, in checking whether A is a tautology, one assigns to the prime subformulae and to the Boolean variables of A arbitrary Boolean values and computes the result for A according to truth tables. By (2), the result invariably is t. (c) How does the computation of the truth value of A relate to the description in (b)? Well, rather than assigning truth values to the prime subformulae of A —which are direct translations of those of A—one computes and uses their intrinsic truth values instead. This latter subcomputation is informed by our knowledge of the metatheory where these subformulae mean something mathematically tangible (cf. the examples of the preceding section). 33
33
On the other hand, A has no Boolean variables, but at the precise spot in the formula structure where A had a p , A has a t or f ( p ) . As we said in (a) above, we may think that this is a "virtual" ρ of A with the assigned value p . 33
33
13
33
3 3
(d) Having noted that A is a tautology as a Boolean formula of the metatheory that is built from metamathematical Boolean constants, prime subformulae, brackets, and connectives, it follows that its truth value under the computation described in (c) is independent—and equal to t—of what values one might choose to assign to its prime subformulae. Thus it is also independent of the intrinsic, computed value of said subformulae. 33
This concludes the case for (1) above. Valid Axioms 2: Ax2. (Vx)A —• A[x := t] is universally valid. Indeed, given D, and fixing Α , χ , ί , we have that ((Vx)A according to 8.1.2,
A[x := <])
is,
(1)
204
FIRSTORDER SEMANTICS—VERY NAIVELY
The trickiest part to agree on is that the part (A[x :=
of (1)
is Λχ[χ := t ] (cf. also 8.1.4). Indeed, we start with v
A:
...\x]...\xl...
where, for the sake of visualization and without loss of generality, I show two free occurrences of χ (actually I may have zero or more). Then we get A[x:=t]:
...;/..·[/]...
(2)
and, applying 8.1.2, we get (A[x:=t\)
:
(...) @(...)»@(...)» B
0)
But (3) is what becomes of
(...)»[x](...)»H(...)» i.e., A®, after we apply the substitution "[x := t }"\ v
With this out of the way, we readily see that (1) is true (t): So, assume the lefthand side of —• in (1), that is, that Af is true for all i e D. But then Af is true when i — i in particular. 25
Valid Axioms 3: Ax3 and Ax4. I do not have anything to add to the discussion in 4.2.2. Valid Axioms 4: Ax5. χ = χ is interpreted as "x° = x " in any 33, as we have just discussed. And this is true, no matter what the χ and 33. 3 5
Clearly, the first "= " is formal, while the second is metamathematical. Valid Axioms 5: Ax6. t — s —• (A\x := t] = A[x := s]) is universally valid. Indeed, let us fix t, s, A, χ and look at the 33interpretation of this formula for some arbitrary 33. As in the argument for Ax2, we want to find that the computed truth value of (4) is t. t»=
D e
^ ( A ? [ x : = t » ] = A?[x :=«»])
(4)
So let t = s in D. Let us set i = t . But then each of j4j[x := t ] and Λχ[χ := s ] are the same formula of the metatheory: Af. Trivially, Af = Af is true. • v
v
v
v
v
We now have: 8.2.3 Metatheorem. (Soundness in FirstOrder Logic) IfhA,
then \= A.
Proof. We argue this for the equivalent logic 2 of Chapter 5. This simplifies the argument due to the presence of a single primitive rule of inference, MP, in that logic.
SOUNDNESS IN PREDICATE LOGIC
205
As in the proof of 3.1.3, we do induction on the length of (absolute) proofs that contain A, and prove that (= A; that is, for every D we have Α = t. Basis. A appears in a proof of length 1. But then A is the only formula in the proof, and hence is in Λι. We are done by 8.2.2. Ώ
As an I.H. we assume the claim for proofs of lengths < n, which contain A. For the induction step, let A appear in an absolute proof of length η + 1 . We have two cases: (1) A was written for the first time before the last step. Then, in view of 4.2.9 and the I.H., we are done. (2) A was written for the first time in the last step. If it is in Λι, then the case has already been argued in the Basis step. So let instead A be derived by MP, that is, for some B, the formulae Β and Β —» A have already appeared in the proof. Now pick any 3D. By the I.H. we have B
v
= t
(*)
and (B > A ) = t, i.e., s
B
v
 A
=t
v
By the truth table for >, (*) and (**) yield A
v
(**)
= t.
•
We have already remarked that in predicate logic "if I A, then \=
Uut
A" is false.
8.2.4 Metatheorem. (Godel's Completeness Theorem) If (= A, then h A. A proof is presented in the Appendix of Part II. Soundness, just as in the case of prepositional calculus, serves the purpose of obtaining counterexamples—in firstorder logic these are called countermodels. Thus, if for some formula A we do not believe that h A, we need only to show that Y= A, that is, to find an interpretation X)—a countermodel—where ψτ. A, i.e., A = f. v
8.2.5 Example. Question:
Can our logic derive the "rule" Ifj?h A, then Γ h (Vx)A
without a condition on x ? Well, if it could derive the above, it could also derive strong generalization below, by setting Γ = {A}. 120
A h (Vx)A
(1)
Why not? Because (1) would yield via the deduction theorem
h A —> (Vx)A l20
Then Ah
A: hence A h (Vx)A.
(2)
206
FIRSTORDER SEMANTICS—VERY NAIVELY
By soundness, (2) yields \= A
(Vx)yt
(3)
Now, (3) is a statement schema. It is supposed to hold—if we think that (1) is all right—for no matter what particular formula we may use for A and no matter what variable for x. Well, then, (3) should hold when we choose A to be "x = y" and χ to be "x". However, as we saw in Example 8.1.7(2) (cf. Definition 8.2.1) ty= χ = y —> (\/x)x = y so (2) is no good, and (1) does not hold in our logic.
•
8.2.6 Example. Knowing that strong generalization is illegal in our logic we can show that certain other suggested "rules" are impossible (underivable) by "reducing strong generalization to them", that is, by saying: 121
If I could have this rule, then I could also do (derive) strong generalization, but this is impossible. For example, we cannot derive A = Β h (Vx)(C[p := A] —> D) = (Vx)(C[p := B] » D)
(1)
because it yields the unprovable (in our logic) A h (Vx)A
(2)
Hence (1) is unprovable too, lest we want a contradiction. Here is the calculation that shows that (1) derives (2): Hypothesis is A: (Vx)A <=> (6.1.11 and \=
aM
X =
( V x ) ( ^ p ) [ p :=
1)
A]>1)
THIS IS >A
Φ> ((1) and A h A = T) ( V x ) ( ^ p ) [ p :=
T]^±)
THIS IS  < T
Φ> (drop V, by \~ Χ Ξ Ξ (Vy)X when X has no free y)
.T — ± The last formula is a tautology, and hence a theorem. Thus, the first line is a theorem from A as the assumption used (middle <=>) was A. 1 2 1
We have to say "in our logic". In the logic of [35.45,53], A h ( ν χ ) Λ is perfectly legal.
SOUNDNESS IN PREDICATE LOGIC
207
In the same manner one shows that "8.12b" ((1) is "8.12a" of [17]) is not strong, i.e., the following is not valid (cf. Section 6.3). D^(A
= B)h (Vx)(D » C[p := A}) = (Vx)(D » C[p := B])
8.2.7 Exercise. Show that the "rule 8.12b" above is not valid in our logic.
• •
8.2.8 Exercise. Given a formula A over a firstorder language and an interpretation D of the language, we saw that ((Vx)A) is (Vx € D)A°. v
Show that {(3x)A)
V
is (3x €
D)Ag.
Hint. Recall that (Vx e £>)Λ is short for (Vx) ((x e D) > A) and (3x e £>)Λ is short for (3x) ((x e £>) Λ A). • 8.2.9 Example. Why do we insist on choosing a nonempty domain D in an interpretation 25? Take any formula A. Clearly (Vx)A —> (3X)J4 is false when interpreted on an empty domain D. Why? "(Vx g D)A®" is true, since there are no χ values in D to use toward a counterexample. On the other hand, "(3x e β ) Λ χ " is false, for it says "there exists an χ value that verifies A®", but there are no values in D to choose from. "Big deal", you say. Why should we worry about that? Because it also happens that
h (VxM
(3χ)Λ
(1)
If we allow empty domains D, the above argument shows
ψ {Vx)A — (3x)A contradicting soundness, something we will not allow!
•
8.2.10 Exercise. Prove (1).
•
8.2.11 Exercise. Prove that (Vy)(3x)>l —» (3x)(Vy)>l is not a theorem schema. That is, show that there is a choice of A, x, y such that \f (Vy) (3x)^4 —> (3x) (Vy) A By the techniques of this chapter (specifically, using soundness) you have to do this: Find an appropriate A so that ψ (Vy)(3x)A —» (3x)(Vy)A Hint. Take A to be y < χ (< is a nonlogical symbol, of course). Now interpret: Take D = Ν interpreting < as the "less than" relation on N. • 8.2.12 Exercise. This was promised on p. 184. Prove that (3x)^4 Λ (3x)B —> (3χ)(Λ Λ Β) is not a theorem schema. That is, show that there is a choice of A, χ and Β such that \f (3χ)Λ Λ (3x)B + (3χ)(Λ Λ Β). Once again, by the techniques of this chapter (soundness) you have to do this: Find appropriate A and Β so that ψ (3χ)Λ Λ (3x)J3 » (3χ)(Λ Λ Β).
FIRSTORDER SEMANTICS—VERY NAIVELY
208
Hint. Take A and Β to be atomic formulae (x) and φ(τί) respectively, where φ, φ are predicates of arity 1. Next interpret: Take D = Ν and let φ (χ) be "the number χ is even" and φ (χ) be "the number χ is odd". • ν
8.3
ν
ADDITIONAL E X E R C I S E S
1. Axiom 3 implies (4.2.7) that no matter for which choice of A and x, we have h (Vx)(A > B)
(Vx)A > (Vx)B
Prove by an appropriate countermodel argument that the converse ((Vx)A + (Vx)B) » (Vx)(A
β)
(1)
is not a universally valid schema. Conclude, with reason (one sentence), that (1) cannot be a theorem schema, either. 2. Is the following schema a derived rule of our logic (that is, of logic 1 or 2)1 A —> Β h A —>
(VX)jB,
provided χ is not free in A
(2)
• If you think that it is, then give a proof in our logic. • If you do not think so, then give a definitive reason as to why—for example, using a concrete interpretation, or by proving the invalid "strong generalization" using (2) as a lemma. 3. Redo Exercise 2, but for the schema A —» Β h (3x)A —• B, provided χ is not free in Β 4. Would your answer change in Exercise 3 if to the left of h we had (Vx) (A —» B) instead? 5. Is the following schema a derived rule of our logic (that is, of logic 1 or 2)? A > Β h (Vx)A > (Vx)J3
(3)
• If you think that it is, then give a proof in our logic. • If you do not think so, then give a definitive reason as to why—for example, using a concrete interpretation, or by proving the invalid strong generalization from (3). 6. Redo Exercise 5, but for the schema (Vx)(A —* B)Y (Vx)A > (Vx)B
ADDITIONAL EXERCISES
209
instead. 7. Redo Exercise 5, but for the schema (Vx)yl > (Vx)£ h (Vx)(yt > B) instead. 8. Which of the following is a derived rule? • A>Bh
( 3 x ) A ^ (3x)B
• (Vx)(4  . B ) h (3χ)Λ » (3x)B In each case, a positive answer needs proof; a negative answer needs a precise argument in connection with a carefully built countermodel. 9. Formulate and explore whether the relativization of the schema in the second bullet of Exercise 8 is provable in our logic. Give precise reasons (proof or countermodel) whichever way you choose to conjecture. 10. Is this (Vx)(A V B) + (Vx)A V (Vx)B an absolute theorem schema? • If you think, "Yes, it is", then give a proof within our logic. • If you think, "No, it is not", then find specific A and Β and an appropriate interpretation to carefully and completely make your case for "no". 11. Is this
(VX)J4 V
(Vx)B +
(Vx)(.4 V
B) an absolute theorem schema?
• If you think, "Yes, it is", then give a proof within our logic. • If you think, "No, it is not", then find specific A and Β and an appropriate interpretation to carefully and completely make your case for "no". 12. Is this
(3X)(J4 Λ
Β) —> (3x)A
Λ
(3x)B an absolute theorem schema?
• If you think, "Yes, it is", then give a proof within our logic. • If you think, "No, it is not", then find specific A and Β and an appropriate interpretation to carefully and completely make your case for "no". 13. Consider the proof below:
(1) (2) (3) (4)
(hypothesis)
{3κ) A A[x:=z]
(auxiliary hypothesis associated with (1); ζ fresh)
(Vz)A[x: (VxM
((3) plus dummy renaming plus Eqn)
((2) plus generalization; (1) has no free z)
By the deduction theorem we have h (3x) A —* (Vx) A You have two tasks:
210
FIRSTORDER SEMANTICS—VERY NAIVELY
(a) Definitively show that (3x)A —> (Vx)A is not an absolute theorem schema. (b) Grade the above "proof'. That is, find exactly where (i.e., at which step) it went wrong—and precisely how. 14. Is the following—on condition that χ is not free in Β—an absolute theorem schema? (Cf. Exercise 26 on p. 189.) (3x) (BvC) A
=
Bw(3x) C A
If yes, then prove it; if no, then provide a carefully constructed countermodel. 15. Is the following—on condition that χ is not free in C—an absolute theorem schema? (Cf. Exercise 27 on p. 189.) (Vx),iB>C=
(3x) (B^C) A
If yes, then prove it; if no,then provide a carefully constructed countermodel.
Appendix A Godel's Theorems and Computability
This appendix develops two cornerstone results of the metatheory of logic, both due to Godel: his completeness and (first) incompleteness theorem. The first is the counterpart of Post's theorem (3.2.1) for firstorder logic and intuitively says that when it comes to the notion of "absolute truth", that is, truth as understood philosophically for the entire edifice of mathematics, then predicate logic speaks "the whole truth". The second came as a shock when first announced ([16]): When it comes to restricted or "relative" truth, that is, the truth of statements (that have no free variables) made in some "powerful" theory such as Peano arithmetic or axiomatic set theory, the formal axiomatic method cannot speak the whole truth. 1
"Powerful" in that these theories can express fairly complicated statements about their behavior. For example, either of them contains a variablefree formula that in essence says "this axiomatic system cannot prove me". 1
Mathematical Logic. By George Tourlakis Copyright © 2008 John Wiley & Sons, Inc.
211
212 A.1
GODEL'S THEOREMS AND COMPUTABILITY
REVISITING TARSKI SEMANTICS
This section looks more carefully at Tarski semantics, which were introduced in 8.1. The extra care is needed so that we can now give a rigorous definition of absolute truth that can be mathematically discussed and manipulated toward proving, as Godel originally did ([15]), that predicate logic is complete, that is, every absolutely true formula has a formal proof in our logic—i.e., the calculus captures the whole truth. The semantics, just as we did in 8.1, will be shaped within an interpretation 3D = (D, M), where as before D will be a nonempty set and Μ a translator of symbols. As we recall from 8.1.2, the goal in assigning semantics to an abstract formula A was to translate it into a "concrete" mathematical statement A with the ultimate goal of "computing" the latter's truth value, something that we can in principle do by putting our "knowledge of mathematics" to work. Since the process eliminates all free variables by replacing any free variable χ by a value x from D (cf. 8.1.2), this truth value is unambiguously obtained. The rigorous definition of Tarski semantics, as was already noted in the remark (2) that followed Definition 8.1.2, bypasses this translation into a concrete formula, thus avoiding the implication—which we cannot make mathematically precise!—that "we know enough mathematics" to evaluate the resulting concrete formula as to its truth. The definition is thus impersonal and instead defines truth of any formula A over a firstorder language directly and from first principles, as long as we have chosen a translation of the language in the style of 8.1.1. 33
3 3
The reader should note that in this section the meaning of the symbol A (or M( A)) has changed: It now denotes a member of { t , f } rather than a metamathematical formula (see Exercises A.l .7 and A.l .8). 33
Central to the definition will be our ability to "replace any free χ by x " , but we need to do such substitutions without exiting into the metamathematical realm, since we are not building a "(meta)mathematical formula" this time around. 33
Pause. But how can we effect such substitutions? As soon as a formal object like χ in A is replaced by a metamathematical object x from D, the resulting string will not be a wellformed formula anymore: x is not even in the acceptable alphabet! 3 3
3 3
A trick that originated with Leon Henkin and Abraham Robinson bypasses the abovementioned difficulty: Just augment the chosen firstorder alphabet (cf. 4.1.2) to include (names of) objects from the domain D that we have in mind! Thus, as in 8.1, we start by fixing a firstorder language L. By the way, it focuses the mind if we think of the language as the triple of "ingredients "(V, Term, WFF)— where V denotes the chosen firstorder alphabet—just as we view an interpretation as a pair of ingredients, D and Μ (cf. 8.1). In step two, we choose an interpretation 3D = (D, M) for our language L. In step three, the last preparatory step prior to giving the definitive version of Definition 8.1.1 below, we import the names of all the members of D to the alphabet V as (names of) new constants. It is intended that these new constants will be translated—by M, to be reintroduced in A.l .5 below—as
REVISITING TARSKI SEMANTICS
213
themselves; i.e., if i is such a new imported constant from D, its meaning under the interpretation will be i. I use the same name, say "i", for a given object of D, both metamathematically and formally (e.g., the name for the object "three", if this constant is imported, will be " 3 " both formally and informally). A.l.l Definition. For any nonempty set D, the firstorder alphabet obtained by importing the members of D as new constants is denoted by V(D). That is, V(D) = V U D. We will use the terminology "Dformulae" and "Dterms" for formulae and terms of the original language L, where some free variables have been replaced by D values. • It is an easy exercise to establish that this is tantamount to saying: A.1.2 Definition. Given a nonempty set D, a Dformula and ΰterm are a formula and term over the alphabet V{D), respectively. The set of all Dformulae and Dterms will be denoted by WFF(D) and Term(D) respectively. The augmented language is L(D) = (V(D), Term(£>), WFF(D)). • A.1.3 Exercise. Fix a language L and a nonempty set D. Then Term C Term(Z?) and WFF C WFF(D). • A.1.4 Exercise. Fix a language L and a nonempty set D. Then all Dterms and all the £>formulae according to Definition A. 1.2 can be obtained by repeated application of substitutions such as t[x := i] and A[x := i] where both t and A are over the original alphabet V, and i e f l . • A.1.5 Definition. (Tarski Semantics—Step 1: Translating the Alphabet) Given a firstorder language L = (V, Term, WFF). An interpretation 33 = (D,M) appropriate for L (or just "for L") is a pair where D is a nonempty set and Μ is a "translator" or "interpretation mapping" that assigns concrete meaning to the symbols in V(D). We will often denote the result of the translation "M(...)" as ".. P". (1) For each free variable x, xP—i.e., the translation M(x)—is some member of D. (2) For each Boolean variable p , p (3)
τ
ν
= t and ±
v
3 5
is some member of {t, f } .
= f.
(4) For each object constant c in V, its translation (P is some member of D. (5) For each object constant i in D, its translation i° is i itself. The letters i, j , k, m, η will name constants imported from D, utilizing primes or subscripts if necessary.
214
GODEL'S THEOREMS AND COMPUTABILITY
(6) For each function / of the language L, the translation f is a mathematical function of the metatheory with the same arity as the formal / . Z takes its inputs from D and has its output values in D. v
33
(7) For each predicate φ of the language L, the translation φ is a relation of the same arity as φ that takes its inputs from D and has its output values in {t, f}. • Ώ
We next extend Μ so as to give metamathematical meaning—and by "meaning" I mean a concrete value from DU {t, f }, not an "intermediate" mathematical formula— to arbitrary Dterms and to arbitrary Dformulae. By A.l .3, this extension will also give meaning to terms and formulae of L. The reader may want to briefly glimpse at Definition 1.3.5, where the "meaning function" ν was extended to be meaningful not only on atomic but on all Boolean formulae. We noted there (immediately prior to the definition) that the extension is different from the original and thus some logicians would prefer a different symbol for it, say, v. We decided against this as it clutters notation and the context can readily fend off any ambiguity. For the same reason we should be content with using the same symbol, M, for both the original mapping of the symbols of the alphabet V(D) into concrete ones and the mapping that maps terms and formulae into their values. A.1.6 Definition. (Tarski Semantics—Step 2: Extending Μ to all of L(D)) Let 3) = (D, M) be an interpretation for L. We extend Μ to all Dterms and Dformulae—still calling it Μ—as follows: Dterms: We define M(t)—i.e., i —for each 33term t: 33
(i) If t is an object variable, or a constant symbol of V(D), then Μ is as in A. 1.5. (ii) If ί is f{ti,...,t ) Dterms, then i
where / is any nary function symbol a n d t i , . . . , t
n
n
are
= / (if,..., i )
3 3
D
3 3
Dformulae: By induction on the complexity (cf. 4.1.15) of such formulae A we define A : 33
I. If A is the Boolean constant _1_ or Τ or a Boolean variable p , then A defined in A. 1.5.
33
has been
II. For any Dterms t and s, (t = s ) = t iff i = s , where only the leftmost occurrence of " = " here is formal (i.e., the one in V); the others are metamathematical. 33
33
33
III. For any Dterms ί ι , . . . , t and nary predicate symbol φ, n
(0(i ,...,i )) =tiff^ (if,...,i ) =t. S
1
3 3
3 3
n
Assuming that we have defined Μ for all Dformulae Β that are less complex than A, we next define M(A) using the notation in 1.3.4: IV. If A is ·Β, then A
33
= F^B ). 33
215
REVISITING TARSKI SEMANTICS
V. If A is Β ο C—where ο is any of Λ, V, —>, Ξ—then A
= F
v
{Β ,Ο ). Ώ
a
ν
VI. If A i s ( V x ) B , t h e n > l ' = tiff for alii £ D we have M ( B [ x := i]) = t. 1
•
Pause. Why not define the extension of Μ over all of L(D) by induction on Dformulae A, therefore assuming the definition as given for the immediate predecessors of Al Because B[x := i\ is not an i.p. of (Vx)B. This is why we resorted to doing the recursive definition with respect to the complexity of formulae instead. A.1.7 Exercise. Given a language L and an interpretation 3D = (D, M) for it, let t be a ZDterm. By induction on the complexity of t show that t 6 D, • v
A.1.8 Exercise. Given a language L and an interpretation 3D = (D, M) for it. Let A be a ZDformula. By induction on the complexity of A show that A 6 {t, f } . • v
A.1.9 Definition. (Truth and Models) Let 3D = (ZD, M) be a interpretation for L, and A be a Dformula. We say "A is true (false) in 3D" iff A = t (f). // in particular A is over L—i.e., it contains no constants imported from D—then we say "3D is a model of A"—and we write (=D A—iff Α = t. If Σ C WFF, then we say "3D is a model of Σ" and write "\= Σ", iff ( = A for each A € Σ. We say that "Σ is satisfiable" iff it has a model. When Σ U {A} C WFF, the notation Σ \= A denotes semantic implication, also called logical implication. It means: "Every model of Σ is a model of A." We write )= A for 0 j= A. Since every interpretation is, vacuously, a model of 0, "0 f= A" amounts to saying that every interpretation (appropriate for the language of A) is a model of A. We say then that "A is logically valid", universally valid, or just valid. • v
Ώ
v
Β
The following lemmata will make the flow of exposition in the proof of the soundness metatheorem smoother. A.1.10 Lemma. Let 3D = (D, M) be an interpretation for L and tbea Dterm that contains no s.. Consider anew interpretation's' = (D', M') where D = D' and M' agrees with Μ everywhere, except possibly at the variable x. Then M(t) = M'(t). This last "=" is, of course, on D. Proof See the exercise below.
•
A . l . l l Exercise. Prove A.1.10 by induction on the complexity of terms.
•
For the benefit of the following lemma we revisit Definition 4.1.21 with an inductive definition of "free (bound) variable". A.1.12 Definition. (Free and Bound Variables) The case of terms: The concept "x is free in t" for terms coincides with the concept "x occurs in t". Namely, if t is x, then χ is free in t. If t is a constant or a
216
GODEL'S THEOREMS AND COMPUTABILITY
y Φ χ, then χ is not free in t. If t is f(t ,...,t ), at least one of the t;. The case of formulae: x
n
then χ is free in ί iff it is free in
Atomic case: (1) χ is not free in any of ± , T, p. (2) χ is free in t = s iff it is so in at least one of t or s. (3) χ is free in φ(ί\,...,
t ) iff it is so in at least one of the tj. n
Nonatomic case: (i) χ is free in  A iff it is so in A. (ii) χ is free in Α ο Β—where ο is one of Λ, V, —>, ΞΞ— iff it is so in at least one of A and B. (iii) χ is free in (Vy) A iff it is free in A and it is not the same as y. A variable that occurs in a formula A, yet is not free, is called bound in A.
•
Thus, in case (iii) above, χ is not free in (Vy)A in precisely two (not mutually exclusive) cases: χ is not free in A, or χ = y. Notwithstanding the fact that the Tarski semantics of a formula are the truth values t or f—not a "concrete" metamathematical formula—nevertheless, the above definition allows us to "translate" a firstorder formula with free variables into a concrete formula with the same number offree variables and vice versa. We present the process that achieves this as a definition (A. 1.14) below, but first we will introduce the notation "x ". n
A.l.13Definition. The symbol x denotes the ordered sequence x\,x , • • • ,x We will simply write χ when the length η is either understood or is unimportant to our discussion. We call x an "ηtuple" or an "nvector". • n
2
n
n
A.1.14 Definition. Let L be a firstorder language and 2) = (D, Μ) an interpretation appropriate for L. A set S of ηtuples from D (synonymously, relation S(x )) is firstorder definable in 23 over L—simply put "definable in 2)" if the language is understood—iff for some formula A of the language L that has x i , . . . , x as its free variables, we have, for all rrij in D (j = 1,..., n): n
n
;
5 ( 7 η ι , . . . , "in) iff  = s Λ [ ι = mi] • · · [x„ := m„] 2
χ
:
It is usual to write "A \t\,..., t ] " for "Α[χχ := t\] • • • [x„ := t ]" and any terms U as long as it is understood that the substituted variables are the χ,. A n
2
"Is true" is always implied in informal mathematics when a relation "S(mi,...,
n
m )" n
is stated.
REVISITING TARSKI SEMANTICS
217
function / with inputs from D and outputs in D is definable in D iff the relation V — f[xi, • • • ,Xn)—known as the graph of /—is so definable. Some authors use the term "(firstorder) expressible" (e.g., [48]) rather than "(firstorder) definable" in an interpretation 3D. • The above definition gives precision to statements such as "we code (or express) an informal statement (i.e., relation) S(xi,...,x ) into the formal language" or that "the (informal) statement S(x\,..., x ) can be written (or made) in the formal language". What makes the statement in the formal language is a firstorder formula A that defines it in the sense of A.1.14. n
n
Conversely, any firstorder formula B, of η free variables, over a language L defines (in 3D) the set of ntuples {(*!,...,*:„) Φ »
BI*!,.
. . , * „ ! }
If we call the above set (relation) R, then we can state that the formula Β informally says "R(xi,..., x )" in the sense that, for all fcj in D, R(ki,..., k ) holds iff ho B\k ...,k \. n
u
n
n
We next prove a few lemmata that lead to the proof of the soundness metatheorem. A.1.15 Lemma. Let 3D = (D, M) be an interpretation for L and A be a Dformula that contains no free occurrences ofx. Consider a new interpretation 3)' = (D',M') where D = D' and M' agrees with Μ everywhere, except possibly at the variable x. Then Μ (A) = M'{A). This last "=" is, of course, on { t , f } . Proof. By induction on the complexity of formulae, mindful of Definitions A. 1.6 and A.1.12. We note at the outset that according to the hypothesis, Μ(· · ·) = Μ'(· · ·) for every symbol "· · · " of the alphabet V(D) except, possibly, x. Atomic case: (1) The Dformula A is one of ρ, T, _L. Then Μ (A) =
M'(A).
(2) A is t = s. Thus M(t = s) = t i f f M ( < ) = M(s) iff M'(t) = Af'(s) by A.1.10 iff M'\t = s) = t by A. 1.6 (3) A is ψ{ίι,.. .,t ). n
Μ(φ(ί ,...,ί )) 1
η
Thus, noting that Μ (φ) =
= t iff Μ(0) ( Μ ( ί , ) , . . . , Μ ( ί ) ) = t ιίίΜ'(φ)(Μ'(ί ),..., Μ'(ί„)) = t by A.1.10 iffM'(0(ii,...,i )) = t byA.1.6 η
ι
n
Nonatomic case:
Μ'(φ),
218
GODEL'S THEOREMS AND COMPUTABILITY
(i) A is  i f l . The I.H. applies to Β and yields M(B) = M'(B) by A.1.12(i). We are done by A. 1,6(IV). (ii) A is Β ο C. The I.H. applies to Β and C and yields M(B) = M'(B) by A. 1.12(ii). We are done by A. 1.6(V). (iii) A is (Vy)B. The I.H. applies to B[y := i], for every i 6 D, since χ is not free in this Dformula (cf. comment immediately following A. 1.12). Thus, we have M(B[y := i}) = M'(B[y := i}), for all i € D. By (VI) of A. 1.6 the above yields M((Vy)B) = M'((Vy)B). • A.1.16 Lemma. Let 33 = (D, M) be an interpretation for L, t be a Dterm, and i e D. Consider a new interpretation 33' = (D', Μ') where D = D' and M' agrees with Μ everywhere, except possibly at the variable χ: M' sets M'(x) = i. Then M(i[x := i\) = M'(t). Proof. By induction on the complexity of the term t. (1) t is x. Then M(t[x := i]) = M(i) = i (cf. A.1.5), while M'{t) = M'(x) = i. (2) ί is y (not x), or is c or is k 6 D. Then (cf. A.1.5)
Μ(ί[χ:=ζ])=Μ(ί)
(3)
M(y) M(c) M(k)
thus, the same as M'(y) thus, the same as Μ'(c) i.e., fc, thus, the same as M'(k)
t i s / ( < ] , . . . , < „ ) . Thus (cf. 4.1.28 and A. 1.6)
M(i[x := <]) = M ( / ) ( M ( t [ x := i ] ) , . . . , M ( i [ x := i])) x
n
= Μ(/)(Μ'(ί,),...,Μ'(ί„))
by I.H.
= M ' ( / ) ( Μ ' ( ί ι ) , . . . , M'(t ))
Μ and M ' agree on /
n
= M'(i)
•
A.l.17 Lemma. Given a term t, distinct variables χ and y, where y does not occur in t, and a constant a, then, for any term s and formula A, s[x := t][y :— a\ is the same as s[y := a][x := t] and A[x := t][y := a] is the same as A[y := a][x := t]. Proof. By induction on the complexity of t (done first) and A. Exercise A.l.18 asks you to fill in the details of the proof. • A.l.18 Exercise. Prove Lemma A. 1.17.
•
A.1.19 Lemma. Let 33 = (D, M) be an interpretation for L, Abe a Dformula, and i e D. Consider a new interpretation 33' = (D', Μ') where D = D' and M' agrees with Μ everywhere, except possibly at the variable χ: M' sets M'(x) = i. Then M ( A [ x : = i]) = M'(A).
REVISITING TARSKI SEMANTICS
219
Proof. By induction on the complexity of formula A. (1) A is one of ρ, ± , T, (Vx)B. Then (cf. 4.1.28, A.1.6, and A.l.15)
M(A[x := i]) = Μ (A) =
M(p) M(±) M(T) [M((Vx)B)
this is M'(p) this is M'(_L) thisisM'(T) this is M'((Vx)B) (by A.l.15)
(2) A is ί = s. Now M(A[x := i ] ) = t iff M ( i [ x := i]) = M(s[x := By A.l.16 the latter is true iff M'(t) = M'(s), i.e., iff M'(t = s) = t.
t]).
(3) A is 0 ( t i , . . . , * „ ) . Μ((fi,...,ί„)(χ := i]) = t iff M ( 0 ) ( M ( [ x := i}),...,M(t [x := i])) = t. By A.l.16 and Μ (φ) = Μ'(φ) the latter is true iff Μ'(ψ) ( Μ ' ( ί ι ) , . . . , M'{t )) = t, i.e., iff Μ' (φ[Ι t )) = t. t ]
n
n
χ n
Nonatomic case: (i) A is ^ B . By I.H. M{B{x := i]) = Μ'(B) and we are done by A.1.6(IV). (ii) A is Β ο C. By I.H. M(B[x := i\) = Μ'(B) and M(C[x := t]) = We are done by A.1.6(V).
M'(C).
(iii) A is (Vy)B and ((Vy)B)[x := i] is (Vy)B[x := i}; the substitution being defined (cf. 4.1.28). Thus M((Vy)B[x := i]) = t iff M(B[x := i][y :=k}) = t, for all ke D
(*)
By Lemma A. 1.17, (*) is equivalent to M ( B [ y := k)[x := i]) = t, for all Jfe € D and hence, by the I.H., to M ' ( B [ y := k]) = t, for all k £ D By A.1.6(VI), (**) is equivalent to M'((Vy)B) = t.
(**) •
We will need one final lemma, to ease the handling of axiom groups Ax2 and Ax6 in the proof of A. 1.21 below. This lemma embodies a mathematically rigorous formulation, and proof, of the remark made in 8.2.2 on p. 203: "The trickiest part to agree on is that the part (A[x := of (1) is A j [ x := i ] . . . " In the present notation, we want to show that M(A[x := M(t)j) = M(A[x := t}). More pleasing intuitively is the notation introduced in Definition A. 1.14: M(A\M(t)]) = M{A[t]). 33
220
GODEL'S THEOREMS AND COMPUTABILITY
A. 1.20 Lemma. Let Ό = (D, M) be an interpretation for a language L and s, t, and A be Dterms and a Dformula respectively, while M(i) = i. Then M(s[x := t\) = M(s[x := i])andM(A[x := t}) = M(A[x := i}). Proof. Wefirstdo induction on the complexity of s. If s is a constant or y ( y φ χ), then both s[x := t] and s[x := i] are just s. Thus, M(s[x := t\) = M(s) = M(s[x := i]). If s is x, then s[x := t] is t while and s[x := i] is i. Thus, M(s[x := t]) = M{t) = i = M{i) = M(s[x := For the induction step let s be f(t ι , . . . , t„). Then M(s[x := i]) = Μ ( / ) ( Μ ( ί ι [ χ := <]),... , M ( i „ [ x := t])). By the I.H. this is M ( / ) ( M ( i ! [ x := i}),..., M(t [x := i})); that is, M(s[x := i}). We next do an induction on the complexity of A. For the atomic case, the subcases where A is one of Τ , ρ are trivial. If on the other hand A is <j>(t\,...,t ), then M(A{x • t]) = Μ{φ){Μ{ίχ\χ := t]),...,M(t [x • <])). By the case for terms, this is Μ{φ)(Μ(ί [χ := i]),...,M(t [x := i})); that is, Μ(φ[χ := i}). Similarly if A is t = s. The induction step in the case of Boolean connectives being straightforward, let us do the induction step just in the case where A is (Vw)B. If w is the same as x, then the result is trivial. As usual, we assume that the noted substitutions are defined, otherwise there is nothing to prove. This entails, in particular, that either w does not occur in t (the interesting case) or that χ is not free in Β—this being the trivial case where both substitutions produce the same formula, (Vw)B (cf. 4.1.28 and 4.1.33). We display the interesting case. n
n
n
χ
n
M(A[x := t}) = tiff
M(((VW)J9)[X
:= f.]) = t
iff M ( ( ( V w ) B [ x : = i])) = t iff M(B[x := £][w := j}) = t for all j € D, by A. 1.6 iff M(B[w := j}[x := <]) = t for all j e A by A. 1.17 iff M ( ( B [ w := j])[x := <]) = t for all j e D iff Af((B[w := j])[x := i]) = t f o r a l l j € D, by I.H. iff M(B[w := j][x := i}) = t for all j e D iff M(B\x •
:=j\) = t for all j e D, by A.1.17
iff M(((Vw)B[x : = i ] ) ) = t b y A . 1 . 6 iff Af(((Vw)B)[x : = i ] ) = t iff M(A[x:=i\)
=t
•
We are ready to revisit soundness within the definition of Tarski semantics. "Our logic" will here be "logic 2" of Chapter 5.
REVISITING TARSKI SEMANTICS
221
A.1.21 Metatheorem. (Soundness in FirstOrder Logic) Let Σ be any theory over a language L and let A be a formula of L. Then Σ h A implies Σ = A. Proof Assume Σ h A. Then we have one of the three cases: (i) A G Σ (trivial). (ii) A is derived using MP. (iii) A e Λι. Toward case (ii) we show that the rule MP preserves truth. Let then 53 be an arbitrary model of Σ, and Β satisfy B = t and (B * A ) ° = t. Thus A = t by Definition A. 1.6, parts (IV) and (V). z
v
Most of the work is for case (iii), and we might as well prove a bit more, namely, that = A. The main effort here is to show that each instance A of the schemata in A x l Ax6 of Definition 4.2.1, as they appear in the list—i.e., prior to prefixing universal quantifiers to form a partial generalization—satisfies f= A. However, we postpone this task until after we show that prefixing universal quantifiers preserves truth. All this completes the argument. Generalization preserves truth; that is, if (= A, then \= (Vx)A. This translates as "if M(A) = t in every interpretation 33 = (£>, M), then also M((Vx)A) = t in every interpretation 33 = (D, M)". Well, suppose instead that \=A
(*)
yet, for some interpretation 33 = (D, M) we have M((Vx)A) = f. By A. 1.6, this says that for some i € D, we have M(A[x:=i]) = f
(**)
Choose now a new interpretation, 33' = (D',M') where D = D' and Μ = M' agree everywhere on the alphabet of L, except possibly at χ where M'(x) = i. By Lemma A. 1.19, we have M{A{x.:=i]) = M'{A) (* * *) But M'(A) = t by (*), which contradicts (**). We return to case (iii). Case of Axl:  = , A. We pick an arbitrary 33 = (D, M) and show that Μ (A) = t. Let p i , . . . , p be all the propositional variables that occur in A— including under prepositional variables both those that are from the alphabet V of L and those that are actually prime subformulae. Define a state υ by setting u(pj) = Μ(ρ^), for i = 1,..., n. By induction on au
n
3
3
Prime subformulae were defined in 4.1.25.
222
GODEL'S THEOREMS AND COMPUTABILITY
the complexity of "Pformulae"—cf. Exercise 4 on p. 149—we show that v(A) = M(A) for each Pformula A (i.e., for each A e WFF). The basis is settled at once by the way ν was defined and since, by the definition of state, and A.l .5, ν and Μ agree on T, Let then A be .B. By I.H. it is v{B) = M(B). Thus, by 1.3.5 (first "=") and A.1.6(IV) (last "=") we have «(>B). = F^(v(B)) = F^(M{B)) = M(iB). If finally A is Β ο C (where ο is as before), then the I.H. yields v(B) = M(B) and v(C) = M(C). Thus, by 1.3.5 (first "=") and A.1.6(V) (last "=") we have v{B ο C) = F (v(B), v(C)) = F (M(B), M{C)) = M ( B ο C). a
0
Now, the assumption yields v(A) = t. By the preceding result, we have M(A) = t. Case of Ax2: A is (Vx)B >· B[x := t]. We pick an arbitrary 3) = (D,M) and show that Μ (A) = t. As M(A) = F_^(M((Vx)B), M ( B [ x := t])) we need establish that if M((Vx)B) = t, then M ( B [ x := t]) = t. Well, the hypothesis yields (cf. A.1.6(VI))thatM(B[x := i}) = t.for alii e D. In particular, M ( B [ x := M(i)]) = t. Hence M ( B [ x := i]) = t by A.l.20. Case of Ax3: A is (Vx)(B » C) > (Vx)B — (Vx)C. We pick an arbitrary Ί) = (D, M) and show that Μ (A) = t. Thus, by the truth table forF_ (1.3.4) I assume M((Vx)(B > C)) = t and M((Vx)B) = t and prove M((Vx)C) = t. The assumptions mean B[x := i] » C7[x := i] = t, for a\\ i e D B[x := i] = t,foralH e D
(*)
(**)
hence C[x := i] = t, for all i € ZD, and we are done (A.l .6(VI)). Case of Ax4: A is Β —> (Vx)B, where χ is not free in B. As before, we work with an arbitrary 35 = (D, M) and show that Μ (A) = t. So assume M ( B ) = t and check whether Μ((Vx)B) = t. The latter will be so precisely if Μ (B[x := i]) = t, foralH € Ζλ But, by the assumption on x, B[x := i] is just Β (cf. 4.1.33). Case of Ax5: We want x = x (cf. A. 1.6(H)) for any 2). This is immediate as "i = i" holds in the metatheory. 33
33
Case of Ax6: A is t  s —> (A[x := i] = A[x := s]). So, pick an arbitrary 33 = (D,M) and assume M(t = a) = t, that is, M(i) = M(s). We want M(A[x := t] = Λ[χ := β]) = t, that is (cf. F= in 1.3.4), M(A[x := i]) = M(A{x := a]). By A.1.20 that last equality is equivalent to M(A{x := M(t)\) = M(A[x := M(s)}) and thus holds. •
COMPLETENESS
223
Α. 1.22 Exercise. Prove that if a set of formulae Γ has a model (cf. A.l .9), then it is consistent. •
A.2
COMPLETENESS
For ages mathematicians were content with arguing informally as they were building the edifice that is mathematics, until they encountered the various paradoxes that an undisciplined informal approach entails, such as Russell's paradox. This led to a movement, major proponents of which were Whitehead and Russell ([56]), Hubert ([22]), and Bourbaki ([2]), that advocated the construction, using the techniques of mathematics, of a robust "engine" with the help of which mathematicians could prove their various theorems within rigid, finitary processes (formal proofs), and with absolutely clear rules of reasoning and selection of assumptions. This "engine" is, of course, firstorder logic. By "robustness" I refer to the inherent inability of this logic to derive contradictions. By "inherent" I mean here that the absolute (nonapplied) firstorder logic—having no nonlogical axioms that can "go wrong"— is contradictionfree: Indeed, Vf ± (cf. also 2.6.6); otherwise, by the soundness metatheorem of the previous section (A. 1.21), we obtain the absurd X = t in every interpretation 33. But how many "truths" can we prove within firstorder logic? Does this logic tell the whole truth? Godel proved that it does—the logic is complete—in this sense: If a formula is true in every model of a chosen set of assumptions (i.e., it is semantically implied by these assumptions; cf. A. 1.9), then it is also provable from these assumptions. In this section we prove Godel's completeness theorem for socalled countable languages L, i.e., languages over countable alphabets (see the discussion under the heading "A brief course on countable sets" on p. 224 below for the definition of countable). The proof given here is not Godel's original ([15]) but is the "modernized" argument due to Leon Henkin ([20]). The strategy for establishing the completeness of our logic, that is, the implication "if Σ = A, then Σ V A", is to prove the equivalent contrapositive: If 35
ΣΓ/Α
(1)
then Σ
ψA
(2)
We will recall that on p. 116 we introduced the concept of an applied firstorder logic or theory. It was stated that a theory is a toolbox consisting of (i) A firstorder language that has a handpicked, specific, set of nonlogical symbols that is appropriate for the intended application (e.g., for set theory we just include the predicate €; nothing else). (ii) Special axioms that give the basic properties of the nonlogical symbols. Intuitively, these state selected fundamental relative truths that characterize the theory.
224
GODEL'S THEOREMS AND COMPUTABILITY
(iii) The logical axioms that are common to all theories. Intuitively, these state absolute truths that are valid in all theories. (iv) Rules of inference. It is standard practice in the literature to take most of these tools for granted and identify a theory with the set of its special axioms Σ, which subsume item (i) above. Thus, a theory is simply any set of formulae, Σ. Any such set, and therefore any theory, is called consistent precisely as we defined in the remark following 2.6.6: if and only if it fails to prove at least one formula; equivalently, if and only if it fails to prove 1. Thus, the contrapositive formulation of the completeness theorem, (1), immediately yields that a consistent theory has a model. To prove that (1) implies (2) we fix a countable firstorder language L and a theory Σ over L that does not prove A, and proceed to construct a model 2) = (D, M) for Σ that is not a model of A (cf. also the approach in the proof of 3.2.1). To make the construction—which has substantial methodological overlap with the one involved in the proof of Post's theorem in Section 3.2—selfcontained, I outline below, with straightforward informal proofs where needed, a number of facts from set theory that we will need. A brief course in countable sets. A set A is countable, if it is empty or (in the opposite case) if there is a way to arrange all its members—possibly with repetitions— in an infinite linear array, in a "row of locations", utilizing one location for each member of N. Since it is allowed to repeatedly list any element of A, even infinitely many times, all finite sets are countable. 4
We can convert a twodimensional enumeration (rot,j)for all i,j in Ν
into a onedimensional (one row) enumeration quite easily. The "linearization" or "unfolding" of the infinite matrix of rows is effected by walking along the arrows as follows:
(0,0)
(1,0) (2,0) (3,0)
/ / /
(0,1) (1,1) (2,1)
/ /
(0,2)
(1,2)
Suppose now that A is a countable set. It is clear that every subset of A is countable: If 0 φ Β C A, then we enumerate the elements of Β as follows: This appendix often refers to sets by name. Much of the time such names are capital Latin letters, A, B, C. unless I refer to a set of formulae (Σ, Δ , Γ). The context will protect us from confusing these A, B, C for formulae.
4
COMPLETENESS
225
Fix a member b S Β that will be used as explained below. We now form two arrays, an auxiliary array and a target array. The latter will contain an enumeration of B. Enumerate A by steps. In each step we produce the next member of A, say a, which we put in the first unused location of the auxiliary array. If α Ε Β, then we also place it in the first unused location of the target array. Otherwise we put b in that location at this step. Another fact that we will need is that if Α Φ 0 is countable, then it also has an enumeration where every element appears infinitely often. Indeed, fix an enumeration «Οι i > 2, • • • of A. Form the infinite matrix whose every row is an, αχ, a ,... and linearize the matrix in the manner we linearized {mij)f » i above. That is, enumerate A as follows: an. a ,ai, an,ai,(22> α , Οχ, θ2, «3, a
a
2
or
3
0
0
υ
Examples of nonempty countable sets are: any finite set; N; the set of all even integers; the set of all integers; the set of all nonnegative rational numbers. Let now A be some countable non empty set (possibly infinite), and fix an enumeration of it, ο , α ι , . . . For example, A might be the alphabet V of a countable firstorder language. The set of all strings of length two over A is the set of all a^aj for i > 0, j > 0, and is linearizable in the manner of ( m * j ) f ail i,j inN That is, the set of all such strings is countable. This extends to strings of any length, as we can see via simple induction. Fix an η > 0 and assume that the set of strings of length η is countable, with an enumeration do, άχ,... But then so is the set of strings of length η + 1, since these are all the strings of the form d j O j , for i > 0, j > 0. But how about the set of all strings over Al This is countable too! Indeed, let o,Q , αχ, o j , . . . be an infinite enumeration of all strings of length η > 0. Then we can enumerate all strings by linearizing the infinite matrix a j , for i > 0, j > 0. Note that the first row, a°, for j > 0, consists of the empty string, e, everywhere. 5
6
0
o r
7
Think of an integer as a pair (n, m), where m € Ν and η = 0 or η = 1. The intention is to have (0, m ) "code" (stand for) m while (1, m) code — m. We know that the set of all (n, m) for η > 0, m > 0 can be linearized just as the matrix above was. The set of all integers is (coded as) a subset of this matrix. Think of such a rational as a pair (n, m), where η G Ν and m € Ν with m φ 0 so that (η, τη) stands for n/m. The set of all (n, m) for η > 0, m > 0 can be linearized just as the matrix above was. The set of the nonnegative rationals is (coded as) a subset of this matrix. 5
6
There is some esoteric small print here: In the proof of the countability of the set of all strings we tacitly used a settheoretical principle known as the axiom of choice. It enables us to make mathematical constructions that involve an infinite set of selections from a set in the absence of a "precise rule" that lets us specify these selections. In our case, out of many possible enumerations for each string length, we chose one,/w each η > 0. Even more esoteric is a result of Feferman and Levy that shows the necessity of the axiom of choice principle if one wants, in general, to show that the union of a countable set— Ap, Αχ, Αϊ, • • •—of countable sets is itself countable ([14]). The said union is denoted by U n > o ^ " and means the set S with an "entrance condition" χ € S that is equivalent to "for some i,x€ Ai'\ That is, S contains all the objects found in all the Ai and nothing else. 7
226
GODEL'S THEOREMS AND COMPUTABILITY
We now turn to the construction of the model we announced prior to our preceding digression into the properties of countable sets. At first we pick an infinite countable set Ν—for example, we can take Ν to be Ν—and fix an enumeration mo, m\, m ,... of N. As usual, WFF(iV) is the set of all iVformulae over L. We note that Σ C WFF(N). We next define an extension Γ of Σ—which simply means a superset of Σ , i.e., Σ C Γ C WFF(JV)). Γ will have a number of key properties that will lead to the Main Lemma (A.2.4). To this end, we fix attention on an enumeration Go, G\, G , • • • of all formulae of WFF(N), and on an enumeration EQ, E\,... of all "existential" formulae among the Gj, that is, those that have the form (3x)B. We assume without loss of generality that each formula E{ occurs infinitely often in the list. 2
2
Pause. Can we do this? For sure: WFF(N) is a subset of the countable set of all strings over V{N), thus it is countable itself. In turn, the subset of WFF(TV) that contains all the "existential" formulae (3x)B, but just those, is countable, and by the results in our "course in countable sets" can be enumerated so that every member is repeated infinitely often. We can now define a sequence Γ , Γ ι , . . . by recursion, in two steps, using the intermediate A sequence that we define in parallel: Let Γο = Σ, and for η = 0 , 1 , . . . let 0
n
=
"
ir„U{G }
ifr„U{G„}r/A
\r U{G }
otherwise
n
n
n
This is almost identical to the construction in the proof of 3.2.1 (see also Claim Four on p. 96, and (i) below). We next let iA„U{B[x:=c]}
if Δ I E where E is (3x)B . . . lJ I Δ„ otherwise In (4) we choose the socalled Henkin constant c Ε Ν so that c = rrn where i is the smallest such that does not occur in any of A, G o , . . . , G„, EQ, ..., E . 1 n+l = i
η
N
N
4
A
N
We now note a set of properties of the Γ sequence of formulae: η
(i) If Γ„ \f A , then Δ \f A . This is clear if Δ is given by the top case. Otherwise, we have Γ U {G„} h A, which precludes Γ„ U{>G } \ A (see the analogous argument in Claim Four on p. 96). η
η
η
N
(ii) If Δ \f A, then Γ \f A . Let Γ h A instead. Thus, Δ „ U {B[x := c]} ΙΑ. As c cannot occur in Σ (why?), and Δ „ h (3x)B, the conditions of 6.5.19 apply and we have Δ „ I A; a contradiction. η
η + 1
η + 1
(iii) For every η > 0, Γ„ 1/ A. By trivial induction on n, via (i) and (ii), given that Γ
0
=
ΣΓ/Α.
We now define Γ by Γ =
IJ Γ
η
(5)
227
COMPLETENESS
(iv) Γ \f A. If not, let B\,..., B be all the formulae of Γ used in a proof that certifies Γ I A. Let T , for appropriate m, contain all the Bj. Then T h A, contradicting (iii). n
m
m
(v) For every Β G WFF(AT), either Β G Γ or (.β) € Γ, ο«ί ηοί οο/η. Indeed, each Β is some Gj. By (3) and (4), at stage i of the construction, one of Bj or ·Β, is placed in Γ* ι. If at different stages (why "different"?) both some Β and ^B enter in Γ, then, by 2.5.7, Γ h J_, and hence (cf. 2.6.6) Γ h A contradicting (iv). +
(vi) Γ is a maximal consistent theory in that whenever Β ^ Γ, then Γ U {B} is inconsistent. Indeed, if Β g Γ, then (.β) e Γ, and hence Γ U {B} h  . β . But r u { B } F B,too. (vii) Γ is deductively closed; that is, Γ h β implies Β € Γ. Otherwise, by maximal consistency (cf. 2.6.6), we get Γυ {B} h A; hence Γ h A (2.1.6), contradicting (iv). (viii) Αχ C Γ. Indeed, by deductive closure and 2.1.1, h BentailsT h β for any B . (ix) Γ is an NHenkin theory, meaning that, Γ h (3x)B implies, for some k e N, Γ h B[x := k\. Indeed, let Γ h (3x)B, where (3x)B is E for some n. By (vii), E G r and hence, by (3), E G A for some m. Without loss of generality we may assume m = n. Indeed, n
n
m
n
m
Case 1: Urn < η is our original situation, then note that A C Δ „ m
Case 2: If m > η is our original situation, then, as (3x)B is enumerated as an Ei infinitely often, take an i > m such that E is still (3x)B. But now we are back to Case 1. t
Thus, by (4), B[x := k] is placed in T
m +
i for some k G N.
So far, the construction presented and its properties track fairly closely the one given in Section 3.2, and its properties. The primary design aim in either construction was to construct a maximal consistent theory Γ that contains Σ—but fails to prove some given formula A—and use the theory's properties to construct a model for Σ. But what is (ix) good for? In informal mathematics the truth of an existential statement such as (3x)B, where Β has at most only χ free, entails the existence of an object (constant) c that makes B[x := c] true—this is the semantics of 3. This phenomenon is not replicated informal logic in general; that is, (3x)B —> B[x := c] is not a theorem schema. See Exercise A.2.13. Henkin's construction in (4), which has as a consequence (ix) above, is the additional work we have to do to make the huge (cf. (v) and (vi)) theory Γ behave, with respect to the quantifier 3, according to what the quantifier's semantics dictate. Such behavior in turn supports our task to build a model of Σ whose informal logical properties we can mimic formally within the theory Γ. The final concern is to allow Γ to handle constants in the domain of the (notyetconstructed) model of Σ with some of the effectiveness informal mathematics can
228
GODEL'S THEOREMS AND COMPUTABILITY
exhibit. In particular, we will need one more property in order to finally define our model: that Γ can distinguish constants; that is, if m φ η in TV, metamathematically speaking, then Γ certifies this by proving  τ η = η, which by (vii) means that the "certificate" is just (>m = η) £ Γ. But this is not necessarily true for the arbitrarily chosen TV! However, we can make it happen for a "smaller" set D obtained by judiciously discarding members of TV. And this involves a few more technical steps! We start by defining the "equality class of n" for each η £ TV: e(n) = {m € TV : Γ h m = n}
(6)
The e(n) sets have some interesting properties: el. η € e(n): Indeed, Γ h η = η by Ax5 and 6.1.19. e2. If e(n) and e(m) both contain the same i from TV, then e(n) — e(m): First, note that the hypothesis translates to Γ h i = η and Γ h i = m. By 7.0.1 via 6.1.19 we get Γh η= m (7) and Γ h τη = η
(7')
If now k £ e(n), then Γ h k = n; hence Γ h A; = m by (7) and 7.0.1 via 6.1.19. That is, A: £ e(m). The converse follows using (7') instead. e3. If k £ e(n), then e(fc) = e(n): by el and e2. e4. If e(k) = e(n), then Γ I k = n: by assumption and el, k £ e(n). We now invoke (6). We next define the set D = {mine(n) : η £ TV}
(8)
where "min S" for any 0 / 5 C TV denotes the element rrij of S that has fAe smallest index i in the fixed (in our discussion) enumeration mo, m\,... of TV (cf. p. 226). By el, the selection "mine(n)" is always possible. Let next k φ η in D. Thus, k = mine(i) and η = mine(j) for some i, j in TV. It follows that e(k) = e(i) and e(n) = e(j) by e3. Can we have Γ h k = n? If yes, then k £ e(n) by (6); hence e(k) = e(n) by e3. We conclude that e(i) = e{j) and therefore this set has two distinct elements, k and n, of smallest index in the (m; );>o enumeration of TV, which is absurd! We have: 8
A.2.1 Lemma. Γ distinguishes the members of D, that is, m φ η in D implies Γ h >m φ η. "The reader who is conversant with the concepts of equivalence relations and equivalence classes will recognize the relation between η and mm Ν given by Γ h η = m as an equivalence relation, i.e., one that is reflexive, symmetric, and transitive. He will also recognize the set e(n) as the equivalence class with representative n. We avoided this terminology in the interest of those readers who have not seen these concepts before.
COMPLETENESS
229
A.2.2 Lemma. Γ is an DHenkin theory (cf. (ix)). Proof. So let Γ h ( 3 χ ) β . We know from (ix) that for some k € N, we have Γ h β [ χ := fc]. Let η = min e(fc). Then η € £> and Γ h η = k (by (6) and (8)). By Ax6, Γ h β [ χ := η] ΞΞ Β[Χ := fc]; hence Γ h β [χ := η]. • A.2J Exercise. D φ Φ.
•
In summary, we have the statement below: A.2.4 Lemma. (Main Semantic Lemma) If Σ is a theory over a firstorder language L that cannot prove A (also over L), and Ν is any infinite countable set, then there is a nonempty subset D C Ν and a DHenkin theory Γ C WFF(iV) that extends Σ—that is, Σ C Γ—which distinguishes the constants of D (in the sense of A.2.1) and satisfies (iv)(viii) as well. A.2.5 Remark. We continue working with L, Σ, N, D, Γ as in A.2.4. By Ax5 and 6.1.19, h t = t for any TVterm t; hence Γ h t = i. By 6.5.2 we have Γ h (3x)x = t. Thus, Γ h m = t for some m e D, since Γ is £>Henkin. This m is uniquein D for, if not, then we also have Γ h η = t, for some η £ D where η φ m. By 7.0.1, Γ h m = n. But A.2.1 yields Γ I—'m = η, contradicting consistency of Γ (iv). • We are ready to define an interpretation S) = (D, M) of L: A.2.6 Definition. We start with a consistent theory Σ over a firstorder language L, and an arbitrary countable infinite set N. We will actually define the interpretation S = (D, M) for the augmented language V, which has as alphabet V = V U (iV — D). Trivially, this will induce an interpretation for L itself: All we have to do is to forget that we have interpreted also the constants from Ν  D. In what follows we faithfully track Definition A.1.5. We thus give meaning to all elements of V'(D): 9
(1) For each object variable y from 11 we have Γ h m = y for a unique m G D (cf. A.2.5). We set M(y) = m. (2) For each Boolean variable q from V, we set M(q) = t iff q e Γ. (3) We set M ( l )
= f
and M(T) = t.
(4) For each constant symbol c from L' we have Γ h m = c for a unique m e f l b y Remark A.2.5. We set M(c) = m. Note that if c € I?, then—m being also in D—c = m by an argument based on the concluding remarks (uniqueness) in A.2.5. This is as it should be! (Cf. A. 1.5(5).) 'Recall that Ν — D, set difference, denotes all the members of Ν that are not in D.
230
GODEL'S THEOREMS AND COMPUTABILITY
(5) Let / be a function symbol from L' of arity k > 0. We want to specify a "concrete" (metamathematical) M(f). We do so by specifying what inputs (from D) generate what outputs (in D) under this M(f). Let then m i , . . . , € D. By A.2.5, Γ h m = f(rrii,... ,m ) for a unique m e 73. Thus we define M{f){mi,.. .,m )—the output—to be this unique m: M ( / ) ( m i , . . . ,m ) = m. k
k
k
(6) For eachfcarypredicate symbol φ from L', we let Μ(φ) be the metamathematical relation that has the following input/output behavior: Μ(φ)(ηι,..., n k ) = t iff
n ) G Γ.
φ(ηχ,...,
•
k
We will prove that 33 is a model of Σ with the help of two lemmata. A.2.7 Lemma. For every Dterm t over L' (same as Νterm over L!) Γ h t = mif m= M(t). w
Proof. By induction on the complexity of i: If t is a variable or constant we are done by (1) and (4) of A.2.6 (being mindful of 7.0.1). Suppose that t is f(t .. .,t ). By the I.H. we have u
n
Γ h ti = ki, where ki = M(ti), for i — 1 , . . . , η Thus, by 7.0.7, and since ki are also formal names of constants, Γ h / ( ί ! , . . . , ί „ ) = / ( * ! , . . . , kn)
(*)
Now, M(t) = M(f)(M(ti),...,M(t )) by A.1.6. In other words, M{t) = M{f)(k ..., fc >, say, = j . By A.2.6(5), Γ h j = f(k ..., fc„), which by 7.0.1 and (*) yields Γ h f(t\,...,<„) =j. • n
u
B
u
A.2.8 Lemma. For every Dformula Β over L', M(B) = t iff Β e Γ. By deductive closure of Γ (cf. (vii), p. 227), we can use Β £ Γ and Γ \ Β interchangeably. We use induction on the complexity of Β (cf. A. 1.6). PTOO/
The atomic cases: (i) Β is p . We are done by A.2.6(2). (ii) Β is T. As M(T) = t (A.2.6(3)), we need to show Τ e Γ. This is so by (viii) on p. 227. (iii) Β is 1_. As M(T) = f (A.2.6(3)), we need to show 1 £ Γ. This is so by (iv) on p. 227 (cf. also 2.6.6). This "Γ h t = m if m = M(t)" may appear a bit roundabout. Why not just say "Γ h t = M(t)"? Well, we allowed letters such as k, m, η to have a dual role, as formal names of constants imported into L' from D and as informal names of members of D. However, we have made no agreements to adopt notation such as "M(...)" formally, nor will we. Μ remains a symbol outside our formal alphabet V'. 10
COMPLETENESS
231
(iv) Β is t = s. In one direction, let M{t = s) = t, that is (A.l.6), M(t) = M(s). Let us call i this member of D. By A.2.7 we have Γ f t = i and Γ h s = i, hence (7.0.1) Γ h ί = s. In the other direction we start with what we have just concluded. Then A.2.7 yields Γ h t = i and Γ h s = j , where i = M(t) and j = M(s). By 7.0.1, T\ i = j . This entails i = j metamathematically (in D)—and hence A/(t = s) = t—since otherwise Γ I—>i = j (A.2.1) contradicting T's consistency. (v) B i s <£(*!,...,*„). Letfci = M ( t i ) ( i = Ι , . , . , η ) . By A.2.6(6), M(
n
= t iff (fci,..., fc„) e Γ iff rh
(**)
n
By repeated application of Ax6 and A.2.7—the latter yielding Γ h i, = fci (i = 1 , . . . , n)—we see that (**) is equivalent to Γ h <j>(t\,..., t ). n
The nonatomic cases: If Β is any of >C or C ο D for ο e {Λ, V, —>, ΞΞ}, then the argument is precisely the same as the one given in the proof of 3.2.1, under "Main Claim" (p. 97). Thus we will consider here only the case where Β is (Vx)C. Let then Μ ((Vx)C) = t. Thus (A.l.6), M ( C [ x := i\) = t, for all i e D. By the I.H. we have C[x := i] € Γ, for alH e D
(* * *)
We want to conclude that (Vx)C £ Γ. If not, then >(Vx)C is in Γ ((ν), p. 227), which via 3.2.1 and the definition of 3, is equivalent to (3x)>C G Γ. By the DHenkin property of Γ, for some i e f l w e have >(7[χ := k\ in Γ, which along with (* * *) contradicts the consistency of Γ ((iv), p. 227). Conversely, let (Vx)C e Γ. Then (6.1.5 and deductive closure of Γ), C[x := i] e r,fora!H e D. By the I.H. Μ (C[x := i]) = t, for all i G D;henceM((Vx)C) = t by A. 1.6. • Thus, by Σ C Γ and the just proved A.2.8, M(B) = t for all Β G Σ, while M(A) = f by (iv) of p. 227. In summary, A.2.9 Lemma. With Σ and A as given {(I) on p. 223) and X) as constructed, X5 is a model ο/Σ, but not of A. Thus Σ ψ A. A.2.10 Corollary. (The Consistency Theorem for FirstOrder Logic) Every consistent theory has a model. Proof. Start with a consistent Σ. Thus for some A in its language, Σ \f A.
•
A.2.11 Metatheorem. (Godel's Completeness Theorem) Given a theory Σ over a firstorder language L. If A is a formula over L, then Σ \= A implies Σ h A. Proof. We have already shown that if Σ 1/ A, then Σ ψ Α.
•
232
GODEL'S THEOREMS AND COMPUTABILITY
A.2.12 Exercise. (Compactness of FirstOrder Logic) Let Σ be a finitely satisfiable theory over some language L, that is, every finite subset of Σ is satisfiable (A. 1.9). Prove that the entire Σ is also satisfiable. • A.2.13 Exercise. Let L be a firstorder language with only one constant, c. Show that ψ ( 3 x ) 5 > B[x := c\. •
A.3
A B R I E F THEORY O F COMPUTABILITY
Computability is the part of logic that gives a mathematically precise formulation to the concepts algorithm, mechanical procedure, and calculable function (or relation). Its advent was strongly motivated, in the 1930s, by Hubert's program, in particular by his belief that the Entscheidungsproblem, or decision problem, for axiomatic theories, that is, the problem "Is this formula a theorem of that theory?" was solvable by a mechanical procedure that was yet to be discovered. Now, since antiquity, mathematicians have invented "mechanical procedures", e.g., Euclid's algorithm for the "greatest common divisor"," and had no problem recognizing such procedures when they encountered them. But how do you mathematically prove the nonexistence of such a mechanical procedure for a particular problem? You need a mathematical formulation of what is a "mechanical procedure" in order to do that! Intensive activity by many (Post [37, 38], Kleene [26], Church [4], Turing [55], Markov [34]) led in the 1930s to several alternative formulations, each purporting to mathematically characterize the concepts algorithm, mechanical procedure, and calculable function. All these formulations were quickly proved to be equivalent; that is, the calculable functions admitted by any one of them were the same as those that were admitted by any other. This led Alonzo Church to formulate his conjecture, famously known as "Church's Thesis", that any intuitively calculable function is also calculable within any of these mathematical frameworks of calculability or computability. By the way, Church proved ([3,4]) that Hubert's Entscheidungsproblem admits no solution by functions that are calculable within any of the known mathematical frameworks of computability. Thus, if we accept his "thesis", the Entscheidungsproblem admits no algorithmic solution, period! The eventual introduction of computers further fueled the study of and research on the various mathematical frameworks of computation, "models of computation" as we often say, and "computability" is nowadays a vibrant and very extensive field. The model of computation that I will present here, due to Shepherdson and Sturgis 12
"That is, the largest positive integer that is a common divisor of two given integers. I stress that even if this sounds like a "completeness theorem" in the realm of computability, it is not. It is just an empirical belief, rather than a provable result. For example, Peter [36] and Kalmir [25], have argued that it is conceivable that the intuitive concept of calculability may in the future be extended so much as to transcend the power of the various mathematical models of computation that we currently know. ,2
A BRIEF THEORY OF COMPUTABILITY
233
[44], is a later model that has been informed by developments in computer science, in particular by the advent of socalled highlevel programming languages. 13
A.3.1
A Programming Framework for Computable Functions
So, what is a computable function, mathematically speaking? There are two main ways to approach this question. One is to define a programming formalism—that is, a programming language—and say "a function is computable precisely if it can be 'programmed' in the programming language". Such programming languages are the Turing Machines (or TMs) of Turing and the unbounded register machines (or URMs) of Shepherdson and Sturgis. Note that the term machine in each case is a misnomer, as both the TM and the URM formulations are really programming languages, the first being very much like assembly language of "real" computers, the latter reminding us more of (subsets of) Algol (or Pascal). The other main way is to define a set of computable functions inductively, starting with some initial functions, and allowing the iteration of functionbuilding operations to build all the remaining functions of the set. This approach (originally due to Dedekind [8] for what we nowadays call primitive recursive functions, and later due to Kleene [26] for what we nowadays call partial recursive functions) is very elegant, but is less intuitively immediate, whereas the programming approach has the attraction of being natural to those who have done some programming. We now embark on defining the highlevel programming language URM. The alphabet of the language is «,+,,:,
X,0,1,2,3,4,
5,6, 7,8,9, if, else, goto, s t o p
(1)
Just like any other high level programming language, URM manipulates the contents of variables. However, these are restricted to be of natural number type—i.e., the only type of data such variables can denote (or "hold", or "contain", in programming jargon) are members of N. Since this programming language is for theoretical considerations only—rather than practical implementation—every variable is allowed to hold any natural number whatsoever, hence the "UR" in the language name ("unbounded register", used synonymously with variable of unbounded capacity). The syntax of the variables is simple: A variable (name) is a string that starts with X and continues with one or more 1: URM variable set:
ΛΊ,ΧΙΙ,ΑΊΙΙ,ΧΙΙΙΙ,...
(2)
Nevertheless, as we have been doing in the case of firstorder languages, we will more conveniently utilize the bold face lower case letters x , y , z , u , v , w , with or without subscripts or primes as metavariables in our discussions of the URM, and in examples of programs. Rather than employing "BNF* notation to define the language (cf. p. 17)—that is, the syntax of URM programs—I will simply say that a URM program is a finite 13
The level is "higher" the more the programming language is distanced from machinedependent details.
234
GODEL'S THEOREMS AND COMPUTABILITY
(ordered) sequence of instructions (or commands) of the following five types: L : χ <— a L : χ < x + 1 L : χ «— χ  1
(3)
L : stop L : if χ = 0 g o t o Μ else g o t o R where L, M, R, a, written in decimal notation, are in N, and χ is some variable. We call instructions of the last type ifstatements. Each instruction in a URM program must be numbered by its position number, L, in the program—":" separating the position number from the instruction. We call these numbers labels. Thus, the label of the first instruction is always " 1 " . The instruction s t o p must occur only once in a program, as the last instruction. The semantics of each command is given in the context of a URM computation. The latter we will let have its intuitive meaning in this subsection, and we will defer a mathematical definition until Subsection A.3.3, where such a definition will be needed. Thus, for now, a computation is the process that cycles along the instructions of a program, during which process each instruction that is visited upon—the current instruction—causes an action that we usually term "the result of the execution" of the instruction. I said "cycles along" because instructions of the last two types (may) cause the computation to loop back or cycle, revisiting an instruction that was already visited by the computation. Every computation begins with the instruction labeled " 1 " as the current instruction. The semantic action of instructions of each type is defined if and only if they are current, and is as follows: (i) L : χ <— a. Action: The value of χ becomes the (natural) number a. Instruction L + 1 will be the next current instruction. (ii) L : χ <— χ + 1. Action: This causes the value of χ to increase by 1. The instruction labeled L + 1 will be the next current instruction. (iii) L : χ <— χ — 1. Action: This causes the value of χ to decrease by 1, i/it was originally nonzero. Otherwise it remains 0. The instruction labeled L + 1 will be the next current instruction. (iv) L : s t o p . Action: No variable (referenced in the program) changes value. The next current instruction is still the one labeled L. (v) L : if χ = 0 g o t o Μ else g o t o R. Action: No variable (referenced in the program) changes value. The next current instruction is numbered Μ if χ = 0; otherwise it is numbered R. This command is syntactically illegal (meaningless) if any of Μ or β exceed the label of the program's s t o p instruction.
235
A BRIEF THEORY OF COMPUTABILITY
We say that a computation terminates, or halts, iff it ever makes (as we say "reaches") the instruction s t o p current. Note that the semantics of "L : s t o p " appear to require the computation to continue ad infinitum, but it does so in a trivial manner where no variable changes value, and the current instruction remains the same: Practically, the computation is over. One usually gives names to URM programs, or as we just say, "to URMs", such as Μ, Ν, P, Q, R, F, H, G. A.3.1 Definition. (Computing a Function) We say that a URM, M, computes a function / of η arguments provided—for some choice of variables χ χ , . . . , x of Μ that we designate as input variables and a choice of a variable y that we designate as the output variable—the following precise conditions hold for every choice of input sequence (or "ηtuple"), a ,..., a from N: n
x
n
(1) We initialize the computation, by doing two things: (a) We initialize the input variables with the input values αχ,.. .,a . initialize all other variables of Μ to be 0.
We
n
(b) We next make the instruction labeled " 1 " current, and thus start the computation. (2) The computation terminates iff J{a\,... ,a„) is defined, or, symbolically, iff "f(a ...,a ) I". u
n
(3) If the computation terminates, that is, if at some point the instruction s t o p becomes current, then the value of y at that point (and hence at any future point, by (iv) above), is /{αχ,..., a ). • n
(1) The notation " / ( α ϊ , . . . , a„) f" means that f(a ,..., x
a ) is undefined. n
(2) The function computed by a URM, M, with inputs and output designated as above, can also be denoted with the symbol M y · . This symbol, with no need for comment, makes it clear as to which are the input variables (superscript) of M, and which is the output variable (subscript). The variables x . . . , x in M y •• are "apparent", or not free for substitution; since My »···· » is not a term (in the predicate logic sense of the word), it does not denote a value. Note also that any attempt to effect such substitutions, for example, My , would lead, in general, to nonsensical situations like "L : 3 * 3 41", a command that wants to change the (standard) value of the symbol " 3 " (from 3 to 4)! 11
Χ η
11
1 ;
,Xn
n
χ
X a
Thus, we may write / = M
X l
X n
  " , but ηοί / ( α ϊ , . . . ,o„) = Μ^'" x
" . θη)
Note that / denotes, by name, a function, that is, a potentially infinite table of input/output pairs, where the input is always an ηtuple. On the other hand, Μ · ' ' goes a step further: It finitely represents the table f, being able to do so because it is a finite set of instructions that can be used to compute the output for each input where / is defined. Χ ι
Χ η
236
GODEL'S THEOREMS AND COMPUTABILITY
A.3.2 Definition. (Computable Functions) A function / of η variables x i , . . . , x n is called partial computable iff for some URM, M, we have / = M y . The set of all partial computable functions is denoted by V. The set of all the total functions in V—that is, those that are defined on all inputs from Ν—is the set of computable functions and is denoted by 71. The term recursive is used in the literature synonymously with the term computable. • 1
X n
Note that since a URM is a theoretical, rather than practical, model of computation we do not include humancomputerinterface considerations in the computation. Thus, the "input" and "output" phases just happen during initialization—they are not part of the computation. That is why we have dispensed with both read and write instructions and speak instead of initialization in (1) of A.3.1. This approach to input/output is entirely analogous with the input/output convention for the other wellknown model of computation, the Turing machine (cf. [6, 24, 31,46,49]). A.3.3 Example. Let Μ be the program 1 :x<x+l 2 : stop Then M£ is the function / given for all χ e Ν by f(x) = χ + 1, the successor function. • A.3.4 Remark, (λ Notation) To avoid saying verbose things such as " M J is the function / given for all χ e Ν by f(x) = χ + 1", we will often use Church's λnotation and write instead " M * = Xx.x + 1". In general, the notation "λ · · · ." marks the beginning "λ" and the end "." of a sequence of input variables "• • ·". What comes after the period "." is the "rule" that indicates how the output relates to the input. The template for λnotation thus is A"input"."outputrule" Relating to the above example, we note that / = Xx.x + 1 = Xy.y + 1 = Xz.f(z) is correct. To the left and right of each "=" we have the table for a function, and we are saying all these tables are the same. Note that x, y ζ are "apparent" variables ("dummy", bound) and are not free (for substitution). In particular, / = f(x) is incorrect as we have distinct types to the left and right of "=": a table and a number (albeit unspecified number). }
Pause. Why bother with these notational acrobatics? Because wellchosen notation protects against meaningless statements, such as M*=x+1
(1)
that one might make in the context of the above example. As remarked before, "M*" is not a term, nor are the occurrences of χ in it free (for substitution). For example, "Mf = 4" (substituting 3 for χ throughout in (1)) is totally meaningless, as it says l:3<3+l 2 : stop
~
4
A BRIEF THEORY OF COMPUTABILITY
237
However, M* = λ χ . χ + 1 does make syntactic and semantic sense; indeed it is true, as two tables are compared and are found to be equal! Since λ χ . χ + 1 = Xy.y + 1 the following three tables are identical: 14
Μ
Input
Μ
Output x+ 1 1 2 3 4
X
0 1 2 3
Input y 0 1 2 3
Output y+i 1 2 3 4
In programming circles, the distinction between function definition or declaration, Xx.f(x), and function invocation (or call, or application, or "use")—what we call a term, f(x), in firstorder language parlance—is well known. The definition part, in programming, uses various notations depending on the programming language and corresponds to writing a program that implements the function, just as we did with Μ here. There is a double standard in notation, when it comes to relations. A relation R, in the metatheory, is a table (i.e., set) of ηtuples. Its counterpart in formal logic is a formula. But where in the formal theory we almost never write a formula A as A(x) in order to draw attention to our interest in its (free) variable x, in the metatheory most frequently we write a relation R as R{x )—without λ notation—thus drawing attention to its "input slots", which here are x\,..., x (i.e., its "free variables"). Since stating "R(a )'\ by convention, is short for "a e R", we have two notations for a relation: Relational, i.e., R{x ), and settheoretic, i.e., x € R, both without the benefit of λ notation. There are exceptions to this practice, for example, when we define one relation from another one via the process of "freezing" some of the original relation's inputs. For example, writing χ < y (the standard "less than" on N) means that both χ and y are meant to be inputs; we have a table of ordered pairs. However, we will write Xx.x < y to convey that y is fixed and that the input is just x. Clearly, a different relation arises for each y; we have an infinite family of tables: For y = 0 we have the empty table; for y = 1 one that contains just 0; for y = 2 one that contains just 0,1; etc. • n
n
n
n
n
n
A.3.S Example. Let Μ be the program 1 :x<x 1
2 : stop
l4
x —»I Μ I means "x is input to M" and  Μ  —> χ indicates "x is output from M".
238
GODEL'S THEOREMS AND COMPUTABILITY
Then M * is the function λχ.χ — 1, the predecessor function. The operation  is called "proper subtraction" and is in general defined by χ —y
0
if χ > y otherwise
It ensures that subtraction (as modified) does not take us out of the set of the socalled numbertheoretic functions, which are those with inputs from Ν and outputs in N.
•
Pause. Why are we restricting computability theory to numbertheoretic functions? Surely, in practice we can compute with negative numbers, rational numbers, and with nonnumerical entities, such as graphs, trees, etc. Theory ought to reflect, and explain, our practices, no? It does. Negative numbers and rational numbers can be coded by natural number pairs. Computability of numbertheoretic functions can handle such pairing (and unpairing; decoding). Moreover, finite objects such as graphs, trees, and the like that we manipulate via computers can be also coded (and decoded) by natural numbers. After all, the internal representation of data in computers is, at the lowest level, via natural numbers represented in binary notation. Computers cannot handle infinite objects such as (irrational) real numbers. But there is an extensive computability theory (which originated with the work of Kleene, [27]) that can handle such numbers as inputs and also compute with them. But this is beyond our scope. A.3.6 Example. Let Μ be the program 1 :x^0
2 : stop Then M * is the function Xx.O, the zero function.
•
In Definition A.3.2 we spoke of partial computable and total computable functions. We retain the qualifiers partial and total for all numbertheoretic functions, even for those that may not be computable. Thus a function is total iff it is everywhere defined and is nontotal (no hyphen) otherwise. The set union of all total and nontotal numbertheoretic functions is the set of all partial functions. Thus partial is not synonymous with nontotal. Compare with the socalled partial order of discrete mathematics (and set theory). A partial order may be also a total (or linear) order. [5
A twoplace (binary) relation R on a set D is a partial order iff it is irreflexive, that is, for no χ can we have R(x, x), and transitive, that is, R(x, y) and R(y, z) imply R(x, z). It is a total or linear order if, moreover, we have trichotomy: For any two elements χ and y of D, R(x, y) V χ = y V R(y, x) is true. If D is N. then the "less than" relation, <, is a total order on D. If D is the set of all subsets of N, then C (proper subset relation) is a partial but not total order on D. 1 5
A BRIEF THEORY OF COMPUTABILITY
239
A.3.7 Example. The unconditional g o t o instruction, namely, "L : g o t o L"\ can be simulated by L : if χ = 0 g o t o U else g o t o L'. • A.3.8 Example. Let Μ be the program segment
k  1 : χ « 0 k: χ <— χ + 1 k+ 1 : ζ « ζ  1 A: + 2 : if ζ = 0 g o t o fc + 3 else g o t o k fc + 3 : . . . What it does, by the time the computation reaches instruction k + 3, is to have set the value of ζ to 0, and to make the value of χ equal to the value that ζ had when instruction k — 1 was current. In short, the above sequence of instructions simulates the following sequence L: χ *— ζ L+ 1 : ζ < 0 L + 2 : ... where the semantics of L : χ <— ζ are standard in programming: They require that upon execution of the instruction the value of ζ is copied into x, but the value of ζ remains unchanged. • A3.9 Exercise. Write a program segment that simulates precisely L : χ <— ζ; that is, copy the value of ζ into χ without causing ζ to change as a side effect. • Because of the above, without loss of generality, one may assume of any input variable, x, of a program Μ that it is readonly. This means that its value remains invariant throughout any computation of the program. Indeed, if χ is not so, a new input variable, x', can be introduced as follows to relieve χ from its input role: Add at the very beginning of Μ the (derived) instruction 1 : χ <— χ', where x' is a variable that does not occur in M. Adjust all the following labels consistently, including, of course, the ones referenced by ifstatements—a tedious but straightforward task. Call M' the soobtained URM. Clearly, Μ ' ϊ ' · * " = Mf  ". 1
y
y i
y
A.3.10 Example. (Composing Computable Functions) Suppose that Xxy.f (x, y) and Xz.g(z) are partial computable, and say / = F * while g — G\. Since we can rewrite any program renaming its variables at will, we assume without loss of generality that χ is the only variable common to F and G. Thus, if we concatenate the programs G and F in that order, and (1) remove the last instruction of G (k : s t o p , for some k)—call the program segment that results from this G', and (2) renumber the instructions of F as k, k + 1 , . . . (and, as a result, the references that ifstatements of F make) in order to give (G'F) the correct program structure, y
then, Xyz.f(g(z),y) = ( G ' F ) ^ ' . Note that all noninput variables of F will hold 0 as soon as the execution of (G'F) makes the first instruction of F current for the first time. This is because none of these can be changed by G' under our assumption, thus ensuring that F works as designed. • Z
240
GODEL'S THEOREMS AND COMPUTABILITY
Thus, we have, by repeating the above a finite number of times: A.3.11 Proposition. IfXy f{y ) putable, then so is Xz.f(gi(z),... n
n
and Xz.gi(z), for i = 1,..., n, are partial com,g„{z)).
We can rephrase A.3.11, saying simply that V is closed under composition. For the record, we will define composition to mean the somewhat rigidly defined operation used in A.3.11, that is: A.3.12 Definition. Given any partial functions (computable or not) Xy f(y ) and Xz.gi(z), fori = 1,..., n, we say that Xz.f(g\(z),.. .,g (z)) is the result of their composition. • n
n
n
We characterized the definition as "rigid". Indeed note that it requires that all the arguments of / be substituted by a &(z)—unlike Example A.3.10, where we substituted a function invocation (cf. terminology in A.3.4) in one variable of / there, and did nothing with the variables y—and for each application &;(...) the argument list, "...", must be the same, for example z. This rigidity is only apparent, as we show in examples in the next subsection (A.3.2). Composing a number of times that depends on the value of an input variable is iteration. The general case of iteration is called primitive recursion. A.3.13 Definition. (Primitive Recursion) A numbertheoretic function / is defined by primitive recursion from given functions Xy.h(y) and Xxyz.g(x, y, z) provided, for all x, y, its values are given by the two equations below: f(0,y) =h(y) f{x + l,y)= g(x,y,f(x,y)) h is the basis function, while g is the iterator. It will be useful to use the notation / = prim(h, g) to indicate in shorthand that / is defined as above from h and g (note the order). • Note that f(l,y) = g{0,y,h{y)l / ( 2 , » ) = g(l,y,g(0,y,h(y})\ /(3,jfl = g(2,y,g(l,y,g(0,y,h(y)))), etc. Thus the "xvalue", 0, 1, 2, 3, etc., equals the number of times we compose g with itself. Hence "iteration", i.e., composition as many times as an input value dictates. A.3.14 Example. (Iterating Computable Functions) Suppose that Xxyz.g(x, y, z) and Xy.h(z) are partial computable, and say g = G ^ ' while h = /if. By earlier remarks we may assume: (i) The only variables that Η and G have in common are z, y. (ii) y are readonly in both Η and G. (iii) i is readonly in G. (iv) χ does not occur in any of Η or G. z
A BRIEF THEORY OF COMPUTABILITY
241
We can now argue that the following program, let us call it F, computes / defined as in A.3.13 from h and g, where IH' is program Η with the s t o p instruction removed, G' is program G with the s t o p instruction removed, and instructions have been renumbered (and ifstatements adjusted) as needed:
r + 2:
i 0 if χ = 0 g o t o k + m + 2 else g o t o r + 2 χ <— χ — 1
it : k+ 1
i«i+l wj < 0
r: r+1:
G'
w < 0 k+ m: fc + m + 1 g: o t o r + 1 k + m + 2: s t o p m
The instructions w, <— 0 set explicitly to zero all the variables of G' other than i, z, y to ensure correct behavior of G'. Note that the w; are implicitly initialized to zero only the first time G' is executed. Clearly, / = F * . • y
We have at once: A.3.15 Proposition. If f,g,h relate as in Definition A.3.13 and h and g are in V, then so is f. We say that V is closed under primitive recursion. A.3.16 Example. (Unbounded Search) Suppose that Xxy.g(x, y) is partial computable, and say g = G £ . By earlier remarks we may assume that y and χ are readonly in G and that ζ is not one of them. ,y
Consider the following program F, where ΓG' is program G with the s t o p instruction removed, and instructions have been renumbered (and ifstatements adjusted) as needed so that its first command has label 2. 0
1: k: k+1 k+ k+ k+ k+
if ζ = 0 g o t o k + I + 3 else g o t o k+l W ] <— 0 {Comment. Setting all noninput variables to 0; cf. A.3.14.}
l: wj  0 {Comment. Setting all noninput variables to 0; cf. A.3.14.} l+ 1 : x * x + 1 l+ 2: g o t o 2 I + 3 : stop
242
GODEL'S THEOREMS AND COMPUTABILITY
Let us set / = F%. Note that, for any α, / ( a ) j precisely if the URM F, initialized with a as the input values in y , ever reaches stop. This condition becomes true as long as the two conditions, (1) and (2), are fulfilled: (1) Instruction k just found that ζ holds 0. This value of ζ is the result of an execution of G (i.e., G' with the s t o p instruction added) with input values α in y and, say, b in x, the latter being the iteration counter—0,1,2,...—that indicates how many times instruction 2 becomes current, (2) In none of the previous iterations (with xvalue < 6) did G' (essentially, G) get into a nonending computation (infinite loop). Correspondingly, the computation of F will never halt for an input a if either G loops for ever at some step, or, if it halts in every iteration b, but nevertheless it never exits with a zvalue of 0. Thus, for all o, / ( a ) = rninfx : g{x, a) = 0 Λ (Vy)(j, < χ* g(y, a) J,)}
•
A.3.17 Definition. The operation on partial functions ρ given for all ο by min{x: g{x,a) = 0 Λ (Vy)(y < .τ » g(y,a)
I)}
is called unbounded search (along the variable x) and is denoted by the symbol (px)g(x,a). The function \y.(px)g(x,y) is denned precisely when the minimum exists. • The result of Example A.3.16 yields at once: A3.18 Proposition. V is closed under unbounded search; that is, if \xy.g(x, y) is in V, then so is \y.{px)g{x, y). A.3.19 Example. Is the function a program, M, for it:
\x .X{, n
where 1 < i < n, in VI Yes, and here is
1:
wi < 0
i :
ζ <— w; {Comment. Cf. Exercise A.3.9}
η : w <— 0 η + 1 : stop n
= M™ . To ensure that Μ indeed has the Wj as variables we reference them in instructions at least once, in any manner whatsoever. •
Xx„.Xi
n
A BRIEF THEORY OF COMPUTABILITY
A.3.2
243
Primitive Recursive Functions
Exercises A.3.3, A.3.6, and A.3.19 show that the successor, the zero, and the generalized identity functions respectively—which we will often name S, Ζ and U" respectively—are in V; thus, not only are they "intuitively computable", but they are so in a precise mathematical sense. We have also shown that "computability" of functions is preserved by the operations of composition, primitive recursion, and unbounded search. In this subsection we will explore the properties of the important set of functions known as primitive recursive. We introduce them by derivations just as we introduced the theorems of logic. A.3.20 Definition. (PTiderivations; P7£functions) A Pftderivation is a finite sequence of numbertheoretic functions that obeys, in its stepbystep construction, the following requirements. At each step we may write: (1) Any one of Z, S, (for any η > 0 and any 0 < i < n). (2) Xz.f(gi(z),..., g„{z)), provided each of f,gi, •. • ,g has already been written. (3) prim(h,g), provided appropriate h and g have already been written. Note that h and g are "appropriate" (cf. A.3.13) as long as g has two more arguments than h. n
A function / is primitive recursive, or a VTZivmcuon, iff it occurs in some VTLderivation. The set of functions allowed in step (1) are called initial functions. We will denote this set by I . The set of all Pftfunctions will be denoted by VTl. • A.3.21 Remark. The above definition defines essentially Dedekind's ([8]) "recursive" functions. Subsequently they have been renamed primitive recursive allowing the unqualified term recursive to be synonymous with computable and apply to the functions of 72. (cf. A.3.2). The concept of a PTi.derivation is entirely analogous with those of proof, formulacalculation, and termcalculation. Visavis proofs, derivations have the following analogous elements: initial functions (vs. axioms) and the operations composition and primitive recursion (vs. the rules of inference, Leib and Eqn). As was the case with proofs (1.4.8 and 4.2.9), we can cut the tail off a derivation and still have a derivation. Thus, a 7 72.function is one that appears at the end of a PTZ.derivation. Properties of primitive recursive functions can be proved by induction on derivation length, just as properties of theorems can be (and have been in this volume) proved by induction on the length of proofs. That a certain function is primitive recursive can be proved by exhibiting a derivation for it, just as is done for the certification of a theorem: We exhibit a proof. However, in proving theorems we accept the use of known theorems in proofs (cf. 2.1.6). Similarly, if we know that certain functions are primitive recursive, then we immediately infer that so is one obtained from them by an allowed operation (composition, primitive recursion, or yettobeintroduced derived operations). For example, if h and g are in VIZ and prim(h,g) makes sense according to A.3.13, >
244
GODEL'S THEOREMS AND COMPUTABILITY
then the latter is in VTZ, too, since we can concatenate derivations of h and g and add prim(h, g) to the right end. In analogy to the case of theorem proving, where we benefit from powerful derived rules, in the same way certifying functions as primitive recursive is greatly facilitated by the introduction of derived operations on functions beyond the two we assumed as given outright (primary operations) in Definition A.3.20. • A.3.22 Theorem. VTZ contains T and is closed under primitive recursion and composition. Indeed, of all possible sets that include 1 and are closed under these two operations, VTZ is the smallest with respect to inclusion. Proof. That VTZ contains 1 is immediate from A.3.20. Why it is closed under primitive recursion was outlined in Remark A.3.21 and the case of composition is analogous (see Exercise A.3.23). Let now <S be a set that includes I and is closed under the two operations. By induction on the length of derivations, we can prove that if f e VIZ, t h e n / eS. For the basis, let / occur in a derivation of length 1. Then it is in J and we are done. Assume the claim for all / that appear in derivations of length < η and consider an / that appears in one of length η + 1. If it appears before the last step, then we are done by the I.H. Let it then appear only at the last step. If it is in 1, we are done by assumption on S. Let then / = prim(h, g) where h and g show up earlier in the derivation under consideration. By I.H. both h and g are in S. As this set is closed under primitive recursion, it contains / as well. The case of composition causing the presence of / in the derivation is similar (see Exercise A.3.23). • A.3.23 Exercise. Provide the missing details in the proof of A.3.22.
•
A.3.24 Remark. (Induction on VTZ) Just as we do "induction on formulae" we can do induction on VII toward proving a property for all / G VTZ. We prove: (1) (Basis) Any one of Z, S, U" (for any η > 0 and any 0, i < n) has the property 3*. (2) \z.f(gx (z),...
,g (z)) n
has the property, provided each of / , g\,...,
g do. n
(3) prim(h, g) has the property, provided h and g do. The above procedure is more elegant (and more widely used) than induction on the length of P7£derivation and is immediately based on the latter. Alternatively, it directly follows from A.3.22: Let S = {/ : / is numbertheoretic and ^ ( / ) holds} where satisfies (l)(3). But then S contains the initial functions and is closed under composition and primitive recursion (verify!). Thus VIZ C S, or / e VTZ implies that holds. • A.3.25 Example. If Xxyw.f(x, y, w) and Xz.g(z) are in VTZ, how about g{z),w)l It is in VTZ since Xxzw.f(x,g(z),w)
=
Xxzw.f(x,
Xxzw.f(Ui(x,z,w),g(U2(x,z,w)),U (x,z,w)) 3
A BRIEF THEORY OF COMPUTABILITY
245
and the U" are primitive recursive. The reader will see at once that to the right of "=" we have correctly formed compositions as expected by A.3.12. Similarly, for the same functions above, (1) \yw.f{2, since
y, w) is in PTZ. Indeed, this function can be obtained by composition, Xyw.f(2,y,w)
=
Xyw.f(sSZ{U {y,wj),y,w) 2
where I wrote "SSZ(...)" as short for S(S(Z(...))) using SSZ(U (y, w)) above works as well.
for visual clarity. Clearly,
2
(2) Xxyw.f(y,x,w) since
isinP72. Indeed, this function can be obtained by composition,
Xxyw.f{y,x,w)
= Xxyw.f
(u^(x,y,w),Uf{x,y,w),Ul{x,y,wYj
In this connection, note that while Xxy.g (x, y) = Xyx.g(y,x), yet Xxy.g(x,y) φ Xxy.g(y, x) in general. For example, Xxy.x — y asks that we subtract the second input (y) from the first (x), but Xxy.y — χ asks that we subtract the first input (x) from the second (y). (3) Xxy.f(x, y, x) is in VIZ. Indeed, this function can be obtained by composition, since Xxy.f(x,y,x) = Xxy.f(U (x,y),U^(x,y),U (x,y)) 2
2
(4) Xxyzwu.f(x, y, w) is in VTL. Indeed, this function can be obtained by composition, since Xxyzwu.f(x,y,w)
=
Xxyzwu.f(Ui(x,
y, z, w, u), t / f (x, y, z, w, i t ) , U$(x, y, z, w, u))
• The above are summarized, named, and generalized in the following straightforward exercise: A.3.26 Exercise. (Grzegorczyk Substitution Operations [18]) P1Z is closed under the following operations: (i) Substitution of a function invocation for a variable: From Xxyz.f(x, y, z) and Xw.g(w) obtain Xxwz.f(x, g{w), z). (ii) Substitution of a constant for a variable: From Xxyz.f(x, y, z) obtain Xxz.f(x, k, z). (iii) Interchange of two variables: From Xxyzwu.f(x,
y, z, w, u) obtain Xxyzwu.f(x,
w, z, y, u).
246
GODEL'S THEOREMS AND COMPUTABILITY
(iv) Identification of two variables: From Xxyzwu.f(x,
y, z, w, u) obtain Xxyzu.f(x, y, z, y, u).
(v) Introduction of "don't care" variables: From Xx.f (x) obtain Xxz.f (x).
•
By A.3.26 composition can simulate the Grzegorczyk operations if the initial functions 1 are present. Of course, (i) alone can in turn simulate composition. With these comments out of the way, we see that the "rigidity" of Definition A.3.12 is gone. A.3.27 Example. The definition of primitive recursion is also rigid, but this rigidity is removable as well. For example, natural and simple recursions such as p(0) = 0 and p(x + 1) = χ—this one defining ρ = Xx.x — 1—do not fit the schema of Definition A.3.13, which requires that the defined function has one more variable than the basis, so it cannot have only one variable! We can get around this. Define first ρ = Xxy.x — 1 as follows: p(0,y) = 0 and p(x + l,y) = x. Now this can be dressed up according to the syntax of the schema in A.3.13, p(0,y) p(x+l,y)=
= Z(y) Uf(x,y,p{x,y))
that is, ρ = prim(Z, Uf). Then we can get ρ by (Grzegorczyk) substitution: ρ = Xx.p(x, 0). Incidentally, this shows that both ρ and ρ are in VTZ. Another rigidity in the definition of primitive recursion is that, apparently, one can use only the first variable as the iterating variable. Consider, for example, sub = Xxy.x — y. Clearly, sub(x,0) = χ and sub(x,y + 1) = p(sub(x,y)) is correct semantically, but the format is wrong: We are not supposed to iterate along the second variable! Well, define instead sub = Xxy.y  x: «A(0,y) =U\{y) , sub{x+ l,y)= p(Ul{x,y,sub(x.y))) Then, using variable swapping (Grzegorczyk operation (iii)), we can get sub: sub = Xxy.sub(y,x). Clearly, both sub and sub are in VTZ. With practice, one gets used to accepting at once simplified recursions like the one for ρ and sub. One needs to make them conform to the format of A.3.13 only if the instructor insists! • A.3.28 Exercise. Prove that Xxy.x + y and Xxy.x χ y are primitive recursive. Of course, we will usually write multiplication χ χ y in "implied notation", xy. • A.3.29 Example. The very important "switch" (or "ifthenelse") function sw = Xxyz.if χ — 0 then y else ζ is primitive recursive. It is directly obtained by primitive recursion on initial functions: sw(0, y,z) — y and sw(x + 1, y, z) = z. • AJ.30 Exercise. Dress up the recursion sw(0, y,z) — y and sw(x + 1, y, ζ) = ζ to bring it into the format required by Definition A.3.13. •
A BRIEF THEORY OF COMPUTABILITY
247
A.3.31 Exercise. Prove by induction on derivation lengths that all functions in VTl are total. • A.3.32 Proposition. TTl C 71. Pmof. By A.3.11, A.3.15, and A.3.22, V71 C V. But all the functions in VTl are total (cf. A.3.31 and Definition A.3.2). • Indeed, the above inclusion is proper, but the proof is beyond our scope (cf. for example, [49]). We also state for the record: A.3.33 Proposition. TZ is closed under both composition and primitive recursion. Proof. Because V is, and both operations conserve totalness.
•
A.3.34 Example. Consider the function ex given by ex(x,0) = 1 ex(x, y + 1)= ex(x, y)x Thus, if χ = 0, then ex(x, 0) = 1, but ex(x, y) = 0 for all y > 0. On the other hand, if χ > 0, then ex(x, y) = x for all y. Note that x is "mathematically" undefined when χ = y = 0. Thus, by Exercise A.3.31 the exponential cannot be a primitive recursive function! This is rather silly, since the computational process for the exponential is so straightforward; thus it is a shame to declare the function nonVTZ. After all, we know exactly where and how it is undefined and we can remove this undefinability by redefining "x " to mean ex(x, y) for all inputs. Clearly ex e VTZ. We do this kind of redefinition a lot in computability in order to remove easily recognizable points of "nondefinition" of calculable functions. We will see further examples, such as the remainder, quotient, and logarithm functions. Caution! We cannot always remove points of nondefinition of a calculable function and still obtain a computable function. • v
y
16
y
A.3.35 Definition. A relation R(x) is (primitive) recursive iff its characteristic function, ίο ifR(x) X = \x.. 11 ti^R(x) is (primitive) recursive. The set of all primitive recursive (respectively, recursive) relations is denoted by VTZ, (respectively, 7Z„). • R
Computability theory practitioners often call relations predicates. It is clear that one can go from relation to characteristic function and back in a unique way, since R(x) = XR{X) = 0. Thus, we may think of relations as "01 valued" functions. The concept of relation simplifies further development of the theory of primitive recursive functions. 16
In firstyear university calculus we learn that "0°" is an "indeterminate form".
248
GODEL'S THEOREMS AND COMPUTABILITY
The following is useful: A.336 Proposition. R(x) G VTZ* iff some f e VTZ exists such that, for all x, R(x) = f{x) = 0. Proof. For the i/part, I want χ G VTZ. This is so since \ = Xx.l  (1  f[x)) (using Grzegorczyk substitution and Xxy.x  y). For the only (/part, f = XR will do. • R
Λ
A.3.37 Corollary. R(x) G TZ* iff some f G TZ exists such that, for all x, R(x) = f(x) = 0. Proof. By the above proof, A.3.32, and A.3.33.
•
A.3.38 Corollary. VTZ* C TZ*. Proof By the above corollary and A.3.32.
•
A.339 Theorem. VTZ* is closed under the Boolean operations. Proof. It suffices to look at the cases of > and V. (.) Say, R(x) G VTZ,. Thus (A.3.35), \ G VTZ. But then G VTZ, since χ^α = Xx.l — XR(X), by Grzegorczyk substitution and Xxy.x  y e VTZ. R
(V)
Let R(x) G VTZ and Q(y) G VTZ*. Then Xxy.x (x, t
RwQ
= if R(x) then 0 else
XRvQ{x,y)
y) is given by
x (y) Q
and therefore is in VTZ. • It is common practice to use R(x) and x (x) (almost) interchangeably. For example, "if R(x) then . . . " is the same as "if XR{X) = 0 then ...". The latter more directly shows that a (Grzegorczyk) substitution was effected into an argument of the ifthenelse (A.3.29) function: R
XR(S)
I
if
χ
= 0 then . . .
thus establishing the primitive recursiveness of the resulting function. A.3.40 Remark. Alternatively, note that XHVQ(X, y) = XR(X) Χ XQ(J7)
•
A.3.41 Corollary. TZ* is closed under the Boolean operations. Proof. As above, mindful of A.3.32, and A.3.33.
•
A.3.42 Example. The relations χ < y, χ < y, χ = y are in VTZ*. See A.3.4 for a refresher on our conventions regarding lambda notation and relations.
A BRIEF THEORY OF COMPUTABILITY
249
With this out of the way, note that χ < y = χ — y = 0 and invoke A.3.36. Finally invoke Boolean closure and note that χ < y = >y < χ while χ = y is equivalent to χ < y Ay < x. • A.3.43 Proposition. IfR{x,y, is in VTl,. Proof. If Q(x,w,z)
z) e VTl, andXw.f(w)
denotes R(x,f(w),z),
e VTl, then R(x, f{w), z)
then x (x,w,z)
= \ (x,
Q
f(w),z).
R
• A.3.44 Proposition. If R(x,y,z) in Tl,.
€ Tl, and Xw.f(w) e Tl, then R(x,f(w),z)
Proof. Similar to that of A.3.43.
is •
A.3.45 Corollary. If f e ΤΊΙ (respectively, in Tl), then its graph, ζ = f(x) is in VTl (respectively, in Tl ). t
t
Proof. Using the relation ζ = y and A.3.43.
•
The following converse of A.3.45, "if ζ = f(x) is in VTl* and / is total, then / e VTl" is not true. A counterexample is provided by the Ackermann function. However, "if ζ = f(x) is in Tl, and / is total, then / G Tl" is true. Cf. [49] and the exercise below. 17
A.3.46 Exercise. Using unbounded search, prove that if ζ = f(x) is in Tl, and / is total, then / e Tl. • A.3.47 Definition. (Bounded Quantifiers) The shorthand notations (\/y) R(z, x) and (3y) R(z,x) stand for (Vy)(?/ < ζ —» R(z,x)) and {3y)(y < ζ A R(z,x)) respectively, and similarly for the nonstrict inequality " < " (cf. the general case on p. 175). •
A.3.48 Theorem. VTl, is closed under bounded quantification. Proof. By A.3.39 it suffices to look at the case of (3y)
since (Vy) R(y,x)
Let then R(y,x) € VTl, and let us give the name Q(z,x) to (By) R(y,x). note that Q(0, x) is false (why?) and Q(z + 1, χ) = Q(z, χ) V R(z, x). Thus,
= We
XQ(0,X)= 1 XQ(Z+1,X)
= XQ(Z,X)X (Z,X)
•
R
The socalled Ritchie version of the Ackermann function Xnx.A (x) is given by a "double recursion" for all η,χ: A (x) = χ + 2, A i ( 0 ) = 2, A (x + 1) = A (A +i(x)). 17
n
0
n +
n+1
n
n
250
GODEL'S THEOREMS AND COMPUTABILITY
A3.49 Corollary. TZ* is closed under bounded quantification. A.3.50 Exercise. The operations of bounded summation and bounded multiplication are quite handy. These are applied on a function / and yield the functions Xzx. Σ ϊ{ί,χ) and ^ · Π ί < / ( Μ ) respectively, where £ = Π«ο/(»>*) = Y definition. Prove that VTZ and TZ are closed under both operations; i.e., if / is in VTZ (respectively, in TZ), then so are Xzx. Σ f(h%) ^zx. Y\ f(i,x)• ί<ζ
λ
0
2
i
<
a
n
1 b
d
0
a n 0 <
ί < ζ
i
A3.51 Definition. (Bounded Search) Let / be a total numbertheoretic function of η + 1 variables. The symbol (py)< f(y, x), for all z, x, stands for z
mm{y : y < ζ A f(y, χ) = 0}
if (3y) f(y,
ζ
otherwise
x) = 0
We define "{py)< " to mean "(py) i". z
•
A3.52 Theorem. VTZ is closed under the bounded search operation (μ«/)< . That is, if Xyx.f(y,x) £ VTZ, then Xzx.(py) f(y,x) G VTZ. 2
Proof. Set g = Xzx.(py) f(y,x). it:
Then the following primitive recursion settles
(0,z)
fl
= l
g(z + 1, x) = if g{z, χ) < ζ then p(z, x) else if f{z,x)
= 0 then ζ
else ζ + 1
•
A.3.53 Exercise. Mindful of the comment following A.3.39, dress up the primitive recursion that defined g above so that it conforms to the Definition A.3.13. • A.3.54 Corollary. VTZ is closed under the bounded search operation
(py)< . z
A.3.55 Exercise. Prove the corollary. A.3.56 Corollary. TZ is closed under the bounded search operations (py)<
•
z
and
ίμυ)< · ζ
Consider now a set of mutually exclusive relations Ri{x), i = 1,... ,n, that is, Ri(x) A Rj (x) is false for each χ as long as i φ j .
A BRIEF THEORY OF COMPUTABILITY
Then we can define a function / by cases requirement (for all x) given below:
251
from given functions /_,· by the if R^x)
7ι(ί)
if R {x) 2
/(f) = «
fn(x)
if R {x)
yj i(x)
otherwise
n
n+
where, as is usual in mathematics, "if Rj(x)" is short for "if Rj(x) is true" and "otherwise" is the condition >(Ri(x) V · · • V R (x)). We have the following result: n
A.3.57 Theorem. (Definition by Cases) If the functions £ = 1,..., η + 1 and the relations Ri(x), i = I,..., η are in VTZ and VTZ, respectively, then so is f above. Proof. Either by repeated use (composition) of ifthenelse or by noting—mindful of A.3.39—that
f{x)
= h(x)(l
~ XR, (5))+
· • • + / n ( 2 ) ( l  XR„(X)) /
n
+
1
(f)(l
+
 X,(R ...VH„)(^)) l V
•
A.3.58 Corollary. Same statement as above, replacing VIZ and V7Z, by TZ and TZ, respectively. The tools we now have at our disposal allow easy certification of the primitive recursiveness of some very useful functions and relations. But first a definition: A.3.59 Definition. ^y) R{y,
x) means (py) x (y,
R
x).
•
Thus, if R(y,x) e VIZ, (resp. e TZ,), then Xzx.(py) R{y,x) e TZ), since χ € VTZ (resp. £ TZ).
e VTZ (resp.
Ά
A.3.60 Example. The following are in VTZ or VTZ, as appropriate: (1) Xxy. —
1 8
(the quotient of the division x/y). This is another instance of
IV \
a nontotal function with an "obvious" way to remove the points where it is undefined. Thus the symbol is extended to mean (μζ)< ((ζ + l)y > x) for all x, y. It follows that, for y > 0, [x/y\ is as expected in normal math, while [x/Oj =x+l. χ
(2) Xxy.rem(x, y) (the remainder of the division x/y). rem(x, y) = χ — y[x/y\. The symbol "\pc\" is called the floor of x. It succeeds in the literature (with the same definition) the socalled "greatest integer function, [x]", i.e., the integer part of the real number x. ,8
252
GODEL'S THEOREMS AND COMPUTABILITY
(3) \xy.x\y (x divides y). x\y = rem(y, x) = 0. Note that if y > 0, we cannot have 0y—a good thing!—since rem(y, 0) = y. Our redefinition of [x/y\ yields, however, 00, but we can live with this in practice. (4) Pr(x) (x is a prime). Pr(x) = χ > 1 Λ {Vy)< {y\x x
—» y = 1 V y = x).
(5) π(χ) (the number of primes < χ ) . The following primitive recursion certifies the claim: π(0) = 0, and π(χ + 1) = if Pr(x + 1) then π(χ) + 1 else π(χ). 19
(6) Xn.p (the nth prime). First note that the graph y = p„ is primitive recursive: y = p Ξ Pr(y) Λ n(y) = η + 1. Next note that, for all n, p < 2 " (see Exercise A.3.61 below), thus p = (py)<2 [y Pn), which settles the claim. n
2
n
n
2n
=
n
(7) Xnx. exp(n, x) (the exponent of p in the prime factorization of x). exp(n, x) = (μν)<^( \χ). n
+1
Ρη
(8) Seq(x) (x's prime number factorization contains at least one prime, but no gaps) Seq\x) Ξ χ > 1 Λ {\/y)< {Vz)< (Pr{y) Λ Pr{z) Ay < ζ A z\x —• j/x). • x
x
A.3.61 Exercise. Prove by induction on n, that for all η we have p < 2 " . //ί/ιί. Consider, as Euclid did, poPi •••p + l. If this number is prime, then it is greater than or equal to p \ (why?). If it is composite, then none of the primes up to p divide it. So any prime factor of it is greater than or equal to p +i (why?). • 2
n
20
n
n+
n
n
A.3.62 Exercise. Prove that λχ. [log xJ € VTZ. Remove the undefinedness at χ = 0 in some convenient manner. • 2
A .3.63 Definition. (Coding Sequences) Any sequence of numbers, do, ••• ,a ,n 0, is coded by the number ( a n , . . . , a ) defined as n
>
n
t
For coding to be useful, we need a simple decoding scheme. expressions:
Define then the
(i) (z)i as shorthand for exp(i, z) — 1 (ii) lh(z) (pronounced "length of z") as shorthand for
^y)<  {p \z) i
z
y
Note that (a) \iz.(z)i
and \z.lh(z)
are in VTZ.
"The πfunction plays a central role in number theory figuring in the socalled prime number theorem. See for example. [30]. ^In his proof that there are infinitely many primes.
253
A BRIEF THEORY OF COMPUTABILITY
(b) If Seq(z), then ζ = ( a , a ) for some a ,.. ., a . In this case, lh(z) equals the number of distinct primes in the decomposition of z, that is, the length η + 1 of the coded sequence. Then ( z ) i , f o n < lh(z), equals o,. For larger i, (z)i = 0. Note that if >Seq(z) then lh(z) need not equal the number of distinct primes in the decomposition of z. For example, 10 has 2 primes, but Ih(lO) — 1. 0
n
0
n
The tools Ih, Seq(z), and Xiz.(z)i are sufficient to perform decoding, primitive recursively, once the truth of Seq(z) is established. This coding/decoding is essentially that of Godel's ([16]) and we will use it in the following subsection. We conclude this subsection with a flexible (seeming) extension of primitive recursion. Simple primitive recursion defines a function "at η + 1" in terms of its value "at n". However we also have examples of "recursions" (or "recurrences"), one of the best known perhaps being the Fibonacci sequence, 0 , 1 , 1 , 2 , 3 , 5 , 8 , . . . , that is given by F = 0 , F i = land(forn > l ) F i = F + F „ _ i , where the value at η + 1 depends on both the values at η and η  1. This generalizes to recursions where the value at n+1 depends on the entire history, or courseofvalues, of the function values a t n . n  l , n  2 , . . . , l , 0 . Compare with the contrast between simple induction and "strong" induction (cf. "A crash course on induction", p. 17). The easiest way to utilize the course of values of a function / : / ( 0 , y), / ( l , y),..., / ( x , y) prior to χ + 1, or "at x", is to code it by a single number! 0
n +
n
A.3.64 Definition. (CourseofValues Recursion) We say that / , of η + 1 arguments, is defined by a basis function Xy .b(y ) and an iterator Xxy z.g(x, y , z) by courseofvalues recursion if for all x, y the following equations hold n
n
n
n
n
f(0,Vn) f{x+
=b(y„) g{x,y ,H(x,y ))
l,y„)=
n
n
where Xxy .H(x, y ) is the history function, which "at x" is given (for all y ) by n
n
n
•
(f(0,y),f(l,y),...J(x,y)) The major result here is: A.3.6S Theorem. VTZ is closed under courseofvalues recursion.
Proof. So, let 6 and g be in VTl. We will show that / £ VTl. It suffices to prove that the history function Η is primitive recursive, for then / = Xxy .(H(x,y )) and we are done by Grzegorczyk substitution. To this end, the following equations—true for all x, y —settle the case: n
n
x
n
H(0,y ) n
H{x+l,y ) n
= =
(b(y )) n
g(x,y ,H{x,v ))
H(x,y )p\' x + l n
n
n
•
A.3.66 Example. The Fibonacci sequence, ( F ) „ > o , can be viewed as the function Xn.F . As such it is in VTl. Indeed, letting H be the history of the sequence n
n
n
254
GODEL'S THEOREMS AND COMPUTABILITY
at η—that is, (FQ, . . . , F )—we have the following courseofvalues recursion for Xn.F in terms of functions known to be in VIZ. N
N
F
0
Fi n+
=
0
= if η = 0 then 1 else(H„) +(// ) , n
A.3.3
n
n
1
•
U R M Computations
As an "agent" executes some URM's, M, instructions, it generates at each step instantaneous descriptions (IDs) of a computation. The information each such description includes is simply the values of each variable of M , and the label (instruction number) of the instruction that is about to be executed next—the current instruction. In this subsection we will arithmetize URMs and their computations—just as Godel did in the case of formal arithmetic and its proofs ([16])—and prove a cornerstone result of computability, the "normal form theorem" of Kleene that, essentially, says that the URM programming language is rich enough to allow us write a universal program for functions. Such a program, U, receives two inputs: One is a URM description, M, and the other is "data", x. U then simulates Μ on the data, behaving exactly as Μ would on input x. Programmers may call such a program an interpreter or compiler. Toward this end, we will first define a relation T(z,x, y)—known in the literature as the Kleene Tpredicate—that is true iff the URM coded by z, when it receives input χ in its variable XI, will have a terminating computation that is coded by y. Thus we turn to coding URMs and URM computations. Normalizing Input/Output: There is clearly no loss of generality in assuming that any URM that computes a unary function does so using XI as input and output variable. Such a URM will have at least two instructions, since the s t o p instruction does not reference any variables. We arithmetize or code a URM Μ as a sequence of numbers—coded by a single number as in A.3.63—where each number of the sequence is the code of some instruction. A.3.67 Definition. (Codes for Instructions) The instructions are coded as follows, where XV is short for i ones
χΤ^~ϊ (1) L : XV « a has code (1, L, i, a). (2) L : XV < A T + 1 has code (2, L,i). (3) L : XV <XV
 1 has code <3,L,i).
(4) L : if Λ Τ = 0 goto Ρ else goto R has code (4, L, i, P, R)
255
A BRIEF THEORY OF COMPUTABILITY
(5) L : stop has code (5, L).
•
The first component of each instruction code z, (Z)Q denotes the instruction type, the second—(ζ) ι—the label, and the remaining components give enough information for us to uniquely know what precise instruction we are talking about. For example, in ζ = (3, L, i) we read that we are talking about the "decrement by one" instruction ((z)o = 3) applied to X I ((z) = i), which is found at label L ((z)i = L). In turn, we code a URM Μ as an ordered sequence of numbers, each being a code for an instruction. Thus given a code ζ (i.e., ζ codes something: Seq(z) holds) we can determine algorithmically whether ζ codes some URM. More precisely: 1
2
A.3.68 Theorem. The relation URM (z) that holds precisely if ζ codes a URM is in VTL.. Proof In what follows we employ shorthand such as (3z, w) and similarly for longer quantifier groupings and for V.
URM(z) = Seq(z) Λ (z) ^
(3z) (3w) ,
for
= <5,^(z)) Λ 21
lh(z)
(V» W ) ( i
 1
Φ Hz)
(i»j)o Φ 5) Λ
(VLW)(Se ((z)jr)A 9
[ ( 3 t , o ) < ( i ) = (l,L + l , i + l , o ) v z
L
( 3 < ) < Z { ( * ) L = < 2 , L + l , i + l) V
t»
t
= v3,!,+ l , t + l ) V
(3M,R) (z)
L
= (4,L+l,i + l,M+1,β+1)}])
•
A.3.69 Definition. An ID of a computation of a URM Μ is an ordered sequence L;a\,... ,a , where al) of M's variables are among the ΛΊ, A l l , . . . XV that we will denote by X i , . . . , x , and a* is the current value of xi immediately before instruction L is executed. L points precisely to the current instruction, meaning the next to be executed. All IDs have the same length, and we say that ID I\ = L\a\,...,a yields ID Ii = P; bi,..., b , in symbols Ii h Ii, exactly when r
r
r
T
(i) Llabels"xi <— c",andii and/2 are identical, except that 6j = c a n d P =
L+l.
Note that ζ = { ( z ) o , . . . , ( )ικ( )^\)< e have used positive labels; thus the last label is lh(z). Similar comment about "(3i, O.)< (Z)L = (1, L + 1, i + 1, a)", etc. Whyi + 1? Because the variables areJn.Xll.Xlll,... 21
D u t
ζ
ζ
Z
w
256
GODEL'S THEOREMS AND COMPUTABILITY
(ii) L labels " X J <— xi + 1", and 11 and I2 are identical, except that 6j = Oj + 1 andP = L + l . (iii) L labels "xj «— XJ — 1", and I\ and I2 are identical, except that 6* = Oj — 1 andP=L+l. (iv) L labels "if χ; = 0 goto R else goto Q", and h and 7 are identical, except that Ρ = Ρ if α, = 0, while Ρ = Q otherwise. 2
(v) L labels "stop", and I\ and /2 are identical. A terminating computation of Μ with input 0 1 , . . . , ojt is a sequence I\,...,I such that for all i < η we have /* h and for some j < n, Ij has as 0th member the label of s t o p . Moreover, I\ is initial; that is, if the input variables of Μ are, without loss of generality, the variables x i , . . . , x t , then n
h = l;ai,...,a ,fV^0
•
f c
r  fcOs
We code an ID / = L; a ,..., a as code(I) = (L, a\,..., computation Ιχ,... ,I by ( c o d e ( / i ) , . . . ,code(I )). x
a ) and a terminating
r
n
r
n
A.3.70Theorem. The relation Comp(z,y) that is true iffy codes a terminating computation of the URM coded by z, which has "XI" as its only input variable (cf. preambular remarks of subsection A.3.3, p. 254), is primitive recursive. Proof. By the remark on p. 254 that normalizes the input/output convention, it must be that lh(y) > 2. Definition A.3.69 allows us the technical convenience to include into an ID enough room for more variables than may actually be present in the URM (that is coded by) 2. Clearly (cf. A.3.67), a generous allowance for the length of an ID, as this is determined by the largest j such that XV occurs in z, is m a x { ( z ) j : i < lh(z)}. Even simpler (and more generous) is just z, which is the one we will work with. Thus, our IDs will each have length ζ + 1, allowing for the label information. Observe next that Comp{z,y)
= URM(z) Λ Seq(y) Λ ( V i )
< l h ( w )
[Seq((y)i) A lh((y)i) = ζ + l] Λ
lh(y) > 1 Λ
(y)j, (y) )
A
j+x
{Comment. The last ID surely has the label of z's stop.} ((y)i ( )±i)o h y
{Comment. The initial ID.} ((y) )o = 1 Λ (Vi)< (l < i 0
2
= lh{ ) z
Λ
((y) ), = 0) 0
The relation "yield(z, (y)j, (y)j+i)" above says "URM ζ causes (y)j h (y)j ". The notation "yield(z, u, v)" is thus shorthand that expands as follows (cf. A.3.69 and A.3.67): +x
A BRIEF THEORY OF COMPUTABILITY
yield{z,u,
ν) Ξ ( 3 f c ) < ( 3 L ) 2
257
( L + 1 = ( ) Λ k> 0 Λ  u
0
( 3 o ) < z ( W t = (hL + Ι,Α,ο) Λ ι, = 2 ^ [ / p f " ' J ) V + 1
p
:
u )
2 2
U
({z)
L
= (2, L + 1, k) Α υ = 2p u) V fc
((z)i, = ( 3 , 1 + (3P, P ) <
m ( 2 )
l,fc>
Av = 2(if (u)* = 0 then « else L«/PfcJ)) V
((«)£, = (4, L + 1, A, P, R) Α Ρ > 0 Λ R > 0 Λ υ = if (it)* = 0 then  U / 2 2
J2
p + 1
V
else [u/2 + \2 ) L
l + 2
R+1
((z)i.= (5,L + l>At; = u ) } )
•
A.3.71 Corollary. (The Kleene 7predicate) 77ie Kleene predicate T(z,x,y) that is true precisely when the URM ζ with input χ has a terminating computation y, is primitive recursive. Proof. By earlier remarks, T(z, x, y) = Comp(z, y) A ((y)n) = x.
•
1
Noting that for any predicate R(y,x), (M)XR(V,X),
(py)R(y,x)
is alternative notation for
we have:
A.3.72 Corollary. (The Kleene Normal Form Theorem) (1) For any URM M, if ζ is its code (A.3.67), then we have M*\ is defined on input (2) There is a primitive recursive function d such that for any Xx.f (χ) £ V there is a number ζ and we have for all x: f{x) =
d((py)T(z,x,y))
Proof. Statement (1) is immediate as "(3y)T(z, x, y)" says that there is a terminating computation of Μ (coded as z) on input x. For (2), we first remark that "=" means that the two sides are both undefined, or both defined and numerically equal. Now, the role of d is to extract from a terminating computation's last ID its 1st component—recalling our definition, A.3.2, and our convention that unary functions are computed, without loss of generality (cf. p. 254), as M${, for various M. Thus, for all y, d(y) = ((y)i ( )_i)! will do. • n y
22
The effect of "L + 1 : Xl
k
— a" on ID u = (L + 1 , . . . ) is to change L + 1 to L + 2 (effected by
the factor 2) and change the current value of X I * , (u)k—stored in the ID as a factor p £ * ' ' " \ a factor p
that we remove by dividing u by it—to a, this being stored in υ as a factor p £
+ 1
.
fc
258
GODEL'S THEOREMS AND COMPUTABILITY
A.3.73 Remark. The normal form theorem says that every computable unary function, in the technical sense of A.3.2, can be expressed as an unbounded search followed by a composition, using a toolbox of just two primitive recursive functions(!): d and Xzxy.\ (z, x, y). This representation, or "normal form", is parametrized by z, which denotes a URM Μ that computes the function in a normalized manner: as M$\. Thus what we set out to do at the beginning of this section is done: The twoinput URM U that computes Xzx.d((py)T(z, x, y))—clearly a computable function this, by closure properties of V (A.3.11 and A.3.18) and A.3.32—is universal, just as compilers are in computing. U accepts as inputs a program Μ coded as a number z, and data for said program, x. It then acts exactly as program ζ would on x, i.e., as Λίχι · • T
1
A.3.74 Definition. (Rogers's ^Notation ([41]) We denote by φ the 2th partial recursive function, in the sense that, for all ζ, φ = Xx.d((py)T{z, x, y)). • ζ
ζ
A.3.75 Remark. (1) From Definition A.3.67 it is clear that not every ζ £ Ν represents a URM. Nevertheless, Definition A.3.74 indexes all partial computable functions using all numbers from Ν as indices, not just those ζ that represent URMs. This is so because the term "d((py)T(z,x,y))" is meaningful for any z. Thus, if ζ is not a URM code, then T(z,x,y) will simply be false for all χ and all y; thus φ (χ) Τ for all x. This is fine! Indeed it is consistent with the phenomenon where a reallife computer program that is not syntactically correct (like our ζ here) will not be translated by the compiler and thus will not run. Therefore, for any input it will decline to offer an output; the corresponding function will be totally undefined. (2) Definition A.3.2, for the unary case, can now be rephrased as "Xx.f(x) £ V iff, for some ζ € Ν, / = φ ". We say that 2 is a "0index" of / . • ζ
ζ
A.3.76 Exercise. Prove that every function of V has infinitely many 0indices. Hint. There are infinitely many ways to modify a program and yet have all programs so obtained compute the same function. • A.3.77 Example. The nowhere^defined function can also be obtained from a program that compiles all right. Setting S = Xyx.x + 1 we note: (\)Xx.(py)S(y,x) £ V by A.3.32 and A.3.18. (2) By the techniques of A.3.16 we can write a program for Xx.(py)S(y, x). As a sideeffect we have that VTZ φ V and TZ φ V. • A.3.78 Exercise. (URMindependent Characterization of V) Define the concept oiVderivations as in A.3.20, however, adding a 4th case of what we may write at each step: We may also write λχ.(μ?/)/(y, x), if Xyx.f(y, x) is already written. Prove: (1) / £ V (as in Definition A.3.2) iff / appears in some Pderivation. (2) Of all possible sets of functions that include J and are closed under primitive recursion, composition and unbounded search, V is the smallest with respect to inclusion. •
259
A BRIEF THEORY OF COMPUTABILITY
A.3.79 Remark. (Case of Many Inputs) It has been convenient to present the normal form theorem, in particular the Kleene predicate, in terms of unary (1ary) functions. It is good to know that in doing so, in the presence of coding, we did not restrict generality at all. Indeed, if Xx .f(x ) G V, then so is g = Xz.f[(z) ,..., [z) ) by composition. Thus, every ηinput computable function is expressible via coding through a unary computable function: For all x , we have f{x ) = g((xn))In particular, if g = φ{, then for all x , we have f(x ) = Φί((χ )) and hence (by A.3.72) / ( £ „ ) = d((py)T(i,
n
0
n
n
n
n
n
η
n
n
n
η
α
η
υ
A.3.4
η υ
Semicomputable Relations; Unsolvability
We next define a Pcounterpart of TZ* and VTZ* and look into some of its closure properties. A.3.80 Definition. (Semicomputable Relations) A relation P(x) is called semicomputable iff for some / G V, we have, for all x , n
P(x ) n
= f(x )
I
n
(1)
The set of all semicomputable relations is denoted by V, Ρ
In) If / = φ in (1) above, then we say that "a is a semicomputable indexor just a semiindex of P(x )". If η = 1 (thus P C N ) and a is one of the semiindices of P, then we write Ρ = W ([41 ]). • We have at once: α
n
a
A.3.81 Theorem. (Normal Form Theorem for SemiComputable Relations) P(x„) € V* iff.forsomeae N, we have (for all x ) P(x ) Ξ (3z)T^(a,x , z). n
n
n
Proof. Only //part. Let P(x ) = / ( £ „ )  , with / e V. By A.3.79 / = some α G N. //part: By A.3.80 and A.3.79, P(x ) = φί \χ )  . But φ € V. n
η
n
η
α
for •
Rephrasing the above (hiding the "a" and remembering that VTZ* C 7£,), we have: A.3.82 Corollary. (Strong Projection Theorem) P(x ) € V* iff, for some recursive predicate Q(x , z), we have (for all x„) P(x ) = (Bz)Q(x , z). n
n
n
'We are making this symbol up. It is not standard in the literature.
n
260
GODEL'S THEOREMS AND COMPUTABILITY
Proof. Fortheo«/y£/,takeQ(f ,2)tobeAi*„z.r " (a,i ,2)forappropriatea For the if, take / = Xx .(pz)Q{x , z). Then / e P and P{x ) = f(x ) . (
)
n
n
n
n
n
n
e N. •
A.3.83 Remark. (Deciders and Verifiers) A computable relation P(x ) is, by definition, one for which χ Ρ € TZ; thus it has an associated URM Μ that decides membership of any o„ in P? "yes" (output 0) if it is in, "no" (output 1) if it is not. Thus this Μ is a decider for P(x ). A semicomputable relation Q{x ), on the other hand, comes equipped only with a verifier, i.e., a URM Ν that verifies a € Q, if true, by virtue of halting on input aWhile mathematically speaking a φ Q is also "verified" by virtue of looping forever on input a , algorithmically speaking this is no verification at all as we do not have a way of knowing whether Ν is looping forever as opposed to being awfully sluggish and being about to halt in a couple of trillion years (cf. halting problem A.3.88). In the algorithmic sense, a verifier (of a semicomputable set of mtuples) verifies only the "yes" instances of questions such as "Is a € Q?" • n
A
n
m
m
m
m
m
m
Clearly, though, if we have a verifier for a relation Q{x„) and also have a verifier for its complement •Q(xn), then we can build a decider for Q{x )' On input a we simply run both verifiers simultaneously. If the one for Q halts, we print 0 and stop the computation; if the one for iQ halts, we print 1 and stop. This computes XQ(3U) Put more mathematically, n
A.3.84 Proposition. IfQ(x ) n
n
and ^Q(x„) are in V*, then both are in TZ,.
Proof. Let i and j be semiindices of Q and
respectively, that is (A.3.81),
Q(x ) n
=
(3z)T< \i,x ,z)
^Q(x )
=
(3z)T^(j,x ,z)
n
n
n
n
Define g=
kx .{pz)(T \i,x ,z)VT^\j,x ,zj) (n
n
n
n
Trivially, g 6 V. Hence, g Ε TZ, since it is total (why?). We are done by noticing that<5(x ) = T^iijXn^gixn))By closure properties of TZ, (A.3.41), ~^Q(x ) is in TZ,, too. • n
n
A.3.85 Proposition. TZ, C V,. Proof. Let Q(x) e TZ, and y be a new variable (other than any of the x). By "h A = (3x)A if χ is not free in A" (cf. p. 188, Exercise 11) and soundness, we have Q(x) = (3y)Q(x) is true in the metatheory (where we are developing this section on computability). By A.3.82, Q(x) e V,. • "α € P" (set notation) is synonymous with "P(a ) η
n
holds" or just " F ( a ) " (relational notation). n
A BRIEF THEORY OF COMPUTABILITY
261
A.3.86 Definition. (Unsolvable or Undecidable Problems) A problem is a question "x £ RT for some set of ηtuples R. "The problem x € R is recursively unsolvable", or just unsolvable, or undecidable, means that the set R—equivalently, the relation x £ R or R(x )—is not in TZ*. Put colloquially, there is no URMprogrammable solution for the problem; there is no decider for the question "Is Xn 6 RT. The halting problem has central significance in computability. It is the question whether "program χ will ever halt if it starts computing on input x". That is, if we set Κ = {χ : φχ[χ) i), then the halting problem is χ € Κ. We denote the complement of AT b y / ? . • n
n
n
n
A.3.87 Exercise. The halting problem χ £ Κ κ semirecursive. Hint. The problem is "φ {χ) j " . Now invoke the normal form theorem (A.3.72(l)). • χ
A.3.88 Theorem. (Unsolvability of the Halting Problem) The halting problem is unsolvable. Proof. In view of the preceding exercise (and A.3.84), it suffices to show that Κ is not semicomputable. Suppose instead that i is a semiindex of the set. Thus, χ £ Κ = (3z)T(i, x, z), or, making the part χ £ Κ—that is, φ {χ) Τ—explicit: χ
^(3ζ)Τ{χ,χ,ζ)
= (3ζ)Ί\ί,χ,ζ)
(1)
Substituting i into χ in (1) we get a contradiction.
•
A.3.89 Remark. (1) Since Κ £ V*, we conclude that the inclusion TI* C V* (A.3.85) is proper, i.e., TI* C V*. (2) The characteristic function of Κ provides an example of a total unconfutable function. (3) In A.3.34 we saw an example of how to remove "points of nondefinitjon" from a function so that it remains computable but has been now extended to a total function. Can we always do that? No; for example, the function / = \χ.φ (χ) + 1 cannot be extended to a total computable function. Of course, by A.3.72, f £ V. Here is why: Suppose that g £ TZ extends / . Thus, g = φί for some i. Let us look at g(i): We have χ
g(i)
= by 9 = Φί
&(»)
φ
+
both sides defined
l
= d e f

o f
/(*) /
But since f(i) [, we also have g(i) = f(i) as g extends / ; a contradiction.
•
A.3.90 Theorem. (Closure Properties of V*) V* is closed under V, Λ, (3y), and (Vj/)< . // is not closed under either > or (Vj/).
(3y) ,
z
Proof. Given semicomputable relations P{x ), Q(y ) and R(y, uk) of semiindices p,q,r respectively. In each case we will express the relation we want to prove semicomputable as a strong projection (A.3.82): n
m
262
GODEL'S THEOREMS AND COMPUTABILITY
V P{S ) V Q ( y ) = {3ζ)Ί< \ρ,χ ,ζ) η
m
=
(3z)T^ \q,y ,z)
V
η
n
m
m
(3z)(T^(p,x ,z)VT^(q,y ,z)) n
m
Λ
P(*n)AQ(y )
=
m
(3z)T^(p,x ,z)A(3z)T^(q,y ,z) n
m
= (3w)((3z) l< \p,x ,z)
A
n
<w
(3y) R(y,u )
k
n
(3z) l< \q,y ,z)) m
<w
=
(3y) (3w)T^(r,y,u ,w)
=
(3w)(3y) 'I< Hr,y,u ,w)
m
k
k+1
k
(3y) (3y)R(y,U ) k
=
(3y)(3w)T^ Hr,y,u ,w) k+1
k
= (3z)(3y) (3w) T^ \r,
y, u ,w)
k+1
Vv) R(v,Zk)
=
k
(Vy) (3w)T( Hr,y,u ,w) k+1
=
k
(3v)(Vy) (3w) T< \r,y,u ,w) k+1
k
As for possible closure under i and Vy, Κ provides a counterexample to >, and ^T(x, x, y) provides a counterexample to Vy. • A.3.91 Remark. (Computably Enumerable Sets) There is an interesting characterization of nonempty semicomputable sets that is found in all introductions to the theory of computation. These sets are precisely those that can be "enumerated effectively" or "computably", that is, A nonempty set S C Ν is semicomputable iff some f £ VTZ has S as its set of outputs, or range as we say technically. Indeed, assume first that, for some semiindex i,x £ S = (3y)T{i, x, y) for all x. Intuitively now, we can enumerate all pairs x, y of numbers, coded as "(a;, y)", and for every pair that satisfies T(i, x, y) output x. Rigorously, this is accomplished by / given for all ζ as follows: (z) a
0
ar(i,(z) ,(z)i) otherwise 0
where "a" is some fixed member of S that we keep outputting every time the condition "T(i,x, y)" fails, ensuring that / is total. I wrote χ for (2)0 and y for (z)\ to connect with the preceding intuitive construction. Of course / is primitive recursive. 25
Because either we did not let the computation φ,(χ) to go on long enough, or no terminating computation exists. 2 5
GODEL'S FIRST INCOMPLETENESS THEOREM
263
Conversely, if S is the range of some primitive recursive g, that is, χ G <S = (3y)g(y) = χ holds for all x, we immediately get that S is semirecursive by A.3.82, since the graph of g, g(y) = x, is in VTZ, (cf. A.3.45). This result justifies the nomenclature computably enumerable (c.e.) and also recursively enumerable (r.e.) for all semicomputable sets (the nomenclature applies to the empty set as well on the understanding that its members can trivially be enumerated by doing nothing). There is no loss of generality in presenting the characterization for subsets of Ν since via coding (...) it can be trivially and naturally extended to sets of ηtuples for η > 1. • A.3.92 Exercise. Prove that if Xx.f(x) € V, then its graph y = f(x) is in P*.
•
A.3.93 Exercise. Prove that if y = f(x) is in P . , then Xx.f(x) G V.
•
A.3.94 Exercise. (Definition by Positive Cases) Consider a set of mutually exclusive relations Ri (x), i = 1 , . . . , n, that is, R, (χ) Λ Rj (χ) is false for each χ as long as i Φ j. Then we can define a function / by positive cases Ri from given functions fj by the requirement (for all x) given below:
m
his)
if
h{2)
ifR {x)
fn{x)
if R (x) otherwise
2
={ n
Prove that if each / , is in V and each of the Ri(x) is in P . , then / G P . Hint. Use A.3.92 and A.3.93 along with closure properties of V, relations. A.4
•
GODEL'S FIRST INCOMPLETENESS THEOREM
We prove here a semantic version of Godel's first incompleteness theorem that relies on computability techniques and the semantic notion of correctness of an axiomatic system. In this form the theorem states that any "reasonable" axiomatic system that attempts to have as theorems precisely all the "true" (firstorder) formulae of arithmetic will fail: There will be infinitely many true formulae that are not theorems. The qualifier reasonable could well be replaced by practical: One must be able to tell, algorithmically, whether a formula is an axiom—how else can one check a proof, let alone write one? "True" means true in the standard interpretation 9ΐ = (Ν, Μ) (given below). To set the stage more precisely, we will need some definitions and notation. In order to do arithmetic, we first need a firstorder (logical) language that we use to write down formulae and proofs. The alphabet of arithmetic has as nonlogical symbols the following: 0,S,+,x,<
264
GODEL'S THEOREMS AND COMPUTABILITY
These nonlogical symbols we can, of course, interpret in any way we please. However, the standard interpretation is given by the table below: Abstract (language) symbol 0
s
+ X
<
Concrete interpretation via Μ 0 (zero) Xx.x + 1 Xxy.x + y Xxy.x χ y Xxy.x < y
The alphabet has only one constant symbol; however, an arbitrary η e Ν can be captured formally in the language by the string SS^_S0 η times
which we will denote by η in order to distinguish it from the informal (metamathematical) name n. Thus, any axiomatic system (or theory) that we use to formally prove theorems of arithmetic will contain: (1) The firstorder alphabet described above
26
(2) The language, that is, the sets of wellformed formulae (WFF) and of terms, Term (3) A distinguished recursive subset of WFF: the special (or nonlogical) axioms for arithmetic 27
(4) Another distinguished subset of WFF: the logical axioms (4.2.1) (5) The rule of inference: modus ponens A.4.1 Remark. Several observations will be helpful: (i) We required that any axiomatic system we devise for arithmetic is "practical" (or "reasonable"). As we noted above, we understand this "reasonableness" as a promise to have a decider for axioms. This is why in (3) above we ask for a recursive set of (special) axioms. This immediately begs the question, "But is not a 'decider' a URM that expects numerical inputs, as opposed to string inputs?" 0 f course, this language has the standard logical part that any firstorder language has (cf. 4.1.2). A particularly famous choice of axioms is due to Peano—the socalled Peano arithmetic (PA). It has axioms that give the behavior of every nonlogical symbol, plus the induction axiom schema:
2 6
2 7
A[x := 0] Λ (Vx)(A
A[x := Sx]) — (Vx)A
This schema gives one axiom for each choice of the formula A.
GODEL'S FIRST INCOMPLETENESS THEOREM
265
There is no difference in principle, since a number (e.g., if written in standard decimal notation) is a string over {0,1,2,3,4,5,6,7,8,9} and, conversely, any string over {0,1,2,3,4,5,6,7,8,9} naturally represents a number. (ii) Applying this observation more generally to strings over any finite alphabet, not just over { 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 } , we will take a more careful approach that disallows "0" as a digit, because its presence has undesirable sideeffects. For this reason we act as follows: Given an alphabet of b > 1 symbols, we first fix an order of its members and assign to every symbol, as its value, its position number in the order, that is, 1 , 2 , 3 , . . . , b. Then any string α αι<ΐ2 · · • α of symbols a, over this alphabet can be thought of as a number expressed in socalled "όadic" notation φ being the "base" of the notation), where the symbols a; are badic digits: υ
a + αφ
1
0
+ ab
2
2
+ ••• +
η
ab
n
n
Conversely, any positive integer can be expressed in a unique way in 6adic notation (i.e., unique 6adic digits can be found) as above (cf. [39,1,47,49] and Remark A.4.2 below). In our present context, let us fix an order for the (finite version of the) alphabet of arithmetic displayed as (1) below. This alphabet has 35 members (separated by commas) that we view as 35adic digits of value, each, equal to its position in (1). For example, 1 is the value of digit "x", 11 of digit V , 12 of digit "0", 35 of digit " < " 2 8
:
x,y,z,u,v,w,=,p,q,
ry , 0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , T,±,(,),.,A,V, ,= V, S,+,x,< >
l
(1)
1
Boolean variables are generated as in (4), p. 94, while object variables as in the footnote 87, p. 115. Thus any string over the alphabet (1) denotes a number in "badic" notation, where b = 35. For example, the formulae (Vx')x' = x' and 0 < 1 have numerical values 29
11+135 +7·35 + 1135 +135 + 25·35 +11·35 +135 +31·35 +2435 1
2
3
4
5
6
7
8
9
and 13 + 35 · 35 + 12 · 3 5 1
2
respectively, that is, in standard decimal notation, 1961469340480871 and 15938 respectively. Programmers are aware of "hexadecimal" notation, that is, notation base16, where the digits that are allowed are 0 , 1 , 2 , 3 , 4 , 5,6, 7 , 8 , 9 , a, 6, c, d, e, f. Rather than using as digits "10", "15" etc., one uses "a" and " / " respectively to avoid the ambiguities of string notation that does not use separators between the symbols of a string. Sometimes we say a "badic number", just as we say "binary number", "hexadecimal number". 2 8
2,
266
GODEL'S THEOREMS AND COMPUTABILITY
Pause. So what are the issues with the digit "0"? Why not number the symbols in (1) by 0 through 34 and work in ordinary base 35, named usually 6ary, instead? Because we will have trouble with strings like x l < 0. The "digit" in the most significant position is (of value) 0 and we lose information as we pass to the string's numerical value. That is, both x l < 0 and 1 < 0 denote the same number. Correspondingly, associativity of concatenation will fail. Concatenating the digits "y" and "x" and "y" of the alphabet, first as (yx)y and then as y(xy), yields different (numerical) results, the first b + 1, the second 6 + 1 . 30
2
At the end of this discussion we see that to speak of a set of strings over the alphabet (1) is the same as talking about a subset of N, while terminology such as "the set WFF is decidable (or primitive recursive, or semicomputable, as the case may be)" is now technically meaningful. (iii) Now that speaking about "recursive sets of strings" makes sense, we note further that the sets WFF, Term, and Λι (logical axioms, cf. 4.2.1) are all recursive. Indeed, at the intuitive level we see that we can parse algorithmically, that is, we can write a URM that will do it for us, a string t to decide the question "Is t € T e r m ? " Rather than specifying what such a program might look like, I will rather outline how the characteristic function of the set Term, xxerm. will be defined by courseofvalues recursion from functions and relations known to be primitive recursive (in which case we just invoke A.3.65). To this end we just follow the definition (4.1.7) and define as follows, (a)(d), being careful to use boldface type for variable names, t, x, y, ζ etc., so that there will be no clash with the 35adic digits x, y, z, u, v, w—which are just names for the numbers 1,2,3,4,5,6—of the alphabet (1) (p. 265): (a) If t is a number whose 35adic representation is a variable or a constant,
then we \ctx
(t) = 0 .
Term
(b) If t is a number whose 35adic representation is Sx, for some string χ (over alphabet (1)), then we let XTerm(t) = 0 precisely when XTerm(x) = 0. (c) If t is a number whose 35adic representation is + z , for some string z, then we let XTerm(t) = 0 precisely when (3x,y)
(d) If t is a number whose 35adic representation is χ ζ, for some string z, then we let XTerm(t) = 0 precisely when ( 3 x , y ) ( x T e r m ( x ) = 0 Λ XTerm(y) = 0 Λ
"bary" signifies base6 and digit range 0 to 6 — 1. Cf. the term binary. "6adic", signifies base6 but digit range 1 to 6. Using digits 1 and 2, base2, we have, dyadic notation, not binary. The term "badic" is due to Smullyan [47]. Interestingly, the suffix adic is Greek for ary: Cf. dyadic vs. binary (dyo or "δυο" is Greek for two). M
GODELS FIRST INCOMPLETENESS THEOREM
267
t (expressed in 35adic notation) is the string χ x y )
3
(e) We set XTerm(t) = 1 in all other cases. Similarly, one can outline a courseofvalues recursion for the characteristic function of WFF, thus showing the primitive recursiveness of the set (equivalently, of the membership relation). Finally, the logical axioms, i.e., the partial generalizations of formulae in the groups AxlAx6, can be algorithmically recognized from their shape (Ax2Ax6) or via truth tables (Axl) once the partial generalization prefix is removed. It is also worth noting that the only rule of inference (thinking of logic 2, cf. Chapter 5) is algorithmically applicable. Indeed, the configuration A
B,A\
Β
is recognized by its form. Thus the relation M P ( x , y, z) on numbers—that is true precisely when the numbers x, y, ζ expressed in 35adic notation have the forms A —> B, A and Β respectively, for some formulae A and Β—is recursive (decidable).
• A.4.2 Remark. (Digression) (1) One theorem of Euclid states that having fixed a b > 1 (from N), any η € Ν has a unique quotient and remainder, that is, unique q and r exist—where 0 < r < b—such that η = bq + r. One immediately obtains, for the same b > 1, and any η > 0 a unique representation η = bn + ν, where 0 < υ < 6, and both π and ν are in Ν (*) The existence part in (*) follows from Euclid's theorem: Given η > 0, we have q and r, where 0 < r < b, such that η = bq + r. If r φ 0, take π = q and υ = r. Otherwise, since q φ 0 (why?), take π = q  1 and υ = b. Uniqueness is settled by Euclid's old argument: If bn + υ = bn' + v', for 0 < ν < b and 0 < v' < b, then b is a factor of the absolute difference \v  v'\. As \v — v'\ < b (why?), this forces ν = v'. Trivially, then, π = π ' as well. Statement (*) leads to the existence and uniqueness of 6adic representations for positive integers exactly in the same manner Euclid's theorem induces the existence and uniqueness of 6ary representations for nonnegative integers. Proceeding by strong induction we note that η = 1 has a 6adic representation: "1". Admitting the claim for all 1 < m < n, and using (*), we have (I.H. applied to η) η = 6(αη + «Ϊ1& + • · · + akb ) + ν for some appropriate 6adic digits Oj. This settles existence. For uniqueness let k
1
α + αιδ Η 1
0
where 0 < α<, Cj < b for all ai + a 6 + 2
hab
k
k
= c + C16 Η 1
0
h c 6'm m
(**)
By (*) we have an = cq. Thus h a b,kl = C + C26 + • · · + c 6, m'  l 1
k
2
m
"This, "x, y < t" is what makes the recursion "courseofvalues". In " + x y " we are using the formal prefix notation for terms rather than the friendly (but informal) "x + y " .
268
GODEL'S THEOREMS AND COMPUTABILITY
and, as above, a = ci. And so on (or use induction). (2) Now we can go back and prove χ G VTZ in detail. We will first develop some tools for manipulating 6adic numbers. As before, we will typeset all the variables that we employ in boldface to distinguish them from the digits χ, y, ζ, u, ν, w ofalphabet(l)p. 265. We fix the base 6 throughout our discussion and show that λχ.χ, the length of the number χ expressed in 6adic notation, is in VTZ: t
Τ ε π η
32
We next show that concatenation is a primitive recursive operation. We will denote by χ * y the (numerical) result of concatenating the 6adic representations of χ and y in that order. Since χ * y = xfjl l + y, we have Axy.x * y £ VTZ. The absence of 0 digits makes clear that (x * y) * ζ = χ * (y * ζ), thus writing "x * y * z" is unambiguous. Note that the number 0 behaves like the empty string, in terms both of its length and its behavior with respect to concatenation: 0 * y = 06' ' + y = y and χ * 0 = χ6'°Ι + 0 = x. Let next x B y be the relation "the 6adic representation of χ is a prefix of that of y". This relation is primitive recursive (cf. A.3.45) since x S y ΞΞ (3z)< y = χ * z. Similarly, for the "postfix relation" x £ y that means "the 6adic representation of χ is a postfix of that of y" and the "part o f relation, x P y , meaning "the 6adic representation of χ is a substring of that of y": xEy = (3z)< y = ζ * χ and xPyEE(3z)< (zByAx£z). Let now d be any digit among the ones allowed in 6adic notation: 1 , 2 , . . . , 6. The relation Xx.tallyd (x) says that χ is nonzero and all its digits (in 6adic notation) are the sameasd. This, too, is primitive recursive: taUyd{x) = χ > OA(Vz)< (zPxAz = 1  > z = d). y
y
y
y
y
x
Important Notational Convention: In expressing the various formulae and functions we are consistently using the value of an alphabet symbol rather than its name. Thus, rather than writing " OBx" to indicate that the alphabet symbol "0" begins the (badic representation of) x, we write instead "12Bx"; rather than χ = χ, we write χ = 1, etc. Most of the above machinery based on 6adic concatenation was developed by Smullyan ([47]) and Bennett ([1]) and is retold in Tourlakis ([49]), the ideas having originated in Quine ([39]). To conclude our task, we will show first that the relation Var(x) that is true precisely when the 6adic notation of χ has the syntax of an object variable (cf. footnote 87, p. 115) is in VTZ. We split our task into two subtasks: That is, positive integers written in 6adic notation for some 6 > 1.
GODEL'S FIRST INCOMPLETENESS THEOREM
269
(i) The relation Num(x) says that the 6adic notation of the number χ is a string over the subalphabet {0,1,2,3,4,5,6,7,8,9} of (1) that does not begin with 0. We now have Num(x) Ξ Χ > 0 Λ  Ί 2 Β χ Λ ( V y ) < ( y P x Λ y = 1 —> y = 12 V y = 1 3 V y = 1 4 V y = 1 5 V y = 1 6 V y = 1 7 V y = 1 8 V y = 19 V y = 20 V y = 21). Clearly, Num{x) € VTl . 3 3
x
34
t
(ii) Var{x) = (3y, z ) < ( ( y = 0 V tally {y)) Λ (ζ = 0 V Num{z)) Λ (x = l * y * z V x = 2*y*zVx = 3*y*zVx = 4*y*zVx = 5*y*zVx = 6*y*z). 35
n
x
Finally, revisiting
xjerm
we see at once:
XTerm(t) =
'if V a r ( t ) V t = 12
thenO
else if ( 3 x ) < ( t = 32 * χ Λ XTerm(x) = 0)
then 0
36
t
• else if ( 3 x , y ) ( t = 33 * χ * y Λ χ ( χ ) = 0 Λ XTerm(y) = 0) else if ( 3 x , y ) ( t = 34 * χ * y Λ * erm(x) = 0 Λ x erm(y) = 0) else < t
< t
Τ β π η
T
T
then 0 then 0 1
A.43 Exercise. The reader is invited to similarly prove, in detail, that the relations (1) χ € WFF, which holds exactly when the number x, expressed in 6adic notation, is a formula, and (2) ΜP(x,y,z), which holds precisely when the numbers x , y , z , expressed in 6adic notation, are formulae of the forms A, (A —* B) and Β respectively, are primitive recursive. • A.4.4 Exercise. Elegant as the primitive recursive definition of the 6adic length x may be, it is, in practical terms, computationally very inefficient. For one thing, the recursion has as many levels as the value of x. With more thought the depth of recursion can be reduced to x, which is approximately log (x). Effect such a definition by first getting two primitive recursive functions quot and res such that for any χ > Oandy > 1 we have χ = quot(x, y ) y + r e s ( x , y) withO < res(x,y) < y. Then observe that for any χ > 0, the 6adic length of χ is one longer than that of quot(x,b). • h
Let us now agree on a coding of proofs. Since a proof is a sequence of formulae, Ao,...,A , and as each formula can be naturally identified with a number, we will code such sequences, and hence proofs, as {Ao,. • ., A ). n
n
33
Digit "0". Digit "0". Digit"/" has value 11. 3 2 is the value of digit "S", 33 is that of "+" and 34 that of " χ ".
3 4
3 5
3 6
270
GODEL'S THEOREMS AND COMPUTABILITY
A.4.5 Lemma. Given the stipulations (1M5) above (p. 264), the relation inProof(y,
x)
which holds precisely when the number y codes a proof of the formula coded by x, is decidable. Proof. (Outline) We have enough confidence by now to accept that the relation χ Ε Λι, which holds exactly when the number χ—expressed in 6adic notation—is a logical axiom, is recursive (indeed with some effort one can prove that it is primitive recursive). Recall that we have also stipulated that the set of special axioms of arithmetic is decidable. That is, S P ( x ) is recursive, where the relation holds exactly when the number x, expressed in 6adic notation, is a special axiom. It is a stipulation rather than an observation because we want to allow the widest variety of "practical" axiomatizations of arithmetic over the alphabet (1) of p. 265. If we restrict attention to the particular Peano axiomatization, then one can actually prove (with some effort) that the set of special axioms is in fact primitive recursive (cf. [53]). Then m P r / ( y , x ) ΞΞ Seq(y) Λ ( V i ) 0 O
( 5 P ( ( y ) , ) V (y), Ε Λ , ν
(3j, k ) ( M P ( ( y ) , ( y ) , (y),) V M P ( ( y ) , (y)j, (y),)) • < i
j
k
k
A.4.6 Lemma. The set ofall theorems of any axiomatization of arithmetic satisfying the stipulations (l)(5) above (p. 264) is semicomputable. Proof. Let AR be the set of all theorems of an axiomatization that is as stated above. By the preceding lemma, χ Ε AR ΞΞ (By)inProof(y, χ). • A.4.7 Remark. Thus (as we remarked long ago, p. 7; see also footnote 8 on that page), for any axiomatization of arithmetic that satisfies the stipulations (1 ){5), there is a computer program that without any input, and if it is allowed to run forever, will print (in coded form, as numbers) all its theorems. All the program has to do is to use as a subprogram a URM that computes a primitive recursive / that has AR as its range (cf. A.3.91). This computer program will behave simply as follows: for i = 0 , 1 , 2 , 3 , . . . p r i n t / ( i ) . • Let us call complete arithmetic (CA) the set of all closed formulae over our language of arithmetic ((1) on p. 265)—i.e., formulae with no free variables, also called sentences—that are true in 91: CA = {closed A : (=<τί A} We make some preliminary observations before we state and prove Godel's first incompleteness theorem.
271
GODEL'S FIRST INCOMPLETENESS THEOREM
A.4.8 Exercise. We have noted that the "informal number η is captured in the language of arithmetic by the term
ss_^so length η
which we abbreviate as n". Make this statement precise by proving, using the table on p. 264 and simple induction on η > 1, that ( S 0 ) ' = n, where I used the abbreviation " S " for the string SS... S of length n. • n
1
n
Following on the above and noting that n having written η for S Q. That is (A. 1.6),
m
= η (A. 1.5(5)), we have ( n )
51
=
n, m
n
(=<η η = η
(1)
Since (by firstorder soundness and Ax6) \= η = η —> (Α [ π ] ΞΞ A  n ] ) for any formula A over the language of arithmetic, we obtain, in particular, (=οτ η = η —» (Α {η} = A [ n ] ) and hence 3 7
h „ A [ n ] = AIn]
(2)
By iterating this a finite number of times we can prove things such as =
(A[x =i]) :
S
= (A[x:=i])
(3)
C
Since \= t = i —• (A[x := t] ΞΞ A [Χ : = i}) as above, we have in particular (=c i = i —* (A[x := ί] ΞΞ A[X : = i]). Taking also i = r into account—that is, (i = i ) = t—we get =D (A[x := ί] ΞΞ A[X := i}). Or, in different notation, we have (3) above. As for (s[x := = (s[x := i ] ) we can use 7.0.8 rather than Ax6. Right? B
0
B
25
We will need one last preparatory item: A.4.9 Definition. (Correctness; [48]) An axiomatization of arithmetic is termed "correct" precisely when the standard interpretation 91 is a model of the set of the special axioms. • Correctness is not the same as soundness. All firstorder theories satisfy the soundness theorem (A. 1.21). However, there are consistent axiomatizations of arithmetic that are not correct ([48, 53]).
The notation " [ . · • ] " was introduced in Definition A. 1.14.
272
GODEL'S THEOREMS AND COMPUTABILITY
A.4.10 Theorem. (Godel's First Incompleteness Theorem) Any axiomatic system for arithmetic that satisfies (l)(5) of p. 264 and, moreover, is correct must be incomplete in the sense that its set of theorems cannot contain the set CA: There will be true sentences of arithmetic that the system cannot prove. Proof We will show that if Godel's theorem fails, then we can build a URM that solves the halting problem—a known impossibility (A.3.88). Let us then have a set of (special) axioms over the language of arithmetic—an axiomatization—that satisfies (1 )(5) and that contains as theorems all of the set CA. Thus, if θ is the set of theorems of the axiomatization, CA C θ
(*)
We note that θ is semicomputable (A.4.6); thus, for some recursive Q(y, x), x e 0 = (3y)Q(y,x)
(*.)
We will accept here a fact proved in the next section: The relation φ (χ)  is definable in 91 (cf. A. 1.14). More specifically, we can find a formula of arithmetic, A, of one free variable χ such that, for all i € Ν, φι(ϊ) \ = =