This paper improves the treatment of equality in guarded dependent type theory (GDTT), by combining it with cubical type theory (CTT). GDTT is an extensional type theory with guarded recursive types, which are useful for building models of program logics, and for programming and reasoning with coinductive types. We wish to implement GDTT with decidable type checking, while still supporting non-trivial equality proofs that reason about the extensions of guarded recursive constructions. CTT is a variation of Martin-Löf type theory in which the identity type is replaced by abstract paths between terms. CTT provides a computational interpretation of functional extensionality, enjoys canonicity for the natural numbers type, and is conjectured to support decidable type-checking. Our new type theory, guarded cubical type theory (GCTT), provides a computational interpretation of extensionality for guarded recursive types. This further expands the foundations of CTT as a basis for formalisation in mathematics and computer science. We present examples to demonstrate the expressivity of our type theory, all of which have been checked using a prototype type-checker implementation. We show that CTT can be given semantics in presheaves on C × D, where C is the cube category, and D is any small category with an initial object. We then show that the category of presheaves on C × ω provides semantics for GCTT.
arXiv:1611.09263v2 [cs.LO] 6 Oct 2017Clouston et al. [11] developed guarded recursive types in a simply-typed setting, following earlier work [27,3,1], with semantics in the presheaf category ω known as the topos of trees, and also presented a logic for reasoning about programs with guarded recursion. For large examples, such as models of program logics, we would like to be able to formalise such reasoning. A major approach to formalisation is via dependent types, used for example in the proof assistants Coq [24] and Agda [28]. Bizjak et al. [10], following earlier work [6,26], introduced guarded dependent type theory (GDTT), integrating the type-former into a dependently typed calculus, and supporting the definition of guarded recursive types as fixed-points of functions on universes, and guarded recursive operations on these types.We wish to formalise non-trivial theorems about equality between guarded recursive constructions, but such arguments often cannot be accommodated within intensional Martin-Löf type theory. For example, we may need to be able to reason about the extensions of streams in order to prove the equality of different stream functions. Hence GDTT includes an equality reflection rule, which is well known to make type checking undecidable. This problem is close to well-known problems with functional extensionality [16, Section 3.1.3], and indeed this analogy can be developed. Just as functional extensionality involves mapping terms of type (x : A) → Id B (f x) (gx) to proofs of Id (A → B) f g, extensionality for guarded recursion requires an extensionality principle for later types, namely the ability to m...