Canonicity and homotopy canonicity for cubical type theory

Cubical type theory provides a constructive justification of homotopy type theory. A crucial ingredient of cubical type theory is a path lifting operation which is explained computationally by induction on the type involving several non-canonical choices. We present in this article two canonicity results, both proved by a sconing argument: a homotopy canonicity result, every natural number is path equal to a numeral, even if we take away the equations defining the lifting operation on the type structure, and a canonicity result, which uses these equations in a crucial way. Both proofs are done internally in a presheaf model.


Introduction
This article is a contribution to the analysis of the computational content of the univalence axiom [Voe14] (and higher inductive types). In previous work [ABC + 21, BCH14, CCHM18, CHM18, OP16], various presheaf models of this axiom have been described in a constructive metatheory. In this formalism, the notion of fibrant type is stated as a refinement of the path lifting operation where one not only provides one of the endpoints but also a partial lift (for a suitable notion of partiality). This generalized form of path lifting operation is a way to state a homotopy extension property, which was recognized very early (see e.g. [Eil39]) as a key for an abstract development of algebraic topology. The axiom of univalence is then captured by a suitable equivalence extension operation (the "glueing" operation), which expresses that we can extend a partially defined equivalence of a given total codomain to a total equivalence. These presheaf models suggest possible extensions of type theory where we manipulate higher dimensional objects [ABC + 21, CCHM18]. One can define a notion of reduction and prove canonicity for this extension [Hub19]: any closed term of type N (natural number) is convertible to a numeral. There are however several non-canonical choices when defining the path lifting operation by induction on the type, which produce different notion of convertibility. 1 A natural question is how essential these non-canonical choices are: can it be that a closed term of type N, defined without use of such non-canonical reduction rules, Figure 1: These are the main rules for the computability predicate component in the sconing models for homotopy canonicity and canonicity in the case of the global context. The component relating to fibrancy differs between the two cases.
any presheaf model. As explained in [CCHM18,OP16,Coq18], in some class of presheaf models, parametrised by two presheaves I (representing an abstract interval) and F (the cofibration classifier), it is possible to define, as an internal model inside this presheaf model, a model of type theory with a hierarchy of universes U fib 0 , U fib 1 , . . . satisfying the univalence axiom. Both models are carried out in a constructive metalanguage. In particular, the second model provides a computational interpretation of univalence.
This model of univalence is a model of cubical type theory where each type has a filling operation. Univalence is then a theorem and not an axiom of cubical type theory. This filling operation is defined by induction on the type, using a more primitive composition operation.
The basic scheme for a canonicity proof that we follow here is to associate by induction on a type A a computability predicate A on the (internal) set |A| of closed elements of this type. As explained in [Coq19], this so-called sconing interpretation for canonicity goes back to Gödel's notion of computability predicates [Göd58], with the crucial feature here that these predicates are now proof-relevant. This scheme works as well for cubical type theory if we use a metalanguage with an interval object.
We now explain in general terms and by example the differences between the homotopy canonicity and the canonicity proofs. For the homotopy canonicity proof, we will have A : |A| → U fib n , while for the canonicity proof, we will have A : |A| → U n with a separate component tracking computability of composition.
For the type of natural number N, for the canonicity proof, we define N t to be k:N t = |N| S k (0), where t = |N| S k (0) is (strict) equality, and N is the constant presheaf of natural numbers. In this case, N is not a fibrant family over |N |. For homotopy canonicity, we have to define N t as a fibrant family over |N | (see Subsubsection 3.2.4). 2 One key step in both arguments is in ensuring that the filling operation is a computable operation. This is solved in very different ways for the two theories. For the homotopy canonicity proof, where A : |A| → U fib n , we can prove directly that the filling operation is computable without needing information on how the filling operation behaves at individual type formers. For the canonicity proof, where A : |A| → U n , the filling operation is defined in terms of a more primitive composition operation and we prove by induction on the type that this composition operation is computable.

Cubical categories with families
We first recall the notion of categories with families (cwf) [Dyb96] equipped with Π-and Σ-types, universes, and natural number types. This notion can be interpreted in any presheaf model. In that setting, we can consider new operations. A cubical cwf will be such a cwf in a presheaf model with extra operations that make use of an interval object I and a cofibration classifier F as introduced in [CHM18, OP16].
1.1. Categories with families. Categories with families form an algebraic notion of model of type theory. In order to simplify the treatment of universes, we define them in a stratified manner where instead of a single presheaf of types, we specify a filtration of presheaves of "small" types. 3 The length of the filtration is not essential: we have chosen ω + 1 so that we may specify constructions just at the top level.
A category with families (cwf) consists of the following data. • We have a category of contexts Con and substitutions Hom(∆, Γ) from ∆ to Γ in Con. The identity substitution on Γ in Con is written id, and the composition of δ in Hom(Θ, ∆) and σ in Hom(∆, Γ) is written σδ. • We have a presheaf Type of types over the category of contexts. The action of σ in Hom(∆, Γ) on a type A over Γ is written Aσ. We have a cumulative sequence of subpresheaves Type n of types of level n of Type where n is a natural number. • We have a presheaf Elem of elements over the category of elements of Type, i.e. a set Elem(Γ, A) for A in Type(Γ) with aσ in Elem(∆, Aσ) for a in Elem(Γ, A) and σ in Hom(∆, Γ) satisfying evident laws. • We have a terminal context 1, with the unique element of Hom(Γ, 1) written ().
• Given A in Type(Γ), we have a context extension Γ.A. There is a projection p in Hom(Γ.A, Γ) and a generic term q in Elem(Γ.A, Ap). Given σ in Hom(∆, Γ), A in Type(Γ), and a in Elem(∆, Aσ) we have a substitution extension (σ, a) in Hom(∆, Γ.A). These operations satisfy p(σ, a) = σ, q(σ, a) = a, and (pσ, qσ) = σ. Thus, every element of Hom(∆, Γ.A) is uniquely of the form (σ, a) with σ and a as above. We introduce some shorthand notation related to substitution. Given σ in Hom(∆, Γ) and A in Type(Γ), we write σ + = (σp, q) in Hom(∆.Aσ, Γ.A). Given a in Elem(Γ, A), we write [a] = (id, a) in Hom(Γ, Γ.A). Thus, given B in Type n (Γ.A) and a in Elem ). We extend this notation to several arguments: given a i in Elem(Γ, Note that we could take a different equational presentation. For instance, the presentation in [Ehr88] takes as primitive the operations σ + and [u] and defines then (σ, u) as a derived operation (σ, u) = σ + [u]. It is a strength of the present approach to canonicity proof to be independent of this choice.
Given a cwf as above, we define what it means to have the following type formers. In addition to the specified laws, all specified operations are furthermore required to be stable under substitution in the evident manner. Thus, every element of Elem(Γ, Σ(A, B)) is uniquely of the form pair(a, b) with a and b as above. Given A and B in Type(Γ) we write A × B for Σ(A, Bp). • Universes. We have U n in Type n+1 (Γ) and an isomorphism Type n (Γ) ∼ = Elem(Γ, U n ), naturally in Γ. 4 • Natural numbers. We have N in Type 0 (Γ) with zero 0 in Elem(Γ, N) and successor S(n) in Elem(Γ, N) for n in Elem(Γ, N). Given P in Type(Γ.N), z in Elem(Γ, P [0]), s in Elem(Γ.N.P, P (p, S(q))p), and n : Elem(Γ, N), we have the elimination natrec(P, z, s, n) in Elem(Γ, P [n]) with natrec(P, z, s, 0) = z, natrec(P, z, s, S(n)) = s[n, natrec(P, z, s, n)].
A structured cwf is a cwf with type formers as above.
4 This presents Tarski-style universes. For Russell-style universes, we would additionally demand that this isomorphism is an identity. A (strict) morphism M → N of cwfs is defined in the evident manner and consists of a functor F : Con M → Con N and natural transformations u : Type M → Type N F and v : Elem M → Elem N (F, u) such that v restricts to types of level n and the terminal context and context extension is preserved strictly. A morphism M → N of structured cwfs additionally preserves the operations of the above type formers. We obtain a category of structured cwfs.
1.2. Internal language of presheaves. For the rest of the article, we fix a category C in the lowest Grothendieck universe. As in [ABC + 21, OP16, LOPS18], we will use the language of extensional type theory (with subtypes) to describe constructions in the presheaf topos over C.
In the interpretation of this language, a context is a presheaf A over C, a type B over A is a presheaf over the category of elements of A, and an element of B is a section. A global type is a type in the global context, i.e. a presheaf over C. Similarly, a global element of a global type is a section of that presheaf.
For elements x and y of a type A, we have the equality type x = A y, satisfying reflection (we allow ourselves to omit the subscript A if it is evident from the context). Given a dependent type B over a type A, we think of B as a family of types B a indexed by elements a of A. We have the usual dependent sum a:A B a and dependent product a:A B a, with projections of s : a:A B a written s.1 : A and s.2 : B s.1, and application of f : a:A B a to a : A written f a. We have also the categorical pairing f, g : X → a:A B a given f : X → A and g : x:X B (f a) and other commonly used notations. The hierarchy of Grothendieck universes in the ambient set theory gives rise to a cumulative hierarchy U 0 , U 1 , . . . , U ω of universesà la Russell. We model propositions as subtypes of a fixed type 1 with unique element tt. This implies that logically equivalent propositions are equal. We have subuniverses Ω i ⊆ U i of propositions for i ∈ {0, 1 . . . , ω}.
When working in this internal language, we refer to the types as "sets" to avoid ambiguity with the types of (internal) cwfs we will be considering.
1.3. Cubical categories with families. We now work internally to presheaves over C. We assume the following: • an interval I : U 0 with endpoints 0, 1 : I, • an cofibration classifier consisting of F : U 0 with a monomorphism [−] : F → Ω 0 . 5 As in [CHM18,OP16], a partial element of a set T is given by an element ϕ in F and a function [ϕ] → T . We say that a total element v of T extends such a partial element ϕ, u if we have [ϕ] → u tt = v. (Note that the last equation make sense because [ϕ] = tt as soon as [ϕ] is inhabited).
Given A : I → U ω , we write hasFill(A) for the set of operations taking as inputs ϕ in F, b ∈ {0, 1}, and a partial section u in i:I [ϕ] ∨ (i = b) → A i and producing an extension of u to a total section in i:I A i. Given a set X and Y : X → U ω , we write Fill(X, Y ) for the set of filling structures on Y , producing an element of hasFill(Y • x) for x in I → X. Given s in Fill(X, Y ) and x, ϕ, b, u as above, we write s(x, ϕ, b, u) for the resulting total section in i:I Y (x i). 5 The requirement that [−] is mono is not essential and can be relaxed. However, this comes at the cost of making later conditions on F more tedious to state. We now interpret the definitions of Subsection 1.1 in the internal language of the presheaf topos. A cubical cwf is a structured cwf denoted as before that additionally has the following cubical operations and type formers. Again, all specified operations are required to be stable under substitution.
• Filling operation. We have fill in Fill(Type(Γ), λ A Elem(Γ, A)) for Γ in Con. Let us spell out stability under substitution: given A : , and σ in Hom(∆, Γ) and r : Note that we do not include computation rules for fill at type formers. This corresponds to our decision to treat fill as a non-canonical operation.
• Dependent path types. Given A in I → Type(Γ) with a b in Elem(Γ, Ab) for b ∈ {0, 1}, we have Path(A, a 0 , a 1 ) in Type(Γ), of level n if A is. Given u in i:I Elem(Γ, Ai), we have the path abstraction (u) in Elem(Γ, Path(A, u 0, u 1)). Given p in Elem(Γ, Path(A, a 0 , a 1 )) and i in I, we have the path application ap(p, r) in Elem(Γ, Ai). These operations satisfy the laws Thus, every element of Elem(Γ, Path(A, a 0 , a 1 )) is uniquely of the form (u) with u in i:I Elem(Γ, Ai) such that u 0 = a 0 and u 1 = a 1 . Using path types, we define isContr c (A) in Type(Γ) for A in Type(Γ) as well as isEquiv c in Type(Γ.A → B) and Equiv c in Type(Γ) for A, B in Type(Γ) as in [CCHM18]. (We use a subscript here and for some other notions to distinguish them from analogous notions defined later in a different setting in Subsection 2.2.) These notions are used in the following type former, which extends any partially defined equivalence (given total codomain) to a totally defined function. Thus, every element of Elem(Γ, Glue c (A, ϕ, T, e)) is uniquely of the form glue(a, t) with a and t as above.
The notion of morphism of structured cwfs lifts to an evident notion of morphism of cubical cwfs. We obtain, internally to presheaves over C, a category of cubical cwfs. We now lift this category of cubical cwfs from the internal language to the ambient theory by interpreting it in the global context: externally, a cubical cwf (relative to the chosen base category C, interval I, and cofibration classifier F) consists of a presheaf Con over C, a presheaf Type over the category of elements of Con, etc.
Remark 1.1. Fix a cubical cwf as above. Assume that I has a connection algebra structure and that F forms a sublattice of Ω 0 that contains the interval endpoint inclusions. As in [CCHM18], it is then possible in the above context of the glue type former to construct an element of Elem(Γ, isEquiv c [unglue]). From this, one derives an element of Elem(Γ, iUnivalence n ) where iUnivalence n = Π(U n , isContr c (Σ(U n , Equiv c (q, qp)))) for n ≥ 0, i.e. univalence is provable. One may also show that the path type applied to constant families I → Type(Γ) interprets the rules of identity types of Martin-Löf with the computation rule for the eliminator J replaced by a propositional equality. Thus, we obtain an interpretation of univalent type theory with identity types with propositional computation in any cubical cwf.
1.4. Computational cubical categories with families. In this subsection, we consider a variation of the notion of cubical categories with families where we replace the filling operation by a composition operation, and where we add computation rules for this composition operation. This version is the one used for (strict) canonicity in Section 6. The computation rules are needed since the proof of canonicity follows closely the constructive justification of cubical type theory. For this justification, we also have to replace the filling operation by a composition operation. We show then that we can define a filling operation from a composition operation and we define the composition operation on types structurally. Since the canonicity argument, like the one in [Coq19], follows closely the structure of the constructive justification of the model of univalence, we need to start from the composition operation instead. In order to simplify the notations, we assume here that the interval I also has a reversal operation, like in [CCHM18,CHM18]. This assumption is not necessary (for instance, as noted in [CCHM18], and indeed as we did in Subsection 1.3, we can avoid the reverse operation at the cost of carrying around an external boolean parameter) but it simplifies the presentation slightly.
Given A : I → U ω , we write hasComp(A) for the set of operations taking as inputs ϕ in F with a partial section u in i:I [ϕ] ∨ (i = 0) → A i and producing an element in A 1 which is equal to u 1 tt on ϕ. Given a set X and Y : X → U ω , we write Comp(X, Y ) for the set of composition structures on Y , producing an element of hasComp(Y • x) for x in I → X. Given s in Comp(X, Y ) and x, ϕ, u as above, we write s(x, ϕ, u) for the resulting element in Y (x 1).
We now change the definition of cubical cwf in two ways to obtain our notion of computational cubical cwf.
First, we replace the filling operation by a composition operation. We have comp in Comp(Type(Γ), λ A Elem(Γ, A)) for Γ in Con together with stability under substitution: given where A r i = A (i ∧ r) and u r i = u (i ∧ r). Second, we add suitable computation rules (equalities) for this composition operation, structurally over types, following the computation rules in [CCHM18,CHM18]. We give the details here for two representative examples.
• For dependent sums, we add the computation rule • For natural numbers, we add the computation rules

Two examples of cubical cwfs
In this section we give two examples of cubical cwfs: a term model and a particular cubical cwfs formulated in a constructive metatheory, the latter with extra assumptions on I and F.
2.1. Term model. We sketch how to give a cubical cwf T built from syntax, and refer the reader to Appendix A for more details. All our judgments will be indexed by an object X of C and given a judgment Γ X J and f : Y → X in C we get Γf Y J f . Here, f acts on expressions as an implicit substitution, while for substitutions on object variables we will use explicit substitutions.
The forms of judgment are: The main rules are given in the appendix. This then induces a cubical cwf T by taking, say, the presheaf of contexts at stage X to be equivalence classes of Γ for Γ X where the equivalence relation is judgmental equality. Some rules are a priori infinitary, but in some cases (such as the one considered in [CCHM18]) it is possible to present the rules in a finitary way.
This formal system expresses the laws of cubical cwfs in rule form. It defines the term model. Following [Str91,PV07] developed in an intuitionistic framework, we conjecture that this can be interpreted in an arbitrary cubical cwf in the usual way: Conjecture 2.1. With chosen parameters C, I, F, the cubical cwf T is initial in the category of cubical cwfs.
However, our canonicity result is orthogonal to this conjecture: It is a result about the initial model, without need for an explicit description of this model as a term model. 2.2. Developments in presheaves over C. We now assume that I and F satisfy the axioms presented in [OP16,Coq18]. We briefly recall them for the reader's convenience. The subobject F of Ω 0 should define a dominance and be closed under disjunction. The subobject classified by the map [−] : F → Ω 0 should be levelwise decidable. The interval I should have two distinct global elements 0 and 1 and connections. The interval endpoint inclusions should be cofibrations (i.e., the equalities to 0 and 1 are coded by elements of F) and cofibrations should be closed under universal quantification over I. Finally, the interval I should be tiny, i.e., the exponential functor (−) I should have a right adjoint R. 6 This is for example the case if C has finite products and I is representable. Most of the reasoning will be done in the internal language of the presheaf topos. At certain points however, we need to consider the set of global sections of a global type F ; we denote this by F . We stress that statements involving are external, not to be interpreted in the internal language. Crucially, the adjunction (−) I R cannot be made internal [LOPS18].
We write C for the category of presheaves over C. The right adjoint R is determined by an isomorphism natural in A and X. Using cocontinuity in X, we may equivalently restrict to A = y(I) where y denotes the Yoneda embedding and I is in C. Then the isomorphism becomes (RX)(I) C(y(I) I , X) natural in I and X. We may modify the given right adjoint R so that this isomorphism becomes an equality. By our smallness assumptions on C and I, we have that y(I) I lives in the lowest Grothendieck universe in our hierarchy. It follows that R restricts to an operation on U n for n ≥ 0. 7 Pseudofunctorially in a presheaf A, the adjunction (−) I R descends to an adjunction between categories of families over A and A I . We record what we need from this in the rest of our development.
Lemma 2.2. Let A be a global set and B a global family over A I . Then we have a global family B I over A with a bijection of global elements The construction (−) I may be chosen so that: making the following diagram commute: Global sections of (A ) I B • f are dotted maps making the following diagram commute: Under transposition of the adjunction, the two are in bijection, naturally in A .
Recall the equivalence between maps into a presheaf and families over that presheaf. Under this equivalence, we can regard (−) I as a functor from global families over A to global families over A I . The above discussion then shows that (−) I is a right adjoint of (−) I .
Let examine the values of the presheaf B I over the category of elements of A. By Yoneda and the natural bijection we have just verified, B I (I, a) is naturally isomorphic to the set of sections of the restriction of B along a I : y(I) I → A I . By our smallness assumptions on C and I, this is in U n if B is valued in U n (irrespective of the size of A). As in our discussion on size preservation of R, we may modify the definition of (−) I so that the above isomorphism becomes an identity. This validates (1) and (2).
In the above statement, the given bijection may be reduced to the case where f is an identity: The cost to pay is that the isomorphism B I • f (B • f I ) I with appropriate coherence becomes primitive (non-derived) data.
We are going to apply Lemma 2.2 in two different instances. The first instance occurs in the following subsection and is used to build internal universes of fibrant sets, which will be needed to prove homotopy canonicity. The second (and more complex) instance occurs in in Subsection 6.1 and is used for interpreting types in the sconing model in the proof of canonicity.
2.2.1. Fibrant presheaves. Recall the global family hasFill : U I ω → U ω from Subsection 1.3. Applying Lemma 2.2 to hasFill, we obtain global C : U ω → U ω such that naturally in a global set X with global Y : X → U ω , global elements of x:X I hasFill(Y • x) are in bijection with global elements of x:X C(Y x). Given a global set X and global Y : X → U ω , we thus have a logical equivalence (maps back and forth) We record only the logical equivalence instead of an isomorphism so that it will be easier to apply our constructions in situations where the right adjoint R fails to exist such as Appendix D. Naturality is only used at one point below, for the forward map, to construct suitable elements of C applied to glueings. Note that C descends to C : U n → U n for n ≥ 0. We write U fib This is essentially the counit of the adjunction defining C. Note that [LOPS18] use modal extensions of type theory to perform this reasoning internal to presheaves over C.
does not generally exist for a set X and Y : X → U ω as for X = 1 one would derive a filling structure for any "homogeneously fibrant" set, which is impossible (see [OP16, Remark 5.9]). However, from (2.2) we get a map More examples of the interplay between internal and external reasoning involving elements of C(X) will occur in Subsubsection 2.2.2 when we reason that closure of Fill under various type formers, proven internally, transfers to corresponding closure properties of C, proven externally.
2.2.2. Some general constructions. We recall some constructions of [CCHM18,OP16] in the internal language.
• Given A : I → U ω and a b : A b for b ∈ {0, 1}, dependent paths Path A a 0 a 1 are the set of maps p : i:I A i such that p 0 = a 0 and p 1 = a 1 . We use the same notation for non-dependent paths. • For A : U ω , we have a set isContr(A) of witnesses of contractibility, defined using paths.
• Given A, B : U ω with f : A → B, we have the set isEquiv(f ) with elements witnessing that f is an equivalence, defined using contractibility of homotopy fibers. We write and is defined in such a way that These operations are valued in U n if their inputs are. We further recall from [CCHM18,OP16] basic facts about filling structures in the internal language.
• Filling structures are closed under substitution: given f : X → X and Y : X → U ω , any element of Fill(X, Y ) induces an element of Fill(X , Y • f ), naturally in X . • Filling structures are closed under exponentiation: given sets S, X and Y : X → U ω , any element of Fill(X, Y ) induces an element of naturally in S.
• The Glue set former preserves filling structures with equivalences. By this, we mean the following. Let A : Γ → U ω and ϕ : and that e ρ tt is an equivalence for ρ : Γ on [ϕ]. Then we have and the map unglue ρ from the glue set to A ρ is an equivalence for ρ as above. All of the above closure observations satisfy naturality under substitution.
Above, we have recorded closure of Fill under various set formers. From this, we use external reasoning to deduce the corresponding closure properties for C. Specifically, we have that C is closed under Π, Σ, Path, Glue (adding equivalence data in the case of Glue), and that C(A) implies C(A S ) for A, S : U ω . 9 We explain how this works in the example case of Π. As in [CCHM18,OP16,LOPS18], glueing shows Fill(1, U fib n ) for n ≥ 0. Using (2.1), we conclude C(U fib n ). Let N denote the natural number object in presheaves over C, the constant presheaf with value the natural numbers. From [CCHM18,OP16], we have Fill(1, N). Using (2.1), we conclude C(N).
We justify fibrant indexed inductive sets in Appendix B.
9 Note that naturality in S of the latter operation is used in substitutional stability of universes in the sconing in Section 3.

28:14
T. Coquand, S. Huber, and C. Sattler Vol. 18:1 2.3. Standard model. Making the same assumptions on C, I, F as in Subsection 2.2, we can now specify the standard model S of cubical type theory in the sense of the current article as a cubical cwf (with respect to parameters C, I, F) purely using the internal language of the presheaf topos. The cwf is induced by the family over U fib ω given by the first projection as follows.
• The category of contexts is U ω , with Hom(∆, Γ) the functions from ∆ to Γ.
• The types over Γ are maps from Γ to U fib ω ; a type A, p is of level n if A is in Γ → U n . This is clearly functorial in Γ.
• The elements of A, p : Γ → U fib ω are ρ:Γ A ρ. This is clearly functorial in Γ. • The terminal context is given by 1.
• The context extension of Γ by A, p is given by ρ:Γ A ρ, with p, q given by projections and substitution extension given by pairing.
We briefly go through the necessary type formers and operations, omitting evident details. Whenever we mention an induced witness of fibrancy, this refers to the observations recorded in Subsubsection 2.2.2.
• The dependent product of A, c : Γ → U fib ω and B, d : ρ: where e is induced by c and d.
• The universe U n : Γ → U fib n+1 is constantly (U fib n , c) with c : C(U fib n ) as recorded before. According to our definition of the types in S, this universe is actually Russell-style, i.e., the evident isomorphism Type n (Γ) ∼ = Elem(Γ, U n ) is an identity.
• The natural number type N : Γ → U fib 0 is constantly (N, c) with c : C(N) as recorded before. The zero and successor constructors and the eliminator are given by the corresponding features of the natural number object N.
We now turn to the cubical aspects. Before defining glue types, we note that the notions isContr c and isEquiv c in the cubical cwf we are defining correspond to the notions isContr and isEquiv. For example, given a type A : Γ → U fib ω , then the elements of isContr c (A), given by ρ:Γ isContr c (A).1 ρ, are in bijection with ρ:Γ isContr(A.1 ρ) naturally in Γ. where e tt ρ : Equiv(T tt ρ, A ρ) is induced by e tt ρ and q ρ is induced by c ρ and λ x d x ρ and λ x (e tt ρ).2.
We have thus verified the following statement.
Theorem 2.4. Assuming the parameters C, I, F satisfy the assumptions of Subsection 2.2, the standard model S forms a cubical cwf.

Sconing
We make the same assumptions on our parameters C, I, F as in Subsection 2.2. In the global context, let M be a cubical cwf (with respect to these parameters) denoted Con, Hom, . . .  (1, A)). Using the forward direction of (2.1), we thus have an internal operation k : A:Type(1) C (Elem(1, A)).
From now on, we will work in the internal language of presheaves over C. We start by defining a global sections operation |−| mapping contexts, types, and elements of M to those of S. • Given Γ : Con, we define |Γ| : U ω as the set of substitutions Hom(1, Γ). Given a substitution σ : Hom(∆, Γ), we define |σ| : |∆| → |Γ| as |σ|ρ = σρ. This evidently defines a functor. • Given A : Type(Γ), we define |A| : |Γ| → U fib ω as |A| ρ = (Elem(1, Aρ), k (A ρ)). This evidently natural in Γ. If A is of level n, then |A| : |Γ| → U fib n . • Given a : Elem(Γ, A) we define |a| : ρ:Γ (|A| ρ).1 as |a| ρ = aρ. This is evidently natural in Γ. Note that |−| preserves the terminal context and context extension up to canonical isomorphism in the category of contexts. One could thus call |−| an (internal) pseudomorphism cwfs from M to S. The sconing M * will be defined as essentially the Artin glueing along this pseudomorphism, but we will be as explicit as possible and not define Artin glueing at the level of generality of an abstract pseudomorphism.

3.2.3.
Universes. We define the universe U * n : Type * (Γ, Γ ) as U * n = (U n , U n , fib U n ) where U n ρ ρ A = |A| ρ → U fib n and fib U n ρ ρ A is given by C(U fib n ) and closure of C under exponentiation (note that fibrancy of |A| ρ is not used). We have carefully chosen our definitions so that the evident natural isomorphism Elem * ((Γ, Γ ), U * n ) ∼ = Type * n (Γ, Γ ) is an identity if the corresponding isomorphism in Type n (Γ) ∼ = Elem(Γ, U n ) in M is an identity. Thus, Russell-style universes are preserved by our presentation of the sconing model. where Path(A, a 0 , a 1 ) ρ ρ ( (u)) = Path λ i (A i ρ ρ (u i)).1 (a 0 ρ ρ )(a 1 ρ ρ ) and fib Path(A,a 0 ,a 1 ) ρ ρ ( (u)) is closure of C under Path applied to (A i ρ ρ (u i)).2 for i : I.
Given (p, p ) : Elem * ((Γ, Γ ), Path * ( A, A , (a 0 , a 0 ), (a 1 , a 1 ))) and i : I, we define the path application ap * (p, i) = (ap(p, i), λ ρ,ρ u ρ ρ i).   A → B) in M, we write |f | : ρ:|Γ| |A| ρ → |B| ρ for |f | ρ a = app(f ρ, a). This notation overlaps with the action of |−| on elements, but we will not use that one here. Just in this subsection, we will use the alternative definition via given left and right homotopy inverses instead of contractible homotopy fibers of both equivalences Equiv c in the cubical cwf M and equivalences Equiv in the (current) internal language. In both settings, there are maps back and forth to the usual definition, which are furthermore natural in the context in the case of the cubical cwf M. The statements we will prove are then also valid for the usual definition.
For (3.2) → (3.3), we use Lemma 3.1 and note that a fiberwise map over an equivalence is a fiberwise equivalence exactly if it is an equivalence on total spaces (the corresponding statement for identity types instead of paths is [Uni13, Theorem 4.7.7]).
For where fib G ρ ρ (glue(a, t)) is given by closure of C under Glue applied to (A ρ ρ a).2 and T tt ρ ρ (t tt) on [ϕ] and the witness that (e tt ρ ρ ).1 (t tt) is an equivalence provided by the such that app * (fst * (e, e ) tt, (t, t ) tt) = (a, a ) on [ϕ], we define glue * ((a, a ), (t, t )) as the pair (glue(a, t), glue(a, t) ) where 3.3. Main result. One checks in a mechanical fashion that the operations we have defined above satisfy the required laws, including stability under substitution in the context (Γ, Γ ).
We thus obtain the following statement.
Theorem 3.3 (Sconing). Assume the parameters C, I, F satisfy the assumptions of Subsection 2.2. Then given any cubical cwf M that is size-compatible in the sense of the beginning of Section 3, the sconing M * is a cubical cwf with operations defined as above. We further have a morphism M * → M of cubical cwfs given by the first projection.

Homotopy canonicity
We fix parameters C, I, F as before. To make our homotopy canonicity result independent of Conjecture 2.1 concerning initiality of the term model, we phrase it directly using the initial model I, initial in the category of cubical cwfs with respect to the parameters C, I, F. Its existence can be justified generically following [Ste19,PV07]. It is size-compatible in the sense of Section 3: internally, Hom I (∆, Γ) and Elem I (Γ, A) live in the lowest universe U 0 for all Γ, ∆, A.
Theorem 4.1 (Homotopy canonicity). Assume the parameters C, I, F satisfy the assumptions of Subsection 2.2. In the internal language of presheaves over C, given a closed natural n : Elem(1, N) in the initial model I, we have a numeral k : N with p : Elem(1, Path(N, n, S k (0))).
Proof. We start the arguing reasoning externally. Using Theorem 3.3, we build the sconing I * of I. Using initiality, we obtain a section F of the cubical cwf morphism I * → I.
Let us now proceed in the internal language. Recall the construction of Subsubsection 3.2.4 of natural numbers in I * . We observe that n:|N| N n forms a fibrant natural number set (in the sense of Appendix B). It is thus homotopy equivalent to N. Under this equivalence, the first projection n:|N| N n → |N| implements the map sending k : N to S k (0).
Inspecting the action of F on n : Elem(1, N), we obtain n : N n. By the preceding paragraph, this corresponds to k : N with a path p : I → |N| from n to S k (0). Now p = (p ) is the desired witness of homotopy canonicity.  Id(A, a, a)). Given P in Type(Γ.A.Ap.Id(App, qp, q)) and d in Elem(Γ.A, P [q, q, refl(q)]) and x, y in Elem(Γ, A) and p in Elem(Γ, Id(A, x, y)), we have J(P, d, x, y, p) in Elem(Γ, P [x, y, p]). We have We can interpret univalent type theory in any cubical cwf with identity types as per Remark 1.1.
The standard model of Subsection 2.3 has identity type Id( A, fib A , x, y) : Type(Γ) given by ρ:Γ Id A ρ (x ρ) (y ρ) using Andrew Swan's construction of Id referenced in Appendix B. We omit the evident description of the remaining operations.

28:22
T. Coquand, S. Huber, and C. Sattler Vol. 18:1 5.2. Higher inductive types. Our treatment extends to higher inductive types [Uni13], following the semantics presented in [CHM18]. Crucially, we have fibrant indexed higher inductive sets in presheaves over C as we have what we would call fibrant uniformly indexed higher inductive sets in the same fashion as in [CHM18] and fibrant identity sets [CCHM18,OP16], mirroring the derivation of fibrant indexed inductive sets from fibrant uniformly indexed inductive sets and fibrant identity sets recollected in Appendix B. 10 Let us look at the case of the suspension operation in a cubical cwf, where Susp(A) : Type(Γ) has constructors north, south and merid(a, i) for a : A and i : I with merid(a, 0) = north and merid(a, 1) = south.
For the sconing model of Section 3, we define for A : Type(1) and A : |A| → U fib ω the indexed higher inductive set Susp A,A over |Susp(A)| with constructors for a : |a| and a : A a and i : I (using the notation of [CHM18]). In the above translation to a uniformly indexed higher inductive set, the constructor north will for example be replaced by north : with constructors and eliminator treated as in Subsection 5.1.

Canonicity
The goal of this section is to show canonicity for cubical type theory, stating that any closed term of type N is (strictly) equal to a numeral. This is a priori a stronger result than merely homotopy canonicity. However, it requires us to add further computation rules for the filling operation to the theory. For this purpose, we have defined in Subsection 1.4 the notion of computational cubical cwf, modelling a modified version of cubical type theory where the filling operation is replaced by the composition operation (filling is then a derived operation). This is our notion of model in this section. The main point is how to define the right notion of computability structure. Once this is done, we can essentially construct the sconing model as in [Coq19]. If we apply this to the initial computational cubical cwf, we get the canonicity result: any closed natural number term is convertible to a numeral. This result was already proved in [Hub19], but like for the proof in [Coq19], our new argument completely avoids the need to define a reduction relation, which is quite subtle for cubical type theory in [Hub19] since it is not closed under name substitution.
As in Subsection 1.4, we have not just connection structure on the interval, but also a compatible reversal structure. Other than that, we make the same assumptions on the I and F as in Subsection 2.2. Starting from an arbitrary computational cubical cwf M in the 10 We stress that the use of "set" in this context refers to the types of the language of presheaves over C, not homotopy sets. (Recall that |Γ| is Hom(1, Γ) for Γ in Con. In particular, a context in M * is a pair (Γ, Γ ) where Γ is a context in M and Γ : |Γ| → U ω .) In contrast to Section 3, we cannot view the rest of the structure M * as being obtained by glueing along the pseudomorphism |−| : M → S of (computational) cubical cwfs. In particular, we will not make use the standard model S. Rather, M * can be seen as the total space of a fibration that presents a fibred version of the standard model over M. In the definition of types, we need to track computability of the composition operation, expressed using the right adjoint to exponentiation with I to get a fiberwise notion.
For A in Type(1), we write |A| for Elem(1, A). Set Pred n = A:Type(1) |A| → U n . For to be the type of operations c taking as argument ψ in F and a family u i , u i for [ψ] ∨ (i = 0) with u i in A i and u i in A i u i and producing an element c(ψ, u, u ) in A 1 (comp(A, ψ, u)) which is equal to u 1 for ψ = 1. Proof. This follows from Proposition 6.1 by setting T = Predω R. Remark 6.3. Define C(X) for X : U ω as in Subsubsection 2.2.1, but using composition instead of filling. As in Section 3, we have a map k : A:Type(1) C(|A|). In the same fashion as above for R, one may construct C over A:Uω c:C(A) A : A → U ω encoding that the family A has "composition over c". Then R can be defined as the restriction of C along the map induced by k. Under the equivalence between families A : A → U ω over A and A : U ω with a map p : A → A, this corresponds to an element of C(A) such that p forms a composition-preserving morphism of fibrant types, a notion defined (like C and C ) using the adjunction recorded in Lemma 2.2.
The closure properties of R under type formers proved in Subsection 6.2 and Lemma 6.6 below can be proved at the level of C . This has the advantage of eliminating the dependency on the computational cubical cwf M (in the case of natural numbers, the input is instead a natural number algebra in fibrant types). Then the actual sconing construction can proceed without external reasoning as in Section 3.
The sconing of the standard model for computational cwfs (defined as S in Subsection 2.3, but using composition instead of filling) will coincide, externally, with the standard model constructed internally in presheaves over [1] × C (where [1] is the poset with elements 0 < 1) with interval object and cofibration classifier defined by projection to C. We define Type * (Γ, Γ ) to be the set of triples (A, A , e A ) where A is in Type(Γ) and A ρ ρ is in |A ρ| → U ω for ρ in |Γ| and ρ in Γ ρ and e A ρ ρ is in R(Aρ, A ρ ρ ) for ρ and ρ as before.
We define Elem * ((Γ, Γ ), (A, A , e A )) to be the set of pairs (a, a ) where a is in Elem(Γ, A) and a ρ ρ is in A ρ ρ (aρ) for ρ in |Γ| and ρ in Γ ρ.
Since the elements do not make use of the last component of the triple defining a type, the operations involving context extension are defined as in Subsection 3.1. For example, we define (Γ, Γ ).(A, A , e A ) to be (Γ.A, (Γ.A )) where (Γ.A) (ρ, u) is ρ :Γ ρ A ρ ρ u.
6.2. Example of dependent sum types. Before explaining the example of the dependent sum type, we need the following preliminary lemma. It intuitively says that the filling operation is computable if the composition operation is computable. Proof. Given r in I, we define e r in i:I R(A i∧r , A i∧r ) by e r i = e r∧i . Using Proposition 6.2, we can define fill (A, ψ, u, u ) r = c(e r )(ψ, u r , u r ) with u r i x = u (i ∧ r) x and u r i x = u (i ∧ r) x.  A, B) ). Using Proposition 6.1, we are reduced to show the following statement.
Proposition 6.5. There is an element of Proof. We assume a family A i , A i in Pred n and e i A in R(A i , A i ) for i : I. We also have B i : Type n (A i ) and B i in u: Given all this, we want to build (a 1 , b 1 ) : Σ(A 1 , B 1 ) (comp (Σ(A, B), ψ, (a, b))).
By the computation rule for Σ, we have where u = fill(A, ψ, a). Using Lemma 6.4, we have u = fill (A, ψ, a, a ) and we define a 1 = u 1. We next define e B i = e i B (u i) (u i), and using Proposition 6.2, we take b 1 = c(e B )(ψ, b, b ). We can use these results to interpret dependent sum types in the model M * , following essentially the interpretation in [Coq19].
Given Given ρ and ρ we have A 1 = Aρ in Type(1) and A 1 = A ρ ρ in |A 1 | → U ω . We also have B 1 = Bρ + in Type(A 1 ) and B 1 uu = B (ρ, fst(w))(ρ , u ) in u: . We can then define T ρ ρ to be Σ(A 1 , B 1 ) and use (1) to define e T ρ ρ . 6.3. Natural numbers. Let N be the (internal) set of natural numbers (given by the constant presheaf of natural numbers). We have a canonical map quote : N → |N| sending k to S k (0). We define a (non-fibrant) family N over |N| by N (t) = k:N t = |N| quote(k) (using the strict equality on the set |N|). 11 Lemma 6.6. We have an element of R(N, N ).
Proof. Using the adjoint definition of R in Proposition 6.1, we must build c : Red(λ i (N, N )). Exponentiation with I preserves external coproducts since I is tiny. Since N is a countable coproduct of 1, it follows that any function I → N is constant (formally, factors uniquely through I → 1).
Let u i : |N| and u i : N u i for [ψ]∨(i = 0). The latter means k i : N such that u i = quote(k i ) for [ψ] ∨ (i = 0). Using the observation from the previous paragraph, there is unique k : N such that k i = k for [ψ] ∨ (i = 0). From the equations for the composition operation on N in a computational cubical cwf and induction on k, we get that We are forced to set c(ψ, u, u ) = (k, tt).
This provides the interpretation of the type of natural numbers in the model M * . We see here a key difference compared to the sconing model used for proving homotopy canonicity: the computability predicate used in this case is not valued in fibrant sets. Note 11 An isomorphic alternative is to define N as a (non-fibrant) indexed inductive set in the presheaf model, with constructors of type N 0 and N n → N (S n) for n : |N|. Indeed, it is this approach that generalizes to the interpretation of inductive types with parameters. , if we apply this to the initial model, we get that any closed term of type N is "computable", i.e., is strictly equal to a numeral.

Conclusion
We have given proofs of two forms of canonicity for cubical type theory. The first one is homotopy canonicity (every closed term of type N is path equal to a numeral) in a cubical type theory without structural computation rules for the composition operation. The second one is canonicity (every closed term of type N is strictly equal to a numeral) in a cubical type theory with these computation rules. While our arguments rely on an interplay between internal and external reasoning, the main part of the first argument can be seen as happening internally in the model of fibrant sets. The second argument can hopefully be refined to a constructive proof of normalisation. uniformly indexed indicates that A is a fibrant family over I rather than a fibrant set with a "target" map to I that indicates the target sort of the constructor sup. Given A : U ω with Fill(1, A), we may use the technique of Andew Swan [Swa16,OP16] to construct a (level preserving) identity set Id A a 0 a 1 for a 0 , a 1 : A (different from the equality set a 0 = a 1 ) with Fill(A × A, λ (a 0 ,a 1 ) Id A a 0 a 1 )) and constructor refl a : Id A a a for a : A that has the usual elimination with respect to families P : a 0 a 1 :A Id A a 0 a 1 → U ω that satisfy Fill( a 0 a 1 :A Id A a 0 a 1 , P ). Using external reasoning as before, one has C(Id A a 0 a 1 ) given C(A), justifying calling Id A a 0 a 1 a fibrant identity set; using (2.2) one has elimination with respect to families P of the previous signature with C(C a 0 a 1 p) for all a 0 , a 1 , p.
Using a folklore technique, we may use fibrant identity sets to derive fibrant indexed inductive sets from fibrant uniformly indexed inductive sets, by which we mean the following. Fibrant indexed inductive sets are used for the interpretation in the sconing model of natural numbers in Section 3, higher inductive types in Subsection 5.2, and identity types in Subsection 5.1. In practise, we will usually not bother to bring the fibrant indexed inductive set needed into the above form and instead work explicitly with the more usual specification in terms of a list of constructors, each taking a certain number non-recursive and recursive arguments. 13 As an example, we construct the fibrant indexed inductive set N needed in Section 3. There, we have a fibrant set |N| : U 0 (satisfying C(|N|)) with an element 0 : |N| and an endofunction S : |N| → |N|. We wish to define the fibrant indexed inductive set N : |N| → U 0 with constructors 0 : N 0 and S : n:|N| ρ N n → N (S n). We let N be the uniformly indexed inductive set over m : |N| with constructors 0 : Id |N| m 0 → N m, S : n:|N| Id |N| m (S n) → N n → N m. and define 0 = 0 refl 0 and S n n = S n refl S(n) n . Fibrancy of Id ensures fibrancy of N (i.e. C(N n) for n : |N|). For elimination, we are given a fibrant family P n n for n : |N| and n : N n with z : P 0 0 and s n n x : P (S n) (S n n ) for all n, n and x : P n n . We have to define h n n : P n n for all n, n such that h 0 0 = z and h (S n) (S n n ) = s n n (h n n ). We define h by induction on the uniformly indexed inductive set N and fibrant identity sets 13 Note that the latter is really an instance of the former since our dependent sums, dependent products, and finite coproducts are extensional (satisfy universal properties). Conversely, the former is an instance of the latter with a single constructor taking a non-recursive and a recursive argument.
x:X Y x ∆ m / / 9 9 X with left map a horn inclusion and right map the evident projection. Note that the codomains of horn inclusions are representable. It follows that the presheaf of Kan fibration structures indexed over the slice of simplicial sets over U ω is representable. Given [n] ∈ ∆ and A ∈ (U ω ) n (i.e. an ω-small presheaf on ∆/[n]), we define C([n], A) as the set of Kan fibration structures on A : ∆ n → U ω . This defines a level preserving map C : U ω → U ω . Then the representing object of the above presheaf is given by the first projection U fib ω → U ω where U fib ω = X:Uω C(X) is defined as before.
Let us now verify (2.1). Given a simplicial set X with Y : X → U ω , a global element of Fill(X, Y ) corresponds to a uniform Kan fibration structure on x:X (Y x) → X in the sense of [GS17]. A uniform Kan fibration structure induces a Kan fibration structure naturally in X, giving the forward direction of (2.1). For the reverse direction, it suffices to give a uniform Kan fibration structure in the generic case, i.e. a global element of Fill(U fib ω , λ (A,c) A). This is [GS17, Theorem 8.9, part (ii)] together with the fact proved in [GZ67, Chapter IV] that Kan fibrations lift against pushout products of interval endpoint inclusions with (levelwise decidable) monomorphisms. 14 Having verified (2.1), the rest of our development applies just as well to the case of simplicial sets. In particular, we obtain in the standard model S of Subsection 2.3 a version of the simplicial set model [KL12] of univalent type theory (using Subsection 5.1 for identity types). 15 As per Subsection 5.2, we furthermore obtain higher inductive types in the simplicial set model in a way that avoids (as suggested by Andrew Swan [Swa17]) the pitfall of fibrant replacement failing to preserve size encountered in [LS20].
Seeing simplicial sets as a full subtopos of distributive lattice cubical sets as observed in [KV20], there is a functor from cubical cwfs with (C, I, F) = (∆, ∆ 1 , Ω 0,dec ) to cubical cwfs where C is the Lawvere theory of distributive lattices, I is represented by the generic object, and F is the (small) sublattice of Ω 0 generated by distributive lattice equations. The cubical cwfs in the image of this functor satisfy a sheaf condition, which can be represented syntactically as an operation allowing one to e.g. uniquely glue together to a type Γ {i,j} A coherent families of types Γf X A f for f a map to X from the free distributive lattice on symbols {i, j} such that f i ≤ f j or f j ≤ f i (compare also the tope logic of [RS18]).
Applying this functor to the simplicial set model S discussed above, we obtain an interpretation of distributive lattice cubical type theory (with I and F as above) in the sense of the current article (crucially, without computation rules for filling at type formers) in simplicial sets. Thus, this cubical type theory is homotopically sound: can only derive statements which hold for standard homotopy types.