Model structure on the universe of all types in interval type theory

Abstract Model categories constitute the major context for doing homotopy theory. More recently, homotopy type theory (HoTT) has been introduced as a context for doing syntactic homotopy theory. In this paper, we show that a slight generalization of HoTT, called interval type theory (⫿TT), allows to define a model structure on the universe of all types, which, through the model interpretation, corresponds to defining a model structure on the category of cubical sets. This work generalizes previous works of Gambino, Garner, and Lumsdaine from the universe of fibrant types to the universe of all types. Our definition of ⫿TT comes from the work of Orton and Pitts to define a syntactic approximation of the internal language of the category of cubical sets. In this paper, we extend the work of Orton and Pitts by introducing the notion of degenerate fibrancy, which allows to define a fibrant replacement, at the heart of the model structure on the universe of all types. All our definitions and propositions have been formalized using the Coq proof assistant.


Introduction
Homotopy type theory (HoTT) can be seen both as a language to formalize mathematics and as a language to do synthetic homotopy theory. Synthetic homotopy theory consists in proving homotopy properties in a syntactic language, here a type theory, which can then be interpreted in several models of homotopy theory (e.g. simplicial sets, cubical sets).
The first model of HoTT has been proposed by Voevodsky using a standard notion in homotopy theory -simplicial sets. This model has later been reworked and polished by Kapulkin and Lumsdaine (2012). In this model, a type is interpreted by a Kan simplicial set 1 and univalent equality is interpreted by paths in those topological spaces.
The simplicial model uses classical logic crucially as it requires to decide whether a map is a degeneracy or not (Bezem et al. 2015). Cubical model, in which a type is interpreted by a Kan cubical set, have been considered to build an intuitionistic model of HoTT. There are several variants of this model, depending on which cube category is chosen: • for cubes without connections, it is called the BCH model (from the initials of its authors) (Bezem et al. 2013(Bezem et al. , 2019 In their works about CCHM, Coquand et al. not only develop a model of HoTT but also an internal language of this model to carry syntactically some constructions of the model. This internal language has been coined cubical type theory. Recently, Orton and Pitts (2018a) have developed a new abstraction layer for the CCHM model. As Martin-Löf type theory can be interpreted in any presheaf category (and even any topos), they identified nine axioms which are valid through the interpretation in the CCHM model and which are enough to carry several constructions of the model (basically, all but the universe of fibrant types) and thus to define cubical type theory internally. So their type theoretic setting can be used to describe the CCHM model.
Orton and Pitts work in the internal language of the presheaf model considered. In this article, we call interval type theory (ITT), Martin-Löf type theory enriched with the constructions introduced by Orton and Pitts. Thus, ITT can be seen as a syntactic subset of the internal language. It is a subset because all its constructions have their interpretation in the model but it is not complete. For instance, we use an intensional type theory while the internal language is extensional.
The simplicial and the cubical models have been settled to describe a notion of equality upto homotopy, satisfying the univalence axiom. But both models allow to interpret a second notion of equality, induced by the equality of the meta-theory. Voevodsky (2013) was the first to propose a type theory where this equality is reflected in the system and called it homotopy type system. In this system, the equality coming from the equality of the meta-theory is called strict, it enjoys uniqueness of identity proof (UIP), by opposition to the univalent equality which satisfies the univalence axiom. To avoid the collapse of those two equalities, and thus the inconsistency of the theory, the property of being fibrant (or Kan) is also reflected at the level of types. The idea is that the univalent equality can only be eliminated over a fibrant predicate, whereas the strict equality can be eliminated over any predicate. Later, Altenkirch et al. gave a more general analysis of a type theory with two equalities and a fibrancy mechanism and called it two-level type theory (Altenkirch et al. 2016;Capriotti 2017). In ITT, the strict equality is primitive and the univalent equality can be defined internally.
The main contribution of this paper is to show internally in ITT that there is a pre-model structure on the universe of all types. Through the interpretation in the model, a direct corollary of this internal construction is that the category of cubical sets is a model category.
A model category is a setting for homotopy theory. It consists of a category equipped with three classes of arrows -fibrations, cofibrations, and weak equivalences -enjoying several properties. In particular, they have to give rise to two ways of factorizing an arbitrary function. Fibrations can be seen as "nice surjections, " cofibrations as "nice injections" and weak equivalence as "homotopy equivalences." Typical examples of model categories are Top, the category of topological spaces, sSet, the category of simplicial sets, and cSet, the category of cubical sets. Model categories are of great importance to compare those different settings in which to formalize homotopy theory, using the notion of Quillen equivalences.
It has already been shown in HoTT that there is a pre-model structure on the universe of fibrant types. The first factorization system (acyclic cofibrations and fibrations, or simply (AC,F)) has been given by Gambino and Garner (2008) using homotopy fibers and the second factorization system (cofibrations and acyclic fibrations or simply (C,AF)) has been given by Lumsdaine (2011) using mapping cylinders. HoTT can be seen as a fibrant fragment of ITT, this result can thus be understood as a pre-model structure on the universe UF of fibrant types. Our work is thus a generalization to the universe U of arbitrary types. UF corresponds to the homotopy category thus its model structure is quite trivial as everything in the universe it already fibrant. To the opposite, U corresponds to the general model category which has a much more complex model structure. In particular, our construction requires the existence of a fibrant replacement, which is not needed in the fibrant case as all types are fibrant.
Note that the notion of fibrant replacement is not admissible with the standard notion of fibrancy provided by a two-level type theory. For instance, it is inconsistent with the existence of types which are not h-sets (Capriotti 2017) or with an interval (Homotopy Type Theory wiki 2014). Thus, another contribution of this paper is to distinguish between two notions of fibrancydegenerate and regular -which allows to define a notion of fibrant replacement compatible with the substitution of type theory.
A description of a model structure on the category of cubical sets has recently been given by Sattler (2017) and it should be interesting to compare its model structure with the one given by the interpretation of our internal model structure in ITT in the cubical sets model.
Plan of the paper. In Sections 2 and 3, we make precise our notion of ITT and redefine a whole part (paths, identity types) of the CCHM model in ITT as there are still few references on the topic. We also introduce a new weaker notion of fibrancy called degenerate fibrancy. In Section 4, we discuss briefly the model of ITT and look at the induced notion of fibrancy in cubical sets through the model interpretation. In Section 5, we construct the fibrant replacement as a quotient inductive type (QIT) in ITT. Section 6 provides the complete definition of a model category. Then, we describe internally in ITT the (AC,F) weak factorization system (Section 7) and two variants of the (C,AF) weak factorization system (Section 9), one which makes use of the notion of mapping cylinders (Section 8), and one which makes us of the notion of partial elements. Finally, we provide a complete description of the model structure on U in ITT (Section 10) and discuss the formalization (Section 11).
Formalization. Following Orton and Pitts approach, all the results of our article have been formalized using an axiomatic presentation of ITT. The formalization as been carried in Coq (while Orton and Pitts used Agda) and can be found in the following repository: https://gitlab.inria.fr/sboulier/thesis-formalizations/blob/emptyctx/InternalCubical-Coq For each subsection, we give a direct link to the corresponding file in the repository.

Interval Type Theory
The kernel of ITT is Martin-Löf type theory with types, types, an impredicative universe of propositions P and a strict equality ≡ modeled using an identity type. Its typing rules are given in Figures 1 and 2. We call the equality strict because it enjoys UIPs. The type of strict equalities live in the universe of propositions P. As a consequence, UIP follows from the more general principle of proof irrelevance. We also suppose that the strict equality enjoys function extensionality and propositional extensionality. The conversion encompasses β reduction for functions, pairs, and equality, and η reduction for functions and pairs. It is written as βη .
The impredicative 2 universe P is closed under types (written ∀), types (written ∃), disjunction ∨, unit type , and empty type ⊥. The complete rules are given in Appendix A. In ITT, we will also consider a universe U, closed under and types. The El operator on those two universes, which turns a proposition or a code A into a type, is written A. We also consider that U contains a unit type 1 and a type of booleans (which will be noted OI in this paper) with their standard introduction and elimination rules.
We use the usual notations: A → B for non-dependent /∀ type; A × B for non-dependent type; A ↔ B for (A → B) × (B → A); P ⇔ Q for its counterpart in P; p # P t for the transport along a strict equality (non-dependent version of J ≡ ). We say that P is a type family over a type A if it is a type in a context ending by A: , x : A P. We will write x : A. P such a family. If P fits in an universe U, it amounts to having a function A → U. To ease the reading, many arguments of functions will be considered as implicit arguments and thus be omitted in the paper, as well as the underlines of the El operator which can be inferred easily. Last, the context , always supposed well formed, is often omitted in the typing rules. An omitted context is written , while an empty context is written ∅ .   In Sections 5 and 8, we will use some QITs. QITs are a generalization of inductive types where equality between elements of the inductive type can be defined at the same time as the definition of its constructors. They are the strict counterpart of higher inductive types (HITs) for a strict equality (i.e. enjoying UIP). HITs and QITs form an active field of research and both their syntax and their semantic are not fully established. We will use an intuitive syntax and will give the introduction and elimination rules for each one. See Coquand et al. (2018) and Cavallo and Harper (2019) for recent developments on HITs and Altenkirch et al. (2018) for QITs.
In this paper, we work in ITT which is a syntactic approximation of the internal language of the CCHM model. It consists of the above-mentioned Martin-Löf type theory enriched with: • an interval I • a universe of cofibrant propositions Cof satisfying nine axioms highlighted by Orton and Pitts (2018a) which we now detail. [Interval.v] The interval I is the first distinguishing feature of ITT. It is a closed type which has two endpoints 0 and 1 and supports min ( ) and max ( ) operations: I is required to satisfy the four axioms given in Figure 3. The axioms ensure that the interval is connected (ax 1 ) that the two endpoints are distinct for strict equality (ax 2 ) and that min and max give a path algebra structure to I (ax 3 and ax 4 ). A path algebra structure is like a bounded lattice but without associativity, commutativity, and absorption law.

Interval
An important difference with the cubical model CCHM is that the interval does not have negation not : I → I. We could add it, restricting slightly the presheaf models in which we can interpret our theory. But here, we stick to Orton and Pitts approach.
A variable typed by the interval is called a dimension and having a dimension i : I in the context corresponds to going one dimension up. An element of a type a : A represents a point: • a A function p : I → A represents a line in A, also called a path, between the two points p 0 and p 1: The constant function λ _ : I. a is the constant path from a to a. It is written idpath a. A two variable function p : I → I → A represents a square in A: For instance, the up left point is p 0 1, the upper side is the line λ i. p i 1, and the upward diagonal is λ i. p i i. Note that it is not possible to represent the other diagonal because there is no negation operation.
As a last example, a function p : I → A is a line between a and b: Then λ i, j. p (i j) is the following square:   [Cof.v] The other important feature of ITT is the universe of cofibrant propositions Cof. It is a subtype of P defined by a predicate cof asserting that a proposition is cofibrant, and it satisfies the axioms of

Cofibrant propositions
We have seen that a function p : I → I → A is a square. Now, a function restricted by this formula: represents the following subsquare: The axioms assert that Cof contains endpoint equality (ax 5 ) is closed under disjunction, dependent conjunction, and universal quantification over I (ax 6 , ax 7 , and ax 8 ).
The last axiom is a strictness axioms asserting that under some conditions, a type can be replaced by a strictly equivalent type satisfying additional strict equalities. By strict equivalence, we mean a type equivalence for the strict equality: Axiom 5 together with propositional extensionality ensures that true and false proposition and ⊥ are cofibrant. For φ and ψ in Cof, we will continue writing φ ∧ ψ for the element of Cof associated with the proposition π 1 (φ) ∧ π 1 (ψ). The same for φ ∨ ψ, i ≡ 0, ⊥, . . . We will also blithely write φ instead of π 1 (φ).
As last requirement on Cof, we suppose that the universe of cofibrant propositions allows to form the join of two partial elements. Given two cofibrant propositions φ, ψ : Cof and two partial elements f and g which agree where there are both defined: the join of f and g is a partial element on φ ∨ ψ : The join cannot be defined by usual disjunction because this would require ∨-elimination to an arbitrary type while it is restricted to P.

Paths and Fibrancy
In the previous section, we have specified what is ITT. We can now describe some basic and fundamental constructions of HoTT directly inside ITT.

Paths [Paths.v]
The first fundamental construction that can be carried over internally in ITT is the notion of paths. A path between two points is a line with these points at its ends. We write a ∼ A b the type of paths between a and b in A. Reflexivity is given by a constant path: Path types are not directly the types by which we will interpret the univalent equality because the transport is not strictly constant on identity paths. Instead, we will use identity types, which are built on top of them (Section 3.4).
The fact that paths are functions has nice consequences. For instance, function extensionality for paths becomes trivial: it is only a change in the order of the arguments of the path seen as a function. If p is a proof of type x : A. fx ∼ B gx, then λ i. λ x : A. p x i is a path between f and g.
In the same spirit, paths enjoy contractibility of singletons. A type is contractible if it is inhabited and if all its elements are path-equal: For every type A and x : A , the type of singletons in x is contractible: The center of contraction is (x, idpath A x) and the path between (x, idpath A x) and (y, p) is given by: [Fibrations.v] Now that we have path types, we want to transport along them. Transport is only valid along fibrant type families so we have to define fibrancy.

Fibrancy
As we said, a partial elements of a type A is an element of A only specified on a restricted face of the current context. We write A the type of partial elements of A: Let a : A be an element of A and (φ, u) be a partial element, we say that a extends (φ, u) if they coincide where u is defined: There is always the empty inhabitant of A: It is the partial element of A which is specified nowhere. Every partial element (φ, f ) of A turns out to be path-equal to this empty inhabitant via the path λ i. (φ ∧ i ≡ 1, f • π 1 ). Hence, the type A is always contractible:

Contr( A)
A type has an extension structure if all its partial elements can be extended: Fibrancy is a weaker condition than having an extension structure where the partial element is required to be specified in at least one endpoint.
To overcome the lack of negation, Orton and Pitts parameterize their definition of fibrancy by the direction in which the extension is done. To do this, we introduce the inductive type OI which has two elements O and I (it is thus a synonym for bool): And we define ι : OI → I, the coercion to the interval, by ι O := 0 and ι I := 1. In the following, we will suppose that this coercion is always implicitly inserted where needed. We will also use the negation ! : OI → OI which is defined by:

It means that every partial element specified at least in i ≡ e can be extended.
This type is not exactly the one proposed by Orton and Pitts but is strictly equivalent. For the sake of completeness, they use Our variant is slightly more compact and will allow to define the fibrant replacement in a simpler way.
Fibrancy is weaker than having an extension structure: In fact, it turns out that a type has an extension structure if and only if it is both fibrant and contractible.

Proposition 1. For any type A we have
It is not a strict equivalence a priori.
Fibrancy generalizes to type families in the following way.

Definition 2.
A type family x : A. P is said to be regularly fibrant 3 if the following type is inhabited: The operation to which fibrancy gives access is called composition. If P is regularly fibrant, then we write And for all w : φ we have that: A type A amounts to be fibrant if and only if the constant family over unit _ : 1. A is regularly fibrant.
For a type family x : A. P, it is not equivalent to be regularly fibrant and that for every x, P is fibrant. The later is weaker than the former. We will say that a type family is degenerately fibrant 4 or pointwise fibrant if we only have the weaker condition:

Remark 2.
A notable exception is the case when P has all its fibers contractible in which case regular fibrancy and uniform fibrancy coincide. Indeed, by Proposition 1, we have But the extension structure on fibers is enough to establish the regular fibrancy , hence we also have For a two variables type family x : A, y : B. P, we will write RFib 2 (x, y. P) if the type family over the sigma x : A. B is regularly fibrant (and so one for three variables families): RFib 2 (x : A, y : B. P) := RFib(z. P x := π 1 (z), y := π 2 (z) ) A useful remark is that regular fibrancy is stable under precomposition: RFib(y. P) → RFib(x. P y := fx ) Orton and Pitts proved the following propositions, which show that the category with families of regularly fibrant families supports several type formers.
See Orton and Pitts' article or the formalization for the proofs.
We also have that the universe of pretypes is fibrant. In fact, it even has an extension structure. This is quite surprising because it means that for all types A and B, there is a path connecting A and B: However, this will not be enough to transport along it and get a map A → B because the type family X : U. X is not regularly fibrant. Proposition 6. The universe has an extension structure, and hence is fibrant: B is given by the strictness axiom taken in A. There are two choices for the B appearing in the axiom: either w : φ. A w or w : φ. A w , both work.
From the composition operation, we can derive a richer operation: Kan filling.
Proposition 7. If x : A. P is regularly fibrant, then we can define an operation: such that for all e, φ, a, and p, fill P agrees with p on φ ∨ i ≡ e and with comp in !e: This is a notable feature of the CCHM model that Kan filling can be defined from composition, it is not the case in BCH for instance. Again, see Orton and Pitts' article or the formalization for the proof. [Paths.v] Now that if we have defined fibrancy, we can at last define transport along a path.

Transport
Proposition 8. Let x : A. P be a regularly fibrant type family, p : a ∼ A b a path between two points of A and u of type P a. Then, u can be transported along p to get an element of type P b : Proof. The transport is given by: modulo rewriting by strict equalities.
Transport together with contractibility of singletons give the dependent elimination for path types (still restricted to regularly fibrant families).
However, paths have a defect: the transport does not compute on reflexivity. For all a : A and u : P a, we have a path: transport(P, idpath A a, u) ∼ P a u but this equality does not hold strictly a priori. Identity types are introduced in the next section to remedy this.
With the transport and the dependent elimination, we can recover all the groupoidal laws satisfied by a univalent equality. First of them are inverse and concatenation: There are some operations which are proven with a transport in HoTT setting but which does not need the fibrancy structure in the cubical setting. They can be defined directly using the cubical definition of paths. For instance: To a path p, the first associates the path λ i. f (p i) and the second the path λ i. (p i) x. It is the same phenomenon that for the definition of function extensionality: as a path type is a richer type than in HoTT, some definitions are simpler. [Id.v] Identity types are a modified version of path types to recover the strict equality for the transport of reflexivity. They were introduced by Swan (2016) and reused in the CCHM model (Cohen et al. 2017). An element of an identity type is a path together with a cofibrant proposition indicating "where the path is refl." We will note x = A y the identity types:

Identity types
Reflexivity is given by the constant path with the proposition "true": Identity types and paths are logically equivalent. From identity types to paths, there is a forgetful map, and in the other direction we use the proposition "false": Note that id2paths sends "refl to refl" (i.e. refl = to idpath), but paths2id does not send idpath to refl = .
Given the extra proposition φ asserting where the path is refl, it is possible to define a dependent eliminator for identity types which computes strictly on refl = :

Models of ITT
The intended model of ITT is the CCHM model, although a wider class of presheaf model can be considered, see Orton and Pitts (2018a). In the presheaf model of dependent type theory, a context is interpreted by a presheaf which is a type parametrized by the objects of a category C . Presheaves are used to model notions, such as "variation over time, " "resource availability" and, in our case, "dimension." The presheaf model support types, types, and universes. See Hofmann (1997) for an account of the presheaf model.
The CCHM model is a presheaf model over a cube category with connections, which will be written . The definition of as well as the interpretation of the interval I and the face lattice F are given in Cohen et al. (2017, Section 8.1).
To interpret ITT, it remains to check that the presheaf model preserves function extensionality, propositional extensionality, proof irrelevance, and QITs. It is true for the three axioms. It should also be the case for QITs but we did not do the formal verification.
Remark. The requirement of having propositional extensionality in the meta-theory is very strong. It seems that the use of this axiom could be avoided by working with the face lattice F of CCHM instead of the cofibrancy predicate cof (the definition of Cof as P : P. cof P has really a set theoretic flavor). We let this for future works.

Degenerate fibrancy
ITT can be viewed as a syntactic subset of the internal language of CCHM, meaning that the syntax of ITT can be used to carry constructions in CCHM. Indeed, in the presheaf model, no interpretation of rule makes the assumption that the premises of the rule are "coming from the syntax." For instance, the interpretation of the formation rule of types can be carried for arbitrary presheaf families A over and B over , A, even if they are not the interpretation of a type of ITT: Hence, for an arbitrary presheaf family A, we can form the presheaf family Fib A by unfolding the definition of the Fib type former. Taking the proposition-as-types point of view, we say that the presheaf family A is fibrant if the presheaf family Fib A has a section. In this paragraph, we compare this induced notion of fibrancy with the one introduced in Coquand  such that for any f : J → I and j # J, (comp(e, I, i, ρ, φ, u, a Now, if we unfold our definition of fibrancy, we get the following. comp(e, I, i, ρ, x, φ, u, p 0 such that for any f : J → I and j # J, (comp(e, I, i, ρ, x, φ, u, p We remark the introduction of a degenerate part (the ρs I ) and a regular part (the x). Thus, we will say that P is regularly fibrant with respect to A and degenerately fibrant with respect to , or simply that P is regularly fibrant when and A are clear.
For a presheaf family, we thus get several notions of fibrancy depending on where we put the limit between the degenerate and the regular part.
• If all the dependency is put in the regular part, we recover the CCHM notion of fibrancy. It corresponds to the fact that, in the empty context, the presheaf ∅ RFib(z : A. P) has a section. We will say that P is fully fibrant.
• If all the dependency is put in the degenerate part, we get something weaker which corresponds to the fact that , A Fib P has a section, or equivalently that Γ DFib(x : A. P) has a section. We will say that P is degenerately fibrant.
In the transport rule: , x : A P p : t ∼ A t H : RFib(x. P) u : P t transport (P, H, p, u) : P t the fibrancy hypothesis is minimal in the sense that only what is needed to interpret the transport is required to be in the regular part.
The notion of regular fibrancy has been generalized to damped horn inclusions by Nuyts (2018). It is called contextual fibrancy there. In particular, Nuyts has shown that there is always a fibrant replacement for contextual fibrancy. We will demonstrate this for our particular case in the coming section.

Fibrant Replacement [FibRepl.v]
The fibrant replacement is an operator turning an arbitrary type A into a fibrant type A satisfying an universal property. Several authors have remarked that the fibrant replacement is not admissible in two-level type theories. For instance, it is inconsistent with the existence of types which are not h-sets (Capriotti 2017) or with an interval (Homotopy Type Theory wiki 2014). Things go nicer in our setting because we use degenerate fibrancy: given a type family x : A. P, we will only get a family x : A. P which is degenerately fibrant, DFib(x. P), and not regularly fibrant, RFib(x. P) (and even less fully fibrant). It turns out that such a degenerate fibrant replacement is admissible. In fact, it can be defined in ITT using a QIT, which is quite remarkable. See Appendix B for the proof that a regular fibrant replacement would be inconsistent.
The fibrant replacement of a type A is the (strict) QIT defined as follows: η is the embedding of A into A, hcomp freely adds the compositions needed so that A is (degenerately) fibrant, and eq assert than hcomp e φ a extends (φ, a !e • inl). For any type A, A is fibrant, but for a type family x : A. P, x : A. P is not regularly fibrant in general.
The two strict equalities are proven by induction on the quotient, using the first elimination principle repl_ind.
Last, we will need the property that any type family P : A → U regularly fibrant can be extended to A preserving regular fibrancy. We call the property the extension rule. Unfortunately, we only know how to prove it in the empty context (the proof relies on the universe of fibrant types). We cannot be certain that it holds in an arbitrary context, but we were not able to derive an inconsistency neither. In the remaining of this paper, we will take care to use it only in an empty context. The propositions only valid in an empty context will be marked by an empty set context symbol "valid in ∅ ctx".
Proposition 11 (extension rule, valid in ∅ ctx). For every type family ∅ P : A → U which is regularly fibrant (RFib P), there exists a type family ∅ P : A → U such that : The proof relies on the existence of a universe of fibrant types UF constructed in Cohen et al. (2017)  Proof. Let P : A → U be a regularly fibrant family in the empty context. Since the context is empty, P is in fact fully fibrant. This fibrancy structure give a map: such that El • P ≡ P. But the universe UF is itself fibrant, hence we have the map:

repl_rec(P ) : A → UF
We take P to be El • repl_rec (P ). By the fibrancy rule of El, this type family is fully fibrant, and hence regularly fibrant.
The extension rule has a very strong consequence, it allows transporting along an equality ηx = ηy to get a map P x → P y if P is regularly fibrant.
Proposition 12. The following operator J = is derivable: Proof. J = is obtained by applying J = to P.
Let us finish this section by remarking that the extension rule is a consequence of Sattler's fibration extension property (Sattler 2017, Corollary 7.7). Indeed, this one gives that for any type family x : A. P and acyclic cofibration f : B → A (still in the empty context), if P • f is regularly fibrant, then so is P.

Model Category
The fibrant replacement is one of the major ingredients to define a pre-model structure on the universe U. This will be done in the next sections, but first, we recall what is a model category. We use here a type theoretic setting, see Hirschhorn (2009), Hovey (2007 which are standard references for a set theoretic account. Defining the right notion of category in HoTT with a relevant equality is quite intricate as several choices can be made to tame higher coherences. There is no such shilly-shallying when a strict equality is used, as already noticed in Altenkirch et al. (2016). In fact, everything takes place exactly as in set theory.
We write C both for the category and the type of its objects, and gf for the composition of arrows g • f .
With this definition, each universe U forms a category where Hom(A, B) is given by A → B. Identity and composition are those of functions and the laws are given by βη conversion. We write Type this category. In the following, we fix C a category.
Definition 5. Let f : Hom(X, Y) and g : Hom(X , Y ) be arrows of C . We say that f is a retract of g if there exists arrows s, r, s , and r such that the following diagram commutes Here and in the rest of the paper, "exists" is understood in the constructive sense, that is, as a sigma type (witnessed existence) and not as a squashed sigma type (mere existence).
By a class of arrows of C , we simply mean a type family X, Y : C , f : Hom(X, Y). P over arrows of C . We write f ∈ P for all function f such that P is inhabited. If Q is another class, we write P ↔ Q if we have X, Y. f : Hom(X, Y). P f ↔ Q f ; and P ∩ Q for the conjunction of the two classes.

Definition 6. A class P of arrows of C satisfies the 2-out-of-3 property if, for all arrows
such that if two of f , g, and g • f belong to P, so does the third. More precisely, it means that we have three functions: Definition 7. Let f : Hom(X, Y) and g : Hom(X , Y ) be arrows of C . It is said that f has the left lifting property (LLP) with respect to g (and that g has the right lifting property (RLP) with respect to f ) if, for all arrows F : Hom(X, X ) and G : Hom(Y, Y ) such that the square below commutes, there exists an arrow γ : Hom(Y, X ) making the two triangles commute We then say that an arrow f has the LLP (resp. the RLP) with respect to a class of arrows P if it has it with respect to all arrows of P. We write LLP(P) (resp. RLP(P)) the class of such arrows.

Definition 8. A weak factorization system on C consists of two classes of arrows L and R such that:
• every arrow f of C can be factorized as f ≡ r • l with l ∈ L and r ∈ R • L is exactly the class of arrows of C which have the LLP with respect to R: • R is exactly the class of arrows of C which have the RLP with respect to L: The classes L and R of a weak factorization system enjoy several good properties: they contain all isomorphisms, they are closed under retract, L is closed under pushouts, R is closed under pullbacks, etc.
We can now define what is model category.
Definition 9. A pre-model structure on C consists of three classes of arrows F, C, and W -the fibrations, the cofibrations, and the weak equivalences -such that: • W satisfies the 2-out-of-3 property • (AC, F) and (C, AF) are two weak factorization systems, where AC := C ∩ W and AF := F ∩ W.

Definition 10. A model category is a category equipped with a pre-model structure which is complete (it has all small limits) and cocomplete (it has all small colimits).
The rest of this article is devoted to showing that there is a pre-model structure on the category Type.

(AC,F) Weak Factorization System
The fibrant replacement allows us to define the first factorization system, given by homotopy fibers, and weak equivalences. Our design choices are guided by the following definition of fibrations.
Definition 11. A function f : A → B is said to be a fibration if there exists a regularly fibrant type family x : X. P such that f is a retract of π 1 : (Σ x : X. P) → X : We write F the class of fibrations. The class of acyclic cofibrations is defined to be LLP(F) for the moment, we will check that it coincides with C ∩ W afterward.
Let us recall that for a map f : A → B, its homotopy fiber in y : B is the type defined by: Then, every function f : A → B factorizes through the fibers of its fibrant replacement: with f := λ x : A. ( fx, η x, refl = (η ( fx))). We add the fibrant replacement so that the type family fiber f is regularly fibrant (and thus fiber f • η also).
Proof. We have to check that: • for all f , π ∈ F and f ∈ LLP(F)

• LLP(F) ↔ LLP(F) • F ↔ RLP(LLP(F))
The only two nontrivial points are that: • for all f , f ∈ LLP(F) • RLP(LLP(F)) ⊆ F We only give the proof of the first one. Many proofs of the following sections are similar, and they all can be found in the formalization.
As the lifting property is stable under retracts, to show that f ∈ LLP(F) we only have to solve the following lifting problem: The map γ is defined as the composition: where β(w, z) := (G w, z). To provide α, we need a map of type: (y : B) (x : A) (p : f x = η y). P x := G (y, x , p) Using the fibrancy rules of and =, we can now do an induction on the fibrant replacement (P is regularly fibrant and B if fibrant). Hence, we need (y : B) (x : A) (p : η ( fx) = η y). P x := G (y, η x, p) Then, using the path induction principle given by the extension rule (Proposition 12), it becomes x : A. P x := G ( fx, η x, refl = ) which is given by F. We see here that the extension rule is crucial to have the lifting. Remark also that identity types are needed to have the commutation of the left triangle that would not hold with path types.

Weak equivalences [Equivalences.v]
To define weak equivalences, we use HoTT equivalences. Let us recall that the predicate of being an equivalence IsEquiv( f ) is defined to be: In Orton and Pitts (2018a), Orton and Pitts use path types to define equivalences. Here, we choose to use identity types because it implies less conversions between paths and identity types in the following. The two types are logically equivalent but we do not know which one is more meaningful.
Unfortunately, this type is never fibrant and hence we take the fibrant replacement: Let us remark that poq is a path and not an inhabitant of an identity type. Hence, if we want to recover an identity type, we have to apply paths2id. In general, the interaction between HIT and identity types remains to be studied. As in the case of the fibrant replacement, we can define the expected elimination principle from the raw elimination principle PO 0 _ind. Note that the transport in poq is a transport along a path.
Proof. The proof goes by induction on the fibrant replacement using repl_ind' (P is regularly fibrant) and then by induction on the quotient with PO 0 _ind. A two-dimensional Kan filler (in P) is needed to complete the case of the poq 0 . See the formalization.

Remark.
For the non-dependent eliminator, we have a strict computational rule on poq: This property is quite remarkable because, in the general case, the pointwise fibrant replacement x. A has no hope to be regularly fibrant. However, it is the case for this particular family x. PO 0 . The secret lies in a decomposition of regular fibrancy into degenerate fibrancy and transport structure. This decomposition was discovered by Coquand et al. (2018). Cavallo and Harper (2019) also use a similar decomposition to give a semantic to wide class of HITs in computational cubical theory.

Definition 13.
A transport structure on a type family x : A. P is an inhabitant of the following type: Proof. See Coquand et al. (2018).
Proposition 17. The fibrant replacement preserves the transport structure: Trans(x. P) → Trans(x. P) Proof. The following argument comes from Cavallo and Orton. 5 This property is true for any endofunctor 6 on types, that is to say, for any operator R on types such that there is an operator: We have seen that such equalities hold for the fibrant replacement.
The transport operation on P gives a map P{x := a e} → P{x := a !e}. By applying F, we get a map R (P{x := a e} ) → R (P{x := a e} ). The fact that F preserves identity maps is enough to show that it actually gives a transport structure on x. RP.
The pushout is degenerately fibrant (because of the fibrant replacement), hence it remains to show that it has a transport structure.
Proposition 18. x. PO 0 has a transport structure.
Proof. See Coquand et al. (2018) or the formalization in Cylinder.v.

Cone
For any type A, the cone of A is the following homotopy pushout: So we define cone A := A A 1. It can also be seen directly as an HIT: The cone satisfies the following elimination principle: w : cone A P H : RFib(w. P) inc : x : A. P{w := inc x} point : P w := point eq : x : A. transport (P, eq x, inc x) ∼ point cone_ind (P, H, inc , point , eq ) : w : cone A. P w The cone enjoys the expected fibrancy rule RFib(x. A) → RFib(x. cone(A x)).

Contr(cone A)
Proof. By induction with cone_ind.

Cylinder
At last, we define the mapping cylinder. Last, as a cylinder is cone, all cylinders Cyl f y are contractible.

(C,AF) Weak Factorization System [Model_structure.v]
We can now describe the second factorization system. Every function f factorizes as: With respect to the factorization that Lumsdaine (2011) gave for the fibrant fragment, the fibrant replacement is added. It is added so that the family y. Cyl f (η y) is regularly fibrant.
The need for the contractibility of cylinders comes from the following characterization of acyclic fibrations. ∅ ctx). A map f : A → B is an acyclic fibration (i.e. both a fibration and a weak equivalence) if and only if there exists a regularly fibrant type family x : X. P with contractible fibers ( x : X. Contr P) such that f is a retract of π 1 : (Σ x : X. P) → X : Proposition 23 (valid in ∅ ctx). ( LLP(AF), AF) is a weak factorization system on U. [Other_facto.v] In Cohen et al. (2017, Section 9.1), the authors propose another factorization as a cofibration followed by an acyclic fibration. This factorization uses partial elements and does not make use of cylinders.

(C,AF) factorization through partial elements
Let f : A → B be a function. Then, it factorizes as: Reusing the definitions of classes F (Definition 11) and C (Proposition 21), we can rederive the Proposition 23.

Proposition 23 . ( LLP(AF), AF) is a weak factorization system on U.
Proof. We can check that: (1) . y. T f y is always a regularly fibrant family (even if A and B are not fibrant) (2) . for all y : B, T f y is contractible (3) . true is a cofibration (i.e. lifts against all acyclic fibrations) The point 2 is an adaptation of the fact that A is always contractible. The point 3 uses the characterization of acyclic fibrations of Remark 2.
The proof of 1 requires dependent conjunction in Cof. Cofibrancy of dependent conjunction follows from axiom ax 7 and proposition extensionality: We let the reader refer to the formalization to have the details of the proofs.
Let us remark that the proof of this proposition does not rely on the extension rule.
As a consequence, if we plug the two weak factorization systems together we have a pre-model structure.

Theorem 25 (valid in ∅ ctx).
There is a pre-model structure on U where: • the weak equivalences are maps f such that IsEquiv f • the fibrations are retracts of π 1 : ( x : X. P) → X with P regularly fibrant • the cofibrations are maps which have the LLP with respect to acyclic fibrations • the (AC,F) factorization of f is done through the homotopy fibers of f • the (C,AF) factorization of f is done through the mapping cylinders of f .
We could also use factorization through partial elements (Section 9.1) for the (C,AF) factorization.
Remark 26 (not formalized). types, types, and strict equality give all small limits and strict quotients give small colimits. Hence, U is a model category.

Externalization
Through the interpretation in the CCHM model, the pre-model structure (defined at the level of ITT, as in Definition 9) on U provides a pre-model structure (defined externally, as in standard homotopy text books) on the category of cubical sets with connections (or any other presheaf model of ITT).
Although we did not formally checked out the details, we conjecture that the pre-model structure on U gives an alternative description of Sattler's model structure on the category (Gambino and Sattler 2015;Sattler 2017) in the sense that the classes F, C, and W are the same.

Characterization of the classes
On the way of proving the previous theorem, we highlighted some characterizations of the four classes F, C, AF, and AC.
The two factorization systems give prototypical examples of maps which are (acyclic) fibrations and (acyclic) cofibrations. We proved that, in fact, all (acyclic) fibrations and (acyclic) cofibrations arise as retracts, in a canonical sense, of such maps. where f is λ x. ( fx, η x, refl = (η ( fx))) and top is λ x. ( fx, top f (η x)). Diagrams are given in Figure 5.  Proof. The forward implication is given by closure of the four classes under retract. The converse implication is the standard retract argument. 7 Gambino and Garner (2008) already gave the characterization of fibrations (in the fibrant case) and call such maps type-theoretic normal isofibration.
Acyclic cofibrations have an even better description. As already noticed by Gambino and Garner, they are the injective equivalences. We generalize their definition to encompass nonfibrant types.

Proposition 28. Let A and B be arbitrary types and f : A → B a map. Then, f is an acyclic cofibration if and only if it is an injective equivalence, that is, if and only if there exists r : B → A and
where strict2id is the map x ≡ y → x = y.
The last condition means that ε( fx) is "identity-equal" to refl = modulo strict equality rewritings.

Formalization
We used the Coq proof assistant (Coq Development Team 2018) to simulate ITT. In this way, we have been able to formalize all the results stated in ITT in this paper except the extension rule. For this purpose, we have used: • The Prop universe for P. Proof irrelevance and propositional extensionality are postulated as axioms. • The equality eq of Coq for the strict equality. It is typed in Prop.
• The usual inductive types of Coq. • QITs are implemented with a private inductive type and an axiom. This is the (slightly hacky) way HITs are for the moment implemented in Coq. • The interval and the universe of cofibrant propositions together with the nine axioms are postulated as Coq axioms. See Appendix C.
The paper and the formalization diverge a bit on the universes: there are à la Tarski in the former while Coq's universes are à la Russell.
The beginning of our formalization is essentially a replay in Coq of Orton and Pitts' Agda formalization (Orton and Pitts 2018b). The formalization in Coq goes pretty well, the only painful thing is to rewrite all strict equalities by hand. The advantage of Coq over Agda is that we can use the rewrite tactic. On the other hand, Orton and Pitts used "rewrite rules" available in Agda to add equalities of the path algebra structure (like "i ∨ 0 ≡ i" . . . ) as definitional equality in Agda. This simplifies the proofs by avoiding some explicit rewritings.
Let us have a quick look at some part of the formalization. The beginning of the definition of the interval is as follows: Fibrations are defined by the following record type: The statement of the main theorem is very short: And the statements of the characterizations of Section 10.2 look like this: See also Figure 6 for an example of term defined using tactics.

Remark.
We kept track of the uses of the extension rule, which is valid only in the empty context, as carefully as possible. The extension rule is postulated as an axiom and every lemma depending on it has been postfixed with __emptyctx. A mechanized check would require a proof assistant supporting a modality, such as Agda-Flat (Licata et al. 2018).
The axioms on which the formalization is relying on can be obtained with the Coq command Print Assumptions. This command crawls recursively the environment and looks for the axioms or admitted lemmas on which a definition is relying. Its output for the Theorem 25 and the four characterizations is given in Appendix C. The first group is the set of assumptions on the equality of the meta-theory (Propext, Proof Irrelevance, and Funext). The second group is the set of axioms used to model ITT. The third group is the set of axioms used to implement strict quotient types ( for the fibrant replacement and homotopy pushouts). The last assumption is the extension rule (Proposition 11) and is only valid in the empty context (see the remark above).

Conclusion and Future Work
ITT, an extension of the internal language developed by Orton and Pitts (2018a), has been used to show internally that there is a pre-model structure on the universe of all types. For this work, we have extended the internal language of Orton and Pitts with a degenerate fibrant replacement, which is definable by a QIT ( for the strict equality). Our results have been formalized in the Coq proof assistant and, as a by product, we provide a formalization of fibrancy of pushouts, as developed by Coquand et al. (2018).
There are several lines for future work. First, the comparison with the pre-model structure (externally) defined by Sattler (2017) remains to be worked out. Our model structure externalizes as a pre-model structure on the category of cubical sets with connections which seems to correspond to Sattler's one, although we have not worked out the details. The extension rule remains to be better understood: is it valid in an non-empty context? Our formalization in Coq does not check that results only valid in the empty context (such as the extension rule) are not used in another context. A possible way to remedy this limitation is to use Andrea Vezzosi's Agda-Flat as in Licata et al. (2018). About weak factorization systems, one may also wonder how the two (C,AF) weak factorization systems that we have presented relate to each other. Then, functoriality or algebraicity of our factorization systems also remains to be investigated. Finally, our work could be generalized to other cube categories using other internal languages, such as in Angiuli et al. (2019).
Let us assume that for any (open) type, there is a fibrant replacement which is fully fibrant and let us derive a contradiction. In particular, for any fibrant family x. P, the family x. P if regularly fibrant: , x : A P

RFib(x : A. P)
Let i. P be the family over the interval given by: The family i. P has been chosen such that P 0 ∼ = ⊥ and P 1 ∼ = . There is := η ( refl ≡ 1) an element of type P 1. Because the family i. P i is regularly fibrant, we can transport along the path between 1 and 0 and get an element of P 0. But there is a map P 0 → ⊥ which is induced by the map P 0 → ⊥ (⊥ is fibrant), hence a contradiction.

Appendix C. Axioms of the Formalization
The following is the (reordered) output of the Coq command Print Assumptions applied to the Theorem 25 and the characterizations of Proposition 27.