APPLICATIONS OF A N A T U R A L DEDUCTION SET THEORY by GEORGE KONSTANTINOS TSKNIS B.Sc, The University of Patras, Greece, 1975 M.Sc, The University of British Columbia, 1985 A THESIS SUBMITTED IN PARTIAL FULFILMENT OF THE REQUIREMENTS FOR THE DEGREE OF DOCTOR OF PHILOSOPHY in T H E F A C U L T Y OF G R A D U A T E STUDIES (Department of Computer Science) We accept this thesis as conforming to the required standard T H E UNIVERSITY OF BRITISH COLUMBIA September 1991 © George Konstantinos Tsiknis, 1991 In presenting this thesis in partial fulfilment o f the requirements for an advanced degree at the University o f British Columbia, I agree that the Library shall make it freely available for reference and study. 1 further agree that permission f o r extensive copying o f this thesis f o r scholarly purposes may be granted by the head o f my department or by his or her representatives. It is understood that copying or publication o f this thesis f o r financial gain shall not be allowed without my written permission. Department The University of British Columbia Vancouver, Canada DE-6 (2/88) A B S T R A C T The goal of this thesis is to demonstrate the versatility and suitability of a logic and set theory NaDSet for providing logical foundations to disparate areas of mathematics and computer science. Category theory has been chosen as the area of mathematics, while programming language semantics and semantics for the lambda calculus are the areas of computer science. In each of the three areas NaDSet provides a logical foundation using exactly the same "logistic" method: Basic concepts are defined as terms of the logic and then the logic is used to derive all theorems; no assumptions in the form of additional axioms or rules of deduction are needed. The thesis demonstrates the ease and directness with which this can be done for the three areas, suggesting that in other, as yet unexplored areas, NaDSet may prove to be equally useful. i i T A B L E OF CONTENTS Abstract ii Acknowledgements vi I. I N T R O D U C T I O N 1 1.1 Goal of the Thesis 1 1.2 The Logistic Method 2 1.3 Choice of Demonstration Areas 4 1.3.1 Category Theory 4 1.3.2 Semantics of Programming Languages 5 1.3.3 The Lambda Calculus 6 1.4 Main Features of NaDSet 6 1.4.1 Natural Deduction Based Set Theory 6 1.4.2 A Nominalist Interpretation of Atomic Formulas 7 1.4.3 One Universal Quantifier Instead of Two 8 1.4.4 A Generalized Unrestricted Abstraction 8 1.5 How the Goal Has Been Achieved 9 1.6 Thesis Oudine and Reader's Guide 11 II. T H E L O G I C NaDSet 13 2.1 Elementary Syntax 13 2.2 Logical Syntax 14 2.3 Some Derived Rules and Definitions 17 2.3.1 'for'Definitions 17 2.3.2 Additional Connectives and Quantifiers 19 2.3.3 Bounded Quantifiers 21 2.3.4 Ordered Pairs and Identity 23 2.3.5 Extensional Identity 24 2.3.6 Natural Numbers 25 IH. C A T E G O R Y T H E O R Y IN NaDSet 27 3.1 Categories 29 3.1.1 Objects, Hom-Sets and Commutative Diagrams 31 3.2 Functors 32 3.3 The Category of Categories 36 i i i 3.3.1 Definitions and Preliminaries 36 3.3.2 Identity Functors 39 3.3.3 Composition Functors 40 3.3.4 Cat is a Category 41 3.4 Natural Transformations and Functor Categories 42 3.4.1 Natural Transformations 42 3.4.2 Natural Equivalence 44 3.4.3 Functor Categories 45 3.5 Other Constructions 46 3.5.1 Opposites56 3.5.2 Product Categories 47 3.5.3 Comma Categories 48 3.5.4 Universals and Limits 49 3.5.5 Adjoints 50 3.6 Additional Issues 51 IV. P R O G R A M M I N G L A N G U A G E S E M A N T I C S IN NaDSet 54 4.1 Formalizing Recursive Definitions 56 4.1.1 Axiomatic Method 56 4.1.2 NaDSet Method 57 4.2 Example of Programming Semantics 60 4.2.1 Syntax 60 4.2.2 Expression Semantics 64 4.2.3 Command Semantics 65 4.2.4 Example Theorem 67 4.2.5 Nondetenriinistic Constructs 72 4.3 Remarks on the Use Of Recursive Definitions 75 4.3.1 First Case: Simple Induction 75 4.3.2 Second Case 77 4.3.3 Third Case 79 4.3.4 General Case 81 V . T H E L A M B D A C A L C U L U S IN NaDSet 83 5.1 Well-Formed Terms of the Lambda Calculus 84 5.1.1 Variables and Constants 84 iv 5.1.2 Lambda Terms 85 5.1.3 Substitution 86 5.1.4 Change of Bound Variables 8 8 5.2 The Lambda Conversion 89 5.3 A Term Model 91 5.4 Variable Assignments and X-Models 95 5.5 Scott-Meyer Models 100 VI. C O N C L U S I O N A N D F U T U R E DIRECTIONS 103 B I B L I O G R A P H Y 110 APPENDIX A : Proof of Lemma 3.3.2.1 121 APPENDIX B: Proof of Lemma 3.3.3.1 128 A P P E N D L X C : Proof of Theorem 3.3.4.1 138 APPENDIX D : Proof of Lemma 4.2.2.1 156 A P P E N D L X E : Proof of Lemma 4.2.3.1 161 APPENDIX F : Proof of Lemma 5.4.3 168 APPENDIX G : Proof of Theorem 5.4.4 177 APPENDIX H : Proof of Theorem 5.5.1 186 v A C K N O W L E D G E M E N T S I am deeply indebted to Paul Gilmore, my research supervisor, for his guidance, encouragement, help and support which was above and beyond the call of duty. The main inspiration of the thesis has been Paul Gilmore's theory, NaDSet and the documents describing it. I have been fortunate in having him as a supervisor. Many thanks to the members of my thesis committee, Andrew Adler, Jeffrey Joyce, David Kirkpatrick and David Pool for their comments and advice on the presentation of the thesis, and to Peter Freyd, Phil Scott, and Robert Seely for their insightful discussions in Kingston. This thesis would not have been possible without the patience, understanding and loving support of my wife Titia and my son Dinos. I am deeply indebted to them. Many thanks to Peter Apostoli, James Andrews, Alex Kean and Rick Morrison for their stimulating and constructive discusions, to Steve Wismath and Nou Dadoun for their comradery. Many thanks to Son Vuong for his support at the beginning of the program, to the head and the personnel of the department of Computer Science, especially to Carol Whitehead, Theresa Fong, Grace Wolkosky and Koon Ming Lau for all the favours big and small. Finally, the support of H . R. MacMillan Trust, I. W. Killam Trust and Natural Science and Engineering Research Council of Canada is gratefully acknowledged. vi Chapter I: Introduction 1 CHAPTER I Introduction 1.1 Goal of the Thesis The goal of this thesis is to demonstrate the versatility and suitability of a logic and set theory NaDSet for providing logical foundations to disparate areas of mathematics and computer science. Category theory has been chosen as the area of mathematics, while programming language semantics and semantics for the lambda calculus are the areas of computer science. In each of the three areas NaDSet provides a logical foundation using exactly the same "logistic" method: Basic concepts are defined as terms of the logic and then the logic is used to derive all theorems; no assumptions in the form of additional axioms or rules of deduction are needed. The thesis will demonstrate the ease and directness with which this can be done for the three areas, suggesting that in other, as yet unexplored areas, NaDSet may prove to be equally useful. The remainder of this introduction will provide answers to four questions: 1) What advantages does the logistic method have over other more commonly used methods? 2) Why have category theory, programming semantics, and semantics for the lambda calculus been chosen as demonstration areas? 3) What characteristics of NaDSet make it more suitable than other logics for the logistic method? 4) How has the thesis achieved its goal? Chapter!: Introduction 2 1.2 The Logistic Method Mathematical logic and formal reasoning impinges more and more frequently on the awareness of computer scientists. In the beginning, a limited form of formal logic was used by researchers in the theory of computation but, recently logic has assumed a significant role in the specification, design and verification of any computer system. Some of the recent programming languages have their semantics expressed in some formal system, while others, like Lisp and Prolog, are the implementations of such formal systems. Furthermore, Artificial Intelligence makes wide use of established formal logics as the principal tool in knowledge representation, machine learning, natural language understanding and computer based reasoning in general. But what is meant by logic? Traditionally, formal or mathematical logic consists of a language (a set of symbols and rules for sentence formation) capable of expressing the fundamental concepts of (mathematical) thought, and a definition of a decidable set of proofs for the logic. Occasionally, some kind of semantics is also defined that associates the language with some well known (mathematical, mental or physical) structures or concepts, but this semantics is apart from the formal logic itself. Throughout this century there has always been an agreement that logic should provide formalizations for truth functions (logical connectives), quantifiers and abstraction (the ability of treating a property of objects as an object), and although there is much debate on how such formalizations are to be realized, the value of logic in providing a formalization of areas of mathematics and computer science is not in dispute. The logistic method, associated with the names of Frege and Russell, is one method of using a logic to formalize mathematics; indeed, Frege and Russell defended the thesis that logic is a progenitor of mathematics. [Wilder52] However, one need not accept this thesis to appreciate the advantages of the method. The characteristic feature of the logistic method is that a concept is defined within a given logic and all properties of the concept are derived from the definition without the use of additional axioms or any modification of the given logic. For example, consider category theory. The concept of a category is defined as the set Cat of structures satisfying the axioms of category theory: Cat for {<Ar, =a, Sr, Tg, Cp> I axioms } Here the < ... > notation is being used to denote the ordered quintuple, and axioms are the Chapter I: Introduction 3 finitely many axioms needed to express the assumptions concerning Ar, =a, Sr, Tg, and Cp. A theorem of category theory is then a formula F for which the formula VArV= aVSrVTgVCp ( <Ar, =a, Sr, Tg, Cp>:Cat 3 F ) is derivable in the given logic. See chapter II for the logical notation, and chapter LTI for the meaning of the terms Ar, =a, Sr, Tg, and Cp. As another example of an application of the logistic method, consider recursive definitions of the kind needed to define the semantics of a programming language. For instance, assume that the integer 0 has been defined along with the successor function ' of the integers. Then the set of nonnegative integers can be defined in the style of Frege and Russell as follows: N for {x I [Vz(0:z A Vu(u:z => u':z) z> x:z)} N is the smallest set that contains 0 and is closed under successor. Mathematical induction over the nonnegative integers is then expressed by the following formula: Vz(0:z A Vu(u:z •=> u':z) r> Vx( x:N => x:z)) That is, any set that has 0 as a member and is closed under successor, has N as a subset. Given a suitable logic, mathematical induction can be derived within the logic without any additional assumptions. The logistic method of formalization can be realized within any formal set theory and it has at least four important advantages. First, all theorems concerning the defined concepts can be proved from the definitions themselves without additional axioms or rules of deduction. For example, mathematical induction followed from the definition of N. This becomes particularly important in areas of computer science where recursive definitions are extensively used. For example, although induction axioms can be easily discovered for the simple recursively defined sets described in [Manna&Waldinger84], finding them for complex recursive definitions, such as those provided in chapter IV, offers a challenge. Second, the definitions do not in any way modify the underlying logic, so that there need never be a concern that inconsistent axioms may be introduced. Third, the definitions are given as terms that can be shown to have properties and can be reasoned about, as has been demonstrated for N. Lastly, recursive definitions for disparate fields can be kept together without any concern that the axioms for one set of definitions will interact in unforseeable ways with those of another set of definitions. It is only necessary to maintain a discipline which ensures that the abbreviating name for a term uniquely identifies the term, at least in the contexts in which the term will be used. Chapter I: Introduction 4 1.3 Choice of Demonstration Areas The three demonstration areas do not exhaust those to which logic may be applied; for example, work in database and knowledge base systems has made extensive use of logic [Reiter 80a], [Gilmore87a,87b,87c], [Morrison91]. Further, a logistic treatment of complexity theory may shed light on the conjecture P=NP [Garey&Johnson79]. But the chosen three areas do provide a sufficiently broad spectrum of applications to achieve the goal of the thesis. 1.3.1 Category Theory Briefly, category theory has been chosen because of the challenge a formalization of the theory presents to logic and because of the importance of the theory to computer science. Abstraction has been traditionally considered as a characteristic feature of mathematics. The capability of treating a property of objects as an object by itself, has been traditionally used as a process of generalization and simplification of mathematical structures. But, unrestricted abstraction does not come without problems. At the turn of the century Russell and others discovered that the naive use of abstraction introduces inconsistencies known as mathematical paradoxes. Traditional set theories, like those of Zermelo-Fraenkel [Shoenfield67] and Godel-Bernays [Godel40], are believed to avoid the paradoxes by restricting abstraction to apply only to collections existing in a cumulative hierarchy of sets. The concern of these set theories with what sets may correctly exist, gives them an ad hoc character that may account for why they have not been of interest to some mathematicians [Gray84]. Moreover, the exclusion of self-referential terms from their set terms is a serious hindrance. Section A l of [Feferman84] provides motivation for considering set theories that permit self-membership by a simple example of a common argument in modern algebra. A set of structures is defined and the set itself is shown to be one of the structures. However, such an argument can not be carried out within the traditional set theories. It is for this reason that the traditional set theories are not suitable for a full formalization of category theory in which no distinction between small and large categories is necessary. Category theory provides an abstract and uniform treatment for many mathematical structures, and increasingly has found applications in computer science [Pierce88]. A short list would include: the design of both functional and imperative languages[Hagino87, Reynolds69], semantic models of programming languages [Smyth&Plotkin82, Huet85, Tennent85], type theory and polymorphism [Raynolds74,84, Wand75, Hagino87], semantics of concurrency Chapter I: Introduction 5 [Monteiro&Pereira86, Zamfir87], specification and development of algorithms [Pitt et al.85,87, Rydeheard&Burstall88], specification languages, algebraic semantics and atomata theory [Ehrig et al.74]. Therefore, a formalization of category theory is important for its computer science applications especially when an automated (or semi-automated) theorem prover can be provided for the formalization. Such formal treatment then can provide a link between abstract categorical specifications and machine executable specifications. For instance, it can significantly contribute to the development of tools for (semi)automated implementation of a language or an algorithm from its semantics or formal specifications, (semi)automated translation from one language to another or even a tool for (semi)automated design and verification for a specific programming language. 1.3.2 Semantics of Programming Languages Providing semantics for programming languages is a fundamental problem for computer science that offers special challenges for a mathematical treatment. The need for unrestricted abstraction for programming language semantics has been recognized by many of its researchers. [Scott70] for instance, describes the problems of self-application that can arise when interpreting programming languages and proposes a solution that has led to the development of denotational semantics. Although Scott's theory provides an elegant mathematical foundation for the semantics of the lambda calculus and programming languages in general, it is not a formal theory since it lacks an effective proof theory. In Scott's foreword to [Stoy7.7], he concludes "For the future the problems of an adequate proof theory and of explaining non-determinism loom very large." In his paper [Scott91] he calls for the development of a formal intuitionistic set theory to provide foundations for programming semantics since such a theory would not only have an effective proof theory, but also would permit the distinction between concepts that are identical in classical set theories. Thus programming semantics provides a challenge for the logistic method in as much as it requires the development of a new logic and set theory. Additionally, since programming semantics is an area rich in recursively defined objects about which theorems must be proved, the logistic method is especially suitable for its formalization. Chapter I: Introduction 6 1.3.3 The Lambda Calculus The theory of lambda calculus has been chosen to demonstrate how the syntax, the proof theory and the semantics of a formal language can be defined in NaDSet in a direct way. The theory of lambda conversion, [Church41], not only has had a great influence on the development of the theory of computation but also is the first consistent theory that offers unlimited abstraction permitting the formation of self-referencial terms. Moreover, the full lambda calculus is an extensional theory while NaDSet is an intensional one. Defining models for such a theory requires, in addition to the extensive use of recursive definitions, a careful use of the extensional identity relation over the terms of NaDSet; details are provided in 2.3.5, and in chapter V. 1.4 Main Features of NaDSet The logistic method requires of a logic that abstraction be treated as a basic concept along with the usual connectives and quantifiers. Of necessity, therefore, the logic must offer an elementary resolution of the paradoxes of set theory. NaDSet resolves the paradoxes of the set theory by formalizing all three basic concepts through rules of deduction in a natural deduction presentation of the logic. An earlier version of the logic was described in [Gilmore71,80,86], while the extended version used in this thesis is described in [Gilmore89] and proved consistent in [Gilmore90]. That NaDSet is formalized as a natural deduction logic is the first of its four important characteristics which will be discussed. 1.4.1 Natural Reduction based Set Theory Although the sequent calculus of [Gentzen34,35] was originally used, any natural deduction formalization of first order logic, such as those presented in [Beth55], [Prawitz65], or [Fitch 52] can be extended to be a formalization of NaDSet, [Gilmore&Tsiknis91b]. Natural deduction presentations of logic provide a transparent formalization of the traditional reductionist semantics of [Tarski36], in which the truth value of a complex formula depends upon the truth values of simpler formulas, and eventually upon the truth values of atomic sentences. Formalizing abstractions in this way has the effect of replacing an unrestricted Chapter I: Introduction 7 comprehension axiom scheme by a comprehension rule of deduction. This replacement is not novel to NaDSet; for example, several of the theories described in [Schiitte77] or the set theory of Fitch described in [Prawitz65] or [Fitch 52] have this feature. This replacement is, however, not enough to ensure consistency; the theory described in [Gilmore68], for example, is inconsistent because of an improper definition of 'atomic formula'. The interpretation of atomic formulas is critical for the reductionist semantics of Tarski. A second important characteristic of NaDSet is its interpretation of atomic formulas. 1.4.2 A Nominalist Interpretation of Atomic Formulas In NaDSet, only names of sets, not sets may be members of sets. To emphasize that this interpretation is distinct from the interpretation of atomic formulas in classical set theory,':' is used in place of 'e' to denote the membership relationship. For example, the atomic formula (i) {ul-u:u}:C is true in an interpretation if the term '{u I -u:u }' is in the set assigned to ' C , and is false otherwise. Note that the term '{u I -u:u }' is being mentioned in the formula while ' C is being used. To avoid confusions of use and mention warned against in [Tarski36] and [Church56], NaDSet must be in effect a second order logic. The first order domain for the logic is the set D of all closed terms in which no parameter ocurs, as defined in clause 4 of the definition of the elementary syntax in section 2.1 of chapter LT. For example, the term '{u I -u:u }' is a member of D. The second order domain for the logic is the set of all subsets of D. Thus if ' C is a second order constant, then an interpretation will assign it a subset of D, so that (i) will be true or false in the interpretation. This nominalist interpretation of atomic sentences is motivated and illustrated at greater length in [Gilmore71,80]. Since computing machines are consummate nominalists, this nominalist interpretation is a natural one for a logic such as NaDSet motivated by the needs of computer science. Although NaDSet is in effect a second order logic, the elementary syntax requires only one kind of quantifier used for quantification over both the first order and second order domains. This is Chapter I: Introduction 8 the third important characteristic of NadSet. 1.4.3 One Universal Quantifier Instead of Two In classical logic, existential quantification can be defined in terms of universal quantification and negation for both first and second order quantifiers. This opportunity for simplification is exploited in NaDSet as well; but the elementary syntax requires only one universal quantifier, not one for first order quantification and one for second order quantification as was the case with the earlier form of NaDSet. However, the second order nature of the logic is revealed in the two kinds of parameters that are required. An occurrence of a parameter in a formula or term of NaDSet plays the role that it does in [Prawitz65], namely as the occurrence of a variable not bound by a quantifier or an abstraction term. The definition of a substitution operator for a term in which free variables occur is complicated by the possibility of a free occurrence of a variable in the term becoming bound after the substitution. Admitting parameters as free variables allows the simpler definition of a substitution operator restricted to terms without free occurrences of variables. In an interpretation of NaDSet, first order parameters are assigned members of D, while second order parameters are assigned subsets of D. The last of the four important characteristics of NaDSet is discussed next. 1.4.4 A Generalized Unrestricted Abstraction N is defined in 1.2 as an abbreviation for a term {x I [Vz(0:z A V U ( U : Z Z> u':z) => x:z)}. This latter is a typical abstraction term of set theory that has such terms. In general they take the form {v I F }, where v i s a variable, and F is a formula in which the variable may have a free occurrence. The term is understood to represent the set of v satisfying F. In NaDSet, however, v may be replaced by more general terms. For example, the Cartesian product of two sets A and B is defined [AxB] for {<u,v> I ( u:A A v:B )} where <...> is the ordered pair. The abstraction term abbreviated in 1.2 by Cat is another example. Chapter I: Introduction 9 The rules of deduction for the introduction of abstraction terms such as these are natural generalizations of the rules of deduction for abstraction terms of the form {v I F}. These abstraction rules determine what are appropriate uses of abstraction terms in mathematical arguments, rather than determine what sets may consistently coexist. For example, the arguments Russell used to show that the empty set is a member of the Russell set and that the universal set is not, are arguments that can be shown to be correct in NaDSet, while the arguments demonstrating that the Russell set is and is not a member of itself cannot be justified in NaDSet. Thus it can be said that NaDSet provides an answer to the question What constitutes a sound argument? rather than to the question. What sets exist? which is a concern of the traditional set theories. In conclusion, NaDSet offers unrestricted generalized abstraction; self-referential set terms can be formed but arguments leading to contradictions are excluded. 1.5 How the Goal Has Been Achieved The goal of the thesis is accomplished by first providing within NaDSet direct definitions of the basic concepts in each of the chosen areas and then by showing that certain theorems that are known to present problems to some other formalisms, are derivable within the logic using these definitions alone. A NaDSet formalization of the basic concepts in category theory is given first. A NaDSet definition of a category is given that is more general than the traditional definitions in two respects: a category is defined in terms of its arrows only with no reference to objects; and secondly, the identity relation of a category is an explicit part of its structure. The notion of a functor on categories is formalized in a similar way. The larger fragment of this part provides the necessary definitions for the category of categories and a NaDSet proof that the latter structure is itself a category. This proof, although greatly abbreviated, demonstrates the capability of NaDSet to provide logical foundations for category theory. An important consequence of this formalization is the following: It is not necessary to distinguish between small and large categories as it is the case when a traditional set theory (like Zermelo-Fraenkel or Godel-Bernays set theory) is used as a foundation of category theory. Chapter I: Introduction 10 Definitions for the remaining fundamental concepts and constructs in category theory , such as those described in [MacLane71] or [Barr&Wells85}, are also presented. The need of a set theory that provides for self-referential definitions is imperative in the field of prograrnming language semantics and was recognized by many of its researchers. To further clarify this point, two approaches to formalizing recursive definitions, corresponding to two different views of mathematics, are contrasted. The advantages of NaDSet's complete recursive definitions are demonstrated by defining in NaDSet the semantics of a simple programming language. Recursive definitions for the set of expressions and commands of the language as well as for their semantics are provided and a theorem stating the semantic equivalence between two commands is derived. The significance of this is underscored by the fact that such a proof cannot be carried out within the lambda calculus or a first order formalization of domain theory without the need of additional axioms. In higher order systems like L C F [Milner72, Gordon et al.78] and H O L [Gordon87] a derivation of such theorem requires fix-point induction and a type of admissibility test the way it is described in chapter 9 of [S toy77]. To further illustrate the use of NaDSet in defining semantics of nondeterministic languages, a nondeterministic expression and command are added to the language and their semantics is defined. In NaDSet, the semantics of a nondeterministic construct is not different from that of its deterrninistic counterpart. In the case of a command, for instance, both are defined by a term that represents a binary relation over the states. Of course, in the nondeterministic case an initial state is associated with (possibly) more than one final states. On the other hand, some kind of power set (or power domain) construction is needed to express this concept in traditional domain theory. Finally, Church's theory of lambda conversion [Church41, Hindley&Seldin86] is defined in NaDSet in a direct way, avoiding the use of complicated encodings. NaDSet definitions of the lambda calculus well formed terms, substitution and conversion are given and the main theorems about them are expressed within this framework. One of the points this part emphasizes is the capability of NaDSet to provide simple and straightforward treatment to such types of concept: NaDSet definitions of the various lambda calculus concepts closely resemble the traditional recursive definitions in any lambda calculus textbook, such as [Barendregt81] or [Hindley&Seldin86]. Chapter I: Introduction 11 In order to show that a significant part of lambda calculus model theory can also be expressed within NaDSet, three of the most acceptable definitions of a lambda calculus model are presented, the structure known as Church's term model is defined and proofs that this structure satisfies the given definitions of models, are provided. 1.6 Thesis Outline and Reader's Guide The rest of the thesis is organized in five chapters. Chapter LT contains a review of the theory NaDSet. Its elementary and logical syntax, that is its syntax and proof theory, are described in detail and some derived rules and definitions needed in subsequent chapters are also provided. Chapter HI provides a NaDSet formalization of the basic concepts in category theory. The set of categories, Cat, and the functors, Func, are defined first and the proof that Cat is also a category is presented. The rest of the chapter contains additional definitions and discussions on natural transformations, functor categories, comma categories, universal elements, limits and adjoint functors. Some consequences of this formalization are discussed at the end of the chapter. Chapter IV of the thesis deals with NaDSet applications in programming language semantics. The chapter starts with a comparison of NaDSet's approach to formalizing recursive definitions with the axiomatic approach. Using recursive definitions, the syntax and the semantics of a simple programming language are defined and a derivation of the semantic equivalence of two command sequences is provided. Next, the programming language is extended to include nondeterministic expressions and commands and the definitions of the semantics of the new constructs are provided. Some remarks and intuition on the way the recursive definitions are used are given in the last section of the chapter. Whereas the two previous chapters discuss the use of NaDSet in formalizing concrete (informal) mathematical (or computer science) theories, chapter V demonstrates how the formal theory of lambda calculus can be defined within NaDSet. Recursive definitions of the lambda calculus terms, variable substitution and the Xpn-theory of term conversion are given and the main theorems about them are expressed in NaDSet. Three definitions of a lambda calculus model are presented in the sequence. The first defines a structure with a relation that interprets the term Chapter I: Introduction 12 conversion. The second definition makes use of variable assignments and the third defines the Scott-Meyer models of the theory. Church's term model is constructed and it is shown to satisfy the given definitions. Finally, chapter VI presents some concluding remarks and discusses some preliminary ideas about the use of NaDSet in other areas of computer science. Chapter II is essential for an understanding the rest of the thesis. However, the hasty reader may just go through the sections 2.1, 2.2 and 2.3.1 before he/she embarks on the rest of the thesis and consult the rest of the material in chapter II as it is necessary. A reader familiar with the latest version of NaDSet can ignore the chapter as soon as she/he makes himself familiar with the notions of the 'for'-definitions in section 2.3.1 and the conventions on derivations which are discussed at the end of section 2.2. Chapters III, IV and V are fairly independent and can be read in any order but, the reader is cautioned that the complexity of the definitions and derivations presented in each of these chapters increases as the number of the chapter does. Moreover, the remarks of section 4.3 may help in understanding the derivations presented in chapter V. Finally, in order to assist the reader, the lengthy proofs of some lemmas and theorems are given in the appendices. Chapter II: NaDSet 13 CHAPTER II The Logic NaDSet A detailed description of the logic NaDSet is provided in this chapter. The elementary syntax, that is the definitions relating to well-formed formulas and terms, is described in section 2.1, while the logical syntax, that is the definitions relating to well-formed proofs, is described in section 2.2. The last section of the chapter includes some derived rules and definitions that are used later in the thesis but no discussion on the semantics of the theory is included here. [Gilmore89] contains a section on the semantics of NaDSet and [Gilmore90] presents a consistency proof of the theory. [Gilmore&Tsiknis91b] provides alternative natural deduction formulations of NaDSet. 2.1 E L E M E N T A R Y S Y N T A X To simplify the description of NaDSet, only a single logical connective '1' and only a universal quantifier V are taken to be primitive. The connective is joint denial, so that (FIG) has the same truth table as (~F A -G) . In this definition, as throughout the thesis, bold expressions represent metavariables over particular sets of strings. Chapter II: NaDSet 14 Definition of Elementary Syntax 1.1. A variable is a term. The single occurrence of the variable in the term is a free occurrence in the term. 1.2. Any parameter or constant is a term. No variable has a free occurrence in such a term. 2 .1 . If r and s are any terms, then r:s is a formula. A free occurrence of a variable in r or in s, is a free occurrence of the variable in the formula. 2 .2 . If F and G are formulas then (FIG) is a formula. A free occurrence of a variable in F or in G is a free occurrence in (FiG). 2 .3 . If F is a formula and v a variable, then VvF is a formula. A free occurrence of a variable other than v in F, is a free occurrence in VvF; no occurrence of v is free in V v F . 3 . Let t be any term in which there is at least one free occurrence of a variable and no occurrence of a parameter. Let F be any formula. Then {tIF} is an abstraction term. A free occurrence of a variable in F which does not also have a free occurrence in t, is a free occurrence in {tIF}. A variable with a free occurrence in t has no free occurrence in {tIF}. 4 . A term is first order if no second order parameter occurs in it. A formula t:T is atomic if t is first order, and T is a second order parameter or constant. A term or formula in which no variable has a free occurrence is said to be closed. Clause 3 of this definition introduces the syntax for set abstraction. It generalizes the conventional syntax in which t may only be a single variable. The more general form of the abstraction term is a genuine extension of the logic that is essential for many of its applications, including its use for category theory in chapter HI. 2.2 L O G I C A L S Y N T A X The extended NaDSet, like the original, is presented as a Gentzen Sequent Calculus [Genzen31,32]. A sequent in NaDSet takes the form r-> 6 Chapter II: NaDSet 15 where r and 0 are finite, possibly empty, sequences of closed formulas. The formulas r form the antecedent of the sequent, and the formulas of © the succedent. A sequent can be interpreted as asserting that one of the formulas of its antecedent is false, or one of the formulas of its succedent is true. By the logical syntax of NaDSet is to be understood the description of the axioms and the rules of deduction for sequents. Definition of Logical Syntax Axioms G -> G, where G is a closed atomic formula Propositional Rules r,G-40 A, H -> A r, A -»(GiH), 0, A Quantification Rules r -> [p/u]F, © r, [r/u]F -> © T -> VuF, 0 r, VuF -> 0 In the first rule, p is a parameter that does not occur in F, or in any formula of r or 0. p is the eigenparameter of the rule. In the second rule, r is any closed term, r is called the eigenterm of the rule. Abstraction Rules r->Ir_/ujF, © r, [r/ujF->0 r->[r/uJt:{tlF},0 r , £ r /u ] t : { t lF } H>0 r->G, © r-> H, e r, (GiH) -> © r, (GiH) -> © 11 is a sequence of the distinct variables with free occurrences in the term t. F is a formula in which only the variables u have free occurrences. Chapter II: NaDSet 16 I is a sequence of closed terms, one for each variable in u.. Structural Rules Thinning r -»e r-4 e r-» F, 9 r, F -»© where F is any closed formula. Contraction r,->F,F, e r , F , F - > © r -> F, © r, F -> © Interchange r -> F, G , © r, F, G -> © r-> G , F, © r, G , F - > © Cut Rule r -> ©, F F, A -> A r, A -> ©, A E n d of definition The propositional, quantification and abstraction rules will be denoted respectively by: i->, -»V, V-», -> {} and {} The structural rules will be referred to by name. Some remarks on derivations The concept of a NaDSet derivation, or simply derivation, is similar to the concept of Gentzen's LK-derivation [Szabo69] but, for space reasons, all the derivations presented in this thesis are condensed. Several applications of the rules of deduction may be represented as one Chapter II: NaDSet 17 application. To assist in identifying the rule being applied, the principal formula in the conclusion of the rule is identified with a prefixed *; here "principal sentence" means the explicitly displayed sentence in the conclusion of the rule. More than one sentence may be so prefixed when a single step represents applications of more than one rule. When a step involves a single premiss rule, the long bar between the premiss and the conclusion is omitted. However, in a step with many premisses, the long bar is retained and a short bar is used to indicate the begining of the premissses for the next multi-premiss rule. The first of these premisses is the end sequent of the derivation appearing above it. If the other premisses are not numbered then their derivations are immediate. Only premisses that are not simple consequences of a lemma are explicidy annotated. If a short bar should occur immediately after a long bar, it is omitted. 2.3 S O M E D E R I V E D R U L E S A N D DEFINITIONS This section displays some definitions and derived rules that are needed in the remainder of the thesis. 2.3.1 'for' Definitions Essential to an understanding of the subsequent chapters is the proper interpretation of definitions of the form name for expression or namerr1.... r m ] for expression . In the first definition name is an abbreviation for expression which is a NaDSet term or formula. This means that any NaDSet expression (that is, term or formula) in which name occurs, should be understood as an expression in which name is replaced by the term or formula expression. The second of these definitions is a definition scheme of individual definitions of the first kind. In this, r l 5.., r m are metavariables ranging over the expressions of NaDSet. Therefore, any term or formula in which namely,... tm] for some terms t l v., t m occurs, it is understood as a term or formula in which namef^,... t ] is replaced by the expression obtained from Chapter II: NaDSet 18 expression by replacing r x by tj and r m by t m . This second use of the for definitions is similar to the quasi-quotation corner notation of [Quine51]. As an illustration consider the following definition of the logical connective '-' in terms of ~[F] for FlF In this case name is the s y m b o l F is a metavariable ranging over NaDSet formulas and expression is the formula F l F . By omitting the square brackets, the last definition gets the more traditional appearance: - F for F l F Moreover, Gentzen's negation rules [Szabo69] can be derived using this definition as follows: —y. - » - : The last step in both derivations is not an application of any rule of section 2.2.; it is an application of the previous definition, instead. From NaDSet's point of view, the last two sequents in each derivation are identical; one is an abbreviation of the other. Therefore the rule applied at this step is just the rule of repetition which is implicitly acceptable by the logical syntax. The latter is in agreement with the abbreviation-like interpretation of the definitions explained in this section. As another example consider the set of categories defined in section 3.1 of chapter III by the definitions: Cat for {<Ar, =a, Sr, Tg, Cp> I Category[Ar, =a, Sr, Tg, Cp] } Category[Ar, =a, Sr, Tg, Cp] for axioms . In the first of these definitions, 'Cat' is provided as an abbreviation for the abstraction term { <Ar, =a, Sr, Tg, Cp> I Category[Ar, =a, Sr, Tg, Cp] } . In the second, A r , = a, Sr, Tg and Cp are used as metavariables ranging over the terms of NaDSet. When they are replaced with particular terms, as they are in the formula Category[Ar, =a, Sr, Tg, Cp] r, F-> A r,F-> A r -» A, F r, FiF -> A r, ~F -> A r-> FlF, A r-> -F, A Chapter II: NaDSet 19 by variables 'Ar', '=a', 'Sr', 'Tg' and 'Cp', the resulting formula Category[Ar, =a, Sr, Tg, Cp] is an abbreviation for the conjunction of all the axioms for categories in which the terms Ar, =a, Sr, Tg and C p are replaced by the variables 'Ar', '=a', 'Sr', 'Tg' and 'Cp'. Of course most of these definitions are given in order to be used in some context. In the case where expression is a term such an in-context definition has the form n for t in S where n is a name (actually, a subset of the variables can be reserved for names; therefore, n can be treated as variable), t is a term and S is a formula. Such a definition is nothing else than the NaDSet formula t:{nlS} The latter indicates that definitions in NaDSet need not be viewed as metatheoretic notions but can be regarded as sentences in the object language, instead. Nevertheless, for simplicity in this thesis the first form of definitions is used and they are interpreted as abbreviations in the way it was discussed earlier. 2.3.2 Additional Connectives and Quantifiers Although the logical syntax of the logic was defined using a single logical connective and one quantifier, all the usual logical connectives, - , A, V, Z>,= and the existential quantifier 3 can be defined using i and V and the corresponding rules of deduction can be derived. The previous section offered an illustration for'-'; the rest of the connectives and the existential quantifier can be treated similarly. In the sequence, the deductive rules for the additional logical symbols are listed but their derivations are omitted. When necessary they will be denoted respectively by: ->A, A-», —>v, v-», ->z>, z>—>, =->,-»3 and 3—>. r, G -> e r -> G, © r - » ~ G , © r, ~ G -> e Chapter II: NaDSet 20 -»A, A—>: r->G, e A-»H,A r, A -> (GAH), e, A ->v, v->: r -> G, 0 r -> H, © r->(GvH),e r->(GvH),© r, G -> H, 0 r-KG^H),© r,G->H,e A,H->G,A r, A -> (G=H), 0, A r -> G, © A, H -> A r, A, (G=H) -»©, A ->3, 3->: r-» [r/u]F, 0 T -> 3uF, 0 In the first rule, r is any closed term. In the second rule, p is a parameter that r, G -»© r,H -> © r, (GAH) -> e r, (GAH) -> © r, G -> © A, H -> A r, A, (GvH) -»©, A r -»G, © A, H -> A r, A, (Gz>H) -> ©, A r, G -> © A -> H, A r, A, (G=H) -> ©, A r, [p/u]F -> © r, 3uF -> © not occur in F, or in any formula of T or 0. Chapter II: NaDSet 21 2.3.3 Bounded Quantifiers Bounded quantifiers are frequently used throughout the paper. For example, each of the axioms (cl) - (c20) for categories given in section 3.1 uses a single or multiple bounded universal quantifier. Consider (c2): [ V f , g : A r ] ( f = a g 3 g = a f ) This expression is an abbreviation for the expression: [VfJ[Vg]( f :Ar A g:Ar 3 (f= ag => g=af)) Thus [Vf,g:Ar] is a conventional bounded quantifier. But a more general form of bounded quantifier is also used: A single variable may be bounded by an abstraction term. For example, lemma 3.2.1 of section 3.2 takes the form: -> [Vx,y:Cat] P[x,y] where P[x,y] is a formula in which the variables 'x' and 'y' occur free. 'Cat', as described in section 2.3.1 above is an abbreviation for the abstraction term {<Ar, =a, Sr, Tg, Cp> I Category [Ar, =a, Sr, Tg, Cp]} where Ar, =a, Sr, Tg and Cp are variables that are bound in the abstraction term. A single bounded quantifier of the form [Vx:Cat] P[x] is an abbreviation for the formula [VAr'] [V=a'] [VSr1] [VTg'] [VCp']( <Ar',=a',Sr ,,Tg ,,Cp ,>:{<Ar,=a,Sr,Tg,Cp> I Category[Ar,=a,Sr,Tg,Cp]} 3 P[<Ar',=a',Sr',Tg',Cp'>] ), where Ar', =a', Sr', Tg' and Cp' are distinct variables free to replace respectively the variable x in the formula P[x]. The formula [Vx,y:Cat] P[x,y] is then an abbreviation for the formula [VAr1] [V=a'] [VSr'] [VTg'] [VCp1] [VAr"] [V=a"] [VSr"] [VTg"] [VCp"] ( Chapter II: NaDSet 22 <Ar\= a\Sr\Tg\Cp'>:{<Ar ,=a,Sr,Tg,Cp> I Category[Ar,=a,Sr,Tg,Cp]} A <Ar" =a",Sr",Tg",Cp">:{<Ar =a,Sr,Tg,Cp> I Category[Ar ,=a,Sr,Tg,Cp]} 3 P[<Ar',=a',Sr',Tg\Cp'>, <Ar",=a",Sr",Tg",Cp">] ), where the variables Ar', =a', Sr', Tg', Cp', Ar", =a", Sr", Tg" and Cp" are suitably chosen. The general form of the bounded quantifiers is defined: [Vv:{t I F}] G for V u (t:{t I F} => [t/v]G) [3v:{t I F}] G for 3JI (t:{t I F} A [t/v]G) where u. is a sequence of the distinct variables with free occurrences in t, and Vu_, 3u. are sequences of quantifiers Vu and 3u, one for each variable u in u, respectively. The following rules of deduction for the bounded quantifiers can be derived: ->V, 3->: r,[fi/uJt:{tlF} [[fi/u]t/v]G,8 r,[p./u]t:{tlF}, [[j>/u]t/v]G -> 0 r - > [ V v : { t l F } ] G , © r, [3v:{tlF}]G-> 0 where u is a sequence of the distinct variables with free occurrences in t, and P. is a sequence of the same length as u. of distinct parameters, none of which occur in the conclusion of the rule. V->, 3 : r->[ryii]t:{tlF},© A, [[r/u]t/v]G -» A r, A, [Vv:{tlF}]G->0,A r->[r/u]t:{tlF},0 A^[[r/yJt/v]G,A r, A -> [3v:{tlF}]G, 0, A where u is a sequence of the distinct variables with free occurrences in t, and I is a sequence of the same length as u of closed terms. Chapter II: NaDSet 23 2.3.4 Ordered Pairs and Identity Order pairs are defined <r,s> for {u l(r:C4s:C)}, where ' C is a given second order constant. Any second order constant may be used since the constant need not satisfy any assumptions apart from the assumptions made for every second order constant. This unusually simple definition of ordered pair is satisfactory in NaDSet because NaDSet is an intensional logic. Triples and other tuples can be similarly defined directly, or can be defined by nesting pairs. Note that when r and s are variables, say 'u' and V , the term <u,v> satisfies the conditions placed on the term t in clause 3 of definition 2.1 of the elementary syntax. This is the most common use of the ordered pair. Note also, however, that the form of t is irrelevant for applications of the } and { } - » rules defined in definition of the logical syntax in 2.2. The term serves only the purpose of providing an order to the distinct variables with free occurrences in it. Identity is given by the definition = for {<u,v>l [Vz](u:z z> v:z)}. Members of = are ordered pairs <r,s>. The conventional infix notation r=s will be used instead of expressing membership by the formula <r,s>:=. The following are derived rules for identity. Their derivations can be found in [Gilmore89]. ->=: r, r:P -> s:P, 0 r -> ©, r=s for any closed first order terms r and s, and second order parameter P not occurring in any set of formulae r, 0. =->: r -> 0, [r/u]F [s/u]F, A —»A r, A, r=s -> 0, A Chapter II: NaDSet 24 where F is any formula in which only the variable u has a free occurrence, and r and s are any constant terms. Moreover, for any formula F and constant terms r, s [r/u]F -> [r/u]F [s/u]F -> [s/u]F r=s, [r/u]F -> [s/u]F is a derivable rule and r=s r=s is a derivable sequent. Finally, the desired properties of the ordered pairs are demonstrated by the following derived rules where, rv r 2 , Sj and s 2 are constant first order terms. -><>: r -> ©, rj=r 2 A -» A, S1=S2 r, A —» 0, A, <rv s1>=<r2, s2> <>^ : r, r t =r 2 -> e r, s t=s,->@ r, <r1? s1>=<r2, s2> -^ 0 r, <r1, s1>=<r2, s2> 0 2.3.5 Extensional Identity Extensional identity is defined as = e for (<x,y>lVu (u:x = u:y )} and provides a means for illustrating important aspects of quantification within NaDSet. Consider the following defined 'universal' sets: Chapter II: NaDSet 25 V I for {ulu=u} V2 for {yly= ey} For each of these terms tm, it is possible to derive the sequent ->tm=etm But the derivations take on a different character in each case. In the following derivations, p is a first order parameter, and P is a second order parameter: For V I : p=p - » p = p =axiom p : V l ^ p : V l {}^ >,->{} - > V l = e V l ->s ,->V For V2: p:P -» p:P axiom -> P=eP ->V ->P:V2 ->{} P:V2 -> P:V2 thinning - » V 2 = e V 2 ->s ,->V Note also that the following sequents are also derivable: - > V l : V l , - > V 2 : V 2 , - > V l : V 2 a n d - * V 2 : V l The first two demonstrate that self-membership presents no problems for NaDSet. Because of the generalized form of abstraction, other forms of extensional identity may be defined. For example, extensional identity for sets of ordered pairs can be defined: =e2 for {<x,y> I VuVv (<u,v>:x = <u,v>:y )}. Other similar forms of extensional identity will be encountered in section 3.3. 2.3.6 Natural Numbers In subsequent chapters some concepts from arithmetic will be needed. Some basic definitions are provided here: Chapter II: NaDSet 26 0 for {u I -u=u} Succ[t] for {u I u=t} SuccCls for ( Z I O : Z A [ V U : Z ] ( S U C C [ U ] : Z ) } N for {ul [Vz:SuccCls](u:z)} < for {<u,v> I [Vz:SuccCl] (u:zz> v:z)} The full development of arithmetic within NaDSet is sketched in [Gilmore86]. Chapter III: Category Theory in NaDSet 27 CHAPTER III Category Theory in NaDSet Section A l of [Feferman84] reinforces the argument presented in [Feferman77] that category theory cannot by itself provide a foundation for mathematics since it makes use of prior notions of logic and set abstraction. At the same time the first paper provides motivation for constructing set theories other than the traditional Zermelo-Fraenkel and Godel-Bernays set theories. An example of a common argument in modern algebra is presented using structures <A, ®, =A> consisting of a set A , a commutative and associative binary operation ® and an identity relation =^ over A . If B is the set of all such structures, PR is the Cartesian product on B and ISO isomorphism between the elements of B, then the structure <B, PR, ISO> is itself a member of B. However, a proof of this fact cannot be formalized within the traditional set theories because of the prohibition against self-membership or self-reference. In [Gilmore89] a proof that <B, PR, ISO> is a member of B was provided within NaDSet. This encouraged the conjecture that NaDSet could provide a logic within which category theory could be formalized. This chapter substantiates this conjecture by providing a proof within NaDSet that the set of all categories is itself a category. Category theory, of course, involves many more primitive concepts than the theory of B-structures. Section 3 presents a definition of a category within NaDSet that is more general in Chapter III: Category Theory in NaDSet 28 two respects than the definition given in [Barr&Wells85] or in [Mac Lane71]. First, a category is defined in terms of its arrows only with no reference to objects, as suggested in [Lawvere66]. Secondly, the identity relation of a category is an explicit part of its structure. While the first simplification is not fundamental, the second generalization has important repercussions. It allows each category to assume its own identity relation that generally may be different than the extensional identity implied by the traditional definitions. The definition of category theory in section 3.1 is typical for definitions of an axiomatic theory within NaDSet. The axioms of the theory are used only to define the set of structures satisfying the axioms, and in no way imply the existence of a structure satisfying the axioms. Therefore, the formalization of the theory within NaDSet has no existential implications for NaDSet. This fact may help to provide an answer to the question posed in [Blass84]: Does category theory necessarily involve existential principles that go beyond those of other mathematical disciplines? When a traditional set theory is used as a foundation for category theory, it is necessary to distinguish between small and large categories [Mac Lane71]. That is not necessary when category theory is formalized within NaDSet. Of course this does not provide an answer to the question: Does the proof of the existence of some categories involve existential principles that go beyond those of other mathematical disciplines? In section 3.2 the notion of a functor on categories is formalized. In section 3.3, which constitutes the larger part of the chapter, the necessary definitions for the category of categories and the detailed NaDSet proof that the category of categories is itself a category, is provided. This proof is of necessity greatly abbreviated, but nevertheless remains long and tedious. Since NaDSet is a logic novel to most readers, and since formal derivations are generally foreign to category theory, this chapter possibly errs on the side of providing too much detail, rather than too little. However, by examining only parts of the derivations provided, readers may gain confidence in the principal result and in the capability of NadSet to provide logical foundations for category theory. The ubiquitous notions of natural transformations and functor categories are formalized in section 3.4, while in section 3.5, definitions and theorems for a variety of basic constructions including comma categories, universals, limits and adjoints are provided. These two sections further demonstrate that NaDSet may be used as the logic for category theory and suggest that any construct in category theory, as well as in the theories of toposes, sheaves, triples etc. can be formalized within NaDSet in a similar way. Chapter III: Category Theory in NaDSet 29 3.1 C A T E G O R I E S A NaDSet definition of the set of categories will be given using the terminology provided in the introduction of [Barr&Wells85] with one exception: Instead of using objects and arrows in defining a category, by following Lawvere's definition [Lawvere66], objects can be dispensed with altogether, and only arrows used. Nevertheless, for the readers who are accustomed to the more traditional definition of categories, a definition of the objects for a category in terms of its arrows is provided. Throughout this chapter, conventional algebraic notations are used as abstraction variables and as parameters. These notations will be explained as they are introduced. Additionally, metavariables ranging over terms of NaDSet that are intended to represent algebraic concepts, are used. They will always be printed in bold type. For example, the variables of this kind used in this section, together with their intended interpretation are: A r the set of arrows or morphisms = a identity of arrows Sr a binary term with first argument an arrow and second argument its source object T g a binary term with first argument an arrow and second argument its target object C p a ternary term the third argument of which is the composite of the arrows that are its first two terms. The first use of these metavariables is in the following definition: Category[Ar, = a, Sr, Tg, Cp] for axioms "axioms" is the conjunction of the sentences listed below. In these axioms, the usual infix notation for = a is used instead of the postfix notation of NaDSet. Identity Axioms [Vf:Ar] f= af [Vf ,g :Ar] ( f= a g3g= a f ) [Vf,g,h:Ar]( f=ag A g=ah 3 f= ah) (cl) (c2) (c3) Chapter III: Category Theory in NaDSet 30 [Vf,g,a:Ar]( f=ag A <f,a>:Sr 3 <g,a>:Sr) (c4) [Vf,a,b:Ar]( a=ab A <f,a>:Sr 3 <f,b>:Sr ) (c5) [Vf,g,a:Ar]( f=ag A <f,a>:Tg 3 <g,a>:Tg) (c6) [Vf,a,b:Ar]( a=ab A <f,a>:Tg 3 <f,b>:Tg) (c7) [Vf,g,h,k:Ar] (f= ak A <f,g,h>:Cp 3 <k,g,h>:Cp ) (c8) [Vf,g,h,k:Ar] (g= ak A <f,g,h>:Cp 3 <f,k,h>:Cp ) (c9) [Vf,g,h,k:Ar] (h= ak A <f,g,h>:Cp 3 <f,g,k>:Cp) (clO) Sr. Tg and Cp are functions [Vf:Ar][3a:Ar] <f,a>:Sr (ell) [Vf,a,b:Ar]( <f,a>:Sr A <f,b>:Sr 3 a=ab) (cl2) [Vf:Ar][ 3a:Ar] <f,a>:Tg (cl3) [Vf,a,b:Ar]( <f,a>:Tg A <f,b>:Tg 3 a=ab) (cl4) [Vf,g,b:Ar]( <f,b>:Tg A <g,b>:Sr 3 [ 3h:Ar]<f,g,h>:Cp) (cl5) [Vf,g,h,a,b,c:Ar]( <f,g,h>:Cp 3 (( <f,a>:Sr 3 <h,a>:Sr) A (<g,b>:Tg 3 <h,b>:Tg) A (<f,c>:Tg = <g,o:Sr))) (cl6) [Vf,g,h,k:Ar] (<f,g,h>:Cp A <f,g,k>:Cp 3 h= ak) (cl7) Note that compositions are written in the order of the arrows from left to right. Therefore, <f,g,h>:Cp if and only if h is g° f where 0 denotes morphism composition. Identity Arrows-Exist [Vf,a:Ar]( <f,a>:Sr 3 <a,a>:Sr A <a,a>:Tg A <a,f,f>:Cp ) (cl8) [Vf,a:Ar]( <f,a>:Tg 3 <a,a>:Sr A <a,a>:Tg A <f,a,f>:Cp ) (cl9) Composition is Associative [Vf,g,h,fg,gh,fglh,flgh:Ar]( <f,g,fg>:Cp A <g,h,gh>:Cp A <fg,h,fglh>:Cp A <f,gh,f lgh>:Cp 3 fglh= aflgh) (c20) Chapter III: Category Theory in NaDSet 31 The set of categories is now defined to be the set of structures satisfying the given axioms : Cat for { <Ar, =a, Sr, Tg, Cp> I Category[Ar, =a, Sr, Tg, Cp ]} where Ar, =a, Cp, Sr and Tg are all used as variables that are bound in the abstraction term. Finally, the projections on a tuple that represents a category can be given by the following definitions. Ar[<Ar,= a,Sr,Tg,Cp>] for { u I u:Ar } =a[<Ar,=a,Sr,Tg,Cp>] for { <u,v> I <u,v>: = a } Sr[<Ar,=a,Sr,Tg,Cp>] for { <u,v> I <u,v>: Sr } Tg[<Ar,= a,Sr,Tg,Cp>] for { <u,v> I <u,v>: Tg } Cp[<Ar,= a,Sr,Tg,Cp>] for { <u,v,w> I <u,v,w>: Cp } 3.1.1 Objects. Hom-Sets and Commutative Diagrams The axiomatization of category theory presented here does not require the specification of a set of objects, since the objects of a category correspond exactly to its identity arrows. Therefore the set of objects Ob[<Ar,=a,Sr,Tg,Cp>] of a category <Ar,= a,Sr,Tg,Cp> may be defined to be any one of the following extensionally identical terms. (i) { x I x:Ar A <x,x>:Sr A <x,x>:Tg } (ii) { x I x:Ar A (pf:Ar]<f,x>:Sr v [3f:Ar]<f, x>:Tg) } (iii) { x I x:Ar A [Vf,g:Ar](<f,x,g>:Cp 3 f=ag) A [Vf,g:Ar](< x,f,g>:Cp z> f=ag) } The hom-set for objects ol and o 2 can be defined: HomtOj.Oj] for { x I x:Ar A <x,o1>:Sr A <x,o2>:Tg } Finally, that the diagram Chapter III: Category Theory in NaDSet 32 C commutes means <f,a>:Sr A < f , t » : T g A <g,b>:Sr A <g,c>:Tg A <f,g,h>:Cp, while that the diagram a k V d-commutes means <f,a>:Sr A < f , t » : T g A <g,b>:Sr A <g,c>:Tg A <k,a>:Sr A <k,d>:Tg A <m,d>:Sr A <m,c>:Tg A [3h:Ar]( <f,g,h>:Cp A <k,m,h>:Cp ), that is, that both the following diagrams commute: 3.2 F U N C T O R S To define the category of categories the notion of functor from one category to another is needed. Its definition is given in the typical NaDSet style with the symbols F, A r ^ , =AQ, STQ, T g £ , CPQ, A r p , = a D ' ^ r D » T 8 D ^ ^ P D u s e c * a s metavariables ranging over second order terms. F u n c t o r [ F , < A r c , = a C , S r c , T g c , C p c > , < A r D , = a D > S r D , T g D , C p D > ] for axioms Chapter III: Category Theory in NaDSet 33 where axioms consists of the conjunction of the following sentences: F is a map for categories < A r c , = a c , S r c , T g c , C p c > : C a t (fl) < A r D , = a D , S r D , T g D , C p D > : C a t ( 0 ) F maps arrows to arrows, preserving arrow identity [Vfc:Ar c ][ 3fd:Ar D ] <fc,fd>:F (f3) [Vfc,gc:Ar c][Vfd,gd:ArD]( fc = a C gc A <fc,fd>:F A <gc,gd>:F 3 f d = a D g d ) (f4) [Vfc,gc:Ar c][Vfd:ArD]( fc = a C gc A <fc,fd>:F 3 <gc,fd>:F ) (f5) [Vfc:Ar c][Vfd,gd:ArD]( fd = a D gd A <fc,fd>:F 3 <fc,gd>:F ) (f6) F preserves source, target and composition [Vfc,c:Ar c][Vfd,d:ArD] ( <fc,c>:Src A <fc,fd>:F A <c,d>:F 3 <fd,d>:SrD ) (f7) [Vfc,c:Ar c ][Vfd,d:Ar D ] ( <fc,c>: T g c A <fc,fd>:F A <c,d>:F 3 <fd,d>: T g D ) (f8) [Vfcl,fc2,fc3:Ar c] [Vfdl,fd2,fd3:ArD](< fcl,fc2,fc3>:Cp c A <fcl,fdl>:F A <fc2,fd2>:F A <fc3,fd3>:F 3 < fdl,fd2,fd3>:CpD ) (f9) Functors, following a suggestion of [Lawvere66], are defined as triples that include the source and target categories. The set of functors is defined: Func for {<F,<Ar c ,= a C ,Sr c ,Tg c ,Cp c >,<Ar D ,= a D ,Sr D ,Tg D ,Cp D >> I Functor[F,<Arc, = a C , S r c , T g c , Cp c >,<Ar D , = a D , S r D , T g D , CpD>]} Chapter III: Category Theory in NaDSet 34 The set of functors from a category <Ar^-,=a^,Sr^,Tg(^,Cp(^> to a category <Arj),=aj),Srj),Tg£),Cp£)> is defined as F u n c [ < A r c , = a C , S r c , T g c , C p c > , < A r D , = a D , S r D , T g D , C p D > ] for {x I < x , < A r c , = a C , S r c , T g c , C p c > , < A r D , = a r j > S r D , T g D , C p D > > : F u n c }. In [Mac Lane71] and [Barr&Wells85] an additional axiom is included in the definition of functors; the axiom states that a functor must map identity arrows to identity arrows. But that axiom is not independent of the seven axioms given here. Since the identity arrows of a category are its objects, they can be defined by one of the three equivalent definitions given in section 3.1. The first of these definitions will be used here: Id[<Arc,=ac,Src,Tgc,Cpc>] for {x I x:Ar^- A <x,x>:Sr^ A <x,x>:Tg^ } The sequent asserted to be derivable in the following lemma, expresses the additional axiom. 3.2.1 Lemma The sequent -> [Vx,y:Cat][Vf:Func[x,y][Vc:Ar[x]][Vd:Ar[y]]( c:Id[x] A <c,d>:f ZD d:Id[y]) is derivable. Proof of lemma 3.2.1 A derivation of the sequent follows. In this, pc and pd are first order parameters, F, ATQ, = a Q STQ, TgQ CpQ and Arjj, =sj), Sr^, Tgry Cpjj are second order parameters and C and D are abbreviations for the tuples <Ar^ <, =&Q, STQ, T g ^ C p £ > and <ATQ, =aj> Srr> Tgj^ Cpjj> respectively. <pc,pc>:Sr£ -» <pc,pc>:Sr(-< <pc,pd>:F -» <pc,pd>:F A <pc,pd>:F <pc,pc>:SrQ <pc,pd>:F -» Chapter III: Category Theory in NaDSet 35 *(<pc,pc>:Sr£> A <pc,pd>:F A <pc,pd>:F) <pd,pd>:Sij) -> <pd,pd>:Srj) *(<pc,po:Src A <pc,pd>:F A <pc,pd>:F 3 <pd,pd>:Srj)), <pc,pc>:Sr£, <pc,pd>:F -» <pd,pd>:Srjj pd:ArQ -> pd: Arjj pd:Arj3 -»pd: Arj) pc:Ar£ -> pc:Ar£ pc:Ar£ -» pc:Ar^ *[Vfc,c:Ar c]*[Vfd,d:ArD] (<fc,c>:Src A <fc,fd>:F A <c,d>:F 3 <fd,d>:SrD), pc:AiQ, pd:Arj), <pc,pc>:Sr^, <pc,pd>:F -> <pd,pd>:Srj) (a) *Functor[F,C,D], pcrAr^, pd:Arj), <pc,pc>:Sr(~<, <pc,pd>:F pd:Arj) -» pd: A i p Functor[F,C,D], pc:ArQ pd:Arr> <pc,pc>:SrQ <pc,pc>:Tg^>, <pc,pd>:F -> *(pd:ArD A <pd,pd>:SrD A <pd,pd>:TgD) Functor[F,C,D], pc :Ar c , pd:Ar D , *pc:Id[C], <pc,pd>:F -> *pd:Id[D] Functor[F,C,D], pc:Ar^, pd:Arj) -> *( pc:Id[C] A <pc,pd>:F 3 pd:Id[D]) Functor[F,C,D] -> *[Vc:Ar[C]]*[Vd:Ar[D]]( c:Id[C] A<c,d>F3d:Id[D]) *F:Func[C,D] -> [Vc:Ar[C]][Vd:Ar[D]]( c:Id[C] -> <pd,pd>:Srj3 Functor[F,C,D], pc:ArQ pd:Arjj, <pc,pc>:TgQ <pc,pd>:F -> <pd,pd>:TgD f7,thinning similar to (a) Chapter III: Category Theory in NaDSet 36 A<c,d>:F3d:Id[D]) *C:Cat, *D:Cat, F:Func[C,D] -> [Vc:Ar[C]][Vd:Ar[D]]( c:Id[C] A <c,d>:F z> d:Id[D]) thinning -> *[Vx,y:Cat]*[Vf:Func[x,y][Vc:Ar[x]][Vd:Ar[y]]( c:Id[x] A<c,d>:f3d:Id[y]) End of proof of lemma 3.2.1 3.3 T H E C A T E G O R Y O F C A T E G O R I E S 3.3.1 Definitions and Preliminaries The category of categories is defined as the tuple <Ar,= a ,Sr ,Tg ,Cp> of the second order terms A r , = a , Sr, Tg, C p whose definitions are given in this section. Because of the great number of variables used in this section, some abbreviations similar to those used in the derivation of lemma 3.2.1, are again used here, and later in this chapter: The capital letters A, B, C, D, E with or without subscripts, are used to abbreviate the tuples < A r A , = a A , S r A , T g A , C p A > , ... , < A r E , = a E , S r E , T g E , C p E > of the terms A r A , = a A , S r A , T g A and C p A , . . . , A r E , = a E , Sr E , T g E and C p E respectively. At different occasions these terms can be second order parameters, abstraction variables or metavariables that range over the second order terms. However, what the terms are to be in a particular context will be described prior to their use. In the following definitions, the letters C and D, with or without subscripts, are abbreviations for the previously mentioned tuples of abstraction variables, while the letters F, G, H possibly subscripted, are regular abstraction variables. A definition of the set A r of arrows for the category of categories will be provided first; it is just the set of functors, as defined in section 4: Chapter III: Category Theory in NaDSet 37 A r for Func The identity =& for members of A r is defined in terms of extensional identity. - a for { ^ C ^ >, <F 2 ,C 2,D 2» I q = EC 2AD! = C D 2 A F 1 = e F 2 } In this definition = e is the coordinate-wise extensional identity among tuples of terms defined by = e for { « A r 1 , = a l , S r 1 , T g 1 , C p 1 >, < A r 2 , = a 2 , S r 2 , T g 2 , C p 2 » I = e^ r 2 A = a i = e = a2 A =e^ r2 A T S i = e T § 2 A C P i =eCP2 J where A r v C p 2 are all being used as abstraction variables. The definition of extensional identity = e depends upon the context: . A r 1 = e A r 2 for [V^Ar^ f:Ar 2 A [Vf:Ar2] fcA^ =ai =e =a2 f o r [Vf,g:A r i](f = a lg 3 f =a2g) A [Vf,g:Ar2](f =a 2g 3 f =alg) S r i = e S r 2 for [Vf,g:Ar1](<f,g>:Sr13<f,g>:Sr2)A [Vf,g:Ar2](<f, g>:Sr 23 <f, g>:Sri) T g l = e T g 2 for [Vf,g:Ar1](<f, g>:T g l 3 <f, g>:Tg2) A [Vf,g:Ar2](<f, g>:Tg 2 3 <f, g>:T g l ) CP! =e C p 2 for [Vf,g,h:Ar1](<f, g,h>:Cp1 3 <f, g,h>:Cp2) A [Vf,g,h:Ar2](<f, g,h>:Cp2 3 <f, g ^ ^ P j ) Fj = e F 2 for [Vf :Ar C l ] [Vg:Ar D l ]( <f,g>:F13 <f,g>:F2) A [Vf :Ar C 2 ] [Vg:Ar D 2 ]( <f,g>:F2 3 <f,g>:F1) Clearly, the source and target of an arrow has to coincide with the identity functor of the source and target category, respectively. Their definitions follow, in a style similar to that of A r . Sr for { « F 1 , C 1 , D 1 > , < F 2 , C 2 , D 2 » I Chapter III: Category Theory in NaDSet 38 c 2 = e C i A D 2 = e C i A [ V f , g : A r C l ] ( <f,g>:F2 = f = a C l g ) } Similarly, Tg for { « F 1 , C 1 , D 1 > , < F 2 , C 2 , D 2 » I C 2 = e D i A D 2 = e D i A [Vf,g:ArD l](<f,g>:F2 = f = a D l g)} The final definition needed is of Cp, composition of the arrows for the category of categories. Cp for { « F 1 , C 1 , D 1 > , < F 2 , C 2 , D 2 > , < F 3 , C 3 , D 3 » I C i = e C 3 A ^l~G^2 A D 2 = e D 3 A [Vf:ArC l][Vg:ArD 2](<f,g>:F 3 = [ 3h:ArD l](<f,h>:F 1 A<h,g>:F2)) } . The main goal of the paper is to show that the set Cat with the defined constructs is itself a category. The proof of this result provided later makes use of some preliminary results that are discussed next. Some trivial consequences of the definitions of =e and =e are listed in the following lemma. 3.3.1.1 Lemma For any second order parameters P, Q and R, the following sequents are derivable: (1) P = e Q ^ P = e Q (2) -> P=eP (3) P = e Q ^ Q = e P (4) P= eQ, Q= eR -» P=eR For any tuples C, D and E of second order parameters, as defined in this section, and any first order parameters a, b, c, the following sequents are derivable. (5) C = e D ^ C = e D (6) C = e C Chapter III: Category Theory in NaDSet 39 (7) C = e D -> D = e C (8) C = e D , D = e E -> C = e E (9) SLIAIQ, C= eD -» a:Arpj (10) a =aC b> C = e D -> a =aD b (11) < a , t » : S r c , C= e D -> <a,b>:SrD (12) <a,b>:Tgc, C= e D ^ <a,b>:TgD (13) <a,b,c>:Cp^, C= £ D -> <a,b,c>:Cp£) The sequents 1-13 are simple consequences of the definitions of = e and = e . Their derivations are elementary and are therefore omitted. 3.3.2 Identity Functors Let Id[C] for = a C . The next lemma insures that for any category (an element of Cat) there exists an identity functor from the category to itself. 3.3.2.1 Lemma The sequent -> [Vx:Cat] <Id[x], x, x>:Ax is derivable. Proof Outline: If C is any tuple <ATQ, =&Q, STQ, TgQ, CpQ> of second order parameters, the lemma is obtained by an application of ->V to the sequent C:Cat -> <Id[C], C, C>:Ar Chapter III: Category Theory in NaDSet 40 whose derivation is obtained as following. Let Ax[G,A,B] be the result of replacing F by G, <ATQ, =aC' ^ r C ' T 8 C ' ^ P C > ^ v a n c * <Arj), =aj), Srj), Tgp,Cpj)> by B in an axiom of (f 1) to (f9) in the definition of a functor in section 3.2. From the definition of Ar, it is obvious that a proof of the lemma can be obtained from a derivation of the sequent C:Cat -> Functor[ Id[C], C, C ] by a single application of ->{}. The latter derivation can in turn be obtained if for each axiom (fl) to (flO) a derivation for the sequent C:Cat -> Ax[ Id[C], C, C ] (LI) is provided. Derivations for the non-trivial cases of LI are given in appendix A. E n d of Proof 3.3.3 Composition Functors For the next lemma, the following definition of the composition of two functors is required: FC [F1 ,C1 ,D1,F2 ,C2 ,D2] for {< f,g> I [ 3h:Ar D 1 ] (< f,h>:Fl A <h, g >:F2) } The lemma states that if two functors are composable, their composite is also a functor. 3.3.3.1 Lemma The sequent -» [Vf,g:Func][Vb,c,d,e:Cat]( <f,b,c>:Ar A <g,d,e>:Ar A c=ed =. < F C [ f,b,c,g,d,e ], b, e > :Ar ) is derivable. Proof Outline: If F l , F2 are second order parameters and CI, D l , CI, D l are the usual tuples of second order parameters, the lemma can be obtained from the sequent Chapter III: Category Theory in NaDSet 41 <F1,C1,D1>:AJ, <F2,C2,D2>:Ar, Dl= e C2 -> <FC[F1,C1,D1,F2,C2,D2], CI , D2 > :Ar by successive applications of the -»V rule. The last sequent can be derived from the sequent Functor[Fl,Cl,Dl], Functor[F2,C2,D2] Dl= e C2 -> Functor[ FC[F1,C1,D1,F2,C2,D2], CI , D2 1 by two applications of {}-> and one of ->{}. Let Ax[G,A,B] be as in the proof of lemma 3.3.2.1. Obviously, a proof of the latter sequent can be obtained if for each axiom (f 1) to (f9) in the functor definition in section 3.2, a derivation of the sequent A x [ F l , C l , D l ] , Ax[F2,C2,D2] Dl= e C2 -> Ax[ FC[F1,C1,D1,F2,C2,D2], CI , D2 ] (L2) is provided. Derivations for the non-trivial cases of the last sequent are shown in appendix B. E n d of Proof 3.3.4 Cat is a Category The main theorem of the chapter is proved in this section. The theorem states that the set of categories equipped with the structure defined in this section is itself a category. 3.3.4.1 T h e o r e m The sequent -> < A r , = a , Sr , Tg , Cp>:Cat is derivable in NaDSet. Proof Outline: A derivation of -> <Ar,= a ,Sr ,Tg ,Cp>:Cat can be obtained from a derivation of Chapter III: Category Theory in NaDSet 42 -> Category[Ar,= a ,Sr ,Tg ,Cp] by one application of -> {} rule and the definition of Cat. To derive the latter sequent it is necessary to provide a derivation of each sequent of the form -> Ax[ A r , = a , Sr , Tg , C p ] (Tl) where Ax[Ar,= a ,Sr,Tg,Cp] is one of the axioms c l to c20 in the definition of categories in section 3.1. Lemma 3.3.2.1 provides an eigenterm of the form <Id[C],C,C>, where C is a five-tuple of second order parameters, for the existential quantifier in (cl 1) and (cl3) and lemma 3.3.3.1 is used to provide the eigenterm for the quantifier in (cl5) which has the form <FC[F1,C1,D1,F2,C2,D2],C1,D2> for some second order parameters F p F 2 and five-tuples of second order parameters CV DV C 2 and D 2 . The derivations of the remaining sequences of the form (Tl) can be obtained by simple applications of the definitions given in section 3.3.1. The complete proof of the theorem is shown in appendix C. E n d of Proof 3.4. N A T U R A L T R A N S F O R M A T I O N S and F U N C T O R C A T E G O R I E S As Eilenberg and Mac Lane observed [MacLane71], "category" has been defined in order to define "functor", and "functor" has been defined in order to define "natural transformation". This notion induces an equivalence relation between categories that allows the comparison of categories that are "alike" but of different "sizes". Moreover, natural transformation is the basic ingredient in the ubiquitous construction of functor categories. 3.4.1 Natural Transformations We now proceed with a NaDSet definition of a natural transformation from one functor to another. In this, T , F, G , A r B , = a B , S r B , T g g , C p g , A r ^ , =aQ, STQ, TgQ, CPQ, Arj) , =aj), S r p , Tgj), C p p are used as metavariables ranging over second order terms, Chapter III: Category Theory in NaDSet 43 while B, C , D are used as abbreviations of the tuples < A r g , = a g, S r g , T g g , C p g >, < A r c , = a C , S r c , T g c , C p c > and < A r D , = a D, S r D , T g D , C p D > respectively. As with categories and functors, the set of natural transformations is defined in two steps: NatTransform[ T , F, G , C, D ] for axioms where "axioms" consist of the conjunction of the following formulas: T is a map for functors <F,C,D>:Func (tl) , <G,C,D>:Func (t2) T is a function from objects in C to arrows in D [Vc:Ob[C]] [3tc:ArD] <c,tc>:T (t3) [Vc:Ob[C]] [Vtc:ArD](<c,tc>:T 3 [3fc,gc:ArD]( <c,fc>:F A <c,gc>:G A <tc,fc>:SrD A <tc,gc>:TgD )) (t4) [Vcl,c2 Ob[C]] [Vtcl,tc2:ArD]( c l = a C c2 A <cl,tcl>:T A <c2,tc2>:T 3 tcl = a D tc2 ) (t5) [Vcl,c2:Ob[C]] [Vtc:ArD]( c l = a C c2 A <cl,tc>:T 3 <c2,tc>:T ) (t6) [Vc:Ob[C]] [Vtcl,tc2:ArD]( tcl = a D tc2 A <c,tcl>:T 3 <c,tc2>:T ) (t7) Tcl c l Fcl • Gel For every arrow h^ of C. the diagram F h ^ Jch commutes c2 Fc2 • Gc2 Tc2 [Vcl,c2 Ob[C]] [Vh:Ar c ] [Vtcl,tc2,fh,gh:ArD]( <h,cl>:Sr c A <h,c2>:Tgc A <cl,tcl>:T A <c2,tc2>:T A <h,fh>:F A <h,gh>:G 3 [3k:ArD]( <tcl,gh,k>:CpD A <fh,tc2,k>:CpD )) (t8) Chapter III: Category Theory in NaDSet 44 The set of natural transformations is defined: NatTrans for {<t,f,g,c,d>l NatTransformf t,f,g,c,d] } Given the functors F, G : C-> D, the sets of natural transformations from F to G can now be defined: NatTrans[F,G,C,D] for {t I <t,F,G,C,D>:NatTrans } 3.4.2 Natural Equivalence A natural transformation is a natural isomorphism (or a natural equivalence) if each component of it is an isomorphism in the target category: NatIsomorphism[F,G,C,D] for { 11 t:NatTrans[F,G,C,D] A [Vc:Ob[C]] [Vtc,dl,d2:ArD] (<c,tc>:t A <tc,dl>:SrD A <tc,d2>:TgD => [3h:ArD]( <tc,h,dl>:CpD A <h,tc,d2>:CpD )) } Given two categories C and D, the equivalence relation among functors from C to D is given by: NatEq[C,D] for {<f,g> I [3t:NatTrans[f,g,C,D] t:NatIsomorphism[f,g,C,D]} An equivalence relation = between categories that meets the requirements mentioned at the beginning of the section, can be given by the following definition in which C, D are used as tuples of abstraction variables. = for { <C,D> I [3F:Func[C,D]] [3G:Func[D,C]] ( < F C [ F , C i D , G , D i C ] , Id[C] >: NatEq[ C, C ] A < F C [ G , D i C i F , C i D ] , M[D] >: NatEq[ D, D ] ) } where Id[_] and FC[_,_,_,_,_,_] are the terms defined prior to lemmas 3.3.2.1 and 3.3.3.1 respectively. Chapter III: Category Theory in NaDSet 45 3.4.3 Functor Categories If C and D are caregories, the category of functors —functor category -- from C to D, denoted by or FunCat[C,D], is defined as the tuple D C for <Ar[C,D],=fl[C,D],5r[C,D],rg[C,D],C/>[C,D]> of the parameterized terms A r [ C , D ] , = f l [C,D], Sr[C,D], Tg[C,B], C p [ C , D ] whose definitions follow. Obviously, the arrows of this category are the natural transformations among functors from C to D. The reader should note that the objects of this category are the functors themselves. Thus we define Ar[C,D] for {<T,F,G> I NatTransform[ T, F, G, C, D ] } The identity among the members of Ar [C,D] is defined in terms of the extensional identity. = f l[C,D] for { « T 1 , F 1 , G 1 > , < T 2 , F 2 , G 2 » I Fl= eF2 A Gl= e G2 A Tl= e T2 }. The identity = e for the terms that represent functors (F's and G's) was defined in section 3.2; it only remains to give its definition for the terms representing natural transformations: T l = e T2 for [Vc:Ob[£J] [Vd:ArD]( <c,d>:Tl = <c,d>:T2 ). The source and the target of an arrow coincides with the source and the target functors of the transformation which are viewed as identity natural transformations. Consequendy we define Sr[C,D] for { « T 1 , F 1 , G 1 > , < T 2 , F 2 , G 2 » I T2= e Fl A F2= eFl A G2= e Fl } and Tg[C,D] for { « T 1 , F 1 , G 1 > , < T 2 , F 2 , G 2 » I T2= e Gl A F2= e Gl A G2= e Gl } . Finally, the composition of two natural transformations is given by the next definition. Chapter III: Category Theory in NaDSet 46 Cp [C,D] for { « T 1 , F 1 , G 1 > , <T2,F2,G2>, < T 3 , F 3 , G 3 » I Fl=eF3 A G= eF2 A G2=eG3 A [Vc:Ob[C]] [Vd:ArD]( <c,d>:T3 = [3dl,d2:ArD](<c,dl>:Tl A <c,d2>:T2 A <dl,d2,d>CpD)) } . The sequent of the following theorem states that for any categories C, D, the set of functors from C to D is itself a category. 3.4.3.1 Theorem The sequent -> [Vx,y:Cat] <Ar [x,y], = f l [x,y], Sr [x,y], Tg [x,y], Cp [x,y]>:Cat is derivable within NaDSet. A derivation of the theorem can be obtained if a derivation is provided for each sequence of the form A x [ A r c , = a C , S r c , T g c , C p c ] , A x t A r p ^ ^ S r ^ T g ^ C p j ) ] -> Ax[ilr[C,D],= f l[C,D],Sr[CJ)],rg[C,D],Cp[C,D]] where A r ^ , =&Q, STQ, TgQ, C p ^ , A l p , =aj), Srp> Tgj), Cpj} are second order parameters, C and D are the tuples <Ar^,=aQ,Sr^,Tg(^,CpQ>, <Ai^,= a j) ,Srj) ,Tg£),Cp£)> and Ax[-,-,-,-,-] is one of the axioms (cl) to (c20). The latter derivations are similar (in structure as well as in length) to those in the proof of theorem 3.3.4.1 and are omitted for space reasons. 3.5. O T H E R C O N S T R U C T I O N S 3.5.1 Opposites To each category C, we associate the opposite category, C°P, defined to be the term Chapter III: Category Theory in NaDSet 47 < A r c , = c , S r O P [ C ] , T g O P [ C ] , C p ° P [ C ] > with components: Sr°P[C] for {<u,v> I <u,v>:Tg c } Tg°P[C] for { <u,v> I <u,v>:Src } Cp°P[C] for { <u,v,g> I <v,u,g>:Cp c } 3.5.1.1 Lemma The sequents -> [Vx:Cat] x°P:Cat -> [Vx:Cat] (x°P)°P = e x are derivable. 3.5.2: Product Categories Given two categories B and C, the product of them, BxC, is defined to be the term <Ar x [B,C], =X[B,C], Sr x [B,C], Tg x [B ,C] , Cp x [B,C]> with components: Ar x [B ,C] for {<u,v> I u : A r B A W.ATQ } =X[B,C] for { « u , v > , < f , g » I <u,f>: = A B A <v,g>: = a C } Sr x [B,C] for { « u , v > , < f , g » I <u,f>:SrB A <v,g>:Sr^; } Tg x [B ,C] for { « u , v > , < f , g » I <u,f>:TgB A <v,g>:Tg c } Cp x [B ,C] for { « u l , v l > , < u 2 , v 2 > , < f , g » I <ul,u2,f>:CpB A <vl,v2,g>:Cp c }. Given two functors F and G their product, FxG is given by: F x G for { « u , v > , < f , g » I <u,f>:F A <v,g>:G } . 3.5.2.1. Lemma The sequents -> [Vw,z:Cat] wxz:Cat Chapter III: Category Theory in NaDSet 48 -> [Vwl,w2,zl,z2:Cat][Vf:Func[wl,zl]][Vg:Func[w2,z2]] fxg:Func[wlxw2, zlxz2] are derivable. 3.5.3. Comma Categories If B , C and D are categories and F:C->B, G:D->B functors, the comma category (F,G) is defined to be the term <Ax[F,G,B,C,D] ,=[F ,G,B,C,D] ,Sr[F ,G,B,C,D] ,Tg[F ,G,B,C,D] ,Cp[F,G,B,C,D]> with components: Ar[F,G,B,C,D] for {<u,v,w,x> I u : A r ^ A v:Arj) A w:Arg A x :Arg A [3f,g,h:ArB]( <u,f>:F A <v,g>:G A <f,x,h>:CpB A <w,g,h>:CpB )} =[F,G,B,C,D] for { « u l , v l , w l , x l > , < u 2 , v 2 , w 2 , x 2 » I <ul,u2>: = A£ A <vl,v2>: =arj A <wl,w2>: = a g A <xl,x2>: = a g } Sr[F,G,B,C,D] for { « u l , v l , w l , x l > , < u 2 , v 2 , w 2 , x 2 » I <ul,u2>:Sr^; A <vl,v2>:Srj) A <wl,w2>: = a g A <wl,x2>: = a g } Tg[F ,G,B,C,D] for { « u l , v l , w l , x l > , < u 2 , v 2 , w 2 , x 2 » I <ul,u2>:Tg(^ A <vl,v2>:Tgj) A <xl,w2>: = a g A <xl,x2>: = a g } Cp[F,G,B,C,D] for { « u l , v l , w l , x l > , < u 2 , v 2 , w 2 , x 2 > , < u 3 , v 3 , w 3 , x 3 » I <wl,w3>: = a g A <xl,w2>: = a g A <X2,X3>: = a g A <ul,u2,u3>:Cpc A <vl ,v2,v3>:Cp£) } . The meticulous reader will have already noticed in the last definition a slight deviation from the traditional one. The arrows of a comma category, according to the above definition, are quadruples instead of pairs. Although such a deviation is immaterial (it only affects the representation of the construct not its properties), it has been found necessary in order to avoid the explicit use of objects and Horn-sets. Nevertheless, it can be shown that a triple <e,d,f> is an object of (F,G) as defined in [MacLane 71] iff <e,d,f,f> is an object of (F,G) according to our definition. Moreover, an arrow <k,h> : <e,d,f> -> <e',d',f> in [MacLane 71] is exactly the arrow <k,h,f,f > in our definition. The difference is that in the first case an arrow cannot be determined by the pair <k,h> alone without explicitly giving its source and target, while in our Chapter III: Category Theory in NaDSet 49 presentation the tuple <k,h,f,f > uniqely determines an arrow in (F,G). 3.5.3.1. Lemma The sequent -> [Vx,y,z:Cat][Vf:Func[x,y]][Vg:Func[z,y]] (f,g):Cat is derivable. 3.5.4. Universa l and Limits To improve readability, in the next two sections additional abbreviations will be used that resemble the functional notation used in mathematics. Specifically, if F is a functor (or transformation) from B to C, we use: F[X]Q for {y I y : A r £ A <x,y>:F}, [ y - » z ] C f ° r ( w ' w : Ai*c A <w,y>:Src A < w , z > : T g £ }, and combining them [y-»F[x]]c for {w I w : A r ^ A <w,y>:Sr^ A [3z:F[x]^<]<w,z>:TgQ }. Similar definitions can be given for [F[y]->x](~« and [F[y]->F[x]]c . We can proceed now with the definition of universal arrows. Given a functor F:D-»C and an object c of C , the following term defines the set of universal arrows from c to F. UniArrFrom[F,D,C,c] for {<r,u> I r:Ob[D] A u:[c->F[r]]c A [Vd:Ob[D]] [Vg:[c->F[d]]c] [3gl:[r->d]D] [3fgl:F[gl] c]( <u,fgl,g>:Cp c A [Vg2:[r->d]D] [Vfg2:F[g2]c]( <u,fg2,g>:Cpc 3 gl= a D g2 )) } By duality, the set of universal arrows from the functor F to an object c is given by: UniArrTo[F,D,C,c] for {<r,u> I r:Ob[D] A u:[F[r]->c]c A [Vd:Ob[D]] [Vg:[F[d]^c] c] [3gl:[d-^r]D] [3fgl:F[gl] c]( <fgl,u,g>:Cp c Chapter III: Category Theory in NaDSet 50 A [Vg2:[d->r]D] [Vfg2:F[g2]c](<fg2,u,g>:Cpc => g l = a D g 2 ) ) } A definition of the diagonal functor must precede a discussion of limits and colimits. In the following definitions B and C are categories, c an object of C and f an arrow of C: DF[B,C,c] for {<u,v> I u :Arg A v=a^ <c } DT[B,C,fJ for { <u,v> I u:Ob[B] A v = a C f } . The diagonal functor from C to C B is defined as A[B,C] for {< u,y> I u : A r c A y = e DT[B,C, u] } The following lemma justifies these definitions: 3.5.4.1. Lemma The sequents -> [Vj,x:Cat][Vc:Ob[x]] DF[j,x,c]:Func[j,x] -» [Vj,x:Cat] [Vc,c':Arx] [Vf:[c->c*]x] DT[j,x,f]:NatTrans[DF[j,x,c], DFrj,x,c'],j,x] -> [Vj,x:Cat] A[j,x]:Func[x,xJ] are derivable. Definitions of limits and colimits can now be given. Given a functor F:B->C, the limits for F are given by Limit[F,B,C] for { <u,v> I <u,v>:UniArrowTo[ A[B,C], C , C B , F] } and the colimits of F by Colimit[F,B,C] for { <u,v> I <u,v>:UniArrowFrom[ A[B,C], C , C B , F] } . Products, powers, equalizers, pullbacks and their duals can easily be defined as special cases of limits and colimits respectively. 3.5.5. A d j o i n t s Given two categories C, D, an adjunction from C to D consists of a pair of functors F:C->D, G:D-»C and a natural transformation n from the identity functor of C to the composition of F Chapter III: Category Theory in NaDSet 51 and G with some additional properties given by the following definition. Adjunction[C,D,F,G,n] for F:Func[C,D] A G:Func[D,C] A n:NatTrans[Id[C], F C [ F , C , D , G , D , C ] , C , C] A [Vx:Ob[C]] [Vy:Ob[D]] [Vf:[x^G[y]]C ] [3nx:n[x]c] [3fl:[F[xi->y]D ] [3gfl:G[fl] c ] ( <nx,gfl,f>:Cp c A [Vf2:[F[x]^y]D ] [Vgf2:G[f2]c] ( <Tix,gf2,f>:CpC f l = a D f 2 )) or equivalently, Adjunction[C,D,F,G/n] for F:Func[C,D] A G:Func[D,C] A n:NatTrans[Id[C], F C [ F , C , D , G , D , C ] , C , C] A [Vx:Ob[C]] [3fx:F[x]D] [3TIX:TI[X]c] <fx,Tix>:UniArrFrom[G,D,C,x] Finally, the set of adjoint pairs of functors from C to D is defined as Adjoint[C,D] for {<f,g> I [3Ti:NatTrans[Id[C], F C [ f ,C,D, g,D,C], C , C] ] Adjunction[C,D, f, g.n] }. 3.6 A D D I T I O N A L ISSUES The discussion in the last section suggests that the variety of constructs defined for categories, toposes, triples and related theories, [Barr Wells 85] can be defined within NaDSet. Nevertheless, there are two kinds of issues that have not been addressed in this chapter. The first concerns the definition of the category of sets per se and the second involves notions like completeness that make either an implicit or an explicit reference to the traditional foundations of the category theory. Although these issues are topics of future research, some preliminary ideas and directions are presented in the following paragraphs. In a traditional presentation of category theory [MacLane 71], the category of sets, Set, is Chapter III: Category Theory in NaDSet 52 defined to be a category whose objects consist of every object that a classical set theory accepts as a set and whose arrows are the mappings among these sets. In NaDSet, however, set abstraction is introduced via abstraction rules, rather than through a comprehension axiom scheme, and enjoys an equal treatment with the connectives and quantifiers. As a consequence, NaDSet provides a characterization of sound arguments, and not a characterization of acceptable sets. Nevertheless, the category Set should be definable within NaDSet. Section 8 of [Gilmore 89] provides a NaDSet formalization of Godel-Bernays set theory within which every theorem of Godel-Bernays theory can be derived. Using the formalization, it should be possible to define a term representing the class of Godel-Bernays sets; the class of mappings among these sets then can be defined as the set of triples with elements the domain, co-domain, and the extension of the mapping. Among the remaining components of Set, target, source, and composition should have the expected definitions while arrow identity is taken to be the extensional identity over the mappings. It is expected that the traditional categorical constructions that are related to Set, such as hom-functors, functor representations and the Yoneda construction, can also be developed within NaDSet. Set is not the only meaningful category of sets that can be defined within NaDSet. There are two identity relations definable in the theory: the intensional identity defined by = for {<u,v> I [Vz]( u:z z> v:z) } and the extensional identity = e for {<u,v> I [Vz]( z:u = z:v ) } . Each one of them defines a different 'universal' set: VI for {u I u=u } V2 for {u I u=eu } . Any one of V I , V2 and VI n V2 can be used as the object component of a category of sets VISet , V2Set, and V12Set, respectively. It should be possible to show that Set is a subcategory of VISet . What properties each of them has and whether the classical constructions on Set can be carried over to these categories, remains to be seen. An analogous treatment may given to the second group of issues. The concept of completeness is taken to illustrate the main idea. A category is said to be small if its objects and arrows are Godel-Bernays sets. Traditionally, a category C is called small-complete if every functor from a small category J to C has a limit [MacLane 71]. Such a notion can be defined in NaDSet given the NaDSet definition of Godel-Bernays sets. Moreover we believe that classical results like Chapter III: Category Theory in NaDSet 53 Freyd's proposition (that a small category which is small-complete is a preorder) [MacLane 71] can be proved in this framework. Nonetheless, a more general notion of completeness can be defined in NaDSet. Let R be a unary relation on Cat definable within NaDSet, and define an /?-category to be one that satisfies R. A category C is called R-complete if every functor from an /?-category to C has a limit. Small-complete categories, categories with terminal objects, with products, with pullbacks, with finite products, etc. are some of the interesting special cases of /?-complete categories. Chapter IV: Programming Semantics 54 CHAPTER IV Programming Language Semantics in NaDSet In the field of programming language semantics, the need for unrestricted abstraction that provides for self-referential definitions was early recognized by many of its researchers. [Scott70] for instance, describes the problems of self-application that can arise when interpreting programming languages and proposes a solution that has led to the development of denotational semantics. Although domain theory provides an elegant mathematical foundation for the semantics of A,-calculus and programming languages in general, it is not a formal theory in the sense described in the introduction of the thesis; it lacks an effective proof theory. In Scott's foreword to [Stoy77], he concludes "For the future the problems of an adequate proof theory and of explaining non-determinism loom very large." NaDSet on the other hand, not only has an effective proof theory, its sequent calculus presentation can benefit from a variety of automated deduction techniques already established for this type of system [Bibel87]. The need for such a set theory for the development of programming language semantics is illustrated by contrasting the presentation of recursive definitions in first order logic with their presentation in NaDSet. Within first order logic such definitions are always incomplete in a very simple sense: Induction axioms must be added to the given definitions and extended with every new recursive definition. Within a set theory such as NaDSet, recursive definitions of sets are represented as terms in the theory and are complete in the sense that all properties of the Chapter IV: Programming Semantics 55 set can be derived from its definition. Such definitions not only have this advantage of completeness, but they also permit recursively defined sets to be members of the universe of discourse of the logic and thereby be shown to be members of other defined sets. This is particularly important when complex recursive definitions are needed, such as those in prograrnming languages. Furthermore, set definitions do not in any way modify the models of NaDSet; there need never be a concern that inconsistent axioms may be introduced. Finally, recursive definitions of disparate fields can be kept together without any concern that one definition may interact in an unforseeable way with another. These advantages are demonstrated by defining in NaDSet the semantics of a simple programming language. Its expressions include simple boolean expressions and its commands include conditional, while and repeat commands. Recursive definitions for the set of expressions and commands of the language as well as for their semantics are provided and some simple lemmas are derived as an illustration of the use of this type of definitions within the proof theory. The main result in this section is the derivation of a theorem stating the semantic equivalence between the command " C repeatwhile E " and the sequence " C; while E do C ". The latter is a demonstration of the first point made in the previous paragraph: The defined semantics is formal, meaning that an effective proof theory is available to reason about it. It should be emphasized that when lambda calculus is used to define the denotational semantics of this language, such a theorem cannot be proved within that formalism. A type of fixed point induction rule is needed, not available within the theory. Moreover in a formalization of domain theory such a proof needs, in addition to a fixed point induction rule (or axioms), some type of admissibility test as was pointed out by Scott. NaDSet's ability to carry out this type of reasoning, without resorting to any additional assumptions, is a strong indication of its suitability in this field. To further illustrate the use of NaDSet in defining semantics of nondeterministic languages, a nondeterministic command named choice is added to the language and its semantics is defined. The main purpose of this addition is to show that it does not change the semantics of commands (or of a program); this is to be contrasted with traditional denotational semantics. In NaDSet the semantics of a command is defined by a term that represents a binary relation over the states. Informally, the pair <s1,s2> is in the semantics of the command C if it is possible to execute C in state s1 and result in state s2. The semantics of a nondeterministic command is nothing more than that; the difference is that an initial state can be associated with more than one final state. Chapter IV: Programming Semantics 56 On the other hand, some kind of power set (or power domain) construction is needed to express this concept in traditional denotational semantics. 4.1 F O R M A L I Z I N G R E C U R S I V E DEFTNTTTONS Two contrasting approaches to formalizing recursive definitions correspond to two different views of mathematics. In the first, a derivative of Hilbert's "formalist" view of mathematics, a recursive definition is expressed by axioms added to first order logic. This is the method used in the programming language Prolog. In the second, a derivative of the Frege-Russell "logistic" view of mathematics [Wilder58], a recursive definition is provided by an abstraction term within a formalized set theory. For derivations of atomic sentences, that is for programming, both methods work equally well. But to prove results about programs, for example, to define a formal semantics for programs, only the second approach is satisfactory. This will be demonstrated in the next two subsections: 4.1.1 Axiomatic Method Given 0 as a constant, and ' as a one place successor function, a one place natural number predicate N is defined by the axioms: N [0 ] Vu( N [u] 3 N [ u ' ] ) A related predicate N N can similarly be defined by the axioms N N [ 0 ' ] Vu( N N [ u ] 3 N N [ u ' ] ) However it is not possible to prove from these four axioms the theorem: Vu( N N [ u ] 3 N [ u ] ) A counter-example is provided by the interpretations N is {0, 0', 0", ... } N N is {c, c', c", ... , 0', 0", ...} Under these interpretations, both N and N N satisfy their axioms, but ( N N [ C ] A ~ N [ C ] ) is true. To prove the theorem an additional axiom is needed for N N , namely ( N[0'] A Vu( N [u] 3 N[u'] ) 3 Vu( N N [ u ] 3 N [u] )) Chapter IV: Programming Semantics 57 . which is an instance of an induction axiom for NN. Because a recursive definition by first order axioms always requires the addition of new axioms with each new recursive definition, such definitions are said to be incomplete. Consider, for example, the definition of the plus predicate by the axioms: Vu( N[u] 3 +[0,u,u] ) VuVvVw( N[u] A N[v] A N[w] A +[U,V,W] 3 +[u',v,w'] ) From the given axioms, the theorem Vu( NN[u] 3 3v(NN[v] A +[u,u,v] ) can only be proved from additional axioms for N. The need to add additional axioms to recursive definitions is more than just an inconvenience: There is always the danger of adding inconsistent axioms. Further, some kinds of results for computer science, as for mathematics, require proving that a particular formula is not derivable; for such results it is necessary that all assumptions be made explicit. 4.1.2 NaDSet Method Consider now recursive definitions for N, N N and + in NaDSet. Recall that intensional identity is defined: = for {<u,v> I Vw ( u:w = v:w ) } The usual infix notation for identity is used in the following definitions: 0 for {u I ~u = u } {t} for {vlv = t } NCls for {z I 0:z A Vu(u:z 3 {u} :z) } N for {x I [Vz:NCls]x:z} NNCls for {z l {0}:ZAVU(U:Z3{U}:Z) } N N f o r {x I [Vz:NNCls]x:z} The definitions of NCls and NNCls, prior to the definitions of N and NN, will be typical of the recursive definitions provided in this paper. NCls for instance, is the set of sets that have 0 as member and are closed under successor (O-successor sets). The bounded universal quantifier [Vz:NCls] in the definition of N, together with the scope of the quantifier, ensures that N is the least such set. Similar remarks can be made for the definitions of NNCls and NN. The sequent Chapter IV: Programming Semantics 58 ->Vu(u:NN=>u:N) is derivable in NaDSet. In the following derivation from the sequent (a), 'p' and 'q' are first order parameters, and 'Q' is a second order parameter. Readers are advised to read the derivation as it has been developed, namely bottom-up. An attractive feature of natural deduction presentations is that the derivation of a sequent is almost determined by the sequent. (a) Q:NCls -> Q:NNCls p:Q->p:Q *[Vz:NNCls]p:z, Q:NCls -> p:Q *p:NN, Q:NCls->p:Q p:NN -> *[Vz:NCls]p:z p:NN -» *p:N ->*Vu( U : N N D U : N ) A derivation of the sequent (a) from the sequent (b) follows: q :Q-»q:Q ( q } : Q - » { q } : Q q:Q,(q:Q3{q} :Q)^{q} :Q (q:QD(q}:Q)^(q:QD(q}:Q) * [ V U ] ( U : Q D (u):Q)^(q:QD{q}:Q) [Vu](u :Q=> ( u } : Q ) - > *^/U](U :QD f u } : Q ) (b) 0 :Q,Q:NCls-KO} :Q * ( 0 : Q A [ V U ] ( U : Q D ( U } : Q ) ) , Q : N C 1 S ^ *({0}:QA [VU](U :Q 3 ( U } : Q ) ) * Q : N C 1 S , Q : N C l s -> * Q : N N C l s Q:NCls -> Q:NNCls contraction The need for a derivation of the sequent (a), which might be expected to be an axiom, is typical of NaDSet. Derivations of such sequents are usually omitted. A derivation of the sequent (b) follows: 0:Q->0:Q Chapter IV: Programming Semantics 59 { 0 } : Q ^ { 0 } : Q 0 : Q , * ( 0 : Q 3 { 0 } : Q ) - > { 0 } : Q 0 : Q , * [ V U ] ( U : Q D ( U } : Q ) - > { 0 } : Q 0 : Q , 0 : Q , [Vu](u:Q3 ( u } : Q ) - > { 0 } : Q thinning 0 : Q , * Q : N C l s - > { 0 } : Q Consider next +: +Cls for {ZI[VV](V:ND<0,V,V>:+) A VuVvVw(<u,v,w>:z 3 <{u},v,{w}>:z ) } + for {<x,y,z> I [Vw:+Cls]( 3 <x,y,z>:w ) } The following sequent can be derived in NaDSet: -> [Vu:NN][3v:NN](<u,u,v>:+) As the reader can verify, a derivation can be provided directly from the given definitions, again emphasizing that logistic definitions are complete in themselves. Recursive definitions in a set theory such as NaDSet have the four important advantages discussed in the introduction of the thesis: First, it is unnecessary to construct induction axioms, since they follow from the definitions. Second, they do not in any way modify the underlying logic, so that there need never be a concern that inconsistent axioms may be introduced. Third, the definitions are given as terms that can be reasoned about, as demonstrated above for N and NN. But also these terms can be shown to be members of other sets; for example, each of N and N N can be shown to be a member of the universal set V I , that is defined to be {u I u=u }. Lastly, recursive definitions for disparate fields do not interact in unforeseeable ways with one another if the abbreviating name for a term uniquely identifies the term. These advantages suggest that NaDSet may provide extensions to Horn clause programming languages such as Prolog. Chapter IV: Programming Semantics 60 4.2 E X A M P L E O F P R O G R A M M I N G S E M A N T I C S In this section, semantics will be defined within NaDSet for the simple language of flow diagrams used in [Stoy77] as an example of the application of denotational semantics. Since they add nothing to the exposition here, primitive commands and primitive predicates will not be considered. 4 .2.1 Syntax The elementary syntax for the language is first described in a variant of Backus-Naur form and then the corresponding NaDSet definitions are presented. 4 .2.1.1 Expressions First the set of expressions is defined: Exp ::= true I false I < ExpQ, Expi, Exp2» CndExp > Here true, false and CndExp are given constant strings, with the latter abbreviating 'conditional expression'. This Backus-Naur form is, of course, a recursive definition of a set Exp. In NaDSet it would be defined: ExpCls for {z I true:z A false:z A fVu.v.w:zl<u.v.w.CndExp>:z } Exp for {e I [Vz:ExpCls]e:z} This type of definitions will be used extensively in the rest of the thesis. Therefore, it is important that its meaning is well understood. A recursive definition is usually given by a pair of NaDSet definitions as in the case of expressions. The first definition defines the term whose members are the sets that are closed under the expression constructors. That is, each element of ExpCls has the constants true and false among its members and if u, v, w are in it, so is the tuple <u.v.w.CndExp>. The second definition then (which actually defines the desired set of expressions) defines Exp to be the least such set (closed under the expression constructors). The following lemma, although simple, gives an illustration on the way recursive definitions of this type are used. At the end of this chapter a broader discussion on the use of such definitions Chapter TV: Programming Semantics 61 is provided. 4.2.1.1.1 Lemma The sequent -» [Vx:Exp](x= true v x=false v [3u,v,w:Exp]x=<u,v,w,CjidExj2>) is derivable. Proof of lemma 4.2.1.1.1 Let for the context of this proof T for fxl x= true v x=false v |"3u.v.w:Exp] x=<u.v.w.CndExp> I. A derivation of the lemma sequent follows. In this, p, r, s and t are first order parameters. r:Exp -> r:Exp s:Exp -» s:Exp t:Exp -> t:Exp p=<r.s.t.CndExp> -» p=<r.s.t.CndExp> r:Exp, s:Exp, t:Exp, p=<r.s.t.CndExp> -> *r3u.v.w:Exp1p=<u.v.w.CndExp> *r3u.v.w:Exp1p=<u.v.w.CndExp> -> r3u.v,w:Explp=<u,v,w,CndExp> p= true -> p= true p=false -» p=false *(p= true v p=false v [3u,v,w:Exp]p=<u,v,w,CndExp.>) -> p= true. p=false. r3u.v.w:Explp=<u.v.w.CndExp> *p:T -> p= true. p=false. r3u.v.w:Exp1p=<u.v.w.CndExp> (a) ^ T:ExpCls * [Vz:ExpCls]p:z -> p= true , p=false. r3u.v.w:Explp=<u.v.w.CndExp> *p:Exp p= true. p=false, r3u.v.w:Explp=<u.v.w.CndExp> p:Exp -» *(p= true v p=false v r3u.v.w:Explp=<u.v.w.CndExp>) -» *[Vx:Exp](x= true v x=false v r3u.v.w:Explx=<u.v.w.CndExp>') Chapter IV: Programming Semantics 62 Proof of (a): A derivation of the sequent (a) from sequents (1),.., (27), in which pu, pv, and pw are first order parameters, follows. (1) pu= true., pv= mie, pw= true. -» [3u,v,w:Exp] <pu.pv.pw.CndExp> =<u.v.w.CndExp> (2) pu= true. pv= true. [3u,v,w:Exp] pw=<u.v.w.CndExp> -> [3u,v,w:Exp] <pu.pv.pw.CndExp> =<u.v.w.CndExp> (27) [3u,v,w:Exp] pu=<u.v.w.CndExp>. [3u,v,w:Exp] pv=<u.v.w.CndExp>. [3u,v,w:Exp] pw=<u.v.w.CndExp> -»[3u,v,w:Exp] <pu.pv.pw.CndExp> =<u.v.w.CndExp> (pu= true v pu=false v [3u,v,w:Exp] pu=<u.v.w.CndExp>). (pv= true v pv=false v [3u,v,w:Exp] pv=<u.v.w.CndExp>). (pw= true v pw=false v [3u,v,w:Exp] pw-<u.v.w.CndExp>) -» (<pu.pv.pw.CndExp> = true v <pu.pv.pw.CndExp> =false v [3u,v,w:Exp] <pu.pv.pw.CndExp> =<u.v.w.CndExp>) *pu:(xl x= true v x=false v [3u,v,w:Exp] x=<u,v,w,CndEjcp.> }, *pv:fxl x= true v x=false v r3u.v.w:Exp1 x=<u.v.w.CndExp> 1. *pw:(xl x= true v x=false v r3u.v.w:Exp1 x=<u.v.w.CndExp> 1 -» * <pu.pv.pw.CndExp>: f xl x= true v x=false v [3u,v,w:Exp] x=<u,v,w,CndExj3> } *pu:T, *pv:T, *pw:T *<pu.pv.pw.CndExp>:T *fVu.v.w:Tl<u.v.w.CndExp>:T true:T false:T -> *(true:T A false:T A rVu.v.w:Tl<u.v.w.CndExp>:T) -> T:ExpCls Chapter IV: Programming Semantics 63 Sequents (1) to (27) can be easily derived using the definition of Expressions. A derivation of (27) is given next, the derivations of the others are similar. A proof of (27): The terms pu, pv, pw, uv vv w p u 2 , v 2 , w 2 , u 3 , v 3 and w 3 are first order parameters. UpExp, v^Exp, WpExp, pu=<upVpWpCndExp_> -» pu:Exp u 2:Exp, v 2:Exp, w2:Exp, pv=<u2,v2,w2,CjidExE> -» pv:Exp u 3:Exp, v 3:Exp, w 3:Exp, pw=<u3,v3.w3,CndExp> -» pv:Exp -> <pu.pv,pw.CndExp> =<pu.pv.pw.CndExp> UpExp, VpExp, WpExp, pu=<u1.v1.w1.CndExp>. u 2:Exp, v 2:Exp, w 2:Exp, pv=<u2,v2,w2,CjidExj3>, u 3:Exp, v 3:Exp, w 3:Exp, pw=<u3.v3.w3.CndExp>. -> *[3u,v,w:Exp] <pu.pv.pw.CndExp> =<u.v.w.CndExp> *[3u,v,w:Exp] pu=<u.v.w.CndExp>. *[3u,v,w:Exp] pv=<u.v.w.CndExp>. *[3u,v,w:Exp] pw=<u.v.w.CndExp> -> [3u,v,w:Exp] <pu.pv.pw.CndExp> =<u.v.w.CndExp> E n d of proof of lemma 4.2.1.1.1 4.2.1.2 Commands The set of commands is similarly defined: Cmd ::= dummy I < Exp, Cmdi , Cmd2, CndCmd > I < Cmdi, Cmd2, SeqCmd > I < Exp, Cmd, WCmd > I < Cmd, Exp, RWCmd > The five nondummy commands are respectively the conditional command, the sequence command, the whiledo command and the repeatwhile command. As with the set Exp, the set Cmd can be defined in NaDSet CmdCls for {z I dummy.:z A [Ve:Exp] [Vcx ,c2: z] <e,c x ,c2,CndCmd>: z Chapter IV: Programming Semantics 64 A [Vc 1 ,c2:z] <cl .c2.SeqCmd>:z A rVe:Expl rVc:zl<e.c.WCmd>:z A [Ve:Exp][Vc:z]<c,e,RWCrnd>:z } Cmd for {c I [Vz:CmdCls]c:z) and a lemma similar to lemma 4.2.1.1.1 can be derived for the commands as well. The strings false, true. CndExp. dummy. CndCmd. SeqCmd. WCmd. and RWCmd are the primitive strings of the language. They are not only assumed to be distinct, but must be assumed to be provably distinct. By this is meant that for each distinct pair S and R of strings from this list, the following sequent is derivable in NaDSet: S =R -> One of the simplest ways of assuring this is to take the strings in order as abbreviations of the integers 0, 1, 2, 3, 4, 5, 6, 7, since all integers can be proved to be distinct using only the definition N of the integers. In addition, the basic properties of ordered pairs and tuples, shown to be derivable in [Gilmore89], must be assumed. In particular, therefore, the following sequent is derivable: <t1.t2.SeqCmd> = <t3,t4,WCmd> -> for any first order terms tv t^ , tj, and t4. 4.2.2 Expression Semantics It is assumed that a finite set S of states has been defined, and that the set B has been defined B for {v I v = 1 w = 0} to represent the set of boolean values. A set ExpSem is to be defined so that "<e,s,v>:ExpSem" means "expression e in state s has value v". But first a definition of ExpCls, expression closed, is needed: ExpSemCls for {w I [Vs:S] <true. s,l>:w A [Vs:S]<false, s,0>:w A [Ve, el,e2:Exp][Vs:S][Vv:B]( <e,s,l>:w A <el5s,v>:w z> «e .e 1 . e 2 .CndExp> .s .v> :w' ) Chapter IV: Programming Semantics 65 A [Ve, e1,e2:Exp][Vs:S][Vv:B]( <e,s,0>:w A <e2,s,v>:w => « e , e 1 . e 2 . C n d E x p > , s . v > : w ) } ExpSem for {<e,s,v> I [Vw:ExpSemCls]<e,s,v>:w } For any expression e the abbreviation ExpSem[e] for {<s,v> I <e,s,v>:ExpSem} will be used for convenience. The following lemma which is a consequence of the previous definition is a reminiscent of the traditional definition of the semantics of an expression [Stoy77, Gordon79,89]. The symbol =e is the extensional identity as was defined in the second chapter. 4.2.2.1 Lemma The sequents (1) -> ExpSem[true] = , {<s,v> I v=l} (2) -> ExpSemrfalsel =e {<s,v> I v=0} (3) -> [Vce^e^Exp] ExpSemr<e.e1 .e2.CndExp>l =e {<s,v> I (<s,l>:ExpSem[e] A <s,v>:ExpSem[e1]) v (<s,0>:ExpSem[e] A <s,v>:ExpSem[e2]) } are derivable. The proof of the lemma is given in appendix D. 4.2.3 Command Semantics Now a set CmdSem is to be defined so that "<c,r,s>:CmdSem" means "command c in state r moves system to state s". Command closed is defined first: CmdSemCls for {w I rvt:Sl<dummv.t.t>:w A [Vcl,c2:Cmd][Vr,s,t:S]( <Cj,r,s>:w A <c2,s,t>:w = > « c1.c2.SeqCmd>.r.t>:w) A [Ve:Exp][Vc1,c2:Cmd][Vr,s:S]( <e,r,l>:ExpSem A <c1,r,s>:w => «e .c 1 . c 2 .CndCmd>.r . s> :w' ) Chapter IV: Programming Semantics 66 A [Ve:Exp][Vc1,c2:Cmd][Vr,s:S]( <e,r,0>:ExpSem A <c2,r,s>:w => « e , c pC2,CjidCmd>,r, s>: w) A [Ve:Exp][Vc:Cmd][Vr:S]( <e,r,0>:ExpSem => <<e,c,W£md>,r,r>:w) A [Ve:Exp][Vc:Cmd][Vr,s,t:S]( <e,r,l>:ExpSem A <c,r,s>:w A «e . c .WCmd>.s . t> :w 3 <<e,c,WjCmd>,r,t>:w) A [Ve:Exp][Vc:Cmd][Vr,s:S]( <e,s,0>:ExpSem A <c,r,s>:w 3 <<c,e,PJ^rM>,r,s>:w) A [Ve:Exp][Vc:Cmd][Vr,s,t:S]( <e,s,l>:ExpSem A<c,r,s>:w A « c . e . R W C m d > , s , t > : w 3 «c ,e .RWCmd>,r , t> :w ) } CmdSem for {<c,r,s> I [Vw:CmdSemCls]<c,r,s>:w } It is interesting to contrast the definition of CmdSem with the denotational semantics for the commands provided in [Stoy77]. Apart from the obvious absence of the top and bottom in the definition of CmdSem, the most striking difference is that the semantics for all commands of the language is provided in the definitions of CmdSemCls and CmdSem, while the semantics for the commands are provided separately by Stoy. However, the properties of the separate commands can be recovered using the following parameterized definitions: WCls[e,c] for {w I [Vr:S]( <e,r,0>:ExpSem 3 <r,r>:w) A [Vr,s,t:S] (<e,r,l>:ExpSem A <c,r,s>:CmdSem A<s,t>:w 3 <r,t>:w) } RWCls[c,e] for {w I [Vr,t:S]( <e,t,0>:ExpSem A <c,r,t>:CmdSem 3 <r,t>:w) A [Vr,s,t:S] (<e,s,l>:ExpSem A <c,r,s>:CmdSem A <s,t>:w 3 <r,t>:w) } The properties of the separate commands are summarized in the following lemma: 4.2.3.1. Lemma The following sequents are derivable. (1) -> [Vt:S] <dummy,t,t>:CmdSem (2) -»[Vc 1 ,c 2 :Cmd][Vr,t:S]( « c1.c2.SeqCmd>.r.t>:CmdSem Chapter IV: Programming Semantics 67 =[3s:S]( <c1,r,s>:CmdSem A <c2,s,t>:CmdSem )) (3) -»[Ve:Exp][Vc 1 ,c 2 :Cmd][Vr,s:S]( <<e.c1.c2.CndCmd>,r.s>:CmdSem = (<e,r,l>:ExpSem A <c1,r,s>:CmdSem) v ( <e,r,0>:ExpSem A <c2,r,s>:CmdSem)) (4) -> [Ve:Exp][Vc:Cmd][Vr,t:S]( «e.c .WCmd>.r . t> :CmdSem B [Vz:WCls[e,c]] <r,t>:z) (5) -»[Ve:Exp][VcrCmd][Vr,t:S]( «c .e .RWCmd>j . t> :CmdSem = [Vz:RWCls[c,e]] <r,t>:z) The proof of the lemma is in appendix E. 4.2.4 Example Theorem To illustrate the point that all the desired properties of the set CmdSem can be derived from its definition and the definitions of the other sets upon which it is dependant, a sketch of a derivation of the following sequent will be provided: -> [Ve:Exp][Vc:Cmd][Vr,t:S] ( «c .e .RWCmd>.r . t> :CmdSem = «c.<e.c .WCmd>.SeqCmd>.r . t> :CmdSem ) This sequent expresses that the effect of the command <c,e,RWCmd> is the same as the effect of the sequence of commands c and <e.c.WCmd> in terms of state transformations. It is theorem 9.22 of [Stoy77]. 4.2.4.1 Theorem The sequent (th) -> [Ve:Exp][Vc:Cmd][Vr,t:S] ( «c .e .RWCmd>.r . t> :CmdSem = «c .<e .c .WCmd>.SeqCmd>.r . t> :CmdSem) is derivable in NaDSet. Proof of theorem 4.2.4.1 Using the variables in the formula of the sequent as first order parameters, the sequent can be simply derived from the following two sequents: (i) e:Exp, c:Cmd, r:S, t:S, «c .e .RWCmd>.r . t> :CmdSem -> Chapter IV: Programming Semantics 68 <<c.<e.c.WCmd>.SeqCmd>.r.t>:CmdSem (ii) e:Exp, c:Cmd, r:S, t:S, <<c.<e.c.WCmd>.SeqCmd>j.t>:CmdSem -» «c .e .RWCmd>.r . t> :CmdSem Sketches of a derivation of the first sequent will be provided in the next subsections. The derivation of the second sequent is similar and therefore is omitted. As before the reader is advised to read the derivations as they have been developed, namely bottom-up. .1 A Derivation of (i) The following abbreviation will be used in this subsection only: T for {<r,t> I [3s1:S](<c,r,s1>:CmdSem A <<c,<e,c,WCmd>,s1,t>:CmdSem )}. There follows a sketch of a derivation of (i) from two sequents (a) and (b) in which this abbreviation has been used. (a) e:Exp,c:Cmd -» T:RWCls[c,e] (b) e:Exp, c:Cmd, r:S, t:S, <r,t>:T -> [3s,:S]( <c,r,Sj>:CmdSem A < <c,<e,c,WCmd>,s1,t>:CmdSem ) e:Exp, c:Cmd, r:S, t:S, *(T:RWCls[c,e] 3 <r,t>:T) -> [Bs^SK ^^ .s^rCmdSem A < <c,<e,c,WCmd>,s1,t>:CmdSem ) e:Exp, c:Cmd, r:S, t:S, *[Vz:RWCls[c,e]] <r,t>:z -» [3s 1 :S ] ( ^ ^ . S j >:CmdSem A < <c.<e.c.WCmd>.s1.t>:CmdSem ) [Using sequents (2) and (5) of lemma 4.2.3.1 and cut rule ] e:Exp, c:Cmd, r:S, t:S, *«c .e .RWCmd>.r . t> :CmdSem -» *«c.<e.c .WCmd>.SeqCmd>.r . t> :CmdSem A derivation of sequent (b) will be left as an exercise for the reader. A derivation of sequent (a) follows. e:Exp, r:S, s:S, <e,s,l>:ExpSem -> <e,s,l>:ExpSem c:Cmd, s:S, s^S, <c,s,Sj >:CmdSem -> <c,s,Sj >:CmdSem t:S, s^S, <s1,t>:W <sl5t>:W Chapter IV: Programming Semantics 69 e:Exp, c:Cmd, r:S, s:S, t:S, Sj:S, <e,s,l>:ExpSem, ^ .s . s^iCmdSem, <s1,t>:W, -» *(<e,s,l>:ExpSem A <c,s,s^>:CmdSeni A<s1,t>:W) <s,t>:W -> <s,t>:W e:Exp, c:Cmd, r:S, s:S, t:S, s^S, <e,s,l>:ExpSem, ^.s.SjXCmdSem, <s1,t>:W, *(<e,s,l>:ExpSem A <c,s,s^>:CmdSem A<S1,I>:W 3 <s,t>:W) -» <s,t>:W s:S -> s:S s^S -> s^S t:S -> t:S e:Exp, c:Cmd, r:S, s:S, t:S, s^S, <e,s,l>:ExpSem, ^ . s . s ^ C m d S e m , <s1,t>:W, *[Vr,s,t:S] (<e,r,l>:ExpSem A <c,r,s>:CmdSem A<s,t>:W 3 <r,t>:W) -> <s,t>:W e:Exp, c:Cmd, r:S, s:S, t:S, s^S, <e,s,l>:ExpSem, ^.s .s^rCmdSem, <s1,t>:W, *W:WCls[e,c] <s,t>:W (thinning, A->, {}->) W:WCls[e,c] -> W:WCls[e,c] e:Exp, c:Cmd, r:S, s:S, t:S, SjiS, <e,s,l>:ExpSem, ^ . S j S ^ i C m d S e m , *[Vz:WCls[e,c]] <slft>:z, W:WCls[e,c] -> <s,t>:W e:Exp, c:Cmd, r:S, s:S, t:S, s^S, <e,s,l>:ExpSem, ^ . s . S j >:CmdSem, [Vz:WCls[e,c]] •<s1,t>:z -» *[Vz:WCls[e,c]] <s,t>:z [Using sequent (4) in lemma 4.2.3.1 and cut] e:Exp, c:Cmd, r:S, s:S, t:S, s^S, <e,s,l>:ExpSem, ^ s ^ x C m d S e m , *<<c,<e,c,WCmd>,s1,t>:CmdSem -» *<<c,<e,c,WCjnd>,s,t>:CmdSem c:Cmd, r:S, s:S, <c,r,s>:CmdSem -» <c,r,s>:CmdSem Chapter IV: Programming Semantics 70 s:S -> s:S e:Exp, c:Cmd, r:S, s:S, t:S, s^S, <e,s,l>:ExpSem, <c,r,s>:CmdSem, ^s .SjXCmdSem, <<c.<e.c.WCmd>.s1.t>:CmdSem -» *(s:S A <c,r,s>:CmdSem A «c .<e .c .WCmd>.s . t> :CmdSem ) e:Exp, c:Cmd, r:S, s:S, t:S, SjiS, <e,s,l>:ExpSem, <c,r,s>:CmdSem, ^.s.SjXCmdSem, «c .<e . c .WCmd>.s 1 . t > :CmdSem -» *[3s1:S](<c,r,s1>:CmdSem A <<c,<e,c,WCmd>,s1,t>:CmdSem ) e:Exp, c:Cmd, r:S, s:S, t:S, <e,s,l>:ExpSem, <c,r,s>:CmdSem, *[3s1:S]*(<c,s,s1>:CmdSem A «c .<e ,c ,WCmd>,s 1 , t> :CmdSem ) -» [3s1:S](<c,r,s1>:CmdSem A «c .<e .c .WCmd>.s 1 . t> :CmdSem ) e:Exp, c:Cmd, r:S, s:S, t:S, <e,s,l>:ExpSem, <c,r,s>:CmdSem, *<s,t>:T -> *<r,t>:T e:Exp, c:Cmd -> *[Vr,s,t:S] *(<e,s,l>:ExpSem A <c,r,s>:CmdSem A <s,t>:T 3 <r,t>:T) Similarly e:Exp, c:Cmd -» [Vr,t:S]( <e,t,0>:ExpSem A <c,r,t>:CmdSem 3 <r,t>:T) e:Exp, c:Cmd -> *([Vr,t:S]( <e,t,0>:ExpSem A <c,r,t>:CmdSem 3 <r,t>:T) A [Vr,s,t:S] (<e,s,l>:ExpSem A <c,r,s>:CmdSem A <s,t>:T 3 <r,t>:T)) e:Exp, c:Cmd -> *T:RWCls[c,e] E n d of proof of theorem 4.2.4.1 The success of NaDSet in deriving such an equivalence property among those recursively defined set terms, reinforces the claim about the power of the generalized abstraction and the completeness of NaDSet definitions. Note that such an argument can not be carried out in the X-calculus formalism. The semantics of the while command is usually defined in ^.-calculus [Stoy77, Gordon79] as follows: C[[while e do c]] ^ (YF) Chapter IV: Programming Semantics 71 where Y is the least fixed point operator defined by Y = Xf.(Xx.f (x x)) (Xx.f (x x)) and F = Xf.Xs.((e s) => (f°a s), s) . In this expression, a is used as an abbreviation of C[[c]], the semantics of the command c, e is an abbreviation of E[[e]], the semantics of the expression e, (a => b, c) is a conditional function (like the one defined in [Stoy77])and ° is the composition operator defined as f° g = Xx.f (g x). Similarly, the semantics of the repeatwhile command can be defined: C[[c repeatwhile e]] ^ (YG) where G = XfAs.((e°a s) => (f°a s), (a s)) . If 'cnv" denotes the ^-conversion, the previous theorem is expressed in ^.-calculus by the statement (st) (YG) cnv ( Y F ) ° o . But such a conversion cannot be derived with the traditional rules of X-conversion. As an illustration the first steps of such a conversion are shown next. First, (Y F) cnv (Xx.F (x x)) (Xx.¥ (x x)) cnv F [(Xx.F (x x)) (Xx.F (x x))] cnv Xs.((e s) => (F °o s), s) where F is the expression [(Xx.F (x x)) (Xx.F (x x))]. Therefore, (Y F)°a = Xy.(YF)(cry) cnv Xy.((e (a y)) => (F*°a (a y)), (a y)) cnv A.y.((e°a y) => (F*°a°a y), (a y)) Similarly, (Y G) cnv (Xx.G (x x)) (Xx.G (x x)) cnv G [(Xx.G (x x)) (Xx.G (x x))] cnv XS.((E°O S) => (G*°a s), (a s)) where G is the expression [(Xx.G (x x)) (Xx.G (x x))]. Consequently, to prove the statment (st) it is necessary to show G cnv F °a which is not much different than the original statement. The problem here is that the terms (Y F) and (Y G) do not have a normal form (they are not meant to) so, they cannot be compared easily. Of course, for any specific command c, Chapter IV: Programming Semantics 72 expression e and state s, the special case of (st), given by a statement of the form ((Y G) s) cnv ((Y F)°a s) is indeed provable but (st) itself is not. Some type of fixed point induction rule is needed to carry out the general case of this argument but, such a rule cannot be added in the type-free X-calculus [Kleene&Rosser35]. On the other hand, the typed X-calculus can be extended to include some type of fixed point induction. An example of the latter is Scott's L C F [Milner72, Gordon et al.78] and its successor H O L system [Gordon87]. Of course, these systems prohibit self-application and therefore are not suitable for other applications. Finally, to carry out this type of argument, any formalization of Scott's domain theory [Scott72,82] must not only provide for fixed point induction but it also has to restrict this type of induction to admissible properties only; otherwise undesirable or even contradictory statements are deducible. Section 9 of [Stoy77] includes a comprehensive discussion on the need of the admissibility test while [Park70] gives an exposition of the fixed point induction per se. 4.2.5 Nondeterministic Constructs The task of modelling nondeterminism and developing appropriate semantics for nondeterministic programming languages is a challenging problem researchers in theoretical computer science have been facing in the last two decades. Because of their strong relation to parallelism and concurrency, nondeterministic languages have many semantic problems associated with them [de Bakker76, Plotkin76, Smyth78, Park80]. The present section does not aspire to solve any of these semantic problems since such a task is outside the scope of the thesis. It rather demonstrates that the established ideas on the semantics of nondeterministic languages can be expressed in NaDSet in a coherent and rather natural way. Moreover, in NaDSet this type of semantics is not different than the semantics of deterministic programs; the difference lies in the interpretation of a term that defines the semantics not in the term itself. To illustrate this claim, our simple programming language is augmented to include a choice expression and a choice command of the form <Exp l 5 Exp 2 , ChExp> and <Cmd l 5 Cmd 2 , ChCmd> respectively. Their intended interpretation implies that the value of the choice expression is either the value of Exp t or that of Exp 2 and that when control reaches the choice command one of the commands Cmj and C n ^ is indiscriminately chosen and executed. Of Chapter IV: Programming Semantics 73 course this type of nondeterministic choice is very simple but, it is adequate for the exposition of this section. Dijkstra's guarded commands or other similar nondeterministic commands can be treated the same way within NaDSet. To accommodate the new constructs, proper sentences have to be added in the definitions of the semantics of expressions and commands. More specifically, the conjunct A [Vej^ExpJtVsrSHVvrBK^epS^xw v <e2,s,v>:w) 3 « e1.e2.ChExp>.s.v>:w) is added to the definition of the term ExpSemCls and A [Vc1,c2:Cmd][Vr,s:S]((<c1,r,s>:w v <c2,r,s>:w) 3 « c1.c2.ChCmd>.r.s>:w') is added to the definition of the term CmdSemCls. It is rather interesting that the addition of the nondeterministic expressions and commands does not bring any radical change to the semantics: the semantics of an expression or a command is still a relation over SxB or SxS respectively. Of course, these relations are no longer functional and their interpretation reflects that difference as well. While the sentence <s,v>:ExpSem[e] was interpreted as "v is the value of e when it is evaluated in state s", in the presence of nondeterminism the statement is interpreted as "v is a possible value of e when it is evaluated in state s". Similarly the sentence <s,r>:CmdSem[c] is interpreted as "r is one of the possible states resulting by executing c in state s". However, such an interpretation is completely transparent to the logic. From the deductive point of view, the new terms that define the semantics of the new constructs are used in the same way the old terms were used. For instance, the proof of theorem 4.2.4.1 is not affected by the change; only the induction in the proof of lemma 4.2.3.1 has to include an additional case corresponding to the new conjuct in the definition of the CmdSemCls term. On the contrary, in denotational semantics some type of powerdomain structure is necessary to express the semantics of nondeterministic constructs [Plotkin76, Smyth78, Apt&Plotkin81]. In that framework the semantics of a command is given as a function from S to the powerset of S. Therefore, (C[[c]] s) is the subset of S containing every states r that can result from executing c in state s. Of course such theories are primarily concerned with computation and such representations may be necessary. On the other hand, the way programming semantics are defined and used in NaDSet makes the use of this type of construction unnecessary, in general. Nevertheless, a type of semantics similar to powerdomain semantics can also be defined within Chapter IV: Programming Semantics 74 NaDSet. If T is any second order term the term that corresponds to the powerset of T is defined: P[T] for {z I [Vx:z]x:T} As an illustration, consider the set of boolean values B defined in section 4.2.2. If an expression is viewed as a function from S to the powerset of B, F[B], its semantics can be defined as follows. ExpSemCls for {w I rVs:Sl<true. s,{xlx=l}>:w A rVs:Sl<false. s,{xlx=0}>:w A [Ve, e1,e2:Exp][Vs:S][Vu,v:P[B]](<e,s,u>:w A 1:U A <e1,s,v>:w => « e . e 1 , e 2 , C n d E x p > , s , v > : w ) A [Ve, e 1 ,e 2 :Exp][Vs:S][Vu,v:/°[B]](<e,s,u>:w A 0:U A <e2,s,v>:w => « e . e 1 . e 2 . C n d E x p > . s . v > : w ) A [Ve 1 ,e 2 :Exp][Vs:S][Vv 1 ,v 2 : /°[B]](<e 1 ,s ,v 1 >:w A <e2,s,v2>:w z>« e re 2.ChExp>.s.fxlx:v 1vx:v 2 }>:w) A [Ve][Vs:S][Vv1,v2:/>[B]](<e,s,v1>:w A \x =ev2 => <e,s,v2 >:w) } ExpSem for {<e,s,v> I [Vw:ExpSemCls]<e,s,v>:w } Naturally, the extentional identity, =e, has to be used in reasoning with this type of semantics. The corresponding command semantics can be defined in a similar way. We conclude this chapter with some general remarks and guidelines on the use of NaDSet recursive definitions in a type of reasoning that corresponds to the traditional structural induction. Chapter IV: Programming Semantics 75 4.3 R E M A R K S O N T H E U S E O F R E C U R S I V E DEFINITIONS In the previous section, recursive definitions have been extensively employed in defining a formal semantics of a simple programming language within NaDSet. The set of expressions, commands and their semantics are given by NaDSet terms that formalize specific recursive definitions. Subsequently, these definitions were used to prove various arguments about the sets they define. A careful examination of these proofs reveals that in general a type of reasoning that resembles the traditional induction can be carried out with such definitions. The present section makes an effort to outline the main elements of such a reasoning. In general, a recursive set RS is defined in NaDSet by a recursive definition of the form RSCls for {zl Stt A S^ A ... A Stn } RS for {t I [Vz:RSCls]t:z} where t is a first order term with free variables v, z is usually a variable and St^ l<i<n, are NaDSet sentences. Informally, since RS is a recursively defined set, it is generated from some basic elements via the use of some generators (constructors or operators). The sentences St : to Stn define exactly how the elements of the set are generated by the constructors. Therefore, the first definition defines all the sets that are closed under the operations defined by the constructors, while the second one defines the minimum such set. Let Z be a derivable sequent containing a sentence in which RS occurs. Some typical cases of the use of the definition of RS in deriving E are discussed below. The derivations shown in the following cases must be considered as tentative derivations; they may not be always feasible. Nevertheless, they outline the patterns of the derivations presented in the present and the next chapter of the thesis. 4.3.1 First Case: Simple induction Let S be the sequent r [VxrRS]*?, A where r and A are sequences of closed formulae and ¥ is a formula with x its only free variable. In this case a derivation of E can be constructed from a derivation of the sequent (i) r - » {xl *P}:RSCls, A Chapter IV: Programming Semantics 76 as follows. [[p/yjt/x]* -> [[p/yJt/x]»P *[p/v]t:{xl -> [[p/yjt/x]^ (i) r -» {xl *P}:RSCls, A r, *[Vz:RSCls]([p/yJt:z) -»[[E/v]t/x]¥, A r, *[p/v]t:RS -> [[p/vlt/x]*?, A r -> *[Vx:RS]¥, A Informally, this states that if under the assumptions r, the set of elements that satisfy ¥ is closed under the generators of RS, every element of the minimum set closed under the generators of RS satisfies ¥ under the same assumptions. Finally, the derivation of the sequent r-^xl^JrRSCls rnirrors the traditional structural induction used in mathematics: to show that {xlT}:RSCls is derivable under the assumptions r, it is necessary to show that {xl satisfies the sentences St2 to S^ or, equivalently, that ¥ is satisfied by the basic elements of RS and it is preserved by the generators of RS, under the same assumptions. Similar remarks apply to a sequent of the form [3x:RS]»P -> A or of the form r -> [Vx:RS]^, A and r, [3x:RS]¥ -> A . 4.3.1.1 Example Consider the set of natural numbers: NCls for (Z IO:ZAVU(U:ZD{U) :Z) ) N for {x I [Vz:Cls]x:z} where 0 for {u I ~u = u } {t} for {v I v = t }. Suppose that < is defined. To show that -> [Vx:N](x<{x}) is derivable it is necessary to show that - » { x l x < { x } }:NCls is derivable which in turn requires the derivation of -» 0<{0} and of ->Vu(u<{u}3{u}<{{u}}). The following example shows that the same technique can be applied in cases in which RS does occur in x¥. 4.3.1.2 Example Chapter IV: Programming Semantics 77 Recall the definition of expressions given in section 4.2.1.1: ExpCls for {z I true:z AMSS:Z A fVii.v.w:z]<ii.v.w.CnHRxp>:7. } Exp for {e I [Vz:ExpCls]e:z} The derivation of the sequent of lemma 4.2.1.1.1 follows the general patern discussed here. Specifically, in order to show that the sequence -» *[Vx:Exp](x= true v x=false v [3u,v,w:Exp] x=<u.v.w.CndExp>') is derivable, it was necessary to derive (a) -» {xl x= true v x=false v [3u,v,w:Exp] x=<u.v.w.CndExp> 1 :ExpCls. In this case, is the formula x= true v x=false v [3u,v,w:Exp] x=<u.v.w.CndExp> and the derivation of sequent (a) is a proof of ^ by a structural induction on the expression x. 4.3.2 Second Case Let Z be the sequent r, [s/v]t:RS A where £ is a sequence of constant first order tetms of length equal to the that of v . In this case it is sufficient to be shown that the term {t I t:RS A (t=[s/v]t z> is closed under the RS-generators. More specifically, a derivation of £ can be constructed, from a derivation of the sequent (i) r -» {t I t:RS A (t=[s/v]t 3 V)} .RSCls, A as follows. ¥ -> ¥ -> [s/v]t =[s/yjt *([s/v]t =[s/yjt 3 -> V [s/yJt:RS, ([s/y]t =[s/v]t z> W) -> thinning *[s/yjt:{t I t:RS A ( t^s/ylt^) } - > ¥ (i) r -> {t I t:RS A (t=[s/v]t3 »P)}:RSCls, A r, *[Vz:RSCls]([s/v]t:z) —> A r, *[s/yJt:RS —> A Chapter IV: Programming Semantics 78 The rationale of this proof can be describe as follows. Note that the term {t I t:RS A (t=[s/v]t 3 ¥ ) } used as the eigenterm for z in the previous derivation, defines the (largest) subset of RS that satisfies the property (t=[s/v]t 3 *¥). Therefore, if this subset of RS is closed under the RS-generators (i.e. it is a member of RSCls), it is coextensional to RS since the later is the smallest such a set (closed under the RS-generators). 4.3.2.1 Example The derivation of the sequent (b) in the proof of lemma 4.2.2.1 demonstrates this type of reasoning using the recursively defined term ExpSem. In order to prove the sequent p:Exp, PpExp, p 2:Exp, t:S, u:B.«p.p 1 .p 2 .CndExp>.t .u>:ExpSem -> ((<p,t,l>:ExpSem A <p1,t,u>:ExpSem) v (<p,t,0>:ExpSem[p] A <p2,t,u>:ExpSem)) the term T defined to be {<x,s,v> I <x,s,v>:ExpSem A rVa.a1.a2:Expl(x=<a.a1.a2.CndExp> r> ((<a,s,l>:ExpSem A <a1,s,v>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,v>:ExpSem))} is used as the eigenterm for z, and the sequent -» T:ExpSemCls had to be derived first. In this example T has a more general form than the corresponding eigenterm in 4.3.2 but the similarity is transparent. Nevertheless, the term {<x,s,v> I <x,s,v>:ExpSem A ( < x . s . v > = « p . p 1 . p 2 . C n d E x p > . t . u > z> ((<p,s,l>:ExpSem A <pj,s,v>:ExpSem) v (<p,s,0>:ExpSem A <p2,s,v>:ExpSem))} could be used as well. 4.3.2.2 Example A similar argument is used in the derivation of sequent (b) in the proof of lemma 4.2.3.1 where the definition of the command semantics, CmdSem, is used. There, in order to derive the sequent e:Exp, c:Cmd, r:S, t:S, «e.c .WCmd>.r . t> :CmdSem. W:WCls[e,c] Chapter IV: Programming Semantics 79 -> <r,t>:W the term {<x,y,z>l <x,y,z>:CmdSem A (x=<e.c.WCmd> 3 <y,z>:W)} was used as the eigenterm and the corresponding sequent (c) e:Exp, c:Cmd, W:WCls[e,c] -> T:CmdSemCls which expresses its closedness with respect to CmdSem was derived in the subsection 4.2.3.1.2.1 of the proof. 4.3.3 T h i r d Case E is the sequent r, [r/yJt:RS -> [s/v]t:RS, A where each of r, s is a sequence of constant first order tetms of length equal to the that of v. A derivation of Z can be obtained as follows. fefr]t:Z->[s&]t:Z -> [r/yjt =[r/yjt *([l/yjt =[r/yjt 3 k/yJt:Z) -> k/YJt:Z [r/yJt:Z, ([r/yjt =[r/yjt 3 k/y]t:Z) -> [s/y]t:Z thinning *tr/yjt:{t I t:Z A (t=[r/v]t 3 [s/yJt:Z)> ^ [s/yJt:Z (hi) r, Z:RSCls ^ {t I t:Z A (t=[r/yjt 3 [s/yJt:Z)}:RSCls, A r, *[Vz:RSCls]([r/yJt:z), Z:RSCls -> [s/yJt:Z, A r, [Vz:RSCls]([r/v]t:z) -> *[Vz:RSCls]([s/yJt:z), A r, *Q/v]t:RS -> *ts/v]t:RS, A where Z is a second order parameter. Sequent (iii) has to be derived to completes the proof of Z. The meticulous reader may have already noticed the similarities of this with the second case. Indeed, the only difference is the introduction of the second order parameter Z that replaces the occurrence of RS in the eigenterm for z. Moreover a similar informal justification for the argument can be carried over to this case as well. 4.3.3.1 Example In section 5.4 of the next chapter, the derivation of the sentence (5) of lemma 5.4.3 uses the Chapter IV: Programming Semantics 80 type of argument discussed here. Specifically, the recursively defined term used there is the term Cnv that defines the X-conversion relation over the X-calculus terms. A proof of the sequent g:Asgn[D,«], w:Lterm, v:Lterm, w^Lterm, VpLterm, <w,w1>:ASubst[g], -cv^xASubsttg], <w,v>:Cnv -> <w1,v1>:Cnv is obtained from a proof of the sequent (a) g:Asgn[D,«], ZrCnvCls -> T:CnvCls where Z is a second order parameter T is the term {<w,v> I [Vw1,v1:Lterm](<w,w1 >:ASubst[g] A <v,v1 >:ASubst[g] 3 <w1,v1 >:Z)}. The reader can easily verify the similarities by examining the main segment of this derivation which is repeated here for convenience: <w,w1>:ASubst[g] -> <w,w1>:ASubst[g] cv.v^ASubsttg] -> <v,Vj>:ASubst[g] <w1,v1>:Z -> <w1,v1>:Z <w,Wj>:ASubst[g], -cv.v^^Substfg], *(<w,w1>:ASubst[g] A -cv.v^ASubsttg] 3 <w1,v1>:Z)} -> <WJ,VJ>:Z w^Lterm -> w^Lterm v^Lterm -> v^Lterm thinning w:Lterm, v:Lterm, w^Lterm, v^'Lterm, <w,w1>:ASubst[g], cv.v^ASubsttg], •[VWpV^LtermJ^w.w^ASubsttg] A <v,Vj>:ASubst[g] 3 <w1,v1>:Z)} -> <w1,v1>:Z w:Lterm, v:Lterm, w^Lterm, v^Lterm, Chapter IV: Programming Semantics 81 <w,w1>:ASubst[g], -cv.v^ASubsttg], *<w,v>:T -» <w1,v1>:Z (a) g:Asgn[D,«], Z:CnvCls -> T:CnvCls g:Asgn[D,»], w:Lterm, v:Lterm, w^Lterm, v^Lteim, Z:CnvCls, <w,w1>:ASubst[g], ^.v^rASubsttg], *[Vz:CnvCls]<w,v>:z - » < w 1 , v 1 > : Z g:Asgn[D,»], w:Lterm, v:Lterm, w^Lterm, VpLterm, <w,w1>:ASubst[g], <v,Vj>:ASubst[g], [Vz:CnvCls]<w,v>:z *[Vz:CnvCls]<w1,v1>:z g:Asgn[D,«], w:Lterm, v:Lterm, w^Lterm, v^Lteim, <w,w1>:ASubst[g], -cv/v^xASubsttg], *<w,v>:Cnv -» *<w1,v1>:Cnv 4.3.4 General Case In the general case, the sequent £ may contain multiple occurences of RS in its antecedent and its succedent. Some forms of the current case can be perceived as the NaDSet representations of the traditional double or multiple-induction arguments. In a bottom-up construction of a derivation of £ the objective is to reduce Z to a sequent (or sequents) where RS does not occur (it has been replaced by a second order parameter or a term). The procedure frequendy adopted in this case is a combination of the following two general directions: The first is to use lemmas already proved and eliminate or reduce the occurences of RS using the cut rule. The other method opts for consecutive repetitions of the procedures outlined in the three special cases discussed above. Nevertheless, the rationale of any of the methods can be recapitulated by the following informal argument. Let O be a property on x (ie. a sentence with a free variable x). To show that RS satisfies <D, it is sufficient to show that for any set Z that is closed under the generators of RS, the subset of Z whose elements satisfy <t> is also closed under the RS-generators. A proof of the Chapter IV: Programming Semantics 82 latter implies that every element of the minimum closed set necessarily satisfies <3>. Usually Z is the set RS itself or a second order parameter but, the form of its subset mentioned above depends not only on the form of * but also on the positions in <& that the variable x occurs. The proofs of the lemmas and theorems of the following chapter provide excellent illustrations of these ideas. Chapter V: Lambda Calculus in NaDSet 83 CHAPTER V The Lambda Calculus in NaDSet The last two chapters have provided an adequate demonstration of the advantages and significance of the type of abstraction provided by the logic NaDSet in formalizing concrete mathematical theories. The present section, then, demonstrates how a formal theory like the theory of lambda calculus can be defined within NaDSet. The theory of lambda conversion, or simply lambda calculus, developed by Church, [Church41], not only has had a great influence on the development of the theory of computation but also is the first consistent theory that offers abstraction and allows the formation of self-referential terms. Of course, lambda calculus does not provide any formalization of quantification. This is exacdy what NaDSet has managed to combine [Gilmore80]. Of course, NaDSet terms are different, more general than the lambda terms; NaDSet aims at a broader spectrum than just formalizing computation. On the other hand, the full X-calculus (that includes the n-conversion) is an extensional theory while NaDSet is an intensional one. Therefore, providing a treatment of the theory of lambda conversion within NaDSet is not only an interesting task per se, but it also provides an additional illustration of the value of NaDSet for some computer science problems. Section 5 of [Gilmore86] presents an approach for simulating p-reduction in first order NaDSet through the use of definite descriptions. Although descriptions may be needed to express some concepts of this type in the first order version of the theory, the final version of (second order) Chapter V: Lambda Calculus in NaDSet 84 NaDSet does not face such limitations. The availability of full induction i.e. the ability to provide recursive definitions by abstraction terms (as it was discussed in the previous chapter) implies that a more direct definition of the lambda calculus is possible. To that extent, well formed X-terms, variable substitution, the X-conversion and most of the basic concepts in the theory are naturally given by terms that resemble the traditional recursive definitions found in any X-calculus textbook [Barendregt81, Hindley«&Seldin86]. Nevertheless, the present chapter undertakes a further exposition than a simple definition of the ^-calculus conversion in NaDSet. In keeping with the method of defining programming semantics illustrated in the previous chapter, the basic concepts of the X-calculus model theory are defined as well. Three definitions of a lambda calculus model are presented, each highlighting a different part of the overall picture[Hindley&Seldin86]. Finally, the Church's term model of the theory is constructed and it is shown to satisfy each one of the given definitions of a model. Much of the work of this chapter appears in [Gilmore&Tsiknis91a]. 5.1 W E L L - F O R M E D T E R M S O F T H E X-CALCTJLUS A set of terms of NaDSet will be defined to be the set Lterm of well-formed terms of the lambda calculus. It is first necessary, however, to define the variables and constants of the calculus. 5.1.1 Variables and Constants The variables and constants of the calculus, called lambda variables and parameters (or briefly Lvariables and Lconstants), are not those of NaDSet. Denumerably many distinct terms of NaDSet are chosen to be Lvariables, and denumerably many distinct terms distinct from the Lvariables are chosen as the Lconstants. Since the arithmetic can be developed within NaDSet, the non-2ero even integers will be defined to be the Lvariables and the odd integers defined to be the Lconstants: Lvar for {2n I n:N A n :> 0 } Leon for {2n+l I n:N } The integer 0 will be reserved to represent the symbol X: X for 0 Chapter V: Lambda Calculus in NaDSet 85 5.1.2 Lambda Terms As was the case with the recursive definitions given in the previous chapter, the recursive definitions will be given in two steps. The following definition of Lterm is typical: LtermCls for {z I [Vu:Lvar] u:z A [Vu:Lcon] u:z A [VWj ,w 2 :z] <WpW 2 >:z A [Vw:z][Vx:Lvar] «X, ,x> ,w>:z } Lterm for {w I [Vz:LtermCls] w:z} Next it is necessary to define Free, a set of pairs the first element of which is a variable with a free occurrence in the term that is the second element of the pair. FreeCls for {z I [Vv:Lvar]<v,v>:z A [Vw1,w2:Lterm][Vv:Lvar](<v,w1>:z v <v,w2>:z 3 < v,<WpW 2 » : z A [Vw:Lterm][Vv,x:Lvar](<v,w>:z A v^x 3 < v , « X , x > , w > : z ) } Free for {<v,w> I [Vz:FreeCls]<v,w>:z } The following is a convenient notation: Free[w] for {v I <v,w>:Free } The definition of variable and the ordering on the integers permits the following definition: FirstNotFree[w] for {v I ~v:Free[w] A [Vu](-u:Free[w] 3 v < u )} The following definition of !Free[w] is the set of all Lvariables if w is a Lterm with no free variables, and is the singleton set {v} if v is the only Lvariable with a free occurrence in w: !Free[w] for {v I [Vx:Lvar](<x,w>:Free 3 v=x)} A closed Lterm is a Lterm in which no variable has a free occurrence: CLterm for {w I w:Lterm A [Vv:Lvar]-<v,w>:Free } The occurrence of a constant in a term is also needed is some of the subsequent sections. Therefore, Coccur is defined to be the set of pairs whose first element is a constant occurring in the term that is the second element of the pair. CoccurCls for {z I [Vc:Lcon]<c,c>:z A [ V W p W ^ L t e m H v c L c o n J O ^ W j X z v <c,w2>:z 3 < c , < w l 5 w 2 » : z A [Vw:Lterm][Vx:Lvar][Vc:Lcon] (<c,w>:z 3 < c , « X , x > , w > : z ) } Coccur for {<c,w> I [Vz:CoccurCls]<c,w>:z } Chapter V: Lambda Calculus in NaDSet 86 In addition, the convenient notation Coccur[w] for {c I <c,w>:Coccur } is used and the the first constant not occurring in a term is given by the following definition: FirstCNotlnfw] for {c I ~c:Coccur[w] A [Vu](-u:Coccur [w] => c < u )}. 5.1.3 Substitution Lastly, it is necessary to define recursively the set of quadruples <w,x,w1,w2> for which the term w 2 is the result of replacing every free occurrence of the Lvariable x in the term Wj with the term w, with changes of bound variables made to prevent clashes of free and bound variables. The definition follows that of definition 1.11 of [Hindley&Seldin86], which in turn follows that of [Curry&Feys58]. SubstCls for {z I [Vw:Lterm][Vx:Lvar]( [Vy:Lvar]((x=y 3 <w,x,y,w>:z) A (x#y 3 <w,x,y,y>:z)) A [Vc:Lcon] <w,v,c,c>:z A [Vw1,w2,w3,w4:Lterm]<w,x,w1,w2>:z A <W,X,W3,W4>:Z 3 < w , x , < w 1 , w 3 > , < w 2 , w 4 » : z A [ V w 2 : L t e r m ] < w , x , « X , x > , w 2 > , « A . , x > , w 2 » : z ) A [Vy:Lvar][Vw1,w2:Lterm](<w,x,w1,w2>:z A y*x A (~y:Free[w] v -xiFreetwJ) 3 < w , x , « X , y > , w 1 > , « X , y > , w 2 » : z ) A [Vy:Lvar] [Vw^w^Lterm] [Vz:FirstNotFree[<w,w1>] ( <z,y,Wj,w2>:z A <w,x,w2,w3>:z A y*x A y:Free[w] A x:Free[w1] 3 < w , x , « X , y > , w 1 > , « A . , z > , w 3 » : z ) Subst for { <w,v,w1,w2>l [Vz:SubstCls] <w,v,w1,w2>:z} The next theorem expresses the basic properties of the substitution . The derivation of each sequent of the theorem envolves a straightforward application of the recursive definition of substitution and it is left as an exersise to the reader. 5.1.3.1 Theorem Chapter V: Lambda Calculus in NaDSet 87 The following sentences are derivable. (1) [Vw,u:Lterm] [ Vx:Lvar] [3v:Lterm]<u,x,w,v>:Subst (2) [Vw:Lterrn][Vu:CLterm][Vx:Lvar](x:!Free[w] 3 [3v:CLterm]<u,x,w,v>:Subst) (3) [Vw,v:Lterm][Vu:CLterm][Vx:Lvar](x:!Free[w] A <u,x,w,v>:Subst 3 v:CLterm) (4) [Vw:Lterm][Vx:Lvar]<x,x,w,w>:Subst (5) [Vw,u:Lterm][Vx:Lvar](~x:Free[w] 3 <u,x,w,w>:Subst) (6) [Vw,u,v:Lterm][Vx:Lvar](x:Free[w] A <u,x,w,v>Subst 3 [Vy:Lvar](y:Free[v] = y:Free[u] v (y:Free[w] A y*x))) (7) [Vw,w1,W2,w3,u,v,v1:Lterm][Vx,y:Lvar](-y:Free[w] A <y,x,w,Wj >Subst A <u,x,w,w2>Subst 3 <u,y,w1,w2>Subst) (8) [Vw,wpv:Ltenri][Vx,y:Lvar](--y:Free[w] A <y,x,w,Wj >Subst 3 <x,y,w1,w>Subst) (9) [Vw,w1,w2,w3,u,v,v1:Lterm][Vx,y:Lvar](-y:Free[w] A ^ y . W j W ^ S u b s t A <u,x,w,w2>Subst A <u,x,v,v1>Subst A <v1,y,w2,w3>Subst 3 <u,x,wpw3>Subst) (10) [Vw,w1,w2,w3,u,v,:Lterm][Vx,y:Lvar](-y:Free[u] A ~x:Free[v] A -cv.y.w.w^Subst A <u,x,w,w2>Subst A <v,y,w2,w3>Subst 3 <u,x,Wj,w3>Subst) (11) [Vw,w1,w2,w3,u,v,v1:Lterm][Vx:Lvar](<v,x,w,w1>Subst A -cu.x.v.v^Subst A <VpX,w,w 2>Subst 3 ^ .x.WpW^Subst) . In one of the following subsections another type of substitution is required as well. The term CSubst is like Subst with the difference that a constant rather than a variable is replaced by a term. It is given by the following term. CSubstCls for {z I [Vw:Lterm][Vc:Lcon]( [Vd:Lcon]((c=d 3 <w,c,d,w>:z) A (c#d 3 <w,c,d,d>:z)) A [Vx:Lvar] <w,c,x,x>:z A [Vw1,w2,w3,w4:Lterm]<w,c,w1,w2>:z A <W,C,W3,W4>:Z 3 < w , c , < w 1 , w 3 > , < w 2 , w 4 » : z Chapter V: Lambda Calculus in NaDSet 88 A [Vx:Lvar][Vw1,w2:Lterm](~x:Free[w] A <w,x,w1,w2>:z 3 < w , c , « A , , x > , w 1 > , « X , x > , w 2 » : z ) A [Vx:Lvar][VWpW2,w3:Lterm][Vy:FirstNotFree[<w,w1>] (x:Free[w] A <y,x,w1,w2>:z A <W,C,W2,W3>:Z 3 < w , c , « A , , x > , w 1 > , « A , , y > , w 3 » : z ) CSubst for {<w,c,w1,w2> I [Vz:CSubstCls]<w,c,w1,w2>:z} 5.1.3.2 Remark Several properties of the set CSubst that are analogous to the properties stated in the previous theorem are assumed to be derivable for the rest of the chapter. 5.1.4 Change of Bound Variables The bound variable variant terms are given by the following definition which also implies the subsequent lemma. BwCls for {z I [Vv:Lvar]<v,v>:z A [Vc:Lcon]<c,c>:z A [Vw1,w2,w3,w4:Wff](<w1,w2>:z A <w3,w4>:z 3 « w 1 , w 3 > , < w 2 , w 4 » : z ) A [Vx,y:Lvar][Vw1,w2,w3:Wff]( « < X . , x > , w 1 > , « X , x > , w 1 » : z ) A ( ~y:Free[Wj] A <y,x,w1,w2>:Subst A <W2,W3>:Z 3 « < X , x > , w 1 > , « X , y > , w 3 » : z ) } B w for {<wl5w2> I [Vz:BvvCls]<w1,w2>:z}. 5.1.4.1 Lemma The sentences (1) [Vx:Lvar ][Vw:Wff ](<x,w>:Bvv = w=x) (2) [Vc:Lcon ][Vw:Wff ](<c,w>:Bvv e W=C) (3) [ V w 1 , w 2 , w 3 : W f f ] ( « w 1 , w 2 > , w 3 > : B w = [3w4,w5:Wff](w3=<w4,w5> A <W15W4>:BVV A <W2,W5>:BVV )) (4) [ V x : L v a r ] [ V w 1 , w 2 : W f f ] ( « < X , x > , w 1 > , w 2 > : B w = Chapter V: Lambda Calculus in NaDSet 89 [3y :Lvar] [3 w 3 ,w 4 :Wffj ( w 2 = « X , y > , w4> A ~y:Free[Wj] A <y,x,w1,w3>:Subst A <W3,W4>:BVV )) are derivable. The next theorem, whose proof is also straightforward and is omitted, states some useful properties of the bound variable variant terms. 5.1.4.2 Theorem The following sequents are derivable. (1) [Vu,v:Wff ](<u,v>:Bw 3 [Vx:Lcon ](x:Free[u] = x:Free[v]) (2) [Vw:Wff ]<w,w>:Bw (3) [Vu,v:Wff ](<u,v>:Bw 3 <v,u>:Bw) (4) [Vw,u,v:Wff ](<w,u>:Bvv A <u,v>:Bw 3 <w,v>:Bvv) (5) [Vw 1 ,w 2 ,u 1 ,u 2 ,v 1 ,v 2 :Wff HVxtLvarJOcwpW^rBw A <U1,U2>:BVV A cupX.Wj.v^rSubst A <u2,x,w2,v2>:Subst 3 <v1,v2>:Bvv) The lambda conversion relation defined in this section is the Xpn-conversion (or X$r\ formal theory) presented in chapter six of [Hindley&Seldin86]. 5.2 T H E L A M B D A C O N V E R S I O N CnvCls for (z I [Vw:Lterm]<w,w>:z (1) (2) (3) A [Vw,u:Lterm]<w,u>:z 3 <u,w>:z A [Vw,u,v:Lterm](<w,u>:z A <U,V>:Z 3 <w,v>:z) A [Vw,u:Lterm][Vx,y:Lvar]( ~y:Free[w] A <y,x,w,u>:Subst 3 < « X , x > , w > , « X , y > , u » : z ) A [Vw,u,v:Lterm][Vx:Lvar](<u,x,w,v>:Subst (4) 3 « « X , x > , w > , u > , v > : z ) A [Vw:Lterm][Vx:Lvar]( ~x:Free[w] (5) 3 « < A , , x > , < w , x » , w > : z ) A [Vw,u,v:Lterm](<u,v>:z 3 « w , u > , < w , v » : z ) A [Vw,u,v:Lterm](<w,u>:z 3 « w , v > , < u , v » : z ) A [Vw,u:Lterm][Vx:Lvar](<w,u>:z (6) (7) (8) Chapter V: Lambda Calculus in NaDSet 90 3 « < X , x > , w > , « X , x > , u » : z ) } (9) Cnv for {<w,v> I [Vz:CnvCls]<w,v>:z } Some useful properties of Cnv that are direct consequences of its definition are listed in the next lemma. 5.2.1. Lemma The sentences (1) [Vw:Lterm]<w,w>:Cnv (2) [Vw,u:Lterm](<w,u>:Cnv z> <u,w>Cnv) (3) [Vw,u,v:Lterm](<w,u>:Cnv A <u,v>:Cnv 3 <w,v>Cnv) (4) [Vw,u:Lterm](<w,u>:Bw 3 <w,u>:Cnv) (5) [Vw,u,v:Lterm][Vx:Lvar](<u,x,w,v>:Subst 3 < « < & , x > , w > , u > , v > : C n v ) (6) [VwLterm][Vx:Lvar](~x:Free[w] 3 « < X , x > , < w , x » , w > : C n v ) (7) [Vw,u,v:Lterm](<u,v>:Cnv 3 « w , u > , < w , v » : C n v ) (8) [Vw,u,v:Lterm](<w,u>:Cnv 3 « w , v > , < u , v » : C n v ) (9) [Vw,u:Lterm][Vx:Lvar](<w,u>:Cnv 3 <<<A.,x>,w>,<<X,x>,u>>:Cnv) are derivable. Proof of lemma 5.2.1 The derivations of the sentences are similar. Only a derivation of (3) is given as an illustration. In this derivation Z is a second order parameter while u,v,w are used as first order parameters as well as variables bound by quantifiers. <u,w>:Z -» <u,w>:Z <w,v>:Z -> <w,v>:Z <u,v>:Z -» <u,v>:Z *(<u,w>:Z A <w,v>:Z 3 <u,v>Z), <u,w>:Z, <w,v>:Z -» <u,v>:Z u:Lterm -» u:Lterm w:Lterm -> w:Lterm v:Lterm -» v:Lterm w:Lterm, v:Lterm, u:Lterm, Chapter V: Lambda Calculus in NaDSet 91 *[Vw,u,v:Lterm](<w,u>:Z A <U , V > : Z => <w,v>Z), <u,w>:Z, <w,v>:Z -» <u,v>:Z w:Lterm, v:Lterm, urLterm, *Z:CnvCls, thinning <u,w>:Z, <w,v>:Z -> <u,v>:Z ZrCnvCls -» Z:CnvCls w:Lterm, v:Lterm, u:Lterm, Z:CnvCls, <u,w>:Z, *[Vz:CnvCls]<w,v>:z -» <u,v>:Z Z:CnvCls -> ZrCnvCls w:Lterm, v:Lterm, u:Lterm, Z:CnvCls, *[Vz:CnvCls]<u,w>:z, [Vz:CnvCls]<w,v>:z -> <u,v>:Z w:Lterm, v:Lterm, u:Lterm, [Vz:CnvCls]<u,w>:z, [Vz:CnvCls]<w,v>:z -> *[Vs:CnvCls]<u,v>:z w:Lterm, v:Lterm, u:Lterm, *<u,w>:Cnv, *<w,v>:Cnv -> *<u,v>:Cnv -» [Vw,v,u:Lterm](<u,w>:Cnv A <w,v>:Cnv 3 <u,v>:Cnv) End of proof of lemma 5.2.1 5.3 A T E R M M O D E L Intuitively, a structure is a model of the Xpn formal theory if it satisfies the theory. More precisely, a model should consist of a collection of individuals D, an interpretation function I mapping each term in the formal language to an element of D and a relation = that interprets the conversion relation. Model for {<D,=,I> I [Vw:Lterm][3a:D](<w,a>:I A [Vb:D](<w,b>:13 a=b)) A [Vw,v:Lterm][Va,b:D](<w,a>:I A <v,b>:I A <w,v>:Cnv 3 a=b) } The simplest model of the theory is the model defined in [Church41] in which D is the quotient of Lterm by Cnv and is known by the name 'term model'. Formally, the term model is the structure <D,«,I> where the terms D , » , I are defined as follows. Chapter V: Lambda Calculus in NaDSet 92 For each Lterm w, its equivalence class under Cnv is defined as [w] for {x I <x,w>:Cnv }, and the domain D is then defined to be the set of the equivalent classes of the terms. D for {[w] I w:Lterm }. » i s the extentional identity over D « for {<x,y> I [Vu:Lterm](u:x = u:y)} and the interpretation I maps each term to its equivalent class I for {<v,[w]> I <v,w>:Cnv}. The relation « as defined has the property that two elements of D are related through « i f f their representatives converge to each other. This property is expressed in the following lemma and is extensively used in the subsequent sections of this chapter. 5.3.1. Lemma The sentence [Vw,v:Lterm]([w]«[v] = <w,v>:Cnv) is derivable. Proof of lemma 5.3.1 A derivation of the lemma follows from the derivations of the sequents (a) w:Lterm, v:Lterm, [w]»[v] -> <w,v>:Cnv (b) w:Lterm, v:Lterm, <w,v>:Cnv -> [w]=[v] where w, v are first order parameters. Their derivations follow. A derivation of (a): w:Lterm, v:Lterm, <w,v>:Cnv -» <w,v>:Cnv w:Lterm, v:Lterm, *w:[v] -» <w,v>:Cnv w:Lterm -» w:[w] w:Lterm, v:Lterm, *(w:[w] -» <w,v>:Cnv w:Lterm -» w:Lterm Sw:[v]) Chapter V: Lambda Calculus in NaDSet 93 w:Lterm, v:Lterm, *[Vu:Lterm](u:[w] = u:[v]) -» <w,v>:Cnv w:Lterm, v:Lterm, *[w]=[v] -» <w,v>:Cnv A derivation of (b): The first sequent in this derivation is a consequence of theorem 5.2.1. w:Lterm, v:Lterm, u:Lterm, <w,v>:Cnv, <u,w>:Cnv -» <u,v>:Cnv w:Lterm, v:Lterm, u:Lterm, <w,v>:Cnv, *u:[w] -» *u:[v] w:Lterm, v:Lterm, u:Lterm, <w,v>:Cnv, similarly u:[v] -» u:[w] w:Lterm, v:Lterm, u:Lterm, <w,v>:Cnv -> *(u:[w] s u:[v]) w:Lterm, v:Lterm, <w,v>:Cnv -» *[Vu:Lterm](u:[w] = u:[v]) w:Lterm, v:Lterm, <w,v>:Cnv -> *[w]«[v] E n d of proof of lemma 5.3.1 In the rest of this chapter lemma 5.3.1 is tacitly used as an alternative definition of the set term » . The following theorem shows that the structure <D,«,I> is indeed a model of the X$r\ formal theory. 5.3.2. Theorem The sequent -> <D,»J>:Model is derivable. Proof of theorem 5.3.2 A derivation of the theorem's sequent can be obtained from the derivations of the sequents (a) -> [Vw:Lterm][3a:D](<w,a>:I A [Vb:D](<w,b>:13 a~b)) (b) -> [Vw,v:Ltenn][Va,b:0](<w,a>:I A <v,b>:I A <w,v>:Cnv 3 a«b) by an application of - » { } followed by an application of ->A . Derivation of (a) and (b) are Chapter V: Lambda Calculus in NaDSet 94 given next. A derivation of (a): In this derivation sequent (i) is a direct consequence of lemma 5.2.1 while sequents (ii) and (iii) are direct consequents of lemma 5.3.1. (i) w:Lterm, b:Lterm, <b,w>:Cnv -» <w,b>:Cnv (ii) w:Lterm, b:Lterm, <w,b>:Cnv -> [w]«[b] cut wrLterm, b:Lterm, <b,w>:Cnv -> [w]«[b] (iii) w:Lterm, b:Lterm, [b]»[w] -> <b,w>:Cnv cut w:Lterm, b:Lterm, [b]«[w] -> [w]«[b] w:Lterm, *[b]:D, [b]«[w] -» [w]«[b] wrLterm, [b]:D, *<w,[b]>:I-» [w]*[b] w:Lterm, [b]:B-> *(<w,[b]>:13 [w]«[b]) w:Lterm -> *[Vb:D](<w,b>:13 [w]«b) w:Lterm -» <w,[w]>:I w:Lterm -> *(<w,[w]>:I A [Vb:D](<w,b>:13 [w]«b)) w:Lterm -> [w]:D w:Lterm -> *[3a:B](<w,a>:I A [Vb:D](<w,b>:13 a«b)) -> *[Vw:Lterm][3a:0](<w,a>:I A [Vb:D](<w,b>:13 a«b)) A derivation of (b): The sequents in the derivation that are marked by a (*) are direct consequence of lemma 5.2.1. (*) w:Lterm, v:Lterm, p:Lterm, q:Lterm, <p,v>:Cnv, <v,q>:Cnv -» <p,q>:Cnv (*) w:Lterm, v:Lterm, p:Lterm, <p,w>:Cnv, <w,v>:Cnv -> <p,v>:Cnv cut Chapter V: Lambda Calculus in NaDSet 95 w:Lterm, v:Lterm, p:Lterm, q:Lterm, <p,w>:Cnv, <v,q>:Cnv, <w,v>:Cnv -» <p,q>:Cnv (*) w:Lterm, p:Lterm, <w,p>:Cnv -> <p,w>:Cnv cut w:Lterm, vrLterm, p:Lterm, q:Lterm, <w,p>:Cnv, <v,q>:Cnv, <w,v>:Cnv -» <p,q>:Cnv w:Lterm, vrLterm, *[p]:D, [*q]:D, *<w,[p]>:I, *<v,[q]>:I, <w,v>:Cnv -» [p]«[q] w:Lterm, v:Lterm, [a]:D, [b]:D -» *(<w,[p]>:I A <v,[q]>:I A <w,v>:Cnv 3 [p]«[q]) w:Lterm, v:Lterm, -> *[Va,b:D](<w,a>:I A <v,b>:I A <w,v>:Cnv 3 a~b) -» *[Vw,v:Lterm][Va,b:D](<w,a>:I A <v,b>:I A <w,v>:Cnv 3 a«b) E n d of proof of theorem 5.3.2 5.4. V A R I A B L E A S S I G N M E N T S A N D T i - M O D E L S The type of models defined in the previous subsection are such that each model defines exactly one interpretation of the lambda terms; no provision for variable assignments— variable valuations or environments— was made by this definition. A more involved definition of the models of the Xpn-theory is given in this section. The notion of a variable assignment is needed first. The set of assignments with respect to a domain D with identity relation ~ can be defined as Asgn[D,=] for {g I [Vx:Lvar][3d:D](<x,d>:g A [ V d ^ D K ^ d j >:g 3 d^d)) }. New assignments can be defined from a given one with the help of parameterized definitions. More specifically, if g is an assignment, v a variable and d any element of D, [d/v]g is an assignment identical to g except it assignes d to v [d/v]g for { <x,y> I (x^v A <x,y>:g) v (x=v A y=d)}. For any (fixed) n, [d 1 /v 1 ,d 2 /v 2 , ... >d n/v„]g is defined similarly. The following lemma Chapter V: Lambda Calculus in NaDSet 96 insures that the new assignment [d/v]g is a legitimate variable assignment if g itself is such. Its proof is nearly elementary and it is omitted. 5.4.1 Lemma The sentence [VD~][Vg:Asgn[D~]][Vv:Lvar][Vd:D]([d/v]g:Asgn[D~]) is derivable. A n interpretation of the theory , called X-Interpretation, is a tuple <D,=,»,I,g> where D is the domain, = is an identity on D, • is a binary operation on D and I is the interpretation map defined in terms of the variable assignment g: Xlnt for {<D,=,»,I,g> I LIAxioms[D,=v,I,g] } where LIAxioms[D,=,« ,I ,g] is the conjunction of the following sentences. The usual abbreviation <w,d>:I[g] for < g , < w , d » : I is used. Informally, this notation means that d is the denotation assigned to w by the interpretation I and the assignment g. g is a variable assignment with respect to D g:Asgn[D,=] (1) ~ is identity in D [Va:D]a-a [ V a , b : D ] ( a - b D b - a ) [Va,b,c:D](a=b A b~c z> a~c) [Va,b,c,d:D](<a,b,c>:« Aa=d=> <d,b,c>:») [Va,b,c,d:D](<a,b,c>:» A b=d z> <a ,d,c>:») [Va,b,c,d:D](<a,b,c>:» A c=d z> <a,b,d>:») [Vw:Lterm][Va,b:D](<w,a>:I[g] A a=b 3 <w,b>:I[g]) (2) (3) (4) (5) (6) (7) (8) (D.*) is an applicative structure [Va,b:D][3c:D](<a,b,c>:» A [Vd:D](<a,b,d>:- 3 c-d)) (9) I is an interpretation [Vw:Lterm][3a:D](<w,a>:I[g] A [Vb:D](<w,b>:I[g] 3 a=b)) [Vx:Lvar][Va,b:D]( <x,a>:g A <x,b>:I[g] 3 a=b) (10) (11) Chapter V: Lambda Calculus in NaDSet 97 [Vw1,w2:Lterm][Va,b,c:D](<w1,b>:I[g] A <w2,c>:I[g] A «w1,w2>,c>:I[g] => <a,b,c>:») (12) [Vw:Lterm][Vx:Lvar] [Va,b,c:D](<<<A.,x>,w>,a>:I[g] A <w,o:I[[b/x]g] 3 <a,b,c> :») (13) [Ve1,e2:Asgn[D,==]][Vx:Lvar][Vw:Lterm][Va:D]( [Vx:Free[w]][Vc:D](<x,o:e1 = <x,c>:e2) A <w,a>:I[e1 ] A <w,b>:I[e2] -> a=b) (14) [Vx j ,x2:Lvar] [ Vwj ,w2:Lterm] [Va,b:D] ( «<A,,x1>,w1>,a>:I[g] A ~x2:Free[w1] A <x2,x1,w1,w2>:Sub A «<X,x 2>,w 2>,b>:I[g] 3 a=b) (15) [Vw:Lterm][Vx:Lvar] [Va,b,c:D](-x:Free[w] A <«A.,x>,<w,x»,a>:I[g] A <w,b>:I[g] z> a=b) (16) [Vx:Lvar][Vw1,w2:Lterm][Vb,c: <w,c>:I[[b/x]g] ]( [Va1,a2,d:D](<w1,a1>:I[[a7x]g] A <w2,a2>:I[[d/x]g] 3 a ^ a ^ A <«X,x>,Wj>,b>:I[g] A «<X,x>,w 2>,c>:I[g] 3 b=c)) (17) A model of the theory , called XModel, is a structure <D,=,»,I> where I is an interpretation map with respect to any variable assignment: AModel for {<D «,•,!> I [Vg:Asgn[D,=]]LIAxioms[D,=,»,I,g]}. The definition of XModel presented here is a NaDSet version of definition 11.3 of [Hindley&Seldin86] with the following additions. Clauses (1) to (8) and clause (10) are not present in definition 11.3. This group of sentences deals with the identity = on D and the functionality of I, notions that are implicitly used in any proof presented in section 11 of [Hindley&Seldin86]. NaDSet as a formal theory does not enjoy such a luxury; a complete definition is necessary to carry out its derivations. Finally, clause (16) correcponds to the Tj-rule and is not present in 11.3 which defines the models of the Xp-theory. To show that the previously defined term model is a A-model, suitable definitions of the operation ° and interpretation I' must be provided. On that account, 0 is defined by ° for {<[u],[v],[w]> I « u , v > , w > : C n v } Chapter V: Lambda Calculus in NaDSet 98 and for any assignment g in Asgn[B,»], I[g] is defined as follows: I'[g] for {<u,[v]> I <u,v>:ASubst[g] } where <u,v>:ASubst[g] if v is the result of simultaneously substituting every free variable x in the term u by the value w whenever the assignment g assigns [w] to x. ASubstCls[g] for (z I [Vc:Lcon]<c,c>:z A [Vx:Lvar][Vv:Lterm](<x,[v]>:g3 <x,v>:z) A [Vw1,w2,v1,v2:Lterm](<w1,v1>:z A <w2,v2>:z 3 « w 1 , w 2 > , < v 1 , v 2 » : z ) A [Vx,y:Lvar][Vw,wlsw2,W3:Lterm][Vc:Lcon](-c:Coccur[w] A~y:Free[w] A [Vu:Free[w]][Vv:Lterm](<u,[v]>:g => (~c:Coccur[v] A -y:Free[v])) A <c,x,w,Wj >:Subst A <w1,w2>:z A <y,c,w2,w3>:CSubst 3 < « A , , x > , w > , « X , , y > , w 3 » : : z ) } ASubst[g] for {<w,v> I [Vz:ASubstCls[g]]<w,v>:z } For convenience, the abbreviation ASubst[w,g] for {v I <w,v>:ASubst[g]} will be used in the following lemma which is a direct consequence of the previous definition and its proof is omitted. 5.4.2. Lemma The sentences (1) [Vg:Asgn[D,«]][Vc:Lcon]( ASubst[c,g] = , {v I v=c} (2) [Vg:Asgn[D,«]][Vx:Lvar]( ASubst[x,g] =e {v I <x,[v]>:g} (3) . [Vg:Asgn[D ,«]][Vw pw 2 :Lterm]( ASubst[<w1,w2>,g] =e {v I [3v1,v2:Lterm](<w1,v1>:ASubst[g] A <w2,v2>:ASubst[g] A v=<vpv2>)} (4) [Vg:Asgn[D,«]][Vx:Lvar][Vw:Lterm]( ASubst[«X,x>,w>,g] =e {v I [3y:Lvar][3w1:Lterm]( ~y:Free[w] A [Vu:Free[w]][Vv:Lterm](<u,[v]>:g 3 ~y:Free[v]) A <w,w1>:ASubst[[[y]/x]g] A v = « X , x > , w 1 > ) } Chapter V: Lambda Calculus in NaDSet 99 are derivable. Some additional properties of the assignment related substitution (ASubst) which will be used in this chapter, are given by the following lemma whose proof is given in appendix F. 5.4.3. Lemma The sentences (1) [Vg: Asgn [D,«] [Vw.Wj ,w2:Lterm] (<w,w1>: ASubst [g] A <w,w2>:ASubst[g] z> <wl5w2>:Bvv) (2) [VgrAsgntDHltVxrLvarJtVw^pViLtermK-xiFreetw] A <w,w1>:ASubst[g] => <w,Wj >:ASubst[[[v]/x]g]) £3) [Vg:Asgn[D,«]][Vx,y:Lvar][Vw,u,v,w 1 ,v 1 ,u 1 :Lterm](-y:Free[w] A [Vu2:Free[w]][Vv2:Lterm](<u2,[v2]>:g => -y:Free[v2]) A <u,x,w,v>:Subst A ^ . v ^ A S u b s t t g ] A <w,w1>:ASubst[[[y]/x]g] A "Cu^xASubsttg] ZD •cupy.WpVjXSubst) (4) [Vg:Asgn[D,«]][Vx,y 1,y 2:Lvar][Vw,v,u:Lterm](-y 1:Free[w] A -y^Freetw] A <w,v>:ASubst[[[y1]/x]g] A -y2:Free[v] A -y2:Free[v] A <y2,yj,v,u>:Subst 3 <w,u>:ASubst[[[y2]/x]g] (5) [Vg:Asgn[D,«]][Vx:Lvar][Vw,v,w 1,v 1:Lterm][Va,b:Lterm](<w,w 1>:ASubst[g] A ^VjXASubsttg] A <w,v>:Cnv => <w1,v1>:Cnv) are derivable. The main theorem of this section states that the term model <D,»>, supplied with the operation ° and the mapping I', becomes a XModel. 5.4.4. Theorem The sequent -» <D,«,°,I'>:XModel is derivable. Proof Outline Let LIAxiom^[D,=,»,I,g], l<i<17, be the i-th sentence in the definition of the ^-interpretation. Chapter V: Lambda Calculus in NaDSet 100 It is sufficient to show that for each i , l<i<17, the sequent g:Asgn[D,»] -> LIAxiom^D^.oJ'] where g is a second order parameter, is derivable. The cases for i=9,ll, 13, 17 are presented in appendix G. The other cases are either similar or simpler than these and are omitted. E n d of Proof 5.5. S C O T T - M E Y E R M O D E L S A simple characterization of the models of the xp-theory that does not make any reference to the interpretation of the X-terms implied by the model, is due to Dana Scott [Scott80b] and Albert Meyer [Meyer82]. Following [Hindley&Seldin86] a strict Scott-Meyer model is given by the following definition. StrictSMModel for {<D, =,»,e> I SMAxioms[D,=,«,e] } where SMAxioms[D,=,»,e] is the conjunction of the following sentences: ~ is identity on D [Va:D]a=a [Va,b:D](a=b 3 b=a) [Va,b,c:D](a=b A b=c 3 a=c) [Va,b,c,d:D](<a,b,c>:» A a = d 3 <d,b,c>:») [Va,b,c,d:D](<a,b,c>:» A b=d 3 <a,d,c>:») [Va,b,c,d:D](<a,b,c>:» AC=(1D <a,b,d>:») (1) (2) (3) (4) (5) (6) (T).*) is an applicative structure [Va,b:D][3c:D](<a,b,c>:« A [Vd:D](<a,b,d>:» 3 c=d)) (7) (D.«) is combinatorially complete [3k:D][Va,b,ka,kab:D](<k,a,ka>:» 3 <ka,b,a>:») [3s:D][Va,b,c,sa,sab,sabc,ac,bc:D](<s,a,sa>:« A <sa,b,sab>:» A <sab,c,sabc>:» A <a,c,ac>:» A <b,c,bc>:» 3 <ac,bc,sabc>:») (8) (9) Chapter V: Lambda Calculus in NaDSet 101 e is a strict representation of the mapping A e:D [Va,b,ea,eab:D](<e,a,ea>:« A <ea,b,eab>:» => <a,b,eab>:») [Va,b,ea:D]( [Vd,ad:D](<a,d,ad>:« 3 <b,d,ad>:») (10) (11) A <e,a,ea>:» => <e,b,ea>:») (12) (13) <e,e,e>:» A Scott-Meyer model is a loose Scott-Meyer model if it does not necessarily satisfy sentence (13): that is, the element e of D may not be a 'fixed point' of •. We now can show that the term model defined in the previous section is also a strict Scott-Meyer model. The definitions for the operation ° was also given in the previous section; the element e is defined to be the equivalence class of the term Xxky.xy : e for [«X,x>,«X,y>,<x,y>»] where x, y are the NaDSet terms that represent the natural numbers 2 and 4 respectively. The next theorem states that the structure <D,«,°,e> is a restricted Scott-Meyer model. 5.5.1. Theorem The sequent -> <D,«,°,e>:StrictSMModel is derivable. Proof Outline Let SMAxiom^[D,=,»,e], l<i<13, be the i-th sentence in the definition of the SM-model. It is sufficient to show that for each i, l<i<13, the sequent -> SMAxiomj[D,«,°,e] is derivable. The cases for i=8, 9 and 13 are presented in appendix H . Cases (1) to (7) are the same as in theorem 5.4.4 while the rest are similar (even simpler) to case (13) and are omitted. The important terms in this proof are the eigenterms for k and s in the cases of sentences (8) and (9). The term [<<X,x>,<<X,y>,x>>] is used as an eigenterm for k and [ « X , x > , « A , , y > , « X , z > , « x , z > , < x , z > » » ] is used for s, where x, X and z are the NaDSet terms that represent the natural numbers 2, 4 and 6 respectively. Finally, the case (13) is the only case that requires the n-conversion rule given by the sixth sentence in the definition of the conversion (CnvCls). E n d of Proof Chapter V: Lambda Calculus in NaDSet 102 We conclude the presentation of lambda calculus in NaDSet with some remarks. First, it should be emphasized that the success in defining abstract models of the lambda calculus in this chapter does not necessarily imply that concrete models of the theory can also be defined in the same way. More work is needed in this area. It will be interesting to see whether constructions like Scott's D ^ model [Scott70,73] and Plotkin's T w model [Plotkin78], can be carried out in NaDSet. Finally, the ideas expressed in this chaprer can be used to provide a NaDSet representation of the theory of typed lambda calculus or other formal theories. Specifically, any axiomatic first order theory can be represented within NaDSet in a similar way. Section 8 of [Gilmore89], for instance, defines the set of structures that satisfy the axioms of Godel-Bernays set theory by the term GBST for {<Cls,M,e> I ajrioms.} where axioms are the NaDSet sentences corresponding to the axioms of the original set theory. Chapter VI: Conclusion 103 CHAPTER VI Conclusion and Future Directions Traditional set theories, in order to avoid the paradoxes, restrict abstraction to apply only to collections existing in a cumulative hierarchy of sets. Such a restriction on abstraction, disallows self application (or self reference except through Godelization) and complicates their proof theory. Theories like the type-free lambda calculi, on the other hand, allow unrestricted abstraction but, they do not provide for quantifiers or logical connectives. A third type of theory, like typed lambda calculus and L C F , restrict both, abstraction and quantification, by imposing well-typedness constraints. However, both unrestricted abstraction and general (untyped) quantification, are essential to some applications. Certain conclusions in mathematics, like "the set of all categories is itself a category", cannot be directly expressed within a language that does not admit self-referential abstraction terms and quantification. Similarly, certain arguments about the semantics of interesting programming languages cannot be formulated in a system not strong enough to handle all three logical concepts without (the previous) restrictions. This thesis has demonstrated that Gilmore's Natural Deduction Set Theory is a logic suitable for such demanding applications. NaDSet combines unrestricted generalized abstraction terms with general untyped quantifiers in a sequent calculus system that naturally blends Tarskian semantics with the Frege-Russell logistic view. Exploiting these features a formalization of the basic concepts of category theory has been provided. The set of all categories, furnished with the appropriate structure, was shown to be a category by itself. As a result of such Chapter VI: Conclusion 104 formalization the distinction between small and large categories is no longer necessary as it is in formalizations of category theory within the traditional set theories. In addition, more general notions of categorical completeness and the category of sets can be defined within this formalization, although this has not been thoroughly explored in the thesis. It is our conjecture that other concepts in category theory that depend upon an underlying set theory can enjoy similar generalizations within NaDSet. Moreover, we believe that the category of categories, as it is defined in chapter III, can be shown to be small-complete but it can not be shown to be complete in the general sense. NaDSet's restriction on the axioms would not permit a derivation of the latter. Substantial evidence of the suitability of the logic in the realm of programming language semantics has also been provided. The syntax and the semantics of a simple programming language were defined within NaDSet and a variety of properties have been shown to be derivable from the definitions. Nondeterministic constructs of the language were shown to enjoy the same semantic treatment in NaDSet as their deterministic counterparts do. Moreover, the given proof of the semantic equivalence of two sequences of commands illustrates the power of NaDSet in formalizing recursive definitions. Such definitions are complete within NaDSet in the sense that the properties of the sets defined by them can be deduced from the definitions alone without the need of extra rules or axioms. The type of semantics obtained through such definitions are called formal semantics of programming languages for the following two reasons. The semantics is expressed within a formal theory in which the programming language itself has also been defined. The existence of a proof procedure and the completeness of the semantic definitions in the theory imply that most (depending on the completeness of the proof procedure) of the semantic properties of the programming languages can be derived within the same formalism from the definitions alone. The latter distinguishes this type of semantics from the traditional denotational semantics. We contemplate to investigate in the future how these ideas can be extended to define semantics for more complicated programming language features like escapes and jumps, procedures and functions, declaration and data types. The standard approaches [Stoy77, Gordon79] of continuation semantics can be used in defining semantics of such constructs in NaDSet as well, but other possibilities of more natural semantics should also be explored. By taking further advantage of NaDSet's complete recursive definitions, a way of defining a Chapter VI: Conclusion 105 formal theory in NaDSet was also demonstrated. Recursive definitions for the syntax, the proof procedure and the models of lambda calculus was provided. To show that a considerable part of lambda calculus model theory can be carried out within this formalism, Church's term model was defined and shown to satisfy the definitions of a model. This, of course, does not imply that any model of the theory can be defined in NaDSet in a similar way. We are currently investigating ways in which more complicated model constractions, like Scott's D ^ construction can be carried out within NaDSet. There are two general aspects of the applications considered in the thesis which, although they have not been emphasized up to this point, should not be overlooked. First, every definition of any concept in each of the three areas of exposition is coherent and natural in the sense that it is defined the same way the concept is usually defined in mathematics. Similar remarks can be made for the formal proofs of the lemmas and theorems: their derivations reflect the usual informal proofs but, they contain more details. Second, the definitions used in each of the three areas do not have any existential import for the theory NaDSet; they do not have any impact on the models of the theory. The inclusion of an inconsistent definition does not cause any problem other than the concern that the term it defines is empty. However, the success of NaDSet in the three disparate areas considered in the thesis must be attributed to the features that distinguish NaDSet from the other conventional set theories; they can be summarized as following. NaDSet resolves the paradoxes of the set theory by replacing the naive compehension axiom scheme of an inconsistent first order set theory with natural deduction rules that introduce abstraction terms into arguments. Generalized set abstraction terms of the form {talF} in which ta may be a term, not just a single variable, and F may be any formula, are admitted. A nominalist interpretation of atomic formulas is used: Only the name of a set, not the set itself, can be a member of another set. To avoid confusions of use and mention, it is necessary that NaDSet be a second order logic, although only a single kind of quantifier and variable is required. As a result, the theory is mainly concerned not with what sets may correctly exist but with what arguments are correct. Self-referencing set terms can be formed in NaDSet but certain contradictory arguments involving that type of terms are not derivable within the logic. It would be of great significance to computer scientists, if the logic's proof procedure were automated. Because of the sequent calculus presentation of the theory, Bibel's connection method [Bibel87] can be extended to provide an automated proof procedure for NaDSet. Chapter VI: Conclusion 106 However, the unification procedure has, in this case, to cope with NaDSet's second order unification which is undecidable, in general. The procedure and ideas of [Huet75] on X-term unification can be extended to NaDSet terms but, a semi-automated theorem proving system for NaDSet is deemed more feasible, for the time being. We believe an interactive system similar to H O L [Gordon87] can be developed for NaDSet. H O L is a version of Milner's [Milner72] theorem proving system for L C F and is designed in a Lisp-like meta-language called M L . Deduction rules are expressed as functions in M L . H O L permits a proof to be constructed backwards from the goal, the sentence to be proved, by means of tactics and tacticals. A tactic is a function that reduces a goal to zero or more subgoals while a tactical operates on tactics themselves. When all the subgoals of a goal have been solved, the original goal becomes a theorem (it can be used again without a proof). Tactics and tacticals are M L functions and comprise a powerful control language through which the user interacts with the system. A proof is therefore the result of cooperation between H O L and its user; the user defines the tacticals and the system executes them until every subgoal of the initial goal is proved. We anticipate that a similar interactive, cooperating theorem proving system can be developed for the logic NaDSet. An alternative is to use Paulson's generic theorem prover, Isabelle [Paulson88]. For the time being it is not clear what extensions are necessary to accommodate NaDSet in Isabelle but in any case the resulting system is expected to be less efficient than the system resulting from the first approach. The rest of this section discusses some prehminary ideas about the use of NaDSet in other areas of computer science. First, in the case of sequential programs, the ideas developed for the domain of programming language semantics can be extended to the area of program specification and verification. Our conjecture is that Hoare axiomatic method [Hoare69] and Dijkstra's predicate transformers and weakest precondition semantics [Dijkstra76] for a programming language can be derived from the formal semantics of the language. In the realm of concurrent programs, it has to be seen how the ideas discussed in [Hailpern&Owicki83, Manna&Pnueli81,Tsiknis85,Cardell89] can also developed in NaDSet. Obviously, any temporal logic system of linear or branching time [Manna&Pnueli81] can be expressed in NaDSet. However, it may be preferable to directly define in NaDSet the semantics of a system of communicating processes in terms of the possible event sequences and express the properties of the program in terms of these sequents instead of going through the temporal logic development. Chapter VI: Conclusion 107 The concepts of data types and polymorphic operations pose some important issues for the semantics of modern programming languages. The presence of polymorphism demands abstractions over types as was recognized independently by Girard and Reynolds. In addition [Reynolds84] shows that a non-trivial interpretation of polymorphic types in the standard (founded on the axioms of Zermelo-Fraenkel theory) category of sets is impossible. However, [Freyd&Scedrov87] reports (without an explicit reference) that Moggi and Hyland have recently shown that such an interpretation is possible within a category of (intuitionistic) sets that is constructed using toposes [Hyland82]. ([Lambek&Scott86] shows the connection between toposes and intuitionistic type theory). We believe that a comprehensive treatment of types and polymorphism is possible within NaDSet. We currently investigate ways in which types are represented by certain set terms the collection of whom is also definable within the logic. The latter might provide a simple and general treatment for polymorphism but this has yet to be seen. Nontheless, a formalization of data types and polymorphism is a challenging undertaking for NaDSet. In 1985 Mike Gordon gave a comprehensive illustration of the use of higher order concepts in the specification and verification of hardware components [Gordon85]. Since then, a variety of approaches has been developed and a considerable number of component designs have been verified using the H O L system [Joyce88,89, Melham87,88, Herbert88]. In [Joyce88] for instance, a complete microprocessor has been specified and verified in H O L . We believe NaDSet can be used equally well as a hardware specification and verification formalism. Moreover, NaDSet's relational character might turn out to be advantageous, especially for analog components where ranges of values, rather than single values, are of interest. In any case, it is interesting to see that NaDSet's parameterized definitions can help in applying Joyce's ideas of parameterized specifications [Joyce88]. The need of high order features in logic programming has been recognized from the early days of the design of the language Prolog. The inclusion of the predicate "call" in Prolog was a strong manifestation of such a need. Later, the semantic difficulties associated with this predicate instigated new approaches like the Lambda Prolog [Miller&Nadathur86] and HILog [Chen et al.89]. Andrews in [Andrews90] gives a simple extension to logic programming using the first order version of NaDSet [Gilmore86]. Although such extension is sufficient to allow predicate names as parameters, the use of the current second order version of NaDSet can provide for complete predicate definitions and, hopefully, comprehensible semantics. We also Chapter VI: Conclusion 108 believe that such an extension can use the evaluation (or computation) techniqes established for the existing languages when the set definitions succumb to certain restrictions. Restricting the form of the definitions is just one way to overcome the undecidability of the second order unification; other ways need to be investigated as well. In the area of knowledge representation and reasoning, NaDSet can perform fairly well especially in the cases where many levels of abstraction are necessary. To this end, a number of representation techniques like frames[Minsky75], inheritance systems [Etherington&Reiter83, Touretzky86], and semantic networks [Sowa84] can be expressed in NaDSet in a straightforward way and the techniques described in [Gilmore87a,87b,87c,87d,88] can help in these cases. However, some of the problems associated with the original approaches (frame problem etc.) may get carried over. In the general case of nonmonotonic reasoning we need to distinguish the following paradigms. In the Theorist framework [Pool88a,88b,89a,89b], NaDSet can be used the same way as any other formal logic; it is the domain of the application that will determine whether the advance features of NaDSet are necessary or advantageous in this case. The same remarks are also appropriate for the case of default reasoning [Reiter80]. The case of circumscription [McCarthy80], on the other hand, seems different, although it exhibits many semantic similarities to the previous approaches. Usually, the circumscription formula is a second order formula and can be naturally defined in NaDSet by a recursive definition of the type used in chapter IV. Moreover, the proof procedure of the logic and the guidelines discussed in that chapter provide a comprehensive proof strategy for circumscription. However, it remains to be seen what advantages (of the type discussed in section 4.1) such definitions can offer in this case and whether this treatment can lead to better algorithms for computing with this type of representation framework. Finally, in cognitive science the representation of notions such as beliefs requires a formalism that admits a truth predicate and provides the means for defining a quotation mechanism (that assigns a term (name) to a sentence). Section 5.5 of [Gilmore90] gives a simple way to define them in NaDSet. According to it, the term "S" that represents a sentence S is defined: "S" for {ulS} where u has no free occurences in S, and the truth predicate T is given by the definition T for {z I [Vu]u:z} . Kripke's ideas, [Kripke75], that only grounded sentences can be assigned truth values, is reflected by the following derived rule: S->S Chapter VI: Conclusion 109 -> "S":T = S Let's assume for a moment that the following definition were admissible L for ~"L":T then L would be the famous liar sentence. L is not derivable because it is not grounded as the following segment of a derivation, in which p is any parameter and t is any term, shows: ->L ->p:"L" -> [Vu]u:"L" -> "L":T ~"L":T -> L-> t:"L" -> [Vu]u:"L" -> "L":T -> - 4 ~"L":T ->L This formulation gives a simpler, more comprehensive formalization of Tarski and Kripke ideas than the axiomatization of [Perlis85]. However, more effort is needed to develop within the theory a quotation mechanism that provides for fixed points of the type needed in the liar formula case. As a final remark we point out that although the ideas discussed in this section are very sketchy and preliminary, they provide some indication that the type of abstraction offered by NaDSet may be valuable for a number of important applications. Bibliography 110 BIBLIOGRAPHY [Aczel&Feferman] [80] Peter Aczel, Solomon Feferman, Consistency of the Unrestricted Abstraction Principle Using an Intentional Equivalence Operator. To H.B. Curry: Essays on Combinatorial Logic, Lambda Calculus and Formalism, Editors J.P. Seldin, J.R. Hindley, Academic Press, 1980, pp. 67-98. [Andrews] [90] James H . Andrews, The Logical Structure ofSequencial Prolog. Technical Report LFCS-90-110, Laboratory for the Foundations of Computer Science, University of Edinburgh, 1990. [91] James H . Andrews, Predicates as Parameters in Logic Programming. A Set-Theoretic Basis. Preliminary Report in Progress. [Apt&Plotkin] [81] K.R. Apt, G. D. Plotkin, A Cook's Tour of Countable Nondeterminism. LNCS 115, 1981, pp. 479-494. [Barendregt] [81] H . P. Barendregt, The Lambda Calculus. Its Syntax and Semantics. North-Holland, Amsterdam, 1981. [Barr&Wells] [85] M . Barr, C. Wells, Toposes, Triples and Theories. Springer-Verlag, New York, 1985. [Bell] [88] J. L. Bell, Toposes and Local Set Theories. An Introduction., 1988. [Beth] [55] E.W. Beth, Semantic Entailment and Formal Derivability. Mededelingen de Koninklijke Nederlandse Akademie der Wetenschappen, Afdeeling Letterkunde, Nieuwe Reeks, v.18, n.13,1955, pp. 309-342. [Bibel] [87] Wolfgang Bibel, Automated Theorem Proving. Vieweg & Sohn, Braunschweig, 1987. [Black] [85] Mickael Julian Black, Naive Semantic Networks. A paper for CPSC 448, Directed Studies in Computer Science, 1985. [Blass] [84] Andreas Blass, The Interaction between Category Theory and Set Theory. Mathematical Applications of Category Theory, J.W. Gray editor, Contemporary Mathematics, 30, American Mathematical Society, 1984, pp. 5-29. Bibliography 111 [Blyth] [86] T. S. Blyth, Categories. Longman, 1986. [Cardell] [89] Rachel Cardell-Oliver, The Specification and Verification of Sliding Window Protocols in Higher Order Logic. University of Cambridge Computer Laboratory Technical Report No. 183,1989. [Carnap] [58] Rudolf Carnap, Introductioon to Symbolic Logic and its Applications. Dover Publications, New York, 1958. [Chen et al.] [89] Weidong Chen, Michael Kifer, David S. Warren, HiLog: A First-Order Semantics of Higher-Order Logic Programming Constructs. Proc. of Notrh American Conference on Logic Programming, Cleveland, Ohio, 1989. [Church] [40] Alonzo Church, A Formulation of the Simple Theory of Types. Journal of Symbolic Logic, 5,1940. [41] Alonzo Church, The Calculi of Lambda Conversion. Princeton University Press, 1941. [56] Alonzo Church, Introduction to Mathematical Logic. Vol I. Princeton University Press, 1956. [Corella] [89] Francisco Corella, Mechanizing Set Theory. IBM T. J. Watson Research Report RC 14706, 1989. [89] Francisco Corella, The Double Nature of Type Theory. IBM T. J. Watson Research Report RC 14706, 1989. [Curry] [42] H . B. Curry, The Inconsistency of certain formal logics. Journal of Symbolic Logic, 7, 1942, pp.115-117. [de Bakker] [76] J. W. de Bakker, Semantics and Termination ofNondeterministic Recursive Programs. Proc. 3rd Coll. Automata, Languages and Programming, Edinburgh, 1976. [Dijkstra] [76] E. W. Dijkstra, A Discipline Programming. Prentice-Hall, Englewood Cliffs, N. J., 1976. [Dybjer] [85] Peter Dybjer, Category Theory and Programming Language Semantics: An Overview. LNCS 240, Springer-Verlag, 1985, pp. 165-181. [Etherington] [87a] David W. Etherington, Formalizing Nonmonotonic Reasoning Systems. Artificial Intelligence 31,1987, pp.41-85. [87b] David W. Etherington, Relating Default Logic and Circumscription. HCAI1987. Bibliography 112 [Ehrig et al.] [74] H . Ehrig, K. D. Kiermeier, H . J. Kreowski, W. Kuehnel, Universal Theory of Automata: A Categorical Approach. B.G. Teubner, Stuttgart, 1974. [Feferman] [77] Solomon Feferman, Categorical Foundations and Foundations of Category Theory. Logic, Foundations of Mathematics and Computability Theory, Editors Butts and Hintikka, D. Reidel, 1977, pp. 149-169. [84] Solomon Feferman, Towards Useful Type-Free Theories, I. Journal of Symbolic Logic, March 1984, pp. 75-111. [Fitch] [52] Frederick B. Fitch, Symbolic Logic: An Introduction. Ronald Press, New York, 1952. [Fitting] [85] Melvin Fitting, A Kripke-Kleene semantics for Logic Programs. Journal of Logic Programming, 4, 1985, pp.295-312. [86] Melvin Fitting, Notes on the Mathematical Aspects ofKripke's Theory of Truth. Notre Dame Journal of Formal Logic, v.27, n . l , January 1986. [Freyd] [64] Peter Freyd, Abelian Categories: An Introduction to the Theory of Functors. Harper and Row, 1964. [Freyd&Scedrov] [87] Peter Freyd, Andre Scedrov, Some Semantic Aspects of Polymorphic Lambda Calculus. LICS 1987 IEEE. [Garey&Johnson] [79] Michael R. Garey & David S. Johnson, COMPUTERS AND INTRACTABILITY, A Guide to the Theory of NP-Completeness, Freeman, 1979. [Gentzen] [34,35] Gerhard Gentzen, Untersuchungen uber das logische Schliessen. Mathematische Zeitschrift, 22, 1934-35, pp. 176-210,405-431. [Gilmore] [68] Paul C. Gilmore, A Formalized Naive Set Theory. A paper presented at the Summer Conference on Intuitionism and Proof Theory, Buffalo, New York, 1968. [71] Paul C. Gilmore, A Consistent Naive Set Theory: Foundations for a Formal Theory of Computation. IBM Research Report RC 3413, June 22, 1971. [80] Paul C. Gilmore, Combining Unrestricted Abstraction with Universal Quantification. To H.B. Curry: Essays on Combinatorial Logic, Lambda Calculus and Formalism, Editors J.P. Seldin, J.R. Hindley, Academic Press, 1980, pp. 99-123. This is a revised version of [Gilmore71]. [86] Paul C. Gilmore, Natural Deduction Based Set Theories: A New Resolution of the Old Paradoxes. Journal of Symbolic Logic, 51,1986, pp. 393-411. [87a] Paul C. Gilmore, The SET Conceptual Model and the Domain Graph Method of Table Design. U B C Computer Science Department Technical Report 87-7,1987. [87b] Paul C. Gilmore, Justifications and Applications of the SET Conceptual Model. U B C Computer Science Department Technical Report 87-9,1987. [87c] Paul C. Gilmore, Formalizing Attribution by Default. U B C Computer Science Department Technical Report 87-26,1987. Bibliography 113 [87d] Paul C. Gilmore, Semantics of Updates with Incomplete Information. Working notes for the database group discussions, 1987. [87e] Paul C. Gilmore, Comments on "A logical Framework for Depiction and Image Interpretation" by Raymond Reiter and Alan K. Mackworth, 1987. [88] Paul C. Gilmore, A Foundation for the Entity Relationship Approach: How and Why. Proceedings of the 6th Entity Relationship Conference, editor S.T. March, North-Holland, 1988, pp. 95-113. [89] Paul C. Gilmore, How Many Real Numbers are There?. U B C Technical Report TR 89-7,1989, revised July 1990. [90] Paul C. Gilmore, The consistency of an Extended NaDSet.. ITLI Prepublication Series for Mathematical Logic and Foundations, ML-90-11, University of Amsterdam, December 1990. [Gilmore&Tsiknis] [90a] Paul C. Gilmore, George K. Tsiknis, A Logic for Category Theory. U B C Computer Science Department Technical Report 90-2, May, 1990. [90b] Paul C. Gilmore, George K. Tsiknis, Logical foundations for Programming Semantics. A paper presented to the Sixth Workshop on the Mathematical Foundations of Programming Semantics, Kingston, Ontario, Canada, May 15-19, 1990. U B C Computer Science Department Technical Report 90-22. Submitted for publication to Theoretical Computer Science. [90c] Paul C. Gilmore, George K. Tsiknis, A Formalization of Category Theory in NaDSet. A paper presented to the Sixth Workshop on the Mathematical Foundations of Programming Semantics, Kingston, Ontario, Canada, May 15-19,1990. U B C Computer Science Department Technical Report 90-23. Submitted for publication to Theoretical Computer Science. [91a] Paul C. Gilmore, George K. Tsiknis, The Lambda Calculus in NaDSet, in preparation. [91b] Paul C. Gilmore, George K. Tsiknis, Formulations of an Extended NaDSet, in preparation. [Godel] [40] Kurt GodeL. The Consistency of the Continuum Hypothesis, Annals of Mathematics Studies, Number 3, Princeton University Press, 1940. [Goguen et al.] [73] J. A . Goguen, J. W. Thatcher, E. G. Wagner, J. B. Wright, A Junction Between Computer Science and Category Theory: I, Basic Definitions and Concepts. Technical Report RC-4526, IBM Research, 1973, (part 1). [75] J. A . Goguen, J. W. Thatcher, E. G. Wagner, J. B. Wright, An Introduction to Categories, Algebraic Theories and Algebras. Technical Report RC-5369, IBM Research, 1975. [76] J. A . Goguen, J. W. Thatcher, E. G. Wagner, J. B. Wright, A Junction Between Computer Science and Category Theory: I, Basic Definitions and Concepts. Technical Report RC-5908, IBM Research, 1976, (part 2). [77] J. A . Goguen, J. W. Thatcher, E . G. Wagner, J. B. Wright, Initial Algebra Semantics and Continuous Algebra. Journal of the A C M , v.24, n. l , January 1977, pp. 68-95. [Gordon] [79] Michael J.C. Gordon, The Denotational Description of Programming Languages. An Introduction. Springer-Verlag, New York, 1979. [85] Mike Gordon, Why Higher-order Logic is a Good Formalism for Specifying and Verifying Hardware. Formal Aspect of VLSI Design, G. Milne, P.A. Subrahmanyam, Bibliography 114 Eds., North-Holland, 1986. Also, University of Cambridge Computer Laboratory Technical Report No. 77,1985. [87] Mike Gordon, A Proof Generating System for Higher-order Logic. VLSI Specification, Verification and Synthesis, G. Birtwistle, P. Subrahmanyam, Eds., Academic Publishers, Boston, 1988, pp. 73-128. Also, University of Cambridge Computer Laboratory Technical Report No. 103, 1987. [Gordon et al.] [78] M . Gordon, R. Milner, L. Morris, M . Newey, C. Wadsworth, A Metalanguage for Interactive Proof in LCF. Fifth A C M SIGACT-SIGPLAN Conference on Princ. of Prog. Lannguages, Tucson, Arizona, 1978. [Gray] [84] J. W. Gray, Editor, Mathematical Applications of Category Theory. Contemporary Mathematics, 30, American Mathematical Society, 1984. [Gunter] [86] Carl A. Gunter, The Largest First-Order -Axiomatizable Cartesian Closed Category of Domains. Lies 1986, IEEE. [Hagino] [87] Tatsuya Hagino, A Typed Lambda Calculus with Categorical Type Constructors. LNCS 283, Springer-Verlag, 1987. [Hailpern&Owicki] [83] Brent T. Hailpern, Susan S. Owicki, Modular Verification of Computer Comunication Protocols. D3EE Transactions on Communications, COM-31(l), 1983, pp. 56-68. [Henkin] [49] Leon Henkin, The Completenes of the First-Order Functional Calculus. Journal of Symbolic Logic, 14, 1949, pp. 159-166. [50] Leon Henkin, Completenes in the Theory of Types. Journal of Symbolic Logic, 15, 1950, pp. 81-91. [53] Leon Henkin, Some Notes on Nominalism. Journal of Symbolic Logic, 18, 1953, pp. 19-29. [Herbert] [88] John Herbert, Temporal Abstraction of the Digital Designs. University of Cambridge Computer Laboratory Technical Report No. 122, 1988. [Hindley&Seldin] [86] Roger J. Hindley, Jonathan P. Seldin, Introduction to Combinators and X-Calculus. Cambridge University Press, Cambridge, 1986. [Hoare] [69] C. A. R. Hoare, An Axiomatic Basis for Computer Programming. Communication of the A C M , v.12, n.10, October 1969, pp. 576-583. [78] C. A. R. Hoare, Communicating Sequenctial Processes. Conn, of the A C M 2,1978, pp. 666-677. [Hoare&Shepherdson] [85] C. A. R. Hoare, J. C. Shepherdson, Editors, Mathematical Logic and Programming Languages. Prentice-Hall, Englewood Cliffs, New Jersey, 1985. Bibliography 115 [Huet] [75] G. P. Huet, A Unification Algorithm for Typed X-calculus. Theoretical Computer Science, 1,1975, pp. 27-57. [85] G. P. Huet, Cartesian Closed Categories and Lambda Calculus. LNCS 242, Springer-Verlag, 1985. [Hyland] [82] J. M . E. Hyland, The Effective Topos. The L.E.J. Brouwer Centenary Symp., ed. A.S. Troelstra, D. van Dalen, Noth-Holland, pp. 165-216. [Joyce] [88] Jeffrey J. Joyce, Formal Specification and Verification of Microprocessor Systems. Euromicro 88, Proc. of the 14th Symbosium on Microprocessing and Microprogramming, Zurich, 1988, North-Holland, 1988, pp.371-378. Also, University of Cambridge Computer Laboratory Technical Report No. 147,1988. [89a] Jeffrey J. Joyce, A Verified Compiler for a Verified Microprocessor. University of Cambridge Computer Laboratory Technical Report No. 167,1989. [89b] Jeffrey J. Joyce, Totally Verified Systems: Linking Verified Software to Verified Hardware. University of Cambridge Computer Laboratory Technical Report No. 178, 1989. [Kean&Tsiknis] [88a] Alex Kean, George Tsiknis, An Incremental Method for Generating Prime ImplicantslImplicates. U B C Computer Science Department Technical Report 88-16, July 1988. [88b] George Tsiknis, Alex Kean, Clause Management Systems (CMS). U B C Computer Science Department Technical Report 88-21, October 1988. Submitted to Computational Intelligence. [90a] Alex Kean, George Tsiknis, An Incremental Method for Generating Prime Implicantsl Implicates. Journal of Symbolic Computation 9, 1990, pp. 185-206. (This is a different version of [Kean&Tsiknis88a] ). [90b] Alex Kean, George Tsiknis, Assumption Based Reasoning and Clause Management Systems. U B C Computer Science Department Technical Report 90-9, May 1990. To appear in the journal of Computational Intelligence. [Kleene] [52] Stephaen Cole Kleene, Introduction to Metamathematics. North-Holland, 1952. [Kleene&Rosser] [35] S. C. Kleene, J. B. Rosser, The Inconsistency of Certain Formal Logics. Annals of Mathematics, 36, 1935, pp. 630-636. [Kripke] [75] Saul Kripke, Outline of a Theory of Truth. Journal of Philosophy, November 1975, pp.690-716. [Lambek] [80] J. Lambek, From X-lalculus to Cartesian Closed Categories. To H.B. Curry: Essays on Combinatorial Logic, Lambda Calculus and Formalism, Eds. J.P. Seldin, J.R. Hindley, Academic Press, 1980, pp. 375-402. Bibliography 116 [Lambek&Scott] [86] J. Lambek, P. J. Scott, Introduction to Higher Order Categorical Logic. Cambridge University Press, 1986. [Lawvere] [66] William F. Lawvere, The Category of Categories as a Foundation for Mathematics. Proc. Conf. on Categorical Algebras, Springer, 1966, pp. 1-21. [MacLane] [71] Saunders Mac Lane, Categories for the Working Mathematician. Springer-Verlag, 1971. [Manna&Pnueli] [81] Z. Manna, A . Pnueli, Verification of Concurrent Programs: The Temporal Framework. The Correctness Problem in Computer Science, R. Boyer, J. Moore eds., Academic Press, London, 1981, pp. 215-273. [Manna&Waldinger] [84] Zohar Manna, Richard Waldinger, The Logical Basis for Computer Programming, Volume 1: Deductive Reasoning. Addison-Wesley, 1984. [90] Zohar Manna, Richard Waldinger, The Logical Basis for Computer Programming, Volume 2: Deductive Systems. Addison-Wesley, 1990. [McCarthy] [80] John McCarthy, Circumscription- A Form ofNon-monotonic Reasoning. Artificial Intelligence 13, 1980, pp. 27-39. [86] John McCarthy, Applications of Circumscription to Formalizing Common-Sense Knowledge. Artificial Intelligence 28,1986, pp. 89-116. [Melham] [87] Thomas F. Melham, Abstraction Mechanisms for Hardware Verification. University of Cambridge Computer Laboratory Technical Report No. 106,1987. [88] Thomas F. Melham, Using Recursive Types to Reason about Hardware in Higher Order Logic. University of Cambridge Computer Laboratory Technical Report No. 135, 1988. [Meyer] [82] A. R. Meyer, What is a Model of Lambda Calculus?. Information arid Control, 52, 1982, pp. 87-122. [Miller&Nadathur] [86] Dale A . Miller, Gopalan Nadathur, Higher-order Logic Programming. Proc. of the Third International Logic Programming Conference, Imperial College, London, July 1986. [Milner] [72] Robin Milner, Implementation and Applications of Scott's Logic for Computable Functions. Proc. of A C M Conference on Proving Assertions about Programs, SIGPLAN Notices 7, January 1972, pp. 1-6. [79] Robin Milner, A Calculus of Communicating Systems. LNCS 92, Springer-Verlag, 1979. [83] Robin Milner, Calculi for Synchrony and Asynchrony. Theoretical Computer SCience 25, 1983,pp.267-310. Bibliography 117 [Minsky] [75] M . Minsky, A Framework for Representing Knowledge. The Psychology of Computer Vision, P.H. Winston, Ed., McGraw-Hill, New York, 1975. Also, MIT A l Lab., Memo 306,1974. [Monteiro&Pereira] [86] Luis F. Monteiro, Fernando C. N. Pereira, A Sheaf-Theoretic Model of Concurrency. LICS 1986, IEEE. [Morrison] [91] Richard Morrison, Design of an Operating System Kernel for Representative-Intensive Environments Based on the SET Data Model. In progress. [Owicki&Gries] [76] S. Owicki, D. Gries, An Axiomatic Proof Technique for Parallel Programs, I. Acta Informatica, 6,1976, pp. 319-340. [Park] [70] David Park, Fixpoint Induction and the Proofs of Program Properties. Machine Intelligence 5,1970, pp.59-78. [80] David Park, On the Semantics of Fair Parallelism. LNCS 86, Springer-Verlag, 1980, pp.504-526. [Paulson] [88] Lawrence C. Paulson, Experience with Isabelle: A Generic Theorem Prover (Preliminary Version). University of Cambridge Computer Laboratory Technical Report No. 143, 1988. [Perlis] [85] Donald Perlis, Languages with Self-Reference I: Foundations. Artificial Intelligence, 25, 1985, pp.301-322. [Pierce] [88] Benjamin C. Pierce, A Taste of Category Theory for Computer Scientists. Thechnical Report CMU-CS-88-203, Computer Science, Carnegie Mellon University, 1988. [Pitt et al.] [85] D. H . Pitt, S. Abramsky, A. Poigne, D. Rydeheard, Eds, Category Theory and Computer Programming. LNCS 240, Springer-Verlag, 1985. [87] D. H . Pitt, A . Poign6, D. Rydeheard, Eds, Category Theory and Computer Science. LNCS 283, Springer-Verlag, 1987. [Plotkin] [66] Gordon D. Plotkin, A Powerdomain Construction. SIAM J. Computing 5, 1976, pp.452-487. [78] Gordon D. Plotkin, T® as a Universal Domain. J. Comput. Systems Sci., 17, pp. 209-236. [Poole] [88a] David Poole, A Logical Framework for Default Reasoning. Artificial Intelligence 36, 1988. Bibliography 118 [88b] David Poole, Representing Knowledge for Logic-Based Diagnosis. Proc. of Int. Conf. on Fifth Generation Computing, Tokyo, 1988. [89a] David Poole, Explanation and Prediction: An Architecture for Default and Abductive Reasoning. Computational Intelligence 5,2,1989. [89b] David Poole, What the Lottery Paradox Tells Us About Nonmonotonic Reasoning. Proc .First Int. Conf. on Principles of Knowledge Representation and Reasoning, 1989. [Prawitz] [65] Dag Prawitz, Natural Deduction, A Proof-Theoretical Study. Stockholm Studies in Philosphy 3, Almquist & Wiksell, Stockholm, 1965. [68] Dag Prawitz, Hauptsatz for Higher Order Logic. Journal of Symbolic Logic, 33, 1968, pp. 452-457. [Reiter] [80] Raymond Reiter, A logic for Default Reasoning. Artificial Intelligence 13,1980, pp. 81-132. [80a] Raymond Reiter, Equality and Domain Cosure in First-Order Databases. J.ACMS 27, 1980, pp.235-249. [82] Raymond Reiter, Circumscription Implies Predicate Completion (sometimes). Proc. Second Conf. on Artificial Intelligence, Pittsburgh, PA, 1982. [Reynolds] [69] John C. Reynolds, Using Category Theory to Design Implicit Conversions and Generic Operators. LNCS 94, Springer-Verlag, 1980. [74] John C. Reynolds, Towards a Theory of Type Structure. LNCS 19, Springer-Verlag, 1974, pp.408-425. [84] John C. Reynolds, Polymorphism is not Set-Theoretic. LNCS 173, Springer-Verlag, 1984,pp.l45-156. [Rydeheard&Burstall] [88] David E. Rydeheard, Rod M . Burstall, Computational Category Theory. Prentice Hall, 1988. [Schiitte] [60] Kurt Schiitte, Syntactical and Semantical Properties of Simple Type Theory. Journal of Symbolic Logic, 25,1960, pp.305-326. [77] Kurt Schiitte, Proof Theory. Springer-Verlag, 1977. [Scott] [70] Dana S. Scott, Outline of a Mathematical Theory of Computation. Technical Monograph PRG-2, Oxford University Computing Laboratory, 1970. [72] Dana S.Scott, Continuous Lattices. S L N M 274, 1972, pp.97-136. [73] Dana S.Scott, Models of Various Type-Free Calculus. Logic, Methodology and Philos. Sci. IV, P. Suppes et al., Eds., North-Holland, 1973, pp. 157-187. [76] Dana S. Scott, Data Types as Lattices. SLAM J. Computing, 5, 1976, pp. 522-587. [80a] Dana S. Scott, Lambda Calculus: Some Models Some Philosophy. Kleene Symposium, Eds. J. Barwise et al., Noth-Holland, 1980, pp. 223-265. [80b] Dana S. Scott, Relating Theories of the X-Calculus. To H.B. Curry: Essays on Combinatorial Logic, Lambda Calculus and Formalism, Eds. J.P. Seldin, J.R. Hindley, Academic Press, 1980, pp. 403-450. [82] Dana S.Scott, Domains for Denotational Semantics. SLNCS 140,1982, pp. 577-613. Bibliography 119 [91] Dana Scott, A Language for Semantics, Mathematical Foundations of Programming Semantics, Carnegie Mellon University, March 25-28,1991. [Shoenfield] [67] Joseph R. Shoenfield, Mathematical Logic. Addison-Wesley, 1967. [Smullyan] [68] Raymond M . Smullyan, First-Order Logic. Springer-Verlag, 1968. [Smyth] [77] M.B.Smyth, Effectively Given Domains. Theoretical Computer Science 5, 1977, pp.257-274. [78] M . B. Smyth, Power Domains. Journal of Computer and System Science 16,1978, pp.23-36. [Smyth&PIotkin] [82] M . B. Smyth, G. D. Plotkin, The Category-Theoretic Solution of the Recursive Domain Equations. SLAM J. Computing 11, 1982, pp. 761-783. [Sowa] [84] J. F. Sowa, Conceptual Structures: Information Processing in Mind and Machine. Addison-Weslay, 1984. [Stoy] [77] Joseph E. Stoy, Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, 1977. [Szabo] [69] M . E . Szabo, The Collected Papers of Gerhard Gentzen. Noth-Holland, Amsterdam, 1969. [Tarski] [36] Alfred Tarski, DerWahrheitsbegriffindenformalisiertenSprachen. Studia Philosophica, vol. 1,1936, pp.261-405. English translation appears in Logic, Semantics, Metamathematics, Papers from 1923 to 1938, Oxford University Press, 152-278,1956. [Tennent] [85] R. D. Tennent, Functor-Category Semantics of Programming Languages and Logics. LNCS 240, Springer-Verlag, 1985. [Touretzky] [86] David S. Touretzky, The Mathematics of the Inheritance Systems. Morgan-Kaufmann, London, 1986. [Tsiknis] [85] George Tsiknis, Specification-Verification of Protocols - The Significant Event Temporal Logic Technique. M.Sc. Thesis, University of British Columbia, April 1985. [88a] George Tsiknis, The Inconsistency of a Belief Revision System. U B C Computer Science Department Technical Report 88-4, January 1988. Revised June 1988. [88b] George K. Tsiknis, A Connection Method for Non-Monotonic and Autoepistemic Logic. U B C Computer Science Department Technical Report 88-5, January 1988. Bibliography 120 [Tsiknis&Vuong] [88] George K. Tsiknis, Son T. Vuong, Protocol Specification and Verification Using the Significant Event Temporal Logic. U B C Computer Science Department Technical Report 88-3, January 1988. Was accepted in the Fifth International Workshop on Protocol Specification Testing and Verification, Toulouse, France, June 1985. [Wand] [79] M . Wand, Fixed-Point Constructions in Order-Enriched Categories. Theoretical Computer Science, 8,1979, pp. 13-30. [Wilder] [58] Raymond L. Wilder, Introduction to the Foundations of Mathematics. Wiley, 1958. [Zamfir] [87] Maria Zamfir, Initial Algebra Semantics and Concurrency. LNCS 298, Springer-Verlag, 1987, pp.528-549. Appendix A: Proof of Lemma 3.3.2.1 121 APPENDIX A Proof of Lemma 3.3.2.1. 3.3.2.1 L e m m a The sequent -> [Vx:Cat] <Id[x], x, x>:Ar is derivable. Proof of Lemma 3.3.2.1 If C is any tuple <ATQ, =aQ, Sr^, T g £ , CpQ> of second order parameters, the lemma is obtained by an application of -»V to the sequent C:Cat -> <Id[C], C, C>:Ar whose derivation is obtained as following. Let Ax[G,A,B] be the result of replacing F by G, <ATQ, = a £ , Sr^;, Tg^ ,Cp^> by A, and <Arj), = a D' ^ r D ' ^ ^D'^PD> d v B m a n ^ O M ° f ( f l ) t o (f9). From the definition of A r , it is obvious that a proof of the lemma can be obtained from a derivation of the sequent C:Cat -> Functor[ Id[C], C, C ] by a single application of ->{}. The latter derivation can in turn be obtained if for each axiom (fl) to (flO) a derivation for the sequent C:Cat -> Ax[ Id[C], C, C ] (LI) is provided. Derivations of the last sequent will be given for axioms (f3), (f4), (f7) and (f9) only, the rest being either similar or trivial. 3.3.2.1.1 Sequent (LI) is derivable when Ax is (f3). A derivation in which f is a first order parameter follows: Appendix A: Proof of Lemma 3.3.2.1 122 f = a C f -> f = a C f f:Arj-. -» f:Ar^> k [Vg:Ar c ] g = a C g, f : A r c -> f = a C f thinning *C:Cat, f : A r c -> f = a C f C : C a t , f : A r c -> *<f,f>:Id[C] f :Ar^ - 4 f:Ar£ C:Cat, f : A r c -> *[3fd:Ar c] <f,fd>:Id[C] C:Cat -> *[Vfc:Ar c ][3fd:Ar c ] <fc,fd>:Id[C] 3.3.2.1.2 Sequent (LI) is derivable when Ax is (f4). In the following derivation f l , f2, f3 and f4 are first order parameters: f3 = a C f 1 f3 = a C f 1 f 1 = a C f4 f 1 = a C f4 f 3 = a C f 4 -> f 3 = a C f 4 *( f3 = a C f l A f l = a C f4 3 f3 = a C f4), f 3 = a C f l , f l = a C f 4 f 3 = a C f 4 f l : A r ^ -» f\:AiQ f3:ArQ -> fi.AiQ f4:Ar(~> -» f4:Ar^ *[Vf,g,h:Ar c]( f = a C g A g = a C h 3 f = a C h), f l : A r c , f3 :Ar c , f4 :Ar c , f 3 = a C f l , f l = a C *4 -> f 3 = a C f 4 f 1 = a C f 3 - . f l = a C f3 [Vf,g,h:Ar c]( f = a C g A g = a C h 3 f = a C h), Appendix A: Proof of Lemma 3.3.2.1 123 * ( f l = a C f 3 3 f 3 = a C f l ) , f l : A r c , f3 :Ar c , f4 :Ar c , f l = a C f 3 , f l = a C f 4 f 3 = a C f 4 fhAiQ -» f l :AjQ f3:AxQ -> f3:Ar^ [Vf,g,h:Arc]( f = a C g A g = a C h 3 f = a C h), * [Vf ,g :Ar c ] ( f= a C g 3 g = a C f ) , f l : A r c , f3 :Ar c , f4 :Ar c , fl = a C f4, f 1 = a C f3 ^ f3 = a C f4 f 1 = a C f2 -> f l = a C f2 f 2 = a C f 4 -> f 2 = a C f 4 [Vf,g,h:Ar c]( f = a C g A g = a C h 3 f = a C h), *( f 1 = a C f^ A f2 = a C f4 3 f 1 = a C f4), [ V f , g : A r c ] ( f = a C g 3 g = a C f ) , f l : A r c , f3 :Ar c , f4 :Ar c , fl = a C f2, f 1 = a C f3, a = a C f4 -» f3 = a C f4 f l : A r ^ -» f l : A r ^ f 2 : A r c -> f 2 : A r c f4:ArQ -» f4:Arc *[Vf,g,h:Ar c]( f = a C g A g = a C h 3 f = a C h), [ V f , g : A r c ] ( f = a C g 3 g = a C f ) , f l : A r c , f2 :Ar c , f3 :Ar c , f4 :Ar c , fl = a C f2, f l = a C f3, f2 = a C f4 -> f3 = a C f4 *C:Cat, f l : A r c , f2 :Ar c , f3 :Ar c , f4 :Ar c , thjjining fl = a C f2, f 1 = a C f3, a = a C f4 -» f3 = a C f4 Appendix A: Proof of Lemma 3.3.2.1 124 C:Cat, f l : A r c , f2 :Ar c , f3 :Ar c , f4 :Ar c , f l = a C f 2 , *<fl,f3>:Id[C], *<f2,f4>:Id[C] -> f 3 = a C f 4 C:Cat, f l : A r c , f2 :Ar c , f3 :Ar c , f 4 : A r c -> *(fl = a C fl A <fl,f3>:Id[C] A <f2,f4>:Id[C] 3 f i = a C f4 ) C:Cat -> *[Vfc,gc,fd, gd:Ar c]( fc = a C gc A <fc,fd>:Id[C] A <gc,gd>:Id[C] 3 fd = a C gd ) 3.3.2.1.3 Sequent (LI) is derivable when Ax is (f7). In the following derivation f l , fl, al and a2 are first order parameters: al = a £ a2 -» al =&Q a2 <f2, al>:Sr c -> <f2, al>:Sr c <f2, a2>:Src -> <f2, a2>:Src *( al = a C a2 A <f2, al>:Sr c 3 <f2, a2>:Src ), <f2,al>:Src, al = a C a2 -> <f2,a2>:Src f 2 : A r c H> f2 :Ar c al:AXQ - » a l : A r £ a2:ArQ —> a2:AiQ *[Vf,g,h:Ar c]( g = a C h A <f, g>:Sr c 3 <f, h>:Sr c ), SLIIATQ, f2:ArQ a2:Ar^, <f2,al>:Src, al = a C a2 -> <f2,a2>:Src f 1 = a C f2 -> f 1 = a C f2 <fl, al>:SrQ -» <fl, al>:Sr^< *( f l = a C f2 A <fl, al>:Sr c 3 <f2, al>:Sr c ), [Vf,g,h:Ar c]( g = a C h A <f, g>:Sr c 3 <f, h>:Sr c ), Appendix A: Proof of Lemma 3.3.2.1 125 al :Ar£ , f2:AiQ, a2:Ar£, <fl,al>:Sr c, f l = a C f 2 , al = a C a2 -> <f2,a2>:Src f l : A r ^ -» H:AXQ f 2 : A r c -> f 2 : A r c al:Ar^. -» alrAr^. * [ V f , g , h : A r c ] ( f = a C g A <f,h>:Sr c 3 <g, h>:Sr c ), [Vf,g,h:Ar c]( g = a C h A <f, g>:Sr c 3 <f, h>:Sr c ), fl :Ar^., &1:AXQ, f2:AiQ, a2:Aj(-«, <fl,al>:Sr c, f l = a £ f2, al = a C a2 -> <£2 ,a2> :Sr c *C:Cat, fl:Ar(~<, ahAiQ, fl-.AiQ, a2:Ar^, thinning <fl,al>:Sr c, f l = a C f2, al = a C a2 -> <f2,a2>:Src C:Cat, f l : A r c , a l : A r c , f2 :Ar c , a2:Ar c , <fl,al>:Sr c, *<fl,f2>:Id[C], *<al,a2>:Id[C] -> <f2,a2>:Src C:Cat, f l : A r c , a l : A r c , f2 :Ar c , a2 :Ar c -> *( <fl,al>:Sr c A <fl,f2>:Id[C] A <al,a2>:Id[C] 3 <f2,a2>:Src) C:Cat -> *[Vfc,c,fd,d:Ar c] ( < fc ,o :Sr c A <fc,fd>:Id[C] A <e,d>:M[C] 3 <fd,d>:Src ) 3.3.2.1.4 Sequent (LI) is derivable when Ax is (f9). A derivation of this sequent is provided in which f 1, f2, f3, g l , g2 and g3 are first order parameters: < gl,g2,g3>:Cp c -> < gl,g2,g3>:Cp c g l : A r c -> g l : A r c g2:Ar c -> g2 :Ar c f3:AiQ -» 0 : A T Q g3 :Ar c -> g3:Ar c a =aC § 3 -> fi =aC g 3 Appendix A: Proof of Lemma 3.3.2.1 126 < gl,g2,f3>:Cp c -> < gl,g2,f3>:Cp c *[Vf,g,h,k:Ar c]*(h = a C k A <f,g,h>:Cpc 3 <f,g,k>:Cpc ), f 3 : A r c , g l : A r c , g2 :Ar c , g3:Ar c , < gl,g2,f3>:Cp c, a =aC g 3 -» < gl,g2,g3>:Cp c g l : A x c -» g l : A r c f2:Ax c -> f 2 : A r c f3:Ar^ -» f3:Ar^ g2 :Ar c -» g2 :Ar c f 2 = a C g 2 -> G = a C g 2 < gl,f2,f3>:Cp c -» < gl,f2,f3>:Cp c *[Vf,g,h,k:Ar c]*( g = a C k A <f,g,h>:Cpc 3 <f,k,h>:Cpc ), [Vf,g,h,k:Ar c](h = a C k A <f,g,h>:Cpc 3 <f,g,k>:Cpc ), f 2 : A r c , B : A r c , g l : A r c , g2:Ar c , g3:Ar c , <gl,f2,f3>:Cpc, f2 = a C g2, f3 = a C g3 -> < gl,g2,g3>:Cp c f l : A r c fhArQ f 2 : A r c -» f2 :Ar c f3:ArQ -H> f3:ArQ g l : A r c -> g l : A r c f ^ a C g 1 f ^ a C g 1 < fl,f2,f3>:Cp c -> < fl,f2,f3>:Cp c * [Vf ,g ,h ,k :Ar c ] * ( f= a C k A <f,g,h>:Cpc 3 <k,g,h>:Cpc), [Vf,g,h,k:Ar c]( g = a C k A <f,g,h>:Cpc 3 <f,k,h>:Cp c), [Vf,g,h,k:Ar c](h = a C k A <f,g,h>:Cpc 3 <f,g,k>:Cp c), f l : A r c , f2 :Ar c , f3 :Ar c , g l : A r c , g2:Ar c , g3:Ar c , < fl,f2,f3>:Cp c, f l = a C g l , f2 = a C g2, f3 = a C g3 ^ < gl,g2,g3>:Cp c Appendix A: Proof of Lemma 3.3.2.1 127 *C:Cat, f l :Ar£ , f2 :AjQ f3:AjQ g l : A j Q g2:AxQ, g3:AjQ thmning < fl,f2,f3>:Cp c, f l = a C g L f 2 = a C g 2 ' B =aC g 3 -> < gl,g2,g3>:Cp c C:Cat, f l : A r c , f2 :Ar c , f3 :Ar c , g l : A r c , g2:Ar c , g3:Ar c , < fl,f2,f3>:Cp c, *<fl,gl>:Id[C], *<f2,g2>:Id[C], *<f3,g3>:Id[C] -> < gl,g2,g3>:Cp c C:Cat, f l : A r c , f2 :Ar c , f3 :Ar c , g l : A r c , g2:Ar c , g3:Ar c , *(< fl,f2,f3>:Cp c A <fl,gl>:Id[C] A <f2,g2>:Id[C] A <f3,g3>:Id[C] => < gl,g2,g3>:Cpc) C:Cat -> *[Vfcl,fc2,fc3,fdl,fd2,fd3:Ar c](<fcl,fc2,fc3>:CpCA <fcl,fdl>:Id[C] A <fc2,fd2>:Id[C] A <fc3,fd3>:Id[C] 3 < fdl,fd2,fd3>:Cp c) E n d of proof of lemma 3.3.2.1 Appendix B: Proof of Lemma 3.3.3.1 128 APPENDIX B Proof of Lemma 3.3.3.1 3.3.3.1 Lemma The sequent -> [Vf,g:Func][Vb,c,d,e:Cat]( <f,b,c>:Ar A <g,d,e>:Ar A c=ed ZD < F C [ f,b,c,g,d,e ], b, e > :Ar ) is derivable. Proof of Lemma 3.3.3.1. If F l , F2 are second order parameters and C l , DI , C l , DI are the usual tuples of second order parameters, the lemma can be obtained from the sequent < F l , C l , D l > : A r , <F2,C2,D2>:Ar, Dl= e C2 -> < FC[F1,C1,D1,F2,C2,D2], C l , D2 > :Ar by successive applications of the ->V rule. The last sequent can be derived from the sequent Functor[Fl,Cl,Dl], Functor[F2,C2,D2] Dl= e C2 -» Functor[ FC[F1,C1,D1,F2,C2,D2], C l , D2 1 by two applications of {}-> and one of - » { } . Let Ax[G,A,B] be as in the proof of lemma 3.3.2.1. From the functor definition it is obvious that a proof of the latter sequent can be obtained if for each axiom (f 1) to (f9) a derivation for the sequent A x [ F l , C l , D l ] , Ax[F2,C2,D2] Dl= e C2 -> Ax[ FC[F1,C1,D1,F2,C2,D2], C l , D2 ] (L2) is provided. Derivations for this sequent will be given for the axioms (f3), (f4), (f7) and (f9) only, the rest being either similar or trivial. Appendix B: Proof of Lemma 3.3.3.1 129 3.3.3.1.1 Sequent (L2) is derivable when Ax is (f3). In the following derivation pc, pd and pe are first order parameters: <pc,pd>:Fl -> <pc,pd>:Fl <pd,pe>:F2 -> <pd,pe>:F2 p d : A r D 1 -> p d : A r D 1 p d : A r D 1 , <pc,pd>:Fl, <pd,pe>:F2 -> *[ 3d:ArD1]*(<pc,d>:Fl A <d,pe>:F2) pdrAiD! , <pc,pd>:Fl, <pd,pe>:F2 -> *<pc,pe>: FC[F1,C1,D1,F2,C2,D2] p e : A r D 2 -> p e : A r D 2 pd:Arrji, <pc,pd>:Fl, pe:Arr_)2, <pd,pe>:F2 -> * [3d :Ar D 2 ] <pc,d>: FC[F1,C1,D1,F2,C2,D2] p d : A r D 1 , <pc,pd>:Fl, *[ 3d :Ar D 2 ] <pd,d>:F2 -> [3d :Ar D 2 ] <pc,d>: FC[F1,C1,D1,F2,C2,D2] pd:Arjji, Dl= e C2 -> p d : A r ^ 2 (lemma 3.3.1.1) p d : A r D 1 , <pc,pd>:Fl, * [Vc:Ar C 2 ] [ 3d:Aib 2 ] <c,d>:F2, Dl= e C2 -> [3d :Ar D 2 ] <pc,d>: FC[F1,C1,D1,F2,C2,D2] *[ 3d:Ar D 1 ] <pc,d>:Fl, [Vc:Ar C 2 ][ 3d:Ar D 2 ] <c,d>:F2, Dl= e C2 -> [3d :Ar D 2 ] <pc,d>: FC[F1,C1,D1,F2,C2,D2] pc:Arci -> pc :ArQ *[Vc:Ar c l ] [ 3d:Ar D 1 ] <c,d>:Fl, [Vc:Ar C 2 ][ 3d:Ar D 2 ] <c,d>:F2, Dl= e C2 Appendix B: Proof of Lemma 3.3.3.1 130 p c : A r c l -> [3d :Ar D 2 ] <pc,d>: FC[F1,C1,D1,F2,C2,D2] [Vc:Ar c l ] [3fd:Ar D 1 ] <c,d>:Fl, [Vc:Ar C 2 ][ 3d:Ar D 2 ] <c,d>:F2, Dl=eC2 .-> * [Vc :Ar c l ] [3d :Ar D 2 ] <c,d>: FC[F1,C1,D1,F2,C2,D2] 3.3.3.1.2 Sequent (L2) is derivable when Ax is (f4). In the following derivation pc 1, pc2, pdl, pd2, pddl and pdd2 are first order parameters: P c l = a C l P c 2 -> P c l = a C l P c 2 <pcl,pddl>:Fl -> <pcl,pddl>:Fl <pc2,pdd2>:Fl -> <pc2,pdd2>:Fl pcl= a ^ipc2, <pcl,pddl>:Fl, <pc2,pdd2>:Fl, -» *(pcl= a^ipc2 A <pcl,pddl>:Fl A <pc2,pdd2>:Fl) pddl= a D 1 pdd2, = aDl=e=aC2 ~> pddl= a C 2 pdd2 (lemma 3.3.1.1) *(pcl= a C 1 pc2 A <pel,pddl>:Fl A <pc2,pdd2>:Fl 3 pddl= a D ipdd2 ), =aDl = e=aC2' P c l = a C l P c 2 ' <pcl,pddl>:Fl, <pc2,pdd2>:Fl, -> pddl= a^ 2pdd2 <pddl,pdl>:F2 -> <pddl,pdl>:F2 <pdd2,pd2>:F2 -> <pdd2,pd2>:F2 (pcl=a(^ipc2 A <pcl,pddl>:Fl A <pc2,pdd2>:Fl 3 pddl=aj3ipdd2 ), =aDl =e =aC2> P c l = a C l P c 2 ' <pcl,pddl>:Fl, <pddl, pdl>:F2, <pc2,pdd2>:Fl, <pdd2, pd2>:F2 -> *( pddl= a C 2 pdd2 A <pddl,pdl>:F2 A <pdd2,pd2>:F2 ) P d l =aD2P d 2 P d l =aD2P d 2 (pcl=acipc2 A <pcl,pddl>:Fl A <pc2,pdd2>:Fl 3 pddl=arjipdd2 ), *( pddl= a C 2 pdd2 A <pddl,pdl>:F2 A <pdd2,pd2>:F2 3 pdl= a D 2 pd2 ), =aDl =e =aC2> P c l = a C l P c 2 ' <pcl,pddl>:Fl, <pddl, pdl>:F2, <pc2,pdd2>:Fl, <pdd2, pd2>:F2 Appendix B: Proof of Lemma 3.3.3.1 131 -» P d l =aD2P d 2 p d d l : A r D 1 , A r D 1 = e A r ^ -> p d d l : A r C 2 pdd2:Ar D 1 , A r D 1 = e A r ^ -> pdd2:Ar C 2 p d l : A r D 2 -> p d l : A r D 2 pd2:Ar D 2 -> pd2:Ar D 2 (lemma 3.3.1.1) (lemma 3.3.1.1) thinning (pcl=acipc2 A <pcl,pddl>:Fl A <pc2,pdd2>:Fl => pddl=arjipdd2 ), *[Vcl,c2:Ar C 2 ] *[Vdl,d2:ArD 2]( c l = a C 2 c 2 A <cl,dl>:F2 A <c2,d2>:F2 3 d ^ ^ ^ ), *Dl=eC2, p c l : A r c l , p c 2 : A r c l , pdl: A r D 2 , pd2 :Ar D 2 , pcl= a C 1 pc2, pddliAjjjj , <pcl,pddl>:Fl, <pddl, pdl>:F2, pdd2:Ar D i , <pc2,pdd2>:Fl, <pdd2, pd2>:F2 -» pdl=aD2P d 2 pddlrArrji -> pddl:Arj)j pdd2:Aijjj -» pdd2:AiQi *[Vdl,d2:Ar D 1 ]( pcl= a C 1 pc2 A <pcl,dl>:Fl A <pc2,d2>:Fl 3 61=^62), [Vcl,c2:Ar C 2] [Vdl,d2:ArD 2]( c l = a C 2 c 2 A <cl,dl>:F2 A <c2,d2>:F2 3 d ^ , ^ ^ ) » Dl=eC2, p c l : A r ^ i , pc2:Ar^ 1 , p d l : A r D 2 , pd2 :Ar D 2 , p c l = a £ i p c 2 , p d d l : A r D ^ , <pcl,pddl>:Fl, <pddl, pdl>:F2, pdd2:Ar D 1 , <pc2,pdd2>:Fl, <pdd2, pd2>:F2 -> P d l =aD2P d 2 [Vdl,d2:Ar D 1 ]( pcl= a C 1 pc2 A <pcl,dl>:Fl A <pc2,d2>:Fl 3 d l = a D i d 2 ), [Vcl,c2:Ar C 2] [Vdl,d2:ArD 2]( c l = a C 2 c 2 A <cl,dl>:F2 A <c2,d2>:F2 3 d l = a D 2 d 2 ), Dl= e C2, p c l : A r c l , p c 2 : A r c l , pdl: A r D 2 , pd2 :Ar D 2 , pcl= a C 1 pc2, Appendix B: Proof of Lemma 3.3.3.1 132 *[ 3d:ArD 1](< pcl,d>:Fl A <d, pdl>:F2), *[ 3d:ArD 1](< pc2,d>:Fl A <d, pd2>:F2) -> P d l =aD2P d 2 [Vdl,d2:Ar D 1 ]( pcl= a C 1 pc2 A <pcl,dl>:Fl A <pc2,d2>:Fl ? 61=^62 ), [Vcl,c2:Ar C 2] [Vdl,d2:ArD 2]( c l = a C 2 c 2 A <cl,dl>:F2 A <c2,d2>:F2 =» d l ^ ^ ) » Dl= e C2, p c l : A r c l , p c 2 : A r c l , p d l : A r D 2 , pd2 :Ar D 2 , pcl= a C 1 pc2, *<pcl,pd 1 >: FC[F 1 ,C 1 ,D 1 ,F2,C2,D2], *<pc2,pd2>: FC[F1,C1,D1,F2,C2,D2] -> P d l =aD2P d 2 pcl:Ar^2 -> pclrAr^j pc2:ArQ| -> pc2:Ar^j *[Vcl ,c2 :Ar c l ] [Vdl,d2:ArD 1]( c l = a C 1 c 2 A <cl,dl>:Fl A <c2,d2>:Fl 3 d l = a D 1 d 2 ), [Vcl,c2:Ar C 2] [Vdl.cErArr^K c l = a C 2 c 2 A <cl,dl>:F2 A <c2,d2>:F2 3 dl-^jy^dl ), Dl= e C2, p c l : A r ^ i , pc2:Ar(-<i, pdl :Arj3 2 , pd2:Ai£) 2 -» *(pcl= a C 1 pc2 A <pcl,pdl>: FC[F1,C1,D1,F2,C2,D2] A <pc2,pd2>: FC[F1,C1,D1,F2,C2,D2] 3 pdl= a D 2 pd2 ) [Vcl ,c2:Ar c l ] [ V d l ^ i A i p j i K c l = a C 1 c 2 A <cl,dl>:Fl A <c2,d2>:Fl 3 d l = a D 1 d 2 ) , [Vcl,c2:Ar C 2] [Vdl,d2:ArD 2]( c l = a C 2 c 2 A <cl,dl>:F2 A <c2,d2>:F2 3 d l = a D 2 d 2 )' Dl= e C2 -> *[Vcl ,c2 :Ar c l ] *[Vdl,d2:ArD 2]( Appendix B: Proof of Lemma 3.33.1 133 c l = a C 1 c 2 A <cl,dl>: FC[F1,C1,D1,F2,C2,D2] A <c2,d2>: FC[F1,C1,D1,F2,C2,D2] 3 d l = a D 2 d 2 ) 3.3.3.1.3 Sequent (L2) is derivable when Ax is (f7). In the following derivation, the terms fdl , d l , fd2 and d2 are first order parameters: <fd2,d2>:SrD2 -» <fd2,d2>:SrD2 f d l : A r D 1 , A r D 1 = e A r ^ -> fdl : A r ^ (lemma 3.3.1.1) d l : A r D 1 , A r D 1 = e A r C 2 -> d l : A r ^ (lemma 3.3.1.1) fd2: Ar j ) 2 -> fd2: Arj-)2 d2: A r D 2 -> d2: A r D 2 <fdl,dl>:SrD 1 , S r D 1 = e S r C 2 - > <fdl,dl>:SrC 2 (lemma 3.3.1.1) <fdl,fd2>:F2 -> <fdl,fd2>:F2 <dl,d2>:F2 -> <dl,d2>:F2 thinning *[Vfc,c:Ar C 2 ]*[Vfd,d:Ar D 2 ] *( <fc,c>:SrC2 A <fc,fd>:F2 A <c,d>:F2 3 <fd,d>:SrD2), *Dl= e C2, <fdl,dl>:SrDi, fd2: A r D 2 , d 2 : A r D 2 , d l : A r D 1 , f d l : A r D 1 , <fdl,fd2>:F2, <dl,d2>:F2 -> <fd2,d2>:SrD2 f c l : A r c i -» f c l : A r ^ j cl:Ar(-<j -> C\:ATQI fdl: Arryi -> fdl :Arj ) i dl:Arp3j -» dl :Arj ) j <fcl,cl>:Sr^ 1 -> <fcl,cl>:Sr^1 <fcl,fdl>:Fl -> <fcl,fdl>:Fl <cl,dl>:Fl -> <cl,dl>:Fl Appendix B: Proof of Lemma 3.3.3.1 134 *[Vfc,c:Ar c l ]*[Vfd,d:Ar D 1 ] *( <fc,c>:SrQj A <fc,fd>:Fl A <c,d>:Fl 3 <fd,d>:Srj)i), [Vfc,c:ArC2][Vfd,d:ArD 2] ( <fc,c>:SrC2 A <fc,fd>:F2 A <c,d>:F2 => <fd,d>:Sr D 2)» Dl= e C2, f c l : A r c l , c l : A r c l , fd2: ArD2> d2:ArD 2> <fcl,cl>:Sr c l , f d l : A r D 1 , <fcl,fdl>:Fl, <fdl,fd2>:F2, dhArr j i , <cl,dl>:Fl, <dl,d2>:F2 -> <fd2,d2>:SrD2) [Vfc,c:Ar c l ][Vfd,d:Ar D 1 ] ( <fc,c>:SrQ1 A <fc,fd>:Fl A <c,d>:Fl 3 <fd,d>:Srr3i), [Vfc,c:ArC 2][Vfd,d:ArD 2] ( <fc,c>:SrC2 A <fc,fd>:F2 A <c,d>:F2 3 <fd,d>:SrD2)> Dl= e C2, f c l : A r c l , c l : A r c l , fd2: ArD2> d 2 : A r D 2 ' <fcl,cl>:Sr c l , *[ 3f:ArD 1]*(<fcl,f>:Fl A <f,fd2>:F2), *[ 3f:ArD 1]*(<cl,f>:Fl A <f,d2>:F2) -> <fd2,d2>:SrD2) [Vfc,c:Ar c l ][Vfd,d:Ar D 1 ] ( <fc,c>:SrQ1 A <fc,fd>:Fl A <c,d>:Fl 3 <fd,d>:SrDi), [Vfc,c:ArC 2][Vfd,d:ArD 2] ( <fc,c>:SrC2 A <fc,fd>:F2 A <c,d>:F2 3 <fd,d>:SrD2)> Dl= e C2, f c l : A r c l , c l : A r c l , fd2: A r D 2 , d 2 : A r D 2 , <fcl,cl>:Sr c l , *<fcl,fd2>: FC[F1,C1,D1,F2,C2,D2], *<cl,d2>: FC[F1,C1,D1,F2,C2,D2] -> <fd2,d2>:SrD2) [Vfc,c:Ar c l ][Vfd,d:Ar D 1 ] ( <fc,c>:SrQj A <fc,fd>:Fl A <c,d>:Fl 3 <fd,d>:SrDi), [Vfc,c:ArC 2][Vfd,d:ArD 2] ( <fc,c>:Sr^2 A <fc,fd>:F2 A <c,d>:F2 3 <fd,d>:SrD2)> Appendix B: Proof of Lemma 3.3.3.1 135 Dl= e C2 -> *[Vfc,c:Ar c l]*[Vfd,d:ArD2] *(<fc,c>:Srcl A <fc,fd>: FC[F1,C1,D1,F2,C2,D2] A <c,d>: FC[F1,C1,D1,F2,C2,D2] => <fd,d>:SrD2) 3.3.3.1.4 Sequent (L2) is derivable when Ax is (f9). In the following derivation the first order parameters pel, pc2, pc3, pdl, pd2, pd3, pel, pe2 and pe3 are used: pel:Arj)i, A r ^ ^ A r ^ ~* P e l : ^ Cl (lemma 3.3.1.1) pe2:Arjji, Arj)i=eAr^<2 pe2: A r ^ (lemma 3.3.1.1) pe3:Arjji, Arj- )^=eAr^2 -» pe3 :Ar£2 (lemma 3.3.1.1) pdl: A r D 2 -> pdl: A r D 2 pd2: A r D 2 -> pd2: A r D 2 pd3: A r D 2 -> pd3: A r D 2 <pel,pe2,pe3>:Cpjji, ATJJI =eAr(-<2 -» <pel,pe2,pe3>:Cp^2 (lemma 3.3.1.1) <pel,pdl>:F2 -> <pel,pdl>:F2 <pe2,pd2>:F2 -> <pe2,pd2>:F2 <pe3,pd3>:F2 -» <pe3,pd3>:F2 <pdl,pd2,pd3>:Cpj32 -> <pdl,pd2,pd3>:Cp£) 2 thinning * [Vfc 1 ,fc2,fc3: A r C 2 ] * [Vfdl ,fd2,fd3: A r D 2 ] *(< fc 1 ,fc2,fc3>:CpC 2 A <fcl,fdl>:F2 A <fc2,fd2>:F2 A <fc3,fd3>:F2 => <fdl,fd2,fd3>:CpD 2). *Dl= e C2, p d l : A r D 2 » P^2'- A rD2> pd3: A r D 2 , p e l : A r D 1 , pe2:Ar D 1 , pe3:Ar D 1 , <pel,pe2,pe3>:Cpjji, <pel,pdl>:F2, <pe2,pd2>:F2, <pe3,pd3>:F2 -> <pdl,pd2,pd3>:Cpj)2 pchAiQi -» p c l : A r Q pc2: ATQI -» pc2: AIQ^ pc3: A T Q -> pc3: A r ^ Appendix B: Proof of Lemma 3.3.3.1 136 pel:Arr_)i -» pel:Arj)j pe2:Arj3i -> pe2: ATJ^J pe3: Arj3i -> pe3: Arjji <pcl,pc2,pc3>:Cp^j -» <pcl,pc2,pc3>:Cp^j <pcl,pel>:Fl -> <pcl,pel>:Fl <pc2,pe2>:Fl -> <pc2,pe2>:Fl <pc3,pe3>:Fl <pc3,pe3>:Fl *[Vfcl,fc2,fc3:Ar c l] *[Vfdl,fd2,fd3:ArD 1]*(< fcl,fc2,fc3>:Cp c l A <fcl,fdl>:Fl A <fc2,fd2>:Fl A <fc3,fd3>:Fl 3 <fdl,fd2,fd3>:CpD 1), [Vfc 1 ,fc2,fc3:ArC 2] [Vfdl ,fd2,fd3:ArD2](< fc 1 ,fc2,fc3>:CpC 2 A <fcl,fdl>:F2 A <fc2,fd2>:F2 A <fc3,fd3>:F2 3 <fdl,fd2,fd3>:CpD 2), Dl= e C2, pel: A T Q J , pc2: ATQ^, pc3 :Ar^j , p d l : A i j j 2 , pd2: A r j j 2 , pd3: Arj-)2, < pcl,pc2,pc3>:Cpci, pel :Arjji , <pcl,pel>:Fl, <pel,pdl>:F2, pe2 :Ar D i , <pc2,pe2>:Fl, <pe2,pd2>:F2, pe3:Ar D 1 , <pc3,pe3>:Fl, <pe3,pd3>:F2 -» <pdl,pd2,pd3>:Cpj)2 [Vfcl,fc2,fc3:Ar c l] [Vfdl,fd2,fd3:ArD 1](< fcl,fc2,fc3>:Cp c l A <fcl,fdl>:Fl A <fc2,fd2>:Fl A <fc3,fd3>:Fl 3 <fdl,fd2,fd3>:CpD 1), [Vfcl,fc2,fc3:ArC 2] [Vfdl,fd2,fd3:ArD 2](< fcl,fc2,fc3>:CpC 2 A <fcl,fdl>:F2 A <fc2,fd2>:F2 A <fc3,fd3>:F2 3 <fdl,fd2,fd3>:CpD 2), D l = e C 2 , p c l : A r c l , p c 2 : A r c l , p c 3 : A r c l , p d l : A r D 2 , p d 2 : A r D 2 , pd3: A r D 2 , <pcl,pc2,pc3>:Cp c l , *[3f:ArD 1]*(<pcl,f>:Fl A <f,pdl>:F2), *[3f:ArD1]*(<pc2,f>:Fl A <f,pd2>:F2), *[3f:ArD1]*(<pc3,f>:Fl A <f,pd3>:F2) -> <pdl,pd2,pd3>:Cpj)2 [Vfcl,fc2,fc3:Ar c l] [Vfdl,fd2,fd3:ArD 1](< fcl,fc2,fc3>:Cp c l A <fcl,fdl>:Fl A <fc2,fd2>:Fl A <fc3,fd3>:Fl 3 <fdl,fd2,fd3>:CpD 1), [Vfcl,fc2,fc3:ArC 2] [Vfdl,fd2,fd3:ArD 2](< fcl,fc2,fc3>:CpC 2 Appendix B: Proof of Lemma 3.3.3.1 137 A <fcl,fdl>:F2 A <fc2,fd2>:F2 A <fc3,fd3>:F2 3 <fdl,fd2,fd3>:CpD2)> Dl= e C2, pel: Ar^-ij, pc2:ArQi, p c 3 : A r £ 1 , pdl:Arj)2» pd2:Arj)2» P d 3 : Arj)2> < pcl,pc2,pc3>:Cp c l , *<pcl,pdl>: FC[F1,C1,D1,F2,C2,D2], *<pc2,pd2>: FC[F1,C1,D1,F2,C2,D2], *<pc3,pd3>: FC[F1,C1,D1,F2,C2,D2] -» <pdl,pd2,pd3>:Cpj32 [Vfcl,fc2,fc3:Ar c l] [Vfdl,fd2,fd3:ArDi](< fcl,fc2,fc3>:Cp c l A <fcl,fdl>:Fl A <fc2,fd2>:Fl A <fc3,fd3>:Fl 3 <fdl,fd2,fd3>:CpD 1), [Vfcl,fc2,fc3:ArC 2] [Vfdl,fd2,fd3:ArD 2K< fcl,fc2,fc3>:CpC 2 A <fcl,fdl>:F2 A <fc2,fd2>:F2 A <fc3,fd3>:F2 3 <fdl,fd2,fd3>:CpD2)> Dl= e C2 -> *[Vfcl,fc2,fc3:Ar c l] *[Vfdl,fd2,fd3:ArD 2]*(< fcl,fc2,fc3>:Cp c l A <fcl,fdl>: FC[F1,C1,D1,F2,C2,D2] A <fc2,fd2>: FC[F1,C1,D1,F2,C2,D2] A <fc3,fd3>: FC[F1,C1,D1,F2,C2,D2] 3 <fdl,fd2,fd3>:CpD 2) End of proof of lemma 3.3.3.1 Appendix C: Proof of Theorem 3.3.4.1 138 APPENDIX C Proof of Theorem 3.3.4.1 3.3.4.1 Theorem The sequent -> < A r , = a , Sr, Tg, Cp>:Cat is derivable in NaDSet. Proof of Theorem 3.3.4.1 In the proof of the theorem we use a notation similar to the one used in the previous lemmas. A r ^ , =ax> S F £ , T g ^ , Q>X' w * t n X being A , B, C, D, E, possibly subscripted, are used as second order parameters while X alone will abbreviate the tuple <Ar^, =&X' ^ r X ' T&X' ^P 5" • A derivation of -> <Ar,=a,Sr,Tg,Cp>:Cat can be obtained from a derivation of -> Category[Ar,=a,Sr,Tg,Cp] by one application of - » { } rule and the definition of Cat. To derive the latter sequent it is necessary to provide a derivation of each sequent of the form ->Ax[Ar ,= a ,Sr ,Tg,Cp] (Tl) where Ax[Ar,= a,Sr,Tg,Cp] is one of the axioms c l to c20. Derivations will be provided for the complicated and "interesting" axioms only. 3.3.4.1.1 The sequent T l is derivable when Ax is the axiom c3. A derivation for it follows. Fl= eF2, F2=eF3 -» Fl= eF3 (lemma 3.3.1.1) Cl= e C2, C2=eC3 -> Cl= e C3 (lemma 3.3.1.1) Appendix C: Proof of Theorem 3.3.4.1 139 Dl= e D2, D2=eD3 -> Dl= e D3 (lemma 3.3.1.1) thinning <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3J)3>:Ar, Fl= eF2, Cl= e C2, Dl= e D2, F2=eF3, C2=eC3, D2=eD3 -> Fl= eF3, Cl= e C3, Dl= e D3 <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3J)3>:Ar -> *( *<F1,C1,D1> ^ a <F2,C2,D2> A *<F2,C2,D2> ^ a <F3,C3,D3> 3 *<F1,C1,D1> ^ a <F3,C3,D3> ) ^ *[Vf,g,h:Ar]( f = a g A g ^ a h 3 f ^ a h ) 3.3.4.1.2 The sequent T l is derivable when Ax is the axiom c6. In the following derivation, al , a2 are first order parameters: al a2, D l = e D2 -> al a2 (lemma 3.3.1.1) <al,a2>:F3 -> <al,a2>:F3 *(<al,a2>:F3 => al a2), D l = e D 2 , <al,a2>:F3 -> al =a£>2a2 (a) (<al,a2>:F3 3 al = a D 1 a2), D l = e D2 -> *(<al,a2>:F3 3 al =^2 a2) ( f = a D l S 3 <al,a2>:F3), D l = e D 2 -> * (a l= a D 2 a2 3 <al,a2>:F3 ) (similar to a) (<al,a2>:F3 = al = a D 1 a2), D l = e D 2 -> *(<al,a2>:F3 = a l = a D 2 a 2 ) a l : A r D 2 -> a l : A r D 2 a2:Arj)2 -> a2:Arj)2 *[Vf,g:ArD 1](<g>:F3 s f = a D 1 g), D l = e D 2 , a k A r r ^ , a2:ArD 2 -> (<al,a2>:F3 a al =302 a2) Appendix C: Proof of Theorem 3.3.4.1 140 [Vf,g:ArD1](<f,g>:F3 = f = a D 1 g), D l = e D2 -> *[Vf,g:ArD2](<f,g>:F3 = f=aD2g) C 3 = e D l , D l =_D2 -» C 3 = e D 2 (lemma 3.3.1.1) D3 =- D l , D l =„ D2 -> D3 =e D2 (lemma 3.3.1.1) thinning <Fl ,Cl ,Dl> :Ar , <F2,C2JJ2>:Ar, <F3,C3,D3>:Ar, F l = e F2, C l = c C2, D l =e D2, C 3 = e D l , D 3 = e D l , [Vf,g:AxD1](<f,g>:F3 = f ^ i g ) , -» * ( C 3 = e D 2 A D 3 = e D 2 A [Vf,g:ArD2](<f,g>:F3 = f = a D 2 g ) ) <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3,D3>:Ar, *<F1,C1,D1> ^ a <F2,C2,D2>, * « F l , C l , D l > , < F 3 , C 3 , D 3 » : T g -* * « F 2 , C 2 , D 2 > , < F 3 , C 3 , D 3 » : T g -> *[Vf,g,a :Ar]*(f^gA<f,a>:Tg3<g,a>:Tg) 3.3.4.1.3 The sequent T l is derivable when Ax is the axiom c l 1. In the following derivation al , a2 are first order parameters. al =aQ a2 —> al =&Q A 2 al =AQ a2 -> al =AQ a2 -» (al =ac a2) = (al = a C a2) a l : A r Q a2:Ar^ -» ( a l = a £ > a 2 ) s (al= a^a2) thinning -* * [Vf,g:Arc](*<f,g>:Id[C] - (f= a C g)) -> C=„C (lemma 3.3.1.1) Appendix C: Proof of Theorem 3.3.4.1 141 -> *(C= eC A C= e C A [Vf,g:Axc](<f,g>:M[C] = f = a C g ) -» * « F , C , D > , < H [ C ] , C , C » : S r C:Cat -> <Id[C],C,C>:Ar (consequence of lemma 3.3.2.1) thinning Functor[F,C,D] -> *[3a:Ar] « F , C , D > , a > : S r *<F,C,D>:Ar -» [3a:Ax] «F ,C ,D> ,a> :Sr -» *[Vf:Ar][3a:Ax] <f,a>:Sr 3.3.4.1.4 The sequent T l is derivable when Ax is the axiom cl5. T l will follow from (1) <Fl,Cl,Dl>:Ar, <F2,C2,D2>:Ar, D 3 = e D l , D 3 = e C 2 -> <FC[Fl ,Cl,Dl,F2,C2,D2],Cl,D2>:Ar and (2) D 3 = e D l , D 3 = C C 2 -> « F 1 , C 1 , D 1 > , < F 2 , C 2 , D 2 > , <FC[F 1 ,C 1 ,D 1 ,F2,C2,D2],C 1 , D 2 » : C p . 3.3.4.1.4.1 The sequent (1) is derived next: D3 = e D l , D3 =e C2 -> D l =e C2 (consequence of lemma 3.3.1.1) <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, D l = c C2 -> <FC[Fl ,Cl,Dl,F2,C2,D2],Cl,D2>:Ar (consequence of lemma 3.3.3.1) cut <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, D 3 = e D l , D3 =e C2 -> < FC[Fl,Cl,Dl,F2,C2,D2],Cl,D2>:Ar 3.3.4.1.4.2 The above sequent (2) is derivable. In the following derivation, al , a2 and a3 are first order parameters. Appendix C: Proof of Theorem 3.3.4.1 142 a3:Arrj)i -> a3:Axj)j <al,a3>:Fl -> <al,a3>:Fl <a3,a2>F2 -» <a3,a2>F2 a3 :Ar D 1 , <al,a3>:Fl, <a3,a2>F2 -> *[3h : A r D 1 ] * ( <al,h>:Fl A <h,a2>F2) *[3h : A r D 1 ] * ( <al,h>:Fl A <h,a2>F2 ) -> [3h : A r D 1 ] ( <al,h>:Fl A <h,a2>F2) *[3h : A r D 1 ] * ( <al,h>:Fl A <h,a2>F2 ) -> [3h : A r D 1 ] ( <al,h>:Fl A <h,a2>F2 ) ( same -> [3h:ArD 1]( <al,h>:Fl A <h,a2>F2 ) -> *<al,a2>:FC[Fl,Cl,Dl,F2,C2,D2] m ZL1:ATQI, a2:Ar£)2 -» (<al ,a2>:FC[F 1 ,C 1 ,D 1 ,F2,C2,D2] as(i)) = [3h:ArD1](<al,h>:Fl A <h,a2>F2) [3h:Ar D 1 ](<al,h>:Fl A <h,a2>F2) thinning = [3h:ArDi](<al,h>:Fl A <h,a2>F2 )) -> *[Vf:Ar c l ] [Vg:Ar D 2 ] ( <f,g>:FC[Fl,Cl,Dl,F2,C2,D2] ^ [3h:ArD1](<f,h>:Fl A <h,g>F2)) D3 = e D l , D3 = e C2 -» D l = e C2 (consequence of lemma 3.3.1.1) - > C l = e C l (lemma 3.3.1.1) ->D2= e D2 (lemma 3.3.1.1) D 3 = e D l , D3= e C2 -> *( C l =e C l A D l =e C2 A D2 = e D2 A [Vf :Ar c l ] [Vg:Ar D 2 ] ( <f,g>:FC[Fl,Cl,Dl,F2,C2,D2] = [3h:ArD1](<f,h>:Fl A<h,g>F2 ))) D 3 = e D l , D 3 = e C 2 -> * « F 1 , C 1 , D 1 > , <F2,C2,D2>, <FC [Fl ,Cl ,Dl ,F2 ,C2,D2] ,Cl ,D2»:Cp Appendix C: Proof of Theorem 3.3.4.1 143 3.3.4.1.4.3 Finally, a derivation of T l from (1) and (2) is given. <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, D 3 = e D l , D 3 = e C 2 -» <FC[Fl ,Cl,Dl,F2,C2,D2],Cl,D2>:Ar (1) D 3 = e D l , D 3 = e C 2 -> * « F 1 , C 1 , D 1 > , <F2,C2,D2>, <FC [Fl ,Cl ,Dl ,F2 ,C2,D2] ,Cl ,D2»:Cp (2) <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, D 3 = e D l , D3= e C2 -> *[ 3h:Ar] « F 1 , C 1 , D 1 > , <F2,C2,D2>,h>:Cp <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3,D3>:Ar, * « F 1 , C 1 , D 1 > , <F3,C3,D3> >:Tg, * « F 2 , C 2 , D 2 > , <F3,C3,D3»:Sr -> [3h:Ar] « F 1 , C 1 , D 1 > , <F2,C2,D2>,h>:Cp thinning <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3,D3>:A -> * ( « F l , C l J ) l > , < F 3 , C 3 , D 3 > > : T g A « F 2 , C 2 , D 2 > , <F3,C3,D3»:Sr 3 [ 3h:Ar] « F 1 , C 1 , D 1 > , <F2,C2,D2>,h>:Cp) -» *[Vf,g,a:Ar]( <f,a>:Tg A <g,a>:Sr => [3h:Ar] <f,g,h>:Cp) 3.3.4.1.5 The sequent T l is derivable when Ax is the axiom cl7. A derivation with first order parameters al, a2, a3, follows: a3:Arj)i -> a3:Arj)j <al,a3>:Fl -> <al,a3>:Fl <a3,a2>:F2 -> <a3,a2>:F2 a3 :Aibi , <al,a3>:Fl, <a3,a2>:F2 -> *[3h:ArD1]*(<al,h>:Fl A <h,a2>:F2) <al,a2>:F4 -> <al,a2>:F4 ^•.ATQI, <al,a3>:Fl, <a3,a2>:F2, *([ 3h:Arj)i](<al,h>:Fl A <h,a2>:F2) 3 <al,a2>:F4) Appendix C: Proof of Theorem 3.3.4.1 144 -» <al,a2>:F4 <al,a2>:F3 -» <al,a2>:F3 *(<al,a2>:F3 3 *[3h:ArD1]*(<al,h>:Fl A <h,a2>:F2)), ([3h:ArD1](<al,h>:Fl A<h,a2>:F2) 3 <al,a2>:F4), <al,a2>:F3 -> <al,a2>:F4 *(<al,a2>:F3 = [3h:ArD 1](<al,h>:Fl A <h,a2>:F2)), *(<al,a2>:F4 = [3h:ArD 1](<al,h>:Fl A <h,a2>:F2)), <al,a2>:F3 -> <al,a2>:F4 &1:ATQ3, C l =e C3 -> alrAr^j al :Ar^3, C l = e C 3 -> a h A r ^ a2:ArD3, D 2 = e D 3 -> a2 :Ar D 2 a2 :Ar D 3 , D 2 = e D 3 -> a2 :Ar D 2 (lemma 3.3.1.1) (lemma 3.3.1.1) (lemma 3.3.1.1) (lemma 3.3.1.1) C l = e C 3 , D 2 = e D 3 , *[Vf:Ar c l ]*[Vg:Ar D 2 ](<f ,g>:F3 - [3h:ArD 1](<f,h>:Fl A <h,g>:F2)), *[Vf:Ar c l ]*[Vg:Ar D 2 ](<f ,g>:F4 = [3h:ArD 1](<f,h>:Fl A <h,g>:F2)), a l : A r C 3 , a2 :Ar D 3 , <al,a2>:F3 -> <al,a2>:F4 (i) C l = e C 3 , D 2 = e D 3 , [Vf:Ar c l ][Vg:Ar D 2 ](<f,g>:F3 = [3h:ArD 1](<f,h>:Fl A <h,g>:F2)), [Vf:Ar c l ][Vg:Ar D 2 ](<f,g>:F4 = [3h:ArD 1](<f,h>:Fl A <h,g>:F2)) -> *[Vf:Ar C 3 ]*[Vg:Ar D 3 ]*(<f,g>:F3 3 <f,g>:F4) C l = e C 4 , D2= e D4, [Vf:Ar c l ][Vg:Ar D 2 ](<f,g>:F3 = [3h:ArD 1](<f,h>:Fl A <h,g>:F2)), [Vf:Ar c l ][Vg:Ar D 2 ](<f,g>:F4 = [3h:ArD 1](<f,h>:Fl A <h,g>:F2)) - » [Vf:ArC 4][Vg:ArD 4](<f,g>:F4 3 <f,g>:F3) (similar to (i) Appendix C: Proof of Theorem 3.3.4.1 C l = e C3, C l = e C4 -> C3 =. C4 (lemma 3.3.1.1) D2 =. D3, D2 = e D4 -* D3 =. D4 (lemma 3.3.1.1) C l = e C 3 , D 2 = e D 3 , [Vf:Aj- c l][Vg:ArD 2](<f,g>:F3 = [3h:ArD1](<f,h>:Fl A <h,g>:F2)), C l = e C 4 , D2= e D4, [Vf:Ar c l][Vg:ArD 2](<f,g>:F4 - [3h:ArD1](<f,h>:Fl A <h,g>:F2)) -> *(C3 = e C4 A D3 =e D4 A [Vf:ArC 3][Vg:ArD 3](<f,g>:F3 3 <f,g>:F4) A [Vf:ArC4][Vg:ArD4](<f,g>:F4 3 <f,g>:F3) ) <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3,D3>:Ar, <F4,C4,D4>:Ar, * « F 1 , C 1 , D 1 > , <F2,C2,D2>, <F3,C3,D3»:Cp, * « F 1 , C 1 , D 1 > , <F2,C2,D2>, <F4,C4,D4»:Cp -> *<F3,C3,D3> = a <F4,C4,D4> thinning -> *[Vf,g,h,k:Ar] *( <f,g,h>:Cp A <f,g,k>:Cp 3 h = a k ) 3.3.4.1.6 The sequent T l is derivable when Ax is the axiom cl8. First we derive the sequents: (1) « F 1 , C 1 , D 1 > , <F2,C2,D2»:Sr -> « F 2 , C 2 , D 2 > , <F2,C2,D2»:Sr (2) « F 1 , C 1 , D 1 > , <F2,C2,D2»:Sr -> « F 2 , C 2 , D 2 > , < F 2 , C 2 , D 2 » : T g (3) <Fl ,Cl ,Dl>:Ar , « F 1 , C 1 , D 1 > , <F2,C2,D2»:Sr - 4 « F 2 , C 2 , D 2 > , <F1,C1,D1>, < F l , C l , D l » : C p 3.3.4.1.6.1 A derivation of (1) with first order parameters al and a2 follows: <al,a2>:F2 -> <al,a2>:F2 a l = a C 1 a 2 , C 2 = e C l -> a l = a C 2 a 2 (lemma 3.3.1.1) Appendix C: Proof of Theorem 3.3.4.1 146 (i) *(<al,a2>:F2 3 al = a C 1 a2), C2 = e C l -» *(<al,a2>:F2 3 al = a C 2 a2) ( a l = a C 1 a 2 3 <al,a2>:F2), C 2 = e C l -> ( a l = a C 2 a 2 3 <al,a2>:F2)(similar to i) *(<al,a2>:F2 = al = a C 1 a2), C 2 = e C l -» *(<al,a2>:F2 m al = a C 2 a2) a l : A r C 2 , C 2 = e C l -> a l : A r c l (lemma 3.3.1.1) a2 :Ar C 2 , C 2 = e C l -> a 2 : A r c l (lemma 3.3.1.1) C2 = e C l , *[Vf,g:Arcl](<f,g>:F2 = f = a C 1 g), al :AxQ 2 , a2:ArQ 2 -> (<al,a2>:F2 = al = a C2 a 2 ) C 2 = e C l , [Vf,g:Arcl](<f,g>:F2 - f = a C 1 g ) -* *[Vf,g:ArC2](<f,g>:F2 = f = a C 2 g ) -> C 2 = e C 2 D 2 = e C l , C 2 = e C l -> D 2 = e C 2 C2 = e C l , D2 =e C l , [Vf,g:Arcl](<f,g>:F2 * f = a C 1 g) -> *(C2= e C2 A D 2 = e C 2 A [Vf,g:ArC2](<f,g>:F2 = f = a C 2 § ) ) * « F 1 , C 1 , D 1 > , < F 2 , C 2 , D 2 » : S r -» * « F 2 , C 2 , D 2 > , < F 2 , C 2 , D 2 » : S r 3.3.4.1.6.2 The derivation of (2) is similar to that of (1) and is omitted. 3.3.4.1.6.3 To derive (3) it is necessary to derive the following two sequents: (a) <Fl,Cl,Dl>:Ar, D2 =e C l , [Vf,g:Arcl](<f,g>:F2 = f = a C 1 g), a l : A r c l , a2: A r D 1 -> *( <al,a2>:Fl 3 [3h:ArD2](<al,h>:F2 A <h,a2>:Fl)) (b) <Fl,Cl,Dl>:Ar, C2 = e C l , D2 = e C l , *[Vf,g:Arcl](<f,g>:F2 = f = a C 1 g), a l : A r c l , a2: ArDl -> *( [3h:ArD2](<al,h>:F2 A <h,a2>:Fl) 3 <al,a2>:Fl) (lemma 3.3.1.1) (lemma 3.3.1.1) 3.3.4.1.6.3.1 First we derive (a) using al and a2 as first order parameters. Appendix C: Proof of Theorem 3.3.4.1 147 a l : A r c l , D 2 = e C l -> a l : A r D 2 <al,al>:F2 -> <al,al>:F2 <al,a2>:Fl -> <al,a2>:Fl D 2 = e C l , <al,al>:F2, a l : A x c l , <al,a2>:Fl -> * [3h:ArD2]*(<al,h>:F2A<h,a2>:Fl) Cl:Cat, al:AxQj -» al =aci al (direct consequence of cl) thinning <Fl,Cl,Dl>:Ar, D2 = e C l , * (al= a C 1 al => <al,al>:F2), a l : A r c l , a2: Aijji, <al,a2>:Fl -> [3h:ArD2](<al,h>:F2 A <h,a2>:Fl) al:Arci -» a L A r ^ i a l :Ar^j al :Ard thinning <Fl,Cl,Dl>:Ar, D2 = e C l , *[Vf,g:Arcl](<f,g>:F2 = f = a C 1 g ) , a l : A r c l , a2: A r D 1 , <al,a2>:Fl -> [3h:ArD2](<al,h>:F2 A <h,a2>:Fl) <Fl,Cl,Dl>:Ar, D 2 = e C l , [Vf,g:Arcl](<f,g>:F2 = f = a C i g ) , a l : A r c l , a2: Aipi -> *( <al,a2>:Fl =5 [3h:ArD2](<al,h>:F2 A <h,a2>:Fl)) 3.3.4.1.6.3.2 A derivation of the sequent (b) is given next. In this, the symbols al, a2 and a3 are first order parameters: al:Arci -» ahAiQi SL3:ATQI -» a3:AiQi a l =aCl a 3 ~> a l =aCl a 3 a3 = a C 1 al -» a3 = a C 1 al (lemma 3.3.1.1) * [ V f , g : A r c l ] * ( f = a C 1 g 3 g = a C l f ) , a l : A r c l , a 3 : A r c l , a l =aCl a 3 -» a 3 =aCl a l Appendix C: Proof of Theorem 3.3.4.1 148 *Cl:Cat, a h A r ^ j , * a3:Ar^i, al =a^j a3 -> a3=a^j al (c2 & thinning) a3:Ar D 2» D2 = e C l -> * a 3 : A r c l (lemma 3.3.1.1) cut Cl:Cat, D 2 = e C l , a l i A r ^ , a3:Arj)2» al =aci a3 ~* a 3 = a C l a * <a3,a2>Fl -> <a3,a2>Fl <al,a2>Fl -> <al,a2>Fl Cl:Cat, * (a3= a C 1 al A <a3,a2>Fl => <al,a2>Fl), D 2 = e C l , al =aci a3, a l : A r £ i , a3:Arj)2> <a3,a2>:Fl -> <al,a2>:Fl a3 :Ar D 2 , D 2 = e C l -> a 3 : A r c l (lemma 3.3.1.1) ahAiQi -» al :Ar^j a2:Ar rj )j -» a2:Aij)i Cl:Cat, *[Vfc,gc:Ar c l ]*[Vfd:Ar D 1 ] ( f c = a C 1 gc A <fc,fd>Fl 3 <gc,fd>Fl), D 2 = e C l , al = a Cl a3, a l : A r £ i , a2:ArT3i, a3:Ar£>2» <a3,a2>:Fl -> <al,a2>:Fl *<Fl,Cl,Dl>:Ar, D2 =e C l , al = a C 1 a3, al :Arrji , a 2 : A r D i , a3:ArD2> <a3,a2>:Fl -» <al,a2>:Fl (f5 & thinning) ahAiQi -> a l :Ar£ i a 3 : A r D 2 A D 2 = e C l -> a 3 : A r c l (lemma 3.3.1.1) <al,a3>:F2 -> <al,a3>:F2 <Fl,Cl,Dl>:Ar, D 2 = e C l , *[Vf,g:Arcl]*(<f,g>:F2 3 f = a C i g ) , a l : A r c l , a 2 : A r D i , a3:ArD2, <al,a3>:F2, <a3,a2>:Fl - * <al,a2>:Fl <Fl,Cl,Dl>:Ar, D 2 = e C l , [Vf,g:Arcl](<f,g>:F2 - f = a C l g ) , a l : A r c l , a2: A r D 1 , *[3h:ArD2](<al,h>:F2 A <h,a2>:Fl) Appendix C: Proof of Theorem 3.3.4.1 149 -» <al,a2>:Fl thinning <Fl ,Cl ,Dl> :Ar , D 2 = e C l , [Vf,g:Arcl](<f,g>:F2 = f = a C 1 g ) , a l : A r c l , a2: A i b i -» *( [3h:ArD2](<al,h>:F2 A <h,a2>:Fl) => <al,a2>:Fl) 3.3.4.1.6.3.3 A derivation of (3) from (a) and (b) follows: (a) (b) <Fl ,Cl ,Dl> :Ar , D 2 = e C l , [Vf,g:Arcl](<f,g>:F2 = f = a C i g ) , a l : A r c l , a2: A r D 1 -> *( <al,a2>:Fl = [3h:ArD2](<al,h>:F2 A <h,a2>:Fl)) <Fl ,Cl ,Dl> :Ar , D 2 = e C l , [Vf,g:Arcl](<f,g>:F2 = f = a C l g) -> *[Vf:Ar c l ]*[Vg: ArrjiK <f,g>:Fl = [3h:ArD2](<f,h>:F2 A <h,g>:Fl)) C 2 = e C l -> C 2 = e C l (lemma 3.3.1.1) D 2 = e C l - > D 2 = e C l (lemma 3.3.1.1) <Fl ,Cl ,Dl> :Ar , C 2 = e C l , D 2 = e C l , [Vf,g:Arcl](<f,g>:F2 EE f = a C l g ) -» *( C2 = e C l A D2 = e C l A D l = e D l A [Vf:Ar c l ][Vg: A r D 1 ] ( <f,g>:Fl - [3h:ArD2](<f,h>:F2 A <h,g>:Fl))) <Fl ,Cl ,Dl> :Ar , * « F 1 , C 1 , D 1 > , <F2,C2,D2»:Sr -> * « F 2 , C 2 , D 2 > , <F1,C1,D1>, < F l , C l , D l » : C p 3.3.4.1.6.4 Finally, T l can be obtained from (1), (2) and (3) by the following simple derivation. (1) (2) (3) thinning <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, « F 1 , C 1 , D 1 > , <F2,C2,D2»:Sr -» ( « F 2 , C 2 , D 2 > , <F2,C2,D2»:Sr A « F 2 , C 2 , D 2 > , < F 2 , C 2 , D 2 » : T g A « F 2 , C 2 , D 2 > , <F1,C1,D1>, < F l , C l , D l » : C p ) Appendix C: Proof of Theorem 3.3.4.1 150 -> *[Vf,a:Ar]*( <f,a>:Sr =3 <a,a>:Sr A <a,a>:Tg A <a,f,f>:Cp) 3.3.4.1.7 The sequent T l is derivable when Ax is the axiom c20. In the following derivation c, d, dl and d2 are first order parameters, and the D and C notations previously introduced to represent five tuples is used again. Further the notation <F(12)3, C(12)3, D(12)3> represents a functor resulting from first composing functors <F1, C l , Dl> and <F2, C2, D2> and then composing the result with the functor <F3, C3, D3>. The triple <F1(23), Cl(23), Dl(23) > has a similar meaning. d l : A r D 1 2 , D2 = e D12 -> d l : A r D 2 (lemma 3.3.1.1) <d2,dl>:F2 -> <d2,dl>:F2 <dl,d>:F3 -> <dl,d>:F3 <d2,dl>:F2, dl:Aim2, <dl,d>:F3, D2= e D12 -> *[3h:ArD2]*(<d2,h>:F2 A <h,d>:F3) <d2,d>:F23 -» <d2,d>:F23 <d2,dl>:F2, *([3h:ArD2](<d2,h>:F2 A <h,d>:F3) 3 <d2,d>:F23 ), d l : A r D 1 2 , <dl,d>:F3, D2= e D12 -> <d2,d>:F23 d2:AxDl, D l = e C 2 3 -> d 2 : A r C 2 3 (lemma 3.3.1.1) d : A rD(12)3> D3= e D23, D3= eD(12)3 -> d : A r D 2 3 (lemma 3.3.1.1) thinning d 2 : A r D 1 , <d2,dl>:F2, *[Vf:ArC 2 3]*[Vg:ArD 2 3]([3h:ArD 2](<f,h>:F2 A <h,g>:F3) = <f,g>:F23), d l : A r D 1 2 , <dl,d>:F3, d : A r D ( 1 2 ) 3 , D2 = eD12, D l =e C23, D3 = eD23, D3 =e D(12)3 ^ <d2,d>:F23 Appendix C: Proof of Theorem 3.3.4.1 151 d2:Aij-)i ^ d 2 : A r £ ) i <c,d2>:Fl -» <c,d2>:Fl d 2 : A r D 1 , <c,d2>:Fl, <d2,dl>:F2, [Vf:ArC23][Vg:ArD23]([3h:ArD2](<f,h>:F2 A <h,g>:F3) = <f,g>:F23), d l : A r D 1 2 , <dl,d>:F3, d:ArD(i2)3, D2 = e D12, D l = e C23, D3 = e D23, D3 = e D(12)3 -> *[3h:ArD 1]*(<c,h>:Fl A <h,d>:F23) *[3h:ArD 1]*(<c,h>:Fl A <h,dl>:F2), [Vf:ArC23][Vg:ArD23]([3h:ArD 2](<f,h>:F2 A <h,g>:F3) * <f,g>:F23), d l : A r D 1 2 , <dl,d>:F3, d:Ar D ( 1 2 )3 , D2 =e D12, D l =e C23, D3 = e D23, D3 =e D(12)3 -> [3h:ArD 1](<c,h>:Fl A <h,d>:F23) <c,dl>:F12 -> <c,dl>:F12 *(<c,dl>:F12 => [3h:ArD 1](<c,h>:Fl A <h,dl>:F2)), [Vf:ArC 23][Vg:ArD23]([3h:ArD 2](<f,h>:F2 A <h,g>:F3) = <f,g>:F23), d l : A r D 1 2 , <c,dl>:F12, <dl,d>:F3, d : A r D ( 1 2 ) 3 , D2 =e D12, D l = e C23, D3 =e D23, D3 =e D(12)3 -> [3h:ArD 1](<c,h>:Fl A <h,d>:F23) c : A rC(12)3> C12=eC(12)3 -> c : A r c l 2 (lemma 3.3.1.1) d l : A r D 1 2 "* d l : A r D 1 2 thinning * [Vf :Ar c l 2 ] * [Vg :Ar D 1 2 ] (< f ,g> :F12- [3h:ArD 1](<f,h>:Fl A <h,g>:F2)), [Vf:ArC23][Vg:ArD23]([3h:ArD 2](<f,h>:F2 A <h,g>:F3) - <f,g>:F23), d l : A r D 1 2 , <c,dl>:F12, <dl,d>:F3, D2 =. D12, D l = e C23, D3 =e D23, D3 = e D(12)3, C12 = e C(12)3, Appendix C: Proof of Theorem 3.3.4.1 152 C:AI-QI2)3, drAijjQ2)3 ~* Ph:Arrjj](<c,h>:Fl A <h,d>:F23) [Vf:Ar c l 2][Vg:ArD 12](<f,g>:F12 = [3h:ArD1](<f,h>:Fl A <h,g>:F2)), [Vf:ArC23][Vg:ArD23]([3h:ArD2](<f,h>:F2 A <h,g>:F3) = <f,g>:F23), *[3h:ArD12]*(<c,h>:F12 A <h,d>:F3), D2 = e D12, D l =e C23, D3 = e D23, D3 = c D(12)3, C12 = e C(12)3 , c : A r C(12)3' d : A r D(12)3 -» [3h:ArD1](<c,h>:Fl A <h,d>:F23) <c,d>:F(12)3 -> <c,d>:F(12)3 <c,d>:Fl(23) -> <c,d>:Fl(23) [Vf:Ar c l2][Vg:ArD 1 2](<f,g>:F12= p h r A T D ^ K ^ r F l A<h,g>:F2)), [Vf :Ax C 23] [Vg :Ar D 2 3] ( [3h :Ar D 2 ]« f ,h> :F2 A <h,g>:F3) = <f,g>:F23), *(<c,d>:F(12)3 3 [3h:ArD12](<c,h>:F12 A <h,d>:F3)), *(ph:ArD 1](<e,h>:Fl A <h,d>:F23) 3 <c,d>:Fl(23)), D2 = e D12, D l =e C23, D3 = e D23, D3 =e D(12)3, C12 =e C(12)3 , c : A rC(12)3> d :ArD(12)3> <c,d>:F(12)3 -> <c,d>:Fl(23) c : A r C(12)3 c : A rC(12)3 d : A r D(12)3 ~> d : A rD(12)3 c : A rC(12)3> C 1 =c C 1 2> C 1 2 =e C< 1 2) 3' C 1 =e C1<23) —» c:Ar^i(23) (lemma 3.3.1.1) d : A r D(12)3' D3= eD(12)3, D3= e D23, D23= eDl(23) -> d:Arj)j^23) (lemma 3.3.1.1) thinning [Vf:Ar c l 2][Vg:ArD 1 2](<f,g>:F12 = [3h:ArD1](<f,h>:Fl A <h,g>:F2)), [Vf:ArC23][Vg:ArD23]([3h:ArD2](<f,h>:F2 A <h,g>:F3) = <f,g>:F23), *[Vf:ArC ( 12 ) 3]*[Vg:ArD ( 12 ) 3](<f,g>:F(12)3 - [3h:ArD12](<f,h>:F12 A <h,g>:F3)), Appendix C: Proof of Theorem 3.3.4.1 153 *[Vf:Ar c l (23)]*[Vg:ArD 1 (23)]([3h:ArD 1](<f,h>:Fl A <h,g>:F23) a<f,g>:Fl(23)), Cl= eC12, Dl= e C2, D2=eD12, C2=eC23, D2=eC3, D3=eD23, C12=eC(12)3, D12=eC3, D3=eD(12)3, Cl= eCl(23), Dl= eC23, D23=eDl(23), c : A r C ( 1 2 ) 3 , d:Ar D ( 1 2 )3 , <c,d>:F(12)3 -> <c,d>:Fl(23) (i) [Vf:Ar c l 2][Vg:Ar D 1 2 ](<f,g>:F12 = p h r A r j ^ K ^ h x F l A <h,g>:F2)), [Vf:ArC23][Vg:ArD23]([3h:ArD2](<f,h>:F2 A <h,g>:F3) = <f,g>:F23), [Vf:ArC ( 1 2 )3][Vg:ArD ( 12)3](<f,g>:F(12)3 = [3h:ArD12](<f,h>:F12 A <h,g>:F3)), [Vf :Ar c l ( 23) ] [ v g: A r Dl(23) ] (P h : A r DlK<f ,h> :Fl * <h,g>:F23) = <f,g>:Fl(23)), Cl= eC12, Dl= e C2, D2=eD12, C2=eC23, D2=eC3, D3=eD23, C12=eC(12)3, D12=eC3, D3=eD(12)3, Cl= eCl(23), Dl= eC23,D23= eDl(23) -> *[Vf:Ar C ( 1 2 ) 3]*[Vg:Ar D ( 1 2 ) 3 ]*(<f,g>:F(12)3 3 <f,g>:Fl(23)) [Vf :Ar c l 2 ] [Vg:Ar D 1 2 ] ( [3h :Ar D 1 ] (<f ,h> :F l A <h,g>:F2) - <f,g>:F12 ), [Vf:Ar C 2 3 ] [Vg:Ar D 2 3 ] (<f ,g>:F23 - [3h:ArD2](<f,h>:F2 A <h,g>:F3)), [Vf:ArC ( 12 )3][Vg:ArD ( 12)3]([3h:ArD 1 2](<f,h>:F12 A <h,g>:F3) = <f,g>:F(12)3), [Vf:Ar c l ( 2 3 ) ] [Vg:Ar D 1 ( 23 ) ] (<f ,g>:Fl(23) = [3h:ArD 1](<f,h>:Fl A <h,g>:F23)), Cl= eC12, Dl= e C2, D2=eD12, C2=eC23, D2=eC3, D3=eD23, C12=eC(12)3, D12=eC3, D3=eD(12)3, Cl= eCl(23), Dl= eC23, D23=eDl(23), -> [ V f : A r c l ( 2 3 ) ] [ V g : A r D 1 ( 2 3 ) ] ( < f , g > : F l ( 2 3 ) 3 <f,g>:F(12)3) (similar to i) Appendix C: Proof of Theorem 3.3.4.1 154 [Vf:Ar c l 2][Vg:ArD 1 2](<f,g>:F12 = [3h:ArD1](<f,h>:Fl A <h,g>:F2)), [Vf:ArC 2 3][Vg:ArD 2 3](<f,g>:F23 « [3h:ArD2](<f,h>:F2 A <h,g>:F3)), [Vf:ArC ( 1 2 ) 3][Vg:ArD ( 1 2 )3](<f,g>:F(12)3 s [3h:ArD12](<f,h>:F12 A <h,g>:F3)), [Vf:Ar c l ( 2 3 )][Vg:ArDi( 23)](<f,g>:Fl(23) - [3h:ArD1](<f,h>:Fl A <h,g>:F23)), Cl= eC12, Dl= e C2, D2=eD12, C2=eC23, D2=eC3, D3=eD23, C12=eC(12)3, D12=eC3, D3=eD(12)3, Cl= eCl(23), Dl= eC23, D23=eDl(23) -> * ( [ V f : A r C ( 1 2 ) 3 ] [ V g : A r D ( 1 2 ) 3 ] « f , g > : F ( 1 2 ) 3 3 <f,g>:Fl(23)) A [Vf:Ar c l ( 2 3 ) ] [Vg:Ar D 1 ( 2 3 ) ] (<f ,g>:Fl(23) 3 <f,g>:F(12)3) ) C l = e C12, C12 =e C(12)3, C l =e Cl(23) -> C(12)3 =e Cl(23) (consequence of lemma 3.3.1.1) D3 = e D(12)3, D3 = e D23, D23 = e Dl(23) -» D(12)3 =e Dl(23) (consequence of lemma 3.3.1.1) C l = e C12, D l = c C2, D2 =e D12, [Vf:Ar c l 2][Vg:ArD 1 2](<f,g>:F12 = [3h:ArD1](<f,h>:Fl A <h,g>:F2)), C2 = e C23, D2 = e C3, D3 =e D23, [Vf:ArC 23][Vg:ArD 2 3](<f,g>:F23 - [3h:ArD2](<f,h>:F2 A <h,g>:F3)), C12=eC(12)3, D12= e C3, D3= eD(12)3, [Vf:ArC ( 1 2 ) 3][Vg:ArD ( 1 2 ) 3](<f,g>:F(12)3 = [3h:ArD12](<f,h>:F12 A <h,g>:F3)), C l =e Cl(23), D l =e C23, D23 =e Dl(23), [Vf:Ar c l ( 2 3 ) ][Vg:Ar D 1 ( 2 3 ) ](<f,g>:Fl(23) Appendix C: Proof of Theorem 3.3.4.1 « [ 3 h : A r D 1 ] ( < f , h > : F l A<h,g>:F23)) -> *( C(12)3 = e Cl(23) A D(12)3 = e Dl(23) A *F(12)3 = e Fl(23)) <Fl ,Cl ,Dl> :Ar , <F2,C2,D2>:Ar, <F3,C3,D3>:Ax, <F12,C12,D12>:Ar, <F23,C23,D23>:Ar,<F(12)3,C(12)3,D(12)3>:Ar, <F1 (23),C 1 (23),D 1 (23)>: A r , * « F 1 , C 1 , D 1 > , <F2,C2,D2>, <F12,C12,D12»:Cp, * « F 2 , C 2 , D 2 > , <F3,C3,D3>, <F23,C23 JD23»:Cp, * « F 1 2 , C 1 2 , D 1 2 > , <F3,C3,D3>, <F(12)3,C(12)3,D(12)3»:Cp, * « F 1 , C 1 , D 1 > , <F23,C23,D23>, <Fl(23),Cl(23),Dl(23)»:Cp -> *<F(12)3,C(12)3,D(12)3>sa<Fl(23),Cl(23),Dl(23)> thinning -> *[Vf,g,h,fg,gh,fglh,flgh:Ar]*( <f,g,fg>:Cp A <g,h,gh>:Cp A <fg,h,fglh>:Cp A <f,gh,f lgh>:Cp 3 fglh = a f lgh ) End of proof of theorem 3.3.4.1 Appendix D: Proof of Lemma 4.2.2.1 156 APPENDIX D Proof of Lemma 4.2.2.1 4.2.2.1 LvPima The sequents (1) ExpSem[true] =e {<s,v> I v=l} (2) -»ExpSem[false] =e {<s,v> I v=0} (3) -» [Ve,el,e2:Exp] ExpSem[<e.el.e2.CndExp>1 =e {<s,v> I (<s,l>:ExpSem[e] A <s,v>:ExpSem[el]) v (<s,0>:ExpSem[e] A <s,v>:ExpSem[e2])} are derivable. Proof of Lemma 4.2.2.1 A proof of (3) is provided in the sequence. Derivations of (1) and (2) are similar (and simpler) and are omitted. (3) can be obtained from the sequents (a) p:Exp, pl:Exp, p2:Exp, t:S, u:B, <t,u>:{<s,v> I (<s,l>:ExpSem[p] A <s,v>:ExpSem[pl]) v (<s,0>:ExpSem[p] A <s,v>:ExpSem[p2])} -»<t.u>:ExpSemr<p.p 1 .p2.CndExp>l (b) p:Exp, pl:Exp, p2:Exp, t:S, u:B, <t,u>:ExpSem[<p,p 1 ,p2,CndExp.>] -» <t,u>:{<s,v> I (<s,l>:ExpSem[p] A <s,v>:ExpSem[pl]) v (<s,0>:ExpSem[p] A <s,v>:ExpSem[p2])} where p, p i , p2, t, and u are first order parameters. Derivations of these sequents follow. .1 A derivation pf (a); In this, W is a second order parameter. Appendix D: Proof of Lemma 4.2.2.1 157 p:Exp -> p:Exp pl:Exp -> plrExp p2:Exp -> p2:Exp t:S -> t:S u.B -» u:B (<p,t,l>:W A <pl,t,u>:W 3 <<p,pl,p2,CndExp>,t,u>:W) <p,t,l>:W, <pl,t,u>:W -» « p . p 1 .p2.CndExp>.t.u>:W p:Exp, pl:Exp, p2:Exp, t:S, u:B, *[Ve, el,e2:Exp]*[Vs:S]*[Vv:B]( <e,s,l>:W A <el,s,v>:W z> <<e.el,e2.CndExp>,s,v>:W) <p,t,l>:W, <pl,t,u>:W -> <<p,pl,p2,CndExrj>,t,u>:W p:Exp, pl:Exp, p2:Exp, t:S, u:B, *W:ExpSemCls, thinning <p,t,l>:W, <pl,t,u>:W -> « p . p 1 .p2.CndExp>.t.u>: W WrExpSemCls -» W:ExpSemCls W:ExpSemCls -> WrExpSemCls p:Exp, plrExp, p2:Exp, t:S, u:B, WrExpSemCls, *[Vw:ExpSemCls]<p,t,l>:w, *[Vw:ExpSemCls]<pl,t,u>:w -» « p . p 1 ,p2,CndExp>,t,u>:W prExp, plrExp, p2:Exp, t:S, u:B, [Vw:ExpSemCls]<p,t,l>:w, [Vw:ExpSemCls]<pl,t,u>:w -» * [VwrExpSemCls] « p . p 1 .p2.CndExp>.t.u>:w p:Exp, pl:Exp, p2:Exp, t:S, u:B, *(*<t,l>:ExpSem[p] A *<t,u>:ExpSem[pl]) -» *<t.u>:ExpSem[<p,pl.p2,CndExp>1 p:Exp, pl:Exp, p2:Exp, Similarly (<t,0>:ExpSem[p] A <t,u>:ExpSem[p2]) -> <t.u>:ExpSem[<p.p 1 ,p2.CndExp>) p:Exp, plrExp, p2:Exp, t:S, u:B, *((<t,l>:ExpSem[p] A <t,u>:ExpSem[pl]) Appendix D: Proof of Lemma 4.2.2.1 158 v (<t,0>:ExpSem[p] A <t,u>:ExpSem[p2])) -» <t.u>:ExpSem[<p.pl.p2.CndExp>1 p:Exp, pl:Exp, p2:Exp, t:S, u:B, *<t,u>:{<s,v> I (<s,l>:ExpSem[p] A<s,v>:ExpSem[pl]) v (<s,0>:ExpSem[p] A <s,v>:ExpSem[p2])} -> <t.u>:ExpSem[<p,pl,p2,CndExp.>] .2 A derivation of (b): Let for this proof only define T for {<x,s,v> I <x,s,v>:ExpSem A rva.a 1 .a2:Explfx=<a.al.a2.CndExp> r> ((<a,s,l>:ExpSem A <al,s,v>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,v>:ExpSem))} A derivation of (b) from the sequents ( c ) ( f ) follows. (c) -» fVs:Sl<true. s,l>:T (d) -> rVs:Sl<false. s,0>:T (e) -> [Ve,el,e2:Exp][Vs:S][Vv:B]( <e,s,l>:T A <el,s,v>:T z> «e.el .e2 .CndExp>.s .v>:T) (f) -> [Ve,el,e2:Exp][Vs:S][Vv:B]( <e,s,0>:T A <e2,s,v>:T z> <<e,el,e2,CndEx£>,s,v>:T) -» *T:ExpSemCls p:Exp, pl:Exp, p2:Exp, t:S, u:B, «p.pl.p2.CndExp>.t .u>:T ->(<p,t,l>:ExpSem A <pl,t,u>:ExpSem), (<p,t,0>:ExpSem A <p2,t,u>:ExpSem) p:Exp, plrExp, p2:Exp, t:S, u:B, *rVw:ExpSemClsl«p.pl.p2.CndExp>.t.u>:w -» (<p,t,l>:ExpSem A <pl,t,u>:ExpSem), (<p,t,0>:ExpSem A <p2,t,u>:ExpSem) p:Exp, pl:Exp, p2:Exp, t:S, u:B, *<t,u>:ExpSem[<p,p 1 .p2.CndExp>l -> (*<t,l>:ExpSem[p] A *<t,u>:ExpSem[pl]), Appendix D: Proof of Lemma 4.2.2.1 159 (*<t,0>:ExpSem[p] A *<t,u>:ExpSem[p2]) p:Exp, pl:Exp, p2:Exp, t:S, u:B, <t,u>:ExpSem[<p,p 1 .p2.CndExp>] -»*< t ,u> : {<s ,v> I (<s,l>:ExpSem[p] A <s,v>:ExpSem[pl]) v (<s,0>:ExpSem[p] A <s,v>:ExpSem[p2])} To complete the proof the sequents (c) to (f) must be derived. A derivation of (e) is given next. Derivations of (c) and (d) are trivial and (f) is similar to (e). .2.1 A derivation of (e): In the following derivation, sequents (i) and (ii) are direct consequences of the identity and ordered pairs rules of section 2.4.4 and sequent (iii) is implied by the definition of ExpSem. Of course, the free ocurrences of e, el , e2, a, al , a2, s and v are first order parameters. (i) <e,s,l>:ExpSem, <el,s,v>:ExpSem, (e=a Ael=al) -> (<a,s,l>:ExpSem A <al,s,v>:ExpSem) (ii) <e,e 1 .e2.CndExp> =<a,a 1 .a2.CndExp> -> (e=a Ael=al) <e,s,l>:ExpSem, <el,s,v>:ExpSem, <e.e 1 ,e2.CndExp> =<a.al ,a2.CndExp> -> (<a,s,l>:ExpSem A <al,s,v>:ExpSem) a:Exp, al:Exp, a2:Exp, <e,s,l>:ExpSem, <el,s,v>:ExpSem, <e.e 1 .e2.CndExp> =<a.al.a2.CndExp> -»*((<a,s , l> :ExpSem A <al,s,v>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,v>:ExpSem)) <e,s,l>:ExpSem, <el,s,v>:ExpSem, *rva.a 1 .a2:Expl*(<e.e 1 .e2.CndExp> =<a,al,a2,Cnd&cp> => ((<a,s,l>:ExpSem A <al,s,v>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,v>:ExpSem))) (iii) e:Exp, el:Exp, e2:Exp, sS, v:B, cut thinning Appendix D: Proof of Lemma 4.2.2.1 160 <e,s,l>:ExpSem, <el,s,v>:ExpSem - » « e . e l .e2.CndExp>.s.v>:ExpSem thinning e:Exp, el:Exp, e2:Exp, sS, v:B, <e,s,l>:ExpSem, [Va,al ,a2:Exp] (e=<a.aLa2.CndExp> 3 ((<a,s,l>:ExpSem A <al,s,l>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,l>:ExpSem))), <el,s,v>:ExpSem, [Va,a 1 ,a2:Exp] (e 1 =<a,a 1 .a2.CndExp> 3 ((<a,s,l>:ExpSem A <al,s,v>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,v>:ExpSem))) -» *C«e.el.e2.CndExp>.s.v>:ExpSem A rVa.al.a2:ExpK<e.el.e2.CndExp> =<a.al.a2.CndExp> 3 ((<a,s,l>:ExpSem A <al,s,v>:ExpSem) v (<a,s,0>:ExpSem A <a2,s,v>:ExpSem)))) e:Exp, el:Exp, e2:Exp, sS, v:B, *<e,s,l>:T, * <el,s,v>:T -» * « e . e 1 .e2.CndExp>.s.v>:T -> *[Ve,e 1 ,e2:Exp]*[Vs:S]*[Vv:B]*( <e,s,l>:T A <el,s,v>:T 3 «e.el.e2.CndExp>.s.v>:T') End of Proof of Lemma 4.2.2.1 Appendix E: Proof of Lemma 4.2.3.1 APPENDIX E Proof of Lemma 4.2.3.1 Lemma 4.2.3.1 The following sequents are derivable. (1) -> [Vt:S] <djmTrm/,t,t>:CmdSem (2) -> [Vci,c2:Cmd][Vr,t:S]( « c j x2.SeqCmd>.r.t>:CmdSem =[3s:S]( <ci ,r,s>:CmdSem A <C2,s,t>:CmdSem )) (3) -> rVe:ExpirVci.C2:CmdirVr.s:SK «e.Ci.C2.CndCmd>.r.s>:CmdSem = (<e,r,l>:ExpSem A <CI ,r,s>:CmdSem) v ( <e,r,0>:ExpSem A <C2,r,s>:CmdSem)) (4) -> [Ve:Exp][Vc:Cmd][Vr,t:S]( <<e,c,WCrnd>,r,t>:CrndSem = [Vz:WCls[e,c]] <r,t>:z) (5) -> [Ve:Exp][Vc:Cmd][Vr,t:S]( «c.e.RWCmd>.r .t>:CmdSem = [Vz:RWCls[c,e]] <r,t>:z) Proof of Lemma 4.2.3.1 Only the proof for case (4) is given. The other cases are similar. The proof consists of two parts, each deriving one of the following sequents: (a) -» [Ve:Exp][Vc:Cmd][Vr,t:S]([Vz:WCls[e,c]] <r,t>:z z> <<e,c,WCmd>,r,t>:CmdSem) (b) -> [Ve:Exp][Vc:Cmd][Vr,t:S]( <<e,c,W^md>,r,t>:CmdSem => [Vz:WCls[e,c]] <r,t>:z ) .1 A proof for (a); <<e,c,WCmd>,s,t>:W -» <<e,c,WjCmd>,s,t>:W «e .c .WCmd>.r . t> :W -> «e .c .WCmd>.r . t> :W Appendix E: Proof of Lemma 4.2.3.1 («e . c .WCmd>.s . t> :W 3 «e .c .WCmd>.r . t> :W) . «e . c .WCmd>.s . t> :W -> «e . c .WCmd>,r . t> :W <e,r,l>:ExpSem -> <e,r,l>:ExpSem W:CmdSemCls, <c,r,s>:CmdSem -» <c,r,s>:W W:CmdSemCls, *(<e,r,l>:ExpSem A <c,r,s>:W 3 f«e .c .WCmd>.s . t> :W 3 <<e,c ,W£rM>,r , t> :W)) , <e,r,l>:ExpSem, <c,r,s>:CmdSem, «e .c .WCmd>.s . t> :W -> «e .c .WCmd>.r . t> :W r:S -» r:S s:S -> s:S t:S -> t:S r:S, s:S, t:S, W:CmdSemCls, *[Vr,s,t:S]( <e,r,l>:ExpSem A <c,r,s>:W 3 («e .c .WCmd>,s , t> :W 3 <<e,c,WCmd>,r,t>:W)), <e,r,l>:ExpSem, <c,r,s>:CmdSem, «e .c .WCmd>.s . t> :W -> «e , c .WCmd>,r . t> :W W:CmdSemCls, [Vr,s,t:S]( <e,r,l>:ExpSem A <c,r,s>:W 3 («e ,c .WCmd>,s , t> :W 3 «e ,c .WCmd>,r , l> :W)) -> *[Vr,s,t:S]*(<e,r,l>:ExpSem A <c,r,s>:CmdSem A «e . c .WCmd>.s , t> :W 3 « e . c . W C m d > j . t > : W ) [Vr:S]( <e,r,0>:ExpSem 3 «e ,c .WCmd>,r , r> :W) -> [Vr:S]( <e,r,0>:ExpSem 3 <<e,c,W^rnd>,r,r>:W) W:CmdSemCls, [Vr:S]( <e,r,0>:ExpSem 3 « e . c . W C m d > . r . r > : W ) , [Vr,s,t:S]( <e,r,l>:ExpSem A <c,r,s>:W 3 («e .c .WCmd>.s . t> :W 3 «e .c .WCmd>.r . t> :W)) -> *([Vr:S]( <e,r,0>:ExpSem 3 « e x . W C m d > . r . r > : W ) A [Vr,s,t:S] (<e,r,l>:ExpSem A <c,r,s>:CmdSem A <<e,c,WCrnd>,s,t>:W 3 « e , c , W C m d > , r , t > : W ) ) Appendix E: Proof of Lemma 4.2.3.1 163 e:Exp -» e:Exp c:Cmd -» c:Cmd e:Exp -» e:Exp c:Cmd -> c:Cmd e:Exp, c:Cmd, W:CmdSemCls, *[Ve:Exp]*[Vc:Cmd][Vr:S]( <e,r,0>:ExpSem 3 « e . c . W C m d > . r . r > : W ) , *[Ve:Exp]*[Vc:Cmd][Vr,s,t:S]( <e,r,l>:ExpSem A <c,r,s>:W 3 (<<e,c,WCmd>,s,t>:W D « e , c , W Q n d > , r , t > : W ) ) -> *([Vr:S]( <e,r,0>:ExpSem 3 « e . c . W C m d > . r . r > : W ) A [Vr,s,t:S] (<e,r,l>:ExpSem A <c,r,s>:CmdSem A «e .c .WCmd>.s . t> :W 3 « e . c . W C m d > . r . t > : W ) ) e:Exp, c:Cmd, W:CmdSemCls, [Ve:Exp][Vc:Cmd][Vr:S]( <e,r,0>:ExpSem 3 <<e,c,WQrid>,r,r>:W), [Ve:Exp][Vc:Cmd][Vr,s,t:S]( <e,r,l>:ExpSem A <c,r,s>:W 3 («e .c .WCmd>.s . t> :W 3 «e ,c .WCmd>.r , t> :W)) -> ([Vr:S]( <e,r,0>:ExpSem 3 *<r,r>: {<x,y>l «e . c .WCmd>.x .y> :WI ) A [Vr,s,t:S] (<e,r,l>:ExpSem A <c,r,s>:CmdSem A *<s,t>:{<x,y>l « e , c . W C m d > . x . y > : W ) 3 *<r,t>:{<x,y>l « e . c . W C m d > . x . v > : W ) )) e:Exp, c:Cmd, *W:CmdSemCls -> *{<x,y>l «e . c .WCmd>.x .y> :WI :WCls[e.cl e:Exp, c:Cmd, r:S, t:S, <r,t>: {<x,y>l « e , c , W C m d > . x , y > : W ) -> «e . c .WCmd>.r . t> :W e:Exp, c:Cmd, r:S, t:S, W:CmdSemCls, *({<x,y>l « e . c . W C m d > . x . v > : W ) :WCls[e,c] 3 <r,t>:{<x,y>l « e , c . W C m d > . x . y > : W I ) -> «e ,c ,WCmd>,r . t> :W e:Exp, c:Cmd, r:S, t:S, *[Vz:WCls[e,c]] <r,t>:z, W:CmdSemCls -» <<e,c,W^md>,r,t>:W thinning e:Exp, c:Cmd, r:S, t:S, [Vz:WGls[e,c]] <r,t>:z, W:CmdSemCls, [Vsl:S]<djmTmy,sl,sl>:W -> «e . c ,WCmd>,r . t> :W e:Exp, c:Cmd, r:S, t:S, [Vz:WCls[e,c]] <r,t>:z Appendix E: Proof of Lemma 42.3.1 164 -> *[Vw:CmdSemCls] *([Vsl:S]<djmirrry,sl,sl>:w 3 <<e,c,WjCmd>,r,t>:w) e:Exp, c:Cmd, r.S, t:S, [Vz:WCls[e,c]] <r,t>:z -> *<<e.c.WCmd>.r.t>:CmdSem -> *[Ve:Exp]*[Vc:Cmd]* [Vr,t:S]*( [Vz:WCls[e,c]] <r,t>:z 3 <<e.c.WCrnd>.r.t>:CmdSem) .2 A derivation of (b) There follows a derivation of (b) from the sequents (c) and (d). In this derivation, the following abbreviation is used: T for {<x,y,z>l <x,y,z>:CmdSem A fx=<e.c.WCmd> r> <y,z>:W)} (c) e:Exp, c:Cmd, W:WCls[e,c] -> T:CmdSemCls (d) e:Exp, c:Cmd, r.S, t:S, (TVsl:Sl<dummv.sl.sl>:T => « e , c , W ^ m d > , r , t > : T ) -> <r,t>:W e:Exp, c:Cmd, r:S, t:S, W:WCls[e,c], *[Vw:CmdSemCls] ([Vsl:S]<dummy,sl,sl>:w 3 <<e,c,WCmd>,r,t>:w) -»<r , t> :W e:Exp, c:Cmd, r:S, t:S, *<<e,c )W£md>,r,t>:CmdSem, W:WCls[e,c] -> <r,t>:W e:Exp, c:Cmd, r:S, t:S, «e,c ,WCmd>,r ,t>:CmdSem -> *[Vz:WCls[e,c]] <r,t>:z -> *[Ve:Exp]*[Vc:Cmd] *[Vr,t:S]*( <<e,c,WCmd>,r,t>:CmdSem 3 [Vz:WCls[e,c]] <r,t>:z) A derivation of sequent (d) will be left as an exercize for the reader. .2.1 A derivation of (c) Let [T/w]Si, l<i < 7, be the formula obtained by replacing w by T in the i-th conjunct in the definition of CmdSem. Then, (c) is obtained from the derivations of (ci) e:Exp, c:Cmd, W:WCls[e,c] -> [T/w]Si for 1 < i < 7. In the following, only the derivations for the case of (cl) and (c5) are given. Case (c4) is similar Appendix E: Proof of Lemma 4.2.3.1 165 to (c5) while the remaining cases are similar to (cl). .2.1.1 A derivation of (cl) The first sequent in the following derivation is obtained by thinning from the last sequent in section 4.2.1, expressing that the strings <cl.c2.SeqCmd> and <e.c.WCmd> are provably distinct. e:Exp, c:Cmd, cl:Cmd, c2:Cmd, <cl.c2.SeqCmd> ='<e.c.WCmd> -> e:Exp, c:Cmd, cl:Cmd, c2:Cmd, r:S, t:S -> *(<cl.c2.SeqCmd> =<e,c,WCmd> => <r,t>:W) cl:Cmd, c2:Cmd, r:S, s:S, t:S, <cl,r,s>:CmdSem, <c2,s,t>:CmdSem -> « c 1 .c2.SeqCmd>.r.t>:CmdSem [From defn of CmdSem] e:Exp, c:Cmd, cl:Cmd, c2:Cmd, r:S, s:S, t:S, W:WCls[e,c], <cl,r,s>:CmdSem, (cl=<e,c,WCmd> 3 <r,s>:W) <c2,s,t>:CmdSem, (c2=<e,c,WCmd> 3 <s,t>:W) -* *(«cl .c2.SeqCmd>.r . t> :CmdSem A (<cl.c2.SeqCmd> =<e.c.WCmd> 3 <r.t>:W)V e:Exp, c:Cmd, cl:Cmd, c2:Cmd, r:S, s:S, t:S, W:WCls[e,c], *<cl,r,s>:T, *<c2,s,t>:T -> * « c 1 ,c2.SeqCmd>.r.t>:T e:Exp, c:Cmd, W:WCls[e,c] -> *[Vcl,c2:Cmd]*[Vr,s,t:S]*(<cl,r,s>:T A <c2,s,t>:T 3 <<cl,c2,SeaCmd>,r,t>:T) .2.1.2 A derivation of fc5) The sequent (c5) can be derived from from sequents (i) and (ii) as following. (i) el :Exp,cl:Cmd,r:S, s:S,t:S, *W:WCls[el,cl], <e 1 ,r, 1 >:ExpSem, <c 1 ,r,s>:CmdSem, <s,t>:W -> <r,t>:W (ii) e:Exp, c:Cmd, el:Exp, cl:Cmd, W:WCls[e,c], <el.cl.WCmd> = <e.c.WCmd> -»W:WCls[el ,c l ] cut (onW:WCls[el,cl]) e:Exp, c:Cmd, el:Exp, cl:Cmd, r:S, s:S, t:S, W:WCls[e,c], <el,r,l>:ExpSem, <cl,r,s>:CmdSem, <el,cl,WCmd> = <e,c,WCmd>, <s,t>:W -> <r,t>:W Appendix E: Proof of Lemma 4.2.3.1 166 <el.cl.WCmd> =<e.c.WCmd> -» <el.cl.WCmd> =<e.c.WCmd> e:Exp, c:Cmd, el:Exp, cl:Cmd, r:S, s:S, t:S, W:WCls[e,c], <el,r,l>:ExpSem, <cl,r,s>:CmdSem, *(<el.cl.WCmd> =<e.c.WCmd> 3 <s,t>:W), <el.cl.WCmd> =<e.c.WCmd> -> <r,t>:W e:Exp, c:Cmd, el:Exp, cl:Cmd, r:S, s:S, t:S, W:WCls[e,c], <el,r,l>:ExpSem, <cl,r,s>:CmdSem, (<el.cl.WCmd> =<e.c.WCmd> 3 <s,t>:W) -> * (<el.cl.WCmd> =<e.c.WCmd> 3 <r,t>:W) el:Exp, cl:Cmd, r:S, s:S, t:S, <el,r,l>:ExpSem, <cl,r,s>:CmdSem, « e 1 .c 1 .WCmd>.s.t>:CmdSem -> «el ,c l ,WCmd>,r , t> :CmdSem e:Exp, c:Cmd, el:Exp, cl:Cmd, r:S, s:S, t:S, W:WCls[e,c], <el,r,l>:ExpSem, <cl,r,s>:CmdSem, (cl=<e,c,WCmd> 3 <r,s>:W), «el ,c l ,WCmd>,s , t> :CmdSem, (<el,cl,WCmd> =<e,c,WCmd> 3 <s,t>:W), -> *(<<el,cl,WCmd>,r,t>:CmdSem A (<el.cl.WCmd> =<e.c.WCmd> 3 <r,t>:W)) e:Exp, c:Cmd, el:Exp, cl:Cmd, r:S, s:S, t:S, W:WCls[e,c], <el,r,l>:ExpSem, *<cl,r,s>:T, *<<el,cl,WCmd>,s,t>:T -» * « e l , c l , W C m d > , r , t > : T e:Exp, c:Cmd, W:WCls[e,c] -> *[Ve:Exp]*[Vc:Cmd]*[Vr,s,t:S]*(<e,r,l>:ExpSem A <c,r,s>:T 3 («e ,c .WCmd>.s . t> :T 3 «e ,c ,WCmd>,r , t> :T) .2.1.2.1 A derivation of (\) el:Exp, r:S, <el,r,l>:ExpSem -> <el,r,l>:ExpSem cl:Cmd, r:S, s:S, <cl,r,s>:CmdSem -» <cl,r,s>:CmdSem <s,t>:W -> <s,t>:W <r,t>:W -» <r,t>:W el:Exp, cl:Cmd, r:S, s:S, t:S, * (<el,r,l>:ExpSem A <cl,r,s>:CmdSem A <s,t>:W 3 <r,t>:W), <el,r,l>:ExpSem, <c 1 ,r,s>:CmdSem, <s,t>:W -» <r,t>:W r:S -> r:S Appendix E: Proof of Lemma 4.2.3.1 167. s:S -> s:S t :S -» t :S el:Exp, cl:Cmd, r:S, s:S, t:S, * [Vr,s,t:S] (<el,r,l>:ExpSem A <cl,r,s>:CmdSem A <s,t>:W => <r,t>:W), <el,r,l>:ExpSem, <cl,r,s>:CmdSem, <s,t>:W -» <r,t>:W el:Exp, cl:Cmd, r:S, s:S, t:S, *W:WCls[el,cl], <el,r,l>:ExpSem, <cl,r,s>:CmdSem, <s,t>:W -» <r,t>:W .2.1.2.1 A derivation of (ii) c:Cmd, el:Exp, W:WCls[el,c] -»W:WCls[el ,c] el :Exp,cl:Cmd, W:WCls[el,cl] -+W:WCls[el,cl] c:Cmd,el:Exp,cl:Cmd, W:WCls[el,c], c=cl ^W:WCls[el ,cl ] e:Exp, c:Cmd, W:WCls[e,c] -> W:WCls[e,c] e:Exp, c:Cmd, el:Exp, cl:Cmd, W:WCls[e,c], e=el, c=cl ->W:WCls[el,cl] thinning e:Exp, c:Cmd, el:Exp, cl:Cmd, W:WCls[e,c], el = e ->W:WCls[el,cl] e:Exp, c:Cmd, el:Exp, cl:Cmd, W:WCls[e,c], <el.cl.WCmd> = <e.c.WCmd> -»W:WCls[el ,c l ] End of Proof of Lemma 4.2.3.1 Appendix F: Proof of Lemma 5.4.3 168 APPENDIX F Proof of Lemma 5.4.3 5.4.3. Lemma The sentences (1) [Vg: Asgn[B,»] [Vw,w 1 ,w2:Lterm] (<w,w 1 >: ASubst[g] A <w,w2>:ASubst[g] 3 <wl,w2>:Bw) (2) [Vg: Asgn[D,«]] [Vx:Lvar] [Vw,w 1 ,v:Lterm] (~x:Free[w] A <w,wl>:ASubst[g] 3 <w,wl>:ASubst[[[v]/x]g]) (3) [Vg: Asgn[D,«]] [Vx,y:Lvar] [Vw,u,v,wl ,v 1 ,u 1 :Lterm](~y :Free[w] A [Vu2:Free[w]][Vv2:Lterm](<u2,[v2]>:g 3 ~y:Free[v2]) A <u,x,w,v>:Subst A <v,vl>:ASubst[g] A <w,wl>:ASubst[[[y]/x]g] A <u,ul>:ASubst[g] 3 <ul,y,wl,vl>:Subst) (4) [Vg:Asgn[D,«]][Vx,yl,y2:Lvar][Vw,v,u:Lterm](~y 1 :Free[w] A ~yl:Free[w] A <w,v>:ASubst[[[yl]/x]g] A -y2:Free[v] A ~y2:Free[v] A <y2,yl,v,u>:Subst 3 <w,u>:ASubst[[[y2]/x]g] (5) [Vg: Asgn[D,«]] [Vx:Lvar] [ Vw,v,w 1 ,v 1 Lterm] [ Va,b:Lterm] (<w,w 1 >: ASubst[g] A <v,vl>:ASubst[g] A <w,v>:Cnv 3 <wl,vl>:Cnv) are derivable. Proof of Lemma 5.4.3 Only a derivation of the sentence (5) is given. A proofs of the rest are similar to (as well as simpler than) that of (5) and are omitted. Let T for {<w,v> I [Vwl,vl:Lterm](<w,wl>:ASubst[g] A <v,vl>:ASubst[g] 3 <wl,vl>:Z)}. A derivation of (5) follows. Appendix F: Proof of Lemma 5.4.3 169 w:Lterm, vrLterm, wl:Lterm, vkLterm, <w,wl>:ASubst[g], <v,vl>:ASubst[g], <w,v>:{<w,v> I [Vwl,vl:Lterm](<w,wl>:ASubst[g] A <v,vl>:ASubst[g] =><wl,vl>:Z)} - » < w l , v l > : Z w.Lterm, vrLterm, wl:Lterm, vLLterm, <w,wl>:ASubst[g], <v,vl>:ASubst[g], *<w,v>:T - » < w l , v l > : Z (a) g:Asgn[D,«], Z:CnvCls -> T:CnvCls g:Asgn[D,»], w:Lterm, v:Lterm, wlLterm, vl:Lterm, Z:CnvCls, <w,wl>:ASubst[g], <v,vl>:ASubst[g], *[Vz:CnvCls]<w,v>:z -» <wl,vl>:Z g:Asgn[D,«], w:Lterm, vrLterm, wl:Lterm, vl:Lterm, <w,wl>:ASubst[g], <v,vl>:ASubst[g], [Vz:CnvCls]<w,v>:z ^ *[Vz:CnvCls]<wl,vl>:z g:Asgn[D,«], w:Lterm, v:Lterm, wlLterm, vl:Lterm, <w,wl>:ASubst[g], <v,vl>:ASubst[g], *<w,v>:Cnv -> *<wl,vl>:Cnv g:Asgn[D,*], w.Lterm, v.Lterm, wl:Lterm, vl:Lterm, -> *(<w,wl>:ASubst[g] A <v,vl>:ASubst[g] A <w,v>:Cnv z> <wl,vl>:Cnv) -> *[Vg:Asgn[D,«]][Vw,vwl,vl:Lterm](<w,wl>:ASubst[g] A <v,vl>:ASubst[g] A <w,v>:Cnv => <wl,vl>:Cnv) To complete the proof, a derivation of the sequent (a) used in the previous derivation is provided in the sequence. To show that the term T is Cnv-closed, it is sufficient to show that T satisfies the clauses of the definition of CnvCls. More specifically, it is necessary to show that for every i, l<i<9, the sequent g:Asgn[D,»], Z:CnvCls -> [T/z]CnvClSj where [T/z]CnvClSj is th sentence obtained by replacing z by T in the i-th sentence of the CnvCls definition. Derivations for the cases i=l, i=5 and i=8 are provided; the rest are similar and therefore are omitted. Appendix F: Proof of Lemma 5.4.3 Case i=l: In this derivation, sequence (i) is a direct consequence of lemma 5.2.1 while (ii) is a consequence of this lemma. <wl,vl>:z '-><wl,vl>:Z Z:CnvCls ->Z:CnvCls Z:CnvCls, *[Vz:CnvCls] <wl,vl>:z -> <wl,vl>:Z Z:CnvCls, *<wl,vl>:Cnv - » < w l , v l > : Z (i) w 1 :Lterm, v 1 :Lterm, <w 1 ,v 1 >:Bw -> <wl,vl>:Cnv cut wl:Lterm, vl:Lterm, Z:CnvCls, <wl,vl>:Bw -><wl,vl>:Z (ii) g:Asgn[D,«], w:Lterm, w 1 :Lterm, v 1 :Lterm, <w,wl>:ASubst[g], <w,vl>:ASubst[g] - » < w l , v l > : B w : . c u t g:Asgn[D,«], w:Lterm, wl:Lterm, vl:Lterm, Z:CnvCls, <w,w 1 >:ASubst[g], <w,v 1 >:ASubst[g] -*<wl,vl>:Z g:Asgn[D,=], w:Lterm, wl:Lterm, vl:Lterm, Z:CnvCls -» *(<w,wl>:ASubst[g] A <w,vl>:ASubst[g] => <wl,vl>:Z) g:Asgn[D,«], w:Lterm, Z:CnvCls _> *[vw 1 ,v 1 :Lterm](<w,w 1 >:ASubst[g] A <w,vl>:ASubst[g] 3 <wl,vl>:Z) g:Asgn[D,»], w:Lterm, Z:CnvCls -> *<w,w>: {<w,v> I [Vwl,vl:Lterm](<w,wl>:ASubst[g] A <v,vl>:ASubst[g] 3 <wl,vl>:Z)} g:Asgn[D,«], w:Lterm , Z:CnvCls *<w,w>:T g:Asgn[D,«], Z:CnvCls -> *[Vw:Lterm]<w,w>:T Appendix F: Proof of Lemma 5.4.3 171 Case i=5: Sequent (b) in the following derivation is a direct consequence of the sentence (2) of this lemma. <u2,y,w2,vl>:Subst -» <u2,y,w2,vl>:Subst « « 3 . , y > , w 2 > , u 2 > , v l > : Z -> « « X , y > , w 2 > , u 2 > , v l > : Z *( <u2,y,w2,vl>:Subst => « « X , y > , w 2 > , u 2 > , v l > : Z ) <u2,y,w2,vl>:Subst -» « « X , y > , w 2 > , u 2 > , v l > : Z w2:Lterm -> w2:Lterm u2:Lterm -> u2:Lterm v 1 :Lterm -> v 1 :Lterm yrLvar-»y:Lvar vl:Lterm, y:Lvar, w2:Lterm, u2:Lterm, *[Vw,u,v:Lterm]*[Vx:Lvar](<u,x,w,v>:Subst => « « X , x > , w > , u > , v > : Z ) <u2,y,w2,vl>:Subst - > « « a , y > , w 2 > , u 2 > , v l > : Z thinning vlrLterm, y:Lvar, w2:Lterm, u2:Lterm, *Z:CnvCls, <u2,y,w2,vl>:Subst -» « « A , , y > , w 2 > , u 2 > , v l > : Z (b) g:Asgn[B,«], w:Lterm, urLterm, v.Lterm, x:Lvar, vlrLterm, y:Lvar, w2:Lterm, u2:Lterm, ~y:Free[w], [Vu:Free[w]][Vv:Lterm](<u,[v]>:g z> ~y:Free[v]), <u,x,w,v>:Subst, <v,vl>:ASubst[g], • <w,w2>:ASubst[[[y]/x]g], <u,u2>:ASubst[g] -» <u2,y,w2,vl>:Subst cut g:Asgn[D,=], ZrCnvCls, w:Lterm, u:Lterm, v:Lterm, x:Lvar, vlrLterm, y:Lvar, w2:Lterm, u2:Lterm, -y:Free[w], <u,x,w,v>:Subst, <v,vl>:ASubst[g], [Vu:Free[w]][Vv:Lterm](<u,[v]>:g z> -y:Free[v]), <w,w2>:ASubst[[[y]/x]g], <u,u2>:ASubst[g] Appendix F: Proof of Lemma 5.4.3 172 -> « « X , y > , w 2 > , u 2 > , v l > : Z w 1 = < « X , y > , w 2 > , u 2 > , « « A . , y > , w 2 > , u 2 > , v 1 >:Z - » < w l , v l > : Z cut g:Asgn[B,«], Z:CnvCls, w:Lterm, urLterm, vrLterm, xrLvar, w 1 rLterm, v 1 rLterm, yrLvar, w2:Lterm, u2:Lterm, -y:Free[w], <u,x,w,v>:Subst, <v,vl>:ASubst[g], [Vu:Free[w]][Vv:Lterm](<u,[v]>:g 3 ~y:Free[v]), <w,w2>:ASubst[[[y]/x]g], <u,u2>:ASubst[g], w 1 = < « X , y >,w2>,u2> -» <wl,vl>:Z g:Asgn[D,»], Z:CnvCls, w:Lterm, u:Lterm, v:Lterm, x:Lvar, wlrLterm, vlrLterm, <u,x,w,v>:Subst, <v,vl>:ASubst[g], *[3y:Lvar]*[3w2,u2:Lterm]*( ~y:Free[w] A [Vu:Free[w]][Vv:Lterm](<u,[v]>:g 3 ~y:Free[v]) A <w,w2>:ASubst[[[y]/x]g] A <u,u2>:ASubst[g] A w l = < « X , y > , w 2 > , u 2 > ) -» <wl,vl>:Z g:Asgn[D,»], Z:CnvCls, w:Lterm, u:Lterm, vrLterm, x:Lvar, using lemma 5.4.2 w 1 rLterm, vlrLterm, <u,x,w,v>:Subst, <v,vl>:ASubst[g], * « « X , x > , w > , u > , w 1 >: AS ubst[g] - » < w l , v l > : Z g:Asgn[D,»], ZrCnvCls, wrLterm, urLterm, vrLterm, xrLvar, wlrLterm, vlrLterm, <u,x,w,v>:Subst * ( « « X , x > , w > , u > , w l > : A S u b s t [ g ] A <v,vl>:ASubst[g] 3 <wl,vl>:Z)} g:Asgn[D,=], ZrCnvCls, wrLterm, urLterm, vrLterm, xrLvar, <u,x,w,v>:Subst -> *[Vw 1 ,v 1 rLterm](««A.,x>,w>,u>,w 1 >:ASubst[g] A <v,vl>:ASubst[g] 3 <wl,vl>:Z)} g:Asgn[D,=], ZrCnvCls, wrLterm, urLterm, vrLterm, xrLvar, <u,x,w,v>:Subst -> * « « X , x > , w > , u > , v > : { < w , v > I [Vwl,vl:Lterm](<w,wl>:ASubst[g] A <v,vl>:ASubst[g] 3 <wl,vl>:Z)} g:Asgn[D,«], ZrCnvCls, wrLterm, urLterm, vrLterm, xrLvar, Appendix F: Proof of Lemma 5.4.3 173 <u,x,w,v>:Subst - » * « « X , x > , w > , u > , v > : T g:Asgn[B,«], Z:CnvCls -> *[Vw,u,v:Lterm]*[Vx:Lvar]*(<u,x,w,v>:Subst 3 « « X , x > , w > , u > , v > : T ) Case i=8: In the following derivation, sequents (i) and (ii) are direct consequence of the definition of Cnv and lemma 5.2.1. « w l , u l > , < w l , v l » : Z -> « w l , u l > , < w l , v l » : Z « w l , v l > , < w 2 , v l » : Z -> « w l , v l > , < w 2 , v l » : Z « w l , u l > , < w 2 , v l » Z -» « w l , u l > , < w 2 , v l » Z . * ( « w l , u l > , < w l , v l » : Z A « w l , v l > , < w 2 , v l » : Z => « w l , u l > , < w 2 , v l » Z ) , « w 1 ,v 1 >,<w2,v 1 » : Z , « w l , u l > , < w l , v l » : Z -» « w l , u l > , < w 2 , v l » : Z wlrLterm, ul:Lterm -> <wl,ul>:Lterm wl:Lterm, vlrLterm -» <wl,vl>:Lterm w2:Lterm, vlrLterm -><w2,vl>:Lterm wl:Lterm, ul:Lterm, w2:Lterm, vl:Lterm, *[Vw,u,v:Lterm](<w,u>:Z A <U,V>:Z Z> <w,v>Z), « w 1 ,v 1 >,<w2,v 1 »:Z, « w l , u l > , < w l , v l » : Z -> « w l , u l > , < w 2 , v l»:Z <w2,vl»:Z -> <w2,vl»:Z wl:Lterm, ulrLterm, w2:Lterm, vl:Lterm, [Vw,u,v:Lterm](<w,u>:Z A <u,v>:Z -> <w,v>Z), *(<wl,w2>:Z « w l , v l > , < w 2 , v l » : Z ) , « w l , u l > , < w l , v l » : Z , <wl,w2>:Z -» « w l , u l > , < w 2 , v l » : Z w 1 :Lterm wl :Lterm Appendix F: Proof of Lemma 5.4.3 w2:Lterm -»w2:Lterm v 1 :Lterm - » v 1 :Lterm w 1 :Lterm, u 1 :Lterm, w2:Lterm, v 1 :Lterm, [Vw,u,v:Lterm](<w,u>:Z A <U,V>:Z => <w,v>Z), *[Vw,u,v:Lterm](<w,u>:Z => « w , v > , < u , v » : Z ) , « w l , u l > , < w l , v l » : Z , <wl,w2>:Z - » « w l , u l > , < w 2 , v l » : Z thinning wlrLterm, ul:Lterm, w2:Lterm, vl:Lterm, *Z:CnvCls, « w l , u l > , < w l , v l » : Z , <wl,w2>:Z - > « w l , u l > , < w 2 , v l » : Z (i) wl:Lterm, w2:Lterm, Z:CnvCls, <wl,w2>:Bw -><wl,w2>:Z cut wl:Lterm, ul:Lterm, w2:Lterm, vl:Lterm, Z:CnvCls, <wl,w2>:Bw, « w l , u l > , < w l , v l » : Z -» « w l , u l > , < w 2 , v l » : Z (ii) w 1 :Lterm, u 1 :Lterm, v 1 :Lterm, *Z:CnvCls, <ul,vl>:Z - » « w l , u l > , < w l , v l » : Z cut wlrLterm, ulrLterm, w2:Lterm, vl:Lterm, Z:CnvCls, <ul,vl>:Z, <wl,w2>:Bw -> « w l , u l > , < w 2 , v l » : Z <u,ul>:ASubst[g] -> <u,ul>:ASubst[g] <v,vl>:ASubst[g] -» <v,vl>:ASubst[g] thinning g:Asgn[D,«], u:Lterm, vrLterm, wlrLterm, ul:Lterm, w2:Lterm, vl:Lterm, ZrCnvCls, *(<u,ul>:ASubst[g] A <v,vl>:ASubst[g] 3 <ul,vl>:Z) <u,ul>:ASubst[g], <v,vl>:ASubst[g], <wl,w2>:Bw -> « w l , u l > , < w 2 , v l » : Z u 1 :Lterm - » u 1 :Lterm vLLterm -» vl:Lterm Appendix F: Proof of Lemma 5.4.3 175 g:Asgn[B,«], u:Lterm, vrLterm, wl rLterm, u 1 rLterm, w2:Lterm, v 1 rLterm, ZrCnvCls, *[Vul,vl:Lterm](<u,ul>:ASubst[g] A <v,vl>:ASubst[g] => <ul,vl>:Z) <u,ul>:ASubst[g], <v,vl>:ASubst[g], <wl,w2>:Bw -» « w l , u l > , < w 2 , v l » : Z grAsgn[B,«], wrLterm, wlrLterm, w2:Lterm, <w,wl>:ASubst[g], <w,w2>:ASubst[g] - » < w l , w 2 > : B w c u t g:Asgn[D,«], wrLterm, urLterm, vrLterm, wlrLterm, ulrLterm, w2:Lterm, vlrLterm, ZrCnvCls, [Vul,vl:Lterm](<u,ul>:ASubst[g] A <v,vl>:ASubst[g] => <ul,vl>:Z) <w,w 1 >:ASubst[g], <u,u 1 >:ASubst[g], <w,w2>:ASubst[g], <v,vl>:ASubst[g] « w l , u l > , < w 2 , v l » : Z s=<wl,ul>, t=<w2,vl>, « w l , u l > , < w 2 , v l » : Z -> <s,t>:Z cut, thinning g:Asgn[D,«], wrLterm, urLterm, vrLterm, srLterm, trLterm, w 1 rLterm, u 1 rLterm, w2:Lterm, v 1 rLterm, Z: CnvCls, [Vul,vl:Lterm](<u,ul>:ASubst[g] A <v,vl>:ASubst[g] 3 <ul,vl>:Z) <w,wl>:ASubst[g], <u,ul>rASubst[g], s=<wl,ul>, <w,w2>:ASubst[g], <v,vl>:ASubst[g], t=<w2,vl> -> <s,t>:Z g:Asgn[D,«], wrLterm, urLterm, vrLterm, srLterm, trLterm, ZrCnvCls, [Vul.vlrLterm](<u,ul>:ASubst[g] A<v,vl>:ASubst[g] =><ul,vl>:Z) *[3wl,ul:Lterm]*(<w,wl>:ASubst[g] A <u,ul>:ASubst[g] A s=<wl,ul>) *[3w2,vl:Lterm]*(<w,w2>:ASubst[g] A <v,vl>:ASubst[g] A t=<w2,vl>) -^<s,t>:Z using lemma 5.4.2 g:Asgn[D,«], wrLterm, urLterm, vrLterm, srLterm, trLterm, ZrCnvCls, [Vul.vlrLterm](<u,ul>:ASubst[g] A <v,vl>:ASubst[g] 3 <ul,vl>:Z) *«w,u>,s>:ASubst[g] , *«w,v>,t>:ASubst[g] Appendix F: Proof of Lemma 5.4.3 176 -> <s,t>:Z g:Asgn[B,»], wrLterm, urLterm, vrLterm, ZrCnvCls, [Vul,vlrLterm](<u,ul>:ASubst[g] A <v,vl>:ASubst[g] => <ul,vl>:Z) -» *[Vs,t:Lterm]*(«w,u>,s>:ASubst[g] A «w,v>,t>:ASubst[g] 3 <s,t>:Z) g:Asgn[D,«], wrLterm, urLterm, vrLterm, ZrCnvCls, *<u,v>:T -> * « w , u > , < w , v » : T g:Asgn[D,«], ZrCnvCls -» *[Vw,u,v:Lterm]*(<u,v>:T z> « w , u > , < w , v » : T ) End of proof of lemma 5.4.3 Appendix G: Proof of Theorem 5.4.4 177 APPENDIX G Proof of Theorem 5.4.4 5.4.4. Theorem The sequent -> <D,«,°,r>:XModel is derivable. Proof of Theorem 5.4.4 Let LIAxiomj[D,=,»,I,g], l<i<17, be the i-th sentence in the definition of the X-interpretation. It is sufficient to show that for each i , l<i<17, the sequent g:Asgn[D « ] -» LIAxiom|[D,=,°J'] where g is a second order parameter, is derivable. Only the cases for i=9,l 1, 13,17 shall be presented. The other cases are either similar or simpler than these and are omitted. Case i=9. The first sequent in the following derivation is a direct consequence of lemma 5.2.1. a:Lterm, b:Lterm, d:Lterm, w:Lterm, «a ,b> ,d> :Cnv. , < w , < a , b » : C n v -> <w,d>:Cnv *[a]:D, *[b]:D, *[d]:D, w:Lterm, «a ,b> ,d> :Cnv , w:[<a,b>] ->w:[d] [a]:D, [b]:D, [d]:D,w:Lterm, «a ,b> ,d> :Cnv, similarly w:[d] -»w:[<a,b>] [a]:D, [b]:D, [d]:D, w:Lterm, «a ,b> ,d> :Cnv -> *(w:[<a,b>] = w:[d]) [a]:D, [b]:D, [d]:D, « a , b > , d > : C n v -> *[Vw:Lterm](w:[<a,b>] s w:[d]) Appendix G: Proof of Theorem 5.4.4 178 [a]:D, [b]:D, [d]:D, *<[a],[b],[d]>:° ->• *[<a,b>]»[d]) [a]:D, [b]:D, [d]:D -> *(<[a],[b],[d]>:° 3 [<a,b>]=[d]) [a]:D, [b]:D -» *[Vd:D](<[a],[b],d>:° => [<a,b>]«d) [a]:D, [b]:D -><[a],[b],[<a,b>]>:° [a]:D, [b]:D ->*(<[a],[b],[<a,b>]>:° A [Vd:B](<[a],[b],d>:° => [<a,b>]«d)) [a]:D, [b]:D->[<a,b>]:D [a]:D, [b]:D -> *[3c:D](<[a],[b],c>:° A [Vd:D]«a],[b],d>:° 3 c«d)) -> *[Va,b:B][3c:D](<a,b,c>:° A [Vd:D](<a,b,d>:° 3 c=d)) Case i=l l . In this derivation, sequent (i) is implied by lemma 5.2.1 and sequent (ii) is a direct consequence of lemma 5.4.2. (i) a:Lterm, b:Lterm, d:Lterm, <b,d>Cnv, <a,d>Cnv -»<a,b>Cnv *[a]:D, *[b]:D, *[d]:D,*[b]«[d], *[a]»[d] -> *[a]»[b] <x,[b]>:g -> <x,[b]>:g [a] :D, [b]:D, [d]:D, <x,[d]>:g, *(<x,[b]>:g 3 [b]«[d]), [a]-[d],<x,[b]>:g->[a]»rb] [b] :D-> [b]:D [a]:D, [b]:D, [d]:D, <x,[d]>:g, *[Vdl:D](<x,dl>:g 3 dl«[d]), [a]-[d],<x,rb]>:g->[aMb] <x,[a]>:g-> <x,[a]>:g [a]:D, [b]:D, [d]:D, <x,[d]>:g, [Vdl:D](<x,dl>:g 3 dl«[d]), *(<x,[a]>:g3[a]«[d]), <x,[a]>:g, <x,[b]>:g -> [a]«[b] [a]:D-*[a]:D Appendix G: Proof of Theorem 5.4.4 179 thinning [a]:D, [b]:D, [d]:D, <x,[d]>:g, *[Vdl:D](<x,dl>:g = dl=[d]), <x,[a]>:g, <x,[b]>:g -> [a]«[b] [a]:D, [b]:D, *[3d:D]*(<x,d>:g A [Vdl:D](<x,dl>:g 3 dl«d)), <x,[a]>:g, <x,[b]>:g -> [a]»[b] xrLvar -> xrLvar x:Lvar, [a]:D, [b]:D, *[Vx:Lvar][3d:D](<x,d>:g A [Vdl:D](<x,dl>:g 3 dl«d)), <x,[a]>:g, <x,[b]>:g -> [a]»[b] *g:Asgn[D,»], x:Lvar, [a]:D, [b]:D, <x,[a]>:g, <x,[b]>:g -> [a]«[b] £ii) g:Asgn[B,«], x:Lvar, [b]:D, <x,b>:ASubst[g] -> <x,[b]>:g cut g:Asgn[B>,»], x:Lvar, [a]:D, [b]:D, <x,[a]>:g, <x,b>:ASubst[g] -> [a]=[b] g:Asgn[D,»], x:Lvar, [a]:D, [b]:D, <x,[a]>:g, *<x,[b]>:I[g] -> [a]«[b] g:Asgn[D,»], xrLvar, [a]:D, [b]:D -> *(<x,[a]>:g A <x,[b]>:I[g] => [a]-[b]) g:Asgn[D ,»] -> *[Vx:Lvar]*[Va,b:D](<x,a>:g A <x,b>:I[g] => a«b) Case i=13. The sequences (i) and (ii) in the following derivation are direct consequences of lemma 5.4.3. (i) g:Asgn[D ~], w:Lterm, x:Lvar, a:Lterm, b:Lterm, c:Lterm, <w,c>:ASubst[[[b]/x]g], « « X , x > , w > , x > , < a , b » : A S u b s t [ [ [ b ] / x ] g ] , « « A . , x > , w > , x > , w > : C n v -» « a , b > , c > : C n v w:Lterm, x:Lvar Appendix G: Proof of Theorem 5.4.4 180 - » « « X , x > , w > , x > , w > : C n v cut g:Asgn[B,«], wrLterm, xrLvar, arLterm, brLterm, crLterm, <w,c>rASubst[[[b]/x]g], « « X , x > , w > , x > , < a , b » : A S u b s t [ [ [ b ] / x ] g ] - » « a , b > , c > : C n v (ii) g:Asgn[B,»], wrLterm, xrLvar, arLterm, brLterm, «<X,x>,w>,a>:ASubst[g] -^««A. ,x> ,w> ,x> ,<a ,b» :ASubst [ [ [b] /x ]g ] • cut g:Asgn[D,«], wrLterm, xrLvar, arLterm, brLterm, crLterm, «<X,x>,w>,a>:ASubst[g] , <w,c>:ASubst[[[b]/x]g] « a , b > , c > : C n v g:Asgn[D,»], wrLterm, xrLvar, arLterm, brLterm, crLterm, *«<X,x>,w>,[a]>:r[g], *<w,[c]>:r[[[b]/x]g] -»*<a] , [b] , [ c ]> : ° g:Asgn[D,»], wrLterm, xrLvar, *[a]:D, *[b]:D, *[c]:D -» *(«<X,x>,w>,[a]>:r[g] A <w,[c]>:r[[[b]/x]g] 3 <[a],[b],[c]>:°) g:Asgn[D,«] -> *[Vw:Lterm]*[Vx:Lvar]*[Va,b,c:D](«<X,x>,w>,a>:r[g] A <w,c>:I'[[b/x]g] 3 <a,b,c>:°) Case i=17. In the next derivation, sequent (i) is a consequence of lemma 5.2.1, sequents (ii) and (iii) are implied by theorem 5.1.4.2 and sequents (iv) and (v) are consequences of lemma 5.4.3. (i) ylrLvar, y2:Lvar, y3:Lvar, wlrLterm, w2:Lterm, vlrLterm, v2:Lterm, ulrLterm, u2:Lterm, « < X , y 3 > , u l > , « A . , y 3 > , u 2 » : C n v , « < X , y l > , v l > , « A . , y 3 > , u l » : B w , < « X , y 2 > , v 2 > , « ) t , y 3 > , u 2 » : B w -> < « X . , y l > , v l > , « A . , y 2 > , v 2 » : C n v (ii) y2:Lvar, y3:Lvar, v2:Lterm, u2:Lterm, -y3:Free[v2], <y3,y2,v2,u2>:Subst, -> « < X , y 2 > , v 2 > , « X , y 3 > , u 2 » : B w Appendix G: Proof of Theorem 5.4.4 181 cut yl:Lvar, y2:Lvar, y3:Lvar, wl:Lterm, w2:Lterm, vlrLterm, v2:Lterm, ul:Lterm, u2:Lterm, -y3:Free[v2], <y3,y2,v2,u2>:Subst, « < X , y 3 > , u 1 > ,«A, ,y3> ,u2» :Cnv , « < X , y 1 >,v l > , « X , y 3 > , u 1 » : B w -> « < X , y l > , v l > , « X , y 2 > , v 2 » : C n v (iii) yl:Lvar, y3:Lvar, vl:Lterm, ul:Lterm, ~y3:Free[vl],<y3,yl,vl,ul>:Subst -> <<<X,yl>,vl>,<<X,y3>,ul>>:Bvv cut yl:Lvar, y2:Lvar, y3:Lvar, wl:Lterm, w2:Lterm, vl:Lterm, v2:Lterm, ul:Lterm, u2:Lterm, -y3:Free[vl], <y3,yl,vl,ul>:Subst, -y3:Free[v2], <y3,y2,v2,u2>:Subst, « < X , y 3 > , u l > , « X , y 3 > , u 2 » : C n v -» «<X,yl> ,vl>,«A , ,y2> ,v2» :Cnv y3:Lvar, ul:Lterm, u2:Lterm, <ul,u2>:Cnv -> «<X,y3>,ul>,«A , ,y3>,u2»:Cnv cut yl:Lvar, y2:Lvar, y3:Lvar, wl:Lterm, w2:Lterm, vlrLterm, v2:Lterm, ulrLterm, u2:Lterm, -y3:Free[vl], <y3,yl,vl,ul>:Subst, ~y3:Free[v2], <y3,y2,v2,u2>:Subst, <ul,u2>:Cnv <<<X,yl>,vl>,<<X,y2>,v2>>:Cnv yl:Lvar, y2:Lvar, y3:Lvar, wl:Lterm, w2:Lterm, vl:Lterm, v2:Lterm, ul:Lterm, u2:Lterm, -y3:Free[vl], <y3,yl,vl,ul>:Subst, ~y3:Free[v2], <y3,y2,v2,u2>:Subst, *[ul]«[u2] -» « < X , y l > , v l > , « X , y 2 > , v 2 » : C n v g:Asgn[D,=], x:Lvar, y3:Lvar, wl:Lterm, ulrLterm, <wl,ul>:ASubst[[[y3]/x]g] -> <wl,[ul]>:r[[[y3]/x]g] g:Asgn[D,«], x:Lvar, y3:Lvar, w2:Lterm, u2:Lterm, <w2,u2>:ASubst[[[y3]/x]g] -> <w2,[u2]>:r[[[y3]/x]g] g:Asgn[D,«], x:Lvar, yl:Lvar, y2:Lvar, y3:Lvar, wl:Lterm, w2:Lterm, vl:Lterm, v2:Lterm, ul:Lterm, u2:Lterm, Appendix G: Proof of Theorem 5.4.4 182 *(<wl,[ul]>:r[[[y3]/x]g] A <w2,[u2]>:r[[[y3]/x]g] 3 [ul]«[u2]), -y3:Free[vl], <y3,yl,vl,ul>:Subst, ~y3:Free[v2], <y3,y2,v2,u2>:Subst, <wl,ul>:ASubst[[[y3]/x]g],<w2,u2>:ASubst[[[y3]/x]g] -> < « A . , y l > , v l > , « A , , y 2 > , v 2 » : C n v ul :Lterm-» [ul]:D u2:Lterm->[u2]:0 y3:Lterm -> [y3]:D g:Asgn[B,«], xrLvar, yl:Lvar, y2:Lvar, y3:Lvar, wlrLterm, w2:Lterm, vl:Lterm, v2:Lterm, ul.Lterm, u2:Lterm, *[Val,a2,d:D](<wl,al>:r[[o7x]g] A <w2,a2>:r[[d/x]g] 3 al«a2) , -y3:Free[vl], <y3,yl,vl,ul>:Subst, ~y3:Free[v2], <y3,y2,v2,u2>:Subst, <wl,ul>:ASubst[[[y3]/x]g],<w2,u2>:ASubst[[[y3]/x]g] -> « < J i , y l > , v l > , « X , y 2 > , v 2 » : C n v (iv) g:Asgn[D,»], x:Lvar, y2:Lvar, y3:Lvar, w2:Lterm, v2:Lterm, u2:Lterm, -y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 -y2:Free[v]), <w2,v2>:ASubst[[[y2]/x]g], -y3:Free[w2], -y3:Free[v2], <y3,y2,v2,u2>:Subst -> <w2,u2>:ASubst[[[y3]/x]g] cut g:Asgn[D,«], x:Lvar, yl:Lvar, y2:Lvar, y3:Lvar, wlrLterm, w2:Lterm, vltLterm, v2:Lterm, ulrLterm, u2:Lterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:r[[d/x]g] 3 al»a2) , -y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 -y2:Free[v]), -y3:Free[vl], <y3,yl,vl,ul>:Subst, <w2,v2>:ASubst[[[y2]/x]g], -y3:Free[w2], ~y3:Free[v2], <y3,y2,v2,u2>:Subst, <w 1 ,ul >: ASubst[[[y3]/x]g] -> « < A . , y l > , v l > , « X , y 2 > , v 2 » : C n v (v) g:Asgn[D,=], x:Lvar, yl:Lvar, y3:Lvar, wLLterm, vl:Lterm, ul rLterm, ~yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 -yl:Free[v]), <wl,vl>:ASubst[[[yl]/x]g], -y3:Free[wl], ~y3:Free[vl], <y3,yl,vl,ul>:Subst -» <wl,ul>:ASubst[[[y3]/x]g] cut g:Asgn[D,«], xrLvar, yl:Lvar, y2:Lvar, y3:Lvar, w 1 :Lterm, w2:Lterm, v 1 :Lterm, v2:Lterm, u 1 :Lterm, u2:Lterm, Appendix G: Proof of Theorem 5.4.4 183 [Val,a2,d:D](<wl,al>:r[[d7x]g] A <w2,a2>:F[[d/x]g] 3 al«a2) , ~yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 ~yl:Free[v]), ~y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 -y2:Free[v]), <wl,vl>:ASubst[[[yl]/x]g],<w2,v2>:ASubst[[[y2]/x]g], ~y3:Free[wl], ~y3:Free[vl], <y3,yl,vl,ul>:Subst, -y3:Free[w2], -y3:Free[v2], <y3,y2,v2,u2>:Subst -> < « X , y l > , v l > , « A . , y 2 > , v 2 » : C n v g:Asgn[D,«], x:Lvar, wl:Lterm, w2:Lterm, yl:Lvar, vl:Lterm, y2:Lvar, v2:Lterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:I'[[d/x]g] 3 al«a2) , ~yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 ~yl:Free[v]), ~y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 ~y2:Free[v]), <wl,vl>:ASubst[[[yl]/x]g],<w2,v2>:ASubst[[[y2]/x]g], *[3y3:Lvar]*[3ul,u2:Lterm]*(~y3:Free[wl] A -y3:Free[vl] A <y3,yl,vl,ul>:Subst A ~y3:Free[w2] A -y3:Free[v2] A <y3,y2,v2,u2>:Subst) -> « < X , y l > , v l > , « X . , y 2 > , v 2 » : C n v wl:Lterm, w2:Lterm, yl:Lvar, vl:Lterm, y2:Lvar, v2:Lterm -> [3y3:Lvar][3ul,u2:Lterm] (~y3:Free[wl] A -y3:Free[vl] A <y3,yl,vl,ul>:Subst A ~y3:Free[w2] A -y3:Free[v2] A <y3,y2,v2,u2>:Subst) cut g:Asgn[D,«]» x:Lvar, wl:Lterm, w2:Lterm, yl:Lvar, vl:Lterm, y2:Lvar, v2:Lterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:I*[[d/x]g] 3 al«a2) , ~yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 ~yl:Free[v]), -y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 ~y2:Free[v]), <wl,vl>:ASubst[[[yl]/x]g],<w2,v2>:ASubst[[[y2]/x]g] -> <«A. ,y l> ,v l> ,«A, ,y2> ,v2» :Cnv yl:Lvar, y2:Lvar, b:Lterm, c:Lterm, vl:Lterm, v2Lterm, b = « X , y l > , v l > , c = « X , y 2 > , v 2 > , « < X , y l > , v l > , « X , y 2 > , v 2 » : C n v -» <b,c>:Cnv c u t Appendix G: Proof of Theorem 5.4.4 184 g:Asgn[D,«], x:Lvar, wl:Lterm, w2:Lterm, brLterm, c:Lterm, yl:Lvar, vlrLterm, y2:Lvar, v2:Lterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:r[[d/x]g] 3 al«a2) , -yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 ~yl:Free[v]), <w 1 ,v 1 >:ASubst[[[y 1 ]/x] g], b=«A.,y 1 >,v 1 >, -y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g=> ~y2:Free[v]), <w2,v2>:ASubst[[[y2]/x]g] ,c=«X,y2>,v2> -» <b,o:Cnv g: Asgn[D =], xrLvar, w 1 :Lterm, w2:Lterm, b.Lterm, c.Lterm, using lemma yl:Lvar, vl:Lterm, y2:Lvar, v2:Lterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:I'[[d/x]g] 3 al«a2) , -yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 ~yl:Free[v]), <w 1 ,v 1 >:ASubst[[[y 1 ]/x] g], b = « \ , y 1 >,v 1 >, ~y2:Free[w2], [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 -y2:Free[v]), <w2,v2>:ASubst[[[y2]/x]g], c = « X , y 2 > , v 2 > ^ * [ b ] « [ c ] g:Asgn[D,«], x:Lvar, wlLterm, w2:Lterm, b:Lterm, c:Lterm, yl:Lvar, vl:Lterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:I'[[d/x]g] 3 al«a2) , -yl:Free[wl], [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3-yl:Free[v]), <w 1 ,v 1 >:ASubst[[[y 1 ]/x]g], b=«k,y 1 >,v 1 >, *[3y2:Lvar] *[3v2:Lterm]*( ~y2:Free[w2] A [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 ~y2:Free[v]) A <w2,v2>:ASubst[[[y2]/x]g] A c = « X , y 2 > , v 2 > ) [b]«[c] g:Asgn[D,=], xrLvar, wlLterm, w2:Lterm, brLterm, crLterm, [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:I'[[d/x]g] 3 al»a2) , * [3yl:Lvar]*[3vl rLterm] *( ~yl:Free[wl] A [Vu:Free[wl]][Vv:Lterm](<u,[v]>:g 3 ~yl:Free[v]) A <wl,vl>:ASubst[[[yl]/x]g] A b = « X , y l > , v l > ) [3y2:Lvar][3v2:Lterm](~y2:Free[w2] A [Vu:Free[w2]][Vv:Lterm](<u,[v]>:g 3 ~y2:Free[v]) A <w2,v2>:ASubst[[[y2]/x]g] A c = « X , y 2 > , v 2 > ) Appendix G: Proof of Theorem 5.4.4 185 -> [b]*[c] g:Asgn[D « ] , x:Lvar, wl:Lterm, w2:Lterm, brLterm, c:Lterm, using lemma 5.4.2 [Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:r[[d/x]g] 3 al«a2) , *«<&,x>,wl>,b>:ASubst[g] , *«<A.,x>,w2>,c>:ASubst[g] ->[b]-[c] g:Asgn[D,»], xrLvar, wlLterm, w2:Lterm, *[b]:D, *[c]:D] [Val,a2,d:D](<wl,al>:F[[d/x]g] A <w2,a2>:r[[d/x]g] 3 al«a2) , *«<X,x>,wl>,[b ]>:r [g] ,*«<A. ,x>,w2>,[c ]>:r [g] ->-[b]«[c] g:Asgn[B,«], x:Lvar, wlLterm, w2:Lterm, [b]:D, [c]:D] -> *([Val,a2,d:D](<wl,al>:r[[d/x]g] A <w2,a2>:I'[[d/x]g] 3 al«a2) A «<X,x>,wl>,[b]>:I'[g] A <«X,x>,w2>,[c]>:I'[g] 3 [b]«[c]) g:Asgn[D,«] -> *[Vx:Lvar]*[Vwl,w2:Lterm]*[Vb,c:D]( [Val,a2,d:D](<wl,al>:I'[[d/x]g] A <w2,a2>:I'[[d/x]g] 3 al«a2) A <«X,x>,wl>,b>:I'[g] A «<X.,x>,w2>,c>:]T[g] 3 b«c) End of proof of theorem 5.4.4 Appendix H: Proof of Theorem 55.1 186 APPENDIX H Proof of Theorem 5.5.1 5.5.1. Theorem The sequent -> <D,=,°,e>:StrictSMModel is derivable. Proof of theorem 5.5.1 Let SMAxiomj[D,=,«,e], l<i<13, be the i-th sentence in the definition of the SM-model. It is sufficient to show that for each i, l<i<13, the sequent SMAxiom^[D,»,°,e] is derivable. Only the cases for i=8, 9 and 13 shall be presented. Cases (1) to (7) are the same as in theorem 5.4.4 while the rest are similar (even simpler) to case (13) and are omitted. In the following derivations, the symbols x, y, z are used for the constant NaDSet terms that represent the natural numbers 2, 4, 6 respectively. Therefore, according to section 5.1.1 the sequents (i) -»x:Lvar (ii) -»y:Lvar (iii) -»z:Lvar are derivable, which implies that the sequents (iv) - » « X , x > , « X , y > , x » : L t e r m (v) - » « X , x > , « X , , y . > , « X , z > , « x , z > , < y , z > » » : L t e r m (vi) - » « X , x > , « X , y > , < x , y » > : L t e r m are derivable as well. As an illustration, a derivation of (iv) is shown next. In this, the sequent (vii) -> x:Lterm which is a direct consequence of the Lterm definition is used. (ii) -»y:Lvar Appendix H: Proof of Theorem 55.1 187 (vii) -»x:Lterm « X , y > , x > : Z - » « X , y > , x > : Z *[Vu:Lvar]*[Vw:Z]«X,u>,w>:Z, - * « X , y > , x > : Z <<X,x>,<<X,y>,x>>:Z -» <<X,x>,<<X,y>,x>>:Z [Vu:Lvar][Vw:Z]«X,u>,w>:Z, * [Vw:Z]«X,x> ,w>:Z -> « X , x > , « A . , y > , x » : Z (i) -» x:Lvar contraction *[Vu:Lvar] [Vw:Z]«X,u>,w>:Z -> « X , x > , « X , v . > , x » : Z *Z:LtermCls -» « X , x > , « X , y > , x » : Z thinning -> *[Vz:LtermCls] « X , x > , « X , y > , x » : z -> * « A , , x > , « A . , y . > , x » : L t e r m Finally, for convenience the abbreviations k for « X , x > , « X , y . > , x » S for « X , x > , « X , y > , « A . , z > , « x , z > , < y , z » » > e_ for <<X,x>,<<a,y>,<x,y>>. will be used in the proof. Consequently, the sequents (iv') ->[k]:D (v1) ^[s]:D (vi1) ->[e]:B can be obtained from (iv), (v) and (vi) by a single application of the ->{} rule. Moreover, since e is identical to [gj, -»[e]:D is derivable as well. The proof of the theorem can now resume. Case i=8. The first sequent in the following derivation is a consequence of sentence (5) of theorem 5.1.3.1. a:LTerm, b:LTerm, y 1 :Lvar, ~y 1 :Free[a], Appendix H: Proof of Theorem 55.1 188 -» <b,yl, a,a>:Subst ««a,yl>,a>,b>,a>:Z -> ««a,yl>,a>,b>,a>:Z a:LTerm, b:LTerm, ylrLvar, -yl:Free[a], *(<b,yl, a,a>:Subst => « « X , y l > , a > , b > , a > : Z ) , -» « « A , , y l > , a > , b > , a > : Z a:LTerm a:Lterm b:LTerm -»b:LTerm a:LTerm -> a:LTerm yl:Lvar -> ylrLvar a:LTerm, b:LTerm, y 1 :Lvar, -y 1 :Free[a], *[Vw,u,v:Lterm]*[Vx:Lvar](<u,x,w,v>:Subst 3 ««A . ,X>,W>,U>,V>:Z), -> ««A,,yl>,a>,b>,a>:Z thinning a:LTerm, brLTerm, yl:Lvar, -yl:Free[a], *Z:CnvCls, ««X,yl>,a>,b>,a>:Z «ka,b>,<«X,yl>,a>,b»:Z -> «ka,b>,«<X,yl>,a>,b»:Z «ka,b>,a>:Z -» «ka,b>,a>:Z a:LTerm, b:LTerm, ylrLvar, -yl:Free[a], Z:CnvCls, * ( « k a , b > , « < X , y > , a > , b » : Z A « « X , y > , a > , b > , a > : Z => « k a , b > , a > : Z ) , « k a , b > , « < X , y l > , a > , b » : Z -> « k a , b > , a > : Z ka:LTerm, b:LTerm -> <ka,b>:LTerm a:LTerm, brLTerm, ylrLvar -» «<X,yl> ,a> ,b> :Lterm a:LTerm -» a:Lterm arLTerm, b:LTerm, ka:LTerm, yl:Lvar, -yl:Free[a], ZrCnvCls, *[Vw,u,v:Lterm](<w,u>:Z A <U,V>:Z 3 <w,v>:Z), «ka,b>,«<A , ,yl>,a>,b»:Z -> « k a , b > , a > : Z contraction a:LTerm, brLTerm, ka:LTerm, ylrLvar, -yl:Free[a], *Z:CnvCls, « k a , b > , « < X . , y l > , a > , b » : Z -> « k a , b > , a > : Z < k a , « X , y l > , a » : Z -> <ka,«A,,yl>,a»:Z Appendix H: Proof of Theorem 55.1 189 ka:LTerm -» ka:LTerm a:LTerm, yl:Lvar - » « X , y l > , a > : L t e r m brLTerm -> b:Lterm a:LTerm, brLTerm, ka:LTerm, ylrLvar, -yl:Free[a], Z:CnvCls, *[Vw,u,v:Lterm]*(<w,u>:Z 3 « w , v > , < u , v » : Z ) < k a , « X , y l > , a » : Z -> « k a , b > , a > : Z contraction a:LTerm, b:LTerm, ka:LTerm, yl:Lvar, -yl:Free[a], *Z:CnvCls, < k a , « a , y l > , a » : Z -» « k a , b > , a > : Z <ka, < k , a » : Z -»<ka , < k , a » : Z <<k,a>,<<X,yl>,a>>:Z -> « k , a > , « X , y l > , a » : Z ka:LTerm -» kaLTerm a:LTerm —> <k,a>:Lterm a:LTerm, yl:Lvar -» « X , y l > , a > rLterm a:LTerm, b:LTerm, ka:LTerm, yl:Lvar, ~yl:Free[a], Z:CnvCls, *[Vw,u,v:Lterm]*(<w,u>:Z A <U,V>:Z 3 <w,v>:Z), <ka, <k,a»:Z, «k,a>,«X ,yl>,a»:Z -> «ka,b>,a>:Z «k,a>,ka>:Z -> «k,a>,ka>:Z a:LTerm -> <k,a>:Lterm ka:LTerm -» kaLTerm a:LTerm, b:LTerm, ka:LTerm, ylrLvar, ~yl:Free[a], ZrCnvCls, *[Vw,u:Lterm]*(<w,u>:Z 3 <u,w>:Z), [Vw,u,v:Lterm](<w,u>:Z A <U,V>:Z 3 <w,v>:Z), « k , a > , k a > : Z , < < k , a > , « X , y l > , a » : Z -> « k a , b > , a > : Z contraction arLTerm, b:LTerm, karLTerm, ylrLvar, ~yl:Free[a], *Z:CnvCls, « k , a > , k a > : Z , « k , a > , « X , y l > , a » : Z -> « k a , b > , a > : Z <a ,x ,«A, ,y> ,x> ,«X ,y 1 > , a » : S ubst -» <a ,x ,«A. ,y> ,x> ,«X ,y l> ,a» :Subst a:LTerm, brLTerm, karLTerm, ylrLvar, -yl:Free[a], < a , x , « X , y > , x > , « X , y l > , a » : S u b s t , ZrCnvCls, Appendix H: Proof of Theorem 55.1 190 *(<a,x,<<X,y>,x>,<<a,yl>,a>>:Subst 3 « k , a > , « X , y l > , a » : Z ) , « k , a > J c a > : Z -> « k a , b > , a > : Z arLTerm, brLTerm, karLTerm, ylrLvar, -yl:Free[a], < a , x , « X , y > , x > , « X , y l > , a » r S u b s t , ZrCnvCls, ( < a , x , « X , y . > , x > , « X , y l > , a » : S u b s t 3 * « « X , x > , « X , y . > , x » , a > , « X , y l > , a » : Z ) , « k , a > , k a > : Z - > « k a , b > , a > : Z -» <<X,y>,x>:LTerm arLTerm -» arLTerm arLTerm, ylrLvar - » « X , y l > , a > : L T e r m -> xrLvar arLTerm, brLTerm, karLTerm, ylrLvar, ~ylrFree[a], < a , x , « X , y > , x > , « X , y l > , a » : S u b s t , ZrCnvCls, *[Vw,u,v:LTerm]*[Vx:Lvar (<u,x,w,v>:Subst 3 « « A . , x > , w > , u > , v > : Z ) , « k , a > , k a > : Z -» « k a , b > , a > : Z arLTerm, brLTerm, karLTerm, ZrCnvCls, [Vw,u,v:LTerm] [VxrLvar (<u,x,w,v>:Subst 3 ««A.,X>,W>,U>,V>:Z), * [3y 1 rLvar] *(~y 1 :Free[a] A < a , x , « X , y > , x > , « X , y 1 > , a » : Subst), « k , a > , k a > : Z - » « k a , b > , a > : Z arLTerm -> [3yl:Lvar](~yl:Free[a] A < a , x , « X , y > , x > , « X , y l > , a » : S u b s t ) cut arLTerm, brLTerm, karLTerm, ZrCnvCls, [Vw,u,v:LTerm] [VxrLvar (<u,x,w,v>:Subst 3 < « < l , x > , w > , u > , v > : Z ) , « k , a > , k a > : Z -> « k a , b > , a > : Z contraction arLTerm, brLTerm, karLTerm, *Z:CnvCls, « k , a > , k a > : Z - » « k a , b > , a > : Z Appendix H: Proof of Theorem 55.1 191 Z:CnvCls -> ZrCnvCls arLTerm, brLTerm, karLTerm, *[Vz:CnvCls]«k,a>,ka>:z ZrCnvCls -» « k a , b > , a > : Z arLTerm, brLTerm, karLTerm, [Vz:CnvCls]«k,a>,ka>:z -> *[Vz:CnvCls]«ka,b>,a>:z arLTerm, brLTerm, karLTerm, *«k ,a> ,ka> :Cnv -> *«ka ,b> ,a> :Cnv [a]:D, [b]:D, [ka]:D, *<[k],[a],[ka]>:° -> *<[ka],[b],[a]>r° [a]:D, [b]:D, [ka]:D -> *(<Od,[a],[ka]>:o 3 <[ka],[b],[a]>:o) -» *[Va,b,ka:D](<[k],a,ka>:o 3 <ka,b,a>:°) (<!*) -> [k]:D -> *[3k:D][Va,b,ka:D](<k,a,ka>:° 3 <ka,b,a>:°) Case i-9. It is similar to the previous case with the exception that the term [s] (that is the term [ « X , x > , « X , y . > , « X , z > , « x , z > , < y , z » » > ] ) is used to instanciate the existentially quantified variable s in the present case. Case i=13. This is the only case whose derivation needs the n-conversion rule given by clause (6) in the definition of CnvCls. This is expected since case (13) is the only clause in the definition of the model that forces the model to be an extensional model (definition 10.7 and theorem 11.30 of [Hindley&Seldin86]). In the following derivation, sequent (a) is implied by the definition "Free" and sequent (b) is a consequent of theorem 5.1.3.1. <<e,e>,<<X,y>,<e,y>>>:Z -> « e , e > , « X , y > , < e , y » > : Z « < A . , y > , < e , y » , e > : Z -> « < X , y > , < e , y » , e > : Z « e , e > , e > : Z <<e,e>,e>:Z * ( « e , e > , « X . , y > , < e , y > » : Z A « < X , y > , < e , y » , e > : Z 3 « e , e > , e > : Z ) « e , e > , « X , y > , < e , y » > : Z , «<A, ,y> ,<e ,y» ,e> :Z -» « e , e > , e > : Z Appendix H: Proof of Theorem 55.1 -> <£,£>:Lterm -> <<&,y>,<£,y>>:Lterm -» £:Lterm *[Vw,u,v:Lterm](<w,u>:Z A <u,v>:Z 3 <w,v>:Z) « £ , £ > , « X , y > , < £ , y » > . Z , <«A,y>,<e.,v>>,£>:Z - > « £ , £ > , £ > : Z thinning *Z:CnvCls, <<<X,y>,<£,y>>,£>:Z, « £ , £ > , « X , y > , < £ , y > » : Z -> « £ , £ > , £ > : Z (a) ~y:Free[e] Z:CnvCls, *(~y:Free[£] 3 < « X , y > , < £ , y » , £ > : Z ) « £ , £ > , « X , y > , < £ , y » > : Z -> « £ , £ > , £ > : Z -> £:Lterm -> y:Lvar Z:CnvCls, *[Vw:Lterm]*[Vx:Lvar]( ~x:Free[w] 3 «<A , ,X>,<W,X»,W>:Z) « £ , £ > , « X , y > , < £ , y » > : Z - > « £ , £ > , £ > : Z *Z:CnvCls, < £ , £ > , « A , , y > , < £ , y > » : Z contraction -> « £ , £ > , £ > : Z ZrCnvCls, * « « X , x > , « X , y > , < x , y » > , £ > , « X , y > , < £ , y » > : Z -» * « « X , x > , « A . , y > , < x , y » > , £ > , £ > : Z (b) -> < £ , x , « X , y > , < x , y » , « X , y > , < £ , y > » : S u b s t ZrCnvCls, * ( < £ , x , « X , y > , < x , y » , « X , y > , < £ , y > » : S u b s t 3 « « X , x > , « X , y > , < x , y » > , £ > , « X , y > , < £ , y » > : Z ) « « A , , x > , « X , y > , < x , y » > , £ > , £ > : Z -> «X ,y> ,<x ,y» :Lterm -» £:Lterm Appendix H: Proof of Theorem 55.1 193 -»<<X,v>,<£,y>>:Lterm -» x:Lvar Z:CnvCls, *[Vw,u,v:Lterm]*[Vx:Lvar](<u,x,w,v>:Subst z> « « A . , x > , w > , u > , v > : Z ) -» « « X , x > , « X , y > , < x , y » > , £ > , £ > : Z *Z:CnvCls -> * « £ , £ > , £ > : Z contraction * [VzrCnvCls] « £ , £ > , £ > : z -> * « £ , £ > , £ > : C n v - » * « [ e l , [ e > , [ e l > : ° -> *[Vx,y:Lvar]<e,e,e>:° End of proof of theorem 5.5.1
- Library Home /
- Search Collections /
- Open Collections /
- Browse Collections /
- UBC Theses and Dissertations /
- Applications of a natural deduction set theory
Open Collections
UBC Theses and Dissertations
Featured Collection
UBC Theses and Dissertations
Applications of a natural deduction set theory Tsiknis, George Konstantinos 1991
pdf
Page Metadata
Item Metadata
Title | Applications of a natural deduction set theory |
Creator |
Tsiknis, George Konstantinos |
Publisher | University of British Columbia |
Date Issued | 1991 |
Description | The goal of this thesis is to demonstrate the versatility and suitability of a logic and set theory NaDSet for providing logical foundations to disparate areas of mathematics and computer science. Category theory has been chosen as the area of mathematics, while programming language semantics and semantics for the lambda calculus are the areas of computer science. In each of the three areas NaDSet provides a logical foundation using exactly the same "logistic" method: Basic concepts are defined as terms of the logic and then the logic is used to derive all theorems; no assumptions in the form of additional axioms or rules of deduction are needed. The thesis demonstrates the ease and directness with which this can be done for the three areas, suggesting that in other, as yet unexplored areas, NaDSet may prove to be equally useful. |
Genre |
Thesis/Dissertation |
Type |
Text |
Language | eng |
Date Available | 2011-03-09 |
Provider | Vancouver : University of British Columbia Library |
Rights | For non-commercial purposes only, such as research, private study and education. Additional conditions apply, see Terms of Use https://open.library.ubc.ca/terms_of_use. |
DOI | 10.14288/1.0302117 |
URI | http://hdl.handle.net/2429/32181 |
Degree |
Doctor of Philosophy - PhD |
Program |
Computer Science |
Affiliation |
Science, Faculty of Computer Science, Department of |
Degree Grantor | University of British Columbia |
Campus |
UBCV |
Scholarly Level | Graduate |
AggregatedSourceRepository | DSpace |
Download
- Media
- 831-UBC_1991_A1 T75.pdf [ 9.21MB ]
- Metadata
- JSON: 831-1.0302117.json
- JSON-LD: 831-1.0302117-ld.json
- RDF/XML (Pretty): 831-1.0302117-rdf.xml
- RDF/JSON: 831-1.0302117-rdf.json
- Turtle: 831-1.0302117-turtle.txt
- N-Triples: 831-1.0302117-rdf-ntriples.txt
- Original Record: 831-1.0302117-source.json
- Full Text
- 831-1.0302117-fulltext.txt
- Citation
- 831-1.0302117.ris
Full Text
Cite
Citation Scheme:
Usage Statistics
Share
Embed
Customize your widget with the following options, then copy and paste the code below into the HTML
of your page to embed this item in your website.
<div id="ubcOpenCollectionsWidgetDisplay">
<script id="ubcOpenCollectionsWidget"
src="{[{embed.src}]}"
data-item="{[{embed.item}]}"
data-collection="{[{embed.collection}]}"
data-metadata="{[{embed.showMetadata}]}"
data-width="{[{embed.width}]}"
async >
</script>
</div>
Our image viewer uses the IIIF 2.0 standard.
To load this item in other compatible viewers, use this url:
https://iiif.library.ubc.ca/presentation/dsp.831.1-0302117/manifest