Detailed overview of First Steps in Synthetic Tait Computability [000V]
- January 19, 2023
- Jon Sterling
We give a chapter-by-chapter overview of First Steps in Synthetic Tait Computability. The novel contributions are contained in Chapters 4, 5, 7, and 8; the remaining Chapters 0-3 and 6 are primarily expository.
Part I: dependent dype theory [000W]
- January 19, 2023
- Jon Sterling
Chapter 0: conspectus on type theory [000X]
- January 19, 2023
- Jon Sterling
This chapter situates the motivations and applications of type theory in mathematics and computer science, and poses these against the semantic and syntactic properties of type theory that are needed to substantiate these applications. On the semantic side, type theory needs a number of properties including function extensionality, function comprehension, propositional univalence, effective quotients, etc.; on the syntactic side, type theory needs to be at least consistent, and many applications require both canonicity and decidability. Combining these syntactic and semantic properties into a single system has been a challenge, and cubical type theory was designed with the intention of satisfying them all. Prior to this dissertation, only the decidability conjecture remained open; thus with the present contribution, we regard the Cubical Hypothesis confirmed.
Chapter 1: objective syntax of dependent types [000Y]
- January 19, 2023
- Jon Sterling
To state and prove theorems like canonicity and decidability for a type theory, we must have a mathematical definition of the syntax of type theory. Conventionally, the syntax of type theory has been studied in several layers: one starts with a definition of “raw” syntax as trees labeled by the names of the generating operations, quotients these trees under permutation of bound variables, and then layers on top of this an additional inductively defined formalism expressing the well-formedness of types, well-formedness of terms, definitional equality of types, and definitional equality of terms. After this, one verifies that definitional equivalence classes of well-formed types and terms can be used as the raw materials to construct a universal model of the type theory that has a universal property: any other model of type theory can be equipped with a unique structure-preserving homomorphism from the universal model. The described universal property determines the universal model up to unique isomorphism, if such a model exists.
We refer to the painstaking process described above as the subjective metatheory, building on the Hegel–Lawvere distinction between objective and subjective approaches to logic. The objective metatheory, in contrast, involves stating and proving results about type theories and programming languages relying only on the universal property of the universal model and not on any specifics of its presentation; the advantage of the objective metatheory is that it is simpler, more direct, more modular, and more composable.
Chapter 1 argues that the subjective metatheory in the sense described is redundant: the decidability conjecture can be stated with respect to any representative of the universal model and does not depend in any way on the raw syntax of type theory, and moreover, for all the type theories considered in this dissertation the existence of at least one representative of the universal model is guaranteed for somewhat trivial reasons that have nothing to do with the specifics of type theory. In this chapter, we develop a logical framework for specifying type theories modularly and working with their universal models in an objective fashion.
Part II: mathematical Background [000Z]
- January 19, 2023
- Jon Sterling
Chapter 2: the language of topoi [0010]
- January 19, 2023
- Jon Sterling
Much of this dissertation is stated and proved by exploiting the language of (Grothendieck) topoi, a concept that leads a dual life as a kind of generalized logic and as a kind of generalized topology. The viewpoint of topos theory qua generalized topology plays an important role in this dissertation, and yet it nonetheless remains unfamiliar to most computer scientists and logicians. For this reason, Chapter 2 is provided as sufficient exposition to understand the use of topoi in the remainder of the dissertation, focusing on the recollement or gluing of a topos from a pair of complementary open and closed subtopoi, a classical construction that provides the geometrical basis for synthetic Tait computability.
Chapter 3: the theory of universes [0011]
- January 19, 2023
- Jon Sterling
Universes started their life in the Grothendieck school of algebraic geometry as a technical device to circumvent the annoyance that there cannot be a “set of all sets”; a universe is a set of enough sets, and whilst a universe cannot contain itself, it may nonetheless lie within an even bigger universe. Several important developments in the theory of universes from the 1970s onward by Bénabou, Martin-Löf, Dybjer, Hofmann, Streicher, Awodey, and others have collided to deliver the present-day understanding of the centrality of universes in semantics: a model of type theory is just a special kind of universe in a special kind of category. This chapter provides expository background on the theory of universes, including a novel account of open and closed subuniverses to reflect the recollement theory of topoi from Chapter 2. These open and closed subuniverses will play a critical role in the development of synthetic Tait computability in subsequent chapters.
Part III: synthetic Tait computability [0012]
- January 19, 2023
- Jon Sterling
Chapter 4: Tait’s method of computability [0013]
- January 19, 2023
- Jon Sterling
It is simple enough to verify negative properties of a formal system, e.g. the non-derivability of a given assertion \Phi : find a mathematical object that models all the rules of the formal system and yet refutes \Phi . In contrast, it is much harder to verify any non-trivial positive property of a formal system (such as canonicity, normalization, decidability, etc.). To handle such results, new techniques were needed — and delivered in the late 1960s by Tait, Martin-Löf and others under the name of Tait’s method of computability or logical predicates. Since its inception, Tait’s method has been the primary tool for verifying positive properties of logics, programming languages, and type theories. Early on, Freyd noticed that the logical predicates arguments can be rephrased as model constructions that glue together geometrical objects corresponding to syntax (object) and set theory (meta), setting the stage for this thesis. Thus despite appearances, both positive and negative properties can both be proved using semantic methods.
In the subsequent development of the computability method for applications in computer science, indexed variants of the logical predicates have proved to be fundamental and a number of variations on indexed logical predicates have appeared including the Kripke logical predicates of Jung and Tiuryn and the much more sophisticated Grothendieck logical predicates of Fiore and Simpson as well as Altenkirch, Dybjer, Hofmann, and Scott. This chapter points out that all of these forms of indexing arise in the same way from what is referred to as a figure shape, a continuous map into the classifying space of “Henkin models” of a given theory. Then the (Kripke, Grothendieck, etc.) logical predicates model is presented much more simply as the Artin gluing of this morphism’s inverse image.
An explicit proof of canonicity for the simply typed \lambda -calculus motivates the abstraction and axiomatization of the geometry of figure shapes and their gluings as a new language for syntactic metatheory, namely synthetic Tait computability. The idea of synthetic Tait computability is to treat both object-level notions (e.g. the collection of terms of type \mathsf {bool}) and meta-level notions (e.g. a normal form of a given term) in the same language by means of a pair of lex idempotent modalities. One strength of this presentation is that both object-level and meta-level notions can be treated using higher-order abstract syntax (HOAS) in the sense of Hofmann, which greatly simplifies the manipulation of variables.
The first demonstration of the power and modularity of synthetic Tait computability is a new a proof of the canonicity property for Martin-Löf type theory. Unlike traditional proofs of canonicity via non-synthetic Tait computability, the synthetic version is completely modular and broken up into general-purpose lemmas that are stated at a high level of abstraction and can be reused in proofs of different properties for different type theories. (Indeed, some of the constructions isolated in this chapter are used off the shelf in Chapter 7 to prove normalization for cubical type theory.) The modularization of syntactic metatheory is one of the main contributions of this dissertation.
Chapter 5: synthetic normalization by evaluation [0015]
- January 19, 2023
- Jon Sterling
This chapter develops a more sophisticated application of synthetic Tait computability, the proof of normalization and decidability of Martin-Löf’s type theory with a cumulative hierarchy of universes. The synthetic argument contained in this chapter builds on the work of Fiore on categorical normalization by gluing for simply typed λ-calculus, and that of Coquand on a presheaf-theoretic version of normalization by evaluation for dependent types. Analogous to the external argument of Fiore, we construe the syntax of normal and neutral forms as the initial algebra for an internal inductive definition in the language of synthetic Tait computability. The influence of Coquand is visible in the definition of the Tait saturation yoga for dependent types in the synthetic setting, an important closure condition for logical predicates that comprised one of the main innovations of Tait in the context of simply typed combinators. Although this chapter is intended only as “dry run” for the main result (to be exposed in Chapter 7), the normalization argument presented here has intrinsic value: it is the simplest and most direct proof of normalization and decidability for Martin-Löf type theory with \eta -laws and cumulative universes that has appeared in the literature so far.
Part IV: cubical type theory [0016]
- January 19, 2023
- Jon Sterling
Chapter 6: cartesian cubical type theory [0017]
- January 19, 2023
- Jon Sterling
This expository chapter introduces cubical type theory as an extension to Martin-Löf’s type theory by an interval \mathbb {I} with two distinct endpoints 0, 1 : \mathbb {I}. The interval is a basic “figure” that defines a notion of path or identification {u}\mathrel {{\sim }_{A}}{v} between two elements of any type; for instance, to identify u,v:A is the same as to construct a function p:\mathbb {I}\to A such that p0 = u and p1=v. Terms involving variables of type \mathbb {I} can exhibit complex computational behavior that is difficult to account for: for instance, if p:{u}\mathrel {{\sim }_{A}}{v} and i:\mathbb {I} are variables, then the application pi:A is a normal form, but it must nonetheless reduce to either u or v when i is substituted for by a constant. Despite appearances, this scenario is fundamentally different from the way that pi must reduce when p is replaced by a \lambda -abstraction, as normal forms must a priori be closed under arbitrary \mathbb {I}-substitutions — a necessity, because the normal form of an n-cube must be an n-cube of normal forms. One of the main technical contributions of this dissertation, introduced in the next chapter, is to generalization of the notion of neutral form and the Tait saturation yoga that smoothly accommodates the problematic computational behavior of the interval.
Chapter 7: normalization for cubical type theory [0014]
- January 19, 2023
- Jon Sterling
This chapter reports the main result of the dissertation, normalization for cubical type theory and its corollaries: injectivity of type constructors, and decidability of equality & typing. These results were first obtained by Sterling and Angiuli for the fragment of cubical type theory without universes; the present chapter extends the results of op. cit. to support a cumulative hierarchy of universes.
The central innovation of this chapter is to generalize the notion of neutral form to accommodate the computational behavior of terms that have free variables of type \mathbb {I} discussed in our synopsis of Chapter 6. In the conventional account of neutral and normal forms, neutrals {\color {DarkRed}{e}} are built up inductively from x for term variables x : A, function applications to normal forms {{\color {DarkRed}{e}}}\mathrel {{\color {DarkRed}{\bullet }}}{{\color {DarkBlue}{m}}} and projections from neutral pairs {{\color {DarkRed}{e}}}{\color {DarkRed}{.1}}, {{\color {DarkRed}{e}}}{\color {DarkRed}{.2}}; our account of neutrals is much the same, except that each neutral form {\color {DarkRed}{e}} comes equipped with a “frontier of instability” \boldsymbol {\partial }{{\color {DarkRed}{e}}}, a predicate on its free \mathbb {I}-variables that indicates when it “needs to compute further”. We think of a neutral form for an n-cube as being undefined on its frontier of instability; the process of restricting a neutral to its frontier of instability is then referred to as destabilization.
When x : A is a variable of an ordinary type, the frontier of instability \boldsymbol {\partial }\,{\mathopen {}\left ({\color {DarkRed}{\mathsf {var}}}\,{x}\right )\mathclose {}} is empty because variables never need to compute further. Where something new happens is the path type: given a neutral form {\color {DarkRed}{e}} : \mathsf {ne}\,{\mathopen {}\left ({u}\mathrel {{\sim }_{A}}{v}\right )\mathclose {}} of path type, we have for each term r : \mathbb {I} a neutral form {{\color {DarkRed}{e}}}\mathrel {{\color {DarkRed}{@}}}{r} : \mathsf {ne}\,A whose frontier of instability is defined like so:
\boldsymbol {\partial }\,{\mathopen {}\left ({{\color {DarkRed}{e}}}\mathrel {{\color {DarkRed}{@}}}{r}\right )\mathclose {}} = \boldsymbol {\partial }{\color {DarkRed}{e}} \lor {\mathopen {}\left (r=0\right )\mathclose {}} \lor {\mathopen {}\left (r=1\right )\mathclose {}}In other words, the path neutral application {{\color {DarkRed}{e}}}\mathrel {{\color {DarkRed}{@}}}{r} needs to compute as soon as e needs to compute, and as soon as the interval term r : \mathbb {I} becomes equal to a constant. Prior to the introduction of the frontier of instability, the neutrals are embedded into the normals at base types unconditionally, i.e. for each neutral form {\color {DarkRed}{e}} : \mathsf {ne}\,\mathsf {bool}, we have a normal form {\color {DarkBlue}{\lfloor }}{e}{\color {DarkBlue}{\rfloor }} : \mathsf {nf}\,\mathsf {bool}.
Now that neutrals are equipped with frontiers of instability, a more refined notion of normal form is needed: when {\color {DarkRed}{e}} is a neutral form, the corresponding normal form should contain (recursively) normal forms for e that are defined under the frontier of instability \boldsymbol {\partial }\,{\color {DarkRed}{e}}. To be more concrete, let x : {\mathsf {tt}}\mathrel {{\sim }_{\mathsf {bool}}}{\mathsf {tt}} be a variable of path type and r : \mathbb {I} is a term; then {{\color {DarkRed}{\mathsf {var}}}\,x}\mathrel {{\color {DarkRed}{@}}}{r}:\mathsf {ne}\,{\mathopen {}\left ({\mathsf {tt}}\mathrel {{\sim }_{\mathsf {bool}}}{\mathsf {tt}}\right )\mathclose {}} is a neutral form for the term xr whose frontier of instability is the boundary (r = 0) \lor (r = 1); the corresponding normal form must therefore glue onto {{\color {DarkRed}{\mathsf {var}}}\,x}\mathrel {{\color {DarkRed}{@}}}{r} additional normal forms for x0 and x1. We refer to the process of completing a neutral with additional data defined on its frontier of instability as stabilization; the stabilized normal form of xr is then written
{\color {DarkBlue}{\lfloor }}{{{\color {DarkRed}{\mathsf {var}}}\,x}\mathrel {{\color {DarkRed}{@}}}{r} \mid r = 0 \hookrightarrow {\color {DarkBlue}{\mathsf {tt}}}, r = 1 \hookrightarrow {\color {DarkBlue}{\mathsf {tt}}}}{\color {DarkBlue}{\rfloor }}where {\color {DarkBlue}{\mathsf {tt}}} is the normal form representing the term \mathsf {tt}
Just as the embedding of neutrals into normals is “stabilized” by a com patible normal form defined on the neutral’s frontier of instability, so too must the Tait saturation yoga be adjusted. Conventionally one requires the computability predicate for a type A to be equipped with a function that takes neutral forms {\color {DarkRed}{e}} of terms e : A to computability witnesses for the same term. In the stabilized Tait saturation yoga, we strengthen the induction hypothesis to require for each neutral form {\color {DarkRed}{e}} a function that extends a computability witness defined only on the frontier of instability \boldsymbol {\partial }{\color {DarkRed}{e}} to a computability witnessed defined everywhere
The twin innovations of frontiers of instability and stabilization then suffice to adapt the synthetic normalization argument of Chapter 5 to a proof of normalization (and thus decidability) for cubical type theory.
Part V: prospects [0018]
- January 19, 2023
- Jon Sterling
Chapter 8: a plan for PL [0019]
- January 19, 2023
- Jon Sterling
This dissertation has focused almost solely on the development and applications of synthetic Tait computability in the context of pure type theory, but the author originally invented synthetic Tait computability to solve problems in core programming languages, as part of Sterling and Harper’s re-analysis of the phase distinction in ML-style module systems between static (compiletime) and dynamic (runtime) code. The purpose of this chapter is to identify several applications of synthetic Tait computability to core programming languages, and set an agenda for future work — some of which has been executed and published following the completion of this dissertation
§ 8.1: two phase distinctions for program modules [001A]
- January 19, 2023
- Jon Sterling
A brief overview is given of the applications of synthetic Tait computability to program modules, material that is published in the Journal of the ACM.
§ 8.2: type refinements and program extraction [001B]
- January 19, 2023
- Jon Sterling
The modal language of synthetic Tait computability promises a new and more abstract account of refinement types and program extraction via a phase distinction between computation and specification. Refinement types are often thought of as a kind of subtype, but there is a fundamental difference: when {\phi }\sqsubset {A} and {\psi }\sqsubset {B} are refinements of types A and B respectively, then \phi \to \psi refines A\to B. In contrast, subtyping laws for function spaces are contravariant in the domain. The refinements available in synthetic Tait computability are moreover proof-relevant in the sense that specification-level code can contain data in addition to properties. The application to proof-relevant refinement types is employed by Niu, Sterling, Grodin, and Harper to develop a logical framework for simultaneously verifying behavior and complexity of functional programs.
§ 8.3: information-flow and noninterference [001C]
- January 20, 2023
- Jon Sterling
Finally, an application of synthetic Tait computability to security and information flow control is identified: a security class is a phase distinction between low and high security. The preliminary results presented in this section have been substantially improved upon by Sterling and Harper, adding support for general recursion and termination-insensitive noninterference by combining synthetic Tait computability with synthetic domain theory.