Higher Inductive Types and Internal Parametricity for Cubical Type Theory Evan Cavallo CMU-CS-21-100 February 2021

Higher Inductive Types and Internal Parametricity for Cubical Type Theory Evan Cavallo CMU-CS-21-100 February 2021

Higher Inductive Types and Internal Parametricity for Cubical Type Theory Evan Cavallo CMU-CS-21-100 February 2021 Computer Science Department School of Computer Science Carnegie Mellon University Pittsburgh, PA 15213 Thesis Committee: Robert Harper, Chair Stephen Brookes Karl Crary Daniel R. Licata (Wesleyan University) Anders Mörtberg (Stockholm University) Submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy. Copyright © 2021 Evan Cavallo This research was sponsored by the United States Air Force Office of Scientific Research award numbers FA9550-15-1-0053 and FA9550-19-1-0216. The views and conclusions contained in this document are those of the author and should not be interpreted as representing the official policies, either expressed or implied, of any sponsoring institution, the U.S. government or any other entity. Keywords: dependent type theory, computational semantics, cubical type theory, internal parametricity, cohesive type theory iii Abstract Recent innovation in the design of type theories—foundational systems of mathe- matics with a focus on constructivity—has produced the concept of interval variable, which can be used to capture relations between objects that carry computational content. We examine two such relationships in type theory: equality, in particular quotients, and arbitrary relations as applied in parametricity interpretations. Cubical type theory, a system using an interval-based formulation of equality, enables a permissive kind of content-carrying equality that includes in particular isomorphism. Cubical type theory provides a constructive interpretation of homo- topy type theory and the Univalent Foundations, formalisms that introduced the idea of isomorphism as equality but which lack intrinsic computational meaning. The cu- bical approach to equality also rectifies long-standing deficiencies in the behavior of quotients in type theory. We realize a system of generalized quotients for cubical type theory originally conceived in homotopy type theory, called higher inductive types, that merges the concepts of inductive type and quotient. Such a mutual gen- eralization is particularly essential in the contentful equality setting, but also has significant applications to ordinary mathematics. Parametricity is, among other things, a proof technique for deriving properties of constructions performed in type theories, based on the idea that constructions preserve all relations between objects. Traditionally a meta-theoretical tool, recent work has shown that parametricity properties can be integrated into a type theory itself using an interval-based system. We develop internal parametricity on top of cubical type theory, examining the similarities and distinctions between the two ap- plications of intervals, finding that a background of cubical equality improves the behavior of internal parametricity, and applying internal parametricity as a tool to solve difficult problems in cubical type theory. We introduce a system of cohesion modalities to express the interaction between parametric and non-parametric type theory, enabling the use of parametricity results in a non-parametric setting. Acknowledgments I met Bob Harper in the first year of my undergraduate degree, when I sent him anemail expressing interest in functional programming. At that point I had other plans—a physics degree, for one—but over the years, Bob and the Programming Languages group coaxed me first from physics into mathematics and finally computer science, entrancing mewith tales of computational trinitarianism and elegant structure. We have always been an odd couple: Bob bombastic and firm in his convictions, me milquetoast and evasive. ButI would not have had it any other way; I have learned and will surely continue to learn a great deal from Bob about integrity, commitment, and passion, in science and in life. Bob, thank you for your expectations and for your boundless faith in me to meet them. My career owes its foundation to Carlo Angiuli, who took me under his wing in my un- dergraduate years, has always been ready to listen to my latest madcap idea, and whose cubical type theory became the foundation for the work of this dissertation. Jon Ster- ling has revolutionized my world more times than I can count. I thank the many others who have passed through Bob’s group and its environs in my time for all the discus- sions, hacking sessions, and fika we’ve had together: Dan Licata, Favonia, Ed Morehouse, Daniel Gratzer, Anders Mörtberg. The Principles of Programming group, and especially the Concert Reading Group, supplied me with my earliest understandings of program- ming languages and type theory; I am grateful to the generation of students before me for explaining it all to me and to the generation after for making me figure out how to explain it myself. Steve Awodey and his gang of philosophers taught me everything I know about category theory over years and years of seminars; I am particularly indebted to Steve, Ulrik Buchholtz, Egbert Rijke, and Mathieu Anel for their insights, but many others have influenced my work. Much of my understanding of internal parametricity was driven by discussions with the directed type theory group at the Snowbird MRC and subsequent conversations with Emily Riehl and Christian Sattler. I thank my committee for their time, and Dan in particular for suggesting a modal parametric type theory. I thank my many friends at CMU and in Pittsburgh for keeping my spirits bright; special thanks go to the Wednesday cohort, who have kept me from hermitage in the age of distance. Finally, I thank Mom, Dad, and Lindsay, who host me for the moment, for their everlasting support. To everyone else, may we meet again in person someday! v vii There are places that contain you, There are corners in your soul, Plastic laminations in your life. But when you’re on the inside Of the outside of your thoughts, Do they restrain or do you stay yourself? Now the inside of the near place Is the outside of the far, But you can only face your space one way. You’re really in the middle Of the inside of yourself, And there is only one thing we can say... You’ll never get out, you’ll never get out, You’ll never get out of the cube! It’s sad! But you’ll never get out, you’ll never get out, You’ll never get out ’til you’re dead! — Jim Henson’s The Cube Contents Contents ix Introduction 1 Contributions ..................................... 3 I Cubical type theory 5 1 Introduction 7 1.1 Equality in type theory ............................ 7 1.2 Realizing contentful equality ......................... 12 2 Martin-Löf’s type theory 19 2.1 A logic of programs .............................. 20 2.2 Formalisms ................................... 39 3 Cubical type theory 45 3.1 Cubical computational type theory ..................... 48 3.2 Programming in a cubical type theory .................... 71 3.3 Formalism and models ............................ 77 II Higher inductive types 83 4 Introduction 85 5 Case studies 95 5.1 Quotients and pushouts ............................ 95 5.2 Truncations .................................. 102 5.3 Identity types ................................. 106 ix x Contents 6 General higher inductive types 111 6.1 Specifications ................................. 112 6.2 Interpreting specifications . 119 6.3 Kan operations ................................. 131 6.4 Elimination ................................... 139 6.5 Strengthening canonicity . 147 7 Conclusions 151 7.1 Related work .................................. 151 7.2 Outlook ..................................... 155 III Internal parametricity 157 8 Introduction 159 9 Parametric cubical type theory 167 9.1 The bridge interval .............................. 168 9.2 Bridge types .................................. 173 9.3 Function types and the extent operator . 177 9.4 Gel types and relativity ............................ 181 10 Programming with parametricity 189 10.1 Characterizing Church booleans . 189 10.2 The relativity principle ............................ 192 10.3 Bridge-discrete types ............................. 194 10.4 The excluded middle ............................. 201 10.5 Iterated smash products ............................ 202 11 Formalism and models 209 11.1 Bicubical set model .............................. 212 12 Conclusions 217 12.1 Related work .................................. 217 12.2 Outlook ..................................... 224 IV Cohesive parametricity 225 13 Introduction 227 Contents xi 14 Cohesive parametric type theory 233 14.1 Interval theory and type systems . 237 14.2 Open judgments ................................ 238 14.3 Rules for modal operators and hypotheses . 246 14.4 Modal types .................................. 254 15 Programming in cohesive parametric type theory 265 15.1 Properties of the discrete embedding . 265 15.2 Church booleans ................................ 267 15.3 Bridge-discreteness .............................. 270 15.4 Iterated smash products ............................ 272 16 Formalism 281 16.1 Cubical set model ............................... 285 17 Conclusions 289 17.1 Related work .................................. 289 17.2 Outlook ..................................... 293 Bibliography 295 Introduction This dissertation presents two applications of interval variables to the design of type the- ories: first, to representing quotients, and second, to internalizing parametricity. A (dependent) type theory is a kind of mathematical framework: a

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    324 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us