Relative induction principles for type theories
IInduction principles for type theories, internally topresheaf categories
Rafaël Bocquet ! (cid:18) Eötvös Loránd University, Budapest, Hungary
Ambrus Kaposi ! (cid:18) Eötvös Loránd University, Budapest, Hungary
Christian Sattler ! (cid:18) Chalmers University of Technology, Sweden
Abstract
We present new induction principles for the syntax of dependent type theories. These inductionprinciples are expressed in the internal language of presheaf categories. This ensures for free thatany construction is stable under substitution. In order to combine the internal languages of multiplepresheaf categories, we use Dependent Right Adjoints and Multimodal Type Theory. Categoricalgluing is used to prove these induction principles, but it not visible in their statements, whichinvolve a notion of model without context extensions. We illustrate the derivation of these inductionprinciples by the example of type theory with a hierarchy of universes closed under function spaceand natural numbers, but we expect that our method can be applied to any syntax with bindings.As example applications of these induction principles, we give short and boilerplate-free proofs ofcanonicity and normalization for our example type theory.
Theory of computation → Type theory
Keywords and phrases induction, metatheory, dependent type theory, internal languages, presheaves,modalities, canonicity, normalization
Funding
Rafaël Bocquet : The author was supported by the European Union, co-financed by theEuropean Social Fund (EFOP-3.6.3-VEKOP-16-2017-00002).
Induction principles
Syntax without bindings or equations is characterized by its universal property as the initialobject of some category of algebras, or equivalently by its induction principle as an inductivetype. The same can be said for syntax with equations, e.g. quotient inductive-inductivetypes. As for syntax with bindings, we can encode it using syntax with equations but withoutbindings by making explicit the contexts and substitutions.While this construction yields induction principles for syntax with bindings, most meta-theoretic results are not direct applications of these induction principles. They often involvea second step, in which the contexts over which the result holds are identified. For example,canonicity only holds in the empty context, whereas normalization holds over every context,but is only stable under renamings. This second step is most of the time handled in anad-hoc manner.Our main contribution is to show how this second step can be handled in a principled wayand to introduce new induction principles for syntactic category with bindings that mergethe two steps into one. More specifically, we give statements and proofs of these inductionprinciples for a small dependent type theory T . We use T to present our constructions; butthey do not rely on any specific feature of that theory. They could be generalized to arbitrarytype theories (for some general definition of type theory, such as Uemura’s definition [25]).We leave the formal generalization to future work. a r X i v : . [ c s . L O ] F e b Induction principles for type theories, internally to presheaf categories
In the general case, we consider a functor F : C → S , where S is the syntax of our theoryand C a category which should satisfy some universal property. We give induction principleswhich directly provide results that are stable over the morphisms of C . Under the hood,these induction principles use the universal properties of both C and S . The input data forthese induction principles consists of a displayed model without context extensions , alongwith some additional data depending on the universal property of C .For example, the following functors would be used to prove various results. {⋄} → T (Canonicity) Ren → T (Normalization) □ → CTT ((Homotopy/Strict) canonicity for cubical type theory) A □ → CTT (Normalization for cubical type theory) ITT → ETT (Conservativity of Extensional Type Theory over Intensional Type Theory) HoTT → (Conservativity of two-level type theory over HoTT)There the initial model of a theory T is denoted by T , T is the main type theory that weconsider in this paper, {⋄} is the terminal category, Ren is the category of renamings of T , □ is the category of cubes, and A □ is the category of cubical atomic contexts of [23].We note some similarity with the worlds of Twelf [19] and with the context schemas ofBeluga [20]. The worlds and context schemas can be seen as descriptions of full subcategoriesspanned by contexts that are generated by a class of context extensions. Our approach ismore general, as we are not restricted to full subcategories.In [10], an argument is made for the use of locally cartesian closed categories insteadof Uemura’s representable map categories in the semantics of type theories. Using locallycartesian closed categories means that contexts can be extended by arbitrary judgments.Indeed, the induction principle that we associate to F : C → S is left unchanged if S isfaithfully embedded into a category with additional context extensions. However it dependson the context extensions of C ; for instance canonicity is provable using {⋄} → T onlybecause {⋄} is not equipped with any way to extend contexts. Thus the general notion ofcontext extension remains important. Higher-order abstract syntax
Higher-order abstract syntax [18] is an encoding of bindings that relies on the bindingstructure of an ambient language. It is closely related to Logical Frameworks [11]. As shownin [12] for the untyped lambda calculus, higher-order abstract syntax can be given semanticsusing presheaf categories.The equivalence of a higher-order presentation of syntax with another presentation isusually called adequacy . Hofmann identified the crucial property justifying the adequacyof the higher-order presentation of untyped or simply-typed syntax: given a representablepresheaf よ A of a category C with products, the presheaf exponential ( よ A ⇒ B ) can becomputed as (cid:12)(cid:12) よ A ⇒ B (cid:12)(cid:12) Γ ≜ | B | Γ × A . This can be generalized to dependently typed syntaxby considering locally representable presheaves.Using the internal language of presheaf categories yields a definition of Categorieswith Families equipped with type-theoretic operations that are automatically stable undersubstitutions. This gives a nice setting to work with a single model of type theory. However,it does not immediately give a way to describe the general semantics of a type theory, sincedifferent models may live over different presheaf categories. We solve this problem by usingMultimodal Type Theory. . Bocquet and A. Kaposi and C. Sattler 3Multimodal Type Theory The action on types of a morphism F : C → D of models can be seen as a naturaltransformation F Ty : Ty C → F ∗ Ty D , where F ∗ : Psh D → Psh C is precomposition by F .The action on terms is harder to describe. As terms are dependent over types, we essentiallyneed to extend F ∗ to dependent presheaves. The correct way to do this is to see F ∗ as adependent right adjoint [5]; it satisfies a universal property that can be axiomatized andyields a modal extension of the internal languages of Psh C and Psh D .The actions of F on types and terms are described in this extended language by: F Ty : ( A : Ty C ) (cid:181) F ∗ → Ty D ,F Tm : { A : Ty C } ( a : Tm C A ) (cid:181) F ∗ → Tm D ( F Ty A b F ∗ ) . where (cid:181) F ∗ and b F ∗ are the elements of the syntax of dependent right adjoints that transitionbetween the presheaf models Psh C and Psh D . Multimodal Type Theory [7] is a furtherextension of this language that can deal with multiple dependent right adjoints at the sametime.Our strategy is to axiomatize just the structure and properties of the models, categoriesand functors that we need, so as to be able to perform most constructions internally toMultimodal Type Theory. We describe our variant of the syntax of a dependent right adjointin Section 3, and of the syntax of Multimodal Type Theory in Appendix B.Other kinds of modalities have been used similar purposes in related work. In [21], theflat modality of crisp type theory is used to characterize the closed terms internally to apresheaf category. In [23], a pair of open and closed modalities correspond respectively to thesyntactic and semantic components of constructions performed internally to a glued topos.One of the advantages of Multimodal Type Theory over other approaches is that additionalmodes and modalities can be added without requiring modification to constructions thatrely on a fixed set of modes and modalities. Categorical gluing
Some of the previous work on the metatheory of type theory has focused on the relationbetween logical relations and categorical gluing. Some general gluing constructions havebeen given [13, 22]. The input of these general gluing constructions is a suitable functor F : C → D , where C is a syntactic model of type theory, and D is a semantic category(for instance a topos, or a model of another type theory with enough structure). Gluingthen provides a new glued model P of the type theory, that combines the syntax of C withsemantic information from D . Canonicity for instance can be proven by gluing along theglobal section functor T → Set . However the known proofs of normalization [24, 6] thatrely on categorical gluing are not immediate consequences of these general constructions.In the present work, we see the constructions of the glued category P and of its type-theoretic structures as fundamentally different constructions. We rely on the same basecategory P ; but we equip it with type-theoretic structure using a different construction, thatdoes not necessarily involve logical relations.As mentioned earlier, the input data for our induction principles are displayed modelswithout context extensions. One of the central results of our work is that any displayed modelwithout context extensions can be replaced by a displayed model with context extensionsover a different base category. In our proof this different base category is the glued category P . However the concrete definition of P does not matter in applications: the only thing Induction principles for type theories, internally to presheaf categories that matters is that P is equipped with a suitable replacement of the input displayed modelwithout context extensions. Contributions
Our main contribution is the statement and proofs of new induction principles over thesyntax of dependent type theory (Section 4), which take into account the fact that the resultsof induction should hold over a category C with a functor into the syntactic category of thetheory. These induction principles are described using the new semantic notions of displayedmodels without context extensions and relative sections.We show that the interpretation of dependent right adjoints and Multimodal Type Theoryin diagrams of presheaf categories gives an internal language that is well-suited to thedefinitions of notions related to the semantics of syntax with bindings, including the notionsof models, morphisms of models, the rest of the 2-categorical structure of models, displayedmodels (both with and without context extensions), sections of displayed models (Sections2–3) We never have to prove explicitly that any construction is stable under substitutions.We reformulate Coquand’s canonicity and normalization proofs [6] using our inductionprinciples (Sections 5–6). We also include details that were omitted in Coquand’s proof (suchas the definition of normal forms), and additionally prove the uniqueness of normal forms. We work in a constructive metatheory, with a cumulative hierarchy (Set i ) of universes.If C is a small category, we write | C | for its set of objects and C ( x → y ) for the set ofmorphisms from x to y . We may write ( x : C ) (or ( x : C op )) instead of ( x : | C | ) to indicatethat the dependence on x is covariant (or contravariant).We write ( f · g ) or ( g ◦ f ) for the composition of f : C ( x → y ) and g : C ( y → z ).We rely on the internal language of presheaf categories. Given a small category C ,the presheaf category Psh C is a model of extensional type theory, with a cumulativehierarchy of universes Psh C ⊂ Psh C ⊂ · · · ⊂ Psh C i ⊂ · · · , dependent functions, dependentsums, quotient inductive-inductive types, extensional equality types, etc. For each ofour definitions, propositions, theorems, etc., we specify whether it should be interpretedexternally or internally to some presheaf category.The Yoneda embedding is written よ : C → Psh C . We denote the restriction of an element x : | X | Γ of a presheaf X along a morphism ρ : C (∆ → Γ) by x [ ρ ] X : | X | ∆ .We use curly braces to indicate implicit arguments. If f : { a : A } ( b : B ( a )) → C ( a, b ), wemay omit the argument a of f . We write f a b or f { a } b when we still want to specify animplicit argument. The notion of locally representable presheaf is the semantic counterpart of the notion ofcontext extension. ▶ Definition 1 (Externally) . Let X be a presheaf over a category C and Y be a dependentpresheaf over X . We say that Y is locally representable if, for every Γ : | C | and x : | X | Γ ,the presheaf Y | x : { ∆ : C op } ( ρ : C (∆ → Γ)) → Set (cid:12)(cid:12) Y | x (cid:12)(cid:12) ( ρ : C (∆ → Γ)) ≜ | Y | ∆ x [ ρ ] . Bocquet and A. Kaposi and C. Sattler 5 over the slice category ( C / Γ) is representable.In that case, we have, for every Γ and x , an extended context (Γ ▷ Y | x ) , a projectionmap p Yx : (Γ ▷ Y | x ) → Γ and a generic element q Yx : (cid:12)(cid:12) Y | x (cid:12)(cid:12) p Yx such that for every σ : ∆ → Γ and y : (cid:12)(cid:12) Y | x (cid:12)(cid:12) σ , there is a unique extended morphism ⟨ σ, y ⟩ : ∆ → (Γ ▷ Y | x ) such that ⟨ σ, y ⟩ · p Yx = σ and q Yx [ ⟨ σ, y ⟩ ] = y . ⌟ Up to the correspondence between dependent presheaves and their total maps, locallyrepresentable dependent presheaves are also known as representable natural transformations .We read this definition in a structured manner, with a local representability structureconsisting of a choice of representing objects in the above definition. The notion of localrepresentability is local : the restriction map from local representability structures for adependent presheaf Y over X to coherent families of local representability structures of Y | x over よ Γ for x : | X | Γ is invertible. Assume that C is an i -small category. Internally to Psh C there is then, for every universelevel j , a family isRep : Psh C j → Psh C max( i,j ) of local representability structures over j -smallpresheaf families. Due to the above locality property, we have for a dependent presheaf Y over X that elements of X ⊢ isRep( Y ) correspond to witnesses that Y is locally representable over X . This leads to universes RepPsh C j ≜ ( A : Psh C j ) × isRep A of j -small locally representablepresheaf families. As an internal category, it is equivalent to the j -small one that that atΓ : | C | consists of an element of the slice of C over Γ together with a choice of base changesalong any map C (∆ → Γ).An alternative semantic for the presheaf ( y : Y ) → Z y of dependent natural trans-formations from Y to Z can be given when Y is locally representable over X : Psh C . Wecould define | ( y : Y ) → Z y | Γ x ≜ | Z | Γ ▷ Y | x ( x [ p Yx ] , q Yx ). This definition satisfies the universalproperty of the presheaf of dependent natural transformations from Y to Z , and is thereforeisomorphic to its usual definition. The alternative definition admits a generalized algebraicpresentation, which is important to justify the existence of initial models. We now define the models of a small dependent type theory T with a cumulative hierarchyof universes, cumulative Π-types and a natural number type. ▶ Definition 2 (Externally) . A cumulative CwF with universes consists of a category C equipped a terminal object and the following global elements of the presheaf model Psh C : Ty C : { i : N } → Psh C Tm C : { i : N } → Ty C i → RepPsh C Lift n : { i : N } → Ty C i → Ty C i +1 U : ( i : N ) → Ty C i +1 along with families of isomorphisms lift i : Tm C i +1 ( Lift i A ) ≃ Tm C i A and El i : Tm C i +1 U i ≃ Ty C i that we may leave implicit. When ( i ≤ j ) , we have a composite operation Lift ji : Ty C i → Ty C j . ⌟ This definition of universes implies that every type belongs to some universe. Locality also holds if we consider local representability as a property.
Induction principles for type theories, internally to presheaf categories ▶ Definition 3 (Internally to
Psh C ) . A Π -type structure over a cumulative CwF withuniverses consists of global elements Π : { i } ( A : Ty C i )( B : Tm C A → Ty C i ) → Ty C i app : { i, A, B } ( f : Tm C (Π A B ))( a : Tm C A ) → Tm C ( B a ) lam : { i, A, B } ( b : ( a : Tm C A ) → Tm C ( B a )) → Tm C (Π A B ) satisfying the β -rule app ( lam b ) a = b a , the η -rule lam ( λ a app f a ) = f and thecumulativity rules Lift i (Π A B ) = Π (
Lift i A ) ( λ a Lift i ( B ( lift − a ))) , lift i ( app f a ) = app ( lift i f ) ( lift i a ) and lift i ( lam b ) = lam ( lift i ◦ b ) . ▶ Definition 4 (Internally to
Psh C ) . A natural number type structure over a cumulativeCwF with universes consists of global elements N : Ty C zero : Tm C N suc : Tm C N → Tm C N elim N : { i } ( P : Tm C N → Ty C i )( z : Tm C ( P zero ))( s : ( n : Tm C N )( n ′ : Tm C ( P n )) → Tm C ( P ( suc n ))) → ( n : Tm C N ) → Tm C ( P n ) satisfying the computation rules elim N P s z zero = z and elim N P s z ( suc n ) = s n ( elim N P s z n ) . A model of T is a cumulative CwF equipped with cumulative universes, Π-types and anatural number type.A sort of a model of T is a presheaf of the form Ty C or Tm C − . The derived sorts areobtained by closing the sorts under dependent products with arities of the form Tm C − . Thetype of an argument of a type-theoretic operation or equation is always a derived sort. Wewill often define objects or perform constructions for every sort or derived sort. We oftenomit dependencies when writing derived sorts; e.g. we write [ Tm , Tm ] Tm for the derived sortof the argument s of elim N . In this section, we review the syntax and semantics of dependent right adjoints (DRAs) [5],and use the syntax of the dependent right adjoint ( F ! ⊣ F ∗ ) to give an internal encoding ofthe notion of morphism of models of T . Multimodal Type Theory is only needed for someof the proofs and constructions performed in the appendix. Fix a functor F : C → D . The precomposition functor F ∗ : Psh D → Psh C has both a leftadjoint F ! : Psh C → Psh D and a right adjoint F ∗ : Psh C → Psh D . The functors F ∗ and F ∗ are not only right adjoints of F ! and F ∗ , they are dependent right adjoints, which meansthat they admit actions on the types and terms of the presheaf models Psh C and Psh D that interact with the left adjoints. We distinguish the functor F ∗ from the dependent rightadjoint F ∗ by using different colors. The dependent adjunction ( F ∗ ⊣ F ∗ ) is constructedin [7, Lemma 8.2], whereas ( F ! ⊣ F ∗ ) is constructed in [9, Lemma 2.1.4]. We recall theirconstructions in Appendix A. . Bocquet and A. Kaposi and C. Sattler 7 We focus on the description of the dependent right adjoint F ∗ as a syntactic and type-theoretic operation. For every presheaf X : Psh C and dependent presheaf A over F ! X , wehave a dependent presheaf F ∗ A over X , such that elements of A over F ! X are in naturalbijection with elements of F ∗ A over X .This is analogous to the definition of Π-types: given a presheaf X : Psh C , a dependentpresheaf Y ( x ) over the ( x : X ) and a dependent presheaf Z ( x, y ) over ( x : X, y : Y ( x )), theΠ-type ( y : Y ( x )) → Z ( x, y ) over ( x : X ) is characterized by the fact that its elements are innatural bijection with the elements of Z ( x, y ) over ( x : X, y : Y ( x )).Following this intuition, we use a similar syntax for Π-types and modalities. We view theleft adjoint F ! as an operation on the contexts of the presheaf model Psh C . If ( x : X ) is acontext of this presheaf model, we write ( x : X, (cid:181) F ∗ ) instead of F ! X . Given a dependentpresheaf Y ( x, b F ∗ ) over ( x : X, (cid:181) F ∗ ), we write ( (cid:181) F ∗ → Y ( x, b F ∗ )) instead of F ∗ Y .We write the components of the bijection between elements of Y ( x, b F ∗ ) over ( x : X, (cid:181) F ! )and elements of ( (cid:181) F ∗ → Y ( x, b F ∗ )) over ( x : X ) similarly to applications and λ -abstractions.If y ( x, b F ∗ ) is an element of Y ( x, b F ∗ ) over ( x : X, (cid:181) F ∗ ), we write ( λ (cid:181) F ∗ y ( x, b F ∗ ))for the corresponding element of ( (cid:181) F ∗ → Y ( x, b F ∗ )). Conversely, given an element f ( x )of ( (cid:181) F ∗ → Y ( x, b F ∗ )) over ( x : X ), we write f ( x ) b F ∗ for the corresponding elementof Y ( x, b F ∗ ). There is a β -rule ( λ (cid:181) F ∗ y ( x, b F ∗ )) b F ∗ = y ( x, b F ∗ ) and an η -rule( λ (cid:181) F ∗ f ( x ) b F ∗ ) = f ( x ).We may define elements of modal types by pattern matching. For instance, we maywrite f ( x ) b F ∗ ≜ y ( x, b F ∗ ) to define f ( x ) as the unique element satisfying the equation f ( x ) b F ∗ = y ( x, b F ∗ ), that is f ( x ) ≜ λ (cid:181) F ∗ y ( x, b F ∗ ).The operation ( (cid:181) F ∗ → − ) is a modality that enables interactions between the two presheafmodels Psh C and Psh D . The symbols (cid:181) F ∗ and b F ∗ and their places in the terms have beenchosen to make keeping track of the modes of subterms as easy as possible. For both symbols (cid:181) F ∗ and b F ∗ , the part of the term that is left of the symbol is at mode Psh C , while the partthat is right of the symbol is at mode Psh D . The type formers ( (cid:181) F ∗ → − ) and the termformer ( λ (cid:181) F ∗
7→ − ) go from the mode
Psh D to Psh C , whereas the term former ( − b F ∗ )goes from the mode Psh C to the mode Psh D . As a first demonstration of the syntax of modalities, we equip the modality ( (cid:181) F ∗ → − )with the structure of an applicative functor [16], defined analogously to the reader monad ( A → − ). This structure is given by an operation(_ ⊛ _) : { A, B } ( f : (cid:181) F ∗ → ( a : A b F ∗ ) → B b F ∗ a )( a : (cid:181) F ∗ → A b F ∗ ) → ( (cid:181) F ∗ → B b F ∗ ( a b F ∗ )) f ⊛ a ≜ λ (cid:181) F ∗ ( f b F ∗ ) ( a b F ∗ )This provides a concise notation to apply functions under the modality. If f is an n -aryfunction under the modality, and a , . . . , a n are arguments under the modality, we can writethe application f ⊛ a ⊛ · · · ⊛ a n instead of ( λ (cid:181) F ∗ ( f b F ∗ ) ( a b F ∗ ) · · · ( a n b F ∗ )).When f is a global function of the presheaf model Psh D , we write f $ a ⊛ · · · ⊛ a n insteadof ( λ (cid:181) F ∗ f ) ⊛ a ⊛ . . . ⊛ a n . If f has implicit arguments, we may write f $ { a } ⊛ { a } ⊛ · · · to specify them under the modality. Here the notation Y ( x, b F ∗ ) is an informal way to keep track of the fact that Y is dependent over thecontext ( x : X, (cid:181) F ∗ ). Induction principles for type theories, internally to presheaf categories
The last component that we need to give an internal definition of morphism of models of T isa way to describe internally the preservation of the extended contexts of locally representablepresheaves. The preservation of context extensions can be expressed without assuming thatthe extended contexts actually exist, i.e. without assuming that the presheaves are locallyrepresentable; in that case we talk about preservation of virtual context extensions. ▶ Definition 5 (Internally to
Psh C ) . Let A C : Psh C and A D : (cid:181) F ∗ → Psh D be presheavesover C and D , and F A : ( a : A C ) (cid:181) F ∗ → A D b F ∗ be an action of F on the elements of A C .We say that F A preserves virtual context extensions if for every dependent presheaf P : (cid:181) F ∗ ( a : A D b F ∗ ) → Psh D , the canonical comparison map τ : ( (cid:181) F ∗ ( a : A D b F ∗ ) → P b F ∗ a ) → (( a : A C ) (cid:181) F ∗ → P b F ∗ ( F A a b F ∗ )) τ p ≜ λ a (cid:181) F ∗ p b F ∗ ( F A a b F ∗ ) is an isomorphism. In other words, F A preserves virtual context extensions when the modality ( (cid:181) F ∗ → − ) commutes with quantification over A C and A D .This provides a notation to define an element p of ( (cid:181) F ∗ ( a : A D b F ∗ ) → P b F ∗ a ) usingpattern matching: we write p b F ∗ ( F A a b F ∗ ) ≜ q ( a, b F ∗ ) to define p as the unique solution of that equation ( p = τ − ( λ a (cid:181) F ∗ q ( a, b F ∗ )) ). ⌟ In Appendix C.1 we show that the internal description of preservation of context extensionscoincides with the external notion of preservation up to isomorphism.
We can finally give an internal definition of morphism of models of T . ▶ Definition 6.
The structure of a morphism of models of T over a functor F : C → D between two models consists of the following global elements, specified internally to Psh C :Actions on types and terms F Ty : { i } ( A : Ty C i ) (cid:181) F ∗ → Ty D i F Tm : { i }{ A : Ty C i } ( a : Tm C A ) (cid:181) F ∗ → Tm D ( F Ty A b F ∗ ) such that F Tm preserves context extensions.Given presheaves X C and X D and an action F X : ( x : X C ) (cid:181) F ∗ → X D b F ∗ that preservesvirtual context extensions, we use the pattern matching notation from Definition 5 todefine derived actions F [ X ] Ty : { i } ( A : ( x : X C ) → Ty C i ) (cid:181) F ∗ → ( x : X D b F ∗ ) → Ty D i F [ X ] Ty A b F ∗ ( F X x b F ∗ ) ≜ F Ty ( A x ) b F ∗ F [ X ] Tm : { i }{ A : ( x : X C ) → Ty C i } ( a : ( x : X C ) → Tm C ( A x )) (cid:181) F ∗ → ( x : X D ) → Tm D ( F [ X ] Ty A b F ∗ x ) F [ X ] Tm a b F ∗ ( F X x b F ∗ ) ≜ F Tm ( a x ) b F ∗ In particular F has an action F [ Tm ] Ty on dependent types, an action F [ Tm ] Tm on dependentterms, and more generally actions on any derived sort of the theory. . Bocquet and A. Kaposi and C. Sattler 9 All of the operations of the theory T should be preserved by F Ty and F Tm . This can beexpressed uniformly using the actions of F on derived sorts and the applicative functorstructure of ( (cid:181) F ∗ → − ) . F Ty ( Lift A ) = Lift $ F Ty AF Tm ( lift a ) = lift $ F Tm aF Ty U C i = ( λ (cid:181) F ∗ U D i ) F Ty ( El C A ) = El D $ F Tm AF Ty N C = ( λ (cid:181) F ∗ N D ) F Tm zero C = ( λ (cid:181) F ∗ zero D ) F Tm ( suc C n ) = suc D $ F Tm nF Tm ( elim C N P z s n ) = elim D N $ F [ Tm ] Ty P ⊛ F Tm z ⊛ F [ Tm , Tm ] Tm s ⊛ F Tm nF Ty (Π C A B ) = Π D $ F Ty A ⊛ F [ Tm ] Ty BF Ty ( lam C b ) = lam D $ F [ Tm ] Tm bF Ty ( app C f a ) = app D $ F Tm f ⊛ F Tm a Computation rules for F [ X ] Ty and F [ X ] Tm can then be derived. For instance, F [ X ] Ty ( λx Π (
A x ) (
B x ))= λ (cid:181) F ∗ x Π D ( F [ X ] Ty A b F ∗ x ) ( a F [ X, Tm ] Ty B b F ∗ ( x, a )) . This equation can be derived from the computation rule of F Ty and the fact that both F X and F Tm preserve virtual context extensions.We can also derive strengthening rules. For example, when A does not depend on x , F [ X ] Ty ( λ x A ) = λ (cid:181) F ∗ x F Ty A b F ∗ . More generally, F [ X ] Ty and F [ X ] Tm are natural in X . ⌟ This extends to a 2-category
Mod T of models of T . A 2-cell of Mod T between twoparallel morphisms F, G : C → D is just a natural transformation α : F ⇒ G . Thecomposition ( F · G ) : C → E of two morphisms F : C → D and G : D → E can be definedinternally to Psh C using Multimodal Type Theory.The theory T admits a biinitial model T . We denote the components of T by Ty , Tm , . . . , instead of Ty T , Tm T , . . . In this section we introduce the notion of displayed model without context extensions anduse it to state our induction principles. Their proofs are given in the appendix.We fix a base model S of T and a functor F : C → S . ▶ Definition 7. A displayed model without context extensions over F : C → S consistsof the following components, specified internally to Psh C :Presheaves of displayed types and terms. Ty • : { i } ( A : (cid:181) F ∗ → Ty S i ) → Psh C Tm • : { i, A }{ A • : Ty • i A } ( a : (cid:181) F ∗ → Tm S ( A b F ∗ )) → Psh C They correspond to the motives of an induction principle.
Displayed variants of the type-theoretic operations of T . They are the methods of theinduction principle. Lift • : { i, A } ( A • : Ty • i A ) → Ty • i +1 ( Lift S $ A ) lift • : { i, A }{ A • : Ty • i A }{ a } → Tm • A • a ≃ Tm • ( Lift • i A • ) ( lift S $ a ) U • : { i } → Ty • ( λ (cid:181) F ∗ U S i ) El • : { i, A } → Tm • U • i A ≃ Ty • ( El S $ A ) N • : Ty • ( λ (cid:181) F ∗ N S ) zero • : Tm • N • ( λ (cid:181) F ∗ zero S ) suc • : { n } ( n • : Tm • N • n ) → Tm • N • ( suc S $ n ) elim • N : { i, P, z, s, n } ( P • : { n } ( n • : Tm • N • n ) → Ty • i P )( s • : { n, p } ( n • : Tm • N • n )( p • : Tm • ( P • n • ) p ) → Tm • ( P • ( suc • n • )) ( s ⊛ n ⊛ p ))( z • : Tm • N • z )( n • : Tm • N • n ) → Tm • ( P • n • ) ( elim S N $ P ⊛ z ⊛ s ⊛ n )Π • : { i, A, B } ( A • : Ty • i A )( B • : { a } ( a • : Ty • A • a ) → Ty • i ( B ⊛ a )) → Ty • (Π S $ A ⊛ B ) lam • : { i, A, B, b } ( A • : Ty • i A )( B • : { a } ( a • : Ty • A • a ) → Ty • i ( B ⊛ a ))( b • : { a } ( a • : Ty • A • a ) → Ty • ( B ⊛ a )) → Tm • (Π • A • B • ) ( lam S $ { A } ⊛ { B } ⊛ b ) app • : { i, A, B, f, a } ( A • : Ty • i A )( B • : { a } ( a • : Ty • A • a ) → Ty • i ( B ⊛ a ))( f • : Tm • (Π • A • B • ) f )( a • : Ty • A • a ) → Tm • ( B • a • ) ( app S $ f ⊛ a ) Satisfying displayed variants of the type-theoretic equations of T . For example: Lift • i (Π • i A • B • ) = Π • i +1 ( Lift • i A • ) ( λ a • Lift • i ( B • (( lift • i ) − a • ))) elim • N P • s • z • ( suc • n • ) = s • n • ( elim • N P • s • z • n • ) ⌟ A displayed model without context extensions has context extensions when for any A and A • , the first projection map( a : (cid:181) F ∗ → Tm S ( A b F ∗ )) × ( a • : Tm • A • a ) λ ( a,a • ) a −−−−−−−→ ( (cid:181) F ∗ → Tm S ( A b F ∗ ))has a locally representable domain and preserves context extensions.In Appendix C.3 we give an internal definition of section of displayed models with contextextensions. It is similar to the definition of morphism of models. The induction principle ofthe biinitial model T is the statement that any displayed model with context extensionsover T admits a section.While (displayed) models without context extensions are not well-behaved, we show thatthey can be replaced by (displayed) models with context extensions. ▶ Definition 8 (Externally) . A factorization ( C Y −→ P G −→ S , S † ) of a global displayed modelwithout context extensions S • over F : C → S consists of a factorization C Y −→ P G −→ S of F and a displayed model with context extensions S † over G : P → S , such that Y : C → P isfully faithful and equipped with bijective actions on displayed types and terms. ⌟ . Bocquet and A. Kaposi and C. Sattler 11 ▶ Construction 9 (Externally) . We construct a factorization ( C Y −→ P G −→ S , S † ) of any modelwithout context extensions S • over F : C → S . Construction sketch.
We give the full construction in the appendix. We see P as analogousto the presheaf category over C , but in the slice 2-category ( Cat / S ). Indeed, a generalizationof the Yoneda lemma holds for Y : C → P . In particular Y : C → P is fully faithful.Equivalently, it could be defined as the pullback along よ : S → b S of the Artin gluing G → b S of F ∗ : b S → b C .It is well-known that given a base model C of type theory, that model can be extended tothe presheaf category b C in such a way that the Yoneda embedding よ : C → b C is a morphismof models with bijective actions on types and terms. This is indeed the justification for one ofthe intended models of two-level type theory [2]. This construction does not actually dependon the context extensions in the base model C . The construction of the displayed model S † over G : P → S is a generalization of this construction to displayed models. ◀ If we have a displayed model without context extensions S • over a functor F : C → S ,we generally want a bit more than just a section s of the displayed model S † constructed inConstruction 9. Indeed, if we take a type A of S over a context F Γ for some Γ : | C | , we canapply the action of s on types to obtain a displayed type s Ty A of S † over s ( F Γ). We wouldrather have a displayed type of S • over Γ. It suffices to have a morphism α Γ : Y Γ → s ( F Γ).We can then transport s Ty A to a displayed type ( s Ty A )[ α Γ ] of S † over Y Γ. Since Y isequipped with a bijective action Y Ty on displayed types, this provides a displayed type Y Ty , − ( s Ty A )[ α Γ ] of S • over Γ, as desired. In general, we want to have a full naturaltransformation α : Y ⇒ ( F · s ). This leads to the following definition. ▶ Definition 10 (Externally) . A relative section s α of a factorization ( C Y −→ P G −→ S , S † ) of a displayed model without context extensions S • over F : C → S consists of a section s of the displayed model with context extensions S † along with a natural transformation α : Y ⇒ ( F · s ) such that ( α · G ) = 1 F . ⌟ Given a relative section s α , we have internally to C actions on types and terms: s Ty α : { i } ( A : (cid:181) F ∗ → Ty S i ) → Ty • As Tm α : { i }{ A : (cid:181) F ∗ → Ty S i } ( a : (cid:181) F ∗ → Tm S ( A b F ∗ )) → Ty • ( s Ty α A ) a We show in the appendix how these actions can be defined.More generally, we have actions on dependent types and terms for every derived sort: s [ X ] Ty α : { i } ( A : (cid:181) F ∗ ( x : X S b F ∗ ) → Ty S i )( x : (cid:181) F ∗ → X S b F ∗ )( x • : X • x ) → Ty • ( A ⊛ x ) s [ X ] Tm α : { i, A } ( a : (cid:181) F ∗ ( x : X S b F ∗ ) → Tm S ( A b F ∗ x ))( x : (cid:181) F ∗ → X S b F ∗ )( x • : X • x ) → Tm • ( s [ X ] Ty α A x x • ) ( a ⊛ x )These actions are compatible with the operations of T . For example: s [ X ] Ty α ( λ (cid:181) F ∗ x N S )= λ x • N • s [ X ] Ty α ( λ (cid:181) F ∗ x Π S ( A b F ∗ x ) ( B b F ∗ x ))= λ x • Π • ( s [ X ] Ty α A x • ) ( λ a • s [ X, Tm ] Ty α B ( x • , a • )) A displayed model without context extension over the biinitial model does not necessarilyadmit a relative section; this depends on the functor F : C → S . Depending on the universalproperty of C , we need to provide some additional data in order to obtain a relative section.We first present the two instances that are needed for canonicity and normalization. ▶ Lemma 11 (Externally) . Denote by {⋄} the terminal category (which should rather beseen here as the initial category equipped with a terminal object), and consider the functor F : {⋄} → T that selects the empty context of T .Any global displayed model without context extensions over F admits a relative section. ▶ Definition 12 (Externally) . A renaming algebra over a model S of T is a category R with a terminal object, along with a functor F : R → S preserving the terminal object, alocally representable dependent presheaf of variables Var R : { i } ( A : (cid:181) F ∗ → Ty S i ) → RepPsh R and an action on variables var : { i, A } → Var i A → (cid:181) F ∗ → Tm S A that preserves contextextensions.The category of renamings Ren S over a model S is defined as the biinitial renamingalgebra over S . We denote the category of renamings of the biinitial model T by Ren . ▶ Lemma 13 (Externally) . Let • T be a global displayed model without context extensionsover F : Ren → T , along with a map var • : { i }{ A : (cid:181) F ∗ → Ty i } ( A • : Ty • A )( a : Var A ) → Tm • A • ( var a ) . Then there exists a relative section s α of • T . It satisfies the additional computation rule s Tm ( var { A } a ) = var • ( s Ty A ) a . In the general case, the underlying section and the natural transformation of a relativesection are obtained respectively from the universal properties of S and C . The universalproperty of S immediately provides a section s of S † . For the natural transformation, weconsider the displayed inserter I of Y and ( F · s ). It is the universal category equippedwith a projection I : I → C and a natural transformation α : ( I · Y ) ⇒ ( I · F · s ) such that( α · G ) = 1 I · F . If we are able to equip I with the required structure, we obtain a section t of I , and thus a natural transformation ( t · α ) : Y ⇒ ( F · s ) and a relative section s t · α of S • For example, in the case of Lemma 13, we just have to equip I with the structure of arenaming algebra over S . IC PS
I Yt F G s α : ( I · Y ) ⇒ ( I · F · s )( α · G ) = 1 I · F In order to prove canonicity for T , we construct a displayed model without contextextensions • T over F : {⋄} → T , so as to apply Lemma 11 to it. . Bocquet and A. Kaposi and C. Sattler 13 We define • T in the internal language of Psh {⋄} (= Set ).A type of • T displayed over a type A : (cid:181) F ∗ → Ty i is a proof-relevant logical predicateover the terms of type A , valued in i -small sets. A term of • T of type A • displayed over aterm a : (cid:181) F ∗ → Tm ( A b F ∗ ) is an witness of the fact that a satisfies the predicate A • . Ty • i A ≜ ( a : (cid:181) F ∗ → Tm ( A b F ∗ )) → Set i Tm • i A • a ≜ A • a The logical predicates over the universes characterizes types that are equipped withlogical predicates. U • i ≜ λ A Ty • i A El • i A • ≜ A • The logical predicate over Π
A B characterizes the functions that preserve the logicalpredicate of A and B .Π • i A • B • ≜ λ f ( { a } ( a • : A • a ) → B • ( app $ f ⊛ a )) lam • i b • ≜ λ a • b • a • app • i f • a • ≜ f • a • Finally, N • : ( (cid:181) F ∗ → Tm N ) → Set characterizes canonical natural numbers, and isdefined as the inductive family generated by zero • : N • ( λ (cid:181) F ∗ zero ) and suc • : { n } → N • n → N • ( suc $ n ). The displayed natural number eliminator elim • N is then obtained fromthe elimination principle of N • . Lemma 11 now provides a relative section s α of • T .Internally to Psh {⋄} , take any global natural number term ( n : (cid:181) F ∗ → Tm N ). Notethat since F : {⋄} → T selects the empty context, the dependent right adjoint F ∗ restrictspresheaves over T to the empty context. Thus n is indeed a closed natural number term.We can apply the action of the relative section s α to n . We obtain an element s Tm α n of Ty • ( s Ty α ( λ (cid:181) F ∗ N )) n . We compute s Ty α ( λ (cid:181) F ∗ N ) = N • . Therefore we have anelement of N • n . This proves that n is canonical. For normalization, we will construct a displayed model without context extensions • T overthe embedding F : Ren → T from the category of renamings to the biinitial model. Ourgoal is to prove, internally to Psh
Ren , that every term of T admits a unique normal form.The core of the proof is exactly the same as in Coquand’s proof [6]; it is a generalization ofNormalization by Evaluation [4].Some of the omitted details of the proof are spelled out in Appendix E. We first need to define neutral terms and normal forms. They are defined, internally to
Psh
Ren , as inductive families Ne and Nf indexed by the terms of T . Ne : { i }{ A : (cid:181) F ∗ → Ty S i } ( (cid:181) F ∗ → Tm i ( A b F ∗ )) → Psh
Ren Nf : { i }{ A : (cid:181) F ∗ → Ty S i } ( (cid:181) F ∗ → Tm i ( A b F ∗ )) → Psh
Ren
An element of Ne { A } a (resp. Nf { A } a ) is a witness of the fact that the term a of type A is a neutral term (resp. admits a normal form). If A : (cid:181) F ∗ → Ty i is a type at level i , wewrite NfTy i A ≜ Nf i +1 { (cid:181) F ∗ → U i } ( El − $ A ).The constructors of these families are listed in the appendix. We just note that there is aconstructor var ne : { i, A } ( a : Var A ) → Ne i ( var a )exhibiting all variables as neutral terms.We also have lifting operations on normal forms. Lift nfty : { i, A } → NfTy i A → NfTy i +1 ( Lift $ A ) lift ne : { i, A, a } → Ne i a ≃ Ne i +1 ( lift $ a ) lift nf : { i, A, a } → Nf i a ≃ Nf i +1 ( lift $ a )These functions are defined by induction on Ne and Nf , mapping each constructor to thesame constructor and only shifting some universe levels.The construction of our normalization function will work for any algebra Ne and Nf withthe above signature (including equations for lift ). The choice of the initial algebra is onlyneeded to show uniqueness of normal forms in Lemma 14. We now construct a displayed model without context extensions • T over F : Ren → T ,internally to Psh
Ren .A displayed type A • : Ty • A of • T over a type A : (cid:181) F ∗ → Ty i consists of four components( A • nfty , A • p , A • ne , A • nf ). A • nfty : NfTy A is a witness of the fact that the type A admits a normal form. A • p : ( (cid:181) F ∗ → Tm ( A b F ∗ )) → Psh
Ren i is a proof-relevant logical predicate over the termsof type A , valued in i -small presheaves. A • ne : { a } → Ne a → A • p a shows that neutral terms satisfy the logical predicate A • p . Thefunction A • ne is often called unquote or reflect . A • nf : { a } → A • p a → Nf a shows that the terms that satisfy the logical predicate A • p admitnormal forms. The function A • nf is often called quote or reify .A displayed term a • : Tm • A • a of type A • over a term ( a : (cid:181) F ∗ → Tm ( A b F ∗ )) is aninhabitant a • of A • p a , i.e. a witness of the fact that a satisfies the logical predicate A • p .The displayed lifting operations Lift • : Ty • i A → Ty • i +1 ( Lift $ A ) and lift • : Tm • A • a ≃ Tm • ( Lift • A • ) ( lift $ a ) are defined using the lifting operations on normal forms ( Lift nfty , lift ne and lift nf ). We give the definitions of the displayed universes, Π-type and natural numbertype structures in the appendix. . Bocquet and A. Kaposi and C. Sattler 15 Given any displayed type A • , every variable of type A satisfies the logical predicate A • p ; wecan define var • : { i, A, a } ( A • : Ty • A )( a : Var A ) → A • p ( var a ) by var • A • a ≜ A • ne ( var ne a ).We can now apply Lemma 13 to • T . We obtain a relative section s α of • T .This proves the existence of normal forms, as witnessed by the following normalizationfunction, internally to Psh
Ren . norm : { i, A } ( a : (cid:181) F ∗ → Tm ( A b F ∗ )) → Nf i a norm { A } a ≜ ( s Ty α A ) nf ( s Tm α a ) It remains to show the uniqueness of normal forms. It follows from stability of normalization: ▶ Lemma 14 (Internally to
Psh
Ren ) . For every a ne : Ne i { A } a , we have s Tm α a = ( s Ty α A ) ne a ne ,and for every a nf : Nf i { A } a , we have ( s Ty α A ) nf ( s Tm α a ) = a nf . ◀ This is proven by mutual induction on Ne and Nf . Each case follows from some of thecomputation rules of s α and the induction hypothesis. For example, the case of var ne a : Ne ( var a ) follows from the computation rule s Tm α ( var a ) = ( s Ty α A ) ne ( var ne a ). More casesare detailed in the appendix. While we have focused on the type theory T in this document, we hope that it is clearthat these constructions generalize to other type theories. Nevertheless, it would be good toactually prove that all of these constructions can be done for arbitrary type theories. In [14],a syntactic definition of Quotient Inductive-Inductive Type signature is given, along withsemantics. It should be possible to extend this approach and give general definitions ofmodels, morphisms, displayed models (without context extensions), etc., for arbitrary typetheory signatures. Other definitions of the general notion of type theory have been proposedrecently [3, 25]. One advantage of the approach of [14] is that its semantics are given byinduction on the syntax of signatures; and thus the definitions of models, morphisms, etc.,for a given type theory signature can be computed.The current proof assistants based on dependent type theory natively support variousvariants of inductive types. We believe that the ideas presented in this paper could helptowards the implementation of proof assistants that natively support syntax with bindings.We have used our framework to give short proofs of canonicity and normalization fordependent type theory. We see them as non-trivial results that are also well-understood;and thus serve as good benchmarks for our induction principles. We hope to apply thisframework the proof of novel results in the future.We would also like to extend this work to other kinds of context extensions and bindingstructures, such as affine binding structures. An affine variable cannot be duplicated (in theabsence of additional structure) and can therefore be used at most once.This should give a description of the category of weakenings as the initial object of somecategory. The category of weakenings is similar to the category of renamings, but withoutthe ability to duplicate variables. Using the category of weakenings in a normalization proofallows for non-linear equations in the type theory, such as the group equation x · x − = 1.The internal language of presheaves over the category of weakenings is also the right settingfor proving the decidability of equality. A The dependent right adjoints F ∗ and F ∗ In this section we give explicit definitions of the adjunctions F ! ⊣ F ∗ and F ∗ ⊣ F ∗ and theirdependent versions F ! ⊣ F ∗ and F ∗ ⊣ F ∗ , given a functor F : C → D .The precomposition functor: F ∗ : Psh D → Psh C | F ∗ X ′ | Γ ≜ | X ′ | F Γ x [ ρ ] F ∗ X ′ ≜ x [ F ρ ] X ′ | F ∗ f ′ | Γ x ≜ | f ′ | F Γ x Its left adjoint: F ! : Psh C → Psh D | F ! X | Γ ′ ≜ (cid:0) (Γ : | C | ) × D (Γ ′ → F Γ) × | X | Γ (cid:1) / ∼ where (Γ , δ ′ , x [ ρ ] X ) ∼ (∆ , F ρ ◦ δ ′ , x )(Γ , δ ′ , x )[ ρ ′ ] F ! X ≜ (Γ , δ ′ ◦ ρ ′ , x ) | F ! f | Γ ′ (Γ , δ ′ , x ) ≜ (Γ , δ ′ , | f | Γ x )The unit of the adjunction F ! ⊣ F ∗ is given by η X : X → ( F ∗ ( F ! X )) | η X | Γ x ≜ (Γ , id F Γ , x )while the hom-set definition of the adjunction is given by an isomorphism ϕ : ( F ! X → X ′ ) ∼ = ( X → F ∗ X ′ ) : ϕ − natural in X and X ′ , where ϕ f ′ ≜ F ∗ f ′ ◦ η X i.e. | ϕ f ′ | Γ x = | f ′ | F Γ ( | η X | Γ x ) and (cid:12)(cid:12) ϕ − f (cid:12)(cid:12) Γ ′ (Γ , δ ′ , x ) ≜ ( | f | Γ x )[ δ ′ ] X . The dependent right adjoint of F ! : F ∗ : DepPsh D ( F ! X ) → DepPsh C X | F ∗ A ′ | Γ x ≜ | A ′ | F Γ ( | η X | Γ x ) a ′ [ ρ ] F ∗ A ′ ≜ a ′ [ F ρ ] A ′ We have F ∗ A ′ ◦ f = F ∗ ( A ′ ◦ F ! f ). The dependent adjunction F ! ⊣ F ∗ is an isomorphism ψ : Psh D (cid:0) ( x ′ : F ! X ) → A ′ ( x ′ ) (cid:1) ∼ = Psh C (cid:0) ( x : X ) → ( F ∗ A ′ )( x ) (cid:1) : ψ − natural in X , where | ψ f ′ | Γ x ≜ | f ′ | F Γ ( | η X | Γ x ) and (cid:12)(cid:12) ψ − f (cid:12)(cid:12) Γ ′ (Γ , δ ′ , x ) ≜ ( | f | Γ x )[ δ ′ ] A ′ .The right adjoint of F ∗ : F ∗ : Psh C → Psh D | F ∗ X | Γ ′ ≜ (cid:8) α : (Γ : | C | )( δ ′ : D ( F Γ → Γ ′ )) → | X | Γ | α Γ ( δ ′ ◦ F σ ) = ( α ∆ δ ′ )[ σ ] X (cid:9) α [ ρ ′ ] F ∗ X ≜ λ Γ δ ′ α Γ ( ρ ′ ◦ δ ′ ) | F ∗ f | Γ ′ α ≜ λ Γ δ ′
7→ | f | Γ ( α Γ δ ′ )The adjunction is an isomorphism ϕ : ( F ∗ X ′ → X ) ∼ = ( X ′ → F ∗ X ) : ϕ − natural in X and X ′ where | ϕ f | Γ ′ x ′ ≜ λ Γ δ ′
7→ | f | Γ ( x ′ [ δ ′ ] X ′ ) and (cid:12)(cid:12) ϕ − f ′ (cid:12)(cid:12) Γ x ′ ≜ | f ′ | F Γ x ′ Γ id F Γ . The . Bocquet and A. Kaposi and C. Sattler 17 dependent right adjoint of F ∗ : F ∗ : DepPsh C ( F ∗ X ′ ) → DepPsh D X ′ | F ∗ A | Γ ′ x ′ ≜ (cid:8) α : (Γ : | C | )( δ ′ : D ( F Γ → Γ ′ )) → | A | Γ ( x ′ [ δ ′ ] X ′ ) | α Γ ( δ ′ ◦ F σ ) = ( α ∆ δ ′ )[ σ ] A (cid:9) α [ ρ ′ ] F ∗ A ≜ λ Γ δ ′ α Γ ( ρ ′ ◦ δ ′ )We have F ∗ A ◦ f ′ = F ∗ ( A ◦ F ! f ′ ). The dependent adjunction F ∗ ⊣ F ∗ is an isomorphism ψ : Psh C (cid:0) ( x : F ∗ X ′ ) → A ( x ) (cid:1) ∼ = Psh D (cid:0) ( x ′ : X ′ ) → ( F ∗ A )( x ′ ) (cid:1) : ψ − natural in X’ where | ψ f | Γ ′ x ′ ≜ λ Γ δ ′
7→ | f | Γ ( x ′ [ δ ′ ] X ′ ) and (cid:12)(cid:12) ψ − f ′ (cid:12)(cid:12) Γ x ′ ≜ | f ′ | F Γ x ′ Γ id F Γ . B Multimodal Type Theory
The proofs and constructions performed in the appendix involve more than two presheafcategories and more than a single dependent right adjoint. We rely on Multimodal TypeTheory [7] to provide a single language that embeds the internal languages of all of thosepresheaf categories and the dependent right adjoints between them.Our variant of Multimodal Type Theory differs from the one presented in [7] in a coupleof ways. We keep the same syntax for dependent right adjoints as in Section 3; whereas [7]uses weak dependent right adjoints instead, which come with a positive elimination ruleinstead of the operation ( − b ). So as to remove some of the ambiguities of the informalsyntax and improve readability in the presence of multiple modalities, we annotate lockswith tick variables . The extension of the syntax of Multimodal Type Theory by ticks wasintroduced by [17] for the same purpose. B.1 Multiple modalities
Multiple modalities are given semantically by multiple dependent right adjoints. Given afunctor F : C → D , we already have two dependent right adjoints F ∗ and F ∗ , which givemodalities ( (cid:181) F ∗ → − ) and ( (cid:181) F ∗ → − ). Dependent right adjoints can be composed, and wealso have modalities ( (cid:181) F ∗ F ∗ → − ), ( (cid:181) F ∗ F ∗ → − ), etc., where ( (cid:181) F ∗ F ∗ → − ) = ( (cid:181) F ∗ (cid:181) F ∗ → − ). B.1.1 Ticks
In presence of multiple modalities, or of non-trivial relations between the modalities, thenotation ( − b µ ) becomes ambiguous. Suppose for instance that µ is a idempotent dependentright adjoint ( µµ = µ ). Then for any context Γ, we have Γ , (cid:181) µ , (cid:181) µ = Γ , (cid:181) µ . If we write( a b µ ) in the ambient context (Γ , (cid:181) µ ), it is unclear whether the subterm a should live in thecontext Γ or Γ , (cid:181) µ .To avoid this kind of ambiguity, we will annotate locks with ticks . In the above example,we would have Γ , (cid:181) m µ , (cid:181) n µ = Γ , (cid:181) mn µ ; and we would write either ( a b n µ ) if a lives over Γ , (cid:181) m µ or( a b mn µ ) if a lives over Γ.We use m , n , o , etc. for tick variables. The tick variables refer to the locks of the ambientcontext. A tick is a formal composition of tick variables, corresponding to the compositionof some adjacent locks in the ambient context. We write • for the empty tick, correspondingto the empty composition. We write m , n , o , etc. to refer to an arbitrary tick.Each (cid:181) now binds a tick variable. If Γ is a context, then the subterms of ( (cid:181) m µ → − ) and( λ (cid:181) m µ
7→ − ) live over the context Γ , (cid:181) m µ . Each b now unbinds the last tick variable of the context; or more generally some suffix ofthe tick variables. The ordinary variables that occur after these tick variables are implicitlydropped from the current context.We omit ticks when only a single modality is involved. B.1.2 Morphisms between modalities
Finally, we have morphisms between modalities. If µ and ν are two parallel dependentright adjoints, whose left adjoints are respectively L µ and L ν , a morphism α : µ ⇒ ν isa natural transformation α : L µ ⇒ L ν . For example, given F : C → D , we have a counit ε F : F ∗ F ∗ ⇒
1, and a unit η F : 1 ⇒ F ∗ F ∗ , induced by the adjunction ( F ! ⊣ F ∗ ).Given α : µ ⇒ ν , we obtain a coercion operation − [ ⁄ α : m ⇒ n ] that sends types andterms from the context Γ , (cid:181) n ν to the context Γ , (cid:181) m µ . Semantically, this operation is the presheafrestriction operation of types and terms along the morphism | α | Γ : (Γ , (cid:181) m µ ) → (Γ , (cid:181) n ν ).This induces a map coe α : { A : (cid:181) n ν → Psh } → ( (cid:181) n ν → A b n ν ) → ( (cid:181) m µ → ( A b n ν )[ ⁄ α : m ⇒ n ]) coe α a ≜ λ (cid:181) m µ ( a b n ν )[ ⁄ α : m ⇒ n ]For another example, consider composable functors F : C → D and G : D → E . Wehave a natural isomorphism α : ( F G ) ! ≃ F ! G ! . This induces isomorphisms ( (cid:181) m ( F G ) ∗ → A ) ≃ ( (cid:181) fg F ∗ G ∗ → A ), whose components are λa (cid:181) fg F ∗ G ∗ ( a b m ( F G ) ∗ )[ ⁄ α : fg ≃ m ]and λa (cid:181) m ( F G ) ∗ ( a b fg F ∗ G ∗ )[ ⁄ α − : m ≃ fg ] . We omit the natural transformation when it can be inferred. For instance we could havewritten [ ⁄ : fg ≃ m ] and [ ⁄ : m ≃ fg ] above.More generally, the operation [ ⁄ α : m ⇒ n ] can be applied to any type or term over acontext of the form (Γ , (cid:181) n ν , ∆) to send it to the context (Γ , (cid:181) m µ , ∆[ ⁄ α : m ⇒ n ]), where ∆is an extension of the context (Γ , (cid:181) n ν ) by variable bindings and locks, and ∆[ ⁄ α : m ⇒ n ]applies the operation [ ⁄ α : m ⇒ n ] to every type in ∆. In that case it is interpretedsemantically by restriction along the weakening (Γ , (cid:181) m µ , ∆[ ⁄ α : m ⇒ n ]) → (Γ , (cid:181) m µ , ∆) of | α | Γ : (Γ , (cid:181) m µ ) → (Γ , (cid:181) n ν ).The operation [ ⁄ α : m ⇒ n ] commutes with all natural type-theoretic operations. Forexample, ( A × B )[ ⁄ α : m ⇒ o ] = ( A [ ⁄ α : m ⇒ o ] × B [ ⁄ α : m ⇒ o ]).It commutes with binders:(( a : A ) → B a )[ ⁄ α : m ⇒ o ] = ( a : A [ ⁄ α : m ⇒ o ]) → B [ ⁄ α : m ⇒ o ] a. Note that [ ⁄ α : m ⇒ n ] is not applied to the bound variable a , as it is already applied tothe type A of a .It also commutes with ( (cid:181) µ → − ) and ( λ (cid:181) µ
7→ − ) for a dependent right adjoint µ :( (cid:181) o µ → A )[ ⁄ α : m ⇒ n ] = ( (cid:181) o µ → A [ ⁄ α : m ⇒ n ])( λ (cid:181) o µ a )[ ⁄ α : m ⇒ n ] = ( λ (cid:181) o µ a [ ⁄ α : m ⇒ n ]) . Bocquet and A. Kaposi and C. Sattler 19 It commutes with ( − b o ) when o is a tick variable that is bound in ∆.The operation [ ⁄ α : m ⇒ nq ] (where nq is a non-empty composition of tick variablesending in q ) can only get stuck on ( − (cid:181) q ) (or more generally on ( − (cid:181) oq )). The operation[ ⁄ α : m ⇒ • ] (where • is the empty composition of ticks) can only be stuck on a variable.Finally, these operations satisfy some 2-naturality conditions. Given two verticallycomposable morphisms α : µ ⇒ ν and β : ν ⇒ ξ , we have( − )[ ⁄ β : n ⇒ x ][ ⁄ α : m ⇒ n ] = ( − )[ ⁄ αβ : m ⇒ x ] . Given α : µ ⇒ ν and a dependent right adjoint ξ such that the whiskering αξ can be formed,we have( − )[ ⁄ αξ : mx ⇒ nx ] = ( − )[ ⁄ α : m ⇒ n ] . Similarly, when we can form the whiskering ξα , we have( − )[ ⁄ ξα : xm ⇒ xn ] = ( − )[ ⁄ α : m ⇒ n ] . C Constructions and ProofsC.1 Preservation of context extensions
We include some results on the preservation of virtual context extensions over a functor F : C → D . ▶ Proposition 15 (Externally) . Let X be a presheaf over C , A C be a dependent presheaf over X , A D be a dependent presheaf over F ! X and F A be a dependent natural transformationfrom A C to F ∗ A D over X . This data corresponds to the premises of Definition 5, interpretedover the context X of the presheaf model Psh C .When A C and A D are locally representable, then F A preserves context extensions in thesense of Definition 5 if and only if, for every Γ : | C | and x : | X | Γ , the comparison morphism (cid:28) F p A C x , (cid:12)(cid:12) F A (cid:12)(cid:12) Γ ▷ A C | x (cid:16) x [ p A C x ] , q A C x (cid:17)(cid:29) : F (Γ ▷ A C | x ) → ( F Γ) ▷ A D | ( | η FX | Γ x ) is an isomorphism (where (cid:12)(cid:12) η FX (cid:12)(cid:12) Γ : | X | Γ → | F ∗ ( F ! X ) | Γ is the evaluation of the unit of theadjunction ( F ! ⊣ F ∗ ) at X and Γ ). ◀ Proof.
We have the following four families of natural transformations where y : | X | Γ → Psh D ( よ Γ → X ) denotes the map in the Yoneda lemma and ϕ and ψ denote the isomorphismsof the (dependent) adjunctions F ! ⊣ F ∗ and F ! ⊣ F ∗ , respectively.i) For all Γ : C op , x : | X | Γ , and a dependent presheaf P over Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )), τ i x,P : Psh D (cid:16) ( ρ : F ! よ Γ ) (cid:0) a : A D ( F ! ( y x ρ )) (cid:1) → P ( ρ, a ) (cid:17) → Psh C (cid:16) ( ρ : よ Γ )( a : A C ( y x ρ )) → F ∗ (cid:0) P ( F ! ρ, ψ − ( F A ( y x ρ, a ))) (cid:1)(cid:17) natural in Γ.ii) For all Γ, x , and Y : Psh D , τ ii x,Y : Psh D (cid:0) Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )) → Y (cid:1) → Psh C (cid:0) Σ よ Γ ( A C ◦ y x ) → F ∗ Y (cid:1) natural in Γ and Y .iii) For all Γ and x , τ iii x : Psh D (cid:0) F ! (Σ よ Γ ( A C ◦ y x )) → Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )) (cid:1) naturalin Γ.iv) If A C and A D are locally representable, for all Γ and x , τ iv x : D (cid:0) F (Γ ▷ A C | x ) → ( F Γ) ▷ A D | ( | η FX | Γ x ) (cid:1) , natural in Γ. τ i has an inverse if and only if F A preserves virtual context extensions as i) is the evaluationof the map τ in Definition 5. τ iv is the map in the statement of the proposition. We showthat having an inverse for τ i , τ ii , τ iii and τ iv are all equivalent.i) → ii). We denote the constant dependent presheaf formed from a presheaf Y by K Y , with Psh ( X → Y ) ∼ = Psh (( x : X ) → ( K Y )( x )) and ( K Y )( x ) = ( K Y )( y ) and F ∗ ( K Y ) = K ( F ∗ Y ). We have the following chain of natural isomorphisms. Psh D (cid:0) Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )) → Y (cid:1) ∼ = Psh D (cid:0) ( ρ : F ! よ Γ )( a : A D ( F ! ( y x ρ ))) → ( K Y )( ρ, a ) (cid:1) ∼ = i) Psh C (cid:16) ( ρ : よ Γ )( a : A C ( y x ρ )) → F ∗ (cid:0) ( K Y )( F ! ρ, ψ − ( F A ( y x ρ, a ))) (cid:1)(cid:17) = Psh C (cid:0) ( ρ : よ Γ )( a : A C ( y x ρ )) → ( F ∗ ( K Y ))( ρ, a ) (cid:1) = Psh C (cid:0) ( ρ : よ Γ )( a : A C ( y x ρ )) → ( K ( F ∗ Y ))( ρ, a ) (cid:1) ∼ = Psh C (cid:0) Σ よ Γ ( A C ◦ y x ) → F ∗ Y (cid:1) The forward maps of iii) and ii) are defined as follows where f ↑ denotes the lifting of an f : Psh C ( X → Y ) to Psh C (Σ X ( Z ◦ f ) → Σ Y Z ). τ iii x = ( F ! π , F A ◦ ( yx ) ↑ ) τ ii x,Y f = ϕ ( f ◦ τ iii x )ii) → iii). We define τ iii x − ≜ τ ii x, ( F ! (Σ よ Γ ( A C ◦ y x ))) − ( η Σ よ Γ ( A C ◦ y x ) ) = τ ii − ( ϕ τ iii x − ◦ τ iii x = τ ii − ( ϕ ◦ τ iii x = ϕ − (cid:0) ϕ ( τ ii − ( ϕ ◦ τ iii x ) (cid:1) = ϕ − ( τ ii ( τ ii − ( ϕ ϕ − ( ϕ
1) = 1 and τ iii x ◦ τ iii x − = τ iii x ◦ τ ii − ( ϕ
1) = τ ii − ( F ∗ τ iii x ◦ ϕ
1) = τ ii − ( ϕ ( τ iii x ◦ τ ii − ( ϕ (1 ◦ τ iii x )) = τ ii − ( τ ii
1) = 1. Naturality of τ iii x − follows from that of τ iii x .ii) → i). We have the following chain of natural isomorphisms. Psh D (cid:16) ( ρ : F ! よ Γ ) (cid:0) a : A D ( F ! ( y x ρ )) (cid:1) → P ( ρ, a ) (cid:17) ∼ = (singleton) (cid:16) f : Psh D (cid:0) Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )) → F ! (Σ よ Γ ( A C ◦ y x )) (cid:1)(cid:17) × Psh D (cid:0) ( w : Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x ))) → ( P ◦ τ iii x ◦ f )( w ) (cid:1) × ( f = τ iii x − ) ∼ = (Σ in Psh D ) (cid:16) f : Psh D (cid:0) Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )) → Σ ( F ! (Σ よ Γ ( A C ◦ y x ))) ( P ◦ τ iii x ) (cid:1)(cid:17) × ( π ◦ f = τ iii x − ) ∼ = ii) (cid:16) f : Psh C (cid:0) Σ よ Γ ( A C ◦ y x ) → F ∗ (Σ ( F ! (Σ よ Γ ( A C ◦ y x ))) ( P ◦ τ iii x )) (cid:1)(cid:17) × ( π ◦ τ ii − f ◦ = τ iii x − ) ∼ = iii) (cid:16) f : Psh C (cid:0) Σ よ Γ ( A C ◦ y x ) → F ∗ (Σ ( F ! (Σ よ Γ ( A C ◦ y x ))) ( P ◦ τ iii x )) (cid:1)(cid:17) × ( π ◦ ϕ − f = 1) ∼ = ( F ! ⊣ F ∗ ) (cid:16) f : Psh D (cid:0) F ! (Σ よ Γ ( A C ◦ y x )) → Σ ( F ! (Σ よ Γ ( A C ◦ y x ))) ( P ◦ τ iii x ) (cid:1)(cid:17) × ( π ◦ f = 1) ∼ = (section) Psh D (cid:0) ( w : F ! (Σ よ Γ ( A C ◦ y x ))) → ( P ◦ τ iii x )( w ) (cid:1) ∼ = ( F ! ⊣ F ∗ ) Psh C (cid:16) ( ρ : よ Γ )( a : A C ( y x ρ )) → F ∗ (cid:0) P ( F ! ρ, ψ − ( F A ( y x ρ, a ))) (cid:1)(cid:17) iii) → ii). We define τ ii x,Y − f ≜ ϕ − f ◦ τ iii x − . We have τ ii x,Y − ( τ ii x,Y f ) = ϕ − ( ϕ ( f ◦ τ iii x )) ◦ τ iii x − = f ◦ τ iii x ◦ τ iii x − = f and τ ii x,Y ( τ ii x,Y − f ) = ϕ ( ϕ − f ◦ τ iii x − ◦ τ iii x ) = ϕ ( ϕ − f ) = f .Naturality of τ ii x − follows from that of τ ii x . . Bocquet and A. Kaposi and C. Sattler 21 iii) → iv). We have the following chain of natural isomorphisms. We use the fact that よ F Γ ∼ = F ! よ Γ and up to this isomorphism, y ( | η X | Γ x ) = F ! ( y x ). よ F (Γ ▷ A C | x ) ∼ = F ! ( よ Γ ▷ A C | x ) ∼ = ( A C is locally representable) F ! (Σ よ Γ ( A C ◦ y x )) ∼ = iii)Σ ( F ! よ Γ ) ( A D ◦ F ! ( y x )) ∼ =Σ よ F Γ (cid:0) A D ◦ y ( | η X | Γ x ) (cid:1) ∼ = ( A D is locally representable) よ F Γ ▷ A D | ( | ηX | x ) We obtain the desired F (Γ ▷ A C | x ) ∼ = F Γ ▷ A D | ( | η X | x ) by Yoneda.iv) → iii). We define | τ iii x − | Γ ′ (∆ , σ, δ ′ ) α ≜ (∆ ▷ A D | x [ σ ] , ( σ ◦ p A C , q A C ) , τ iv x [ σ ] − ◦ ⟨ δ ′ , α ⟩ ).This is well-defined as | τ iii x − | Γ ′ (∆ , σ ◦ δ, δ ′ ) α = (cid:0) ∆ ▷ A C | x [ σ ◦ δ ] , ( σ ◦ δ ◦ p A C , q A C ) , τ iv x [ σ ◦ δ ] − ◦ ⟨ δ ′ , α ⟩ (cid:1) = (cid:0) ∆ ▷ A C | x [ σ ◦ δ ] , ( σ ◦ p A C , q A C )[ ⟨ δ ◦ p A C , q A C ⟩ ] , τ iv x [ σ ◦ δ ] − ◦ ⟨ δ ′ , α ⟩ (cid:1) = (cid:0) Θ ▷ A C | x [ σ ] , ( σ ◦ p A C , q A C ) , F ⟨ δ ◦ p A C , q A C ⟩ ◦ τ iv x [ σ ◦ δ ] − ◦ ⟨ δ ′ , α ⟩ (cid:1) = (cid:0) Θ ▷ A C | x [ σ ] , ( σ ◦ p A C , q A C ) , τ iv x [ σ ] − ◦ ⟨ F δ ◦ δ ′ , α ⟩ (cid:1) = | τ iii x − | Γ ′ (Θ , σ, F δ ◦ δ ′ ) α. The roundtrips are identities by easy computations. ◀▶ Proposition 16 (Internally to
Psh C ) . Let A C : Psh C and A D : (cid:181) F ∗ → Psh D be presheavesover C and D , B C : A C → Psh C and B D : (cid:181) F ∗ → A D b F ∗ → Psh D be dependent presheavesover A C and A D , and F A : A C → (cid:181) F ∗ → A D b F ∗ and F B : { a : A C } → B C a → (cid:181) F ∗ → B D b F ∗ ( F A a b F ∗ ) be actions of F on A and B .If F A and F B both preserve virtual context extensions, then the action on dependent pairs F Σ AB : ( p : Σ A C B C ) (cid:181) F ∗ → Σ ( A D b F ∗ ) ( B D b F ∗ ) F Σ AB ( a, b ) b F ∗ ≜ ( F A a b F ∗ , F B b b F ∗ ) preserves virtual context extensions. ◀ Proof.
Given Q : (cid:181) F ∗ → Σ ( A D b F ∗ ) ( B D b F ∗ ) → Psh D , the map τ : ( (cid:181) F ∗ ( p : Σ ( A D b F ∗ ) ( B D b F ∗ )) → Q b F ∗ p ) → (( p : Σ A C B C ) (cid:181) F ∗ → Q b F ∗ ( F Σ AB p b F ∗ )) τ q ≜ λ p (cid:181) F ∗ q b F ∗ ( F Σ AB p b F ∗ )factors through the following chain of isomorphisms( (cid:181) F ∗ ( p : Σ ( A D b F ∗ ) ( B D b F ∗ )) → Q p ) ≃ ( (cid:181) F ∗ ( a : A D b F ∗ )( b : B D b F ∗ a ) → Q ( a, b )) ≃ (( a : A C ) (cid:181) F ∗ ( b : B D b F ∗ ( F A a b F ∗ )) → Q ( F A a b F ∗ , b ) ≃ (( a : A C )( b : B C a ) (cid:181) F ∗ → Q ( F A a b F ∗ , F B b b F ∗ )) ≃ (( p : Σ A C B C ) (cid:181) F ∗ → Q ( F Σ AB p )) ◀ C.2 Displayed categories
Displayed categories were introduced in [1]. The data of a displayed category over a base D is equivalent to the data of a category C equipped with a functor into D . Many structureson functors that may seem non-categorical because they involve equalities of objects, suchas fibration structures, are actually well-behaved when seen as structures over displayedcategories. Some of the constructions that follow are more intuitive when thinking aboutdisplayed categories instead of functors. Because Multimodal Type Theory does not havedependent modes, we have to see displayed categories as functors when working internally.We write F : C (cid:95) D if F is a functor that exhibits C as a displayed category over D .Given an object x of D , we may write | C | ( x ) (or C ( x ) or C op ( x )) for the set of objects of C displayed over x , that is the set containing the objects x ′ : | C | such that F x ′ = x . Givenobjects x and y of C and a morphism f : D ( F x → F y ), we write C ( x → f y ) for the set ofmorphisms of C from x to y that are displayed over f . In other words, C ( x → f y ) is the setcontaining the morphisms f ′ : C ( x → y ) such that F f ′ = f . C.3 Sections of displayed models with context extensions ▶ Definition 17. A section of a displayed model with context extensions S • over a functor F : C (cid:95) S consists of a section s : S → C of F (up to a natural isomorphism sF ≃ S ) alongwith (internally to Psh S ):Actions on types and terms. s Ty : { i } ( A : Ty S i ) (cid:181) s s ∗ → Ty • ( λ (cid:181) f F ∗ → A [ ⁄ : sf ≃ • ]) s Tm : { i, A } ( a : Tm S a ) (cid:181) s s ∗ → Tm • ( s Ty A b s s ∗ ) ( λ (cid:181) f F ∗ → a [ ⁄ : sf ≃ • ]) where [ ⁄ : sf ≃ • ] is coercion over the natural isomophism sF ≃ S .Such that for every A : Ty S i , the total action ( a : Tm S a ) → ( (cid:181) s s ∗ → ( a : (cid:181) f F ∗ → Tm S A [ ⁄ : sf ≃ • ]) × ( Tm • ( s Ty A ) b s s ∗ a )) preserves context extensions.As in the definition of morphisms of models, we can then derive actions on dependenttypes and terms. Given any pair ( X S , X • ) where X S : RepPsh S , X • : (cid:181) s s ∗ → ( (cid:181) f F ∗ → X S [ ⁄ : sf ≃ • ]) → Psh C along with an action s X : ( x : X S ) (cid:181) s s ∗ → X • ( λ (cid:181) f F ∗ → x [ ⁄ : sf ≃ • ]) such that the induced total action ( x : X S ) → ( (cid:181) s s ∗ → ( x : (cid:181) f F ∗ → X S [ ⁄ : sf ≃ • ]) × ( x • : X • b s s ∗ x )) has a locally representable codomain and preserves context extensions, we define (using . Bocquet and A. Kaposi and C. Sattler 23 the pattern matching notation of Definition 5) s [ X ] Ty : { i } ( A : X S → Ty S i ) (cid:181) s s ∗ { x } ( x • : X • b s s ∗ x ) → Ty • ( λ (cid:181) f F ∗ → A [ ⁄ : sf ≃ • ] ( x b f F ∗ )) s [ X ] Ty A b s s ∗ ( s X x b s s ∗ ) ≜ s Ty ( A x ) b s s ∗ s [ X ] Tm : { i, A } ( a : Tm S a ) (cid:181) s s ∗ { x } ( x • : X • b s s ∗ x ) → Tm • ( s Ty A b s s ∗ ) ( λ (cid:181) f F ∗ → a [ ⁄ : sf ≃ • ]) s [ X ] Tm a b s s ∗ ( s X x b s s ∗ ) ≜ s Tm ( a x ) b s s ∗ And such that all type-theoretic operations are preserved. For example, s Ty N S = λ (cid:181) s s ∗ N • s Ty ( elim S N P f z n ) = elim • N $ s [ Tm ] Ty P ⊛ s [ Tm , Tm ] Ty f ⊛ s Tm z ⊛ s Tm ns Ty (Π S A B ) = Π • $ s Ty A ⊛ s [ Tm ] Ty B As in the definition of morphisms of models, we can derive computation rules for s [ X ] Ty and s [ X ] Tm . C.4 Displayed presheaf category
In what follows, we need to consider categories of presheaves over large categories, and inparticular categories of presheaves over categories of presheaves. We have to be a bit carefulabout sizes. If C is a category, we write b C for the category of ω -small presheaves (functorsinto Set ω ) over C , and Psh C for the category of large presheaves (functors into Set ω +1 ) over C . We only use the internal language of Psh C .The goal of this subsection is to construct the factorization of Construction 9. ▶ Definition 8 (Externally) . A factorization ( C Y −→ P G −→ S , S † ) of a global displayed modelwithout context extensions S • over F : C → S consists of a factorization C Y −→ P G −→ S of F and a displayed model with context extensions S † over G : P → S , such that Y : C → P isfully faithful and equipped with bijective actions on displayed types and terms. ⌟▶ Construction 9 (Externally) . We construct a factorization ( C Y −→ P G −→ S , S † ) of any modelwithout context extensions S • over F : C → S . We fix a model S of T and a functor F : C (cid:95) S for this whose subsection. ▶ Definition 18.
We define the displayed presheaf category P along with a projectionfunctor G : P (cid:95) S (which exhibits P as a displayed category over S ) and the displayedYoneda embedding Y : C → P . The displayed Yoneda embedding is a displayed functorover S : it satisfies ( Y · G ) = F . They are analogous to the usual category of presheaves andYoneda embedding, but in the slice -category ( Cat / S ) , or equivalently in the -category ofdisplayed categories over S . C P S F Y G
An object Γ † of P displayed over an object Γ of S is a dependent presheaf Γ † : { Θ : C op } ( γ : S ( F Θ → Γ)) → Set ω . A morphism f † : P (Γ † → f ∆ † ) displayed over a morphism f : S (Γ → ∆) is a dependentnatural transformation f † : { Θ : C op } ( γ : S ( F Θ → Γ)) → Γ † γ → ∆ † ( γ · f ) . Given an object
Γ : | C | , we define an object | Y | Γ of P displayed over F Γ by | Y | Γ { Θ } γ ≜ C (Θ → γ Γ) As this is both contravariant in Γ and covariant in Θ , this extends to a displayed functor Y : C → P . ▶ Proposition 19 (Externally) . The category P is equivalent to the comma category ( b C ↓ N F ) , where N F : S → b C is the composition of the Yoneda embedding よ S : S → b S with F ∗ : b S → b C . ◀ We prove several core properties of G : C (cid:95) P and Y : C → P .The first of these properties is the generalization of the Yoneda lemma to P . ▶ Lemma 20 (Externally) . There is a natural family of isomorphisms r : { Γ † : P }{ ∆ : C op } ( γ : S ( F ∆ → Γ)) → Γ † γ ≃ P ( | Y | ∆ → γ Γ † ) , whose components are given by r { Γ † } { ∆ } γ γ † ≜ λ { Θ } { δ } ( δ ′ : C (Θ → δ ∆)) γ † [ δ ′ ] r − { Γ † } { ∆ } γ γ ′ ≜ γ ′ { ∆ } { id F ∆ } id ∆ ◀▶ Proposition 21 (Externally) . The functor Y : C → P is fully faithful. Proof.
We prove that the actions of Y on displayed morphisms are bijective; this impliesthat its total actions are also bijective.Take two objects Γ and ∆ of C and a base morphism f : S ( F ∆ → F Γ). By Lemma 20,we have | Y | Γ f ≃ P ( | Y | ∆ → f | Y | Γ ); and | Y | Γ f = C (∆ → f Γ) by definition. This determinesa function C (∆ → f Γ) → P ( | Y | ∆ → f | Y | Γ ) that coincides with the action of Y on displayedmorphisms, which is therefore bijective. ◀▶ Proposition 22 (Externally) . The unit η Y : 1 Psh C ⇒ ( Y ! · Y ∗ ) is an isomorphism. Proof.
This follows from Y being fully faithful (see [15, Prop 4.23]). ◀ As both Y ! and Y ∗ admit dependent right adjoints, Proposition 22 induces coercion operationsinternally to Psh C and Psh P .In the following, R denotes the category of elements functor. ▶ Lemma 23 (Externally) . A dependent presheaf Y → X is locally representable exactly ifthe induced functor R Y → R X is a left adjoint. Proof.
An easy computation. ◀▶ Lemma 24 (Externally) . Let p : E → C be a Grothendieck fibration. Then pullback along p preserves left adjoints. . Bocquet and A. Kaposi and C. Sattler 25 Proof.
A standard fact. ◀ In the following, we switch freely between the point of view of a dependent presheaf over X and a map into X . In particular, a dependent presheaf over X is locally representableexactly if the corresponding map into X is a representable morphism. ▶ Corollary 25 (Externally) . Let p : E → C be a Grothendieck fibration. Let f ∈ Psh C ( Y → X ) be locally representable. Then p ∗ f ∈ Psh E ( p ∗ Y → p ∗ X ) is locally representable. Proof.
This is the combination of Lemma 23 and Corollary 25. For this, note that R p ∗ f isthe pullback of R f along p . ◀▶ Proposition 26 (Internally to
Psh P ) . For every locally representable presheaf A : (cid:181) g G ∗ → RepPsh S , the presheaf ( (cid:181) g G ∗ → A b g G ∗ ) is locally representable. Proof.
We have to show the judgment A : (cid:181) g G ∗ → RepPsh S ⊢ isRep( (cid:181) g G ∗ → A b g G ∗ ) . Inhabitants of this type correspond to local representability structures of the dependentpresheaf A : (cid:181) g G ∗ → RepPsh S ⊢ (cid:181) g G ∗ → A b g G ∗ . This is the image of the universal locallyrepresentable dependent presheaf A : RepPsh S ⊢ A under G ∗ . From Proposition 19, we seethat G ∗ is a Grothendieck fibration. We conclude by Corollary 25. ◀▶ Proposition 27 (Internally to
Psh P ) . Given an ω -small presheaf A : (cid:181) p Y ∗ → Psh C ω , thepresheaf ( (cid:181) p Y ∗ → A b p Y ∗ ) is locally representable. Proof.
We have to show the judgment A : (cid:181) g Y ∗ → Psh C ω ⊢ isRep( (cid:181) g Y ∗ → A b g Y ∗ ) . Inhabitantsof this type correspond to local representability structures of the dependent presheaf A : (cid:181) g Y ∗ → Psh S ω ⊢ (cid:181) g Y ∗ → A b g Y ∗ . This is the image of the universal dependent presheaf A : Psh S ⊢ A under Y ∗ . So it suffices to show the following: given an ω -small dependentpresheaf N over M in Psh C , the dependent presheaf Y ∗ N over Y ∗ M in Psh P is locallyrepresentable.Let us inspect the action of the functor Y ∗ on M : Psh C . From Appendix A, we have forΓ : C and Γ † : P (Γ) that | Y ∗ M | (Γ , Γ † ) consists of a dependent natural transformation(∆ : C op )( g : P ( Y ∆ , (Γ , Γ † ))) → | M | ∆ . Regarding C as displayed over S , this writes as(∆ S : S op )(∆ C : C op (∆ C ))( u : S (∆ S → Γ))( u † : P ( Y ∆ C → u Γ † )) → | M | ∆ C . By Lemma 20 (displayed Yoneda), this is naturally isomorphic to the type of dependentnatural transformations(∆ S : S op )(∆ C : C op (∆ C ))( u : S (∆ S → Γ))( u † : Γ † u )) → | M | ∆ C . Similarly, for a dependent presheaf N over M in Psh C , we can describe the dependentpresheaf Y ∗ N over Y ∗ M in Psh P as follows. Given Γ : C and Γ † : P (Γ) and α : | Y ∗ M | (Γ , Γ † ) ,then | Y ∗ N | (Γ , Γ † ) α is the type of dependent natural transformations(∆ S : S op )(∆ C : C op (∆ C ))( u : S (∆ S → Γ))( u † : Γ † u ) → | N | ( α ∆ S ∆ C u u † ) . We now show that Y ∗ N is locally representable. Let (Γ , Γ † ) be an object of P and α : | Y ∗ M | (Γ , Γ † ) . We have to define a representing object for the presheaf (over ( P / (Γ , Γ † )))( Y ∗ N ) | α : ((Ω , Ω † ) : P op )( ρ : S (Ω → Γ))( ρ † : P (Ω † → γ Γ † )) → Set (cid:12)(cid:12) ( Y ∗ N ) | α (cid:12)(cid:12) (Ω , Ω † ) ρ ρ † ≜ | Y ∗ N | (Ω , Ω † ) ( λ ∆ S ∆ C u u † α ∆ S ∆ C ( u · ρ ) ( ρ † u u † )) The extended context is (Γ , Γ ▷ ) whereΓ ▷ ∆ S ∆ C ( u : S (∆ S → Γ)) ≜ ( u † : Γ † ∆ S ∆ C u ) × ( n : | N | ∆ S ∆ C ( α ∆ S ∆ C u u † ))Note that this is only well-defined because N is ω -small.The projection morphism p : P (Γ ▷ → id Γ † ) forgets the component n . The generic element q : (cid:12)(cid:12) ( Y ∗ N ) | α (cid:12)(cid:12) (Γ , Γ ▷ ) id p is given by q ∆ S ∆ C u ( u † , n ) ≜ n .Finally, we have to check the universal property of the extended context. Given (∆ , ∆ † ) : P , a morphism from (Ω , Ω † ) to (Γ , Γ ▷ ) consists of a morphism ρ : S (Ω → Γ) and a dependentnatural transformation ρ ▷ : { ∆ S , ∆ C } → ( u : S (∆ S → Ω)) → Ω † u → Γ ▷ ( u · ρ ) . By definition of Γ ▷ , this is equivalently given by a pair of dependent natural transformations ρ † : { ∆ S , ∆ C } → ( u : S (∆ S → Ω)) → Ω † u → Γ † ( u · ρ ) ρ n : { ∆ S , ∆ C } → ( u : S (∆ S → Ω)) → ( u † : Ω † u ) → | N | ∆ S ∆ C ( α ∆ S ∆ C ( u · ρ ) ( ρ † u u † )) , i.e. by ρ † : P (Ω † → ρ Γ † ) and ρ n : (cid:12)(cid:12) ( Y ∗ N ) | α (cid:12)(cid:12) (Ω , Ω † ) ρ ρ † . This shows that (Γ , Γ ▷ ) satisfiesthe universal property of a representing object of ( Y ∗ N ) | α . ◀▶ Proposition 28 (Internally to
Psh P ) . For every ω -small presheaf A : (cid:181) p Y ∗ → Psh C ω , theunique map ( (cid:181) p Y ∗ → A b p Y ∗ ) → ( (cid:181) g G ∗ → ) preserves context extensions. Equivalently, the constant map ( (cid:181) g G ∗ → B b g G ∗ ) → (( (cid:181) p Y ∗ → A b p Y ∗ ) → ( (cid:181) g G ∗ → B b g G ∗ )) is an isomorphism for every B : (cid:181) g G ∗ → Psh S . Proof.
This follows from the fact that the projection map p : P ((Γ , Γ ▷ ) → (Γ , Γ † )) construc-ted in the proof of Proposition 27 is sent by G to the identity morphism id : S (Γ → Γ). ◀ We can now forget the definitions of P , G and Y , as we will only rely on these properties.We will work internally to Psh P , Psh C and Psh S and use the dependent right adjoints F ∗ , G ∗ , Y ∗ , Y ∗ and their compositions. There is actually, up to isomorphism, only a singlenew composite dependent right adjoint Y ∗ Y ∗ . We will most of the time use the tick variable f for F ∗ , g for G ∗ , y for Y ∗ and p for Y ∗ . We have the following isomorphisms and morphismsbetween DRAs. Y ∗ G ∗ ≃ F ∗ Y ∗ F ∗ ≃ G ∗ η Y : 1 Psh C ⇒ Y ∗ Y ∗ ε Y : Y ∗ Y ∗ ⇒ Psh P With our naming scheme for ticks variables, they induce the following coercion operations[ ⁄ : yg ≃ f ] [ ⁄ : pf ≃ g ] [ ⁄ : • ≃ yp ] [ ⁄ : py ⇒ • ] ▶ Construction 29.
We construct a displayed model with context extensions S † over G : P (cid:95) S . Furthermore, we equip Y : C → P with actions on displayed types and terms thatpreserve all displayed type-theoretic operations. . Bocquet and A. Kaposi and C. Sattler 27 Construction.
We pose, internally to
Psh P , Ty † : { i } ( A : (cid:181) g G ∗ → Ty S i ) → Psh P Ty † A ≜ (cid:181) p Y ∗ → Ty • ( λ (cid:181) f F ∗ ( A b g G ∗ )[ ⁄ : pf ≃ g ]) Tm † : { i, A } ( A † : Ty † i A )( a : (cid:181) g G ∗ → Tm S ( A b g G ∗ )) → Psh P Tm † { A } A † a ≜ (cid:181) p Y ∗ → Tm • ( A † b p Y ∗ ) ( λ (cid:181) f F ∗ ( a b g G ∗ )[ ⁄ : pf ≃ g ])By Proposition 26, the family ( (cid:181) g G ∗ → Tm S ( A b g G ∗ )) is locally representable. By Proposi-tion 27, the family Tm † A † a is also locally representable. Thus by Proposition 16( a : (cid:181) g G ∗ → Tm S ( A b g G ∗ )) × ( a † : Tm † A † a )is a locally representable family of presheaves. The fact that the first projection map( a : (cid:181) g G ∗ → Tm S ( A b g G ∗ )) × ( a † : Tm † A † a ) λ ( a,a † ) a −−−−−−−→ ( (cid:181) g G ∗ → Tm S ( A b g G ∗ ))preserves context extensions follows from Proposition 28.The isomorphism ( Y ! · Y ∗ ) ≃ Psh C induces, internally to Psh C , isomorphisms Y Ty : { i }{ A : (cid:181) f F ∗ → Ty S i }→ Ty • A ≃ ( (cid:181) y Y ∗ → Ty † ( λ (cid:181) g G ∗ ( A b f F ∗ )[ ⁄ : yg ≃ f ])) Y Ty A • ≜ λ (cid:181) y Y ∗ (cid:181) p Y ∗ A • [ ⁄ : yp ≃ • ] Y Ty , − A † ≜ ( A † b y Y ∗ b p Y ∗ )[ ⁄ : • ≃ yp ] Y Tm : { i, A }{ A • }{ a : (cid:181) f F ∗ → Tm S ( A b f F ∗ ) }→ Tm • A • a ≃ ( (cid:181) y Y ∗ → Tm † ( Y Ty A • b y Y ∗ ) ( λ (cid:181) g G ∗ ( a b f F ∗ )[ ⁄ : yg ≃ f ])) Y Tm a • ≜ λ (cid:181) y Y ∗ (cid:181) p Y ∗ a • [ ⁄ : yp ≃ • ] Y Tm , − a † ≜ ( a † b y Y ∗ b p Y ∗ )[ ⁄ : • ≃ yp ]We have more generally bijective actions on dependent types and terms. Given, internallyto Psh C , the data ofA presheaf X S : (cid:181) f F ∗ → Psh S ,A dependent presheaf X • : ( (cid:181) f F ∗ → X S b f F ∗ ) → Psh C ,A dependent presheaf X † : (cid:181) y Y ∗ → ( (cid:181) g G ∗ → ( X S b f F ∗ )[ ⁄ : yg ≃ f ]) → Psh P ,A family of bijections Y X : { x : (cid:181) f F ∗ → X S b f F ∗ }→ X • x ≃ ( (cid:181) y Y ∗ → X † b y Y ∗ ( λ (cid:181) g G ∗ ( x b f F ∗ )[ ⁄ : yg ≃ f ])) , we construct isomorphisms Y [ X ] Ty : { i }{ A : (cid:181) f F ∗ → X S b f F ∗ → Ty i }→ ( { x } ( x • : X • x ) → Ty • ( λ (cid:181) f F ∗ A b f F ∗ ( x b f F ∗ ))) ≃ ( (cid:181) y Y ∗ { x } ( x † : X † b y Y ∗ x ) → Ty † ( λ (cid:181) g G ∗ ( A b f F ∗ )[ ⁄ : yg ≃ f ] ( x b g G ∗ ))) Y [ X ] Ty A • ≜ λ (cid:181) y Y ∗ x † (cid:181) p Y ∗ A • [ ⁄ : yp ≃ • ]( Y X, − [ ⁄ : yp ≃ • ] ( λ (cid:181) y ′ Y ∗ x † [ ⁄ : py ′ ⇒ • ])) Y [ X ] Ty , − A † ≜ λ x • ( A † b y Y ∗ ( Y X x • b y Y ∗ ) b p Y ∗ )[ ⁄ : • ≃ yp ] Y [ X ] Tm : { i }{ A : (cid:181) f F ∗ → X S b f F ∗ → Ty i }{ a : (cid:181) f F ∗ ( x : X S b f F ∗ ) → Tm ( A b f F ∗ x ) }{ A • : { x } ( x • : X • x ) → Ty • ( λ (cid:181) f F ∗ A b f F ∗ ( x b f F ∗ )) }→ ( { x } ( x • : X • x ) → Tm • ( A • x • ) ( λ (cid:181) f F ∗ a b f F ∗ ( x b f F ∗ ))) ≃ ( (cid:181) y Y ∗ { x } ( x † : X † b y Y ∗ x ) → Tm † ( Y [ X ] Ty A • b y Y ∗ x † ) ( λ (cid:181) g G ∗ ( a b f F ∗ )[ ⁄ : yg ≃ f ] ( x b g G ∗ ))) Y [ X ] Tm a • ≜ λ (cid:181) y Y ∗ x † (cid:181) p Y ∗ a • [ ⁄ : yp ≃ • ]( Y X, − [ ⁄ : yp ≃ • ] ( λ (cid:181) y ′ Y ∗ x † [ ⁄ : py ′ ⇒ • ])) Y [ X ] Tm , − a † ≜ λ x • ( a † b y Y ∗ ( λ (cid:181) p Y ∗ x • [ ⁄ : yp ≃ • ]) b p Y ∗ )[ ⁄ : • ≃ yp ]In particular we obtain bijective actions of Y on every derived sort of the theory.It remains to define the type-theoretic operations of S † . Each operation of S † should bederived from the corresponding operation of S • . We want all of the displayed operations tobe preserved by Y Ty and Y Tm . This translates to the following equations, internally to Psh C . Y Ty N • b y Y ∗ = N † Y Tm ( suc • n • ) b y Y ∗ = suc † ( Y Tm n • b y Y ∗ ) Y Ty (Π • A • B • ) b y Y ∗ = Π † ( Y Tm A • b y Y ∗ ) ( Y [ Tm ] Ty B • b y Y ∗ )To define N † , zero † , etc., we essentially have solve these equations. We look for candidateswith the following shape (where n ‡ , A ‡ , B ‡ , etc., are still to be determined). N † = (cid:181) p Y ∗ N • suc † = λ n † (cid:181) p Y ∗ suc • n ‡ ( n † , b p Y ∗ )Π † = λ A † B † (cid:181) p Y ∗ Π • A ‡ ( A † , b p Y ∗ ) B ‡ ( B † , b p Y ∗ )The following equations should then hold internally to Psh P . λ (cid:181) p Y ∗ suc • n • = λ (cid:181) p Y ∗ suc • n ‡ ( Y Tm n • b y Y ∗ , b p Y ∗ ) λ (cid:181) p Y ∗ Π • A • B • = λ (cid:181) p Y ∗ Π • A ‡ ( Y Ty A • b y Y ∗ , b p Y ∗ ) B ‡ ( Y [ Tm ] Ty B • b y Y ∗ , b p Y ∗ )We use the following definitions for n ‡ , A ‡ and B ‡ . n ‡ ( n † , b p Y ∗ ) ≜ n † b p Y ∗ A ‡ ( A † , b p Y ∗ ) ≜ A † b p Y ∗ B ‡ ( B † , b p Y ∗ ) ≜ λ a • ( B † [ ⁄ : py ⇒ • ] ( Y Tm a • b y Y ∗ ) b q Y ∗ )[ ⁄ : • ≃ yq ]In general, we have to solve equations of the form y ‡ ( Y [ X ] Ty y • b y Y ∗ , b p Y ∗ ) = y • . or y ‡ ( Y [ X ] Tm y • b y Y ∗ , b p Y ∗ ) = y • . They admit solutions with the following shape: y ‡ ( y † , b p Y ∗ ) ≜ λx • ( y † [ ⁄ : py ⇒ • ] ( Y X x • b y Y ∗ ) b q Y ∗ )[ ⁄ : • ≃ yq ] . This provides a definition of all displayed type-theoretic operations of S † . These operationssatisfy the equations that hold in S • . ◀ . Bocquet and A. Kaposi and C. Sattler 29 Recall the definition of relative section. ▶ Definition 10 (Externally) . A relative section s α of a factorization ( C Y −→ P G −→ S , S † ) of a displayed model without context extensions S • over F : C → S consists of a section s of the displayed model with context extensions S † along with a natural transformation α : Y ⇒ ( F · s ) such that ( α · G ) = 1 F . ⌟ We now show how the actions of s α on types and terms can be derived internally to C .The actions of s α on types and terms are defined using the actions of s , the coercion[ ⁄ α ! : y ⇒ fs ] induced by α ! : Y ! ⇒ ( F ! · s ! ) and the inverse of the actions of Y on displayedtypes and terms. s Ty α : { i } ( A : (cid:181) F ∗ → Ty S i ) → Ty • As Ty α A ≜ Y Ty , − ( λ (cid:181) y Y ∗ ( s Ty ( A b f F ∗ ) b s s ∗ )[ ⁄ α ! : y ⇒ fs ]) s Tm α : { i }{ A : (cid:181) F ∗ → Ty S i } ( a : (cid:181) F ∗ → Tm S ( A b F ∗ )) → Ty • ( s Ty α A ) as Tm α a ≜ Y Tm , − ( λ (cid:181) y Y ∗ ( s Tm ( a b f F ∗ ) b s s ∗ )[ ⁄ α ! : y ⇒ fs ])The more general actions on dependent types and terms are defined given the data of X S : (cid:181) f F ∗ → Psh S X • : ( x : (cid:181) f F ∗ → X S b f F ∗ ) → Psh C X † : (cid:181) fs F ∗ s ∗ ( x : (cid:181) g G ∗ → ( X S b f F ∗ )[ ⁄ : sg ≃ • ]) → Psh P Y X : { x : (cid:181) f F ∗ → X S b f F ∗ } → X • x ≃ ( (cid:181) y Y ∗ → ( X † b fs F ∗ s ∗ )[ ⁄ α : y ⇒ fs ] ( λ (cid:181) g G ∗ ( x b g G ∗ )[ ⁄ : f ≃ yg ])) s X : (cid:181) f F ∗ ( x : X S b f F ∗ ) (cid:181) s s ∗ → X † b fs F ∗ s ∗ ( λ (cid:181) g G ∗ x [ ⁄ : sg ≃ • ])such that the total action of s X preserves virtual context extensions. s [ X ] Ty α : { i } ( A : (cid:181) F ∗ ( x : X S b F ∗ ) → Ty S i ) { x : (cid:181) F ∗ → X S b F ∗ } ( x • : X • x ) → Ty • ( A ⊛ x ) s [ X ] Ty α A ≜ Y [ X ] Ty , − ( λ (cid:181) y Y ∗ ( s [ X ] Ty ( A b f F ∗ ) b s s ∗ )[ ⁄ α ! : y ⇒ fs ]) s [ X ] Tm α : { i, A } ( a : (cid:181) F ∗ ( x : X S b F ∗ ) → Tm S ( A b F ∗ x )) { x : (cid:181) F ∗ → X S b F ∗ } ( x • : X • x ) → Tm • ( s [ X ] Ty α A x • ) ( a ⊛ x ) s [ X ] Tm α a ≜ Y [ X ] Tm , − ( λ (cid:181) y Y ∗ ( s [ X ] Tm ( a b f F ∗ ) b s s ∗ )[ ⁄ α ! : y ⇒ fs ])These actions preserve all type-theoretic operations. This follows from the fact that theactions of s and Y on types and terms preserve the type-theoretic operations. We give thedetailed proof for N , suc and Π. s [ X ] Ty α ( λ (cid:181) f F ∗ x N ) = Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † ( s [ X ] Ty N b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : y ⇒ fs ])(definition of s [ X ] Ty α )= Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † N † [ ⁄ α ! : y ⇒ fs ])( s [ X ] Ty preserves N )= Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † N † )(commutation with − [ ⁄ α ! : fs ⇒ y ])= N • ( Y [ X ] Ty preserves N ) s [ X ] Tm α ( λ (cid:181) f F ∗ x suc ( n b f F ∗ x ))= Y [ X ] Tm , − ( λ (cid:181) y Y ∗ { x } x † ( s [ X ] Tm ( λ x suc ( n b f F ∗ x )) b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : y ⇒ fs ])(definition of s [ X ] Tm α )= Y [ X ] Tm , − ( λ (cid:181) y Y ∗ { x } x † ( suc † ( s [ X ] Tm ( λ x n b f F ∗ ) b s s ∗ ( x † b s s ∗ )))[ ⁄ α ! : y ⇒ fs ])( s [ X ] Tm preserves suc )= Y [ X ] Tm , − ( λ (cid:181) y Y ∗ { x } x † suc † ( s [ X ] Tm ( λ x n b f F ∗ ) b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : y ⇒ fs ])(commutation with − [ ⁄ α ! : fs ⇒ y ])= suc • ( Y [ X ] Tm , − ( λ (cid:181) y Y ∗ { x } x † ( s [ X ] Tm ( λ x n b f F ∗ ) b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : y ⇒ fs ]))( Y [ X ] Tm preserves suc )= suc • ( s [ X ] Tm α n ) (definition of s [ X ] Tm α ) s [ X ] Ty α ( λ (cid:181) f F ∗ x Π ( A b f F ∗ x ) ( B b f F ∗ x ))= Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † ( s [ X ] Ty ( λ x Π ( A b f F ∗ x ) ( B b f F ∗ x )) b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : fs ≃ y ])(definition of s [ X ] Ty α )= Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † (Π † ( s [ X ] Ty A b s s ∗ ( x † b s s ∗ )) ( s [ X, Tm ] Ty B b s s ∗ ( x † b s s ∗ )))[ ⁄ α ! : fs ≃ y ])( s [ X ] Ty preserves Π)= Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † Π † ( s [ X ] Ty A b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : fs ≃ y ]( s [ X, Tm ] Ty B b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : fs ≃ y ])(commutation with − [ ⁄ α ! : fs ⇒ y ])= Π • ( Y [ X ] Ty , − ( λ (cid:181) y Y ∗ { x } x † ( s [ X ] Ty A b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : fs ≃ y ]))( Y [ X, Tm ] Ty , − ( λ (cid:181) y Y ∗ { x } x † ( s [ X, Tm ] Ty B b s s ∗ ( x † b s s ∗ ))[ ⁄ α ! : fs ≃ y ]))( Y [ X ] Ty preserves Π)= Π • ( s [ X ] Ty α A ) ( s [ X, Tm ] Ty α B ) (definitions of s [ X ] Ty α and s [ X, Tm ] Ty α )We can already prove the induction principle corresponding to {⋄} → T , Lemma 11. ▶ Lemma 11 (Externally) . Denote by {⋄} the terminal category (which should rather beseen here as the initial category equipped with a terminal object), and consider the functor F : {⋄} → T that selects the empty context of T .Any global displayed model without context extensions over F admits a relative section. Proof.
We apply the constructions of this subsection to F : {⋄} → T . {⋄} P T F Y G s
Construction 29 provides a displayed model S † over G : P → T . By biinitiality of T ,we have a section s of S † . Since Y , F and s all preserve terminal objects, we have a naturalisomorphism α : Y ≃ ( F · s ). This determines a relative section s α of S • . ◀ C.5 Displayed inserters
We fix two parallel displayed functors
K, L : C → D over a base category S . . Bocquet and A. Kaposi and C. Sattler 31 C DS
F KL G ▶ Definition 30 (Externally) . The displayed inserter of K and L is a displayed category I : I (cid:95) C over C .A object of I displayed over an object x of C is a displayed morphism β x : D ( K x → id F x
L x ) . A morphism of I from β x to β y displayed over f : C ( x → y ) is a proof of the commutationof the square K x L xK y L y β x K f L fβ y There is natural transformation β : IK ⇒ IL formed by the morphisms β x .The category I satisfies the following universal property: for every category A along witha functor A : A → C and a natural transformation γ : AK ⇒ AL , there exists a uniquefunctor B : A → I such that A = BI and γ = Bβ . ▶ Proposition 31 (Internally to
Psh I ) . Assume give locally representable presheaves A S : (cid:181) if I ∗ F ∗ → RepPsh S A C : (cid:181) i I ∗ → RepPsh C A D : (cid:181) il I ∗ L ∗ → RepPsh D along with actions of K , L and G on these presheaves K A : (cid:181) i I ∗ → A C b i I ∗ → (cid:181) k K ∗ → ( A D b il I ∗ F ∗ )[ ⁄ β ! : ik ⇒ il ] L A : (cid:181) i I ∗ → A C b i I ∗ → (cid:181) l L ∗ → A D b il I ∗ L ∗ G A : (cid:181) ik I ∗ L ∗ → A D b il I ∗ L ∗ → (cid:181) g G ∗ → ( A S b if I ∗ F ∗ )[ ⁄ : lg ≃ f ] such that L A and G A preserve context extensions and the two composed actions of F on A coindide, i.e. the equality ( G A b il I ∗ L ∗ ( L A b i I ∗ a b l L ∗ ) b g G ∗ )[ ⁄ : f ≃ lg ]= (( G A b il I ∗ L ∗ )[ ⁄ β ! : ik ⇒ il ] ( K A b i I ∗ a b k K ∗ ) b g G ∗ )[ ⁄ : f ≃ kg ] holds over the context ( (cid:181) i I ∗ , a : A C b i I ∗ , (cid:181) f F ∗ ) .Then the presheaf A I ≜ (cid:181) i I ∗ → { a : A C b i I ∗ | (cid:181) k K ∗ → ( K A b i I ∗ a b k K ∗ ) = ( L A b i I ∗ a b l L ∗ )[ ⁄ β ! : ik ⇒ il ] } is locally representable and the first projection map I A : A I → (cid:181) i I ∗ → A C b i I ∗ preserves context extensions. Proof.
We translate the statement externally. Fix an object ( x, β x ) of I . We have locallyrepresentable dependent presheaves A S : { y : S op } ( ρ : S ( y → F x )) → Set A C : { y : C op } ( ρ : C ( y → x )) → Set A D : { y : D op } ( ρ : D ( y → L x )) → Set and dependent natural transformations K A : { y : C op } ( ρ : C ( y → x )) → A C ρ → A D ( K ρ · β x ) L A : { y : C op } ( ρ : C ( y → x )) → A C ρ → A D ( L ρ ) G A : { y : D op } ( ρ : C ( y → L x )) → A D ρ → A S ( G ρ )such that L A and G A preserves context extensions and such that for every ρ : C ( y → x ) and a : A C ρ , we have G A ( L ρ ) ( L A ρ a ) = G A ( K ρ · β x ) ( K A ρ a ).We have to show that the dependent presheaf A I : { ( y, β y ) : I op } ( ρ : I (( y, β y ) → ( x, β x ))) → Set A I { ( y, β y ) } ρ ≜ { a : A C ρ | K A ρ a = ( L A ρ a )[ β y ] } is locally representable.Fix some object ( y, β y ) of I along with ρ : I (( y, β y ) → ( x, β x )). Recall that ρ is amorphism ρ : C ( y → x ) such that β y · K ρ = L ρ · β x .We have to show that the presheaf A I | ( y,β y ) : { z : I op } ( σ : I ( z → ( y, β y ))) → Set A I | ( y,β y ) σ ≜ A I ( σ · ρ )is representable.We know that A C | y and A D | L y are representable and that L A preserves context extensions.Thus we have some representing object p : C ( y ▷ → y ) of A C | y , and we know that L p : D ( L y ▷ → L y ) is a representing object of A D | L y . We have a generic element q : A C ( p · ρ )for A C | y , and L A ( p · ρ ) q : A D ( L ( p · ρ )) is a generic element for A D | L y .We construct a morphism β y ▷ : D ( K y ▷ → L y ▷ ) such that the square K y ▷ L y ▷ K y L y K p β y ▷ L p β y commutes and such that G β y ▷ = id F y .By the universal property of
L y ▷ , we define β y ▷ as the extension of K p · β y by theelement K A ( p · ρ ) q : A D ( K p · β y · L ρ ). β y ▷ ≜ (cid:10) K p · β y , K A ( p · ρ ) q (cid:11) . . Bocquet and A. Kaposi and C. Sattler 33 We can then compute
G β y ▷ = G (cid:10) K p · β y , K A ( p · ρ ) q (cid:11) = (cid:10) G ( K p ) · G β y , G A ( K ( p · ρ ) · β x ) ( K A ( p · ρ ) q ) (cid:11) = (cid:10) G ( L p ) , G A ( L ( p · ρ )) ( L A ( p · ρ ) q ) (cid:11) = G (cid:10) L p , L A ( p · ρ ) q (cid:11) = G ( L ⟨ p , q ⟩ )= id This defines an object ( y ▷ , β y ▷ ) of I , equipped with a projection p into ( y, β y ). Itremains to show that this object represents A I | ( y,β y ) .Fix an object ( z, β z ) of I along with a morphism σ : I (( z, β z ) → ( y, β z )). We knowthat factorizations of σ : C ( z → y ) through p : C ( y ▷ → y ) are in natural bijection withelements of A C ( σ · ρ ). We extend this bijection to I . Because a displayed morphism of I over a morphism of C only consists of propositional data, we only need to construct a logicalequivalence at the level of A I .Take an element a : A I ( σ · ρ ). By the universal property of y ▷ , we have an extendedmorphism ⟨ σ, a ⟩ : C ( z → y ▷ ). Let’s show that the square K z L zK y ▷ L y ▷ β z K ⟨ σ,a ⟩ L ⟨ σ,a ⟩ β y ▷ commutes.By the universal property of L y ▷ , both K ⟨ σ, a ⟩ · β y ▷ and β z · L ⟨ σ, a ⟩ can be written asthe extension of some morphism in D ( K z → L y ) by some element of A D . We compute K ⟨ σ, a ⟩ · a y ▷ = K ⟨ σ, a ⟩ · (cid:10) K p · β y , K A ( p · ρ ) q (cid:11) = (cid:10) K ( ⟨ σ, a ⟩ · p ) · β y , ( K A ( p · ρ ) q )[ K ⟨ σ, a ⟩ ] (cid:11) = (cid:10) K σ · β y , ( K A ( p · ρ ) q )[ K ⟨ σ, a ⟩ ] (cid:11) = (cid:10) K σ · β y , K A ( σ · ρ ) a (cid:11) and β z · L ⟨ σ, a ⟩ = β z · (cid:10) L σ, L A ( σ · ρ ) a (cid:11) = (cid:10) β z · L σ, ( L A ( σ · ρ ) a )[ β z ] (cid:11) Now
K σ · β y = β z · L σ because σ is a morphism of I , and K A ( σ · ρ ) a = ( L A ( σ · ρ ) a )[ β z ]because a is an element of A I . Thus we have K ⟨ σ, a ⟩ · β y ▷ = β z · L ⟨ σ, a ⟩ , as needed.This concludes the proof that A I | ( y,β y ) is representable. The dependent presheaf A I isthus locally representable.Finally, we also have to check that the representing objects that we have constructed arenatural in ( x, β x ). This follows from the fact that the representing objects of A C are naturalin x . ◀ We now return to the setting of our induction principles. We fix a base model S of T ,a functor F : C → S equipped with a displayed model without context extensions S • , afactorization ( C Y −→ P G −→ S , S † ) and a section s of S † . We let I be the displayed inserter of Y and F · s . From the point of view of I , the relative section of S • already exists. When workinginternally to Psh C over a context that ends in ( − , (cid:181) i I ∗ ), we can define actions s [ X ] Ty β and s [ X ] Tm β by following the same construction as in the presence of a global natural transformation Y ⇒ ( F · s ).We can specialize Proposition 31 to this situation. ▶ Proposition 32 (Internally to
Psh I ) . Assume given the following data:A locally representable presheaf A S : (cid:181) if I ∗ F ∗ → RepPsh S .A dependent presheaf A • : (cid:181) i I ∗ → ( (cid:181) f F ∗ → A S b if I ∗ F ∗ ) → Psh C .A dependent presheaf A † : (cid:181) ifs I ∗ F ∗ s ∗ → ( (cid:181) g G ∗ → ( A S b if I ∗ F ∗ )[ ⁄ : sg ≃ • ]) → Psh S suchthat the first projection map ( a : (cid:181) g G ∗ → ( A S b if I ∗ F ∗ )[ ⁄ : sg ≃ • ]) × ( a † : A † b ifs I ∗ F ∗ s ∗ a ) λ ( a,a † ) a −−−−−−−→ ( (cid:181) g G ∗ → ( A S b f F ∗ )[ ⁄ : sg ≃ • ]) has a locally representable domain and preserves context extensions.A bijective action Y A : (cid:181) i I ∗ { a : (cid:181) f F ∗ → A S b if I ∗ F ∗ } → A • b i I ∗ a ≃ ( (cid:181) y Y ∗ → ( A † b ifs I ∗ F ∗ s ∗ )[ ⁄ β ! : iy ⇒ ifs ] ( λ (cid:181) g G ∗ ( a b g G ∗ )[ ⁄ : f ≃ yg ])) . An action s A : (cid:181) if I ∗ F ∗ ( a : A S b if I ∗ F ∗ ) (cid:181) s s ∗ → A † b ifs I ∗ F ∗ s ∗ ( λ (cid:181) g G ∗ a [ ⁄ : sg ≃ • ]) whose induced total action preserves context extensions.A locally representable presheaf A C : (cid:181) i I ∗ → RepPsh C .An action F A : (cid:181) i I ∗ → A C b i I ∗ → (cid:181) f F ∗ → A S b if I ∗ F ∗ that preserves context extensions.A map f : (cid:181) i I ∗ → ( a : A C b i I ∗ ) → A • b if I ∗ F ∗ ( F A b i I ∗ a ) .We pose s Aβ : (cid:181) i I ∗ ( a : (cid:181) f F ∗ → A S b if I ∗ F ∗ ) → A • b i I ∗ as Aβ b i I ∗ a ≜ Y A, − ( λ (cid:181) y Y ∗ ( s A ( a b f F ∗ ) b s s ∗ )[ ⁄ β ! : iy ⇒ ifs ]) Then the presheaf A I ≜ { a : (cid:181) i I ∗ → A C b i I ∗ | (cid:181) i I ∗ → s Aβ b i I ∗ ( λ (cid:181) f F ∗ F A b i I ∗ ( a b i I ∗ ) b f F ∗ ) = f b i I ∗ ( a b i I ∗ ) } is locally representable and the first projection map A I → (cid:181) i I ∗ → A C b i I ∗ preserves context extensions. Proof.
This follows from Proposition 31, applied to the following presheaves B S b if I ∗ F ∗ ≜ A S b if I ∗ F ∗ B C b i I ∗ ≜ ( a : (cid:181) f F ∗ → A S b if I ∗ F ∗ ) × ( A • b i I ∗ a ) B P b ifs I ∗ F ∗ s ∗ ≜ ( a : (cid:181) g G ∗ → ( A S b if I ∗ F ∗ )[ ⁄ : sg ≃ • ]) × ( A † b ifs I ∗ F ∗ s ∗ a ) . Bocquet and A. Kaposi and C. Sattler 35 and to the following actions Y A b i I ∗ a b y Y ∗ ≜ ( λ (cid:181) g G ∗ ( F A b i I ∗ a b f F ∗ )[ ⁄ : yg ≃ f ] , Y A b i I ∗ ( f b i I ∗ a ) b y Y ∗ )( F · s ) A b i I ∗ a b fs F ∗ s ∗ ≜ ( λ (cid:181) g G ∗ ( F A b i I ∗ a b f F ∗ )[ ⁄ : gs ≃ • ] , s A b if I ∗ F ∗ ( F A b i I ∗ a b f F ∗ ) b s s ∗ ) G A b ifs I ∗ F ∗ s ∗ ( a, − ) b g G ∗ ≜ a b g G ∗ ◀ We can now prove the induction principle associated to
Ren → T . ▶ Lemma 13 (Externally) . Let • T be a global displayed model without context extensionsover F : Ren → T , along with a map var • : { i }{ A : (cid:181) F ∗ → Ty i } ( A • : Ty • A )( a : Var A ) → Tm • A • ( var a ) . Then there exists a relative section s α of • T . It satisfies the additional computation rule s Tm ( var { A } a ) = var • ( s Ty A ) a . Proof of Lemma 13.
We apply Construction 29 to F : Ren → T . By biinitiality of T ,we have a section s of † T . We can now consider the inserter category I . IRen P T I F Y G s
We equip I with the structure of a renaming algebra over T . Internally to Psh I , wedefine Var I : { i } ( A : (cid:181) if I ∗ F ∗ → Ty i ) → Psh I Var I A ≜ { a : (cid:181) i I ∗ → Var
Ren ( A b i I ∗ ) | (cid:181) i I ∗ → s Tm β b i I ∗ ( var ( a b i I ∗ )) = var • ( s Ty β b i I ∗ ( A b i I ∗ )) ( a b i I ∗ ) } By Proposition 31,
Var I is a family of locally representable presheaves. The universalproperty of Ren then provides a section t of I : I → Ren , up to some natural isomorphism tI ≃ Ren which provides an internal coercion operation [ ⁄ : ti ≃ • ]. This determines arelative section s t · β of • T .The section t : Ren → I comes with an action on variables. Internally to Psh
Ren , wehave, for every a : Var
Ren A , an element t Var a : (cid:181) t t ∗ → Var I ( λ (cid:181) i I ∗ A [ ⁄ : ti ≃ • ]) whosefirst projection is a . By definition of Var I , the second projection shows that the relativesection s t · β satisfies the desired computation rule, s Tm t · β ( var a ) = var • ( s Ty t · β A ) a. ◀ D Additional examples
We give here the induction principles corresponding to the functors □ → CTT and A □ → CTT into the initial model of (cartesian) cubical type theory (
CTT ). For our purposes, a model of
CTT is a category S equipped with the structure of a modelof T , a representable interval presheaf I S : RepPsh S equipped with two endpoints 0 S , S : I S ,and possibly other type-theoretic operations (paths type, glue types, etc.).A displayed model without context extensions of CTT over a functor F : C → S consistsof a displayed model of T without context extensions, a dependent interval presheaf I • :( (cid:181) f F ∗ → I S ) → Psh C , the displayed endpoints 0 • : I • ( λ (cid:181) f F ∗ S ) and 1 • : I • ( λ (cid:181) f F ∗ S ),and possibly some other displayed type-theoretic operations (displayed path types and gluetypes, etc.). ▶ Definition 33 (Externally) . A (cartesian) cubical algebra over a model S of CTT is acategory C with a terminal object, along with a functor F : C → S preserving the terminalobject, a locally representable interval presheaf I C : RepPsh C with two endpoints C , C : I C and an action int : I C → (cid:181) F ∗ → I S that preserves context extensions and the endpoints.The category of cubes □ S over a model S is defined as the biinitial cubical algebra over S .We denote by □ the category of cubes of the biinitial model CTT of cubical type theory. ⌟▶ Lemma 34 (Externally) . Let • CTT be a global displayed model without context extensionsover F : □ → CTT , along with a map int • : ( i : I □ ) → I • ( int i ) such that int • □ = 0 • and int • □ = 1 • .Then there exists a relative section s α of • CTT . It satisfies the additional computationrule s Tm α ( int i ) = int • i . Proof.
We apply Construction 29 to F : □ → CTT . By biinitiality of CTT , we have asection s of † CTT . We can now consider the inserter category I . I □ P CTT
I F Y G s
We equip I with the structure of a cubical algebra over CTT . Internally to
Psh I , wedefine I I : Psh I I I ≜ { i : (cid:181) i I ∗ → I □ | (cid:181) i I ∗ → s I β b i I ∗ ( int ( i b i I ∗ )) = int • ( i b i I ∗ ) } I , I : I I I ≜ λ (cid:181) i I ∗ □ I ≜ λ (cid:181) i I ∗ □ . Bocquet and A. Kaposi and C. Sattler 37 We can verify that the required equations hold: s I β b i I ∗ ( int □ )= s I β b i I ∗ ( λ (cid:181) f F ∗
0) ( int preserves 0)= 0 • ( s I β preserves 0)= int • □ (by assumption)By Proposition 31, I I is locally representable. The universal property of □ then providesa section t of I : I → □ , up to some natural isomorphism tI ≃ □ which provides an internalcoercion operation [ ⁄ : ti ≃ • ]. This determines a relative section s t · β of • CTT .The action of t on the interval proves the computation rule s Tm t · β ( int i ) = int • i . ◀▶ Definition 35 (Externally) . A (cartesian) cubical atomic algebra over a model S of CTT is a category C with a terminal object, along with a functor F : C → S preserving theterminal object and with the structures of a cubical algebra ( I C , C , C , int ) and of a renamingalgebra ( Var C , var ).The category of cubical atomic contexts A □ is the biinitial cubical algebra over the biinitialmodel CTT of cubical type theory. ⌟▶ Lemma 36 (Externally) . Let • CTT be a global displayed model without context extensionsover F : A □ → CTT , along with maps var • : { i }{ A : (cid:181) F ∗ → Ty i } ( A • : Ty • A )( a : Var A ) → Tm • A • ( var a ) . and int • : ( i : I A □ ) → I • ( int i ) such that int • A □ = 0 • and int • A □ = 1 • .Then there exists a relative section s α of • CTT , satisfying the additional computationrules s Tm α ( var { A } a ) = var • ( s Ty A ) a and s Tm α ( int i ) = int • i . Proof.
Similar to the proofs of Lemma 13 and Lemma 34. ◀ E Details of the normalization proof
We list below the constructors of the inductive families Ne and Nf . var ne : { i, A } ( a : Var A ) → Ne i ( var a ) app ne : { i, A, B, f, a } → Ne f → Nf a → Ne ( app $ { A } ⊛ { B } ⊛ f ⊛ a ) elim ne N : { i, P, z, s, n } → (( m : Var ( λ (cid:181) F ∗ N )) → NfTy i ( P ⊛ var m )) → (( m : Var ( λ (cid:181) F ∗ N ))( p : Var ( P ⊛ var m )) → Nf ( s ⊛ var m ⊛ var p )) → Nf z → Ne n → Ne ( elim N $ P ⊛ s ⊛ z ⊛ n ) ne nf N : { a } → Ne { (cid:181) F ∗ → N } a → Nf a ne neEl : { i, j, A } → ( i ≤ j ) → Ne { (cid:181) F ∗ → U i } ( El − $ A ) → Ne { Lift ji $ A } a → Nf j a zero nf : Nf zerosuc nf : { n } → Nf n → Nf ( suc n ) lam nf : { i, A, B, b } → (( a : Var A ) → Nf ( b ⊛ var a )) → Nf i ( lam $ { A } ⊛ { B } ⊛ b ) ne nfty U : { i, j, A } → ( i ≤ j ) → Ne { (cid:181) F ∗ → U i } ( El − $ A ) → NfTy j ( Lift ji $ A ) U nfty : { i, j } → ( i < j ) → NfTy j ( (cid:181) F ∗ → Lift ji +1 U i ) N nfty : { i } → NfTy i ( (cid:181) F ∗ → Lift i N )Π nfty : { i, A, B } → NfTy i A → (( a : Var A ) → NfTy i ( B ⊛ var a )) → NfTy i (Π $ A ⊛ B )The lifting function on displayed types is defined as follows. Lift • i : { A } ( A • : Ty • i A ) → Ty • i +1 ( Lift $ A )( Lift • i A • ) nfty ≜ Lift nfty i A nfty ( Lift • i A • ) p a ≜ A • p ( lift − i $ a )( Lift • i A • ) ne a ne ≜ A • ne ( lift ne , − i a ne )( Lift • i A • ) nf a • ≜ lift nf i ( A • nf a • )The definition of the displayed universes of the normalization displayed model is below. U • i : Ty • i +1 ( λ (cid:181) F ∗ U i ) U • i, nfty ≜ U nfty i U • i,p ≜ λA Ty • i ( El $ A )( U • i, ne { A } A ne ) nfty ≜ ne nfty U A ne ( U • i, ne { A } A ne ) p ≜ λa Ne a ( U • i, ne { A } A ne ) ne ≜ λa ne a ne ( U • i, ne { A } A ne ) nf ≜ λa ne ne nfEl a ne U • i, nf { A } A • ≜ A • nfty The most interesting part is the component U • i, ne that constructs a displayed type over anyneutral element of the universe; any element of a neutral type is itself neutral.For Π-types, the logical predicates are defined in the same way as for canonicity.(Π • A • B • ) nfty ≜ Π nfty A nfty ( λa var let a • = A • ne ( var ne a var ) in ( B • a • ) nfty )(Π • A • B • ) p A ≜ { a } ( a • : A • p ) → ( B • a • ) p (Π • A • B • ) ne f ne ≜ λa • ( B • a • ) ne ( app ne f ne ( A • nf a • ))(Π • A • B • ) nf f • ≜ lam nf ( λa var let a • = A • ne ( var ne a var ) in ( B • a • ) nf ( f • a • )) . Bocquet and A. Kaposi and C. Sattler 39 For natural numbers, we define an inductive family N • p : ( (cid:181) F ∗ → Tm N ) → Psh
Ren generated by zero • : N • p ( λ (cid:181) F ∗ zero ) suc • : { n } → N • p n → N • p ( suc $ n ) ne N • p : { n } → Ne n → N • p n This family witnesses the fact that a natural number term is an element of the free ( zero , suc )-algebra generated by the neutral natural number terms. This extends to the followingdefinition of the displayed natural number type in the normalization model. N • nfty ≜ N nfty N • ne n ne ≜ ne N • p N • nf zero • ≜ zero nf N • nf ( suc • n • ) ≜ suc nf ( N • nf n • ) N • nf ( ne N • p n ne ) ≜ ne nf N n ne The displayed natural number eliminator elim • N is defined using the induction principleof N • p . E.1 Stability of normalization
We recall the statement of Lemma 14. ▶ Lemma 14 (Internally to
Psh
Ren ) . For every a ne : Ne i { A } a , we have s Tm α a = ( s Ty α A ) ne a ne ,and for every a nf : Nf i { A } a , we have ( s Ty α A ) nf ( s Tm α a ) = a nf . ◀ This lemma is proven by induction on Ne and Nf .First note that given A : (cid:181) F ∗ → Tm U i , we have ( s Ty α U i ) nf ( s Tm α A ) = ( s Ty α ( El ⊛ A )) nfty .This implies that for whenever A nfty : NfTy i A and normalization is stable at A nfty , we have( s Ty α A ) nfty = A nfty . var ne a : Ne ( var a ) s Tm α ( var a )= ( s Ty α A ) ne ( var ne a ) (computation rule of s α ) app ne f ne a nf : Ne ( app $ { A } ⊛ { B } ⊛ f ⊛ a ) s Tm α ( app $ f ⊛ a )= app • ( s Tm α f ) ( s Tm α a ) (computation rule of s α )= ( s Tm α f ) ( s Tm α a ) (definition of app • )= (( s Ty α (Π A B )) ne f ne ) ( s Tm α a ) (induction hypothesis for f ne )= (Π • ( s Ty α A ) ( s [ Tm ] Ty α B )) ne f ne ) ( s Tm α a ) (computation rule of s α )= (( s [ Tm ] Ty α B ) ( s Tm α a )) ne ( app ne f ne (( s Ty α A ) nf ( s Tm α a ))) (definition of Π • )= ( s Ty α ( B ⊛ a )) ne ( app ne f ne a nf ) (induction hypothesis for a nf ) lam nf b nf : Nf ( lam $ { A } ⊛ { B } ⊛ b ) ( s Ty α (Π A B )) nf ( s Tm α ( lam $ b ))= (Π • ( s Ty α A ) ( s [ Tm ] Ty α B )) nf ( lam • ( s [ Tm ] Tm α b )) (computation rule of s α )= (Π • ( s Ty α A ) ( s [ Tm ] Ty α B )) nf ( λ a • ( s [ Tm ] Tm α b ) a • ) (definition of lam • )= lam nf ( λ a var let a • = ( s Ty α A ) ne ( var ne a var ) in ( s [ Tm ] Ty α B a • ) nf ( s [ Tm ] Tm α b a • ))(definition of Π • )= lam nf ( λ a var let a • = s Tm α ( var a var ) in ( s [ Tm ] Ty α B a • ) nf ( s [ Tm ] Tm α b a • ))(computation rule of s α )= lam nf ( λ a var ( s Ty α ( B ⊛ var a var )) nf ( s Tm α ( b ⊛ var a var )))(computation rule of s α )= lam nf ( λ a var b nf a var ) (induction hypothesis for b nf )= lam nf b nf Π nfty A nfty B nfty : NfTy (Π $ A ⊛ B ) ( s Ty α (Π $ A ⊛ B )) nfty = (Π • ( s Ty α A ) ( s [ Tm ] Ty α B )) nfty (computation rule of s α )= Π nfty ( s Ty α A ) nfty ( λa var let a • = ( s Ty α A ) ne ( var ne a var ) in ( s [ Tm ] Ty α B a • ) nfty )(definition of Π • )= Π nfty ( s Ty α A ) nfty ( λa var let a • = s Tm α ( var a var ) in ( s [ Tm ] Ty α B a • ) nfty )(computation rule of s α )= Π nfty ( s Ty α A ) nfty ( λa var ( s Ty α ( B ⊛ var a var )) nfty ) (computation rule of s α )= Π nfty ( s Ty α A ) nfty ( λa var B nfty a var ) (induction hypothesis for B nfty )= Π nfty A nfty B nfty (induction hypothesis for A nfty ) References Benedikt Ahrens and Peter LeFanu Lumsdaine. Displayed categories.
Log. Methods Comput.Sci. , 15(1), 2019. doi:10.23638/LMCS-15(1:20)2019 . Danil Annenkov, Paolo Capriotti, Nicolai Kraus, and Christian Sattler. Two-level type theoryand applications.
CoRR , abs/1705.03307, 2019. URL: http://arxiv.org/abs/1705.03307 , arXiv:1705.03307 . Andrej Bauer, Philipp G. Haselwarter, and Peter LeFanu Lumsdaine. A general definition ofdependent type theories.
CoRR , abs/2009.05539, 2020. URL: https://arxiv.org/abs/2009.05539 , arXiv:2009.05539 . Ulrich Berger and Helmut Schwichtenberg. An inverse of the evaluation functional for typedlambda-calculus. In
Proceedings of the Sixth Annual Symposium on Logic in Computer Science(LICS ’91), Amsterdam, The Netherlands, July 15-18, 1991 , pages 203–211. IEEE ComputerSociety, 1991. doi:10.1109/LICS.1991.151645 . Lars Birkedal, Ranald Clouston, Bassel Mannaa, Rasmus Ejlers Møgelberg, Andrew M. Pitts,and Bas Spitters. Modal dependent type theory and dependent right adjoints.
Math. Struct.Comput. Sci. , 30(2):118–138, 2020. doi:10.1017/S0960129519000197 . Thierry Coquand. Canonicity and normalization for dependent type theory.
Theor. Comput.Sci. , 777:184–191, 2019. doi:10.1016/j.tcs.2019.01.015 . . Bocquet and A. Kaposi and C. Sattler 41 Daniel Gratzer, G. A. Kavvos, Andreas Nuyts, and Lars Birkedal. Multimodal dependent typetheory.
CoRR , abs/2011.15021, 2020. URL: https://arxiv.org/abs/2011.15021 , arXiv:2011.15021 . Daniel Gratzer, G. A. Kavvos, Andreas Nuyts, and Lars Birkedal. Multimodal dependenttype theory. In Holger Hermanns, Lijun Zhang, Naoki Kobayashi, and Dale Miller, editors,
LICS ’20: 35th Annual ACM/IEEE Symposium on Logic in Computer Science, Saarbrücken,Germany, July 8-11, 2020 , pages 492–506. ACM, 2020. doi:10.1145/3373718.3394736 . Daniel Gratzer, G.A. Kavvos, Andreas Nuyts, and Lars Birkedal. Type Theory à la Mode.Technical report, 2020. Technical report accompanying [8]. URL: https://jozefg.github.io/papers/type-theory-a-la-mode.pdf . Daniel Gratzer and Jonathan Sterling. Syntactic categories for dependent type theory:sketching and adequacy.
CoRR , abs/2012.10783, 2020. URL: https://arxiv.org/abs/2012.10783 , arXiv:2012.10783 . Robert Harper, Furio Honsell, and Gordon D. Plotkin. A framework for defining logics.
J.ACM , 40(1):143–184, 1993. doi:10.1145/138027.138060 . Martin Hofmann. Semantical analysis of higher-order abstract syntax. In , pages 204–213. IEEEComputer Society, 1999. doi:10.1109/LICS.1999.782616 . Ambrus Kaposi, Simon Huber, and Christian Sattler. Gluing for type theory. In HermanGeuvers, editor, , volume 131 of
LIPIcs , pages25:1–25:19. Schloss Dagstuhl - Leibniz-Zentrum für Informatik, 2019. doi:10.4230/LIPIcs.FSCD.2019.25 . Ambrus Kaposi, András Kovács, and Thorsten Altenkirch. Constructing quotient inductive-inductive types.
Proc. ACM Program. Lang. , 3(POPL):2:1–2:24, 2019. doi:10.1145/3290315 . G. KELLY. The basic concepts of enriched category theory.
Reprints in Theory and Applicationsof Categories [electronic only] , 2005, 01 2005. Conor McBride and Ross Paterson. Applicative programming with effects.
J. Funct. Program. ,18(1):1–13, 2008. doi:10.1017/S0956796807006326 . Andreas Nuyts and Dominique Devriese. Transpension: The right adjoint to the pi-type.
CoRR ,abs/2008.08533, 2020. URL: https://arxiv.org/abs/2008.08533 , arXiv:2008.08533 . Frank Pfenning and Conal Elliott. Higher-order abstract syntax. In Richard L. Wexelblat,editor,
Proceedings of the ACM SIGPLAN’88 Conference on Programming Language Designand Implementation (PLDI), Atlanta, Georgia, USA, June 22-24, 1988 , pages 199–208. ACM,1988. doi:10.1145/53990.54010 . Frank Pfenning and Carsten Schürmann. System description: Twelf - A meta-logical frameworkfor deductive systems. In Harald Ganzinger, editor,
Automated Deduction - CADE-16, 16thInternational Conference on Automated Deduction, Trento, Italy, July 7-10, 1999, Proceedings ,volume 1632 of
Lecture Notes in Computer Science , pages 202–206. Springer, 1999. doi:10.1007/3-540-48660-7\_14 . Brigitte Pientka. Beluga: Programming with dependent types, contextual data, and contexts.In Matthias Blume, Naoki Kobayashi, and Germán Vidal, editors,
Functional and LogicProgramming, 10th International Symposium, FLOPS 2010, Sendai, Japan, April 19-21, 2010.Proceedings , volume 6009 of
Lecture Notes in Computer Science , pages 1–12. Springer, 2010. doi:10.1007/978-3-642-12251-4\_1 . Brigitte Pientka and Ulrich Schöpp. Semantical analysis of contextual types. In Jean Goubault-Larrecq and Barbara König, editors,
Foundations of Software Science and ComputationStructures - 23rd International Conference, FOSSACS 2020, Held as Part of the EuropeanJoint Conferences on Theory and Practice of Software, ETAPS 2020, Dublin, Ireland, April25-30, 2020, Proceedings , volume 12077 of
Lecture Notes in Computer Science , pages 502–521.Springer, 2020. doi:10.1007/978-3-030-45231-5\_26 . Jonathan Sterling and Carlo Angiuli. Gluing models of type theory along flat functors. 2020. Jonathan Sterling and Carlo Angiuli. Normalization for cubical type theory.
CoRR ,abs/2101.11479, 2021. URL: https://arxiv.org/abs/2101.11479 , arXiv:2101.11479 . Jonathan Sterling and Bas Spitters. Normalization by gluing for free λ -theories. CoRR ,abs/1809.08646, 2018. URL: http://arxiv.org/abs/1809.08646 , arXiv:1809.08646 . Taichi Uemura. A general framework for the semantics of type theory.
CoRR , abs/1904.04097,2019. URL: http://arxiv.org/abs/1904.04097 , arXiv:1904.04097arXiv:1904.04097