15-819 Computational Higher Type Theory


Course Information

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

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 Type Theory (CTT), 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 CTT, 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 NuPRL system is based on a proof theory, called refinement logic, that supports interactive proof development and extraction of programs from proofs.

We will then investigate a recent advance in computational type theory, called Cubical Computational Type Theory (CCTT), which enriches CTT 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 CTT, proof theories for CCTT are chosen according to convenience so as to support deriving true equations between types and their elements at all dimensions. The RedTT system is new proof interactive proof checker for CCTT. It uses a novel proof theory to support the convenient development of proofs/programs in computational cubical type theory.

References

Lecture notes by Ryan Kavanagh (2018).

Requirements

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

No letter grades will be assigned for this class.

Schedule

The notes from last year's instance are included as a convenient reference, but be warned that they are not perfectly synchronized in content or development as this year's instance.

Date Topic Reading Last Year's Notes
Jan 15 (No Class: PoPL)
Jan 17 (No Class: PoPL)
Jan 22 Computational and Formal Type Theory Constable, et al. NuPRL; Martin-Löf ITT, CMCP Balzer and Gratzer
24 Formal Type Theory and its Computational Interpretation Stenlund; Tait's Method for Termination
29 Semantic Type Theory Martin-Löf CMCP Balzer and Niu
31 (Class Cancelled due to weather)
Feb 5 Equality for Formal and Semantic Type Theory Martin-Löf CMCP; Stenlund Kavanagh and Coblenz
7 Decidability of Formal Equality Stenlund; Angiuli STLC
12 Normalization Angiuli STLC Niu and Yuan
14 Computational Interpretation of Girard's F Girard's Method for Termination
19 Girard's F; Behavioral Dependent Types Martin-Löf ITT, CMCP; Constable et al. NuPRL
21 Behavioral Dependent Types Martin-Löf CMCP; Constable, et al NuPRL Derakshan and Wang
26 Propositions-as-Types Van Heijenoort; Dybjer Meaning Explanations Derakshan and Wang
28 Formal Dependent Type Theory Martin-Löf ITT; Hofmann SSDT
Mar 5 Identity Type in Formal Type Theory Martin-Löf ITT; HoTT Book Evan Cavallo
7 Computational Dependent Type Theory Martin-Löf CMCP; Constable, et al.
12 Computational Dependent Type Theory Martin-Löf CMCP; Constable, et al. Yue Niu and Jonathan Laurent
14 Mathematical Semantics of CDTT Martin-Löf CMCP; Constable, et al.; Allen
19 (Spring Break)
21 (Spring Break)
26 Mathematical Semantics of CDTT Martin-Löf CMCP; Constable, et al. Travis Hance and Paul Goelz
28 Homotopy Type Theory: Enriching ITT HoTT Book; Grayson; Tsementzis
Apr 2 Homotopy Type Theory: Univalence HoTT Book; Escardo; Angiuli J; Licata FunExt Di Wang
4 Homotopy Type Theory: Higher Inductive Types HoTT Book
9 Computational Cubical Dependent Type Theory (CCDTT) AHW PoPL; AH Meaning; AFH III Kavananagh, Sterling, Laurent
11 Meanings of Judgments AH Meaning; AFH III
16 Cartesian Cubical Type Theory AH Meaning; AFH III
18 Cubical Pre-Types AFH III
23 Kan Conditions: Coercion AFH III
25 Kan Conditions: Coercion
30 Kan Conditions: Coercion AFH III
May 2 Kan Conditions: Composition AFH III
7 Universes and Univalence AFH III Goelz
9 Higher Inductive Types CH IV

Robert Harper
Last modified: Mon Feb 18 22:42:42 EST 2019