Homotopy Type Theory: Univalent Foundations of Mathematics
Total Page:16
File Type:pdf, Size:1020Kb
Homotopy Type Theory Univalent Foundations of Mathematics arXiv:1308.0729v1 [math.LO] 3 Aug 2013 THE UNIVALENT FOUNDATIONS PROGRAM INSTITUTE FOR ADVANCED STUDY Homotopy Type Theory Univalent Foundations of Mathematics The Univalent Foundations Program Institute for Advanced Study “Homotopy Type Theory: Univalent Foundations of Mathematics” c 2013 The Univalent Foundations Program Book version: first-edition-257-g5561b73 MSC 2010 classification: 03-02, 55-02, 03B15 This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/. This book is freely available at http://homotopytypetheory.org/book/. Acknowledgment Apart from the generous support from the Institute for Advanced Study, some contributors to the book were partially or fully supported by the following agencies and grants: • Association of Members of the Institute for Advanced Study: a grant to the Institute for Advanced Study • Agencija za raziskovalno dejavnost Republike Slovenije: P1–0294, N1–0011. • Air Force Office of Scientific Research: FA9550-11-1-0143, and FA9550-12-1-0370. This material is based in part upon work supported by the AFOSR under the above awards. Any opinions, findings, and conclusions or recommendations expressed in this publication are those of the author(s) and do not necessarily reflect the views of the AFOSR. • Engineering and Physical Sciences Research Council: EP/G034109/1, EP/G03298X/1. • European Union’s 7th Framework Programme under grant agreement nr. 243847 (ForMath). • National Science Foundation: DMS-1001191, DMS-1100938, CCF-1116703, and DMS-1128155. This material is based in part upon work supported by the National Science Foundation under the above awards. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation. • The Simonyi Fund: a grant to the Institute for Advanced Study Preface IAS Special Year on Univalent Foundations A Special Year on Univalent Foundations of Mathematics was held in 2012-13 at the Institute for Advanced Study, School of Mathematics, organized by Steve Awodey, Thierry Coquand, and Vladimir Voevodsky. The following people were the official participants. Peter Aczel Eric Finster Alvaro Pelayo Benedikt Ahrens Daniel Grayson Andrew Polonsky Thorsten Altenkirch Hugo Herbelin Michael Shulman Steve Awodey Andre´ Joyal Matthieu Sozeau Bruno Barras Dan Licata Bas Spitters Andrej Bauer Peter Lumsdaine Benno van den Berg Yves Bertot Assia Mahboubi Vladimir Voevodsky Marc Bezem Per Martin-Lof¨ Michael Warren Thierry Coquand Sergey Melikhov Noam Zeilberger There were also the following students, whose participation was no less valuable. Carlo Angiuli Guillaume Brunerie Egbert Rijke Anthony Bordg Chris Kapulkin Kristina Sojakova In addition, there were the following short- and long-term visitors, including student visitors, whose contributions to the Special Year were also essential. Jeremy Avigad Richard Garner Nuo Li Cyril Cohen Georges Gonthier Zhaohui Luo Robert Constable Thomas Hales Michael Nahas Pierre-Louis Curien Robert Harper Erik Palmgren Peter Dybjer Martin Hofmann Emily Riehl Mart´ın Escardo´ Pieter Hofstra Dana Scott Kuen-Bang Hou Joachim Kock Philip Scott Nicola Gambino Nicolai Kraus Sergei Soloviev iv About this book We did not set out to write a book. The present work has its origins in our collective attempts to develop a new style of “informal type theory” that can be read and understood by a human be- ing, as a complement to a formal proof that can be checked by a machine. Univalent foundations is closely tied to the idea of a foundation of mathematics that can be implemented in a computer proof assistant. Although such a formalization is not part of this book, much of the material presented here was actually done first in the fully formalized setting inside a proof assistant, and only later “unformalized” to arrive at the presentation you find before you — a remarkable inversion of the usual state of affairs in formalized mathematics. Each of the above-named individuals contributed something to the Special Year — and so to this book — in the form of ideas, words, or deeds. The spirit of collaboration that prevailed throughout the year was truly extraordinary. Special thanks are due to the Institute for Advanced Study, without which this book would obviously never have come to be. It proved to be an ideal setting for the creation of this new branch of mathematics: stimulating, congenial, and supportive. May some trace of this unique atmosphere linger in the pages of this book, and in the future development of this new field of study. The Univalent Foundations Program Institute for Advanced Study Princeton, April 2013 Contents Introduction 1 I Foundations 15 1 Type theory 17 1.1 Type theory versus set theory . 17 1.2 Function types . 21 1.3 Universes and families . 24 1.4 Dependent function types (P-types) . 25 1.5 Product types . 26 1.6 Dependent pair types (S-types) . 30 1.7 Coproduct types . 33 1.8 The type of booleans . 34 1.9 The natural numbers . 36 1.10 Pattern matching and recursion . 39 1.11 Propositions as types . 41 1.12 Identity types . 47 Notes................................................ 53 Exercises . 55 2 Homotopy type theory 57 2.1 Types are higher groupoids . 60 2.2 Functions are functors . 68 2.3 Type families are fibrations . 69 2.4 Homotopies and equivalences . 73 2.5 The higher groupoid structure of type formers . 77 2.6 Cartesian product types . 78 2.7 S-types . 80 2.8 The unit type . 83 2.9 P-types and the function extensionality axiom . 83 2.10 Universes and the univalence axiom . 85 2.11 Identity type . 87 vi Contents 2.12 Coproducts . 89 2.13 Natural numbers . 91 2.14 Example: equality of structures . 93 2.15 Universal properties . 96 Notes................................................ 98 Exercises . 100 3 Sets and logic 103 3.1 Sets and n-types . 103 3.2 Propositions as types? . 105 3.3 Mere propositions . 107 3.4 Classical vs. intuitionistic logic . 109 3.5 Subsets and propositional resizing . 110 3.6 The logic of mere propositions . 112 3.7 Propositional truncation . 113 3.8 The axiom of choice . 114 3.9 The principle of unique choice . 116 3.10 When are propositions truncated? . 117 3.11 Contractibility . 119 Notes................................................ 122 Exercises . 123 4 Equivalences 125 4.1 Quasi-inverses . 126 4.2 Half adjoint equivalences . 128 4.3 Bi-invertible maps . 132 4.4 Contractible fibers . 133 4.5 On the definition of equivalences . 134 4.6 Surjections and embeddings . 134 4.7 Closure properties of equivalences . 135 4.8 The object classifier . 138 4.9 Univalence implies function extensionality . 140 Notes................................................ 142 Exercises . 142 5 Induction 145 5.1 Introduction to inductive types . 145 5.2 Uniqueness of inductive types . 148 5.3 W-types . 150 5.4 Inductive types are initial algebras . 153 5.5 Homotopy-inductive types . 156 5.6 The general syntax of inductive definitions . 160 5.7 Generalizations of inductive types . 164 5.8 Identity types and identity systems . 166 Contents vii Notes................................................ 170 Exercises . 171 6 Higher inductive types 173 6.1 Introduction . 173 6.2 Induction principles and dependent paths . 175 6.3 The interval . 180 6.4 Circles and spheres . 181 6.5 Suspensions . 183 6.6 Cell complexes . 187 6.7 Hubs and spokes . 188 6.8 Pushouts . 190 6.9 Truncations . 193 6.10 Quotients . 195 6.11 Algebra . ..