You are on page 1of 178
BASIC PROOF THEORY Cambridge Tracts in Theoretical Computer Science Editorial Board ‘S. Abramsky, Department of Computing Science, Edinburgh University PIH. Aczel, Department of Computer Science, University of Manchester IW. de Bakker, Centrum voor Wiskunde en Informatica, Amsterdam LA. Goguen, Programming Research Group, University of Oxford Y. Gurevich, Deparment of Electrical Engineering and Computer Science, University of Michigan IV. Tucker, Department of Mathematics and Computer Science, University College of Swansea Titles in the series 1.G.Chaitin Algorithmic Information Theory 2: LIC. Paulson Logie and Computation 3M. Spivey Understanding Z 4.6. Revest. Lambda Calculus, Combinaxors and Functional Programming 3.A. Ramsay Formal Methods in Artficial Intelligence 6.8. Vickers Topology via Logic 7.LN, Girard, ¥. Lafont & P, Taylor Proofs and Types &.J. Clifford Formal Semantics & Pragmavics for Natural Language Processing 9! M4. Winslect Updating Logical Databases 10. K. McEvoy & 3.V. Tucker (eds) Theoretical Foundations of VLSI Design LTH, Tse. A Unifying Framework for Stuctured Analysis and Design Models 12: G. Brewka Nonmonotonie Reasoning 1g. S{G. Noggar Mathematics for Computer Graphics 15. Dasgupta Design Theory and Computer Science 17, .C.M. Baeten (ed) Applications of Process Algebra 18, CM. Baeten & W. P. Weiland Process Algebra 19, M. Manzano. Extensions of First Order Logic 21,D.A. Wolftam The Clausal Theory of Types 221 V’ Stoltenberg-Hansen, I. Lindstrom & E. Griffor Mathematical Pheory af Domains 23. E-R. Olderog. Nets, Terns and Formuias 26. BID. Mosses Action Semantics 21. W.H, Hesselink Programs, Recursion and Unbounded Choice 29. P. Girdenfors (ed) Belief Revision 30. M. Ahoy & N. Biggs Computational Learning Theory BITE Melham Higher Order Logic and Hardware Verificasion 32. RIL. Carpenter The Logic of Typed Feature Structures 33. EG. Manes Predicate Transformer Semantics 34, F-Nielson & HAR. Nielson Two Level Functional Languages 35.L-Feijs & I Jonkers Formal Specification and Design 36. S Mauw & G.I, Veluink (eds) Algebraic Specification of Communication Protocols 37. V. Stavridou Formal Methods in Circuit Design 38, NShankar Meaamachematics, Machines and Gadel’s Proof 39. 1B Pans. The Uncertain Reasoner's Companion 40: LDesel & IEsparza Free Choice Petri News 41, TJ. Ch, Meyer & W. van der Hoek Epistemic Logic for AI and Computer Science 42. CR. Hindley Basic Simple Type Theory 43. AS, Troelsira & H. Schwichtenbers Basie proof Theory BASIC PROOF THEORY AS. . Troelstra University of Amsterdam H Schwichtenberg Univ S ersity of Munich CAMBRIDGE UNIVERSITY PRESS 1B MS™ jd Published by the Press Syndicate of the University of Cambridge ‘The Pitt Building, Trumpington Street, Cambridge CB2 RP 40 West 20th Street, New York, NY 10011-4211, USA, 10 Stamford Road, Oakleigh, Melboume 3166, Australia © Cambridge University Press 1996 First published 1996 Printed in Great Britain at the University Press. Cambridge Library of Congress cataloguing in publication data available British Library cataloguing in publication data available ISBN 0521 57223 1 hardback Contents Preface 1 Introduction 1.1 Preliminaries 1.2. Simple type theories 1.3 Three types of formalism 2. N-systems and H-systems 2.1 Natural deduction systems 2.2 Nias aterm calculus 2.3 The relation between C, and M. 2.4 Hilbert systems 2.5 Notes 3. Gentzen systems 3.1 The Gl- and G2-systems 3.2 The Cut rule 3.3 Equivalence of G- and N-systems 3.4 Absorbing the structural rules 3.5. The one-sided systems for C 3.6 Notes 4 Cut elimination with applications 4.1, Cut elimination 4.2 Applications of cut elimination 4.3 Interpolation and definable functions 4.4 Some generalizations with applications 4.5. A more efficent calculus for Ip 46 Notes 5 Refinements 5.1 Numerical bounds on cut elimination 20 29 29 37 39 42 46 51 52 57 59 a 3 76 6 84 90 96 102 105 us us. 5.2 Permutation of rules for classical logic 5.3 Permutability of eules for Gi 54 Notes Normalization for aatural deduction 6.1 Contractions and normalization 6.2 The structure of normal derivations 6.3 From normal to cutfree deductions 6.4 Conservativity of predicative classes . 6.5 Conservativity for Horn clauses 6.6 Strong normalization for Nm and A, 6.7 More on normalization 68 Notes Resolution 7.1 Introduction to resolution 72 Unification 7.3 Linear resolution Ta From Gentzen system to resolution 7.5 Resolution for Ip . 7.6 Notes Categorical logic 8.1 Deduction graphs... . 8.2 Lambda terms and combinators 8.3. Decidabitity of equality 8.4 A coherence theacees for CCC's 85 Notes Modal and linear logic 3.1 The modai logic $4 92 Embedding intuitionistic logic into $4 9.3 Linear logic 9.4 A system with privileged formulas 9.5 Proofnets oe 9.6 Notes. 10 Proof theory of arithmetic 10.1 Ordinals below eo 10.2 Provablity of initial cases of TI. 10.3 Normalization with the omega rule Contents 124 131 135 137 . 137 143 48 150 152 187 161 168 172 17 74 378 185 188 197 200 200 = + 206 = 213 216 = 223 225 226 - 230 - 234 - 242 245; 255 259 260 263 . 267 Contents 10.4 Unprovable initial cases of TL 10.5 TI for non-standard orderings 10.6 Notes 11 Second-order logic 11.1 Intuitionistic second-order logic 11.2 fp? and A2 11.3 Strong normalization for Ni? 11.4 Encoding of A2@ into A2 ALS Provably recursive functions of HA? 116 Notes . Bibliography Symbols and notations Index 272 279 234 287 237 291 293 . 298 300 306 331 335 Preface ‘The discovery of the set-theoretic paradoxes around the turn of the century, and the resulting uncertainties and doubts concerning the use of high-level abstractions among mathematicians, led D. Hilbert to the formulation of kis programme: to prove the consistency of axiomatizations of the essential parts ‘of mathematics by methods which might be considered as evident and reliable because of their elementary combinatorial (“finitistic”) character. Although, by Gédel’s incompleteness results, Hilbert's programme could not be carried out as originally envisaged, for a long time variations of Hilbert’s programme have been the driving force behind the development of proof theory. Since the programme called for a complete formalization of the relevant parts of mathematics, including the logical steps in mathematical ar- guments, interest in proofs as combinatorial structures in their own right. was awakened. This is the subject of structural proof theory; its true beginnings ‘may be dated from the publication of the landmark-paper Gentzen (1935] Nowadays there are more reasons, besides Hilbett’s programme, for study- ing structural proof theory. For example, automated theorem proving implies an interest in proofs as combinatorial structures; and in logic programming, formal deductions are used in computing. ‘There are several monographs on proof theory (Schiitte {1960,1977), Takeuti [1987], Poblers (1989]) inspired by Hilbert’s programme and the questions this engendered, such as “measuring” the strength of subsystems of analy- sis in terms of provable instances of transfinite induction for definable well- orderings (more precisely, ordinal notations). Pohlers [1989] is particularly recommended as an introduction to this branch of proof theory. Girard [1987] presents a wider panorama of proof theory, and is not easy reading for the beginner, though recommended for the more experienced: The present text attempts to fill a lacuna in the literature, a gap which exists between introductory books such as Heindorf [1994], and textbooks on mathematical logic (such as the classic Kleene (1952a], or the recent van Dalen [1994}) on the one hand, and the more advanced monographs mentioned above on the other hand. Our text concentrates on the structural proof theory of first-order logie and its applications, and compares different styles of formalization at some length. A glimpse of the proof theory of first-order arithmetic and second-order logic x Preface is also provided, illustrating techniques in relatively simple situations which are applied elsewhere to far more complex systems. As preliminary knowledge on the part of the reader we assume some fa miliarity with first-order logic as may be obtained from, for example, van Dalen (1994). A slight knowledge of elementary recursion theory is also help- ful, although not necessary except for a few passages. Locally, other prelimi- nary knowledge will be assumed, but this will be noted explicitly. Several short. courses may be based on a suitable selection of the material. For example, chapters 1, 2, 6 and 10 develop the theory of natural deduc- tion and lead to a proof of the “classical” result of Gentzea on the relation between the ordinal cy and first-order arithmetic. A course based on the first five chapters concentrates on Gentzen systems and cut, elimination with (elementary) applications ‘There are many interconnections between the present text and Hindley (1996); the latter concentrates on type-assignment systems (systems of rules for assigning types to untyped lambda terms) which are not treated here, In our text we only consider theories with “rigid typing”, where each term and all of its subterms carry along a fixed type. Hindley’s book may be regarded as a companion volume providing a treatment of deductions as they appear in type-assignment systems, We have been warned by colleagues from computer science that references to sources more than five years old will make a text look outdated. For readers inclined to agree with this we recommend contemplation of the following platitudes: (1) a more recent treatment of a topic is not automatically an lmprovement over eatlier treatments; (2) if a subject is worthwhile, it will in due time acquire a history going back more than five years; (3) results of lasting interest do exist; (4) limiting the horizon to five years entails a serious lack of historical perspective. Numbered exercises are scattered throughout the text. These ace immedi- ately recognizable as such, since they have been set in smaller type and have been marked with the symbol @. Many of these exercises are of a routine character (complete the proof of this lemma”). We believe that (a) such exercises are very helpful in famil. iarizing the student with the material, and (b) listing these routine exercises explicitly makes it easy for a course leader to assign definite tasks to the students, At the end of each chapter, except the first, there is a section called “Notes”. ‘There we have collected historical credits and suggestions for further reading; also we mention other work related to the topic of the chapter. ‘These notes do mot pretend to give a history of the subject, but may be of help in gaining. some historical perspective, and point the way to the sources. ‘Thete is no attempt at completeness; with the subject rapidly expanding this has become well-nigh impossible. Preface xi ‘The references in the index to names of persons concern in the majority of cases a citation of a publication. In case of publications with more than one author, only the first author’s name is indexed. Occurrences of author names in the bibliography have aot been indexed. ‘There is a separate list, where symbols and notations of more than local significance have been indexed. ‘The text started as a set of course notes for part of a course “Introduction to Constructivism and Proof Theory” for graduate students at the University of Amsterdam, When the first author decided to expand these notes into a book, he felt that at feast some of the classical results on the proof theory of first-order arithmetic ought to be included; hence the second author was asked to become coauthor, and more particularly, to provide a chapter on the proof theory of first-order arithmetic, The second author's contribution did not restrict itself to this; many of his suggestions for improvement and inclusion of farther results have been adopted, and a lot of material from his, course notes and papers has found its way into the text, We are indebted for comments and information to K. R, Apt, J.P. A. K. van Benthem, H.C. Doets, J. R. Hindley, G. E, Mints, V. Sanchez, S. V. Solovjor, A. Weiermann; the text was prepared with the help of some useful Latex macros for the typesetting of prooftrees by $. Buss and for the typesetting of ordinary trees by D. Roorda. M. Behrend of the Cambridge University Press very carefully annotated the near-final version of the text, expunging many blemishes and improving typographical consistency. Amsterdam/ifiinchen A. S$. TROELSTRA Spring 1996 H. SCHWICHTENBERG Chapter 1 ' Introduction Proof theory may be roughly divided into two parts: structural proof theory and interpretational proof theory. Structural proof theory is based on a com binatorial analysis of the structure of formal proofs; the central methods are cut elimination and normalization, In interpretational proof theory, the tools are (often semantically moti- vated) syntactical translations of one formal theory into another. We shall encounter examples of such translations in this book, such as the Gédel- Gentzen embedding of classical logic into minimal logie (2.3), and the modal embedding of intuitionistic logic into the modal logic $4 (9.2). Other well- known examples from the literature are the formalized version of Kleene's realizability for intuitionistic arithmetic and Gédel's Dialectica interpretation (see, for example, Troelstra (1973)) The present text is concerned with the more basic parts of structural proof theory. In the first part of this text (chapters 2-7) we study several formal- izations of standard logics. “Standard logics", in this text, means minimal intuitionistic and classical first-order predicate logic. Chapter 8 describes the connection between cartesian closed categories and minimal conjunction~ implication logic; this serves as an example of the applications of proof theory in category theory. Chapter 9 illustrates the extension to other logics (namely the modal logic $4 and linear logic) of the techniques introduced before in the study of standard logics. The final two chapters deal with first-order arithmetic and second-order logic respectively. ‘The frst section ofthis chapter contains notational conventions and def. initions, to be consulted only when needed, so a quick scan of the contents will suffice to begin with. The second section presents a concise introduction to simple type theory, with rigid typing; the parallel between (extensions of) simple type theory and systems of natural deduction, under the catch-phrase “formulas-as-types”, is an important theme in the sequel. ‘Then follows a brief informal introduction to the three principal types of formalism we shall ‘encounter later on, the N-, H- and G-systems, or Natural deduction, Hilbert systema, and Gentzen systems respectively. Formal definitions of these sys- tems will be given in chapters 2 and 3 1 2 Chapter 1. Introduction 1.1 Preliminaries ‘The material in this section consists primarily of definitions and notational conventions, and may be skipped until needed. Some very general abbreviations are “iff” for “if and only if", “IH” for “in- duction hypothesis”, “w.lo.g.” for “without loss of generality”. To indicate literal identity of two expressions, we use =. (In dealing with expressions with bound variables, this is taken to be literal identity modulo renaming of, bound variables; see 1.1.2 below.) ‘The symbol @ is used to mark the end of proofs, definitions, stipulations of notational conventions. IN is used for the natural numbers, zero included. Set-theoretic notations such as C, C are standard. 11-1. The language of first-order predicate logic ‘The standard language considered contains V,\,—+, ,¥,3 as primitive logi- cal operators (.L being the degenerate case of a zero-place logical operator, i.e. a logical constant), countably infinite supplies of individual variables, n-place relation symbols for all n € IN, symbols for n-ary functions for all’ n € IN O-place relation symbols are also called proposition fetters or proposition vari- ables; O-argument function symbols are also called (individual) constants. The ianguage will not, unless stated otherwise, contain = as a primitive We use certain categories of letters, possibly with sub- or superscripts or primed, as metavariubles for certain syntactical categories (locally different conventions may be introduced) ¢,u.2,4,0,w for individual variables; ‘+ f.gyh for arbitrary function symbols; 6d for individual constants; t,9;7 for arbitrary terms; + P,Q for atomic formulas; R for relation symbols of the language; * A, B,C,D,E, F for arbitrary formulas in the language. Norarion. For the countable set of proposition variables we write PY. We introduce abbreviations: Ae B:= (A B)A(B> A), nA Ask, T ou Ld. Preliminaries 3 In this text, T (“truth”) is sometimes added as a primitive. If P is a finite sequence At,...,An of formulas, AT is the iterated conjunction (...(A, A ‘A2) A. An)y and VP the iterated disjunction (...(Ar V Aa) V ..-An). IEE is empty, we identify VP with T, and AP with a NoraTion. (Saving on parentheses) In writing formulas we save on paren- theses by assuming that V,3,~ bind more strongly than V,A, and that in turn V,/ bind more strongly than ~),<+. Outermost parentheses are also usually dropped. Thus AA ~B — C is read as ((A A (~B)) + C). In the case of iterated implications we sometimes use the short notation AL Ag Ag Aq for A (Azo (Anat An) oo) ‘We also save on parentheses by writing e.g, Reryz, Rtotita instead of R(z,v, 2), Rlto, ti, 2), where R is some predicate letter. Similarly for a unary function symbol with a (typogeaphically) simple argument, so fz for f(2), ete. In this ‘ease no confusion will arise. But readability requires that we write in full Rls, 99,2), instead of Rfzgyhz. 2 1.1.2. Substitution, free and bound variables Expressions £,£" which differ only in thé names of bound variables will be regarded by us as identical. This is sometimes expressed by saying that & and £" are a-equivalent. In other words, we are only interested in certain equivalence classes of (the concrete representations of) expressions, expres sions “modulo renaming of bound variables”. There are methods of finding unique representatives for such equivalence classes, for example the namefree terms of de Bruijn [1972]. See also Barendregt (1984, Appendix Cl For the human reader such representations are less convenient, so we shall stick to the use of bound variables. But it should be realized that the issues of, handling bound variables, renaming procedures and substitution are essential ‘and non-trivial when it comes to implementing algorithms. In the definition of “substitution of expression for variable x in expression! £", either one requires chat no variable free in £” becomes bound by a variable- binding operator in €, when the free occurrences of z are replaced by &" (also expressed by saying that there must be no “clashes of variables"), °€” is free Jor x in &, or the substitution operation is taken to involve a systematic renaming operation for the bound variables, avoiding clashes. Having stated that we are only interested in expressions modulo renaming bound variables, we can without loss of generality assume that substitution is always possible. Also, it is never a real restriction to assume that distinct quantifier occur- rrences are followed by distinct variables, and that the sets of bound and free variables of a formula are disjoint. 4 Chapter 1. Introduction NOTATION. “FV" js used for the (set of) free variables of an expression: 0 V(t) is the set of variables free in the term ¢, FV(A) the set of variables free in formula A ete £{z/t] denotes the result of substituting the term t for the variable x in the expression £. Similarly, €[Z/4] is the result of simultaneously substituting the terms @= t1,...,tq for the variables Z = 21,...,z, respectively For substitutions of predicates for predicate variables (predicate symbols) we use essentially the same notational conventions. If in a formula A, con- taining an n-ary relation variable X", X" is to be replaced by a formula B, seen as an n-aty predicate of n of its variables Z = 21,...,2q, we write ALX"/Ag.B] for the formula which is obtained from A by replacing every occurrence XZ by B[z/4) (neither individual variables nor relation variables of Vz B are allowed to become bound when substituting) Locally we shall adopt the following convention. In an argument, once a formula has been introduced as A(z), ie. A with a designated free variable 2, we write A(t) for Alz/t), and similarly with more variables. @ 1.1.8. Formulas and formula-occurrences Formula-occurrences (f..’s) will play an even more important role than the formulas themselves. A fo. is nothing but a formula with a position in another structure (prooftree, sequent, a larger formula etc.). If no confusion is to be feured, we shall permit ourselves a certain “abus de langage” and talk about formulas when really f.0.'s are meant. Deriniri0N. (Gentsen subformula) Unless stated otherwise, the notion of subfermula we use will be that ofa subformula in the sense of Gentzen, given by the following clauses: (0) A,B are subformulas of AA B, AV B, A+B: (i) Ais a subformule of 7A; (iii) Alz/t] is a subformula of ¥zA, 31, for all terms ¢ free for x in A; (iv) The relation “,, is subformula of ...” is reffexive and transitive If we replace the third clause by: (iii) A is 4 subformula of ¥z4, 324, we have the notion of literal subformula, @ 1d. Preliewinaries 5 Derinrrion. We define positive (P) and negative (formula-Jcontests (N’) simultaneously by an inductive definition given by the three clauses (i)-(iti) below. The symbol “+” in clause (}) functions as a special proposition letter (not in the language of predicate logic), a placeholder so to speak. (i) + € Pi and if BY € P and B~ ¢N and A is any formula, then (ii) ANBY, BYAA, AVB*, BYVA, A-+BY, BA, WeBt, 328+ € (iil) ANB: , BOAA, AVB™, B-VA, A-+B>, BY +A, WeB™, 32B> EN. The set of formula contezts is the union of P and NV. Note that a context contains always only a single occurrence of +. For arbitrary contexts we some- times write F(s], G[+],-... Then F[A],G[A], ... are the formulas obtained by replacing + by A (literally, without renaming variables). ‘The strictly positive contexts SP are defined by (iv) + € SP; and if Be SP, then (0) ANB, BAA, AVB, BVA, A+B, veB, 353 € SP An alternative style of presentation of this definition ie PaslANPIPAALAVP|PVA|A~ PIN + A|VeP | 32, N=AAN|NAA|AVN|NVA|A+N|P Al VEN | BEN, SP =«| AASP|SPAA|AVSP|SPV-A|A-+ SP | VaSP | 325P A formula occurrence (J.0. for short) in a formula B is a subformula A together with a context indicating the place where A occurs (so B may be obtained by replacing + in the context by A). In the obvious way we can now define positive, strictly positive and negative occurrence and positive, strictly positive and negative subformula. A strictly positive subformaula is also called a strictly positive part, abbreviated s.p.p. a LL, Finite multisets Finite multisets, ie, “sets with multiplicity”, or to put it otherwise, finite sequences modulo the ordering, will play an important role in this text. Norarion. If A is a multiset, we use [Al for the number of its elements. For ‘the multiset union of [ and A'we write PU A or in certain situations simply T,A or even PA (namely when writing sequents, which will be int oduced later). The notation P, A or PA then designates a multiset which is the union, of P and the singleton multiset containing only A If *c* is some operator and [= Ay,..., Ay is a finite multiset of formulas, we write eP for the multiset cAy,...cAs, « Chapter 1. Introduction. Finite sets may be regarded as special cases of finite multisets: a multiset where each element occurs with multiplicity one represents a finite set. For the set underlying a multiset I’, we write Set(I'); this multiset contains the formulas of P with multiplicity one. s Norarion. We shall use the notations AT, VT also in case I’ is a multiset. AC, VI ate then the conjunction, respectively disjunction of I" for some sequence I” corresponding tof, AT, VI are then uniquely defined modulo logical equivalence, as long as in our logic A,V obey the laws of symmetry. and associativity. e 1.1.5. Deducibility and deduction from hypotheses, conservativity In our formalisms, we derive either formulas or sequents; sequents are expres sions of the form I’ > A, where (4 are finite multisets of formulas. NOTATION, For sequents derived in a formalism S we write SHPSA or bsP sa, and for formulas derived in S SHA or Fs A If we want to indicate that a deduction D derives I => A, we can write Dis l= A (or DEL = A if S is evident) For formalisms based on sequents, $+ A will coincide with S b= A Gequent T= A with P empty) If a formula A is derivable from a finite multiset T of hypotheses or as sumptions, we write Pisa In systems with sequents this is equivalent to St P > A. (N.B. In the literature I F A is sometimes given a slightly different definition for which ‘the deduction theorem does not hold; ef. remack in 9.1.2.) A theory is a set of sentences (closed formulas); with each formalism is associated a theory of deducible sentences, Since for the theories associated with the formalisms in this book, it is always true that the set of deducible Jormulas and the set of pairs {(I,A) | T+ A} are uniquely determined by the theory, we shall also speak of formulas belonging to a theory, and use the expression “A is deducible from in a theory” In particular, we write Pty d, TRA, Phe for deducibility in our standard logical theories M, I, C respectively (ef. the next subsection). a 1.1. Preliminaries 7 DEPINITION. A system S is conservative over a system S! C S, if for formulas Ain the language of S' we have that if S + A, then S'+ A, For systems with sequents, conservativity similarly means: if T > A in 8, with P= A in the language of S', then + T =» A in S', Similarly for theories. ® 1.1.6. Names for theories and systems Where we are only interested in the logics as theories, i.e. as sets of theorenes, we use M, Land C for minimal, intuitionistic and classicat predicate calculus respectively; Mp, Ip and Cp are the corresponding propositional systems. If we are interested only in formulas constructed from a set of operators A say, we write A-S or AS for the system S restricted to formulas with operators from A. Thus >A-M is M restricted to formulas in A, + only. On the other hand, where the notion of formal deduction iz under investiga- tion, we have to distinguish between the various formalisms characterizing the same theory. In choosing designations, we use some mnemonic conventions: # We use “N’, “H”, “G" for “Natural Deduction”, “Hilbert system” and “Gentzen system” respectively. “GS" (from "Gentzen-Schiitte”) is used as a designation for a group of calculi with one-sided sequents {always classical) © We use “c" for “classical”, “i” for “intuitionistic”, “m” for “minimal”, “8” for “Sa”, “p” for “propositional”, ‘e" for “E-logic". If p is absent, the system includes quantifiers. The superscript “2” is used for second- order systems, '* Variants may be designated by additions of numbers, superscripts such as “*” ete, Thus, for example, Ge is close to the original sequent calculus LK of Gentzen (and G1i to Gentzen’s LJ), G2e is a variant with weakening absorbed into the logical rules, G3c a system with ‘weakening and contraction absorbed into the rules, etc. ‘+ In order to indicate several formal systems at once, without writing down the exhaustive list, we use the following type of abbreviation: Slabc} refers to Sa, Sb, Sc; Slablled] refers to Sac, Sbe, Sad, Sbd, ete,; {mic] stands for “m, or i or €”; [mil for “m or i”; [123] for “2, 2 or 3”, ete. In such contracted statements an obvious parallelism is maintained, eg. “G[123|e satisfies A iff G[123]i satisfies 5” is read as: “Glee (respectively G2c, G3c) satisfies A iff Gli (respectively G2i, G3i) satisfies B LLLT. Finite trees DEFINITION. (Terminology for trees) Trees are partially ordered sets (X, <) with a lowest element and all sets {y : y < 2} for X linearly ordeted 8 Chapter 1. Introduction ‘The elements of X are called the nodes of the tree; branches are maximal linearly ordered subsets of X (i.e, subsets which cannot be extended further) ‘Trees are supposed to grow upwards; the single node at the bottom is called the root or bottom node of the tree. If a branch of a tree is finite, it ends in a leaf or top node of the tree. If n,m are nodes of a tree with partial ordering <, and n= m, then m is a successor of n, na predecessor of m. If n 1) immediate successors. Then S(T) < HTM 41, I(T) <9(7). For strictly 2-branching trees s(7) = 2Is(T) — 1 Formulas may also be regarded as (labelled) trees. The definitions of size and depth specialized to formulas yield the following definition, DeFINirion. The depth aj of & foriiia Ais the maximum length of a branch in its construction tree, minus one. In other words, we define recur- sively [P| = 0 for atomic P, || = 0, [Ae B| = max(|A),|B|) + 1 for binary operators 0, {0 A} = || +1 for unary operators o ‘The size or length s(A) of a formula A is the number of occurrences of logical symbols and atomic formulas (parentheses not counted) in A: s(P) = 1 for P atomic, s(A.0B) = s(A) + s(B) +1 for binary operators 0, s(2A) = s(A) +1 for unary operators ©, 2 For formulas we therefore have s(A) < 24141. 1.8. Simple type theories ° 1.2 Simple type theories This section briefly describes typed combinatory logic and typed lambda cal- culus, and may be skipped by readers already familiar with simple type the- cries. For more detailed information on type theories, see Barendregt (19921, Hindley [1996]. Below, we consider only formalisms with rigid typing, ie systems where every term and all subterms of a term carry a fixed type. Hindley (1996] deals with systems of type assignment, where untyped terms are assigned types according to certain rules. The untyped terms may pos- sess many different types, or no type at all. There are many parallels between rigidly typed systems and typeassignment systems, but in the theory of type assignment there is a host of new questions, sometimes very subtle, to study. But theories of type assignment fall outside the scope of this book 1.2.1. DEFINITION. (The set of’ simple types) The set of simple types T-, is constructed from a countable set of type variables Py, Pj, Ps,... by means of a type-forming operation (function-type constructor) —». In other words, simple types are generated by two clauses () type variables belong to T; (ii) if A, Be T., then (A + B) € T A type ofthe form A —+ B is called a function type. “Generated” means that nothing belongs to 7-, except on the basis of (i) and (ii). Since the types have the form of propositional formulas, we can use the same abbreviations in writing types as in writing formulas (ef, 1.1.1) 2 Intuitively, types denote special sets. We may think of the type variables as standing for arbitrary, unspecified sets, and given types A, B, A > Bis a set of functions from A to B, 1.2.2. DEFINITION. (Terms of the simply typed lambda calculus 4) All terms appear with a type; for terms of type A.we use. ¢4, 84,74, possibly with extra sub- or superscripts. The terms ato generated by the following three clauses: (ji) For each A € T., there is a countably infinite supply of variables of type A; for arbitrary variables of type A we use u*, v4, wA34,y4,24 (possibly with extra sub- or superscripts); (ii) if 1478, 2 are termns of types A+ B, A, then App(t48, 94)? is a term of type By (iii) if is a term of type B and 2 a variable of type A, then (Az*.t2)4-2 is a term of type A» B. ®

You might also like