15-819 Computational Higher Type Theory


Course Information

Time: Tue-Thu 10:30-11:50
Room: 4303 GHC
Instructor: Robert Harper
Slack: Slack

Synopsis

Computational type theory has its origins in Martin-Löf's Constructive Mathematics and Computer Programming. That paper provided the foundation for the NuPRL type theory and implementation, which has been under continual development at Cornell since the early 1980's. Unlike formal type theory, computational type theory begins with the notion of program, and defines types as specifications of program behavior. This leads to a very rich type theory that encompasses the usual logically-motivated types and extends it with many concepts motivated directly by computation. With types being defined semantically, the role of proof theory is entirely pragmatic, supporting implementation, rather than definitional or conceptual.

The subject of this course is Computational Dependent Type Theory (CDTT), a theory of constructive mathematics based on computation. We will begin by developing the origins of computational type theory, and its relation to formal type theory. The semantic method used to define CDTT, called a meaning explanation, is related to the main method used to analyze formal type theories, the theory of logical relations. But, rather than being a metamathematical device, the relational interpretation of types defines the semantics of types. An important technical distinction, however, is in the semantics of variables. In computational type theory variables behave as they do in informal mathematics, ranging over the values of a type, whereas in formal type theory variables behave more like indeterminates in algebra. The emphasis in computational type theory is on execution of closed programs, whereas the emphasis in formal type theory is on calculation with open terms. Moreover, the concept of judgmental equality differs markedly in the two settings.

We will build up a full treatment of dependent type theory in the computational setting. The computational approach starts with a programming language given by a deterministic transition system and the notion of a value, or canonical form. The meaning explanation defines types as programs whose values index, or name, specifications of program behavior. The elements of a type are those programs that behave according to the specification given by its type. Philosophically, the meaning explanation is meant to be self-standing, meaningful on its own terms and not in need of further explanation or justification. Mathematically, it can be helpful to examine these principles by a rigorous construction, along the lines considered by Allen and Crary.

Computational type theory is implemented by a proof theory that is sound according to the meaning explanations to be convenient to use. Proof theory is viewed as a means to access the truth; it describes, rather than defines, the subject matter. A practical proof theory need not (and does not) correspond to any extant system of formal logic, nor need it satisfy any meta-theoretic properties other than being sound for the semantics. But it does need to be practical! For example, the RedPRL system is based on a proof theory, called refinement logic, that supports interactive proof development and extraction of programs from proofs. It is inspired by the NuPRL system, which has been under development at Cornell for the last thirty years.

We will then investigate a recent advance in computational type theory, called Computational Cubical Dependent Type Theory (CCDTT), which enriches CDTT with identifications, or paths, of all finite dimensions. The ordinary elements of a type are called its points, and are of dimension 0. Its elements at dimension n+1 are paths that connect two elements of dimension n, and serve as a witness of the interchangeability of those elements in all contexts. From a programming viewpoint, the higher-dimensional structure provides a general theory of (symmetric) coercions between types. From a mathematical viewpoint, it makes connections to algebraic topology and higher category theory. In either case a central concept is Voevodsky's univalence axiom, which asserts that equivalent (loosely speaking, isomorphic) types are identified (interchangeable).

There are many ways to organize the higher structure of types. We will use a cubical structure in which types and terms are stratified into dimensions, with dimension zero corresponding to conventional computational type theory, and with the objects at dimension n+1 being n+1-dimensional cubes, which may be considered as lines between n-cubes in n different ways, corresponding to the pairs of opposing faces in each dimension. Thus, a 1-cube is a line connecting two points, a 2-cube is a square connecting two lines by connecting their end points, a 3-cube is, well, a cube connecting three pairs of squares in three ways, and so on through all dimensions. In the computational setting a cube is a program whose evaluation sensitive to the bindings of dimension variables that, when specialized to 0 or 1, induce the computation of the end points of a line parameterized by that variable. A cube may also execute in response to the substitution of one variable for another, forming the diagonal of a square.

The higher-dimensional structure applies to types as well as their members. At dimension zero there is no room for variation, so that types and members are as in ordinary computational type theory. At higher dimension a line of types classifies a line of elements in such a way that the end points of the element line inhabit the corresponding end points of the type line. Moreover, a line of types induces a coercion between its end points that, in general, computes in a non-trivial way to express the computational meaning of that line. For a line of terms to inhabit a line of types, coercion along the type line must take the left end point of the element line from the left end point of the type line to the right end point of the type line, wherein they are identified. (And, conversely, the right end point must be coerced to the left end of the type wherein it is identified with the left end point.) Well-typed computations are required to be coherent in that the order of specialization of dimensions does not matter---the upper point of the left edge of a square must coincide with the left point of its upper edge. Finally, there must be enough lines to ensure that, for example, two lines with the same intermediate end point may be concatenated to form another line, and there must be higher-dimensional lines witnessing the associativity of concatenation. The general condition is called the Kan condition, which amounts to demanding that a class of equational constraint satisfaction problems have solutions---which, in the computational setting, means to require that the solutions be computable from the problem specification in a uniform manner.

Just as in ordinary CDTT, proof theories for CCDTT are chosen according to convenience so as to support deriving true equations between types and their elements at all dimensions. The RedPRL system implements CCDTT using a higher-dimensional form of refinement logic that specifies the extraction of programs from proofs and provides a means of executing them. Thus, the propositions-as-types correspondence extends to the higher-dimensional case.

References

Requirements

The class is open to any PhD student, and to undergraduate or other graduate students with permission of the instructor.

All students are required to participate by preparing typeset lecture notes.

No letter grades will be assigned for this class. It should not be taken to fulfill a course requirement or for degree credit.

Schedule

Date Topic Reading Notes
Jan 16 Computational and Formal Type Theory Constable, et al. NuPRL; Martin-Löf ITT, CMCP Balzer and Gratzer
18 Semantic Interpretation of Function Types Angiuli STLC; Martin-Löf CMCP; Stenlund
23 Formal Interpretation of Function Types Angiuli STLC; Martin-Löf CMCP; Stenlund Balzer and Niu
25 Kripke Logical Relations Martin-Löf CMCP; Stenlund
30 Interpretations of Positive Types Martin-Löf CMCP; Stenlund Kavanagh and Coblenz
Feb 1 Interpretations of Positive Types Martin-Löf CMCP; Stenlund
6 Computational Interpretation of Polymorphism Girard PandT Niu and Yuan
8 Structural and Behavioral Equality Martin-Löf ITT, CMCP, Truth, Analytic; Constable, et al NuPRL
13 (Class cancelled)
15 Structural and Behavioral Equality Martin-Löf ITT, CMCP, Truth, Analytic; Constable, et al NuPRL Derakshan and Wang
20 Propositions-as-Types Van Heijenoort; Sterling Meaning Explanations Derakshan and Wang
22 Formal Dependent Type Theory Martin-Löf ITT; Hofmann SSDT
27 Identity Type in Formal Type Theory Martin-Löf ITT; HoTT Book Evan Cavallo
Mar 1 Computational Dependent Type Theory Martin-Löf CMCP; Sterling Meaning; Constable, et al.
6 Computational Dependent Type Theory Martin-Löf CMCP; Constable, et al. Yue Niu and Jonathan Laurent
8 Mathematical Semantics of CDTT Martin-Löf CMCP; Constable, et al.; Allen
13 (Spring Break)
15 (Spring Break)
20 Mathemetical Semantics of CDTT Martin-Löf CMCP; Sterling Meaning; Constable, et al. Travis Hance and Paul Goelz
22 Homotopy Type Theory: Enriching ITT HoTT Book; Grayson; Tsementzis
27 Homotopy Type Theory: Univalence HoTT Book; Escardo; Angiuli J; Licata FunExt Di Wang
29 Homotopy Type Theory: Higher Inductive Types HoTT Book
Apr 3 Computational Cubical Dependent Type Theory (CCDTT) AHW PoPL; AH Meaning; AFH III Kavananagh, Sterling, Laurent
5 Meanings of Judgments AH Meaning; AFH III
10 Cartesian Cubical Type Theory AH Meaning; AFH III
12 Cubical Pre-Types AFH III
17 Kan Conditions: Coercion AFH III
19 (No Class)
24 Kan Conditions: Coercion AFH III
26 Kan Conditions: Composition AFH III
May 1 Universes and Univalence AFH III Goelz
3 Higher Inductive Types CH IV

Robert Harper
Last modified: Wed May 16 13:13:48 EDT 2018