Categorical Logic and Type Theory
Total Page:16
File Type:pdf, Size:1020Kb
CATEGORICAL LOGIC AND TYPE THEORY Bart JACOBS Research Fellow ofthe Royal Netherlands Academy of Ans and Sciences Computing Science Institute, University ofNijmegen, P.O. Box 9010, 6500 GL Nijmegen, The Netherlands 1999 ELSEVIER AMSTERDAM • LAUSANNE • NEW YORK • OXFORD • SHANNON • SINGAPORE • TOKYO Contents Preface v Contents vii Preliminaries xi 0. Prospectus 1 0.1. Logic, type theory, and fibred category theory 1 0.2. The logic and type theory of sets 11 1. Introduction to ßbred category theory 19 1.1. Fibrations 20 1.2. Some concrete examples: sets, w-sets and PERs 31 1.3. Some general examples 40 1.4. Cloven and split fibrations 47 1.5. Change-of-base and composition for fibrations 56 1.6. Fibrations of signatures 64 1.7. Categories of fibrations 72 1.8. Fibrewise structure and fibred adjunctions 80 1.9. Fibred products and coprodncts 93 1.10. Indexed categories 107 2. Simple type theory 119 2.1. The basic calculus of types and terms 120 2.2. Functorial semantics 126 vii viii Contents 2.3. Exponents, products and coproducts 133 2.4. Semantics of simple type theories 146 2.5. Semantics of the untyped lambda calculus as a corollary 154 2.6. Simple parameters 157 3. Equational Logic 169 3.1. Logics 170 3.2. Specifications and theories in equational logic 177 3.3. Algebraic specifications 183 3.4. Fibred equality 190 3.5. Fibrations for equational logic 201 3.6. Fibred functorial semantics 209 4. First order predicate logic 219 4.1. Signatures, connectives and quantifiers 221 4.2. Fibrations for first order predicate logic 232 4.3. Functorial Interpretation and internal language 246 4.4. Subobject fibrations I: regulär categories 256 4.5. Subobject fibrations II: coherent categories and logoses 265 4.6. Subset types . 272 4.7. Quotient types 282 4.8. Quotient types, categorically 290 4.9. A logical characterisation of subobject fibrations 304 5. Higher order predicate logic 311 5.1. Higher order signatures 312 5.2. Generic objects 321 5.3. Fibrations for higher order logic 330 5.4. Elementary toposes 338 5.5. Colimits, powerobjects and well-poweredness in a topos 346 5.6. Nuclei in a topos 353 5.7. Separated objects and sheaves in a topos 360 5.8. A logical description of separated objects and sheaves 368 6. The effective topos 373 6.1. Constructing a topos from a higher Order fibration 374 6.2. The effective topos and its subcategories of sets, u;-sets, and PERs .... 385 6.3. Families of PERs and w-sets over the effective topos 393 6.4. Natural numbers in the effective topos and some associated principles . 398 7. Internal category theory 407 7.1. Definition and exarnples of internal categories 408 7.2. Internal functors and natural transformations 414 7.3. Externalisation 421 7.4. Internal diagrams and completeness 430 Contents ix 8. Polymorphie type theory 441 8.1. Syntax 444 8.2. Use of Polymorphie type theory 454 8.3. Naive set theoretic semantics 463 8.4. Fibrations for Polymorphie type theory 471 8.5. Small Polymorphie fibrations 485 8.6. Logic over Polymorphie type theory 495 9. Advanced ßbred category theory 509 9.1. Opfibrations and fibred spans 510 9.2. Logical predicates and relations 518 9.3. Quantification 535 9.4. Category theory over a fibration 547 9.5. Locally small fibrations 558 9.6. Definability 568 10. First order dependent type theory 581 10.1. A calculus of dependent types 584 10.2. Use of dependent types 594 10.3. A term model 601 10.4. Display maps and comprehension categories 609 10.5. Closed comprehension categories 623 10.6. Domain theoretic modeis of type dependency 637 11. Higher order dependent type theory 645 11.1. Dependent predicate logic 648 11.2. Dependent predicate logic, categorically 653 11.3. Polymorphie dependent type theory 662 11.4. Strong and very strong sum and equality 674 11.5. Füll higher order dependent type theory 684 11.6. Füll higher order dependent type theory, categorically 692 11.7. Completeness of the category of PERs in the effective topos 707 References 717 Notation Index 735 Subject Index 743 .