On Church's Thesis in Cubical Assemblies

We show that Church's thesis, the axiom stating that all functions on the naturals are computable, does not hold in the cubical assemblies model of cubical type theory. We show that nevertheless Church's thesis is consistent with univalent type theory by constructing a reflective subuniverse of cubical assemblies where it holds.


Introduction
One of the main branches of constructive mathematics is that of recursive or "Russian" constructivism, where to justify the existence of mathematical objects, one must show how to compute them. A rather extreme interpretation of this philosophy is the axiom of Church's thesis, which states that all functions from N to N are computable. Despite (or perhaps because) of its highly non-classical nature it has been well studied by logicians and turns out to be consistent with a wide variety of formal theories for constructive mathematics. This is usually proved using realizability models based on computable functions, starting with Kleene's model of Heyting arithmetic [Kle45], but with many later variants and generalisations. See for example [TvD88, Chapter 4, Section 4] for a standard reference.
When interpreting Church's thesis in type theory an additional complication is introduced. Logical statements are usually interpreted in type theory using the propositions-as-types interpretation. Applying this to Church's thesis would give us the type below. However it is straightforward to use function extensionality to show that this type is empty. 1 It is therefore impossible in any case to show that the above "untruncated" version of Church's thesis is consistent with univalence, since univalence implies function extensionality [Uni13, Theorem 4.9.4].
To have any hope of showing Church's thesis is consistent with univalence we need a different formulation. We will use the interpretation of logical statements advocated in [Uni13, Section 3.7], and commonly used in homotopy type theory and elsewhere. In this approach one uses the higher inductive type of propositional truncation at disjunction and existential quantifiers, which ensures that the resulting type is always an hproposition (i.e. that any two of its elements are equal). This yields the following version of Church's thesis, which is the one we will study here. It is well known that Church's thesis holds in the internal logic of Hyland's effective topos (see for instance [vO08,Section 3.1] for a standard reference). Similar arguments show that in fact it already holds in its simpler subcategory of assemblies, and even in cubical assemblies, when they are viewed as regular locally cartesian closed categories and thereby, following Awodey and Bauer in [AB04] or Maietti in [Mai05] as models of extensional type theory with propositional truncation. However, the interpretation of cubical type theory in cubical assemblies due to the second author [Uem18] is very different to the interpretation of extensional type theory. We draw attention in particular to the fact that for extensional type theory hpropositions are implemented as maps where in the internal logic each fibre has at most one element. 2 On the other hand in the interpretation of cubical type theory, each fibre can have multiple elements as long as any two elements are joined by a path, telling us to always treat them as "propositionally equal." For propositional truncation we don't strictly identify elements by quotienting, but instead add new paths. Our first result is that Church's thesis is in fact false in the interpretation of cubical type theory in cubical assemblies, even though it holds in the internal logic.
To show Church's thesis is consistent with univalence we will combine cubical assemblies with the work of Rijke, Shulman and Spitters on modalities and Σ-closed reflective subuniverses in [RSS17]. We will construct a reflective subuniverse where Church's thesis is forced to hold, and then use properties of cubical assemblies to show that this reflective subuniverse is non trivial. Our model can also be viewed as a kind of stack model akin to those used by Coquand for various independence and consistency results, including the independence of countable choice from homotopy type theory [Coq18], although our formulation will be quite different to Coquand's.

Models of Type Theories
In this paper we use models of different kinds of type theory: extensional dependent type theory; intensional dependent type theory (with the univalence axiom). All of them are based on the notion of a category with families [Dyb96].
Definition 2.1. Let C be a category. A cwf-structure over C is a pair (T, E) of presheaves T : C op → Set and E : C T op → Set such that, for any object Γ ∈ C and element X ∈ T (Γ), the presheaf is representable. The representing object for this presheaf is denoted by χ(X) : {X} → Γ or χ(X) : Γ.X → Γ. A category with families, cwf in short, is a triple In general a model E of a type theory consists of a category with families (C E , T E , E E ) and algebraic operations on the presheaves T E and E E . An object Γ of C E is called a context. An element X of T E (Γ) is called a type and written Γ ⊢ E X. An element a of E E (Γ, X) is called an element of type X and written Γ ⊢ E a : X. The subscript of ⊢ E is omitted when the model E is clear from the context. An algebraic operation on those presheaves is expressed by the schema In this schema we always assume that the operation A(J 1 , . . . , J n ) is stable under Example 2.2. Let E be a cwf. We say E supports dependent product types if it has operations It is a kind of routine to describe other type constructors such as dependent sum types, extensional and intensional identity types, inductive types, higher inductive types and universes.
For a model E of a type theory, we denote by [[−]] E the interpretation of the type theory in the model E.
Definition 2.3. By a model of univalent type theory we mean a cwf that supports dependent product types, dependent sum type, intensional identity types, unit type, finite coproducts, natural numbers, propositional truncation and a countable chain U 0 : U 1 : U 2 : . . . of univalent universes.

Internal Languages
Formally we will work with models of type theories, but we will construct types and terms of those models in a syntactic way using their internal languages. Let . . ) be a model of a type theory. For a context Γ ∈ C E and a type Γ ⊢ X, we introduce a variable x and write (Γ, x : X) for the context Γ.X. For another type Γ ⊢ Y , the weakening Γ, x : X ⊢ Y is interpreted as the reindexing Γ.X ⊢ Y · χ(X). For an element Γ ⊢ a : X and a type Γ, x : X ⊢ Y (x), the substitution Γ ⊢ Y (a) is interpreted as the reindexing Γ ⊢ Y ·ā, whereā : Γ → Γ.X is the section of Γ.X → Γ corresponding to the element Γ ⊢ a : X. All type and term constructors of the type theory are soundly interpreted in E in a natural way. Note that types and terms built in the internal language are stable under reindexing.

W -types with Reductions
We will later use W -types with reductions to construct higher inductive types. So that we can use them internally in type theory we give below a new, split formulation. This is based on the non-dependent special case of the version in [Swa18].
. . ) be a model of a type theory with dependent product types, dependent sum types and extensional identity types. Suppose that E has types 1 ⊢ F and ϕ : F ⊢ [ϕ] such that ϕ : F, x : [ϕ], y : [ϕ] ⊢ x = y. We call an element of F a cofibrant proposition. We often omit [−] and regard an element ϕ : F itself as a type. A cofibrant polynomial with reductions over a context Γ ∈ C E consists of the following data: • a type Γ ⊢ Y of constructors; • a type Γ, y : Y ⊢ X(y) of arities; • a cofibrant proposition Γ, y : Y ⊢ R(y) : F together with an element Γ, y : Y, r : R(y) ⊢ k(y, r) : X(y) which we refer to as the reductions.
An algebra for a cofibrant polynomial with reductions (Y, X, R, k) over Γ ∈ C E is a type Γ ⊢ W together with an element Γ, y : Y, α : X(y) → W ⊢ s(y, α) : W such that Γ, y : Y, α : X(y) → W, r : R(y) ⊢ s(y, α) = α(k(y, r)). Algebras for (Y, X, R, k) form a category in the obvious way and we say E supports cofibrant W -types with reductions if every cofibrant polynomial with reductions has an initial algebra preserved by reindexing.

Orton-Pitts Construction
Assumption 3.1. Let E be a model of dependent type theory that supports dependent product types, dependent sum types, extensional identity types, unit type, finite colimits, natural numbers, propositional truncation and a countable chain of universes. We further assume that every context Γ ∈ C E is isomorphic to 1.X for some type X over the terminal object 1. Suppose the following: • E has a type 1 ⊢ I equipped with two constants 0 and 1 and two binary operators ⊓ and ⊔; • E has types 1 ⊢ F and ϕ : An element of F is called a cofibrant proposition. We often omit [−] and regard an element ϕ : F itself as a type; • I and F satisfy ax 1 -ax 9 given by Orton and Pitts [OP18]; • F satisfies propositional extensionality: ϕ,ψ:F (ϕ ⇔ ψ) ⇒ (ϕ = ψ); • the exponential functor (−) I : C E → C E has a right adjoint; • E supports cofibrant W -types with reductions.
Note that the axioms in [OP18] are written in the internal language of an elementary topos, but they are easily translated into dependent type theory with I and F as above. We require propositional extensionality which trivially holds when F is a subobject of the subobject classifier of an elementary topos.
Under these assumptions, we will build a model E of univalent type theory as follows: • the base category C E is that of E; • the types Γ ⊢ E X are the types Γ ⊢ E X equipped with a "fibration structure"; • the elements Γ ⊢ E a : X are the elements Γ ⊢ E a : X of the underlying type X in E; By the construction given in [OP18], this model E supports dependent product types, dependent sum types, identity types, unit type, finite coproducts and natural numbers. For a countable chain of univalent universes, use the right adjoint to (−) I as in [LOPS18]. It remains to show that E supports propositional truncation, which will be proved in Section 3.1 using cofibrant W -types with reductions. We call a model of univalent type theory of the form E an Orton-Pitts model.

Higher Inductive Types in Orton-Pitts Models
We are still working with a model E of type theory that satisfies Assumption 3.1. We will show how to construct higher inductive types in E. Our techniques are fairly general, although we will focus on the HITs that we will need for the main theorem. The techniques developed by Coquand Huber and Mörtberg in [CHM18] are already very close to working in arbitrary Orton-Pitts models. The only exception is that the underlying objects for the HITs are given by certain initial algebras, which are constructed directly for cubical sets. This definition doesn't quite work for cubical assemblies for two reasons. Firstly we are using a different cube category, and secondly we are working internally in assemblies. Rather than proving the same results again for cubical assemblies we will use a more general approach based on W -types with reductions that covers both cases. The first author already showed in [Swa18, Section 4] that (non-split) W -types with locally decidable reductions can be constructed in any category of presheaf assemblies and we'll see later how to ensure that we get in fact split W -types with reductions in presheaf assemblies.
Finally, we will also make some minor adjustments related to the fact that we do not assume the interval object has reversals.
When we construct higher inductive types, we will use formulations based on Path types, following Coquand, Huber and Mörtberg. Technically these formulations can only be stated in cubical type theory, and not in intensional type theory in general. However, it is straightforward to derive versions based on Id types using the equivalence of Path and Id types, which are then valid in E. We note that although computation rules hold definitionally for both point and path constructors for the Path type versions, after translating to Id types, the definitional equality only holds for point constructors. However, neither definitional equality will be needed for our end result.
Definition 3.2. Given a type Γ ⊢ E A, we define the local fibrant replacement of A, LFR(A) to be the W -type with reductions defined as follows.
• When a : A, we add an element inc(a) to LFR(A).
Formally, we define the constructors Y to be the coproduct A + (F × 2). We take the arity X(inl(a)) to be the empty type for a : A and X(ϕ, ǫ) to be We take the reductions R(inl(a)) to be ⊥ for a : A and R(ϕ, ǫ) to be ϕ together with the map p : ϕ ⊢ (1−ǫ, p) : i:I ϕ∨(i = ǫ). Proof. Suppose we are given a type Γ ⊢ E X. We first construct the naïve suspension, Susp 0 (X) as the pushout below.
We next take the local fibrant replacement, to get LFR(Susp 0 (X)). This is then an initial Susp(X) algebra, as defined by Coquand, Huber and Mörtberg in [CHM18, Section 2.2] and so we can then proceed with the same proof as they do there.
Theorem 3.4. The model E supports propositional truncation.
Proof. Suppose we are given a type Γ ⊢ E A. We first define the underlying object of A to be the W -type with reductions defined as follows.
• When a : A, we add an element inc(a) to A .
• If x, y : A and i : I, then A contains an element of the form sq(x, y, i).
• If x, y, i are as above and i = 0, then sq(x, y, i) reduces to x.
• If x, y, i are as above and i = 1, then sq(x, y, i) reduces to y.
Formally, we define this by taking the coproduct of two polynomials with reductions. The first is the one we used before for LFR. We now construct a new higher inductive type, which is a simplified version of the higher inductive type J F defined by Rijke, Shulman and Spitters in [RSS17, Section 2.2]. Given families of types Γ ⊢ E A and Γ, a : A ⊢ E B(a) we will construct a higher inductive type K Γ B defined as follows. to Path(ext(a, f ), f (b)).
We require that K B satisfies the following elimination rule. Suppose we are given a family of types Γ, x : K B ⊢ E P (x) together with the terms below.
R : Suppose further that S satisfies the equalities Then we have a choice of term Γ, x : K B ⊢ s(x) : P (x) satisfying the following computation rules for a : A, f : B(a) → K B and b : B(a).
Moreover the choice of term is strictly preserved by reindexing.
We use the techniques developed by Coquand, Huber and Mörtberg together with W -types with reductions for constructing the actual objects. In order to give K Γ B the structure of a fibration we need to define a composition operator. We will do this by freely adding an hcomp operator, and then combining it with a transport operator, which we will explicitly define.
Definition 3.5. Let Γ ⊢ E X be a type. We define the naïve cone, Cone(X) to be the following pushout 3 .
X 1 We can now define K Γ B to be the following W -type with reductions. • When a : A, c : Cone(B(a)) and f : B(a) → K B , we add an element pastecone(a, c, f ) to K B .
• If a, c, f are as above and c is of the form inr(b, 1) for b : B(a), then pastecone(a, c, f ) reduces to f (b).
• When ϕ : F and u : • If p : ϕ and u is as above then hcomp(ϕ, u) reduces to u(1, p).
3 Pushout in the usual categorical sense, not the homotopy pushout.
To check that this really is a W -type with reductions, we need to define the polynomial with reductions. We take it to be the coproduct of the following two polynomials with reductions.
We define the first component of the coproduct as follows. We take the constructors Y to be a:A Cone(B(a)) and the arities X(a, c) to be B(a). We take the reductions R(a, inl( * )) to be ⊥ and R(a, inr(b, i)) to be (i = 1) together with the map R(a, inr(b, i)) ⊢ b : B(a). Note that R : ( a:A Cone(B(a))) → F is well-defined because we have (0 = 1) = ⊥ by propositional extensionality.
The second component in the coproduct is the polynomial with reductions that we used for local fibrant replacement.
Lemma 3.6. We construct a transport operator for Proof. Suppose we are given ϕ : F and a path γ in Γ which is constant on ϕ. We need to define a transport operator, which is a map t : K B(γ(0)) → K B(γ(1)) such that t is the identity when ϕ is true. Formally this map can be defined by giving an appropriate algebra structure on K B(γ(1)) and then using the initiality of K B(γ(0)) . However, for clarity we will present the proof as an argument by higher recursion on the definition of K B(γ(0)) .
We need to show how to define t(pastecone(a, c, f )) and t(hcomp(ψ, u)), and then check that the definition respects the reduction equations. For the latter we define the transport operator so that it preserves the hcomp structure, which determines it uniquely, following [CHM18]. For the former, we recall that Cone(B(a)) was defined as a pushout, and so we can split into a further two cases. Either c is of the form inl( * ), or it is of the form inr(b, i) where b : B(a) and i : I. Now in addition to the reduction equation, we have to also satisfy t(inl( * )) = t(inr(b, 0)) in order to eliminate out of the pushout.
Write t A for the transport A(γ(0)) → A(γ(1)) and t B for the transport a:A(Γ(0)) B(a) → B(t A (a)) ensuring that t A (a) = a and t B (b) = b when ϕ = ⊤, for all a : A(γ(0)) and b : B(a). Write t −1 B for the homotopy inverse a:A(Γ(0)) B(t A (a)) → B(a), again ensuring that t −1 B (b) = b when ϕ = ⊤. Since we are only guaranteed the existence of a homotopy inverse, not a strict inverse, we don't necessarily have t −1 . We can however construct paths p : a:A(Γ(0)) b:B(a) I → B(a) satisfying for all a : A(Γ(0)) and b : B(a) that p(a, b, 0) = t −1 B (t B (b)) and p(a, b, 1) = b. Furthermore, we may assume that for any a, b and i, if ϕ = ⊤ then p(a, b, i) = b.
We define t(pastecone(a, inl( * ), f )) to be of the form pastecone(t A (a), inl( * ), f ′ ), where we still need to define a function f ′ : B(t A (a)) → K B(γ(1)) . Note that we may assume by recursion that for each b : B(a), t(f (b)) has already been defined and belongs to K B(γ(1)) . Hence we can simply define f ′ to be t • f • t −1 B . The obvious first attempt at defining t(pastecone(a, inr(b, i), f )), would be . Note however that this does not satisfy the reduction equations. This is because when i = 1, pastecone(a, inr(b, i), f ) reduces to f (b) and pastecone(t A (a), ))) which is not necessarily strictly equal to t(f (b)). We fix this using the hcomp constructor, following the construction of homotopy pushouts in [CHM18, Section 2.3]. We define ψ : F to be ϕ ∨ (i = 0) ∨ (i = 1). We then define u : j:I (ψ ∨ (j = 0)) → K B(γ(a)) as follows. p(a, b, j))) i = 1 We then define t(pastecone(a, inr(b, i), f )) to be hcomp(ψ, 0, u). The reduction equation for hcomp then ensures that we do satisfy the reduction equation for pastecone and also retain the necessary equations for the pushout and furthermore ensures that the resulting map t : K B(γ(0)) → K B(γ(1)) is a transport operator.
Theorem 3.7. We construct a fibration structure for each K B , which is strictly preserved by reindexing.
Lemma 3.8. We construct terms ext and isext for K B that satisfy the appropriate equations. Proof.
ext ( We need to define a term Γ, x : K B ⊢ s(x) : P (x) satisfying the appropriate equalities. We define s by higher recursion on the construction of K B . We first deal with the case s(pastecone(a, c, f )). Recalling that Cone(B(a)) is defined as a pushout, we can split into the two cases c = inl( * ) and c = inr(b, i) for some b : B(a) and i : I.
We define It is straightforward to check that this does preserve the reduction and pushout equations and so does give a well defined map. One can show it is a section again by higher recursion and the computation rules are satisfied by definition.

Internal Cubical Models
Let S be a model of dependent type theory with dependent product types, dependent sum types, extensional identity types, unit type, finite colimits, Wtypes and a countable chain of universes. We also assume that every context of S is isomorphic to 1.X for some type 1 ⊢ S X. In particular, the category C S is finitely complete so that internal categories in C S make sense. Let denote the internal category in C S in which the objects are the natural numbers and the morphisms from n to m are the order-preserving functions 2 n → 2 m . Note that S has a natural number object since it has W -types. We will refer to internal presheaves over as internal cubical objects.
Theorem 3.10. Under those assumptions, the category of internal cubical objects in S is part of a model of type theory that satisfies Assumption 3.1.
Example 3.11. Let A be a partial combinatory algebra. It is well-known that the category Asm(A) of assemblies on A is part of a model of type theory with dependent product types, dependent sum types, extensional identity types, unit type, finite colimits. It is also known that Asm(A) has W -types (an explicit construction is found in [vdB06, Section 2.2]). Assuming a countable chain of Grothendieck universes in the set theory, Asm(A) has a countable chain of universes. Thus the category CAsm(A) of internal cubical objects in Asm(A) is part of a model of type theory that satisfies Assumption 3.1.
It is shown in [OP18] that, when S = Set, the category of presheaves over satisfies all the axioms of Orton and Pitts if we take F to be the presheaf of locally decidable propositions. The proof works for an arbitrary S and one can show that the category of internal cubical objects in S is part of a model of type theory satisfying Assumption 3.1 except the existence of cofibrant W -types with reductions (see also [Uem18]). To construct cofibrant W -types with reductions, we recall the following from [Swa18].
Theorem 3.12. Let E be a locally cartesian closed category with finite colimits and disjoint coproducts and W -types, and let C be an internal category in E. Then the category P(C) of internal presheaves over C has all locally decidable W -types with reductions.
We furthermore observe that one can show that this construction is stable under pullback up to isomorphism using a technique similar to the one used by Gambino and Hyland for ordinary W -types. The reason is that pointed polynomial endofunctors are stable under pullback because they are constructed from Σ types, Π types and pushouts, all of which are preserved by pullback, and in locally cartesian closed categories the initial algebras of such pointed endofunctors are also stable under pullback. However, to ensure that the construction is strictly preserved requires a little more work.
We show how to use the non split version above to construct split W -types with reductions. The essential idea is to carry out the construction given above "pointwise," expanding out the method suggested by Coquand, Huber and Mörtberg in [CHM18, Section 2.2]. Since we define cubical sets here as a category of presheaves in the usual, contravariant sense, we work with contravariant presheaves here, although the original proof in [Swa18] is phrased in terms of covariant presheaves. We also make minor adjustments to fit with the "split" version appearing in section 2.2.
Suppose that we are given a context Γ ∈ P(C) together with a type Y ∈ P( C Γ), a type X ∈ P( C {Y }), a locally decidable monomorphism R Y and a map k : y:R X(y) over C Γ.
We need to show how to define a strict version of the W -type with reductions W (Y, X, R). We will refer to the new strict version as W ′ (Y, X, R). This should be an element of P( C Γ), so in particular we need to define a family of types W ′ (Y, X, R)(c, γ) indexed by objects c of C and elements γ : Γ(c).
We fix such a c and γ. We first note that we have a a locally decidable polynomial with reductions Y γ , X γ , R γ in the internal presheaf category P( C C(−, c)) given by reindexing along the map C(−, c) → Γ given by Yoneda. We then carry out the "non strict" construction to get a presheaf W (Y γ , X γ , R γ ) on C C(−, c) and finally we define W ′ (Y, X, R)(c, γ) to be W (Y γ , X γ , R γ )(c, 1 c ).
For completeness, we unfold the definitions to obtain the following explicit description of W ′ (Y, X, R)(c, γ). We first define the dependent W -type N 0 of normal forms indexed by the objects (d, f ) of C C(−, c).
If (d, f ) is an object of C C(−, c) we add an element to N 0 (d, f ) of the form sup(y, α) whenever y is an element of Y (d, Γ(f )(γ)) that does not belong to the subobject R(d, Γ(f )(γ)) and α is an element of the following type.
The next step is to define maps N 0 (d, f ) → N 0 (e, f • g) whenever g : e → d and f : d → c in C. Say that we are given an element of N 0 (d, f ) of the form sup(y, α). We recall that N 0 (g)(sup(y, α)) is defined by splitting into cases depending on whether or not y belongs to the subobject R(d, Γ(f )(γ)). If it does, we define N 0 (g)(sup(y, α)) to be α(g, k(y)). Otherwise, we define N 0 (g)(sup(y, α)) to be sup(Y (g)(y), α ′ ) where α ′ (h, x) is defined to be α(g•h, x).
We then define N (d, f ) for each f : d → c to be the subobject of N 0 (d, f ) consisting of hereditarily natural elements and verify that this does indeed define a presheaf on C C(−, c). But this is identical to [Swa18, Section 4] so we omit the details.
If we then define W ′ (Y, X, R)(c, γ) to be N (c, 1 c ), then this is strictly stable under reindexing by definition.
One can construct by recursion an isomorphism between N (d, f ) and W (Y, X, R)(d, Γ(f )(γ)) for each f : d → c. In particular this gives us an isomorphism between N (c, 1 c ) and W (Y, X, R)(c, γ), and so we have a canonical isomorphism between W ′ (Y, X, R)(c, γ) and W (Y, X, R)(c, γ). It follows that we can assign an initial algebra structure to W ′ (Y, X, R)(c, γ) by transferring the algebra structure on W (Y, X, R)(c, γ) via the isomorphism.

Discrete Types
We introduce a class of types in an Orton-Pitts model for future use. Let E be a model of type theory satisfying Assumption 3.1.
Definition 3.13. A type 1 ⊢ X is said to be discrete if the map λx.λi.x : X → X I is an isomorphism.
The proofs of the following propositions are found in [Uem18].
Proposition 3.14. Every discrete type 1 ⊢ X carries a fibration structure.
Proposition 3.15. If a type 1 ⊢ X has decidable equality, then it is discrete.
Corollary 3.16. The natural number object in E is discrete.

Church's Thesis
We consider a dependent type theory with dependent product types, dependent sum types, identity types, unit type, disjoint finite coproducts, propositional truncation and natural numbers. In such a dependent type theory, one can define Kleene's computation predicate T (e, x, z) and result extraction function U (z) as primitive recursive functions T : N × N × N → 2 and U : N → N. The statement T (e, x, z) means that z codes a computation on Turing machine e with input x and U (z) is the output of the computation. Church's Thesis is the following axiom.

Failure of Church's Thesis in Internal Cubical Models
Let S be a model of type theory as in Section 3.2. We have seen that the category P( ) of internal cubical objects in S is part of a model of type theory satisfying Assumption 3.1. In this section we show the following theorem. To prove Theorem 4.1, we recall from [Uem18] the notion of a codiscrete presheaf. The constant presheaf functor ∆ : S → P( ) extends to a morphism of cwf's and preserves (at least up to isomorphism) several type constructors. Here we only need the following.
Proposition 4.2. The morphism ∆ : S → P( ) of cwf 's preserves dependent product types, dependent sum types, extensional identity types and natural number objects.
A constant presheaf ∆X is regarded as a type in P( ) by the following proposition and Proposition 3.14.

Proposition 4.3. Constant presheaves are discrete.
For types 1 ⊢ S X and x : X ⊢ S Y (x), one can define a type x : ∆X ⊢ P( ) ∇ X Y (x) called the codiscrete presheaf which has the following properties.
Then we readily get a function

Null Types
Let E be a model of univalent type theory. Based on Rijke, Shulman and Spitters' null types [RSS17] we define a notion of null structure as follows.
Let a : A ⊢ B(a) be a proposition in E. For a type Γ ⊢ X in E, we define a proposition Γ ⊢ isNull B (X) as Γ ⊢ a:A isEquiv(λ(x : X).λ (b : B(a)).x) and call a term of isNull B (X) a B-null structure on X. A B-null type is a type Γ ⊢ X equipped with a B-null structure n on X. That is, a B-null type has a witness that the canonical map X → X B(a) is an equivalence for each a.
Definition 5.1. We define a cwf E B as follows: • the contexts are those of E; • the types are the B-null types in E; • the elements of Γ ⊢ EB X are those of the underlying type X in E.
We have the obvious forgetful morphism E B → E of cwf's.
For a proposition a : A ⊢ B(a), a nullification operator assigns • each type Γ ⊢ X a B-null type Γ ⊢ L B X and an element Γ ⊢ η X : X → L B X; and • each pair of type Γ ⊢ X and B-null type Γ ⊢ Y an element Γ ⊢ e : isEquiv(λ(f : We also require that a nullification operator is preserved by reindexing. We review some properties of null types. See [RSS17] for further details. Proposition 5.2. Let Γ ⊢ X and Γ, x : X ⊢ Y (x) be types in E.
Consequently, E B supports dependent product, dependent sum and intensional identity types preserved by the morphism E B → E.
For a universe U we define a subuniverse U B of U as Proposition 5.3. The universe U B has a B-null structure.
Proof. Our condition that each B(a) is a proposition corresponds to Rijke, Shulman and Spitters' notion of topological modality. They prove in [RSS17, Corollary 3.11 and Theorem 3.12] that for any such modality the universe of modal types is itself modal.
Proposition 5.4. If a nullification operator L B exists, then it preserves propositions.
Proof. This is true for any modality by [RSS17, Lemma 1.28]. Corollary 5.6. Suppose that E has a nullification operator L B . Then X → L B X gives propositional truncation in the model E B .
Proof. By Proposition 5.4, L B X is a proposition. For any B-null proposition Z, we have equivalences ≃ (X → Z).

Null Types in Orton-Pitts Models
Let E be an Orton-Pitts model.
Definition 5.7. A type a : A ⊢ B(a) in E or E is said to be well-supported if the propositional truncation a : A ⊢ E B(a) taken in the model E of extensional dependent type theory is inhabited.
Proposition 5.8. Let 1 ⊢ E X be a type and a : A ⊢ E B(a) a proposition. If X is discrete and B is well-supported, then X has a B-null structure.
Proof. We show that, for any a : A, the function k a :≡ λx.λb.x : X → (B(a) → X) is an isomorphism in the internal language of E. Since B is well-supported, k a is injective. To prove surjectivity we assume that f : B(a) → X is given. By the well-supportedness of B there exists some element b : B(a). We show that f = k a (f (b)). Assume b ′ : B(a) is given. Since B is a proposition in E we have a path p : I → B(a) such that p0 = b ′ and p1 = b. By the discreteness of X the path f • p : Hence we have f = k a (f (b)) by function extensionality.
We easily deduce the following corollaries.
Corollary 5.9. If B is well-supported, then 0 has a B-null structure.
Corollary 5.10. If B is well-supported, then N has a B-null structure.
Proposition 5.11. Let a : A ⊢ E B(a) be a proposition and Γ ⊢ E X and Γ ⊢ E Y types. Then there exists a term of type Proof. We proceed in the internal language of E. Suppose that X and Y has a B-null structure. Assume that a : A is given. Since the function (X + Y ) → (B(a) → (X + Y )) factors as We know that is a proposition in E, we have a path p : I → B(a) such that p0 = b 0 and p1 = b. Since the exponential functor (−) I preserves colimits because it has a right adjoint, we have (∀ i: . Now f (p0) ∈ X and thus we have ∀ i:I f (pi) ∈ X. In particular, f b ∈ X. In a similar manner, we have By Corollary 3.16, Propositions 5.2, 5.8 and 5.11, for any type X defined in dependent type theory only using dependent product types, dependent sum types, identity types, unit type, disjoint finite coproducts and natural numbers, the interpretation [[X]] E has a B-null structure for any well-supported proposition B in E. In particular, if [[X]] E is inhabited, then so is [[X]] EB for any well-supported proposition B in E.
Example 5.12. Markov's Principle is the following axiom.
For a decidable predicate α : N → 2, the proposition n:N α(n) is equivalent to the type n:N α(n) × k:N α(k) → n ≤ k which is defined without propositional truncation. Hence, if the model E of extensional dependent type theory satisfies Markov's Principle, then so does the model E B of univalent type theory for any well-supported proposition B in E.
We now show how to define nullification operators in Orton-Pitts models. Following Rijke, Shulman and Spitters in [RSS17, Section 2.2] we will first define an operator J B , although we will only consider the case of nullification, since that is all we need here.
Lemma 5.13. For types a : A ⊢ E B(a) and Γ ⊢ E X, we have the higher inductive J B (X) defined as follows.
• When x : X, then J B (X) contains an element α B X (x). Proof. J B (X) differs from K B by having an extra point constructor α B X : X → J B (X).
We define A ′ to be the type A + X and define the family of types a : A ′ ⊢ B ′ (a) as follows. We can then take J B (X) to be K B ′ , as defined in section 3.1. We take α B X (x) to be ext(inr(x), ⊥ KB ) where ⊥ KB is the unique map from 0 to K B .
Theorem 5.14. E has a nullification operator L B for every type a : A ⊢ E B(a).
Proof. This follows from [RSS17, Theorem 2.16], observing that for the case of nullification the pushout appearing there is just a suspension, which we have already shown how to implement in theorem 3.3, and we showed in lemma 5.13 how to implement their J operator.

Church's Thesis in Null Types
Consider a dependent type theory with dependent product types, dependent sum types, identity types, unit type, disjoint finite coproducts, propositional truncation and natural numbers. Let a : A ⊢ B(a) be a type in this type theory where A and B are definable only using dependent product types, dependent sum types, identity type of 2, unit type, finite coproducts and natural numbers. We define a : A ⊢ C(a) := B(a Also note that the equality of natural numbers is decidable, and thus there exists a function = N : N → N → 2 such that the type U (z) = f (x) is equivalent to (U (z) = N f (x)) = 1. Therefore Church's Thesis is equivalent to a type of the form with a type a : A ⊢ B(a) definable only using dependent product types, dependent sum types, identity of 2, unit type, finite coproducts and natural numbers. Since Church's Thesis holds in the category Asm(K 1 ) of assemblies on Kleene's first model K 1 , by Corollary 6.2 the model of univalent type theory E [[C]] E satisfies Church's Thesis where E = CAsm(K 1 ).
We can now prove our second main result, which informally says that univalent type theory is consistent with the main principles of Recursive Constructive Mathematics. Proof. We prove consistency by constructing a model where all of the above holds and where there is no element of type ⊥. Consider the Orton-Pitts model E with E = CAsm(K 1 ). We have seen that E satisfies Church's Thesis in Example 6.3. It remains to show that E satisfies Markov's Principle and ⊥ is empty in this model.
Using well supportness again, and example 5.12 we see that to show Markov's principle holds, it suffices to show it holds in cubical assemblies (as a model of extensional type theory). Again, we observe that the type corresponding to Markov's principle is preserved by the constant presheaves functor, and so it suffices to show that Markov's principle holds in assemblies, which is again a standard argument.
Using well supportness once more, and corollary 5.9 we see that ⊥ is the same in null types as in cubical assemblies. It follows that it has no global sections, i.e. there is no element of type ⊥ in the model.
We can use Theorem 6.1 for other principles.
Example 6.5. Brouwer's Continuity Principle is the following axiom. The standard ordering < on N is decidable, and thus Brouwer's Continuity Principle is an instance of Theorem 6.1.
We obtain a new proof of the following result originally proved by Coquand using cubical stacks [Coq18] 4 . See also [CMR17] for an earlier stack model based on groupoids.
Theorem 6.6. Martin-Löf type theory remains consistent when all of the following extra structure and axioms are added.

Brouwer's Continuity Principle.
Proof. This is the same as for theorem 6.4. See e.g. [vO08, Proposition 3.1.6] for a proof that Brouwer's principle holds in the the effective topos (the same proof applies for assemblies).

Conclusion and Further Work
We have constructed a model of type theory that satisfies the main axiom of homotopy type theory (univalence) and the main axioms of recursive constructive mathematics (Church's thesis and Markov's principle). However, in both fields there are additional axioms that are natural to consider, but which we have left for future work.
With regards to homotopy type theory, we expect that the remaining higher inductive types appearing in [Uni13] can be implemented following the technique suggested in [RSS17, Remark 3.23] together with the technique of [CHM18] for constructing the necessary higher inductive types in cubical assemblies.
The situation with the remaining axioms of recursive constructive mathematics is more difficult. The axiom of countable choice is often included, but it is unclear whether countable choice holds in our model, or how to adjust the model to ensure countable choice does hold. The other main axiom of recursive constructive mathematics is extended Church's thesis, which states that certain partial functions from N to N are computable. The main issue here is that it is unclear what is the most natural way to formulate partial functions in homotopy type theory. Much progress on this has been made by Escardó and Knapp in [EK17]. However, as they show, a weak form of countable choice is needed for their definition to work as expected. We expect that for any reasonable formulation of extended Church's thesis Theorem 6.1 can be used to construct a model where it holds.
Another open problem is to find a good definition of (∞, 1)-effective topos, which should be to the effective topos what (∞, 1)-toposes are to Grothendieck toposes. In particular the effective topos should be recovered as the localisation of the hsets in the (∞, 1)-effective topos, and commonly seen theorems and definitions in the effective topos should be special cases of corresponding higher versions. One possible definition is cubical assemblies. We can now see another possibility in the form of reflective subuniverses of cubical assemblies. However, our definition is dependent on particular a choice of axioms that satisfy the necessary conditions to apply Theorem 6.1, so we leave open the problem of finding a "natural" definition that satisfies axioms such as Church's thesis without needing to ensure they hold in the definition.