J .Donald Monk
Mathematical Logic
Springer- Verlag New York
Heidelberg
Berlin 1976
to Dorothy
J. Donald Monk Department of Mathemat~cs Un~vers~ty of Colorado Boulder, Colorado 80302
Editorial Board P. R. Halmos
F. W . Gehring
C. C . Moore
Mur~ugrrrgEdrtor
Un~versityof Michigan Department of Mathemat~cc Ann Arbor. M~chigan48104
Un~versityof Californ~aat Berkeley Depanment of Mathematics Berkeley, Califorma 94720
Univers~tyof Californ~a Depanment of Mathematics Santa Barbara. California 93106
A M S Subject Classifications Primary: 02-xx Secondary: ION-xx, 06-XX, 08-XX, 26A98
Library o f Congress Catalog~ngIn Publication Data Monk, James Donald, 1930 Mathematical logic. (Graduate texts in mathematics ; 37) Bibliography Includes indexes. 1. Logic, Symbolic and mathernat~cal.I. Title. 11. Series. QA9.M68 511'.3 75- 42416
All rights reserved No part of this book may be translated or reproduced in any form without written permission from Springer- Verlag.
@ 1976 by Springer-Verlag lnc. Printed in the United States of America
ISBN 0-387-90170-
1
Springer-Verlag
New York
ISBN 3- 540-90 170- I
Springer-Verlag
Berlin
Heidelberg
Preface
This book is a development of lectures given by the author numerous times at the University of Colorado, and once at the University of California, Berkeley. A large portion was written while the author worked at the Forschungsinstitut fur Mathematik, Eidgennossische Technische Hochschule, Ziirich. A detailed description of the contents of the book, notational conventions, etc., is found at the end of the introduction. The author's main professional debt is to Alfred Tarski, from whom he learned logic. Several former students have urged the author to publish such a book as this; for such encouragement I am especially indebted to Ralph McKenzie. I wish to thank James Fickett and Stephen Comer for invaluable help in finding (some of the) errors in the manuscript. Comer also suggested several of the exercises. J . Donald Monk October, 1975
Contents
Introduction Interdependence of sections Part I
Recursive Furzctiorl Theory 1. Turing machines
2. 3. *4. 5. 6. 7.
Elementary recursive and primitive recursive functions Recursive functions; Turing computability Markov algorithms Recursion theory Recursively enumerable sets Survey of recursion theory
Part I1
Elemerlts of Logic *8. *9. 10. 1I. * 12.
Sentential logic Boolean algebra Syntactics of first-order languages Some basic results of first-order logic Cylindric algebras
Introduction
Part I11
Decidable and Urzdecidahle Theories 13. 14. 15. 16. 17.
Some decidable theories Implicit definability in number theories General theory of undecidability Some undecidable theories Unprovability of consistency
Part 1V
Model Theory 18. 19. *20. 21. 22. *23. 24. 25. 26. 27. 28.
Construction of models Elementary equivalence Nonstandard mathematics Complete theories The interpolation theorem Generalized products Equational logic Preservation and characterization theorems Elementary classes and elementary equivalence Types Saturated structures
Leafing through almost any exposition of modern mathematical logic, including this book, one will note the highly technical and purely mathematical nature of most of the material. Generally speaking this may seem strange t o the novice, who pictures logic as forming the foundation of mathematics and expects to find many difficult discussions concerning the philosophy of mathematics. Even more puzzling t o such a person is the fact that most works on logic presuppose a substantial amount of mathematical background, in fact, usually more set theory than is required for other mathematical subjects at a comparable level. T o the novice it would seem more appropriate t o begin by assuming nothing more than a general cultural background. In this introduction we want t o try to justify the approach used in this book and similar ones. Inevitably this will require a discussion of the philosophy of mathematics. We cannot d o full justice t o this topic here, and the interested reader will have t o study further, for example in the references given at the end of this introduction. We should emphasize at the outset that the various possible philosophical viewpoints concerning the nature or purpose of mathematics d o not effect one way or the other the correctness of mathematical reasoning (including the technical results of this book). They d o effect how mathematical results are to be intuitively interpreted, and which mathematical problems are considered as more significant. We shall discuss first a possible definition of mathematics, and then turn t o a deeper discussion of the meaning of mathematics. After this we can in part justify the methods of modern logic described in this book. The introduction closes with an outline of the contents of the book and some comments on notation. As a tentative definition of mathematics, we may say it is an apriori, exact, abstract, absolute, applicable, and symbolic scientific discipline. We now
Part V
Unusual Logics 29. Inessential variations 30. Finitary extensions 3 1. Infinitary extensions Index of symbols Index of names and definitions
fi
Introduction
consider these defining characteristics one by one. To say that mathematics is a priori is to say that it is independent of experience. Unlike physics or chemistry, the laws of mathematics are not laws of nature or dependent upon laws of nature. Theorems would remain valid in other possible worlds, where the laws of physics might be entirely different. If we take mathematical knowledge to mean a body of theorems and their formal proofs, then we can say that such knowledge is independent of all experience except the very rudimentary process of mechanically checking that the proofs are really proofs in the logical sense-lists of formulas subject to rules of inference. Of course this is a very limited conception of mathematical knowledge, but there can be little doubt that, so conceived, it is apriori knowledge. Depending on one's attitude towards mathematical truth, one might wish to broaden this view of mathematical knowledge; we shall discuss this later. Under broadened views, it is certainly possible to challenge the a priori nature of mathematics; see, e.g., Kalmar [6] (bibliography at the end of this introduction). Mathematics is exact in the sense that all its terms, definitions, rules of proof, etc. have a precise meaning. This is especially true when mathematics is based upon logic and set theory, as it is customary to do these days. This aspect of mathematics is perhaps the main thing that distinguishes it from other scientific disciplines. The possibility of being exact stems partially from its a priori nature. It is of course difficult to be very precise in discussing empirical evidence, because nature is so complex, difficult to classify, observations are subject to experimental error, etc. But in the realm of ideas divorced from experience it is possible to be precise, and in mathematics one is precise. Of course some parts of philosophical speculation are concerned with a priori matters also, but such speculation differs from mathematics in not being exact. Another distinguishing feature of mathematical discourse is that it is generally much more abstract than ordinary language. One of the hallmarks of modern mathematics is its abstractness, but even classical mathematics is very abstract compared to other disciplines. Number, line, plane, etc. are not concrete concepts compared to chairs, cars, or planets. There are different levels of abstractness in mathematics, too; one may contemplate a progression like numbers, groups, universal algebras, categories. This characteristic of mathematics is shared by many other disciplines. In physics, for example, discussion may range from very concrete engineering problems to possible models for atomic nuclei. But in mathematics the concepts are a priori, already implying some degree of abstractness, and the tendency toward \ abstractness is very rampant. Next, mathematical results are absolute, not revisable on the basis of experience. Again, viewing mathematics just as a collection of theorems and formal proofs, there is little to quarrel with in this statement. Thus we see once more a difference between mathematics and experimental evidence; the latter is certainly subject to revision as measurements become more exact.
Introduction
Of course the appropriateness of a mathematical discipline for a given empirical study is highly subject to revision. Experimental evidence and a posteriori reasoning hence play a role i11 motivation for studying parts of mathematics and in the directions for mathematical research. One's attitude toward the absoluteness of mathematics is also colored by differing commitments to the nature of mathematical truth (see below). A feature of mathematics which is probably not inherent in its nature is its applicability. A very great portion of mathematics arises by trying to give a precise mathematical theory for some concrete, perhaps even nonmathematical, situation. Of course geometry and much of classical mathematics arose in this way from special intuition derived from actual sense evidence. Also, logic owes much to this means of development; formal languages arose from less formal mathematical discourse, the notion of Turing machine from the intuitive notion of computability, etc. Many very abstract mathematical disciplines arose from an analysis of less abstract parts of mathematics, and may hence be subsumed under this facet of the discipline; group theory and algebraic topology may be mentioned as examples. This aspect of mathematics is emphasized in Rogers [12], for example. Finally, the use of symbolic notation is a main characteristic of mathematics. This is connected with its exact nature, but even more connected with the development of mathematics as a kind of language. In fact, mathematics is often said just to be a language of a special kind. Most linguists would reject this claim, for mathematics fails to satisfy many of their criteria for a language, e.g., that of universality (capability of expressing usual events, emotions, ideas, etc. which occur in ordinary life). But mathematics does have many features in common with ordinary languages. It has proper names, such as n and e, and many mathematical statements have a subjectpredicate form. In fact, almost all mathematical statements can be given an entirely nonsymbolic rendering, although this may be awkward in many cases. Thus mathematics can be considered as embedded in the particular natural language-English, Russian, etc.-in which it is partially expressed. But also mathematics can, in principle, be expressed purely symbolically; indeed, a large portion of mathematics was so expressed in Russell and Whitehead's Principia Mathernatica. Now we turn to a discussion of the nature of mathematical truth. We shall briefly mention three opposed views here: platonism, formalism, and intuitionism. The views of most mathematicians as to what their subject is all about are combinations of these three. On a subjective evaluation, we would estimate the mathematical world as populated with 65y0 platonists, 30y0 formalists, and 5y0intuitionists. We describe here the three extremes. There are (perhaps) more palatable versions of all three. According to extreme platonism, mathematical objects are real, as real as any things in the world we live in. For example, infinite sets exist, not just
Introduction
as a mental construct, but in a real sense, perhaps in a "hyperworld." Similarly, nondenumerable sets, real numbers, choice functions, Lebesgue measure, and the category of all categories have a real existence. Since all of the mathematical objects are real, the job of a mathematician is as empirical as that of a geologist or physicist; the mathematician looks at a special aspect of nature and tries to discover some of the facts. The various mathematical statements, like the Riemann hypothesis or the continuum hypothesis, are either true or false in the real world. The axioms of set theory are axioms in the Greek sense-self-evident statements which form a partial basis to deductively arrive at other truths. Hence such results as the independence of the continuum hypothesis relative to the usual set-theoretical axioms force the platonist into a search for new insights and intuitions into the nature of sets so as to decide the truth or falsity of those statements which cannot be decided upon the basis of already accepted facts. Thus for him the independence results are not results about mathematics, but just about the formalization of mathematics. This view of mathematics leads to some revisions of the "definition" of mathematics we gave earlier. Thus it no longer is independent of empirical facts, but is aS empirical as physics or chemistry. But since a platonist will still insist upon the absolute, immutable nature of mathematics, it still has an a priori aspect. For more detailed accounts of platonism see Mostowski [lo] or Godel [3]. In giving the definition of mathematics we have implicitly followed the view of formalists. A formalist does not believe that any mathematical objects have a real existence. For him, mathematics is just a collection of axioms, theorems, and formal proofs. Of course, the activity of mathematics is not just randomly writing down formal proofs for random theorems. The choices of axioms, of problems, of research directions, are influenced by a variety of considerations-practical, artistic, mystical-but all really nonmathematical. A revised version of platonism is to think of mathematical concepts not as actually existing but as mental constructs. A very extensive understructure for much of formalism is very close to this version of platonismthe formal development of a mathematical theory to correspond to certain mental constructions. Good examples are geometry and set theory, both of which have developed in this way. And all concept analysis (e.g., analyzing the intuitive notion of computability) can be viewed as philosophical bases for much formal mathematics. Another motivating principle behind much formalism is the desire to inter-relate different parts of mathematics; for example, one may cite the ties among sentential logic, Boolean algebra, and topology. Thus while mathematics itself is precise and formal, a mathematician is more of an artist than an experimental scientist. For more on formalism, see Hilbert [5], A. Robinson [ll], and P. Cohen [ 2 ] . For another discussion of platonism and formalism see Monk [9]. Intuitionism is connected with the constructivist trend in mathematics: a mathematical object exists only if there is a (mental) construction for it. This philosophy implies that much ordinary mathematics must be thrown
Introduction out, while platonism and formalism can both be used to justify present day mathematics. Even logical principles themselves must be modified on the basis of intuitionism. Thus the law of excluded middle-for any statement A, either A holds or (not A) holds-is rejected. The reasoning here goes as follows. Let A, for example, be the statement that there are infinitely many primes p such that p 2 is also a prime. Then A does not presently hold, for we do not possess a construction which can go from any integer m given 2 with m < p. But (not A) also does not to us and produce primes p and p hold, since we do not possess a construction which can go from any hypothetical construction proving A and produce a contradiction. One may say that intuitionism is the only branch of mathematics dealing directly with real, constructible objects. Other parts of mathematics introduce idealized concepts which have no constructive counterpart. For most mathematicians this idealism is fully justified, since one can make contact with verifiable, applicable mathematics as an offshoot of idealistic mathematics. See Heyting [4] and Bishop [I].
+
+
Now from the point of view of these brief comments on the nature of mathematics let us return to the problem of justifying our purely technical approach to logic. First of all, we do want to consider logic as a branch of mathematics, and subject this branch to assevere and searching an analysis as other branches. It is natural, from this point of view, to take a no-holdsbarred attitude. For this reason, we shall base our discussion on a settheoretical foundation like that used in developing analysis, or algebra, or topology. We may consider our task as that of giving a mathematical analysis of the basic concepts of logic and mathematics themselves. Thus we treat mathematical and logical practice as given empirical data and attempt to develop a purely mathematical theory of logic abstracted from these data. Our degree of success, that is, the extent to which this abstraction corresponds to the reality of mathematical practice, is a matter for philosophers to discuss. It will be evident also that many of our technical results have important implications in the philosophy of mathematics, but we shall not discuss these. We shall make some comments concerning an application of technical logic within mathematics, namely to the precise development of mathematics. Indeed, mathematics, formally developed, starts with logic, proceeds to set theory, and then branches into its several disciplines. We are not in the main concerned with this development, but a proper procedure for such a development will be easy to infer from the easier portions of our discussion in this book. Inherent in our treatment of logic, then, is the fact that our whole discussion takes place within ordinary intuitive mathematics. Naturally, we do not develop this intuitive mathematics formally here. Essentially all that we presuppose is elementary set theory, such as it is developed in Monk [8] for example. (See the end of this introduction for a description of set-theoretic notation we use that is not standard.) Since our main concern in the book is
Introduction
Introduction
certain formal languages, we thus are confronted with two levels of language in the book: the informal metalanguage, in which the whole discussion takes place, and the object languages which we discuss. The latter will be defined, in due course, as certain sets (!), in keeping with the foundation of all mathematics upon set theory. It is important to keep sharply in mind this distinction between language and metalanguage. But it should also be emphasized that many times we take ordinary metalanguage arguments and "translate" them into a given formal language; see Chapter 17, for example. Briefly speaking, the book is divided up as follows. Part I is devoted to the elements of recursive function theory-the mathematical theory of effective, machine-like processes. The nfost important things in Part I are the various equivalent definitions of recursive functions. In Part I1 we give a short course in elementary logic, covering topics frequently found in undergraduate courses in mathematical logic. The main results are the completeness and compactness theorems. The heart of the book is in the remaining three parts. Part I11 treats one of the two basic questions of mathematical logic: given a theory T, is there an automatic method for determining the validity of sentences in T? Aside from general results, the chapter treats this question for many ordinary theories, with both positive and negative results. For example, there is no such method for set theory, but there is for ordinary addition of integers. As corollaries we present celebrated results of Godel concerning the incompleteness of strong theories and the virtual impossibility of giving convincing consistency proofs for strong theories. The second basic question of logic is treated in Part IV: what is the relationship between semantic properties of languages (truth of sentences, denotations of words, etc.) and formal characteristics of them (form of sentences, etc.)? Some important results of this chapter are Beth's completeness theorem for definitions, Lindstrom's abstract characterization of languages, and the Keisler-Shelah mathematical characterization of the formal definability of classes of structures. In both of these chapters the languages studied are of a comprehensive type known as first-order languages. Other popular languages are studied in Part V, e.g., the type theory first extensively developed by Russell and Whitehead and the languages with infinitely long expressions. Optional chapters in the book are marked with an asterisk *. For the interdependence of the chapters, see the graph following this introduction. The book is provided with approximately 320 exercises. Difficult o r lengthy ones are marked with an asterisk *. Most of the exercises are not necessary for further work in the book; those that are are marked with a prime '. The end of a proof is signaled by the symbol 0. As already mentioned, we will be following the set-theoretical notation found in [8]. For the convenience of the reader we set out here the notation from [8] that is not in general use. For informal logic we use " 3" for "implies," "c-" or "iff" for "if and only if," " 7"for "not," "V" for "for all," and "3" for "there exists." We distinguish between classes and sets in the usual fashion. The notation {x : p(x)) denotes the class of all sets x such
that ~ ( x ) Inclusion . and proper inclusion are denoted by c and c respectively. The empty set is denoted by 0, and is the same as the ordinal number 0. We let A B = {x : x E A , x $ B). The ordered pair (a, b) is defined by (a, b) = {{a), {a, b)); and (a, b, c) = ((a, b), c), (a, b, c, d) = ((a, b, c), 4 , etc. A binary relation is a set of ordered pairs; ternary, quaternary relations are defined similarly. The domain and range of a binary relation R are denoted by Dmn R and Rng R respectively. The value of a function f at an argument a is denoted variously by "f, .f, f",fa, fa, f(a); and we may change notation frequently, especially for typographical reasons. The symbol ( ~ ( i :) i E I) denotes a function f with domain I such that f i = ~ ( ifor ) all i E I. The sequence (x,, . . ., x , - ~ ) is the function with domain m and value xi for each i E m. The set *B is the set of all functions mapping A into B. An m-ary relation is a subset of "A, for some A. Thus a 2-ary relation is a set of ordered pairs, (x, y). By abuse of notation we shall sometimes identify the two kinds of ordered pairs, of binary relations, ternary relations, etc. We write f * A for {fa : a E A). The notationsf: A -+ B,f:A +-B, f : A x- B, andf: A* B mean that f is a function mapping A into (onto, one-one into, one-one onto respectively) B. The identity function (on the class of all sets) is denoted by I. The restriction of a function F to a set A is denoted by F A. The class of all subsets of A is denoted by SA. Given an equivalence relation R on a set A, the equivalence class of a E A is denoted by [a], or [a], while the set of all equivalence classes is denoted by AIR. Ordinals are denoted by small Greek letters a,/3, y , . . ., while cardinals are denoted by small German letters m, n, . . . . The cardinality of a set A is denoted by IA [ . The least cardinal greater than a cardinal m is denoted by mC.For typographical reasons we sometimes write (exp (m, n) for mn and exp m for 2m. One final remark on our notation throughout the book: in various symbolisms introduced with superscripts or subscripts, we will omit the latter when no confusion is likely (e.g., [a], and [a] above).
-
r
BIBLIOGRAPHY 1. Bishop, E. Foundations of Constructive Analysis. New York: McGraw-Hill (1967). 2. Cohen, P. Comments on the foundations of set theory. In: Axiomatic Set Theory. Providence: Amer. Math. Soc. (1971), 9-16. 3. Godel, K. What is Cantor's continuum problem? Amer. Math. Monthly, 54 (1947), 515-525. 4. Heyting, A. Intuitionism. Amsterdam: North-Holland (1966). 5. Hilbert, D. Die logischen Grundlagen der mathematik. Math. Ann., 88 (1923), 151-165. 6. Kalmar, L. Foundations of mathematics-whither now. In: Problems in the Philosophy of Mathematics. Amsterdam: North-Holland (1967), 187-194. 7. Kreisel, G. Observations on popular discussions of foundations. In: Axiomatic Set Theory. Providence: Amer. Math. Soc. (1971), 189-198. 8. Monk, J. D. Introduction to Set Theory. New York: McGraw-Hill (1969).
Introduction
Introduction
9. Monk, J. D. On the foundations of set theory. Amer. Math. Monthly, 77 (1970), 703-71 1. 10. Mostowski, A. Recent results in set theory. In: Problems in the Philosophy of Mathematics. Amsterdam: North-Holland (1967), 82-96. 11. Robinson, A. Formalism 64. In: Logic, Methodology, and the Philosophy of Science. Amsterdam: North-Holland (1964), 228-246. 12. Rogers, R. Mathematical and philosophical analyses. Philos. Sci., 31 (1964), 255-264.
Interdependence of Chapters
Chapter 1: Turing Machines
1
(3) Move tape one square to the right. (4) Move tape one square to the left. (5) Stop.
Turing Machines
We now want to make this rigorous. Definition 1.1. A Turing machine is a matrix of the form
In this chapter we shall present a popular mathematical version of effectiveness, Turing computability, which will form our main rigorous basis for the mathematical discussion of effectivity. Actually in this section we present only some of the basic definitions concerning Turing machines and some elementary results which both illuminate these definitions and form a basis for later work. The definition of Turing computability itself is found in Chapter 3. After giving the formal definition of a Turing machine we discuss briefly the motivation behind the definition. In our exposition of Turing machines we follow Hermes [2] rather closely. A Turing machine (intuitively) consists of a mass of machinery, a reading head, and a tape infinite in both directions. The machine may be in any of finitely many internal states. The tape is divided up into squares calledfields of the tape (see figure).
l l l l l l l l ~ 1 l 1 ~1 .. .
... Left
I
A>
machinery Mass Of
reading head
Right
I
The machine proceeds step by step. At a given step it takes an action depending on what state it is in and upon what it finds on the field that the reading head is on. We allow only two symbols, 0 and 1, to be on a given field, and all but finitely many of the fields have 0 on them. These are the actions the machine can take: (1) Write 0 on the given field (first erasing what is there). (2) Write 1 on the given field (first erasing what is there).
where: c,, . . ., c, are distinct members of w, v,, . . ., v,, E (0, 1, 2,3,4) and dl, . . ., d,, E {cl, . . ., c,). c,, . . .,c, are called states. c, is called the initial state of the machine. We think of a row ci e vj dj of this matrix as giving the following information: when the machine is in state ci and scans the symbol e on the tape, it takes action vj and then moves into state dj. Here the action given by vj is as follows: v, = 0: write 0 on scanned square; vj = 1 : write 1 on scanned square; vj = 2: move tape one square to the right; vj = 3: move tape one square to the left; vj = 4: stop. To make this precise, we proceed as follows: Definition 1.2. Let Z be the set of all (negative and nonnegative) integers. A tape description is a function F mapping Z into (0, 1) which is 0 except for finitely many values. A configuration of a given Turing machine T is a triple (F, d, e) such that F is a tape description, d is a state, and e is an integer (which tells us, intuitively, where the reading head is). A computation step of T is a pair ((F,d, e), (F', d', e')) of configurations such
Part 1: Recursive Function Theory
Chapter 1 : Turing Machines the case of two tapes, for example, one may instead use odd and even numbered squares on a single tape. These intuitive comments on the strength of Turing machines of course would require proof. Some of them will be proved later, and we hope that they will all seem plausible after we have worked with Turing machines a while. For a more detailed argument on the strength of Turing machines see the introduction to [2].
that : if the line of the Turing machine beginning with (d, Fe) is (d, Fe, w, f), then : if w = 0 if w = 1 ifw=2 ifw=3
then then then then
F' = F& F' = F", F1=F, F1=F,
d' = f, d' = f, dl=f, d'=f,
-
e' = e; e' = e; el=e-1; el=e+l.
,
Here F; is the function ( F {(e, Fe))) u {(e, E ) } . Thus F: is the tape description acting like F except possibly at e, and Fze = e . A computation of T is a finite sequence ((Fo, do, eo), . . ., (F,, dm,em)) of configurations such that do = c,, ((F,, di, ei), (Fi+l, d,+l, ei+,)) is a computation step for each i < m, and the row of the Turing machine beginning (dm,Fe,) has 4 as its third entry. The way a Turing machine runs has now been described. To compute a functionf, roughly speaking we hand the machine a number x and it produces fx as an output. Since only zeros and ones appear on a tape, we cannot literally hand x to the machine; it must be coded by zeros and ones. The mathematically most obvious way of coding x is to use its binary representation as a "decimal" with base 2. However, this is inconvenient, in view of the very primitive operations which a Turing machine can perform. We elect instead to represent x by a sequence of x + 1 one's. (This is sometimes called the tally notation.) The extra "one" is added in order to be able to recognize the code of the number zero as different from a zero entry on the tape whose purpose is just as a blank. The precise way in which functions are computed by a Turing machine will be defined in Chapter 3. In this chapter we want to see how these rather primitive looking machines can nevertheless perform some intricate operations on strings of zeros and ones. These results will be useful in Chapter 3 and later work. Using the intuitive notion of coding we can argue as follows that Turing machines are really quite powerful: We have seen informally how to represent any number on a tape. A sequence of numbers can be represented by putting blanks (zeros) between the strings of ones representing the numbers. By using two blanks one can code several blocks of numbers, or one can use the two blanks to recognize a portion of the tape set aside for a special purpose. By repeated adjoining of a one, it is possible to add with a Turing machine; and by repeated addition, one can multiply. Since a new state depends on the currently scanned symbol, it is possible to set up different actions depending upon what is on the tape. And we are not really restricted to just one square in this decision making, since by using several states we can examine any restricted portion of the tape. In the general theory of Turing machines, one allows several symbols instead of just 0 and 1 (see, e.g., [2]). However, it is clearly possible to code these different symbols by different strings of 1's. Several tapes may also be allowed. Again such a modification can be coded within our machines; in
Definition 1.3. Trig,, is the following machine :
Proposition 1.4. For any tape description F and any e E Z, ((F, 0, e), (F, 1, e - 1)) is a computation of Trig,,. Thus Trig,, merely moves the tape one square to the right, and then stops.
Definition 1.5. TI,,, is the following machine: 0 0 3 1 0
1 3 1
1 0 4 1 1 1 4 1
Proposition 1.6. For any tape description F and any e E Z, ((F, 0, e), 1)) is a computation of TI,,,. (F, 1, e
+
Thus TI,,, moves the tape one square to the left and then stops.
Definition 1.7. To is the following machine:
,-
Proposition 1.8. For any tape description F and any e E Z, (i) if Fe = 0,then ((F, 0,e)) is a computation of To; (ii) if Fe = 1 , then ( ( F , 0,e), (F& 0,e)) is a computation of To. Thus To writes a 0 $a zero is not here, but does not move the tape.
Chapter 1: Turing Machines
Part 1: Recursive Function Theory
Definition 1.13.
Definition 1.9. T, is the following machine:
T,seekois the following machine: 0 0 3 1 0 1 3 1 1 0 4 1
Proposition 1.10. For any tape description F and any e E Z, (i) ifFe = 0, then ((F, 0, e), (F;, 0, e)) is a computation of T,; (ii) zyFe = 1, then ((F,0, e)) is a computation of TI. T, writes a 1 i f a 1 is not there, but does not move the tape. Definition 1.11. If a is any set and m E w , let a'"') be the unique element of "'{a). Thus a"')' is an m-termed sequence of a's, a'") = (a, a , . . ., a) (m times). If x and y are finite sequences, say x = (x,, . . ., x,-,) and y = (yo, . . .,yn-&, we let xy = (x,, . . ., xm-,, yo, . . ., yn-,). Frequently we write a for (a). Definition 1.12. T, ,,,,, is the following machine:
1 1 1 0 T,,,,,, finds the first 0 to the right of the square it first looks at and stops at that 0.
Definition 1.14. T,,,,,,
is the following machine: 0 0 2 1 0
1 2 1
1 0 0 0 1 1 4 1 T,,,,,, finds the first 1 to the left of the square it first looks at and stops at that 1. It may be that no such 1 exists; then the machine continues forever, and no computation exists.
Definition 1.15. T, ,,,,,is the following machine : 0 0 3 1
A computation with Tlseekocan be indicated as follows, where we use an obvious notation :
0 1 3 1 1 0 0 0 1 1 4 1 T,,,,,, finds the first 1 to the right of the square it first looks at and stops at that 1. But again, it may be that no such 1 exists.
0 1"')' a
-
A
Definition 1.16. Suppose M, N , and P are Turing machines with pairwise disjoint sets of states. By M + N we mean the machine obtained by writing down N after M, after3rst replacing all rows of M of the forms (c 0 4 d ) or (c' 1 4 d') by the rows (c, 0 0 e) or (c' 1 1 e) respectively, where e is the initial state of N. By
f Reading head Thus T,,,,,, finds the first 0 to the left of the square it first looks at and stops at that 0. In this and future cases we shall not formulate an exact theorem describing such a fact; we now feel the reader can in principle translate such informal statements as the above into a rigorous form. - 0
we mean the machine obtained by writing down M, then N, then P, after first replacing all rows of M of the forms (c 0 4 d ) or (c' 1 4 d') by the
Part 1: Recursive Function Theory
Chapter I : Turing Machines In the nontrivial case we start with - 0'") 0 0'") -; m > 0 :
rows (c 0 0 e) or (c' 1 1 e') respectively, where e is the initial state of N and e' is the initial state of P. Obviously we can change the states of a Turing machine by a one-one mapping without effecting what it does to a tape description. Hence we can apply the notation just introduced to machines even if they do not have pairwise disjoint sets of states. Furthermore, the above notation can be combined into large "flow charts" in an obvious way.
A
-
Definition 1.17. TSee,, is the following machine :
Stop
Tr seek 1
Tl seek 1
if 1
(Here by Trig,,-+ Stop we mean that the row (1 1 4 1) of Trig,,is not to be changed.) This machine just finds a 1 and stops there. It must look both left and right to find such a 1; 1's are written (but later erased) to keep track of how far the search has gone, so that the final tape description is the same as the initial one. If the tape is blank initially the computation continues forever. Since this is a rather complicated procedure we again indicate in detail a computation using Tseekl.First we have two trivial cases: Starting with
1a A
Starting with 0 1 A
Here i
=
1 initially, and the portion beyond 0'"-1) 1 0(23--2)0 O ( n - i + l )
place only if i < m and i I n. Thus, if we start with
n
+ 1r
m, we end as follows (setting i = m):
-
takes A 1 O(m) 0 O(n) -, and A
Part 1: Recursive Function Theory
On the other hand, if we start with - Ocm) 0 Ocn) 1 -, and n as follows (setting i
=
n
A
+ 1):
+ 1 < m we end
I !
Chapter 1: Turing Machines
Definition 1.20. TltranS is the following machine:
7 * To Trig,, TI
Start --+Tleft + TI,,,
-+
+
Jifo Tright
The action of Tltrans is indicated thus, in the case of interest to us:
The tape is otherwise unchanged
Definition 1.21. TI,,,,, is the following machine :
1.0
T trans TI,,,, acts as follows in the case of interest to us:
Definition 1.18. TI,,, is the following machine:
4
Start
The tape to the left and right of this portion of x unchanged.
lift
TIseek 0 -+ Trig,+,3 T e f t
+
TI,,, moves the tape to the right until finding 00, and stops on the rightmost of these two zeros. TI,,, does not start counting zeros until moving the tape.
1
i
f
l
TI,,,
+
+I Tl seek 0
ifo -+
Jifo
Tl trans
Definition 1.19. T,,,, is the following machine:
Start -+T, seek
Definition 1.22. Tfinis the following machine:
Tmt
Trendmoves the tape to the left until finding 00, and stops on the left-most of these two zeros. Trenddoes not start counting zeros until moving the tape.
I Tright
1
TI trans
+ y + 5 symbols is
Chapter 1 : Turing Machines
Part 1: Recursive Function Theory
T,,,,,,acts as follows:
T,,, acts as follows in the case of interest t o us:
wherep = xo this :
+ x, + . . . + xmVl+ 2m + 2. I n c a s e m = 0, it workslike
The tape is otherwise unchanged. This machine copies the nth block t o the left. These are all the basic machines needed t o compute functions. We shall return t o Turing machines after discussing some classes of number-theoretic functions. BIBLIOGRAPHY
I n each case the tape is otherwise unchanged. Here "fin" abbreviates "finish." This machine will be used at the end of computations t o erase scratchwork.
1. Davis, M. Computability and Unsolvability. New York : McGraw-Hi11 (1958). 2. Hermes, H. Enurnerability, Decidability, Computability, 2nd ed. New York: Springer (1969). 3. Minsky, M. Computation. Englewood Cliffs: Prentice-Hall (1967).
EXERCISES
Definition 1.23. T,,,, is the following machine:
1.25. Give an example of a Turing machine which gets in a loop-repeats configurations over and over.
some
1.26. Give an example of a Turing machine which never stops, but doesn't get in a loop. 1.27'. Prove rigorously that T,,,,,,
does what is said in the text.
1.28'. Prove rigorously that T,,,,,, does what is said in the text.
T,,,, acts as follows:
1.29'. Prove rigorously that T,,, does what is said in the text. 1.30'. Prove rigorously that T,,,, does what is said in the text. 1.31'. Prove rigorously that T,,,,,, does what is said in the text. 1.32. Show that there is no Turing machine which, started at an arbitrary position, will find the left-most 1 on the tape.
Construct a Turing machine which will print the sequence 11001100. . .
The tape is otherwise unchanged.
1.33.
A machine M repeated m > 0 times will be indicated by M m in our
1.34. Construct a Turing machine that stops iff there are at least two one's on the tape.
diagrams.
Definition 1.24. F o r
ti
> 0, Tn,,,, is the following machine:
I
Start -+ TFSeek+ Tl,rt
t
if I
To
+ T,!'A;k 0
-+
TI
+
TI"i% o
-+
TI
Chapter 2: Elementary recursive and primitive recursive functions
7
Elementary recursive and primitive recursive functions
(3) the 2-ary operation f such that f(m, n) = Im - nl for all m, n E W ; (4) the 2-ary operation f such that f(m, n) is the greatest nonnegative integer ~ m l (if n n # O), 0 if n = 0 ; we denote f(m, n) by [mln]; ( 5 ) for each positive integer n and each i < n, the n-ary operation f on w such that for all x,, . . ., xn-, E w, f(x,, . . ., xn-,) = xi;f is denoted by U:; it is called an identity or projection function. Second, and last, A is required to be closed under the following operations upon number-theoretic functions : (a) The operation of composition. Iff is an m-ary function, and g o , . . . , g m _ ,are n-ary functions, then the composition off with g o , . . . , gm-, is denoted by K: (f;go, . . ., g m -,); it is defined to be the n-ary function h such that for all x,, . . ., xn-, E w, ~ ~ ( X. .C. I Xn ? - 1) = f(go(x09 . . ., Xn - I), . . . , gm- I(XO,. . ., Xn - 1)). (b) The operation of summation. Iff is an m-ary function, then g (m-ary) is obtained from f by .sun7mation, in symbols g = I f , if for all x,, . . ., X m - 1 EW, t
To show that many number-theoretic functions are Turing computable, it is convenient to distinguish some functions by closure conditions. The class of elementary recursive functions which we shall now define in this way is a class of intuitively effective functions which contains most of the effective functions actually encountered in practice. However, not every effective function is elementary recursive. Toward the end of the chapter we introduce the wider class of primitive recursive functions, which still does not cover all kinds of intuitively effective functions. In the next chapter we go from primitive recursive functions to a class of functions, the recursive functions, intuitively corresponding to the entire class of effective functions. An elementary recursive function is just a function obtainable from the usual arithmetic operations of addition, subtraction, multiplication, and division by composition, summation, and multiplication. Most of this chapter is concerned with listing out some elementary functions and with giving operations which lead from elementary functions to elementary functions. This is necessary in order to be able to easily recognize that some of the rather complicated intuitively effective functions are, in fact, elementary recursive. A more detailed treatment of the topics of this section can be found in PCter [2].
Definition 2.1. A number-tl~eoreticfunction is a function which is, for some positive integer n7, an in-ary operation on W. The class of ~lcnwntary rcywrsi~,~, or for brevity elemcntary function.\, is the intersection of all classes A of number-theoretic functions such that, first of all, the following specific functions are in A : ( I ) +, the usual 2-ary operation of addition; (2) ., the usual 2-ary operation of multiplication;
, Yxm-1) ):Y g ( x o , . . . > ~ m - 1=) C { ~ ( X ~ , . . . , X ~ - ~ < [note that if m
=
1 the definition reads
for any m, we have g(x,, . . ., x ,-,, 0) = 0 by convention]. (c) The operation of multiplication. I f f is an m-ary function, then g (m-ary) is obtained from f by multiplication, in symbols g = if for all x,, . . . , xm-, E W,
nf,
n
g h , . . ., ~ ~ - = 1 )
{ ~ ( x o ,. .., xm-2, Y) : Y < xm-1)
[if x m - , = 0, the right hand side is 1 by convention]. It should be evident that each elementary function is effectively calculable in the intuitive sense. To convince oneself of this, it is enough to argue that each of the functions (1)-(5) above is effectively calculable, and that the class of effectively calculable functions is closed under the operations (a)-(c). For (1)-(S), the ordinary school algorithms suffice for this argument. As to (a)-(c), suppose, for example, that j; an m-ary function, is effectively calculable, and we wish to show that 2 f also is. Given x,, . . . , x m - , E W,we merely calculate f ( x o , . . ., x , , - ~ ,O), f ( x o , . . ., xm-2,I), . . ., f ( x o , . . ., x , , - ~ ,xm-I - 11, which we can do since f is effectively calculable, and then we add them all up by the school process, giving us ( 2f)(x,, . . . , xm-,).
Chapter 2: Elementary recursive and primitive recursive functions
Part 1 : Recursive Function Theory
PROOF.If xo, . . . , x P _ ,E w , then, with I side,
=
left hand side and r
=
We now proceed to show that many garden-variety number-theoretic functions are elementary and that simple operations on elementary functions again give elementary functions. For later purposes it is convenient to formulate results of the second kind in a more general way. A class A of number-theoretic functions is said to be closed under elementary recursive operations provided A contains all the elementary functions 2.1(1)-(5) and is closed under composition, summation, and multiplication. Obviously the class of all elementary functions is closed under elementary recursive operations. So will be all of the wider classes of effective functions which we discuss later.
right hand
The following theorem is the usual set-theoretical consequence of a definition like 2.1.
Proposition 2.4. Let A be closed under elementary recursive operations. Iff is m-ary andf E A, and rr is a permutation of (0, . . . , m - 11, then the m-ary function g such that g(xo, . . ., x,- ,) = f(x,,, . . ., x ,,) for all x,, . . ., x,-, E w is also in A .
,-
Proposition 2.3. A nunzber-theoretic function f is elementary iff there is a jinite sequence (go, . . . ,g, _ ,) of number-theoretic functions such that g,-, = f, and for each i < k one of the following conditions holds: G) gi = +, (ii) gi = ., (iii) g, = subtraction (in the sense of 2.1(3)), (iv) g, = division (in the sense of 2.1(4)), (u) gi = U; for some n > 0, some j < n, (vi) g, is n-ary, andfor some m > 0 there exist j < i and k,, . . . , k, - , < i such that g j is m-ary, g,,, . . ., g are n-ary, and g, = K: (g, ; gh.O,, , ., gh.(,- ,,) (g, ix obtained from earlier funcrions by composition), (vii) there is a j < i such that g, = 1(g,), (viii) there is a j < i such that gi = 1-1(g,).
PROOF.g
=
K: (f; UFO,. . ., U:,-,,).
0
Proposition 2.5 (Identification of variables). Let A be closed under elementary recursive operations. Iff is m-ary, m > 1, and f E 4 then the (m - 1)-ary function g such that g(xo, . . ., x,-,) = f(x0, . . ., x,-,, x0)for all xo, . . ., xm-, E w is in A.
4;
,,,-,,
PROOF. Let A be the set of all f such that there is a finite sequence of the kind described in the theorem. By considering I-termed sequences it is easy to see that +, ., subtraction, division, and U; are all in A (for any 11 > 0 and j < n). Suppose f E A , f is wary, h,, . . ., 11, 6 A , all of h,, . . . , /I,_, are n-ary. Choose a finite sequence (go, . . . , g, - ,' such that g, - = f and or each i < k one of the conditions (i)-(uiii) holds for g,. For each j < nl choose a finite sequence (I ,.,, . . . , I,,,,-,)such that I,,,,-,= 11, and for each i < a, one of the conditions (i)-(viii) holds for I,,. Then consideration of the sequence
By means of 2.4 and 2.5 variables can be identified in an arbitrary number of places. Thus iff is 3-ary elementary, so is the function g with g(x, y) = f(x, y, y), for if h(x, y, z) = f(y, x, z), h is elementary by 2.4; letting k(x, y) = h(x, y, x) for all x, y E w , k is elementary by 2.5, and g(x, y) = k(y, x) for all x, y E w , SO g is elementary by 2.4. Usually it is just as easy in cases like this to use the method of proof of 2.4 and 2.5.
I
I
I PROOF.g =
1 shows that K; ( f ; /I,, . . . , h,- ,) E A . Thus A is closed under composition. 1f f E A , so that a sequence (g,,. . ., g , - l i exists as in the theorem, then 1f \ and cg,, . . . , gh-,, rI f ) show that Zf, consideration of (a,, . . . , g, _,, f E A . Hence every elementary function appears in A . This proves =>. If j t A , with (go,. . ., g,_,> given as in the theorem, then it is easily shown by induction on i that g , is elementary for each i < k . In particular, f = g,-, is elementary; this proves +.
rI
Proposition 2.6 (Adjoining apparent variables). Let A be closed under elementary recursive operations. Iff is m-ary and f E A, then the (m + 1)-ary function g such that g(x,, . . . , x,) = f(xo, . . ., x,-,) for all xo, . . . , x, E w, is in A .
(f; U t f l , . .., U;+j).
D
Definition 2.7 (i) For n > 0, m E w , C; is the n-ary function such that C ; (x,, . . .,xn-,) = m for all x,, . . . , x,-, E w . (ii) sg and are unary functions; for x E w , sgx -
=
sgx =
0 1
{
ifx=O, if x f 0, if x = 0, it.x.0.
Chapter 2: Elementary recursive and primitive recursive functions
Part 1: Recursive Function Theory
(iii)
# is a unary function :
fix=@-
I
I
ifx=O i f x + o for all x
E w.
(iu) By convention, O0 = 1, OX = 0 for x # 0 ; O! = 1. (v) a is a unary function: 4x = x + 1 for all x E w. Thus Ck is the n-ary constant function with value m. The functions sg and @ are of a technical usefulness. / is the predecessor function and 4 the successor function.
The definition 2.9(iii) is motivated by our intuitive feeling that a relation R is effective iff x, is an effective function. In fact, if we have an effective procedure for determining membership in R, then we can effectively calculate XR as follows. Given any object a, determine whether a E R or a $ R. In the first case, X,a = 1, and in the second case, X,a = 0. Conversely, suppose we have an effective procedure for calculating values of x,. Given any object a, calculate XRa. If XRa = 1, then a E R. If x,a = 0, then a $ R. Given any class A of number-theoretic functions, an m-ary numbertheoretic relation R is said to be an A-relation if X, E A.
Proposition 2.10. 0 and w are elementary; i f x
Ew
then {x) is elementary.
Proposition 2.8. The following functions are elementary: (i) C", for n # 0) (ii) 4 (iii) sg (iv) Sg (0) exponentiation (vi) factorial (vii) p
PROOF (1) Ch is elementary: CA x = Ix - xl for all x E w. ,,CA y, for all x E w. is elementary: Sg x = (2) (3) sg is elementary: sg x = Sg Sg x for all x E w. (4) C: is elementary: C: x = @ C; x for all x E w. (5) C1, is elementary: (by induction on m) C;+, x = C; x + C: x for all X E W. (6) Ck is elementary: Ck (x,, . . ., x,-,) = C; U6 (x,, . . ., x,-,) for all
n,
Xo
,..., X , - 1 E W .
+
(7) 4 : 4X = X c: X. (8) exponentiation : xY = (9) factorial : x! = ,az. (10) p : p x = \ x - c:x\ .sg x.
nZ,Ug (x, z). n,,
Definition 2.9 (i) By an m-ary number-theoretic relation (m > 0) we mean a set of is the set of all m-tuples of natural m-tuples of natural numbers. numbers. As usual, we identify l w and W,in an informal way. (ii) If R is an m-ary number-theoretic relation, its characteristic function x,, is the m-ary number-theoretic function such that for all x,, . . ., Xm-1 E w, 0 if (xo, . . ., x,,,-~>$ R, X R ( X O ' . . . * X ~ - ~ ) = { Ii f ( ~ ~ , . . . , x ~ - ~ > E R . (iii) An m-ary number-theoretic relation R is elementary if X, is elementary.
By 2.10, {x) is always on effectively decidable set. Intuitively speaking, to check whether y E {x) we simply check if y = x (surely an effective matter). As an example, let B = (0) if Fermat's last theorem is true, yhile B = 0 if it is false. B is an effectively decidable set, although we do not know now whether 0 E B or not. Thus there is a decision procedure for membership in B, but we don't know what it is (it is either the obvious one for (0) or the obvious one for 0).
Proposition 2.11. Let A be closed under elementary recursive operations. If R and S are A-relations, then so are R n S, R u S, and "w R.
-
PROOF. For all x,, . . ., xm-,, x,,S(xo, . . ., Xm- 1) = XR(XO, . . .,Xm- 1) .XS(XO, . . .,x,,,-~), xT(xO,. . .,x,-~) = Sg xR(xO,. . .,xm- with T = R, R v S = R) n ( m ~S)]. 0
- -
-
-
Corollary 2.12. Every Jinite subset of w is elementary, andso is every cojinite set. Proposition 2.13. The binary relations I, < , 2 , = , # are elementary. ~ W P .
For any x, y E w,
-
so # is elementary. Finally, 5 ==
#).
=
(<
u
=), 2
=
(2" , . , <), >
=
(zw
- s), 0
Proposition 2.14 (Bounded existential quantifier). Let A be closed under elementary recursive operations. Suppose R is an m-ary A-relation. Let
Chapter 2: Elementary recursive and primitive recursive functions
Part 1 : Recursive Function Theory
. . .,xm-1): there is a y < x,Then S is an A-relation.
S = {(x,,
such that (x,, . . . , x,-
2,
y)
E
R).
R,, . . . , R, - , are pairwise disjoint n-ary A-relations with U,, ,Ri = and f is the n-ary function such that, for all x,, . . . , xn E w,
Proposition 2.15 (Bounded universal quantifier).' Let A be closed under elementary recursive operations. Suppose R is an m-ary A-relation. Let T = {(x,, . . .,x,- 1):for every y < x,-I we have (x,, . . ., x,- ,, y) E R). Then T is an A-relation. PROOF. Let S be as in 2.14, with R replaced by "w S.
-
R. Then T
=
0
Definition 2.16 (Bounded minimum). Let R be an m-ary relation. For all x,, . . .,x , - ~ E w, let the least y < x,-I such that (x,, . . ., x,-,, y) E R, if there is such a y, f , . . ., x 1 = {O otherwise. f(x,, . . ., x,-,) is denoted by py < X,-~R(X,, . . ., x ,-,, y). Proposition 2.17. Let A be closed under elementary recursive operations. If R is an m-ary A-relation, then the function f of 2.16 is a member of A. PROOF. Note that (1) Sg
2 xR(xo, . . ., xm-2, Y) =
~ < t
,
1
if (x,, . . ., x,-
0
otherwise.
Let g(x,, . . .,x,-,, i) = Sg 2, X R ( ~.O. .,, x,-,, i E w. Thus g E A. From (1) we see that 2 { g ( x o,..., x , - 2 , a i ) ; i < x , - l ) =
,,y) # R for all y < i,
y) for all x,, . . ., x,-,,
if there is a y < x . . ., x - ) x,~lsuchthat(xo,..., x , - ~ , ~ ) E R , otherwise.
Definition 2.19 (i) for x, y E w , let
(ii)
x i f x ~ y , y ifx>y. (by induction). For m > 2, rnin, (x,, . . . , x,-,) = min (min,-I (x,, . . ., x,-,), x,-,), with rnin, (x, y) = min (x, y). max (x, y), max, (x,, . . ., x,- ,) similarly. rm (x, y) = remainder upon dividing x by y, if y # 0 ; rm (x, 0) = 0. ( = {(x, y) : x divides y) = {(x, y) : there is a z such that y = xez). PM = {x : x is a positive prime). min (x, y)
(iii) (iv) (u) (vi) (vii)
=
Proposition 2.20. All of the functions and relations of 2.19 are elementary. PROOF. Obvious, as concerns (i)-(iv). For (v),
Hence For (vi), note that xl y iff there is a z such that y = x . z iff there is a z < y such that y = x.z; now see 2.14. Finally, p E PM iff for every x < p, either not xlp or x = 1, and p f 0, p Z 1; cf. 2.15. 0 The rather technical proof of 2.17 may be compared with a proof of the intuitive version of the proposition, which goes: if R is an m-ary effective relation, then the function f of 2.16 is effective. In fact, to calculate f(x,, . . ., x,-,), we test successively whether (x,, . . . , x,-,, 0 ) E R, (x,, . . ., x,-,, 1) E R, . . ., (x,, . . ., x,-,, x,-,) E R. If at some point we reach an i such that (x,, . . ., x,-,, i) E R, we set f(x,, . . ., x,-~) = i and stop testing. If we complete our testing without finding such an i we setf(xo, . . ., x,= 0.
Proposition 2.18 (Definition by cases). Let A be closed under elementary recursive operations. Suppose go,. . ., g,-l are n-ary members of A ,
Definition 2.21. For every k let pl, be the (k PI = 3, p, = 5, . . ..
+ 1)st prime; thus po = 2,
Proposition 2.22 (Number-theoretic). For every k, p, PROOF. By induction on k. Trivial for k
=
exp (2,2'").
0, 1. Induction step, k > 0:
Pk+l 5 P O . .. . p k - 1 (Euclid) 5 exp (2,2O). . . . .exp (2,2'") - 1 (induction hypothesis) - 2.Uexp(2.i):i
Chapter 2: Elementary recursive and primitive recursive functions
Part 1: Recursive Function Theory
A relation R is primitive recursive iff X, is a primitive recursion function.
Proposition 2.23. p is elementary. PROOF. Let N = { ( x ,y) : x , y E PM, x < y, and y is the next prime after x}. Thus N = {(x,y) : x , y E PM and x < y and for all z < y, either z Ix or not z $ PM), so N is elementary. Let Pr = { ( x ,k ) : x is the ( k + 1)st prime}. Thus ( x , k ) E Pr if x E PM and &,, x,,y = k , so Pr is elementary. Finally, pk = px < exp (2,2'") + l ( ( x , k ) E Pr), so p is elementary. 0
Definition 2.24. If a = 0 or a = 1, let (a), = 0. If a > I let (a), be the exponent of pi in the prime decomposition of a. Sometimes we write (a)i instead of (a),. Proposition 2.25. ( ) is elementary. PROOF. (a), = px < a(p:la and not p;+ l la).
Definition 2.26. la
=
greatest i such that p,lx (=0 if x
=
0 or 1).
Proposition 2.27. 1 is elementary. PROOF. la
=
pi < a[p,lx and V j 5 a(i < j => p,+a)].
We now proceed to study a larger class of functions, the class of primitive recursive functions. Most of the effective functions encountered in the literature were actually shown to be primitive recursive. Actually most of them are even elementary, and usually this can easily be shown. We feekthat it is only an historical accident that elementary functions are not more widely discussed than primitive recursive functions.
Definition 2.28. The class of primitive recursive functions is the intersection of all classes A of functions such that cr, U; E A for all n > 0 and i < n, and such that A is closed under composition and under the following two operations : ( i ) The parameterized operation of primitive recursion: iff is m-ary and h ( m + 2)-ary, m > 0 , then define g recursively as follows:
\
.
Note that the operations of primitive recursion are rather special kinds of recursive or inductive definitions. Many recursive definitions can be reduced to primitive recursive ones; see, e.g., the important course-of-values recursion, 2.33. But there are recursive definitions which cannot be reduced to primitive recursion. See, e.g., Theorem 3.6. The class of general recursive functions introduced in the next section encompasses all of the natural notions of recursive definitions. Clearly the primitive recursive schema affords an effective procedure for calculating values of R m ( f ,h), iff and h are effectively calculable. Similarly for RO(a,h). Thus every primitive recursive function is effectively calculable in the intuitive sense. Analogously to 2.3 we have:
-,
( i ) gi = 4 , (ii) g, = U; for some n > 0, j < n, (iii) as in 2.3 (vi) (composition), (iv) there exist j, h < i and m E w , m # 0, such that g j is m-ary, g,, is , gi = Rm(gj,g d , ( m + 2 ) - a r ~and (v) there exist j < i and a E w such that gj is 2-ary and gi = RO(a,gj). A class A of number-theoretic functions is said to be closed under primitive recursive operations provided A contains all the primitive recursive functions 4, U; and is closed under the primitive recursive operations given in 2.28, including composition.
Theorem 2.30. If A is closed under primitive recursive operations, then A is closed under elementary recursive operations. In particular, every elementary function is primitive recursive. PROOF (1) / is primitive recursive. For,
/o for all x,, . . ., xm-,, y E w . Then g is obtained from f and h by primitive recursion, in symbols g = Rm(f,h). (ii) The no-parameter operation of primitive recursion: if a E w and h is 2-ary, define g :
80 = a, h(y, gy), In symbols g = RO(a,h). PY
for all y
E w.
=
fl
Proposition 2.29. A number-theoretic function f is primitive recursive there is a finite sequence (go, . . .,gk - ,) of functions such that gk = f, and for each i < k one of the following conditions holds:
=
0,
;f;v= U X Y ,by). (2)
is primitive recursive. For, X' 0 x -- cry
(3) C: is primitive recursive:
u:x, u; ( x , y, x
= = ;f;
-
y).
Chapter 2: Elementary recursive and primitive recursive functions
Part 1 : Recursive Function Theory
+ is primitive recursive: x x
Definition 2.31. Iff is an m-ary number-theoretic function, we definef the course-of-values function for f, as follows: f" is again m-ary, and for any XO,.. ., Xm-1 Ew,
+ 0 = u;x, + 4y = u; (x, y, x + y). 4
is primitive recursive: x.0 x.4y
= =
c;x, xx.y+ x
=
+(UZ (x, y, x.y), u; (x, y, x-y)).
= (x y) + (y 'x). sg is primitive recursive: 3 x = 1 -sg (x) = sg sg x. rm is primitive recursive. Define
Ix - yl -
Thus f(x,, . . ., xm- ,) codes the whole sequence (fix,, . . ., xm-,, 0), . . ., f(xO, . . ., x,-~, x , - ~ - 1)). Note that f(x,, . . ., xm-,, 0) = 1.
x.
Proposition 2.32. Let A be closed under primitive recursive operations. Then f € A i f l f ~ A.
PROOF. Assume first that f E A. Then
f(x, 0) = 0, f (x, .Y) = 4 5 Y).sg lx - d i x , y)l. Then rm (x, y) = f(y, x). Division is primitive recursive. Define f(x, 0) = 0, f(x, 4 =f(x, y)
+ Sg IX
- 4 rm (x, YI.
where h(z,, . . ., z,) = zm .pf(z0-~~2(m z ( -~1) f or all z,, . . .,zmE o.Conversely, if YE A, then +
Then [xlyl = f(y, x). Now assume that A is closed under primitive recursive operations. In particular, A is closed under composition. (11) A is closed under summation. For, suppose f E A, f m-ary, and g Then
=
zf. The next proposition shows that recursion in which the successor step depends on several preceding values can still be reduced to primitive recursion.
Proposition 2.33 (Course-of-values recursion). Let A be closed under primitive recursive operations. Supposef is an m-ary function and h is an (m 1)-ary member of A such that, for all x,, . . ., xm-I E w,
+
Then f E A. The converse of 2.30 fails; see 2.45. To express another important property of primitive recursion, we need a new coding device. Given a finite sequence (x,, . . ., xm-,) of natural numbers, it is natural to code it by the single integer pfi+l.The added one in the exponents is essential for uncoding, to distinguish between the codes for (2, 3,O) and (2, 3), for example. The mapping that assigns to each finite sequence of natural numbers its code as above is a one-one function into w. From the code y the original sequence x is easily extracted:
ni,,
The following definition gives a special instance of this coding device:
~ O O F
&,. J(x,,
. ., xm-2,O)
= 1,
. . .,xm - ,, V ) =
n
p~(x~.....~(m - 3.i)+ 1
t
= f'(xo, . . . , xm- 2 ,
y) .*:(xo'...'x(" - 2).Y) + 1 = y(xo, . . ., Xm -2, Y).pll;(xO .... .x(m - 2).u.?(xO.
Thus f~A. By 2.32, f E A.
....x(m - 2 1 . ~ +) 1 0
Next we show how close elementary functions are to primitive recursive functions-the class of elementary functions is closed under a restricted kind of primitive recursion.
Chapter 2: Elementary recursive and primitive recursive functions
Part 1: Recursive Function Theory
Proposition 2.34 (Bounded primitive recursion) (i) Suppose m > 0, f and h are elementary, m-ary and (m 2)-ary respectively, g = Rm(f, h), k is elementary, and g(xo, . . ., x,) I k(xo, . . ., x,) for all x,, . . ., x, E w. Then g is elementary. (ii) Suppose h is a binary elementary function, g = RO(a,h) (with a E w), and gx I k x for all x E w, with k elementary. Then g is elementary.
'+
$
+
PROOF. (i) For any x,, . . ., x,, z E s(xO,.. ., x,) Let R consist of all (m p$g0,...3XW so that (1)
=
(x,
w
+ 1)- z < x m k(xo, . . .,xm-,, z).
(9)o =f(xo,.
. . ., x,, y) such that there is a q
5
., xm-1)
(qIZ+1= h(xo, . . ., xm-1, z, (q)Z)
and, finally, y (3)
=
(q),,.
g(x0, . . ., x,)
Obviously R is elementary. Now (i) follows from = CL), Ik(x0,
Lemma 2.36.
LZ
is primitive recursive.
PROOF. We may assume that m # 0. Now we prove 2.37 by induction on n: a(m,.O) = m. Assuming m 2 a(m, n),
and, for all z < x,, (2)
,
Lemma 2.37. m 5 a(m, n) for all m, n.
let
+ 2)-tuples (x,,
\
Thus a(m, n) is the iterated exponential, m raised to the m power n times. Although exponentiation is elementary by 2.8(v), we shall see that iterated exponentiation is not. The reason is that it grows faster than any elementary function; see 2.44. Obviously, we have:
. . .,x,)[(x~, . . .,x,, Y)
E
Rl.
T o prove (3), assume that x,, . . ., x, E w, let t be the sequence (g(xo, . . ., x,-I, O), . . .,g(x0, . . .,Xm - 1, x,)), and let
+ 1) = 2 mm 2 m. 0 Lemma 2.38. a(m, n) < a(m, n + I) for all m > 1 and all n E w. PROOF. a(m, n + 1) = > a(m, n). 0 Lemma 2.39. a(m, n) < a(m + 1, n) for all m # 0 and all n E w. PROOF. We proceed by induction on n: a(m, 0) = m < m + 1 = a(m + 1,O). a(m, n
Assuming our result for n, a(m, n
Lemma 2.40. all n , p E w.
+ 1) =
I (m
+ I)a(m,n)
+ 1 , n + I). 0 a(m, n) + a(m, p) I a(m, rnax (n, p) + 1) for all m > 1 and < (,
+ l)a(m+l.n) = a(m
+ a(m, p) I 2a(m, rnax (n, p)) by 2.38 < < - 2a(m.max - ma(m.max = a(m, rnax (n, p) + 1). a(m, n).a(m, p) I a(m, rnax (n, p) + 1)for
PROOF. a(m, n)
(n,p))
Then for each i I x, we have
Lemma 2.41. n, p E W. and so
(n.P))
0 all m > 1 and all
PROOF. If n = p = 0 then the inequality is obvious. Hence assume that n # 0 o r p # 0.Then
5 p$;o....."m'
Furthermore, q satisfies the conditions (I), (2). Thus (x,, . . ., x,, g(x,, . . ., x,)) E R. It is also clear that (x,, . . ., x,, y) E R implies that y = g(xo, . . ., x,), so (3) holds. 0 Condition (ii) is proved similarly. As our final result of this chapter we shall give an example of a primitive recursive function which is not elementary.
Definition 2.35. a is the binary operation on conditions: for any m, n E w,
w
given by the following
Lemma 2.42. a(m, n)a(m,p)5 a(m, rnax ( p all n, p E W. PROOF. For n = 0 we have a(m, n)5(m.~)= m a ( m . ~ ) = ~ ( mp,
+ 1)
+ 2, n + 1)) for I a(m,
max ( p
all m > 1 and
+ 2, n + 1))
(using 2.38). If n # 0 we have a(m, n)a(m.P) = m a ( m . n - l ) . a ( m , p ) < matm.max (n - I.P)+1) = a(m, rnax ( p + 2, n + I)).
by 2.41
0
Chapter 2: Elementary recursive and primitive recursive functions
Part 1 : Recursive Function Theory
Lemma 2.43. a(a(m, n), p) I a(m, n
+ 2p) for
all m > I and all n, p
E w.
Assume now that rnax {gi(xo,. . . , xn-,) : i < m) > 1. Then
PROOF. We proceed by induction on p : a(a(m,n),O)
=
a(m,n)
=
a(m,n
+ 2.0).
Assuming our result for p, we then have a(a(m, n), p
+ I) = a(m, n)a(acm,n).p)< a(m, n)a(m.n + 5 a(m, rnax (n + 2p + 2, n + 1)) -
=
a(m, n
2 ~ )
+ 2(p + 1)).
by 2.42
0
Lemma 2.44. If g is a k-ary elementary function then there is an m E w such that for all x,, . . ., x k _ , E w , if rnax (x,, . . ., xk-,) > 1 then g(x,, . . . , xk-,) < a(max (x,, . . ., xk-,), m).
PROOF. Let A be the set of all functions g (of any rank) for which there is such an m. T o prove the lemma it suffices to show that A is closed under elementary recursive operations. (1)
A is closed under 2. (7) I n fact, suppose f E A, say f is m-ary, and let g = Since f E A, choose p E w such that rnax (x,, . . . , x,-,) > 1 implies that f(x,, . . ., xm-,) < a(max (x,, . . ., x,- ,), p). Let
xf.
Then for any x,, . . ., xm-, E w ,f(x,, . . ., xm-,) < a(max (x,, . . ., xm-,, 2), q), using 2.38. Thus if rnax (x,, . . ., x,- ,) > 1 we have
+€A.
In fact, let m
=
x,
2: for any x,, x,
+ x,
Ew
I rnax
with rnax (x,, x,) > 1,
+ max (x,, xl) 0) + a(max (x,, x,), 0) I) + a(max (x,, x,), 1)
(x,, x,) a(max (x,, x,), < a(max (x,, x,), I 4 m a x (x,, x,),
=
2)
by 2.38 by 2.40
Thus (1) holds, Analogously,
(3)
Similarly, using 2.42,
. E A.
(2) f E A,
where f(m, n)
=
Im
-
n 1 for all m, n
E w.
For if rnax (x,, x,) > I, then Is, - x,l 5 rnax (x,, x,) = ~ ( m a x(x,, x,), 0) < a(max (x,, x,), 1). Similarly, the next two statements hold: (4) (5) (6)
f E A, U; E A ,
=
rnax {q, : i < m )
+ 2p + rnax {f(x,,
. . ., x,-,)
: x,, . . . , x,-,
This completes the proof of 2.44.
PROOF. By 2.36,
5 1)
a
is primitive recursive. Suppose
a
is elementary. Let
fm = a(m, m) for all m E w . Thus f is elementary. By 2.44 choose m E w such that x > I implies that fx < a(x, m). Then a(m contradiction.
+ 2 , m + 2) = f(m + 2) < a(m + 2,m) < a(m + 2 , m + 2)
+ 1.
Now suppose that rnax (x,, . . ., x,-,) > I . Then if go(xo,. . ., xn-,), . . . , g,-,(x,, . . ., x,-,) I1, we obviously have
. 11, . . ., S n - ~ ( x o., . ., xn-1)) by 2.38 < s 5 a(max (x,, . . . , x,-,), s)
~ ( x o , . . ., xn - 1) = ~ ( S O ( X .O. , , X n -
n.
Theorem 2.45. There are primitive recursive functions which are not elementary in fact, a is such a function.
where f(m, n) = [mln] for all m, n E w . for any positive n E w and any i < n. A is closed under composition.
For, suppose f is m-ary, go,. . . , g , , are n-ary, and f , go, . . . , g,-, E A . Choose p, q,, . . ., 4,-, E w such that rnax (x,, . . ., x,,) > I implies that f(x0,. . ., x,-,) < (b(max (x,, . . ., x,-,),p), and such that for each i < m, rnax (x,, . . .,x,-,) > I implies thatg,(x,, . . . ,x,- ,) < (c(max(x,, . . . , x n - ,),q,). Let h = K: (f; go, . . . , g, - ,). Let s
A is closed under
(8)
by 2.38
0
BIBLIOGRAPHY 1. Grzegorczyk, A. Some classes of recursive functions. Rozprawy Matematyczne, 4 (1953).
2. PBter, R. Recursive Funktionen. Berlin: Akademie-Verlag (1957).
Part 1 : Recursive Function Theory
EXERCISES 2.46. Show that the following functions are elementary:
Chapter 2: Elementary recursive and primitive recursive functions
each f E A introduce a symbol Rf. Allow, in addition, variables v0, ul, v2, . . .. We define term: any variable standing alone is a term. I f f 6 A, f m-ary (m > O), and a,, . . ., am-,are terms, then so is Rfao, . . ., om-l. These are all the terms. Let i be such that all the variables appearing in a certain term T are in the list v,, . . .,vi. Define g::
where R is elementary. (2) g(xo, . . . , x,-~, y) = max {f(xo, . . ., x,-~, z) : z 5 y}, with f elementary. (3) g(xo, . . . ,xm-2, y) = min {f (xo, . . .,x,-~, z) : z i. y), with f elementary. 2.47. Show that the following functions and relations are elementary:
(1) (2) (3) (4)
(a, b) = gcd (greatest common divisor) of a and b, = 0 if a = 0 o r b = 0. sa = sum of positive divisors of a. the set of perfect numbers, i.e., numbers a with sa = 2a. the Euler p function: pa = the number of elements of {x :1 < x < a) with (x, a) = 1.
< e .n, for every n E w , where e is the base of the natural system of logarithms. Show that f is elementary. Hint: write
2.48. Let fn = [e .n] = greatest integer
Let Sn = n! + n!/l! + . + n!/n!. Define S primitive recursively, but show that is bounded by an elementary function. Let Rn = l/(n + I)! + . . (Note: R is not a number-theoretic function, since its values are actually transcendental.) Show that for n > 1, Rn < lln!. Hence conclude that [e n] = [Sn/(n - 1)!] for n > 1, as desired. 2.49. Show that
):(
(combinatorial symbol) is elementary.
The purpose of the following two exercises is t o show how one can be rigorous in applying the results of this section in showing that functions o r relations are elementary. However, later we shall not use these exercises, since the application of results of this section are obvious anyway. Both exercises have t o d o with certain formal languages which are special cases of languages which will be discussed in detail later. 2.50 (EXPLICIT DEFINITION). Let A be a class of number-theoretic functions closed under composition, and such that U: E A whenever n > 0 and i < n. For
for all vo, . . ., vi E w , where each Rf occurring in T is interpreted asf. Show that g, E A. [Try induction on how 7- is built up.] 2.51 (COMPLEX EXPLICIT DEFINITION).. For each elementary function f introduce a
symbol Ff, and for each elementary relation R a symbol gR.Also let No, Nl, . . . be some more symbols, and uo, vl, . . . variables. For logical symbols we take 3, V, p, l, v , A ,-+,*, =. Special symbols: (,), < . We define terms and formulas simultaneously and recursively: (1) v, is a term; (2) iff is an m-ary elementary function and a,, . . .,am-, are terms, then is a term; Ff(ao,. . (3) Ni is a term; (4) if R is an m-ary elementary relation and a,, . . ., are terms, then B8(ao, . . .,om-l) is a formula; (5) if a, T are terms then a = T is a formula; ( 6 ) if p and # are formulas then so are - , p , p v #, p A #, p + #, p f;' #; (7) if vi does not occur in a term a, and if p is a formula, then 3vi < a, p and Vvi < a, p, are formulas; (8) under the assumptions of (7),p v i < a, p is a term. These are all the terms and formulas. Now show:
(9) $a is a term whose variables are in the list vo, . . ., vf,andiff f,(uo,. . .,vJ = a for all vo, . . ., vi E w , then ff,is elementary; (10) ifp is a formula whose variables are in the list vo, . . ., vi and if Rf, = {(vO,. . .,vi> : vO,. . .,ui E w and p), then Rf, is elementary. In (9) and (lo), the symbol Ff is to be interpreted as f; gRas R; Ni as i, and the other symbols are to have their natural meanings. Suggestion: prove (9), (10) simultaneously by induction on how a and g, are built up. 2.52. Suppose g and g' are 1-ary primitive recursive and h and h' are 3-ary
primitive recursive. Define f and f ' simultaneously:
Show that f and f' are primitive recursive. Hint: define f"(x, y) 3f'(X.Y).
= 2f(x.y).
Part 1: Recursive Function Theory
Recursive Functions; Turing Computability
Suppose that g is 1-ary primitive recursive, h is 4-ary primitive recursive and f is defined as follows: f(0,n)
= f ( l , n) =
gn
f(m+l,n)=h(f(m-l,n),f(m,n),m,n)
form>O.
/
3
Show that f is primitive recursive. Show that there are exactly X , primitive recursive functions. Show that there is a number-theoretic function which is not primitive recursive.
I j
In this chapter we shall give three versions of the notion of effectively calculable function: recursive functions (defined explicitly by means of closure conditions), an analogous but less redundant version due to Julia Robinson, and the notion of Turing computable function, based upon Turing machines. These three notions will be shown to be equivalent; here the results of Chapters 1 and 2 serve as essential lemmas. In the exercises, three further equivalent notions are outlined: a variant of our official definition of recursiveness, the Godel-Herbrand-Kleene calculus, and a generalized computer version which is even closer to actual computers than Turing machines. As stated in the introduction to this part, none of these different versions stands out as overwhelmingly superior to the others in any reasonable way. The versions involving closure conditions are mathematically the simplest. The ones using generalized machines seem the most intuitively appealing. The Kleene calculus and the Markov algorithms of the next section are closest to the kinds of symbol manipulations and algorithmic procedures that one works out on paper or within natural languages. Take your pick.
Definition 3.1. Let m > 1. An m-ary number-theoretic function f is called E w there is a y such that f(xo, . . . , x, -,, y) = special if for all x,, . . ., x, 0. Iff is a special function, we let
-,
I '
I
k(x,, . . ., x,-,)
. . .,x,-,, y) = 0. - ,, y) = 0)" for "k(xo, . . . , x,-,) ". The
= the least y such that f(x,,
We write "py(f(x0, . . ., X, operation of passing from f to k is called the operation of (unbounded) minimalization. The class of general recursive functions is the intersection of all classes A of functions such that 4, U; E A for all n > 0 and i < n, and such that A is closed under composition, primitive recursion, and minimalization
Chapter 3 : Recursive Functions; Turing Computability
part 1 : Recursive Function Theory
(applied to special functions). A relation R is general recursive iff X , is general recursive. Frequently, both for functions and relations, we shall say merely recursive instead of general recursive. A class A of numbertheoretic functions is said to be closed under general recursive operations provided that A contains all the functions 4, U; and is closed under composition, primitive recursion, and minimalization (applied to special functions). Several comments on Definition 3.1 should be made before we proceed. First, the minimalization operator used in 3.1 is somewhat different from the one in 2.16, and the difference in their notations reflects this. We shall see later that this difference is essential (see, e.g., 3.6). To see that all general recursive functions are effectively calculable it suffices to assume that f is an m-ary special effectively calculable function with m > 1 and that k is obtained from f by minimalization and argue that k is effectively calculable. In fact, given x,, . . ., xm-, E w , start computing f (x,, . . ., xm-,, O), f (x,, . . ., xm-,, I), . . .. Since f is special, 0 eventually appears in this sequence. The first y for which f(xo, . . ., x ,-,, y) = 0 is the desired value of k at (x,, . . ., xm-,), and the calculation can then terminate. Thus the assumption that f is special is very crucial. Otherwise, for some arguments this procedure would continue forever without yielding an output. We can argue as follows, intuitively, that every effectively calculable function is general recursive. Let f, m-ary, be effectively calculable. We then have a finitary procedure P to calculate it. Given an argument (x,, . . ., xm-1), from P we make a calculation c; the last step of the calculation has the value f(xo, . . . , xm-,) coded in it. Let Tconsist of all sequences (P, x,, . . . , xm-,, c) of this sort. Presumably T itself is effectively calculable and probably more easily calculable than f. By a coding device we may assume that P E w and c E w . Let V be the function that finds the output f(xo,. . ., x ~ - within ~ ) c. Now it is reasonable to suppose that both T and V are simple enough that they are recursive, for no matter how complicated f is, T and V must be very routinely calculable. Also, it is reasonable to assume that c is uniquely determined by P and x,, . . ., x ,-,. Hence
so f is recursive. We shall see that this intuitive argument is very close to the rigorous argument that every Turing computable function is recursive. Church's thesis is the philosophical principle that every effectively calculable function is recursive. This principle is important in supplying motivation for our notion of recursiveness. We shall not use it, however, in our formal development. Later, especially in Part 111, we shall use what we will call the weak Church's thesis, which is just that certain definite arguments and constructions which we shall make are to be seen to be recursive (or even elementary) without a detailed proof. The weak Church's thesis rests on the same foot as the common feeling that most mathematics can be formalized
within set theory. Of course we can take extensive practice with checking the weak Church's thesis as strong evidence for Church's thesis itself.
,
Theorem 3.2. If A is closed under recursive operations, then A is closed under primitive recursive operations. In particular, every primitive recursive function is recursive. Now we want to see that there is a recursive function which is not primitive recursive. The argument which we shall use for this purpose is of some independent interest, so we shall first formulate it somewhat abstractly.
Definition 3.3. Let A be a collection of number-theoretic functions. A binary number-theoretic function f is said to be universal for unary members of A provided that for every unary g E A there is an m E w such that for every n E w , f(m, n) = gn. Theorem 3.4. Let A be a set of number-theoretic functions closed under elementary recursive operations. Iff is uniuersal for unary members of A , then f $ A. PROOF. Assume t h a t f ~A. Let gm = f(m, m) + 1 for all m E w . Thus g E A. Sincef is universal for unary members of A , choose m E w such that f(m, n) = gn for all n E w . Then gm = f(m, m) = f(m, m) + 1, contradiction. 0 The proof just given is an instance of the Cantor diagonal argument. Other instances will play an important role in this part as well as in Part 111; see, e.g., 15.18 and 15.20.
Lemma 3.5. There is a general recursive function which is universalfor unary primitive recursive functions. PROOF. We first define an auxiliary binary function h by a kind of recursion which is not primitive recursion, and afterwards we will show that h is actually general recursive. We accompany the recursive definition with informal comments. We think of a number x as coding information about an associated primitive recursive function f : (x), is the number of arguments off, and the next prime factor of x indicates in which case of the construction of 2.29 we are in. The definition of h(x, y) for arbitrary x, y E w breaks into the following cases depending upon x: Case 1 (Successor). x = 2. Let h(x, y) = (y), + 1 for all y. Case 2 (Identity functions). x = 2".3'+l, where i < n. Let h(x, y) = ( Y ) ~ for all y. 'I, with n, m > 0. Case 3 (Composition). x = 2%.5".p;.p',0. . . . .p;:; For any y, let h(x, y ) = h(g, p ; ( ~ O . ~ ) . . . . .ph(r(m - U.Y) m-1 1.
Note here that q < x and rO, . . ., r(m - 1) < x, so the recursion is legal.
47
Chapter 3 : Recursive Functions; Turing Computability
Part 1: Recursive Function Theory
~t is similarly show that r is closed under primitive recursion with parameters. Thus ( 1) holds. Now let f ( s , y) = h(x, 2Y)for all x, y E w . Then by (I), f is universal for unary primitive recursive functions. Hence it only remains to show that h (and hence f ) is general recursive. This proof can easily be modified to show that almost any legal kind of recursion leads to a general recursive function. This kind of proof is, however, very laborious. There is a much easier way of proving this kind of thing: see the comments following the recursion theorem in Chapter 5. The computation of h(x, y) can be done in finitely many steps, in which we compute successively certain other values of h : h(a,, bO),. . ., h(am-,, bm-,). We identify this sequence of computations with the number pgO... . . pctm m _-,1), where, for each i < m, ci = 2a'.3bi.51t(ai.bi). This intuitive idea should be kept in mind in checking the following statement, which clearly shows that h is general recursive. For brevity, we write (a),, (or (a),,, or (a)(i, j)) in place of ((a),),; similar abbreviations hold for (((u)~)~),, etc.
Case 4 (Primitive recursion without parameters). x = 2.7'-lla with q > 0. We define h(x, y) by recursion on y: h(x, 1) = a, 2~+ 1) = h(x, z) = 0
2 ~3h(x. . em ( 2 . ~ )1,) for z not of the form 2"
l l q .13' with Case 5 (Primitive recursion with parameters). x = 2'" m > 0 and q > 0. We define h(x, y) by recursion on y. First let y be given with (y),,, = 0. We set 0 , Y) = h(9, Y) y .p%.ph,'=f.""P(Prn.2)) )1) = Case 6. For x not of one of the above forms, let h(x, y)
=
0 for all y.
This completes the recursive definition of h. We first claim (I) for every m E w .-. 1 and for every m-ary primitive recursive function f there is an x E w 1 such that, for all yo, . . ., ym- E w ,
-
Statement. For any x, y E w , h(x, y) = (z),,,,, where z is the least u such that u 2 2, (u),,,, = X, ( u ) , ~=. ~y, and for each i < lu one of the following holds :
Indeed, let J? be the set of all f such that an x exists. Then, for all y,
so ri E J?. Next, suppose i < n. Then for any yo,. . ., yn-l
E w,
so UT E I?. To show that is closed under composition, suppose that f e I', go, . . .,gm-l E J?, f m-ary, and go, . . . ,g,-, each n-ary. Choose u e w for f and v,, . . ., vm-, t w for go,. . .,gm-, respectively so that ( I ) holds for f, u ; g o , u 0 ; .. . g v 1 Let x = 2n.5m.p;.pF-.. ..pY(.jl). Then for any yo, . . . , yn- t w we have, with z = pEO.. . . - p;(" I), gi(yo,. . ., yn- l) = ti for each i < m,
Y
f
Thus J? is closed under composition. T o show that r is closed under primitive recursion without parameters, suppose f t r,f binary, with associated number q SO that (I) works, and suppose that x = 2'. 7'. 1 la. Let kO = a, k(n 1) = f(n, kn) for all n E w . Then we show that ky = h(x, 2y) for all y w by induction on y :
+
(2) (uho = 2 and (u),, = (u),,, + 1 ; (3) Kuh0 = 1 and (u),,, - 1 < (u),,, and (u),, = (u)(i, 1, (u),,, - I ) ; (4) ( ~ ) , o#o 0, (U),OI= 0, ( u ) , ~ # ~0, I(u),, < (u),,, + 3, and there is a j < i such that (u),, = (u),,,, I(u),, <: (u),,, - 1, for all k < (u),,, there is a q < i such that (u),~= (u),,0,~+4, (u),, = (&, and (u),, = (u),,,, and, finally, ( 4 1 2 = (u),,; (5) (U),OO = 1, ( ~ ) , o= I (u),,, = 0, (u),,, # 0, I(u),, < 4, and one of the following three cases holds: (5') (u)11 = 1 and (u),, = (u),,,; (5") there is a w < (u), such that (u),, = 2"+ l, and there is a j < i such that (u),, = (u),,, and for some k < i, (u),, = (u),,, (u),, = 2", ( u ) , ~= ZW.3(U)k2, and (43, = (41,; (5") there is no w < (u), such that (u),, = 2", and (u),, = 0; > 1, ( ~ ) , o=I ( ~ 1 = ~ ~ (u),,~ 2 = 0, (u),,,~ # 0, I(u),, I5 , and one of (6) (U),OO the follow~ngcondlt~onsholds (with (u),,, - I = m for brevity): (6') (u),lm= 0 and there is a j < i such that (u),, = (u),,,, (u),, = (u),,, and (u),, = (u),,; (6") (u),lm# 0, say (u),, = t.pm,and there exist j, k < i such that (u),, = (~):05~ ( ~ ) , 1= 2 . e (pm+ ~ ~ 1, (u),,), (u),, = (u),,, (u),, = t, and (u),, = ( 4 2; (7) none of the above, and (u),, = 0. To check thls statement carefully, let A be the set of all u 2 2 satisfying the condition above begmning "for each i 5 lu". Then the following condition IS clear: Aa
Chapter 3 : Recursive Functions; Turing Computability
Part 1 : Recursive Function Theory
(8) if u, v E A, then u . n i , , , p ~ ~ ) E~ A. i+l (9) for all x , y E w , there is a u E A with (u),,,, such u, (u),,,, = h(x, Y). Condition (9) is established by induction on x. This completes the proof of 3.5.
=
x and (u),,,,
=
y ; for any I
essential way the power of the notion. We have simply specified in a detailed way how an input for the machine is to be presented and how the output is to be located. The condition (1) is particularly useful in combining several computations. Now we show that every recursive function is Turing computable.
0 Lemma 3.10.
Theorem 3.6.
There is a recursive function which is not primitive recursive.
Theorem 3.7.
There are exactly N o recursive functions.
PROOF. Let A, consist of all of the functions 4, U; with i < n. Thus IAoI = No. Having defined A,, let A,+, consist of all members of A, together with all functions obtainable from members of An by one application of composition, primitive recursion, or minimalization (applied to special functions). Thus if IA,I = KO, then \A,+ ,I = KO. Clearly, then, IU,,, A,, = KO. 0 Obviously IJ, A, is exactly the set of all recursive functions. Theorem 3.8. There is a number-theoretic function which is not recursive. Although Theorem 3.8 follows from 3.7 purely on grounds of cardinality, we can also explicitly exhibit a nonrecursive function. Let fo, f,, . . . be an enumeration of all unary recursive functions (by 3.7). Define gm = f,m + 1 for all m E w . Then g is obviously not in our enumeration, so g is not recursive. We are really just repeating the proof of Theorem 3.4 here in a special case. We now turn to the notion of a Turing computable function. Definition 3.9 ( i ) If g = ( g o , . . .,gm-,) is a finite sequence of 0's and 1's and F is a tape description (recall Definition 1.2), then we say that g lies on F beginning at q and ending at n (where q, n E Z),provided that Fq = go, F(q + 1) = g,, . . ., F, = g m _ ,(thus n = q + m - 1). (ii) An m-ary number-theoretic function f is Turing computable iff there is a Turing machine M, with notation as in Definition 1.1, such that for every tape description F, all q, n E Z,and all x,, . . . , xm E w , if 01'"O + I ) 0 . . . o I ( x ( I I - ~ )lies + I ) on F beginning at q and ending at n, and if Fi = 0 for all i > n, then there is a computation ((F, c,, n + I), (G,, a,, b,), . . ., (G,- ,, a, - ,,b, - ,)) of M having the following properties :
ci
is Turing computable.
PROOF. A machine for
4
is
U; is Turing computable. PROOF. The machine is T(n-i)copy. Lemma 3.11.
Lemma 3.12. The class of Turing computable functions is closed under composition. PROOF. Suppose f m-ary, go, . . .,g,-, n-ary. Supfiose f, go, . . .,g,-, are computed by M, N o , . . ., N,-, respectively. Then the following machine computes K; ( f ;go, . . .,g, - ,) : K e f t + Tl
-+
Tleft
NO+ T&+,)copy
+
T6+1)copy + TpseehO
+NI +
.' '
-+
Tright
-+
T 6 +,)copy Nm - 1 T(m+( m- a)n)copy-+ . . . + Tm c o p y + M -+ Tfin. -+
-f
-f
+ Trend
+
T(m+( m - 1)n)ocpy
-f
Lemma 3.13. The class of Turing computable functions is closed under primitive recursion without a parameter. PROOF. Suppose that f is a binary operation on w , computed by a machine M, and a E w . Let go = a, g(n + 1) = f ( n , gn) for all n E w. Then the following machine computes g :
-,
(1) Gp-,i = F i f o r all i 5 n + 1; (2) l ( f ' " o . . ~ . ~ x ( m l lies ) ) + lon ) G,-I beginning at n b p - I - 1; (3) G,-,i = 0 for all i 2 b,-,. We then say that f is computed by M.
+2
and ending at
There are, of course, several arbitrary aspects in this definition of computable function. Many details could be changed without modifying in an
Lemma 3.14. The class of Turing computable functions is closed under primitive recursion with parameters. PROOF. Suppose that f is m-ary, m > 0 , g is ( m + 2)-ary and that they are computed by M and N respectively. Let h(xo,. . ., x,-,, 0 ) = f ( x o , . . . , x,-,), Z1
Chapter 3 : Recursive Functions; Turing Computability
Part 1 : Recursive Function Theory
Definition 3.17. Let [E be the set of even numbers. Let T be the class of all Turing machines. If M is a Turing machine, with notation as in 1.1, we let the Godel number of M, g M , be the number
Lemma 3.18. 8*T is elementary.
PROOF. For any x E w , x E ~ * ifTlx is odd, x > 1, for every i 5 lx we have ((x),), < 5, for every i I lx there is a j I lx such that ( ( x ) ~ )=~ ((x),),, for every i I Ix, if i is even then ((x),), = ((x),,~),, and for all i, j I lx, if i 2 I j, then ((x),), # ((x),),, and if i is even then ((x),), = 0, while if i is odd, ((x),)~= 1. 0
+
Lemma 3.15. The class of Turing computable funcrions is closed under minimalization (applied to special functions).
Definition 3.19. If F is a tape description, then the Godel number of F, gF, is the number
PROOF. Let f be an m-ary special function, m > 1, and suppose that f is , computed by a machine M. Let g(xO,. . . , xm-,) = py[ f ( x O , .. ., x ~ - y)~ = 01 for all x,, . . . , x,-, E w . Then the following machine computes g :
where
ki
=
(/2) {F(-(i
+
if i is even, 1)/2) if i is odd.
Note that a natural number m is the Godel number of some tape description iff Vx < Im((m), < 2) and m # 0. Summarizing Lemmas 3.10-3.15, we have:
Lemma 3.16. Every general recursive function is Turing computable. We now want to get the converse of 3.16. This requires Godel numbering. This process, whose name is just a catch-word for the process of numbertheoretically effectivizing nonnumber-theoretic concepts (already hinted at in the introduction to this part), has already been used twice in less crucial contexts. In discussing course-of-values recursion, we numbered finite sequences of numbers; see 2.31. And in constructing a function universal for unary primitive recursive functions essentially we numbered construction sequences for primitive recursive functions; see 3.5. Now we want to effectively number various of the concepts surrounding the notion of Turing machine. Besides our immediate purpose of proving the equivalence of Turing conlputability and recursiveness, this effectivization will be important for our later discussion of general recursion theory. The script letter g will be used for Godel numbering functions throughout this book; we will usually just depend on the context to distinguish the various particular uses of "g."
I
: I
Definition 3.20. A complete conjiguration is a quadruple (M, F, d, e) such that (F, d, e) is a configuration in the Turing machine M. C is the set of all complete configurations. The Godel number g(M, F, d, e) of such a complete configuration is the number
where
Lemma 3.21. 8*@is elementary. PROOF. For any x E w , x iff Vi I l(x),(((x),), < 2), (x), # 0, (x), E g*T, and there is an i 5 l(x), such that (x), = (((x),)~),, and lx I3. 0
Definition 3.22. (i) For any e E E , let
Chapter 3 : Recursive Functions; Turing Computability
Part 1 : Recursive Function Theory
For any x
E w,
Lemma 3.27. R2 is elementary.
let x
+2
x-2
f,x=
[r: 1
i f x is even,
ifxisoddandx>I, i f x is even and x > 0, ifx=O, ifxisodd.
Lemma 3.23. fo andf, are elementary. For any e E Z we havefoge and flge = g(e - 1).
Definition 3.28. I f h is a finite sequence of 0's and l's, we let =
g(e
+ 1)
gh =
n
pZi+l.
i < Dmnh
For any x
E w,
let f2x
=
n,, ,pa.
Lemma 3.29. f, is elementary, and f,x Definition 3.30. For any x , y
E w,
= gl("+l)for
Cat ( x , y)
=
any x.
ni, pg: ,.
x.
,y
+
Lemma 3.31. If h and k are jinite sequences of 0's and l's, then ~ ( h k=) Cat (gh, gk). (Recall the definition of hk from 1.11.) Lemma 3.24. Let R , = { ( x ,n, E , y) : x = 9 F for some tape description F, n = ge for some e E Z, E = 0 or E = 1, and y = 9(F:)). Then R , is elementary. I x ( ( x ) ~ < 2), x # 0, E < 2, and y = PROOF. (x, n, E , y) E Ro i f f Vi I [xIPY" .pi. 0
Definition 3.32. f Ax
=
Cat (2,f2x). For m > 1 ,
Lemma 3.33. f ? is elementary for 8(0 1 ( ~ 0 + 1 0) . . .0 l(x(m-1)+1)
each m , and f?(x,,. . ., x,-,)
=
>.
Lemma 3.25. Let R, = { ( x , y) : x is the Godel number of a complete conjiguration ( M , F, d, e), y is the Godel number of a complete conjiguration ( M , F', d', e') (same M ) , and ((F,d, e), (F', d', el)) is a computation step). Then R, is elementary.
Lemma 3.34. Let R3 = { ( x ,y, m , n): x is the Godel number of a tape description F', y is the Godel number of a jinite sequence h of 0's and l's, m = ge and n = ge' for certain e, e' E Z, and h lies on F beginning at e and ending at e'). Then R3 is elementary.
PROOF. For any x , y, m , n ( x , y, m , n) E R3 i f f y # 0, Vi I lx((x), < 2), # 0, either y = 1 and m = n, or else y > I , for every i I ly[(y),= 1 or ) ~that (z), = m , fo((z)J = ( z ) ~ + ~ ( y ) , = 21, and there is a z r ( m + 2 ~ such X
for each i < lz, lz
Definition 3.26. A complete computation is a sequence 5% = ( ( M , F,, do, e,), . . ., ( M , F,, dm,em)) such that <(F,, do, e,), . . ., (F,, dm,em)) is a computation in M. The Godel number o f such a complete computation is the number
,
pf(M,Ft.dlet).
i<m
Let R2 be the set o f all Godel numbers o f complete computations.
=
1 y, (z),, = n, and for each i
I lz, (x)(,)~= ( Y ) ~
1.
The notations fo, f,, fi, f?, R,, R1,R2, R3 will not be used beyond the present section. The relations T , introduced next, however, are fundamental for the aspects o f recursion theory dealt with in Chapters 5 and 6.
:
Definition 3.35. For m > 0 let T , = {(e,x,, . . ., x,-,, u ) : e is the Godel number o f a Turing machine M , and u is the Godel number o f a complete ; computation ( ( M , F,, do, v,), . . ., ( M , Fn, dn, v,)) such that O 1 ( x O + l ) 0 . . 0 l(x(m-l)+l) lies on Fo ending at - 1 , F, is zero otherwise, v, = 0, and Fnl = 1.) rr
Chapter 3 : Recursive Functions; Turing Computability
Part 1: Recursive Function Theory
Note that for any e, x,, . . ., x,-, (e, x,, . . ., X , - U ) E T,.
there is at most one u such that
Ew
Lemma 3.36. T, is elementary.
1
Definition 3.42. ( i ) J(a, b) = ((a Exc [ d x ]for all x E w.
+ b)2 + b)2 + a for all a, b E w. (ii) L x =
Theorem 3.43 (i) J and L are elementary; (ii) Exc 0 = 0 and LO = 0 ; (iii) if Exc (a 1) # 0, then Exc (a + 1) La; (iv) Exc J(a, b) = a ; (v) LJ(a, b) = b ; (ui) J i s 1 - 1.
+
=
Exc a
+ 1 and L(a + 1 ) =
= x2 + Exc a < ( X 1)'. Since Exc (a 1) Z 0 , it is then clear that Exc (a + 1) = Exc a 1. Furthermore, clearly x2 I a < ( x + and x2 I a + 1 < (X I)', SO x = [.\/a] = [ d ( a l ) ] and hence La = L(a + I ) . To prove (iv), note that
PROOF. ( i ) and (ii) are obvious. As to (iii), choose x such that a Obviously V is elementary.
+
Lemma 3.38. Every Turing computable function is recursive.
PROOF. Let M be a Turing machine which computes f as described in Definition 3.9(ii), and let e = gM. Then for any x,, . . ., x m - , E w , f ( x 0 , . . ., x,-d
=
V M e , X O , . . ., x,-
I,
0
Theorem 3.39. A function is Turing computable i f it is recursive. We close this chapter with a variant of the notion of recursiveness due to Julia Robinson [3].It will be useful to us later on. The idea is to simplify the definition of recursive function by using rather complicated initial functions but very simple recursive operations.
Lemma 3.41.
I.\/@
greatest integer I .\/x x - [2/xI2;this is the
[%I] and Exc are elementary.
PROOF. [.\/XI 5 x for all x
[@I
= =
=
E w.
0
{!$:;
Thus we may use 2.34. Finally, Exc n
=
n
((a
+ +
+ b)' + b)'
I J(a, b) < ((a b)2 b)2 + 2(a = ((a + b)2 + b + 1)'.
+
+
+ b)2 + 2b + 1
Hence Exc J(a, b) = a, and (iv) holds. Furthermore, clearly from the above [1/J(a,b)] = (a b)2 b ; since
+
+
we infer that LJ(a, b) = Exc [ d J ( a ,b)] = b, as desired in (v).Finally, (vi)is a purely set-theoretical consequence of (iv) and (v). 0 For the next results we assume a very modest acquaintance with number theory; see any number theory textbook.
Tbeorem 3.44 (Number-theoretic: The Chinese remainder theorem). Let m,, . . ., m, - be natural numbers > 1, with r > 1 , the mi's pairwise relatively prime. Let a,, . . ., a,-, be any r natural numbers. Then there is an x E w such that x = ai(mod mi)for all i < r.
,
Further,
1 # ( [ d n ]+ 112, + 1if n +otherwise = [ d n ] + G In + 1 - ([z/nl + 1)'1
+ 111 =
+
u) E Tml,
as desired.
Definition 3.40. [ z / ]is the function such that [.\/XI for each x E w . Also, for any x E w we let Exc x excess of x over a square.
+
A
[z/nI2.
The next definition and theorem introduce special cases of the important device of pairing functions, extensively used in recursive function theory.
PROOF. By induction on r ; we first take the case r
= 2. Since rn, and m , are relatively prime, there exist integers (positive, negative, or zero) s and t such that 1 = m,s + m,t. Then a, - a, = mos(ao- a,) + m,t(a, - a,). Choose u E w such that a, - mos(a0- a,) + urnom, > 0 , and let x = a, m,s(a, - a,) + um,m,.Then x = a,(mod m,),andx = a, + mlt(a0 - a,) urnom, = a,(mod m,), as desired. Now we assume the theorem true for r and prove it with "r" replaced by
+
Chapter 3: Recursive Functions; Turing Computability
Part 1: Recursive Function Theory
+
-
r + 1". With s, t, u as above, choose x E OJ such that x E a, - mos(ao - a,) umoml(mod moml), x = a2(mod m,), . . ., x = a,(mod m,). Then x = a, (mod m,) and, since a, - m,s(a, - a,) = a, m,t(a, - a,), x a,(mod m,) D as desired. "
+
Definition 3.45. For all x, i E w let P(x, i )
=
rm (Exc x, 1
+ (i + 1)Lx).
Theorem 3.46 (Number-theoretic: Godel's &function lemma). For any finite sequence yo, . . ., y,-, of natural numbers there is an x E w such that P(x, i) = yi for each i < n. PROOF. Let s be the maximum of yo,. . ., y,-,,n. For each i < n let m, = 1 + (i 1) - s! Then for i < j < n the integers m, and mj are relatively prime. For, if a prime p divides both mi and m,, it also divides mj - mi = ( j 1). s! - (i + l).s! = ( j - i).s! Now pts!, since pll (i + l)s!. Hence p l j i. But j - i < n I s, and hence this would imply that p(s!, which we know is impossible. Thus indeed mi and m, are relatively prime. Hence by the Chinese remainder theorem choose u such that
+
+
v
= y,(mod m,)
+
for each i < n.
that for any x E w , x2 I x2 Thus (1) Next,
+ x < ( X + I)', Exc has range
and hence Exc (x2 + X) = X.
w.
+
Ex&" (2x) = x2 2x (2) for all x E w. For, obviously Exc (x2 2x) = 2x. If Exc (y) = 2x with y < x2 + 2x, we may write y = z2 2x < (z 1)'and so z c: x and hence (z + = z2 + 22 1 I z2 2x < (Z a contradiction. Thus (2) holds. Again,
+ + + + +
+
+ I ) = x2 + 4x + 2 for all X E U . For, (X + 1)' = x2 + 2x + I < x2 + 4x + 2 < x2 + 4x + 4 = ( X + 2J2, and hence Exc (x2 + 4x + 2) = 2x + 1. Now suppose Exc (y) = 2x + I, with y < x2 + 4x + 2. Choose z such that y = z2 + 2x + I < ( z + Then z2 + 2 x + 1 = y < x2 + 4x + 2 = ( x + + 2 x + I, and hence z 5 x. Hence (z + = z2 + 22 + 1 I z2 + 2x -I- 1 = y < (z + a contradiction. Thus (3) holds. From (2) we see that CA x = 0 = Exc Ex&" (x + x) for all x w; Exc(-"(2x
(3)
E
J
Let x = J(v, s !). Then Exc x = u by 3.43(iu), and Lx = s ! by 3.43(u). Hence if i < n we have P(x, i) = rm (Exc x, 1 ( i 1)Lx) = rm (u, mi) - Yf.
hence
+ +
Definition 3.47. Iff is a 1-place function with range w, letf(-l)y = PX(fx for all y E w . We say that f(-l) is obtained from f by inversion.
= y)
Theorem 3.48 (Julia Robinson). The class of recursive functions is the intersection of all classes A of functions such that 4, Exc, U; E A (for 0 5 i < n), and such that A is closed under the operations of composition, and of inversion (applied to functions with range w).
+,
PROOF. Clearly the indicated intersection is a subset of the class of recursive functions (f(-l)y = PX((fx - yl = 0), SO we have here a special case of minimalization). Now suppose that A is a class with the properties indicated in the statement of the theorem. We want to show that every recursive function is in A. This will take several steps. The general idea of the proof is this : Inversion is a special case of minimalization, and the general case is obtained from inversion by using pairing functions. Primitive recursion is obtained by representing the computation of a function f as a finite sequence of the successive values off, coding the sequence into one number using the fi function, and selecting that number out by minimalization. Our proof will begin with some preliminaries, giving a stock of members of A , which leads to the fact that the pairing functions are in A . First note
Hence by composition with
Ck E A
(5)
Now let x @ y Thus
=
J,
for all n > 0 and all m E w.
Exc (Exc'-') (2x
+ 2y) + 3x + y + 4) for
all x, y
E w.
Now if x 2 y, then (x
+ y + 2)2 = (X + y)2 + 4x + 4y + 4 I (x + Y ) + ~ 2(x + y) + 3 5 + y + 4 =Exc'-l)(2~+2~)+3x+y+4 < (x y)2 6x 6y 9 = (x y 3)2.
+ +
+ + + +
by(2)
Hence (7) Let fx
=
xOy=x-y i f y ~ x . x2 for all x E: w. Then by (2), ( 7 ) , f-Y = Ex&" (2x) - 2x for all
X E w, SO
(8)
Next note that sg .w (9)
f € A. =
Exc .(x2) and @ x
=
sg, G EA .
I
a sg s for all x
E w.
Thus
Chapter 3 : Recursive Functions; Turing Computability
Part 1: Recursive Function Theory Let Ix
Furthermore,
[ d x ] for all x
E w.
Then by (18), Ix = k(x 0 Exc x), so
Exc o 4 has range w.
(10)
+
For, Exc 40 = 0, and if x # 0, then Exc 4(x2 x - 1) = X. Now using 3.43(iii) we see that j x = Exc (Exc 0 d)(-l)(x) for all x E w. Hence
+€A.
(1.1)
+ y y + 2x + 2y + 1 + y y + 5x + 3y + 4 + Y ) +~ 4x + 4y + 4 + y + 2)2. ~ 2(x + y) + 3x + y + 4), (21) now follows. Since x 0y = Exc ((x + Y ) +
(12) =
2y, then EXC44 Exc(-')
i f x = 2y
(x
for all x E w.
x[E(x) = Exc 44 Exc(- l)x
EXC44 (y2 + 2y) Exc (y2 + 2y + 2) = 1;
X = =
(22)
+ 1, then EXC44 Exd-l'
+
EXC44 (y2 + 4y 2) = Exc (y2 + 4y + 4) = 0.
X =
Hence by (8) and (19)
For,
Recall that [E is the set of even numbers. Next we show
For, if x
=
x
+y +
= (x
< (x < (x = (x
(x, y) = sg [(x O y) 0(3x hence X, E A.
+ y + 3)]
for all x, y E w, and
For, if x 2 y then
by (3)
From (12) we have: XEE A.
(13) Now let gx
=
2 Exc x
If x < y, then
+ sg xlEx for all x E w. Thus
(14) We claim (15)
g has range w.
For, if x = 2y then, since y2 + y is even, g(y2 + y) = 2 Exc (y2 2y = x. If x = 2y + 1 then, since (y y is odd, g((y 2y 1 = x. Let hx = [x/2] = greatest integer y I x/2 for all x E W. Then
+
+
(16)
hx
=
Exc g(-l)x
+
for all x
E
+
+ y) = + y) =
for m(x, Y) = x>(x, y)-(x O Y) + x>(Y,x).(y O 4 . With the aid of the auxiliary functions which we have shown to be in A, we can now show how minimalization can be reduced to inversion.
w, and hence h E A.
For, 2 Exc g(-l)x + Sg XIEg(-l)x= x for any x ; thus if x is even, then 2 Exc g(-l)x = x ; while if x is odd, 2 Exc g(-l)x + 1 = x, as desired. For any x E w, let kx = [(Exc/x)/2] + sg x. Thus Furthermore, (18) For, if x
k(x2) = x
for all x.
= 0 the result is obvious. If x # 0, thenjx2 = x2 - 1 = (X 2x - 2, Exc/x2 = 2x - 2, and hence k(x2) = X, as desired.
~ x2) 0y2)/2] for all x, Y E w . Let m(x, Y) = For, x.y = [(((x + Y ) 0 Ix - yl for all x, y E w. Then
+
Suppose f is a 2-ary special function, f E A. Let gx = py(f(x, y) = O), for all x E w. Then for all x E w , gx = Lpz(f(Exc z, Lz) = 0, (25) Exc z Lz = [d[\/z]], and Exc z = x) (and for each x there always is a z satisfying the conditions in parentheses).
+
To prove this, let x E w be given. Let z = J(x, gx). Then f(Exc z, Lz) = f(x, gx) = 0 by 3.43; Exc z + Lz = x + gx = [ d [ d z ] ] by direct computation, and Exc z = x. Clearly also Lz = gx. It remains to show that our choice of z gives the least integer s satisfying the conditions of the p - operator. Assume that f(Exc s, Ls) = 0, Exc s + Ls = [l/[l/s]], and Exc s = x. Say
Chapter 3 : Recursive Functions; Turing Computability
Part 1 : Recursive Function Theory
To prove (31), let x,, . . ., x, - ,, y E w be given. By Theorem 3.46 choose z y we have such that P(z, i) = g(xo, . . ., xm-,, i) for each i 5 y. Thus if ow I
Then [ d s ] = p, and Ls = Excp. Say p = q2 + s = p2 + x < ( p + Then [2/[2/s]] = q. Thus x + Ls = q. Since f(Exc s , Ls) = Ls < (q + 0, we have gx I Ls. Hence x + gx I q, (x + g ~ < )q2,~(x + g ~ + )gx ~I p, [(x + g ~ +)gxI2 ~ I p2, and z = J(x, gx) I p2 + x = S, as desired. Thus (25) is established. (26)
Under the hypothesis of (25) we have g E A . Hence
For, let nz = Sg f(Exc z, Lz).Sg (IExc z + Lz - [z/[z/z]]l).Exc z. By (25), n has range W , and clearly n E A . Clearly for any x E w we have gx = Sg x . go + Ln(-l)x, so g E A. Next,
. .,., xm - 1, w, P(z, w)) Or w = Y) = y. ~lw(P(z,ow) Z ~ ( X O Furthermore, P(z, 0) = g(xo, . . ., xm-,, 0) = f(xo, . . ., xm-,). Hence there is a z of the sort mentioned in (31). Let t be the least such z. By induction on i it is easily seen that for any i Iy we have P(t, i) = g(xo, . . ., x,- ,, i). Hence P(t, y) = g(xo,. . ., x,-,, y), as desired.
(27) iff is special, f E A , and g is obtained from f by minimalization, then g E A. For suppose f is rn-ary, rn > 1. We proceed by induction on rn; the case rn = 2 is given by (26). Inductively assume that rn > 2. Define f ' by
Under the hypothesis of (31), if in addition f and h are in A, 0 2 ) then g E A. For, first let
for all x,, . . ., xm-, E w . Clearly f ' is special, since f is. Let g' be obtained from f ' by minimalization. By the induction hypothesis, g' E A. Now if x,, . . ., x,-, E w , then
for all x,, . . .,xm-,, y, z, w E w . Then k' more, obviously k' is special and
by (9), (24), and (30). Further-
,
Let kt'(x0, . . ., xm-,, y, z) = ~lw(k'(x,,. . ., x ,-,, y, z, w) = 0) for all x,, . . ., xm-,, y, z E w . Then k" E A by (27). Let km(x0,. . .,xm-,, y, z) = sg (I/?(z, 0) f(xO,..., ~ ~ - ~ ) 1 ) + s g ( I k,..., " ( x ~ , - ~ , y , z ) yl). Then ~ " E A and , by (31) kmis special; moreover,
",
~ ( x o ,..., xm-I, Y) = P(CLZ(~"(XO,. . ., Xm-13 Y, Z) = O), Y).
hence g E A by (20). For all x, y E w let g k Y) = [x/yl. ,
For, if x, y E w then
EA
.IHence g
E
A, as desired.
so g E A by (27) and (22). Now since rm (x, y) = x @ ([x/y].y), we have
If g is obtained from a and h by primitive recursion, a E w and h (33) binary and h E A, then g E A.
Hence by (20),
The proof is similar to that of (32). Thus 4, U; E A, and A is closed under composition, primitive recursion, and minimalization (applied to special functions). Hence, every recursive function is in A, and the proof of 3.48 is complete. 0
Now we can take care of primitive recursion. Suppose g is obtained from f and /I by prim~tiverecursion, f tn-ary and /I ( m + 2)-ary, m > 0. Then for any so,. . ., s,,_,, y E w , (3 1 ) g(xo,. . . , .I-,- ,, = &z[P(z, 0) = f ( u, . . . , x, - ,) and pM'(P(2,J W ) # /7(x0,. . . , Xm-l, M', P(z, M')) Or IZ. = 4') = J'], Y ) ; such z and w always exist, for any x,, . . ., s,_,,y t w . 13)
Definition 3.49. such that
Let P be the two-place operation on one place functions P(f, g)(x)
=f
for all one place functionsf, g and all x
x
+ gx
E w.
Chapter 3: Recursive Functions; Turing Computability
Part 1: Recursive Function Theory
(3) f ( x , Y + 1) 5 f ( x + 1, y); (4) f ( x , Y) < f ( x + 1, Y); (5) f ( l , Y) = Y + 2;
Theorem 3.50. The class of 1-place recursive functions is the intersection of all sets A of 1-place functions such that d, Exc E A a n d A is closed under K:, P, a n d inversion (applied to functions with range w).
(6) f(2, y) = 2y + 3 ; (7) for any el, . . ., c, there is a d such that for all x, XI.,<, f(c,, x) 5 f ( d , x ) (prove first for r = 2, taking d = max (el, c2) + 4); (8) for every primitive recursive function g (say with n places) there is a c such that for all X I , . . ., x,, g ( x l , . . .,*x,,) < f(c, x, + . . . + x,); (9) f is not primitive recursive.
PROOF. Clearly t h e intersection indicated is included in t h e class of 1-place recursive functions. N o w suppose t h a t A satisfies t h e conditions of t h e theorem. N o t e that U i E A , since U i = K t (Exc, Ex&')). I f f is a 1-place recursive function, then f = K t (f, UA). Hence in o r d e r t o show t h a t all 1-place recursive functions a r e in A (which is all t h a t remains f o r t h e proof), it suffices t o prove t h e statement
(*)
3.54.
What difficulty would arise in deleting "primitive" from Lemma 3.5 [show that 3.5 would then be false, but also indicate how a proof roughly similar to that given for 3.5 would break down].
3.55.
Express a Turing machine to compute directly in terms of the machines of Chapter 1, i.e., don't use results of this section.
3.56.
The set { g M : M is a Turing machine with exactly five states) is elementary.
3.57'.
Prove (33) in the proof of 3.48 in detail.
3.58.
The class of recursive functions is the intersection of all classes A of functions such that .r, U,"E A (each n > 0, each i with i < n), + E A, - E A, .E A, and A is closed under composition and under minimalization (applied to special functions). Thus we have here another equivalent definition of the notion of recursive function; this version, o r slight variations of it, are frequently found in the literature.
3.59.
I ) - I for all x, y E w, let Klx Let J,(x, y) = 2". (2y l)/exp (2, Klx)] - 1)/2. Then show: let Llx = ([(x
3.60.
For any x, y E w , let Jz(x, y) = [(x y)2 + 3x y]/2, Q,x = [ ( [ - \ / ( 8 ~+ 111 + 1)/21 1 , QZX = 2x - (Q1xl2, K2x = (QZX - Qlx)/2, and L2x = Qlx - Kzx. Prove analogs of 3.59(1)-(5). Hint: Define f : w x w - t w x w by putting
iff is a n m-ary general recursive function a n d go, . . .,gm-, E A , then KT (f ;go,. . .,g m- ,) E A .
To prove (*), let B b e t h e set of all f such that iff is m-ary a n d go, . . ., gm-, E A then KT ( f ; g o , . . ., gm-,) E A . N o t e t h a t f o r f unary we have f E A iff f E B. Hence +, 3 , Exc, U; E B (for 0 I i < n < w) a n d B is closed under inversion, applied t o functions with range w. T o show t h a t B is closed under composition, assume t h a t f (m-ary) is in B, t h a t h,, . . ., hm-, (all n-ary) a r e in B, a n d t h a t g o , . . ., gn-, E A. T h e n by 2.2,
Thus, go, . . .,gn-, being arbitrary, K: ( f ; hO,. . ., I?,-,) t h e proof is complete.
E
B.. Hence by 3.48
0
+
+
+
=
(x
+ I),,
and
BIBLIOGRAPHY 1. Davis, M. Computability and Unsoluability. New York: McCraw-Hi11 (1958). 2. Hermes, H. Enurnerability, Decidability, Computability. New York: Springer (1969). 3. Robinson, J. General recursive functions. Proc. Amer. Math. Soc., 1 (1950), 703-718. EXERCISES 3.51.
+
+
Show that the set I' in the proof of 3.5 is closed under primitive recursion with parameters.
3.52*.Let f ( O , y ) = y + l , f ( x + l , O ) = f ( x , l ) , f(x, f ( x + 1, y)). Show that f is recursive.
and f ( x + l , y + l ) =
3.53*. (continuing 3.52*). Show that f is not primitive recursive. Hint: prove the following in succession (for any x, y E w):
(The function f describes a certain easily visualized procedure of going through all pairs (x, y).) Prove that J2f(x, y) = J2(x, y) I for all x, y E w. Thus Jz is the w associated with f. Then show successively natural mapping w x w that Jz maps w x w onto w and that for all x , y E w, QIJz(x, y) = x + y, QzJdx, Y) = 3x + Y , KZJAx, Y) = x, L2J d x , y ) = Y . Then J2(K2x, Lzx) = x follows easily since J2is onto.
-
+
Chapter 3: Recursive Functions; Turing Computability
Part 1 : Recursive Function Theory
3.61*. I f f is a 1-place number-theoretic function, we define f" (temporary notation) by induction: fox=x forallx~w, fn+lx=ff"x forallx~w. The function g such that gn = f"0 for all n E w is said t o be obtained from f by iteration. Prove the following theorem:
Theorem ( R . M . Robinson). The class of primitive recursive functions is the intersection of all classes A of functions such that o, Exc, +, U? E A whenever i < n E w and A is closed under composition and iteration.
I
1 I I
Hint: As in the proof o f 3.48 the essential thing is t o show that each primitive recursive function is in A, where A satisfies the conditions o f the theorem. Proceed stepwise :
I I
I
(1) C;, sg, % E A. (2) L e t f x = x + 2 @ E x c ( x + 4 ) + 1. Then ~ E A . (3) Let gx = x + 2[2/x].Then g E A. (4) Let hx = xZ. Then h E A. ( 5 ) Let x @ y = Exc [ ( x + Y ) + ~ 3x + y + 11. Then @ E A. ( 6 ) Let a x = Sg x + 2 Sg ( x @ 1). Then a E A. (7) Let /3 be obtained from a by iteration, yx = x + 1 + fix, E obtained from y by iteration, k x = [x/2]for all x ; then 3 > /3x = x (mod 3), and k , = EX - X , and k E A. (8) Let ix = [ d x ] .Then i E A. ( 9 ) ., J, L E A . (10) Suppose j E A, and k is defined from j as follows:
I
Then k E A. Hint: define k'n = J(n, kn) for all n E w. (11 ) Suppose fi E A, and fi is defined from fl as follows:
I
Then fz E A. Hint: define 10 = 0, I(n + 1 ) = fz(Ln, Excn). (12) Suppose fl, fz E A, and f3 is defined as follows:
I I
I
Then f3 E A. Hint: define &a, 0 ) = a, l(a, n (13) I f f4, f5 E A, and f6 is defined by:
then f6 E A. (14) A is closed under primitive recursion.
+ 1 ) = J(a, f3(a, n))
3.62.
Using 3.61, show that the class o f all 1-ary primitive recursive functions is the intersection o f all classes A such that 6, Exc E A and A is closed under iteration, K:, and P.
3.63*
(HERBRAND-GODEL-KLEENE CALCULUS). W e outline another equivalent version o f recursiveness. W e need a small formal system: Variables: vo, vl, vZ,. . . ; Individual constant: 0 ; Operation symbols: f , (m-ary), g,, (m-ary) for all m E w 1, n E w; 4 (unary). By induction we define A 0 = 0, A ( m + 1 ) = a A m for all m E w ; we denote A m sometimes by m. Now we define terms: ( 1 )
; (2) ; (3) i f o is a term, so is do; (4) i f m E w 1 and 0 0 , .. ., a,-, are terms, so are fmoo...o,-l for each n E w ; gmnoo.. (5) terms are formed only in these ways.
and
An equation is an expression o = T with o, T terms. A system of equations is a finite sequence o f equations. I f E is a system o f equations, say E = <po,. . . , v,- ,),then an E-derivation is a finite sequence <#,, . . .,#, - o f equations such that for each i < n one o f the following holds: (6) 3 j < m # , = v,; ( 7 ) 3 j < i3 variable a 3 m E w (4, is obtained from #, by replacing each occurrence o f a in , )I by m); (8) 3j, k < i #, has the form o = T, #, has the form fpxo.. .x, = y or gpqyo.. .x,-, = y, and #, is obtained from #, by replacing one occurrence o f fpxo.. .x, - (or gpqx0.. .x, - ,) in T by x.
-,
,
W e write E t x to mean that there is an E-derivation with last member x. Now an m-place number-theoretic function k is called HerbrandGodel-Kleene recursive i f there is a system E o f equations such that Vxo~~~Vx,-lQy(Etfmxo~~~x,-l = y i f fk ( x o , .. .,x,-,) = y). Show that k is Herbrand-Godel-Kleene recursive i f fit is recursive. Hint: T o show that every recursive function is HGK recursive, let A be the collection o f all functions k (say k is m-ary) such that there is a set E o f equations and an assignment o f n-ary operations to the n-ary operation symbols occurring in members o f E (for all n E w), k assigned to f,, under which all members o f E become intuitively true for any values assigned to the variables and such that Vx,. . .Vxm-,3y ( E t fmxo.. .x,-, y). Show that A satisfies the conditions o f Exercise 3.58 and hence that every recursive function is Herbrand-Godel-Kleene recursive. T o show the converse, do a Godel numbering. Let Th = {(e,x u , . . ., & - I , u ) : e is the Godel number o f a system E o f equations and rr is the Godel number o f an E-derivation with last term o f the form fmxo.- . x , , = y). Given such a u, V'u is t h e y mentioned. Then see the proof o f 3.38. 3.64* ( I N F I N I T E D I G I T A L C O M P U T E R ) . Y e t another equivalent form o f recursiveness is obtained by generalizing a first-generation digital computer. W e
Part 1 : Recursive Function Theory
Markov Algorithms
visualize our computer as an infinite array of storage boxes, labeled 0, 1, 2 , . . . . Each storage box is allowed to hold any natural number. By convention we assume that all but finitely many of the boxes have 0 in them. Box 0 is the instruction counter. Box 1 is the accumulator. All other boxes are just fast memory cells. We supply only six instructions:
(1) add one to the contents of Box 1; (2) subtract one from the contents of Box 1, or leave zero if already 0 ; (3) replace the contents of storage n by the contents of storage 1 (for any 4 ; (4) replace the contents of storage 1 by the contents of storage n (for any n); (5) (for each n E w) if storage 1 has a zero in it, take the next instruction from storage n otherwise proceed as usual; (6) stop. For technical reasons there is no start instruction. The machine works as follows. We set the storages initially to certain values (programming). Then the machine starts. It looks at box 0 and takes its instruction from the box specified there (each instruction will be assigned a number). After performing the instruction, the instruction counter advances one step (except possibly for instructions (5) and (6)), and then the next instruction is executed, etc. The machine continues until hitting the stop instruction, and then stops. It is possible that the machine will get in a "loop", and never stop. An initial state of the machine is called aprogram. A program computes a 1-place function f as follows. We put x in storage 2 and press the start button. The machine grinds away, and finally stops; fx is then in the accumulator. Now we express all of this rigorously. A storage description orprogram is a function F mapping w into w such that for some m E w we have Fn = 0 for all n 2 m. An instruction is a number of the form 2O3O, 2l.3O, 22.3", 23.3", 24.3", 0, where n E w. These instructions correspond to (1)-(6) above, respectively. A computation step is a pair (F, G) such that F and G are storage descriptions and one of the following conditions holds: (1) (2) (3) (4) (5)
FFO = 2O. 3O and G = (F:, + + FFO = 2l. 3, and G = (F:, + 1)$1 FFO = 22.3" (for some n), and G = (F:, + 1)h FFO = 23. 3" (for some n), and G = (FPo+ I):, FFO = 24.3" (for some n), and G = FjO+, i f F 1 # 0, G=Fi ifF1=0.
A computation is a finite sequence 0, such that (F,, Fi+,) is a computation step for each i < m - 1 and Fm-,Fm-,O = 0. We say that is a computation beginning with Fo and ending with F,_l. Now an m-ary function f is said to be infinite-digital computed by a program F provided that for all xo, . . . , x, -, there is a computation beginning with F%;.Y!k - and ending with a program G such that G1 = f(xo,. . ., xm-I). Show that a function is infinite-digital computable iff it is recursive.
: : t
)
o
4*
The present chapter is optional; it is devoted t o another important and widely used version of effectiveness, Markov algorithms. The theory of Markov algorithms is described carefully and in detail in Markov [3]. Here we shall only give enough of its development t o prove equivalence with Turing computability and recursiveness. The equivalence was first proved in Detlovs [2]. F o r a brief outline of the theory see Curry [I].
Definition 4.1. Throughout this chapter, by a word we shall understand a finite sequence of O's, l's, and 2's. The empty word is admitted. A Markov algorithm is a matrix A of the form
such that a,, . . ., a,, b,, . . ., b, are words and c,, . . ., cmE (0, 1). A word a occurs in a word b if there are words c and d such that b = cad. Of course a may occur in b several times. A n occurrence of a in b is a triple (c, a, d ) such that b = cad. It is called the jirst occurrence of a in b if c has shortest length among all occurrences of a in 6. An algorithmic step under A is a pair (d, e) of words with the following properties : (i) there is an i 5 m such that ai occurs in d ; (ii) if i Im is minimum such that ai occurs in d, and if (f,a,, g ) is the first occurrence of ai in d, then e = fbig. Such an algorithmic step is said t o be nonterminating, if with i as in (ii), ci = 0; otherwise (i.e., with ci = I), it is called terminating. A computation
Chapter 4: Markov Algorithms
Part 1: Recursive Function Theory under A is a finite sequence (do, . . ., dm) of words such that for each i < m - 1, (d,, d,+,) is a nonterminating algorithmic step, while (dm-,, dm) is a terminating algorithmic step. Now an m-ary function f is algorithmic if there is a Markov algorithm A as above such that for any x,, . . ., xm-, E w there is a computation (do, . . ., d,,) under A such that the following conditions hold:
PROOF. Let f (n-ary) be computed by a Turing machine M, with notation as in 1.1 and 3.9. With each row ti = (c,,,,, ei, ui, di) of M (1 I i I 2m) we shall associate one or more rows tl(i, 0), . . ., tf(i,pi) of a Markov algorithm, depending on vi. Case 1. ui = 0 or 1. We associate the row
Case 2.
vi
=
2. We associate the rows (in order)
Case 3. vi
=
3. We associate the rows (in order)
Case 4. vi
=
4.We associate the row
We then say that A computesf.
A row a, b, 0 in a Markov algorithm will be indicated a, + b,, while a row a, bi 1 will be indicated a, -+ - b,. A Markov algorithm lists out finitely many substitutions of one word for another, and an algorithmic computation consists in just mechanically applying these substitutions until reaching a substitution of the form ai -+ .b,. Clearly, then, an algorithmic function is effective in the intuitive sense. Markov algorithms are related to Post systems and to formal grammars. Now we shall give some examples of algorithms, which we shall not numerate since they are not needed later. The algorithm A, : (0)
-+
Now let A be the following Markov algorithm:
.(0)
t v , 0)
works as follows : any computation under A is of length 2 and simply repeats the word: (a, a), where (0) occurs in a. Consider the algorithm A, :
Some examples of computations under A, are: We claim that A computesf. To see this, let x,, . . ., xn-, E w . Since M computesf, by 3.9 there is a computation ((F, c,, 0), (GI, a,, b,), . . ., (G,-,, a,- ,, b,-,)) of M with the following properties: (I) 0 0 - . . 0 l(x(m-l) l) lies on F ending at - 1, and F is 0 elsewhere; (2) l(~(m-l)+l) 0 l(f(x0,....x ( m - l ) + l ) 0 lies on G,-, ending at b, - ,. Now let Go = F, a, = c,, bo = 0. Let Q-, be the word +
+
Let A , be the following algorithm:
The algorithm A , takes any word and replaces all 0's by l's, then stops. Let A, be
Now we define Ni, Pi, Q, for i < q by induction. Let No be 0 l(xO+l)0 . - . 0 l(x(m-l)+ 0, Po = 0 (the empty sequence), and Q, = 0 l("O + l) 0 - . 0 l(x(m-l)+l)0 2 + l ) 2. Suppose now that i 1 < q and that Ni, P,, Qi have been defined so that the following conditions hold:
+
Clearly no computation under As exists. Starting with a word in which (1) occurs, A, manufactures more and more one's. Lemma 4.2.
Every Turing computablefunction is algorithmic.
(3) N, f 0; (4) Ni lies on G, ending at b,; (5) Pi lies on G, beginning at b,
+ 1;
Chapter 4: Markov Algorithms
Part 1: Recursive Function Theory
(6) (7) (8) (9)
Gi is 0 except for Nipi; exactly two 2's occur in Qi; Ni 2 l'ai+l' 2 Pi - Q,; if i # 0, then (Qi-,, Q,) is a nonterminating algorithmic step under A.
Definition 4.5. If A is a Markov algorithm as in 4.1, its Godel number, g A , is the number
Clearly (3)-(9) hold for i = 0. We now define Ni+ Pi+ Qi+,. Let the row of M beginning with a, Gib, be
Lemma 4.6. We now distinguish cases depending on u. Note that, since i < q - 1, u # 4. In each case we define Ni+,, Pi+,, Qi+,, and it will then be evident that (3)(9) hold for i + 1 in that case. In each case, let Qi+, be defined by (8) for i + 1. Case 1. u = 0. Let Ni+, be Ni with its last entry replaced by 0, and let Pi+1= Pi. Case 2. v = 1. Similarly. Case 3. v = 2. Here we take two subcases: Subcase 1. Ni has length at least 2. Write N, = Ni+,e, where E = 0 or 1, and set Pi+ = &Pi. Subcase 2. Ni has length 1. Let Ni+ = (0), Pi+ = NIP,Case 4. u = 3. Again we take two subcases: with E = 0 or 1, and set N,+, = Nie. Subcase I. Pi # 0. Write Pi = &Pi+, Subcase 2. Pi = 0. Let Pi+ = 0, Ni+ = NiO. This completes the definition of N,, Pi, Qi for all i < q, so that (3)-(9) hold. Let Q, be the word N,-, 2. Then by (9) it follows that (Q-,, Q,, . . ., Qg) is a computation under A . Now by (2), (6), and (4), we can write
,
hence 0 l(f(xO..-J(m-l)+l)0 2 Occurs in Q, and 2 occurs only once in Q,. 0 It follows that A computes f. We now turn to the problem of showing that every algorithmic function is recursive. This is done by the now familiar device of Godel numbering.
PROOF. n is the Godel number of a Markov algorithm iff n 2 2 and Vi i In [((n)i)oand ((n),), are Godel numbers of words, ((n),), i 1, and l((n),) I 21.
Definition 4.7. Let Ro = {(m, n) : m and n are Godel numbers of words a and b respectively, and a occurs in b}. Lemma 4.8.
If a
=
(a,, . . .,a,-,)
is a word, its Godel number, ga, is
Thus the empty word has Godel number 1.
Lemma 4.4.
Definition 4.9. R1 = {(m, n, p, q): m, n, p, q are Godel numbers of words a, b, c, d respectively, and (a, b, c) is the first occurrence of b in d ) . Lemma 4.10.
I
=
1 or m > 1 and
R, is elementary.
PROOF. (m, n, p, q) E R1 if m, n, p, q are Godel numbers of words and Cat (Cat (m, n), p) = q and Vx I q Vy 5 q[lx < lm & x and y are Godel numbers of words 3 Cat (Cat (x, n), y) # q]. 0
Definition 4.11. R, = {(p, m, n) :p is the Godel number of a Markov algorithm A, m, n are Godel numbers of words a, b respectively, and (a, b) is a nonterminating computation step under A). R, is elementary.
PROOF. (p, m, n) E R, iff p is the Godel number of a Markov algorithm, m and n are Godel numbers of words, 3i lp such that (((P)~)~, m) E R,, and Qi I 1, Vx I m QY 5 mm[(((~)i)o, m) E Ro & V j < i[(((p)j)o, m) @ R01 & (x, ((p>i)o,Y, m) E RI => Cat (Cat (x, ((p),)~,y) = n & ((p)i)z = 01. 0
Definition 4.13. R, is like R, except with "terminating" instead of "nonterminating".
The set of Godel numbers of words is elementary.
PROOF.m is the Gijdel number of a word iff m [(m), r 3 and 1 r (mhl.
R, is elementary.
PROOF (m, n) E Ro iff m is the Godel number of a word, n is the Godel number of a word, and 3x I n 3y I n[Cat (Cat (x, m), y) = n]. (Recall from 3.30 the definition of Cat.)
Lemma 4.12. Definition 4.3.
The set of Godel numbers of Markov algorithms is elementary.
Vi < Im 0
Lemma 4.14.
R, is elementary.
Chapter 4: Markov Algorithms
Part 1 : Recursive Function Theory
If (do, . . ., dm) is a finite sequence of words, its Godel
Definition 4.15. number is
Also let R, = {(m, n) : m is the Godel number of a Markov algorithm A, and n is the Godel number of a computation under A).
Lemma 4.16.
BIBLIOGRAPHY 1. Curry, H. Foundations of Mathematical Logic. New York: McGraw-Hill (1963). 2. Detlovs, V. The equivalence of normal algorithms and recursive functions. A.M.S. Translations Ser. 2, Vol. 23, pp. 15-81. 3. Markov, A. Theory of Algorithms. Jerusalem: Israel Program for Scientific Translations (1961).
R, is elementary.
PROOF. (m, n) E R, iff m is a Godel number of a Markov algorithm, In 2 1, 0 and Vi < In l[(m, (n)i, ( n h + d E R21 and (m, (n)lnzl, (n),,) E Ra.
Definition 4.17. fix
=
EXERCISES 4.28.
Let A be the algorithm
n,,,pp.
Lemma 4.18. f, is elementary. Definition 4.19. f i x f ixm).
=
Cat (2, fix).f ?+l(x,,
. . .,x,)
Lemma 4.20. f," is elementary, for each m E w
=
Cat (f ;(x,,
Show that A converts any word a on 0, 1 (i.e., involving only 0 and 1) into a
. ..,xm-,,)
(0).
4.29.
Construct an algorithm which converts every word into a fixed word a.
4.30.
Construct an algorithm which converts every word a into l("+'), where n is the length of a.
4.31.
Let a be a fixed word. Construct an algorithm which converts any word # a into the empty word, but leaves a alone.
4.32.
There is no algorithm which converts any word a into aa.
4.33.
Construct an algorithm which converts any word a on 0, 1 into aa.
Lemma 4.21. f ,"(x,, . . ., xm-,) is the G6del number of
0 1'~"+1' 0 . . . 0 l(x(rn-l)+l) The notations R,, R,, R,, R,, f,, f," section.
will not be used beyond the present
Definition 4.22. Th = {(e, x,, . . ., x,-,, c) : e is the Godel number of a Markov algorithm A , and c is the Godel number of a computation (do, . . ., d,) under A, (c), = Cat (f ?(x,, . . ., xm- 2. 33), and 2 occurs only once in d,). Lemma 4.23. Definition 4.24.
Th is elementary. V'y
=
p x 2 y[(Cat (f ix, 2.33), (y),,)
Lemma 4.25.
V' is elementary.
Lemma 4.26.
Every algorithmic function is recursive.
E
Ro].
PROOF. Say f is m-ary and is computed by a Markov algorithm A . Let e be the Godel number of A. Then for any x,, . . ., xm- E w we have
,
f(x0, . . ., xm-,)
=
V1pz((e, x,,
. . .,xmWl,z ) E Th). 0
Thus f is recursive, as desired.
Theorem 4.27.
Turing computable
=
recursive
=
algorithmic.
4.34*. Show directly that any algorithmic function is Turing computable.
Chapter 5: Recursion Theory
5
Recursion Theory
(i) (x,, . . ., x, - ,) E Drnn F, (ii) there is a computation of M beginning with (F, c,, n
+ 1)
are equivalent; and if one of them holds, and (F, c,, n + I), (GI, a,, b,), , . ., (G,-l, a,-,, 6,-,)) is a computation of M, then (1)-(3) of 3.9(ii) hold. Clearly any partial Turing computable function is effectively calculable.
Corollary 5.2. Every Turing computablefunction is partial Turing computable. Every total partial Turing computablefunction is Turing computable. Next, we want to generalize our Definition 3.1 of recursive functions. To shorten some of our following exposition we shall use the informal notation
to mean that . - . is defined iff - - - is defined, and if . . . is defined, then - . = - - -. For example, iff is the function with domain {2,3) then when we say We have been concerned so far with just the definitions of mathematical notions of effectiveness. We now want to give an introduction to the theory of effectiveness based on these definitions. Most of the technical details of the proofs of the results of this chapter are implicit in our earlier work. We wish to look at the proofs and results so far stated and try to see their significance. In order to formulate some of the results in their proper degree of generality we need to discuss the notion of partial functions. An m-ary partial function on w is a function f mapping some subset of "w into w. The domain off may be empty-then f itself is the empty set. The domain off may be finite; it may also be infinite but not consist of all of "w. Finally, it may be all of "w, in which casef is an ordinary m-ary function on w. When talking about partial as total. functions, we shall sometimes refer to those f with Drnn f = Intuitively speaking, a partial function f (say m-ary) is effective if there is an automatic procedure P such that for any x,, . . ., xm-, E w, if P is presented with the m-tuple (x,, . . ., xm-,) then it proceeds to calculate, and if (x,, . . ., x,- ,)E Dmnf, then after finitely many steps P produces the answer f(xo,. . ., x,-,) and stops. In case (x,, . . ., xm-,) $ Drnn f the procedure P never stops. We do not require that there be an automatic method for recognizing membership in Drnn f. Clearly iff is total then this notion of effectiveness coincides with our original intuitive notion (see p. 12). Now we want to give mathematical equivalents for the notion of an effective partial function.
Definition 5.1. Let f be an m-ary partial function. We say that f is partial Turing computable iff there is a Turing machine M as in 1.1 such that for every tape description F, all q, n E Z, and all x,, . . ., xm-,E w, if 0 l(xO+l)0 - - - 0 l(x(m-l)+ lies on F beginning at q and ending at n, and if Fi = 0 for all i > n, then the two conditions
we mean that Drnn g
f (x + 2).
n Drnn h = {0,1) and for
any x E {0,1), gx
+ hx =
Definition 5.3 (i) Composition. We extend the operator K! of 2.1 to act upon partial functions. Let f be an m-ary partial function, and go, . . .,g m _ , n-ary partial functions. Then Kg is the n-ary partial function h such that for any Xo, . . . , X,-lEw,
(ii) Primitive recursion with parameters. Iffis an m-ary partial function and h is an (m + 2)-ary partial function, then Rm(f,h) is the (m 1)-ary partial function defined recursively by:
+
for all x,, . . ., xm- ,,y E w. (iii) Primitive recursion without parameters. If a E w and h is a 2-ary partial function, then RO(a,h) is the unary partial function g defined recursively by
Chapter 5: Recursion Theory
Part 1: Recursive Function Theory (iv) Minimalization. Let f be an (m + 1)-ary partial function. An m-ary partial function g is obtained from f by minimalization provided that for all g(x,, . . ., x,-~)
2:
Theorem 5.7. There is a partial recursive function f such that f cannot be extended to a recursive function.
least y such that Vz 5 y((xo, . . ., x,-~, Z) E Dmn f ) and f(x,,. . ., x,-~, y) = 0.
We then write g(x,, . . ., xm-l) "- py( f(x0, . . ., xm-l, y) = 0). (v) The class of partial recursive functions is the intersection of all classes C of partial functions such that 4 E C, U; E C whenever i < n E w , and Cis closed under composition, primitive recursion, and minimalization. Clearly every partial recursive function is effectively calculable. Note that it is not appropriate to simplify the definition of minimalization to g(x,, . . ., x,-~)
2:
least y such that (x,, . . ., x , - ~ , y) E Dmn f and ~ ( x o ,. . , X ~ - I , Y = ) 0,
+
Corollary 5.4. Every general recursive function is partial recursive.
recursive.
Here it is PROOF. PARTIALRECURSIVE =. PARTIALTURINGCOMPUTABLE. only necessary to read again the proofs of Lemmas 3.10-3.16 and check that they adapt to the situation of partial functions and the new Definitions 5.1 and 5.3. COMPUTABLE + PARTIAL RECURSIVE. PARTIAL TURING to reread 3.17-3.38.
Corollary 5.6.
Again one needs only
Any total partial recursive function is recursiue.
+
fx
=0
if x is not the Godel number of a Turing machine, Vpu((x, X, U)E TI) 1 if x is the Godel number of a Turing machine and there is such a u, fx is undefined, otherwise.
+
It is routine to show that f is partial recursive; we will prove this formally in this case, but usually not in the future. We can define f by (1). Clearly then, for any x E w
so f is partial recursive. Now f cannot be extended to a general recursive function. For, suppose f s h with h general recursive. By the proof of 3.38 there is an e E w such that, for all x E w ,
In particular, he = Vpu((e, e, u) E TI) and (by the definition of TI, 3.35) e is the Godel number of a Turing machine. Thus fe is defined, and
In contrast to the situation for Turing computability, it is not at all immediately clear that every total partial recursive function is general recursive; this is, however, true, as our next theorem shows. The proof of this theorem is rather long when carried out from the beginning. = partial
PROOF. The rule for computingf is as follows. For a given x E w , determine whether or not x is the Godel number of a Turing machine. If it is not, set fx = 0. If it is, test in succession whether or not (x, x, 0) E TI, (x, x, 1) E TI, (x, x, 2 ) ' TI, ~ etc. The first time we find a u such that (x, x, u) E TI, set fx = Vu 1. If we never find such a u, the computation never ends. Clearly f is intuitively a calculable partial function, and it has the following property: for any x E w,
(1)
for all x,, . . .,xm- E w. For, even iff is calculable there may be no clear way to calculate g. For example, suppose that (x,, . . ., xm-,, 0) Dmnf, while (x,, . . .,xm-l, 1) E Dmn f and f(x,, . . ., xm-,, 1) = 0. Without knowing that (x,, . . ., x,-~, 0) $ Dmn f it is unclear at what point in a computation of g(x,, . . ., x,-,) one would be justified in setting g(x,, . . ., x,-~) = 1. The above definition of minimalization clearly avoids this difficulty. One can give explicit examples where f is partial recursive but g, defined in this new way, is not. (See Exercise 5.38.) Note that there are nontotal partial recursive functions. For example, clearly C: is partial recursive, and hence by 5.3(iv) so is the function g such that gx 2: py(C?(x, y) = 0). Obviously, however, g is the empty function.
Theorem 5.5. Partial Turing computable
A natural question occurs as to whether every partial recursive function can be extended to a recursive function; the answer is no:
0
fe contradiction.
=
Vpu((e, e, u) ET,)
+ 1 = he + 1 = fe + 1, 0
We now turn to the formulation of some basic results called the normal form, iteration, and recursion theorems.
Definition 5.8. For any e E w and m E UJ let cpr be the m-ary partial recursive function such that for all x,, . . ., xm-, E w, cpr(xo, . . ., xm-,) 2: Vpu((e, x,, . . ., xm-1, u) E Tm). Note also that the (m + 1)-ary partial function F' defined by cpt(xo, . . ., xm-1, e) 2: Vpu((e, XO,. . ., x , - ~ , u) E T,) for all x,, . . ., x ,-,, e E w, is also partial recursive. This remark will be frequently useful in what follows.
Chapter 5 : Recursion Theory
Part 1: Recursive Function Theory Theorem 5.9 (Normal form theorem). For any partial recursive function f (say m-ary) there is an e E w such that f = cpz. PROOF. By the proof of 5.5, second part.
0
Corollary 5.12 (Universal partial recursive function). There is a partial recursivefunction g of two variables such that for any partial recursive function f of one variable there is an e E w such that for all x E w, g(e, x) 2. fx. PROOF. Let g be as in the proof of 5.1 1.
This theorem, which was implicitly used already in the proof of 5.7, has many important corollaries, which we shall now explore. First of all, its normal form nature is made a little more explicit in the following corollary.
-
1 there exist a 1-place elementary function Corollary 5.10. For each m E w f and an ( m + 2)-place elementary function g such that for any m-ary partial recursive function h there is an e E w such that for all x,, . . ., x m - , E w,
PROOF. Let f
=
V and g
=
Sg
0
x,,.
0
In view of the proof of 3.4, the reader might view 5.12 with some suspicion. Let us see what happens if we try the diagonal method on the g of 5.12. For any x E w, let fx .- g(x, x) I. Then f is partial recursive, so by 5.12 there is an e E w such that for all x E w , g(e, x) 2. f x . Now if g(e, e ) is defined, then g(e, e ) = fe = g(e, e ) 1. Conclusion: g(e, e) is not defined. We are saved by g being a partial function. No contradiction arises. We now turn to the iteration theorem. This basic result, although of a rather technical nature, is basic for most of the deeper results in recursion theory. See, e.g., the proofs of 5.15, 6.19, and 6.25.
+
+
0
This formulation suggests the possibility of improving the result by droppingf. (Another possibility, dropping p, is impossible since there are recursive functions which are not primitive recursive.) As to this possibility, see Exercise 5.43; the answer is no. Theorem 5.9 and its proof give rise to a certain universal phenomenon as follows. Corollary 5.11 (Universal Turing machines). There is a Turing machine M with the following property. I f f is any unary partial Turing computable function and a Turing machine N computes it, and if e is the Codel number of N , then if 0 1'" + I ) 0 I("+ l) 0 is placed upon an otherwise blank tape ending at - 1 and if M is started at 0, then M will stop ifJ x E Dmn f, and if x E Dmn f , then after the machine stops I""+" 0 will lie on the tape beginning at 1 . PROOF. Let g be the partial recursive function defined by
-
+
Theorem 5.13 (Iteration theorem). For any m, n c w 1 there is an ( m 1)ary recursive function SF such that for all e, y,, . . ., y,, x,, . . ., x, E w,
PROOF. If M is any Turing machine and y,, following Turing machine :
. . .,y,
E w,
let M,*, ,.,,,, ,be the
+
Clearly there is an (m 1)-ary recursive function s: such that for any e, y,, . . ., y, E w, if e is the Godel number of a Turing machine M, then s:(e, y,, . . ., y,) is the Godel number of M*,, ,...,., Obviously SF is as desired in the theorem. 0 Actually a more detailed analysis would show that s; in 5.13 can be taken to be elementary recursive, but we shall not use this fact. As a first application of the iteration theorem we give Corollary 5.14. There is no binary function f such that for all x, y
for all e, x E w. Let M compute g. Clearly M is as desired.
In more intuitive terms we can describe the way M is to act as follows: M is presented with two numbers e and x. First M checks if e is the Godel number of some Turing machine. If it is, say t. = g N , then M begins checking one after the other whether 0 or 1 or . . . is the Godel number of a computation under N with input x. If there is such a number, M takes the first such and reads off the result of the computation. It may be that e is not the Godel number of a Turing machine or that there is no computation with input x ; then M does not give an answer. 0 r.
E p,
0 PROOF. Suppose there is such a n f ; say f = cpz. Now for any x, y
Ew
if y is the Godel number of a Turing machine, (x, x) E Dmn cpz, and cpE(x, x) = 0; g(x, y ) is undefined, otherwise.
g(x, y)
=0
let
part 1 : Recursive Function Theory
Say g
=
Chapter 5 : Recursion Theory Case I. x Case 2. x Case 3. x Let
cp:. Then by the iteration theorem,
iff (s:(r, e), e) E Dmn cpf ifff(s:(r, e), s:(r, e)) = 0
s:(r, e) E Dmn vl(s:(r, e))
U
~h~~ there is no automatic method for determining of a pair (x, Y)whether Dmn cp:. Otherwise stated, there is no automatic method of determining of a Turing machine M and a number y whether M will eventually stop with an output when presented with input y. Thus Corollary 5-14 shows the recursive unsolvability of the Halting problem for Turing machines. We can give a more intuitive, informal proof of this result. Suppose we have an automatic method telling us whether a Turing machine M will stop with input y. Then we can construct a machine N such that for any Y E * the following conditions are equivalent:
(1) N stops when given input y ; (2) is not the @&I number of a Turing machine, or it is the number of a machine T such that T does not stop when given input Y. ~ eNt have Gadel number e. By (I) and (2) we reach a contradiction in trying to decide whether N stops, given input e.
Theorem 5.15 (Recursion theorem). If m > 1 and f is an m-arY partial recursive function, then there is an e E w S U C ~that for all xo, . . ., xm-2 E w, f(x0,. . ., ~ ~ - e)2 21,
g(x0, . . ., x,,, - 1)
N
w
let
f ( ~ 0.,. .,X m - 2, ~i-
~ h u gs is partial recursive; say g = py. Let e iteration theorem, for all x, . . ., x,-2 E W, C&'-'(X~,
. . .,xm-2)
- 1, xm - 1)). =
sk-i(r, r). Then by the
~ : ( X O.,. ., Xm-2, r) N g(x0,. . ., xm-2, r) 2 f(x0,...,xm-2,e).
2
cpz(q, pt,O. . . . :pt("m - I I)),
where ti 2: cp:(ri, y) for each i < m. Case4. x = 2.7q.11awithq > 0. Let
n
PROOF.For any x,, . . .,xm-I E
=
hl(x, y, e)
iff s:(r, e) $ Dmn cpf(s:(r, e)), a contradiction.
+
2. Let hl(x, y, e) = (y), 1 for all y. 2".3'+l, where i < n. Let h'(x, y, e) = (y), for all y. = 2"-5"-p:-p',0- . . . . p ~ ~ j with 3 , n, m > 0. =
h ' k , 1, e) h ' h 2'+', e) where v
2
$
a, cp;(q, 2y.3V),
cp:(x, 29, hl(x, 2, e)
1
i\4
= N
=
0
for Z. not of the form 2". Case 5. x 2" 11'. 13' with m > 0 and q > 0. ~~t (Y), = 0. We set
be given
h'(x, Y, e) 2: 9 3 9 , y), @(x, Y-P&+',e) 2: cpz(r, y.p&.p;+,), where v .v cp;(x, y.p",. Case 6- For x not of one of the above forms, let y, = 0 for e. we apply the recursion theorem and obtain an e E such that for all X, Y E w, hl(x, Y, e)
-
cp:(x, y).
it is straightforward to check by complete induction on that for all x, Y w, h(x, Y) 2 c~:(x, y). Thus h = cpz is recursive. It is similarly shown that the function in 3.52 is recursive. ~ ~we define a partial recursive function f fas follows J V , Y, e) f l ( x + 1,o, e) f'(x + 1, Y + 1, e)
= 2:
2:
+
y 1, (P;(X, I), &(x, (P:(x
+ 1, y)).
Let be such thatf'(x, Y, e) 2 V ~ ( XY) , for all X, y E w. Then it is easily proved induction on X, with induction on y in the induction step, that S cp;. ~ f(x7 Y) 2 VXX, Y) for all x, y E w . T ~ U =
0
The recursion theorem is extremely useful in checking that functions defined by rather complicated recursive conditions are, in fact, general recursive. We shall illustrate its use by verifying again that the functions of 3.5 and 3.52 are recursive. ~n the case of 3.5, we first define an auxiliary three-place function h' that is obviously partial recursive from the form of its definition, which goes by cases as in the definition of h, as follows. Let x, y, e E w-
Theorem 5-16(Fixed point theorem). there is an e E w such that cp: =
f is a unary recursivefunction then
PROOF. For any x, y E w let g(x, Y )
2:
V P ~ (fy, ( X, u) E TI).
Thus g is partial recursive, and g(x, y) 2. cphx for all x, w. N~~ we apply the recursion theorem to obtain on e E w such that g(x, 2. cp:x for all x e w. Thus cp: = qfe, as desired. 01
~
Chapter 5: Recursion Theory
Part 1 : Recursive Function Theory PROOF. Suppose there is such an$ Let
An important consequence of the fixed-point theorem is given in Theorem 5.17 (Rice). Let F be a set of one-place partial recursive functions such that 0 # F and F does not consist of all one-place partial recursive functions. Then A = {e : cpl, E F ) is not recursive.
g(e, x ) = 1 g(e, x ) = 0 Thus g is recursive and g(e, x ) g(e, x )
PROOF. Suppose it is. Let a E A and b $ A. Now define
if 3u 5 f(e, x)((e, x , u) E T I ) , otherwise.
= =
1 0
if x E Dmn cp:, if x $ Dmn cp:,
contradicting 5.14. Then g is recursive. By 5.16 choose e such that cpk = cpi,. Then if e E A we see that cp: E F (by the definition of A), hence cp;, E F, so ge E A ; but e E A implies also ge = b $ A , contradiction. Also, e $ A implies on the one hand cpl, $ F, cpi, $ F, ge $ A, and on the other hand implies ge = a E A, contradiction. 0 Rice's theorem has many important corollaries; we shall mention a few. Corollary 5.18. recursive.
For any unary partial recursive function f, {e : cp:
Corollary 5.19.
{ x : cp: is a constant function) is not recursive.
Corollary 5.20.
{ ( x , y ) : y is in the range of cp:) is not recursive.
=f
) is not
0
Thus there is no automatic procedure P such that, given a Turing machine M and a number x , P determines the maximum number of steps in an Mcomputation starting with x. Our final topic of this section is the arithmetical hierarchy. The recursive relations, as we have argued, coincide with the effective number-theoretic relations. Certain other relations, namely those obtained by using the quantifiers 3 or V on the recursive relations, are also very natural relations to consider in many contexts. They can be arranged in the so-called arithmetical hierarchy, according to the depth of quantifiers used in defining them. We shall describe this hierarchy and its most important properties. Our main result, 5.36, depends on the following normal form theorem. Theorem 5.23. Let m > 1. If R is an m-ary recursive relation, then there exist e, e' E w such that for all x,, . . . , x , E w,
-,
PROOF. If the given set is recursive, then clearly so is
PROOF. For any x,, . . ., x m - , E w let
{ x : 0 is in the range of cp:),
0
contradicting 5.17. Corollary 5.21.
Thus f is partial recursive, so by 5.9 there is an e E w such that for all x,, . . ., X m - 2 E w,
( ( x , y) : cp: = cph) is not recursive.
PROOF. If the given set is recursive, and e E w, then
{ x : cp: = cp:) is recursive, contradicting 5.17. Thus there is no automatic procedure for determining whether or not cp: is a given unary partial recursive function; or whether or not cp: is a constant function; or whether or not y is in the range of cp:; or whether or not cp: = cp:. Clearly 5.14 is also a consequence of Rice's theorem. We can use 5.14 to establish the following result concerning the length of computations. Theorem 5.22. There is no binary recursive function f such that for all e, x E w , 3u((e, x, u) E TI) i#3u f (e, x)((e, X, U )E TI).
~ Y ( ( x o , . . . , x ~ - ~ , Y ) E R i)f f ( x o , . . . , x r n - 2 ) ~ D m n f , iff 3y((e, xo, . . .,xm- 2 , Y ) E T m Thus ( i ) holds. Condition (ii) is easily obtained from (i).
0
Definition 5.24. Let C , = no = set of all recursive relations. If n, m > 0, then an n-ary relation R is in Cm (respectively n m ) provided there is an (m n)-ary recursive relation S such that, if m is odd,
+
Chapter 5 : Recursion Theory
Part 1: Recursive Function Theory
PROOF. The assertions for A, follow from those for C, and II,. The assertions for C, and II, are proved simultaneously by induction on m. The case m = 0 is trivial. Now assume the assertions for m. We take just one typical 1: assertion for m Assume R, S E C,+ ,; we show that R n S E C,+ ,. By 5.25, choose (n + 1)ary II,-relations R', S' such that for all x,, . . ., xn-, E w ,
while, if m is even,
+
(respectively
Members of C, (respectively II,) are called C,-relations (respectively II,relations). Also let A, = C, n II,. Any member of U, ,,, (C, u II,) is said to be arithmetical.
,
Then for any x,, . . ., xn-,
The following three propositions are now easily .established by induction, using 5.25: Proposition 5.26. IfR is an n-ary C,-relation, f,, functions, and
then S E C,. Similarly for
n,
. . .,f, ,are n-ary recursive -
i f f 3 y ~ w 3 z ~ w [ (,..., x, x,-,,~)ER' and (x,, . . ., x,-,, z) E St].
Now let R" = {(x,, . . ., x, + ,) : (x,, . . ., x,) E R') and S " = {(x,, . . ., x,, ,) : (x,, . . ., x,- ,, x,+ ,) E St). Using 5.26 and 5.27 it is easy to see that R", S" E II,. Now, continuing from above, for any x,, . . .,x,-, E w, ( x , . .. x
)GR
nS
iff 3y E w 32 E ~ [ ( x , ,. . ., x,-,, y, z) E R" n S"] iff 3y E w[(xo, - - ., Xn-1, (Y),, (Y)J E R" n S"1.
Since R" n S " E II, by the induction hypothesis, we get R n S E C,,,
I
1
by
17
5-25. For m > 0, neither 4 nor II, nor A, is closed under complementation; see 5.36. The following proposition is evident.
f
k
1
I
Proposition 5.30. I f R is an n-ary 2,-relation with n > 1 and m > 0, and if S = {(xO, . . .,x,- 2) : 3y E w(xo, . . ., x, - z , y) E R), then S E 2,. Similarly with II. and V. Proposition 5.31. I f R is an n-my Cm-relation,then so are the two relations
and A,.
Proposition 5.27 (Adjunction of apparent variables). If R is an n-ary C,relation and S = {(x,, . . ., x,) : (x,, . . ., x,) E R), then S E C,. Similarlyfor II, and A,. Proposition 5.28 (Identification of variables). If R is an n-ary C,-relation, n > 1, and S = {(x,, . . ., x , - ~ ) : (x,, x,, xl, x2, . . ., x , - ~ ) E R}, then R E Z ., Similarly for n, and A,. Proposition 5.29. If R and S are n-ary C,-relations, then so are R u S and R n S. Similarly for n, and A,. n,
w,
(x, ,..., x , - , ) e R n S
Note that there are only X, arithmetic relations, and hence most numbertheoretic relations are not arithmetical. Now we want to describe the relationships between the various classes C,, II,, and indicate some operations under which these classes are closed. The following obvious proposition indicates how these classes can be inductively defined, and furnishes a basis for inductive proofs of our further results. Proposition 5.25 (i) An n-ary relation R is in C,, iff there is an (n + 1)-ary relation S in IIm such that for all x,, . . ., x,-, E w, (x,, . . ., x,-,) E R zff 3y E w ( ( ~ 0.,. ., xn-1, Y) E S). (ii) An n-ary relation R is in II,+, iff there is an (n + 1)-ary relation S in C, such that for all x,, . . ., x,-, E w, (x,, .-.., x,-,) E R iff Vy E w ( ( ~ 0., . ., Xn-1, Y) E S).
E
1
PROOF. Again we prove all cases simultaneously by induction on m. The case m = 0 is trivial. Assume that all of the statements are true for m. We take one typical case for m + 1 : Let R be an n-ary C,+,-relation, and let T be as above. By 5.25, let R' be a II,-relation such that for all x,, . . ., x,-, E w, (X0,...,Xn-1)ER
iff3z€w[(x0,..., X , - ~ , Z ) E R ' ] .
Clearly, then, it suffices to show that for all x,, . . ., x,-, (1)
Vy <
x,-1
E
w,
32 E ~[(xO,. . ., x,,-2, Y , Z) E R'] , x , - ~ , y, (z)~)E R']. iff 32 E w Vy ly X , , - ~ [ ( X- ~- .,
Chapter 5 : Recursion Theory
Part 1: Recursive Function Theory
Clearly the right side of (1) implies the left side. If the left side holds, choose for each y < x,-, an integer w, E w such that (x,, . . ., x,-,, y, w,) E R', and let z = II,, - ,,pYy; clearly then z is as desired in the right side of (1). 0
,
The following proposition is obvious:
Proposition 5.32. If R is an n-ary relation, then R Proposition 5.33. C,
U II,
A,,
E
C, iff "w
-
R
E
~f R; has been defined for all n, let Rk+1 = ( ( ~ 0 ., . ., xn) 3~ E ~ [ ( x -o.,., X n , Y ) 6Rk"]). It is easily seen by induction on m, using 5.23, that the desired conditions hold. 0
- -
Theorem 5.36 (Hierarchy theorem). For any m, n > 0 there exists an n-ary II,. Hence "w T E I I , Em.Furthermore, there is an relation T E C, n-ary relation W E A,, (C, U IX,). PROOF. Let R; be as in 5.35. Let
-
II,.
,.
PROOF. Let R E C,, say R is n-ary. Let S = {(x,, . . ., x,) : (x,, . . ., x , - ,) E R}. Then S E C, by 5.26 and 5.27. Clearly R = {(x,, . . ., x,-,) : Vy E ~ [ ( x ,.,. ., x,-,, y) E S ] ) , SO R E I, Thus C, _c II,, ,, and similarly I X , _c C,,,. An easy inductive argument shows that C, E C,,, and II, G II,,,. 0
,.
-
T = {(xo,- . ., xn - 1) : ( X O , X O , X I , X 2 , . . ., xn - 1 ) E R l ) . Thus T E C,. If T E II,, by 5.35 choose e E w so that T = {(x,, . . ., xn-,) : (e, x,, . . ., x,-,) 6 R;}. Then ecn l ) E Rk iff e(")E T iff (e), l $ R;, a contradiction. Thus T 6 n,. For the second part of the theorem, let T be as in the first part. Set +
+
We will return to the following important result several times later on:
{(xo,. . ., xn-1) : ((xo)o,( X I ) O , . . ., (xn-i)0)6 T and ( ( x o ) (~X ,I ) , , . . ., (xn- d l ) E T } . PROOF. We know that A, c A,. Suppose R E A,, say R is n-ary. Then there Now T , "w T E A,+, by 5.33, so W EAm+l. Suppose W E C,. Choose are recursive S , T((n + 1)-ary) such that for all x,, . . ., x , - ,E w , (to, . . ., t,-,) E T ( T is obviously nonempty since 0 E IX,). For any x,, . . ., (xo,...,x,-i)~R ~ ~ ~ ~ ~ [ ( X ~ , . . . , X ~ - ~ , Y > E S I x,-, ~w we have iff VyC(x0,. . .,x,-1, Y ) E TI. iff (2%O- 3t0, . . ., 2X(n-1). 3t(n-1) (x,, . . ., X, - ,) T E W, Hence, as is easily seen, so "w T E C,, contradiction. Similarly, W E II, leads to a contradiction.
Theorem 5.34.
A,
=
A,.
W
=
-
-
Thus the arithmetical hierarchy appears as in the following diagram, where the lines indicate proper inclusions:
0
so R is recursive.
Intuitively, to determine whether or not (x,, . . ., xn-,) E R we check in succession (x,, . . ., x,- 0), (x,, . . ., x,-,, I), . . . for membership in S and T. Eventually one of these is in S (hence (x,, . . . , x,- ,) E R), or else one of them fails to be in T (hence (x,, . . ., x,-,) 6 R). Now we extend our normal form results up into the arithmetical hierarchy:
,,
Theorem 5.35. For m , n > 0 there is an (n + 1)-ary C,-relation Rz with the following properties:
(i) for every n-ary C,-relation S there is an e E w such that S {(xo,. . . , X n - 1) : (e, xo, . . ., x, - 1) E Rkl; (ii) for every n-ary n,-relation S there is an e E w such that S {(xo,. . ., x,, - ,) : (e, xo, . . ., xn- ,) $ R 3 .
=
=
Chapter 5: Recursion Theory
Part 1 : Recursive Function Theory
BIBLIOGRAPHY 1. Kleene, S. C. Introduction to Metamathematics. Princeton: van Nostrand (1952). 2. Malcev, A. I. Algorithms and Recursive Functions. Groningen: WoltersNoordhoff (1970). 3. Rogers, H. Theory of Recursive Functions and Effective Computability. New York: McGraw-Hill (1967).
EXERCISES
5.45.
I f f is a unary recursive function, then { ( x ,f x ) : x E w ) is a recursive relation. Similarly if we replace both words "recursive" by "primitive recursive" or by "elementary."
5.46.
Give an example of a unary partial recursive function f such that { ( x ,f x ) : x E Dmn f ) is not recursive.
5.47.
There is a recursive set which is not elementary.
5.48.
There is a unary recursive function f for which there is no binary elementary function g such that for all x E w , f x = py[g(x, y ) = 01. Hint: take f = x,, where A is as in 5.47.
I f f is a finite function (i.e., it is a finite set and is a function), then f is partial recursive.
There is a total unary function f such that { ( x ,f x ) : x E but f is not elementary.
Give an example of a binary partial recursive function f such that if g is defined by
There is no recursive procedure for deciding for an arbitrary e whether or not cp: has infinite range.
g x = least y such that f ( x , y) is defined and f ( x , y) = 0 , g x = undefined if no such y,
Assume m > 1 . Let A = {e : cp; is a special recursive function). Show that A is not recursive.
then g is not partial recursive (cf. 5.3 and following remarks). Give an example of a binary recursive function f such that if g is defined by g x = least y such that f ( x , y ) = 0, gx = 0 if no such y, then g is not recursive. The class of partial recursive functions is the intersection of all classes C of partial functions such that o E C, U: E C whenever i < n, and C is closed under composition, primitive recursion, and minimalization, all except composition applied only to total functions. I f f is an m-ary partial recursive function and Dmn f is recursive, then f can be extended to a general recursive function. Give an example of an m-ary partial recursive function f which can be extended to a general recursive function, but has the property that Dmn f is not recursive. There is a unary partial recursive function f such that for no binary recursive function g is it true that for all x, f x E py[g(x, y) = 01. Hint: let f x 2 cpix.0 + x for all x . If g works as above, let hx = cpkx 1 if g ( x , x ) = 0 , h x = 0 otherwise. Show h is recursive and obtain a contradiction.
+
For any total function f of one variable the following conditions are equivalent : ( 1 ) there is a recursive function g of two variables such that for all x f x = PY[B(X, Y ) = 01. ( 2 ) { ( x ,f x ) : x E W ) is a recursive relation.
E w,
The conditions remain equivalent if in both (1) and ( 2 ) "recursive" is replaced by "primitive recursive" or by "elementary."
W)
is elementary
Show that the function f defined as follows is recursive. f a y ) = Y + 1, f(l,~= ) Y + 2, f ( x + 2,O) = f ( x + I , I), f ( x + 2, Y + 1) = f ( x , f ( x + 1 , f ( x + 2, Y))). Show that there is no recursive function f satisfying the following conditions : f ( 0 , Y ) = Y + 2, f ( x + 1,O) = f ( x , I), f ( x + 1, Y + 1) = f ( x + l , f ( x , Y ) ) + 1.
Chapter 6: Recursively Enumerable Sets
6
Recursively Enumerable Sets
PROOF. Obviously (i) * (ii) 3 (iii). To show that (iii) => (iv) we just need to show that 0 (the empty set) is the range of some partial recursive function; and obviously the only possibility for such a function is 0 (which is also the empty function). 0 is partial recursive by the argument following 5.3. (iv) 3 (v). Let A = Rng cpi. For any x E w let
fx
-- PY((~,(~10,(~11)
and YY), = 4 . Clearly then Dmn f = Rng cpi = A, and f is partial recursive. (v) * (vi). Suppose A = Dmn cp:. Then for all x E w , x E A iff 3y((e, x, y) E T,), so A E C1. (vi) * (i). Suppose A EX,. By 5.23 choose e E w such that A = {X: 3y((e, x, y) E T,)). We may assume that A # 0 ; say a E A. Now for any X E w let E T1
Clearly f is an elementary function and Rng f
In this chapter we shall deal in some detail with the set C, of relations (see 5.24). Such relations are called recursively enumerable for reasons which will shortly become clear. The study of recursively enumerable relations is one of the main branches of recursive function theory. They play a large role in logic. In fact, for most theories the set of Godel numbers of theorems is recursively enumerable. Thus many of the concepts introduced in this section will have applications in our discussion of decidable and undecidable theories in Part 111. Unless otherwise stated, the functions in this chapter are unary. A nonempty set is efSectively enumerable provided there is an automatic method for listing out its members, one after the other. This does not imply that there is a decision method for determining membership in the set. The formal version of this notion is given in
Definition 6.1. A set A G w is recursively enumerable (for brevity r.e.) if A = 0 or A is the range of a recursive function. This definition can be given several equivalent forms, each having its own intuitive appeal :
Theorem 6.2. For A
G w
the following are equivalent;
A = 0 or A is the range of an elementary function; A = 0 or A is the range of a primitive recursive function; A is recursively enumerable; A is the range of a partial recursive function; A is the domain of a partial recursive function; (vi) A E XI.
(i) (ii) (iii) (iv) (v) --
=
A, as desired.
0
An intuitive proof of the equivalence of 6.2(iii) and 6.2(v) is instructive. First assume that A is recursively enumerable, A # 0. Say A = Rng f, recursive. We define a function g with domain A as follows. To calculate gx, we look along the list f0,f 1,. . . for x . If we find it, we set gx = 0. If x is never found, gx is never computed. Clearly g is effectively calculable (see introduction to Chapter 5), and Dmn g = A. Conversely, suppose A = Dmn g, g partial recursive, and assume that A # 0. Now we make the following calculations: two steps in the calculation of go one step in the calculation of g l three steps in the calculation of go two steps in the calculation of g l one step in the calculation of g2 four steps in the calculation of gO three steps in the calculation of g l two steps in the calculation of g2 one step in the calculation of g3 ... ... ... ... .. .. During this process we will occasionally obtain answers. At regular intervals we list out all the x for which we have so far calculated gx. Since A # 0, eventually we will list at least one x, and then at regular intervals we put more on our list (with many repetitions). Calling the list f0, f 1, . . ., clearly f is an effectively calculable total function with range A. Now we want to investigate the relationship between recursive and recursively enumerable sets. By 5.33 and 5.36 we have
Theorem 6.3. Every recursive set is recursively enumerable. There is a recursively enumerable set which is not recursive.
Chapter 6: Recursively Enumerable Sets
Part 1: Recursive Function Theory Hence for all y
The second part of 6.3 is one of the most important results of recursion theory, so we give its proof here in a more direct form:
Definition 6.4. Theorem 6.5.
K
=
xAy = 1 xay = 0
{ x : 3y((x,x , y) E TI)).
-
0
?
-
contradiction.
$
Theorem 6.8. subset.
,4
Any infinite recursively enumerable set has an infinite recursive
PROOF. Let A be infinite r.e., say A = Rngf, f recursive. We define g by induction:
U
+
Thus gx < g(x 1) for all x E w, and hence, by 6.7, R n g g is infinite and recursive. Obviously Rng g E A. 0
The set K will be discussed further later on. Another important relationship between recursive and recursively enumerable sets is given in 5.34, which can be reformulated as follows:
c
Theorem 6.6. Let A
w.
The following conditions are equivalent:
( i ) A is recursive; (ii) A and OJ A are recursively enumerable.
-
This theorem can be seen in the following fashion, working directly from Definition 6.1: Of course (ii) * ( i ) is the main part of 6.6. Assume (ii). We may suppose 0 # A # w. Then let f and g be recursive functions with Rng f = A, Rng g = w A. To determine whether x E A or not, list out fO, go, f 1, g l , . . .. Eventually x will appear in the list; if x = fn for some n, then x E A, while if x = gn for some n, then x E A. Formally, for any x E w,
-
if fpy(fy = x or gy otherwise.
xAx = 1 xAx = 0
=
x)
=
x,
Next, we want to investigate closure properties of the class of r.e. sets. Which operations on sets lead out of the class, and under which operation is ' the class closed? By 5.29, the class of r.e. sets is closed under union and intersection. We can give intuitive proofs of these facts directly from the definition. Let A and B be r.e. sets, and ignore the case when one of them i I is empty. Let f and g be recursive functions enumerating A and B respectively. I One enumerates A U B by: f 0, go, f 1 , g l , . . .. One can enumerate A n B by looking along this list and putting a number on a separate list as soon as it appears at both an odd and even step. Both of these procedures can be given I, a rigorous formulation.
,
,
By 6.3 and 6.6, the class of r.e. sets is not closed under complementation. Some further closure properties:
I
Theorem 6.9. Let A
The following are equivalent:
G w.
(i) A is inJinite and recursive: (ii) there is a recursivefunction f with Rngf
=
A and V x E w(f x < f
PROOF. ( i ) a (ii). Let a be the least member of A. Define
f (x
f0 1)
+
a = py(y =
EA
and y > fx).
Clearly f is as desired. (ii) * (i). Assume f as in (ii). Then by induction on x ,
(X
+ 1)).
4
If A is r.e. and f is partial recursive, then f *A is r.e.
PROOF.We may assume that A # 0. Say A = Rng g, g recursive. Clearly 0 0 g is partial recursive. 0
f * A = Rng ( f g ) and f
Theorem 6.10. I f A is r.e. and f is partial recursive, then f-'*A is r.e. PROOF. Say A
=
Theorem 6.11.
If A is r.e., then U,,, Rng cp: is r.e.
Thus (2)
Vy E Rng f 3x
Iy
(fx
=
Y).
Dmn cp:. Then f-l*A
PROOF. For any y Y
1
if3x Iy ( f x = y) otherwise,
as desired.
,
K is recursively enumerable but not recursive.
PROOF. Obviously K E Cl so K is recursively enumerable. Suppose K is recursive. Then so is w K, so by 6.2(v) there is an e E w such that w K = Dmn cp:. Then iff e E Dmn cp: by the definition of K, eE K iff e E Dmn cp: by the choice of e, e6K
Theorem 6.7.
E w,
=
Dmn (cp: f ) as desired. 0
E w,
E
U Rng cp:
I*€A
i f f 3x E A ( y E Rng cp:).
Since both A and each Rng p: are in C,, it follows easily that is in 2,.
U,,,
Rng p:
0 n<
Chapter 6: Recursively Enumerable Sets
Part 1: Recursive Function Theory
We may assume that R # 0 ; say (a,, . . ., a,-,) x E w let
Before carrying the theory of r.e. sets further we wish to back up and extend our results obtained so far to relations.
-
PROOF. Clearly ( i ) =. (ii) (iii) (iu). (iv) =. (v). Assume (iv), with f,, . . ., f,-I partial recursive and R = { ( f o x ,. . .,fm-,x) : x E Drnn fo n - . . n Drnn fm- ,). We may assume that R # 0 , say (a,, . . . , a,- ,) E R. Say f , = cp:,, . . .,f,-I = cp:(,-l,. For any x E w, let p i + if (ei, (x),, ( x ) ~,)+ c T 1 for all i < m, gx = t<m
gx
=
n
otherwise.
i<m
Clearly g is elementary and R = {((gx),, . . ., (gx),-I) : x E w). Obviously (v) 3 (vi) => (vii) => (viii). (viii) (ix). Suppose f is as in (viii). Sayf = cp:. For any x,, . . ., x , let
if (e, ( 4 0 , . . ., (4,) E Tm f,x = ai otherwise. Clearly each f, is elementary and R = { ( f o x ,. . .,fm-,x) : x
E
w).
0
Theorem 6.14. Every recursiue relation is recursively enumerable. For each positive m there is a recursively enumerable m-ary relation which is not recursiue. PROOF. The first part is true by 6.13(x) and 5.33; for the second part, use 5.36. 0 The following result is proved just as for sets.
Theorem 6.15. Let R
c " w . The following conditions are equivalent:
( i ) R is recursive; (ii) R and "w R are recursively enumerable.
-
The following important theorem shows that the notion of a partial recursive function can be defined without resorting to the rather complicated notions discussed at the beginning of Chapter 5.
' I i
!
11 1 1 I
-,E w
R . Now for i < m and any
A x = (x)t
Definition 6.12. A relation R G "w is recursively enumerable (for brevity r.e.) if A = 0 or there exist m recursive functions f,, . . ., fm- such that
Theorem 6.13. For R G "w the following are equivalent: ( i ) R = 0 or there exist elementary functions fo, . . ., f m - I with R = {(fox,. . . , f m - l x ) : X E ~ ) ; (ii) like ( i ) with "elementary" replaced by "primitive recursive"; (iii) R is recursively enumerable; (iv) there exist partial recursive functions fo, . . ., f m - , with R = { ( f o x , .. ., f m - l ~ :) x E D m n f , n . . . n Drnn f,-l); (0) R = 0 or there is an elementary function f with R = {((fx),, . . ., ( f ~ ) , - l ): X E w); (ui) like (v), with "elementary" replaced by "primitive recursiue"; (vii) like (v), with "elementary" replaced by "recursive"; (viii) there is a partial recursive function f such that R = {((fx),, . . ., (fx),: x E Dmn f I; (ix) there is an m-ary partial recursive function f such that R = Drnn f ; (x) R e x 1 .
E
P
:
Theorem 6.16. Let f be a unarypartialfunction. Then the following conditions are equivalent: ( i ) f is partial recursive; (ii) {(x,f x ) : x E Dmn f ) is r.e. PROOF. ( i ) * (ii). Assume (i). For any x, y
E
w let
--
g(x, Y ) P ~ -Yfxl = 0). Clearly g is partial recursive and Drnn g = { ( x ,f x ) : x E Drnn f ) . (ii) 3 (i). Assume (ii), and by 6.12 let g and h be recursive functions such that {(x,f x ) : x Then for any x E w,
E
fx
Drnn f )
2:
=
{(gx, hx) : x
E w).
~PY(= ~ Y4,
so f is partial recursive. Clearly g is partial recursive and R = Drnn g. (ix) => (.x). Suppose R = Drnn cp?. Then
W e now turn to the study of some special r.e. sets. Definition 6.17 (i) A set A 5 w is productive if there is a recursive function f (called a productive function for A ) such that for all e E w , if Drnn cp: G A then fe E A Drnn cp:. (ii) A set A G w is creative if A is r.e. and w A is productive.
-
-
Chapter 6: Recursively Enumerable Sets
Part 1: Recursive Function Theory
Thus a productive set A is strongly not recursively enumerable: there is an effective procedure for finding members of A B for any r.e. subset B of A. A creative set, while r.e., is strongly nonrecursive. The sets of Godel numbers of theorems of many theories studied in Part 111 are creative, as we shall see. Recall Definition 6.4.
Second, suppose that y $ A. Then y 4 Drnn cp;, so Vz (z, y, e) $ Drnn I, hence Vz((z, y) $ Drnn cpz), so by 5.13 Drnn cpl(s:(e, y)) = 0. Thus, since g is productive,
Theorem 6.18.
K. For
The following result will not play a role in our logical discussion, but is important in the general theory of r.e. sets. See also the definition and results concerning simple sets below.
-K
Theorem 6.20. $ A is productive, then A has an infinite recursive subset.
-
K is creative.
-
-
PROOF. By 6.5, K is r.e. Now U,1 is a productive function for w i f e ~ w a n d D m n c p :E w K , t h e n e ~ ( w K ) - Dmncp:;for
so e E
w
-
-
by definition of K, 6.4 by assumption Drnn cp: c
e E K + e E Drnn cp: +eE w K
w
0
K, and hence by definition of K, e $ Dmn cp:.
The next theorem shows that, in a sense, any r.e. set can be obtained from a creative set; cf. 6.10 and the initial section of Chapter 7.
Theorem 6.19. If A is r.e. and C is creative, then there is a recursivefunction f such that A = f-'*C.
-
PROOF. Say A = Drnn cp& and let g be a productive function for For any x, y, z E w let
@, Y, x)
pub
= gs:(x,
w
-
k(y, x)
= f -l*C.
Dmn cpl(s:(e, x))
=
{(x),
(1)
1 : i I 1x1.
In fact, for any y E w, y E Drnn cpl(s:(e, x)) Now let r be such that cp:
Sincef is obviously
-
(x)~-I 1).
cp:. Now for any x E w,
iff (y, x) E Drnn cpz iff 3i IIx(y = (x), =
-
iff (y, x) E Drnn k 1).
0, and define
g(x,y)=fr ify=Oorl, if Y # 0 and y # 1. g(x, Y) = fsXe, Y)
= d ( z , Y).
Let fy = gs:(e, y) for ally E w. We claim that A recursive, this will complete the proof. First suppose that y E A. Then
=
=
Thus I is partial recursive. By the recursion theorem (5.15) choose e E w such that for all y, z E w, Kz, Y, e)
pi(i I lx and y
Clearly k is partial recursive; say k
C.
Y)I + cp:y.
-
PROOF. By 6.8 it suffices to show that A has an infinite r.e. subset. Let f be a productive function for A. For any x, y, let
Thus g is recursive. Now define t: w -+ w by setting, for any x E w, tx = g(x, fx). Here fx is defined in 2.31, and by 2.33, t is recursive. Now we claim for all x E w, tx E A
(2)
-
{ty : y < x}.
We establish (2) by induction on x. For x = 0,
z E Drnn cpl(s:(e, y))
iff (z, y) E Drnn cp: iff (z, y, e) E Drnn I (by choice of e) iff z = gs:(e, y) and y E Drnn cp; iff z = gs:(e, y).
-
Thus (1) holds. Now iffy $ C, this means that gs:(e, y) $ C and so by (1) C. Since g is a productive function for w C we Drnn cpl(s:(e, y)) -C OJ would get gs:(e, Y)E (w contradicting (1). Thus fy E C .
-
- C)
Dmn cpl(s:(e, Y)),
(since cp: = 0 s A and f is a productive function for A). Thus (2) holds for x = 0. Suppose (2) holds for all x' < x, where x # 0. Then tx = g(x, fx), and h # 0, 1, so tx = fs:(e, fx). Also Drnn cpl(s:(e, fx))
-
=
{ty : y < x} E A
by (1) and the induction hypothesis. Since f is a productive function for A, tx = fs:(e, fx) E A {ty : y < x), as desired. Thus (2) holds. Hence Rng t is an infinite r.e. subset of A, and the proof is complete. 0
Chapter 6 : Recursively Enumerable Sets
Part 1: Recursive Function Theory
We now give a method to arrive at creative sets. Definition 6.21 (i) . Two sets A and B are recursively separable if there is a recursive set C such that A 5 C and B G w C. (ii) A and B are recursively inseparable if they are disjoint but not recursively separable. (iii) A and B are effectively inseparable if they are disjoint and there is a 2-ary recursive function f such that for all e and r, if A r Drnn cp:, 6 c Drnn cp:, and Drnn cp: n Drnn cp: = 0, then f(e, r) E w (Dmn cp,' u Drnn cp:).
-
,
-
Effectively inseparable sets will be constructed in abundance in Part 111; most undecidability results actually yield such sets. Obviously we have: Theorem 6.22. If A and B are effectively inseparable then they are recursively inseparable. The converse of 6.22 fails; see Exercises 6.47, 6.48. Theorem 6.23. If A and B are recursively enumerable and effectively inseparable, then both A and B are creative.
Clearly Kl and K2 are r.e. and Kl n K, = 0. For any e, r E w let f(e, r) = 2'.3". To verify 6.21(iii), assume that Kl c Drnn cp,' and K2 E Drnn cp: with Drnn cp,' n Drnn cp: = 0. Suppose f(e, r ) E Drnn cp: u Drnn 9:. By symmetry, sayf(e, r ) E Drnn cp,'. Thus 3y((e, 2'.3", y) E TI), and since Drnn cp: n Drnn cp: = 0, obviously Qz((r, 2'. 3", z ) $ TI). Thus 2r.3eE K2, so 2'- 3" E Drnn cp:, contradiction.
0
The next theorem gives an important method of producing new effectively inseparable sets from old ones: Theorem 6.25. Suppose that A and B are effectively inseparable, f is a unary recursive function, C, D c w, C n D = 0, A E f-l*C, and B c f-l*D. Then C and D are effectively inseparable. PROOF. Let h be a function given by 6.21(iii) because A and B are effectively inseparable. For any e, x E w , let g(x, e) 2 py((e, fx, y) E TI). Thus g is partial recursive; say g = 9:. Now we can define a function k intended to satisfy 6.21(iii) for C and D: for any e, u E w, let k(e, u) = fh(s:(r, e), s:(r, u)). Thus k is recursive. In order to verify 6.21(iii), assume that C c Drnn cp: and D r Drnn cpt, where Drnn cp,' n Drnn cpt = 0. It follows that A G f - l * Drnn cp,', B r f - l * Drnn cp:, and f -l* Drnn cp,' nf -l* Drnn cpt = 0. Now for any x t w, x E f -I* Drnn cp,'
-
PROOF. By symmetry it suffices to show that A is creative, i.e. that w A is productive. Let f be as in 6.21(iii) Say A = Drnn cpt and B = Drnn cpb. For any e, x E w let g(x, e)
P Y ( ( ~x,, Y) E T1 or (s, X, Y) E TI).
Thus Drnn g = {(x, e) : x E Drnn cp: U B}. Clearly g is partial recursive; say g = cp;. Now for any e E w we have, by 5.13, (1)
Drnn cp1(s;(r, e))
=
{x : (x, e) E Drnn
-
tp;)
=
Drnn cp:
Similarly, f - l * Drnn cpt = Drnn cpls:(r, u). Thus A c Drnn
-
-
0
U B.
-
Let for any e E w he = f(u, s:(r, e)). Thus h is recursive; we claim it is a productive function for w A . In fact, suppose Drnn cp,' r w A. Then, A = Drnn cpt, B c Drnn cpl(s:(r, e)), and Drnn 91 n using (I), Drnn cpl(s:(r, e)) = 0. Hence, by 6.21(iii), he = f(u, s:(r, e)) t w (Dmn cpt u Drnn cpl(s:(r, e))), i.e., he t w (A u Drnn cpi U B), SO he t 0 (w A) Drnn cp,', as desired.
- -
iff fx E Drnn cp: iff 3y((e, f x , Y ) E Tl) iff (x, e) E Drnn g = Drnn cp,2 iff x E Drnn cpls:(r, e).
-
-
Theorem 6.24. There exist two recursively enumerable eflectively inseparable sets. PROOF. Let K1 = {x : 3y[((x),, x, y) TI and Vz y(((x)l, x, z) g Tl)l), K2 = {x : gy[((x),, x, Y)E and Vz I ~ ( ( ( x )x~, ,z) @ TI)]}.
As our final topic in this chapter we briefly consider a kind of r.e. set much different from creative sets. We introduce them partly to give a class of sets which are not creative, and partly because there is a big literature concerning them. Definition 6.26. A set A c w is simple if A is r.e., w B n A # 0 whenever B is an infinite r.e. set.
-
A is infinite, and
Theorem 6.27. A simple set is neither recursive nor creative.
-
PROOF. If A is simple and recursive, then w A is an infinite r.e. set and A n (w A) = 0, contradiction. If A is simple and creative, by 6.20 choose B infinite recursive such that B G w A. Contradiction.
-
-
0
Chapter 6 : Recursively Enumerable Sets
Part 1 : Recursive Function Theory
Theorem 6.28.
6.34. For each of the following determine if the set in question is recursive, r.e.,
Simple sets exist.
or has an r.e. complement: (1) ( x :there are at least x consecutive '1's in the decimal representation of T); (2) {x: there is a run of exactly x consecutive 7's in the decimal representation of T); ( 3 ) { x : cp: is total}; ( 4 ) {x: Dmn cp: is recursive).
PROOF. Let g be a recursive function universal for unary primitive recursive functions (see Lemma 3.5). F o r any e E w let
Thus f is partial recursive. F o r each e Clearly for any e e w ,
E
w let ),x
= g(e,
x) for all x e w .
6.35. There are No r.e. sets which are not recursive.
6.36. There is a recursive set A such that
4,
if e E D m n f , then fe E R n g and fe > 2e; if Rng ), is infinite then e E: Dmnf.
(1) (2)
6.37. If A is productive, then so is {e: Dmn cp;
-
-
if n
E w,
then 2n
6.40. If B is r.e. and A
-
n B is productive, then A is productive.
6.41. There is an r.e. set which is neither recursive, simple, nor creative. Hint: let A be simple and set B = { x : ( x ) E~A}. 6.42. For A 5 w the following are equivalent:
(1) A is recursive and A # 0; ( 2 ) there is a recursive function f with Rng f
BIBLIOGRAPHY
1 . Malcev, A. I. Algorithms and Recursive Functions. Groningen: WoltersNoordhoff (1970). 2. Rogers, H. Theory of Recursive Functions and Effective Computability. New York: McGraw-Hill (1967). 3. Smullyan, R. M. Theory of Formal Systems. Princeton: Princeton University Press (1961).
=
A and Vx E w( fx
-
- A are productive.
6.46. If A is productive and B is simple, then A n B is productive.
6.30. Prove that the class of r.e. sets is closed under union and intersection using
the argument following 6.8, but rigorously. 6.31. Show that if A is a Cn-set, n > 0, and f is partial recursive, then f * A is C,. 6.32. If A and B are r.e. sets, then there exist r.e. sets C , D such that C G A, D G B , C U D = A U B , ~ ~ ~ C ~ D = O . 6.33. Suppose that f and g are unary recursive functions, g is one-one, Rng g is
recursive, and V x ( f x
L
gx). Show that Rng f is recursive.
cA
6.44. If A is creative, B is r.e., and A n B = 0,then A u B is creative.
Then the following conditions are equivalent:
( 1 ) f is recursive; ( 2 ) ( ( x ,fx) :x E w ) is an r.e. relation; (3) { ( x ,fx) : x E w ) is a recursive relation.
+ 1)).
( 1 ) A is productive; ( 2 ) there is a partial recursive function f such that Ve E w (if Dmn cp: then fe is defined and fe E A Dmn cp:).
6.45. There is a set A such that both A and w -+ w .
f (x
6.43. For A G w the following are equivalent:
EXERCISES 6.29. Let f : w
-
- -
-
For, let i e 2n n Rngf: Say i = fi. By (I), 2 j < fi, so 2 j < i < 2n. Thus j < n, s o i~ f*n. Since (3) holds, 12n n R n g f ( 5 n, hence 12n R n g f 1 2 n, for any U n E w . Thus w R n g f is infinite.
-
c A).
6.39. Any infinite r.e. set is the disjoint union of a creative set and a productive set. Hint: say Rng f = A. Let gn = f p i ( f i # gj for all j < n). Show that g * K is creative and A g * K is productive.
n Rng f c_ f *n.
-
is not r.e.
6.38. There are 2Ho productive sets. Hint: Let A = { e : Dmn cp: c w K}. Show that A G w K , ( w K ) A is infinite, and any set P with A GP w K is productive.
Now Rng f is simple. For, it is obviously r.e. Suppose B is any infinite r.e. set. By choice of g, choose e E w s o that R n g ), = B. By (2) and (I), fe e R n g ).. Thus B n Rng f # 0.Finally, t o show that w Rng f is infinite, note
(3)
nXGA Dmn cp:
-
6.47. Two sets A and B are strongly recursively inseparable if A n B = 0 , w ( A LJ B ) is infinite, and for every r.e. set C, C A infinite C nB # 0, C B infinite => C n A # 0. Show that if A and B are r.e. but strongly
-
-
;q 1 !$
C
recursively inseparable, then: (1) A and B are recursively inseparable. ( 2 ) A u B is simple. (3) neither A nor B is creative. ( 4 ) A and B are not effectively inseparable.
6.48. Show that there exist two r.e. strongly recursively inseparable sets. Hint: let E = { ( e ,x) : j y ( ( e , x, y ) E TI)). Show that there exist recursive functions
f, g such that E = { ( f i ,gi) : i . :w ) .
103
Part 1 : Recursive Function Theory
Show that there exist recursive functions h, k such that
Let A
=
h(n
+
k(n
+
Survey of Recursion Theory
pi(gi > 3f i ) ; = pi(gi > 3 f i and gi # ghO); 1 ) = pi(gi > 3fi & Vj 5 n(gi # gkj) & Vj 'i n(f i # fhj) & Vj 'i n(gi # ghj)); 1 ) = pi(gi > 3fi &Vj 'i n + l ( g i # ghj) & Vj 'i n ( f i # f k j ) & Vj 'i n(gi # gkj)).
hO kO
=
Rng ( g h), B 0
=
7
Rng ( g k). 0
We have developed recursion theory as much as we need for our later purposes in logic. But in this chapter we want to survey, without proofs, some further topics. Most of these topics are also frequently useful in logical investigations.
Turing Degrees Let g be a function mapping OJ into w . Imagine a Turing machine equipped with an oracle-an inpenetrable black box-which gives the answer gx when presented with x . The function g may be nonrecursive, so that the oracle is not an effective device. Rigorously, one defines a g-Turing machine just like Turing machines were defined in 1.1, except that v,, . . ., v,, are arbitrary members of (0, 1, 2, 3, 4, 5). And one adds one more stipulation in 1.2: If w = 5, and F(e - 1) = 0 or Fe = 1, then F' = F, d' =f, e' = e , while if w = 5 and 0 1'" + I ) 0 lies on F ending at e , then l) 0 lies on F' ending at e', e' = e + gx 2, 0 0 F' is otherwise like F and d' = f.
+
Then the notion of g-Turing computable function is easily defined. One can also define g-recursive function: in 3.1, each class A is required to have g as a member. These two notions, g-Turing computable and grecursive function, are shown equivalent just as in Chapter 3. In fact, most considerations of Chapters 1 through 6 carry over to this situation. If h is g-recursive, we also say that h is recursive in g. One can extend the notion in an obvious way to a set of F of functions, arriving at the notion of a function being recursive in F. At present we restrict ourselves to the simpler notion. We say that h and g are Turing equivalent if each is recursive in the other.
Chapter 7: Survey of Recursion Theory
Part 1: Recursive Function Theory
This establishes an equivalence relation on the set of all functions mapping w into U. The equivalence classes are called Turing degrees of unsolvability. Each equivalence class has at most No members (actually exactly KO,as is easily seen), since there are only No possible Turing machines with oracles. Clearly then there are exp No degrees. Let D be the set of degrees. For a, j3 E D we write a IB provided there exist f E a and g E j3 with f recursive in g. This relation I makes D into a partially ordered set. Clearly the degree of recursive functions, denoted by 0, is the least element of D. Many of the important results about D are concerned with trying to describe the partial ordering I. A complete description is far from being known. The rather scattered results which we now want to mention are among the strongest facts known. Some of their proofs are quite complicated, involving priority arguments, a kind of argument seemingly unique to this area.
corohary 7.9. There are degrees 1 0 ' which are not r.e.
-\cC
Partial Recursive Functionals Apartial functional is a function F such that for some m, n E w, the domain of F is a subset of "("w) x "w, while the range of F is a subset of w; additionally we assume m n > 0. In case m = 0 we are dealing with the partial functions of Chapter 5. In case the domain of F is all of "("w) x "w, we call F total. An (m, n)-relation R is any subset of "("w) x "w. We now wish to give a reasonable meaning to F and R being recursive, and to R being recursively enumerable. Since a function cannot be presented in its entirety to a machine it is natural to seek a definition of these notions in which only initial segments of functions are given. If 2l = (fo, . . . ,fm-,, x,, . . ., xn-,) E "(Ow) x "w, we let for any y E w
+
Proposition 7.1. Any two elements of D have a least upper bound. Theorem 7.2. There exist two elernents of D without a greatest lower bound. Theorem 7.3. In D, no ascending sequence a. < al < bound.
-
0
. has a
Now we say that an (m, n)-relation R is recursively enumerable (r.e.) provided that there is an (m + n + 1)-ary recursive relation S c "+"+lw such that for all 2l E "("w) x "w,
least upper
UE R
Proposition 7.4. Every element of D has only countably many predecessors.
Theorem 7.5. There are exp No minimal degrees. A subset E of D is an initial segment of D provided that for all a, j3 E D, if a < j3 E E, then cc E E.
R
Theorem 7.6. Any finite distributive lattice can be embedded as an initial segment of D; likewise any countable Boolean algebra and any countable ordinal.
Theorem 7.7. No r.e. degree is minimal. Theorem 7.8. There are two minimal degrees with join 0'.
iff 3x E w[(ax, x) E S].
Obviously this definition coincides with the definition of r.e. relation if m = 0. The definition is motivated as follows. We generate the members of S one after the other. Having generated a member (yo,. . ., yrn-,, z,, . . ., zn-,, x) of S,we have implicitly generated each member 21 of R such that a x = (YO,. . ., ym- zo, . . ., zn-,). Eventually each member of R is generated in this fashion. A partial functional F is partial recursive provided that its graph
An element a of D is minimal, if 0 < a and there is no B with 0 < /3 < a.
One of the main open problems in the theory of degrees is the conjecture that every finite lattice can be embedded as an initial segment in D. There are some special degrees of particular importance for applications to logic. A degree a is recursively enumerable (r.e.) provided that x, E a for some r.e. set A . Note that there are only No r.e. degrees. We let 0' be the degree of xK. We know from Theorem 6.19,p. 98 that X , E 0' for any creative set B; and 0' is the largest r.e. degree.
Theorem 7.10. For every nonzero r.e. degree a there is a minimal degree 2 a.
,
t I
I
=
{(a, x) : 2l E Dmn F, F2l = x)
is r.e. Again this notion coincides with the old definition for m = 0. Given 2L E Dmn F, clearly the above generation of R constitutes an effective calculation of F2I (provided there is some way to recognize effectively that a x = b0, . . . ,yrn-,, zo, . . . , zn-J for given (yo, . . ., yrn-,, ZO,. . . , zn-l)). An (m, n)relation R is recursive provided X, is recursive. These definitions form the basis for a generalized recursion theory. This generalization, expounded at length in Shoenfield [9],has many of the properties of ordinary recursion theory; the enumeration, iteration, and recursion theorems carry over, as well as the considerations concerning the arithmetical hierarchy. As is suggested above, there is a strong connection between generalized recursion theory and relative recursiveness : Theorem 7.11. A function f : w --+ w is recursive in a function g : w + w iff there is a total recursive functional F: x w + w such that for all x E w, fx =m ,4 . 1 n7
Chapter 7: Survey of Recursion Theory
Part 1: Recursive Function Theory
The notion of a functional also enables one to clarify the role of the sets A, in the arithmetical hierarchy:
It follows that we can define . on RET by setting a./3 alence type of JX(A x B), where A E a and B E /3.
=
recursive equiv-
nn)z f f it is
Proposition 7.17. Addition and multiplication of RET's are commutative and associative. Multiplication is distributive over addition.
The notion of recursive functionals also makes possible the construction of a new hierarchy. An ( m , n)-relation R is CL (resp. Ilf,) where m > 1 provided there is a recursive relation S so that for all U E "("w) x "w we have
The structure (RET, .) is not, however, a ring, and it cannot be embedded in a ring. This can be seen for example, from the fact that a + /3 = a where a and /3 are respectively the recursive equivalence types of w and of 1 . Since /3 /3 # 13, ,6 is not the additive zero of (RET, +, .), so this structure cannot even be embedded in a ring. For each n E w, let ii be the recursive equivalence type of n. Then - is an isomorphic embedding of (w, +, .) into (RET, +, .). The structure (RET, .) has a simple substructure which is much more closely related to (w, .). To define it, let us call a set A G w isolated if it is not recursively equivalent to any proper subset B c A. An RET a is an is01 if it has an isolated member. We denote by ISOL the collection of all isol's.
Theorem 7.12. A relation is An+liff it is recursive in {xA: A is recursive in {X, : A is C,).
+,
+
. ., Q, are quantifiers V or 3 on functions (members of Ow), where Ql,. alternately V and 3 (with Ql = 3 (resp. Ql = V), while is a quantifier V x or 3x on numbers. By collapsing quantifiers, it is easy to see that any second-order prefix can be put in this form (see Chapter 30). The classification of relations in the sets CL and I l k forms the analytical hierarch~l.Again we set A; = Cf, n IIL. The theory of this hierarchy shows considerable similarity, in results and proofs, to the classical topological theory of analytic sets. For example, we have Theorem 7.13 I f P and Q are disjoint R such that P c R a n d Q G - R .
relations, then there is a A: relation
+
Two sets A , B c w are said to be recursively equivalent if there is a one-one partial recursive function f such that A 5 Dmn f and f *A = B. This establishes an equivalence relation on the set of all subsets of w; the equivalence classes are called recursive equivalence types (RET's). They are the effective version of cardinal numbers.
Proposition 7.14. I f a and ,6 are RET's, then there exist A t a and B E /3 such that A and B are recursively separable. Proposition 7.15. If a and ,6 are RET's, A, A' E a, B, B' E 8, A and B are recursively separable, and A' and B' are recursively separable, then -A u B is recursively equivalent to A' U B'.
By 7.14 and 7.15,we can define a binary operation + on RET by setting + ,6 = recursive equivalence type of A u B, where A E a , B E /3, and A and
B are recursively separable. Recall the function J, from 3.60. It is a one-one function mapping onto w.
Proposition 7.16. If a, B E RET, A, A' E a, and B, B' is recursively equivalent to J*,(A1 x B').
Theorem 7.18. ISOL is closed under have :
+ and
E
w
x w
B, then J*,(A x B)
.. For any
a,
/3,
y
E
ISOL we
+
(i) a /3 = a y implies /3 = y ; (ii) a.8 = a . y a n d a # Uimply/3 = y ; (iii) (w, +, -) is a substructure of (ISOL,
Isols
a
+, +,
+, .).
The structure (ISOL, +, .) can be embedded in a ring ISOL*, which has the ordinary ring of integers as a substructure. It has many interesting properties. Since it has zero divisors, it cannot be embedded in a field.
Recursive Real Numbers It is natural to try to effectivize common notions of mathematics, such as the notion of a real number. We give here a few of the relevant definitions and results. Let Q be the set of rational numbers. A sequence r E OQ is recursive iff there exist unary recursive functionsf; g, h such that for all n E w,
rn
=
( f n - gn)/(l
+ hn).
Thus if en = 112"for all n E w, then E is recursive. In fact we may take fn = 1 for all n, gn = 0 for all n, and hn = 2" - 1 for all n. Now a recursive sequence r E "Q recursively converges to a real number a provided there is a unary recursive function k such that for all n E w and all n 2 k m we have Irn - a1 < em. A real number a is recursive if there is a recursive sequence of rationals which recursively converges to a.
Chapter 7: Survey of Recursion Theory
Part 1 : Recursive Function Theory t
Theorem 7.19. The set of recursive real numbers forms a subfield F of the field of real numbers. Every rational number is recursive. F is countable. There is a Cauchy recursive sequence of rationals which does not converge recursively. Theorem 7.20. If r E "Q is recursive, strictly monotone, converges to a recursive real number a , then r recursively converges to a. A sequence r E " F is recursive provided there are binary recursive functions
f, g, h, k such that for all m , n E w and all p 2 k ( m , n ) we have Irn - { [ f ( ~n ), - g(p, n)ll[l
+ h ( ~n)l)l ,
< em.
Many other concepts of ordinary mathematics can be given effective formulations in a similar way.
Word Problem for Groups There is a classical problem in group theory which has been given a negative solution using notions of recursive function theory. We shall give a precise formulation of it. Let X be a nonempty set. We form the free group generated by X as follows. For each x E X let x' = (X, x). Note that ' is a one-one function whose range is disjoint from X. A finite sequence (perhaps 0 ) of elements of X u Rng' is called a word on X; we let W x be the set of all words on X. Let = be the smallest equivalence relation on W x containing all pairs (0, aa') and (0, a'a) with a E X. It is easily seen that if a, b, c, d E W x , a = b, and c =- d, then ac = bd. Hence there is a binary operation . on the set Fx of equivalence classes under = such that [a].[b]= [ab] for all a, b E W x . Under this operation Fx becomes a group, called the free group generated by X. A defining relation over X is a pair (a, b ) of words over X. If R is a set of defining relations over X, we let R* be the normal subgroup of Fx generated by all elements [ a ] .[b]-l with (a, b) E R. Let F,,, = Fx/R*. A group G is determined by generators X and defining relations R if it is isomorphic to Fx,,; then (X, R) is a presentation of G. It is easily seen that every group has a presentation. If X and R are finite, then (X, R ) is afinite presentation and G is finitely presentable. Iff is a one-one map of X U X' into W , then any word x of W x can be given a Godel number 9,x by 8,X
=
n
pixi+ 1
t <m
where x i s of length m. We say that the word problem for (X, R) is recursively solvable provided that for some such f,
{(gJa,gJb) : h b l
=
h[bl)
is recursive, where h is the natural homomorphism of Fx onto Fx,,. For X and R finite, this definition does not depend on the choice off.
.-
Theorem 7.21 (Novikov). There is a group G with afinite presentation ( X , R ) which is recursively unsolvable. Thus there is no automatic procedure for determining of a pair of words ( a , b ) whether they become equal upon applying the relations in R.
Solvability of Diophantine Equations. A diophantine equation is an equation of the form P(x,, . . ., x,-,) = 0 , where P(xo, . . ., xm-,) is a polynomial in indeterminants x,, . . . , x m - , with integer coefficients. A classical problem of number theory, called Hilbert's tenth problem (see Davis [2]) is whether there is an automatic method for determining whether an arbitrary diophantine equation has an integral solution. By means of Godel numbering this question can be given a rigorous form. The answer (Theorem 7.24) is negative, and follows from an even stronger result which we now want to formulate. An n-ary relation R c "w is called diophantine if there is a polynomial P(xo,. . ., xn-,, yo,. . ., ym-,) with integral coefficients such that R
=
{ xE : there exist yo,. . ., y,-, E w such that P(x0 ,..., xn-1, yo , - . . ,ym-1) = 0).
Theorem 7.22 (J. Robinson, M. Davis, Y. Matiyasevic). it is diophantine.
A relation is r.e. iff
As an interesting corollary we have Theorem 7.23. There is a polynomial with integral coeficients such that its positive values, when members of w are substituted, are exactly all positive primes. It is also easy to derive the solution to Hilbert's tenth problem from 7.22: Theorem 7.24. There is no automatic method which, presented with a diophantine equation E , will decide whether e has a solution. BIBLIOGRAPHY 1. Boone, W. W. The word problem. Ann. Math., 70 (1959), 207-265. 2. Davis, M. Hilbert's tenth problem is unsolvable. Amer. Math. Monthly, 80 (1973), 233-269. 3. Dekker, J. C. E. Les Fonctions Combinatoires et les Zsols. Paris: GauthierVillars (1966). 4. Dekker, J. C . E. and Myhill, J. Recursive equivalence types. Univ. Calzx Publ. Math., 3 (1960), 67-214. 5. Herrnes, H. Enumerability, Decidability, Computability. New York: Springer (1969).
PART I1 Elements of Logic
Sentential Logic
We now begin the study of logic proper. In this part we shall introduce the basic notions of a first-order language and the structures appropriate for it. We shall only present here the most basic definitions and results, up to and including the completeness theorem-which expresses the most important relationship between the syntactical and semantic notions. In Parts I11 and IV many deeper results in these two domains will be found. The emphasis throughout this book, as well as in the mathematical world, is on first-order languages. There are many other languages, some of which will be briefly discussed in Part V. First-order languages are, roughly speaking, the simplest languages with which one can conveniently formulate any mathematical theory. Moreover, one can prove about these languages and their structures many interesting and useful results which cannot be extended to more involved languages.
8
Before considering first-order languages we consider some simpler languages, whose study will be a simplified model of the more involved study of first-order languages themselves. These sentential languages enable one to express only such primitive logical notions as not, implication, and, or, etc. I These connectives between sentences are such that the truth of a complicated sentence can be inferred just from the truth or falsity of its components. We shall choose two of these connectives, negation and implication, as 1 primitive, and show at a later stage that all other connectives can be expressed in terms of them. We show how the notion of a sentence can be I rigorously defined, how axioms for valid sentences can be given, and the 1 connection between the axioms and the notion of truth. In the exercises we 1 outline the theories of some nonclassical versions of logic, such as threevalued and intuitionistic logic.
:
:
Definition 8.1. A sentential language is a triple (n, c, P) such that n # c, {n, c) n P = 0, and P # 0. We think of n and c as a negation symbol and implication symbol respectively, while P is a set of atomic, indivisible sentences. With these intuitive meanings it is possible to define in a rigorous way additional intuitive notions, such as an expression-any sequence of symbols-and a sentencean expression which has a meaningful form: Definition 8.2. Let 9 = (n,c, P ) be a sentential language. The set {n, c) u P is the set of symbols of 8. An expression of 9 is any finite sequence of symbols of 8 ;the empty set (=empty sequence) is admitted. We define
Part 2: Elements of Logic
one-place and two-place operations by setting
Chapter 8 : Sentential Logic
i
s E P. Then (iii) holds, by (i). Now assume, inductively, that m > 1. By (ii) for some sentence #. Thus po = n, we have two cases. First suppose p = i# and # = (p,, . . ., pm-l). If (po, . . ., pi) is a sentence, then by (ii) we easily infer that (F,, . . ., pi) is a sentence, contradicting the induction hypothesis, since # is a sentence. Second, suppose p = # + x for sentences # and x, and suppose the hypothesis of (iii) holds. Then p0 = c, and there is a j with 1 < j < m - 1 and # = (p,, . . ., p,), x = (pj+l, . . ., v,,-~). Suppose that (pO,.. ., pi) is a sentence. Then by (ii) there are sentences 0, a such that (po, . . ., pi) = 0 += a ; hence there is a k with I < k < i such that 0 = (pl,. . ., pk) and a =
and += on the set of expressions
for all expressions g, and #. Recall from 1.11 that p# is just the juxtaposition of the two finite sequences p and #. Sent9, the set of sentences of 9, is the intersection of all classes r of expressions of B such that (s) E F for each s E P and r is closed under i and +. Note that we have not used parentheses in our language; the notation used here and later on is parenthesis-free, or Polish notation. Of course we shall use parentheses freely in our informal language (metalanguage). For example, p + (# + X) has a clear meaning for expressions p, #, X ; in fact, it is the same as the expression ( ~ ) p ( c ) # ~The . most important feature of the parenthesis-free notation, as well as the more usual notation with parentheses, is the unique readability of sentences (Theorem 8.5). Throughout this section, unless otherwise indicated, B = (n, c, P ) will be a fixed but arbitrary sentential language; also, we shall use small Greek letters to denote sentences, and large ones to denote sets of sentences. The following two obvious results will be used frequently:
Proposition 8.3 (Induction principle for sentences). and I? is closed under i and +, then SentB G I?.
If(s)
E I?for
each s E P
Proposition 8.4 (Construction sequence for sentences). p E SentB iff 'there is a jinite sequence (go, . . ., #n- ,) of expressions of B such that n > 0, t,bn- = p, and for each i < n one of the following condition holds: (i) #r = (s) for some s E P; (ii) #i = i# for some, j < i; (iii) #i = 4, + #k for some j, k < i. With regard to 8.4, cf. Proposition 2.3.
Theorem 8.5 (Unique readability) (i) Every sentence is of positive length. (ii) Ifp is a sentence, then either p = (s) for some s E P, p = -#for some sentence #, or p = # + for some sentences #, X. (iii) Ifp = (po, . . ., pm- is a sentence and i < m - 1, then (TO, . . ., pi> is not a sentence. (iv) In (ii), the three possibilities are mutually exclusive, and the sentences # and x are uniquely determined by p. PROOF. Conditions (i) and (ii) are easily established using 8.3; for example, to prove (i) we let 'I be the set of all expressions of positive length. We establish (iii) by induction on m. If m = 1, then by (ii) and (i), p = (s) for some
,
I I
i I
!
; I
From 8.5 the following result of a purely set-theoretical nature follows.
Theorem 8.6 (Recursion principle for sentences). Let A be any set, f a function mapping P into A , g a function mapping A x Sent9 into A, and h a function mapping A x A x Sentr x Sent;* into A. Then there is a unique function k mapping Sent@into A such that the following conditions hold: (i) k(s) = fs for all s E P, (ii) k i p = g(kp, p) for every sentence p, (iii) k(p + #) = h(kp, k#, p, #)for all sentences p,
#.
I
We shall now define the syntactical notion of theorem in a sentential logic. Here we meet in its most primitive form the very important process of ' axiomatization in mathematics. In this case we wish to axiomatize the notion of logical truth appropriate for the primitive logic we are now dealing with.
Definition 8.7. A sentence is a logical axiom of B iff it has one of the following forms (where p, 4, x are arbitrary sentences): (All P + ( # + d , (A21 hJ+ (# + x)l + KT += $1 += (v + x)l, (A31 ( TJ+ -#I + (4 + p). Now let r be a set of sentences. The set of r-theorems9 is the intersection of all sets A of sentences such that r _c A, each logical axiom is in A, and # E A whenever p E A and p + # E A. We say that # is obtained from p and p += # by detachment or modus ponens. We write r t9 p to abbreviate "p is a r-theoremq," and we write t9p for 0 t9 v. The subscript B is frequently omitted. We give one of the usual consequences of a definition like 8.7:
Theorem 8.8. r t p, ~ f fthere is a jinite sequence (#,, . . ., #, - ,), m > 0,of sentences of 9 such that 4,-,= p, and for each i < m one of the following holds:
Part 2: Elements of Logic
Chapter 8 : Sentential Logic
(i) #i is a logical axiom of @ (ii) #, E I?, = #, + (I,i for some j, k < i. (iii)
A sequence ((I,,,, . . ., (I,,-1) as in 8.8 is called a formal proof of p from the hypotheses I?. Some simple but frequently useful properties of I- are given in the following theorem.
The deduction theorem is a formalization of a common method of proof in mathematics. Frequently when one wants to establish an implication p + (I, in common mathematical reasoning, one first adjoins p to the mathematical assumptions I'.After arguing that 4 holds, one concIudes that p -+ 4 follows from the original assumptions. Now we show I-6' for various sentences 6'. These facts will serve as lemmas for the completeness theorem, which enables us to check for I-9 in a routine, mechanical way.
Theorem 8.9. Let I?, A G Sent9 and p, (I, E Sent9. Then: (i) i f A G r and A I- p, then I' I- p ; (ii) if I' I- p, then O I- p for somefinite subset O of I?; (iii) if I' I- x for each x E A and A I- p, then I' I- p ; (iu) ifr I-pand I' I-p++, then I' I-+.
* * b+*, $4*
' x, d I- v I-FJ+# {P ' $4 'x, d I- (I, {v (I,, {P"*,*'X,d
Lemma 8.10. kp + p. PROOF. Just this once we give a formal proof, with justifications listed in the column to the right. (1) {p+ [ ( p + p ) + ~ l ) + { [ v + ( ~ + ~ ) ~ + ( v + v ) } A2 A1 (2) P, [(cp 94 + 91 (3) [ ~ + ( v + ~ J ) ~ + ( P + v ) (I), (2), detachment A1 (4) v + (P + v) ( 5 ) p, + P, (3), (4), detachment
' '
Theorem 8.11 (Deduction theorem).
If I?
U {p) I-
4, then I' I- p + #.
PROOF. By induction on m we show that for every nonzero m E w , if (xo,. . .,xm is a formal proof of (I, from I? u {p), then I' I- p -+ #. Suppose is a formal proof of this is true for all n < m, and suppose (xo,.. ., x,-~) (I, from I' u {p). By 8.8 we have four cases: Case I . J, is a logical axiom. Now I-$ + (p + #) by A l , and obviously I-+, so I-p + # and hence I' I- p -+ $. Case 2. E I?. This is treated similarly to Case I. Case 3. (I, = p. By 8.10 we have I-p+ (I,; hence I' I- p + #. Case 4. 3j, k < m - 1 such that xk = X, += (I,. Now by the induction assumption I' I- p + xk and I' I- p + x,. The following F-proof shows that
{P'+
+
(I,-+x,d I-*+x + X, 9)) I- X
{P+*~*-+X~~T+X (9'+ (I,) I- (* + x) 3 (v + x) t (v K4 X) + (T -,x)1
*>
'
+
'
Easy applications of the deduction theorem give:
Lemma 8.14. I-p + ( i p + (I,).
+
r I-p+(I,:
Two applications of the deduction theorem finish the proof. By a similar proof, or using 8.13, we get:
Lemma 8.15. I- i p + (p + #). Lemma 8.16.
I- 1 i p -+ V.
using A1 A3 A3
0
Chapter 8 : Sentential Logic
Part 2: Elements of Logic
Lemma 8.17.
Definition 8.22. Let B = (n,c, P ) be a sentential language. Members of P2 are called models of 8. (Intuitively, 0 means falsity, 1 means truth, and a function f E '2 is just an assignment of a truth value to each sentence of P.) Using the recursion principle for sentences, we can associate with each f E2 ' a functionf + : Sent9 -+ 2 such that for any s E P and any p, 4 E Sentg
t ( p + 4) + ( i# + -IT).
f + ( s > =fi, i p= 1 f+ i p =0 f+(~++)= 0
iff+p = 0, i f f + p = 1, iff f + p = 1 a n d f f p
f'
0.
(ff intuitively tells us about the truth or falsity of any sentence of 9, given the truth or falsity of members of P.) We say that f is a model of q~iff + p = 1;f is a model of a set I? of sentences iff f + p = 1 for all p E F. We write I? k g p iff every model of I? is a model of p, and we write kgp instead of 0 kg p. Sentences p with kgp, are called tautologies.
Lemma 8.18. t p + i i q ~ .
Lemma 8.19.
=
Whether or not a sentence p is a tautology can be decided by the familiar truth table method: one writes in rows all possible f 6 '2 and for each such f calculates f + p from inside out. Of course instead of all f 6 '2 it suffices to list only the f E Q2, where Q is the set of s E P which occur in v. For example, the following table shows that (s,) + ( ( s 2 ) -+ (s,)) is a tautology:
t ( p + l p ) + -IT.
1
1 0 0
1 1 0 1
1 0 1
0
1 1 1 1
The following table shows that - I ( s , ) + ( l ( s l ) + ( s , ) ) is not a tautology: Our last two lemmas are easily obtained using the methods in the proofs above.
31
~($1)
-+l>
-+
<s1>
-I<s1>
-+
( - . l < ~ l >+ ($1))
Lemma 8.20. I-( i p + p) + P. Lemma 8.21. kp + ( i# + - ~ (+ p 4)). Now we introduce a semantical consequence relation I? k p. Roughly speaking, the difference between syntactical notions like t and semantical ones like k is this: Syntactical notions are defined purely in terms of the formal symbols, with only the mathematical notions being used which are essential for the definition. In semantical notions, however, mathematical ideas of a very different sort from formal notions play an essential role; almost always some version of the idea of a model, or mathematical realization, of the formal notions plays a role, along with a rigorous notion of truth.
''
Clearly this truth table procedure provides an effective procedure for determining whether or not a sentence is a tautology. This statement could be made precise for sentential languages B = (n, c, P ) with P countable by the usual procedure of Godel numbering. (See 10.19-10.22, where this is done in detail for first-order languages.) In practice, to check that a statement is or is not a tautology it is frequently better to argue informally, assuming the given sentence is not true and trying to infer a contradiction from this. For example, if ( s , ) + ((s,) J ( s ~ ) )is false, then s, is true and (s,) -,< s l ) is false; but this is impossible; (s,) + ( s , ) is true since s, is true. Thus ( s l ) + (<s2)-,( s , ) ) is a tautology. 1?1
Chapter 8: Sentential Logic
Part 2: Elements of Logic
We are going to show shortly that the relations t and k are identical. T o d o this we need some preliminary statements.
Lemma 8.23.
II
Hence we may apply Zorn's lemma t o obtain a member A of d maximal under inclusion. Now we establish some important properties of A.
For, if A t- p, and p, $A, then A v {p,) is inconsistent, so by 8.26, A t i p . Then by 8.14, A is inconsistent, contradiction.
PROOF. Let A = {p, : every model of I? is a model of p). It is easy t o check, using truth tables for the logical axioms, that I? c A, every logical axiom is in A, and A is closed under detachment. Hence all I?-theorems are in A. The lemma follows. 0 Definition 8.24. I' is consistent iff
A t p, implies that p, E A.
(1)
If F I- p,, then r t= p.
if p, E Sent, then p
(2)
E
A or i p , E A.
For, suppose p, $ A. Then A u {p,) is inconsistent, so by 8.26 A t i p , , and (1) yields i p , E A.
r If p, for some p.
Theorem 8.25. The following conditions are equivalent:
T o prove this, first suppose i p , E A. By 8.15 and (I), p + $ E A. If IC, E A, then p + $ E A by A1 and (1). Thus in (3) holds. Now suppose i p , 6 A E A. Hence by 8.21 and ( l ) , i ( p , + 4) E and $A. By (2) we have p, E A and i$ A, so p + IC, $ A since A is consistent. Thus (3) holds. We now define the desired modelf: For any s E P let
(i) I? is inconsistent. (ii) I? t i ( p , +- p) for every sentence p,. (iii) I? t i ( p +- p,) for some sentence p,.
+
PROOF. Obviously (i) * (ii) 3 (iii). Now suppose I? t i ( p , + p,) for a certain sentence p,. Let $ be any sentence. By Al, I' t (p, + p,) + [-+ + (p, + p,)]; from 8.10 we infer that F b i$ + (p, p,), and then 8.17 yields I' t i ( p + p,) + i i+. Hence F t i 11S)o.by 8.16, T' t 4 : being any sentence, I' is inconsistent.
fs=1 fs = 0
+
if(s)~A, otherwise.
We claim: for any sentence p,, f +p, = 1 iff p, E A.
(4)
For, let O = {p, :f +g, = 1 iff p, E A}. By the definition ofS, (s) s E P. Now suppose p, E O. Then
Theorem 8.26. I' u {p) is inconsistent iff I' t i p .
+,
PROOF. 3 : Since J? u {p,) t 4 for any sentence we have I? u {p,) k ~ p , so , by the deduction theorem r t p, + i p , . By 8.19, I' t i p , . e : I' u {p,) k i g , and r u {p,) t p, so by 8.14, r u {p) t for any sentence +. 0
f+(ip,) = 1
+
Theorem 8.27. 0 is consistent. PROOF. Since i ( p , + p,) always receives the value 0 under any model, for any sentence p, by 8.23 we have not ( t i ( p , + p,)). 0
I
PROOF. Let 'I be a consistent set of sentences. Let d = {A : r G A, A is &' is nonempty. Suppose Li? is a subset o f d simply consistent). Since r E d, ordered by inclusion, B # 0. Then I? c U 9?.Also, U 9? is consistent, for, if not, there would be, by 8.25, a sentence p, such that U B t i ( p + g,). t i ( p , + p) for some finite subset {4,, . . ., 4,Then by 8.9, {$,, . . ., of U B. Say $, E A, E B, . . ., 4,-, E A,_, E 93. Since 93 is simply ordered, there is an i < rn such that Aj G Ai for all j < m. Thus 4, E Ai, . . . , E Ai, so Ai k i(cp + cp). Thus Ai is inconsistent by 8.25, contradicting Ai E 93. Thus U is consistent.
O for each
ifff+p, = 0 definition of ifff+g,# l iffp,$A since p E O iff i p , E A (2), consistency of A +
Thus i p , E O. Finally, suppose p,, $ E O. Then f+(p,++)
I
Theorem 8.28 (Extended completeness theorem). Every consistent set of sentences has a model.
E
I
=
1
ifff+p,=Oorff$= I ifff+p,# 1 o r f + $ = 1 iffp,$Aor$~A iff i p , ~ A o r $ ~ A iffp,-+$tA
definition of
+
since p, $ E O (2), consistency of A (3)
Thus g, + $ E O. Hence Senty c 0 , and (4) holds. If g, E I', then g, E A and hence f +p, = 1 by (4). Thusfis a model of r, as desired. 0
Theorem 8.29 (Completeness theorem).
r
t p rff
r
k p.
PROOF. 3 : by 8.23. c : Suppose not ( I ' 1 F).Then not ( r t i i p ) by 8.16, u { lcp} is consistent, by 8.26. By 8.28, let f be a model of r u { -y). Thus f is a model of 1' but not of q, so not ( r k cp). 0 SO
Chapter 8: Sentential Logic
Part 2: Elements of Logic
This completeness theorem is our first result of a modern model-theoretical character. It shows the complete equivalence of the syntactical notion t and the semantical notion k . Hence in considering various problems in sentential logic we can use syntactical or semantical methods with equal right. Another interesting consequence of the equivalence, kg, iff kp,, is that there is an automatic method for determining whether tp,or not (the truth-table method above). From just the definition of t p it is difficult to infer that such a decision method exists. This does not mean that for any T there is an effective procedure to determine whether I? I- p, or not. For example, P may be infinite, we may have I? G P, and under a natural Godel numbering I? may be nonrecursive; in this case there is no such decision method. We have now seen that our axioms for sentential logic formulated for negation and implication are sound and complete. Next, we indicate how various other notions of sentential logic can be expressed in terms of negation and implication. Some important results, like duality and normal form theorems, can be formulated using the new notions.
Definition 8.30. For any sentences p and
# let
cp v # = i p , + # (disjunction of cp and #); p, A = i ( p ,+ i # ) (conjunction of p, and #); p, t, = (p, + +) A (+ + p,) (biimplication between p, and
+ +
$1.
The following obvious proposition enables one to tell easily whether a sentence formulated using these defined symbols is a tautology or not:
Proposition 8.31. I f f is a model of 8 and p, and
(i) f + ( c p v # ) = 1 (ii) f + ( p , A +) = 1 (iii)f+(cpo#)=l
# are sentences of 8, then
ifff+p,= 1 0 r f + # = 1; i f f f + p , = 1 andf+# = 1 ; ifffcp,=f+#.
Having all of these sentential notions available, we can discuss the notion of the dual of a sentence:
Definition 8.32. For any sentence p, we define the dual of p,, denoted by p,d, as follows (using 8.6): (i) ( s ) ~ = ( s ) for each s E P; (ii) ( ~ c p =) ~- p d ; (iii) (p, +#)d = l PAd #d.
Proposition 8.33 ( 0 49, A +Id +, vd V + d ; (ii) kip, V $)d t,rpd A yid; (iii) I-p, t,p,dd; (iv) iff and g are models of 9 and fs = g+ -I ( s ) for all s E P, then f + p, = g ( l p d )for every sentence p,; (0) ~ k p , ~ f f { l + ~ : *t ~l p r ' )d ; (vi) I-p, ~ f ft -I tpd; (vii) I-p, + $ iff k g d + p,d; (viii) I-p, t,$ 18 hpd o z+hd. +
PROOF.In the case of ( i ) and (ii) it is just necessary to apply Definition 8.32 to the sentences (p, A $)d and (p, v $)d in order to see what combination of 9d and +d they are and then check that then ( i ) and (ii) are tautologies. For example, (p,
A
*)d = ( 3 9 ) --, 1Wd= l ( p , + ~ $ 4 ~ = l ( 7 y d A ( T $ ) ~ )= l( i v d A l+ * d p,d) v $d is a tautology (by, say, the truth-table
and i ( i V d A method). We prove (iii) by induction on p,. For p, of the form ( s ) with s E P, we have vdd= p,, and (iii) is clear. Now we assume (iii) for p, and prove it for i p . Now ( l p , ) d d= i T and dd (p, * , p,dd)+-( i p t, i F d d is ) a tautology, so (iii) for p, clearly implies (iii) for i p . Finally, assume (iii) for p, and +; we establish it for p, + $. We have (p, + $ ) d d = ( l p A d(Cld)d = ( 1 ( l v d+ 1 ~ ) ~ ) ) ~ = l( lY -+ dl + d ) d= l ( l( l V d ) d A ( 1$bd)d) = l (1l P d A d 1$bdd)= 1 l ( 1 l V-+ dd 1~ $ ~ d ) ; thus (p, t,rpdd)+ ((+ e, +dd)+-[(p, + +) * (p, -+ ~ , h ) ~is~a]tautology, ) so (iii) follows for p, -t +. Therefore (iii) holds in general. Assume the hypothesis of (iv). We prove its conclusion also by induction on cp. The case p, = ( s ) with s E P is trivial from the hypothesis of (iv). Assuming f +p, = g+ i p,d, we have f + i p ,=0
iff f + p , = 1 iff g + -I vd = 1 =0 iffg+ i lVd iff g + -I( ~ p , =) 0. ~ Thus if the conclusion of (iv) holds for p,, then it also holds for l p , . Finally, assume that f +p, = g + ( l v d )and f =g + ( ~ + ~ Then ).
++
f+(p,+$)
The following proposition shows that A and v are dual notions. The most useful part of the proposition is probably (viii), by which one can conclude that vdo +d is a tautology after proving that q t, is.
+
=
0
iff f+cp = 1 a n d f + + = 0 i f f g fiV =d 1 andg+ =0 i f fg + 1 p,d = 1 and g+$d = 1 i f f g + ( l p dA + d ) = 1 iffg+(p,++)d = 1 i f fg+ i (p, + +)d = 0.
Part 2: Elements of Logic
Chapter 8: Sentential Logic
Hence the conclusion of (iv) holds for p + # if it holds for p and for #. Hence (iv) holds. We can derive (v) from (iv) easily using the completeness theorem. First assume I' t- rp Thus by the completeness theorem I' k p. We shall now establish that { T # ~#: G r) k i p d . To this end, let g be any model such that g + i = 1 for all # E I?. Define fs = g + -I (s) for all s t P. By (iv), f + # = g + i #d for every sentence ). Hence f is a model of I?, and so f + p = 1. Therefore g + i pd = 1. Since g is arbitrary, : # E I') k l p d . By the # E I?) t- i p d . The converse is proved in completeness theorem, exactly the same way; (v) follows. The condition (vi) is a special case of (v). Concerning (vii), recall that (y+ #). = i p d A (Gd. Hence t- i (p + fld* + pd), so (vii) follows from (vi). Finally, (viii) follows from (vii) since t-x o '6 is equivalent to the 0 conjunction of t-x +- 0 and t-0 + X, for any sentences x and 8.
PROOF. By 8.9(ii) we may assume that A is finite. Hence it is enough to prove by induction on m that for all m E w and all p E "+,SentB, if I? v ivi :i 5 m) I- # then I? 1 A,,, pi + +. This statement for m = 1 is just the deduction theorem. Now we assume our statement for m (and for all sentences #), and we assume that p E m+2Sentpand I? v {pi : i I m + 1) I- #. By the deduction theorem, I? LJ {pi : i 5 m) t- p,,, + #. Hence by the induction assumption, I' t- A,,, pi + (cp,,, + 4).Now using Proposition 8.35 it is easily checked that the following sentence is a tautology, and hence is a I?-theorem : [ iA smR + ( P ~ + I + A
I
A
+ (ism+l
pi+#).
It follows that 'I I- Airm+l pi 4 #, as desired.
0
We can also give a useful criterion for inconsistency:
Some other important sentential connectives are the finite generalizations of conjunction and disjunction :
Theorem 8.37. For any set I? of sentences the following conditions are equivalent: (i) I? is inconsistent; (ii) there is an m E w and a q~ E "'+'I' such that !- ViSmi pi.
Definition 8.34. Let (po, . . ., pm-,) be a finite sequence of sentences, with m > 0. We define the general conjunction Ai,, pi and the general disjunction Vi , vi for j < m by recursion :
PROOF. (i) * (ii). Assuming (i), we have I' I- # A i# for any sentence #; we fix $. From 8.27 we know that I' # 0.Hence by Theorem 8.36 there is an m E w and a p ~ ~ + ~ I ' s that uch
It remains only to notice that the sentence
We sometimes write po instead of Vir pi.
,
A
.. A
p, instead of
Ail;, pi, and po v - . - v
ism
T,
The following proposition shows how to calculate truth values with these new connectives; it is easily established by induction on j. Proposition 8.35. Under the assumptions of Dejnition 8.34, for any j < m and any modelf we have (i) f (ii) f
+
+
AiSjpi = 1 iffVi I j (f Vi,, pi = 1 i f f 3 I j (f
With the aid of generalized conjunction we can formulate a generalized form of the deduction theorem 8.11 which is frequently useful in the further study of sentential logic:
+
0
The following theorem is perhaps the most important result in the classic theory of sentential logic :
+pi = 1);
+pi = 1).
Theorem 8.36. If r u A t- andA # 0,then there is an rn E w and a p E "+'A such that I? I- p, A - . - A cp, +- +.
ism
is a tautology. (ii) 3 (i). Assume (ii). Then for any sentence # we have I? k #. In fact, let f be a model of I?. Then in particular f +pi = 1 for all i I m. But, by virtue of Proposition 8.35, this contradicts the fact that Vi,, 1pi is a tautology. Conclusion: 'I has no models. Thus, vacuously, every model of P is a model of #. Hence, indeed, I? k #, so I? t- # by the completeness theorem. Thus F is inconsistent.
,,
A
, ,
Tbeorem 8.38 (Distinguished disjunctive normal form). Let 8 = (n, c, {so, . . ., s,)) be a sentential language, with m t w . Let p be a sentence which has at least one model. Then there is a function # such that:
+
+
+
(i) the domain of is (p 1) x (m 1)for some P 6 w ; (ii) for each i I p and j I m, #ti = <sf> or #ij = l(si>; ( W b w Visp A t s m +ij-
Chapter 8 : Sentential Logic
Part 2: Elements of Logic
A general sentential logic is a quadruple 9 = (K, P, f, g ) such that P # 0, K n P = 0, f is a function mapping K into w -- 1, and g is a function ' are the assigning to each k G K an fk-truth function g,. Symbols of 9 members of K u P ; expressions of 9 are finite sequences of symbols. With
PROOF. Let M be the set of all models of q ; M # 0 by assumption. Let g be a one-one function mapping some integer p + I onto M. For each i 2 p and j I m let (sj) if gisj = 1, Thus g,' A,, #,, = 1, whilef + A, this ~t follows easily that f t9, = f desired.
each k
., +
+,, = 0 ~ff # fit, for each i 5 1). From V l r pA]<,,, for every model f , as 0
"
By duality we obtain
E
K we associate an fk-ary .operation L 0.n expressions :
where m = fk, for any expressions 90,. . ., y m - , The set of sentences of B is the intersection of all classes r of expressions of 9 such that { ( s ) : s E P ) G I'and I? is closed under all the operations L for k E K. On the basis of these definitions, analogs of 8.3-8.6 are easily established. This enables us to extend the notion + of 8.22. A model of 9 is again any mapping of P into 2. Given a model h, a mapping h of the set of sentences of 9 into 2 is defined by recursion as follows: +
Theorem 8.39 (Distinguished conjunctive normal form). Lrt .Y = (17,c, { s o . . ., s ~ - ~ he } ;a sentential logic, with m t w . Let q be a sentence which is not a tautology. Then there is a function $ such that: ( i ) the domain of 4 is ( p + 1) x ( m + I ) for some p E w ; (ii)for each i I p and each j 5 m , #ij = (sj) or Gi,= l(.sj..>; (iii) t-g, A i S p V j < m 4ij. PROOF. Assume the hypothesis. Thus not(tF), so by 8.33(rli), qd has a model. Hence by 8.38 we can choose I/ so that ( i ) and ( i i ) hold and
bd* V
A
i 5 P l5nl
Now an application of 8.33(aiii) gives the desired result (X.33(i) and 8.33(ii) must first be generalized in the obvious way). As the final topic of this chapter we want to systematically consider possible variants of our choice ofconnectives negation and implication, and show that all other connectives can be defined from these two. The full meaning of our sentential logic is given by a sentential language ( n , c, P ) together with the definition off for f E P2, which amounts to assigning the usual truth tables for the meanings of n and c. We shall see that any connective, with its meaning given by some truth table, can be expressed in terms of n and c. There are also other connectives which can serve, like n and c, to express any connective. To prove all of this rigorously, we need a notion of pctwrol sentential logic: +
Definition 8.40. For each set P, a P-truth function is any function mapping ' 2 into 2. [Thus, for example, the 2-truth function f corresponding to c is given by the stipulations
$
where m = fk and p,,, . . ., p,,are sentences of 9 . Then with any sentence p, we can associate a P-truth function TQ such that TQ f = f +p, for any f G '2. The logic 9 isfunctionally complete provided that {Fw: p, a sentence of 9 ) is the set of all P-truth functions. We can identify sentential logics in our earlier sense (language together with semantic notions) with certain general sentential logics, namely those of the form ({n,c), P,f, g ) , where n # c, {n, c} n P = 0, fn = 1,fc = 2, g, is the function given by g ( 1 ) = 0, g ( 0 ) = 1, and g, is the function mentioned above in 8.40. Then we have
Theorem 8.41. Let 9 = ({n, c), P, f, g ) be a sentential logic in the original sense, with Pjinite. Then 9 is functionally complete. PROOF. Note that there are exp exp IP ( P-truth functions. Hence it suffices to show that there are at least that many truth functions of the form To. Let lPl = m + 1, say P = {s, : i I m). For each h G ' 2 we define x,, an (m ])-termed sequence of sentences of 9:for j Im, xhj = (s,) if hsj = 1, x h j = i ( s j ) if hs, = 0. Now for any nonempty subset I ' of P2, let
+
% =
V /\
Xhj.
her j r m
Then it is easily verified that r is the set of all models of p, (cf. the proof of 8.38). Hence For# FQ,if I' # A. Furthermore, clearly Yo,f F@for all nonempty E P2, where t+h is a sentence with no models. Thus we have as desired. exhibited exp exp IPI different functions Yo,
0
This theorem is a rigorous expression of the above mentioned fact that any connective can be defined in terms of n and c. As also stated, other choices of connectives can be used for this purpose. To show this, the following lemma is useful.
Chapter 8: Sentential Logic
Part 2: Elements of Logic
Theorem 8.43. Negation and conjunction give rise to a functionally complete sentential logic. That is, i f 9 = ({n, k ) , P, f, g ) is a general sentential logic with fn = 1 , f k = 2, and g given by:
Lemma 8.42. Let neg be the truth function corresponding to n in any sentential logic, and imp that corresponding to c. Let 8 = ( K , P, f, g ) be a general : p, a sentence of sentential logic such that K n 2 = 0 , P finite, neg E {Frp (K, 1, f, g)), and imp E {To: p, a sentence of (K, 2, f, g). Then 8 isfunctionally complete. PROOF. Let 8' = (K, l , f , g ) , 9"= (K, 2 , f , g), and let 8" = ({n', c'}, P, f ', g') be a sentential logic. For p, a sentence of 8' and # a sentence of 8,let q[#]be the sentence of 8 obtained from p, by substituting # for ( 0 ) throughout p,. If h. is a model of 8 and # is a sentence of 8, then h; is the model of 8' such that h;O = h+#. Now if p, is a sentence of 8',# a sentence of 8,and h is a model of 8, then h+p[#]= h;*p,.
and i f P is finite, then 8 is functionally complete.
+
PROOF. We may assume that P n 2 = 0. Let i p , = (n)p, and p, A = (k)& for all sentences p,, #. Clearly neg = F<,>in ({n, k}, l , f , g), and imp = Trp in ({n, k } , 2, f, g ) , where p, is the sentence
I
This is easily proved by induction on p,. We work similarly with 8 " . For p, a sentence of 8 " and #, x sentences of 9, let p[#, X ] be the sentence of 8 obtained from p, by substituting $I for ( 0 ) and x for ( 1 ) throughout p,. If h is a model of 8 and # and x are sentences of 8,then h';, is the model of 8 " such that h;,O = h++ and h;,l = h+x. By induction, one easily establishes
I
if p, is a sentence of B",# and x sentences of 8,and h a model of 8, then h +p[#,x] = Cp,.
:
(2)
Now by hypothesis choose a sentence cp of 8' and a sentence # of 8 " so that neg = Fq and imp = T * . With each sentence x of 8" we now associate a sentence X* of 8,defined by recursion:
Thus the theorem follows from Lemma 8.42.
0
Similarly
i
' '
Theorem 8.44. Negation and disjunction give rise to a functionally complete sentential logic.
S
I
It is of some interest that a single connective can be used in sentential logic:
Theorem 8.45. Let 8 = ( { s ) ,P, f, g ) be a general sentential logic such that fs = 1 and g is given by
and with Pfinite. Then 8 is functionally complete. for any sentences X , x,, x1 of 8" and any s E P. Now we prove the following statement by induction on X :
(3) for any sentence
x
PROOF. p,l# = ( s ) & for any sentences p,, #. (The connective here is called the Shefler stroke.) Then neg = Fq and imp = F* where p, is (O)I(O) and , # is (0)1((1)1(1)). Thus Lemma 8.43 implies. 0
of 8" and any model h of 8",h+x* = h+x.
The statement is clear for
x
=
( s ) , s E P. Now assume it true for X . Then
BIBLIOGRAPHY 1. Schmidt, H. A. Mathematische Gesetze der Logik. Berlin: Springer (1960). 2. Lukasiewicz, J. and Tarski, A. Investigations into the sentential calculus. In Logic, Semantics, Metamathematics; Collected Papers of A . Tarski. Oxford:
and neghl* = 0 iff hl,(O) = 1 iff h f X * = 1 iff h + x = 1 iff h + ( i , y )= 0, i.e., neg hl* = h+ i x . Similarly, h+(x0+ xl)* = imp h;:,:, and imp hi:,: = 0 iff /z&,:O = 1 and h::,:l = 0, i.e., iff h+x,* = 1 and h+,y? = 0, i.e., iff h+xo = 1 and h+,y1= 0, that is, iff h+(,y0+ = 0. Hence imp h';:,: = h+(xO-t X I ) . Thus (3) holds. It follows directly from (3) that, since 8" is functionally cornfor, if I is any truth function, write I = y, with x a sentence of plete, so is 9: F .By (3), Yx= Yx*, as desired. 0
Oxford Univ. Press (1956). 3. Post, E . The Two-Valued Iterative Systems of Mathematical Logic. Princeton: Princeton Univ. Press (1941). EXERCISES 8.46. Let B = (n, c, {s, t ) ) be a sentential language, with s # t. Determine which of the following expressions are sentences: <s), , , .
Chapter 8: Sentential Logic
Part 2: Elements of Logic
8.47. By a sentential language with parentheses we mean a system B = (n, c, I, r, P ) such that n, c, I, r are all distinct, P # 0, and {n, c, 1, r ) n P = 0. We
introduce operations
+ on expressions as follows:
1,
*
1 9 , = v qJ + = v*, for all expressions p,, #. Sent9 is the intersection of all sets I'of expressions such that (s) E I' for each s E P and i p , , p, + 4 for all p,, $ E I?. Prove an analog of 8.5. Modify 8.2 by changing the definition of +:
for all expressions p,,
+. Show then that parts (iii) and (iv) of 8.5 fail.
Show that the following schemas, due to Lukasiewicz, can replace (A1)(A3) of 8.7:
Hint: prove the following schemas in succession from the above schemas:
;,
, ii x;.
Show that the following single schema, due to Meredith, can replace the schemas (A1)-(A3) :
10)1+x)+~)+[(~+cp)+(e-*9))1 (a) ( { [ ( v + $ ) + ( l x + Hint: prove the following formulas from this schema:
8.51. Let B = (n,c, P ) and 8' = (n', c', P') be two sentential languages. We write B 5 9'iff n = n', c = c', and P G P'. Assume that B I9'and
prove the following: ( 2 ) i f f : P f + 2 , then f + 1 Sentg = (f p p ) + ; (3) if U {p,l S Sentp, then I't p p, iff r t p rp. 8.52. Let ISent be the set of all sentences (of a fixed but arbitrary sentential language) in which the negation symbol does not occur. Our aim is to outline an independent development of sentential languages without
Chapter 8 : Sentential Logic
Part 2: Elements of Logic
negation. Let IAxm be the set of all sentences of the following kinds (where p,, $, x E 1Sent):
8.54. Again we work with a sentential logic in which negation and disjunction are taken as primitive. We want to describe now a definition of " tp," in which rules of inference rather than axioms take precedence. We define four rules of inference.
Let I' - IThm be the intersection of all sets of I-sentences including r u IAxm and closed under detachment. We write I' tl p, for rp E I? - IThm. Establish the following, where all sentences and sets of sentences are taken from ISent : (a) (b) (4 (d) (e) (f)
0 11p, p,. the deduction theorem for 1,. 0 t1 (rp + *) + t($ + x) (rp + x)l. If I' tI (s) for each s E P, then I' tI p,.for each p, E ISent. 0 tl (p, + $) + (Krp + x) + $1 + $). Call a set I' of I-Sentences I-consistent if not (r tI rp) for some I-sentence p,. If I' is I-consistent, then I' has a model which is not identically 1. -+
-+
I%
Hint: use these steps: (1) (2) (3) (4) (5) (g)
there is an s E P such that not ( r tI <s)); there is a maximal A 3- J? such that not (A tI <s)); A 1, p, implies that p, E A; p , - f $ ~ A i f f p , $ Ao r $ ~ A ; continue as in the proof of 8.28. r t,rp iff k p, iff I' t p,. Hint: for the hard direction, assume not (I' t, p,). Then not (I'u {p, -+ $ : $ E ISent) 1p,), so by (f) let f be a model of u {p, + $ : $ E ISent) which is not identically 1. Show that fip, = 0.
8.53. We work in a sentential logic in which negation and disjunction are taken as primitive. For any sentences p, and $ let p, + # = i p , v #. Take as axioms all sentences of the following forms:
(a) (9, v p,)-,p,; (b) p, (p, v $1; (c) (p, v $)+@ v rp); ( 4 (rp + *) + [(x v p,) (x v *)I. Prove analogs of 8.28 and 8.29. Hint: apply the result of 8.49. In order to do this it suffices (proof !) to derive the following: -+
-+
1
(1) Association. This rule is a relation R, s Sent x Sent. If p, is a sentence, ($ v X) v 6 is a consecutive part of p,, with 4, X, 6 E Sent (i.e., p, = e'(($ v X) v 8)O" for some expressions Of, 0'7,and if a is obtained from p, by replacing a consecutive part of p, of this sort by $ v (X v 0) (i.e., if a = 8'(# v (X v @)8" with notation as before), then (p, o) E R,. (2) Commutation. We define R, c Sent x Sent. If p, is a sentence, $ v x is a consecutive part of p,, with $, x Sent, and a is obtained from p, by replacing a consecutive part of p, of this sort by x v $, then (p,, a) E R,. (3) Double negation. Rz is to consist of all pairs of the following sort, w h e r e $ , ~ , e ~ S e n t : ( ( $ v ~8) ,v( $ v 1 - q ) v O ) ; ( x v 0, - 1 7 v 8); (* v x, v -I -x), (x, -I 1x1. (4) Conjunction. R3 consists of all triples of the following sort, where 4, X, 0, a E Sent:
*
A set r c Sent is closed under R,, . . . , R, provided that p, E r whenever # and x E ROand (4,p,) E Ro, ($, p,) E RI, ($, p,) E Rz, or (4,X, p,) E R3. We call a sentence p basic if it has one of the following forms: <s) v 10) with s E P, with x basic, /J v x x v $ with x basic, (0 v X) v $ with x basic,
(formulate this as a recursive definition). Thm is the intersection of all classes of sentences including all .the basic sentences and closed under Ro, RI, Rz, and R3. We write Ip, for p, E Thm. Prove that tp, iff kp. Hint: the following facts lead to an easy solution:
v -(x v O)] v a, then k(qb v i x ) v a and k(* v 7 0 ) v a. (1) If (2) If +($v -.Ii x ) v 8, then I($ v X) v 0. (3) If Cp, and p, cannot be obtained from some other sentence by f, or (after applying association and commutation), then p, is basic. 8.55. Show that a logic with negation alone is not functionally complete. Similarly for implication, disjunction, conjunction.
8.56 (Three-valued logic). It is natural to consider sentential logics in which three or more truth values are allowed. We describe here a version of
Chapter 8: Sentential Logic
Part 2: Elements of Logic
Now define for each basic sentential symbol s
three-valued logic. The truth values are 0 (falsity), 1 (truth), and 2 (indeterminate). The truth tables for i and + are as follows:
fs=1 fs = 0 fs = 2
if<s)~A, if i < s ) E A, otherwise.
Prove by induction on p, that
f +p = 1 f +p, = 0 f +p, = 2
implies P, E A implies i p , E A, implies p, $ A and i p , $ A.
To prove the analog of 8.29, note that if I? t p, then I? u {p, + (p, + ip,)) is consistent. (e) Define the appropriate notion of functional completeness for threevalued logic. Show that our connectives are not functionally complete. 8.57 (Intuitionistic logic). We outline here a short introduction to intuitionistic sentential logic (see the introduction to the book). According to intuitionism, every mathematical assertion, to be called mathematical and not theological, should be expressible in the form "I have effected a certain construction A in my mind." If p, and # are assertions, then:
(a) Show that the following sentence is not always true in three-valued logic, but is never false:
(1) We can assert p, A # iff both p, and # can be asserted. (2) We can assert p, v # iff at least one of the sentences p, and # can be asserted. (3) We can assert ~ p iff, we possess a construction which leads from the supposition of p, to a contradiction. (4) We can assert p, -+ # iff we possess a construction which, when joined to the construction mentioned in p, (which is not, however assumed to exist), leads to a construction of the sort mentioned in #).
Now we shall describe an axiom system for three-valued logic. The axioms are all sentences of the following forms:
Let detachment be the only rule of inference. This gives a new notion Let 1 be the semantic notion for three-valued logic. (b) Show that I' t p, implies I' k p,. (c) For further purposes, prove the following:
Examples: (a) p, v -p, cannot be asserted for every assertion p,, for this would imply the existence of a general method such that, given a construction A, the method tells us how to carry out A, or else how to infer a contradiction from the assumption that A has been carried out. For example, let p, be: "I have constructed integers x , y, z, m such that m > 2, and xm y m = zm." I cannot assert p,. But also I cannot obtain a contradiction from the assumption that the construction mentioned in p, has been carried out, i.e., I cannot assert ~ p ,Thus . I cannot assert p, v ~ p , . (b) T -p, + p, cannot be asserted for every assertion p,. Indeed, take the following example of Brouwer. Write the decimal expansion of T :
1.
+
(d) Prove analogs of the completeness theorems 8.28 and 8.29. Hint: to prove the analog of 8.28, begin as in the proof of 8.28, obtaining the set A. Show:
# implies A 1 p, + (p, +#), p, 6 A implies A t p, + (p, + ip,), l p , 9 A implies A t i v +-( i p , + v), A I- p, implies p, E A.
A U {p,) t
I
I
1 j
Underneath write . 3 3 3 3 . . ., breaking this off as soon as the sequence of digits 0123456789 has occurred in the expansion of .rr (classically it is un known whether this will ever occur). Let p, be the assertion: p is rational. Classically p, is obviously true. Intuitionistically p, is to be interpreted as " I possess a construction of integers m, n such that p = mln." Suppose -p,; then p cannot have the form . 3 3 . . . 3 0 0 . . . , so p = 4, i.e., p, holds, contradiction. Assuming ~ pwe, get a contradiction. Hence (intuitionistically)
Chapter 8 : Sentential Logic
Part 2: Elements of Logic
8.58 (Modal logic). We now briefly discuss the addition of new connectives to sentential logic which express such intuitive notions as possibility or necessity. A modallanguage is a quadruple 9 = (n, c, d , P ) such that ({n,c, d}l = 3, P f 0, and {n, c, d } n P = 0.The symbol d is the necessity symbol. For any expression p, we write O p = < d ) p . Other notation is carried over from the sentential case. If p is a sentence, then U p expresses, intuitively speaking, that p is not only true, but is true in all possible worlds. Thus if p is the sentence "It is sunny now," then rp may be true at a given place and time, but it is not necessarily true. On the other hand, if cp is "A rose is a rose," then p is necessarily true. The notion of necessity is, however, somewhat unclear and indefinite in its intuitive meaning, much more indefinite than the notions in three-valued logic or intuitionism. For example, is the sentence O p + U U p to be accepted, or not? Debate over these matters has led to a large number of systems of modal logic, of which we present only one. Our axioms are as follows:
, ,p.
But we cannot assert p intuitionistically, and hence we cannot assert 11p+p. Now we seek to axiomatize those assertions which are intuitionistically valid. We take negation, conjunction and implication as primitive. As axioms we take all sentences of the following kinds:
Detachment is the only rule of inference. " tip" is defined analogously to the classical case. (a) Check that the axioms are intuitionistically valid in the intuitive sense. (p) Check that the deduction theorem goes through. Our notion of intuitionistic validity is informal, and hence we cannot hope to prove a completeness theorem until we find a mathematical version of this validity. Without trying to justify it, we introduce the following mathematical version of intuitionistic validity: an intuitionistic model for B is a function Given a sentential language 9, f mapping P into the collection of open sets in some topological space X. Given such a function f, we define
-
For rules of inference we allow detachment, and the inference of O p from cp. This gives a notion r tm p. If X is a topological space and f: P SX, we define f : Sent9 + S X as follows : +
f+<s) f + 1p f + ( p A *) f + ( p+ I))
-
= fs for all S E P = interior of (X
=f + p =
nf+*;
interior of [ ( X
;
f +<s> = fs
f +p);
-f
+ p ) Uf
+
f + ( W = XNf+g, f + ( g , + + ) = ( X - f+g,) U ~ + Q f U p = interior of f +cp.
#I.
+
This gives rise to a notion 'I Ci p. (y) Prove that r ti p implies r ki p. (8) Show that if r is consistent, then there is a model f with associated topological space X such that for any sentence p, r t p iff f + p = X. Hint: let X = { A : I? G A, A consistent}. For each sentence p, let
1 Y
Show that the U,'s form a base for a topology on X. Let fs = U<,, for each s E P, and show that f + p = U, for each sentence p. (E)
I? t i p iff I? 6 p.
(5) An interesting connection between intuitionistic and ordinary logic is : # E 1') t, 1l p ; in particular, given by the following result: 1' k g, iff ( 1i# t p iff k, i i p . Hint: pick a suitable set of axioms A for classical logic and show that and that the latter set is closed under detachment. Then use
(E).
Of course this gives a notion of r k, g,. (a) Show that r km p implies r km p. (p) If I' is consistent, then has a model f such that for every sentence p, I? I m p ifff + p = X. Hint: let X = { A : A is maximal consistent in ordinary sentential logic and for every sentence p, r tm g, implies g, E A). For each sentence cp, let
Show that these sets form a base for a topology on X. Let fs = { A E X : A t < s ) } . Show that f + p = { A E X : A t p} for every sentence v . ( y ) r It, g, iff I' cm p, and in particular t m p iff km g,. Now for any sentence p not including q we associate a new sentence vm:
-
(6) t i p iff 1, pm. Hint: Assume that t , p, and let f : P S X , X a topological space. For each s E P let gs = interior of fs. Show that g +'$ = f +m$m
Part 2: Elements of Logic for any sentence II,( g +'is the extension of g defined in Exercise 8.57, while f + m is the extension off defined in this exercise). This easily leads to bm vm, hence 1 vm.A similar argument works for the converse.
Boolean Algebra
8.59. We have considered several different systems of sentential logic : two-valued,
three-valued, and intuitionistic logic. How many different systems are there altogether? Here is a "best possible" answer: Let B = (n, c, { s ) ) be a sentential language. Given any set I' G Sentg, let SI-be the intersection of all classes including I' and closed under detachment. Let 9 = {SF: r G Sentg}. Show that 191 ' = exp Xo. Hint: define qn recursively:
For each subset M of w let r M that M # N * SpM # Si-N
=
9'
{vSn: n E M ) U { 9 ) ~ + :1 n $ M ) . Show
In this chapter we give a brief introduction to the theory of Boolean algebras. As we shall see, these are algebraic structures which stand in an intimate relationship to sentential logics. They will also form a source for some of the applications of logic which we shall give later. Boolean algebras are actually most simply motivated by a reference to elementary set theory, however, as follows :
Definition 9.1. Afield of sets is a set d such that U U E U,U U X E d whenever X E d,and X u Y EU whenever X,Y Ed.We also say that d is afield of subsets of U d. Proposition 9.2. Let d be afield of sets. Then
(i) 0 E U ; (ii) i f X , Y E & then X n Y E & . We now want to consider an abstraction from the concrete notion of a ., -, 0, 1) where A is field of sets. We consider algebraic structures ( A , intended to correspond to a field of sets d,+ to u,. to n,- to -- (relative to U d),0 to the empty set 0, and 1 to U d We write down axioms on ., - ,0, 1 intended to axiomatize the concrete notions fully; later we show that in fact our axiomatization captures all the true identities among the concrete notions. Note that we treat +, ., -, 0, 1 as variables ranging over the corresponding notions in all Boolean algebras. Of course 0 and I are also used in an entirely different sense for the integers 0 and 1.
+,
+,
Definition 9.3. A Boolean algebra (BA) is a system U = ( A , + , ., - , 0, 1) such that + and . are binary operations on A , - is a unary operation on A, 0, 1 E A, and the following conditions hold for all x , y, z E A :
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
+ + + + +
(i) x y = y xandx-y = y-x; (ii) x ( y z) = ( x y) z and x . ( y - z ) = (x.y).z; (iii) x.y + y = yand(x y).y = y; y a z= ( x y)-(x (iv) x - ( y z ) = x a y x - z and x ( v ) x - - x = 0 and x - x = 1.
We define x I y iff x of U .
+ + + + + + + z); + + y = y. A is called the universe, or underlying set,
By routine checking we have Corolary 9.4. Ifdis a field of sets, then (d,u, n, N ,0, U d ) is a BA, called a Boolean set algebra of subsets of d.
u
Throughout this chapter, unless otherwise indicated, we deal with an arbitrary BA 4L as above, and with arbitrary elements x, y, z, etc. of A. Note the following proposition, which is obvious from the form of the axioms in 9.3:
+
(xvii) i f x < z and y I z, then x y I z ; (xviii) i f x I y and x I z, then x I y.2.
PROOF. For (i), we calculate: x
x.x + x x x.x = (x x)-(x x) = x.(x x) x.(x x) = (x x ) . x ( x x).x =x x =
9.3 (iii) 9.3(i) 9.3(iv) 9.3(iv) 9.3(i) 9.3 (iii) By duality we have (ii), and (iii) is immediate from ( i ) and the definition of I . To prove (iv), assume that x 5 y and y I x. Then, using the definition x = x. Condition (u) is proved similarly: of 2 and 9.3(i),y = x y = y z = z, so assume that x Iy and y _< z. Thus x y = y and y =
+ + + + + + + + + +
+
+
+
x+z=x+(y+z)=(x+y)+z =y+z=z.
+
A duality principle follows from 9.5: if we have proved a statement about
Proposition 9.6 (i) x x = x; (ii) x . x = x ; (iii) x lx ; (iv) i f x I y and y I x, then x = y; (v) i f x Iy a n d y < z, thenx IZ ; (vi) x I y i8x.y = X ; (vii) x.0 = 0 ; (viii) x . 1 = x ; 0 = x; (ix) x 1 = 1; (x) x (xi) x I y i f x - - y = 0; (xjj) x = -y i f f x + y = 1 and x.y = 0 ; (xiii) - - x = x ; (xiv) - ( x + y) = -x.-y; (xu) -(x.y) = - x + - y ; (xui) 0 1 x 5 1 ;
+
+ +
9.3(ii)
+
For (vi),assume first that x I y. Thus x y = y, so x.y = x.(x y) = x by 9.3(iii). Thus x y = y implies x . y = x. By duality the converse holds, and this establishes (vi). Condition (vii) is proved as follows:
+
all BA's, then a second dual statement, obtained from the first one by interchanging + and . and also 0 and 1 , is true. We shall not bother to make this principle more precise, since our applications of it can be justified by 9.5 directly. The following proposition summarizes the elementary arithmetic of BA's. It will be used later without specific reference to it.
+
x.0
x.(x.-x) (x-x)--x = x.-x = 0 =
9.3(v) 9.3(ii) (ii),9.3(v)
=
Condition (viii) is easy, using 9.3(v), 9.3(i), 9.3(iii): x.1
=
x.(x
+ -x)
=
( - x f x).x = x.
By duality, we obtain (ix) and ( x ) from (viii) and (vii) respectively. To prove (xi), first assume x Iy. Then by (vi), x.-y = (x.y)--y = x.(y.-y) = x.0 = 0 (using also 9.3(ii), 9.3(v), and (vii)). Now assume x.-y = 0. Then
+
+
x - y = x - y 0 = x.y x.-y = x - ( y+-y) = x . l = x
-
(ix) 9.3(iv),9.3(v),(viii)
Hence x I y by (vi). The direction in (xii) is clear from 9.3(i) and 9.3(v). Now assume x y = 1 and x - y = 0. Then
+
x
x.1
=
x.(y
+ -y)
+
= x.y x--y x.-y + 0 = x.-y y--y = ( x + y).-y = 1.-y = - y =
(viii), 9.3(v), 9.3(iv) 9.3(i), 9.3(v) 9.3(iu), 9.3(i), (viii) Now (xiii)is immediate from (xii). To prove (xiv) we also use (xii): -0
X
+ x.-y
=
+ y + -x.-y
+
+
x + ( x -x)-y + -x--y x + x . y + -x.y + -x.-y = x + - x . ( y + -y) = x + - x = x--x.- y + y.-x.-y = 0.
=
=
( x + y).-x.-y
=
1;
Part 2: Elements of Logic
Chapter 9: Boolean Algebra
Thus - ( x + y) = - x . -y by (xii).By duality we have (xu).(xvi)is immediate from (vii), (viii), (vi). To prove (xvii), assume x 5 z and y 5 z. Thus x + z = z and y + z = z. Hence x y z = x + z = z. (xviii) follows by du0 ality (note that the dual of x 5 y is y 2 x).
+ +
Now we shall consider several common algebraic notions in their special form for Boolean algebras. Many of these notions and the theorems we prove about them apply to much more general situations; see for example Part IV.
Definition 9.7. Let U = ( A , +, ., -, 0, 1) and 23 = ( B , +', .', -', O f , 1') be BA's. We say that U is a subalgebra of 23 if A G B, 0 = O f , 1 = l', and for all x , y E A, x + y = x +' y, x . y = x.'y, and - x = -'x. For any -',-'. X E B, Xis a subuniverse of 23 if 0', 1' E X and Xis closed under
+',
Thus if U is a subalgebra of 23, then A is a subuniverse of 23. Any subuniverse of 23 is the underlying set of some subalgebra of 23. A subuniverse is just a subalgebra with the structure ignored. Some useful equivalent definitions of subuniverse are given in
Proposition 9.8. Let U be a BA, X G A. Then the following conditions are equivalent: ( i ) X is a subuniverse of U; (ii) X # 0, and X is closed under + and - ; (iii) X # 0, and X is closed under . and - .
PROOF. Obviously ( i ) 3 (ii). NOWassume (ii). Then X is closed under -, since x . y = - ( - x + -y); hence (iii) holds. Assume (iii). Then X is closed under + by the dual of the argument just given. Choose x , E X. Then 0 = x,.-x, E X, and 1 = xo + -xo E X. Thus X i s a subuniverse of U. 0 Proposition 9.9. Ifd is a nonempty collection of subuniverses of a BA U, then d is a subuniverse of U.
n
The proof is trivial. Proposition 9.9 justifies the following definition (observe that A is always a subuniverse of 3):
n
Definition 9.10. If X c A, U a BA, then the set ( Y : X G Y, Y a subuniverse of U} is called the subuniverse of U generated by X. The following theorem expresses this notion in a simpler fashion. Note the similarity to 8.38.
Theorem 9.11. If X is a subset of A, then the subuniverse of 21 generated by X consists of 0 , 1 , and all elements of A of the form
PROOF. Clearly each such element is in the subuniverse of U generated by X. Thus it suffices to show that the set S of all such elements is a subuniverse of U containing X. Obviously X c S and S is closed under +. By 9.8(i) it remains only to show that S is closed under -. Let z be any element of S, as in ( 1 ) . Then
where F = Pi., ni. Here we have used a generalization of the distributive law 9.3(iv) which is easy to establish by induction on m. Thus - 2 E S , as 0 desired. The next general algebraic notions we shall consider for Boolean algebras are homomorphisms and isomorphisms:
Definition 9.12. Let U = ( A , + , ., - , 0, I ) and U' = (A', +', .', -', O f , 1') be BA's. A function f mapping A into A' is a homomorphism of U into 2' provided that fO = 0', f 1 = l', and for all x, y E A, f ( x y) = f x +'fy, f ( x . y ) = f x . 5 , and f ( - x ) = -'fx. Iff maps onto A' we say that f is a homomorphism of U onto U'. An isomorphism into is a one-one homomorphism. The BA's U and U' are isomorphic provided there is an isomorphism from U onto 5%'. A homomorphism of U into itself is called an endomorphism of 3.
+
As is usual in algebra, one is only interested in the properties of BA's up to isomorphism.
Proposition 9.13. Let U and U' be BA's, as in 9.12, and let f be a map of A into A'. Then the following conditions are equivalent; ( i ) f is a homomorphism; (ii) f ( - x ) = -'fx a n d f ( x y) = f x f ' f y for all x , Y E A; (iii) f ( - x ) = -'fx a n d f ( x . y ) = f x . 5 for all x, y E A; (iv) fO = O1,fl = l l , f ( x y) = fx+'fyforallx,y~A,andfx~'fy = 0' whenever x . y = 0.
+ +
PROOF. Obviously ( i ) a (ii). Now assume (ii), and let x, y
E
X.
A. Then
so (iii) holds. Analogously, (iii) * (ii). If (ii) holds, then f preserves -,as already proved. Furthermore, fO = f(0.-0) = f0.'-'fO = 0' and f 1 = f(l - 1 ) = f 1 +'-'fl = 1'. Hence ( i ) holds. Thus (i)-(iii) are equivalent. Obviously ( i ) * (iv). Now assume (iv);to show (ii) it suffices to show that f preserves -. We have for any x E A
+
=f ( x
+
-x) =fx +'f(-x); fx.'f(-x) = 0' by hypothesis of (iv). Thus f ( - x ) = -'fx, as desired. 0 1
where for each i, j, either yi, E X or - y j j
E
/
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
Proposition 9.14. Let U and U' be BA's, as in 9.12, and let f be a map of A into A'. Then the following conditions are equivalent: ( i ) f is an isomorphism of U onto U'; (ii) f maps A onto A', and for all x , y
E
y
+ -y---x
= -x.y
I. Hence
+ -y.xEI,
+
PROOF. Obviously ( i ) (ii). Now assume (ii). Now if f x = fy, then f x I' fy and fy s ' f x , so x I y and y I x, hence x = y. Thus f is one-one. Now we shall apply 9.13(iv). For any x, y E A we have f x I'f ( x + y) and fy I' f ( x + y), since x I x y and y I x y. Thus f x + ' f y ~ ' f ( +x y). Let f x + ' f y = fz (since f is onto A'). Then f x I' fz, so x I z. Similarly y I z , s o x + y I z . B u t f z ~ ' f ( x+ y)impliesz 5 x + y.Thusz = x + y, and hence f x + ' f y = fz = f ( x + y). Next, choose x so that f x = 0'. Then 0 I x, so f O I'fx = 0' and hence fO = 0'. Similarly f 1 = 1'. Now assume x . y = 0. Write fx-lfy = fz. Then fz I ' f x and fz I' fy, so z r x and z I y, hence z I x . y = 0, and z = 0. Thus fx-lfy = fO = 0', as desired. 0
+
Now we introduce the important notions of ideals and filters, which as we shall see, enable one to study homomorphisms within a given BA rather than between two BA's.
Definition 9.15. A subset I of U is an ideal of U if I # 0, a + b E I whenever a, b E I, and a E I whenever a 5 b E I. A subset F of U is a$lter of U iff F # 0, a.b E F whenever a, b E F, and a E F whenever a 2 b E F. Note that 0 is a member of any ideal I. In fact, since I # 0 choose b E I. Then 0 I b E I, so 0 E I. Similarly, 1 is a member of any filter. The notions of ideal and filter are dual. Later we give a more exact description of the relationship of the notions.
Proposition 9.16. Let Ibe an ideal of U. Let R = { ( x ,y) : x.- y Then R is an equivalence relation on A. Moreover,
-x.--
E
so - x R - y. To prove (ii), assume that xRy and x1Ry'. Thus x.-y y - - x E I and x'a-y' y'a-x' E I. Hence
A, x I y i f f x s ' f y .
+
+ y--x
Now we turn to (i). Assume that xRy. Thus x.-y
+ ye-
x
E
I).
( i ) i f x R y , then - x R - y ; (ii) i f x R y and x'Ryf, then ( x + xl)R(y + y'); (iii) i f x R y and x1Ry', then (x.x1)R(y.y').
(x
+ XI).-(y + y') = ( x + XI)--yo-y' Ix.-y
+
=
+ x'.-y'E
x.-ye-y'
+
+ x'--y.-y'
I
+
+
+
and hence ( x xf).- ( y y') E I. Similarly ( y y f ) - - ( x x') E I, so ( x x f ) R ( y y'). Finally, (iii) clearly follows from ( i ) and (ii). 0
+
+
Proposition 9.16 justifies the following definition.
+,
Definition 9.17. Let I be an ideal of a BA U = (A, ., -, 0, 1). Let A/I be the set of all equivalence classes under the equivalence relation R of 9.16; the equivalence class of an element a E I i s denoted by [a],, or simply [a]. Operations +', and -' on A/I are uniquely determined by the stipulation that, for all a, b 6 A, a',
+'
+
[a] [b] = [a b]; [a].'[b]= [a-b]; -'[a] = [-a].
+',
We let %/I = (A/I, .', -', [O], [ I ] ) .Let I* be the function mapping A onto AIIdefined by I*a = [a],for all a E A. U/Iis called a quotient algebra of U. The following proposition is easily established:
Proposition 9.18. If I is an ideal of a BA U, then %/I is a BA, and I * is a homomorphism from U onto %/I. The most important facts about the relationship between ideals and homomorphisms are expressed in the following theorem :
PROOF. R is reflexive on A : if x E A, then x .-x + - x - x = 0 E I. Obviously R is symmetric. R is transitive: assume that xRyRz. Thus x.-y + ye-x E I and y.-z + z . - ~ E I .Now
Theorem 9.19 (The homomorphism theorem). Let f be a homomorphismfrom a BA U onto a BA 23. Let I = { x : x E A and f x = 0). Then I is an ideal of U, and %/I is isomorphic to 23. I is called the kernel o f f . Furthermore, f is one-one z f I = (0).
y.-z + z.-y E Z , But x.y.-z 5 y.-z x.-y 5 X - - y + y.-x E I, so x . - y . - z e x - - y . - z E I. Similarly, z.-x E I, so x.-z an equivalence relation on A.
PROOF. Since f 0 = 0, we have 0 E I and hence I # 0. Suppose x , y E I. Thenf(x+y)=fx+fy=O+O=O.Thusx+y~I.Supposex~y~I. Then f x Ify = 0, so f x = 0 and hence x E I. Thus I is an ideal. Now let g = {([a], fa) : a E A). Then g is a function: if [a] = [b],then a.- b + b.- a E I, hence f ( a - - b + b.-a) = 0; since f is a homomorphism, it follows that
x . y . - z ~ I . And x - - y - - z I I. Hence x . - z = x.y.-z + 2.-x E I, i.e., xRz. Thus R is
SO
+
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
+
fb.-fa = 0, sofa.-fb = 0 = fb.-fa, hencefa 5 fb 5 fa, hence fa.-fb fa = fb. Thus g is a function mapping AII onto B. g preserves - :
And g preserves g([a]
Definition 9.24. An ideal I of U is maximal if I # A and there is no ideal J such that I c J c A. Maximal filters, usually called ultrafilters, are similarly defined.
+,
-,-, 0, l), where 0, 1, 2 ' w,~ and We let 2 = (2, operations on 2 given by the following table:
+:
+ [b]) = g[a + b] = f(a + b) = f a + fb
=
g[al
+,
a ,
- are
+ g[bl.
This completes the proof that g is an isomorphism of %/I onto 23. Iff is oneone, obviously I = (0). Conversely, if I = (0) and x # y, then x.-y -x.y # 0, so
+
0 # f(x--y
+ -x.y)
+ -fx.fy
= fx.-fy
0
and fx # fy.
It is time to tie up the notions of ideal and filter; the following proposition is easily proved:
Proposition 9.20. There is a one-one correspondence between ideals andfilters on a given BA U. In more detail, if1is an ideal of U and F is a filter of U, then: (i) (ii) (iii) (iv)
If = {x: -x Fi = {x : - x If' = I ; Fir = F.
E E
I is maximal; I # A, andforanyx, Y E A , i f x . y ~ I t h e n x ~ I o r y ~ I ; I # A, andfor any x E A, either x E I or -X E I; the algebra %/I is isomorphic to 2.
PROOF
The following proposition is also clear:
Proposition 9.21. The intersection of any nonempty family of ideals (filters) is an ideal (filter).
(i) + (ii). Assume that I is maximal, but that there are elements x, y E A with x . y E I while x $ I and y 6 I. Then the ideal generated by I u {x) is A, so by 9.23 there is a u E Isuch that 1 = u x. Similarly, there is a u E I such that 1 = u y. Hence
+
+
+ + + +
This justifies the following definition:
Definition 9.22. For any X E A, the ideal (filter) generated by Xis the ideal (filter)
n{ Y : X E Y, Y is an ideal (filter) of U). Corollary 9.23. For any X E A, the ideal generated by X is the set {y :for somefinite sequence x,, . . ., x , - ~ E X, y I x o + . . . +Xm-l), while the filter generated by X is the set E
X, xo. . . . ex, - 5 y).
Now we turn to the study of some special ideals and filters.
- .-
Proposition 9.25. For any ideal I in a BA U the following conditions are equiualent: (i) (ii) (iii) (iu)
I) is afilter of 2l; F ) is an ideal of U;
{y :for some finite sequence x,, . . ., x, -
The algebra 2 is a BA, as is easily checked. Maximal ideals are sometimes called prime ideals. It is also easy to check that maximal ideals and ultrafilters correspond to each other under the correspondence described in 9.20. The following proposition gives some useful equivalent definitions for maximal ideals.
+
+
+
1 = (u x).(v y) = u.u u - y x.u x - y Iu v x-y€I, so 1 E I. But then, since y I 1 for any y E A, A = I. This contradicts I being maximal. (ii) => (iii). Assume (ii). Now 0 = x.-x E I, SO by (ii), x E I or - x E I. (iii) 3 (iu). Assume (iii). Then [0] # [I] since I # A. For any x E I, [x] = [O] and [-XI = [I], so [O] and [I] are the only elements of %/I, by (iii). -,- are just like in 9.24, so %/I is isomorphic to 2. Clearly the tables for (iv) 3 (i). Since IAIIJ > 1, I i s proper. If J is an ideal such that I c J c A, choose x E J I. Then [0], # [x], since I # J, and [x], # [I], since J # A. Thus IAIII > 2, contradiction. 0
+,
-
There is a theorem dual to 9.25 concerning filters; we will apply it when needed. The same applies to our next theorem. Of course the dual of 9.25(iv)
..,.
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
requires a careful formulation of the notion %IF, F a filter. This is straightforward using 9.20. For example, the associated equivalence relation, is {(x, y) : x . y -x.-y E F}. Now we prove a fundamental existence theorem for maximal ideals.
+
Theorem 9.26 (Boolean prime ideal theorem). If I is a proper ideal of U (i.e., I is an ideal of U, and I # A), then there is a maximal ideal J of U such that I s J. PROOF. Let d = {J:I c J , J is a proper ideal of a}. Then d # 0, since obviously I Ed.Let be a nonempty subset of d simply ordered by inclusion. We now show that U g E d.Since 93 is a nonempty collection of ideals 2 1 , clearly U W # 0, and I s U a.Let x, Y E U 93. Say X E J E B and y E K E W. By symmetry we may assume that J G K. Then x, y E K, and since K is an ideal it follows that x + y E K and hence x + y E U 93. If x I ~ E U B ' ,say y ~ J ~ 9 Then 3 . XEJ since J is an ideal; thus X E U ~If . 1 E U W,then 1 E J E93 for some J , contradicting J proper. Thus U 99 is proper, and we have established that U 99 ~ d . We can now apply Zorn's lemma to obtain a member J of d maximal under inclusion. Clearly J is as desired. 0 The Boolean prime ideal theorem has been studied extensively from the point of view of axiomatic set theory. It is weaker than the axiom of choice (which is equivalent to Zorn's lemma), but it cannot be established on the basis of the usual axioms of set theory without choice, both statements assuming those axioms are consistent. The prime ideal theorem can be used to establish the following important result. In its proof we make a switch from working with ideals to working with filters. Ideals seem more appropriate in. pureIy algebraic contexts, as above, while filters are natural when considering matters, like here, which verge on topology; see Exercise 9.69.
+
thus f(a b) =fa u fb. It remains to show that f is one-one. Suppose x E A, x # 0. Let F = {z : z E A, x I z). Clearly F is a proper filter. By 9.26, let G be an ultrafilter such that F E G. Now x E G, so G E fx, as desired. The Boolean representation theorem shows that our axioms for BA's are complete, in the sense that the only models of these axioms are the Boolean set algebras, up to isomorphism. By this theorem, we can establish properties of arbitrary BA's by establishing them for the more special Boolean set algebras. On the other hand, we can apply ordinary algebraic constructions, some of which, like homomorphisms and quotient algebras, lead out of the class of Boolean set algebras, to establish properties of Boolean set algebras themselves. We now turn to some important notions special for Boolean algebras.
Definition 9.28. An element x E A is an atom of U if x $ 0, while for all y, 0 I y 5 x implies 0 = y or y = x. U is atomic if for every nonzero x E A there is an atom a 5 x. U is atomless if U has no atoms. In the BA of all subsets of a set X, the singletons {x} for x E X are the atoms, and this BA is atomic. An easy example of an atomless BA is the BA of subsets of the set of rational numbers generated by all half-open intervals [r, s). There are BA's which are neither atomic nor atomless. A fundamental property of atomless BA's is given in 9.48 below. With the aid of the notion of an atom we can determine all finite BA's; see 9.30.
Proposition 9.29. Everyfinite BA is atomic. PROOF. Suppose U is nonatomic. Choose a nonzero a, E A such that there i s n o a t o m a, > - . . > a, > 0, since there is no atom l a , choose a,,, E A with a, > an+l > 0. The so constructed sequence a E WAis one-one, so IAI 2 X,. 0
Theorem 9.27 (Boolean representation theorem). Every BA is isomorphic to a Boolean set algebra.
Proposition 9.30. If U is afinite BA with m atoms, then U is isomorphic to the Boolean set algebra of all subsets of m.
PROOF. Let U be a BA. Let X = {F: F is an ultrafilter of 3). It suffices to find an isomorphism f of U into the BA (SX, u , n, -, 0, X). For each a E A, let fa = { F : a E F E X). Then for any F E X and any a, b E A,
PROOF. Let a
FE~(-a) SO f(-a)
=
X
-
iff-a~Fiffa$F i f f F g f a i f f F ~ X - fa;
(by 9.25(iii))
"A enumerate all atoms of U. For each x fx
iffa + b ~ F i f f a ~ F o r b ~ (by9.25(ii)) F i f f F ~ f aor F ~ f b i f f F f~a u fb;
=
E
A, let
{i : a, I x).
Thus f maps A into the Boolean set algebra 23 of all subsets of m. Suppose i~ f(x + y), while i $ fx. Thus a, I x + y but a, $ x. Hence a,.x < a,, so a , - x = 0 since a, is an atom. Therefore a, = ai.(x + y) = a i - y I y, i.e., y) 5 fx u fy; the converse inclusion is obvious, i E fy. This proves that f(x so f(x + y) = f x u fy. Clearlyfxn f - x = 0. For any i ~ m w e h a v e a=~ a,-(x + -x) = a i . x + a,.--x, so ai.x # 0 or a,--x # 0; these two alternatives imply (since ai is an atom) a, i x or a, i - x respectively. Thus i E fx
+
fa;
F ~ f ( a +b)
E
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
o r i f(-x). ~ Hencefx u f(-x) = m,som fx = f(-x).Thusfisahomomorphism of U into 8. If x # 0, then, since U is atomic by 9.29, there is an i E m with ai x ; thus fx # 0. It follows by 9.19 that f is one-one. Finally, a,; we claim that fx = T. If i E T, obviously suppose T G m. Let x = a, I x and i E fx. NOWsuppose i E fx. Thus a, I x, so ai = CjeTai.aj. Hence there is a j E T with a,. a, # 0. Since ai and a j are both atoms, ai = a,. a j = a j il and so i = j E T, as desired. N
xi,,
PROOF. For any x E X, x 5 XX and hence u . x i u.XX. Now suppose that b is any upper bound of { x . u : x E XI. Then for any x E X, x . a 5 b and so x 5 -a b. ThusXX I -a 6, s o a . X X I b. D
+
+
The next general algebraic notion we shall consider for BA's is that of direct or Cartesian products.
Definition 9.38.
Let (21, : i E I) be a system of BA's,
Corollary 9.31. For any n E UJ the following conditions are equivalent:
for each i E I. By the product of the system ( a i : i E I) we mean the structure
(i) there is a BA of power n; (ii) n = 2" for some m.
Corollary 9.32.
If U and 8 are finite BA's,
then U g 23 if
1A /
=
1 B(.
Definition 9.33. Let 31 be a BA, X G A . The least upper bound of X, if it exists, is the unique element CX such that Vx E X (X I CX) (i.e., CX is y]. Dually, the an upper bound of X) and Vy E A [Vx E X (x y) * CX I greatest lower bound of X, if it exists, is the unique element n X such that Vx E X ( n X I x) (i.e., n X is a lower bound of X) and Vy E A [Vx E X (y I X) = > y I n x ] . Proposition 9.34.
Ui = ( A i , +i, .i, -i, Oi, 1,)
The following conditions are equivalent:
where B = i E I ) and
Pi.,
Ai
=
{f: f is a function with domain I andJ;
E
A, for all
+, ., - are defined as follows (for arbitrary f, g t B, i E I):
The members 0, 1 of B are of course given by hypothesis. If each Ui = B, we denote P,, 21, by 'B. If 1= 2, we denote Pi,, 21i by Qlox a,. Thus U, x 21, consists of all pairs ( x , y) with x t A,, y t A , , with the operations given by
(i) U is atomic; (ii) for every a E A , Z{x : x I a, x is an atom of U) exists and equals a.
PROOF (i) 3 (ii). Assume (i), and let a E A . Obviously a is an upper bound for X = {x : x I a, x is an atom of 2). Suppose that b is another upper bound for X. If a $ b, then a . - b # 0, and there is an atom x with x I a>-b. Thus x I a, so x E Xand x I b. Thus x I b.-b = 0, contradiction. Thus a I b, as desired. 0 (ii) => (i): obvious. Corollary 9.35. If U is atomic and has only finitely many atoms, then U is finite.
The following proposition is straightforward:
Proposition 9.39.
: i E I) is a system of BA's, then
Pi,, 24 is a BA.
Proposition 9.40. The BA ( S X , LJ, n, -, 0, X ) is isomorphic to X2.
PROOF. For each Y G X , let X, be the characteristic function Y , i.e., for all x E X let
Proposition 9.36. I f C X exists, then n { - x : x E X) exists and equals -C X.
PROOF. If x E X, then x I CX and hence -XX I-x. Thus -CX is a lower bound for Y = {-x : x E X). Let a be any lower bound for Y. Thus V X E X ( a I -x), s o V x ~ X ( xI -a). HenceXX I- a a n d a I-XX.
It is easily verified that
x is the desired isomorphism.
0
If we combine this proposition with the representation theorem, we obtain
Proposition 9.37. equals a.XX.
If XX
exists and a
E
A , then X{x.a : x
E
X) exists and
Corollary 9.41. Any BA can be isomorphically embedded in X2for some set X.
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
PROOF. Assume URB. If A is finite, then U z 23 by (ii) and Corollary 9.32. Hence assume A is infinite. By (ii), B is also infinite. Let a : w ~ A and b : w% B. We now define two sequences ( x i : i E w ) E " A and ( y i : i E w ) E " B by recursion so that for every m E w and every t _c m ,
This corollary shows another completeness property of our axioms for BA's. Namely, if we wish to check that an equation holds in all BA's, it is enough to check that it holds in the two-element BA 2. For, then it will also clearly hold in X2, and any subalgebra of X2, and hence by 9.41 in any BA. This gives a decision procedure for checking when equations hold in all BA's; in fact, under a natural Godel numbering the set of Godel numbers of equations holding in all BA's is recursive, indeed even elementary recursive. The decision procedure really coincides with the truth table method described for sentential logic. Another important fact about products of BA's can be expressed using the notion of relativized BA:
n
I (JJ iot xi. i ~ m t-
id
ut
n n=n JJ xi.
=
k t
A. U
n .
- ~ i ) .
i~m-t
vt
xi,
isn-t
Yi.
~ i .
ten-t
Lot
E
i
Let xo = a,, and by (iii) choose yo E B so that (U xo)R(23 yo) and (U 1 -xo)R(23 t -yo). Thus ( 1 ) holds for m = 1. Now suppose xi and yi defined for all i < n, where ( 1 ) holds for all m I n, and n L 1. For each t E n let
Definition 9.42. For any BA 21 = ( A , +, ., -, 0, 1) and any a E A we let U 1 a = ( A 1 a, +', -',-', 0, a), where
for any x , y
I (JJ ~
- xi)..
For n odd we proceed as follows. Let j be minimum such that bj $ { y , : i < n), and set y, = b,. Now let t E n. We have (U ut)R(23 r u t ) by (I), so by ( i ) and (iii) choose wt E A t ut so that [(U u,) 1 wt]R[(23t v,) f (v,.y,)] and [(U f ut) -' wt]R[(231 v,) -"(vt. y,)], where -' and -" are the minus operations in U f ut and 23 v, respectively. Thus
1 a is the relativization of 91 to a.
It is easy to check the following proposition:
z,,,
Proposition 9.43. U a is a BA. Proposition 9.44. For any a E A, ?I is isomorphic to (91 1 a) x (91 1 -a).
PROOF. For any x E A , let f x the desired isomorphism.
=
nls(,+
( x - a , x.-a). It is easily checked that f is
0
Definition 9.45. Given a product Pi,, ?Ii of BA's, and any i E I, pr, is the function mapping Pi,, Al into A, given by pr,x = xi for all x E Pier Ai. Corollary 9.46. pr, is a homornorpkismfrom
Pi,,
Ui onto 91,.
I
/C
I
I
The following lemma expresses an important property of the notion of relativization.
b
Lemma 9.47 (Vaught). Let R be a binary relatiotz between countable BA's such that the following conditions hold:
t
( i ) ifUR23, then 23RU; (ii) ifllR23, then \ A ] = JBI; (iii) if UR23 and a E A , then there is a b E B such that (U (2L - a)R(23 1 - 6). Then U
23 whenever UR23.
1 a)R(23 1 b) and
w,. We now check (1) for m = n + 1. Given where w, I u,. Set x, = any subset s of n + 1 , we take two cases. Case 1. n E S. Then we write s = t u {n), where t G n. Thus xi1, -,- X t = Ut.X n and Y1. L n + 1 )-,- Y1 = vt .Yn. Now if t ' c n and t # t ' , clearly u,. u , = 0. Hence ut .x, = w,. Hence the desired result is immediate from (2). Case 2. n $ s. Thus s E n, and x,-n,,(,+ -,- x, = us.- x,, while ~ : . n t e ( n + l ) -~ Y , = us.-yn. Clearly us.-x, = us.- w,, so again the desired conclusion follows from (2). If n is even, we proceed as above except with the roles of U and 23, a and b, x and y interchanged. Thus our sequences are defined, and ( 1 ) holds for every m E w and t c m. In particular, for any m E w and t c m, using (ii),
1
I
n,,,
n:,,
n,,,
nlEs
Now we claim if i, j <
(4)
For, let m
=
max{i, j )
w,
then xi Ix, iff y,
y,.
+ 1. By induction on n one easily shows that for every
.Ew,
I
=
2 (nx i . n
tcn
1st
isn-t
- Xi)
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
and hence
PROOF. Let Yo = X and, for m E w,
and, similarly,
It is easily checked that Urn,, Yrn= A. Furthermore, by induction on m one easily shows that I Yml I 1 XI + No for each m E W. Hence
r
y i . - y j = ~ \ n y k . n -yk:tsm,ict,jtt kot
kern-t
Thus (4) follows from (3). By induction, the following statement is easily established :
(5)
for all i E w, a, E {xo, . . ., xzi) and bi
E
{yo, . . ., yzt+1).
Combining (4) and (5), we see from 9.14 that {(xi, yi) : i E w) is the desired isomorphism. 0
Lemma 9.52. If U is a BA and f is a one-one function from A onto B, then there is a BA 23 with universe B such that f is an isomorphismfrom U onto 23.
PROOF. Let U = (A, +, ., -, 0, 1). We define the operations of 23 as follows. For any b, c E B, b
Theorem 9.48. Any two denumerable atomless BA's are isomorphic.
+' c = f(f-lb + f-lc), b . ' ~= f(felb.f-lc), -'b = f(-f -lb), 0' = f 0, 1' = f l .
PROOF. Let R = {(U, 23) : IAl = (BI = 1 or U and 23 are denumerable and atomless). The hypothesis of 9.47 is easily verified. The final algebraic notion which we shall consider for BA's is that of a free algebra: is freely generated by X provided:
Definition 9.49.
extended to a homomorphism of U into 23. If U is freely generated by X, we say that U is a free BA with free generators X. We first note that free BA's are determined up to isomorphism by their sets of free generators:
If U and 23 are each freely
generated by X, then they are
PROOF. Let f be a homomorphism from U into 23 extending Id 1 X (identity on X), and let g be a homomorphism from 8 into U extending Id 1 X. Then {a E A : gfa = a) is a subuniverse of U including X; since 91 is generated by X, this set is equal to A. Thus g of = Id 1 A. Similarly,f g = Id B. Hence 0 f is the desired isomorphism. 0
To prove the existence of free algebras we need a couple of lemmas.
Lemma 9.51.
If X generates
U,
then IA 1
I
IXI + Xo.
=
(B,
+',
a',
Of, 1'). The conclusions of the lemma are then
0
Theorem 9.53. For any nonempty set X there is a BA freely generated by X.
(i) X generates U; (ii) if 23 is any BA and f is any function mapping X into B, then f can be
Proposition 9.50. isomorphic.
Then we set 23 routine.
PROOF. Let A be any set such that IAl = (XI + No. Let I = {(B,f ) : 23 is a BA, B G A, and f is a function mapping X into B). Let E = P(B,f)oI 23. We define a function g mapping X into C by setting ( g ~ ) = ~ fx , for all x E X and (23, f ) E I. Then (1)
g is a one-one function.
For, assume that x, y E X and x # y. Now there is a BA 93 with IBI > 1 and B c A ; to see this, consider the BA 2, note that (A1 2 2, and apply 9.52. Let f be any function mapping X into B such that fx # fy. Thus (23, f ) E I, and
Thus (1) holds. Now let 9 be the subalgebra of Q generated by g*X. Let h be any one-one function with domain D such that g - l h. Finally, by 9.52 let 5 be a BA such that h is an isomorphism from 9 onto 5. We claim that 5 is the desired algebra freely generated by X. Since g*X generates 9 and the isomorphism h maps g*X onto X, clearly X generates 5. Now let k be any function mapping X into some BA Q. Let 4 be the subalgebra of Q generated by k*X. Then 9.51, I HI I I XI + Ho = (Al. Let I be any one-one function mapping H into A, and by 9.52 let R be a BA such that I is an
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
isomorphism of 4 onto 8. Note that (R, 1 0 k ) E I. Now set k + = I-' pr(a,l,s h - l ; we claim that k + is the desired extension of k . Obviously k + is a homomorphism of 5 into Q. If x E X, then 0
0
0
as desired.
We shall give another proof of 9.53 below; see Theorem 9.58 and the remark after it. This new proof will be based on the correspondence between Boolean algebras and sentential logics, to which we now turn. We shall see that there is a full correspondence between these two kinds of mathematical objects.
Definition 9.54. Let 9 be a sentential language and I? G Sent9. We let = ? = Xp,, #) : p,, 4 E Sent9 and r t-9p, ++ $1. We shall sometimes write -,, or even =, when no ambiguity is likely. The following proposition can be routinely checked.
Theorem 9.58. If 9 = (n, c, P ) is a sentential language, then %If is freely generated by { [ ( s ) ]: s E P } , and ( [ ( s ) ] : s E P ) is a one-one function. PROOF. We check the second statement first. If s, t E P and s # t, clearly F(s) o ( t ) and hence Y ( s ) o ( t ) , so [ ( s ) ] # [ ( t ) ] . By induction on sentences it is easily seen that [p,] is in the subalgebra generated by X = { [ ( s ) ]: s E P}, for each sentence p,. Thus X generates 9lf.Now let f be any function mapping X into a B A 2l. By recursion (8.6), we define a function g
for any s E P and any p,, (1)
I )E
Sent9. We now claim if t-p,, then gp,
=
1.
To prove ( I ) , let I? = {p, : p, E Sentg, gp, = 1). It is easily seen that each logical axiom is in I?. For example, to check (A3) we note
Proposition 9.55. Let 9 be a sentential language and I' G Sent9. Then for any p,, 4, cCI' E Sentg, ( i ) = is an equivalent relation on Sent9; (ii) if p, 4,then i p , = 1 4 ; (iii) if p, = 4,and p,' = #', then (p, v p,')
--
(*
A
= (+ v
#I)
and (p,
A
p,')
--
*I);
( i 4 (p, A l p , ) = (4A +I; ( 4 (p, v l p , ) = (* v -4).
Also, clearly I? is closed under detachment. Thus each logical theorem is in I?, and (1) follows. Now if kp, o +, then g(p, o 4)= 1, and hence it follows easily that gp, = g*. Thus there is a function f + mapping Mi? into A such that f + [ T I = gp, for any sentence p,. It is easily checked that f is the desired extension off. +
This proposition justifies the following definition:
Definition 9.56. Let 9 be a sentential language and I? E Sentg. We let %IT be the algebra (Sent9/ -$', + , ., - , 0 , 1) with the operations determined by the following stipulations, where p,, 11, E Sent9:
From 9.58 one easily obtains a new proof of the existence of free algebras. In fact, given any set X, there is a sentential language 9of the form (n, c, X). By 9.58, %f is freely generated by { [ ( s ) ]: s E X } , and I{[(s)]: s E X}l = 1x1. Thus by 9.52 we can easily infer that there is a BA freely generated by X. There is a natural correspondence between notions in sentential logic and notions in Boolean algebra. We give one instance of this correspondence next, and state some others in the exercises.
Proposition 9.59. Let F be a filter in a BA %Ic,and set A I? A, and %I?/F is isomorphic to %Ig. The following proposition is easy to check:
Proposition 9.57. If B is a sentential language and I? a BA.
E
Sentb, then
%IF is
=
U F.
Then
PROOF. Note first that I? is a subset of the unit element 1 of %I$'; since 1 E F, clearly I? E A. We write below [p,],, [XI,, [p,], for the equivalence classes under the equivalence relations associated with r, F, A respectively. Assume that [[v]r]F= [[#]r]F.Then [p,], [#I, - [ p , ] , - - [+I, E F. Recalling the definitions of the operations in %If?,we see that [(p, A +) v ( i p , A -I+)], E F and
+
Chapter 9: Boolean Algebra
Part 2: Elements of Logic
9.67. Every infinite BA has an infinite subset X such that if x, y E X, and x # y
hence, using an easy tautology, [p, o $1, E F. Thus p, o $ E A and s o [p,], = [$I,. Similarly [p,], = [$I, implies that [[pIrlF = [[$IrIF. Hence there is a one-one function f mapping 2llf?/F onto 2llZ such that f[[p,],lP = [ p ) I a for every sentence p,. Clearly f is the desired isomorphism. 0 The preceding two results lead t o the following theorem, which is another kind of completeness theorem for Boolean algebras. It shows that any BA is one of the algebras ZIT, u p t o isomorphism. Hence we may say that the theories of Boolean algebras and of sentential logics are equivalent, in some sense.
then x . y = 0, and an infinite subset Y such that if x, y E Y, then x Iy or y 5 x. 9.68. Without using any principle beyond Z F (set theory without the axiom of
I
9.69. For any BA U, let FU be the set X = { F : F is an ultrafilter on U), with the topology on X given by the base { { F :x E F E X ) : x E A). Then FU is a I
Theorem 9.60. Any BA is isomorphic to Cmf? for some sentential language B and some
I? c Sents.
PROOF. Let U be any BA. Let B = (n, c, A ) be a sentential language, and let f be the function such that f [ ( a ) ] = a for a E A. By 9.58, we can extend f t o a homomorphism f of 2llf onto U. Let F be the filter-kernel off +,i.e., F = {x : x E M r , f + x = 1). By the homomorphism theorem we have U isomorphic t o 2llflF. Let I? = U F. Then by 9.59, 22IflF is isomorphic t o 2llf?'. Thus U is isomorphic t o mf?, as desired.
k
+
1. Halmos, P. R. Lectures on Boolean Algebras. Princeton: van Nostrand (1963). 2. Sikorski, R. Boolean Algebras, 3rd ed. New York, Berlin: Springer (1969). EXERCISES Show that in any BA we have -(-x
+ -y + z) + -(-x + y) + - x + z = 1.
Show that there is a natural one-one correspondence between Boolean algebras and rings with identity such that x . x = x for all x. (Only the most elementary facts about rings are needed to solve this problem. Given a BAU=
There is a BA U and a nonempty subset X of A such that 0, 1 E X, and X is closed under + and ., but X is not a subuniverse of U . For each infinite cardinal m, there is a BA with exactly m elements. If U is a finitely generated BA, say generated by X, X finite, then U is finite, in fact has at most exp exp (XI elements. This bound can be attained. 9.66. There is an infinite BA with exactly 3 atoms. IAn
\
I 3
BIBLIOGRAPHY
choice) show that the following two statements are equivalent: (1) the Boolean prime ideal theorem, (2) every BA with at least two elements has a maximal ideal.
compact Hausdorff space in which the simultaneously closed and open sets form a base. FU is called the Stone space of U. In fact, { { F: x E F E X } : x E A) is the set of all closed and open sets in FU. The space FU is homomorphic to the closed subspace of *2 consisting of all homomorphisms from U into 2, with the discrete topology. 9.70. A Stone space is a compact Hausdorff space in which the closed-open sets
form a base. For any topological space X, the set of closed-open sets forms a field of sets; B X is the associated BA. Then for X a Stone space, B X is isomorphic to the BA, a subalgebra of the direct power X2, whose universe consists of all continuous functions mapping X into 2 (latter with discrete topology). Furthermore, F 6 X i s homeomorphic to X. Finally, if U is any BA, then BFU is isomorphic to U. 9.71. There is a BA U such that 2U is isomorphic to U.
1
!
9.72. For any set X, the BA associated with the product space X2 (2 discrete) is freely generated by {{ f :ft = 1) : i E X } .
(
9.73. If X generates U , then X freely generates U iff for every m E w * 1, every one-one x E mX, and every E E m2, xfi # 0, where for any. y . E A, yo = - y and y1 = y.
nI,,
9.74. Without using any principle beyond ZF, show that the following statements
are equivalent: (1) extended completeness theorem for sentential logic, (2) Boolean representation theorem. Hint: For (1) * (2) it suffices by 9.68 and the proof of the Boolean representation theorem, along with 9.60 and its proof, to show that (1) * (in any BA A'? with at least two elements there is an ultrafilter). Let A = {p, : p, a sentence of 9, [p,] = 1). Assuming > 1, show that A is consistent, and apply (1) to get a modelf. Show that F = {[p,] :f +p, = 1) is an ultrafilter in A'?. For (2) 3 (I), assume that I'is a consistent set of sentences in a sentential language 9.Let h be an isomorphism from yfi*$' onto a Boolean set algebra of subsets of a set X. Since r is consistent, X # 0. Choose xo E X, and let f be the model of B such that fs = 1 iff xo E h[<s)]. Show that f is a model of r. 9.75 (Tarski). Let U be the Boolean set algebra of recursive subsets of w . Show that a B A B is isomorphic to U iff 8 is denumerable, atomic, and for every b~ B, i f B I b is infinite then there are c, d 5 b with c . d = 0,c + d = b, and both 23 23 c and 23 d infinite. Hint: use Vaught's Lemma 9.47. 161
Chapter 10: Syntactics of First-order Languages
10
Syntactics of First-order Languages
range. Also, corresponding to each 0 E Drnn 0 an 00-ary operation on A is selected as the "meaning" of 0.Finally, corresponding to each R E Drnn W an WR-ary relation on A is chosen as the meaning of R. The logical symbols, i.e., members of Rng L, are interpreted in their intuitive senses. We shall make all of this precise in the next chapter. We will shortly define precisely the notions of term, formula (grammatical expression), etc. First let us give some examples of first-order languages. Language of equality. We let L = (w i : i E 5), v = (rn : rn E w), 0 = W = 0.This language is suitable just for expressing statements about equality alone. For example, the statement that equality is a symmetric relation is expressed by the formula
+
and the statement that the universe has at least three elements is expressed by the formula
In this chapter we give the basic definitions and results concerning the syntax of first-order languages: terms, formulas, proofs, etc. As we proceed we shall also check the effectiveness of many of the notions, although at a later stage we shall just appeal to the weak Church's thesis (see the comments preceding 3.3). This long section contains only very elementary facts, which will be used later mainly without citation. The basic definitions of syntactical notions occupy 10.1-10.18. The remainder of the chapter is concerned with elements of proof theory; this plays an important role in our discussion of decidable and undecidable theories in Part 111, but will not be used in the discussion of model theory (Part IV). The basic notion of a first-order language, with which we shall be working for most of the remainder of this book, is as follows:
Definition 10.1. A first-order language is a quadruple 9 = (L, v, 8 , g ) with the following properties : (i) L, v, 0 and W are functions such that Rng L, Rng v, Drnn 0, and Drnn W are pairwise disjoint. (ii) Drnn L = 5, and L is one-one. Lo is the negation symbol of 9,L1 the disjunction symbol of 9,L, the conjunction symbol of 9,L, the universal and L, the equality symbol of 9. quantifier of 9, (iii) Drnn v = w, and v is one-one. v, is called the ith individual variable. (iv) Rng 0 G w. For 0 E Drnn 8 , 0 is called an operation symbol of rank 0 0 ; in case 8 0 = 0, we also refer to 0 as an individual constant. (v) Rng W G w 1. For R E Drnn W, R is called a relation symbol of rank 9 R .
-
In an intended interpretation (model) of a first-order language, a certain set A is chosen as the domain or universe over which the variables vi are to
(For the meaning of some of the symbols here, see below.) Note that there are other languages which are clearly equivalent in all respects to this lan5 : rn E w), 0 = guage. For example, we might let L = ( i : i E 5), v = (rn W = 0. In general, if we have two languages 9 = (L, v, 0,W) and 9' = (L', v', Cot,) ' % 9' and there is a one-one function f from Rng L u Rng v u Drnn 0 u Drnn W onto Rng L' U Rng v' U Drnn 8' u Drnn B' such that f 0 L = L', f 0 v = v', 8' 0 f = 0, and B' 0 f = 9,then 9 and 9'are equivalent in all senses of interest to us. For this reason, we usually do not specify a language in full detail; any exact specification the reader imagines should be all right for our purposes. In particular, there is no need to specify L or v. It is enough just to indicate the number and rank of the operation and relation symbols. Language of set theory. There are no operation symbols and only one relation symbol, E, which is to be binary. The statement that the union of two sets exists is:
+
Language of rings. There are no relation symbols. The operation symbols (binary); (unary); 0 , 1 (0-ary). In this language, specific polyare: nomials with integer coefficients can be expressed. For example, the polynomial x3 3x - 1 is expressed by
-
+, .
+
Language of ordered3elds. This is like the language of rings, except that we add a binary relation symbol <. Full language of a nonempty set A . Here we have for each operation (say m-ary)fon A an m-ary operation symbol O,, and for each relation (say n-ary) R on A an rn-ary relation symbol R, on A. More precisely, let B and C be
1
Part 2: Elements of Logic two disjoint sets with a : Urn,, "*A B and /I: S("A)C. Then 9 is a language (L, 0, U , 9 ) such that Drnn U = B, Drnn 9 = C, Oaf = arity offfor each finitary operation f on A , and 9PR = arity of R for each finitary relation R on A. As we see from the last example, some of the languages we consider can have uncountably many symbols. For many of the countable languages it is of interest to consider the effectiveness of various notions to be introduced. For this purpose we make the following definition: Definition 10.2. If 9 = (L, v, 0 , 9 ) is a first-order language, then members of Drnn O U Drnn 9 are called nonlogical constants. The set Sym2 = Rng L u Rng v u Drnn O u Drnn W is the set of symbols of 9. An effectivizedfirst-order language is a quintuple 9 = (L, v, U , 9 , 9 ) such that (L, v, O , 2 ) is a first-order language and in addition the following conditions hold : (i) 9 is a one-one function mapping Symz into w; (ii) 9 0 v is recursive, Rng ( 9 0 u) is recursive, and v - I 0 9 - I is partial recursive; (iii) 9 * Drnn O is recursive and U 9 - I is partial recursive; (iv) g* Drnn 9 is recursive and 9 0 9 - I is partial recursive. 0
Most of the languages appropriate for ordinary mathematical theories can be effectivized. For example, the language of equality above which was explicitly described as a certain quadruple 9 = (L, v, 8 , 9 ) can be effectivized as 9' = (L, v, O , 9 , 9), where 9(w i) = i for each i E 5 and 9m' = m + 5 for each m E w. The Godel-numbering function 9 of 10.2 will be extended to various concepts introduced later, and the extension will always be denoted by y + . Unless otherwise indicated, the statements which follow refer to an arbitrary first-order language 9; when appropriate, to an arbitrary effectivized firstorder language 9.The following proposition is obvious.
+
Proposition 10.3. 9 * SymT is recursive. Intuitively, of course, 10.3 says that there is an automatic method for recognizing a symbol of a given effectivized first-order language. Definition 10.4. Expr2, the set of expressions of 9 , is the set of all finite sequences of symbols of 2.The empty sequence is admitted. If u =
Proposition 10.5. 8 + *Expr2 is recursive. PROOF. For any x G w , we have x E g +* ExprT iff x V i I lx((x), - 1 E ~ S*y m ~ ) .
=
Chapter 10: Syntactics of First-order Languages
Thus there is an effective method for recognizing expressions in a given effective language. Definition 10.6. We introduce some operations on expressions p,
Now we introduce analogous operations on w. For the definition of Cat, see 3.30. For m, n E w , let (i)' (ii)' (iii)' (iu)' (0)' (vi)' (vii)' (viii)'
i ' m = Cat (2YL0+l, m), m v ' n = Cat (Cat (2fL1 l, m), n), m A ' n = Cat (Cat (2fL2+l,m), n), V'mn = Cat (Cat (2yL3 l, m), n), m =' n = Cat (Cat (DL4 l, m), n), m +' n = i m v ' n, m t*' n = (m +' n) A ' (n +' m), 3'mn = i'V'm 1'n.
In addition we use
+
+
+
V,,
pi and
Ai,,
pi for the finite iterations of v and
A :
Strictly speaking, all of the operations in 10.6 are relative to 9.We might indicate this sometimes with a subscript, e.g., -19, +&. Note that, as for sentential languages, our languages do not have parentheses but yet we can use ordinary notation as in 10.6. The actual expressions of a language will rarely be written. That is, we will usually prefer to write an expression in the form Vvo(vo= v, += vl v,) for example rather than in the equal form
=
We use the boldface symbols for operations +, =, etc. on expressions to distinguish from the intuitive symbols. Note that the operations on w given in 10.6 act on Godel numbers of expressions just like the corresponding operations act onexpressions. Thus, for example,9+ -I p = i'8.+p, g+Vap = V'29"+19+p, etc. The following proposition is obvious.
I or else x > I and
0
t,h
Proposition 10.7. The operations
v ',
',V',
i ' , A
=',+',
t*',
3' are recursive.
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
-
Definition 10.8 ( i ) For 171 t w 1 we define an m-ary operation Con, on tion on t ? ~For . any x,yo, . . . , y, E w,
Also, we define Con' by primitive recursion. For any x , y
E
w
PROOF. The first statement is obvious. To prove the second, the reader should check the following statement, using 10.9. For any x t w, x t I / + *Trm iff x > 1 and there is a y < p;"' such that ( y ) , , = x and for each i I l y one of the following conditions holds:
by induc-
(1) there is an m < ( y ) ,such that ( y ) , = 2 P m + ' ; ( 2 ) there is a k < x such that k E y* Drnn 0, U y l k = 0, and ( y ) , = 2"l; (3) there exist k < x and z < p":,' such that k E I/* Drnn C, C y l k > 0 , lz = fiY-'k - 1, for each j Iz there is an \ < i such that ( z ) , = (y),, and ( y ) , = Cat ( 2 k+',Con" 2 ) . 0
w,
Con' (x, 0 ) = (x),, Con' (x, y 1) = Cat (Con' ( x ,y), (s;)~+ J.
+
Finally, we set Con" y = Con' ( x , Ix) for any x E w. ( i i ) Trm2, the collection of terms of 9, is the intersection of all classes I? of expressions such that the following conditions hold: (1) ( v , ) E ~f o r e a c h m ~ w ; ( 2 ) if 0 E Drnn 8 , say with 8 0 = m, and if #,, . . ., #,-I E r , then
<0>#0.. .#,-I
The following proposition follows directly from the definition of terms and is frequently of use. Proposition 10.11 (Induction on terms). If (v,) E r for all m E w, and (O)a,. . .urn-, E r whenever 0 E Drnn B, 60 = m , and a,, . . . , a,-, E r, then Trm E r.
~ r .
Note, with regard t o 10.8(ii), that if 0 0 = 0 , then the condition merely says that ( 0 ) E r. The number-theoretic functions in ( i ) are introduced so that the following properties of Godel numbers will hold. If y o , . . ., y,-, are expressions, m > 0 , then
Con" x
= g + ( y o .-
Proposition 10.12 (Unique readability) ( i ) Every term is nonempty. (ii) If a is a term, then either u = (0,) for some m E w, or else there exist 0 E Drnn 9,say with 8 0 = m, and 7 0 ,. . ., 7,- E Trm such that a = ( 0 ) ~. .~T , - l.. (iii) If a is a term and i < Drnn a, then (a,, . . ., a,-,) is not a term. (iv) If 0,P E Drnn 0, say 8 0 = m, lrP = n, and a E "Trm, T E "Trm, and ( 0 ) ~ O ~ ~=~( Pa ) m T , .~. . Tl , - ~ , then m = n, 0 = P, a n d o = 7.
.T,-~).
The notion of term in 10.8 is the general~zation to arbitrary first-order languages of the common mathematical notion of a polynomial. In case the first-order language is a language for rings (see above after 10.1), then we obtain exactly the ordinary notion of a polynomial with integer coefficients. The following construction property of terms is easily established. '
Proposition 10.9. An exprrssion a is a term iff there is a jnite sequence (T,, . . ., T,-,) of expression.^ with T , _ , = u such that for each i < n one of the following conditions holds: ( i ) ri = (0,) for some m E w, (ii) there is an 0 E Drnn 8 , say with 8 0 such that ri = < O ) r j O.. .T ~_ ( ~
=
m, and there are j,, . . .,j,
-
,< i
I
1
1
, I
I
There is an effective procedure for recognizing when an expression is a, term :
I
Proposition 10.10. The functions Con,, Con', and Con" are recursive. The set g + * Trm is recursive.
I
1I 1
I
PROOF. In each of the cases ( i ) and (ii), let be the collection of terms for which the des~redcondition holds, and apply 10.11. We prove (iii) by induction on Dmn a. The case Drnn a = 1 is clear by ( i ) . Now assume that Dmn > 1 and that (iii) is true for all terms T such that Drnn T < Drnn a. By (ii) we may write a = ( 0 ) ~. .~T,-,, . where 0 E Drnn I f , 8 0 = m , and T E ,Trm. If i = 0 , then 0 = (a,, . . ., a,-,) is not a term, by ( i ) . If i = 1, then (a,, . . ., a,-,) = ( 0 ) , which fails to be a term because ( 1 ) i < Drnn a implies m > 0 and ( 2 ) by ( i i ) ,for ( 0 ) to be a term we would have to have 0 0 = 0. So, assume that i > 1. Then (a,, . . ., 0,- ,) = ( 0 ) ~. .~T I.- 1 p for some j < m and some expression p whlch 1s an inltial segment of 7,. Assume that
,.
The following useful proposition follows from 10.12 purely set theoretically:
Part 2: Elements of Logic
Chapter 10: Syntactics of First-order Languages
Proposition 10.13 (Recursion on terms). Let f map Rng v into a set A, and for each 0 E Drnn 0 (say with 0 0 = m), let go map "A x "Trm into A. Then there is an h: Trm -+ A such that: (i) h(vn) = fun for all n E w; (ii) h(0)ao. - .am- = go(huo, . . . , hum- 00, . . . , a, - ,) whenever 0 E Drnn 0 , 0 0 = m, and a E "Trm.
,
(1) p, is an atomic equality formula, i.e., there are terms a and 7 with p, = a = 7; (2) p, is an atomic nonequality formula, i.e., there is an R G Drnn 92, say with WR = m, and there are a,, . . ., am-, E Trm such that p, = (R)oo.. .am-,; (3) p, = i y 4 for some formula $; (4) p, = $ v x for some formulas X; (5) p, = A x for some formulas #, X ; (6) p, = Va* for some individual variable a and some formula +. (iii) If p, is a formula and i < Drnn p,, then (p,,, . . ., p,,-,) is not a formula. (iv) for each formula p,, exactly one of (1)-(6) above holds, and the terms, formulas, etc. a, 7, 4, . . . asserted to exist are uniquely determined by p,.
,,
+
Now we can define the most important syntactical notion, that of a formula (grammatically built expression). Definition 10.14. An expression of the form a = T, where u and T are terms, is called an atomic equality formula. If R E Drnn W, say WR = m, and a,, . . ., am-, are terms, then (R)a,. . .am- is an atomic nonequality formula. These two kinds of expressions together constitute the atomic formulas. The set of formulas, Fmla, is the intersection of all sets I? of expressions such that each atomic formula is in I? and I? is closed under all the operations 1 , v , A , Va (for each individual variable a).
Proposition 10.18 (Recursion on formulas). Let f map the set of atomic formulas into a set A, let g map A x Fmla into A , h and k map 2 A x 2Fmla into A, and let I map A x Rng v x Fmla into A. Then there is an s: Fmla -+ A such that for any formulas p,, I)and any variable a, (i) sp, = fp, ifp, is atomic; (ii) s( T J ) = g(sp,, p,); (iii) s(p, v *) = h(sp,, s*, 94 4 ; (iv) s(p, A *) = k(sp,, s*, p,, *); ( 4 s(Vap,) = b , a, 94).
There is an automatic method for recognizing when an expression is a formula : Proposition 10.15. 9
+
* Fmla is recursive.
PROOF. The proposition becomes obvious after checking the following statement whose proof is based on a proposition for formulas which is entirely similar to 10.9. For any x E w, x E 9+ * Fmla iff there is a y IpG1" such that (y),, = x and for each i 5 ly one of the following conditions holds:
This takes care of the basic facts about grammar in first-order languages. Now we want to formulate precisely the basic proof-theoretic notions of logical axioms and theorems. Essentially we want to give a mathematical analysis of the intuitive notion of a proof. T o begin with, we need to define the notion of tautology in a first-order language. Intuitively speaking, a tautology is a formula which is logically valid purely on the basis of the intended meanings of 1 , v , A alone. They were discussed in detail in Chapter 8, but our treatment here is self-contained.
(1) There are u, v E ~ + Trm * such that (y), = u =' v. (2) There exist a k I xand z IpZ1" such that k E p* Drnn 92, lz = Log-lk - 1, (z)? E Trm for each j I lz, and (y), = Cat (2h+ l, Con'' z). (3) There is a j < i such that (y), = il(y),. (4) There exist j, k < i such that (y), = (y), v ' (y),. (5) There exist j, k < i such that (y), = (y), A ' (y),. (6) There exist m < (y), and j < i such that (y), = V'29"m+1(y)j. 0
Definition 10.19 (i) A truth valuation is a function f mapping Fmla into 2 with the following properties, for any formulas p,, +:
The following results are established in a fashion analogous to the corresponding results for terms : Proposition 10.16 (Induction on formulas). If I? is a set of formulas containing each atomic formula and closed under all operations 1 , v , A , Va (for each individual variable a), then Fmla G I?. Proposition 10.17 (Unique readability) (i) Every formula is nonemrty. (ii) If p, is a formula, then one of the following holds:
+,
I
I
(1) f(-p,) = 1 ifffp, = 0; (2) f(cp v +) = 1 ifffp, = 1 o r f + = 1; (3) f(p A +) = 1 ifffp, = 1 and fx = 1. (ii) A formula p, is a tautology iff fp, = 1 for every truth valuationf. (iii) An expression # occurs in an expression p, iff p, = ~ $ 0for some expressions X, 0. (iv) # is a subformuh of p, iff both # and p, are formulas and # occurs in p,.
1't
Part 2: Elements of Logic
The following lemma gives a simplified definition for the notion of a tautology: Lemma 10.20. For any formula p, the following conditions are equivalent:
(i) p, is a tautology; (ii) for a n y 5 i f f maps the set S of subformulas of p, into 2 and satisfies the following conditions; E S , then f ( 1 4 ) = 1 iff f# = 0 ; (a) for any.#, if # E S and i# (b) for any 4, X , i f #, X , # v X E S , then f(# v X ) = 1 iff ( f # = 1 or fx = 1); (4 for any #, X , if#, X , # A X E S , thenf(# A X ) = 1 z f f ( f # = 1 and fx = 1 ) ; then fp, = 1. PROOF ( i ) * (ii).Assume that p, is a tautology, and let f satisfy the hypothesis of (ii). By recursion on formulas we define a function h : Fmla -+ 2 as follows: if # is an atomic formula E S , 0 if # is an atomic formula $ S , 1 - h# for any formula #, i f h # = 1 orhx = 1 , h(# v x) = 1 if h# = hx = 0, h(# v x) = 0 A(# A x) = h#.hx, if Va# E S , h Va# = f Va# h Va# = 0 if Va# $ S.
h# h#
= f#
= h( l#)=
Clearly h is a truth valuation, so hp, = 1. Now it is easily shown by induction on formulas that
V# E Fmla (# E S
h#
= f#).
Hence fp, = 1 , as desired. (ii) => (i). Assume (ii), and, in order to show that p, is a tautology, let h be any truth valuation. Let f = h S. Clearly f satisfies the hypothesis of (ii), SO hp, = fp, = 1. 0
r
Clearly 10.20 gives an automatic method for checking whether a given formula is a tautology. We simply list out all me6bers of S , then check for each of the finitely many f: S + 2 whether the condition (ii) holds. Now we want to make this argument rigorous. Proposition 10.21. { ( p + # p+p,) , : # is a subformula o f v ) is recursive.
PROOF. Let R be the set in question. Then for any m , n E w, (m, n) E R iff m, n E ~ + Fmla * and 3x,y I n(n = Cat (Cat (x, m ) , y)). Proposition 10.22. The set of G6del numbers of tautologies is recursive.
Chapter 10: Syntactics of First-order Languages
PROOF. Let R be the relation of 10.21. Using 10.20, it is easy to check that for any m E w, m is the Godel number of a tautology iff: 3n I pL1" {n > 1 & Vp m[(p,m ) E R => 3i I ln(p = (n),)]& Vi I In[((n),,m ) E R ] & (n),, = m & Vf I plm, [ I f = In & Vi r If [ ( f ) ,= 1 or ( f ) , = 21 & Vi r If Vj r lf [ i l ( n ) ,= (n), => ((f),= 2 o ( f ) , = I ) ] & V i < l f V j 5 1fVk < If [(n), v r ( n ) , = (n), => ( ( f ) , = 2 o ( f ) , = 2 or ( f ) , = 2)] & Vi r IfVj r If Vk I I f [(n), A ' ( 4 k = (4,=> ( ( f), = 2 iff ( f ), = 2 and ( f )k = 211 * ( f l u = 211. Note here that n is used to code the set S of all subformulas of p,, if m = g+p, while f is used to code any function as in 10.20(ii). Of course, the form of the above displayed expression shows that { m : m is the Godel number of a tautology) is recursive. 0 Tautologies are by no means the only logically valid formulas in a first order language. Some additional ones are, for example, the formulas vo = vO, VvO(vO = vl) + v2 = v3, VvO[vO = v1 v i ( v 0 = v l ) ] We now want to formulate the notion of a logically valid formula, or theorem, in a general way, but still syntactically. We defer to the next section the proof of the completeness theorem, which states that the theorems are exactly the logically valid formulas. See also the next section for the rigorous definition of a logically valid formula. Delinition 10.23 ( i ) Axm9, the set of logical axioms of 9?is the set of all formulas of the following forms (where p, and # are formulas, i < w, and o and T are terms) :
( 1 ) p,, p, any tautology; (2) v v i ( ~+ #) + W v i + ~ Vvi#) ; (3) p, + Vvip,, if v, does not occur in p,; (4) 3u,(ui a), if vi does not occur in a ; (5) a = T + (p, + #)? if p, and # are atomic formulas and # is obtained from p, by replacing an occurrence of u in p, by T. (ii) Let I? be a set of formulas. Then F-Thm9, the set of all I?-theorems of 9,is the intersection of all subsets A of Fmla9 such that
=
( 1 ) I? u Axm9 E A ; (2) # E A whenever p,, p, + # E A (closure under detachment or modus ponens) ; (3) Vvip,E A whenever p, E A and i < w (closure under generalization). We write T h m 9 instead of 0-Thm2, r k9 p, instead of p, E r-Thm2, and F ~ instead Q of 0 t2 p,. Formulas e, with be, are called logical theorems. If I? I-9 cp, we call p, a (syntactical) consequence of I'. Of course when no ' in all these cases. confusion is likely we shall omit the subscript 2
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
of r , then there is an automatic method for checking when a sequence of formulas is a I?-formal proof. We now proceed to prove this rigorously.
As usual, we give an equivalent version of this closure definition of theorems : Proposition 10.24. For I? u {p) G Fmla, (t,b0, . . . ,$,, - l ) of formulas such that the following conditions holds:
r I- cp
z j f there is a jinite sequence
Definition 10.26. We extend 9 and 9+further to finite sequences of expressions. If p = (p,, . . ., pm-l) is a finite sequence of expressions, let
+, -, = cp and for each i < m one of
(i) $, E Axm, (ii) 4, E r , (iii) 3j, k < i such that = $, + $(, (iv) 3 j < i 3k E w (+, = VV,$,).
Proposition 10.27. Let I? be a set of formulas such that g + * r is recursive. Then g (r-Prf) is recursive.
A sequence of the sort described in 10.24 is called a formalproof of p from
PROOF. For any x E w we have: x ~ g+*(I?-Prf) + iff x > 1 and for every i I lx one of the following conditions holds:
+,
I?, or a r-formalproof of cp. We denote by r-Prf the set of all r-proofs. This is our rigorous formulation of the intuitive potion of a proof. In fact, as stated in the introduction, we consider mathematics itself to be formalized on the basis of set theory. More precisely, mathematical language can be identified with a certain definitional expansion of the language of set theory describing following 10.1. The axioms of mathematics are just the usual axioms for set theory together with definitions of all the defined symbols. It is our conviction that any mathematical proof can be expanded, somewhat routinely, to eventually reach the form of a formal proof from I? in the above sense. Of course, this conviction is another instance, like the weak Church's thesis (see the comments following 3.1), of a judgement of applied mathematics that is not subject to a rigorous proof. We are just stating that our rigorous notion of proof is a fully adequate mathematical version of the mathematical proofs actually found in articles and books. It is clear that there is an effective method for recognizing when an expression is a logical axiom. More rigorously, we have the following theorem : Proposition 10.25. g
+
* Axm is recursive.
* iff one of the following conditions PROOF. For any x E w , x ~ g +Axm holds : (1) x is the Godel number of a tautology; (2) 3y, z, w I x[y, z E ~ * Fmla + and w E Rng ( g o v) and X = v'2W y y +' z) (v'2W ly v12'"+lz)] ; (3) 3y,z 5 x [ y ~ g + * F m l a a n d z ~ R n g ( ~ o v ) a n d - , 3 uI , wy y = Cat (Cat (u, 2"+I), w) and x = y +' V'2z+ly]; (4) 3 y , z I x [ y ~ g + * T r m a n d z ~ R n g ( g o v ) a n~d3 u w, I y y = Cat (Cat (u, 2"+l), w) and x = 3'2"+l(2"+l =' y)]; ( 5 ) 3s, t, y, z I x[s, t ~ g +Trm * and y and z are Godel numbers of atomic formulas and 3m, n Iy[y = Cat (Cat (m, s), n) and z = Cat (Cat (m, t), n)] 0 and x = (s =' t ) +' (y +' z)]. +
+I
+
+I
Since there is an automatic method for recognizing logical axioms, it is clear from 10.24that if there is an automatic method for recognizing members
+
+
From this proof we also obviously obtain: Proposition 10.28. I f r is a set of formulas such that y + * r is recursively enumerable, then 9 + *(r-Prf) is recursively enumerable. +
The following easy consequence of this proposition is one of the most important results of elementary logic.
I I
, I
I
'
1 i
b
1 %
i
! ;
Theorem 10.29. Let I' be a set of formulas such that 9 + * r is recursively enumerable. Then g + *(F-Thm) is recursively enumerable. PROOF. For any x (Y~Y= XI.
E w,
we have x EB+*(I?-Thm) iff 3y[y E B ++*(I?-Prf) and
0
An intuitive proof of Theorem 10.29 runs as follows. We assume that r can be listed by some effective procedure A . Let B be an effective procedure which lists all formulas. Now we describe an effective procedure C listing all I?-theorems. We start the procedures A and B going simultaneously. At the kth stage of the procedure C , having accomplished the kth stage of both A and B, we list out all sequences of length I k of formulas already produced by B. For each such sequence p, we check whether it is a F-proof using for members of I? only the formulas already produced by A . For each sequence p for which the answer is affirmative, procedure C produces as an output the last term of p. Clearly the procedure C so described generates precisely the I?-theorems. It is quite possible in 10.29 to have 8+*(I'-Thm) nonrecursive; this is in fact the defining characteristic of the undecidable theories which will be discussed extensively in Part 111.
Part 2: Elements of Logic
Chapter 10: Syntactics of First-order Languages
Most of the remainder of this chapter is devoted to establishing elementary results about the relation t defined in 10.23. Some high points of this development, which is rather tedious because of our economical system of axioms, are as follows: a formal expression of the principle of substitution of equals for equals, 10.49; the principle for changing bound variables, 10.59; universal specification-dropping a universal quantifier, 10.61; substitutivity of equivalent formulas, 10.71; prenex normal form theorem, 10.81; provability for sentences alone, 10.85; and the notion of consistency, 10.89-10.93. Proposition 10.30. For any m E w, if a E "Rng v and p, and then
+ are formulas,
PROOF. We proceed by induction on m. The case m = 0 is trivial, since (p, -+ +) + (p, + 4) is a tautology. Now assume the result for m, and suppose that p, E +' Rng v. Then
We prove (1) by induction on n. The case n = 0 is trivial. Suppose true for n, F t' Vao. . .Vanp,, F t' Vao. . .Van(p,+ +). Now and I? t1Va0.. .Van-1 Van(p,+ +), so by the induction hypothesis, r tfVa0.. Van- l(Vanp, +Van+). By the induction hypothesis again, F 1' Va, . . .Van+,as desired, hence F-Thm G A. In particular (taking m = 0 in the definition of A), r I- p, a r In the following proposition we summarize some simple properties of t which will be used frequently without citation.
+
Proposition 10.33. Let r , A E Fmla and p, E Fmla. Then (i) if r E A and 'I t p,, then A k v; (ii) if F t v, then O t p,for some finite subset O of F ; (iii) if I? t Xfor e a c h x E A a n d A tp,, then I? tp,; (iv) if r t p, and I? t p, + 4, then I' t
+.
by the induction hypothesis. Generalizing on a,, noticing an instance of the axioms 10.23(2), and applying detachment, we get
Now by another instance of 10.23(2), a tautology, and detachment, we get 1. our desired result for m 0
+
In what follows, a, fi will denote arbitrary variables, o, T, p will denote arbitrary terms, and p,, 4, x arbitrary formulas. Proposition 10.34. to
PROOF. Let
Related to 10.30 is the following important theorem, to the effect that there is a version of t not involving the rule of generalization:
+
Theorem 10.32. F k p, if I? t' p,.
PROOF. F-Thm clearly satisfies the conditions 10.31(i) and 10.31(ii). Hence r-Thm' G r-Thm, i.e., r t' p, a I? t p. To prove the converse, let
be a variable not occurring in o. Then
ta=o+(a=u+o=o) by 10.23(5) I-T(u= u ) + -(a= 0) by a tautology, detachment tVa[ -(a = a) + -(a = o)] generalization 10.23(2), detachment tVa 7 (a = U)+Va i (a = a) t ~ ( =a o) +Va 1(a = o) 10.23(3) t l ( o = a) +Va 7 (a = a) tautology, etc. t3a(a = o) + o = a tautology, etc. to o using 10.23(4)
Definition 10.31. Let I? G Fmlap. We let F-Thm' be the intersection of all sets A G Fmla2 satisfying the following conditions: (i) i f p , ~ A x m ~F,UmEw, and a E m R n g v ,t h e n V a , . . . V c ~ ~ - ~ p , ~ A ; (ii) E A whenever p,, p, + E A. We write Thmh instead of 0-Thm;P, F t> p instead of p, E F-Thm>, and t>p, instead of 0 t&p,.
+
a
= o.
=
Proposition 10.35. to = T -+ T = a.
PROOF. ~u=T+((z=u+T=u) ~ ~ = T + T = u
Obviously Axm u F c A and A is closed under generalization. To show that A is closed under detachment it is clearly sufficient to establish
10.23(5) using a tautology
Proposition 10.36. to = T + (T = p + o = p].
t~=u+(~=p+o=p) to = T + (T = p + o = p)
10.23(5) using 10.35 and a tautology
Chapter 10: Syntactics o f First-order Languages
Part 2 : Elements o f Logic Lemma 10.37. If 0 is an operation symbol of rank m , i < m , a,, . . ., a, are terms, and T is a term, then
,
Before returning t o proof-theoretic matters concerning these notions, we as usual want t o briefly discuss the effectivity o f the notions. It is, in fact, obvious that there is an effectiveprocedure for recognizing i f a certain variable occurs bound or free at a given place in a formula. The following three propositions give a rigorous formulation o f this fact.
tai = 7 + OuO..-om-l = PROOF. The following formula is an instance o f 10.23: ai=7+ (Ou,.
- .U,-l
=
O~O"'um-l+O~O --a,-1 .
Proposition 10.42. Let R = {(m,i, x, y) : m = ga for some variable a, x = g + p and y = 8+#for some formulas p,, #, i < Drnn p,, and V is a quant$er on a at the ith place in p, with scope $1. Then R is recursive.
= 0a0"'ai-17a*+1"'am-l).
Hence 10.34 and a suitable tautology give the desired result.
0
PROOF. ( m , i , x , y ) ~ R i f f m ~ R n g ( g o u ) a n d yx ~ , g+*FmlaandiIlx 1 and ( x ) ~ +=, m + 1 and i + ly I lx and V j I and (x), = g L , b [ ( ~ )=r (x)i+jI. 0
Using this lemma, we give our first form o f the principle o f substitution o f equals for equals:
+
Theorem 10.38. If 0 is an operation symbol of rank m , and a,, . . ., a,-,, TO,. . ., 7,-, are terms, then
toi = T i + 0 7 , . .
.7i-la,ai+1.. .a,-1
= OTO..
.TiUi+l..
Proposition 10.43. Let S = {(m,k , x ) : m = ga for some variable a, x = g+p,for some formula p, k < Drnn p,, and a occurs bound at the kth place of p,}. Then S is recursive.
PROOF. ( m , k , x ) ~ S i f f m ~ R n g ( g ~ v ) , x ~ ~ + * F r n l a , k I l x , ( x ) , = m + 1 and 3 I lx 3 y I x [ y ~ g +Fmla, * i < k I i + ly, and (m, i, x, y) E R ] , where R is as in 10.42. 0
-am-l.
Hence 10.36 and an easy but long tautology give the desired result.
0
Lemma 10.39. If t u = T + (p, + +) and a E Rng v does not occur in a or in T , then t o = 7 + (Vap,+Va$).
Proposition 10.44. Let T = {(m,k , x ) : m = ga for some variable a, x = 9 +p, for some formula p,, k < Drnn p,, and a occurs free at the kth place of p,). Then T is recursive.
PROOF.
PROOF. (m, k , x ) E T i f fm E Rng (9 v), x and (m, k , x ) $ S , where S is as in 10.43. 0
=
t a 7 + (p, + I)) tVa(a 7 ) -+ Va(p,+ #) ta = r+Va(a = 7 ) t a = 7 + (Vap,+ Va*)
=
hypothesis generalization, 10.23(2) 10.23(3) using 10.23(2) and a tautology
E
g + * Fmla, k I lx, ( x ) , = m
+ 1, 0
The following proposition is analogous t o 10.40, and is proved similarly:
Ci
Proposition 10.45. Let p, = (vo, . . ., p,, - be a formula, and suppose that i < m. If pi E Drnn 8 u Rng v, then there is a unique j such that i < j I m - 1 and (p,, . . .,p,,) is a term.
T o proceed further, we must introduce the basic notions o f free and bound occurrences o f variables in formulas. The definitions are based on the following Proposition, which is easily proved by induction on p,, using 10.17.
W e now extend the notion o f free variable t o terms: Proposition 10.40. Let p, = (p,,, . . ., p,,-,) be a formula, and suppose that i < m. I f y i E Rng L , then there is a unique j such that i < j I m - 1 and ( y i , . . ., v j ) is a formula. Definition 10.41. Let p, = (p,,, . . ., p,,-,) be a formula, and let i < m. W e say that V is a quantijier on a at the ith place in p, with scope 4 i f vi = LS, p,i+l = a, and # = (q,,. . ., y j ) is the unique formula given by 10.40. A variable o occurs bound at the kth place of p, i f vk = a and there exist i, j < m such that V is a quantifier on a at the ith place in p, with scope
Definition 10.46. A term a occursfree at the ith place in p, provided there is a j with i I j < Drnn p such that a = ( y i , . . ., v j ) and for any k , i f i I k I j and a variable a occurs at the kth place in p,, then a occurs free at that place in p,. k 1
This notion, too, is effective:
L
,
Proposition 10.47. Let U = {(x,i, y ) : x = p+o for some term a, y = g+p, for some formula p,, i < Drnn p,, and a occurs free at the ith place in v). Then U is recursive.
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
This definition contains a hidden assumption, easily established, that the indicated substitutions always convert a formula into another formula. Note that we do not insist that the substitutions be what is sometimes calledproper: it may be that some of the substituted occurrences of a in Subf,"p, do not occur free in Subfgp,. For example, Subf,"VP(a = ,8) = V/3(/3 = P). Clearly the formation of Subfgp, is an effective procedure starting from a, a, and p. Formally :
PROOF. (x,i, y ) U~ iff x E B + * T r m , y ~ g + * F m l a ,i I ly, and 3 j I ly[i I j and Vk I j[i I k 3 (y), = (x),-,] and Vk I j(i I k and (x), E 0 Rng (B V) * ((x),, k, y) E T)], where T is as in 10.44. 0
Now we return to proof-theoretic matters, still aiming toward our main theorem on substitution of equals for equals. Lemma 10.48. If p, and # are formulas, and # is obtainedfrom p, by replacing one free occurrence of o in p, by a free occurrence of T in #, then ta = T -+ (9'
Proposition 10.52. If m is the Godel number of a variable a, x is the Godel number of a term o, and y is the Godel number of a formula p,, let f(m, x, y) be the Godel number of Subfgp,; otherwise, let f(m, x, y) = 0. Then f is recursive.
$1.
PROOF. We proceed by induction on p. For p, atomic,
Hence by 10.35 we have The induction steps from p, to i v , p, and # to p, v #, and p, and # to p, A # are all trivial, using suitable tautologies. Now suppose that our result holds for p,, a is a variable, and Va# is obtained from Vap, by replacing one free , a free occurrence of T in Va#. Then a does not occurrence of u in V U ~by occur in o or in T, and # is obtained from p, by replacing one free occurrence of o in p, by a free occurrence of T in #. Hence
to= r-+(p,o#) induction hypothesis to = T -+ (Vap, o Va#) 10.39, suitable tautologies
+
This completes the proof. Theorem 10.49 (Substitution of equals for equals). gp,and # are formulas, and # is obtained from p, by replacing zero or more free occurrences of o in p, by free occurrences of T in #, then to = T -+ (p, o #). This theorem is obtained from 10.48 by induction on the number of free occurrences of u in p, which are replaced to obtain #. Corollary 10.50. If p and 6 are terms, and 6 is obtained from p by replacing zero or more occurrences of a in p by T, then to = T + p = 6. PROOF. By 10.49, to follows by 10.34.
=
T
+ (p = p w p
= t). Hence
PROOF. We will indicate a simple procedure for obtaining Subfgp, which makes the effectiveness very clear. First, it is clearly an effective matter to take the first free occurrence of a in p, (if any) and replace it by o. Formally, for any m, x, y E w we define a function f ' by considering two cases: Case 1: m = 9 a for some variable a, x = 8 + o for some term a, y = 9+p, for some formula p,, and a occurs freely in p,. Let # be obtained from p, by replacing the first free occurrence of a in p, by o, and set f'(m, x, y) = 9 + # . Case 2: Case 1 does not hold. Let fl(m, x, y) = y. This function f ' is recursive, since for any m, x, y E w we have fl(m, x, y) = pz{(m E Rng(g 0 u) & x E ~ +Trm * & y E ~ +Fmla * & 3i I ly{(m, i, y) E T & V j < i[(m, j, y) 4 TI & 34, w I y[lu = i - 1 & y = Cat (Cat (u, 2"), w) & z = Cat (Cat (u, x), w])) or [(m 4 Rng ( 9 0 v) or x 4 9 * Trm or y 4 g +* Fmla or Vi I ly[(m, i, y) 4 TI) and z = y]). where T is as in 10.44. Thus f' is recursive. Second, we obtain f from f ' in a certain way. Unfortunately, we cannot obtain fjust by iterating f ', in general. The reason is that cc may occur in o; then iterating f ' would not only not give the desired result but would give longer and longer formulas. We can circumvent this difficulty by first replacing all free occurrences of a by a new variable /3, and then replacing each free occurrence of P by o; both of these procedures can be obtained by iterating f '. We obtain a suitable /? by a function f : f"(m,x, y) = p z { z ~ R n g ( ~ o v ) & zm# & V i IIx [z Z (xhl & Vi -< ~Y[Z Z (Y),]). Now we iterate f ' to replace a by 8 :
the desired result
0
I
frn(m,x, Y, 0)
=
Y,
f "(m, x, Y, n + 1) = f '(m, f"(%
x, Y),f "(m, x, Y, n));
+ 1). Finally,
We now introduce another important notion connected with the notion of free occurrence of a va.riable.
and set fiv(m, x, y) replace /3 by o:
Definition 10.51. For any variable a, term a, and formula p,, let Subfzp, be the formula obtained from p, by replacing every free occurrence of a in F by o-
f"(m, x, Y, 0) = fiV(m,x, Y), f"(m, x, Y, n + 1) = ff(f"(m, x, Y), x,f"(m, x, Y , n)). Clearly then f(m, x, y) = f"(m, x, y, Ifiv(m, x , y) + 1).
= f"(m,
x, y, ly
we again iterate f ' to
0
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
Lemma 10.58. If a occurs bound in p,, tlzen there is a formula Va# wlziclz occurs in p, such that a does not occur bound in #.
Important properties of Subfzp, will be given shortly. At the moment we need this notion only to establish an important theorem allowing change of bound variables, for which we need several lemmas. The first two are special cases of important results which will be established later.
Theorem 10.59 (Change of bound variables). kg, t,Subbgg,.
Lemma 10.53. If a is a variable whiclz does not occur b o u ~ din g, and does not occur in a, and if no free occurrence of a in a, is witlzin tlw scope of a quant$er on a variable occurring in o, then I-Vwg, 4 Subf zp.
=
a + (p, -+ Subfzp,) I-p, + ( i S u b f zp, +- i a
= o)
tVap, -+ (VU i Subfzg, + Va 1 a = a) I- i V a i a u + (Yap, + i V u i Subfzp,) tiVa i a = o I-Vap, -+ i V a i Subfzp, t iSubfap, -+ Va 1Subfzp, FVap, + Subfzp,
=
10.49 suitable tautology using 10.23(2) suitable tautology 10.23(4)
(3)
kx o Subbgx. Now clearly Subb;fp, can be obtained from Subb;x by replacing an occurrence of Vy Subf;# in S u b b ; ~by V/3 Subf,"#. Thus by 10.54 it suffices to show
Lemma 10.55. If a and /3 are distinct variables, a does not occur bound in g,, and /3 does not occur in g, at all, then kVug, o V/3 Subfgg,. I-Vwp,-+ Subfgp, tV/3 Vap, + V/3 Subfgp, I-Vap, + Vu Vwp, tVap + Vp Subfgp,
10.53 using 10.23(2) 10.23(3)
Now we can apply the result just obtained to /3, a, Subfgp, instead of a , /3, g, and obtain tV/3 Subfgg, + Vu Subf; Subftg,. Since Subfi Subfgg, = g,, the desired theorem follows. 0 Definition 10.56. By Subbgg, we mean the formula obtained from g, by replacing each bound occurrence of a in g, by /3.
In fact, y # 13, y does not occur bound in Subf:#, and ,B does not occur in Subf:# at all; furthermore, Subfi, Subf:# = Subf;#. Thus 10.55 yields (4), and the proof is complete. 0
, I
,
! I
Again one should check that Subbgp, is really always again a formula. The formation of Subb$p, from p, is clearly effective. The following proposition is established analogously to 10.52. Proposition 10.57. I f tn is t l ~ cGorlc.1 tiu11zh~rof a uariablc cc, s ic. the Godel number of a cariable p, and y is the Giicld nuniber of a fornzula p,, let /z(nz, X, y ) be thc Godel number of SubbgF; otlzerwise, let h(m, X , y ) = 0. Then 11 is recur.sive.
v, then
Now /3 does not occur in x, and x has fewer than m bound occurrences of a. Hence by the induction assumption,
x in g, 0
PROOF. Induction on p,.
does not occur in
t-Va# o Vy Subf ;#. (1) Now let x be obtained from p, by replacing an occurrence of Va# in p, by Vy Subf;$. Then by ( I ) and 10.54 we have
10.23(3) suitable tautology [7
Lemma 10.54. If # is obtained from p, by replacing an occurrence of by 0, and if kx o 8, then kp, t,$.
Ifp
PROOF. We proceed by induction on the number m of bound occurrences of a in p,. If m = 0, the desired conclusion is trivial. We now assume that m > 0, and that our result is known for all formulas with fewer than nz bound occurrences of a. By Lemma 10.58, let VU# be a formula occurring in p, such that a does not occur bound in 4.Let y be a variable not occurring in p, (hence not in #) with y Z a, p. Then by 10.55 we have
PROOF Fa
0
PROOF. Induction on p,.
The restriction on /3 in 10.59 is necessary, as one sees intuitively by the example g, = 3a 7 a = /3 with a # /3. Here Subbgg, = 3P 1 3j = /3, and + Subbgp, is obviously not a valid formula, so lip, + Subb$g,. This can be rigorously established after we have rntroduced the notion of truth (see 11.50). We now turn to properties of Subfzg,. The rnam result, 10.61, removes unnecessary hypotheses from 10.53. Lemma 10.60. If tlir ~'ariablr~ w doloc..r riot occur in a, anti i f no j k occurrcncc of a in p, is ~ ~ i t l ltlw i n scope of a yuantific~rolz a cariublc occurring in o, tl~cw Nap, -t Subf Zp,. PROOF. Let b ,' be a variable not occurring in g,, not occurring in different from a . Then by change of bound variables, tp, o Subb&.
a,
and
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
For the other direction, let fl be a variable not occurring in p,. Then by change of bound variable,
Hence using 10.23(2) we infer that I-Vup,o Va Subbzp,.
(1)
Now
u
(2)
does not occur bound in Subb,"p,, so by 10.53 we see that
tg, o Subbgy.
Hence using 10.23(2) we obtain Now
a
tVa Subb;fp + Vcry,
(3)
does not occur at all in Subf; Subb,"p,,and clearly
and by 10.23(3) we obtain
Subbg Subfz Subbzp, = Subfzp,,
(3)
From (1)-(4) the desired conclusion easily follows.
tSubf; Subb,"p,t,Subf&.
Proposition 10.64. If the variable a does not occurfree in p,, then tVa(p, +4)+(p, Va*)
Conditions (I), (2), (3) immediately yield the desired result.
' -
Theorem 10.61 (Universal specification). If no free occurrence in p, of the variable a is within the scope of a quantifier on a variable occurring in a, then kVup, +- Subf;p,. PROOF. Let Then
tSubbZp, +Vcr Subbzp,.
(4)
so by change of bound variable,
PROOF. tp, o V q by 10.63; hence use 10.23(2). Proposition 10.65. tVcrV/3p,+ VPVap,.
/3 be a variable not occurring in p, or in a, and distinct from a.
tvavgp, +- p, tVap, +- Subf $9 tVp Vap, + V/3 Subf '& tVap, +V/3 Vap,
10.60 using 10.23(2) 10.23(3)
Now no free occurrence of /3 in Subfzp, is within the scope of a quantifier on a variable occurring in a. Clearly also Subft Subfzp, = Subfzp,. Hence by 10.60
Conditions (I), (2), (3) immediately yield the desired result.
U
Theorem 10.61 gives the most important property of Subfzp,. This property is frequently taken as one of the axiom schemas for derivability. Again, the hypothesis on a is necessary, as is seen by the example p, = 33 -I (a = /3); Vap, + Subf;p, is not logically valid. We say here that a clash of bound variables has occurred. We now give some important corollaries of 10.61.
PROOF. By 10.62,
similarly
The desired result now follows easily by symmetry.
0
The following proposition is easily established. Proposition 10.66 ( i ) 1-Map, o 3ct -I p, (ii) kva i p, o igap, (iii) tVap, o 1 3 a 1 p, Corollary 10.67. If no free occurrence of a in p, is within the scope of a quantij?er on a variable occurring in o, then tSubf zp, +- 3av. PROOF tVa i p, + Subfg Bubf zp, + gap,
Corollary 10.62. tVap, + p,. Corollary 10.63. If thr variable u does not occur free in p,, then tp, t,Vap,.
10.62 (twice) 10.23(2) 10.63
tVaVcrV/3p,+- Vap, tVaV& += VaVaV/3p, tVaVfip,+ Vap, I-VaVpp, += V/3Vap,
Corollary 10.68.
tp, + 3av.
Corollary 10.69. tVap, + gap,. Proposition 10.70. k3aV& -+ VPgap,.
1 p,
universal specification suitable tautology
Part 2 : Elements of Logic
Chapter 10: Syntactics of First-order Languages
PROOF t p + 3a:p Pf/3p+V/33av t iV,63a:p + i V & t lV/33ap + V a 1 V/3p t3a:Vj?p+ V,63ap
The purpose of first forming $ is to eliminate any possible clash of bound variables. The following two corollaries give the essential properties of this notation.
10.68 10.23(2) tautology 10.23(2), 10.64 tautology
Corollary 10.74.
kp(oo,. . ., a,- ,) + 3vo. .3u,- IT.
The formula V/33ap + 3aV/3p is not, in general, valid. The following important syntactical theorem is a version for formulas of the principle of substitution of equals for equals:
Both of these corollaries are immediate consequences of earlier results, upon noticing that simultaneous substitution can be obtained by iterated ordinary substitution; in the notation of 10.72,
Theorem 10.71 (Substitutivity of equivalence). Let p, $, x be formulas and a: E mRngv. Suppose that if/3 occurs free in p or in $ but bound in x then /3 E {ai : i < m}. Let 8 be obtained from x by replacing zero or more occurrences of p in x by $. Then
This fact is also useful in checking formally that this substitution notion is effective :
PROOF. We proceed by induction on x. We may assume that 6' # X . If x is atomic, then x = p and $ = 8; this case is trivial. Suppose x is i x ' . Then 6' is of the form TO', and the induction hypothesis easily gives the desired result. The induction steps involving v and A are similar. Now suppose y, = V/3xf.Then by the induction hypothesis,
Note that ,6 does not occur free in Vao.. .Va:m-l(po $). Hence, using 10.61, we easily obtain
as desired.
0
Again note that implicit in 10.71 is the assertion that the expression 8 formed from x is again a formula; this is easily established. Now we introduce a notation which will be frequently used in the remainder of this book.
Proposition 10.75. If x is the Glidel number of a formula p, m E w , yo,. . ., ym-, are Glidel numbers of terms uo,. . ., am-, respectively, let s(x, yo, . . ., ym- ,) = p(ao, . . ., am- ,); if x and yo, . . ., ym- do not satisfy these conditions, let s(x, yo,. . ., y,-,) = 0. Then s is recursive. +
PROOF.First we need a function picking out the integer k described in 10.72. For any x, yo, . . ., y,-, E w , let
+
g(x, yo,. . ., y,-,) = pk[(3i I lx{((x),= p k 1) or V j , m3i I lyj[(yj),= p k 11) and Vi I lx[(x),A 1 E Rng(B 0 v) * ~ - l ~ - l ( ( x )1 ~) I k ] and A j < m Vi I lyj[(yj)t A 1 E Rng (9 o V )* ~ - l y - l ( ( y j ) i 1) I kl) or (Vi I lx[(x), 1 $ Rng (g v) and A,, ,Vi I l ~ j [ ( ~Aj ) 1i $ Rng (9o ")I)].
+
-
0
Now let f be the function of 10.52, let f ' be the function of 10.57, and let S be the relation of 10.43. We now define a function f" which codes the set of variables which occur bound in p but also occur in some u,:
f"(x, zo, . . ., z,- ,) = py((y),, = 1 and Vi I ly(3j I lx[((y),,j, x ) E S ] A V,,, 3u 2 zj 3w I zj[zj= Cat (u, Cat (2"" l,, w))])and Qj I Ix Vk I x{(k,j, x ) E S and V n <3u , I zn 3w I zn[zn= Cat (u, Cat (2k+1,w))] 2 3 i < ly[(y), = k ] } and Vi, j < ly[i < j 3 v-l 9 ( ~ ) < i v-lf-l(~)jl). +
Definition 10.72. Let p be a formula, m E w , o 6 "Trm. Choose k maximum such that vk occurs in p or in uj for some j < m, k = 0 if no variable occurs in p or in any ui. Let a,, . . . , orn- , be a list of all variables which occur bound in p but also occur in some u j , with a. < . . . < a:,-, in the natural order v,, v,, . . . of the variables. Let I) be the formula
and let p(u0, . . ., be the formula obtained from I) by simultaneously replacing all free occurrences of vO,. . ., urn-,by oo, . . . , om-, respectively.
Next we define a function f'"yielding the formula $ of 10.72, via an auxiliary function f":
Part 2: Elements of Logic
Chapter 10: Syntactics of First-order Languages
and
f f v ( x , YO,.. ., Ym-1)
= frn(x0, YO,.. ., Ym-1,
Definition 10.80. A formula p, is quantifier-free if L, does not occur in it. A formula is in prenex normal form provided there is an m E w , a Q E "{V, 31, an a E mRngv, and a quantifier-free formula p, such that
+
I f l ( ~ ,YO,. . ., Ym-1)).
We then define a function s' using the fact stated after 10.74: The formula p, is called the matrix of of *.
#; Qoa,. . .Qm-
is the prefix
Theorem 10.81 (Prenex normal form theorem). For any formula p, there is a formula y4 in prenex normal form such that I-p, t,4, and such that a variable occurs free in p, if it occurs free in #. The desired function s is obtained from s' by a simple and obvious definition 0 by cases.
;
PROOF. By induction on p,. The only difficult step is the passage from p,, and 9, to vl v p , ~(or to A v2).Since these cases are symmetric, we deal only with the first. Thus assume, with obvious notation,
Our next main result 10.81 concerns prenex normal form.
Lemma 10.76. If
a
does not occur free in #, then FVap, v $ t,Va(p, v
4). ;i
By change of bound variable we may assume that none of a,, . . ., am-, occur and that none of Po, . . .,fin_, occur in Qoao.. . in QbPo-. .Qk- IfinQm-lam-l+l. Thus by 10.76 and 10.78,
Definition 10.82. p, is a sentence, in symbols p, E Sent2, if no variable occurs free in p,. Intuitively speaking, only sentences express complete statements. A formula with free variables has no definite meaning until values are assigned to the free variables. Obviously the notion of sentence is effective:
Now (I) and (2) give the desired conclusion. The proof of the following lemma is just like that for 10.76.
Lemma 10.77. If
a
does not occur free in $, then Nap,
Lemma 10.78. If
a
does not occur free in
A
# t,Va(p
4,then t3aT v #
Proposition 10.83. g A
3a(p, v
t ,
4). 4).
+
* Sent is recursive.
Because one is generally only interested in sentences, and not formulas in general, it is convenient to have notions of theorem and proof where only sentences are mentioned:
Definition 10.84. Let S c Sent*. We let r-Thm" be the intersection of all sets A 5 Sent* satisfying the following conditions:
Similarly :
Lemma 10.79. I f
a
does not occur free in
4,then Hap, A 6 o 3a(p A 4).
(i) if p, E Axm9 u S , m E W , a E mRngv, and Vao-. .Yam- lp, is a senp, E A for any a E Rng v and tence, then Va,. . .Vam- lp, E A ; also, Vap, ; any sentence p,; (ii) y5 E A whenever p,, p, + $ E A. We write ThmL instead of 0-Thm;, I? t' p, instead of 9, E I?-Thm;, and k'&q instead of 0 t l ' p,.
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic $'
Theorem 10.85. For
r u {p,)
G
Sent9, I' t p, iff I' k" p,.
PROOF. (i) (ii). We proceed by induction on m, the case m = 0 being trivial (condition (ii) is then to be interpreted as I' t #,just like (i)). Assume that the implication holds for m, and suppose that I? u {p,,, . . ., p,,) t #. Then by 10.86, I? u { y o ,. . ., p,m-l) 1- p,, -,#, SO by the induction assumption, I? k 9, A A q~,,,-~ + (ym+ #). A suitable tautology then gives I' t p,, A * . . A p,,,, + #, as desired. The implication (ii) (i) is trivial.
PROOF. (r-Thm) n Sent in place of A clearly satisfies 10.84 (i)-(ii). Hence I'-Thm" c (I'-Thm) n Sent, so I' t" p, 2 I? I- p,. To prove the converse, let A
Fmla: for all m E w and all a E "Rng u, if Va,. . .Va,-,p, is a sentence then r t" Va, - . .Va,,- lp,).
= {p, E
Clearly Axm u I? G A and A is closed under generalization. To show that A is closed under detachment it clearly suffices to show (1)
Recalling 10.33(ii), we easily obtain Corollary 10.88. Assume I? U A U {p,) G Sent. Then the following conditions are equivalent:
if n E w , a E "Rng v, Va,. . .Van-,(p, + #) is a sentence, I' t" Va,. . V W , - ~ ~and , , I' k" Va,. - -Van-l(p, -t #), then I' I-" Va,. . -Van-l#.
(i) I'UA I-p,; (ii) I' I- #, A
This is established just like (1) in the proof of 10.32. Hence I?-Thm G A, so I' k p, a r t" p,. Theorem 10.86 (Deduction theorem). If p, is u sentence and then I' k p, -+ #. PROOF. Let A
=
{x : I' t p, + #}. If
x is an axiom
r u {p,) t #,
A
-,p for some m E w and some
The notion of a consistent set of formulas is one of the most important notions of elementary logic:
or a member of ,'I then
Definition 10.89. A set I? c Fmla is consistent if I? V p, for some p. Some obvious equivalents of this notion are as follows: Proposition 10.90. For any I? E Fmla the following conditions are equivalent:
is a I'-formal proof of p, + X, so x E A. Obviously p, E A. It is easily seen that A is closed under detachment. Now suppose that x E A and a E Rng v. Then
(i) I? is inconsistent; (ii) I? I- p, and I' t i p , for some formula p,, (iii) I? I- p, A i p for some formula p,. Theorem 10.91. 0 is consistent.
Thus Vax E A. Hence (I' u {p,))-Thm G A, as desired.
Ci
The deduction theorem formalizes an important procedure in intuitive proof theory. Frequently when one wishes to prove an implication p, + # one will add p, to the standing assumptions I' and then derive #. The deduction theorem then says that p, + # is derivable from r alone. The deduction theorem does not hold if p, is merely assumed to be a formula. For example, {v, = v,} t v, = v, (as is easily seen), but Vv, = v, -t v, = 11, (see Exercise 11.52). This comes about because the free variables in formulas of r, where 1' t p,, are treated as though they were universally quantified for most practical purposes.
, '
!
,
,
I
Corollary 10.87. as sum^ r conditions are rquiualcnt:
G
Sent, m
E w,
and p, E "Sent. Then the following
! :
PROOF. For any formula p,, let p,' be obtained from p, by first simultaneously replacing all atomic formulas in p, by v, = v, + v, = v, and then deleting all quantifiers. Let A = {p, : p' is a tautology). It is easily checked that Axm G A and A is closed under detachment and generalization. Hence Thm G A by Definition 10.23. Since, for example, i ( v , = v,) $A, it follows that 0 is 0 consistent. Of course 10.91 is an important result, showing that all of our work concerning the notion t is not completely trivial. It is obvious on intuitive grounds, since tp, implies that p, is intuitively true, while there are certainly formulas that are not intuitively true. This can be made precise using the modeltheoretic notions of the next chapter. The following two facts concerning consistency are frequently useful : Proposition 10.92. Assume I? u A G Sent and A # 0. Then the following conditions are equiualent :
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
( i ) I? U A is inconsistent; ( i i ) there exist an m E w V
1
-
r I-
1 and a p, E "A such that
ip,, v
.
Vm-1-
PROOF ( i ) 5 ( i i ) . By 10.88 we obtain m
Ew
Most of the languages naturally occurring in mathematics can be considered as elementary in this sense. Furthermore, the various effectiveness results of this chapter extend with minor modifications of proofs t o prove elementariness of the various notions. Some exercises below indicate where some of these modifications must occur.
and p, E "A such that BIBLIOGRAPHY
We may assume m # 0. Since 'I t Vvo(vo= v,), we easily obtain using a suitable tautology I' t i p , , v - . v i y m -,.
-
( i i ) 3 ( i ) . Since I? Il7 u A is inconsistent.
i ( v OA . . . A vrn-
Proposition 10.93. If I?
E
( i ) I? is inconsistent; ( i i ) there exist m E w
and
r u A t p,,
A
... A
QJ, -
0 Sent, then the following conditions are equivalent:
1 and p, E "I?
SO
that t i p , , v
. ..v
1. Church, A. Introduction to Mathematical Logic, Vol. I . Princeton: Princeton Univ. Press (1956). 2. Shoenfield, J . Mathematical Logic. Reading: Addison-Wesley (1967). 3. Tarski, A. A simplified formalization of predicate logic with identity. Arch. f. Math. Logik u. Grundl., 7 (1965), 61-79.
EXERCISES Show that in 10.2(ii) the requirement that v - l 9 - l is partial recursive can be replaced by the requirement that ( v - l o 9 - l )u ( 0 : m 4 Rng (9 v ) ) is recursive. 0
~p,,,,-~,
T o derive 10.93 from 10.92 it is necessary t o use 10.91. Since, as mentioned earlier, we are mainly interested in sentences, as opposed t o formulas in general, it is useful t o have a standard method for forming a sentence from a formula:
Definition 10.94. Let p, be a formula. Then there is a unique m E w and a E "Rng u such that {a,, . . ., a m - , } is the collection of all variables occurring free in p, and v - l a , < - .. < ~ - ~ a , We - ~ let . [[p,]],the closure of p,, be the sentence Vcc, .V a , - l p .
0
Let 9be a first-order language, as in 10.1. Let P = {p, : p, is a formula of 2 whose first symbol is either in Dmn W , or is L, or L4). Let n, c be distinct sets not in P. Then 8 = (n, c, P ) is a sentential language. With each sentence p, of 8 we associate an expression p,' of 2 :
<#)'
=
#
(lp,)' = 1 q J ' ; (p, + $1' = g,' +
for # E P;
*'.
Also, with each formula p, of 2'we associate an expression pt of 8;
The following proposition summarizes some usual facts about this notion:
Proposition 10.95 (9
(ii) (iii)
mJ11-t
9);
if I? t p,,
ifr
then I? t [ [ p , ] ] ; G Fmla and I" = { [ [ p , ] ] : 9, E I?}, then I?-Thm = r'-Thm.
In conclusion of this section, we wish t o indicate a modified notion of effectiveness for first-order languages which is frequently useful. A n elementary effectiuizedJirst-order language is a quintuple as in 10.2, except with ( i i ) , (iii), (iu) replaced by the following conditions: 0 v is elementary, Rng (f u) is elementary, and ( v - l 8 - l ) U (0 : m E w Rng ( g o v ) ) is elementary; (iii') g* D m n Lo is elementary and (Lo 0 g - l ) u (0 : m E u g* D m n 0 ) is elementary; ( i d ) g* Dmn 9Z' is elementary and (9 9 - l ) u (0 : rn E w g* Dmn 92) is elementary.
(ii') g
0
0
N
N
0
-
Show that ' maps Sent9 into Fmlaz (but is not onto), and maps Fmlaz into Sent9 (but is not onto). For any sentence p, of 8, Cap,++ For any formula g, of 2 , pt, yt' is a tautology. For any sentence p, of 2 , p, is a tautology iff p,' is a tautology. And for any formula p, of 9, p, is a tautology iff p,+ is a tautology. Prove a version of 10.52 for elementary effective languages. 10.99. Prove a version of 10.75 for elementary effective languages. 10.100. Let a be a variable not occurring in a and such that no free occurrence of a in p, is within the scope of a quantifier on a variable occurring in a.
Prove:
Chapter 10: Syntactics of First-order Languages
Part 2: Elements of Logic
if ol does not occur free in p,; (e) [[p, +Vap,]] (f) [[yll, p, as in 10.23(4); (g) [[vll, p, as in 10.23(5).
10.101. Let a, p, y be distinct variables. Prove:
For r G Sent, let I'-Thmvi be the intersection of all sets A G Sent such that r u AxmVis A and A is closed under detachment. Show that I?Thmvi = Sent n J?-Thm. 10.107. Let 9 be a first-order language in which 0 = 0. An atomic formula Rot,,. . .u,(,-~,is standard if iO = 0, . . . ,i(m - 1) = m - 1; any atomic equality formula is standard. A formula is standard if all of its atomic parts are standard. Let Fmlas be the collection of all standard formulas. Prove that for any formula p, there is a standard formula # with the same free variables as p, such that hpt, #.
10.102. Prove the following generalization of the deduction theorem: if p, is a formula and I' u {p,} t #, then I? t [[p,]] + #. 10.103. For any F G Fmla, let F-Thm"' be the intersection of all sets A E Fmla such that:
(1) I? u Thm E A; (2) A is closed under detachment. We write r t" p, for p, E r-Thm'". Prove: (3) if I? E Sent, then r t. p, iff F P p , ; (4) if r u {p}t m # , then r I-"'p, -,#; (5) if I? t"' p, and a is a variable which does not occur free in any formula of I?, then I? tmVap,.
r
i !
10.108. (Continuing 10.107.) Let AxmS consist of all standard formulas of the following kinds:
(a) p,, p, a tautology; (b) W p , + #) + (Vap, +Va*) ; (c) p, +Vap,, if a does not occur in p,; (d) ~ V a p+ , Va -I Vap, ; (e) VaVpp, +VpVap, ;
Exercise 10.103 gives a common definition of I?-theorem, which differs from ours in the case of I? having formulas with free variables. The next exercise gives the most common selection of logical axioms: 10.104. Let Axmiv consist of all formulas of the forms in 10.23(1), 10.34, 10.48, 10.61, and 10.64. Let I?-ThmtUbe the intersection of all A G Fmla such that r u Axmiv c A and A is closed under detachment and generalization. Show I?-Thm = I?-Thmiv.
Axioms a n d rules widely used by Hilbert a n d his followers are given in the next exercise. 10.105. Let Axmv consist of all formulas of the forms in 10.23(1), 10.34, 10.48. 10.61, and 10.67. Let r-Thmv be the intersection of all A E Fmla such that I? u Axmv E A and:
(1) A is closed under detachment; (2) if p, + # E A and a does not occur free in p,, then p, +Va# E A; (3) if p, + # E A and a does not occur free in #, then 3ap, + # E A. Show that r-Thm = r-Thmv. The following axiom system is due t o Quine: 10.106. Let Axmvfconsist of all sentences of the following forms:
For I' E Fmlas, let I?-ThmS be the intersection of all sets A c Fmlas such that I? u Axms s A and A is closed under detachment and generalization. Prove that if I? E Fmlas, then r-ThmS = r-Thm n Fmlas.
Chapter 11: Some Basic Results of First-order Logic
11
Some Basic Results of First-order Logic
first-order language 9 such that U is an 9-structure. In this case we call 2 an U-language. Let us now consider 9-structures for the languages 2 described following 10.1. Language of equality. The 9-structures are (essentially)just the nonempty sets. Language of set theory. The 9-structures are the pairs (A, R), where A is a nonempty set and R is a binary relation on A. If R = {(x, y) : x, y E A and x E y), then we obtain a particularly natural 9-structure. Language of rings. Any 9-structure has the form U = (A, , ., - , 0 , 1) where A is a nonempty set, + and - are binary operations on A, - is a unary operation on A, and 0, 1 E A. In particular, every ring is an 9-structure. Of course, there are also many 9-structures which are not rings. Full language of a nonempty set A. An 9-structure has the form 9 = (D,J R) of the general sort; D in general has no relationship to A, and may even have smaller or larger cardinality than A. One particular 9-structure is U = (A,J R), where f and R list all of the operations and relations on A; thus iff E U,,, mAAthen faf = f and if R E Urn,,^.1S("'A) then RPR = R. Our next objective is to describe precisely how an 9-structure determines the meaning of terms and formulas.
+
We now introduce the basic notions of model and truth for first-order languages. Then we prove the completeness theorem, which shows the equivalence between the proof-theoretic notion t and the corresponding semantic notion. Following this we give a series of simple but basic results concerning first-order logic. Namely, we will discuss compactness, the elimination of operation symbols, extensions by definitions, Skolem functions, Herbrand's theorem, and interpretations from one language to another. These results will be useful in discussing decidable and undecidable theories as well as in the model-theoretic portion of the book.
Definition 11.1. Let 9 = (L, v, 0 , B ) be a first-order language. An 9structure is a triple U = (A,f, R) such that: (i) A # 0 ; (ii) Drnn f = Dmn 0, and for each 0 E Drnn 0 ,f,is an 00-ary operation on A (with simply fo E A if 00 = 0); (iii) Drnn R = Dmn W, and for each R E Drnn W, RRis an BR-ary relation on A. Thus an 9-structure gives a domain A over which the variables of 9 can range, and assigns a meaning to each nonlogical symbol of 9.Frequently where 9-structures will be written in other forms, e.g. U = (A, J;, RJisl, I = Drnn 0 , J = Drnn W, U = (A, f ) if W = 0, etc. Or we may write U = (A, RU, O')R,~,~ %, o ~ 0. For D ~ R E ~Drnn B , RR is called the denotation of R in U; and fo is the denotation of 0 in U, for 0 E Drnn 9 . Note that if U = (A,f, R) is any mathematical object with A # 0, f a function with range a collection of (finitary) operatiol~son A, and R a function with range a set of (finitary) relations on A, and if Dmn f n Drnn R = 0,then there is a
,,,,
Definition 11.2. For any term oU: "A+ A: for any X E "A,
where 9 0
=
u
of 9 and any 9-structure U we define
m. We say that a term-defines the function
uU in
U.
Note that if 0 is 0-ary, then OUx = 0% for any x E "A.
Proposition 11.3. If every variable occurring in u is in the set {v, : i E I'), where I' E w , then oUx = oUy whenever x 1 I? = y [ F. This proposition is easily established by induction on u. It justifies the following definition :
Definition 11.4. If o is a term with variables among v,, . . ., on-,, let "09' be the n-ary operation on A such that "uUx = oay whenever x E "A, y E "A, and x E y. We say that a term-defines "aU in U. Note that n = 0 is possible in 11.4, this being the case if o is built up from individual constants alone, with no variables occurring in it. Then OU" is just a certain element of U. Now we turn to the meaning of formulas; naturally this also depends on the values assigned to the variables, as follows: 1 o<
Chapter 11 : Some Basic Results of First-order Logic
Part 2: Elements of Logic
Definition 11.5. For any formula p, of 2' and any 9-structure U we define p,' c "A: for any x E "A, x E ( o = T)% iff oUx = P y ; x ~ ( R u , . . . o , - ~ ) ~( Ui f~ fX , .. ., C T ~ where g R = m ; ( i q ~ ) = ~ '"A p,'; (p, v *)' = p,' (p, A *I% =
x
E
u *%;
-
- ~ ER', X )
E
p,% we say that x satisfies
It is easy to give rules for the effect of our defined connectives on the truth of x E p,%. For example, E E
PROOF. Using a simple inductive argument based on 10.24, it obviously suffices to show that each logical axiom is universally valid. We consider the five kinds of logical axioms given in 10.23: (1) p, is a tautology. Let x formula #, let
E
"A; we wish to show that x
E
p,". For any
(Vvip,)I1iff for all a E A, xf,E p,'.
We say that p, elementarily defines p,' in 21. If x p, in 21, and write U C p,[x].
x x
Lemma 11.8. 1' t p, implies 1' k p,.
iff ( x E p,% implies x E $'); (p, + (3vip,)' iff there is an a E A with xf,E p,%.
Proposition 11.6. If every variable occurring free in a formula p, is in the set F C w , a n d i f x rI' = y r r , then x ~ p , ~ z f l ~In~ p , ~ . { v , : i ~ F )where , particular, ifv is a sentence, then p,' = "A or p', = 0. This proposition is easily established by induction on p,, and justifies the following definition.
Definition 11.7. If p, is a formula with free variables among u,, . . .,v, - , , we let
Clearly f is a truth valuation in the sense of 10.19. Hence fp, = 1, i.e., x E v2', as desired. + X ) +(Vv,# + V v I X ) . Again let x E "A. To (2) p, is the formula VV,(I,/J establish that x E p,", we use the remark following 11.5: we assume that x E (Vv,(# + x))", x E (Vv,#)?',and prove that x E ( V U , ~ ) ?Let ' . a E A be arbitrary. and xi E #%, so x; E xU, as desired. Then x; E (# -+ (3) p, is # +Vv,$, where v, does not occur in $. Obviously p,' = "A, by Proposition 1 1.6. (4) p, is 3v,(v, = a ) , where v, does not occur in a . Let x E "A, and set a = o'x. Then by 11.3, aUx = oU&. Hence
. U k 3vi(vi = a ) [ x ] ,as desired so U k (vi = a ) [ x f , ]Hence
( 5 ) p, is a = 7 + (4 + x), where # and x are atomic formulas and x is obtained from # by replacing an occurrence of u in $J by 7.The desired result clearly follows from the following lemma: (5') if [ is obtained from the term p by replacing one occurrence of 7 , and if x E "A and aUx = ~ " xthen , p"x = t a x .
a
in
p by
We say that p, elementarily defines "p,' in U. If x E n ~ Uwe say that x satisfies p, in U, and again write U k p,[x]. In general, a formula p, holds or is true in U if = "A; we also say that 21 satisfies p, or is a model of p, and we write U 1 p,. We write U 1 A if each p, E A holds in 21; K k p, if each U E K is a model of p,, and K k A if K k p, for each p, E A. Furthermore, we write r k p, if each model of is a model of p,, and F k A if I' k p, for each p, E A. We say that p, is universally valid if p, holds in every 2'-structure, and we then write hp. In this definition we have given the main semantic notions that we will work with in the model-theoretic portion of the book. We now turn to the discussion of the relationships of these notions with the proof-theoretic notions. The main result we want to establish is that r t p, iff r C p,. This will enable us in the second part of this section to establish some important prooftheoretic results by model-theoretic means. One half of this important equivalence is rather easy t o establish:
The lemma is easily proved by induction on p.
0
Lemma 11.8 is already of some interest. In particular, using it we can establish that a formula p, is not derivable by exhibiting a model of i p , . Thus if p, has the form # A 1 4 , clearly any 5"-structure is a model of ip,, and so Vp, by 11.8. This provides another proof that the empty set is consistent (cf. 10.91). We can now establish rigorously that various restrictions on axioms and theorems in Chapter 10 are essential in order to preserve the property given in 11.8. For example, consider the restrictions in 10.23(3) and 10.23(4). Formulas of the form p, +Vu,p, are not universally valid, in general, if v, occurs in 9. For example, let i = 0 and consider the formula p, = ( v , = v,). Let U be any 2'-structure with at least two elements, and let x E "A be such that x, = x,. Clearly then 91 k ~ [ x ] while , if a t A jx0}, then 91 k - p [ x z ] and hence 21 1 i V v , p , [ x ] ;thus x does not satisfy q + V v , q in 91. For an example concerning 10.23(4), let 2 be a language with a unary operation
-
197
Chapter 11 : Some Basic Results of First-order Logic
Part 2: Elements of Logic symbol f and let p, be the formula vo = fv,. Let U be an 9-structure in which A = w and f is interpreted by s. Clearly then U i= i3vop,.Thus the restriction in 10.23(4) is also necessary. To prove the converse of 11.8, it is enough to restrict attention to a sentence p, and a set I? of sentences. The contrapositive of the converse of 11.8 then says that if I? H p,, then I? # p,; by 10.89, this means that: if I? u { i p , ) is consistent, then I? u { ip,) has a model. Thus our task is really to show that any consistent set of sentences has a model. We shall first show this for special sets of sentences where, in a sense, quantifiers can be eliminated:
Theorem 11.12. If I? is a complete, rich, consistent set of sentences in a language 9 , then I? has a model 21 such that the cardinality of A is at most /{a : u is a term of 9 in which no variable occurs)l PROOF. Let B = {a : a is a term of 9 , and no variable occurs in a). We define = to be the set
-
{(a, T) : a,
T
E
B and I? t u
= 7).
By 10.34-10.36, is an equivalence relation on B. Recall that [ I is the function assigning to each a E B its equivalence class under =. Let A = B/-. By 10.38, for each 0 E Dmn Lo, say of rank m, there is an m-ary operation 0% on A such that for any a,, . . ., a,-, E B,
Definition 11.9. Let 9 be a first-order language. A set I? of sentences of 9 is rich if for every sentence of 9 of the form 3ap, there is an individual constant c of 9 such that I? k 3ap, + SubfFp,. A set I? of sentences of 9 is complete provided that for any sentence p, of 9 , I? I- p, or r t ~ p , .
O%([uo],. . ., [a, - I])
[Oao. .a,- I].
=
For any R E Dmn B, say R m-ary, we let Ra be the collection of all m-tuples of the form ([a,], . . ., [am-,]) such that t Roo---om-,.This defines U. We claim that U is the desired model of I?. The proof of this is based on the following auxiliary considerations. First, the following statement is easily established by induction on T:
Note that tsubf Ep, + 3crp,; hence the requirement in 11.9 essentially ensures that any existential quantifier can be eliminated. In fact, the following proposition is easily established by induction on p,: Proposition 11.10. Let I? be a rich set of sentences. Then for any sentence p, there is a sentence # in which no quantijier occurs such that r t p, t,#.
for any
(1)
T
E
B,
=
OrU
[TI.
The following proposition expresses some simple but useful properties of complete sets of sentences:
Next, let a E WB.If T is any term, we let Sar be the term obtained from T by simultaneously replacing each variable vi in T by ai. Then by induction on T it is easily shown that
Proposition 11.11. For any I? E Sent2 thefollowing conditions are equivalent:
(2)
(i) I? is complete and consistent; (ii) {p, : p, E Sent2, I? k p,) is a maximal consistent set of sentences; (iii) for any sentences p,, #, if I? I- p, v #, then I? t p, or I? t #, and I? is consistent. PROOF (i) => (ii). Obviously A = {p, : p, E Sent2, I? t p,) is consistent. Suppose A c @; say p, E O A. Thus I? If p,, SO by (i) I? !- i p , . Hence i p , E A c O, SO both p, and i p , are in O. Hence O is inconsistent. (ii) G- (iii). Assume that I? H p, and I? If I/, and let A be as above. Then A c A U {p,}, so A u {p,) is inconsistent. Hence by 10.92, A k i p , so I? t i p , . and so by a suitable tautology, r t i ( p , v #). Thus Similarly I? !- i# I? p, v # since I? is consistent. (iii) => (i). Given a sentence p,, we have I? t p, v i p , so by (iii), I? k p, or 0 I? t ip,. Thus I? is complete.
ino
1 o U) = [Sa7],
Similarly, for any formula p, let Sap,be obtained from p, by simultaneously replacing each free occurrence of ui in p by ai for each i < w . Then: (3)
For any formula p,, U i= p,[[ ] 0 a] iff U i= Sap,.
Of course (3) is also established by induction on p,; we consider two steps as illustration. If p, is T = p, then
-
We now show, by a direct construction, that any complete, rich, consistent set of sentences has a model:
for any term T, T'([
t= ,[
I 01 O
iff .a([ I) O 0) = pa([ I O 0) iff O(Sa~)% = O(soP)ILby (I), (2) iff U i=Sap.
P
4
Now, suppose p, is Vu,#. Assume first U t= p,[[ ] o]. Then Sap,has the form Vv,#', where 4' is obtained from # by simultaneously replacing each free occurrence of v, in # by a,, for each j E w {i). To show that Sap,holds in U, let a = [T] be arbitrary. Then U t= #[([I a):], i.e., 21 i= #[[I oil. By the induction hypothesis, U k S(ot)#. Clearly S(a:)# = S(o;)#', so again by the induction assumption, U k #'[[ ] a:], i.e., U k #'[([ ] a):]. Thus Sap,holds in U, as desired. The converse is similar. 0
-
0
0
0
0
Chapter 11 : Some Basic Results of First-order Logic
Part 2: Elements of Logic
Now we return to the proof that 91 is a model of I?. This is immediate from the following stronger statement: for any sentence p,, I' t p, iff p, holds in 21. (4) We prove (4) by induction on the sentence p,. If p, is
a
= T, then
To extend a consistent set r to a rich consistent set r is technically somewhat difficult. If 9 has no individual constants, then it is obviously impossible to do this extension within 9 itself. In general we must expand the language. We now briefly discuss the idea of expansion of languages.
t
$ Definition 11.14. A language 9' = (L', u', 0', B') is an expansion of a language 2 = (L, v, O , 2 ) provided that L = L', v = u', O s 6' and W s 9'; we also say then that 9 is a reduct of 2". In case 3 '= (L', v', O', B', 5~')and 9 = (L, v, 0, W,8 ) are effectivized first-order languages, then we insist additionally that g s 8', and we call 9' an efSective expansion of 9 . Assume that 9' is an expansion of 9 . If U = (A, f, R) is an 2-structure and 23 = (B, f ', R') is an 2"-structure, we say that U is the 9-reduct of 23, or that 23 is an 9'-expansion of 21 provided that A = B, f E f', and R E R'. We then write U = 23 19.
5. $
Next, let p, be Ru,. . .urn- First suppose r 1 9 . Then by the definition of R2', ([a,], . . . , [ u m l ] )E R". By ( I ) it follows that 91 1 Roo. . .om_l. Conversely, suppose 21 1 Roo. . .am-l. Thus (Ooa', . . . , OU;-,) E RU, i.e., by (I), ([a,], . . ., [am-l]) E R ~Hence . by the definition of R", there exist T,, . . ., T , - ~ E B with By an easy argument . [a,] = [T,], . . . , [urn- = [rm- and r I- R T ~. .7,using 10.23(5), I' t p,. For p, = i$ we have (by consistency and completeness) iff I? V $ I? t p, iff%#$ (induction hypothesis) iffBkp,.
i
4
In discussing expansions we will usually not be as rigorous as in 11.14. Thus we might say "let 9' be obtained from 9 by adjoining a new binary relation symbol" or "let 9' be obtained from 9 by adjoining m individual constants." Note that the ways of making such statements precise are all equivalent, in some sense; see the comments following 10.1. In the following proposition we summarize the most important elementary facts about expansions.
The cases p, = $ v x and p, = $ A x are similar. Finally, suppose p, is Vv,$. First suppose r t p,. To show that p, holds in 91, let a = [TI be arbitrary. Since tp, -+ SubfYi$ by universal specification, we have k Subf:$. Hence 21 k Subfy$, by the induction assumption. By (3) we have 91 k $[[ ] 0 a], where u E @Bis any sequence with a, = 7. Thus p, holds in 91. Conversely, suppose p, holds in 91. Since I' is rich, let c be an individual constant of 9 such that I? t 3vi i $ + Subf? i $. Thus r t SubfEL$-+ Vvi$. Let a E @ B be any sequence such that oi = c. Since p, holds in 21, U k $[[ ] u]. By (3), Subf:# holds in 91, so I' t Subfr$ by the induction assumption. Hence I' t p,, as desired. 0
Proposition 11.15. Let 2, 3', 21, 23 be as in 11.14. Then: (i) Trm2 _c T r m p , Fmlay s Fmlap, Axmy G A x m p , and Sent2 Sentp ; (ii) if a E Trm2, then aU = 5%; (iii) ifp, E Fmla2, then p,% = p,B; (iv) ifr E F m l a ~ then , U is a model of I? 1 823is a model of I'; (v) if I? u {p,) E Fmla2, then I? k2 p, ifS r kyf p,.
0
To obtain the completeness theorem, we still need to see how any consistent set r of sentences can be extended to a complete, rich, consistent set. First we deal with the case of extension to a complete consistent set. The theorem in question has many applications in addition to our immediate concern with the completeness theorem : then Theorem 11.13 (Lindenbaum). If r is a consistent set of sentences of 9, tkere is a complete consistent set A of sentences in 9 such that I? G A. is a nonempty PROOF. Let d = {A : r G A r Sent,, A consistent}. If 9 3 G Sent,. Also, UB is subset of .d simply ordered by c , then r G 0 1 and a p, E "UB consistent. For, otherwise, by 10.93 there is an 172 E w such that t 19, v . . . v i v m - Since B is simply ordered, p, E "A for some A E =B.Thus by 10.93, A is inconsistent, contradicting our assumption that 28 5 .d. Now we can conclude by Zorn's lemma that d has a maximal 0 member A. By 1 1.1 1, A is complete.
-
/ S1
s
This proposition is easy to prove; (i)-(iii) are proved by induction, and (iv) and (v) follow from (i)-(iii). By the completeness theorem which we will shortly prove, 1l.l5(v) also holds for the notion t . This statement is needed in our proof of the completeness theorem, however, so we will give a prooftheoretic proof of it:
Proposition 11.16. Let 2'be an expansion of 9 , andassume that I? u {p,) E Fmlay. Then I? ty p, if I? tp p,. PROOF. Obviously t-9q~ 3 I? tp p,. Now assume that I? tp p,. Say that is a I'-formal proof in 9' with = p,. Nonlogical constants ''which do not appear in 9 will be called new constants. Let ol be a of 2 variable not occurring in any of the formulas . . .,#,-,. We now associate
&, . . . ,
+,,
c
Part 2: Elements of Logic
with any formula or term recursion :
x
PROOF. Let ($,, . . ., +,-,) be a I?-formal proof with I),-,= Subf:~. Let /3 be a variable not occurring in any of the formulas 4,, . . .,+,-,. For any i < m let t+h; be obtained from $, by replacing c throughout +i by /3. As in the proof of 1 1.16 it is seen that (&, . . ., t,h;- ,) is a r-formal proof. Since
of 8' a formula or term X - of 9 , defined by
(v,)- = vi; ( 0 0 , . .am- ,)- = 00;- . .a;( 0 ~- .am-,)~ . = a (a = 7 ) - = (a- = 7 - ) ; (Rae. .am-,)- = Ru;. . .a,-, (Rae. . .am-,)- = (a = a) ( 1 p ) - = 19-; ( p v *)- = p - v *-; ( p A $1- = 9- A *-; (Vqp)- = vv,p - .
,
if 0 is an old operation symbol; if 0 is a new operation symbol;
(Subf :p)- = Subf gp, we have I? t Subf gp. Hence I? t V/3 Subfgp and I? I- p by universal specification. 0
if R is an old relation symbol; if R is a new relation symbol;
Finally we are in a position to construct rich extensions:
Lemma 11.18. Let 9 be anyfirst-order language and let I? be a consistent set of sentences in 2'.Let 2" be an expansion of 8 obtainedby adj~ininglFrnla~I new individual constants. Then there is a consistent rich set A of sentences 0j-8' such that r G A.
We claim: (I)
if i < m and
Chapter 11: Some Basic Results of First-order Logic
-
PROOF. Let ( p a : a < m) be a list of all sentences of 2" of the form 3/3I), where m is an infinite cardinal number. Note that m = IFmla21. We now define a sequence ( d , : a < m) of new individual constants. Suppose we have already defined d/3 for all /3 < a, where a < m. Then
is a logical axiom, then 4; is a logical theorem in 9 .
To prove (1) we take up the five possibilities for #i according to 10.23. First suppose that *i is a tautology. Then #; is a tautology. For, let f be any truth valuation in 8.Definef + p = f p - for any formula p of 8 ' . It is clear that f is a truth valuation, so f +$i= 1. Thus f*; = 1 , as desired. Second, suppose has the form Vvi(p+ X )+ (Vvip + Vvix). Then #; is
{d/3 : /3 < a ) u { C : c is a new individual constant occurring in some pb with /3 5 a )
+
so I); is still a logical axiom. Third, suppose +i is the formula p +Vvip, where vi does not occur in p. Then is the formula p- + V q p - , and, by choice of a, vi does not occur in p-. Thus is a logical axiom. For $i of the form 3vi(vi = a) where vi does not occur in a, a similar argument works. Finally, suppose has the form a = 7 + ( p + x), as in 10.23(5). If p has the form Rp,. . p m - , where R is a new relation symbol, then +i is U - = 7 - -+ (a = a -+ a = a), which is a logical theorem. If p does not have this form, then the desired result follows easily from the following statement:
+;
(2)
if p = and
has cardinality < m, so we can let d, be some new individual constant not in this set, say the first one under some given well-ordering of all the new individual constants. This completes the definition of the sequence (d, : a < m). Now for each a < m let p, be the sentence 3/3,#,. For each a. 5 m let O,
+;
/ I
=
r u {3/3,+, +=
S u b f S : y < a).
We claim that each set 0, is consistent in 9,and we shall establish this by induction on a. We have O, = I?, so Oo is consistent in 9' by 11.16. The induction step to a limit ordinal is clear from 10.92. So now assume that O, is consistent; we prove that O,+, is consistent. If a,+, is inconsistent, then by 10.92 we have
and p' = p7v are terms, then either p - = p'- or else phave the respective forms p'u-v', pfr-vl.
~ U V
This statement is easily established by induction on p. Thus ( 1 ) holds. Clearly: (3)
for a a term of 9 , a -
= a ; for
p a formula of 9 , p-
NOWusing (1) and (3) it is easily checked that each i < m. Hence r t2 p, as desired.
=
p.
#; is a r-theorem in 8 for 0
The same method of proof gives the following proposition which is also needed in our construction of rich extensions: Proposition 11.17 Let c be an individual constant not occurring in any Then l7 t p. formula of I? u {p). Assume that I? t Subf
8 $,
and also O, I- iSubf<:#,. We may apply 11.17 to this, by choice of da. Thus O, t (2)
@,
ih,and hence
t 13/3,*,.
By (I) and (2), 0, is inconsistent, contradicting the induction assumption. Thus each set 0, is consistent. Clearly Om is rich and contains I?, as desired. 0 mn.7
Chapter 11 : Some Basic Results of First-order Logic
Part 2: Elements of Logic
Now we can prove the completeness theorem. Theorem 11.19 (Completeness theorem, first form). Any consistent set of sentences has a model. The model can be taken to have power I I Fmla91. PROOF. Let I? be a consistent set of sentences in the language 9. Let 9' be obtained from p49 by adjoining IFmla21 new individual constants. By 11.18, let A be a consistent rich set of sentences in 9' with r E A. By 11.13, let O be a complete consistent set of sentences in 9' such that A E O. Obviously O is still rich. By 11.12, O has a model U. Clearly (by 11.15(iv)), U 1 9 is a model of I'. From all of these results it also follows that [A( 5 IFmla21. As already observed informally, 11.19 leads to the equivalence of t and k: Theorem 11.20 (Completeness theorem, second form). I? 1p, i f I' 1 p,. PROOF. 3 : by 11.8. e : Assume I' H p,. Thus by 10.95(iii), {[[#]I : t+h E I') If [[p,]] so by 10.92, A = {[[#I] : t+h E r)u { i[[p,]]} is consistent. Hence A has a model U, by 11.20. Clearly U is a model of l? but not of p,, as desired. Because of this theorem, we can formulate results from now on using either t or k. Since we shall use model-theoretic methods almost exclusively, it seems more appropriate to formulate them using k, as we shall do. In the future our only use for the notion t will be in proofs of model-theoretic results where we use the completeness theorem. The following theorem expresses one of the main model-theoretic results, proved very- essentially using t : Theorem 11.21 (Weak completeness theorem). If 9 is an efSectivizedJirstorder language, then {8 + p, : k p,) is recursively enumerable.
compactness theorem, see Exercise 11.59. We give here just a few corollaries to indicate the flavor of applications of the compactness theorem (see also the exercises). Corollary 11.23. Let 9 be any Jirst-order language. Then there is no set I? of sentences of 9 such that for any 9-structure U, U is a model of I? 18 U is finite. PROOF. Assume the contrary. Expand 9to 9' by adjoining new individual constants c, for m E w. Let A be r together with all sentences i ( c i = c,) for i # j. Every finite subset A' of A has a model. For, choose T E w finite so that A' G I? U { i ( c i = cj) : i,j E T, i # j). Let U be any finite 9'-structure in which c;U # cy for all distinct i, j E T, where c;U is the denotation of ci in U for each i E T . Thus U 1 9 is a finite 9-structure, so by assumption on r , U '1 9 is a model of I?. Thus U is a model of A'. Hence by the compactness theorem, A has a model 8.Since c" c? for all distinct i, j E w (where, now, cy is the denotation of ci in 8 for all i E w), 23 is infinite. But 8 1 9 is a modei of r , contradiction. 0 Corollary 11.24. Let 9 be a Jirst-order language with just one nonlogical constant, a binary relation symbol I. Let K be the class of all 9-structures U = ( A , I ) such that I is a well-ordering of A. Then there is no set I? of sentences of 9 such that K = {U : U is a model of I?). PROOF. Assume the contrary. Again adjoin new individual constants c, for m E w. Let A be I' together with all sentences c,,, < c,, for m E w. Every finite subset of A clearly has a model. Hence by the compactness theorem, A has a model U. The 9-reduct (A, I ) of U is such that I is not a well-ordering, but (A, I ) is a model of I?, contradiction. 0
PROOF. By the completeness theorem, the given set is identical with 18+p, : t p,). This set is r.e. by Theorem 10.29. 0
Corollary 11.25. If a sentence p, holds in every inJinite 9-structure, then there is an m E w such that p, holds in everyjinite 9-structure of power >m.
The following important theorem follows immediately from the first form of the completeness theorem.
PROOF. Suppose the conclusion fails. Thus for every m E w there is a finite 9-structure of power > m in which p, fails to hold. Adjoin new individual constants c, for m E w. Let
Theorem 11.22 (Compactness theorem). If I? is a set of sentences such that every finite subset of I' has a model, then I? has a model. PROOF. By 11.19 it suffices to show that I? is consistent. Suppose not: say r t p, A ~ p , By . 10.33, A I- p, A i p , for some finite subset A of I?. By 11.20 (in fact, the easy part of 11.20 given in 11.8), A k p, A i p , . By hypothesis, A has a model U. Hence p, A ~ p holds , in U, which is impossible. 0 The compactness theorem lies at ;he start of model theory, and it will play a very important role in Part IV. For some motivation for the name
I? = {-I,}
u { i ( c i = c,): i, j~
w,
i # j}.
Then every finite subset of I? has a model, so I'has a model U. Thus U 1 9 is an infinite model of i p , , so the hypothesis of 11.25 fails. 17 We now turn to some basic results about first-order languages which we prove in a model-theoretic way. These results have to d o with introducing new symbols or eliminating symbols. First we prove a theorem which shows, roughly speaking, that any first-order language is equivalent to a language in which there are no operation symbols.
Part 2: Elements of Logic
Chapter 11: Some Basic Results of First-order Logic
Definition 11.26 ( i ) Let 9 = (L, v, 0, W ) be a first-order language. A relational version of 9 is a first-order language of the form 9' = ( L , v, 0', 9 ' ) such that 0' = 0, W G B', and such that there is a one-one function T (called a translation of 9into 9')mapping Drnn O onto Dmn 9%" Drnn 92 such that 9 ' T o = 8 0 1 for all 0 E Drnn O. T be as in ( i ) . With each formula p of 9 we associate (ii) Let 9,9', T-translate p' as follows. First we define p' for formulas p of the its 9', form a = v,, a a term:
-
+
( v j = 0,)' = v j = vi; for 0 an individual constant. (0= q)' = Tout If 0 is an operation symbol of rank m > 1 and p is OU,. .a,-, a,, . . ., a,-, be the first m variables not occurring in p, and set p'
=
3ao. .3am- ,[(ao= a,)' A . - - A (a, h Toao-- .a,- l ~ i ] .
= vi, let
,= a, - 1)'
Next we define p' for p of the form a = 7 , 7 not a variable. Let a be the first variable not occurring in p, and let
p'
=
3a((a = a)'
A
(7 = a)').
If p = Roo. - .a,-, with each oi a variable, let p' = p. If at least one at is not a variable, let a,, . . ., a,-, be the first m variables not occurring in p, and set
Finally we set ( i p ) ' = i p ' , ( p v = p' v $', ( p A 4)' = p' A $', and (Vap)' = Vap'. (iii) Let 9,9')T be as in ( i ) . For 0 E Drnn 9 , the existence condition for 0 is the following sentence of 2" (where 0 is m-ary): $)I
the uniqueness condition for 0 is the sentence
$'
9' = ( L , v, 0', 9',),' such that ( L , v, O', 9') is a relational version of 2, 9 1 (Rng L u Rng v u Dmn W ) = ', 1 (Rng L u Rng v u Dmn W ) , and there is a translation T of ( L , u, O , 9 ) into ( L , v, O f , 9 ' ) such that TO 9 - I 18* Dmn O is partial recursive.
it
f
0
:i,
The following proposition is easily (weak Church's thesis!) established.
i
I
Proposition 11.27. Let 9, 9, T be as in 11.26(v). For any m
'r; 1
fm
=
fm
=
+
0
p'
E w,
dejine
if m = y + pfor some p, E Fmlap, where p' is the 2') T-translate of p, otherwise.
Then f is a recursive function.
k'
;: 1
, $
In the next theorem we give the main properties of relational versions of languages.
Theorem 11.28. Let 2" be a relational version of 9 with translation, T , notation as in 1 1.26(i). ( i ) I f p is a formula of 9 in which no operation symbol occurs, then p' = p; (ii) Let U be an 9-structure and U' the relational version of 3, with notation as in 11.26(iv). Then U' is a model of the translation conditions. Furthermore, if p is any formula of 9, and x E " A , then U 1 pix] ifSU' 1 pl[x].For any formula p of 2" there is a formula p* of 9 such that for all x E W A ,U C p*[x] iff U' C p[x].I f % is an P-structure which is a model of the translation conditions, then '23 = U' for some 9-structure U. Then I' 1 p iff (4' : $ E I') u (iii) Let I' u {p} be a set of formulas of 9. {# : # is a translational condition} k p'.
PROOF. ( i ) and the first part of (ii) are obvious. We prove the second part of (ii) by induction on p, following 11.26(ii). If p is v, = v,, obviously U C ~ [ xiff] U' C pl[x].Suppose p is 0 = v,, where 0 is an individual constant. If U C p[x], then x, = Oa, and hence x, E T?; thus U' C pl[x].The converse is similar. Now suppose, inductively as in 11.26(ii), that p is Oa, . . .a,- = v,. Assume that U 1 p[x].Thus 0 % ~ . .az-,x ~ . = x,. Let y be like x except that Yao = oyx, . . ., yam- = a t - ,x. Thus by 1 1.3, U C a , = a o [ y ] ., . . , 2l 1 = a,-l[y]. SO, by the induction hypothesis, U' 1 (a, = a,)'[y], . . ., U' C (a,-, = a,-,)'[y]. It follows easily that U' C pl[x].The converse is similar. The remaining steps in this inductive proof are similar. Next, given a formula p of 2" we construct p* by replacing all atomic subformulas of p of the form Tea,. . .a, by Oao. . .a,- , = a,. The desired property of p* is easily established by induction on p. The final condition of (ii) is clear. To prove (iii), first assume r C v. Let 23 be any model (an 2"-structure) of (4' : 4 s I?} u ( 4 : 4 is a translation condition}. By (ii) we may write 8 = U' with U an 9-structure. Since U' k 4' for each 4 E J? it follows by
,
The set of translation conditions is the set of all existence and uniqueness conditions for all 0 E Drnn 0. (iv) If U is any 2'-structure, the relational version U' of 2 is obtained from U by replacing each operation of U by the associated relation. That is, if U = ( A , f , R), then U' = ( A , R'), where U' is the 2"-structure such that R c R', while if 0 E Drnn 0, with 0 m-ary, then
RrTO = {(x,, . . ., x,) :foxo. . .x, -
=
x,).
(v) If 9 = (L, v, O , 9 , g) is an dectivized first-order language, then an effectivized relational version of 9 is an effectivized first-order language
Chapter 11 : Some Basic Results of First-order Logic
Part 2: Elements of Logic
(ii) that U is a model of r. Hence U k p,, so by (ii),U' 1 p,' as desired. Second, assume {(I,' : (I, E r) U {(I, : (I, is a translation condition) 14'. Let U be a model of I?. By (ii), U' is a model of {(I,' : (I, E I') u {(I, : (I, is a translation condition}. 0 So U' U v', and by (ii) again, U k v, as desired. We now want to give the main facts concerning the role of definitions in first-order languages.
Definition 11.29. A theory is a pair (I?,9 )such that J? is a set of sentences of 9 and v E r whenever I7 1 p,, for each sentence p, in 9.We call r itself a theory when 9 is implicitly understood, or we say that I? is a theory over or in 9.If U is an 9-structure, the 9-theory of U is the pair (I?,9 ) , where I? = {p, E Sentp : U U v } ;clearly (I?, 9 ) is a theory. A theory (I", 9') is an extension of a theory (I?, 9)provided that 9' is an expansion of 9 and I? c F'. We say that (I",9 ' ) is a conservative extension of (I?, 9) provided that, in addition, r = I?' n Sentp. If I? is a theory in 9,a set A E Sent9 is a set of axioms for F provided that r = {p, E Sent9 : A k p,}. Now let 9' be an expansion of 9 and let r and I" be theories over 9 and 9 'respectively. ( i ) If R is a relation symbol of Y but not of 9,then apossible definition of R over r is any formula p, of 9 with free variables among {v,, . . ., urn-,), where m is the rank of R . (ii) If 0 is an operation symbol of 9' but not of 9, then apossible definition of 0 over I? is a formula p, of 9 with free variables among {v,, . . ., v,), where m is the rank of 0, such that the following existence and uniqueness conditions are in I?: vV0.. .V V ,- 1 3 ~ , v ; V V O . . . V U ~ + I [..,urn) ~ ~ O ,A. d u o , . - ., Vm-~,Vm+l)+Um=
Vrn+ll.
(iii) We say that (I",9') is a definitional extension of (I?,9 ) provided that for every nonlogical constant C of 9' but not of 9 there is a possible definition p,, of C over r such that
I?'
=
u {& : C a nonlogical constant of 9' but not of 9 ) k v ) ,
{p, : p, E Sent9, and F
where p,; is the sentence
definitional extension of (r,9 ) if (I", 9 ' ) is a definitional expansion of (I?, 9 ) for which there is a function p, as in (iii) such that g + 0 p, 0 8 I - l 1 {9'C : C is a nonlogical constant of 9' but not of 9 ) is partial recursive. There are two central results concerning definitions. The first is that defined symbols can always be eliminated in favor of old symbols:
Theorem 11.30. Let (I?', 9 ' ) be a definitional extension of (I?,9 ) , with notation as in 11.29. Then for any formula # of 9' there is a formula #' of 9 with the same free variables as # such that F' k # t* 4'.I f I" is an effective definitional extension of I?, then such a formula #' can be effectively obtained from (I,.
PROOF.We construct (I,' by induction on (I,. In each step the desired properties of (I,' are easy to prove, and we prove the desired result in only one step as an illustration. To begin with, we construct #' for (I, of the form a = vi by induction on a. If o is a variable, we set #' = #. Now suppose inductively that a is 07,. . .rn-,. Let a,, . . ., a n - , be the first m variables not occurring in (I,. If 0 is a symbol of 9,then we let (I,' be the formula
If 0 is a symbol of 9' but not of 9,we let (I,' be the formula
In this case we check explicitly that I" I= (I,t,#'. Let U be any model of I". First suppose that U k +[XI with x E W A . Thus oUx = xi, so O U ( r f x , .. ., 7:- 1 ~=) xi. Hence U I= (Ov, . .v, - ,= v,)[r$x, . . . , 7:- ,x, x i ] Since r ' k pb, it follows that U I= p,,[~Yx,. . ., T?-,X, x i ] Now let y be like x except that ya, = T ~ for X each j < n. Clearly then U k p,,(a,, . . ., an-,, vi)[y]and U k (7, = a j ) [ y ]for each j < n. By the induction assumption, U k ( r j= aj)'[y] for each j < n. Thus U U #'[XI. The converse is similar. Now we continue the inductive definition of 4';it is complete for (I, of the form u = vi. If (I, is a = T , where T is not a variable, let a be the first variable not occurring in (I,, and set #' = 3a((a = a)' A (7 = a)'). Next, suppose # is Roo. - .on - ,. Let a,, . . ., an- be the first n variables not occurring in #. If R is a symbol of 9, set
if C is a relation symbol of rank m, while p,; is
if C is an operation symbol of rank m. (iv) If 9 = (L, v, 0,W , 8 ) and 9' = (L', v', 0', a',B') are effectivized first-order languages, the above notation applies to them also. We assume is an effective expansion of 9. We say that (I",9'is ) an effective that 9'
If R is a symbol of 9' but not of 9,set
Chapter 11: Some Basic Results of First-order Logic
Part 2: Elements of Logic (# A x)' = #' A and Finally, let ( -r#)' = l# (# v x)' ' = , f v (VVi#)' = VVi*'. The final assertion of the theorem concerning effectiveness is clear from 0 the above. XI,
The second important fact concerning definitions is that nothing new can be proved:
Theorem 11.31. Let (F', 9 ' ) be a definitional expansion of ( r , 9 ) . Then (I", 9 ' ) is a conservative extension of (I?, 9 ) . PROOF. Again we take all notation as in 11.29. Suppose # is a formula of 9 and F' 1 #; we must show that r k #. Let 2l be any model of r (2l is an 9-structure). For C a nonlogical constant of 9 , let CU' = Ca. Let R be a relation symbol of 9' but not of 9 , say R is m-ary. We define RU' = "p;. Now suppose that 0 is an operation symbol of 9' but not of 9 ; say 0 is m-ary. Since p, is a possible definition of 0 over I' and U is a model of ,'I we may define Ow as follows. For any x0, . . . , xm- E A, let Ow(xo, . . ., xm-,) be the unique y E A such that U I=pa[xo, . . ., xm-,, y]. This defines the 9'structure 3'.Clearly 2l' is a model of ,'?I so U' is a model of #. Hence U is 0 also a model of #, since # is a formula of 9 . Thus I' 1 #, as desired. Closely related to this fact about definitions is the following result.
Theorem 11.32. Let I? be a theory in a language 9 , and p a formula of 9 with free variables among v,, . . . , urn.Assume that F b Vu, . . .Vvm-,3v,p. Let 9' be an expansion of 9 by adding a new m-ary operation symbol 0 . Let F' be a theory in 9' with axioms r together with the sentence Vv, . . Vvm-lp(vO, . . ., urn- ,, OU, . .urn-,). Then I" is a conservative extension of I'.
Definition 11.33. For any formula p, let Fv p be the set of all variables occurring freely in p. For any first-order language 9 , aprimitive Skolem expansion of 9 is an expansion 9' of 9 such that there is a function S mapping {3vip : p E Fmla2} one-one onto the set of all nonlogical constants of 9' which are not constants of 9 , such that for each p E Fmla2 and each variable a, S,,, is an operation symbol of rank IFv 3apl. In case 9 and 9' are effectivized with Godel numbering functions 9,9',we call 9' an effective primitive Skolem expansion provided that 2' is an effective expansion of 9 and the function
is partial recursive. Given first-order languages 9 = (L, v, 0 , B), and 9' = (L, U,0', B), we say that 9' is a Skolem expansion of 9 provided there is a sequence (9,: i E w ) of first-order languages Yi = (L, v, Ui, B ) such that go= 9, for each i E w %+,is a primitive Skolem expansion 0 f 9 ~ with associated function S i , and 0' = Ui,, 0,. If all of these languages are effectivized, 9' is an effective Skolem expansion of 9 provided that each gi+, is an effective primitive Skolem expansion of g, and 9'is an effective expansion of each L&. Assuming that 9' is a Skolem expansion of 9 , with notation as above, the Skolem set of 9' over 2 is the set of all sentences [[3uidv0, . - ., ui) + v ( ~ o.,. -
vi - 1,
u)II
where a = S$Vi,aO.. .am-,, m = IFv 3vipl, FV3vip = {ao,. . ., a,-l} with v - b o < . . . < la,-^, and j is minimal such that 3vip is a formula of pj. (Recall that [[XI]denotes the universal closure of x; see 10.94.)
+
PROOF. Assume that I" k #, where # is a formula of 9 . To prove k #, let 2l be any model of I'. By the axiom of choice, there is an m-ary function g on A such that for all x,, . . ., xm-, E A, U k p[xo, . . ., X, - ,, g(xo, . . ., x,-~)]. Let U' be the expansion of U to an 9'-structure in which 0 is interpreted as g. Then 2l' is a model of I",so U' is a model of #. Since # is a formula of 9 , 0 U is a model of #. Theorem 11.32 justifies the common intuitive practice in mathematics of introducing notation for objects proved to exist. For example, after proving that an algebraic equation of a specified type has a solution, one introduces a name c for such a solution. By 11.32, nothing new not involving c can be proved after this that was not provable before. The procedure can be used even if one cannot pick out a unique such c. We now want to generalize the process described in Theorem 11.32. The construction we give is essential for our present purpose of proving the Skolem normal form theorem and Herbrand's theorem, and also plays an important role in model theory.
The following two propositions are obvious.
Proposition 11.34. any first-order language has a Skolem expansion. Proposition 11.35. If 9' is a Skolem expansion of 9, then IFmla21 I Fmlap 1.
=
The following lemma is fundamental for our main results.
Lemma 11.36. If 9' is a Skolem expansion of 9 , then any 9-structure can be expanded to a model of the Skolem set of 9' over 9 . PROOF. From the definition of Skolem expansions, we see that it is enough to prove the following statement:
' ' be a primitive Skolem expansion of 9, and U an Statement. Let 2 2-structure. Then 21 can be expanded to an 9'-structure which is a model of all sentences [[3v,p(vo,. . ., v,) + p(vo, . . ., v,- ,, a)]], where p is a formula 71 1
Chapter 11 : Some Basic Results of First-order Logic
Part 2: Elements of Logic
of 9 , a = S3uiVIOa0. . .am-l, m v-'ao < - - . < ~ - ' a , - ~ .
=
IFv 3qp,l, and Fv 3viV
= { a o , . . .,
bs-+ p,;
a,-,) with
(ii) if9L is a model of the Skolem set of 9' over 9, then 3 I=p, -+ p,S; (iii) ifr is a theory in 9 and r' = {@ : p, E r)-ThmP, then the following conditions hold: ( a ) if% is a model of P and U' is an expansion of U to a model of the Skolem set of 9' over 9 , then U' is a model of r'; (b) if%' is a model of I", then U' 1 9 is a model of r; (c) (I", 9 ' ) is a conservative extension of (I?, 9 ) ; (iv) p, has a model iff r,oS has a model.
To prove this statement, let C be a choice function for nonempty subsets of A. Let # = 3vip, be a formula of 9 , with Fv 3vip, = {ujo,. . ., v ~ ( , - ~ )where ), jO < . . . < j(m - 1). We define an m-ary operation t, on A as follows. For any x,, . . ., x , -,E A, set t,(xo, . . ., x,-I)
=
t,(xo, . . ., x,-,)
=
C{a : there is a y E p,% such that y, and y,, = x , for each k < m ) , CA if the above set is empty.
=
a
PROOF. Clearly cpS is universal and Fv p, = Fv @. Condition ( i ) is easily proved by induction on p,, as is (ii).To prove (iii)(a),assume its hypothesis and let p, E I?. Then U 1 p, by hypothesis, so by (ii), U' t @. Thus U' is a model of r', as desired. Condition (iii)(b)follows from (i). To prove (iii)(c),assume first that r 1 p,, p, a sentence of 9 . If U' is any model of I", then by (iii)(b), U' 1 9 is a model of r and so U' 1 9 I= p, and U' t p. Thus F' t p,. Now assume that I?' k p,. Let U be any model of r. By Lemma 11.36, let U' be an expansion of U to a model of the Skolem set of 9' over 9 . Then by (iii)(a), U' is a model of I", so U' t p, by assumption. Thus U t p,. Hence r t p,, as desired. Condition (iu) is immediate from 11.36, (iii)(a),and (iii)(b) (with I? axiomatized by {p,)). 0
Let U' be the expansion of U to an 9'-structure in which each symbol S, is interpreted as t,. To show that U' is as desired, consider any formula # = 3vip, of 9 with notation as above. Suppose x E "A and U' t 3qp,[x]. Then U t 3vip,[x]since 3u,p, is a formula of 2. Thus there is an a E A such that U t p,[x',]. Hence the first clause in the definition of t,(xjO,. . ., x ~ ( , - ~ ) ) gives an element b E A such that U t p,[xL]. Let a be the term S 3 v i c ~ j O - - . u,,,-,,. Recall that the formula p,(vo,. . ., U , - ~ Uhas ) the form Subf;'p,', where p,' is obtained from p, by replacing bound variables suitably. Clearly U t p1[x;], where b = t,(x,,,. . ., x,,,-,,). Hence we easily infer that U C Subfgp,'[x].Thus U' is a model of [[3vip,(vo,.. ., ui) + y(uo, . . ., v , - ~ ,u)]], as desired. 0
The starting point of our considerations concerning Herbrand's theorem is 11.38(io). From it one can easily obtain an equivalent condition for a prenex sentence p, to be universally valid. Indeed, this is true iff i p , has no model, and the sentence i p , is equivalent in a natural way to a prenex sentence #. Thus tp, iff # has no model iff t,hS has no model (by 11.38(iv)) iff C T # ~The . sentence - 1 4 ~is equivalent to a certain prenex sentence with only existential quantifiers. We define it explicitly as follows.
The functions introduced in the expansion of U to U' in the proof of 11.36 are called Skolem functions. The entire method associated with Skolem expansions is sometimes called the method of Skolem functions. One of the main properties of Skolem expansions is that every formula becomes equivalent, in a certain sense, to a prenex formula having only universal quantifiers :
Definition 11.39. A formula p, is existential if it is in prenex normal form with only existential quantifiers. Let 9' be a Skolem expansion of 9, with notation as in 11.33. With each prenex formula p, of 9' we associate the prenex formula p," obtained from p, by interchanging 3 and V and replacing the matrix # of p, by -I#. Now with each prenex formula p, of 9' we associate a formula p H :
Definition 11.37. A formula is universal if it is in prenex normal form with only universal quantifiers. Let 9' be a Skolem expansion of 9 , with notation as in 11.33. With each prenex formula p, of 9' we associate a formula qS:
vS = p, if p, is quantifier free; ( V a y y = ValpS; ( 3 ~ i ~ )=' vS(vo,. . ., V i - l r a),
-
where a = S$ui,/30. .&-l, FV3v19 = {Po,. . ., Prn-,) with v-lPo < . . < v - ~ ~ , - , ,and j is chosen minimal so that 3v1p,is a formula of 9,.
i 211
Theorem 11.38 (Skolem normal form theorem). Let 9' be a Skolem expansion of 9.For every prenex formula p, of 9 , the formula yS is universal and the same variables occur free i: y as do in qP. Furthermore, for any prenex formula p, of 9' we have: 3 13
i
where a = S1,Po.. .P,-l, # = 3vip,", Fv # = {Po,. . .,rBm-l} with v-lrBO < - .. < v-lP,-,, and j is chosen minimal so ihat # is a formula of g..
Theorem 11.40. Let 9' be a Skolem expansion of 9,and let p, be a prenex formula of Y. Then: ( i ) p,H is an existential formula;
Part 2: Elements of Logic
Chapter 11: Some Basic Results of First-order Logic with 4 quantifier-jree. Then kp zflsome disjunction of instances Subf:;. - Subf :$I:;+ of $I is a tautology, where a,, . . ., a,-, are variable-free terms.
(ii) kpH o lpns; (iii) ifp is a sentence, then tcp iff CpH. PROOF. (i) is obvious from the definitions. To prove (ii), first note that t- ~ go, vn. Next we prove (ii) by induction on the length of p; it is clear if cp is quantifier free. Now ( 3 ~ z p = ) ~3acpH, and we assume inductively that kpHo i p n S . Thus C(3ap)He,3a -I f S . Also C3a i pnSt, -MapnS, and (VCZP;")~ = VaVnS.Since (3ap)n = Vapn, it follows that C(3a1p)~ o l(3ap)ns, ) ~ . ., v,-,, a), with notation as in as desired. Next, let ( V U ~=~pH(vo,. 11.39. By the induction hypothesis, CcpH o i p n S , SO CpH(vo,. . ., vi-,, a) o - I ~ ~ ~. (. .V , vi, , a). Recalling 11.37, we see that qPS(v0,. . ., vi- ,, a) = ( 3 ~ ~ ~Note " ) ~that . (Vuip))"= 3uipn. Thus t-(V~~cp)~ t* 1(VulpyS, as desired. Finally, we prove (iii) :
,,
Cp
iff iff iff iff
-up does not have a model pn does not have a model pnSdoes not have a model (by 11.38(iv)) C -pnS iff CpH(by (ii)).
where a,, . . ., a,-, are variable-free terms of 9'.We claim that I' is inconsistent. For, if it is consistent, then it has a model U. Let B be the set of all elements ,aU of A (see 11.4), where a is a variable-free term. If R is a relation symbol of rank n, denoted by RU in U, let R~
=
{(x,, . . ., x,-
: x,,
. . .,x,-
OsOab. . - 'a?-
0
PROOF. Assume that p is not a tautology; let f be a truth valuation (10.19) such thatfp = 0. Let A = Trm9. For any relation symbol R, say R of rank m, let RU = {(T,,. . ., T , - ~ ) :~ R T ~ . - - T , - ~11.. = Also, for any operation symbol 0 , say of rank m, let
With these denotations for operation symbols and relation symbols we obtain an 2-structure U. Note that aUx = a for every term a where xi = (q) for each i E w . Hence by induction on 4 we easily obtain: for any quantifier-free formula 4 not involving equality, U C $[XI ifff* = 1. 0, it follows that ZI # ~ [ x ]so , #p, as desired.
::", :;II,
E
B and (x,, . . .,x,- ,)
E RU).
,
Theorem 11.41. If p is a quantijier-free formula not involving equality and Cp, then p is a tautology.
=
i S u b f $. . .Subf
If 0 is an operation symbol of rank n, denoted by 0% in 3,let for variable free terms a,, . . ., a,-
Herbrand's theorem in a sense reduces provability to checking tautologies. The following result, interesting in itself, is one of the main lemmas for the theorem.
Since f p
PROOF. =>. Assume Cp. Thus by 11.40, kcpH. Now let I' be the set of all sentences
=
'(Oa,.
. .a, - ,)a.
This definition is easily justified. Thus we obtain a structure 23. Since each member of r is quantifier-free, 23 is a model of r. Since kcpH, choose x,, . . ., x,-, E B SO that 23 C #[x,,. . ., x,-,I. Say xi = 'a? for each i < m. Thus Subf J;. - .Subf J\",t;+ holds in 23, which is a contradiction since 23 is a model of I'. Thus r is inconsistent. Hence by 10.92, some disjunction of negations of members of I' is valid, so by 11.41 it is a tautology, as desired. e.Obvious. 0 We give one simple application of Herbrand's theorem: Consider the formula 4 = 3aV/3p +V/33ap, where a and are distinct variables and p is any formula (possibly involving equality). We want to prove that h,b by using Herbrand's theorem. It is of course easy to prove k# by a direct semantic argument, but as we shall see, an application of Herbrand's theorem is more routine. Let 9 be our original language. Choose n > 0 so that Fv p E {v,, . . ., un-,). Expand the language to 2' by adding a new n-ary relation symbol R. Now let p' = Rv,. . -v,-,, 4' = 3aV/3p1+V/33ap1. We first show that 14'. Let y and 6 be new variables. Then a prenex formula equivalent to 4' is
x = VyV/3363a(~ S u b f Subf $$p'
v p'),
0
Now we can give our version of Herbrand's theorem. Several versions of this theorem can be found in the literature. It has found considerable use, especially in finitary proofs of the consistency of theories. Theorem 11.42 (Herbrand). Let 9' be a Skolem expansion of p(%: and let p be a prenex sentence of 2" not involving equality. Say pH = 301,. . .3a, - ,t,h
and
XH
has the form 363a( ~ S u b f :Subf &' v Subf ip'),
of where c and d are new individual constants, in a Skolem expansion 9" 9'An . instance of the matrix of this prenex formula is the tautology ~ S u bPf u b f ip' v Subf Subf ip'.
Part 2: Elements of Logic
Thus k#' by Herbrand's theorem. Now let I? be the theory consisting of all consequences of the sentence
I
+
+
The fundamental model-theoretic relationships concerning interpretations are expressed in the following proposition, which is easily proved by induction on the formula p,. Proposition 11.45. Let U = (x,f, R, I") be a syntactical 9-structure in 9 ' , and let B .be a model of .'?I Then for any formula p, of 9 and any x E OBr'% we have Br'% t= p[x] iff23 i=p,a[x]. Corollary 11.46. Let F be a theory in 2 , and let U = (x,f, R, 1'') be an interpretation of F in 9 ' . Then for any formula p, of 9 , the condition P C p, implies that I?' k p,%. I
i
1
1
If F is a theory in 9 , we say that U is an interpretation of I? in r' provided that r' t= p,% for each p, E I?. With each model B of I?' we associate an 9-structure Br'% = B(Ff, U) as follows: Bra = lX3; for 0 an operation symbol of 9 , say m-ary, and for any b,, . . ., b,-, E By%, let OQ(r',a)(bo,. . ., b, - ,) = fZ(b,, . . ., b,-,) ((ii) assures that Br'% is closed under 0%('.%)); for R a relation symbol of 2 , say R m-ary, let Rs(ygU) = "'RE n lx2. In case, to start with, 9 and 9' are effectivized first-order languages with corresponding Godel numbering functions 9 and g', a syntactical 9-structure U in 9 ' , with notation as above, is effective provided that the functions g ' o f o g - l rg*DmnCo and g'+ o R o 9 - l r g * D r n n B are partial recursive (no further restrictions on I").
We give a few simple facts about these notions. First, concerning effective interpretations, the following proposition is clear. Proposition 11.44. Let U be an effective syntactical 9-structure in 9 ' . Then the formation of UU and p,a is effective. That is, 8'+0 f 0 8+ 19 * Trm2 andg' 0 f 0 9 + 19+ * Fmla2 are partial recursive, wheref is the function assigning 0%to a and p,% to p,.
is a definitional expansion of ({p, E Sent2 : by), 2 ) . Clearly (I?, 9') It is also easy to see that 1' C 4- 4'. Hence 1' t= 4 since we know that k+'. By Theorem 11.31, ( r , 9 ' ) is a conservative extension of ({p, E Sent2 : t=p,), Y ) , so h/~,as desired. The final topic of this chapter is the notion of an interpretation of one theory in another. This can be viewed as a syntactical counterpart of the notion of a model. All of the definitions relevant to this new notion are given in the following Definition 11.43. Let 9 = (L, v, 0,W) and 9' = (L', v', LO,' W') be two first-order languages. A syntactical 9-structure in 9' is a quadruple U = (x, f, R,I?') such that x is a formula of 9' with Fv x G {v,), f : Dmn LO + Dmn LO' and U'fO = LOO for each 0 E Dmn LO, R : Dmn B -+ Fmla2, and Fv RR E {v,, . . ., urn-,), with m = B R , for each R E Dmn 9, while 1'' is a set of sentences of 9 'satisfying the following conditions: (i) F' t= 3u0x; (ii) F' t= Vv, . . - Vv, - ,(Ai,, x(vi) += x(fovo - - .v, - ,)) for each operation symbol 0 of 2 (say of rank m). Given a syntactical 9-structure U with the notation above, with each term o and formula p, of 9 we associate a term 0%and formula p,' of 2' as follows (this is the syntactical counterpart of Definitions 11.2 and 11.5) :
Chapter 11: Some Basic Results of First-order Logic
PROOF. Assume that F k p,, and let B be any model of r' (thus '23 is an 9'-structure). Since I" C 4% for each 4 E r , it follows that 8 t= 4%for each 4 E I?, and hence by 11.45 Bra is a model of F. Thus Br'% t= p, by assumption, so by 11.45 again, B k p,%. Thus I?' C p,%, as desired. 17 BIBLIOGRAPHY 1. Chang, C. C., Keisler, H. J. Model Theory. Amsterdam: North-Holland Publ. Co. (1974). 2. Shoenfield, J. Mathematical Logic. Reading: Addison-Wesley (1967). 3. Tarski, A., Mostowski, A., Robinson, R. M. Undecidable Theories. Amsterdam: North-Holland Publ. Co. (1953). EXERCISES
I
11.47. Show that the restriction that a not occur in a or in 7 is essential in Lemma
10.39. 11.48. Show that the restrictions in 10.49, that only free occurrences of a are 11.49. 11.50. 11.51. 11.52. 11.53.
replaced and that the new occurrences of 7 are free, are essential. Show that in 10.59 it is essential that j3 not occur in p,. Show that the restriction of 10.61 is essential. Show that in 10.71 the string of quantifiersVor,. . .Vor,-l cannot be deleted. Show that Ifv, = vl -+ vo = v2 (cf. the remarks after 10.86). Carry out a modification of the proof of 11.12 in which B is the set of all individual constants of 3
Part 2: Elements of Logic
11.54. Show that any consistent set of formulas in a language 9 can be extended
Cylindric Algebras
to a maximal consistent set of formulas of 3 11.55. Let K be the class of all groups in which every element is of finite order, and let 9 be an appropriate first-order language. Show that there is no set I' of sentences of 9 such that K = {U : U is a model of I'). 11.56. Let K be the class of all fields of prime characteristic, and let 9 be an
appropriate first-order language. Show that there is no set of 9 such that K = {U : U is a model of I?).
12*
r of sentences
11.57. If a sentence g, holds in all non-Archimedean ordered fields, then g, holds
in all ordered fields. 11.58. Let I? be a theory in a language d%: Suppose that for every finite subset A of I? there is a model of A which is not a model of I?. Then there is no finite set 9 of sentences which has exactly the same models as I?. 11.59. Let K be a nonempty set of 9-structures. For each L K let CL = {U E K :2l is a model of every sentence which holds in all members of L). Show that with respect to C as a closure operator, K is a compact topo-
logical space. Cylindric algebras stand in the same relationship to first-order logic as Boolean algebras stand to sentential logic. We present in this chapter an introduction to the theory of these algebras paralleling our treatment of Boolean algebras. Again, the simplest motivation for the study of these algebras is from elementary set theory:
11.60. Establish using Herbrand's theorem that any formula of the last type in
10.101 is universally valid.
Definition 12.1. Let U be a nonempty set and a an ordinal. For each K < cr we define a one place operation C, on subsets of "U by setting, for any x G "U,
C,X={x~~U:x~cr~{~}=y~cr~{~)forsomey~ For
K,
X < a we set
DKh= { X E aU : X,
=
x,).
Thus C,X is the generalized cylinder obtained by moving X parallel to the K-axisin a-space, while D,, is a diagonal hyperplane. An a-dimensional cylindric$eld of sets is a set at' of subsets of "U (for some U) which is a field of sets in the Boolean sense and which is closed under all operations C, and contains all sets D,, as elements. A cylindric set algebra of dimension a is a structure (d,u,n, N , 0,"U, C,, DKh)K,h
a
?
The general notion of a cylindric algebra is obtained by abstraction from this notion:
Delinition 12.2. By a cylindric algebra of dimension a (where number), for brevity a CA,, we mean a structure
a
=
< A , +,
., -,0,1, c,,
~,A>,,A<,
a
is an ordinal
Chapter 12: Cylindric Algebras
Part 2: Elements of Logic such that (A, +, ., -, 0, 1) is a BA, c, is a unary operation on A for each K < a, d,, E A for all K, A < a , and the following axioms hold (for all K, A,p < a a n d a l l x ~ A ) : 0; X I c,x; c,(x. C, y) = CKX.C, y ; C,C,X = c,c,x; d,, = 1; if K # A, p, then d,, = c,(d,,.d,,); if K # A, then c,(d,,.x).c,(d,,.-x)
(Cd (C2) (C3) (C4) (C5) (CJ (c7)
c,o
=
=
+
+
c,(x + y) = Oand (v) yieldsc,x.-cK(x y) = 0. Thusc,x I c,(x y), and similarly cKyI c,(x + y). Next, c,x.(-cKx.-c,y) = 0, so x.c,(- c,x.- c,y) = 0 by (0). Similarly, y.c,(-cKx.-c,y) = 0, so (x + y).cK(-c,x.-c,y) = 0, and an application of (v) yields c,(x + y).-c,x.-c,j~ = 0, i.e., c,(x y) I c,x + c,y. Thus (vi) holds. (vii): if x I y, then x + y = y, so c,x I c,x c,y = c,(x + y) = c,y, using (vi). (viii): The inequality -cKx I c, - c,x is an instance of (C,). By (iii), -cKx.cKcKx= 0, so by (v), cK-c,x.c,x = 0, -c,x, as desired. (ix): by (C,) we may assume that K # A. i.e., cK-c,x I Then, since c,(d,,.d,,) = d,, = 1 by (C,) and (C,), we have
+
+
0.
By routine checking one obtains Corollary 12.3. Every cylindric set algebra is a cylindric algebra.
The following proposition summarizes elementary properties of CA,'s which will be used later without specific reference. In what follows results are implicitly relative to an arbitrary CA, U, arbitrary K,A, p < a, and arbitrary x, y, z E A, unless otherwise stated. Proposition 12.4 (i) If c,x = 0, then x = 0. (ii) c,l = 1. (iii) c,c,x = c,x. (iv) x E Rng c, if c,x = x. (v) x.c,y = 0 ifc,x-y = 0. (vi) c,(x y) = c,x c,y. (vii) Zf x < y, then c,x I c, y. (uiii) c, - c,x = -cKx. (ix) dKh= dhlc. (x) c,d,, = 1. (xi) If K # A, p, then c,d,, = d,,. (xii) If K # A, then c,(d,, .- x) = - c,(d,, -x). (xiii) If K # A, then d,, .c,(d,, - x) = d,, .x.
+
so d,,.-d,, = 0 by (i). Thus d,, I d,,, so (ix) follows by symmetry. (x): by (C,) and (ii) we may assume that K # A. Then
(xi): Assuming
K
# A, p, we have
(xii): by (C,), c,(d,,.-x).c,(d,,.x)
Hence c,(d,,.-
x)
= - c,(d,,.x)
=
0. On the other hand,
by 9.6(xii). (xiii) : we have
+
so d,, .-x.c,(d,, easily follows.
.x)
so c,x. y = 0 by (i). The converse is the same statement. (ui): Since c,(x + y). -c,(x + y) = 0, by (0) we have (x + y).c, - c,(x + y) = 0, so x . c, -
0 and hence d,,.c,(d,,.x)
I x,
from which (xiii)
0
An elementary operation which will play an important role in later considerations is as follows. Definition 12.5. For
PROOF. (i), (ii): immediate by (C,). (iii): Putting x = 1 in (C3) we obtain c,c,y = c,l -c,y, so (iii) follows from (ii). (iv): if x E Rng c,, say x = c,y. Then c,x = c,c,y = c,y = x by (iii). The converse is trivial. (v): if x.c,y = 0, then
=
K,
h < a and x
if sfx = x sfx = c,(d,,.x)
E K
A we set =
A, if
K
# A.
For later use we give some properties of this operation; they are easily established on the basis of 12.4: Proposition 12.6 (i) st is an endomorphism of ( A , (ii) If K # p, then s:d,, = d,,.
+, ., -, 0, I).
Chapter 12: Cylindric Algebras
Part 2: Elements of Logic
+
In general there is no simple expression for the elements of the subuniverse generated by X, unlike the situation for BA's (cf. 9.1 1).
(iii) If K p, v, then s:d,, = d,,. = d,,-x. (iu) d,,.s:x (v) If p # K, A, then dKA.s:x = dKA.s8x. (vi) s$,x = c,x. (vii) If p # K, A, then s:c,x = c,s:x. (viii) If K # p, then SFSEX = SEX. (ix) s:s:x = stsix. (x) I f A # p Z K # V,then s:$x = s;s:x. (xi) s;s$x = sffs:x. (xii) s:s:c,x = sfc,x. (xiii) S ~ S ,cVx ~ C = s~s~c,c,x.
Definition 12.12. Let U and 23 be CA,'s, with notation as in 12.9. A homomorphism from U into 23 is a function f mapping A into B such that for all X, y E A and K, A < a,
For later purposes it is convenient to introduce the notion of the dimension set Ax of an element x, giving the coordinates in which x is not a cylinder: Definition 12.7. Ax
=
(i) f(x + Y) = fx +'fy; (ii) f(x.y) = f x . 3 ; (iii) f(-x) = -Ifx; (iu) f 0 = 0' ; (0) f l = 1'; (ui) fc,x = ckfx; ,. (vii) fdKA= &A The terms homomorphism onto, isomorphism into, and isomorphism onto have the obvious meaning. We write U 23 if there is an isomorphism of U into 23.
{K: c,x # x).
The following proposition gives some easily established properties of this notion :
Proposition 12.13. Iff is a homomorphism from U into 23 and x E A, then A ~ X G ax.
Proposition 12.8 (i) A0 = A1 = 0. (ii) If dKA# 1, then AdKA= {K,A). (iii) A(x + y) c Ax U Ay. (iu) Ax = A - x. (v) A(x.y) c Ax u Ay. (vi) Ac,x G Ax {K). (vii) As:x E (Ax {K})u {A).
Definition 12.14. Let U = ( A , ideal of U is an ideal of ( A , x E I then C,X E I.
+, -,-, 0, 1, c,, dKA),,,,, be a CA,. An +, -, 0, 1) such that for all < a, if K
a,
+
Proposition 12.15. Let I be an ideal in a CA, U, and let R = {(x, y) : x .-y - x .y E I ) (cf. 9.16). Then for any K < a and x, y E A, ifxRy then c,xRc, y.
--
PROOF. Assume that xRy and
K
<
a.
Thus x.- y
+ - x - y E I. Now
Now we consider some algebraic notions as applied to cylindric algebras. hence
+',
Definition 12.9. Let U = ( A , +, ., -, 0, 1, c,, d,,), ,,,, and 23 = ( B , O', It, ck, dbA)K,A,,be CA,'s. We say that U is a subalgebra of 23 if A c B, 0 = O', 1 = l', d,, = d:, for all K, A < a , and for all x, y e A , x + y = x + ' y , x . y = x.'y, - x = -'x, and c,x = ckx for all K < a. For any X G B, X is a subuniverse of 8 if O r , 1' E X, dkAE X for all K, A < a , and Xis closed under +', .', -' and ck for each K < a. a',
-I,
Proposition 12.10. If sl is a nonempty collection of subuniverses of a CA, U, then is a subuniverse of 21.
nd
n{
Definition 12.11. If X G A , 21 a CA,, then the set Y : X c Y, Y a subuniverse of 2f) is called the subuniverse of 21 generated by X.
Thus c,x.-c,y E I, and by symmetry, c , y -c,x C, y E I and c,xRc, y.
E
I, so c,x.-c,y
+ -c,x. 0
Along with 9.16 and 9.17, Proposition 12.15 justifies the following definition : Definition 12.16. Let Zbe an ideal in a CA, U = ( A , + ,., - ,O, 1, c,, dKA),,,., We define %/I = (AII, +', .', -', O', l', c!, dkA),,A<,,where
Chapter 12: Cylindric Algebras
Part 2: Elements of Logic
in accordance with 9.17, cL[a] [d,,] for all K, h < a.
=
[c,a] for all a E A and
K
< a, and dLA=
Furthermore, we let %#' =
+, -,-, 0, 1, c,, d , ~ ) ~ . ~ < ~
is a CA,, and I * is a Proposition 12.17. If I is an ideal in a CA, U, then %/I homomorphism from U onto %/I. Proposition 12.18. I f f is a homomorphism from a CA, U onto a CA, 23 and %/I. I = {x E A :fx = 0), then I is an ideal of U, and 23 Proposition 12.19. The intersection of any nonempty family of ideals in a CA, is an ideal. Definition 12.20. If U is a CA, and x is the set
c A,
then the ideal generated by X
r ) { I : X c I, I a n ideal of U). We can directly generalize 9.23 to give a simple expression for the members of the ideal generated by a set:
Proposition 12.21. If X G A, U a CA,, then the ideal generated by X is the collection of a l l y E A such that there exist m , n E w and x E mX,K E with y I CKO' ' 'C,(,-l)(xO+ ' +xm-1). "
PROOF. Let I be the collection of all y E A such that such m , n , x, K exist. Clearly I is contained in the ideal generated by X. Thus it is enough to show that X c I and I is an ideal. Taking m = 1 and n = 0 we easily see that X E I. Taking m = n = 0, we see that 0 E I and hence I # 0. If z 5 y E I, obviously also z E I. If y E I, with m , n, x, K as above, and if h < a, then CAY
+ ' + xm-I),
5 C),C,().' 'CX(, - ~)(xO
' '
so cAyE I. Finally, suppose y, y' E I, with m , n, x, K and m', n', x', the corresponding conditions. Then Y
+ y'
so y
I cKo.. .cKcn - i)(xo I CK0' ' 'C,(,-l)CK.o-
+ y'
+ . . + X, '
-
'C,y,.-l)(~o
K'
satisfying
+ cKpo c,,(,, - l)(xb + . . + x&*- 1) + . . . + xm-1 + x; + . . . + x&.-1),
E Ialso.
0
We shall not develop the algebraic theory of CA,'s any further. Instead, we now turn to the relationships between first-order logic and cylindric algebras. In this regard the following definition is fundamental.
Definition 12.22. For 9 a first-order language and I? a set of sentences in 9we set
= g = {(p,, 4) : p, and 4 are formulas of 9and I? C p, o 4).
This definition is easily justified (see 9.54-9.56). Routine checking gives:
Proposition 12.23. %f is a CA,. As in the case of sentential logic and Boolean algebras, there is a natural correspondence between notions of first-order logic and notions of cylindric algebras. We give two instances of this correspondence. The first one indicates the close relationship between set algebras and models of a theory:
Proposition 12.24. Let I'be a set of sentences in afirst-order language 9, and let U be a model of r. Then {p,% : p, E Fmla2) is an w-dimensional field of sets. Let 23 be the associated cylindric set algebra. Then the function f such that f [p,] = for each p E Fmla2 is a homomorphism of %f onto 23 (f is easily seen to be well defined). This proposition can be routinely checked. The following proposition is established just like 9.59.
Proposition 12.25. Let I be an ideal in a CA, mi??",and set A -[TI E I). Then I' G A, and %F/I is isomorphic to %If'.
= {p, E Sent2:
The algebras 2IlF possess a special property not possessed by other CA,'s; the definition of this property is given in
Definition 12.26. Let U be a CA,. We say that U is locallyfinite dimensional provided that for all a E A, Aa is finite. In the case of an algebra %f, if p, is any formula and v, is a variable not occurring in p, then C3v,p*p, and hence c,[p,] = [3v,p] = [p]. Thus {K : vK occurs in p,), and hence A[p] is finite. Hence: A[p]
Proposition 12.27. mf7 is locally finite dimensional. The following result is an analog of 9.58; it shows that the algebras have a certain freeness property.
Part 2: Elements of Logic
Chapter 12: Cylindric Algebras
Proposition 12.28. Let 9 = ( L , v, 0, 9 ) be a Jirst-order language with no operation symbols. Suppose U is a CA,, and f : Dmn B + A is a function such that A f R G gRfor all R E Dmn B. Then there is a homomorphism g from 2ltF into U such that g[Rv,. . .vm- = fR for each R E Dmn W (with, say, BR = m).
v, = v, or v, = v,, and again obviously hp, = 1. If with K $ p, then x is v, v, or u, = u,, and
=
4 is
v,
= v,
or u,
= v,
,]
PROOF. The proof is similar to that of 9.58, but is much more tedious. We first define a function h : Fmla2 4 A ; hp, is defined by induction on p,. The most complicated part of the definition is the case in which p, is an atomic formula of the form RviO.. .v~(,-~,.In this case, let j,, . . .,jm-I be the first m integers in w {iO, . . .,i(m - l), 0 , . . .,m - 11, and set
-
hence
So we may assume that
+ has the form Ruio. - - vict- l)vKvi(t+ . .
x is RviO.. ;vict- l ) ~ A ~ i ( tl +) . . .vi(,,-
l).
l).
Vi(m- 1 )
and
In this case we need several lemmas.
.
Let j,, . .,jm-I E w, and let k,, . . ., km-,, 1 be distinct integers in w {j,,. . .,jm-l, 0 , . . . , m - 11, and assume that u < m . N
for motivation, cf. the comments following 10.74. The inductive definition of hp,proceeds very simply: h(v, = v,) = dKA, h(p, v +) = hp, + h+, h(p A +) = hp,.h+, h( ip,) = - hp, hVv,p, = -c, - hp,. Analogously to the sentential case, we now claim if tp,, then hp,
(1)
=
(3) Then
The proof is straightforward
1.
To prove ( I ) , let F = {p, : p, E Fmla2, hp, = 1). Now each logical axiom is in F. We prove this in detail for each kind of axiom. First suppose hp, # 1 ; we show that p, is not a tautology. Let I be a maximal ideal of the BA 23 = (SF, +, ., -, 0 , 1) such that hp, E I, and let T be the natural homomorphism of 23 onto 2311. Then BII is a two-element BA, and T 0 h can be considered as a truth valuation. Since vhp, = 0 , p is not a tautology. Next, suppose p, has the form Vv,(+ + X )+ (Vv,+ +Vu,x). Then
+ +
+
hp, = --c,-(-h+ + hx) --c,-h+ -c,-hx = c,(h+.-hx) c,-h+ -c,-hx 2 c,(h+.-hx) c,(-h$.-hx) -c,-hx = c,-hx -c,-hx = 1.
+
+ +
if v, does not occur in
(4)
+, then
$ Ah+.
+
+,
+ -c,-
h#
= - h+
+ - - h#
=
1 (using 12.8(iv)).
The desired conclusion for p, of the form 3vK(vK= v,) is clear. Finally, suppose p, is vK= U , + (+ + X), where x and are atomic and x is obtained from II, by replacing an occurrence of v, in by v,. We may suppose that K # A, since if K = h then = x and obviously hp, = 1. I f is v, = u,, then x is
+
+ +
Let jO, . . .,j(m - 1) E w, and let kO, . . .,k ( m - I), 10, . . ., I(m - 1) be distinct integers in w {jO, . . ., j(m - I), 0 , . . ., m - 1). Then
K
To prove (2) we proceed by induction on +. First suppose is Rvio. .uicmThen with notation as in the definition of h+, by 12.8(uii) we have Ah+ c {iO, . . ., i(m - 1)). Thus (2) holds in this case. All other steps in the inductive proof of (2) are easy using appropriate parts of 12.8. Thus (2) holds. Hence if p is + Vu,+ where v, does not occur in then hp, = --h+
-
+
For the next kind of axiom we need a lemma: (2)
Thus (3) holds. By induction from (3) we obtain
+
We can also prove the following slightly stronger statement: LetjO, . . ., j(m - 1) E w, let kO, . . ., k ( m - 1) be distinct integers in w {jO, . . .,j(nz - I), 0 , . . ., m - 11, and let 10,. . ., l(m - 1) ( 5 ) also be distinct integers in w {jO, . . .,j(m - I), 0 , . . .,m - 1). Then the conclusion of (4) still holds.
-
-
-
In fact, let PO,. . ., p(m - 1) be distinct integers in w {jO, . . ., j(m - I), 0,. . .,m - 1 , kO, . . ., k ( m - l ) , 10,. . .,I(m - 1)). Then, using (4) twice,
Part 2: Elements of Logic
Chapter 12: Cylindric Algebras
Now we return to checking that hp = 1 (see above prior t o (3)). Choose j0, . . .,j(m - 1) E w {iO, . . .,i(t - 1))i(t f I), . . .,i(m - l), 0, . . .,m - 1, K , A), and set
12.33.* Prove COG(-do19- do2.- d12) = cOc1c2(-dol . - do2.- dl,) (even if a
=
3).
12.34. If a > 1 and co is the identity mapping, then each c, is the identity mapping, and d,, = 1 for all K , h < a. 12.35. Every finitely generated CAI is finite. 12.36. For any a 2 2 there is an infinite CA, generated by one element. Hint:
+
by 12.6(u), so hp = -dKA -sLtx + sitx = 1, as desired. We have now shown that hp = 1 for each logical axiom p, i.e., each logical axiom is in the set I' defined following (1). Obviously I? is closed under detachment and generalization. Thus each logical theorem is in I', and (1) follows. Now if kg, t,4, then h(p t,4) = 1, and hence it follows easily that hp = h$. Hence (since 1 = k) there is a function g mapping M$ into A such that g[p] = hp for any p E Fmla9. It is easily checked that g is the desired homomorphism. 17 The following kind of logical representation theorem is an obvious consequence of 12.18, 12.25, and 12.28.
Theorem 12.29. If 21 is a locally finite dimensional CA,, then U z 3nf for I'. some 9, As an easy consequence of 12.29 we obtain the following analog of the Boolean representation theorem.
Theorem 12.30. If U is a locally finite dimensional CA,, is a homomorphism of U onto a cylindric set algebra.
I A1
> 1 , then there
PROOF. By 12.29 we may assume that U = 'ZIF for some 9,F. Then is consistent, since IAI > 1. Let 9 be a model of I'. The desired conclusion now follows from 12.24. BIBLIOGRAPHY 1. Halmos, P. R. Algebraic Logic. New York: Chelsea (1962). 2. Henkin, L., and Tarski, A. Cylindric algebras. In Proc. Symp. Pure Math. ( A M S ) , 2 (1961), 83-113. 3. Henkin, L., Monk, J. D., and Tarski, A. Cylindric Algebras, Part I. Amsterdam: North-Holland (1971). EXERCISES 12.31. Prove c, - cAx.cA- c, - x 12.32.
Prove cocl - dol
=
0.
= co- dOl (even
if
cl =
2).
consider the cylindric set algebra of subsets of "w generated by {X E ,w : X o < xl}. 12.37. If U is a locally finite dimensional CA,,, and 0 # x E A, then there is a homomorphism f of 91 onto a cylindric set algebra such that fx # 0. 12.38. If U is a CA,, cc <
w , and IAl > 1, then% x U (understood in the natural sense) is not isomorphic to a cylindric set algebra. Hint: in a cylindric set algebra 23 of dimension a, if x # 0 then co. . .c, - lx = 1.
PART I11 Decidable and Undecidable Theories
I ! E (. J
1 I
/
The main topic of this part is the application of the definitions and results of recursive function theory to logic. The question that is central to our endeavors here is to determine for various particular mathematically interesting theories r whether or not there is an effective procedure to determine of any sentence p, the truth or falsity of r k q.
Some Decidable Theories
13
First we give the basic definitions with which we shall be working in this part.
Definition 13.1. Let r be a theory in an effectivized first-order language 9 = (L, v , 0,9, &2). We say that I? is decidable if y + * r is recursive, and undecidable if g *ris not recursive. +
'
,
In this chapter we give a few examples of decidable theories. The methods for proving theories decidable are numerous. Some of the easiest methods are model-theoretic, so we shall give more examples of decidable theories in Part IV. For proving theories decidable, the extensive mechanism of recursive function theory is not really needed. Almost all of the work can be done on the intuitive level of recognizing that certain procedures are effective. Everything is made rigorous by applying the weak Church's thesis (see p. 46). Many of the theories which have been proved to be decidable are rather simple. The table below may help the reader to get an idea of the complexity decidable theories can have, especially when compared with our list of undecidable theories on p. 279. We also list in each case a convenient method of proof for the decidability of the theory. We shall give a detailed treatment in this chapter for the theories 1, 5, 7 in this table. The method we will use is that of elimination of quantijiers. This method can be described in rough terms as follows. In our given language we single out effectively certain formulas as basic formulas. These will usually not be quantifier free. Then we show (eliminating quantifiers) that any formula is effectively equivalent within our given theory to a sentential combination of basic formulas, i.e., a combination using only v , A , 1.Finally, we give an effective procedure for determining whether or not such a combination is 711
Chapter 13: Some Decidable Theories
Part 3 : Decidable and Undecidable Theories
the intersection of all sets A L Fmla9 such that I? E A and A is closed under v , A , and 1.
Some decidable theories Theory of 1. Equality (no nonlogical constants, no axioms) 2. Finitely many sets (m unary relation symbols, no axioms) 3. One equivalence relation 4. One unary function 5. ( a , s)
A method of proof
Lowenheim 1915
Elimination of quantifiers Elimination of quantifiers
p. 241
m-elementary equivalence Tree automata Elimination of quantifiers Tree automata
p. 354
Janiczak 1953 Ehrenfeucht 1959
-
Rabin 1968
6. Two successor functions* +) 7.
In this book
Proved by
( i ) the domain of # is ( p + 1) x ( m + 1); (ii) for each i I p a n d j I m , #ij E I? or t,hij (iii) Visp A j s m #ij.
p. 243
p. 236 -
Simple ordering (SI, u, n, N , 0, I ) Boolean algebras Free groups Absolutely free algebras 13. Abelian groups 14. Ordered abelian groups 15. Algebraically closed fields 16. Real-closed fields 17. p-adic fields 18. Euclidean geometry 19. Hyperbolic geometry
Ehrenfeucht 1959 Skolem 1917 Tarski 1949 Malcev 1961 Malcev 1961 Szmielew 1949 Gurevich 1964 Tarski 1949
Elimination of quantifiers Tree automata
p. 240
Model completeness
-
Vaught's test
=
Urn,, "2, OW
= w(O>,
=
+ 1) = sAm;
s1
=
s;
s m + l= ssm;
m
=
Am.
0 = 0.
,
-
p. 351
41w
A(m
smvi= a, a a term not involving v,;
Model completeness p. 362 Tarski 1949 Ax, Kochen; Ershov 1965 Reduction to 16 Tarski 1949 Schwabhauser 1959 Reduction to 16
* This is the theory of 3 = (A, 40, dl), where A
i x with x E I?;
The terms of this language are just of two kinds: sma for some variable a, and m for some m E w, where sOais just a. A formula will be called basic if it has one of the following forms :
-
Model completeness
=
F o r the proof, see 8.38. We now turn to the decidability proof for the theory of (w, 4,O). We work in an effectivized language with a unary operation symbol s and an individual constant 0. By induction we set
-
A0 = 0; Presburger 1929
8. 9. 10. 11. 12.
for
all w E A.
a consequence of the theory. This method yields much more information than just the decidability of the theory, as we shall see.
The Theory of
Theorem 13.3 (Disjunctive normal form theorem). Let F L Fmla9. Then for any p, E Qf F such that i p , is not a tautology there exist p, m E w and a function # such that:
(o,o)
For technical reasons, instead of this theory we first consider the theory of (w, 4,O). First we need some notions from sentential logic. Definition 13.2. Let I' G Fmla9 (wheie 2 is an arbitrary first-order language). The set QfI' of quantzj7er-free combinations of members of I' is
; I
Clearly there is an effective method for recognizing when a formula is basic. Let I?, be the set of all sentences which hold in ( w , 6,O). Obviously I?, is a complete and consistent theory. Two formulas p, and # are equivalent (under I?,) provided that p, o # holds in (w, 4,O).
\
Lemma 13.4. For anyformula p, one can effectiuelyjnd a formula # equivalent under I?, to p, such that # is a quantifier-free combination of basic formulas and Fv# 5 Fvp,. PROOF. We proceed by induction on p,. First suppose p, is atomic; thus p, has the form a = T. If no variable occurs in p,, then p, has the form m = n. This is equivalent to 0 = 0 or t o 1(0 = 0)according as m = n or m # n . Suppose a variable occurs in p,. If p, has the form sma = sna for some variable a, then p, is equivalent to 0 = 0 or to 1(0 = 0) according as m = n or m # n. The only forms left are sma = a or a = sma (for some variable a), where a does not involve a. Both are equivalent t o sma = a. This takes care of the atomic case. The induction steps using 1 , v , A are ttivial. T o make the induction step using Va it suffices to show that if p, is a quantifier free combination of basic formulas then 3ap, is equivalent t o a quantifier free combination of basic formulas determined effectively from 3ap. Since
Part 3 : Decidable and Undecidable Theories
Chapter 13 : Some Decidable Theories
A formula p, is basic if it has one of the following three forms:
. . ., p, - do not involve a. Now for p > 0 the following pairs of formulas are equivalent : I
I Note that the third kind of basic formulas involves quantifiers. As indicated in the introduction to this section, this is typical of the elimination of quantifiers method when it is applied to theories of any complexity at all. Lemma 13.8. For any formula p, one can eflectivelyjnd a formula # equivalent to p, such that # is a quantzjier-free combination of basic formulas under and Fv# G Fvp,.
PROOF. The assertion is obvious for atomic formulas, and the induction steps involving 1,v , A are trivial. As in the proof of 13.4 it is hence sufficient to prove the lemma for p, of the form 3 4 , $ a conjunction of basic formulas and their negations. Now the following formulas hold in U:
$ \
=T
- . = n, - , >
1. Thus (1)
w h e r e O ~ i s j I k I l > O , p >l , q o,..., ql-I > 1 , a n d t 0,..., (,-,do not involve a. This in turn is clearly equivalent to
In case i > 0, (2) is equivalent to
Thus we may assume that i Therefore we may actually assume that $ is a conjunction of basic formulas. As in the proof of 13.4, we may assume that each conjunct actually involves a. Now if a is a term involving a, then there is a term T not involving a and an m E Z such that
=
and po PT; and pa < pr; and pa r,,pT. It follows that in (1) we may assume that no = becomes of the form a
CT
=
0; so (2) is equivalent to a formula of the form
where 0 I s I t < u, r,, . . ., ru-, > 1, and rlo,. . ., qu-l do not involve a. Next, we claim that we may assume that u = t 1. This clearly follows from the following number-theoretic fact:
+
Let a, b, m, n be integers with m, n > 1. Letp = lcm (myn); then gcd (plm, pln) = 1, so there exist integers c, d such that c(p/m) d(p/n) = 1. It follows that for any integer y the following two conditions are equivalent : (i) y = a (mod m) and y = b (mod n); (ii) a = b (mod gcd (m, n)) and y = c(p/m)a d(p/n)b (mod p).
+
holds in U. It follows that formulas of the forms (4)
+
are respectively equivalent to formulas of the forms na = p na < p p na -,
or p < nff
To prove (4), assume its hypothesis. Suppose (i) holds. Then y - a = em and y - b = fn for some e, f, so a - b = fn - em, which is divisible by gcd (m,, n). Thus a = b (mod gcd (m, n)). Also,
where n 2 0 and p does not involve a ; and we may clearly assume n > 0. Hence we may assume that p, is equivalent to a formula of the form Thus (ii) holds. Conversely, suppose that- (ii) holds. Write a - b v gcd (m, n). Then y
-a
=y
- c(p/m)a
=Y
- 4plm)a
= 0 (mod m)
- d(p/n)a - d(pln)b - d(pln) v gcd (myn)
=
Part 3 : Decidable and Undecidable Theories
-
-
since y - c(p/m)a - d(p/n)b 0 (mod p) and d(p/n)gcd (m, n) 0 (mod m). Similarly, y = b (mod n). Hence (4) has been checked, and hence in (3) we may assume that u = t 1. If s = 0 or t = s, it is clear that (3) is equivalent to 0 = 0. So, assume that 0 < s < t. Then (3) is equivalent to the following formula:
+
Chapter 13 : Some Decidable Theories
PROOF. The atomic case is trivial, and the induction steps using 1 , v , A are trivial. As in previous proofs it now suffices to assume that p, has the form 3 4 , a quantifier-free combination of basic formulas. Since the formulas em are sentences, and since a = a is equivalent to el, we may assume that p, has the form where Po, . . .,pn-, are distinct variables # a . If m > 0, p, is clearly equivalent to
Theorem 13.9. F2 is decidable. PROOF. By the method of proof of 13.5 we see that it suffices to describe a method for determining the truth in U of basic sentences. The basic sentences are easily seen to be effectively equivalent to sentences of the forms
(or to if m = 1 and n (i : m I i < n). We claim
=
m). Hence assume that m
=
0. Let I
=
To prove (I), first let A be any set and let x E OA. Suppose x satisfies p, in U, J c I, and x satisfies Ai,j,J,i+ i (pi pj) in A. Say pi = vk, for all i E I, and a = v,. Thus xk, # xk, whenever i, j E J and i # j. Since x satisfies p, in U, choose a E A so that xf,satisfies A,,, 1(a pi). Thus a # xk, for each i ~ I , i n p a r t i c u l a r f o r e a c h i ~ J , /sAo / 2 IJI l . T h ~ s e ~ holdsinA. ,~+~ Conversely, suppose x satisfies the right side of (1) in A . Define i E j iff i, j E I and xk, = xk,. Clearly = is an equivalence relation on I. Let J be a subset of Iwhich has exactly one element in common with each = equivalence class. If i, j~J and i # j, then xk, # xkj. Thus x satisfies / \ i , j , J , i + j i (Pi pj) in A . Since x satisfies the right side of (1) in A, it follows that E I J I + ~holds in A, i.e., A has at least I JI 1 elements. Hence we may choose
=
which are true in 21 iff, respectively, m = n, m < n, or m = , p . Obviously there is a decision method for determining these latter three questions.
Theorem 13.10. The theory of ( E , +) is decidable.
The Pure Theory of Equality Our language here has no nonlogical constants. F3 consists of all sentences p, such that tp,. Thus in this case, unlike the preceding two cases, the theory we investigate is not complete. For example, VvoVvl(v,= 0,) holds in oneelement structures but not in any others. The general procedure is still the same, however. First we distinguish some basic formulas, which again are not special atomic formulas but some of which are rather complicated sentences. We let
and, for m > 1,
= +
=
+
( a = pi), so x satisfies p,. Thus (1) holds, and Clearly then xf, satisfies Ai,, i this completes the proof of 13.11. 0
Theorem 13.12. I?, is decidable.
-
PROOF. The only basic sentences are em, m E w 1. Clearly el E I', while em $ F3 if m # 1. Let A be the set of all sentential combinations of basic sentences. Note: m I IAl iff em holds in the set A. For any p, E A let m , be the maximum m such that em is a part of p,. Using (1) it is easy to check that (1)
By a basic formula we mean a formula vi = v j or a formula E,. Note that the 2'-structures here are just sets. The basic lemma, as usual in this chapter, is:
Lemma 13.11. For anyformula p, one can eflectivelyfindaformula 4 equivalent under r3to g, such that $ is a quantifier-free combination of basic formulas and Fv$ G F v p
(2)
if p, E A and m , I IAl, IBI, then p, holdsin A iff p, holds in B.
Now by (2) we have (3)
if p, E A, then p, holds in every A with m , 5 ] A [iff p, holds in the set m,.
Chapter 13: Some Decidable Theories
Part 3 : Decidable and Undecidable Theories EXERCISES
Thus (4)
if p E A, then kp iff p holds in the set n for every nonzero n I m,.
Condition (4) clearly provides an effective procedure for determining whether p E F3 for p E A. Namely, for each n I m,, n # 0 one checks whether p, holds in n, this being essentially just a matter of checking tautologies by virtue of (1). 0
Corollary 13.13. If A is any nonempty set, then a subset B of A is elementarily definable i ' B = 0 or B = A. As a further consequence of our decision method for I?, we can find all complete extensions of ;,'I i.e., all theories A 2 r, which are complete. For 1 let I?," be the set of all sentences p such that each m E w
and let F," be the set of all sentences p, such that
Theorem 13.14 (i) The theories r,"and I?," are each complete, consistent, and decidable. (ii) The theories r," and I'," constitute all the complete and consistent extensions of r,.
PROOF (i) By (1) in the proof of 13.12, ern A -ern+, holds in a set A iff it holds in the set m. Hence I'b = {p, : p, holds in m), so Q' is complete and consistent. Similarly, r," = {p, : p holds in w), so I?," is complete and consistent. Obviously then each theory I',"is decidable. l?," is easily seen t o be decidable using (I) in the proof of 13.12, and 13.11. (ii) Obviously r, is a subset of r," and of each set rb. Now suppose that A is any complete and consistent extension of I',. By the completeness theorem, let A be a model for A. If IAl = m < w, clearly then rb = A. If [ A ] 2 w , by (2) in the proof of 13.12 we easily see that I?," E A, so I?," = A. 0 BIBLIOGRAPHY 1. Ershov, Yu., Lavrov, I., Taimanov, A., Taitslin, M. Elementary theories. Russian Mathematical Surveys, 20 (1965), 35-105. 2. Rabin, M. Decidability of second-ordz theories and automata on infinite trees. Trans. Amer. Math. Soc., 141 (1969), 1-35. 3. Tarski, A., Mostowski, A., Robinson, R. M. Undecidable Theories. Amsterdam:
North-Holland (1953).
13.15. Determine all elementarily definable subsets of Z with respect to the
structure (Z,
+,
<).
13.16. Show that the theory of
( w , +)
is decidable.
13.17. Show that the theory of one set is decidable. 13.18. Using the method of elimination of quantifiers, show that the theory of (Q, <) is decidable. 13.19. Determine the elementarily definable binary relations in any infinite set
(i.e., using the language with no nonlogical symbols and the theory I',").
Chapter 14: Implicit Definability in Number Theories
14
On the other hand, an m-ary relation R G "w is syntactically defined in r by p, iff Fvp s {v,, . . ., urn- ,} and for all x,, . . .,xm-, E w,
Implicit Definability in Number Theories
Finally, an m-ary relation R G "w is weakly syntactically de$ned in c {v,, . . ., urn-,) and for all x,, . . .,x,-, E w,
by
9) iff Fvp
We first want to indicate some relationships between these notions and the notion of recursiveness. Then we shall turn starting with 14.9 to specific theories r in which many functions and relations are syntactically definable. Proposition 14.2. Let R c "w. Let I' be a theory in L?,,,, and assume that ~ ( =0 1) E I'. Then the following conditions are equivalent: (i) R is syntactically deJinable in I?; (ii) xR is syntactically dejnable in r. In this chapter we consider several ways in which number-theoretic functions and relations can be implicitly defined in number theories. We do not mean elementarily definable as in Chapter 11; the present notions of definability are expressed in terms of theories and not of structures. As we shall see, the notions lead to new equivalents of the notion of recursiveness; see 14.12, 14.20, and 14.26. They also form the basis for diagonalization procedures which produce many undecidable theories (see the next chapter). We shall be concerned with two types of implicit definability. The first, syntactic definability, follows; the second, spectral representability, is given in 14.22.
and similarly (x,, . . ., xm-,) 6 R 3 $(x,, . . ., xm-,, 0) E I?. Thus $(x,, . . ., xm-,, y ) E I?, where y = xR(xO,. . ., xm-,). On the other hand, if (x,, . . ., xm-,) E R, then p,(x,, . . ., xm-,) E I? and hence by a suitable tautology
Definition 14.1. L?,,, is a fixed effective first-order language with the following nonlogical constants :
Similarly if (x,, . . ., xm-,)
0 s
+,
an individual constant, a unary operation symbol, binary operation symbols.
For each n E w we let A(n + 1) = sAn (inductively), with A0 = 0; frequently we shall write n in place of An. For terms a, T, the expression a 5 T is used as an abbreviation for the formula 3vi(vi u = T), where i is the least integer such that vi does not occur in u or in T. Now let I? be a theory in L?,,,. We say that an m-ary function$ "w 4 w is syntactically deJined in r by a formula p, iff Fvp, c {v,, . . ., v,) and for all x,, . . ., x,-, E w, the following sentences are in r, where y = ~ ( x o ,. .. r xm-1): ~ ( ~ 0- 9.,.Xm-1, Y) V~m[p,(~o, . . .,Xm-1, urn) + Urn = y I.
+
PROOF. (i)
* (ii). Let p, syntactically define R in I?. Let $ be the formula
Thus for any x,, . . ., xm-, E w,
+ R then
Hence X, is syntactically defined by $. (ii) => (i). Let $ syntactically define X, in r. Let p, be the formula $(vo, . . ., urn- 1). Suppose that (x,, . . ., xm-,) E R. Thus x,(x,, . . ., xm-J = 1, SO $(x,,. . ., xm-,, 1) E I?, i.e., p,(x,, . . ., xm-,) E r. On the other hand, suppose that (x,, . . ., xm-,) 6 R. Thus x,(x,,. . . , x,-~) = 0, so by the second requirement on syntactic definability for functions, Hence, since i ( 0 = 1) E I?, we have +(x,, xm-l) E r. The following proposition is obvious:
. . .,xm-,, 1) E I?, i.e., -~p,(x,, . . .,
Chapter 14: Implicit Definability in Number Theorles
Part 3 : Decidable and Undecidable Theories R Proposition 14.3. Let R G *w and let r be a consistent theory in Y,,,. is syntactically definable in I? then R is weakly syntactically dejinable in I'.
PROOF. Say r is recursively axiomatized by A. Let T$ be as in the above proof. Let R be weakly syntactically defined in I? by p,, and let e = p+p,. Clearly for all x,, . . . , xm-, E w we have
Recall from 11.29 the notion of a set of axioms for a theory. We effectivize this notion:
<x0,..., x , - ~ ) E R so R is r.e.
Definition 14.4. If 64 is an effectivized first-order language, a theory I? in 64 is recursively axiomatizable if there is a set A of sentences of PEP with 8+*A recursive such that A axiomatizes I?. If I? is finitely axiomatizable, i.e., it is axiomatized by a finite set, then I? is recursively axiomatizable. The connections of the notion of 14.4 with the notions of decidability and undecidability will be explored in the next chapter. For now we relate the notion to our notions of syntactic definability. Theorem 14.5. L e t 8 "w +-w and let I? be a consistent recursively axiomatizable theory in sn0, such that i ( n = p) G r whenever n # p. I f f is syntactically definable in r then f is recursive. A similar statement holds for relations R G "w.
Ti = {(e,x,, . . .,xm-,, z, y ) : e is the Godel number of a formula p, with free variables among v,, . . ., urn,and y is the Godel number of a A-formal proof of cp(x,, . . ., xm- ,, z)).
r by cp. Clearly
Thus f is recursive. The proof for relations follows from 14.2.
0
The intuitive basis of 14.6 is like that for 14.5. Given R, unary, weakly syntactically defined by p, in r, where r is axiomatized by an effective set A, first start listing out all A theorems. Whenever p,(x) appears on the list, give output x. In this way R will be effectively enumerated. The preceding two theorems give a method for exhibiting logical equivalents of recursiveness. Thus if we can find a consistent recursively axiomatizable theory I' in Yn,,in which every recursive function is syntactically definable and with i ( m = n) E I? whenever m # n, then by 14.5, a function will be recursive iff it is syntactically definable in I?. By 14.2, the same will be true of relations. Shortly we shall, indeed, produce such theories. is w-consistent iff for every formula Definition 14.7. A theory 'I in 2n,s p, with free variables among {v,), if p,(x) E r for each x E w, then 30, 1 duo) $ r. Proposition 14.8. If r is an w-consistent theory in Y,,,, i ( m = n) E I' whenever m # n, and every unary recursive function is syntactically definable in I', then every r.e. set is weakly syntactically definable in r.
PROOF. Say I? is recursively axiomatized by A. Let
Clearly T$ is recursive. Now let f be syntactically defined in then for any x,, . . ., xm-, E w we have, with e = g+cp,
i f f 3 y ( ( e , x 0 ,..., x , - , , y ) ~ T k ) ,
C]
An intuitive account of 14.5 may be helpful. Suppose that f (unary for simplicity) is syntactically defined by cp in,'I where has a recursive set A of axioms. We compute f x as follows. Start generating all A-theorems, one after the other (see the remarks following 10.29). As the theorems are generated, we look for one of the form cp(x, y). As soon as one such appears, we can say that y = fx. That eventually a formula p,(x, y) will appear in our list of r-theorems is assured by the stipulation in 14.1 that p(x, y) G r ; the uniqueness of y follows from the fact that Vu,(p,(x,v,) + v, = z) E r, where z = fx. Theorem 14.6. Let R E "w and let r be a recursively axiomatizable theory in Sno,. If R is weakly syntactically deJnable in r, then R is recursively enumerable.
PROOF. First note that every w-consistent theory is also consistent. Hence the formula i ( v , = v,) clearly weakly syntactically defines the empty set. Now let A be any nonempty r.e. set, say A = Rng f where f is recursive. By hypothesis, there is a formula p, which syntactically defines f in r. Let t,h be the formula 3v,p,(v1, 0,); we claim that weakly defines A . To prove this, first suppose x E A. Say fy = x. Then ~ ( yx ), E I?, so +(x)E r. Second, suppose that x $ A . Thus for each y E w we have fy # x. Now y~(y,x ) + x = z is a member of I?, where z = fy, and i ( x = z) is a member of r , so i p , ( y ,x ) is a member of r, for each y E w. By w-consistency +(x) $ r , as desired. 0 Now we are ready to discuss our weakest form of number theory: Definition 14.9. The theory R in 2,,, is the collection of all sentences p, of 2,,, such that A 1 p,, where A consists of the following sentences (for all m, n ~ w ) : ( i ) m n = p, where m + n = p ; (ii) m - n = p, where m . n = p; (iii) i ( m = n) for m # n ; (iv) Vv,(v, I n+vo = 0 v - . - v v, = n ) ; ( v ) Vv0(vo n v n 5 v,).
+
Chapter 14: Implicit Definability in Number Theories
Part 3: Decidable and Undecidable Theories
which obviously implies that R k pix, v,) + v1 = A Exc x, as desired. First note by 14.9(iv) that
Proposition 14.10 ( i ) R is recursively uxiomatizable. ( i i ) R is w-consistent.
Now let i I x. Using 14.9(i) and 14.9(iv) we easily obtain
PROOF. Condition ( i ) is obvious. To prove ( i i ) , first note that 2l = ( w , +, . , b , 0 ) is a model of R. Now if Fvp, 5 {v,) and ~ ( xE )R for each x E w , then '2L k p,[x] for each x E w and hence 21 kVv,p(v,). Since 2 is a model of R it follows that 321, 1 p,(vo)$ I?. 0
+
+
+
Every recursive function is .syntactically dlfinable in R.
+ i s in A. For, let p, be the formula v, + v, = v,;
...
v v1=A(2i).
+ + +
+
In fact, if i < y, then i 2 j I i 2 2i < i 2 2i 1 = (i i y 2 IX, so i 2 j # X , while if y < i, then x < ( y 1 ) , I i 2 i i 2 j ; thus x # i 2 + j. If i = y but j # Exc x, obviously x # i 2 j. Hence (7) holds. Now we clearly have, using 14.9(i) and 14.9(ii),
PROOF. Let A = { f :f is syntactically definable in R}. We shall use Julia Robinson's theorem 3.48 to show that every recursive function is in A .
I.
v
Let j I 2i. We now note the following little number-theoretic fact:
The next theorem constitutes one of the two main theorems of this section. It forms the main underpinning of all of our results which use the notion of syntactic definability.
Theorem 14.11.
R t = +A u 2 = i + v 1 = 0
(6)
+
+
while from (7) and 14.9(iii) we get
obviously the desired
(9)
conditions of 14.1 hold. 11. a is in A. In this case let p, be sv, = v,. 111. U ; E A ( 0 2 i < n ) . Let p, be vi = v,. IV. Exc E A. Let p, be the following formula:
if i # y
then R k i ( x = A(i2
or j # Exc x,
+ j)).
Thus if i # y but j i 2i is arbitrary, (8) and (9) give Rk
+
A
vz
= i + i ( u l = j).
Thus, since j I 2i is arbitrary, ( 6 ) gives us We show that p, syntactically defines Exc in R . To check the first requirement of 14.1, assume that x E w. By the definition of Exc, choose y E OJ such that x = y 2 Excx < ( y 1)'. Since ( y = y 2 + 2y + 1 , it follows that Exc x I 2y; and clearly y I x. Thus by 14.9(i), R t= z + y = x , where z = x - y, so
+
+
(1)
+
1
+
Now if i
,
++
i(u2
= i).
Hence by (5) we infer that
=
y but j # Exc x, (8) and (9) give R t=
Rkylx.
+ A Exc x = A2y
Rk
+
A
v2 = i + i ( u l
= j).
+ A Exc x = x,
Combining this with (10) and (6) we obtain the desired conclusion (4). V . A is closed under composition. To prove this, assume that f, go, . . . , g m - , E A , where f is m-ary and each g, is n-ary; let h = K,"(f, go,. . .,gm-,). Say f, go, . . ., g m - , are syntactically defined by cp, . . ., in R, respectively. Let x be the formula
From (1)-(3) it follows that R k ~ ( xA, Exc x), which is the first of the two desired conditions for Exc x. To check the second condition, let be the formula
We show that x syntactically defines 11 in R. For the first condition of 14.1, assume that so,. . ., x,-, E w . Then for any i < m , since +, syntactically defines g, in R,
Similarly, R k A(2y Y = W Y ) , so
-
(2)
Exc x)
by 14.9(i) and R k y
!
I
RFAEXCXI y + y .
,
Next, by 14.9(ii) R t= y - y = A ( y 2 ) and by 14.9(i) R k A ( y 2 )
+,,
+,-,
SO
U2
5X
A V,
5
V2+
Vl A X = ( U 2 . V 2 ) +
Vl.
Thus p,(x, v,) is the same formula as 3v2+. We shall prove that
where yi
=
gi(xo,. . ., A-,-,). Since p, syntactically defines f in R,
Part 3 : Decidable and Undecidable Theories
Chapter 14: Implicit Definability in Number Theories
where z = f(yo, . . .,y,-,) = h(xo, . . ., xn-,). By (1 1) and (12) we obviously obtain R k ,y(xo,. . ., xn-,, z), as desired in the first part of 14.1. Now let 0 be the formula
/\
#I(%, . . ., Xn-1,
vn+i+J A
Corollary 14.12. A function is recursive if in R.
By 14.3, 14.6, 14.8, 14.10, and 14.11, we have:
~ ( ~ n + .l.,, .On+,, on).
i<m
Then for any i < m, since
Corollary 14.13. A relation is r.e. zff it is weakly syntactically definable in R.
syntactically defines gi in R, R k 0 + v , + ~ + , = yi.
Another consequence of 14.1 1 is a result concerning elementary definability; it depends on the following simple lemma:
It follows that R k 0 + q(yo, . . ., y,-,, vn) and hence, since p, syntactically defines f in R, R k 0 + v, = z, as desired in the second part of 14.1.
with I I Lemma 14.14. Let U = ( w , +, -,4, O), and let I'be a theory in Sn,, as a model. Then if a function or relation is syntactically dejinable in F it is also elementarily dejinable in U.
VI. A is closed under inversion (applied to functions with range w). In fact, let f E A, with f having range w. Say p, syntactically defines f in R. Let be the formula
+
+
We show that syntactically definesf ( - l ' in R. Let x E w, and set f(-l)x Therefore, since p, syntactically defines f in R and fy = x,
=
PROOF. First suppose f, an m-ary function, is syntactically defined by a formula p, in I'. Then "+lPa =f, i.e., f is elementarily defined by p, (see = x ,. Then by 14.1, I? k q(xo, . . ., x,). 11.7). In fact, first supposefxo. . .x, Since U is a model of I?, U != q(xo, . . ., x,) and so U k q[xo,. . ., x,]. Second, suppose fxo. . . x m - # x,, say fxo. . .xm- = y # x,. Then by the second requirement on syntactic definability, F k p,(xo,. . ., x,) + y = x, so, since U is a model of I? and U k i y = x,, also U k ip,(xo,. . ., x,) and so it is not the case that U =! p,[xo,. . ., x,]. The case of relations is even easier. 0
-,
y.
Before continuing to check the two conditions of 14.1, we need a small lemma expressed in (14) below. Note by 14.9(iv) we have R != v2 5 y +
it is syntactically definable
V (v, = i). 1SY
From 14.11 we then obtain
If i < y, then f i # x and hence by 14.9(iii), R k -(A( fi)
= X)
for i < y.
Corollary 14.15. Every recursive function and relation is elementarily definable in the structure (w, .,rr, 0).
+,
On the other hand, since p, syntactically defines f in R we have R k p,(i, x) + x = A(f i)
for any i E w.
Recalling the definition of the arithmetical hierarchy from Chapter 5, we then have:
Putting these three statements together, we have i
I Now we return to checking the conditions of 14.1. By 14.9(v) we have R k v, 5 y v y 5 v,, so (14) yields R k q(u,, x) + v,
(1 5 )
= y v y 5 v,.
+
But R k 0 y = y by 14.9(i), so R k y 5 y and hence (15) gives R k p,(v,, x) + y 5 v,. Therefore by (13) we have R k #(x, y), as desired in the first part of 14.1. Now by (13) and the definition of i+h we easily obtain R k +(x, v,) + v, 5 y A q(vl, x), SO by (14) we have R k +(x, v,) +-v, = y, as desired in the second part of 14.1. 0 From 14.5 and 14.11 we obtain the following syntactical equivalent of recursiveness.
Corollary 14.16. For any number-theoretic relation R the following conditions are equivalent. (i) R appears in the arithmetical hierarchy; (ii) R is elementarily definable in (w, +, ., 4, 0). There are three other number theories which we shall consider in the future : Definition 14.17 (i) The theory Q in 9,, is, the collection of all sentences p, such that A I- p,, where A consists of the following sentences: (a) VvoVul(svo= sv, + uo = v,); (b) Vvo 1 (soo = 0);
Chapter 14: Implicit Definability in Number Theories
Part 3 : Decidable and Undecidable Theories
14.9(iu). Again we proceed by ordinary induction on n. Now v, 5 0 is the formula 3vl(u, v, = 0).Note that
'~; ( c ) Vvo[1 ( V o = 0 )+ ~ L ' ~ ( s=I /L',)] (d) 0 = cO); ( e ) VvoVol[v0 so, = s(vo u,)]; (f)Vvo(c,.O = 0 ) ; ( g ) Vv0Vo1(vo .svl = vo.L'l u,).
+
+
+
+ +
Q 1 v,
(Recall from 10.94 that for any formula X , [ [ X I ] is the universal closure of notation $(O), #(svo),etc., from 10.72 (note that # may have free variables other than v,).) (iii) The theory N in 9,, is, the collection of all sentences p which hold in ( w , ., 4 , O).)
+,
The following proposition is obvious (cf. the proof of 14.10).
We shall see later that N is not recursively axiomatizable. The connection between our number theories is given in G
N.
+
by l4.l7(i)(c),
= 0,as desired. Now we assume
Q != v, + v, = A(n + 1) A i ( u , = 0 ) + 3v,(sv2 = 0,) Q != v, sv, = A(n 1) + s(vl v,) = A(n 1) Q != s(v, v,) = A(n + 1) + v, v, = n
+ +
+ +
+
+
14.17(i)(c) 14.17(i)(e) 14.17(i)(a)
=
Thus Q 1 v, 5 A(n + 1) + v, = 0 v 3v,(sv, = v, A v, 5 n), and Q k sv, V, A v 2 < n + v , = 0 v . . . v v,=n by (I), so Q ! = v , < A ( n + 1)+ I), as desired. v, = 0 v . . . v u, A(n 14.9(v). Again we proceed by induction on n. Note that Q k v, 0 v, by 14.17(i)(d), so Q != 0 5 v, and Q != v, 5 0 v 0 5 u,. Now assume that Q b u o 5 n v n 5 v,. Now Q b v o 5 n + v o = 0 v . . . v v , = n by 14.9(iu), which has already been established, and for each i r n we have Q k A(n - i 1) i A(n 1) by 14.9(i), so Q 1 i 5 A(n 1). It follows that
+ + =
+
+ =
+
+
Now
PROOF. Obviously P E N. TO prove Q s P it is obviously enough to show that the sentence V v o [ i ( u o= 0) +3vl(svl = vo)Jis in P. To this end, let p, be the formula ~ ( v=, 0 ) + 3vl(sv, = v,). Since kO = 0 , we obviously have P k ~ ( 0 )It. is equally obvious that kp,(svo),so P k Vv,[y(v,) + g,(svo)]. Hence P kVvop(vo)by the special axiom for P, as desired. Now to show that R G Q it suffices to check that the sentences of 14.9 are in Q. 14.9(i) We show this by ordinary mathematical induction on n. The case n = 0 is clear by 14.17(i)(d).Now assume that Q k m n = A(nz + 11). By 14.17(i)(e), Q k m A ( J ~=) s(m n), and hence Q k m AJn = Ad(m n). 14.9(ii) This is similarly checked. 14.9(iii) It clearly suffices to show that Q k i ( m = n ) whenever n < m. This we do by induction on n. For n = 0 , we have by 14.17(i)(b) that Q k i [ A ( , - ( m- I ) ) = 01, as desired. Ndw assume that Q I. ~ ( =mn ) for all m > n, for a certain n. Now assume ~n < m. Now Q k A m = m + n = A(m - I), and n < rn - 1 implies Q k i ( n = A ( m - I)) by the induction hypothesis, so Q k - ( A m = m).
+
= v,)
Now
=
Proposition 14.18 ( i ) Q is finitely ax-iomatizable. (ii) P is rrcursively axiomatizable. (iii) Q , P, and N are w-consistent.
QG P
i ( v , = 0 ) + 3v,(sv2
Hence 14.17(i)(b)yields Q t v, 5 0 + v, that
x; also recall the
E
A
so, making use of l4.l7(i)(e),
(ii) The theory P in 04",,, of Peano arithnwtic is the collection of all sentences g, such that 1 t g,, where A consists of the sentences (a), (b), (d)-(g) above and also, for each formula $, the following sentence:
Theorem 14.19. R
+ v, = 0
+
+
+ m = v, + A(am) for every m E w . In fact, Q k sv, + 0 = sv,, Q != sv, = s(v, + O ) , and Q != s(vo + 0 ) = v, + SO using l4.l7(i)(d) and l4.l7(i)(e). Thus Q k sv, + 0 = v, + 1. Assume that Q b sv, + m = v, + A(dm). Then Q k sv, + A(m + 1) = s(sv, + m ) by 14.17(i)(e), Q 1 s(sv, + m ) = s(v, + A(am)) by our assumption, and Q k s(vo + A(am)) = v, + A(dom) by 14.17(i)(e). Thus Q 1 SV, + A(m + 1) = V , + A(m + 2), and (3) has been established by induction. Now
(3)
Q 1 sv,
+
and hence Q =! n 5 v, += n = u, v A(n + 1) 5 v,. We easily infer from this, the inductive hypothesis and (2) that Q I.v, 5 - A ( n + 1) v A(n 1) 5 vo.
+
Corollary 14.20. The following conditions are equivalent:
( i ) f is recursive; (ii) f is syntactically dejinable in R, Q, or P.
Chapter 14: Implicit Definability in Number Theories
Part 3: Decidable and Undecidable Theories
Rig has a smallest and a largest element and under which each element of Ria different from the greatest element has an imntediate successor; (iii) for any x E Ri3, i j { y : ( y , x ) E RE2[)isfinite, then l{y : ( y , x ) E R1g}l = f l { y : ( Y , x) E Ria)/.
Corollary 14.21. The following conditions are equivalent:
( i ) R is r.e.; (ii) R is weakly syntactically definable in R, Q, or P. Now we turn to our second notion of implicit definability in number theory.
different from RA, R i , R i , R;, PROOF. We first divide the symbols of pun and R: into two disjoint classes, consisting of distinct symbols OR; and l R ; for q E w 1 , r E w, where 'R9, is q-ary. The symbols OR: will be used for a translation of p,, while the other symbols lR9, will be used for auxiliary purposes. To define the translation of v, first let v, be a variable not occurring in p,, fixed for the rest of the proof. Let A be the set of all formulas of 2',,whose relation symbols and variables occur in p,. For each formula x E A we associate a formula x':
-
Definition 14.22. Tun(the universal language) is an effective first-order 1 language with no operation symbols but such that for each m E w and each n E w there is an m-ary relation symbol R; (with R: # RE,' if m # m' or n # n'). An n-ary number-theoretic function f is spectrally represented by a sentence p, of Zunprovided that for all x,, . . ., x,-, E w the following two conditions hold :
-
(i) there is a finite model 91 of p, such that (R:aI = xi for each i < n ; (ii) if 91 is any model of p, such that (R??ll = xi for each i < n, then IR;"I = f ( x o , . . ., 4 - 1 1 .
Now we can describe our desired sentence (I,. Namely, there clearly is a sentence (I, such that for any 9un-structureU, U k (I,iff the following conditions hold :
Lemma 14.23. Any spectrally representable function is recursive.
PROOF. We give an intuitive proof for this, thus appealing to the weak Church's thesis (see p. 46). Letf, n-ary, be spectrally represented by p,. Let r = { R ~ : m € lw, i~~ w , R ~ o c c ~ r ps,ionr m = 1 and is n).Thus F i s finite. Let 9' be the reduct of 9,, to the symbols of I'. We know that the truth of p, in an Zun-structure 91 is completely determined by the truth of p, in the 9'-reduct of 91. Clearly we can effectively construct all 2'-structures with universe a fixed m E w 1, and any 9'-structure 91 with [ A ] = m is isomorphic to one of them. Our decision method for f is as follows. Given x,, . . . , x,-, E w, we begin constructing all 9'-structures 91 with A = I, all with A = 2, etc. For each structure 91, as soon as it has been constructed, we check if p, holds in 91 (surely an effective question) and if IR:?il = x , for each i < n. As soon as we get an affirmative answer to all of these questions, which must eventually happen by 14.22(i), we set f(x,,. . ., x,-,) = IRA31 (by 14.22(ii)). 0
I
I I
!
-
We shall shortly prove that every recursive function is spectrally representable. For this theorem and one in Chapter 16 we need the following rather technical lemma. It essentially shows. how to spectrally represent simultaneously. not only x and f x but also x and all values f 0 , f I , . . .,ji Lemma 14.24. Let f be a unary function spectrally represented by a sentence p,. Then there is a sentence y5 which also spectrally reprrsmts f such that for any modd 91 of y5 the following conditions hold: ( i ) IR:y = 1R;"'I
+ 1;
(ii) Rg" i s a simple ordering of R y in the <-.sense, with respect to which
I
( 1 ) l R Y is a one-one function mapping RAa into Ria, there being only one element of Rta not in the range of lRga; (2) condition (ii) of 14.24; (3) if x E '"A and x, E Ria, then: ~'[xl; (a) (b) there is an a E A with (a, x,) E lR;%; (c) {(a, b) : (a, b, x,) E l R Y ) is a one-one function mapping {a : (a, x,) E Ria) onto {a : (a, x,) E OR;%),and {a : (a, x,) E OR?) c {a : (a, x,) E lRga}; (d) {(a,b) : (a, b, x,) E lR:a) is a one-one function mapping {a : (a, x,) E OR;%) onto {a : (a, x,) E R f a ) , and {a : (a, x,) E OR?%)G {a : (a, xi) E lRzS);
I
(4) if y is the greatest element of Ria under Rza, then lRfa is a one-one function mapping Ria onto {a : (a, y ) E R:"). Thus conditions ( i ) and (ii) of the lemma are now trivial. We now check condition (iii), and then come back to the proof that (I, still spectrally represents f. So, let U be a model of (I,. We now associate with each y such that {a : (a, y ) E ' R i a ) # 0 a new 9,-structure 23,. Namely we set By
(5)
=
{a : (a, y ) E lR;%},
while for each symbol R z we let (6)
R:By
=
{(x,, . . ., x , - ~ ) : x,, . . ., xm- E By (x,, . . ., X , - y ) E ,Rim lm). +
and
Chapter 14: Impl~cltDehnabihty In Number I heorles
Part 3 : Decidable and Undecidable Theories
Now we claim : "B,, and x is any member of 4, then a, k ~ [ x ] iff 21 k X'[x(,]. This condition is easily checked by induction on x; it explains to some extent why was constructed in the above fashion. From it our condition (iii) easily follows. In fact, let x E Rk2', and assume that { y : (y, x) E Rz>l) is finite. We know by (3)(b) that {a : (a, x) E 1Rg21}# 0, so 23, is defined. Take any z E "B,. Then by (3)(a) we have 2i k p'[zL], so (7) yields
(7)
if B, # 0, x
E
x and a (21) 'Rf2' = {(a, a, y ) : y I 'R2,?' = {(a, a) : a E R ; ~ "); (22) (23) Rf2' = 0 otherwise.
E
RiZy};
Clearly I I is finite and IRAXI = x, so to finish the proof of 14.22(i) and hence of our lemma it remains only to check that 2i k 4,i.e., that (1)-(4) hold. Of these, all but (3)(a) are routinely checked. But this condition is also clear, for (7) again is easily established by induction on X, so since 23, k p for each 0 y 5 x, (3)(a) follows. Now we prove the converse of 14.23 :
Now by (3)(c), (5) and (6) we have
and by (3)(d), (5) and (6) we have
But since p spectrally represents f, it follows from (8), (9), (10) that f l{a : (a, X) E Rg2L)I= ]{a : (a, x) E Ri2l)j, as desired in (iii). Now we turn to showing that 4 still spectrally representsf. To this end, let x E w , fixed for the rest of this proof. To check 14.22(ii), suppose that U is a model of 4 and IRh2'I = x. Then, by what we have shown above, conditions (i)-(iii) of our lemma 14.24 hold. By (ii), let y be the greatest number of Ri2I under Rg3; then by (i),
Theorem 14.25 (Trachtenbrot). sentable.
Every recursive function is spectrally repre-
PROOF. Let A = { f : f is spectrally representable). We shall again apply Julia Robinson's theorem 3.48 in order to show that every recursive function is in A . I. + is in A . We can clearly write down an =Pun-sentencep whose models are exactly those =Pun-structures 21 for which Rh2 n Ri2 = 0 and Ri3 = Rka u Ria. Thus p spectrally represents 11. a is in A . This time take a sentence p, such that 21 is a model of p, iff with exactly one more element than RA2'. R i a is a superset of 111. U: is in A . Let p, express that Rk2 = R:". IV. Exc E A. To motivate the construction of the desired sentence p,, suppose that Exc x = z. Then we can write x = y 2 + z for a certain y, where x < ( y In our sentence p,, Rb is to be thought of as a set with x elements, R: one with z elements, and R i one with y elements. We can express that x = y 2 + z by using functions (see below). Also, R$ is to have y 1 elements. We can express that x < ( y by means of a one-one function that is not onto. Getting down to details, let p be a sentence such that U is a model of p, iff the following conditions hold:
+.
+
By (4) and (iii) it follows from (10) and ( I I) that IR:211 = fx, as desired in 14.22(ii). It remains to check 14.22(i), i.e., to construct a finite model 21 of 4 such that IRA2'1 = X. TO do this, we first apply 14.22(i) for p, to produce for each y r x a finite model of p, with IRAcDyl= y. For the universe of our model 21 we take
Now we define the relations of 91 as follows:
Rka = x and Rh2l = x + 1 ; Rg3 = { ( y , z ) : y < z Ix ) ; R:?' = RIB". 1 > R:x = {(a,y ) : y 5 x and a E RiBy); OR(q + 1)PI = {(zo,. . ., z , - ~ y, ) : y I x and (z,, . . . , z,-,) E R : ~ ~ ) ; r 1R2'21 = 2 {(y, Y : y E RA29; lR221 = {(a,y): y I x and a E By}; lRga is any relation such that for each y I x, {(a, 6 ) : (a, b, y ) E lR;?I) is a one-one function mapping y onto RABy;
+
+
(1) RgQi: Ria H Rp'; R33 . R i a x Ri2l tf RA21; Rng Rga n Rng Ri2 = 0 and Rng R;% U (2) R y = R?; (3) Ria G R$?l, and Rill has exactly one more element than Rk2I; (4) R:% : R1,2L H Ria x Rj2; but R3,a does not map onto R$a x Ria.
ORig
+
+
To check the conditions of 14.22, let x E w . Say x = y 2 Exc x < (y Choose a finite =Pun-structure 91 such that IRi"1 = x, IRial = Exc x, ]Ri2'1 = y, RiQl c Ria, and R y has exactly- one more element than Rig'. Clearly then we can choose RZa, Ria, Rf3 SO that (I)-(4) hold. Thus 14.22(i) holds. Similarly, 14.22(ii) holds. V. A is clorcd undcr composition. For, supposef, go,. . .,g , _ , E A , where f is m-ary and each g, is n-ary; let h = K z ( f ; g o , . . .,g,-,). Say g o , . . .,
Part 3 : Decidable and Undecidable Theories
Chapter 14: Implicit Definability in Number Theories
grn-,,f are spectrally represented by $,, . . ., $,, respectively. The idea of the construction of a sentence p spectrally representing h is this. We modify the sentences $i so that pairwise they talk about entirely different symbols. Then we can introduce relationships between them in order to represent h. Formally, the first step takes place via m + 1 different syntactical Zunstructures in Z U n .We can clearly divide the symbols of -Punup into m + 2 pairwise disjoint parts such that each part contains infinitely many relation symbols of each rank and such that RA, . . ., Ri all are in the last part. The j-ary relation symbols of the ith part (0 I i I m + 1) will be denoted by iR.'0, i ~ i. ., and we assume that "'+lR: = Ri for each k I n. For each ti, Si, I?,) be the syntactical -Pun-structure in i I m let Ui = (rn+lR~+,+lvo, Yunsuch that : ti
(5) (6) (7)
=
0 (since -Punhas no operation symbols); SiRL = 'Ri',v0. . .v, - ; ri = { ~ v ~ ~ + ~ R ~ + ~ + ~ u ~ ) .
By means of these syntactical structures, our sentences $,, . . . , $, receive translations $to, . . ., $gm. The relationships between these translations that we need to express are: (1) our standard argument places RA, . . . , Rh-I correspond to the argument places in the translations $yo-. .$z(yil'; (2) the results obtained in + t o , . . ., $$Ti1) correspond to the argument places in $2"; (3) the result obtained in $2" corresponds to the standard result place Ri. Thus we want a sentence p (which clearly exists) such that for any -Pun-structure 8 , 8 k g, iff the following conditions hold : (8) (9)
8 k $ ~ ~ 3 ~ ~ ~ + f ~o r eRa c~h i+s m~; + ~ v ~ 23 k ('R:v0 + m + 'R;+,+ l ~ o A) (rnR:~o+ "'+lR1n+rn+lvo)
A
A
Ism
i
(10) r n + l R i $ k : R i s ~ i R i s s "'RtC8 (1 1) rn lRi:+i : i ~ iH+ (12) m + l ~ : : + m : m ~ ; s m ~ ; s . +
foreachi<mandk
We check 14.22(ii) and leave 14.22(i) to the reader. Assume that x,, . . ., x,-I E w and that 23 is a model of p such that I R ; ~ ~ = x, for each i < n. Then by (lo), (13)
I i ~ i ' O I=
x,
for each i < m and k < n.
Now 8 is a model of I?, by (8), so we can form the structure i I m. Note from 11.43 that
8 r ' 9 " i
for each
Hence by (9) and (13) we have I R : ~ ( ~ ~ , ~ ~ ) = I X, for each i < m and k < n. Furthermore, from 11.45 and (8) we knaw that k *i for each i < m. Hence by 14.19(ii) for +, and gi we obtain (15)
R
=
g
i . . ., x
1
for each i < m.
Using (1 5 ) , (14), (9), (13) we see that
Since Brrn*%"k $,, it follows that
Hence by (14), (9), (12) we obtain IRA1 = h(xo, . . ., x,-,), as desired. VI. A is closed under inversion, applied to functions with range w . For, let f E A , where f is a unary function with range w . By Lemma 14.24, we know that f is spectrally represented by a sentence $ satisfying the conditions of 14.24. We translate $ so as to make room for some auxiliary symbols. Namely, we divide the symbols of -Puninto equal parts denoted by OR! and lR?, where IRA = RA and lR; = R:. Let U = (lRiv0, t, S. r ) be the syntactical -Pun-structure in -Punsuch that:
(which we shall show spectrally Now there clearly is a sentence x of Zun represents f(-l)) such that for any -Pun-structure 23, 8 k x iff the following conditions hold : (20) 23 k*%; (21) lR$%is a one-one function mapping ORAS onto and l ~ f ' Bis a one-one function mapping OR:^ onto # 0; if b E B and b is not the greatest element of ORis under OR$^, (22) then either {(a, c) : (a, e, b) E 'RID) maps l ~ $ one-one into {a : (a, b) E OR:%) but is not an onto map, or it maps {a : (a, b) E OR:^) one-one into IRAs but is not an onto map. Now we check that the conditions of 14.22 work for f ( - l ' and X. Suppose x E w . To check 14.22(i), we first apply 14.22(i) for f and to obtain a finite model g of $ such that IRAQI = f(-l)x. From Q we construct a finite model 23 of x as follows. We set B = C, while for relation symbols we let 23 be such that
+
= RQ". 1~:s = B. (23) r 9 (24) lRts = R:" and lRiS = R'". o , l ~ : ' B are arbitrary as long as (21) and (22) hold. lRis, l ~ : and ~ , (25)
Clearly (25) is possible, in view of 14.24(iii): Clearly from the definition of 23 we have 23 a model of I? and B m = Q. Since Q is a model of 4,it follows from 11.45 that 8 b $3, i t . , condition (20) holds. Thus by (24) we see that 23 is a model of x, as desired, since IR;%I = IIR;sI = IR:"I = x. To check 14.22(ii), let 23 be any model of x such that IRtsI = X. Let
Chapter 14: Implicit Definability in Number Theories
Part 3 : Decidable and Undecidable Theories
= Bm. Then by 11.45 and (20), Q is a model of IORiB(= = IRAsI = X. NOWwe claim
O
+. Note
that IRiQl
=
with the following axioms: 14.32. Let T be the theory in TnOS
I~RA%(
RiQ is finite.
(26)
+,
it follows by 14.24(ii) For, suppose it is infinite. Since Q is a model of that there is a y 6 R;" such that \{a : (a, y ) E R~")I = f(-l)x. Then by 14.24(iii) we infer that I{a : (a, y ) E R?")I = X. But Rf" = OR?%and 11RA231= I R ; ~ ( = x, so this stands in contradiction to (22), since y cannot be the Thus (26) holds. greatest element of OR;% under OR;%. Now by (26), since spectrally represents f, f ( R i Q J= x. Note that lR:B1 = (lRiBl = = IRAQ(. Thus t o finish the proof of 14.25 it remains only to show that fy # x whenever y < (RiB(.But if y < I R : ~ ~ , then y < IRA"1, and from 14.24(ii), since O is a model of +, there is a b E C different from the greatest element of RiQ under RgQ such that J{a : (a, 7)E RgK)l = y. Then by 14.24(iii) and (22) we have
+
OR:%^
Show that not every recursive function is syntactically definable in T. Hint: eliminate quantifiers and show that not every recursive set is syntactically definable in T. 14.33. Give an example of a consistent theory in 2,,in ,which a nonrecursive set is syntactically definable. 14.34. An m-ary function f is strongly syntactically definable in a theory I' formulated in T,,, provided that there is a formula P) of T,,, with Fv P) G {vo,. . .,v,) such that the following two conditions hold: (1) for all x,, . . .,x, - E w , the sentence P)(x,, . . .,x,Af(xo, . . .,x,is in I?; (2) the sentence Vvo. . .Vv, - 13v, + lVv,(~ t,v, v, + is in r. Show that iff is syntactically definable in r, then it is also strongly syntactically definable in I?. Hint: Say f is syntactically defined by P). Let 4 be the formula
=
and let
Corollary 14.26. A function is recursive iff it is spectrally representable.
x be the formula
Show that BIBLIOGRAPHY 1. Ershov, Yu., Lavrov, I., Taimanov, A., Taitslin, M., Elementary theories. Russian Mathematical Surveys, 20 (1965), 35-105. 2. Shoenfield, J., Mathematical Logic. Reading: Addison-Wesley (1967).
EXERCISES
=
Let be the theory of 9,,, with the single axiomVvoVvl(vo vl). Show that every function is syntactically definable in r, but only countably many relations are syntactically definable in r. Thus the assumption -(O 1) E r in 14.2 is necessary; and the assumption in 14.5 that i ( m n) E r whenever rn # n is necessary.
=
=
, is consistent but not w-consistent. Describe a theory in 2,,which Show that R is not finitely axiomatizable. Hint: it is enough to show that for any finite set r of the axioms in 14.9 for R, there is a model of I? which is not a model of R. 14.30. Prove, without using 14.29, that R is a proper subset of Q. 14.31. Show that the sentence Vvo
,.
,n
svo
1
= vo is in P but not in Q.
x strongly syntactically defines f.
Chapter 15: General Theory of Undecidability
15
Theorem 15.1 has considerable theoretical importance. According to it, as soon as we know that a theory can be effectively enumerated we can conclude that a very effective (i.e., elementary) axiom system can be given for it. Theorem 15.1 is a kind of logical version of the equivalence of ( i ) and (iii) in 6.2 (equivalent definitions of r.e. sets). The following important theorem gives a logical version of the fact that a set is recursive iff both it and its complement are r.e.
General Theory of Undecidability
Theorem 15.2. For any complete theory equivalent; (i) (ii)
In previous chapters we have introduced several concepts related to the notion of undecidable theories (complete theories, 11.9 ; theories, 11.29; decidable and undecidable theories, 13.1 ; syntactical and weak syntactical definability, 14.1 ; recursive axiomatizability, 14.4; spectral representability, 14.22). Our purpose in this chapter is to establish various relationships known to exist between these notions and related ones. These general theorems will be applied in the next chapter, in which numerous examples of undecidable theories are given. We proceed in this chapter from the simpler concepts t o the more complicated ones.
Theorem 15.1 (Craig). For any theory r in an elementary efSectivized$rstorder language the following conditions are equivalent: ( i ) I? is axiomatizable by a set A such that y + * A is elementary; ( i i ) I? is recursively axiomatizable; (iii) y *ris r.e. +
PROOF. Obviously ( i ) a (ii), while ( i i ) => (iii) by 10.29. Now assume that (iii) holds. Let f be an elementary function with range gC*I?. Set A = {p, : p, is a sentence, and there is an x r y+p,such that f x = g+J,for some sentence J, such that p, = $ A J, A . - A
$1.
Obviously g +*A is elementary, and A s r. Now suppose that J, E I?. Choose x so that f x = g + $ . Clearly we can find 3 sentence p, of the form $ A J, A - . . A J, such that g+p,2 x. This follows from the simple observation that g +(Oo A 01) > + Oo for any formulas 0,, 0,. Thus p, E A, and hence J, E A - Thm, as desired. 0
r
the following conditions are
r is decidable: r is recursively axiomatizable.
PROOF. ( i ) ( i i ) .This is obvious, since r axiomatizes r. ( i i ) a (i).Assume ( i i ) , say A axiomatizes r, where g + *A is recursive. A decision procedure for r can be described as follows. Assume that I' is consistent. (It is obvious, and trivial, that an inconsistent theory is both decidable and recursively axiomatizable.) Given any sentence q, start listing all sentences derivable from A (recall from 10.29 that +*(A-Thm) is r.e.). Since is con~plete, either p, or -19 will eventually appear on the list. If p, appears, we of course give the output p, E r. If i p , appears, by the consistency of I' we give the r.i output p, $ More formally, write g+*(A-Thm) = Rngf, where f is recursive. Then x E ~ + *iffF x EJir+*Sentand f p y ( f y
=
.u or fy
=
~ ' x =) x.
Because of their importance, we list here two corollaries of 15.2 which are simple logical transformations of it:
Corollary 15.3. I f F is recursivrly axiomatizable and undecidable, then 1' is incomplete. Corollary 15.4. If axiomatizable.
r
is complete and undecidable, then I' is not recursively
In Corollary 15.3 we encounter a justification for our emphasis on undecidability in this book. Even if our main concern were proving various theories incomplete, we see by 15.3 that more general results are obtained by proving undecidability (since we are mainly concerned with recursively axiomatizable theories). In 16.1 we shall see that N is an example of a theory which is con~pletebut undecidable; thus by 15.4, N is not recursively axiomatizable. Another important connection between our basic notions is given in
Theorem 15.5. I f r is consistent and decidable, tlzen 1' c A ,for some consistent, decidable complete theory A.
Part 3 : Decidable and Undecidable Theories
Chapter 15 : General Theory of Undecidability
PROOF. Intuitively we proceed as follows, merely effectivizing a proof of Lindenbaum's Theorem 11.13. Effectively list out all sentences. Now extend I? by an effective, recursive procedure: at the mth step, add the mth sequence if it is consistent t o d o so, otherwise add nothing. In this way we extend r t o a complete theory A with y *A r.e. ; by 15.2, A is decidable. More formally, we proceed as follows. Let h be a recursive function with range 8+*Sent and with hO E 9 * r . Now we define a function f by recursion. Let
Rng h, h recursive. Let k be a recursive function such that Rng k = 8+*Sent. We now define our binary recursive function$ For any m, n E w, f(m,O) = hm f(m,n+l)=kn
+
f (m, n
i f tAs ny + - I f ( m , i ) + i y + - l k n $ r ,
+ 1) = f (m, n)
otherwise.
+
f0 f(m f(m
=
hO
+ 1) = hm + 1) = fm
if I? Y /\y+-Ifi+
-y+-lhm,
(1)
otherwise.
+
As a generalization of 15.5 we have the following result. It shows that the decidability of a theory I' is equivalent t o the existence of complete decidable extensions of I? with certain restrictions. This result is practically useful in proving decidability of theories. The proof is just an extension of the proof of 15.5.
Theorem 15.6 (Ershov). Let I? be consistent and recursively axiomatizable. Then I? is decidable 18there is a sequence O,, O,, . . . of complete consistent extensions of r and a binary recursive function f such that the following conditions hold:
nt<@
(9 r = oi; (ii) For every m E w, {f (m, i) : i E w) which axiomatizes Om.
=
g *A, for some set A, of sentences +
PROOF. First suppose that I? is decidable. Let
Since
(r u {p,)
= {p, E
= {p, E
Sent : A, 1 p). Thus (ii)
I? u {y+-lf(m, i) : i < n) is consistent, for each m, n E w.
f<m
Let A = y+-l*Rng$ Now A is consistent. For, by induction it is clear (see the proof of the next theorem) that r u {y+-lfi: i < m) is consistent for each m E w; SO it follows, of course, that r u A is consistent. A fortiori, A is consistent. Furthermore, r E A. For, assume that p, E F, say hm = p,. Clearly then, since we have already established that r u {y+-lfi: i < m) is consistent, it follows that f (m + 1) = hm, so p, E A. Note that A is a theory, since if A 1 p,, with, say, hm = p,, then obviously f(m + 1) = hm. Next, A is complete, for let p, be a sentence with p $ A, say p, = hm. Then f(m 1) f hm, so I? 1 A,,,y+-lfi+ ip,, hence A 1 i p , hence i p ~ A . Finally, since A is complete a n d y + * A = Rng f is r.e., by 15.1 A is recursively axiomatizable and hence by 15.2 it is decidable. 0
R
Now let A, = {y+-lf(m, i) : i E w) and 0, automatically holds. Now
Sent : r u
consistent iff
i p ,$
r),
{p,) +
is consistent). *R is recursive. Say
+
*R
=
We prove (1) by induction on n, with m fixed. Since F is given t o be consistent, the case n = 0 is trivial. The definition of Q and h immediately gives the desired result for n = 1. Assume inductively that n > 1. If (1) fails for n, then
Hence f(m, n - 1) # k(n - 2) by the way f was defined, so f(m, n - 1) = f(m, n - 2). But then (1) fails for n - 1, contradiction. Thus (1) holds. Next, (2)
E
A,
for each m E w.
For, let p,EI?. Say p, = y C - l k n . Then A i S n y + - l f ( m , i ) + i y + - l k n $ r ; for otherwise, since also y + - lkn E I? we would have u {y -If (m, i) : i In) 1) = kn, and p, E A,. Also inconsistent, contradicting (I). Hence f(m, n note the following consequence of (1):
+
(3)
+
Omis consistent, for each m E w.
Next, (4)
Omis complete, for each m E w.
For, let p, be any sentence; say p, = g +-lkn. If A,,, 8' -lf(m, i) + - y + - l k n $ I?, then f(m, n 1) = kn and hence p, E Om.If Ai,. 9'-'f(m, i) + i g + - l k n E I?, then by (2) we see that A, t. i p , , so i p , E Om. Thus (4) holds. O,. Suppose p, is any It remains only to establish (i). By (2), F c sentence not in I'.Then I' u { i p ) is consistent, so i p , E Q. Say 8+-'hm = l p , . Thus f(m, 0) = hm implies that i p , E A, G Om, so by (3), p, $ Om. Hence p $ r ) ,,,O,. Thus (i) holds. Conversely, suppose that @, @,, . . . are complete consistent extensions of I' sucn that (i) and (ii) hold. Since r is recursively axiomatizable, by 15.1 it follows that y + * r is r.e. Hence it suffices to show that w f + * ris r.e. First we give an informal proof for this. Begin listing members of @, (note
+
n,,,
-
Chapter 15: General Theory of Undecidability
Part 3 : Decidable and Undecidable Theories that 9+* Omis r.e. for all m). After listing a few of them, list a few members of O,. Then list more members of O,, then of O,, then of 0,. Then list more members of O,, etc. In this listing process, if i p , appears, then on a separate list put p,. Since r G 0, and 0, is consistent, each such p, fails to be in r. Since each Omis complete and (i) holds, each sentence not in r eventually appears on the list. More formally, define a partial recursive function h as follows. For any x E w,
hx (5)
= py(x $ 9 +*Sent, or x E 9 +*Sent and for all i I l(y),[((y),), = f((y),, i)] and (y), is the Godel number of a @proof of A i s , ~ o 9+-Y(Y)O),+ 19+-'x).
- -
We claim that Drnn h = w 9 + * r (as desired). For, first let x E Drnn h. If x $ 9+*Sent, obviously x E w g +* r . Assume that x = y+p,, where p, is a sentence. Since x E Drnn h, we get a y as indicated in (5). Let m = (y),. Then by (ii), i p , E Om,so p, $ Omsince Omis consistent. Thus p, $ by (i), SO E 9 + * r . Second, let x E w -- 9 + * r . If x $9+*Sent, obviously x E Drnn 12. Suppose x = +p,, where cp is a sentence. Thus since x $ 9+* r we have p, $ r. By (i) choose m such that p, $ Om; hence i p , E Om by the completeness of Om.By (ii) and the deduction theorem there are +,, . . ., E A, such that t-+, A . . . A + i p , . By (ii), choose p such that 9++,,. . ., 8 + + m ~ { f ( mi, ) : i Ip). Clearly then we still have t- Ais,9+-lf(m, i ) + i p , . Now we let q = ~ f ' " . ~let ) , r be the Godel number of a 0-proof of A, 9+-lf(m, i) + i p , , and let y = 29.3"-5'. Clearly y satisfies the con0 ditions in (5), so x E Dmn h.
+,
+,
n,.,
essentially undecidable can be shown to actually be finitely inseparable. To see the logical significance of the latter notion, first note: (*)
if r is a finitely axiomatizable theory, then M = 9+*{p, : p, is a sentence whose negation holds in some finite model of r ) is r.e.
In fact, we can assume that the language has only finitely many nonlogical constants, and we list all members of M as follows. Begin listing all finite 9-structures with universe m E w 1 (any finite 9-structure will be isomorphic to one of this form). Simultaneously start listing all sentences. For each finite 9-structure 21, check if U is a model of J?; since r is finitely axiomatizable, this can be done in finitely many steps. If 2l is determined to be a model of F, check each sentence already listed for truth in 2l. For those sentences of the form i p , determined to hold in U we put y+p,on our output list. Clearly this gives an effective enumeration of M. Thus (*) holds. A rigorous proof of (*) would be rather lengthy, but is clearly possible (weak Church's thesis). Thus we see that if r is finitely inseparable, then the following is true:
-
(7)
There is an automatic procedure P such that, given any consistent finitely axiomatizable theory A with the property that every finite model of r is a model of A, the procedure P produces after finitely many steps a sentence p, such that 9, $ A but p, holds in all finite models of A.
In fact, let f be a recursive function satisfying the definition 6.21 for the effectively inseparable pair 9+*Thm2 and M = 9 *{p, : p, is a sentence whose negation holds in some finite model of r). Let A be as in (t),and set A = 9 +*A u {X : x is not the Godel number of a sentence) and B = 9 *{p, : is a sentence whose negation holds in some finite model of A). Thus y+*Thm2 E A , M E B, A n B = 0, and A and B are r.e. (using (*)). Say A = Drnn p,,1 and B = Drnn p,:. Then f(e, r ) = p+p,for some p, satisfying the conclusion of (?). On the other hand, it is clear from Definition 15.7 that any finitely inseparable theory I? is undecidable. The property (?) exhibits another property of r: no finitely axiomatizable extension of r is determined by its finite models. Roughly speaking, a finitely inseparable theory is a weak theory which is undecidable. However, there are consistent theories which are intrinsically undecidable, in the sense that all their consistent extensions are undecidable. Most such essentially undecidable theories can be shown to be inseparable, a stronger property. An important property of inseparable theories is that they are effectively incompletable, in the following sense: +
+
Some Generalizations of the Concept of Undecidability and their Relationships to Each Other and to Some Logical Notions Definition 15.7. Let be a theory in a language 9 . We say that r is essentially undecidable if I? is consistent and whenever A is a consistent theory in 9 with I? G A, it follows that A is undecidable. The theory r is inseparable if 9 + * r and 9+*{p, : p, is a sentence and i p , E I?) are effectively inseparable (see Chapter 6). And we say that F is finitely inseparable provided that *Thm2 and 9+*{p, : p, is a sentence whose negation holds in some finite model of r ) are effectively inseparable. +
Some remarks on the origin and intuitions underlying these notions are in order. There are some theories which are undecidable but which can be easily extended to consistent decidable theories. An example is the theory of one binary relation, which is proved undecidable in the next chapter. If we adjoin to this theory the axiom VvoVvl(vo= v,), we obviously get a consistent decidable theory. (See Exercise 15.24.) Thus r is not essentially undecidable. Most theories with this property of being undecidable but not
(#)
if I' is an inseparable theory, then there is an automatic procedure P such that if A is any consistent recursively axiomatizable extension of I? then P yields a sentence p, such that p, $ A and i p , 4 A.
Part 3 : Decidable and Undecidable Theories
Chapter 15: General Theory of Undecidability
PROOF. Let F be an inseparable theory in 9. Thus 8 + * F and A = 8+*{p,: p, is a sentence and i p , E r ) are disjoint, by 6.21, so 'I is consistent. Suppose that A is a consistent theory in 9 with r c A. Let B = g+*{p,: p, is a sentence and i p , E A). Thus g + * r G g +*A, A E B, and g +*A n B = 0. Clearly B is recursive if 8+*A is recursive, so the recursive inseparability of g * r and A implies that g + *A is not recursive, i.e., A is undecidable. Hence r is essentially undecidable. Trivially, every essentially undecidable theory is undecidable. Now suppose that F is a finitely inseparable theory in 9, and let C = {8+tp: p, is a sentence which holds in every finite model of F). By 15.7, g +*Thm2 and g + *Sent2 C are effectively inseparable. If F is decidable, then g +* r is a recursive set containingg *Thm2 and disjoint from 8. *Sent2 C , which is impossible. Thus r is undecidable. If C is recursive, C is a recursive set containing 8+ *Thm2 and disjoint from 8+ *Sent2 C, which is again impossible. 0
In fact, let f be a recursive function satisfying Definition 6.21 for the effectively inseparable pair g + * r and M = g +*{p, : p, is a sentence and i p E I?). Given A as in (#), set A = g f * A u { x : x is not the Godel number of a sentence) and B = 8 +*{g, : p, is a sentence and i p , E A). Then g +*I? E A, M c B, A n B = 0, both A and B are r.e., say A = Drnn p,,l and B = Drnn cp:. Then f(e, r ) = g+p,for some p, as desired in (#).
+
The following theorem gives a rigorous version of (#):
Theorem 15.8. Let F be an inseparable theory. Then there is a recursive function h such that ifA is any consistent extension of r in 9and ifg+*A = Drnn v,l, then he = g+p,for some sentence p, such that p, $ A and i p , $ A.
-
-
PROOF.Let f be as above. We define a partial recursive function k' by setting kl(x, e) py [(e, x, y ) E TI or x $ g *Sent9], for all x, e E w. Say k' Drnn k' Let ke
=
Note that
{(x, e) : x
E
Dmn cp: or x $ 8 *Sent2). +
s:(r, e) for all e E w. Then for any x
E w,
:
and hence Dmn cpk,
(1)
+
+
-
+
= cp?. =
-
=
Dmn cpi u (w
-
g+*Sent~).
Next, we define a partial recursive function I' by setting 1
for all x, e E w (recall the definitions of ifand cp' from 5.8 and 10.6). Say I' = (pf. Let le = s:(s, e) for all e E w. Then for any x E w ,
!
I
There are examples of undecidable theories which are not essentially undecidable (see the comments following 15.7); essentially undecidable theories which are not inseparable; finitely inseparable theories which are not essentially undecidable and hence not inseparable (again see the comments following 15.7); inseparable (hence essentially undecidable and undecidable) theories which are not finitely inseparable (see the comment following 16.2); and decidable theories r with 8+*{p, : p, holds in all finite models of F) nonrecursive (15.25). Now we want to consider the effect of extending theories on the above notions. Recall the definition of extensions of theories from 11.29. The following result generalizes the definition of essentially undecidable theories.
Proposition 15.10 Let F be a theory in 9, A a consistent theory in an efSective expansion 9' of 9, and assume that F E A. Then F essentially undecidable implies A essentially undecidable, and inseparable implies A inseparable.
,
and hence Dmn cp:, = {x : i ' x E Dmn 9:). (2) For any e E w , let he = f(ke, le). Now suppose that A is a consistent extension of I? and g + * A = Drnn rp:. By (1) and (2), Drnn cpi, = A and Drnn cp;, = B, with A and B as in the discussion preceding this theorem. ( A u B), so he = g+p,for some sentence p, with Hence he = f(ke, le) E w 0 g, $ A and i p , $ A, as desired.
-
Next we list some simple properties of the notions in 15.7.
Proposition 15.9. Every inseparable theory is essentially undecidable, and every essentially undecidable theory is undecidable. EveryJinitely inseparable theory is undecidable. If I? is finitely inseparable, then {8 +p, : p, is a sentence which holds in everyJinite model of I?) is not recursive.
PROOF. Assume the first sentence of 15.10. Let I? be essentially undecidable. Suppose that O is a consistent decidable extension of A in 9'. Then O n Sent2 is a consistent decidable extension of F in 9, contradiction. Next, suppose F is inseparable. Since 8+*F c g + * A and g+*{p, : g, is a sentence of 2 ' and i p , E r ) E g+*{p, : p, is a sentence of 9' and i p , E A), while the two sets on the right of these inclusions are disjoint, it is clear , that A is inseparable. 17 There is an example of theories I?, A in a ianguage 9 such that r c A, A is inseparable, but I? is decidable (see 15.27). On the other hand, we have:
Proposition 15.11. If I? and A are theories in a language 9,and A is an extension of r, then A finitely inseparable implies I? finitely inseparable.
Part 3 : Decidable and Undecidable Theories
Definition 15.12. Let I' and A be theories in languages 9 and 9 ' , A an extension of r (hence 9' an expansion of 9 ) . We say that A is afinite extension of F provided that there is a finite set O of sentences of 9' such that F u O axiomatizes A. Proposition 15.13. If I? and A are theories in 9 and A is afinite extension of r, then A undecidable implies I? undecidable.
PROOF. Let O be a finite set of sentences such that r u O axiomatizes A. Then for any sentence p,, we have p, E A iff A O -t p, E ,'I so I? is undecidable. 0 The following result enables one to prove that some rather weak theories are undecidable.
Proposition 15.14. Let 9' be an effective expansion of a language 9.Suppose I' is a theory in 9 , A is a theory in 9')and I? u A is consistent. If r is finitely axiomatizable and essentially undecidable, then A is undecidable.
PROOF. Let O = {p, : p, is a sentence of 2" and r u A k p,). Clearly O is a theory in 2'which is an extension of I? and a finite extension of A. By 0 15.10, O is essentially undecidable, so by 15.13, A is undecidable. In case we deal with definitional expansions, it is to be expected that we obtain complete equivalences between our notions for a theory and its expansion :
Proposition 15.15. Let (I",9 ' ) be an effective definitional expansion of (I?, 9 ) . Then: ( i ) I? is decidable iff I" is decidable; (ii) r is essentially undecidable iff I" is essentially undecidable; (iii) I? is inseparable iff I" is inseparable; (iv) l7 is finitely inseparable iff r' is finitely inseparable.
PROOF. Let the notation be as in 11.29 and 11.30. For any sentence p, of 9 , by 11.31 we know that p, E I? iff p, E r'. Hence I" decidable 3 I? decidable. By 11.30 we know that for any sentence $ of 9 ' , we have IC, E I?' iff $' E r ; because the formation of I)' is effective, r decidable 3 I?' decidable. Thus ( i ) holds. The implication from left to right in (ii) is a special case of 15.10. NOW assume that I" is essentially undecidable, and ? ! G A, where A is a consistent theory in 9. Let A' be the theory in 9' with axioms A u I?'. Then A' is a definitional expansion of A ; furthermore, since I?' G A', it follows that A' is undecidable. Hence by (i) of our present theorem, proved above, A is undecidable.
Chapter 15: General Theory of Undecidability
The implication from left to right in (iii)is immediate from the definitions involved. Now suppose I" is inseparable. Let B = g+*{p: p, E Sentp, i p , E I"), D = 8 *{p, : p, E Sent2, ip, E r). Thus we are given that 8.+*I" and B are effectively inseparable sets. Now by 11.30 and 11.31 we know that for any sentence p, of 9 ' , p, E r r iff p,' E I?, and g+p,E B iff g+plE D. Hence from 6.25 it follows that g+*rand D are effectively inseparable. Hence r is inseparable. For (iv), suppose I? is finitely inseparable; thus g+*Thm9 and B = {p, : p, E Sent9, -IT holds in some finite model of I?) are effectively inseparable. As in the proof of 11.31 we see that any model of I? can be expanded to a model of I". Henceg + *Thm9 G g *Thmp, and B G {p, E Sentp : -IT holds in some finite model of r');it follows that I" is finitely inseparable. Finally, assume that r' is finitely inseparable. For each sentence p, of 9 , let A, be the set of all existence and uniqueness conditions 11.29(ii) for the new operation symbols occurring in p,. Let p,* = p,' (defined in the proof of A, -t p,' if A, # 0. Furthermore, let O, 11.30) if A, = 0, and let it be be the set consisting of all definitions for the new symbols in p,. Note that by the proof of 11.30, 0, k p, o p,'. Now it suffices to prove +
+
(1)
(2)
if p, E Sent9, and kp,, then by*; if p, E Sentp and -~p, holds in some finite model of ,'?I ip,* holds in some finite model of r.
then
To prove (I), assume that p, E Sent9. and kp,. To check that krp*, let U be any 9-structure which is a model of A,. Obviously U can be expanded to an 9'-structure 23 which is a model of 0,. Since kp, and 0, k p, t,p,', it follows that 23 k p,' and hence 11 k p,', as desired. To prove '(2), assume that E Sentp, and U i= -IT, where U is a finite model of r'. Then I( 9 is a model of A, u and of l p , ' , since I?' k i p , o ip,', so U 1 9 k iV*
r
Next we consider the general notion of interpretation of one theory into another (1 1.43-1 1.46).
Proposition 15.16. Let 9 and 9' be two languages, I? and A consistent theories in 9 and 2" respectively, and suppose that U is an effective interpretation of r in A. Then:
(i) r essentially undecidable 3 A essentially undecidable. (ii) l? inseparable A inseparable. (iii) Suppose also that for every model Q of F there is a model 23 of A such that Q = BAa.Then l? undecidable 3 A undecidable. (iv) Suppose that for each finite model Q of I? there is a finite model 23 of A such that Q = BAC1. Then A finitely inseparable 3 A finitely inseparable. PROOF. (i! Let A' be any consistent theory in 9' which extends A. Set I" = {p, E Sents : A' k Thus r c I" since U is an interpretation of I' in A. Now I" is a theory in 9,for if I?' 1 p,, then O 1 p, for some finite subset O
Part 3 : Decidable and Undecidable Theories
Chapter 15: General Theory of Undecidability
of I", hence kA O + p,, kA{#a : # E O) + p,a by 11.46, so A' k p,2[ and .'?I r' is consistent because A' is. Therefore, r' is undecidable (since we assume that r is essentially undecidable). The formation of p,%is recursive by 11.44, so A' is undecidable, as desired. (ii) The implication here is essentially a trivial consequence of 6.25. Let A = g + * r and B = g+*{p,: p, E SentP, i p , E I'). Thus A and B are effectively inseparable. Correspondingly, let C = g + * A and D = g+*{p, : p, E SentP, i p , E A). Note that C n D = 0 since A is consistent. Now we define a funetionf: w 4 w: for any x E w, if x $ g +*Sent9, fx = 0 fx=g+(g+-l~)~ ifx~g+*Sent~.
p, E
It is easily checked that A c f - l * C and B c f-l*D. Since f is recursive by 11.44, it follows that C and D are effectively inseparable, by 6.25. Thus A is inseparable. (iii) The added hypothesis implies, as we shall see, that for any sentence p, of 2 , p, E I? iff p,a E A; hence clearly A decidable implies r decidable. In fact, p, E I? 3 p,a E A even without the added hypothesis, by 11.46. Now assume that q~~ E A. Let O be any model of r. By our added hypothesis, O= for some model 23 of A. Thus 23 k q?, so by 11.45, O k p,. Hence r k p, and p, E r, as desired. (iv) We can prove this similarity t o (ii); we just need t o establish the following two results : (1)
for any sentence p, of 9 , kp, implies ITa;
(2)
for any sentence p, of 9 , if i p , holds in some finite model of r , then ( -ip,)a holds in some finite model of A.
Now (1) is immediate from 11.46, since any syntactical 2-structure in 2' is an interpretation of Thm2 in Thmp (obviously). Condition (2) follows 0 from our extra hypothesis for (iu) along with 11.45. The following variant of 15.16(iu) will be useful in Chapter 16. Proposition 15.17. Let 2 and 2' be two languages, and let r and A be consistent theories in 2 and 2' respectively. Assume that 2 has only finitely many operation symbols (with no restriction on the number of relation symbols). Let U = (x,f, R, I?') be an efective syntactical 2-structure in 2' such that r' is finite. Finally, suppose that for each finite model O of J? there is afinite model 23 of A u I" such that O = Br'%. Then r finitely inseparable 2 A finitely inseparable.
PROOF. By virtue of 6.25 it suffices t o establish the following: I?' + p,II; for any sentence p, of 2 , kp, implies k (1) (2)
for any sentence p, of 9, if i p , holds in some finite model of holds in some finite model of A. then -(/\I" +
r,
To prove (I), assume that kp, and that 23 is an 2'-structure which is a model of Art.Then Wa k p,, SO by 11.45, 23 k p,%,as desired in (1). To prove (2) let O be a finite model of r such that O k - I T . By hypothesis of our proposition let % be a finite model of A u r' such that O = Wa. Thus by 11.45, 23 k i v a , as desired in (2). 0
Connecting the Notions of Implicit Definability in Chapter 14 with the Undecidability Notions Theorem 15.18. If r is a theory in 2,,,in which every recursive set is weakly syntactically definable, then F is undecidable.
PROOF. Suppose
r is decidable. Let
A = {e : e is the Godel number of a formula free, and #(e) $ .)?I
# having at most uo
Clearly A is recursive, by the hypothesis that I? is decidable. Let p, weakly syntactically define A in I',and set e = g + y . Then p,(e)~r
iffe~A iff d e ) 6 r
(sinc