Normalization for Cubical Type Theory
aa r X i v : . [ c s . L O ] J a n Normalization for Cubical Type Theory
Jonathan Sterling
Computer Science DepartmentCarnegie Mellon University
Carlo Angiuli
Computer Science DepartmentCarnegie Mellon University
Abstract —We prove normalization for (univalent, Cartesian)cubical type theory, closing the last major open problem in thesyntactic metatheory of cubical type theory. Our normalizationresult is reduction-free , in the sense of yielding an injectivefunction from equivalence classes of terms in context to atractable language of β/η -normal forms. As corollaries we obtainboth decidability of judgmental equality as well as the injectivityof type constructors in judgmentally consistent contexts.
I. I
NTRODUCTION
De Morgan [19] and Cartesian [8, 9] cubical type theoryare recent extensions of Martin-L¨of type theory which pro-vide constructive formulations of higher inductive types andVoevodsky’s univalence axiom; unlike homotopy type theory[63], both enjoy canonicity , the property that closed terms ofbase type are judgmentally equal to constructors [8, 34].Several proof assistants already implement cubical typetheory, most notably Cubical Agda [64] (for the De Morganvariant) and redtt [48] (for Cartesian). Like most type-theoretic proof assistants, both typecheck terms using algo-rithms inspired by normalization by evaluation [1], whichinterleave evaluation and decomposition of types. The cor-rectness of these algorithms hinges not on canonicity but on normalization theorems characterizing judgmental equivalenceclasses of open terms—and consequences thereof, such asdecidability of equality and injectivity of type constructors.But unlike canonicity, normalization and its corollaries haveuntil now remained conjectures for cubical type theory.We contribute the first normalization proof for Cartesiancubical type theory [9]. By relying on recent advances inthe metatheory of type theory, our proof is significantly moreabstract and concise than existing canonicity proofs for cubicaltype theory; moreover, it can be adapted to De Morgan cubicaltype theory without conceptual changes.
A. Cubical type theory and synthetic semantics
Cubical type theory extends type theory with a number offeatures centered around a primitive interval I with elements , I . Propositional equality is captured by a path type path ( A, a , a ) whose elements are functions f : Q i : I A ( i ) satisfying f (0) = a and f (1) = a judgmentally. Congruenceof paths follows from substitution; the remaining propertiesof equality are defined at each type by the Kan operations ofcoercion and box filling (or composition).In Cartesian cubical type theory, coercion is a function coe : Q A : I →U Q r,s : I A ( r ) → A ( s ) satisfying coe ( A, r, r, a ) = a for all A : I → U and a : A ( r ) , and additional equations for each particular connective, e.g.: coe (cid:0) λi. (cid:0)Q x : A ( i ) B ( i, x ) (cid:1) , r, s, f (cid:1) = λx. coe ( λi.B ( i, coe ( A, s, i, x )) , r, s, f ( coe ( A, s, r, x )))
The equations governing coercion and composition arecomplex, especially for the glue type which justifies uni-valence; calculating (and verifying the well-definedness of)these equations was a major obstacle in early work on cubicaltype theory. Orton and Pitts [43, 46] streamlined this processby observing that the model construction for De Morgancubical type theory—the most technical part of which is theseequations—can be carried out synthetically in the internalextensional type theory of any topos satisfying nine axioms(e.g., whose objects are De Morgan cubical sets); Angiuli et al.[9] establish an analogous result for the Cartesian variant.A subtle aspect of these models is that coercion is definednot on types A : U but on type families A : I → U ;consequently, a semantic universe U of types-with-coercionmust strangely admit a coercion structure for every figure I → U . Licata et al. [43] obtain U by transposing the coercionmap across the right adjoint to exponentiation by I given bythe tininess of I .The synthetic approach of Orton and Pitts simplifies andclarifies the model construction of cubical type theory byfactoring out naturality obligations, in much the same waythat homotopy type theory provides a “synthetic homotopytheory” that factors out e.g., continuity obligations.In this paper, we combine ideas of Orton and Pitts withthe synthetic Tait computability (STC) theory of Sterling andHarper [55], which factors out bureaucratic aspects of syntacticmetatheory. In STC, one considers an extensional type theorywhose types are (proof-relevant) logical relations; the under-lying syntax is exposed via a proof-irrelevant proposition syn under which the syntactic part of a logical relation is projected. B. Canonicity for cubical type theory
Traditional canonicity proofs fix an evaluation strategy forclosed terms, and associate to each closed type a proof-irrelevant computability predicate or logical relation rangingover closed terms of that type. Then, one ensures that evalua-tion is contained within judgmental equality, that computabil-ity is closed under evaluation, and that computability at base In De Morgan cubical type theory, coercion is limited to A (0) → A (1) ,a restriction counterbalanced by the additional (De Morgan) structure on I . coe ( λi.A, r, s, a ) in cubical type theory requires determiningthe head constructor of (i.e., evaluating) the type A in context i : I . Accordingly, the cubical canonicity proofs of Angiuliet al. [7, 8], Huber [34] define evaluation and computabilityfor terms in context ( i : I , . . . , i n : I ) . In both proofs, thedifficulty arises that typing and thus computability are closedunder substitutions of the form I n I m , but evaluation isnot; both resolve the issue by showing evaluation is closedunder computability up to judgmental equality. C. Semantic and proof-relevant computability
The past several years have witnessed an explosion in semantic computability techniques for establishing syntacticmetatheorems [4, 20, 22, 26, 38, 51, 55, 56, 61]. What makessemantic computability different from “free-hand” computabil-ity is that it is expressed as a gluing model , parameterized inthe generic model of the type theory; hence one is alwaysworking with typed terms up to judgmental equality.A new feature of semantic computability, forced in manycases by the absence of raw terms, is that a term maybe computable in more than one way. This proof-relevance plays an important role in the normalization arguments ofAltenkirch et al. [4], Coquand [20], Fiore [26] as well as thecanonicity arguments of Coquand [20], Sterling et al. [56].The proof-relevant approach is significantly simpler to set upthan the alternative and it provides a compositional accountof computability for universe hierarchies, which had been themain difficulty in conventional free-hand arguments.
Example 1.
A semantic canonicity argument for ordinarytype theory associates to each closed type a computabilitystructure which assigns to each equivalence class of closedterms of that type a set of “computability proofs.” We choosethe computability structure at base type to be a collection of“codes” for each constant; then, by exhibiting a choice ofcomputability proof for every well-typed term, we concludethat every equivalence class at base type is a constant.Crucially, the ability to store data within the computabilityproofs circumvents the need to define a subequational evalu-ation function, allowing us to carry out the entire argumentover equivalence classes of terms; rather than choosing arepresentative of each equivalence class, we encode canonicalforms as a structure indexed over equivalence classes of terms.
1) In what contexts do we compute?:
Semantic computabil-ity arguments have already been used to establish ordinarycanonicity, cubical canonicity, and ordinary normalization.The key difference between these arguments lies in what isconsidered an “element” of a type, or more precisely, whatare the contexts (and substitutions) of interest. In ordinarycanonicity proofs, the only context of interest is the closedcontext, in which each type has just a set of elements; thecomputability structures are thus families of sets. Following Huber and Angiuli, Favonia, and Harper [8, 34],cubical canonicity proofs must consider terms in all contexts I n , with all substitutions I n I m between them. These con-texts and substitutions induce a cubical set (i.e., a presheaf) ofelements of each type; the computability structures in questionare thus families of cubical sets indexed in the application of a“cubical nerve” applied to a syntactical object, an arrangementsuggested by Awodey in 2015. Notably, because proof-relevantcomputability arguments are not evaluation-based, cubicalcanonicity proofs in this style (e.g., that of Sterling, Angiuli,and Gratzer [56]) entirely sidestep the evaluation coherencedifficulties of prior work [8, 34].The passage to presheaves of elements is not a novel featureof cubical canonicity; it appears already in normalizationproofs for ordinary type theory, in the guise of Kripke logicalrelations of varying arities [37]. Because normalization isby definition a characterization of open terms, one mustnecessarily consider the presheaf of elements of a type relativeto all contexts; but in light of the fact that normal formsare not closed under substitutions of terms for variables,one considers only a restricted class of substitutions (e.g.,weakenings, injective renamings, or all variable renamings).Following Tait [59], the normal forms of type theory aredefined mutually as the neutral forms ne ( A ) (variables andeliminations thereof) and the normal forms nf ( A ) (constantsand constructors applied to normals) of each open type A .Proof-irrelevant normalization arguments then establish thatevery neutral term is computable (via reflection ↑ A ), and thatevery computable term has a normal form (via reification ↓ A ).Proof-relevant normalization arguments follow the same yogaof reflection and reification, except that we speak not of thesubset of neutral terms but rather the collection of neutrals andnormals encoding each equivalence class of terms [20].
2) Related work on gluing for type theory:
The past fortyyears have brought a steady stream of research developingthe gluing perspective on logical relations [4, 23, 26, 27, 58];however, only in the past several years has our understandingof the syntax and semantics of dependent types [3, 12, 28, 44,62] caught up with the mathematical tools required to advancea truly objective metatheory of dependent type theory.In particular, Coquand’s analysis [20] of proof-relevantcanonicity and normalization arguments for dependent typetheory in terms of categorical gluing was the catalyst for anumber of recent works that obtain non-trivial metatheoremsfor dependent type theory by semantic means, although someyears earlier Shulman [51] had already used gluing to provea homotopy canonicity result for a univalent type theory.Uemura [61] proved a general gluing theorem for certaindependent type theories in the language of Shulman’s typetheoretic fibration categories; Kaposi et al. [38] proved asimilar result in the language of categories with families.Coquand et al. [22] employed gluing to prove a homotopycanonicity result for a version of cubical type theory thatomits certain computation rules, and Kapulkin and Sattler[39] used gluing to prove homotopy canonicity for homotopytype theory (as famously conjectured by Voevodsky). Sterling2t al. [56] adapted Coquand’s gluing argument to prove thefirst non-operational strict canonicity result for a cubical typetheory. Gratzer et al. [29] used gluing to prove canonicityfor a general multi-modal dependent type theory. Sterling andHarper [55] employ a different gluing argument to establisha proof-relevant generalization of the Reynolds AbstractionTheorem for a calculus of ML modules. Gratzer and Sterling[28] used gluing to establish the conservativity of higher-orderjudgments for dependent type theories.
3) What are the neutrals of cubical type theory?:
Today’sobstacles to proving cubical normalization are entirely dif-ferent from the obstacles faced in the first proofs of cubicalcanonicity [8, 34]. As we have already discussed, coherenceof evaluation is a non-issue for semantic computability; more-over, as normalization already descends under binders, thisfeature of coercion poses no additional difficulty.However, cubical type theory includes a number of openjudgmental equalities that challenge the yoga of reflection andreification. Consider the rule that applying any element, evena variable, of type path ( A, a , a ) to I (resp., I ) equals a (resp., a ). Whereas application of neutrals (e.g., variables)to normal forms (e.g., constants) is typically irreducible, herepath application of a variable to a constant (but not to avariable) is a redex which may uncover further redexes: x : path ( λ . N → N , fib , fib ) ⊢ x (0)(7) = 13 : N One might imagine defining the normal form of path appli-cation by a case split on the elements of I (sending , I tothe normal form of fib (7) , and i : I to a neutral application),but such a case split requires us to model I as a coproduct,which will not be tiny, preventing us from obtaining a universeof Kan types following Licata et al. [43].Similar issues arise with a number of equations in bothCartesian and De Morgan cubical type theory; in fact, theCartesian variant is a priori more challenging in this regardbecause contraction of interval variables i, j : I may alsoinduce computation (e.g., in coe ( A, i, j, a ) ).In this paper, we index neutrals ne φ ( A ) by a proposi-tion φ representing their locus of instability , or where theycease to be neutral. For example, path application sends a φ -unstable neutral of type path ( A, a , a ) and an element r : I to a ( φ ∨ ( r = 0) ∨ ( r = 1)) -unstable neutral of type A ( r ) . Reflection ↑ φA operates on stabilized neutrals , pairs ofa neutral ne φ ( A ) with a proof that the term is computableunder φ . In the case of path application x ( r ) , one mustprovide computability proofs for a , a under the assumption r = 0 ∨ r = 1 .Terms in the ordinary fragment are never unstable (hence φ = ⊥ ), in which case a stabilized neutral is a neutral inthe ordinary sense; “neutrals” with cubical redexes (such as x (0) ) have φ = ⊤ , in which case their stabilized neutral isjust a computability proof (and ↑ ⊤ A is the identity). To ourknowledge, this is the first time that computability data appearsin the domain of the reflection operation. D. Contributions
We establish the normalization theorem (Theorem 42) forCartesian cubical type theory closed under Π , Σ , path, glue,and a higher inductive circle type, using a cubical extension ofsynthetic Tait computability [55]; the new idea on which ourargument hinges is the concept of stabilized neutrals describedabove. As corollaries to our main result, we obtain the admis-sible injectivity of type constructors (Theorem 43) as well asan algorithm to decide judgmental equality (Theorem 44).The present paper does not describe universes or the mod-ifications necessary to prove normalization for De Morgancubical type theory; but note that univalence can be statedwithout universes, as we have done here. The novel aspects ofcumulative, univalent universes are already supported becauseof the tininess of the interval and the account of glue types;the difference is that the operator projecting a normal typefrom a normalization structure of size α must be generalizedover β ≥ α . Our argument carries over mutatis mutandis to anormalization proof for De Morgan cubical type theory.In Section II we discuss the syntax of Cartesian cubical typetheory and its situation within a dependently sorted logicalframework. In Section III, we axiomatize a cubical version ofsynthetic Tait computability (STC) [55], a modal type theoryof synthetic logical relations suitable for proving syntacticmetatheorems; we construct in cubical STC a “normalizationmodel” of cubical type theory displayed over the genericmodel. In Section IV we construct a topos model of cubicalSTC, which takes us the remaining distance to the main resultsof this paper, which are described in Section V.II. C ARTESIAN CUBICAL TYPE THEORY
We define the subject of our normalization theorem, inten-sional Cartesian cubical type theory, as a locally Cartesianclosed category of judgments T generated by the signature inFigs. 1 and 2. Readers may consult [9] and [6, Appendix B]for further exposition, including rule-based presentations. A. LCCCs as a logical framework
The primary aspects of a type theory are its judgments A type and a : A and their derivations, many of whichrequire hypothetical judgments (e.g., λx.b : A → B when x : A ⊢ b : B ). One typically restricts which judgments maybe hypothesized, allowing ( x : A ) but not ( X type ) , judgmen-tal equalities ( a = b : A ) , or hypothetical judgments. Theserestrictions, realized by the notion of context , are crucial tothe syntactic metatheorems on which implementations rely; forexample, decidability of equality requires that intensional typetheory lacks a context former (isomorphic to) h Γ , a = b : A i .Both the rule-based presentations and the common cate-gorical semantics of type theory—including categories withfamilies [25], natural models [12], and Uemura’s recent gener-alization thereof known as representable map categories [62]—include a notion of context as part of the definition of a typetheory, and require these contexts to be preserved by modelsand their homomorphisms.3 , F , tp : jdg [ − ] : F → jdg tm : tp → jdg , I (=) : ( I × I ) → F ( ∧ F ) , ( ∨ F ) : ( F × F ) → F ( ∀ I ) : ( I → F ) → F : { φ } Q p,q :[ φ ] p = [ φ ] q : { φ, ψ } ([ φ ] ∼ = [ ψ ]) ∼ = ( φ = F ψ ): { φ } (cid:0)Q i : I [ φ ( i )] (cid:1) ∼ = [ ∀ I φ ]: { r, s } ( r = I s ) ∼ = [ r = s ]: { φ, ψ } ([ φ ] × [ ψ ]) ∼ = [ φ ∧ F ψ ]: { φ , φ } [ φ i ] → [ φ ∨ F φ ] For each judgment J ∈ { I , F , tp , [ φ ] , tm ( A ) } : abort J : [0 = 1] → ∼ = J split J : { φ, ψ } Q x φ :[ φ ] → J Q x ψ :[ ψ ] →{ J | φ֒ → x φ } [ φ ∨ F ψ ] → J : { φ, ψ } Q :[ φ ] split J ( x φ , x ψ ) = J x φ : { φ, ψ } Q :[ ψ ] split J ( x φ , x ψ ) = J x ψ : { φ, ψ, x } x = J split J ( x, x ) { J | φ ֒ → x φ } := P x : J Q p :[ φ ] x = J x φ ( p ) ⊥ F := (0 = 1) ∂i := ( i = 0) ∨ F ( i = 1)[] J := abort J [ φ ֒ → x φ , ψ ֒ → x ψ ] J := split J ( x φ , x ψ ) Fig. 1. Basic judgmental structure of Cartesian cubical type theory. path : (cid:0)P A : I → tp tm ( A (0)) × tm ( A (1)) (cid:1) → tp Π , Σ : (cid:0)P A : tp ( tm ( A ) → tp ) (cid:1) → tpglue : Q φ : F (cid:8)(cid:0)P B : tp P A :[ φ ] → tp Q :[ φ ] tm ( Equiv ( A, B )) (cid:1) → tp (cid:12)(cid:12) φ ֒ → λ ( B, A, f ) .A (cid:9) S1 : tppath / tm : { A, a , a } (cid:0)Q i : I { tm ( A ( i )) | ∂i ֒ → [ i = ǫ ֒ → a ǫ ] tm ( A ( i )) } (cid:1) ∼ = tm ( path ( A, a , a ))Π / tm : { A, B } (cid:0)Q x : tm ( A ) tm ( B ( x )) (cid:1) ∼ = tm (Π( A, B ))Σ / tm : { A, B } (cid:0)P x : tm ( A ) tm ( B ( x )) (cid:1) ∼ = tm (Σ( A, B )) glue / tm : { φ, B, A, f } (cid:8)(cid:0)P a : Q :[ φ ] tm ( A ) { tm ( B ) | φ ֒ → f ( a ) } (cid:1) ∼ = tm ( glue ( φ, B, A, f )) (cid:12)(cid:12) φ ֒ → λ ( a, b ) .a (cid:9) base : tm ( S1 ) loop : Q i : I { tm ( S1 ) | ∂i ֒ → base } ind S1 : Q C : tm ( S1 ) → tp Q b : tm ( C ( base )) Q l : Q i : I { tm ( C ( loop ( i ))) | ∂i֒ → b } Q x : tm ( S1 ) tm ( C ( x )): { C, b, l } ind S1 ( C, b, l, base ) = tm ( C ( base )) b : { C, b, l, i } ind S1 ( C, b, l, loop ( i )) = tm ( C ( loop ( i ))) l ( i ) hcom : Q A : tp Q r,s : I Q φ : F Q a : Q i : I Q :[ i = r ∨ F φ ] tm ( A ) { tm ( A ) | r = s ∨ F φ ֒ → a ( s ) } coe : Q A : I → tp Q r,s : I Q a : tm ( A ( r )) { tm ( A ( s )) | r = s ֒ → a } isContr : tp → tpisContr := λA. Σ( A, λx. Π( A, λy. path ( λ .A, x, y ))) Equiv : tp → tp → tpEquiv := λA.λB. Σ(Π(
A, λ .B ) , λf. Π( B, λb. isContr (Σ(
A, λa. path ( λ .B, f ( a ) , b ))))) unglue : { φ, B, A, f } tm ( glue ( φ, B, A, f )) → tm ( B ) unglue := λg.π ( glue / tm − ( g )) Fig. 2. Generating clauses in the signature for Cartesian cubical type theory pertaining to connectives. For space reasons, we omit the computation rules ofthe Kan operations for each connective, which can be found in [9].
4n contrast, higher-order logical frameworks for definingtype theories, such as Martin-L¨of’s logical framework [45] andthe Edinburgh Logical Framework [31], elevate the judgmental structure of a type theory; then, as explicated by Harperet al. [31], one may impose after the fact a collection ofLF contexts (or worlds ) relative to which adequacy and othermetatheorems hold [30]. These worlds, which can be seen tocorrespond roughly to the arities of Jung and Tiuryn [37], weresubsequently implemented in the Twelf proof assistant [47] as“ %worlds declarations.”In light of that perspective, we regard a notion of contextas a structure placed on a locally Cartesian closed category ofjudgments T of a type theory, whose objects and morphismsare (equivalence classes of) judgments and deductions. Thedependent products of T encode hypothetical judgments, andthe finite limits both encode substitution and judgmentalequality; a notion of context is often a full subcategory C ⊆ T spanned by objects distinguished as contexts. Example 2.
The category of judgments T of Martin-L¨of typetheory without any types is the free LCCC generated by asingle map tm tp . The category of contexts C ⊆ T isinductively defined as the full subcategory spanned by theterminal object and any fiber of tm tp over a context.Equality is undecidable in T (as it has all finite limits),but is decidable for terms and types in context , objectifiedby the restricted Yoneda embedding T Pr ( C ) taking thejudgment tp : T to its “functor of context-valued points”Hom ( C , tp ) : C op Set . Proofs of decidability proceed byfurther restricting to a category of (contexts and) renamings R along the forgetful map R C [4, 20, 26].A second distinction between LCCCs and (for instance)Uemura’s framework is that the latter is stratified to ensurethat the use of hypothetical judgment in a theory is strictlypositive, whereas both LCCCs and syntactic logical frame-works place no restriction on hypothetical judgments and evenallow binders of higher-level (e.g., in Martin-L¨of’s funsplit operator [45]). However, using an Artin gluing argument dueto Paul Taylor [60], Gratzer and Sterling [28] have observedthat the extension of a representable map category `a la Uemurato a LCCC is conservative (in fact, fully faithful), ensuring theadequacy of LCCC encodings of type theories.We therefore define the category of judgments of Cartesiancubical type theory as the LCCC T generated by the signaturein Figs. 1 and 2; then, locally Cartesian closed functors M : T E determine algebras for that signature valuedin E . Unlike homomorphisms of models of type theory, suchfunctors preserve higher-order judgments; note however thatwe are proving a single theorem about the syntactic category T , not studying the model theory of cubical type theory. B. The signature of Cartesian cubical type theory
In Fig. 1 we present the judgmental structure of cubicaltype theory; we inherit from Martin-L¨of type theory the basicforms of judgment tp : T and tm : ( T ) / tp classifyingtypes and terms respectively, and add three additional forms of judgment for cubical phenomena: I : T for elements of theinterval, F : T for cofibrations (or cofibrant propositions ), and [ − ] : ( T ) / F for proofs of cofibrations. The standard notion ofcontext is generated by and context extension by ( x : A ) , ( i : I ) , and ( : [ φ ]) . In this paper, we will only consider amore restricted notion of atomic context (Section IV-C) thatplays a role analogous to the renamings of Example 2.Cofibrations are strict propositions; the cofibration classifier F is strictly univalent and closed under ∧ F , ∨ F , ∀ I , and = I .We define ∧ F , ∀ I , and = I in terms of the same notions in T ,but T has no disjunction or empty type by which to define ∨ F or stipulate (0 = 1) → ⊥ . Instead, we axiomatize these byeliminators abort J , split J for each generating judgment J .The following notations in Fig. 1 are used pervasivelythroughout this paper. (At present, “propositions” are elementsof F ; later they will be elements of a subobject classifier Ω .) Notation 3 (Extent types [49]) . Given a proposition φ and a partial element a φ : [ φ ] → A , we write { A | φ ֒ → a φ } forthe collection of elements a : A that restrict to a φ under theassumption of z : [ φ ] . In other words: { A | φ ֒ → a φ } := { a : A | ∀ z : [ φ ] .a = a φ ( z ) } We will implicitly coerce elements of { A | φ ֒ → a φ } to A . Notation 4 (Systems [19]) . Let φ, ψ be propositions. Under : [ φ ∨ ψ ] , given a pair of partial elements a φ : [ φ ] → A and a ψ : [ ψ ] → A that agree when : [ φ ∧ ψ ] , we write [ φ ֒ → a φ , ψ ֒ → a ψ ] : A for the “case split” that extends a φ , a ψ . Likewise, under theassumption : [ ⊥ ] , we write [] : A for the unique elementof A . We will leave abstraction and application over z : φ implicit; where it improves clarity, we may write the unarysystem [ φ ֒ → a ] for λz : φ.a .In Fig. 2 we define the connectives of cubical type theory.We specify the elements of Π , Σ , path , and glue by isomor-phisms whose underlying functions encode introduction andelimination rules, and whose equations encode β and η rules;we will leave the first three of these isomorphisms (and theprojection from equivalences to functions) implicit. The higherinductive circle S1 has constructors base and loop and aneliminator ind S1 with computation rules. Finally, we specifythe Kan operations hcom and coe ; for space reasons we donot reproduce the computation rules for hcom and coe in eachtype, which can be found in Angiuli et al. [9].The signature for De Morgan cubical type theory [19, 21]differs only in the structure imposed on I and the types andcomputation rules of hcom and coe .III. S YNTHETIC T AIT COMPUTABILITY
In this section, we axiomatize a category E whose in-ternal language provides a “type theory of proof-relevantlogical relations” `a la Sterling and Harper’s synthetic Taitcomputability [55]. Inside that type theory, we then define Syntactic presentations typically write h Γ , φ i for h Γ , : [ φ ] i . xiom Substantiation Axiom STC-1 Lemma 26Axiom STC-2 Construction 30 and Corollary 32Axiom STC-3 Computation 27Axiom STC-4 Remark 28 and Construction 30Axiom STC-5 Lemmas 33, 54 and 55Axiom STC-6 Construction 24 and Remark 29
Fig. 3. A dictionary between the axioms of Section III and their substantia-tions in the category of computability structures. a reflection–reification computability model of cubical typetheory from which we will derive normalization. We deferto Section IV an explicit construction of E as a category ofcomputability structures; Fig. 3 provides forward references toour justifications of the axioms.We begin by assuming that E satisfies Giraud’s axioms[10]; all such categories interpret extensional Martin-L¨of typetheory extended by a strictly univalent universe Ω of all proof-irrelevant propositions. Next, we assume that E contains acumulative hierarchy of universes whose elements satisfy astrictification axiom introduced by Orton and Pitts [46]. Definition 5. An Orton–Pitts universe is a type theoretic uni-verse U strictly closed under dependent products, dependentsums, inductive types, quotients, and the subobject classifier,such that the following additional strictification axiom holds:Given A : U , write Iso ( A ) := P B : U ( A ∼ = B ) forthe type of U -isomorphs of A . For any proposition φ : Ω , there is a section to the weakening map Iso ( A ) ( φ → Iso ( A )) . Axiom STC-1.
There exists a cumulative hierarchy of Orton–Pitts universes U ⊆ U . . . in E such that every map in E isclassified by some U i . We schematically write U , V for arbitrary universes in thehierarchy specified by Axiom STC-1. Axiom STC-2.
There exists a tiny [42, 66] interval object I : U with two endpoints , I . What it means for the interval to be tiny is that theexponential functor ( I → − ) : E E has a right adjoint ( − ) I .Equivalently, the exponential functor preserves colimits. A. Modalities for syntax and semantics
The central assumption of synthetic Tait computability isthe existence of an uninterpreted proposition syn from whichwe will generate the modal syntax–semantics duality.
Axiom STC-3.
There exists a proposition syn : Ω . The proposition syn generates complementary open and closed lex idempotent modalities , that we interpret asrespectively projecting the syntactic and semantic aspects of agiven computability structure. Because lex modalities descendto the slices in a fibered way, we can use , na¨ıvely in the internal language of E [14, 50]; however, we find it mostconvenient to begin by considering the universes U , U of“syntactic” and “semantic” types.
1) Universe of syntactic types:
Given a universe U : V , wedefine the universe U : V of syntactic types together with its(dependent) modality; the following definitions are justified byOrton–Pitts strictification (Axiom STC-1), setting φ := syn . U : { V | syn ֒ → U } U ∼ = syn → U : { U → U | syn ֒ → λA.A } ∼ = λA.λ : syn .A el : { U → U | syn ֒ → λA.A } el ∼ = λA. Q z : syn A ( z ) To see how strictification applies, observe that syn → U isan isomorph of U under the assumption : syn ; we may there-fore choose U to be (totally) isomorphic to ( syn → U ) andunder : syn strictly equal to U . The remaining definitionsgo through directly given that U .Because it causes no ambiguity, we will leave the decoding el implicit in our notations; furthermore, we will leave bothabstraction and application over syn implicit.Our use of Orton–Pitts strictification above can be summedup in the following syntactic realignment lemma, theworkhorse of synthetic Tait computability. Corollary 6 (Syntactic realignment [54, 55, 57]) . Given A : U , A ◦ : U , and an isomorphism f : ( A ◦ ∼ = A ) , we maydefine a strictly aligned type f ∗ A : { U | syn ֒ → A ◦ } and astrictly aligned isomorphism f † : { f ∗ A ∼ = A | syn ֒ → f } . Remark 7.
The syntactic modality commutes with dependentproducts, dependent sums, equality, etc.Then we axiomatize the existence of an algebra for thesignature of Cartesian cubical type theory in E . One can inter-nalize as a dependent record the collection T -Mod ( V ) of T -algebras/models valued in types classified by any universe V ,writing M . tp , M . tm , etc. for each component. In Axiom STC-4below, we require a T -model M valued in U , such that M . I is the syntactic part of the interval of Axiom STC-2. Axiom STC-4.
There exists a T -model M : T -Mod ( U ) such that ( M . I = I ) .2) Universe of semantic types: A type A : U is called se-mantic (or -connected ) when it has no syntactic component,i.e. we have an isomorphism ∼ = A . Using this idea as aprototype, we define a dual universe of semantic types: U : { V | syn ֒ → } U ∼ = { U | syn ֒ → } : U → U ∼ = λA.A ⊔ A × syn syn el : U → U el ∼ = λA.A Above we are writing A ⊔ A × syn syn for the pushout of thetwo product projections from A × syn .The definitions of U , , el are likewise justified bysyntactic realignment (Corollary 6): fixing : syn we notethat each of the types above becomes a singleton, so it can bealigned to restrict to strictly. As with the syntactic modality,we leave the decoding el implicit.6 arning 8. The semantic modality commutes with dependentsums and equality, but not much else.
B. Cofibrations and locality
We construct the universe of cofibrations in two steps: firstwe define a universe of propositions E : { U | syn ֒ → M . F } ,and then we constrain it to a subclass F ⊆ E generated byequality of dimensions, disjunction, conjunction, and universalquantification over the interval. The purpose of this constraintis to support an external algorithm that decides equalityunderneath a cofibration (Theorem 44). E : { U | syn ֒ → M . F } E ∼ = P φ : M . F { Ω | syn ֒ → M . [ φ ] } It is trivial to close E under conjunction, equality of theinterval, and universal quantification over the interval. Notation 9.
The canonical map ( − = ⊤ E ) : E → Ω is asuitable decoding function; we treat it as an implicit coercion.As in Fig. 1, the difficult part is to close E under disjunctionand to enforce = 1 ; because M . split J only eliminates intocomponents of M , the “disjunction” M . ( ∨ E ) is not even adisjunction relative to types in U , much less in all of U (and similarly for M . abort J and M . ⊥ F ). Construction 10 (Disjunction) . We explicitly glue togetherthe syntactic disjunction with the semantic disjunction; to en-sure that the resulting proposition is aligned over the (weaker)syntactic disjunction, we place the semantic disjunction un-derneath the modality to force it to become -connected. ( ∨ E ) : { E × E → E | syn ֒ → M . ( ∨ F ) } φ ∨ E ψ = ( φ M . ∨ F ψ, M . [ φ M . ∨ F ψ ] ∧ ([ φ ] ∨ [ ψ ])) No realignment is required, because Ω is strictly univalent.We may then define the universe of cofibrations F ⊆ E to bethe smallest subobject of E closed under the following rules: z : syn φ : E φ ∈ F φ ∈ F ψ ∈ F φ ∧ E ψ ∈ F φ ∨ E ψ ∈ F ∀ i : I . ( φ ( i ) ∈ F )( ∀ i.φ ( i )) ∈ F r, s : I ( r = s ) ∈ F To avoid confusion, we will write ∧ F , ∨ F : F × F → F forthe maps induced by the closure of F under ∨ E . Likewise wedefine ⊤ F = (1 = 1) and ⊥ F = (0 = 1) in F . We observe thatthe universe of cofibrations can be aligned over M . F , i.e. wehave F : { U | syn ֒ → M . F } ; this follows from the fact that ( φ ∈ F ) = Ω ⊤ for any φ : E assuming z : syn .We must define semantic conditions for types that are local with respect to ∨ F and ⊥ F , in the sense that they behave asthough the positive cofibrations satisfy universal properties. Definition 11.
A type A : U is called ⊥ F -connected when itbehaves as if = 1 , i.e. we have ([ ⊥ F ] → A ) ∼ = . Definition 12.
A type A : U is called F -local when it is ⊥ F -connected and, for any two cofibrations φ, ψ : F , the type A is right-orthogonal to the canonical map [ φ ] ∨ [ ψ ] [ φ ∨ F ψ ] in the sense that the dotted map below always exists uniquely: [ φ ] ∨ [ ψ ][ φ ∨ F ψ ] A [ φ ֒ → a φ , ψ ֒ → a ψ ] [ φ ֒ → a φ , ψ ֒ → a ψ ] A A necessary condition for a type A : U being F -local isthat its syntactic part A is F -local. In Axiom STC-5 below,we assert that this condition is sufficient. Axiom STC-5.
A type A : U is F -local if and only if A is F -local. The interpretation of every syntactic sort of Cartesian cu-bical type theory in M can be seen to be F -local. Therefore,by Axiom STC-5, any type A whose syntactic part A isisomorphic to one of those sorts is automatically F -local. C. Kan computability structures
Definition 13. A computability structure A : U tp is a pair ofa syntactic type A ◦ : M . tp and a total type aligned over theelements of A ◦ : U tp : { V | syn ֒ → M . tp } U tp ∼ = P A ◦ : M . tp { U | syn ֒ → M . tm ( A ◦ ) } We leave the projection π : U tp U implicit in our notation. Definition 14. A homogeneous composition structure on A : U tp is an element of the type HCom ( A ) defined inFig. 4; such a structure asserts the existence of an operation hcom A that is aligned over the existing syntactic homogeneouscomposition operation. We define by realignment a weakclassifying object U hcomtp for computability structures equippedwith a homogeneous composition structure: U hcomtp : { V | syn ֒ → M . tp } U hcomtp ∼ = P A : U tp HCom ( A ) We leave the projection U hcomtp U tp implicit.Likewise, a coercion structure on a line of computabilitystructures A : I → U tp is an element of the type Coe ( A ) alsodefined in Fig. 4; such a structure provides a coe A operationaligned over the existing syntactic coercion operation.Constructing a weak classifying object for coercion struc-tures is more challenging; we use the method of Licata et al.[43], which relies crucially on the tininess of the interval. Construction 15.
Using the right adjoint ( − ) I to ( I → − ) given by Axiom STC-2, we transpose the map Coe :( I → U hcomtp ) U to obtain Coe ♯ : U hcomtp ( U ) I .Pulling back the “root” of the generic family ˙ U U Com : U tp U Coe : ( I → U tp ) U HCom ( A ) ∼ = (cid:8)Q r,s : I Q φ : F Q a : Q i : I Q :[ i = r ∨ F φ ] A { A | r = s ∨ F φ ֒ → a ( s ) } (cid:12)(cid:12) syn ֒ → M . hcom A (cid:9) Coe ( A ) ∼ = (cid:8)Q r,s : I Q a : A ( r ) { A ( s ) | r = s ֒ → a } (cid:12)(cid:12) syn ֒ → M . coe A (cid:9) Fig. 4. Definitions of homogeneous composition structures for a computability structure and coercion structures for a line of computability structures; theuse of U indicates that these structures are -connected , i.e. equivalently classified by the subuniverse { U | syn ֒ → } . nftp : { U | syn ֒ → M . tp } ne ( − ) : Q φ : F Q A : M . tp { U | φ ∨ syn ֒ → M . tm ( A ) } nf : Q A : M . tp { U | syn ֒ → M . tm ( A ) } var : { A } { var ( A ) → ne ⊥ F ( A ) | syn ֒ → λx.x } Fig. 5. Axiomatization of the structure of normal and neutral forms. Theremainder of the generators are distributed across Figs. 6 to 10. along this map, we obtain a weak classifying object U kantp forcomputability structures with both homogeneous compositionand coercion, which we call Kan . U kantp U hcomtp ( ˙ U ) I ( U ) I Coe ♯ Because all the structures we are adding to U tp remain -connected, we may align this pullback as a large type U kantp : { V | syn ֒ → M . tp } . The left map U kantp U hcomtp projects a homogeneous composition operation hcom A forevery Kan computability structure A : U kantp ; transposing theupstairs map, we see that each line of Kan computabilitystructures A : I → U kantp also carries a coercion structure coe A .We leave the composite projection U kantp U tp implicit. D. Neutral and normal forms
In order to axiomatize the neutral and normal forms, wewill need a computability structure of term variables . Axiom STC-6.
We assume a family of types var : Q A : M . tp { U | syn ֒ → M . tm ( A ) } . In Fig. 5, we axiomatize the judgmental structure of thenormal and neutral forms of cubical type theory in the lan-guage of synthetic Tait computability; Figs. 6 to 8 containthe normal and neutral forms of path, Π , and glue types(within dashed boxes); Σ -types and the circle are located in theappendix (Figs. 9 and 10). The main part of the normalizationargument only needs constants of the kind listed to exist, butwe will substantiate these constants with an external inductivedefinition in Appendix C. As discussed in Section I-C3, the main difficulty in adaptingCoquand’s semantic normalization argument [20] to cubicaltype theory is that neutral terms do not evince a cubically-stable aspect of the syntax of cubical type theory. The simplestexample of this behavior is the neutral form of a path appli-cation papp ( p, i ) , which is “neutral” in the traditional senseonly so long as i is neither nor . Warning 16.
It is reasonable but ultimately futile to try andrestrict the second argument of papp to be a “variable” ofsome kind—in doing so, one refutes either the tininess of theinterval or the existence of a Tait reflection operation for paths.The failure of all previous attempts to isolate the neutralforms of cubical type theory stems ultimately from an insis-tence on characterizing positively the conditions under whicha term is neutral. We have taken the opposite perspective, byindexing the neutrals in a “locus of instability” φ : F underwhich they cease to be neutral; as soon as φ becomes true,the semantic information carried by a : ne φ ( A ) collapses to apoint. Our negative perspective suggests a way to “stabilize”a neutral form by gluing computability data onto it along itslocus of instability. Definition 17 (Stabilized neutrals) . Let A : U tp be acomputability structure; a stabilized neutral is a pair of aneutral a : ne φ ( A ) together with a computability datum a : Q :[ φ ] { A | syn ֒ → a } defined on its locus of instability.We will write [ a | φ ֒ → a ] for such pairs, and obtain byrealignment a type family of stabilized neutrals: sne φ : { U tp → U | syn ∨ φ ֒ → [ syn ֒ → M . tm , φ ֒ → λA.A ] } sne φ ( A ) ∼ = P a : ne φ ( A ) Q :[ φ ] { A | syn ֒ → a } E. Cubical normalization structures
We now reach the central definition of this paper, that of a cubical normalization structure , a notion inspired by the Taitclosure condition [59] under which neutrals can be reflected tocomputable elements and computable elements can be reifiedto normals, as presented for instance by Coquand [20]. Ourversion of the Tait reflection operation takes stabilized neutralsto computable elements.
Definition 18. A cubical normalization structure A : tp ath : (cid:8)(cid:0)P A : I → nftp nf ( A (0)) × nf ( A (1)) (cid:1) → nftp (cid:12)(cid:12) syn ֒ → M . path (cid:9) plam : { A } (cid:8)Q p : Q i : I nf ( A ( i )) nf ( M . path ( A, p (0) , p (1))) (cid:12)(cid:12) syn ֒ → λp.λi.p ( i ) (cid:9) papp : { φ, A, a , a } (cid:8) ne φ ( M . path ( A, a , a )) → Q i : I ne φ ∨ F ∂i ( A ( i )) (cid:12)(cid:12) syn ֒ → λp.λi.p ( i ) (cid:9) path : (cid:8)(cid:0)P A : I → tp A (0) × A (1) (cid:1) → tp (cid:12)(cid:12) syn ֒ → M . path (cid:9) [ path ( A, a , a )] ∼ = Q i : I { A ( i ) | ∂i ֒ → [ i = ǫ ֒ → a ǫ ] M . tm ( A ( i )) } hcom r → s ; φ path ( A,a ,a ) p = λi. hcom r → s ; φ ∨ F ∂iA ( i ) λk. [ k = r ∨ F φ ֒ → p ( k ) , i = ǫ ֒ → a ǫ ] M . tm ( A ( i )) coe r → sλj. path ( A ( i,j ) ,a ( j ) ,a ( j )) p = λi. com r → s ; ∂iλj.A ( i,j ) λj. [ j = r → p ( i ) , i = ǫ ֒ → a ǫ ( j )] M . tm ( A ( i,j )) ⇓ path ( A, a , a ) = path (cid:0) λi. ⇓ A ( i ) , ↓ A (0) a , ↓ A (1) a (cid:1) ↑ φ path ( A,a ,a ) [ p | φ ֒ → p ] = λi. ↑ φ ∨ F ∂iA ( i ) [ papp ( p , i ) | φ ∨ F ∂i ֒ → [ φ ֒ → p ( i ) , i = ǫ ֒ → a ǫ ] M . tm ( A ( i )) ] ↓ path ( A,a ,a ) p = plam (cid:0) λi. ↓ A ( i ) p ( i ) (cid:1) Fig. 6. The cubical normalization structure for dependent path types. pi : (cid:8)(cid:0)P A : nftp Q x : var ( A ) nftp (cid:1) → nftp (cid:12)(cid:12) syn ֒ → M . Π (cid:9) lam : { A, B } (cid:8)(cid:0)Q x : var ( A ) nf ( B ( x )) (cid:1) → nf ( M . Π( A, B )) (cid:12)(cid:12) syn ֒ → λf.λx.f ( x ) (cid:9) app : { φ, A, B } (cid:8) ne φ ( M . Π( A, B )) → Q x : nf ( A ) ne φ ( B ( x )) (cid:12)(cid:12) syn ֒ → λf.λx.f ( x ) (cid:9) Π : (cid:8)(cid:0)P A : tp ( A → tp ) (cid:1) → tp (cid:12)(cid:12) syn ֒ → M . Π (cid:9) [Π( A, B )] ∼ = Q x : A B ( x ) hcom r → s ; φ Π( A,B ) f = λx. hcom r → s ; φB λi. [ i = r ∨ F φ ֒ → f ( x, i )] coe r → sλi. Π( A ( i ) ,B ( i )) f = λx. coe r → sλi.B ( i, coe s → iA x ) f (cid:0) coe s → rA x (cid:1) ⇓ Π( A, B ) = pi (cid:0) ⇓ A, λx. ⇓ B (cid:0) ↑ ⊥ F A [ var ( x ) | ⊥ F ֒ → [] M . tm ( A ) ] (cid:1)(cid:1) ↑ φ Π( A,B ) [ f | φ ֒ → f ] = λx. ↑ φB ( x ) (cid:2) app (cid:0) f , ↓ A x (cid:1) (cid:12)(cid:12) φ ֒ → f ( x ) (cid:3) ↓ Π( A,B ) f = lam (cid:0) λx. let ˜ x = ↑ ⊥ F A [ var ( x ) | ⊥ F ֒ → [] M . tm ( A ) ] in ↓ B (˜ x ) f (˜ x ) (cid:1) Fig. 7. The cubical normalization structure for dependent product types. glue : { φ } (cid:8)(cid:0)P B : nftp P A :[ φ ] → nftp Q :[ φ ] nf ( Equiv ( A, B )) (cid:1) → nftp (cid:12)(cid:12) syn ∨ φ ֒ → [ syn ֒ → M . glue ( φ, − ) , φ ֒ → λ ( B, A, f ) .A ] (cid:9) englue : { φ, B, A, f } (cid:8)(cid:0)P a : Q :[ φ ] nf ( A ) { nf ( B ) | syn ∧ φ ֒ → f ( a ) } (cid:1) → nf ( M . glue ( φ, B, A, f )) (cid:12)(cid:12) syn ∨ φ ֒ → λ ( a, b ) . [ syn ֒ → M . glue / tm ( a, b ) , φ ֒ → a ] (cid:9) unglue : { φ, B, A, f, ψ } { ne ψ ( M . glue ( φ, B, A, f )) → ne ψ ∨ F φ ( B ) | syn ֒ → M . unglue ( φ, − ) } glue : (cid:8)Q φ : F (cid:8)(cid:0)P B : tp P A :[ φ ] → tp Q :[ φ ] Equiv ( A, B ) (cid:1) → tp (cid:12)(cid:12) φ ֒ → λ ( B, A, f ) .A (cid:9) (cid:12)(cid:12) syn ֒ → M . glue (cid:9) [ glue ( φ, B, A, f )] ∼ = P a : Q :[ φ ] A { B | φ ֒ → f ( a ) } hcom r → s ; ψ glue ( φ,B,A,f ) p = h omitted for brevity, see [9] i coe r → sλi. glue ( φ ( i ) ,B ( i ) ,A ( i ) ,f ( i )) f = h omitted for brevity, see [9] i⇓ glue ( φ, B, A, f ) = glue (cid:0) φ, ⇓ B, ⇓ A, ↓ Equiv ( A,B ) f (cid:1) ↑ ψ glue ( φ,B,A,f ) [ g | ψ ֒ → g ] = (cid:0)(cid:2) φ ֒ → ↑ ψA [ g | ψ ֒ → g ] (cid:3) , ↑ ψB (cid:2) unglue ( g ) (cid:12)(cid:12) ψ ∨ F φ ֒ → (cid:2) ψ ֒ → π ( g ) , φ ֒ → f (cid:0) ↑ ψA [ g | ψ ֒ → g ] (cid:1)(cid:3) B (cid:3)(cid:1) ↓ glue ( φ,B,A,f ) ( a, b ) = englue (cid:0)(cid:2) φ ֒ → ↓ A a (cid:3) , ↓ B b (cid:1) Fig. 8. The cubical normalization structure for glue types. [ A ] : U kantp ⇓ A : { nftp | syn ֒ → [ A ] } (normal form) ↑ ( − ) A : Q φ : F { sne φ ([ A ]) → [ A ] | syn ֒ → λa.a } (reflect) ↓ A : { [ A ] → nf ([ A ]) | syn ֒ → λa.a } (reify)We define by realignment the large type tp of cubical nor-malization structures, noting that the latter three componentsof a cubical normalization structure are -connected: tp : { V | syn ֒ → M . tp } Remark 19 (Vertical maps) . We refer to the reflection andreification maps as vertical , in the sense that they are con-strained to lie over the syntactic identity function.The role of verticality is to ensure that reification takescomputability data for a given term to a normal form of thesame term , etc. Likewise, our presentation of the neutral andnormal forms use extent types to express their relationship tothe syntactic T -model without escaping the internal languageof E . In this way, extent types and vertical maps play a veryimportant role in synthetic Tait computability.The main result of this section is the construction of acomputability algebra for Cartesian cubical type theory; thisequips each syntactic type with a Kan computability structure,normal form, and reflection and reification maps. Theorem 20.
We have a computability T -model M ′ : { T -Mod ( U ) | syn ֒ → M } aligned over the syntactic algebra.Proof. We define M ′ . tp = tp , M ′ . tm ( A ) = [ A ] , M ′ . I = I , and M ′ . F = F . In Figs. 6 to 11, we show how to close the universeof cubical normalization structures tp under the connectives path , Π , Σ , glue , and S1 . The fact that the resulting model isaligned over M follows from each of these components beingaligned over their syntactic counterparts; in particular, eachconnective is aligned over the syntactic connective in M .IV. T HE COMPUTABILITY TOPOS
We now define the category E in which Section III takesplace, as a category of sheaves on a generalized space G which combines syntax and semantics. Mirroring the modalsyntax–semantics duality introduced in Section III-A, sheaveson G function as computability structures because they havesyntactic and semantic aspects obtained by restriction to thecorresponding regions of the space.We construct G in turn by starting with a syntactic topos T that contains the generic model of Cartesian cubical typetheory, and gluing it onto a semantic topos A over which thenotions of variable, neutral, and normal form are definable. A. The language of topoi
Topoi are sometimes thought of as generalized topolog-ical spaces, and sometimes as special kinds of categories.These perspectives are complementary, but one avoids manynotational and conceptual quagmires by distinguishing them formally [5, 16, 65]: in the tradition of Grothendieck, the 2-category of topoi is opposite to the 2-category of cocompleteand finitely complete categories satisfying Giraud’s exactnessaxioms [10]. This explains why the product of two topoiis given by a tensor product of categories; the situation isanalogous to the other dualities between geometry and algebrain mathematics, such as locales/frames, affine schemes/com-mutative rings, Stone spaces/Boolean algebras, etc.
Notation 21.
Given a topos X , we will write Sh ( X ) forits category of sheaves , which is the formal avatar of X inthe opposite category. In traditional parlance, morphisms oftopoi go in the “direct image” direction, and morphisms ofcategories of sheaves go in the “inverse image” direction. Example 22 (Presheaves) . Given a small category C , thecategory of presheaves Pr ( C ) is the category of functors C op Set . Because Pr ( C ) satisfies Giraud’s axioms, thereis a topos b C satisfying Sh (cid:0) b C (cid:1) = Pr ( C ) .If C has all finite limits, then b C has a universal propertyby Diaconescu’s theorem [24]: morphisms of topoi X b C are the same as left exact functors C Sh ( X ) , i.e. functorsthat preserve finite limits. Viewing C as a finite limit theory,this universal property is summed up by referring to b C as theclassifying topos of C -models. B. The syntactic topos
Recall from Section II that a model of T in Sh ( X ) isa locally Cartesian closed functor T Sh ( X ) ; when thisfunctor only preserves finite limits but not dependent products,we refer to it as a pre-model . Pre-models play an importantrole in the metatheory of higher-order logic (as in the “generalmodels” of Henkin [32], later studied in the language of topoiby Awodey and Butz [11]), as well as the metatheory of depen-dent type theory (as in pseudo-morphisms of cwfs [38, 44]).We define the syntactic topos T as the presheaf topos b T .In light of Example 22, T is the classifying topos of pre-models of T , in the sense that morphisms of topoi X b T correspond to pre-models of T in Sh ( X ) . C. The topos of cubical atomic terms
Next, we define the semantic topos A and an essentialmorphism of topoi α : A T along which we will glue inSection IV-D; that α is essential means there is an additionalleft adjoint α ! ⊣ α ∗ ⊣ α ∗ , a technical condition that will playan important role in Section IV-E. Intuitively, A is the toposof cubically atomic terms , i.e., term variables and elementsof the interval; concretely, we equip A with a tiny intervalobject I ∼ = α ∗ I : Sh ( A ) and a fiberwise-tiny family of termvariables var : Sh ( A ) / α ∗ tm indexed in syntactic types. The 1-cells are reversed, but the 2-cells remain the same.
10e define A := b A , where A is a category of cubicalatomic contexts and substitutions whose objects Γ : A wedefine simultaneously with their decodings α (Γ) : T : · : A α ( · ) = T Γ : A A : α (Γ) tp Γ .A : A α (Γ .A ) = α (Γ) .A Γ : A Γ . I : A α (Γ . I ) = α (Γ) × I Before defining the morphisms of A , we first characterizethe term variables: TOP VARIABLE A : α (Γ) tp Γ .A (cid:13) z A : A α ( z A ) = q A POP VARIABLE Γ (cid:13) α : A Q ∈ { I } ∪ (cid:8) B : α (Γ) tp (cid:9) Γ .Q (cid:13) s Q ( α ) : A ◦ p Q α ( s Q ( α )) = α ( α ) ◦ p Q Then, we define the morphisms γ : ∆ Γ simultaneouslywith their decodings α ( γ ) in terms of the cubical atomic terms: EMPTY · : ∆ · α ( · ) = ! α (∆) VARIABLE γ : ∆ Γ ∆ (cid:13) α : A ◦ α ( γ ) γ.α : ∆ Γ .A α ( γ.α ) = h α ( γ ) , α ( α ) i DIMENSION γ : ∆ Γ r : α (∆) I γ.r : ∆ Γ . I α ( γ.r ) = h α ( γ ) , r i The above decodings assemble into a functor α : A T ,which automatically induces an essential morphism of topoithat we will also write α : A T . Lemma 23.
The chosen interval structure is preserved by re-striction along α : A T ; that is, we have an isomorphism y A ( · . I ) ∼ = α ∗ y T ( I ) . Construction 24 (The presheaf of variables) . We have a fam-ily var : Sh ( A ) / α ∗ tm , whose fiber at each a : α (Γ) tm ( A ) is the set of variables Γ (cid:13) a : A with α ( a ) = a . D. The glued topos
Let S be the Sierpi´nski topos satisfying Sh ( S ) = Set → .Writing ( pt ) for the punctual topos satisfying Sh ( pt ) = Set ,we have open and closed points ◦ : ( pt ) S and • :( pt ) S corresponding under inverse image to the codomainand domain functors on Set respectively. In geometrical terms,these endpoints render S a directed interval {• → ◦} that canbe used to form cylinders by cartesian product.We define the glued topos G by gluing the open endof the cylinder A × S onto T along α : A T , obtaining a diagram of open and closed immersions
T G A j i as follows:
AA × S A × ◦ TG α j A A × • i Finally, we define the category E axiomatized in Section IIIto be E := Sh ( G ) . Remark 25.
The gluing construction above has the advantageof being expressed totally in the category of Grothendiecktopoi; for familiarity, we note that the category E = Sh ( G ) is the traditional Artin gluing of the inverse image functor α ∗ : Pr ( T ) Pr ( A ) and can hence be explicitly computedas the comma category Pr ( A ) ↓ α ∗ . Therefore, an object of E is a pair (cid:0) E, A α ∗ E (cid:1) of a presheaf E : Pr ( T ) and apresheaf A : Pr ( A ) equipped with a structure map to α ∗ E . E. Verifying the axioms
Because E = Sh ( G ) is a category of sheaves, it satisfiesGiraud’s axioms and thus interprets extensional type theoryextended with a universe Ω of propositions. To see that E moreover admits a hierarchy of type-theoretic universessatisfying the strictification axiom (Axiom STC-1), we observethat E also admits a presentation as a presheaf category. Lemma 26 (Orton–Pitts universes) . In E we have a cumulativeand transfinite hierarchy of Orton–Pitts universes (Defini-tion 5) U ⊆ U ⊆ . . . corresponding to the sequence ofstrongly inaccessible cardinals in the background set theory.Proof. First, we observe that G can be presented as b G forsome small category G , following a standard result of topostheory that the Artin gluing of a continuous and accessiblefunctor between categories of presheaves is again a categoryof presheaves [10, 18]. Note that α ∗ is continuous, as theinverse image part of an essential morphism of topoi.We therefore obtain a hierarchy of Hofmann–Streicher uni-verses [33] in E ≃ Pr ( G ) , which Coquand has additionallyshown to be cumulative. Finally, using the argument of Ortonand Pitts [46, Theorem 6.3] and our assumption that the back-ground set theory is boolean, we conclude that the Hofmann–Streicher universes satisfy the strictification axiom.Using our computation of E as a comma category (Re-mark 25), we can explicitly compute the proposition syn stip-ulated by Axiom STC-3. Then, we construct the syntactic T -model, family of term variables, and interval object stipulatedby Axioms STC-4, STC-6, and STC-2 respectively. Computation 27 (The syntactic open) . We define syn : E to be the subterminal object j ! = (cid:0) , α ∗ (cid:1) , for which11e have an equivalence of categories Pr ( T ) ≃ E / syn . Theinverse image part of the open immersion can be viewed asthe pullback map syn ∗ : E E / syn , and the direct image isthe dependent product map syn ∗ : E / syn E . Remark 28 (The syntactic T -model) . As the classifier of pre-models of T , the topos T contains the generic pre-model of T , namely the Yoneda embedding T Sh ( T ) = Pr ( T ) .Because the Yoneda embedding is locally Cartesian closed, thegeneric pre-model is in fact a genuine T -model; because T is small, the size of this model is bounded by the smallest -modal Hofmann–Streicher universe, allowing us to internalizeit as an element of T -Mod ( U ) . Remark 29 (The family of term variables) . In light of Re-mark 25, the presheaf var : Pr ( A ) / α ∗ tm from Construction 24can be internalized as a U -valued family of types in E thatrestricts to tm : Pr ( T ) under the open immersion. Construction 30 (The glued interval) . We take the interval I : E to be the direct image I := j ∗ y T ( I ) of the syntactic intervalunder the open immersion, so j ∗ I = y T ( I ) . Because of theisomorphism from Lemma 23, it is easy enough to see that i ∗ I ∼ = y A ( · . I ) , completing our justification of Axiom STC-4.To see that the glued interval is tiny, we use a general factabout Artin gluings along inverse image functors. Lemma 31.
Let f : Y U be a morphism of topoi. Write X for the Artin gluing of the inverse image functor f ∗ , and write j : U X and i : Y X for the respective open and closedimmersions of topoi. Suppose that X : Sh ( X ) is a sheaf suchthat j ∗ X is a tiny object in Sh ( U ) and i ∗ X is a tiny objectin Sh ( Y ) ; then X is tiny.Proof. It suffices to check that the exponential functor ( X → − ) preserves colimits; see the appendix for details. Corollary 32.
The glued interval is tiny in E . We substantiate Axiom STC-5 by showing that ⊥ F ≤ syn in the lattice of opens of G , and unfolding Construction 10;details are in the appendix (Lemmas 54 and 55). Lemma 33.
A type A : U in E is F -local if and only if A is F -local. Finally, we construct the normal and neutral forms as anindexed quotient inductive type [3] valued in U ; the fulldefinition appears in Fig. 12 in the supplementary appendix.V. N ORMALIZATION FOR CUBICAL TYPE THEORY
Finally, we show that our computability model (Theo-rem 20) lets us compute the normal form of every syntactictype, implying the (external to E ) decidability of type equalityin cubical type theory, and the injectivity of type constructors. Remark 34.
Because α : A T is an essential morphismof topoi with additional left adjoint α ! ⊣ α ∗ , so is the closedimmersion i : A G ; the additional left adjoint i ! takes E : Pr ( A ) to the computability structure (cid:0) α ! E, E α ∗ α ! E (cid:1) determined by the unit of the monad α ∗ α ! . Construction 35.
Let
Γ : A be an atomic context; we write L Γ M : E for i ! y A (Γ) , the computability structure of vectors of“atoms of type Γ ” tracked by honest substitutions/terms. Lemma 36.
For any X : E , we have a canonical isomorphism [ L − M , X ] ∼ = i ∗ X : Pr ( A ) determined by adjoint transpose andthe Yoneda lemma. Construction 37.
The computability model evinces a locallyCartesian closed functor M ′ : T E ; restricting along α : A T , we have an interpretation functor J − K : A E taking each atomic context to its computability structure M ′ ( α (Γ)) . We observe that j ∗ J Γ K = y T ( α (Γ)) = α ! y A (Γ) . Construction 38.
For any X : E there is a canonicalnatural transformation [ J − K , X ] α ∗ j ∗ X : Pr ( A ) whichrestricts M ′ ( α (Γ)) X : E to its syntactic part, noting thatHom ( α ! y A (Γ) , j ∗ X ) ∼ = α ∗ j ∗ X (Γ) . Viewed as a sheaf on G , we write X M ′ : E for the pair (cid:0) j ∗ X, [ J − K , X ] α ∗ j ∗ X (cid:1) . Construction 39.
We define a pointwise vertical (Remark 19)natural transformation atom : L − M J − K : Hom ( A , E ) thatreflects each atomic substitution as a computable substitution.The definition follows by recursion on the index Γ : A , anduses the fact that the locus of instability of a variable is empty: atom ( · ) ( · ) = · atom Γ . I ( γ.r ) = ( atom Γ ( γ ) , r ) atom Γ .A ( γ.x ) = (cid:0) atom Γ ( γ ) , ↑ ⊥ F M ′ ( A ) [ var ( x ) | ⊥ F ֒ → [] M ′ ( A ) ] (cid:1) Lemma 40.
The pointwise vertical natural transformation atom : L − M J − K induces by precomposition a vertical map atom ∗ X : X M ′ X for any sheaf X : E . Theorem 41 (The normalization function) . The functor M ′ : T E induces a vertical map M . tp ( M ′ . tp ) M ′ . Compos-ing this with the vertical maps atom ∗ M ′ . tp and ⇓ , we obtaina vertical normalization map nbe sending a syntactic type tothe normal form chosen by its normalization structure in M ′ : M . tp ( M ′ . tp ) M ′ M ′ . tp nftpatom ∗ M ′ . tp ⇓ We can similarly exhibit a pointwise vertical normalizationfunction for syntactic terms : Q A : M . tp { M . tm ( A ) → nf ( A ) | syn ֒ → id } The standard correctness conditions (soundness and com-pleteness) for normalization follow immediately.
Theorem 42 (Correctness of normalization) . The normaliza-tion function is sound and complete for cubical type theory.
1) Completeness — if two (types, terms) are equal, thenthey are taken to equal normal forms.
2) Soundness — if two (types, terms) are taken to the samenormal form, then they are equal.Proof.
Completeness is automatic because our entire devel-opment was carried out relative to judgmental equivalence12lasses of terms. Soundness follows from the fact that thenormalization function is vertical, hence a section to the unitof the open modality, hence a monomorphism.We would not expect the Π constructor to be injective in thesyntactic category (a derivability): because monomorphismsare preserved by left exact functors, this would imply that anymodel of cubical type theory has injective type constructors.However, there is a modal version of injectivity correspondingto the traditional admissibility statement that does hold. Theorem 43 (Injectivity of type constructors) . The followingformula holds in the internal logic of E = Sh ( G ) : ∀ A, A ′ , B, B ′ . M . Π( A, B ) = M . Π( A ′ , B ′ ) = ⇒ (( A, B ) = ( A ′ , B ′ )) Proof.
By completeness, M . Π( A, B ) = M . Π( A ′ , B ′ ) implies: pi ( nbe ( A ) , λx. nbe ( B ( x ))) = pi ( nbe ( A ′ ) , λx. nbe ( B ′ ( x ))) By soundness, it suffices to show: (( nbe ( A ) , λx. nbe ( B ( x ))) = ( nbe ( A ′ ) , λx. nbe ( B ′ ( x )))) The result follows from injectivity of pi in nftp , shown by astandard inductive argument (Lemma 52 in the appendix). Theorem 44 (Decidability of equality) . Given two normalforms A , A : L Γ M nftp externally, there is an effectivealgorithm to determine whether A = A or A = A .Proof. As in the normal form presentation of strict coproducts[2], elements of nftp are not pure data: they include bindersof type I , var ( A ) , and [ φ ] . Nevertheless, equality is algorith-mically decidable as follows, by recursion on Γ , A , A .At a binder of type I or var ( A ) , we continue at Γ . I or Γ .A respectively. At a binder of type [ φ ] , we note that ourdefinition of F (Section III-B) licenses a case split on the formof φ : F . We eliminate universal quantifications in the style ofCohen et al. [19], proceeding by “left inversion” until reachinga conjunction of equations r = I s . If the conjunction implies , we halt; otherwise, we proceed under the equalizingatomic substitution ∆ → Γ .The above results unfold to statements about judgmentsin atomic contexts (i.e., in the image of α : A T ),but standard presentations of cubical type theory also allowcontext extension by : [ φ ] , written Γ , φ . Note however thatone can algorithmically eliminate such assumptions, as in theproof of Theorem 44 and the implementations of Cubical Agdaand redtt . Simply left invert φ ∨ ψ and perform quantifierelimination on ∀ i.φ ( i ) ; under , all judgments hold; andunder a consistent cofibration r = s , one can test equality bysubstitution or by using a union-find algorithm. A CKNOWLEDGMENTS
We thank Mathieu Anel, Steve Awodey, Thierry Coquand,Favonia, Marcelo Fiore, Daniel Gratzer, Robert Harper, AndersM¨ortberg, Michael Shulman, and Thomas Streicher for usefulconversations on cubical computability and Artin gluing. Wethank Tristan Nguyen at AFOSR for his support.This work was supported in part by AFOSR under grantsMURI FA9550-15-1-0053 and FA9550-19-1-0216. Any opin-ions, findings and conclusions or recommendations expressedin this material are those of the authors and do not necessarilyreflect the views of the AFOSR.R
EFERENCES [1] A. Abel, “Normalization by evaluation: Dependent typesand impredicativity,” Habilitation, Ludwig-Maximilians-Universit¨at M¨unchen, 2013.[2] T. Altenkirch, P. Dybjer, M. Hofmann, and P. Scott, “Nor-malization by evaluation for typed lambda calculus withcoproducts,” in
Proceedings of the 16th Annual IEEESymposium on Logic in Computer Science . Washington,DC, USA: IEEE Computer Society, 2001, pp. 303–.[3] T. Altenkirch and A. Kaposi, “Type theory in type theoryusing quotient inductive types,” in
Proceedings of the43rd Annual ACM SIGPLAN-SIGACT Symposium onPrinciples of Programming Languages , ser. POPL ’16.St. Petersburg, FL, USA: ACM, 2016, pp. 18–29.[4] T. Altenkirch, M. Hofmann, and T. Streicher, “Cate-gorical reconstruction of a reduction free normaliza-tion proof,” in
Category Theory and Computer Science ,D. Pitt, D. E. Rydeheard, and P. Johnstone, Eds. Berlin,Heidelberg: Springer Berlin Heidelberg, 1995, pp. 182–199.[5] M. Anel and A. Joyal, “Topo-logie,”Mar. 2019, preprint. [Online]. Available:http://mathieu.anel.free.fr/mat/doc/Anel-Joyal-Topo-logie.pdf[6] C. Angiuli, “Computational semantics of cartesian cu-bical type theory,” Ph.D. dissertation, Carnegie MellonUniversity, 2019.[7] C. Angiuli, R. Harper, and T. Wilson, “Computationalhigher-dimensional type theory,” in
POPL 2017: Pro-ceedings of the 44th ACM SIGPLAN Symposium onPrinciples of Programming Languages . Paris, France:ACM, 2017, pp. 680–693.[8] C. Angiuli, K.-B. Hou (Favonia), and R. Harper,“Cartesian Cubical Computational Type Theory:Constructive Reasoning with Paths and Equalities,”in , ser. Leibniz InternationalProceedings in Informatics (LIPIcs), D. Ghicaand A. Jung, Eds., vol. 119. Dagstuhl,Germany: Schloss Dagstuhl–Leibniz-Zentrum fuerInformatik, 2018, pp. 6:1–6:17. [Online]. Available:http://drops.dagstuhl.de/opus/volltexte/2018/9673[9] C. Angiuli, G. Brunerie, T. Coquand, K.-B.Hou (Favonia), R. Harper, and D. R. Licata,“Syntax and models of cartesian cubical type13heory,” Feb. 2019, preprint. [Online]. Available:https://github.com/dlicata335/cart-cube[10] M. Artin, A. Grothendieck, and J.-L. Verdier,
Th´eoriedes topos et cohomologie ´etale des sch´emas . Berlin:Springer-Verlag, 1972, s´eminaire de G´eom´etrieAlg´ebrique du Bois-Marie 1963–1964 (SGA 4),Dirig´e par M. Artin, A. Grothendieck, et J.-L. Verdier.Avec la collaboration de N. Bourbaki, P. Deligne et B.Saint-Donat, Lecture Notes in Mathematics, Vol. 269,270, 305.[11] S. Awodey and C. Butz, “Topological completeness forhigher-order logic,”
The Journal of Symbolic Logic
Mathematical Structures in Computer Science , vol. 28,no. 2, pp. 241–286, 2018.[13] A. Bauer, “First steps in synthetic computability theory,”
Electronic Notes in Theoretical Computer Science , vol.155, pp. 5–31, 2006, proceedings of the 21st AnnualConference on Mathematical Foundations of Program-ming Semantics (MFPS XXI).[14] L. Birkedal, R. E. Møgelberg, J. Schwinghammer, andK. Stovring, “First steps in synthetic guarded domaintheory: Step-indexing in the topos of trees,” in
Proceed-ings of the 2011 IEEE 26th Annual Symposium on Logicin Computer Science . Washington, DC, USA: IEEEComputer Society, 2011, pp. 55–64.[15] I. Blechschmidt, “Using the internal language of toposesin algebraic geometry,” Ph.D. dissertation, Universit¨atAugsberg, 2017.[16] M. Bunge and J. Funk,
Singular coverings of toposes , ser.Lecture notes in mathematics, 1890. Berlin: Springer,2006.[17] M. Bunge, F. Gago, and A. M. San Luis,
SyntheticDifferential Topology , ser. London Mathematical SocietyLecture Note Series. Cambridge University Press, 2018.[18] A. Carboni and P. Johnstone, “Connected limits, familialrepresentability and artin glueing,”
Mathematical Struc-tures in Computer Science , vol. 5, no. 4, pp. 441–459,1995.[19] C. Cohen, T. Coquand, S. Huber, and A. M¨ortberg,“Cubical Type Theory: a constructive interpretationof the univalence axiom,”
IfCoLog Journal ofLogics and their Applications
Theoretical Computer Science , vol.777, pp. 184–191, 2019, in memory of Maurice Nivat, afounding father of Theoretical Computer Science - PartI.[21] T. Coquand, S. Huber, and A. M¨ortberg, “On higherinductive types in cubical type theory,” in
Proceedingsof the 33rd Annual ACM/IEEE Symposium on Logic inComputer Science . Oxford, United Kingdom: ACM, 2018, pp. 255–264.[22] T. Coquand, S. Huber, and C. Sattler, “Homotopy canon-icity for cubical type theory,” in , ser. Leibniz International Proceed-ings in Informatics (LIPIcs), H. Geuvers, Ed., vol. 131.Dagstuhl, Germany: Schloss Dagstuhl–Leibniz-Zentrumfuer Informatik, 2019.[23] R. L. Crole,
Categories for Types , ser. Cambridge Math-ematical Textbooks. New York: Cambridge UniversityPress, 1993.[24] R. Diaconescu, “Change of base for toposes with gen-erators,”
Journal of Pure and Applied Algebra , vol. 6,no. 3, pp. 191–218, 1975.[25] P. Dybjer, “Internal type theory,” in
Types for Proofs andPrograms: International Workshop, TYPES ’95 Torino,Italy, June 5–8, 1995 Selected Papers , S. Berardi andM. Coppo, Eds. Berlin, Heidelberg: Springer BerlinHeidelberg, 1996, pp. 120–134.[26] M. Fiore, “Semantic analysis of normalisation by evalua-tion for typed lambda calculus,” in
Proceedings of the 4thACM SIGPLAN International Conference on Principlesand Practice of Declarative Programming , ser. PPDP’02. Pittsburgh, PA, USA: ACM, 2002, pp. 26–37.[27] P. Freyd, “On proving that is an indecomposableprojective in various free categories,” 1978, unpublishedmanuscript.[28] D. Gratzer and J. Sterling, “Syntactic cat-egories for dependent type theory: sketchingand adequacy,” 2020, note. [Online]. Available:https://arxiv.org/abs/2012.10783[29] D. Gratzer, G. A. Kavvos, A. Nuyts, and L. Birkedal,“Multimodal dependent type theory,” in Proceedings ofthe 35th Annual ACM/IEEE Symposium on Logic inComputer Science . Saarbr¨ucken, Germany: Associationfor Computing Machinery, 2020, pp. 492–506.[30] R. Harper and D. R. Licata, “Mechanizing metatheoryin a logical framework,”
Journal of Functional Program-ming , vol. 17, no. 4-5, pp. 613–673, Jul. 2007.[31] R. Harper, F. Honsell, and G. Plotkin, “A framework fordefining logics,”
J. ACM , vol. 40, no. 1, pp. 143–184,Jan. 1993.[32] L. Henkin, “Completeness in the theory oftypes,”
The Journal of Symbolic Logic ∼ streicher/NOTES/lift.pdf[34] S. Huber, “Canonicity for cubical type theory,” Journalof Automated Reasoning , Jun. 2018.[35] J. M. E. Hyland, “First steps in synthetic domain theory,”in
Category Theory , A. Carboni, M. C. Pedicchio, andG. Rosolini, Eds. Berlin, Heidelberg: Springer BerlinHeidelberg, 1991, pp. 131–156.[36] P. T. Johnstone,
Sketches of an Elephant: A Topos Theory ompendium: Volumes 1 and 2 , ser. Oxford LogicalGuides. Oxford Science Publications, 2002, no. 43.[37] A. Jung and J. Tiuryn, “A new characterization of lambdadefinability,” in Typed Lambda Calculi and Applications ,M. Bezem and J. F. Groote, Eds. Berlin, Heidelberg:Springer Berlin Heidelberg, 1993, pp. 245–257.[38] A. Kaposi, S. Huber, and C. Sattler, “Gluing for typetheory,” in ,ser. Leibniz International Proceedings in Informatics(LIPIcs), H. Geuvers, Ed., vol. 131. Dagstuhl, Ger-many: Schloss Dagstuhl–Leibniz-Zentrum fuer Infor-matik, 2019.[39] C. Kapulkin and C. Sattler, “Homotopy canonicity ofhomotopy type theory,” Aug. 2019, slides from a talkgiven at the International Conference on HomotopyType Theory (HoTT 2019). [Online]. Available:https://hott.github.io/HoTT-2019/conf-slides/Sattler.pdf[40] A. Kock,
Synthetic Differential Geometry , 2nd ed.,ser. London Mathematical Society Lecture Note Series.Cambridge University Press, 2006.[41] ——,
Synthetic Geometry of Manifolds , ser. CambridgeTracts in Mathematics. Cambridge University Press,2009.[42] F. W. Lawvere, “Toward the description in a smoothtopos of the dynamically possible motions and defor-mations of a continuous body,”
Cahiers de Topologie etG´eom´etrie Diff´erentielle Cat´egoriques , vol. 21, no. 4, pp.377–392, 1980.[43] D. R. Licata, I. Orton, A. M. Pitts, and B. Spitters,“Internal universes in models of homotopy type theory,”in , 2018, pp. 22:1–22:17.[44] C. Newstead, “Algebraic models of dependent type the-ory,” Ph.D. dissertation, Carnegie Mellon University,2018.[45] B. Nordstr¨om, K. Peterson, and J. M. Smith,
Program-ming in Martin-L¨of’s Type Theory , ser. InternationalSeries of Monographs on Computer Science. NY:Oxford University Press, 1990, vol. 7.[46] I. Orton and A. M. Pitts, “Axioms for modelling cubicaltype theory in a topos,” in , 2016, pp. 24:1–24:19.[47] F. Pfenning and C. Sch¨urmann, “System description:Twelf — a meta-logical framework for deductive sys-tems,” in
Automated Deduction — CADE-16 . Berlin,Heidelberg: Springer Berlin Heidelberg, 1999, pp. 202–206.[48] T. RedPRL Development Team, “ redtt ∞ -categories,” Higher Structures , vol. 1, 2017.[50] E. Rijke, M. Shulman, and B. Spitters, “Modalities in homotopy type theory,”
Logical Methods in ComputerScience , vol. Volume 16, Issue 1, Jan. 2020. [Online].Available: https://lmcs.episciences.org/6015[51] M. Shulman, “Univalence for inverse diagrams and ho-motopy canonicity,”
Mathematical Structures in Com-puter Science ,ser. Leibniz International Proceedings in Informatics(LIPIcs), H. Geuvers, Ed., vol. 131. Dagstuhl,Germany: Schloss Dagstuhl–Leibniz-Zentrum fuerInformatik, 2019, pp. 31:1–31:25. [Online]. Available:http://drops.dagstuhl.de/opus/volltexte/2019/10538[57] ——, “A cubical language for Bishop sets,” 2020, underreview.[58] T. Streicher, “Categorical intuitions underlying semanticnormalisation proofs,” in
Preliminary Proceedings of theAPPSEM Workshop on Normalisation by Evaluation ,O. Danvy and P. Dybjer, Eds. Department of ComputerScience, Aarhus University, 1998.[59] W. W. Tait, “Intensional Interpretations of Functionalsof Finite Type I,”
The Journal of Symbolic Logic
Practical Foundations of Mathematics , ser.Cambridge studies in advanced mathematics. Cam-bridge, New York (N. Y.), Melbourne: Cambridge Uni-versity Press, 1999.[61] T. Uemura, “Fibred fibration categories,” in
Proceedingsof the 32nd Annual ACM/IEEE Symposium on Logicin Computer Science . Reykjavik, Iceland: IEEEPress, 2017, pp. 24:1–24:12. [Online]. Available:http://dl.acm.org/citation.cfm?id=3329995.3330019[62] ——, “A general framework for the semanticsof type theory,” 2019. [Online]. Available:https://arxiv.org/abs/1904.04097[63] T. Univalent Foundations Program,
Homotopy Type The-ory: Univalent Foundations of Mathematics . Institute forAdvanced Study: https://homotopytypetheory.org/book,2013.[64] A. Vezzosi, A. M¨ortberg, and A. Abel, “Cubical Agda:15 Dependently Typed Programming Language withUnivalence and Higher Inductive Types,” in
Proceedingsof the 24th ACM SIGPLAN International Conferenceon Functional Programming ∼ amoertbe/papers/cubicalagda.pdf[65] S. Vickers, Locales and Toposes as Spaces . Dordrecht:Springer Netherlands, 2007, pp. 429–496.[66] D. Yetter, “On right adjoints to exponentialfunctors,”
Journal of Pure and Applied Algebra
PPENDIX
A. Normalization structures
In Figs. 9 to 11, we present the remaining normalizationstructures that could not fit in the main body of Section III.
B. Explicit computations
In Section IV-E we gave a presentation of E as a categoryof presheaves, an apparently necessary step to substantiate thestrict universes of synthetic Tait computability; it is still useful,however, to gain intuitions for the more traditional presentationof E as the comma category Sh ( A ) ↓ α ∗ , and to understandthe explicit computations of the inverse image and direct imageparts of the open and closed immersions respectively. Computation 45 (Comma category) . An object of the commacategory E ≃ Sh ( A ) ↓ α ∗ is an object E : Pr ( T ) togetherwith a family of presheaves E ′ α ∗ E : Pr ( A ) ; a morphismfrom (cid:0) F, F ′ α ∗ F (cid:1) to (cid:0) E, E ′ α ∗ E (cid:1) is a morphism e : F E : T together with a commuting square of thefollowing kind: F ′ α ∗ F E α ∗ Ee ′ α ∗ e Computation 46 (Open immersion) . The open immersion j : T G corresponds under inverse image to the codomain fibration j ∗ : Pr ( A ) ↓ α ∗ Pr ( T ) . Hence we may computethe adjunction j ∗ ⊣ j ∗ as follows: j ∗ : (cid:0) E, E ′ α ∗ E (cid:1) E j ∗ : E (cid:0) E, α ∗ E α ∗ E (cid:1) The direct image functor j ∗ is fully faithful. In fact, we havetwo additional adjoints j ! ⊣ j ∗ ⊣ j ∗ ⊣ j ! , the exceptional rightadjoint by virtue of the adjunction α ∗ ⊣ α ∗ . j ! : E (cid:0) E, α ∗ E (cid:1) j ! : (cid:0) E, E ′ α ∗ E (cid:1) α ∗ E ′ × α ∗ α ∗ E E Computation 47 (Closed immersion) . The closed immersion i : A G corresponds under inverse image to the domain functor i ∗ : Sh ( A ) ↓ α ∗ Pr ( A ) . We compute the adjunc-tion i ∗ ⊣ i ∗ as follows: i ∗ : (cid:0) E, E ′ α ∗ E (cid:1) E ′ i ∗ : E ′ (cid:0) , E ′ α ∗ (cid:1) Because α is an essential morphism of topoi, we have anadditional left adjoint i ! ⊣ i ∗ ⊣ i ∗ : i ! : E ′ (cid:0) α ! E ′ , E ′ α ∗ α ! E ′ (cid:1) Computation 48 (Open and closed modality) . Using thesyntactic open syn (Computation 27), we can compute theopen modality = j ∗ j ∗ as the exponential ( syn → − ) . Like-wise, syn makes another computation of the closed modality = i ∗ i ∗ available: A × syn A syn A Corollary 49.
From Computations 27 and 45 to 47 we maymake the following observations: The open modality := j ∗ j ∗ on E has both a rightadjoint j ∗ j ! and left adjoint j ! j ∗ ; hence the syntacticopen syn : E is a tiny object; the adjunction j ! j ∗ ⊣ can be computed as ( − × syn ) ⊣ ( syn → − ) . The closed modality := i ∗ i ∗ on E has a left adjoint i ! i ∗ . The gluing functor α ∗ : Pr ( T ) Pr ( A ) can bereconstructed as the composite i ∗ j ∗ . The following fracture theorem is from SGA 4 [10].
Lemma 50 (Fracture [10, 50]) . Any sheaf on G can bereconstructed up to isomorphism from its restriction to T and A ; in particular, the following square is cartesian forany A : E : A A A A C. Explicit construction of neutral and normal forms
Our construction of the computability model of cubicaltype theory (Theorem 20) requires only that certain constantscorresponding to the neutral and normal forms exist in E .However, to use this computability model to establish theinjectivity and (external) decidability properties of Section V,it is important to ensure that the corresponding properties holdfor our normal forms.Concretely, we define them by a family of indexed quotientinductive types (QITs [3]) valued in the modal universe U : [ tp ∋ nf A ] : U ( A : M . tp )[ A ∋ nf a ] : U ( A : M . tp , a : M . tm ( A ))[ a ∈ φ ne A ] : U ( φ : F , A : M . tp , a : M . tm ( A )) g : (cid:8)(cid:0)P A : nftp Q x : var ( A ) nftp (cid:1) → nftp (cid:12)(cid:12) syn ֒ → M . Σ (cid:9) pair : { A, B } (cid:8)(cid:0)P x : nf ( A ) nf ( B ( x )) (cid:1) → nf ( M . Σ( A, B )) (cid:12)(cid:12) syn ֒ → λ ( a, b ) . ( a, b ) (cid:9) split : { φ, A, B } (cid:8) ne φ ( M . Σ( A, B )) → P x : ne φ ( A ) ne φ ( B ( x )) (cid:12)(cid:12) syn ֒ → λ ( a, b ) . ( a, b ) (cid:9) Σ : (cid:8)(cid:0)P A : tp ( A → tp ) (cid:1) → tp (cid:12)(cid:12) syn ֒ → M . Σ (cid:9) [Σ( A, B )] ∼ = P x : A B ( x ) hcom r → s ; φ Σ( A,B ) p = let x ( k ) = hcom r → k ; φA λi. [ i = r ∨ F φ → π ( p ( i ))] in (cid:0) x ( s ) , com r → s ; φλi.B ( x ( i )) λi. [ i = r ∨ F φ → π ( p ( i ))] (cid:1) coe r → sλi. Σ( A ( i ) ,B ( i )) p = let x ( k ) = coe r → kA π ( p ) in (cid:0) x ( s ) , coe r → sλi.B ( x ( i )) π ( p ) (cid:1) ⇓ Σ( A, B ) = sg (cid:0) ⇓ A, λx. ⇓ B (cid:0) ↑ ⊥ F A [ var ( x ) | ⊥ F ֒ → [] M . tm ( A ) ] (cid:1)(cid:1) ↑ φ Σ( A,B ) [ p | φ ֒ → p ] = let ( x , y ) = split ( p ); ˜ x = ↑ φA [ x | φ ֒ → π ( p )] in (cid:0) ˜ x, ↑ φB (˜ x ) [ y | φ ֒ → π ( p )] (cid:1) ↓ Σ( A,B ) p = pair (cid:0) ↓ A π ( p ) , ↓ B ( π ( p )) π ( p ) (cid:1) Fig. 9. The cubical normalization structure for dependent sum types. s { nftp | syn ֒ → M . S1 } base : { nf ( M . S1 ) | syn ֒ → M . base } loop : (cid:8)Q i : I { nf ( M . S1 ) | ∂i ֒ → base } (cid:12)(cid:12) syn ֒ → M . loop (cid:9) fhcom : { HCom ( M . S1 , nf ( M . S1 )) | syn ֒ → M . hcom M . S1 } inds (cid:8)Q C : var ( M . S1 ) → nftp Q b : nf ( C ( M . base )) Q l : Q i : I { nf ( C ( M . loop ( i ))) | ∂i֒ → b } Q x : ne φ ( M . S1 ) ne φ ( C ( x )) (cid:12)(cid:12) syn ֒ → M . ind S1 (cid:9) lift : { φ } (cid:8)(cid:0)P b : ne φ ( M . S1 ) Q :[ φ ] { nf ( M . S1 ) | syn ֒ → b } (cid:1) → nf ( M . S1 ) (cid:12)(cid:12) syn ∨ φ ֒ → λ ( b, b ′ ) . [ syn ֒ → b, φ ֒ → b ′ ] (cid:9) The following definition of S1 is justified by realignment: the constructors give rise to a (quotient-inductive) type that is isomorphic to M . tm ( M . S1 ) underneath z : syn ; after realignment, the constructor ⌊−⌋ becomes the identity function. data [ S1 ] : { U | syn ֒ → M . tm ( M . S1 ) } where ⌊−⌋ : { syn } → M . tm ( M . S1 ) → [ S1 ] base : { [ S1 ] | syn ֒ → ⌊ M . base ⌋} loop : Q i : I { [ S1 ] | [ ∂i ] ֒ → base , syn ֒ → ⌊ M . loop ( i ) ⌋} lift : Q φ : F Q x : ne φ ( M . S1 ) Q x :[ φ ] →{ [ S1 ] | syn ֒ →⌊ x ⌋} { [ S1 ] | [ φ ] ֒ → x, syn ֒ → ⌊ x ⌋} fhcom : Q r,s : I Q φ : F Q c : Q i : I Q :[ i = r ∨ F φ ] P x : M . tm ( M . S1 ) { [ S1 ] | syn ֒ →⌊ x ⌋} { [ S1 ] | [ r = s ∨ F φ ] ֒ → π ( c ( i )) , syn ֒ → M . hcom r → s ; φ M . S1 ( λi.π ( c ( i ))) } S1 : { tp | syn ֒ → M . S1 } hcom r → s ; φ S1 c = fhcom ( r, s, φ, λi. [ i = r ∨ F φ ֒ → ( c ( i ) , c ( i ))]) coe r → sλ . S1 x = x ↑ φ S1 [ x | φ ֒ → x ] = ( x , lift ( φ, x , [ φ ֒ → x ])) ↓ S1 ⌊ c ⌋ = c ↓ S1 base = base ↓ S1 loop ( i ) = loop ( i ) ↓ S1 lift ( φ, x , x ) = lift φ (cid:2) x (cid:12)(cid:12) φ ֒ → ↓ S1 x (cid:3) ↓ S1 fhcom ( r, s, φ, c ) = fhcom r → s ; φ λi. (cid:2) i = r ∨ F φ ֒ → ↓ S1 π ( c ( i )) (cid:3) Fig. 10. Definition of the cubical normalization structure for the circle. nd S1 : (cid:8)Q C : S1 → tp Q b : C ( base ) Q l : Q i : I { C ( loop ( i )) | ∂i֒ → b } Q x : S1 C ( x ) (cid:12)(cid:12) syn ֒ → M . ind S1 (cid:9) ind S1 ( C, b, l, ⌊ c ⌋ ) = M . ind S1 ( C, b, l, c ) ind S1 ( C, b, l, base ) = b ind S1 ( C, b, l, loop ( i )) = l ( i ) ind S1 ( C, b, l, lift ( φ, x , x )) = let ˜ x = ↑ φ S1 [ x | φ ֒ → ( x , x )] inlet c = inds (cid:0) λy. ⇓ C (cid:0) ↑ ⊥ F S1 [ var ( y ) | ⊥ F ֒ → [] tm ( S1 ) ] (cid:1) , ↓ C ( base ) b, λi. ↓ C ( loop ( i )) l ( i ) , x (cid:1) in ↑ φC (˜ x ) [ c | φ ֒ → ind S1 ( C, b, l, ˜ x )] ind S1 ( C, b, l, fhcom ( r, s, φ, x )) = com r → s ; φλi.C ( hcom r → i ; φ S1 x ) λi. [ i = r ∨ F φ ֒ → ind S1 ( C, b, l, π ( x ( i )))] Fig. 11. Implementation of the induction principle for the circle.
In fact, we ensure that [ a ∈ φ ne A ] is not only -connectedbut actually ( φ ∨ syn ) -connected, capturing the sense in whichthe data of a neutral form collapses to a point on its locus ofinstability. Then, the collections of normal and neutral formsare obtained by dependent sum and realignment as follows(noting that the fibers of each family are valued in U andare thus -connected): nftp ∼ = P A : M . tp [ tp ∋ nf A ] nf ( A ) ∼ = P a : M . tm ( A ) [ A ∋ nf a ] ne φ ( A ) ∼ = P a : M . tm ( A ) [ a ∈ φ ne A ] Our use of quotienting in the definition of normal formsis to impose correct cubical boundaries on constructors: forinstance, we must have ∂i → loop ( i ) = base . Because thetheory of cofibrations is (externally) decidable, the quotientcan be presented externally by an effective rewriting systemthat reduces size and is therefore obviously noetherian. Remark 51.
An indexed quotient inductive type in U alsohas a universal property in U , obtained by adding an additionalquotient-inductive clause that contracts each fiber to a pointunder z : syn .In Fig. 12 we present the indexed quotient inductive defini-tion of normal and neutral forms. Lemma 52 (Injectivity of normal form constructors) . Thefollowing formula holds in the internal logic of E = Sh ( G ) : ∀ A, A ′ , B, B ′ . pi ( A, B ) = pi ( A ′ , B ′ ) = ⇒ (( A, B ) = ( A ′ , B ′ )) Proof.
We prove this in the same way that one proves injec-tivity of constructors of any inductive type, with one subtlety:we must ensure that our constructions respect the cubicalboundary of glue , which is the only constructor of [ tp ∋ nf − ] subject to an equational clause.By induction on [ tp ∋ nf − ] , we define a -connected pred-icate isPi : nftp → Ω satisfying a universal property: ∀ X : nftp . isPi ( X ) ⇐⇒ ( ∃ A , B .X = pi ( A , B )) We define isPi as follows: isPi ( , pi ( A , B )) = ⊤ isPi ( , glue { B, A, f } ( φ, B , A , f )) = ∃ z : [ φ ] . isPi ( A, A ( z )) isPi ( , sg ( A , B )) = ⊥ isPi ( , path ( A , a , a )) = ⊥ isPi ( , s
1) = ⊥ We must verify that isPi respects the φ -boundary of glue = A ( z ) . But supposing that z : [ φ ] , we can calculate that isPi ( , glue ( φ, B , A , f )) = isPi ( , A ( z )) , which is exactlywhat it means for isPi to respect that equation.The reverse implication of the universal property of isPi is immediate. We prove the forward implication by inductionon X , where again the only subtlety is in the case of glue :if isPi ( , glue ( φ, B , A , f )) then we must have isPi ( A, A ( z )) ,which by the inductive hypothesis implies A ( z ) = pi .Then we define dom : { X : nftp | isPi ( X ) } → nftp : dom ( , pi ( A , B )) = η ( A ) dom ( , glue ( φ, B , A , f )) = dom ( A, A ) Note that these are the only constructors that may satisfy isPi ,and in the case of glue , if isPi ( , glue ( φ, B , A , f )) holds then φ = ⊤ and isPi ( A, A ) . We may define cod similarly.Finally, suppose that pi ( A, B ) = pi ( A ′ , B ′ ) . Then by apply-ing dom to both sides of this equation, we get ( A = A ′ ) ; theequality of codomains likewise follows by applying cod . D. Proofs of theorems
Lemma 23.
The chosen interval structure is preserved by re-striction along α : A T ; that is, we have an isomorphism y A ( · . I ) ∼ = α ∗ y T ( I ) .Proof. First we compute the representable points of α ∗ y T ( I ) by transpose and the Yoneda lemma:Hom Pr ( A ) ( y A (Γ) , α ∗ y T ( I )) ∼ = Hom Pr ( T ) ( α ! y A (Γ) , y T ( I )) ∼ = Hom Pr ( T ) ( y T ( α (Γ)) , y T ( I )) ∼ = Hom T ( α (Γ) , I ) IRCLE TYPE s tp ∋ nf M . S1 ] PATH TYPE A : Q i : I [ tp ∋ nf A ( i )] a : [ A (0) ∋ nf a ] a : [ A (1) ∋ nf a ] path { A, a , a } ( A , a , a ) : [ tp ∋ nf M . path ( A, a , a )] GLUE TYPE φ : F B : [ tp ∋ nf B ] A : Q z :[ φ ] [ tp ∋ nf A ( z )] f : Q z :[ φ ] [ M . Equiv ( A ( z ) , B ) ∋ nf f ( z )] glue { B, A, f } ( φ, B , A , f ) : [ tp ∋ nf M . glue ( φ, B, A, f )] GLUE TYPE BOUNDARY φ : F B : [ tp ∋ nf B ] A : Q z :[ φ ] [ tp ∋ nf A ( z )] f : Q z :[ φ ] [ M . Equiv ( A ( z ) , B ) ∋ nf f ( z )] z : [ φ ] glue { B, A, f } ( φ, B , A , f ) = A ( z ) : [ tp ∋ nf A ( z )] PI / SG TYPE A : [ tp ∋ nf A ] B : Q x : var ( A ) [ tp ∋ nf B ( x )] pi { A, B } ( A , B ) : [ tp ∋ nf M . Π( A, B )] sg { A, B } ( A , B ) : [ tp ∋ nf M . Σ( A, B )] UNSTABLE z : [ φ ] ⋆ ( z ) : [ a ∈ φ ne A ] UNSTABLE COLLAPSE z : [ φ ] a : [ A ∈ φ ne a ] a = ⋆ ( z ) : [ a ∈ φ ne A ] VARIABLE x : var ( A ) var { A } ( x ) : [ x ∈ ⊥ ne A ] FUNCTION APPLICATION f : [ f ∈ φ ne M . Π( A, B )] a : [ A ∋ nf a ] app { A, B, f, a } ( f , a ) : [ a ∈ φ ne A ] PAIR PROJECTION p : [ p ∈ φ ne M . Σ( A, B )] fst { A, B, p } ( p ) : [ π ( p ) ∈ φ ne A ] snd { A, B, p } ( p ) : [ π ( p ) ∈ φ ne B ( π ( p ))] PATH APPLICATION p : [ p ∈ φ ne M . path ( A, a , a )] r : I papp { A, a , a } ( p , r ) : [ p ( r ) ∈ φ ∨ F ∂r ne A ( r )] UNGLUE DESTRUCTOR g : [ g ∈ ψ ne M . glue ( φ, B, A, f )] unglue { B, A, f, g } ( φ, g ) : [ M . unglue ( g ) ∈ ψ ∨ F φ ne B ] CIRCLE INDUCTION C : Q x : var ( M . S1 ) [ tp ∋ nf C ( x )] b : [ C ( M . base ) ∋ nf b ] l : Q i : I [ C ( M . loop ( i )) ∋ nf l ( i )] s : [ s ∈ φ ne M . S1 ] ind { C, b, l, s } ( C , b , l , s ) : [ M . ind S1 ( C, b, l, s ) ∈ φ ne C ( s )] CIRCLE NEUTRAL LIFT s : [ s ∈ φ ne M . S1 ] s φ : Q :[ φ ] [ M . S1 ∋ nf s ] lift { s } ( s , s φ ) : [ M . S1 ∋ nf s ] CIRCLE NEUTRAL LIFT BOUNDARY s : [ s ∈ φ ne M . S1 ] s φ : Q :[ φ ] [ M . S1 ∋ nf s ] z : [ φ ] lift { s } ( s , s φ ) = s φ ( z ) : [ M . S1 ∋ nf s ] CIRCLE BASE base : [ M . S1 ∋ nf M . base ] CIRCLE LOOP r : I loop ( r ) : [ M . S1 ∋ nf M . loop ( r )] CIRCLE LOOP BOUNDARY r : I : [ ∂r ] loop ( r ) = base : [ M . S1 ∋ nf M . base ] CIRCLE FORMAL HOMOGENEOUS COMPOSITION r, s : I φ : F a : Q i : I Q z :[ i = r ∨ F φ ] [ M . S1 ∋ nf a ( i, z )] fhcom { a } ( r, s, φ, a ) : [ M . S1 ∋ nf M . hcom ( M . S1 , r, s, φ, a )] FUNCTION ABSTRACTION f : Q x : var ( A ) [ B ( x ) ∋ nf f ( x )] lam { A, B, f } ( f ) : [ M . Π( A, B ) ∋ nf λx.f ( x )] PAIR CONSTRUCTOR a : [ A ∋ nf a ] b : [ B ( a ) ∋ nf b ] pair { A, B, a, b } ( a , b ) : [ M . Σ ∋ nf ( a, b )] PATH ABSTRACTION p : Q i : I [ A ( i ) ∋ nf p ( i )] plam { A, a , a , p } ( p ) : [ M . path ( A, a , a ) ∋ nf λi.p ( i )] ENGLUE CONSTRUCTOR a : Q z :[ φ ] [ A ∋ nf a ] b : [ B ∋ nf b ] ∀ z : [ φ ] . b = a ( z ) englue { B, A, f, a, b } ( φ, a , b ) : [ M . glue ( φ, B, A, f ) ∋ nf M . glue / tm ( a, b )] ENGLUE CONSTRUCTOR BOUNDARY a : Q z :[ φ ] [ A ∋ nf a ] b : [ B ∋ nf b ] ∀ z : [ φ ] . b = a ( z ) z : [ φ ] englue { B, A, f, a, b } ( φ, a , b ) = a ( z ) : [ A ∋ nf a ] Fig. 12. The explicit indexed quotient-inductive definition of normal and neutral forms. The
UNSTABLE and
UNSTABLE COLLAPSE rules ensure that ne φ ( A ) collapses to M . tm ( A ) within the locus of instability φ .
19e see by induction on the definition of the objects andhom sets of A that this is equivalent to Hom A (Γ , · . I ) . Lemma 31.
Let f : Y U be a morphism of topoi. Write X for the Artin gluing of the inverse image functor f ∗ , and write j : U X and i : Y X for the respective open and closedimmersions of topoi. Suppose that X : Sh ( X ) is a sheaf suchthat j ∗ X is a tiny object in Sh ( U ) and i ∗ X is a tiny objectin Sh ( Y ) ; then X is tiny.Proof. We must check that the exponential functor ( X → − ) preserves colimits. Fixing a diagram E • : I Sh ( X ) , wemay compute the exponential (cid:0) X → colim I E • (cid:1) in the lan-guage of Sh ( Y ) as follows; first, the standard computationthat glues a function from the open subtopos onto a functionfrom the closed subtopos [36]: i ∗ (cid:0) X → colim I E • (cid:1) f ∗ (cid:0) j ∗ X → j ∗ colim I E • (cid:1) i ∗ X → i ∗ colim I E • i ∗ X → f ∗ j ∗ colim I E • Commute cocontinuous functors past colimits. i ∗ (cid:0) X → colim I E • (cid:1) f ∗ (cid:0) j ∗ X → colim I j ∗ E • (cid:1) i ∗ X → colim I i ∗ E • i ∗ X → colim I f ∗ j ∗ E • Use the tininess of i ∗ X, j ∗ X and the cocontinuity of f ∗ . i ∗ (cid:0) X → colim I E • (cid:1) colim I f ∗ ( j ∗ X → j ∗ E • ) colim I ( i ∗ X → i ∗ E • ) colim I ( i ∗ X → f ∗ j ∗ E • ) Hence by the universality of colimits we have: colim I i ∗ ( X → E • ) colim I f ∗ ( j ∗ X → j ∗ E • ) colim I ( i ∗ X → i ∗ E • ) colim I ( i ∗ X → f ∗ j ∗ E • ) Lemma 53. If Γ : A is a formal context, then the hom set Hom T ( α (Γ) , [0 = 1]) is empty.Proof. Formal contexts do not induce assumptions of falsecofibrations. This can be seen by a model construction inwhich T is interpreted into cubical sets, where the interpre-tation of cofibrations is standard but each type is interpretedas an inhabited type. Such an argument accommodates typesthat are “weakly empty” (e.g. the void type lacking an η -law),because the abort eliminator can simply return the basepointof its motive. Lemma 54.
In the lattice of opens of G , we have ⊥ F ≤ syn .Proof. We recall that the interval I is purely syntactic(Lemma 23), hence we have ⊥ F = j ∗ y T ([0 = 1]) andtherefore i ∗ ⊥ F = α ∗ y T ([0 = 1]) . To show the inequality ⊥ F ≤ syn , we need to exhibit a square of the following kindin Pr ( A ) : α ∗ y T ([0 = 1]) α ∗ y T ([0 = 1]) ⊥ F syn It suffices to show that α ∗ y T ([0 = 1]) is the initial objectof Pr ( A ) , but this follows from Lemma 53. Lemma 55.
A type A : U in E is ⊥ F -connected if and only A is ⊥ F -connected.Proof. If A is ⊥ F -connected, it is immediate that A is ⊥ F -connected. Conversely, assume that A is ⊥ F -connected;Lemma 54 implies that A is also ⊥ F -connected. Lemma 33.
A type A : U in E is F -local if and only if A is F -local.Proof. For ⊥ F -connectedness, we use Lemma 55. Then,fixing φ, ψ : F we must check that a partial element [ φ ֒ → a φ , ψ ֒ → a ψ ] : [ φ ] ∨ [ ψ ] A can be extended to aunique partial element [ φ ∨ F ψ ] A .We assume a proof of [ φ ∨ F ψ ] ; by Construction 10 wehave M . [ φ M . ∨ F ψ ] and ([ φ ] ∨ [ ψ ]) , which is the same as [ φ ] ∨ [ ψ ] ∨ syn . Hence we may form the following partialelement, using the fact that A is F -local: φ ֒ → a φ ψ ֒ → a ψ syn ֒ → [ φ ֒ → a φ , ψ ֒ → a ψ ] A Lemma 36.
For any X : E , we have a canonical isomorphism [ L − M , X ] ∼ = i ∗ X : Pr ( A ) determined by adjoint transpose andthe Yoneda lemma.Proof. Fix an atomic context
Γ : A and compute: [ L − M , X ](Γ) ∼ = Hom E ( L Γ M , X )= Hom E ( i ! y A (Γ) , X ) ∼ = Hom Pr ( A ) ( y A (Γ) , i ∗ X ) ∼ = i ∗ X (Γ) Lemma 40.
The pointwise vertical natural transformation atom : L − M J − K induces by precomposition a vertical map atom ∗ X : X M ′ X for any sheaf X : E . roof. The vertical map is computed in the language of thecomma category as the following square: [ J − K , X ] α ∗ j ∗ XX M ′ [ L − M , X ] ∼ = i ∗ X α ∗ j ∗ X [ atom , X ] X α ∗ id j ∗ X To see that the diagram commutes, we chase an element x : J Γ K X , using the fact that each component atom Γ : L Γ M J Γ K is vertical. Theorem 41 (The normalization function) . The functor M ′ : T E induces a vertical map M . tp ( M ′ . tp ) M ′ . Compos-ing this with the vertical maps atom ∗ M ′ . tp and ⇓ , we obtaina vertical normalization map nbe sending a syntactic type tothe normal form chosen by its normalization structure in M ′ : M . tp ( M ′ . tp ) M ′ M ′ . tp nftpatom ∗ M ′ . tp ⇓ Proof.
Unfolding things more precisely, the vertical map M . tp ( M ′ . tp ) M ′ must be a square of the following form: α ∗ y T ( tp ) α ∗ y T ( tp ) M . tp = j ∗ y T ( tp ) [ J − K , M ′ . tp ] α ∗ y T ( tp )( M ′ . tp ) M ′ α ∗ id y T ( tp ) The upstairs map is defined by functoriality of the com-putability interpretation, taking a type A : α (Γ) tp to itschosen normalization structure M ′ ( A ) : J Γ K M ′ . tptp