Synthetic Spectra via a Monadic and Comonadic Modality
SSynthetic Spectra via aMonadic and Comonadic Modality
Mitchell Riley , Eric Finster , and Daniel R. Licata Wesleyan University University of Cambridge
Abstract
Homotopy type theory allows for a synthetic formulation of homotopy theory, where arguments canbe checked by computer and automatically apply in many semantic settings. Modern homotopy theorymakes essential use of spectra , a model for stable homotopy types , where the suspension and loop spaceoperations become an equivalence. One can define a version of spectra analytically in type theory, butwith this definition can be quite difficult to work with. In this paper, we develop an alternative syntheticapproach to spectra, where spectra are represented by certain types, and constructions on them by typestructure—–maps of spectra by ordinary functions, loop spaces by the identity type, and so on. There isan ∞ -topos of parametrised spectra , whose objects are an index space with a family of spectra over it, sostandard homotopy type theory can be interpreted in this setting. To isolate the spaces (as objects withtrivial spectra) and the spectra (as objects with trivial base) within this more general setting, we extendtype theory with a novel modality that is simultaneously a monad and a comonad. Intuitively, thismodality keeps the base of an object the same but replaces the spectrum over each point with a trivialone. Because this modality induces a non-trivial endomap on every type, it requires a more intricatejudgemental structure than previous modal homotopy type theories. We show that the type theory issound and complete for an abstract categorical semantics, in terms of a category-with-families with aweak endomorphism whose functor on contexts is a bireflection, i.e. has a counit an a unit that are asection-retraction pair. Next, we augment the type theory with a pair of axioms, one which impliesthat the spectra are stable, and the other which relates the synthetic spectra to the analytic ones, and,working inside the type theory, show that our synthetic spectra have many of the properties expected ofspectra. Contents
I Theory 7 (cid:92)
Modality 7 (cid:92) type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.3 Alternative Rules Without Marked Context Extension . . . . . . . . . . . . . . . . . . . . . . 12 (cid:92) a r X i v : . [ m a t h . C T ] F e b Reduced Types 24
II Metatheory 41
Introduction
Homotopy type theory provides a setting in which one can do synthetic homotopy theory: rather than work-ing with concrete topological spaces or simplicial sets, one works with types and the universal constructionsprovided by the type formers of the theory. Working this way requires clever new arguments for standardresults, but the payoff is that the same proof applies in any model of the theory, not just in the homo-topy theory of spaces. It is conjectured that all of axiomatic homotopy type theory (“axiomatic HoTT”)as in [HoTTBook] can be interpreted in any ∞ -topos — the interpretation of the basic Martin-L¨of typetheory [AW09; LW15; AK11], Voevodsky’s univalence axiom [GK17; Shu15; Shu19a] and a class of higherinductive types [LS20] have been worked out, though closure of the universes under higher inductive typesis in progress. The basics of synthetic homotopy theory are presented in [HoTTBook, Chapter 8], and asignificant number of results have been developed and formalized since.One of the main advantages of axiomatic HoTT is that all constructions performed in it are necessarilyhomotopy invariant. However, this is a double-edged sword, as it rules out some of the first definitionsfrom algebraic topology one might hope to make. For example, a key invariant of topological spaces istheir homology and cohomology groups, which are often easier to calculate than their homotopy groups.Externally, the ordinary homology and cohomology of a space X are defined via maps into X from simplices ofvarious dimensions. But these simplices are all contractible, so working internally they are indistinguishablefrom the point. Instead, homology and cohomology can be defined in type theory [Cav15; Gra18] via the spectra that represent them.Classically, the study of spectra was motivated by the Freudenthal suspension theorem (see [HoTTBook,Chapter 8] for a proof in type theory), which implies that, for nice spaces X and Y , the sequence of homotopyclasses of maps [ X, Y ] → [Σ X, Σ Y ] → [Σ X, Σ Y ] → . . . stabilises . Stable homotopy theory studies the phenomena that survive after arbitrarily manysuspensions, and it is an important tool for obtaining results about unstable homotopy theory/spaces as well— e.g. the homotopy groups of spheres in a certain range coincide with certain stable homotopy groups.One can form a category out of the above observation, where the objects are nice pointed spaces and thehom-sets are given by the colimit over the above diagram, but the resulting category does not have very niceproperties. This motivates passing to a category of spectra that includes the previous as a full subcategory,but is much better behaved categorically.Using ∞ -categorical technology (by which we mean ( ∞ , ∞ -category of spectra canbe defined by starting with the ∞ -category of pointed spaces S ∗ , and inverting the loop space functor Ω ina universal way: Spec = lim ←− (cid:16) · · · Ω −→ S ∗ Ω −→ S ∗ Ω −→ S ∗ (cid:17) In the ∞ -category of spectra, the suspension Σ and loop space Ω functors are equivalences, in contrast toordinary spaces where Σ and Ω are far from being equivalences. This makes Spec a good place to do stablehomotopy theory: everything is stable under suspension. Spectra behave much like objects from algebra,such as modules over a ring, or chain complexes. One has a zero object and biproducts, and every morphismof spectra has a well-behaved kernel and cokernel. Like chain complexes, Σ and Ω shift objects up and downin dimension.Unwinding the above definition, a spectrum can be presented concretely as a sequence of pointed spaces X , X , X , . . . , together with a pointed equivalence between each space and the loop space of the next, X (cid:39) (cid:63) Ω X , X (cid:39) (cid:63) Ω X , . . . . This definition of spectra is readily internalised in type theory, replacing‘pointed spaces’ with ‘pointed types’, and has been formalised [Shu+19]. However, most basic constructionson spectra are still work in progress, as working with such spectra can be difficult. Moreover, re-buildingthe theory of spectra from scratch within type theory is not so much in the spirit of working synthetically;we should be leveraging the type theory to provide some of the structure built-in.One approach to synthetic spectra would be to look for a type theory that interprets in the ∞ -categoryof spectra, but this category is not an ∞ -topos, so the type theory would not include all of axiomatic HoTT(e.g. it is not even cartesian closed; like modules over a ring, it is closed for a different notion of monoidalproduct). However, spectra are a full subcategory of space-parametrised families of spectra , which Joyaland Biedermann have shown form an ∞ -topos [Joy08, Section 35]. The ∞ -category P Spec of parametrisedspectra can be pleasantly described as follows [ABG18]: Given a space X , one can think of it as an ∞ -groupoid and consider the functor ∞ -category Fun( X, Spec). The objects of this are our parametrisedspectra over X . This assignment from spaces to functor categories assembles into a functor S op → Cat ∞ ,with Cat ∞ the ∞ -category of ∞ -categories. An ∞ -categorical version of the Grothendieck constructionyields the ∞ -category P Spec of parametrised spectra. Thus, we can begin by interpreting all of axiomaticHoTT into this ∞ -topos P Spec of parametrised spectra. This has important practical advantages overdesigning a new type theory for just the spectra, not the families: we can reuse all of the synthetic homotopytheory that has been developed, and we can reuse existing proof assistants to work in this setting.When working in axiomatic HoTT with the model in parametrised spectra in mind, it will be necessaryto have some syntactic way to say when a type denotes a single spectrum, rather than a family of them— for example, the fact that suspension and loop space are an equivalence holds only for spectra, notfamilies thereof. Moreover, it will be necessary say when a type (in P Spec) denotes an ordinary space; forexample, some constructions that we will perform apply only to families of spectra over a space, not familiesof spectra over a spectrum, so in certain places we will want to restrict dependency to types that denotespaces. It turns out that we can access both the full subcategory of spaces and the full subcategory ofspectra by way of a modality [HoTTBook; RSS20]. A basic operation on P Spec is the functor that, given aparametrised spectrum, extracts its underlying space. In the other direction, we can assign to each space X the parametrised spectrum ( X, X → Spec denotes the constant functor at the zero spectrum,which has the one-point space at each level (not the empty space, since the spaces in an Ω-spectrum are allpointed). This is both left and right adjoint to the forgetful functor from P Spec to spaces S that extracts3he index space: P Spec
S(cid:62)(cid:62) and this diagram satisfies the additional coherence of a bireflective subcategory [Fre+99]. This means thatthe roundtrip on P Spec, which we write as (cid:92) , has a number of special properties: is a left-exact idempotentmonad and comonad, it is adjoint to itself, and the counit followed by the unit (cid:92)E → E → (cid:92)E is the identity.Then, we can isolate the spaces within the parametrised spectra as the (cid:92) -modal types [HoTTBook; RSS20],roughly the types A such that A (cid:39) (cid:92)A — i.e. an object is a space iff it is equivalent to the object consisting ofthe same base space with the 0-spectrum over every point, because that means the object has no interestingspectra to begin with. Dually, we can isolate the spectra as the (cid:92) -connected types, the types such that (cid:92)A iscontractible — i.e. an object is a single spectrum iff it is a family of spectra over the point.Monadic modalities are well-studied in axiomatic HoTT [RSS20], but to describe non-trivial comonadicmodalities, one must modify the judgemental structure of the context. The adjunction between S and P Specis a degenerate example of axiomatic cohesion [Law07]. An ∞ -topos T is cohesive (over S ) if there is a stringof adjoint functors relating T to S , satisfying certain conditions. These adjunctions induce a string of adjointfunctors S (cid:97) (cid:91) (cid:97) (cid:93) on T so that S and (cid:93) are monads and (cid:91) is a comonad. In our setting, we have S ≡ (cid:91) ≡ (cid:93) , hencethe name (cid:92) for our roundtrip operation. A ‘cohesive type theory’ capturing the structure of cohesion wasintroduced by Shulman [Shu18], where the three functors also appear as unary type formers. The part of thetheory we are especially interested in is the (cid:91)/(cid:93) fragment, which on its own is called ‘spatial type theory’. Inspatial type theory, the context is divided into two zones following [Bar96; PD01]: a ‘modal’ zone, where thetypes of all variables are morally prefixed with a (cid:91) , followed by a context with ordinary variables. The rulesfor the (cid:91) and (cid:93) modalities move variables between the zones to enforce the correct relationships between themodalities and the judgemental version of (cid:91) represented by the modal context zone. In principle one coulduse spatial type theory for P Spec by adding axioms asserting that the modalities are all equivalent. While wehave no objection in principle to adding axioms to type theories for synthetic homotopy theory (we extendaxiomatic HoTT, which already adds univalence and higher inductive types as axioms), the ergonomics ofsuch axioms can be poor — in this case, transport across these equivalences would be pervasive in everyconstruction.In this paper, we instead describe an extension of the judgements and rules of type theory, which give the (cid:92) modality the correct properties without the need for any axioms (Section 1). Relative to existing modaldependent type theories, the primary difficulty of the (cid:92) modality is that the bireflection induces a non-trivialroundtrip on every type : the unit map A → (cid:92)A followed by the counit map (cid:92)A → A . The syntax has a pairof novel features to handle this. Firstly, each variable may be used in two ways: as normal, or “marked”,which is written x and means using it via the roundtrip described above. Secondly, in contrast to spatial typetheory, there is no separation of the context into two zones, one modal and one non-modal. The presence ofboth the unit and counit mean that modal and ordinary variables can be mixed together without restriction.Next, to demonstrate that the resulting type theory is quite ergonomic to use, even without a proofassistant, we develop some synthetic homotopy theory informally in the style of [HoTTBook]. First, inSection 2, we show that our rules for the (cid:92) modality indeed give it the desired properties—we can proveinternally that it is a monad and comonad, idempotent, self-adjoint, left-exact, interacts nicely with pointedtypes, and that the (cid:92) -modal (the “spaces”) are closed under various type constructors. Next, in Section 3,we study the (cid:92) -connected types (the “spectra”), showing that they are pointed and that ordinary functionsbetween them are automatically pointed, avoiding the need to carry around proofs of pointedness. Byassuming a base type S (intended to be modelled in P Spec by the sphere spectrum), we give a syntheticdefinition of the adjunction Σ ∞ (cid:97) Ω ∞ that relates spaces and spectra, which allows transfer of informationbetween the unstable and stable worlds.With the type-theoretic rules for (cid:92) , our “synthetic spectra” do not have all of the properties of spectra.This is in some sense an advantage — we can also interpret all of the above constructions in a simpler model In full detail, the round-trip only applies to types that depend on a space, not a spectrum.
4n parametrised pointed spaces, which we give some intuition for in Section 8. But, to bring the syntheticspectra closer to spectra, we identify two axioms. The first, studied in Section 4, makes the internal categoryof synthetic spectra stable , in particular making Σ (cid:97)
Ω an adjoint equivalence for these types. It turns outto be sufficient to assert that coproducts and products of synthetic spectra coincide. Together with theambient setting of an ∞ -topos and a left-exact (cid:92) modality, this causes commutative squares of spectra to bepushouts if and only if they are pullbacks, which, together with finite limits/colimits and a zero object, isan equivalent characterisation of the stability of an ∞ -category. The proof that this axiom implies stabilityuses a recent advance in synthetic homotopy theory, the Generalized Blakers-Massey Theorem [ABFJ20].The second axiom connects our synthetic spectra to ‘analytic’ spectra, defined concretely as sequencesof pointed types with connecting maps. Using the above stability axiom, we show that the Σ ∞ (cid:97) Ω ∞ adjunction between pointed types and synthetic spectra can be factored through analytic spectra, definingin particular an adjunction between synthetic and analytic spectra. For this part, we assume the correctnessof an analytic spectrification operation, which has been defined but not yet proved correct in type theory.Our second axiom is that this adjunction between synthetic and analytic spectra is an equivalence. As anapplication, we show that this axiom is is strong enough to fix the homotopy groups (appropriately defined)of the synthetic sphere spectrum to be the stable homotopy groups of the ordinary higher inductive spheres,using some recent work on sequential colimits [SDR20].Finally, in Section 7, we give a sound and complete categorical semantics for our type theory, in categorieswith families enhanced with extra structure to interpret the modality. In particular, we require a weak CwFendomorphism such that the underlying functor on contexts is a bireflection, i.e. has a counit-unit section-retraction pair. Related work.
Our rules for the natural modality follow the work on constructive modal logics suchconstructive S4, intuitionistic linear logic, and adjoint logic — especially presentations with two contextsor different judgements for modal assumptions — and their generalisations with dependent types [Bar96;BW96; PD01; Ale+01; CP02; NPP08; Ree09; KPB15; V´ak15; PR16]. The most directly related calculi arespatial type theory [Shu18] and the calculi for right adjoint functors/comonads [Clo18; Bir+20; GSB19].While these previous works inform our design in Section 1, none consider a bireflective modality as we dohere, and there were still some interesting design questions specific to our setting. For example, because (cid:92) isboth a monad and a comonad, the previous work suggests two possible designs: [PD01; Shu18] have specialcontext structure corresponding to a comonad, and the counit is a “silent” operation (not marked in theproof term), while [GSB19] has special context structure for a monad, and the unit is a silent operation. Inour setting, we have both a monad and a comonad, but the “roundtrip” of the unit followed by the counit is not the identity, so we cannot make both the unit and counit silent. After some experimentation, we choseto make the unit silent and the counit explicit via “marked” variables.Some additional related work develops frameworks for modal type theories in general [LSR17; Gra+20],but our setting is not quite an instance of these frameworks. The first [LSR17] lacks dependent types, butcan describe the simply-typed fragment of our type theory. The mode theories of the second [Gra+20], donot allow making the left adjoint types (“locks”) into CwF morphisms, which corresponds in our setting todefining the natural operation on contexts as a context of individually marked variables. Additionally, ourcontribution in Section 1 is an “optimised” syntax where structural rules are combined with other rules, andas much is admissible as possible, and the step from these frameworks to an optimised syntax is currentlyone that must be undertaken for each type theory separately in any case.There is also work by Isaev on ‘indexed type theories’ [Isa20a; Isa20b], which correspond to indexed( ∞ -)categories. The theory of parametrised spectra can be described in terms of an indexed ∞ -categoryover spaces, where the ∞ -category over each fixed space X is Fun( X, Spec). But there are significant benefitsin considering the total category as we do: the existing constructions of type theory automatically apply totypes that correspond to spectra, whereas in indexed type theory one needs to add an indexed version ofeach type constructor together with axioms relating the base and indexed versions of each. Our ordinaryuniverse U is already a universe of parametrised spectra; in an indexed type theory one has a universe forthe types in the base, but seems difficult to extend this to indexed types, as only the total category has a5niverse. Acknowledgements:
The work in this paper benefited heavily from discussions with Michael Shulmanand Mathieu Anel, in particular to Mike for suggesting Axiom N. Thank you also to Ed Morehouse and AlexKavvos for many helpful conversations. 6 art I
Theory (cid:92)
Modality
In this paper, we begin with homotopy type theory as in [HoTTBook] with Π, Σ, identity, and (higher)inductive types, and univalent universes. We then add a new modality , a unary type constructor (cid:92) . Unlikethe monadic modalities studied in [RSS20], which can be described by axioms, our (cid:92) modality also hassome comonadic aspects, which require changes to the judgements of the type theory. We first describe ajudgemental version of the modality that applies to contexts and has the desired unit and counit maps, andthen give a type constructor that internalises this judgemental operation as a type.
At a high level, the reason we require some new judgemental structure for presenting the (cid:92) modality is thatit has both a unit A → (cid:92)A and a counit (cid:92)A → A and the roundtrip A → (cid:92)A → A gives a non-trivial map forgeneral types A . So to β -reduce an introduction followed by an elimination, we need a judgemental versionof this roundtrip map A → A to reduce to. This must satisfy a naturality equation, which says that for any f : A → B , the composites A → B → (cid:92)B → B and A → (cid:92)A → A → B are equal: post-composing with theroundtrip is the same as precomposing with it. To achieve this, we add post-composition with the roundtripas a new way of using variables: for a variable x : A , we write x for the roundtrip on A applied to x , and saythat the variable is marked or zeroed or dull . For a general term a , we define an admissible operation a that“underlines all of the free variables of a ”, and denotes precomposing with the roundtrip on the context. Thisgives normal forms for the above naturality equations. There is an interaction with dependency, becauseapplying the roundtrip to a term must also apply it to the term’s type, so if a : A then a : A . For certainrules, we will need a judgement classifying terms whose free variables are only used marked, which we call dull terms . We accomplish this by allowing variable declarations in the context to be marked as well, written x :: A , which semantically is the same as x : (cid:92)A . A variable declared marked in the context can only be usedmarked, so a term in a context of only marked declarations must be dull. Any context Γ can be turned into acontext of only marked declarations via a defined Γ operation, which semantically is applying the (cid:92) modalityto the context. Finally, we have admissible structural rules corresponding to precomposing a judgement withthe unit Γ → Γ and counit Γ → Γ. We now discuss the rules in Figure 1 in more detail.
Marked Context Extension and Variables.
To make the type theory easier to use, we will make Γ an admissible (defined by induction on syntax) operation, rather than a derivable (new piece of formal syntax)one. The new piece of formal syntax is a new context extension Γ , x :: A ( ctx-ext-zero ), which semanticallyis the same as Γ .(cid:92)A . We think of this special context extension as “marking” a variable by writing :: in placeof :, and by writing an underscore under the variable name. Formally, either one of the underscore or the ::would be enough, but we find the syntax clearer if variables are written the same in the context and at theiruse sites, which will be marked; and we carry over the :: from spatial type theory [Shu18].The restriction imposed by a marked context extension is that a variable that is declared marked in thecontext Γ , x :: A can only be used marked as x in a term, as indicated in the var-zero rule. Semantically,this is using the counit (cid:92)A → A , because x :: A in the context is semantically (cid:92)A , but A as a type on theright is semantically just A . In concrete syntax, it is best to think of x as a term constructor underline ( x ),not that the underline is part of the variable name.A new ingredient for the (cid:92) modality is that there are two ways to use an ordinary unmarked variabledeclared in the context as Γ , x : A, Γ (cid:48) . In addition to the standard rule Γ , x : A, Γ (cid:48) (cid:96) x : A , we can alsoapply the var-roundtrip rule, and use the variable x by writing x . We say that such a use is marked or zeroed , because semantically, it corresponds to the projection from Γ post-composed with the roundtrip A → (cid:92)A → A . In our intended models, this keeps the base of x the same but replaces the fibres of x with the7 arked context extension and variables: ctx-ext-zero Γ ctx Γ (cid:96) A : U Γ , x :: A ctx var-zero Γ , x :: A, Γ (cid:48) (cid:96) x : A var-roundtrip Γ , x : A, Γ (cid:48) (cid:96) x : A Natural on contexts: Γ ctx Γ ctx −−− · : ≡ · Γ , x : A : ≡ Γ , x :: A Γ , x :: A : ≡ Γ , x :: A Γ ≡ Γ −−−− Precomposition with the counit: pre-counit Γ (cid:96) a : A Γ (cid:96) a : A −− − −− Γ (cid:96) a : A Γ (cid:96) a ≡ a : A −−−−−−−− Γ (cid:96) a : A Γ (cid:96) a ≡ a : A −−−−−−−− Γ (cid:96) ∆ tele Γ (cid:96) ∆ tele −−−−−−− ( · ) : ≡ · (∆ , x : A ) : ≡ ∆ , x : A (∆ , x :: A ) : ≡ ∆ , x :: A pre-counit-gen Γ , ∆ (cid:96) a : A Γ , ∆ (cid:96) a : A −−−−−−−−−−− Precomposition with the unit/roundtrip: pre-unit Ψ , Γ , ∆ (cid:96) a : A Ψ , Γ , ∆ (cid:96) a : A −− − − − − −− pre-roundtrip Γ (cid:96) a : A Γ (cid:96) a : A −− − −− pre-roundtrip-gen Γ , ∆ (cid:96) a : A Γ , ∆ (cid:96) a : A −−−−−−−−−−− Figure 1: New Context Structure. Dashed lines indicate admissible rules.8efault sections of A . We intentionally use the same raw syntax for these two distinct typing rules var-zero and var-roundtrip , one of which uses a variable that is marked in the context (via the counit), and theother uses a variable that is unmarked in the context (via the roundtrip). This allows precomposition withthe unit Γ → Γ to be a “silent” operation that leaves the raw syntax unchanged. We explain the operation A marking a type below. Natural on Contexts
Proceeding to the admissible rules in the figure, marking a context Γ is definedinductively by marking all of the variables in a context. Semantically, these equations say (roughly —there are some subtleties with dependency that we discuss below) that (cid:92) (cid:92) (Γ .A ) = (cid:92) Γ .(cid:92)A (whichare the equations of a strict CwF morphism [Dyb96, Definition 2]) and that (cid:92) (Γ .(cid:92)A ) = (cid:92) Γ .(cid:92)A (which isreasonable because of idempotence (cid:92)(cid:92)A = (cid:92)A ). The equation states that Γ is idempotent—syntactically, Γhas only marked variable declarations, which Γ leaves unchanged (and the A operation discussed next is alsoidempotent).Putting together ctx-ext-zero and var-zero and the definition of Γ, the types of later marked variablescan depend on earlier unmarked ones (but can only use them marked). For example, in a context x : A, y :: B ,the type B is in context x : A ≡ x :: A , so may refer to x (but not x ). This means we cannot put all of themarked variables in a separate context zone preceding the unmarked variables [Bar96; PD01]. Precomposition with the Counit.
We will often be interested in types and terms where every use of afree variable is marked/zeroed. We call such types and terms dull . A dull term in context Γ is equivalentlya term in the context Γ—because all the variables in Γ are marked, any term Γ (cid:96) a : A necessarily usesthese variables marked. We can turn any Γ (cid:96) a : A into a dull term Γ (cid:96) a : A by marking all the freevariable uses in a with an underscore ( pre-counit ). (Note that we overload the notation and write the a operation on general terms using the same syntax as for marked/roundtripped variables.) Semantically, a isprecomposing a with the counit Γ → Γ. Because the type A also depends on Γ, substitution by the counitwill also mark its variables, which we write as A . We think of types as elements of a universe, so Γ (cid:96) A : U implies Γ (cid:96) A : U is another instance of this rule. This means that when a term is marked/zeroed i.e. onlyvaries over the underlying space of the context, its corresponding type is also only permitted to vary overthe underlying space of the context.We omit a formal definition of a on raw syntax, which is given by recursion over the term syntax (likesubstitution), turning x into x , leaving marked variable uses unchanged, and proceeding recursively otherwise(e.g. f ( a ) = f ( a )). In particular, zeroing commutes with the type former for Id -types: ( x = y ) ≡ ( x = y ),which is part of what makes our modality left-exact.One subtlety is that, because a is semantically substitution/precomposition with the counit Γ → Γ, itmarks the free variables of a term, but leaves the bound variables the same. For example, λx.f x ≡ λx.f x .This leads to the full form of the operation in pre-counit-gen , which marks the variables in Γ in thecontext and changes all occurrences of the Γ-variables in the term into marked ones, but does not changethe occurrences of ∆-variables in the term. Formally, ∆ is a telescope (context in context), but we omitthe rules for Γ (cid:96) ∆ telescope , with formation rules analogous to those for contexts, and the operation ofconcatenating a context and a telescope Γ , ∆. For example, with f in Γ and x in ∆, f x = f x . However,when the variables declared in Γ occur in the types in ∆, those occurrences must be marked, which wenotate with ∆ . The telescope ∆ is defined by sending x : A to x : A ( not x :: A , differing from Γ)and x :: A to x :: A (since all variables are already zeroed) for each variable in ∆. Officially, we should beannotating the underscores like a Γ to indicate which variables in a are to be zeroed, but when we use thisoperation informally we always start with Γ being all free variables and ∆ empty, so we adopt a conventionthat a means to mark all free variables of a .The equations for precomposition with the counit state that if a term starts out in Γ, then marking hasno effect a ≡ a . Syntactically, this is because a term in context Γ cannot have any unmarked free variableuses, which are the only parts of a term changed by the marking operation. Note that this equation needsΓ ≡ Γ to type check, and semantically corresponds to the counit on Γ being the identity. Consequently,marking is idempotent: a ≡ a . 9 recomposition with the Unit. There is an analogous operation of precomposition with the unit Γ → Γ.Following [GSB19], we make this a “silent” operation, i.e. it does not change the raw syntax of the term orthe type, only the typing derivation, as stated in pre-unit . We refer to as use of the unit as “unzeroing”a piece of the context, because variables that are marked/zeroed in the context Γ in the premise becomeunmarked/unzeroed in the conclusion. The unit does not unmark the uses of the variables in a term ortype — a use x of a marked variable x :: A from Γ (typed by var-zero , which is the counit (cid:92)A → A )becomes a use x of x : A from Γ (typed by var-roundtrip , which is the roundtrip A → (cid:92)A → A , the counitprecomposed with the unit). Thus, the unit can be silent because we use the same syntax for the counit onmarked variables as for the roundtrip on unmarked variables. var-roundtrip in the typing derivation.To work up to the rule in the figure, the most basic form, where Ψ and ∆ are empty, says that anyΓ (cid:96) a : A is also Γ (cid:96) a : A . For the same reasons as for the counit, we will need a tail telescope ∆ that isnot “unzeroed” by the operation (i.e. the marks in ∆ in the premise are still there in the conclusion), forinductively pushing this operation under bound variables, which are not unzeroed (and indeed, might noteven be marked in the premise). We will also sometimes find it useful to unzero a variable in the middleof the context, without unzeroing its prefix, e.g. going from Γ , x :: A (cid:96) J to Γ , x : A (cid:96) J . Semantically,this is precomposition with the unit A → (cid:92)A paired with the identity substitution on Γ. It is an implicitrequirement for the judgement in the conclusion to be well-formed that Ψ , Γ , ∆ is a well-formed context Precomposition with the Roundtrip.
Composing pre-unit and pre-counit , we have a rule pre-roundtrip representing precomposition with the non-trivial roundtrip Γ → (cid:92) Γ → Γ. (We have not seen ause for a counit rule with a prefix Ψ as in the unit rule, so we do not include one, and consequently restrictthe roundtrip to the setting where both the unit and counit exist, when Ψ is empty for the unit.) Thesection-retraction property of a bireflection states that composing pre-unit and pre-counit in the otherdirection, i.e. going from Γ (cid:96) a : A to Γ (cid:96) a : A to Γ (cid:96) a : A should be the identity; because the unit is silent,this is the same as the counit equation a ≡ a .Returning to the rule var-roundtrip , the type A in the conclusion is typed by pre-roundtrip , because,as for the counit, precomposing/substituting by the roundtrip on Γ substitutes into the type A as well.Because variable uses x : A and x : A (in general) have different types, the marked-ness of a variable usagecannot be na¨ıvely flipped at will in a term. For example, if x : A then x = x may not be well-formed, as A is not in general the same type as A . The only reason that we do not need to analogously mark the type A in the conclusion of var-zero as A is that the marked context extension ctx-zero ‘pre-zeroes’ the type —the type A is in context Γ, so must already use only marked variables. Well-formedness of the Conclusions.
Whenever we can form a term Γ (cid:96) a : A , we of course wantthat Γ ctx and Γ (cid:96) A : U . (Depending on precisely how the type theory is set up, these are sometimespresuppositions of the term judgement; later when checking that pre-counit and pre-unit are admissiblein Section 6, we follow [Str91] in having them be consequences of the term judgement.) There are few spotsin the above rules where it is a bit subtle why these invariants are maintained. First, in var-zero , we haveby ctx-ext-zero that Γ (cid:96) A : U , but for the use of A on the right, we need Γ , x : A, Γ (cid:48) (cid:96) A : U . In additionto the usual weakening with x : A, Γ (cid:48) , this uses pre-unit . In var-roundtrip , we have Γ (cid:96) A : U , so byanother application of var-roundtrip , we also have Γ (cid:96) A : U , so all that is needed is the usual weakening.In the definition of Γ for unmarked variables, we begin with Γ (cid:96) A : U , and need Γ (cid:96) A : U , which we haveby pre-counit (with ∆ empty). In the definition for marked variables, we start with Γ (cid:96) A : U , and needΓ (cid:96) A : U to apply ctx-ext-zero , which holds by idempotence. In the equation a ≡ a , we need the sameequation on types to see that A ≡ A , and similarly for the a ≡ a equation. Substitution for Marked Variables.
There is a new case of standard substitution for substituting into var-roundtrip , which is defined by x [ a/x ] : ≡ a That is, when we substitute a term a : A for a marked variable usage x , the result is the marking of a .This type checks for Γ , x : A (cid:96) x : A and Γ (cid:96) a : A because the pre-roundtrip rule gives Γ (cid:96) a : A .10 -form Γ (cid:96) A : U Γ (cid:96) (cid:92)A : U (cid:92) -intro Γ (cid:96) a : A Γ (cid:96) a (cid:92) : (cid:92)A (cid:92) -elim Γ (cid:96) b : (cid:92)A Γ (cid:96) b (cid:92) : A (cid:92) -beta Γ (cid:96) a : A Γ (cid:96) a (cid:92)(cid:92) ≡ a : A (cid:92) -eta Γ (cid:96) b : (cid:92)A Γ (cid:96) b ≡ b (cid:92)(cid:92) : (cid:92)A Figure 2: Rules for (cid:92)
Semantically, x is the roundtrip A → (cid:92)A → A , and the substitution post-composes this roundtrip with a ;but a is a pre-composed with the roundtrip Γ → (cid:92) Γ → Γ, and these are equal by naturality of the unit andcounit.A substitution principle for marked variables that is typical from other comonadic type theories follow-ing [PD01] is Γ , x :: A, Γ (cid:48) (cid:96) b : B Γ (cid:96) a : A Γ , Γ (cid:48) [ a/x ] (cid:96) b [ a/x ] : B [ a/x ] −−−−−−−−−−−−−−−−−− Here, the term being substituted must already have all of its variables marked, as indicated by the premiseΓ (cid:96) a : A of the rule, and this substitution principle is implemented by a syntactic substitution, replacing x with a everywhere. Given the admissible rules in Figure 1, we can in fact define this by first unzeroing thevariable x to get Γ , x : A, Γ (cid:48) (cid:96) b : B and then doing an ordinary substitution b [ a/x ]. Since all uses of x willbe marked x in b and B , this will replace x with a everywhere—but since Γ (cid:96) a : A , we have a ≡ a , so weget the same result as the more specialised principle would have given.We prefer this style of presenting substitution, where the substitution for marked variables is given byunmarking and then ordinary substitution, because it corresponds more closely to what we will do whenworking informally in this type theory. When performing substitutions b [ a/x ] by hand, we can simply lookin b for each instance of x and x and replace them with either a or a accordingly, without having to mentallykeep track of the context through each subterm to see whether x is marked or not (variables that are notmarked become marked in the premises of some rules), as we would have to do if substitution for a markedvariable required pre-marking the term. This is another benefit of having var-zero and var-roundtrip rules be identical raw syntax. In our experience trying different systems for this setting, this choice seemscritical for the usability of the system for informal type theory. Comparison with Spatial Type Theory.
In spatial type theory [Shu18], there is also a special contextextension x :: A , which is a judgemental version of extending the context with (cid:91)A . Such variables are called crisp . A usage of a crisp variable x in a term corresponds to a use of the counit (cid:91)A → A , like our var-zero rule. Because there is only a counit and not also a unit, the type A of a crisp variable x :: A is only permittedto depend on other crisp variables. A loose way to think about this is as follows. Before we have accessto any structural rules, dependency forces us to apply modalities to an entire context at once. Given atype-in-context Γ (cid:96) A : U presented as a fibration p : A → Γ, ordinary context extension corresponds toconsidering the object A as a context. If we want to make A discrete, we have to apply (cid:91) to everything,giving (cid:91)p : (cid:91)A → (cid:91) Γ. So (cid:91)A can only depend on a discrete context, and the judgemental version x :: A hasthe same restriction. Therefore, all crisp variables must occur before regular ones, and the context naturallydivides into two zones. In our system, however, the presence of the unit map A → (cid:92)A means that we can nolonger neatly divide the context in this way. For example, if we have a context x :: A, y :: B , then we canprecompose with the unit substitution just on x , giving x : A, y :: B . This breaks the invariant that crispvariables all occur before ordinary ones. (cid:92) type Using this judgement structure, it is now simple to describe the (cid:92) type using the rules in Figure 2.11 ar-roundtrip Γ , x : A, Γ (cid:48) (cid:96) x : A pre-roundtrip Γ (cid:96) a : A Γ (cid:96) a : A −− − −− Γ (cid:96) a : A Γ (cid:96) a ≡ a : A (cid:92) -form Γ (cid:96) A : U Γ (cid:96) (cid:92)A : U (cid:92) -zero Γ (cid:96) A : U Γ (cid:96) (cid:92)A ≡ (cid:92)A : U (cid:92) -intro Γ (cid:96) a : A Γ (cid:96) a (cid:92) : (cid:92)A (cid:92) -elim Γ (cid:96) b : (cid:92)A Γ (cid:96) b (cid:92) : A (cid:92) -beta Γ (cid:96) a : A Γ (cid:96) a (cid:92)(cid:92) ≡ a : A (cid:92) -eta Γ (cid:96) b : (cid:92)A Γ (cid:96) b ≡ b (cid:92)(cid:92) : (cid:92)A ≡ (cid:92)A Figure 3: Rules without marked context extensionRecall that we refer to a term/type in context Γ, i.e. a term/type all of whose free variables are marked,as dull . The formation rule says that for any dull type A there is a type (cid:92)A . Formally, this formation rule isanalogous to (cid:93) in spatial type theory or dependent right adjoints [Bir+20], in that it asks for a type under theleft adjoint of (cid:92)A , which in this case is also (cid:92) , represented by Γ. One alternate rule that one could imagineis like (cid:91) in spatial type theory, Γ (cid:96) A : U implies Γ (cid:96) (cid:92)A : U . However, this rule breaks admissibility ofprecomposition with the unit, because it forces variables in the conclusion’s context to be marked.The introduction rule says that for any dull term of a dull type a : A there is a term a (cid:92) : (cid:92)A , againtransposing (cid:92) on the right to (cid:92) on the left (roughly, (cid:92) Γ → A implies Γ → (cid:92)A ). This is the same as theintroduction rule for (cid:93) and dependent right adjoints. Note that the type A must be assumed to be dull forthe type (cid:92)A in the conclusion to be well-formed.The elimination rule says that for any (not necessarily dull) term b : (cid:92)A , there is a term b (cid:92) : A . Semanti-cally, this is the counit (cid:92)A → A precomposed with b . Note that the type A must be assumed to be dull for (cid:92)A in the premise to be well-formed — for a non-dull type A , we have a counit (cid:92)A → A , but in general wedo not have a map (cid:92)A → A .The computation or β -reduction rule says that a (cid:92)(cid:92) ≡ a . Whenever the left-hand side is well-typed, theright-hand side is too, because of the silent unit rule pre-unit . Note that a is necessarily dull for the (cid:92) -intro rule to have been applied, and all of its free variables are still marked zeroed on the right.The uniqueness or η -rule says that b ≡ b (cid:92)(cid:92) for any term b : (cid:92)A . Since b is not necessarily dull, it must bemarked (precomposed with the counit) before being used in the introduction rule − (cid:92) . One must be cautiousin applying this rule from right to left, as not every possible ‘unzeroing’ of a term b will be well-typed.For a non-dull type Γ (cid:96) A : U , note that A (given by pre-counit ) and (cid:92)A are very different. Inparametrised pointed spaces/spectra, A is A with its dependency on the fibres of the context Γ replaced bythe sections of Γ. On the other hand, (cid:92)A also replaces the fibres of A with the trivial pointed space/spectrum.For example, if A is a closed type then A ≡ A (cid:54)(cid:39) (cid:92)A . From this point of view, our notation Γ for markinga context is confusing, because it semantically is (cid:92) Γ; however, we use this notation to emphasise that it isimplemented by “underlining all of the variables in Γ”.We have not proved canonicity or normalisation for the (cid:92) type, as our intended applications rely on manyaxioms, but we conjecture they are true: the equations for Γ and a are proved rather than asserted, and the (cid:92) type has a β rule for weak head reduction and a type-directed η rule. As an alternative to the above rules, it is also possible to give rules for (cid:92)A without marked context extension ctx-ext-zero , which we show in Figure 3 ( pre-roundtrip needs to be generalized with a ∆ like above,but we omit this from the figure).The idea with this variation is to have a judgemental account only of the roundtrip idempotent, and12ot the object Γ that the roundtrip splits through. We still include the marked variable uses (representingthe roundtrip applied to a variable) and the admissible operation of underlining terms a (representingprecomposition with the roundtrip on the context, so it does not change the context). The formation,introduction, and elimination rules are essentially (cid:92) : U → U and − (cid:92) : A → (cid:92)A and − (cid:92) : (cid:92)A → A . The β rulesays that the composite A → (cid:92)A → A is the roundtrip, and the η rule says that the composite (cid:92)A → A → (cid:92)A is the identity. We explicitly include an equation (cid:92)A ≡ (cid:92)A because semantically these types should be equal— in Figure 2, we only allow the latter to be written, but that requires marked context extension to enforce.The η rule requires (cid:92)A ≡ (cid:92)A for both sides to have the same type.While the rules in Figure 3 are shorter to describe, we prefer the rules from Figures 1 and 2 with markedcontext extension for several reasons. First, they do not require an extra equation (cid:92) -zero . Second, whenworking informally below, we will often assume a dull/marked variable x :: A , which has the same meaningas assuming a variable x : (cid:92)A , but using a dull variable by writing x is a bit terser than writing x (cid:92) , andsubstitution does not need to go through a β -reduction. However, the main reason we prefer the markedvariables in the context is because they are necessary for future work on adding the ‘smash product of spectra’as a tensor type, as in linear logic. The base of every type can be duplicated, so when splitting the contextto type check c : C (cid:96) ( a, b ) : A ⊗ B , we can e.g. allow a split into c : C (cid:96) a : A and c :: C (cid:96) b : B , where onecomponent receives all of c and the other receives only the base of c . Presenting this nicely requires markedvariables in the context. (cid:92) For the next several sections, we work in axiomatic HoTT [HoTTBook] (with Π, Σ, identity, and (higher)inductive types, and univalent universes) with our new rules for (cid:92) . First, we develop the basic structure ofthe (cid:92) type internally, proving that (cid:92) behaves like both the (cid:91) and (cid:93) modalities of spatial type theory [Shu18].
Definition 2.1 (Unit and counit for (cid:92) ) . The introduction and elimination rules immediately give, for anytype A , unit and counit maps η A : ≡ ( λx.x (cid:92) ) : A → (cid:92)Aε A : ≡ ( λn.n (cid:92) ) : (cid:92)A → A The fact that the we only have a counit for dull types is what defeats the ‘no-go theorem’ for comonadicmodalities [Shu18, Theorem 4.1]. In general, there is no way to go from a term of (cid:92)A or A to a term of thenon-zeroed type A . Proposition 2.2.
The counit and unit are a section-retraction pair, i.e. the roundtrip η A ◦ ε A : (cid:92)A → A → (cid:92)A is the identity. The composite ε A ◦ η A : A → (cid:92)A → A is equal to λx.x .Proof. For n : (cid:92)A we have η ( ε ( n )) ≡ n (cid:92)(cid:92) ≡ n (cid:92)(cid:92) ≡ n by the definition of and the η -law. For the composite on x : A , we get ε ( η ( x )) ≡ x (cid:92)(cid:92) ≡ x by the β -law. Definition 2.3.
We can define the functorial action of (cid:92) on a map, in any ambient context: given f : A → B we define (cid:92)f : (cid:92)A → (cid:92)B by: (cid:92)f ( x ) : ≡ [ f ( x (cid:92) )] (cid:92) yielding a map ( A → B ) → ( (cid:92)A → (cid:92)B ). When f is λy.y we get (cid:92) ( λy.y )( x ) ≡ [( λy.y )( x (cid:92) )] (cid:92) ≡ [( λy.y )( x (cid:92) )] (cid:92) ≡ ( x (cid:92) ) (cid:92) ≡ x f is f ◦ f we first have (cid:92) ( f ◦ f )( x ) ≡ [( f ◦ f )( x (cid:92) )] (cid:92) ≡ [( f ◦ f )( x (cid:92) )] (cid:92) ≡ [ f ( f ( x (cid:92) ))] (cid:92) But we also have( (cid:92) ( f ) ◦ (cid:92) ( f ))( x ) ≡ (cid:92) ( f )([ f ( x (cid:92) )] (cid:92) ) ≡ [ f (([ f ( x (cid:92) )] (cid:92) ) (cid:92) )] (cid:92) ≡ [ f (([ f ( x (cid:92) )] (cid:92) ) (cid:92) )] (cid:92) ≡ [ f ( f ( x (cid:92) ))] (cid:92) So (cid:92)f preserves identity and composition definitionally. Remark 2.4.
Note that, in contrast with (cid:91) of spatial type theory, we do not need the function f to be‘crisp’, i.e., only use modal variables. Here, we can turn any function f : A → B into a ‘crisp’ one f : A → B by zeroing, allowing us to apply (cid:92) -intro to f ( x (cid:92) ) : B .The η -rule for (cid:92)A implies that any term of natural type is equal to the marked version of it: Proposition 2.5.
For any dull type Γ (cid:96) A : U and not necessarily dull term Γ (cid:96) a : (cid:92)A there is a definitionalequality Γ (cid:96) a ≡ a : (cid:92)A Proof.
Suppose a term Γ (cid:96) a : (cid:92)A . By the η -rule, we have a ≡ a (cid:92)(cid:92) . But applying the admissible roundtriprule pre-roundtrip , we have Γ (cid:96) a : (cid:92)A (using the fact that A ≡ A because A is dull). Applying the η -ruleto that gives a ≡ a (cid:92)(cid:92) . But n ≡ n ).Semantically, this is because, for any f : Γ → (cid:92)A , the composite with the roundtrip Γ → (cid:92) Γ → Γ → (cid:92)A is still equal to f — first, use naturality of the unit/counit to see this is equal to Γ → (cid:92)A → (cid:92)(cid:92)A → (cid:92)A andthen the latter two maps are inverse by idempotence of (cid:92) . Proposition 2.6.
The unit and counit are natural, so for any f : A → B the diagrams A B(cid:92)A (cid:92)B fη A η B (cid:92)f (cid:92)A (cid:92)BA B (cid:92)fε A ε B f commute.Proof. On the left: f (( a (cid:92) ) (cid:92) ) (cid:92) ≡ f ( a ) (cid:92) ≡ f ( a ) (cid:92) On the right: ( f ( x (cid:92) ) (cid:92) ) (cid:92) ≡ f ( x (cid:92) ) ≡ f ( x (cid:92) )We now consider types that are equivalent to their ‘underlying space’. Definition 2.7.
A type A is modal if the unit η A : A → (cid:92)A is an equivalence. We defineModal : ≡ (cid:88) X : U isEquiv ( λx.x (cid:92) )for the type of modal types.This definition is studied in detail in [HoTTBook, Definition 7.7.5],[RSS20, Section 1]. In the intendedmodel, the modal types are the spaces, embedded in P Spec as a space equipped with the constant zerofamily of spectra. We will sometimes need to restrict statements to such spaces, so it is important that wecan carve out a subuniverse of spaces using the modality.14 roposition 2.8. If A is modal then A is also modal.Proof. Given a witness w : isModal ( A ), we have w : isModal ( A ), showing A (cid:39) (cid:92)A . Proposition 2.9.
For any A , the type (cid:92)A is modal.Proof. The counit ( λz.z (cid:92) ) : (cid:92)(cid:92)A → (cid:92)A is an inverse to the unit ( λv.v (cid:92) ) : (cid:92)A → (cid:92)(cid:92)A . Using Proposition 2.5,for the roundtrip on (cid:92)A we have v (cid:92)(cid:92) ≡ v ≡ v and for the roundtrip on (cid:92)(cid:92)A we have z (cid:92)(cid:92) ≡ z (cid:92)(cid:92) ≡ z. Note that the unit and counit are not in general an equivalence between (cid:92)A and A — the use of the η -lawto prove v ≡ v does not apply in A . Intuitively, (cid:92)A is the base space of A , while A itself only zeroes out thedependence of A on the ambient context. However, we do have: Proposition 2.10.
A type A is modal iff ( λx.x ) : A → A is an equivalence.Proof. Suppose λx.x : A → A is an equivalence, with inverse g : A → A . We show that η A is a quasi-equivalence, which can be improved to an equivalence. The inverse is g ◦ ε A : (cid:92)A → A . For x : A , wehave g [( x (cid:92) ) (cid:92) ] ≡ g ( x ) = x using the inverse law for g ◦ ( λx.x ).For the other composite, let ( λx.x, g, w ) : A (cid:39) A , so that w is the witness that ( λx.x ) and g are inverses.Now observe that ( λx.x, g, w ) : A (cid:39) A and by definition of , the maps are λx.x and g , so we also have g ◦ ( λx.x ) = id A . Then, for y : (cid:92)A , the composite is g ( y (cid:92) ) (cid:92) ≡ [ g ( y (cid:92) )] (cid:92) ≡ (( λx.x (cid:92) ) ◦ g ◦ ( λx : A.x ))( y (cid:92) ) = ( λx.x (cid:92) )( y (cid:92) ) ≡ ( y (cid:92) ) (cid:92) ≡ y Conversely, if A is modal then A is also modal by Proposition 2.8. By the β -law, the map ( λx.x ) : A → A is equal to the composite ε A ◦ η A : A → (cid:92)A → A , which is the composite of two equivalences. First, η A is anequivalence because A is modal. Second, ε A is an equivalence, because it is left-inverse to η A , which is anequivalence because A is modal, and a left-inverse of a map that is an equivalence is its inverse. Corollary 2.11.
A dull type A is modal iff x = x for any x : A .Proof. By function extensionality, ( λx.x ) = ( λx.x ), and transporting the fact that the identity function isan equivalence along this allows us to use Proposition 2.10.In the remainder of this section we show that (cid:92) has all the properties of both (cid:91) and (cid:93) from spatial typetheory.
We begin with the monadic properties; those shared with (cid:93) . The following characterises maps into (cid:92)A (fromthe ambient context) via an induction principle, so we call it a “right” universal property (even though thedomain on the left of the Π type is what changes). Below, we also consider a “left” universal property, whichcharacterises maps out of (cid:92)A . Proposition 2.12 (Right (cid:92) -induction, cf. [Shu18, Theorem 3.4]) . Suppose P : (cid:92)A → U is a type familysuch that each P ( v ) is modal. Given a dependent function f : (cid:81) x : A P ( x (cid:92) ) , there is g : (cid:81) v : (cid:92)A P ( v ) such that g ( x (cid:92) ) = f ( x ) for all x : A . roof. Because each P ( v ) is modal, we have inverses r v : (cid:92)P ( v ) → P ( v ). So it is enough to produce afunction g (cid:48) : (cid:81) v : (cid:92)A (cid:92)P ( v ). Zeroing f gives a function f : (cid:81) x : A P ( x (cid:92) ), which we can use to define g (cid:48) ( v ) : ≡ f ( v (cid:92) ) (cid:92) and g (cid:48) ( v ) has type (cid:92)P ( v (cid:92)(cid:92) ) ≡ (cid:92)P ( v ) as required. To get the goal function g : (cid:81) v : (cid:92)A P ( v ) we then post-composewith r v : g ( v ) : ≡ r v ( f ( v (cid:92) ) (cid:92) )This has the correct computation property: g ( x (cid:92) ) ≡ r v ( f ( x (cid:92)(cid:92) ) (cid:92) ) ≡ r v ( f ( x ) (cid:92) ) ≡ r v ( f ( x ) (cid:92) ) = f ( x )as r v is an inverse of ( λx.x (cid:92) ). Theorem 2.13 (Right universal property, cf. [Shu18, Theorem 3.6]) . Suppose B : (cid:92)A → U is a type familywith each B ( v ) modal. Then precomposition with η A : A → (cid:92)A is an equivalence (cid:89) v : (cid:92)A B ( v ) (cid:39) (cid:89) x : A B ( x (cid:92) ) Proof.
The inverse is given by right (cid:92) -induction (Proposition 2.12), and the roundtrip on f : (cid:81) ( x : A ) B ( x (cid:92) ) isexactly the g ( x (cid:92) ) = f ( x ) equation given above.For the other composite, suppose h : (cid:81) ( v : (cid:92)A ) B ( v ), and y : (cid:92)A , and we need to show that h ( y ) is equal tothe g ( y ), for the g determined by right (cid:92) -induction on h -precomposed-with- η A , λx.h ( x (cid:92) ). However, by the η -law, y ≡ ( y (cid:92) ) (cid:92) , so g ( y ) ≡ g (( y (cid:92) ) (cid:92) ) = h (( y (cid:92) ) (cid:92) ) = h ( y )(This proof is morally doing another right (cid:92) -induction to reduce y to something of the form x (cid:92) , but we havenot yet proved that b = B ( y ) b (cid:48) is modal when B ( y ) is modal, so we cannot use Proposition 2.12 directly, butinstead η -expand explicitly.) Corollary 2.14. ( λA.(cid:92)A ) : U → U with unit λx.x (cid:92) : A → (cid:92)A is a monadic modality in the sense of [RSS20].Proof. The precomposition equivalence (cid:89) v : (cid:92)A (cid:92)B ( v ) → (cid:89) x : A (cid:92)B ( x (cid:92) )of the previous proposition, where (cid:92)B is modal by Proposition 2.9, is precisely the definition of a ‘uniquelyeliminating modality’ [RSS20, Definition 1.2], one of the several equivalent definitions of a monadic modality.Being a monadic modality has many formal consequences. In particular: Lemma 2.15 (Properties of a modality, [RSS20]) . A is modal iff ( λx.x (cid:92) ) : A → (cid:92)A admits a retraction.2. If the input types are modal then all the following are modal: A × B x = A y fib f ( x ) B × A C A (cid:39) B . If A is any type and P : A → U is such that every P ( x ) is modal, then (cid:81) ( x : A ) P ( x ) is modal. Ifadditionally A is modal, then (cid:80) ( x : A ) P ( x ) is modal.4. For any types A and B , the canonical map (cid:92) ( A × B ) → (cid:92)A × (cid:92)B is an equivalence.5. If A is a proposition, then so is (cid:92)A . Also like (cid:93) , the (cid:92) modality preserves Σ-types and is left-exact.
Proposition 2.16 ( (cid:92) preserves Σ) . For types A : U and B : A → U , we have (cid:92) (cid:88) x : A B ( x ) (cid:39) (cid:88) u : (cid:92)A (cid:92)B ( u (cid:92) ) Proof.
We know that the right-hand side is modal, so to define a map from left-to-right it is sufficient toprovide f : (cid:80) ( x : A ) B ( x ) → (cid:80) ( u : (cid:92)A ) (cid:92)B ( u (cid:92) ) and then apply (cid:92) -induction. For this we have f ( a, b ) : ≡ ( a (cid:92) , b (cid:92) ).The other way, we are provided u : (cid:92)A and v : (cid:92)B ( u (cid:92) ), with which we can produce( u (cid:92) , v (cid:92) ) (cid:92) : (cid:92) (cid:88) x : A B ( x ) . To show the roundtrip on the left is the identity, suppose v : (cid:92) (cid:16)(cid:80) ( x : A ) B ( x ) (cid:17) . By (cid:92) -induction (= (cid:92) ismodal by Lemma 2.15) we assume this is of the form ( a, b ) (cid:92) , and then the round trip is just( a (cid:92)(cid:92) , b (cid:92)(cid:92) ) (cid:92) ≡ ( a, b ) (cid:92) ≡ ( a, b ) (cid:92) by the β -rule for (cid:92) .For the other roundtrip, starting with ( u, v ) : (cid:80) ( u : (cid:92)A ) (cid:92)B ( u (cid:92) ), the computation rule for (cid:92) -induction givesthat the roundtrip is equal to f ( u (cid:92) , v (cid:92) ) ≡ ( u (cid:92)(cid:92) , v (cid:92)(cid:92) ) ≡ ( u, v ) Proposition 2.17 ( (cid:92) is left-exact, cf. [Shu18, Theorem 3.7]) . For x, y : A , there is an equivalence ( x (cid:92) = y (cid:92) ) (cid:39) (cid:92) ( x = y ) such that ( x (cid:92) = y (cid:92) )( x = y ) (cid:92) ( x = y ) ap ( − ) (cid:92) ( − ) (cid:92) commutesProof. We can define maps both ways by: c (cid:55)→ ap ( − ) (cid:92) ( c (cid:92) ) : (cid:92) ( x = y ) → ( x (cid:92) = y (cid:92) ) p (cid:55)→ ( ap ( − ) (cid:92) ( p )) (cid:92) : ( x (cid:92) = y (cid:92) ) → (cid:92) ( x = y )17or showing the roundtrip on c : (cid:92) ( x = y ) is the identity, first, for any type A with x, y : A and p : x = A y ,we have ap ( λx.x ) ( p ) = p as paths in x = A y (which type checks because x = x ). By path induction, it sufficesto show ap ( λx.x ) ( refl x ) ≡ ap ( λx.x ) ( refl x ) = refl x ≡ refl x Then we have[ ap ( − ) (cid:92) ( ap ( − ) (cid:92) ( c (cid:92) ))] (cid:92) ≡ [ ap ( − ) (cid:92) ( ap ( − ) (cid:92) ( c (cid:92) ))] (cid:92) = [ ap (( − ) (cid:92) ) (cid:92) ( c (cid:92) )] (cid:92) ≡ [ ap − ( c (cid:92) )] (cid:92) = [ c (cid:92) ] (cid:92) ≡ [ c (cid:92) ] (cid:92) ≡ c The other direction is easier: the roundtrip on p is: ap ( − ) (cid:92) ( ap ( − ) (cid:92) ( p ) (cid:92)(cid:92) ) ≡ ap ( − ) (cid:92) ( ap ( − ) (cid:92) ( p ))= ap ( − ) (cid:92)(cid:92) ( p ) ≡ ap id ( p )= p = p The last equality is by Lemma 2.11 and that p : ( x (cid:92) = y (cid:92) ) is a term of a dull modal type.The triangle commutes by path-induction: ap ( − ) (cid:92) ( ap ( − ) (cid:92) ( refl x )) (cid:92) = ap ( − ) (cid:92)(cid:92) ( refl x ) (cid:92) = ( refl x ) (cid:92) ≡ ( refl x ) (cid:92) Left-exactness has some additional formal consequences outlined by [RSS20].
Proposition 2.18. • (cid:92) preserves pullbacks, [RSS20, Theorem 3.1]. • (cid:92) preserves n -types and more generally n -truncated maps for all n , [RSS20, Corollary 3.9]. Now we turn to the comonadic properties of (cid:92) ; the properties it shares with the (cid:91) modality of spatial typetheory. First, as remarked in Section 1, we can derive a substitution principle of dull terms for dull variables:
Definition 2.19 (Dull substitution) . The dull substitution principle is dull-subst Γ , x :: A (cid:96) c : C Γ (cid:96) a : A Γ (cid:96) c [ a/x ] : ≡ c [ a/x ] : C [ a/x ] −−−−−−−−−−−−−−−− To see that this type checks, precompose with the unit on A to get Γ , x : A (cid:96) c : C and the unit on Γ to getΓ (cid:96) a : A , and then a normal substitution c [ a/x ] has type C [ a/x ] ≡ C [ a/x ]. Remark 2.20.
Definition 2.19 corresponds to the substitution principle for crisp variables in spatial typetheory, where a crisp variable can be substituted by a term containing only crisp variables. In our setting,given a term a in a general context, we can mark it and then substitute it for a dull variable:Γ , x :: A (cid:96) c : C Γ (cid:96) a : A Γ (cid:96) c [ a/x ] ≡ c [ a/x ] : C [ a/x ] −−−−−−−−−−−−−−−− (cid:96) a : A is a dull term, we can use dull-subst . This is equal to the ordinary substitution c [ a/x ]because all of the uses of x in c and C must be marked, so a will be marked during substitution; we canprove inductively that Γ , x :: A (cid:96) c : C Γ (cid:96) a : A Γ (cid:96) c [ a/x ] ≡ c [ a/x ] : C [ a/x ] −−−−−−−−−−−−−−−− Proposition 2.21 (Left (cid:92) -induction) . A (cid:91) -style eliminator is derivable for (cid:92) : “ (cid:91) ”-elim Γ , x : (cid:92)A (cid:96) C : U Γ (cid:96) v : (cid:92)A Γ , u :: A (cid:96) c : C [ u (cid:92) /x ]Γ (cid:96) ( let u (cid:92) = v in c ) : C [ v/x ] −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− “ (cid:91) ”-beta Γ , x : (cid:92)A (cid:96) C : U Γ (cid:96) v : A Γ , u :: A (cid:96) c : C [ u (cid:92) /x ]Γ (cid:96) ( let u (cid:92) = v (cid:92) in c ) ≡ c [ v/u ] : C [ v (cid:92) /x ] −−−−−−−−−−−−−−−−−−−−−−−−−−−−−−−− Proof.
The eliminator can be derived by dull substitution:( let u (cid:92) = v in c ) : ≡ c [ v (cid:92) /u ]which has type C [ v (cid:92)(cid:92) /x ] ≡ C [ v/x ] as required. The β -rule follows immediately from the β -rule for (cid:92) , usingthe fact that v ≡ v for Γ (cid:96) v : A , as all variable uses in v are already marked.This induction principle can be rephrased as a characterisation of maps out of (cid:92)A (which we call a “left”universal property to distinguish it from the characterisation of maps into (cid:92)A given in Theorem 2.13, thoughconfusingly it is the natural on the codomain that differs between the two sides). Theorem 2.22 (Left universal property, cf. [Shu18, Theorem 6.16]) . For any
A, B : U , post-composition(and functoriality of (cid:92) ) with ( − ) (cid:92) : (cid:92)B → B induces an equivalence (cid:92) ( (cid:92)A → (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → B ) or more dependently, for A : U and B : (cid:92)A → U , fibrewise post-composition (and functoriality of (cid:92) ) with ( − ) (cid:92) : (cid:92)B ( v ) → B ( v ) yields an equivalence (cid:92) (cid:89) v : (cid:92)A (cid:92)B ( v ) (cid:39) (cid:92) (cid:89) v : (cid:92)A B ( v ) Proof.
The counit map (cid:92)B ( v ) → B ( v ) is always a section of the unit map, so the post-composition map inthe statement of the Theorem is also a section.We just have to check that the roundtrip on (cid:92) (cid:16)(cid:81) ( v : (cid:92)A ) B ( v ) (cid:17) is the identity. Suppose we have an f : (cid:92) (cid:16)(cid:81) ( v : (cid:92)A ) B ( v ) (cid:17) . Unfolding the definition of post-composition and functoriality of (cid:92) with both the unitand the counit is: ( λx. ( f (cid:92) ( x )) (cid:92)(cid:92) ) (cid:92) ≡ ( λx. ( f (cid:92) ( x ))) (cid:92) ≡ ( λx. ( f (cid:92) ( x ))) (cid:92) ≡ ( f (cid:92) ) (cid:92) ≡ f where x ≡ x : (cid:92)A by Proposition 2.5. Note that ( λx. ( f (cid:92) ( x ))) (cid:92) is well-typed, as x is not free below the (cid:92) -intro , so does not need to be marked. 19ecause the rules for (cid:91) are derivable, we could instead have repeated the proof for (cid:91) verbatim, using let -bindings, but the above is more direct. Remark 2.23.
One may wonder why the applications of (cid:92) are required around the two sides. Thinkingsyntactically, they are necessary to block access to ‘spectral’ information from the context. Without (cid:92) onthe right, one could use a b : B in the context to form constant functions const b : (cid:92)A → B which have nocorresponding maps (cid:92)A → (cid:92)B on the left.Another way to see that they are necessary is to consider the model in families of pointed types. There,it is clear that the map is not an equivalence without the (cid:92) present: E ( (cid:92)A → (cid:92)B ) is equivalent to the pointin every fibre, but E ( (cid:92)A → B ) may be non-trivial. Corollary 2.24 (Dull Self-adjointness) . For any
A, B : U there is an equivalence (cid:92) ( A → (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → B ) Proof.
Combining the left and right universal properties we get (cid:92) ( A → (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → B ) Proposition 2.25 (cf. [Shu18, Theorem 3.11]) . In the presence of univalence, the type
Modal ≡ (cid:80) ( A : U ) isModal ( A ) of modal types is modal.Proof. We can use a simpler proof than the one for (cid:93) . By Corollary 2.11, we just have to show that for any A : U and w : isModal ( A ), there is an equality ( A, w ) = (
A, w ). And there is: by assumption A is modal so A (cid:39) A , again by Corollary 2.11. In the second component, isModal ( A ) is a proposition, so we are done. Remark 2.26.
When working with inductive types in a theory with more structured contexts such as ours,one has make sure that the induction principles are strong enough. In spatial type theory, one needs toassert or prove ‘crisp induction principles’, for when the motive of an elimination rule depends on a crisp variable of type being eliminated. The crisp induction principle for a type constructor is a judgemental wayof saying that the modality preserves the type constructor. For example, crisp coproduct case analysis isa judgemental way of saying that (cid:91) ( A + B ) (cid:39) (cid:91)A + (cid:91)B , because the crisp induction principle gives crispvariables of type A + B the same universal property as an ordinary variable of type (cid:91)A + (cid:91)B . In our setting,a dull induction principle for coproducts looks like: dull- + -elim Γ , z :: A + B (cid:96) C : U Γ , x :: A (cid:96) p : C [ inl ( x ) /z ] Γ , y :: B (cid:96) q : C [ inr ( y ) /z ]Γ (cid:96) s : A + B Γ (cid:96) dullcase ( z.C, x.p, y.q, s ) : C [ s/z ] −−−−−−−−−−−−−−−−−−−−−−−−−−−−−− In spatial type theory, crisp induction principles are proven using the adjointness of (cid:91) and (cid:93) , and because (cid:92) is self-adjoint, we could repeat the proof almost verbatim. But we can show they are valid more directly,using the pre-counit and pre-unit rules.With the above inputs, we can apply pre-unit to obtainΓ , z : A + B (cid:96) C : U Γ , x : A (cid:96) p : C [ inl ( x ) /z ]Γ , y : B (cid:96) q : C [ inr ( y ) /z ]Γ (cid:96) s : A + B Now note that C [ inl ( x ) /z ] ≡ C [ inl ( x ) /z ] and C [ inr ( x ) /z ] ≡ C [ inr ( x ) /z ], because z is only used marked in C ,as in Remark 2.20. These inputs are now of the right shape to apply the ordinary + -elim rule.Using an analogous construction, we can derive dull induction principles for Id -types, pushouts, etc.20 roposition 2.27 ( (cid:92) preserves pushouts) . Suppose f : C → A and g : C → B are dull functions betweendull types. Then (cid:92) ( A + C B ) (cid:39) (cid:92)A + (cid:92)C (cid:92)B, the pushout of (cid:92)f : (cid:92)C → (cid:92)A and (cid:92)g : (cid:92)C → (cid:92)B .Proof. Morally, this follows because we just proved that (cid:92) is a left adjoint, but we can also write out themaps explicitly as follows.From left-to-right, we extract a term of p : A + C B , and then do case analysis. On a : A , we have inl ( a (cid:92) ) : A + (cid:92)C (cid:92)B . Similarly, on b : B we have inr ( b (cid:92) ) : A + (cid:92)C (cid:92)B . To complete the cocone we have to toprovide for any c : C , a path inl ( f ( c ) (cid:92) ) = inr ( g ( c ) (cid:92) ) in (cid:92)A + (cid:92)C (cid:92)B . The glue constructor for the (cid:92)A + (cid:92)C (cid:92)B pushout gives us a path glue ( c (cid:92) ) : inl ( (cid:92)f ( c (cid:92) )) = inr ( (cid:92)g ( c (cid:92) ))And this type is equal to inl ( f ( c ) (cid:92) ) = inr ( g ( c ) (cid:92) ) by the definition of the functorial action of (cid:92) , and the β -rule.The right-to-left direction is similar. We begin with case analysis on z . On n : (cid:92)A and m : (cid:92)B we have inl ( n (cid:92) ) : A + C B and inr ( m (cid:92) ) : A + C B respectively. For any o : (cid:92)C , we need a path inl ( (cid:92)f ( o ) (cid:92) ) = inr ( (cid:92)g ( o ) (cid:92) ).Expanding the definition of functoriality and applying the β -rule, this is a path inl ( f ( o (cid:92) )) = inr ( g ( o (cid:92) ))and glue ( o (cid:92) ) is such a path in A + C B . All together this produces a dull term of A + C B , so applying (cid:92) -intro we are done.Checking the roundtrips are the identity is straightforward, using left (cid:92) -induction and dull pushoutinduction, which can be derived as in Remark 2.26.The sequential colimit (see e.g. [SDR20]) of a sequence A (0) a (0) −−→ A (1) a (1) −−→ A (2) a (2) −−→ . . . is given by the higher inductive type colim A n with point and path constructors ι : (cid:89) n : N A ( n ) → colim n A n κ : (cid:89) ( n : N ) (cid:89) ( x : A ( n )) ι ( n + 1 , a ( n, x )) = ι ( n, x ) Proposition 2.28 ( (cid:92) preserves sequential colimits) . Suppose we have a diagram A (0) a (0) −−→ A (1) a (1) −−→ A (2) a (2) −−→ . . . of dull types and dull functions between them. Then (cid:92) (colim n A ( n )) (cid:39) colim n (cid:92)A ( n ) where the sequential colimit on the right is over the diagram (cid:92)A (0) (cid:92)a (0) −−−→ (cid:92)A (1) (cid:92)a (1) −−−→ (cid:92)A (2) (cid:92)a (2) −−−→ . . . Proof.
The proof is analogous to that for pushouts.Finally, we give compound rules for Π x : (cid:92)A.B , which we refer to as “dull Π-types” (c.f. [Shu18; PR16;Vez19], or the connective A → B in linear logic as a fusion of ! A (cid:40) B ).21 roposition 2.29. Dull Π -types are definable with Γ (cid:96) A : U Γ , x :: A (cid:96) B : U Γ (cid:96) (cid:89) x :: A B : U Γ , x :: A (cid:96) b : B Γ (cid:96) λx :: A.b : (cid:89) x :: A B : U Γ (cid:96) f : (cid:89) x :: A B Γ (cid:96) a : A Γ (cid:96) f ( a ) : B [ a/x ]( λx :: A.b )( a ) ≡ b [ a/x ] f : (cid:81) ( x :: A ) B ≡ λx :: A.f ( x ) Proof.
Recall from Definition 2.19 that dull substitution B [ a/x ] is syntactically just B [ a/x ]. We define (cid:81) ( x :: A ) B : ≡ (cid:81) ( y : (cid:92)A ) B [ y (cid:92) /x ] λx :: A.b : ≡ λy.b [ y (cid:92) /x ] f ( a ) : ≡ f ( a (cid:92) )The β/η equations follow from the same for Π and (cid:92) . The modality also interacts nicely with pointed types and functions. Recall the following standard definitions:
Definition 2.30. A pointed type is a pair ( A, a ) of a type A and a term a : A . A pointed map from ( A, a )to (
B, b ) is a function f : A → B and a path p : f ( a ) = b . Write U (cid:63) for the type of pointed types and A → (cid:63) B : ≡ (cid:88) f : A → B f ( a ) = b for the type of pointed maps.Note that a type or map being pointed is structure, not a property. However, it is common to abusenotation and write A → (cid:63) B rather than ( A, a ) → (cid:63) ( B, b ) when the points of A and B can be inferred fromcontext. Lemma 2.31. If B is modal then then A → (cid:63) B is modal.Proof. By Lemma 2.15, modal types are closed under Σ, = and Π where the codomain is modal.
Proposition 2.32.
For any pointed type ( A, a ) , there are canonical points a : A and a (cid:92) : (cid:92)A for which theunit η A : A → (cid:92)A and counit ε A : (cid:92)A → A are pointed maps.Proof. Both are immediate from the definitions:( λx.x (cid:92) )( a ) ≡ a (cid:92) ( λn.n (cid:92) )( a (cid:92) ) ≡ a (cid:92)(cid:92) ≡ a The following is a standard characterisation of equivalence between Σ-types:
Lemma 2.33.
Suppose we have type families P : A → U and Q : B → U . If we have an equivalence f : A (cid:39) B and a family of equivalences g x : P ( x ) (cid:39) Q ( f ( x )) then the map ( λ ( x, p ) . ( f ( x ) , g x ( p ))) : (cid:88) x : A P ( x ) → (cid:88) y : B Q ( y ) is an equivalence. roof. We have Σ : (Σ A : U .A → U ) → U , and the given data is equivalent to ( A, P ) = (Σ A : U .A →U ) ( B, Q )by univalence and the definitions of paths in Σ and Π types.
Proposition 2.34.
Let ( A, a ) and ( B, b ) be pointed types with B modal. Precomposition with A → (cid:63) (cid:92)A induces an equivalence ( (cid:92)A → (cid:63) B ) (cid:39) ( A → (cid:63) B ) Proof.
We have seen (Theorem 2.13) that there is an equivalence w : ( (cid:92)A → B ) (cid:39) ( A → B ) . So we need to show that for every f : (cid:92)A → B , there is an equivalence( f ( a (cid:92) ) = b ) (cid:39) ( w ( f )( a ) = b )but w is precomposition with the unit, so the type on the right is also ( f ( a (cid:92) ) = b ). Proposition 2.35.
For dull pointed types ( A, a ) and ( B, b ) , post-composition with ( − ) (cid:92) : (cid:92)B → B inducesan equivalence (cid:92) ( (cid:92)A → (cid:63) (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → (cid:63) B ) Proof.
Because (cid:92) commutes with Σ by Proposition 2.16, we can again apply Lemma 2.33 so it is enough toshow that the map (cid:88) f : (cid:92) ( (cid:92)A → (cid:92)B ) (cid:92) ( f (cid:92) ( a (cid:92) ) = b (cid:92) ) (cid:39) (cid:88) g : (cid:92) ( (cid:92)A → B ) (cid:92) ( g (cid:92) ( a (cid:92) ) = b )induced by post-composition is an equivalence.First, we know by Theorem 2.22 that w : (cid:92) ( (cid:92)A → (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → B )Explicitly, this is w ( f ) ≡ ( λx.f (cid:92) ( x ) (cid:92) ) (cid:92) So we need to produce for every f : (cid:92) ( (cid:92)A → (cid:92)B ) an equivalence (cid:92) ( f (cid:92) ( a (cid:92) ) = b (cid:92) ) (cid:39) (cid:92) (( w ( f )) (cid:92) ( a (cid:92) ) = b )On the right we calculate( w ( f )) (cid:92) ( a (cid:92) ) ≡ [( λx.f (cid:92) ( x ) (cid:92) ) (cid:92) ] (cid:92) ( a (cid:92) ) ≡ ( λx.f (cid:92) ( x ) (cid:92) )( a (cid:92) ) ≡ f (cid:92) ( a (cid:92) ) (cid:92) And then we have (cid:92) ( f (cid:92) ( a (cid:92) ) = b (cid:92) ) ≡ (cid:92) (( f (cid:92) ( a (cid:92) )) (cid:92)(cid:92) = b (cid:92) ) (by the η -rule) ≡ (cid:92) (( w ( f )) (cid:92) ( a (cid:92) ) (cid:92) = b (cid:92) ) (by the above calculation) (cid:39) (cid:92) (( w ( f )) (cid:92) ( a (cid:92) ) = b ) (by left exactness and idempotence)One then has to check that this equivalence is the one that is induced by composition with the counit, butthis follows from the definition of the left-exactness equivalence.23 roposition 2.36 (Dull Self-adjointness for Pointed Types) . For any dull pointed types A and B , there isan equivalence (cid:92) ( A → (cid:63) (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → (cid:63) B ) Proof.
By Proposition 2.34 (where (cid:92)B is modal by Proposition 2.9), ( A → (cid:63) (cid:92)B ) (cid:39) ( (cid:92)A → (cid:63) (cid:92)B ). Usingunivalence, ( λX : U .(cid:92)X ) preserves equivalences, so we have (cid:92) ( A → (cid:63) (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → (cid:63) (cid:92)B )Then by Proposition 2.35 we have (cid:92) ( (cid:92)A → (cid:63) (cid:92)B ) (cid:39) (cid:92) ( (cid:92)A → (cid:63) B ). Informally, the modal types A (cid:39) (cid:92)A studied above are those with no synthetic spectral information—wethink of (cid:92)A as forgetting the spectra and replacing them with the trivial one, so if A is equivalent to (cid:92)A , then A had no spectral information to begin with. Dually, we can consider types with only synthetic spectralinformation, which can be defined by demanding that its underlying space is contractible. In our intendedmodel, such a type corresponds to an individual spectrum indexed by the point — finding the spectra amongthe parametrised families of spectra as those families where the index space is trivial. However, since thetype theory thus far admits more models than the main intended one, we will refer to such a type as reduced rather than as “a spectrum” (though when reading it can be helpful to substitute “a spectrum” for “reduced”to gain intuition). This is an instance of a general definition: for any monadic modality (cid:13) , a (cid:13) -connected type A is one where (cid:13) A is contractible [RSS20], so a reduced type is a (cid:92) -connected one. Definition 3.1.
A type E is reduced if (cid:92)E is contractible. We haveRedu : ≡ (cid:88) E : U isContr ( (cid:92)E )for the type of reduced types. Remark 3.2.
In the pointed spaces model of Section 8, the reduced types are “synthetic pointed types”.A reduced type A has B A contractible, so E A is just a single type, and its section p A is just an element of E A . Moreover, any function f : A → B for A and B reduced is a “synthetic pointed map”—inside the typetheory, we do not need to carry around the data saying that f preserves the point, but in the pointed spacesmodel it will be interpreted as a function that preserves the sections of A and B , i.e. the points. Remark 3.3.
With reduced types/spectra in mind, we can clarify why the syntactic property of a type E being dull is not the same as it being modal. Thinking of our intended model, the only spectrum (reducedtype) that is also a space (modal) is the point. However, we can have a non-trivial spectrum (reduced type)that is dull, which describes the relationship of E to the context —a dull spectrum is one that only variesover the underlying space of the context.In what follows, we will often say “For a dull X. . . ”, which should be parsed formally as a dull Π type (cid:81) ( X :: ... ) . . . as in Definition 2.29. In particular “For a dull reduced type E means (cid:81) ( E ::Redu) (cid:81) ( ... ) , thoughwe will omit the projection of the type part and use E directly as a type. This means that proof that E isreduced is dull, as well as the type itself. Definition 3.4.
Any dull reduced type E has a canonical point (cid:63) E : E given by the composite 1 → (cid:92)E → E ,where the first map is part of the data of (cid:92)E being contractible, and the second is ε E . Proposition 3.5.
Any dull map f : E → F between dull reduced types is a pointed map in a canonical way. roof. In the diagram 1 (cid:92)E (cid:92)FE F (cid:92)ff the top triangle commutes by contractibility of (cid:92)F , and the bottom square commutes by naturality of thecounit, so we have a path equipping f with the structure of a pointed map.We can’t show that this pointing of f : E → F is unique, but we can show that the underlying space of‘ f is pointed’ is contractible, i.e. ‘ f is pointed’ is itself reduced. Hence: Proposition 3.6. If E and F are dull reduced types then (cid:92) ( E → F ) (cid:39) (cid:92) ( E → (cid:63) F ) .Proof. We verify (cid:92) ( E → (cid:63) F ) ≡ (cid:92) (cid:88) f : E → F f ( (cid:63) E ) = (cid:63) F (cid:39) (cid:88) f : (cid:92) ( E → F ) (cid:92) ( f (cid:92) ( (cid:63) E ) = (cid:63) F ) (Proposition 2.16) (cid:39) (cid:88) f : (cid:92) ( E → F ) f (cid:92) ( (cid:63) E ) (cid:92) = (cid:92)F (cid:63) F (cid:92) (Proposition 2.17) (cid:39) (cid:92) ( E → F ) ( (cid:92)F is contractible) Definition 3.7. If A is any type and x : (cid:92)A is a dull point of its base, the reduced type over x is the type A x : ≡ (cid:88) y : A ( x = y (cid:92) )When A is dull, A x is canonically pointed by ( x (cid:92) , refl x ) : (cid:80) ( y : A ) ( x = y (cid:92) ). Proposition 3.8. A x is reduced.Proof. We calculate: (cid:92) (cid:88) y : A ( x = y (cid:92) ) (cid:39) (cid:88) u : (cid:92)A (cid:92) ( x = u (cid:92)(cid:92) ) (Proposition 2.16) (cid:39) (cid:88) u : (cid:92)A ( x = u (cid:92)(cid:92) ) (= (cid:92)A is modal by Proposition 2.15) ≡ (cid:88) u : (cid:92)A ( x = u )which is contractible.This lets us internalise the idea that every type is a ‘space-valued family of spectra’:25 orollary 3.9. For any type A , A (cid:39) (cid:88) x : (cid:92)A A x Proof.
Expanding A x on the right, and using the fact that x = x : (cid:88) ( x : (cid:92)A ) (cid:88) ( y : A ) ( x = y (cid:92) ) (cid:39) (cid:88) ( x : (cid:92)A ) (cid:88) ( y : A ) ( x = y (cid:92) )Interchange the Σ-types and then you have a contractible pair.Reduced types are closed under many operations: Proposition 3.10.
Reduced types are closed under Σ -types, identity types, pullbacks, pushouts, suspensionsand loop spaces.Proof. Closure under Σ, identity types and pullbacks holds for any lex modality [RSS20, Theorem 3.1].Closure under pushouts follows from Proposition 2.27. Suspension types and loop spaces (defined via identitytypes) are special cases of pullbacks and pushouts.
Remark 3.11.
Since a reduced type E is a type, we can apply the ordinary higher inductive suspensiontype constructor Σ E to it, and similarly, for an element x : E , form a loop space via the identity typeΩ( E, x ) : ≡ x = E x . Thinking of the reduced types as spectra, these operations on types do turn out tocorrespond semantically to the correct operations of suspension and loop space on spectra. This is becauseSpec is a full subcategory of P Spec, and the limits and colimits defining suspension and loop space alreadyland in Spec, so they coincide with the limits and colimits calculated in the subcategory.
Remark 3.12.
A common abuse of notation is, for a pointed type (
X, x ), to write Ω X for the pointedtype ( x = X x, refl x ), leaving x to be inferred from context. Any dull reduced type E is pointed by (cid:63) E fromDefinition 3.4, and when we write Ω E for a dull reduced type, (cid:63) E is the point that should be inferred. Proposition 3.13.
For dull reduced types E and F , suspension and loop space are dull adjoints, i.e. (cid:92) (Σ E → F ) (cid:39) (cid:92) ( E → Ω F ) Proof.
By Proposition 3.6, it is equivalent to show (cid:92) (Σ E → (cid:63) F ) (cid:39) (cid:92) ( E → (cid:63) Ω F )so this follows by functoriality of (cid:92) from the fact that suspension and loop space are adjoint for (general)types and pointed maps [HoTTBook, Lemma 6.5.4]. We now have defined the modal types, i.e. the spaces (in the intended model in P Spec), and the reducedtypes, i.e. the spectra. One important feature of spectra that we would like to capture synthetically is anadjunction relating these: Redu (spectra)Modal (cid:63) (spaces) Ω ∞ Σ ∞ (cid:97) ∞ operation ‘freely stabilises’ a pointed modal type. Once we have imposed some axioms, we will findthat the homotopy groups of the reduced type Σ ∞ X correspond to the stable homotopy groups of the modaltype X .Recall from the introduction that the ∞ -category of spectra may be defined as the limitSpec = lim ←− (cid:16) · · · Ω −→ S ∗ Ω −→ S ∗ Ω −→ S ∗ (cid:17) and that spectra can presented concretely as a sequence of pointed spaces X , X , . . . with X (cid:39) Ω X , X (cid:39) Ω X , . . . . Then Ω ∞ sends a spectrum to the space X . It is named Ω ∞ as we have ‘applied Ω infinitelymany times’ to reach the end of the limit. The left adjoint Σ ∞ sends a space X to the spectrification of itssuspension pre-spectrum (see Section 5 below), i.e. we can make a sequence of pointed spaces X, Σ X, ΣΣ X, . . . with maps X → (cid:63) ΩΣ X , Σ X → (cid:63) ΩΣΣ X . . . given by the unit of the Σ (cid:97) Ω adjunction. These maps are notequivalences, which is corrected by replacing each space by a certain colimit, a process called spectrification.Here, we instead define an abstract/synthetic variant of this adjunction, which can be interpreted in thisway in P Spec. We will do so by assuming the existence of a distinguished reduced type S : Redu. Notethat S is a closed type, so is dull. In our intended model this will be interpreted as the sphere spectrum(i.e. Σ ∞ S ) living over the point. In this section, we will use the notation S and Σ ∞ / Ω ∞ because of theintended interpretation in P Spec, but these will be abstract operations that exist in any model (up to thechoice of S ).Using S , we define Ω ∞ as follows: Definition 3.14.
For E : Redu, define the modal typeΩ ∞ E : ≡ (cid:92) ( S → E )which is pointed by the constant zero map ( λ .(cid:63) E ) (cid:92) . Remark 3.15.
To gain intuition for why this is the right definition, we can consider the pointed spacesmodel of Section 8. The analogue of S there is B , the two-point space S living over the point. The base ofthe function type B → E is equivalent to the type of all basepoint preserving maps from the upstairs of B to the upstairs of E . The basepoint is fixed, and there is one free point that can be mapped to any point ofthe upstairs E . So the base space of B → E indeed corresponds to the upstairs of E .For spectra, similar reasoning applies, using the Σ ∞ (cid:97) Ω ∞ adjunction more explicitly, and that the spherespectrum is the stabilisation of the two-point space:Map Spec ( S , E ) (cid:39) Map
Spec (Σ ∞ S , E ) (cid:39) Map S (cid:63) ( S , Ω ∞ E ) (cid:39) Map S (1 , Ω ∞ E ) (cid:39) Ω ∞ E So we take ‘Map
Spec ( S , E )’ as our definition of Ω ∞ E .One application of Ω ∞ is defining the homotopy groups of a spectrum, in the sense that is used in stablehomotopy theory: Definition 3.16.
The S -shifted homotopy groups of a reduced type E are defined by π sn E : ≡ π n (Ω ∞ E )Simply calculating π n ( E ) will not do the correct thing: we will see later that, after imposing a stabilityaxiom (Section 4), reduced types are ∞ -connected 4.10, so π n ( E ) (cid:39) ∞ (cid:97) Ω ∞ then has a surprisingly simple formula: Definition 3.17.
For X a pointed modal type, define Σ ∞ X : ≡ X ∧ S .This is left adjoint roughly because maps of reduced types are pointed maps, and − ∧ A (cid:97) A → (cid:63) − forany A .First, we check that Σ ∞ lands in reduced types: 27 roposition 3.18. For any modal type X , Σ ∞ X is reduced.Proof. The pushout diagrams defining X ∨ S and X ∧ S are1 X S X ∨ S (cid:112) X ∨ S X × S ∞ X (cid:112) Because (cid:92) preserves pushouts by Proposition 2.27 and products by Proposition 2.16, and S is reduced, so (cid:92) S (cid:39)
1, we can calculate1 (cid:92)X (cid:92) ( X ∨ S ) (cid:39) (cid:92)X (cid:112) (cid:92)X (cid:92)X (cid:92) (Σ ∞ X ) (cid:39) (cid:112) because the top of the second diagram is the identity, and the pushout of a map along the identity is thesame map. Proposition 3.19. Σ ∞ and Ω ∞ are (dull) adjoints: there is an equivalence (cid:92) (Σ ∞ X → E ) (cid:39) ( X → (cid:63) Ω ∞ E ) where X is a pointed modal type and E is reduced.Proof. X → (cid:63) Ω ∞ E ≡ ( X → (cid:63) (cid:92) ( S → (cid:63) E )) (cid:39) (cid:92) ( X → (cid:63) (cid:92) ( S → (cid:63) E )) ( − → (cid:63) (cid:92) − is modal ) ≡ (cid:92) ( (cid:92)X → (cid:63) ( S → (cid:63) E )) (Proposition 2.36) (cid:39) (cid:92) ( X → (cid:63) ( S → (cid:63) E )) ( X modal) (cid:39) (cid:92) ( X ∧ S → (cid:63) E ) ≡ (cid:92) (Σ ∞ X → (cid:63) E ) (cid:39) (cid:92) (Σ ∞ X → E ) (Proposition 3.6, Proposition 3.18)Here we use currying for pointed maps A → (cid:63) ( B → (cid:63) C ) (cid:39) ( A ∧ B ) → (cid:63) C , which has been proved in typetheory [van18, Theorem 4.3.28]. Remark 3.20.
In the pointed spaces model, for a pointed modal type X , X ∧ B works out to be B X ∧ X + 1 (cid:39) X ∨ S → X × S (cid:39) X + X which is the identity on the first component X and the basepoint inclusion on the second. So the first copyof X is crushed to a point, and identified with the basepoint of the second copy of X .In all, the operation takes a pointed modal type X to a reduced type Σ ∞ X , moving X from the base tothe fibre, internalising the analytic pointing as synthetic pointing.In P Spec we have to work a little harder to justify this definition. Σ ∞ is a functor from pointed spacesto spectra, but we can precompose with the functor ( − ) + : S → S ∗ to get a functor from unpointed spaces.This is typically written Σ ∞ + : S →
Spec, and is left adjoint to the functor given by computing the pointedspace Ω ∞ and forgetting the basepoint. 28s a left adjoint, Σ ∞ + preserves colimits, and because every space is the colimit of its points, we calculateΣ ∞ + ( X ) (cid:39) Σ ∞ + (colim X (cid:39) colim X Σ ∞ + (1) (cid:39) colim X Σ ∞ ( S ) (cid:39) colim X S I.e., the colimit of the constant diagram on X at S . For us, such a constant diagram is given by theparametrised spectrum X × S , placing a copy of S over every point in X . The desired colimit can becomputed as the cofibre of X → X × S which is the basepoint in the second component, crushing the base X to a point. We can take this as our type-theoretic definition of Σ ∞ + :Σ ∞ + ( X ) : ≡ cofib( X → X × S )To get back to Σ ∞ ( X ) for X a pointed type, we have to crush the ‘extra copy of S ’ that was addedover the new basepoint: this is now taking the cofibre of the composite S → X × S → Σ ∞ + X which is thebasepoint in the first component. Combining the two cofibre diagrams, in all we have calculated the smashproduct X ∧ S . So far, we have seen that we have the three adjunctions in the following diagram (the two vertical sides arethe same): Modal (cid:63)
Modal (cid:63)
Redu Redu ΣΣ ∞ ⊥(cid:96) Ω Σ ∞ (cid:96) ΣΩ ∞ ⊥ Ω Ω ∞ We can also show that the diagram commutes.
Remark 3.21.
In pointed spaces it is clear this should be true, as the Σ ∞ (cid:97) Ω ∞ adjunction simply movespointed spaces into the fibre over a point and back, and the suspension/loop space of a reduced type iscalculating the suspension/loop space of the unique fibre.For spectra, consider a spectrum again presented as a sequence of pointed spaces ( E , E , . . . ). Theloop space of such an Ω-spectrum can be calculated by shifting the spaces over by one, giving Ω-spectrum(Ω E , E , E , . . . ), so extracting the 0th space commutes with calculating the loop space.The suspension of an Ω-spectrum can be calculated by shifting the spaces the other way, giving ( E , E , . . . ).Leaving aside spectrification briefly, Σ ∞ X is given by the prespectrum ( X, Σ X, Σ X, . . . ), so Σ ∞ Σ X ≡ (Σ X, Σ X, . . . ) is exactly Σ ∞ X shifted by one. Proposition 3.22. Ω ∞ commutes with the ordinary loop space operation Ω : Ω ∞ Ω E (cid:39) (cid:63) ΩΩ ∞ E naturally in E . Note that the left-hand side is the loop space on reduced (and therefore pointed) types, while the right-hand side is the loop space on pointed modal types, but both are implemented by the usual loop space ontypes.This is easy, after the following basic fact about loop spaces.
Lemma 3.23.
For any pointed types A and B , ( A → (cid:63) Ω B ) (cid:39) (cid:63) Ω( A → (cid:63) B ) naturally in B . roof. ( A → (cid:63) Ω B ) (cid:39) (cid:63) ( A → (cid:63) ( S → (cid:63) B )) (cid:39) (cid:63) ( S → (cid:63) ( A → (cid:63) B )) (cid:39) (cid:63) Ω( A → (cid:63) B )The first equivalence is essentially the universal property of the higher inductive circle S , while the secondfollows from exchange for function types. Proof of Proposition. Ω ∞ Ω E ≡ (cid:92) ( S → (cid:63) Ω E ) (cid:39) (cid:63) (cid:92) (Ω( S → (cid:63) E )) (cid:39) (cid:63) Ω (cid:92) ( S → (cid:63) E ) ≡ ΩΩ ∞ E For any pointed type, (cid:92) Ω( A, a ) (cid:39) (cid:63) Ω( (cid:92)A, a (cid:92) ) follows from Proposition 2.17.In the other direction, we have: Proposition 3.24. Σ ∞ commutes with Σ : ΣΣ ∞ X (cid:39) Σ ∞ Σ X naturally in X .Proof. First, some properties of the suspension and smash higher inductive types in ordinary homotopy typetheory are that Σ X (cid:39) S ∧ X [Bru16, Proposition 4.2.1] and smash is associative [van18, Definition 4.3.33].Thus, we can calculateΣΣ ∞ X ≡ Σ( X ∧ S ) (cid:39) S ∧ ( X ∧ S ) (cid:39) ( S ∧ X ) ∧ S (cid:39) Σ ∞ Σ X Classically, the category of spectra has a number of special properties, including a zero object, biproducts(products and coproducts that are isomorphic), any pushout square is a pullback square and vice versa,and suspension and loop space are inverse (not only adjoint). Thus far, our definition of synthetic spectraas reduced types (dully) has a zero object: 1 is initial as well as terminal because (cid:92) (1 → E ) (cid:39) (cid:92) ( E ) (cid:39) ∨ .For any pointed types A and B there is a canonical wedge inclusion ι A,B : A ∨ B → A × B . Axiom S (for Stable).
For any dull reduced types E and F , the wedge inclusion ι E,F : E ∨ F → E × F isan equivalence. Unfolding the informal use of dull Π-types, (Proposition 2.29), this is asserting the existence of a term ax S : (cid:89) ( E : (cid:92) Redu) (cid:89) ( F : (cid:92) Redu) isEquiv ( ι E (cid:92) ,F (cid:92) ) Remark 4.1.
Some care has to be taken when devising an internal version of the external fact that thesubcategory Spec (cid:44) → P Spec is stable. The obvious thing to try is an an axiom that applies to any reducedtype. The issue is that when asserting the existence of a closed term, like the axiom above, the term can beweakened to any ambient context. 30emantically, this means we have to consider whether the axiom holds in all slice categories P Spec / Γ.In our situation, it does not . A reduced type in P Spec / Γ consists of a family of spectra E over the base ofΓ, together with spectrum maps between the fibres of E and the corresponding fibres of Γ. This categoryis not stable in general, as it lacks a zero object (among other things). If the context Γ itself consists of asingle spectrum F , then the existence of a zero object would imply that any map E → F splits.The axiom does hold in P Spec /X when X is a space, as reduced types in P Spec /X are exactly thefamilies of spectra over X , comprising a stable category. Syntactically this requirement corresponds tohaving a dull context, hence the restriction to types in (cid:92) Redu in Axiom S.We can weaken our ax S to an arbitrary context Γ and still be safe, as the spectra E (cid:92) and F (cid:92) will onlydepend on the underlying space of Γ. Remark 4.2.
This axiom rules out the pointed spaces model, as the wedge and product of reduced typesin that model correspond to the ordinary wedge and product of the pointed types in the unique fibre. But it doesn’t rule out the trivial model where (cid:92) is the identity functor. There, the only reduced type is the point,and the wedge inclusion 1 ∨ → × Proposition 4.3.
For two dull reduced types E and F , the smash product E ∧ F and the join E ∗ F areboth contractible.Proof. Recall that the smash product E ∧ F is the cofibre of the wedge inclusion, i.e. the pushout E ∨ F E × F E ∧ F (cid:112) Axiom S asserts that the top map is an equivalence, so the bottom-right corner is equivalent to the bottom-left. For the join, we have E ∗ F (cid:39) Σ( E ∧ F ) by [Cav15, Theorem 4.19], and the suspension of a contractibletype is contractible.Here, E ∧ F is the smash product of types , which does not correspond to the ‘smash product of spectra’,an important operation in stable homotopy theory.Next, we show that Axiom S indeed makes pullbacks and pushouts in Redu coincide, mainly as a conse-quence of the Little Blakers-Massey Theorem [ABFJ20]. As a first step: Lemma 4.4.
For any pointed type A , there is a pullback square ΣΩ A A ∨ AA A × A ι ∆ where the map on the left is the counit of the Σ (cid:97) Ω adjunction. This will follow quickly from the following consequence of descent for pushouts:
Theorem 4.5 ([Rij18, Theorem 2.2.12]) . Consider a commuting cube of types S (cid:48) A (cid:48) S B (cid:48)
A X (cid:48)
BX, nd suppose the vertical squares are pullback squares. Then the commuting square A (cid:48) (cid:116) S (cid:48) B (cid:48) X (cid:48) A (cid:116) S B X is a pullback square.Proof of Lemma 4.4.
Consider the commutative cubeΩ A A A AA × A, where the vertical map A → A × A is the diagonal, and the maps A → A × A on the left and right are theidentity on one component and constant at the point on the other. All of the vertical squares are pullbacks.Now note that the pushout of the top span is ΣΩ A , and the pushout of the bottom span is A ∨ A , so bythe above theorem we have the desired pullback square (with the top/left bottom/right maps swapped, butpullbacks are symmetric in the sense that A × C B (cid:39) B × C A ). Corollary { S } For any dull reduced type, the canonical map ΣΩ E → E is an equivalence.Proof. By Lemma 4.4, this map is the pullback of the wedge inclusion ι along ∆. By Axiom S, ι is anequivalence, and the pullback of an equivalence along any map is an equivalence. Definition 4.7.
Recall [HoTTBook, Definition 7.5.1] that a type A is n -connected if its n -truncation iscontractible, and a map is n -connected if its fibre is an n -connected type for all base points. A type orfunction is ∞ -connected if it is n -connected for every n .We will use the following Lemmas about n -connected types: Lemma 4.8.
Suppose that a type A is 0-connected and P : A → Prop is a family of propositions ( − -types).Then if P ( a ) holds for some a : A , then P ( a (cid:48) ) holds for all a (cid:48) .Proof. Assume an a such that P ( a ) and another point a (cid:48) . Since A is 0-connected, its 0-truncation iscontractible, and therefore its 0-truncation is a proposition [HoTTBook, Theorem 7.1.10], so we get a path | a (cid:48) | = (cid:107) A (cid:107) | a | . Commuting the truncation with the loop space gives (cid:107) a (cid:48) = a (cid:107) − [HoTTBook, Theorem 7.3.12].That is, a (cid:48) is merely equal to a . But P ( a (cid:48) ) is a proposition by assumption, so to prove it, we can assume a (cid:48) = a , and then transport the assumed proof of P ( a ). Lemma 4.9. • If A and B are -connected then so is A × B • If A, B are -connected and C is -connected, then for any maps f : A → C and g : B → C , thepullback A × C B is -connected.Proof. For the first part, truncation preserves products [HoTTBook, Theorem 7.3.8], so to show (cid:107) A × B (cid:107) iscontractible, we can equivalently show that (cid:107) A (cid:107) × (cid:107) B (cid:107) is contractible. But (cid:107) A (cid:107) and (cid:107) B (cid:107) are contractibleby assumption, and 1 × (cid:39)
1. 32or the second, the pullback is given by the type (cid:80) (( x,y ): A × B ) f ( x ) = C g ( y ). By [HoTTBook, Theorem7.3.9, Theorem 7.3.12], we have (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) (cid:88) ( x,y ): A × B f ( x ) = C g ( y ) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) (cid:39) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) (cid:88) ( x,y ): A × B (cid:107) f ( x ) = C g ( y ) (cid:107) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) (cid:39) (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) (cid:88) ( x,y ): A × B | f ( x ) | = (cid:107) C (cid:107) | g ( y ) | (cid:13)(cid:13)(cid:13)(cid:13)(cid:13)(cid:13) (cid:39) (cid:107) A × B (cid:107) (cid:39) (cid:107) C (cid:107) is contractible by assumption, so any identity type in it is as well,and the last step is by the previous part, since A and B are 0-connected. Corollary { S } Dull reduced types and dull maps between them are ∞ -connected.Proof. For types, we prove by induction on n that every dull reduced type E is n -connected. Every type is( − − E is reduced, and we want to show that it is ( n + 1)-connected. Then Ω E is also reduced by Proposition 3.10and dull, so by the inductive hypothesis (which applies to all dull reduced types, so in particular Ω E ) it is n -connected. Suspension increases connectivity by 1 [HoTTBook, Theorem 8.2.1], so ΣΩ E is ( n +1)-connected.But by Corollary 4.6, E (cid:39) ΣΩ E , so E is ( n + 1)-connected as well.Now for maps, fix an n . The fibre of a dull map f : E → F over the basepoint is the type fib f ( (cid:63) F ) := (cid:80) ( x : E ) f ( x ) = (cid:63) F , which is a dull reduced type and thus is an ∞ -connected type by above, and therefore n -connected. We now show that this implies that all fibres are n -connected using Lemma 4.8. First, F is adull reduced type, and thus by the previous part it is in particular 0-connected. For any type A , the type“ A is n -connected” is a proposition, because it unfolds to “the n -truncation of A is contractible”, and beingcontractible (like all h-levels) is a proposition [HoTTBook, Theorem 7.1.7]. Thus, fib f ( (cid:63) F ) being n -connectedimplies the same for any basepoint x : F , so f is an n -connected map.We will now make use of the Little Blakers-Massey Theorem and its dual, which is the specialisation ofthe Generalised Blakers-Massey Theorem [ABFJ20] to the identity modality. The Generalised Theorem hasbeen formalised in The HoTT Library [Shu19b]. First, some notation: Definition 4.11.
For f : A → B , let ∆ f denote the canonical map A → A × B A . Definition 4.12.
For f : A → B and g : C → D , the pushout product f (cid:50) g is defined to be the canonicalgap map A × C A × DB × C P B × D (cid:112) f (cid:50) g where P : ≡ ( A × D ) (cid:116) A × C ( B × C ). 33 emma 4.13. The fibres of ∆ f are given by fib ∆ f ( a, a (cid:48) , p ) (cid:39) (( a, p ) = fib f ( f ( a (cid:48) )) ( a (cid:48) , refl f ( a ) )) , and in particular, fib ∆ f ( a, a, refl a ) (cid:39) Ω ( a, refl a ) fib f ( f ( a )) . Proof.
Direct calculation: fib ∆ f ( a, a (cid:48) , p ) : ≡ (cid:88) x : A ( x, x, refl f ( x ) ) = ( a, a (cid:48) , p ) (cid:39) (cid:88) ( x : A ) (cid:88) ( l : x = a ) (cid:88) r : x = a (cid:48) ! ap f ( l ) · ap f ( r ) = p (cid:39) (cid:88) r : a = a (cid:48) ap f ( r ) = p (cid:39) (cid:88) r : a = a (cid:48) ! ap f ( r ) · p = refl f ( a (cid:48) ) (cid:39) (cid:88) r : a = a (cid:48) r ∗ ( p ) = refl f ( a (cid:48) ) (cid:39) ( a, p ) = ( a (cid:48) , refl f ( a (cid:48) ) ) Proposition 4.14.
The pushout product is the ‘external fibrewise join’, in the sense that for b : B and d : D , fib f (cid:50) g ( b, d ) (cid:39) fib f ( b ) ∗ fib g ( d ) Proof.
This is another application of descent. Consider the cube fib f ( b ) × fib g ( d ) fib f ( b ) A × C fib g ( d ) A × D B × CB × D The back vertical map extracts the A and C from the fibres, the side vertical maps extract the A or C andpair with b or d in the other component, and the front vertical map is ( b, d ). By singleton contractibilityand paths in products being component-wise, all the vertical sides are pullback squares. The correspondingsquare fib f ( b ) ∗ fib g ( d ) 1 P B × D f (cid:50) g is a pullback by Theorem 4.5, so fib f ( b ) ∗ fib g ( d ) is equivalent to the fibre of f (cid:50) g at ( b, d ).We now quote the Theorem that actually does the work:34 heorem 4.15 (Little Blakers-Massey Theorem, [ABFJ20, Corollary 4.1.4, Theorem 3.5.1]) . Consider thefollowing square.
Z YX W gf hk • If the square is a pushout and ∆ f (cid:50) ∆ g is an equivalence, then the square is also a pullback. • If the square is a pullback and h (cid:50) k is an equivalence, then the square is also a pushout. Theorem { S } A dull commutative square in reduced types is a pullback square iff it is a pushoutsquare.Proof.
Suppose a dull commutative square in reduced types
E GF H gf hk
By Definition 3.4 and Proposition 3.5, we have base points (cid:63) E , (cid:63) F , (cid:63) G , (cid:63) H , and the maps are all pointed.Thus, the fibres all have dull points— e.g. fib f ( (cid:63) F ) := (cid:80) ( z : E ) f ( z ) = (cid:63) F has a point given by (cid:63) E and thepath showing f is pointed.To use Theorem 4.15, we just need to show that ∆ f (cid:50) ∆ g and h (cid:50) k are equivalences, which we will dousing the “contractible fibres” definition of equivalence.The fibre of ∆ f (cid:50) ∆ g over the basepoint p : ≡ (( (cid:63) E , (cid:63) E , refl f ( (cid:63) E ) ) , ( (cid:63) E , (cid:63) E , refl g ( (cid:63) E ) )) is Ω( fib f ( (cid:63) F )) ∗ Ω( fib g ( (cid:63) G )) by Lemma 4.13 (where f ( (cid:63) E ) = (cid:63) F and g ( (cid:63) E ) = (cid:63) G because the maps are pointed) and Propo-sition 4.14. Again by Proposition 4.14, the fibre of h (cid:50) k over q : ≡ ( (cid:63) H , (cid:63) H ) is fib h ( (cid:63) H ) ∗ fib k ( (cid:63) H ). Toshow that these are both contractible, by Proposition 4.3, it suffices to show that the pieces of the join aredull, reduced types. By Proposition 3.10, reduced types are closed under fibres and loop spaces, and for thebasepoints these types are dull because the basepoints are. This shows that fib ∆ f (cid:50) ∆ g ( p ) and fib h (cid:50) k ( q )are contractible.Since the fibres over p and q are contractible, to show that general fibres fib ∆ f (cid:50) ∆ g ( p ) and fib h (cid:50) k ( q ) overany p and q are contractible, by Lemma 4.8 it suffices to show that p : ( E × F E ) × ( E × G E ) and q : H × H are elements of 0-connected types, since being contractible is a proposition. For q , by Corollary 4.10, H is ∞ -connected and in particular 0-connected, so H × H is 0-connected by Lemma 4.9. For p , again usingclosure under products, we need to show that ( E × F E ) and ( E × G E ) are 0-connected. By Corollary 4.10, E is 0-connected and F , G are 1-connected, so the pullbacks are 0-connected as well by Lemma 4.9. Thisuse of 0-connectedness is important because the fibre of a map between dull reduced types is only dull whenthe point over which we are taking the fibre is, so the argument in the previous paragraph can be applieddirectly to p and q .We showed that the counit ΣΩ E → E is an equivalence in Corollary 4.6, and we can now show that theunit is as well: Corollary { S } For any E : Redu , the unit map E → ΩΣ E is an equivalence.Proof. The pushout square defining the suspension is E
11 Σ E (cid:121) (cid:112) sn
35y Theorem 4.16, this is also a pullback square. However, we also have a pullback square n = Σ E s
11 Σ E (cid:121) (cid:112) sn so uniqueness of pullbacks gives an equivalence E (cid:39) ( n = s ). If we consider the suspension to be pointed by N , then Ω(Σ E ) is the type n = n . But since E is pointed, we have a path mer ( (cid:63) E ) : s = n , and compositionwith this path gives an equivalence ( n = s ) (cid:39) ( n = n ), so E ∼ = Ω(Σ E ).The unit of the adjunction Σ (cid:96) Ω sends e : E to the path mer ( e ) · ! mer ( (cid:63) E ), so the composite equivalenceis indeed the unit. In the previous section, we showed that Axiom S gives the reduced types/synthetic spectra many of theproperties that we expect spectra to have. In this section, we investigate an additional axiom, which relatesthe synthetic spectra represented by reduced types to the concrete/analytic spectra that can be definedin pure homotopy type theory. This also results to be proved using the reduced types and transferred toanalytic spectra, and vice versa.One can define (“Ω-”)spectra internally in type theory [van18; Cav15] as sequences of types and connect-ing maps.
Definition 5.1. A sequential prespectrum J is a sequence of pointed modal types J : N → Modal (cid:63) togetherwith pointed maps α n : J n → (cid:63) Ω J n +1 . A sequential spectrum is a prespectrum such that the α n are pointedequivalences. The types of such objects are denoted SeqPreSpec and SeqSpec respectively. Definition 5.2.
A morphism of sequential (pre)spectra f : Mor( I, J ) is a sequence of pointed maps f n : I n → (cid:63) J n that commute with the α n . Remark 5.3.
We need to restrict the types in the sequence to be modal so that semantically they correspondto sequences of spaces. Otherwise we would be describing a spectrum object in P Spec (cid:63) , something morecomplicated than an ordinary spectrum.Our goal is to relate our reduced types with these sequential spectra. We do this by describing a seriesof (dull) adjoints: Modal (cid:63)
SeqPreSpec SeqSpec Redu susp ⊥ ⊥ spec0 th ⊥ Lι R
The left two adjunctions take place almost entirely in pure homotopy type theory: susp takes a space X to the suspension prespectrum ( X, Σ X, ΣΣ X, . . . ), and spec is spectrification, inverting the connecting mapsto equivalences. Their composite spec ◦ susp is thus an analytic analogue of the Σ ∞ stabilisation functorwe defined in Section 3, taking a modal type to its suspension analytic spectrum. The right adjoint ι isforgetful/an inclusion, while 0 th selects the 0 th term of a pre-spectrum, and the composite 0 th ◦ ι is ananalytic analogue of Ω ∞ . All that takes us out of ordinary HoTT is the requirement that the types involvedare modal types. The new construction in this section is the rightmost adjunction relating analytic andsynthetic spectra, and an axiom stating that it is an adjoint equivalence, making the two notions of spectracoincide. Definition 5.4.
For any pointed modal type X , we have the suspension sequential prespectrum susp X where(susp X ) n : ≡ Σ n X , and the structure maps are the unit maps α n : Σ n X → ΩΣ n +1 X .36ote that all the Σ n X are modal, by Proposition 2.27. Proposition 5.5. susp is left adjoint to taking the zeroth type of a sequential prespectrum.Proof.
Suppose we have a map X → (cid:63) J . We need a map Σ X → (cid:63) J such that X ΩΣ XJ Ω J commutes, equivalently, one such that Σ X Σ X Σ J J commutes. Then Σ X → (cid:63) J is forced to be the composite of Σ X → Σ J → J . This argument iteratesto produce a map Mor(susp X, J ), showing the data of such a morphism is equivalent to that of a map X → (cid:63) J . Definition 5.6.
For a sequential prespectrum J , the spectrification of J is given by(spec J ) n : ≡ colim k Ω k J n + k Each (spec J ) n is modal by Proposition 2.28 and Lemma 2.15. That these types actually assemble intoa sequential spectrum has not yet been proven in type theory, so we leave it as an unjustified assertion —note that this assertion is a statement in pure homotopy type theory, and is not dependent on the modalextension we make in this paper, a proof of the assertion would certainly apply when the types concernedhappen to be modal. Assertion 1.
This formula defines a sequential spectrum, and the operation is left adjoint to the inclusionof sequential spectra into sequential prespectra.
Now we turn to the L (cid:97) R adjunction relating these sequential spectra to our synthetic spectra’. First,we can extract a sequential prespectrum from any reduced type E . Definition 5.7.
For E : Redu, define RE : SeqPreSpec by( RE ) n : ≡ Ω ∞ Σ n E with connecting maps( RE ) n ≡ Ω ∞ Σ n E → (cid:63) Ω ∞ ΩΣΣ n E (cid:39) (cid:63) ΩΩ ∞ ΣΣ n E (cid:39) (cid:63) ΩΩ ∞ Σ n +1 E ≡ Ω( RE ) n +1 The first map is given by functoriality of Ω ∞ on the unit X → (cid:63) ΩΣ X for X = Σ n E . The second is derivedfrom Proposition 3.22 and the third is essentially by definition, depending on how iterated suspension isdefined. Proposition { S } RE is a sequential spectrum.Proof. By Proposition 3.10, reduced types are closed under suspensions, so an induction shows that Σ n E isreduced. Therefore the unit map Σ n E → (cid:63) ΩΣΣ n E is an equivalence by Corollary 4.17, so the connectingmap defined above is a composite of equivalences.Conversely, suppose we have a sequential prespectrum J : SeqPreSpec. We can produce a reduced type LJ : Redu. 37 efinition 5.9. For J : SeqPreSpec let LJ : Redu be LJ : ≡ colim(Σ ∞ J → ΩΣ ∞ J → Ω Σ ∞ J → . . . )where the maps Σ ∞ J n → ΩΣ ∞ J n +1 are given byΣ ∞ J n → ΩΣΣ ∞ J n (cid:39) ΩΣ ∞ Σ J n → ΩΣ ∞ ΣΩ J n +1 → ΩΣ ∞ J n +1 where the maps are the unit of Σ (cid:96) Ω, Proposition 3.24, functoriality on the connecting map J n → Ω J n +1 of the prespectrum, and then the counit of Σ (cid:96) Ω.To see that this type is reduced, by Proposition 2.28, (cid:92)LJ is equivalent to the colimit of the (cid:92) Ω n Σ ∞ J i ,and reduced types are closed under loop spaces by Proposition 3.10, and Σ ∞ of any type is reduced byProposition 3.18, so each of the terms of that colimit is contractible, so the colimit is as well. Remark 5.10.
Let S : SeqPreSpec denote the sphere (analytic) prespectrum, i.e. the suspension prespec-trum of S . Then LS (cid:39) S , because at each level of the colimit we haveΩ n Σ ∞ S n ≡ Ω n ( S n ∧ S ) (cid:39) Ω n (Σ n S ) (cid:39) S The first equivalence is Σ n A (cid:39) S ∧ ( S ∧ . . . ( S ∧ A )) (cid:39) ( S ∧ S . . . ∧ S ) ∧ A (cid:39) S n ∧ A , using associativityof smash and Σ A (cid:39) S ∧ A [Bru16, Proposition 4.2.1], [van18, Definition 4.3.33]. The second is given byiterating ΩΣ E (cid:39) E for a dull reduced type E (Corollary 4.17), noting that the suspension of a dull reducedtype is reduced by Proposition 3.10, and S is assumed to be reduced. Proposition { S } The operations L and R are dull adjoints: (cid:92) ( LJ → (cid:63) E ) (cid:39) Mor(
J, RE ) Proof.
Suppose we have a dull map k : LJ → (cid:63) E . We can forget the fact that k is pointed using Proposi-tion 3.6. The data of k (using the universal property for maps out of a colimit) is equivalent to a sequenceof dull maps k n : Ω n Σ ∞ J n → E so that the squaresΩ n Σ ∞ J n Ω n +1 Σ ∞ J n +1 E E k n k n +1 commute.We can transpose the k across the adjunctions to get maps ˆ k n : J n → (cid:63) Ω ∞ Σ n E . This type on theright is exactly ( RE ) n , so we just have to show that this collection of maps forms a morphism of sequentialprespectra. This mostly involves unwinding the definition of the map Ω n Σ ∞ J n → Ω n +1 Σ ∞ J n +1 Precompose the upper left corner with the equivalence Ω n +1 Σ ∞ Σ J n (cid:39) Ω n ΩΣ ∞ Σ J n (cid:39) Ω n ΩΣΣ ∞ J n (cid:39) Ω n Σ ∞ J n : Ω n +1 Σ ∞ Σ J n Ω n +1 Σ ∞ J n +1 E E ... Ω n +1 Σ ∞ ˆ α n k n +1 Since Σ (cid:97)
Ω, and for dull reduced types Axiom S implies that Σ and Ω are inverses, we also have anadjunction Ω (cid:97)
Σ on dull reduced types. Transposing across this and Σ ∞ (cid:97) Ω ∞ vertically, such squares areequivalent to squares Σ J n J n +1 ( RE ) n +1 ( RE ) n +1 ... ˆ α n ˆ k n +1 (cid:97) Ω, we get J n Ω J n +1 Ω( RE ) n +1 Ω( RE ) n +1 ... α n Ωˆ k n +1 Finally, precompose the lower left corner with the equivalence β n : ( RE ) n (cid:39) Ω( RE ) n +1 to get J n Ω J n +1 ( RE ) n Ω( RE ) n +1 ... α n Ωˆ k n +1 β n All we have left is to check is that the vertical map on the left is equal to ˆ k n . Tracing through what wehave done, it is equal to J n → ΩΣ J n → ΩΩ ∞ Σ n +1 Ω n +1 Σ ∞ Σ J n → ΩΩ ∞ Σ n +1 Ω n +1 ΣΣ ∞ J n → ΩΩ ∞ Σ n +1 Ω n Σ ∞ J n → ΩΩ ∞ Σ n +1 E → Ω ∞ ΩΣ n +1 E → Ω ∞ Σ n E In the above sequence, the map ΩΩ ∞ Σ n +1 Ω n Σ ∞ J n → ΩΩ ∞ Σ n +1 E is given by ΩΩ ∞ Σ n +1 k n , so by natu-rality, we can move this use of k n to the end. The above chain is then equal to the composite J n → ΩΣ J n → ΩΩ ∞ Σ n +1 Ω n +1 Σ ∞ Σ J n → ΩΩ ∞ Σ n +1 Ω n +1 ΣΣ ∞ J n → ΩΩ ∞ Σ n +1 Ω n Σ ∞ J n → Ω ∞ ΩΣ n +1 Ω n Σ ∞ J n → Ω ∞ Σ n Ω n Σ ∞ J n → Ω ∞ Σ n E For this to be the transpose of k n , what we need is for the composite J n → Ω ∞ Σ n Ω n Σ ∞ J n , leaving off thelast map, is equal to the unit. And it is, by liberal use of the triangle inequalities, as every map in the stringis either unit/counit or an equality of composites in a system of commuting adjunctions.Having established this adjunction, we introduce the following axiom, which identifies the synthetic andanalytic spectra: Axiom N.
The adjunction between
Redu and
SeqSpec is a dull adjoint equivalence, i.e. the map
LRE → (cid:63) E is an equivalence and Mor(
J, RLJ ) is a level-wise equivalence. As an application, we show that this axiom fixes the stable homotopy groups of S , in the sense ofDefinition 3.16, to be the actual stable homotopy groups of the ordinary spheres. Remark 5.12.
The composite right adjoint Redu → SeqSpec → SeqPreSpec → Modal (cid:63) in the diagramat the beginning of this section is ( RE ) ≡ Ω ∞ E . So the composite adjunction must be equivalent to theadjunction Modal (cid:63) Redu Σ ∞ Ω ∞ that we already have from Proposition 3.19. Definition 5.13.
Let QX : ≡ Ω ∞ Σ ∞ X . Lemma { S, N } QX (cid:39) colim k Ω k Σ k X roof. By Remark 5.12, we have QX ≡ Ω ∞ Σ ∞ X (cid:39) ι ( R ( L (spec(susp( X )))))). Axiom N allows us tochop the L (cid:97) R adjunction off this roundtrip on Modal (cid:63) , and ι is just forgetful, so we get 0th(spec(susp( X ))).Then colim k Ω k Σ k X is exactly the 0th type of the spectrification of the suspension prespectrum of X . Proposition { S, N } π sn ( S ) (cid:39) colim k π n + k ( S k ) Proof.
We will make use of some properties of sequential colimits proven in [SDR20]. Specifically, sequentialcolimits commute with taking loop spaces [SDR20, Corollary 7.4] and truncations [SDR20, Corollary 7.6],and thus calculating homotopy groups. π sn ( S ) ≡ π n (Ω ∞ S ) (by definition) (cid:39) π n (Ω ∞ Σ ∞ S ) (by Remark 5.10) (cid:39) π n (colim k Ω k Σ k S ) (by the Lemma 5.14) (cid:39) colim k π n (Ω k Σ k S ) (sequential colimit commutes with π n ) (cid:39) colim k π n + k (Σ k S ) (definition of π ) (cid:39) colim k π n + k ( S k ) (definition of S n )40 art II Metatheory
The rules for the natural type in Figures 1 and 2 can be applied to various precise formulations of type theory.For example, if the ambient Martin-L¨of type theory is thought of algebraically as an essentially algebraictheory / quotient inductive-inductive type [Alt+18], then we could make Γ a new context former, a a newterm former, the unit a new explicit substitution, and the rules defining these operations new judgementalequalities. However, this kind of algebraic formulation does not immediately capture two important aspectsof our syntax. The first is that the Γ and a are definable in terms of marked context extension and markedvariables — this would need to be recovered as part of a canonicity proof. The second is that the unitis “silent,” i.e. it does not change the raw proof term — in the algebraic style, it would be made explicitanalogously to weakening.The simplest way to make these observations formal is to adopt a more traditional syntax, where thesubjects of a judgement Γ (cid:96) a : A are a raw syntax context Γ, a raw syntax term a , and a raw syntaxtype A . These weak invariants “break the loop” so that the basic inference rules can be defined prior tothe admissible rules — otherwise, one requires the admissible rules to know that the presuppositions of thejudgements are satisfied. For example, the premise of (Γ , x :: A ) ctx is Γ (cid:96) A type , but Γ ctx only followsfrom an admissible rule. When making rules in this style precise, there are some somewhat arbitrary choices about the presuppositionsof a judgement. For example, a derivation of Γ (cid:96) a : A might1. presuppose that Γ is well-formed, i.e. the subject is really a raw context Γ such that Γ ctx .2. check Γ ctx as part of the derivation.3. neither of the above, i.e. formally one can make derivations of Γ (cid:96) a : A for an ill-formed context Γ,but we generally will only be interested in derivations when when Γ ctx .The first has the same problem as the algebraic syntax — it requires the admissible rules to be mutualwith the basic ones — and the second is a bit far from an implementation, which inductively maintains theinvariant that the context is well-formed without repeatedly re-checking it, so we follow the third option forcontexts in all judgements. However, for types, the rules will ensure that the type is well-formed, and forequality rules, the rules will ensure that the terms are well-typed: • If Γ ctx and Γ (cid:96) a : A then Γ (cid:96) A type . • If Γ ctx and Γ (cid:96) a ≡ a (cid:48) : A then Γ (cid:96) a : A and Γ (cid:96) a (cid:48) : A .This is because, following [Str91; Hof97]’s approach to categorical semantics and initiality, we officially adopta fully annotated term syntax, where every inference rule has a direct typing premise for each term/typemetavariable appearing in the rule. (Of course, this is also a bit far from an implementation.) Togetherwith the admissible rules, these premises will be enough to ensure that the types in a typing judgement andterms in an equality judgement are well-formed. De Boer, Brunerie, Lumsdaine and M¨ortberg (see [Boe20])have given a fully mechanised initiality proof for roughly this style of presentation, though we treat variablebinding informally rather than using de Bruijn indices.According to these conventions, the official basic rules for the type theory with (cid:92) and Π are in Figure 4.41 ctx Γ ctx Γ (cid:96) A type Γ , x : A ctx Γ ctx Γ (cid:96) A type Γ , x :: A ctx Γ (cid:96) · tele Γ (cid:96) ∆ tele Γ , ∆ (cid:96) A type Γ (cid:96) ∆ , x : A tele Γ (cid:96) ∆ tele Γ , ∆ (cid:96) A type Γ (cid:96) ∆ , x :: A tele var Γ (cid:96) A type Γ , x : A, Γ (cid:48) (cid:96) x : A var-zero Γ (cid:96) A type Γ , x :: A, Γ (cid:48) (cid:96) x : A var-roundtrip Γ (cid:96) A type Γ , x : A, Γ (cid:48) (cid:96) x : A (cid:92) -form Γ (cid:96) A type Γ (cid:96) (cid:92)A type (cid:92) -intro Γ (cid:96) A type Γ (cid:96) a : A Γ (cid:96) a (cid:92)A : (cid:92)A (cid:92) -elim Γ (cid:96) A type Γ (cid:96) b : (cid:92)A Γ (cid:96) b A(cid:92) : A (cid:92) -beta Γ (cid:96) A type Γ (cid:96) a : A Γ (cid:96) ( a (cid:92)A ) A(cid:92) ≡ a : A (cid:92) -eta Γ (cid:96) A type Γ (cid:96) b : (cid:92)A Γ (cid:96) b ≡ ( b A(cid:92) ) (cid:92)A : (cid:92)A Γ (cid:96) A type Γ , x : A (cid:96) B type Γ (cid:96) Π x : A.B type Γ (cid:96) A type Γ , x : A (cid:96) B type Γ , x : A (cid:96) b : B Γ (cid:96) ( λx : A.b : B ) : Π x : A.B Γ (cid:96) A type Γ , x : A (cid:96) B type Γ (cid:96) f : Π x : A.B Γ (cid:96) a : A Γ (cid:96) f ( a ) A,x.B : B [ a/x ]Γ (cid:96) A type Γ , x : A (cid:96) B type Γ , x : A (cid:96) b : B Γ (cid:96) a : A Γ (cid:96) ( λx : A.b : B )( a ) A,x.B ≡ b [ a/x ] : B [ a/x ] Γ (cid:96) A type Γ , x : A (cid:96) B type Γ (cid:96) f : Π x : A.B Γ (cid:96) f ≡ λx : A.f ( x ) A,x.B : B : Π x : A.B
We omit the structural rules: type conversion for typing; and reflexivity, symmetry, transitivity, compatibilityfor each constructor, and type conversion for equality.Figure 4: Official Rules42 .2 Operations on Raw Syntax
The zeroing operations Γ and a and ∆ are defined on raw syntax (prior to typing). This accords withthe way we use these operations when working informally: we do not want to have to think about the exactstructure of a derivation as we zero a term. We use the following judgements for raw terms: • γ (cid:96) a rawterm denotes a raw term in the scope γ . We think of raw syntax as being intrinsically scoped,so a raw term a is judged relative to a scope γ consisting of variable names only, with no associatedtypes or marks. We do not distinguish between ordinary and marked variables in scopes γ becausewe want precomposition with the unit to be “silent”, and precomposition with the unit changes themarked context extension into into unmarked context extension. At the level of raw syntax, x is simplya term constructor underline ( x ) that takes a variable as input. • Γ rawctx denotes a raw context consisting of a list of variables with a raw term as a ‘type’ of each, andwith possible marks on the variables. What is missing from Γ ctx is that the types are not necessarilywell-formed. Every Γ rawctx has an underlying scope of variable names, written dom (Γ). • γ (cid:96) ∆ rawtele similarly denotes a raw telescope in the scope γ with possible marks on the variables.The zeroing operations on raw syntax have shapeΓ rawctx Γ rawctx −−−−− γ (cid:96) ∆ rawtele γ (cid:96) ∆ rawtele −−−−−−−− γ, γ (cid:48) (cid:96) ∆ rawtele γ, γ (cid:48) (cid:96) ∆ γ rawtele −−−−−−−−−−− γ, δ (cid:96) a rawterm γ, δ (cid:96) a γ rawterm −−−−−−−−−− When we apply these operations to well-typed telescopes and terms, we will just write, for example, ∆ and a , letting Γ represent its underlying list of variables.The definitions of the operations on raw syntax are in Figure 5.Idempotence properties of contexts and terms now hold on the level of raw syntax. Lemma 6.1. • If Ψ rawctx and dom (Ψ) (cid:96) Γ rawtele and dom (Ψ , Γ) (cid:96) ∆ rawtele , Ψ , Γ , ∆ ≡ α Ψ , Γ , ∆ • If Γ rawctx and dom (Γ) (cid:96) ∆ rawtele , Γ , ∆ ≡ α Γ , ∆ • If γ, γ (cid:48) (cid:96) ∆ rawtele then (∆ γ ) γ,γ (cid:48) ) ≡ α ∆ γ,γ (cid:48) ) ≡ α (∆ γ,γ (cid:48) ) ) γ • If γ, δ, δ (cid:48) (cid:96) a rawterm . Then ( a γ ) γ,δ ) ≡ α a γ,δ ) ≡ α ( a γ,δ ) ) γ In words, zeroing a larger piece of the context subsumes zeroing a smaller piece.Zeroing and weakening/substitution also commute at the level of raw syntax:
Lemma 6.2. • If γ (cid:96) a rawterm then γ, δ (cid:96) a γ ≡ α a γ,δ ) • If γ, γ (cid:48) (cid:96) a rawterm and γ, γ (cid:48) , x, δ (cid:96) b rawterm then ( b [ a/x ]) γ ≡ α b γ [ a γ /x ]43 , · : ≡ ΓΓ , (∆ , x : A ) : ≡ (Γ , ∆) , x : A Γ , (∆ , x :: A ) : ≡ (Γ , ∆) , x :: A · : ≡ · Γ , x : A : ≡ Γ , x :: A Γ , x :: A : ≡ Γ , x :: Ax γ : ≡ x if x ∈ γx γ : ≡ x if x / ∈ γx γ : ≡ x ( (cid:92)A ) γ : ≡ (cid:92) ( A γ )( a (cid:92)A ) γ : ≡ a γA γ (cid:92) ( a A(cid:92) ) γ : ≡ a γA γ (cid:92) ( λx : A.b : B ) γ : ≡ λx : A γ .b γ : B γ f ( a ) γA,x.B : ≡ f γ ( a γ ) A γ ,x.B γ · : ≡ · ∆ , x : A : ≡ ∆ , x :: A ∆ , x :: A : ≡ ∆ , x :: A ( · ) γ : ≡ · (∆ , x : A ) γ : ≡ ∆ γ , x : A γ (∆ , x :: A ) γ : ≡ ∆ γ , x :: Ax [ a/x ] : ≡ ax [ a/y ] : ≡ x if y (cid:54) = xx [ a/x ] : ≡ ay [ a/x ] : ≡ y if y (cid:54) = x ( (cid:92)A )[ a/x ] : ≡ (cid:92) ( A [ a/x ])( b (cid:92)A )[ a/x ] : ≡ ( b [ a/x ]) (cid:92)A [ a/x ] ( b A(cid:92) )[ a/x ] : ≡ ( b [ a/x ]) A [ a/x ] (cid:92) ( λ ( x : A ) .b : B )[ a/x ] : ≡ λ ( x : A [ a/x ]) .b [ a/x ] : B [ a/x ] f ( b ) A,x.B [ a/x ] : ≡ ( f [ a/x ])( b [ a/x ]) A [ a/x ] ,y.B [ a/x ] Figure 5: Operations on Raw Syntax44 If γ (cid:96) a rawterm and γ, x, δ, δ (cid:48) (cid:96) b rawterm then ( b [ a/x ]) γ,δ ) ≡ α b γ,x,δ ) [ a γ /x ] ≡ α b γ,x,δ ) [ a/x ]Additionally, we have Lemma 6.3. If Γ , ∆ (cid:96) a : A then a ≡ α a For this, we do need that a : A is a well-typed term, so that variables from Γ are used in the ‘correct’way: well-typed a ’s can only use variables from Γ with a marking, but raw terms might incorrectly use themunmarked. Proof.
Intuitively, the only time a γ is not equal to a is for a unmarked variable x ∈ γ , but these cannotappear in a well-typed term in a context with Γ already marked. The induction goes through because ineach inference rule, if Γ is marked in the conclusion, then any variable in Γ stays marked in all premiseswhere it occurs. We now check that the intended admissible rules are indeed admissible. To simplify the task, recall that pre-counit is a special case of pre-counit-gen , defining a : ≡ a for a term Γ (cid:96) a : A . Additionally pre-roundtrip-gen and pre-roundtrip follow by composing pre-unit and pre-counit-gen , so we donot need to prove them separately. Thus, what remains is to verify typing for Γ and a and ∆ and thatsubstitution is still admissible.First, we verify that ctx-zero and pre-counit-gen are admissible. Proposition 6.4. ctx-zero and pre-counit-gen are admissible. pre-counit-gen Γ , ∆ (cid:96) a : A Γ , ∆ (cid:96) a : A −−−−−−−−−−− Γ , ∆ (cid:96) a ≡ a (cid:48) : A Γ , ∆ (cid:96) a ≡ a (cid:48) : A −−−−−−−−−−−−−− Γ , ∆ (cid:96) A type Γ , ∆ (cid:96) A type −−−−−−−−−− Γ , ∆ (cid:96) A ≡ A (cid:48) type Γ , ∆ (cid:96) A ≡ A (cid:48) type −−−−−−−−−−−−−− Proof.
All four rules are proved by mutual induction on the typing/type formation/equality derivations. Themost important cases are the variable rules, but we also show the (cid:92) formation, introduction, and eliminationrules, and Π-formation to demonstrate bound variables. • var : There are two sub-cases, depending on whether the variable is in Γ or ∆. – In the former case, we have Γ (cid:96) A type Γ , x : A, Γ (cid:48) , ∆ (cid:96) x : A Then x :: A ∈ Γ , x : A, Γ (cid:48) . Since the context Γ , x : A is well-scoped, A only uses variables fromΓ, and so A ≡ A ,x : A, Γ (cid:48) because zeroing commutes with weakening. So Γ , x : A, Γ (cid:48) , ∆ (cid:96) x : A ,x : A, Γ (cid:48) is well-typed by var-zero , because Γ (cid:96) A type by the inductive hypothesis for thepremise (with the empty telescope), so Γ (cid:96) A type by idempotence. – In the latter case, we have Γ , ∆ (cid:96) A type Γ , ∆ , x : A, ∆ (cid:48) (cid:96) x : A By the IH on the premise, Γ , ∆ (cid:96) A type , and (∆ , x : A, ∆ (cid:48) ) ≡ ∆ , x : A , ∆ (cid:48) . Thus, wecan conclude Γ , ∆ , x : A , ∆ (cid:48) (cid:96) x : A by var .45 var-zero : We again distinguish cases depending on whether the variable was in Γ or ∆. – In the former case, we have Γ (cid:96) A type Γ , x :: A, Γ (cid:48) , ∆ (cid:96) x : A Expanding the definition of zeroing on contexts, x :: A ∈ Γ. Since A is well-typed in a contextwith Γ zeroed, A ≡ A ≡ A ,x, Γ (cid:48) ) . Γ (cid:96) A type holds by idempotence, so so Γ , ∆ (cid:96) x : A by var-zero . – In the latter case we have Γ , ∆ (cid:96) A type Γ , ∆ , x :: A, ∆ (cid:48) (cid:96) x : A Then by definition x :: A ∈ ∆ , and again A ≡ A because A is well-typed in a context Γ , ∆ withΓ already zeroed. So Γ , ∆ (cid:96) x : A is holds by var-zero because the premise Γ , ∆ (cid:96) A type holds by idempotence. • var-roundtrip : Note that A in the conclusion of the rule means A ,x : A, Γ (cid:48) ) , i.e. A zeroed withrespect to all the variables in the entire context. We again distinguish cases depending on whether thevariable was in Γ or ∆. – In the former case, we are given Γ (cid:96) A type Γ , x : A, Γ (cid:48) , ∆ (cid:96) x : A Then x :: A ∈ Γ , x : A, Γ (cid:48) , and by idempotence( A ) ≡ ( A ) ,x : A, Γ (cid:48) , ∆) ≡ ( A ,x : A, Γ (cid:48) , ∆) ) ≡ A ,x : A, Γ (cid:48) ) by idempotence/commuting with weakening, so Γ , x : A, Γ (cid:48) , ∆ (0Γ ,x : A, Γ (cid:48) ) (cid:96) x : A ,x : A, Γ (cid:48) ) is well-typed by var-zero , because the type Γ (cid:96) A type is well-formed by the IH on the premise. – If x : A ∈ ∆, then we were given Γ , ∆ (cid:96) A type Γ , ∆ , x : A, ∆ (cid:48) (cid:96) x : A Then A ≡ ( A ) , ∆ ,x : A, ∆ (cid:48) ) ≡ ( A , ∆ ,x : A, ∆ (cid:48) ) ) ≡ A by idempotence so Γ , ∆ , x : A , ∆ (cid:48) (cid:96) x : A by var-roundtrip , using the IH on thepremise to get Γ , ∆ (cid:96) A type . • (cid:92) -form : Suppose we have Γ , ∆ (cid:96) (cid:92)A type because Γ , ∆ (cid:96) A type . By idempotence, the context canbe rewritten Γ , ∆ (cid:96) A type , and also A ≡ A because A is a well-typed term in a context with Γalready marked. Reapplying the rule then gives Γ , ∆ (cid:96) (cid:92) ( A ) as required. • (cid:92) -intro : Suppose we have Γ , ∆ (cid:96) a (cid:92)A : (cid:92)A because Γ , ∆ (cid:96) A type and Γ , ∆ (cid:96) a : A . By idempotence,the context Γ , ∆ can be rewritten as Γ , ∆ , so we also have Γ , ∆ (cid:96) A type and Γ , ∆ (cid:96) a : A .Because a and A are well-formed terms in a context with Γ already marked, we have a ≡ α a and A ≡ α A , so Γ , ∆ (cid:96) A type and Γ , ∆ (cid:96) a : A as well. Reapplying the rule then givesΓ , ∆ (cid:96) ( a ) (cid:92)A : (cid:92) ( A ) as required. • (cid:92) -elim : Suppose we have Γ , ∆ (cid:96) a A(cid:92) : A because Γ , ∆ (cid:96) A type and Γ , ∆ (cid:96) a : (cid:92)A . The inductivehypothesis for a gives Γ , ∆ (cid:96) a : (cid:92)A . For the type, by idempotence Γ , ∆ ≡ Γ , ∆ , and A ≡ A because A is already well-typed in a context with Γ marked. So we have Γ , ∆ (cid:96) A type andΓ , ∆ (cid:96) a : (cid:92)A and can reapply the rule to get Γ , ∆ (cid:96) (( a ) A (cid:92) ) : A .46 Π -intro : If the inputs are Γ , ∆ (cid:96) A type Γ , ∆ , x : A (cid:96) B type then inductively Γ , ∆ (cid:96) A type Γ , ∆ , x : A (cid:96) B type where in the later case we extend the telescope to ∆ , x : A . Reapplying the rule givesΓ , ∆ (cid:96) (cid:89) x : A B type as required. Proposition 6.5. ctx-zero is admissible. Γ ctx Γ ctx −−− Proof. • In the case for · , then Γ ≡ · is well-formed. • In the case for Γ , x : A ctx , then Γ ctx and Γ (cid:96) A type , so applying the IH gives Γ ctx and pre-counit for the type gives us Γ (cid:96) A type . By idempotence Γ = Γ, so Γ (cid:96) A type as well, and Γ (cid:96) ∆ , x :: A ctx is well-formed. • In the case for Γ , x :: A ctx , we have Γ ctx and Γ (cid:96) A type . By the IH Γ ctx . By idempotence Γ ≡ Γ,so applying ctx-ext-zero to Γ (cid:96) A type gives that Γ , x :: A ctx is well-formed. Proposition 6.6.
Zeroing of telescopes is well-formed Γ (cid:96) ∆ tele Γ (cid:96) ∆ tele −−−−−− Proof. • In the case for · , then Γ (cid:96) · tele is well-formed. • In the case for ∆ , x : A ctx , we have Γ (cid:96) ∆ tele and Γ , ∆ (cid:96) A type , so applying the IH gives Γ (cid:96) ∆ tele and pre-counit for the type gives us Γ , ∆ (cid:96) A type . By idempotence, Γ , ∆ (cid:96) A type as well, so soΓ (cid:96) ∆ , x :: A ctx is well-formed. • In the case for Γ (cid:96) ∆ , x :: A tele , we have Γ (cid:96) ∆ tele and Γ , ∆ (cid:96) A type . By the IH Γ (cid:96) ∆ tele . Byidempotence Γ , ∆ ≡ Γ , ∆, so Γ , ∆ (cid:96) A type as well, and Γ (cid:96) ∆ , x :: A ctx is well-formed. Proposition 6.7.
Precomposition with the counit on a telescope is well-formed Γ (cid:96) ∆ tele Γ (cid:96) ∆ tele −−−−−−− Proof. • In the case for · then Γ (cid:96) · tele is well-formed.47 In the case for ∆ , x : A tele , we have Γ (cid:96) ∆ tele and Γ , ∆ (cid:96) A type . Inductively, Γ (cid:96) ∆ tele , andapplying pre-counit-gen to A , we have Γ , ∆ (cid:96) A type . So we have the well-formed telescopeΓ (cid:96) ∆ , x : A tele . • In the case for ∆ , x :: A tele , we have Γ (cid:96) ∆ tele and Γ , ∆ (cid:96) A type . Inductively, Γ (cid:96) ∆ tele . Byidempotence, Γ , ∆ is equal to Γ , ∆ , so the type formation premise is also Γ , ∆ (cid:96) A type , so we canform Γ (cid:96) ∆ , x :: A tele . Proposition 6.8.
The pre-unit rule is admissible. For all rules, assume Ψ ctx and Ψ (cid:96) Γ tele and Ψ , Γ (cid:96) ∆ tele . pre-unit Ψ , Γ , ∆ (cid:96) a : A Ψ , Γ , ∆ (cid:96) a : A −− − − − − −− Ψ , Γ , ∆ (cid:96) a ≡ a (cid:48) : A Ψ , Γ , ∆ (cid:96) a ≡ a (cid:48) : A −−−−−−−−−−− Ψ , Γ , ∆ (cid:96) A type Ψ , Γ , ∆ (cid:96) A type −−−−−−−−− Ψ , Γ , ∆ (cid:96) A ≡ A (cid:48) type Ψ , Γ , ∆ (cid:96) A ≡ A (cid:48) type −−−−−−−−−−−− Proof.
All four are proved by mutual induction on derivations. First we check some representative cases of pre-unit . pre-unit and the analogous statement for judgemental equality are proved by mutual inductionon typing/equality derivations. • var : We distinguish cases on which of Ψ or ∆ the variable x is in—it cannot be in Γ because allvariables in Γ are marked. In the case for Ψ (cid:96) A type Ψ , x : A, Ψ (cid:48) , Γ , ∆ (cid:96) x : A we can simply reapply the rule. In the case forΨ , Γ , ∆ (cid:96) A type Ψ , Γ , ∆ , x : A, ∆ (cid:48) (cid:96) x : A the inductive hypothesis gives Ψ , Γ , ∆ (cid:96) A type , so we reapply the rule. • var-zero : We again distinguish cases on which of Ψ , Γ , ∆ the variable was in. In the case forΨ (cid:96) A type Ψ , x :: A, Ψ (cid:48) , Γ , ∆ (cid:96) x : A we can reapply the rule. In the case for Ψ , Γ , ∆ (cid:96) A type Ψ , Γ , ∆ , x :: A, ∆ (cid:48) (cid:96) x : A Ψ , Γ , ∆ = Ψ , Γ , ∆ by idempotence, so we can reapply the rule with Ψ , Γ , ∆ (cid:96) A type for the premise.But now it is possible x ∈ Γ, and there are two cases, depending on whether x is marked in Γ: – If x in was not marked, then we have the instanceΨ , Γ (cid:96) A (cid:48) , Γ) type Ψ , Γ , x : A (cid:48) , Γ (cid:48) , ∆ (cid:96) x : A where A (cid:48) , Γ) ≡ α A . Since zeroing commutes with weakening, A = A (cid:48) , Γ ,x, Γ (cid:48) , ∆) as well, andwe want to use var-roundtrip var-roundtrip Ψ , Γ (cid:96) A (cid:48) type Ψ , Γ , x : A (cid:48) , Γ (cid:48) , ∆ (cid:96) x A (cid:48) : A For the premise, we need Ψ , Γ (cid:96) A (cid:48) type , we which can obtain by inverting the assumption thatΨ (cid:96) Γ , x : A (cid:48) , Γ (cid:48) tele If x was marked, i.e. we have Ψ , Γ (cid:96) A type Ψ , Γ , x : A, Γ (cid:48) , ∆ (cid:96) x : A then Ψ , Γ , x : A, Γ (cid:48) , ∆ (cid:96) x : A by var-zero , because we have Ψ , Γ (cid:96) A type by idempotence onthe premise. • var-roundtrip : We distinguish cases on which of Ψ or ∆ the variable x is in—again, it cannot be inΓ because all variables in Γ are marked. In the case forΨ (cid:96) A type Ψ , x : A, Ψ (cid:48) , Γ , ∆ (cid:96) x : A we can simply reapply the rule to get Ψ , x : A, Ψ (cid:48) , Γ , ∆ (cid:96) x : A — note that the old and new contextshave the same sets of variables, so A is zeroed with respect to the same implicit set of variables in bothcases.In the case for Ψ , Γ , ∆ (cid:96) A type Ψ , Γ , ∆ , x : A, ∆ (cid:48) (cid:96) x : A the inductive hypothesis (the smaller telescope ∆ is well-formed by inversion) gives Ψ , Γ , ∆ (cid:96) A type ,so we can reapply the rule. • (cid:92) -form : Suppose we have Ψ , Γ , ∆ (cid:96) (cid:92)A type because Ψ , Γ , ∆ (cid:96) A type . By idempotence, the contextcan be rewritten Ψ , Γ , ∆ (cid:96) A type . Reapplying the rule then gives Ψ , Γ , ∆ (cid:96) (cid:92)A as required. • Π -form : If the inputs are Ψ , Γ , ∆ (cid:96) A type Ψ , Γ , ∆ , x : A (cid:96) B type then inductively Ψ , Γ , ∆ (cid:96) A type Ψ , Γ , ∆ , x : A (cid:96) B type where for B we have extended ∆ to the well-typed telescope Ψ , Γ (cid:96) ∆ , x : A tele . We can then reapplythe rule. Proposition 6.9.
Precomposition with the unit for telescopes is admissible: Ψ ctx Ψ (cid:96) Γ tele Ψ , Γ (cid:96) ∆ tele Ψ , Γ (cid:96) ∆ tele −−−−−−−−−−−−−−−−−−−−− Proof. • If ∆ ≡ · then Ψ , Γ (cid:96) · tele is well-formed. • Suppose ∆ , x : A tele because Ψ , Γ (cid:96) ∆ tele and Ψ , Γ , ∆ (cid:96) A type . Inductively, Ψ , Γ (cid:96) ∆ tele andapplying pre-unit to A , we have Ψ , Γ , ∆ (cid:96) A type , so Ψ , Γ (cid:96) ∆ , x : A tele is well-formed. • Suppose ∆ , x :: A tele because Ψ , Γ (cid:96) ∆ tele and Ψ , Γ , ∆ (cid:96) A type . By the IH, Ψ , Γ (cid:96) ∆ tele . Byidempotence, Ψ , Γ , ∆ is equal to Ψ , Γ , ∆ (cid:96) A type , so we can form Ψ , Γ (cid:96) ∆ , x :: A tele .49 roposition 6.10. pre-unit preserves the size (number of derivation steps) of a typing derivation.Proof. Inspection of the above proof. Note that all of the equality reasoning involving idempotence etc. isabout syntactic equality ≡ α , which does not get recorded in typing derivations. Proposition 6.11.
Substitution is admissible. For all rules, assume Γ ctx and Γ (cid:96) A type and Γ , x : A (cid:96) ∆ tele . Γ (cid:96) a : A Γ , x : A, ∆ (cid:96) b : B Γ , ∆[ a/x ] (cid:96) b [ a/x ] : B [ a/x ] −−−−−−−−−−−−−−−−−− Γ (cid:96) a : A Γ , x : A, ∆ (cid:96) B type Γ , ∆[ a/x ] (cid:96) B [ a/x ] type −−−−−−−−−−−−−−−−−−− Γ (cid:96) a : A Γ , x : A, ∆ (cid:96) b ≡ b (cid:48) : B Γ , ∆[ a/x ] (cid:96) b [ a/x ] = b (cid:48) [ a/x ] : B [ a/x ] −−−−−−−−−−−−−−−−−−−−− Γ (cid:96) a : A Γ , x : A, ∆ (cid:96) B ≡ B (cid:48) type Γ , ∆[ a/x ] (cid:96) B [ a/x ] ≡ B (cid:48) [ a/x ] type −−−−−−−−−−−−−−−−−−−−−− Proof.
The first new interesting case is substitution for a roundtripped variable. The inputs areΓ (cid:96) a : A Γ , x : A, ∆ (cid:96) x : A and so applying the pre-roundtrip on a gives Γ (cid:96) a : A , which can be weakened to Γ , x : A, ∆ (cid:96) a : A andtaken as the result.The other new kind of case is substitution into a rule that has a zeroed context as a premise. For example,suppose we are in the case for Γ (cid:96) a : A Γ , x : A, ∆ (cid:96) (cid:92)B type because Γ , x : A, ∆ (cid:96) B type . Then applying pre-unit (note that Γ ctx and Γ (cid:96) A type and Γ , x : A (cid:96) ∆ tele by ctx-zero and pre-counit and zeroing/ pre-unit for telescopes), we have Γ , x : A, ∆ (cid:96) B type , andby pre-counit we have Γ (cid:96) a : A . Because pre-unit preserves the size of a derivation, we can appealto the inductive hypothesis to form Γ , ∆[ a/x ] (cid:96) B [ a/x ] type . Because zeroing commutes with substitution,Γ , ∆[ a/x ] is equal to Γ , ∆[ a/x ], and B [ a/x ] is equal to B [ a/x ]. So reapplying the rule gives Γ , ∆[ a/x ] (cid:96) (cid:92) ( B [ a/x ]) type . We now describe a notion of model for our type theory. Categories with families (CwFs) [Dyb96] area standard notion of model for dependent type theories, and we begin by recalling their definition. Wegenerally follow the same notation for CwFs as in [Bir+20].
Definition 7.1. A category with families (CwF) is specified by:1. A category C with a terminal object 1.2. For each object Γ ∈ C , a set C (Γ) of families over Γ.3. For each object Γ ∈ C and family A ∈ C (Γ), a set C (Γ (cid:96) A ) of elements of the family A over Γ.4. For each morphism θ ∈ C (∆ , Γ), re-indexing functions A ∈ C (Γ) (cid:55)→ A [ θ ] ∈ C (∆) and a ∈ C (Γ (cid:96) A ) (cid:55)→ a [ θ ] ∈ C (∆ (cid:96) A [ θ ]), satisfying A [ id ] = A , A [ θ ◦ δ ] = A [ θ ][ δ ], a [ id ] = a and a [ θ ◦ δ ] = a [ θ ][ δ ].50. For each object Γ ∈ C and family A ∈ C (Γ), a comprehension object Γ .A ∈ C equipped with a projection morphism p A ∈ C (Γ .A, Γ), a generic element q A ∈ C (Γ .A (cid:96) A [ p A ]) and a pairing operation θ ∈ C (∆ , Γ) , a ∈ C (∆ (cid:96) A [ θ ]) (cid:55)→ ( θ, a ) ∈ C (∆ , Γ .A ) satisfying p A ◦ ( θ, a ) = θ , q A [( θ, a )] = a , ( θ, a ) ◦ δ =( θ ◦ δ, a [ δ ]) and ( p A , q A ) = id . Definition 7.2.
A Π -structure on a CwF consists of, for each Γ ∈ C , A ∈ C (Γ), B ∈ C (Γ .A ), a familyΠ( A, B ) ∈ C (Γ) and functions λ Γ ,A,B : C (Γ .A (cid:96) B ) → C (Γ (cid:96) Π( A, B ))app Γ ,A,B : C (Γ (cid:96) Π( A, B )) → (cid:89) a ∈C (Γ (cid:96) A ) C (Γ (cid:96) B [( id Γ , a )])such that Π( A, B )[ θ ] ≡ Π( A [ θ ] , B [( θ ◦ p , q )]) λ Γ ,A,B ( b )[ θ ] ≡ λ ∆ ,A [ θ ] ,B [( θ ◦ p , q )] ( b [( θ ◦ p , q )])app Γ ,A,B ( f, a )[ θ ] ≡ app ∆ ,A [ θ ] ,B [( θ ◦ p , q )] ( f [ θ ] , a [ θ ])app Γ ,A,B ( λ Γ ,A,B ( b ) , a ) ≡ b [( id Γ , a )] λ Γ ,A,B (app Γ .A,A,B ( b [ p A ]) , q A ) ≡ b Π-types are not required to interpret our modality, but we will show that the interpretation of markedvariables and zeroing does not interfere with that of Π-types. The other standard type formers are similar.
Definition 7.3. A weak CwF morphism F between CwFs consists of a functor F : C → D , an operation onfamilies mapping A ∈ C (Γ) to a family F A ∈ D ( F Γ) and an operation on elements mapping a ∈ C (Γ (cid:96) A ) toan element F a ∈ D ( F Γ (cid:96) F A ), such that1. The functor F : C → D preserves terminal objects (up to isomorphism)2. The operations on families and elements commute with reindexing in the sense that
F A [ F θ ] = F ( A [ θ ])and F t [ F θ ] = F ( t [ θ ]).3. The maps ( F p A , F q A ) : F (Γ .A ) → F Γ .F A are isomorphisms for all Γ and A . We write ν Γ ,A for theinverse. Lemma 7.4.
For any weak CwF morphism, the following equations hold: F ( p A ) ◦ ν Γ ,A ≡ p F A (1) F ( q A )[ ν Γ ,A ] ≡ q F A (2) ν Γ ,A ◦ ( F θ, F a ) ≡ F ( θ, a ) (3)We now come to our notion of model for our type theory. Definition 7.5. A category with families with a bireflector (CwB) consists of a CwF C with a weak endo-morphism N : C → C , such that there are natural transformations η : id C ⇒ N and ε : N ⇒ id C for theunderlying functor of N , such that η ◦ ε ≡ id N − . Remark 7.6.
The CwF structure aside, this is a category equipped with a ‘bireflective subcategory’ asstudied in [Fre+99]. The definition we have given here uses an equivalent characterisation of bireflectiv-ity [Fre+99, Theorem 13], as a ‘split-idempotent natural transformation on id C with specified splitting’.There is some derived structure in any CwB C . 51 emma 7.7. For any Γ ∈ C , N η Γ ≡ η N Γ N ε Γ ≡ ε N Γ Proof.
Naturality gives that
N η Γ ≡ N η Γ ◦ η Γ ◦ ε Γ ≡ η N Γ ◦ η Γ ◦ ε Γ ≡ η N Γ The counit is similar.
Proposition 7.8. N is an idempotent monad and comonad, with multiplication and comultiplication givenby µ Γ : ≡ N ε Γ δ Γ : ≡ N η Γ Proof.
The associativity law follows because
N µ Γ ≡ N N ε Γ ≡ N ε N Γ ≡ µ N Γ . Unit laws follow by naturality: µ Γ ◦ η N Γ ≡ N ε Γ ◦ η N Γ ≡ η Γ ◦ ε Γ ≡ id N Γ with the other holding because η N Γ ≡ N η Γ . For idempotence, we have just seen that η N Γ is a right inverseto µ Γ , and the other direction follows by assumption: η N Γ ◦ µ Γ ≡ η N Γ ◦ N ε Γ ≡ η N Γ ◦ ε N Γ ≡ id NN Γ The comonad structure follows by symmetry.
Remark 7.9.
A CwB is also a ‘CwF+A’ [Bir+20, Definition 16], where the left and right adjoints are both N . By [Bir+20, Lemma 17], any CwB is also a category with a ‘dependent right adjoint’ [Bir+20, Definition2]. The action of this ‘dependent right adjoint’ on types is not quite the action of N coming from the weakCwF morphism, instead for Γ ∈ C and A ∈ C ( N Γ) the ‘right adjoint type’ N Γ A ∈ C (Γ) is given by N Γ A : ≡ ( N A )[ N η Γ ◦ η Γ ] . Note that η as we have defined it is the unit of N as a monad, so that N η Γ ◦ η Γ , is the unit of the N (cid:97) N adjunction. There is then a bijection of elements C ( N Γ (cid:96) A ) ∼ = C (Γ (cid:96) N Γ A ) . We could base our interpretation of the type theory around this bijection, but it does not match nicely withour judgemental structure: our operation applying N to an entire context is an admissible one Γ, which isdefined in terms of a special context extension, so we would need to define and use an interpretation of theadmissible rule.In our interpretation, we collapse the distinction between modal variables and variables of type (cid:92)A , sothat ‘modal context extension’ by A becomes ordinary context extension by (cid:92)A . The var-zero rule thenbecomes an application of the semantic counit map ‘ (cid:92)A → A ’, or just (cid:92) -elim applied to an ordinary variable,which we capture in the following definition. 52 efinition 7.10. If A ∈ C (Γ), let q A ∈ C (Γ . ( N A )[ η Γ ] (cid:96) A [ ε Γ ◦ η Γ ][ p ( NA )[ η Γ ] ]) be defined by q A : ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ]where we have calculated the type to be A [ p A ][ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ] ≡ A [ ε Γ ◦ N ( p A ) ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ] ≡ A [ ε Γ ◦ p NA ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ] ≡ A [ ε Γ ◦ η Γ ◦ p ( NA )[ η Γ ] ] Lemma 7.11.
The counit term satisfies the following equations: q A [( id Γ , ( N n )[ η Γ ])] ≡ n [ ε Γ ◦ η Γ ] (4)( N q A )[ η Γ . ( NA )[ η Γ ] ] ≡ q ( NA )[ η Γ ] (5) q A [ ε Γ . ( NA )[ η Γ ] ◦ η Γ . ( NA )[ η Γ ] ] ≡ q A (6) q A [ (cid:0) θ ◦ p ( NA [ θ ])[ η ] , q ( NA [ θ ])[ η ] (cid:1) ] ≡ q A [ θ ] (7)Thinking of q A as the interpretation of ‘ x (cid:92) ’, from top to bottom, this is a β -rule ‘ x (cid:92) [ a (cid:92) /x ] ≡ a ’, an η -rule‘( x (cid:92) ) (cid:92) ≡ x ’ idempotence ‘ x (cid:92) ≡ x (cid:92) ’, and stability under substitution for other variables ‘ x (cid:92) [ θ ] ≡ x (cid:92) ’ if θ misses x . Proof.
The β -rule: q A [( id Γ , ( N n )[ η Γ ])] ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ][( id Γ , ( N n )[ η Γ ])](Substitution into a substitution extension) ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] ◦ ( id Γ , ( N n )[ η Γ ]) , q ( NA )[ η Γ ] [( id Γ , ( N n )[ η Γ ])] (cid:1) ]( β -rules for substitution extension) ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ ( η Γ , ( N n )[ η Γ ])](Substitution into a substitution extension) ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ ( N id Γ , N n ) ◦ η Γ ](Equation 3) ≡ q A [ ε Γ .A ◦ N ( id Γ , n ) ◦ η Γ ](Naturality of ε ) ≡ q A [( id Γ , n ) ◦ ε Γ ◦ η Γ ]( β for variable rule) ≡ n [ ε Γ ◦ η Γ ] 53he η -rule: ( N q A )[ η Γ . ( NA )[ η Γ ] ] ≡ ( N ( q A [ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ]))[ η Γ . ( NA )[ η Γ ] ]( N commutes with substitution into terms) ≡ ( N q A )[ N ( ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ) ◦ η Γ . ( NA )[ η Γ ] ](Naturality of η ) ≡ ( N q A )[ η Γ .A ◦ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ]( η ◦ ε is the identity) ≡ ( N q A )[ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ](Equation 2) ≡ q NA [ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ]( β -rule for variables) ≡ q ( NA )[ η Γ ] Idempotence: q A [ ε Γ . ( NA )[ η Γ ] ◦ η Γ . ( NA )[ η Γ ] ](Definition of q ) ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ][ ε Γ . ( NA )[ η Γ ] ◦ η Γ . ( NA )[ η Γ ] ](Naturality of ε and η ) ≡ q A [ ε Γ .A ◦ η Γ .A ◦ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ]( η ◦ ε is the identity) ≡ q A [ ε Γ .A ◦ ν Γ ,A ◦ (cid:0) η Γ ◦ p ( NA )[ η Γ ] , q ( NA )[ η Γ ] (cid:1) ](Definition of q ) ≡ q A Stability under substitution: q A [ (cid:0) θ ◦ p ( NA [ θ ])[ η ] , q ( NA [ θ ])[ η ] (cid:1) ](Equation 5) ≡ q A [ (cid:16) θ ◦ p ( NA [ θ ])[ η ] , ( N q A [ θ ] )[ η Γ . ( NA [ θ ])[ η Γ ] ] (cid:17) ](Equation 4) ≡ q A [ θ ] [ ε ∆ . ( NA [ θ ])[ η ∆ ] ◦ η ∆ . ( NA [ θ ])[ η ∆ ] ](Equation 6) ≡ q A [ θ ] We record an easy Lemma stating that the non-trivial roundtrip has no effect on terms of (cid:92)A . Lemma 7.12. If n ∈ C (Γ (cid:96) ( N A )[ η Γ ]) then n ≡ n [ ε Γ ◦ η Γ ]54 · (cid:75) : ≡ (cid:74) Γ , x : A (cid:75) : ≡ (cid:74) Γ (cid:75) . (cid:74) Γ (cid:96) A (cid:75)(cid:74) Γ , x :: A (cid:75) : ≡ (cid:74) Γ (cid:75) . ( N (cid:74) Γ (cid:96) A (cid:75) )[ η (cid:74) Γ (cid:75) ] if A ≡ α A (cid:74) Γ , x : A, x : ? A , . . . , x n : ? A n (cid:96) x (cid:75) : ≡ q (cid:74) Γ (cid:96) A (cid:75) [ p ? (cid:74) A (cid:75) ◦ · · · ◦ p ? (cid:74) A n (cid:75) ] (cid:74) Γ , x : A, x : ? A , . . . , x n : ? A n (cid:96) x (cid:75) : ≡ q (cid:74) Γ (cid:96) A (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ][ p ? (cid:74) A (cid:75) ◦ · · · ◦ p ? (cid:74) A n (cid:75) ] (cid:74) Γ , x :: A, x : ? A , . . . , x n : ? A n (cid:96) x (cid:75) : ≡ q (cid:74) Γ (cid:96) A (cid:75) [ p ? (cid:74) A (cid:75) ◦ · · · ◦ p ? (cid:74) A n (cid:75) ] (cid:74) Γ (cid:96) (cid:92)A (cid:75) : ≡ ( N (cid:74) Γ (cid:96) A (cid:75) )[ η (cid:74) Γ (cid:75) ] (cid:74) Γ (cid:96) a (cid:92)A (cid:75) : ≡ ( N (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) A (cid:75) (cid:74) Γ (cid:96) a (cid:75) )[ η (cid:74) Γ (cid:75) ] (cid:74) Γ (cid:96) n A(cid:92) (cid:75) : ≡ q (cid:74) Γ (cid:96) A (cid:75) [ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) n (cid:75) (cid:1) ] (cid:74) Γ (cid:96) Π x : A.B (cid:75) : ≡ Π( (cid:74) Γ (cid:96) A (cid:75) , (cid:74) Γ , x : A (cid:96) B (cid:75) ) (cid:74) Γ (cid:96) λx : A.b : B (cid:75) : ≡ λ (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) A (cid:75) , (cid:74) Γ ,x : A (cid:96) B (cid:75) ( (cid:74) Γ , x : A (cid:96) b (cid:75) ) (cid:74) Γ (cid:96) f ( a ) A,x.B (cid:75) : ≡ app (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) A (cid:75) , (cid:74) Γ ,x : A (cid:96) B (cid:75) ( (cid:74) Γ (cid:96) f (cid:75) , (cid:74) Γ (cid:96) a (cid:75) )where x : ? A denotes either x : A or x :: A , and p ? (cid:74) A (cid:75) denotes p (cid:74) A (cid:75) or p ( N (cid:74) Γ (cid:96) A (cid:75) )[ η Γ ] accordingly.Figure 6: Partial Interpretation Proof. n ≡ q ( NA )[ η Γ ] [( id Γ , n )] ≡ ( N q A )[ η Γ . ( NA )[ η Γ ] ][( id Γ , n )] (Equation 5) ≡ ( N ( q A [ ε Γ . ( NA )[ η Γ ] ◦ η Γ . ( NA )[ η Γ ] ]))[ η Γ . ( NA )[ η Γ ] ][( id Γ , n )] (Equation 6) ≡ ( N q A )[ η Γ . ( NA )[ η Γ ] ][( id Γ , n )][ ε Γ ◦ η Γ ] (Naturality) ≡ q ( NA )[ η Γ ] [( id Γ , n )][ ε Γ ◦ η Γ ] (Equation 5) ≡ n [ ε Γ ◦ η Γ ] We now show that the rules of our type theory can be soundly interpreted in any CwB. The exact formof the induction we use for the partial interpretation hews closer to [Hof97, Section 3.5] than [Bir+20]: wedefine the interpretation on fully-annotated raw syntax as in Section 6, and interpret raw terms prior toknowing what family they will live in. The partial interpretation function (cid:74) − (cid:75)
1. Maps Γ rawctx to objects of C ;2. For Γ rawctx with (cid:74) Γ (cid:75) defined, maps dom (Γ) (cid:96) A rawterm to a family in C ( (cid:74) Γ (cid:75) ); and,3. For Γ rawctx with (cid:74) Γ (cid:75) defined, maps dom (Γ) (cid:96) a rawterm to (pairs T ∈ C ( (cid:74) Γ (cid:75) ) and elements in C ( (cid:74) Γ (cid:75) (cid:96) T )).The partial interpretation of the syntax is defined by mutual induction in Figure 6. The induction metric isthe size of the context for part 1, the size of the type for part 2, and the size of the term for part 3. Thesoundness theorem will demonstrate that these assignments are in fact total on well-typed contexts, typesand terms, and that the interpretation of a well-typed term Γ (cid:96) a : A is an element of the correct family (cid:74) A (cid:75) ∈ C ( (cid:74) Γ (cid:75) ). We now explain some of the conventions and subtleties in this definition:55 Our interpretation function follows the shape of the ‘dull-variable-less’ rules of Figure 3. This letsus avoid unnecessary manoeuvring between the syntactic and semantic unit and counit, instead onlyrequiring the roundtrip to match up (Lemma 7.13). This choice requires using the admissible pre-unit rules in the proof of totality of the interpretation function, which in turn requires that proof to be byinduction on the size of a derivation, the total number of rules used in forming it. This works because pre-unit preserves size by Proposition 6.10. For example, in the rule for (cid:74) Γ , x :: A (cid:75) , we write (cid:74) Γ (cid:96) A (cid:75) on the right hand side, which differs from the typing premise Γ (cid:96) A . This will be handled in thetotality proof by the admissible unzeroing rule pre-unit . The same move also happens for (cid:74) Γ (cid:96) (cid:92)A (cid:75) and (cid:74) Γ (cid:96) a (cid:92) : (cid:92)A (cid:75) . • Following [Boe20], we formally think of a partial function as a function to partial elements of thecodomain, representing a partial element of Z by a pair of a proposition φ and function φ → Z . • We write the action of (cid:74) − (cid:75) on pairs (Γ rawctx , dom (Γ) (cid:96) A rawterm ) as (cid:74) Γ (cid:96) A (cid:75) to make clear theseparation between the context and the term, or just as (cid:74) A (cid:75) if the context is clear, and similarly forterms. We have to be careful with these abbreviations, though, because the semantics is “intrinsicallytyped”, so semantic types in different semantic contexts are never equal (and similarly for terms). Forexample, in syntax, the same raw type can satisfy Γ (cid:96) A type and Γ (cid:96) A type , but (cid:74) Γ (cid:96) A (cid:75) ∈ C (Γ) and (cid:74) Γ (cid:96) A (cid:75) ∈ C (Γ) (though there is an explicit unit operation taking one to the other). • We make definedness of (cid:74) Γ (cid:75) a precondition for the function of (cid:74) Γ (cid:96) A (cid:75) , so it only makes sense towrite the latter when we have established the former. This follows the presupposition modes of thejudgements, where the context is assumed to be well-formed but the type is implied to be well-formed. • We adopt the convention that a right-hand side is defined only if the interpretation of each subexpres-sion in it is. I.e., we implicitly lift semantic operations on total elements to partial elements, rather thanthinking of the semantic operations like N , λ etc. as being defined on partial elements. In particularthis means that when (cid:74) Γ (cid:75) is defined, implies (cid:74) Γ Suppose (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:75) are defined. Then there is a morphism R Γ;∆ : (cid:74) Γ , ∆ (cid:75) → (cid:74) Γ , ∆ (cid:75) such that whenever (cid:74) Γ , ∆ (cid:96) J (cid:75) is defined then (cid:74) Γ , ∆ (cid:96) J (cid:75) is defined and (cid:74) Γ , ∆ (cid:96) J (cid:75) ≡ (cid:74) Γ , ∆ (cid:96) J (cid:75) [ R Γ;∆ ] where J denotes either a type or term. oreover, R Γ; · : ≡ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) , so in particular, if (cid:74) Γ (cid:75) and (cid:74) Γ (cid:96) J (cid:75) are well-defined then (cid:74) Γ (cid:96) J (cid:75) is definedand (cid:74) Γ (cid:96) J (cid:75) ≡ (cid:74) Γ (cid:96) J (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] Proof. The definition of the morphism R and the proof of the equation for substituting by it are mutuallyrecursive, because the equation is needed for the definition of R to have the stated type. The inductionmetric is: for R Γ;∆ the total size of the raw context Γ , ∆; and for the equation, the total size of the rawcontext Γ , ∆ plus the size of J . The size of a context adds 1 for each variable in addition to counting the sizeof the type (e.g. size (Γ , x : A ) = size (Γ) + size ( A ) + 1), which means that the definition of the morphismfor Γ , ∆ , x : A can use the equation at Γ , ∆ (cid:96) A , but the proof of the equation for Γ , ∆ (cid:96) J only uses themorphism at Γ , ∆.The morphism R Γ;∆ is defined by R Γ; · : ≡ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) R Γ;∆ ,x : A : ≡ (cid:0) R Γ;∆ ◦ p (cid:74) A (cid:75) , q (cid:74) A (cid:75) (cid:1) R Γ;∆ ,x :: A : ≡ (cid:16) R Γ;∆ ◦ p ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆0Γ (cid:75) ] , q ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆0Γ (cid:75) ] (cid:17) In the second case, (cid:74) Γ , ∆ , x : A (cid:75) ≡ (cid:74) Γ , ∆ (cid:75) . (cid:74) Γ , ∆ (cid:96) A (cid:75) , and we have (cid:74) Γ , ∆ , x : A (cid:75) ≡ (cid:74) Γ , ∆ (cid:75) . (cid:74) Γ , ∆ (cid:96) A (cid:75) . By the IH, since Γ , ∆ is a smaller context than Γ , ∆ , x : A , we have R Γ;∆ : (cid:74) Γ , ∆ (cid:75) → (cid:74) Γ , ∆ (cid:75) , and p (cid:74) A (cid:75) : (cid:74) Γ , ∆ (cid:75) . (cid:74) Γ , ∆ (cid:96) A (cid:75) → (cid:74) Γ , ∆ (cid:75) . Thus, by the pairing rule for substitutions in a CwF, thesecond component of the result, we require a term in C ( (cid:74) Γ , ∆ (cid:75) . (cid:74) A (cid:75) (cid:96) (cid:74) A (cid:75) [ R Γ , ∆ ◦ p (cid:74) A (cid:75) ]). Since the sizeof Γ , ∆ (cid:96) A is the same as the size of the context Γ , ∆ , x : A (we count 1 for the variable x ), we can use theinductive hypothesis for the second part for A , and this type is equal to (cid:74) A (cid:75) [ R Γ , ∆ ][ p (cid:74) A (cid:75) ], justifying the useof q (cid:74) A (cid:75) .The third case is similar, but we need to know that ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ][ R Γ;∆ ] ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ].Again using the IH on the smaller type A , and commuting the semantic substitution by R Γ , ∆ outside of the N , it suffices to show that η (cid:74) Γ , ∆ (cid:75) ◦ R Γ;∆ ≡ N ( R Γ , ∆ ) ◦ η (cid:74) Γ , ∆ (cid:75) : (cid:74) Γ , ∆ (cid:75) → N (cid:74) Γ , ∆ (cid:75) , which are equal bynaturality of η .The use of R in the statement of the second part is justified because Γ; ∆ is smaller than the total sizeof Γ; ∆ (cid:96) J . For the proof, we go by cases. In the cases for terms, because the term interpretation returnsa pair of a family and a term, we must show that both components are defined and equal.In each case, we first show that the families are equal and then the terms. We orient the calculationsfrom the left-hand side of the theorem statement to the right-hand side, so for definedness we need to arguethat if the “unsubstituted” type/term at the bottom is defined, then the top is. For each calculation, weshow the steps and then argue why each step in it is defined. • var : Suppose x is the final variable in the context. There are two cases: – x ∈ ∆:In this case, we have an inductive hypothesis for A , which is smaller than the input Γ , ∆ , x : A (cid:96) x ,unfolding the gives the result.For the families, we have (cid:74) Γ , ∆ (cid:96) A (cid:75) [ p (cid:74) A (cid:75) ] ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ , ∆ ][ p (cid:74) A (cid:75) ] (IH for A ) ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ p A ][ R Γ , ∆ ,x : A ] (Definition of R Γ;∆ ,x : A )57or the terms, we have (cid:74) Γ , ∆ , x : A (cid:96) x (cid:75) ≡ q (cid:74) Γ , ∆ (cid:96) A (cid:75) ≡ q (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] (IH for A ) ≡ q (cid:74) A (cid:75) [ (cid:0) R Γ;∆ ◦ p (cid:74) A (cid:75) , q (cid:74) A (cid:75) (cid:1) ] (Equation 7) ≡ (cid:74) Γ , ∆ , x : A (cid:96) x (cid:75) [ (cid:0) R Γ;∆ ◦ p (cid:74) A (cid:75) , q (cid:74) A (cid:75) (cid:1) ] ≡ (cid:74) Γ , ∆ , x : A (cid:96) x (cid:75) [ R Γ;∆ ,x : A ]For definedness, we have assumed that both the top and bottom contexts are defined, so (cid:74) Γ , ∆ , x : A (cid:75) ≡ (cid:74) Γ , ∆ (cid:75) . (cid:74) A (cid:75) and similarly on the bottom. Definedness of the contexts implies defined-ness of (cid:74) A (cid:75) and (cid:74) A (cid:75) , so all of the subterms. – x / ∈ ∆ (so in this case ∆ ≡ · ):For the families, both sides have type (cid:74) Γ (cid:96) A (cid:75) [ p (cid:74) A (cid:75) ][ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] and this is defined because (cid:74) Γ (cid:96) A (cid:75) is, because the context is assumed to be well-formed.For the terms, (cid:74) Γ , x : A (cid:96) x (cid:75) ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] ≡ (cid:74) Γ , x : A (cid:96) x (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] ≡ (cid:74) Γ , x : A (cid:96) x (cid:75) [ R Γ ,x : A ; · ]When (cid:74) x (cid:75) on the bottom is defined, all of the steps are defined, because (cid:74) Γ , x : A (cid:75) and therefore (cid:74) A (cid:75) are assumed.The more general situation of a variable in the middle of the context follows by an easy induction,because R is constructed by iterated pairings, which cancel with the projections in the interpretationof the variable term. • var-zero : Again suppose x :: A is the final variable in the context. – x ∈ ∆: First, because (cid:74) Γ , ∆ , x :: A (cid:75) is defined, we know A has only marked variables, i.e. A ≡ A ≡ A , ∆) . Syntactic idempotence (Lemma 6.1) also gives that A ≡ A , so also A ≡ A ≡ A .Since A is smaller than Γ , ∆ , x :: A (cid:96) x , we have an inductive hypothesis for A .For the families we have (cid:74) Γ , ∆ (cid:96) A (cid:75) [ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ][ p N ( (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆0Γ (cid:75) ] ] ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ][ p N ( (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆0Γ (cid:75) ] ] ( A ≡ A ) ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ][ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ][ p N ( (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆0Γ (cid:75) ] ] (IH for A ) ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ][ R Γ;∆ ][ p N ( (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆0Γ (cid:75) ] ] (Naturality of ε ◦ η ) ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ][ p N ( (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) ∆ , Γ (cid:75) ] ][ R Γ;∆ ,x :: A ] (Definition of R )58 Γ , ∆ , x :: A (cid:96) x (cid:75) ≡ q (cid:74) Γ , ∆ (cid:96) A (cid:75) ≡ q (cid:74) Γ , ∆ (cid:96) A (cid:75) ( A ≡ A ) ≡ q (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] (Induction) ≡ q (cid:74) Γ , ∆ (cid:96) A (cid:75) [( R Γ;∆ ◦ p , q )] (Equation 7) ≡ (cid:74) Γ , ∆ , x :: A (cid:96) x (cid:75) [ R Γ;∆ ,x :: A ]In both calcualations, because of the assumption that (cid:74) Γ , ∆ , x :: A (cid:75) is defined, all of the subex-pressions are defined. – x / ∈ ∆:For the families, (cid:74) Γ (cid:96) A (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ][ p N ( (cid:74) Γ (cid:96) A (cid:75) )[ η (cid:74) Γ (cid:75) ] ] ≡ (cid:74) Γ (cid:96) A (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ][ p N ( (cid:74) Γ (cid:96) A (cid:75) )[ η (cid:74) Γ (cid:75) ] ][ ε (cid:74) Γ ,x :: A (cid:75) ◦ η (cid:74) Γ ,x :: A (cid:75) ]by naturality and idempotence of ε ◦ η . (cid:74) Γ , x :: A (cid:96) x (cid:75) ≡ q (cid:74) A (cid:75) ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ ,x :: A (cid:75) ◦ η (cid:74) Γ ,x :: A (cid:75) ] (Equation 6) ≡ (cid:74) Γ , x :: A (cid:96) x (cid:75) [ R Γ ,x :: A ; · ]In both calculations, all subexpressions are defined because (cid:74) Γ , x :: A (cid:75) is defined.We again need an induction for non-last variables. • var-roundtrip : Again assume x is the last variable in the context. – x ∈ ∆:For the families, (cid:74) Γ , ∆ (cid:96) A (cid:75) [ p (cid:74) Γ , ∆ (cid:96) A (cid:75) ] ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ p (cid:74) Γ , ∆ (cid:96) A (cid:75) ][ R Γ;∆ ,x : A ]by definition of R Γ;∆ ,x : A and the IH for the type A , which is smaller than Γ , ∆ , x : A (cid:96) x .For the terms (cid:74) Γ , ∆ , x : A (cid:96) x (cid:75) ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ , ∆ ,x : A (cid:75) ◦ η (cid:74) Γ , ∆ ,x : A (cid:75) ] ≡ q (cid:74) A (cid:75) [ (cid:0) R Γ;∆ ◦ p (cid:74) A (cid:75) , q (cid:74) A (cid:75) (cid:1) ][ ε (cid:74) Γ , ∆ ,x : A (cid:75) ◦ η (cid:74) Γ , ∆ ,x : A (cid:75) ] ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ , ∆ ,x : A (cid:75) ◦ η (cid:74) Γ , ∆ ,x : A (cid:75) ][ (cid:0) R Γ;∆ ◦ p (cid:74) A (cid:75) , q (cid:74) A (cid:75) (cid:1) ] (Naturality) ≡ (cid:74) Γ , ∆ , x : A (cid:96) x (cid:75) [ R Γ;∆ ,x : A ]In both calculations, (cid:74) Γ; ∆ , x : A (cid:75) and (cid:74) Γ; ∆ , x : A (cid:75) defined implies all of the subterms aredefined. 59 x / ∈ ∆:For the families, we have (cid:74) Γ (cid:96) A (cid:75) [ p (cid:74) A (cid:75) ][ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] ≡ (cid:74) Γ (cid:96) A (cid:75) [ p (cid:74) A (cid:75) ][ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ][ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ]by idempotence of ε ◦ η .For the terms (cid:74) Γ , x : A (cid:96) x (cid:75) ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ][ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] ( η ◦ ε is identity) ≡ (cid:74) Γ , x : A (cid:96) x (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ] ≡ (cid:74) Γ , x : A (cid:96) x (cid:75) [ R Γ ,x : A ; · ]Once again, in both cases, (cid:74) Γ , x : A (cid:75) defined implies all of the subexpressions are defined.We again need an induction for non-last variables. • As a final variable case, it may be that x :: A ∈ Γ , ∆, but we have the raw syntax x as the judgement J . This is in fact not possible, as it contradicts the assumption that (cid:74) Γ , ∆ , x :: A, ∆ (cid:48) (cid:96) x (cid:75) is defined,as there is no clause for this in the definition of the partial interpretation. • (cid:92) -form : (cid:74) Γ , ∆ (cid:96) (cid:92)A (cid:75) ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ] ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ])[ η (cid:74) Γ , ∆ (cid:75) ] (Induction) ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ N R Γ;∆ ][ η (cid:74) Γ , ∆ (cid:75) ] ( N commutes with substitution) ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ][ R Γ;∆ ] (Naturality) ≡ (cid:74) Γ , ∆ (cid:96) (cid:92)A (cid:75) [ R Γ;∆ ]For definedness, we assume that (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:75) are defined, and definedness of (cid:74) Γ , ∆ (cid:96) (cid:92)A (cid:75) onthe bottom implies definedness of (cid:74) Γ , ∆ (cid:96) A (cid:75) , so (cid:74) Γ , ∆ (cid:96) A (cid:75) is defined by the IH for the smallertype A . This makes all of the subexpressions defined. • (cid:92) -intro :For the families, Γ , ∆ (cid:96) A is smaller than Γ , ∆ (cid:96) a (cid:92)A , and (cid:74) a (cid:92)A (cid:75) defined implies (cid:74) A (cid:75) defined, so we have( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ] ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ][ R Γ;∆ ]by the same reasoning as in the previous case.For terms, (cid:74) Γ , ∆ (cid:96) ( a A ) (cid:92) ) (cid:75) ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) (cid:74) Γ , ∆ (cid:96) a (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ] ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] (cid:74) Γ , ∆ (cid:96) a (cid:75) [ R Γ;∆ ])[ η (cid:74) Γ , ∆ (cid:75) ] (IH for A and a ) ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) (cid:74) Γ , ∆ (cid:96) a (cid:75) )[ N R Γ;∆ ][ η (cid:74) Γ , ∆ (cid:75) ] ( N commutes with substitution) ≡ ( N (cid:74) Γ , ∆ (cid:96) A (cid:75) (cid:74) Γ , ∆ (cid:96) a (cid:75) )[ η (cid:74) Γ , ∆ (cid:75) ][ R Γ;∆ ] (Naturality) ≡ (cid:74) Γ , ∆ (cid:96) a (cid:92)A (cid:75) [ R Γ;∆ ] 60he IH on A and a give that (cid:74) A (cid:75) and (cid:74) a (cid:75) are defined, (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:75) are assumed, so all ofthe subexpressions are defined. For N (cid:74) Γ , ∆ (cid:96) A (cid:75) (cid:74) Γ , ∆ (cid:96) a (cid:75) to be defined, we need that the familyfor (cid:74) Γ , ∆ (cid:96) a (cid:75) is equal to (cid:74) Γ , ∆ (cid:96) A (cid:75) . This holds because the family part of (cid:74) a (cid:75) is equal to (cid:74) A (cid:75) because (cid:74) a (cid:92)A (cid:75) is defined (by the implicit conditions that the righthand sides must type check), sothe family part of (cid:74) a Γ (cid:75) is equal to (cid:74) A (cid:75) [ R ] by the family part of the IH for a , and by the IH for A , (cid:74) A (cid:75) [ R ] ≡ (cid:74) A (cid:75) . • (cid:92) -elim :Assuming (cid:74) Γ , ∆ (cid:96) n A(cid:92) (cid:75) is defined, both (cid:74) A (cid:75) and (cid:74) n (cid:75) are defined, so by the inductive hypotheses on A and n , (cid:74) Γ , ∆ (cid:96) A (cid:75) is defined and equal to (cid:74) A (cid:75) [ R Γ;∆ ], and (cid:74) n (cid:75) is defined and equal to (cid:74) n (cid:75) [ R Γ;∆ ].For the families, (cid:74) Γ , ∆ (cid:96) A (cid:75) [ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ] ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ][ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ] (IH for A ) ≡ (cid:74) Γ , ∆ (cid:96) A (cid:75) [ ε (cid:74) Γ , ∆ (cid:75) ◦ η (cid:74) Γ , ∆ (cid:75) ][ R Γ;∆ ] (naturality)Since (cid:74) A (cid:75) and (cid:74) A (cid:75) and the denotations of the contexts are all defined, all of the steps are defined.For the terms (cid:74) Γ , ∆ (cid:96) ( n ) A (cid:92) (cid:75) ≡ q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) n (cid:75) (cid:1) ] (Definition) ≡ q (cid:74) A (cid:75) [ R Γ;∆ ] [ (cid:0) id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) n (cid:75) [ R Γ;∆ ] (cid:1) ] (IH for A and n ) ≡ q (cid:74) A (cid:75) [( R Γ;∆ ◦ p ... , q ... )][ (cid:0) id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) n (cid:75) [ R Γ;∆ ] (cid:1) ] (Equation 7) ≡ q (cid:74) A (cid:75) [( R Γ;∆ , (cid:74) Γ , ∆ (cid:96) n (cid:75) [ R Γ;∆ ])] (Composing substitutions) ≡ q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) n (cid:75) (cid:1) ][ R Γ;∆ ] (Un-composing substitutions) ≡ (cid:74) Γ , ∆ (cid:96) n A(cid:92) (cid:75) [ R Γ;∆ ]Since (cid:74) n (cid:75) and (cid:74) n (cid:75) and the denotations of the contexts and types are all defined, all of the subtermsare defined. For q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) n (cid:75) (cid:1) ] to be defined, we need that (cid:74) Γ , ∆ (cid:96) n (cid:75) hasfamily N (cid:74) A (cid:75) [ η (cid:74) Γ , ∆ (cid:75) ]. Because (cid:74) n A(cid:92) (cid:75) is defined, we know that the family part of (cid:74) n (cid:75) is equal to N (cid:74) Γ , ∆ (cid:96) A (cid:75) [ η Γ , ∆ ], so by the IH the family part of (cid:74) n (cid:75) is equal to N (cid:74) Γ , ∆ (cid:96) A (cid:75) [ η Γ , ∆ ][ R Γ;∆ ], and thisis equal to N (cid:74) A (cid:75) [ η (cid:74) Γ , ∆ (cid:75) ] by the IH for A via the same reasoning as in the (cid:92) -form case. • Π -form :If (cid:114) Γ , ∆ (cid:96) (cid:81) ( x : A ) B (cid:122) is defined, then so are both of (cid:74) Γ , ∆ (cid:96) A (cid:75) and (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) . We can applythe IH (on the same contexts) to A to see that (cid:74) Γ , ∆ (cid:96) A (cid:75) is defined.By assumption, (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:75) are defined so both of (cid:74) Γ , ∆ , x : A (cid:75) and (cid:74) Γ , ∆ , x : A (cid:75) arealso. We can then apply the IH to B to see (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) is defined. It follows that (cid:114) Γ , ∆ (cid:96) (cid:81) ( x : A ) B (cid:122) is also defined.The morphism R Γ;∆ ,x : A is available by the inductive hypothesis— the size of Γ , ∆ , x : A is less thanthe size of Γ , ∆ (cid:96) (cid:81) ( x : A ) B because B (like all types/terms) has size at least 1.61o show the equation holds, (cid:116) Γ , ∆ (cid:96) (cid:89) x : A B (cid:124) ≡ Π( (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) ) ≡ Π( (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [ R Γ;∆ ,x : A ]) (IH on A and B ) ≡ Π( (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [ R Γ;∆ ◦ p (cid:74) A (cid:75) , q (cid:74) A (cid:75) ]) (Definition of R Γ;∆ ,x : A ) ≡ Π( (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) )[ R Γ;∆ ] (Semantic Π commutes with substitution) ≡ (cid:116) Γ , ∆ (cid:96) (cid:89) x : A B (cid:124) [ R Γ;∆ ] • Π -intro :Since (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:96) λx : A.b : B (cid:75) are defined by assumption, all of (cid:74) Γ , ∆ (cid:96) A (cid:75) and (cid:74) Γ , ∆ , x : A (cid:75) and (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) (cid:74) Γ , ∆ , x : A (cid:96) b (cid:75) are defined, so the inductive hypotheses imply that (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) b (cid:75) are defined. Themorphism R Γ;∆ ,x : A is available because Γ , ∆ , x : A is smaller than Γ , ∆ (cid:96) λx : A.b : B .The familiesΠ( (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) ) ≡ Π( (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) )[ R Γ;∆ ]are defined and equal as in the previous case.For the terms (cid:74) Γ , ∆ (cid:96) λx : A .b : B (cid:75) ≡ λ ( (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) b (cid:75) ) ≡ λ ( (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [ R Γ;∆ ,x : A ] , (cid:74) Γ , ∆ , x : A (cid:96) b (cid:75) [ R Γ;∆ ,x : A ]) (IH) ≡ λ ( (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) b (cid:75) )[ R Γ;∆ ] (Substitution into λ ) ≡ (cid:74) Γ , ∆ (cid:96) λx : A.b : B (cid:75) [ R Γ;∆ ]All of the subterms are defined, so to see that the top is defined, we just need to know that (cid:74) Γ , ∆ , x : A (cid:96) b (cid:75) has type (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) . Because the bottom is well-typed, the family partof b is equal to (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) , so the family part of the IH for b says that its type is equal to (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [ R Γ;∆ ,x : A ], which by the IH for B is equal to what we want. • Π -elim :Since (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:75) and (cid:74) Γ , ∆ (cid:96) f ( a ) A,x.B (cid:75) are defined by assumption, all of (cid:74) Γ , ∆ (cid:96) A (cid:75) and (cid:74) Γ , ∆ , x : A (cid:75) and (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) and (cid:74) Γ , ∆ (cid:96) f (cid:75) and (cid:74) Γ , ∆ (cid:96) a (cid:75) are defined, so the inductivehypotheses imply that (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) , (cid:74) Γ , ∆ (cid:96) f (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) are defined. The morphism R Γ;∆ ,x : A is available because Γ , ∆ , x : A is smaller thanΓ , ∆ (cid:96) f ( a ) A,x.B .For the families, we have (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [( id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) )] ≡ (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [ R Γ;∆ ,x : A ][( id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) [ R Γ;∆ ])] (IH) ≡ (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [( R Γ;∆ ◦ p , q )]( id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) [ R Γ;∆ ]) (Definition of R Γ;∆ ,x : A ) ≡ (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [( R Γ;∆ , (cid:74) Γ , ∆ (cid:96) a (cid:75) [ R Γ;∆ ])] ≡ (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) [( id (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) )][ R Γ;∆ ]62nd for the elements: (cid:74) Γ , ∆ (cid:96) f ( a ) A,x.B (cid:75) ≡ app (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ ,x : A (cid:96) B (cid:75) ( (cid:74) Γ , ∆ (cid:96) f (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) ) ≡ app (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ] , (cid:74) Γ , ∆ ,x : A (cid:96) B (cid:75) [ R Γ;∆ ,x : A ] ( (cid:74) Γ , ∆ (cid:96) f (cid:75) [ R Γ;∆ ] , (cid:74) Γ , ∆ (cid:96) a (cid:75) [ R Γ;∆ ]) (IH) ≡ app (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ ,x : A (cid:96) B (cid:75) ( (cid:74) Γ , ∆ (cid:96) f (cid:75) , (cid:74) Γ , ∆ (cid:96) a (cid:75) )[ R Γ;∆ ] ≡ (cid:74) Γ , ∆ (cid:96) f ( a ) A,x.B (cid:75) [ R Γ;∆ ]All of the subexpressions are defined, so to check that the top is defined, we need that the family partof (cid:74) Γ , ∆ (cid:96) f (cid:75) is Π( (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) ) and that the family partof (cid:74) Γ , ∆ (cid:96) a (cid:75) is (cid:74) Γ , ∆ (cid:96) A (cid:75) . Since (cid:74) Γ , ∆ (cid:96) f ( a ) A,x.B (cid:75) is defined, we know that the familypart of (cid:74) a (cid:75) is (cid:74) Γ , ∆ (cid:96) A (cid:75) and the family part of (cid:74) f (cid:75) is Π( (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) ). Thefamily part of the IH for a and f implies that the family parts of (cid:74) a (cid:75) and (cid:74) f (cid:75) are (cid:74) Γ , ∆ (cid:96) A (cid:75) [ R Γ;∆ ]and Π( (cid:74) Γ , ∆ (cid:75) , (cid:74) Γ , ∆ (cid:96) A (cid:75) , (cid:74) Γ , ∆ , x : A (cid:96) B (cid:75) )[ R Γ;∆ ], which are equal to what we want by the inductivehypotheses for A and B and a calculation as in the case for Π -form .As usual we also need to define semantic morphisms corresponding to substitution and weakening. Weneed weakening for both marked and unmarked variables, but can get away with substitution just for ordinaryvariables using the ‘dull substitution’ trick (Definition 2.19). Lemma 7.14 (Semantic substitution) . Suppose all of (cid:74) Γ , x : A, Γ (cid:48) (cid:75)(cid:74) Γ (cid:96) a (cid:75)(cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) are defined and that (cid:74) a (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) Γ (cid:96) A (cid:75) ) ( (cid:74) Γ (cid:96) A (cid:75) is defined because (cid:74) Γ , x : A, Γ (cid:48) (cid:75) is). Then thereis a morphism S (Γ; A ; Γ; a ) : (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) → (cid:74) Γ , x : A, Γ (cid:48) (cid:75) such that if (cid:74) Γ , x : A, Γ (cid:48) (cid:96) J (cid:75) is defined then (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:96) J [ a/x ] (cid:75) is defined and (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:96) J [ a/x ] (cid:75) ≡ (cid:74) Γ , x : A, Γ (cid:48) (cid:96) J (cid:75) [ S (Γ; A ; Γ; a )] where J is either a type or term. The S (Γ; A ; Γ; a ) morphism is given by S (Γ; A ; · ; a ) : ≡ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) a (cid:75) (cid:1) S (Γ; A ; Γ (cid:48) , y : B ; a ) : ≡ (cid:0) S (Γ; A ; Γ (cid:48) ; a ) ◦ p (cid:74) B [ a/x ] (cid:75) , q (cid:74) B [ a/x ] (cid:75) (cid:1) S (Γ; A ; Γ (cid:48) , y :: B ; a ) : ≡ (cid:16) S (Γ; A ; Γ (cid:48) ; a ) ◦ p ( N (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:96) B (cid:75) )[ η (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) ] , q ( N (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:96) B (cid:75) )[ η (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) ] (cid:17) Proof. The induction metric is, for S (Γ; A ; Γ (cid:48) ; a ), the size of Γ , x : A, Γ (cid:48) , and for the equation, the size ofthe raw context Γ , x : A, Γ (cid:48) plus the size of J . Size is defined in such a way that the morphism can use theequation on any type in the context.In the S (Γ; A ; Γ (cid:48) , y : B ; a ) case of the definition of S , we have that (cid:74) Γ , x : A, Γ (cid:48) , y : B (cid:75) ≡ (cid:74) Γ , x : A, Γ (cid:48) (cid:75) . (cid:74) Γ , x : A, Γ (cid:48) (cid:96) B (cid:75) , and (cid:74) Γ , Γ (cid:48) [ a/x ] , y : B [ a/x ] (cid:75) ≡ (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) . (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:96) B [ a/x ] (cid:75) are defined. By the IH, since Γ (cid:48) is smaller than Γ (cid:48) , y : B , we have a morphism S (Γ; A ; Γ (cid:48) ; a ) : (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) → (cid:74) Γ , x : A, Γ (cid:48) (cid:75) . To apply the paring rule, we need an element of C ( (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) . (cid:74) B [ a/x ] (cid:75) (cid:96) (cid:74) B (cid:75) [ S (Γ; A ; Γ (cid:48) ; a ) ◦ (cid:74) B [ a/x ] (cid:75) ]). Since the type Γ , x : A, Γ (cid:48) (cid:96) B is defined to be smaller than the context Γ , x : A, Γ (cid:48) , y : B , we canuse the IH to conclude (cid:74) B [ a/x ] (cid:75) ≡ (cid:74) B (cid:75) [ S (Γ; A ; Γ (cid:48) ; a )], which is what we need to use q (cid:74) B [ a/x ] (cid:75) as the secondcomponent of the pairing.The S (Γ; A ; Γ (cid:48) , y :: B ; a ) case is similar: as the second component of the pairing we need an element C ( (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) . ( N (cid:74) B [ a/x ] (cid:75) )[ η (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) ] (cid:96) ( N (cid:74) B (cid:75) )[ η Γ ,x : A, Γ (cid:48) ][ S (Γ; A ; Γ (cid:48) ; a ) ◦ p ( N (cid:74) B [ a/x ] (cid:75) )[ η (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) ] ]) . Again, q ( N (cid:74) B [ a/x ] (cid:75) )[ η (cid:74) Γ , Γ (cid:48) [ a/x ] (cid:75) ] does the job, as the size of Γ , x : A, Γ (cid:48) (cid:96) B is defined to be smaller thanΓ , x : A, Γ (cid:48) , y : B , so the IH gives us (cid:74) B [ a/x ] (cid:75) ≡ (cid:74) B (cid:75) [ S (Γ; A ; Γ (cid:48) ; a )], and by naturality,( N (cid:74) B (cid:75) )[ η Γ ,x : A, Γ (cid:48) ◦ S (Γ; A ; Γ (cid:48) ; a )] ≡ ( N (cid:74) B (cid:75) )[ N S (Γ; A ; Γ (cid:48) ; a ) ◦ η Γ , Γ (cid:48) [ a/x ] ] ≡ ( N (cid:74) B (cid:75) [ S (Γ; A ; Γ (cid:48) ; a )])[ η Γ , Γ (cid:48) [ a/x ] ] ≡ ( N (cid:74) B [ a/x ] (cid:75) )[ η Γ , Γ (cid:48) [ a/x ] ]The cases for terms for the modality are essentially the same as in Lemma 7.13. The only interestingnew case is substituting into var-roundtrip .Suppose we have done the roundtrip on x , the variable being substituted for, and this variable lies at theend of the context.Because all of (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) A (cid:75) and (cid:74) Γ (cid:96) a (cid:75) are defined, by Lemma 7.13 we know that (cid:74) Γ (cid:96) A (cid:75) and (cid:74) Γ (cid:96) a (cid:75) are defined, and (cid:74) Γ (cid:96) A (cid:75) ≡ (cid:74) Γ (cid:96) A (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] (cid:74) Γ (cid:96) a (cid:75) ≡ (cid:74) Γ (cid:96) a (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ]For the families, we then have: (cid:74) Γ (cid:96) A (cid:75) ≡ (cid:74) Γ (cid:96) A (cid:75) [ p (cid:74) A (cid:75) ][ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) a (cid:75) (cid:1) ] (Semantic projection cancels with substitution) ≡ (cid:74) Γ (cid:96) A (cid:75) [ P (Γ; A ; · )][ S (Γ; A ; · ; a )] (Definitions of P and S ) ≡ (cid:74) Γ , x : A (cid:96) A (cid:75) [ S (Γ; A ; · ; a )] (Lemma 7.15)using that (cid:74) Γ (cid:75) , (cid:74) Γ , x : A (cid:75) and (cid:74) Γ (cid:96) A (cid:75) are defined to apply Lemma 7.15.And for the elements: (cid:74) Γ (cid:96) a (cid:75) ≡ (cid:74) Γ (cid:96) a (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] ≡ q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) a (cid:75) (cid:1) ][ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] (Substitution for variable) ≡ q (cid:74) A (cid:75) [ S (Γ; A ; · ; a )][ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] (Definition of S ) ≡ q (cid:74) A (cid:75) [ ε (cid:74) Γ ,x : A (cid:75) ◦ η (cid:74) Γ ,x : A (cid:75) ][ S (Γ; A ; · ; a )] (Naturality) ≡ (cid:74) Γ , x : A (cid:96) x (cid:75) [ S (Γ; A ; · ; a )] (Definition)Again the general case follows by induction on the length of Γ (cid:48) , as the definition of S (Γ; A ; Γ (cid:48) ; a ) willcommute past the iterated projections in the interpretation of x . Lemma 7.15 (Semantic weakening) . Suppose (cid:74) Γ , x : A, Γ (cid:48) (cid:75) and (cid:74) Γ , Γ (cid:48) (cid:75) are well-defined. Then there is amorphism P (Γ; A ; Γ (cid:48) ) : (cid:74) Γ , x : A, Γ (cid:48) (cid:75) → (cid:74) Γ , Γ (cid:48) (cid:75) such that if (cid:74) Γ , Γ (cid:48) (cid:96) J (cid:75) is defined then (cid:74) Γ , x : A, Γ (cid:96) J (cid:75) isdefined and (cid:74) Γ , x : A, Γ (cid:96) J (cid:75) ≡ (cid:74) Γ , Γ (cid:48) (cid:96) J (cid:75) [ P (Γ; A ; Γ)] where J is a type or a term.Similarly, if (cid:74) Γ , x :: A, Γ (cid:48) (cid:75) and (cid:74) Γ , Γ (cid:48) (cid:75) are well-defined then there is a morphism P (Γ; A ; Γ (cid:48) ) : (cid:74) Γ , x :: A, Γ (cid:48) (cid:75) → (cid:74) Γ , Γ (cid:48) (cid:75) such that if (cid:74) Γ , Γ (cid:48) (cid:96) J (cid:75) is defined then (cid:74) Γ , x :: A, Γ (cid:96) J (cid:75) is defined and (cid:74) Γ , x :: A, Γ (cid:96) J (cid:75) ≡ (cid:74) Γ , Γ (cid:48) (cid:96) J (cid:75) [ P (Γ; A ; Γ)] . roof. The metric is the size of Γ , x : ? A, Γ (cid:48) for the morphism and the size of Γ , x : ? A, Γ (cid:48) (cid:96) J for theequation. The maps are defined in the expected way, with semantic projection in the base case and variablesfor the remaining telescope, and using the IH for the equation on Γ , x : ? A, Γ (cid:48) (cid:96) B in the context extensioncases. We just show the definition of the maps: P (Γ; A ; · ) : ≡ p (cid:74) Γ (cid:96) A (cid:75) P (Γ; A ; Γ (cid:48) , y : B ) : ≡ (cid:0) P (Γ; A ; Γ (cid:48) ) ◦ p (cid:74) Γ ,x : A, Γ (cid:48) (cid:96) B (cid:75) , q (cid:74) Γ ,x : A, Γ (cid:48) (cid:96) B (cid:75) (cid:1) P (Γ; A ; Γ (cid:48) , y :: B ) : ≡ (cid:16) P (Γ; A ; Γ (cid:48) ) ◦ p ( N (cid:74) Γ ,x : A, Γ (cid:48) (cid:96) B (cid:75) )[ η (cid:74) Γ ,x : A, Γ (cid:48) (cid:75) ] , q ( N (cid:74) Γ ,x : A, Γ (cid:48) (cid:96) B (cid:75) )[ η (cid:74) Γ ,x : A, Γ (cid:48) (cid:75) ] (cid:17) P (Γ; A ; · ) : ≡ p ( N (cid:74) Γ (cid:96) A (cid:75) )[ η (cid:74) Γ (cid:75) ] P (Γ; A ; Γ (cid:48) , y : B ) : ≡ (cid:0) P (Γ; A ; Γ (cid:48) ) ◦ p (cid:74) Γ ,x :: A, Γ (cid:48) (cid:96) B (cid:75) , q (cid:74) Γ ,x :: A, Γ (cid:48) (cid:96) B (cid:75) (cid:1) P (Γ; A ; Γ (cid:48) , y :: B ) : ≡ (cid:16) P (Γ; A ; Γ (cid:48) ) ◦ p ( N (cid:74) Γ ,x :: A, Γ (cid:48) (cid:96) B (cid:75) )[ η (cid:74) Γ ,x :: A, Γ (cid:48) (cid:75) ] , q ( N (cid:74) Γ ,x :: A, Γ (cid:48) (cid:96) B (cid:75) )[ η (cid:74) Γ ,x :: A, Γ (cid:48) (cid:75) ] (cid:17) We now have the pieces required for the soundness theorem. Theorem 7.16 (Soundness) . The partial interpretation function enjoys the following properties: • If Γ ctx then (cid:74) Γ (cid:75) is a well-defined object of C , • If (cid:74) Γ (cid:75) is defined and Γ (cid:96) A type then (cid:74) Γ (cid:96) A (cid:75) ∈ C ( (cid:74) Γ (cid:75) ) , • If (cid:74) Γ (cid:75) is defined and Γ (cid:96) a : A then (cid:74) Γ (cid:96) A (cid:75) is defined and (cid:74) Γ (cid:96) a (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) Γ (cid:96) A (cid:75) ) , • If Γ ≡ Γ (cid:48) ctx then (cid:74) Γ (cid:75) ≡ (cid:74) Γ (cid:48) (cid:75) , • If (cid:74) Γ (cid:75) is defined and Γ (cid:96) A ≡ B type then both (cid:74) A (cid:75) and (cid:74) B (cid:75) are defined and (cid:74) A (cid:75) ≡ (cid:74) B (cid:75) , • If (cid:74) Γ (cid:75) is defined and Γ (cid:96) a ≡ a (cid:48) : A then all of (cid:74) A (cid:75) , (cid:74) a (cid:75) and (cid:74) a (cid:48) (cid:75) are defined, both (cid:74) a (cid:75) and (cid:74) a (cid:48) (cid:75) are in C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) Γ (cid:96) A (cid:75) ) , and (cid:74) a (cid:75) ≡ (cid:74) a (cid:48) (cid:75) .Proof. Routine, using the previous Lemmas as necessary. We show a few cases: • var-roundtrip : Since the context is assumed to be defined, all of the subexpressions of the definitionare defined. For the type, we want (cid:74) Γ (cid:96) A (cid:75) defined and have that (cid:74) Γ (cid:96) A (cid:75) defined, so we applyLemma 7.13. Modulo a number of semantic projections corresponding to the weakening of A throughthe rest of the context, we want the definition to have type (cid:74) Γ (cid:96) A (cid:75) , but it has type (cid:74) Γ (cid:96) A (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ],and these are equal. • (cid:92) -intro : Suppose Γ (cid:96) A type and Γ (cid:96) a : A and that (cid:74) Γ (cid:75) is defined. We want to show (cid:74) a (cid:92)A (cid:75) ∈ (cid:74) (cid:92)A (cid:75) .Because pre-unit preserves size, we can apply the inductive hypothesis to the resulting derivationsof Γ (cid:96) A type and Γ (cid:96) a : A to get that (cid:74) Γ (cid:96) A (cid:75) and (cid:74) Γ (cid:96) a (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) Γ (cid:96) A (cid:75) ) are defined. Thus, (cid:74) (cid:92)A (cid:75) ≡ ( N (cid:74) A (cid:75) )[ η (cid:74) Γ (cid:75) ] and (cid:74) a (cid:92)A (cid:75) ≡ ( N (cid:74) Γ (cid:96) A (cid:75) (cid:74) a (cid:75) )[ η (cid:74) Γ (cid:75) ] are defined, and the term has the correct type. • (cid:92) -elim : Suppose Γ (cid:96) A type and Γ (cid:96) a : (cid:92)A and that (cid:74) Γ (cid:75) is defined. We want to show (cid:74) a A(cid:92) (cid:75) ∈ (cid:74) A (cid:75) .Because pre-unit preserves size, we can apply the inductive hypothesis to the resulting derivationof Γ (cid:96) A type and to Γ (cid:96) a : (cid:92)A to get that (cid:74) Γ (cid:96) A (cid:75) and (cid:74) Γ (cid:96) a (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) N (cid:74) Γ (cid:96) A (cid:75) [ η (cid:74) Γ (cid:75) ]) aredefined. Thus, (cid:74) a A(cid:92) (cid:75) is defined, since all of its pieces are, and (cid:74) a (cid:75) has the necessary type. Its type is (cid:74) A (cid:75) [ p (cid:74) A (cid:75) ][( id (cid:74) Γ (cid:75) , (cid:74) a (cid:75) )], which is defined because all of its pieces are, and reduces to (cid:74) A (cid:75) as desired. • (cid:92) -beta : Assume the typing premises Γ (cid:96) A type and Γ (cid:96) a : A . Then (cid:74) A (cid:75) and (cid:74) a (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) Γ (cid:96) A (cid:75) )are defined because we can apply pre-unit to both before using the inductive hypothesis. Second,65 ( a (cid:92) ) (cid:92) (cid:75) is defined and has type (cid:74) A (cid:75) by composing the previous two cases, which works because we havethe same inductive hypotheses available on the typing premises. Finally, these are equal because: (cid:74) Γ (cid:96) a (cid:92)(cid:92) (cid:75) ≡ q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) a (cid:92) (cid:75) (cid:1) ] ≡ q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ (cid:75) , ( N (cid:74) Γ (cid:96) a (cid:75) )[ η (cid:74) Γ (cid:75) ] (cid:1) ] ≡ (cid:74) Γ (cid:96) a (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] (Equation 4) ≡ (cid:74) Γ (cid:96) a (cid:75) (Lemma 7.13) ≡ (cid:74) Γ (cid:96) a (cid:75) ( a is already zeroed syntactically) • (cid:92) -eta : Suppose the typing premises Γ (cid:96) A type and Γ (cid:96) n : (cid:92)A . The inductive hypothesis on the lattergives (cid:74) (cid:92)A (cid:75) and (cid:74) n (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) (cid:92)A (cid:75) ) defined. By Lemma 7.13, (cid:74) Γ (cid:96) n (cid:75) ∈ C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) (cid:92)A (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ]) isdefined, and (cid:74) (cid:92)A (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] ≡ (cid:74) (cid:92)A (cid:75) . This implies (cid:74) ( n A(cid:92) ) (cid:92)A (cid:75) is defined and is in C ( (cid:74) Γ (cid:75) (cid:96) (cid:74) (cid:92)A (cid:75) ). (cid:74) Γ (cid:96) n (cid:92)(cid:92) (cid:75) ≡ ( N (cid:74) Γ (cid:96) n (cid:92) (cid:75) )[ η (cid:74) Γ (cid:75) ] ≡ ( N ( q (cid:74) A (cid:75) [ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) n (cid:75) (cid:1) ]))[ η (cid:74) Γ (cid:75) ] ≡ ( N q (cid:74) A (cid:75) )[ η (cid:74) Γ (cid:75) . ( N (cid:74) A (cid:75) )[ η (cid:74) Γ (cid:75) ] ][ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) n (cid:75) (cid:1) ] (Naturality of η ) ≡ q ( N (cid:74) A (cid:75) )[ η (cid:74) Γ (cid:75) ] [ (cid:0) id (cid:74) Γ (cid:75) , (cid:74) Γ (cid:96) n (cid:75) (cid:1) ] (Equation 5) ≡ (cid:74) Γ (cid:96) n (cid:75) ≡ (cid:74) Γ (cid:96) n (cid:75) [ ε (cid:74) Γ (cid:75) ◦ η (cid:74) Γ (cid:75) ] (Lemma 7.13) ≡ (cid:74) Γ (cid:96) n (cid:75) (Lemma 7.12) Corollary 7.17. MLTT extended as in Figures 1 and 2 is logically consistent.Proof. For any CwF there is a CwB with N the identity functor, so the extension interprets in any existingmodel. Conversely, we can build a syntactic category. Theorem 7.18 (Completeness) . The term model of the type theory forms a CwB.Proof. The CwF is constructed in the usual way, with the underlying category given by contexts and totalsubstitutions between them, the families for a context given by types in that context up to equality, andelements of each family by terms up to equality in that type.Total substitutions are defined as normal for the empty context and ordinary context extension. Substi-tution into Γ , x :: A is defined to match dull-subst : subst-ext-zero ∆ (cid:96) θ : Γ ∆ (cid:96) a : A [ θ ]∆ (cid:96) ( θ, a/x ) : Γ , x :: A The identity substitution is given as usual for ordinary context extension, and by id Γ ,x :: A : ≡ id Γ , x/x formodal context extension. Composition of total substitutions θ : ∆ (cid:96) Γ and θ (cid:48) : Γ (cid:96) Γ (cid:48) is defined by inductionon θ (cid:48) . The new case, when Γ (cid:48) ends with a modal context extension, is defined by ( θ (cid:48) , a (cid:48) /x )[ θ ] ≡ ( θ (cid:48) [ θ ] , a (cid:48) [ θ ] /x ).Checking associativity and unit laws of composition is then straight forward.66urning to the CwB structure, the functor N is defined on contexts by N (Γ) : ≡ Γ, on types by N ( A ) : ≡ (cid:92)A and terms by N ( a ) : ≡ a (cid:92) . On total substitutions, we define N ( θ ) : ≡ θ , where · : ≡ · θ, a/x : ≡ θ, a/xθ, a/x : ≡ θ, a/x This admissible rule was used in subst-ext-zero above.To show N is a weak CwF morphism, N preserves the terminal object (empty context) by definition, andcommutes with reindexing on types and terms by the definition of substitution as an admissible operation. Wejust need that N (Γ .A ) → N Γ .N A is an isomorphism, and unfolding the definitions, this is the substitutionΓ , x : A (cid:96) ( id Γ , x (cid:92) ) : Γ , y :: (cid:92)A This has an inverse Γ , y :: (cid:92)A (cid:96) ( id Γ , y (cid:92) ) : Γ , x : A by the β - and η -rules for (cid:92) . The β -rule will give us x in the last component, but this matches the definitionof the identity substitution for a marked variable.The unit and counit substitutionsΓ (cid:96) unit Γ : Γ −−−−−−− Γ (cid:96) counit Γ : Γ −− − − − − −− are given by inductively defining unit · : ≡ · unit Γ ,x : A : ≡ unit Γ , x/x unit Γ ,x :: A : ≡ unit Γ , x/x counit · : ≡ · counit Γ ,x : A : ≡ counit Γ , x/x counit Γ ,x :: A : ≡ counit Γ , x/x Naturality is easy to verify by induction. The round-trip on Γ is exactly the identity substitution, as id Γ bydefinition consists of tuples of zeroed variables. We present a concrete implementation in parametrised pointed types, which has a similar structure toparametrised spectra, but is simpler to describe. The ∞ -topos of parametrised pointed spaces is definedsimilarly to P Spec, but with the ∞ -category of pointed spaces S (cid:63) taking the place of Spec, so an objectconsists of a space B and a family E : Fun( B, S (cid:63) ) of pointed spaces. In intensional type theory, we candefine a weak version of this model, where many equations that should be strict equalities (such as the β -and η -rules for the type formers) hold only up to paths. Indeed, in this internal presentation, function typesin the theory are interpreted as functions that preserve the point only up to a path whereas we conjecturethat there is an external model in parametrised pointed spaces where functions are pointed up to equality.This model has been considered independently in some related work. Some aspects, including the uni-verse, were described in a talk by Buchholtz [Buc19], which discussed simple, internally definable models ofcohesion. The paper of Kraus and Sattler [KS17] discuss how, for certain Reedy diagrams, the data of acoherent diagram has a finite description internally, without needing to specify infinitely many coherences.Parameterised pointed spaces can be seen as the category of homotopy coherent diagrams over the walking67ection/retraction. Intuitively, an ∞ -presheaf Γ on { s : 1 → , r : 0 → | r ◦ s = id } consists of a spaceΓ(0) and a space Γ(1) with a projection Γ(1) → Γ(0) and a section of it Γ(0) → Γ(1). Taking the fibre ofthe projection, we can think of Γ(1) as a dependent type on Γ(0), with each type in the fibre equipped witha distinguished point determined by the section s . Kraus and Sattler’s construction applies to this indexcategory, and their construction yields a description equivalent to the one presented here.Coquand, Ruch, and Sattler [CRS20] also consider constructive sheaf models of univalent type theory onthe walking section-retraction. In this (weak) model, each ‘context’ ‘Γ ctx ’ is interpreted as an element of a record type Definition 8.1 (Contexts in Pointed Spaces) . Ctx : ≡ { B : U , E : B → U , p : (cid:89) g : B E ( g ) } consisting of a type B , a family of types over it E , and a section p . Equivalently, we could package E and p together into a family of pointed types. This corresponds to the section/retraction pair (cid:80) ( g : B Γ) E Γ( g ) B Γ pr ( g, p g ) With this in mind, we refer to B Γ as the base or index space , E Γ as the fibre , and p as the section or the point (though this is a bit imprecise, since really it is a family of points, one for each object of the base).A ‘substitution’ Γ (cid:96) θ : ∆ between Γ , ∆ : Ctx is then a map of the base and a map of the fibres thatcommute with the section, represented by the record type Definition 8.2 (Substitutions in Pointed Spaces) . { B : B Γ → B ∆ , E : (cid:89) g : B Γ E Γ( g ) → E ∆( B ( g )) , p : (cid:89) g : B Γ E ( g, p Γ( g )) = E ∆( B ( g )) p ∆( B ( g )) } Definition 8.3 (Empty Context in Pointed Spaces) . The empty context ‘ ∅ ctx ’ is given by the unit typeover the unit type. B ( ∅ ) : ≡ E ( ∅ )( (cid:63) ) : ≡ p ( ∅ )( (cid:63) ) : ≡ (cid:63) Note that we use “copattern” notation [Abe+13] to describe elements of records/functions, i.e. this desugarsto the record ∅ : ≡ { B = 1 , E = λg. , p = λg.(cid:63) } For a context Γ : Ctx , the context (cid:92) Γ : Ctx is defined by keeping the base the same but replacing the fibrewith the point: 68 efinition 8.4 (Natural Context in Pointed Spaces) . B ( (cid:92) Γ) : ≡ B Γ E ( (cid:92) Γ)( g ) : ≡ p ( (cid:92) Γ)( g ) : ≡ (cid:63) The unit substitution Γ (cid:96) η : (cid:92) Γ is given by B η ( g ) : ≡ g E η ( g, g (cid:48) ) : ≡ (cid:63) p η ( g ) : ≡ refl i.e. it is the identity in the base, and sends everything in E Γ to the point, which in particular sends thesections of Γ to the point. Because the fibres are pointed, there is also a counit (cid:92) Γ (cid:96) ε : Γ B ε ( g ) : ≡ g E ε ( g, (cid:63) ) : ≡ p Γ( g ) p ε ( g, (cid:63) ) : ≡ refl i.e. it is again the identity on the base, and sends the point in the fibre to the chosen point in each fibre.For a context Γ (which determines a closed type), (cid:92) Γ is contractible in this model when B Γ is a contractibletype. A (cid:92) -connected context has the form { B Γ (cid:39) , E Γ : 1 → U , p Γ : E Γ( (cid:63) ) } and thus is exactly a singlepointed type. Moreover, the substitutions between them are exactly pointed maps.Supposing that Γ consists of a single type A , we are used to thinking of substitutions ∅ (cid:96) θ : A ascorresponding to ‘elements of A ’. In our setting, however, if A is a (cid:92) -connected type then the type of suchsubstitutions is contractible — there is a unique pointed map from 1 to A that sends the point in the fibreto the point of A . Thus, substitutions from ∅ do not give access to the elements of the fibre of A . To accessthe elements of the fibre, we can instead consider substitutions from B (cid:96) θ : A , where B is the booleans overthe unit type Definition 8.5. B B : ≡ E B ( (cid:63) ) : ≡ p B ( (cid:63) ) : ≡ true Substitutions B (cid:96) θ : A correspond to pointed maps from the booleans into E A . Such a pointed map sends true to the point, but has one remaining degree of freedom — where they send false . Thus, the substitutionsfrom B into a (cid:92) -connected type A are equivalent to E A ( (cid:63) ). We use an analogue of B in Section 3 below.The fact that substitutions ∅ (cid:96) θ : A ‘miss’ data from A does not conflict with the equivalence of types A (cid:39) (1 → A ): we will see that the definition of the internal hom does capture the fibre of A in the fibre ofthe function type. A dependent type in this model ‘Γ (cid:96) A type ’ is specified by an element of the record type Definition 8.6 (Dependent Type in the Pointed Spaces Model) . { B : B Γ → U , E : (cid:89) g : B Γ B ( g ) → E Γ( g ) → U , p : (cid:89) ( g : B Γ) (cid:89) ( a : B ( g )) E ( g, a, p Γ( g )) } A depends only on the base of the context, while the fibre depends on both the base andthe fibre of the context, and the base of the type. Not every fibre of the E A family has a specified point,only the fibres that additionally lie over the basepoint of E Γ.The data of a type in context can arranged into the following diagram. (cid:80) ( g : B Γ) (cid:80) ( a : B A ( g )) (cid:80) ( e : E Γ( g )) E A ( g, a, e ) (cid:80) ( g : B Γ) E Γ( g ) (cid:80) ( g : B Γ) B A ( g ) B Γwhere the upwards maps are sections definable from p Γ and p A .This section/retraction on the left is exactly the interpretation of context extension ‘Γ .A ctx ’, and thehorizontal maps describe the projection substitution Γ .A → Γ Definition 8.7 (Context Extension in Pointed Spaces) . The context extension ‘Γ .A ctx ’ is defined by B (Γ .A ) : ≡ (cid:88) g : B Γ B A ( g ) E (Γ .A )( g, a ) : ≡ (cid:88) e : E Γ( g ) E A ( g, a, e ) p (Γ .A )( g, a ) : ≡ ( p Γ( g ) , p A ( g, a ))A ‘term in context’ must be the data of a section of the projection substitution ‘Γ .A → Γ’ shown inthe diagram above — this is a section in the horizontal direction. Building the section equation in viadependency gives Definition 8.8 (Terms in Pointed Spaces) . A term ‘Γ (cid:96) t : A ’ is an element of the record type { b : (cid:89) g : B Γ B A ( g ) e : (cid:89) ( g : B Γ) (cid:89) ( e : E Γ( g )) E A ( g, b ( g ) , e ) p : (cid:89) g : B Γ e ( g, p Γ( g )) = E A ( g, b ( g ) , p Γ( g )) p A ( g, b ( g )) } For (cid:92) Γ (cid:96) A type , we can define the natural type Γ (cid:96) (cid:92)A type by replacing the fibres with the unit type: Definition 8.9 (Natural Type in Pointed Spaces) . B ( (cid:92)A )( g ) : ≡ B A ( g ) E ( (cid:92)A )( g, a, e ) : ≡ E ( (cid:92)A )( g, a ) : ≡ (cid:63) Note that this definition only uses g : B Γ and not the fibre or the section of Γ, so the definition is independentof whether we ask for an A that depends on Γ or on (cid:92) Γ. This internal model supports both dependent sums and dependent products satisfying the expected equationspropositionally. Our goal here is to demonstrate how these type formers depend on the pieces of the context,so we instead describe non-dependent × -types and → -types, but the analogous definitions replacing × withΣ and → with Π give the dependent versions.Product types are easy: we form the product both downstairs and upstairs. The pairing and projectionterms are defined using the pairing and projection of the underlying × -types.70 efinition 8.10 (Product Types in Pointed Spaces) . For two types ‘Γ (cid:96) A type ’ and ‘Γ (cid:96) B type ’ define‘Γ (cid:96) A × B type ’ by B ( A × B )( g ) : ≡ B A ( g ) × B B ( g ) E ( A × B )( g, ( a, b ) , e ) : ≡ E A ( g, a, e ) × E B ( g, b, e ) p ( A × B )( g, ( a, b )) : ≡ ( p A ( g, a ) , p B ( g, b ))Function types are more interesting. The base of A → B is not the type of functions B A → B B , butrather the entire type of substitutions Γ .A to Γ .B over Γ. For a fixed g : B Γ, the data of such a substitutionunwinds to triples Arr ( A, B )( g : B Γ) := { b : B A ( g ) → B B ( g ) e : (cid:89) a : B A ( g ) E A ( g, a, p Γ( g )) → E B ( g, b ( a ) , p Γ( g )) p : (cid:89) a : B A ( g ) e ( a, p A ( g, a )) = p B ( g, b ( a )) } Definition 8.11 (Function Types in Pointed Spaces) . For two types ‘Γ (cid:96) A type ’ and ‘Γ (cid:96) B type ’ define‘Γ (cid:96) A → B type ’ by B ( A → B )( g ) : ≡ Arr ( A, B )( g ) E ( A → B )( g, ( b f, e f, p f ) , e ) : ≡ (cid:89) a : B A ( g ) E A ( g, a, e ) → E B ( g, b f ( a ) , e ) p ( A → B )( g, ( b f, e f, p f )) : ≡ e f This definition makes it clear that the (cid:92) modality does not preserve Π-types: the base of (cid:92) ( A → B ) is Arr ( A, B ), while the base of ( (cid:92)A → (cid:92)B ) is essentially B A → B B (because the fibres of (cid:92)B are 1, the rest ofthe data of Arr ( (cid:92)A, (cid:92)B ) is determined).We can also define identity types and the universe. Similar to Σ-types, Id -types are given component-wise.The type ‘ a = a (cid:48) ’ has as its base paths in the base of ‘ A ’, with the family over a path p : B ( a )( g ) = B ( a (cid:48) )( g )given by dependent paths in E A ( g, − , e ) that lie over it. Definition 8.12 (Identity Types in Pointed Spaces) . For ‘Γ (cid:96) a : A ’ and ‘Γ (cid:96) a (cid:48) : A ’, define ‘Γ (cid:96) ( a = a (cid:48) ) type ’ by B ( a = a (cid:48) )( g ) : ≡ ( B ( a )( g ) = B ( a (cid:48) )( g )) E ( a = a (cid:48) )( g, p, e ) : ≡ ( E ( a )( g, e ) = ap E A ( g, − ,e ) ( p ) E ( a (cid:48) )( g, e )) p ( a = a (cid:48) )( g, p ) : ≡ p ( a )( g ) (cid:5) apd p A ( g, B B ( − )( g )) ( p ) (cid:5) p ( a (cid:48) )( g ) − The types of the paths used to define the basepoint of each family above are p ( a )( g ) : E ( a )( g, p Γ( g )) = p A ( g, B ( a )( g )) apd p A ( g, B B ( − )( g )) ( p ) : p A ( g, B ( a )( g )) = ap E A ( g, − ,e ) ( p ) p A ( g, B ( a (cid:48) )( g )) p ( a (cid:48) )( g ) − : p A ( g, B ( a (cid:48) )( g )) = E ( a (cid:48) )( g, p Γ( g ))Finally, the universe has as its base the entire type of pointed families, and as its upstairs, the type ofunpointed families over the same base. Definition 8.13 (The Universe in Pointed Spaces) . The universe ‘ ∅ (cid:96) U type ’ is given by B ( U )( (cid:63) ) : ≡ (cid:88) ( B : U ) (cid:88) ( E : B →U ) (cid:89) ( b : B ) E ( b ) E ( U )( (cid:63), ( B, E, p ) , (cid:63) ) : ≡ B → U p ( U )( (cid:63), ( B, E, p )) : ≡ E Future Work This paper lays the groundwork for synthetic stable homotopy theory, but much remains to be done. Themost obvious next step is to investigate synthetic cohomology using reduced types: Definition 9.1. For a dull pointed space X and reduced type E , the n th cohomology of X with coefficientsin E is defined by the formula E n ( X ) : ≡ π n ( (cid:92) (Σ ∞ X → E ))Using Axiom S, we expect these groups to form a ‘cohomology theory’, in the sense of the Eilenberg-Steenrod axioms (see [Cav15, Section 3]) for any reduced type E . To recover ordinary cohomology, we needto define a reduced type ‘ H Z ’ that satisfies π s ( H Z ) = Z and π sn ( H Z ) = 0 for n (cid:54) = 0. Axiom N implies that π s S = Z , so we expect to form such an H Z by truncating S to remove the stable homotopy groups abovedimension 0. This truncation operation will be given by a higher inductive type, nullification at Σ S .To discuss synthetic homology , we will need a version of the ‘smash product of spectra’, so that wecan make the definition ‘ E n ( X ) : ≡ π sn (Σ ∞ X ⊗ E )’. This product is analogous to the tensor product ofmodules/chain complexes in algebra, and spectra come equipped with an internal hom for this product.Adding type formers corresponding to these operations will require a more radical modification to the waycontexts are structured and remains work in progress.We have also begun work on a modification of Agda to include our (cid:92) -modality, which would allow usto formalise the results of this paper. Agda already has infrastructure to support a class of modalities,including the (cid:91) modality of spatial type theory [Vez19] and run-time irrelevance [Atk18]. The common factorin all these modalities is that they restrict access to the variables in the context in various ways, but when avariable is available, it is used via the ordinary variable rule. Including our var-zero rule involves touchingmany more aspects of the type-checker, and in particular it is not yet clear how marked variables shouldinteract with the module system. This is also left for future work.Finally, it remains to work out the details of the models, constructing instances of a CwB for modelcategories presenting parametrised pointed spaces and for parametrised spectra. For this, we anticipatebuilding on [Shu19a] and the strictification techniques [LW15] that have previously been applied to modali-ties [Bir+20]. References [Abe+13] Andreas Abel, Brigitte Pientka, David Thibodeau, and Anton Setzer. “Copatterns: Pro-gramming Infinite Structures by Observations”. In: Proceedings of the 40th Annual ACMSIGPLAN-SIGACT Symposium on Principles of Programming Languages . POPL ’13. Rome,Italy: Association for Computing Machinery, 2013, pp. 27–38. isbn : 9781450318327. doi : .[ABFJ20] Mathieu Anel, Georg Biedermann, Eric Finster, and Andr´e Joyal. “A Generalized Blakers-Massey Theorem”. In: Journal of Topology (2020). arXiv: . Forthcom-ing.[ABG18] Matthew Ando, Andrew Blumberg, and David Gepner. “Parametrized spectra, multiplicativeThom spectra and the twisted Umkehr map”. In: Geometry & Topology issn : 1465-3060. doi : .[AK11] Peter Arndt and Krzysztof Kapulkin. “Homotopy-theoretic models of type theory”. In: Typedlambda calculi and applications . Vol. 6690. Lecture Notes in Comput. Sci. Springer, Heidelberg,2011, pp. 45–60. doi : .[Ale+01] Natasha Alechina, Michael Mendler, Valeria de Paiva, and Eike Ritter. “Categorical andKripke semantics for constructive S4 modal logic”. In: Computer science logic (Paris, 2001) .Vol. 2142. Lecture Notes in Comput. Sci. Springer, Berlin, 2001, pp. 292–307. doi : . 72Alt+18] Thorsten Altenkirch, Paolo Capriotti, Gabe Dijkstra, Nicolai Kraus, and Fredrik NordvallForsberg. “Quotient inductive-inductive types”. In: Foundations of software science and com-putation structures . Vol. 10803. Lecture Notes in Comput. Sci. Springer, Cham, 2018, pp. 293–310. doi : .[Atk18] Robert Atkey. “Syntax and semantics of quantitative type theory”. In: Proceedings of the33rd Annual ACM/IEEE Symposium on Logic in Computer Science . 2018, pp. 56–65. doi : .[AW09] Steve Awodey and Michael A. Warren. “Homotopy theoretic models of identity types”. In: Math. Proc. Cambridge Philos. Soc. issn : 0305-0041. doi : .[Bar96] Andrew Barber. Dual Intuitionistic Linear Logic . Tech. rep. Technical Report ECS-LFCS-96-347. University of Edinburgh, 1996.[Bir+20] Lars Birkedal, Ranald Clouston, Bassel Mannaa, Rasmus Ejlers Møgelberg, Andrew M. Pitts,and Bas Spitters. “Modal dependent type theory and dependent right adjoints”. In: Mathe-matical Structures in Computer Science doi : .[Boe20] Menno de Boer. “A Proof and Formalization of the Initiality Conjecture of Dependent TypeTheory”. Licentiate Thesis, available from http://su.diva- portal.org/smash/record.jsf?pid=diva2%3A1431287&dswid=-3494 . MA thesis. Stockholm University, 2020.[Bru16] Guillaume Brunerie. “On the homotopy groups of spheres in homotopy type theory”. PhDthesis. Universit´e de Nice, 2016. arXiv: .[Buc19] Ulrik Buchholtz. Universes in toy models of spatial type theory . 2019. url : .[BW96] Nick Benton and Philip Wadler. “Linear logic, monads and the lambda calculus”. In: . IEEEComput. Soc. Press, Los Alamitos, CA, 1996, pp. 420–431. doi : .[Cav15] Evan Cavallo. “Synthetic cohomology in homotopy type theory”. MA thesis. Carnegie MellonUniversity, Dec. 2015. url : .[Clo18] Ranald Clouston. “Fitch-style modal lambda calculi”. In: Foundations of software scienceand computation structures . Vol. 10803. Lecture Notes in Comput. Sci. Springer, Cham, 2018,pp. 258–275. doi : .[CP02] Iliano Cervesato and Frank Pfenning. “A linear logical framework”. In: Inform. and Comput. issn : 0890-5401. doi : .[CRS20] Thierry Coquand, Fabian Ruch, and Christian Sattler. Constructive sheaf models of typetheory . 2020. arXiv: .[Dyb96] Peter Dybjer. “Internal type theory”. In: Types for proofs and programs (Torino, 1995) .Vol. 1158. Lecture Notes in Comput. Sci. Springer, Berlin, 1996, pp. 120–134. doi : .[Fre+99] P. J. Freyd, P. W. O’Hearn, A. J. Power, M. Takeyama, R. Street, and R. D. Tennent.“Bireflectivity”. In: vol. 228. 1-2. Mathematical foundations of programming semantics (NewOrleans, LA, 1995). 1999, pp. 49–76. doi : .[GK17] David Gepner and Joachim Kock. “Univalence in locally cartesian closed ∞ -categories”. In: Forum Math. issn : 0933-7741. doi : .[Gra+20] Daniel Gratzer, G. A. Kavvos, Andreas Nuyts, and Lars Birkedal. “Multimodal DependentType Theory”. In: ACM/IEEE Symposium on Logic in Computer Science . Saarbr¨ucken, Ger-many: Association for Computing Machinery, 2020, pp. 492–506.73Gra18] Robert Graham. “Synthetic Homology in Homotopy Type Theory”. 2018. arXiv: .[GSB19] Daniel Gratzer, Jonathan Sterling, and Lars Birkedal. “Implementing a modal dependenttype theory”. In: ICFP ’19 (2019), pp. 1–29.[Hof97] Martin Hofmann. “Syntax and semantics of dependent types”. In: Semantics and logics ofcomputation (Cambridge, 1995) . Vol. 14. Publ. Newton Inst. Cambridge Univ. Press, Cam-bridge, 1997, pp. 79–130. doi : .[HoTTBook] The Univalent Foundations Program. Homotopy Type Theory: Univalent Foundations of Math-ematics . Institute for Advanced Study: https://homotopytypetheory.org/book , 2013.[Isa20a] Valery Isaev. “Indexed type theories”. In: Mathematical Structures in Computer Science (2020), pp. 1–61. doi : .[Isa20b] Valery Isaev. Indexed type theories . 2020. url : .[Joy08] Andr´e Joyal. Notes on logoi . 2008. url : .[KPB15] Neelakantan R. Krishnaswami, Pierre Pradic, and Nick Benton. “Integrating Linear and De-pendent Types”. In: Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium onPrinciples of Programming Languages . POPL ’15. Mumbai, India: Association for ComputingMachinery, 2015, pp. 17–30. isbn : 9781450333009. doi : .[KS17] Nicolai Kraus and Christian Sattler. “Space-Valued Diagrams, Type-Theoretically (ExtendedAbstract)”. In: (2017). arXiv: .[Law07] F. William Lawvere. “Axiomatic cohesion”. In: Theory Appl. Categ. 19 (2007), No. 3, 41–49.[LS20] Peter LeFanu Lumsdaine and Michael Shulman. “Semantics of higher inductive types”. In: Math. Proc. Cambridge Philos. Soc. issn : 0305-0041. doi : 10 .1017/s030500411900015x .[LSR17] Daniel R. Licata, Michael Shulman, and Mitchell Riley. “A fibrational framework for substruc-tural and modal logics”. In: . Vol. 84. FSCD ’17. 2017. url : http://dlicata.web.wesleyan.edu/pubs/lsr17multi/lsr17multi-ex.pdf .[LW15] Peter LeFanu Lumsdaine and Michael A. Warren. “The local universes model: an overlookedcoherence construction for dependent type theories”. In: ACM Trans. Comput. Log. issn : 1529-3785. doi : .[NPP08] Aleksandar Nanevski, Frank Pfenning, and Brigitte Pientka. “Contextual modal type theory”.In: ACM Trans. Comput. Log. issn : 1529-3785. doi : .[PD01] Frank Pfenning and Rowan Davies. “A judgmental reconstruction of modal logic”. In: vol. 11.2001, pp. 511–540. doi : .[PR16] Valeria de Paiva and Eike Ritter. “Fibrational modal type theory”. In: Proceedings of theTenth Workshop on Logical and Semantic Frameworks, with Applications (LSFA 2015) . Vol. 323.Electron. Notes Theor. Comput. Sci. Elsevier Sci. B. V., Amsterdam, 2016, pp. 143–161. doi : .[Ree09] Jason Reed. “A judgmental deconstruction of modal logic”. 2009. url : .[Rij18] Egbert Rijke. “Classifying Types”. PhD thesis. Carnegie Mellon University, July 2018. arXiv: . 74RSS20] Egbert Rijke, Michael Shulman, and Bas Spitters. “Modalities in homotopy type theory”. In: Log. Methods Comput. Sci. Proceedings of the 35th Annual ACM-IEEE Symposium on Logic in Com-puter Science (LICS 2020) . 2020. url : . Forthcoming.[Shu+19] Michael Shulman, Floris van Doorn, Egbert Rijke, Stefano Piceghello, and Yuri Sulyma. Spectral Sequences in Homotopy Type Theory . 2019. url : https://github.com/cmu-phil/Spectral/tree/master/spectrum .[Shu15] Michael Shulman. “The univalence axiom for elegant Reedy presheaves”. In: Homology Ho-motopy Appl. issn : 1532-0073. doi : .[Shu18] Michael Shulman. “Brouwer’s fixed-point theorem in real-cohesive homotopy type theory”.In: Math. Structures Comput. Sci. issn : 0960-1295. doi : .[Shu19a] Michael Shulman. “All ( ∞ , .[Shu19b] Michael Shulman. The Generalized Blakers-Massey Theorem . The HoTT Library. 2019. url : https://github.com/HoTT/HoTT/blob/master/theories/Homotopy/BlakersMassey.v .[Str91] Thomas Streicher. Semantics of type theory . Progress in Theoretical Computer Science. Birkh¨auserBoston, Inc., Boston, MA, 1991, pp. xii+298. isbn : 0-8176-3594-7. doi : .[V´ak15] Matthijs V´ak´ar. “A Categorical Semantics for Linear Logical Frameworks”. In: Foundationsof Software Science and Computation Structures . Ed. by Andrew Pitts. Berlin, Heidelberg:Springer Berlin Heidelberg, 2015, pp. 102–116. isbn : 978-3-662-46678-0.[van18] Floris van Doorn. “On the formalization of higher inductive types and synthetic homotopytheory”. PhD thesis. 2018. arXiv: .[Vez19] Andrea Vezzosi. Agda Flat . 2019. url : https://github.com/agda/agda/tree/flathttps://github.com/agda/agda/tree/flat