This paper was converted on www.awesomepapers.org from LaTeX by an anonymous user.
Want to know more? Visit the Converter page.

\aldine  Foundations of Substructural Dependent Type Theory

C.B. Aberlé caberle@andrew.cmu.edu Carnegie Mellon UniversityUSA
(2024)
Abstract.

Abstract: This paper presents preliminary work on a general system for integrating dependent types into substructural type systems such as linear logic and linear type theory. Prior work on this front has generally managed to deliver type systems possessing either syntax or semantics inclusive of certain practical applications, but has struggled to combine these all in one and the same system. Toward resolving this difficulty, I propose a novel categorical interpretation of substructural dependent types, analogous to the use of monoidal categories as models of linear and ordered logic, that encompasses a wide class of mathematical and computational examples. On this basis, I develop a general framework for substructural dependent type theories, and proceed to prove some essential metatheoretic properties thereof. As an application of this framework, I show how it can be used to construct a type theory that satisfactorily addresses the problem of effectively representing cut admissibility for linear sequent calculus in a logical framework.

copyright: acmlicensedjournalyear: 2024doi: XXXXXXX.XXXXXXXconference: Make sure to enter the correct conference title from your rights confirmation email; June 03–05, 2018; Woodstock, NYbooktitle: Tallinn ’24: Thirty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), June 03–05, 2018, Tallinn, Estoniaisbn: 978-1-4503-XXXX-X/18/06

1. The Past, Present & Future of Substructural Dependent Type Theory

Dependent type theory in the mould of Martin-Löf’s intuitionistic type theory (martin-lof, Mar75) promises to internalize mathematical reasoning into systems for constructing proof and program alike. Likewise, substructural type systems akin to Girard’s linear logic (girard, Gir87) seek to reflect the fundamental insight that truth is ephemeral, and to thereby capture notions of state, resources, etc. in the proofs/programs they afford. Yet these two typing disciplines, both alike in dignity, have proven resistant to a satisfactory union.

Many authors seeking to combine substructural and dependent typing have followed the solution posed by Cervesato & Pfenning (cervesato-pfenning, CP02), whereby contexts of would-be substructural dependent type theories are to be cleft in twain – on one side an intuitionistic context of variables upon which others may depend, and on the other a context of substructural variables amongst which there inheres no dependency. This approach is not without theoretical merit nor practical utility, but by its very nature, it falls short of fully capturing substructural reasoning about proofs/programs, since substructurality must end where dependency begins. As Jason Reed observes (reed, Ree09), this has the practical consequence that one cannot give an effective representation of cut-admissibility for linear sequent calculus in a linear logical framework constructed in this way. Such a representation must reflect substructural constraints on terms into the types in which those terms appear – precisely what is disallowed by forfeiting dependency to the intuitionistic layer.

Other solutions to the problem of combining substructural and dependent types have been proposed, e.g. forms of quantitative type theory (mcbride, McB16) (atkey, Atk18). However, the majority of these share with Cervesato & Pfenning’s the confinement of dependent type formation to an essentially intuitionistic layer of the theory, which thereby runs afoul of the same example highlighted above by Reed.

What is distinctly lacking from the above attempts at integrating substructural and dependent types is a solidly agreed-upon semantic basis in mathematics upon which to build the type-theoretic apparatus. To be sure, many of the above-mentioned dependent type theories have been given denotational semantics, some quite elegant, often as variations on the categorical semantics of dependent type theory, with some additional structure to make sense of the substructural component (e.g. (krishnaswami-pradic-benton, KPB15)). Yet, as illustrated by such troublesome cases as Reed’s, none of these semantics capture the full generality of substructural dependent types in the same way that, e.g., the usual categorical semantics for linear and ordered logic in monoidal categories do. Upon reflection, it should be clear why this would be the case – the semantics of linear logic were arrived at not by adding structure to the semantics of intuitionistic type theory, but rather by carefully removing such structure.

I thus propose to develop a truly general substructural dependent type theory by generalizing the categorical semantics of dependent type theory to a novel class of structures, which I call left-fibred double categories (LFDCs), as a unifying framework for both dependent and substructural type theories. I establish metatheoretic desiderata, such as decidability, admissibility of substitution, etc., for the resulting type theory, and finally, to illustrate its general applicability, I turn it upon the example of representing cut-admissibility for linear sequent calculus, and show how the type theory succeeds at this task where others have previously failed.

2. Sketch of a Semantics

I begin with a reflection upon and generalization of the categorical semantics of dependent types. For present purposes, I keep the exposition somewhat informal, with fully rigorous definitions and proofs to be conducted in future work.

2.1. Revisting the Semantics of Dependent Type Theory

Toward defining a class of structures capable of modelling substructural dependent types, I first recall the ordinary categorical semantics of dependent types. Various definitions exist in the literature of categorical structures that model dependent types, e.g. categories with families, display map categories, natural models, etc. For present purposes, however, it will suffice for us to consider only the most general class of such models – comprehension categories.

Definition 2.1

A comprehension category, viewed as a model of dependent type theory (c.f. Jacobs (jacobs, Jac93)), comprises:

  1. (1)

    A category \mathfrak{C} of contexts, with objects Γ,Δ\Gamma,\Delta representing contexts and morphisms f:ΓΔf:\Gamma\xrightarrow[]{}\Delta\in\mathfrak{C} viewed as substitutions.

  2. (2)

    For each context Γ\Gamma\in\mathfrak{C}, a category 𝔗(Γ)\mathfrak{T}(\Gamma) of types, with objects S,TS,T interpreted as types dependent upon Γ\Gamma and morphisms t:ST𝔗(Γ)t:S\xrightarrow[]{}T\in\mathfrak{T}(\Gamma) as terms of type TT in context Γ\Gamma, additionally parameterized by SS.

  3. (3)

    For each f:ΓΔf:\Gamma\xrightarrow[]{}\Delta\in\mathfrak{C}, a functor f:𝔗(Δ)𝔗(Γ)f^{*}:\mathfrak{T}(\Delta)\to\mathfrak{T}(\Gamma) representing the application of the substitution ff, such that the assignment of functors ff^{*} preserves identities and composites of substitutions up to coherent natural isomorphism.

  4. (4)

    For each Γ\Gamma\in\mathfrak{C}, a context extension functor Γ:𝔗(Γ)\Gamma_{\bullet}:\mathfrak{T}(\Gamma)\to\mathfrak{C} mapping each type SS to the context Γ(S)\Gamma_{\bullet}(S), to be thought of as Γ\Gamma extended with a fresh variable of type SS.

  5. (5)

    For each substitution f:ΓΔf:\Gamma\xrightarrow[]{}\Delta\in\mathfrak{C}, a natural transformation ff_{\bullet} with components f(S):Γ(f(S))Δ(S)f_{\bullet}(S):\Gamma_{\bullet}(f^{*}(S))\xrightarrow[]{}\Delta_{\bullet}(S)\in\mathfrak{C} for all S𝔗(Δ)S\in\mathfrak{T}(\Delta), which – roughly speaking – applies ff to turn Γ\Gamma under an extension of Γ\Gamma substituted over ff. We moreover require that the assignment of natural transformations ff_{\bullet} preserves identities and composites modulo the natural isomorphisms described above in item 3.

  6. (6)

    For each context Γ\Gamma\in\mathfrak{C}, a natural transformation πΓ\pi_{\Gamma} with components πΓS:Γ(S)Γ\pi_{\Gamma}^{S}:\Gamma_{\bullet}(S)\xrightarrow[]{}\Gamma\in\mathfrak{C} for each S𝔗(Γ)S\in\mathfrak{T}(\Gamma), to be thought of as projecting out Γ\Gamma from an extension of Γ\Gamma, such that for each substitution f:ΓΔf:\Gamma\xrightarrow[]{}\Delta\in\mathfrak{C} and type S𝔗(Δ)S\in\mathfrak{T}(\Delta), the following square is a pullback:

    Γ(f(S)){{\Gamma_{\bullet}(f^{*}(S))}}Δ(S){{\Delta_{\bullet}(S)}}Γ{\small\Gamma}Δ{{\Delta}}f(S)\scriptstyle{f_{\bullet}(S)}πΓ\scriptstyle{\pi_{\Gamma}}f\scriptstyle{f}πΔ\scriptstyle{\pi_{\Delta}}\scriptstyle{\lrcorner}

A reader familiar with other categorical models of type theory, e.g. categories with families, may puzzle over the fact that our presentation involves interpreting terms as morphisms f:ST𝔗(Γ)f:S\xrightarrow[]{}T\in\mathfrak{T}(\Gamma), parameterized by both the context Γ\Gamma and an additional type SS. In fact, this extra parameterization is crucial for generalizing the semantics to substructural dependent types and effectively separates the ”type-level” and ”term-level” aspects of contexts.

In a comprehension category, the projection maps πΓS\pi_{\Gamma}^{S} induce ”term-level weakening,” whereby we may discard the extended part of a context. Substituting along these projection maps yields corresponding “type-level weakening” functors ωΓS:𝔗(Γ)𝔗(Γ(S))\omega_{\Gamma}^{S}:\mathfrak{T}(\Gamma)\to\mathfrak{T}(\Gamma_{\bullet}(S)), which play a key role in defining additional type-theoretic structure on comprehension categories, specifically:

Definition 2.2

A comprehension category has Dependent Sums:

  1. (1)

    if for each context Γ\Gamma\in\mathfrak{C} and type S𝔗(Γ)S\in\mathfrak{T}(\Gamma), the weakening functor ωΓS\omega_{\Gamma}^{S} has a left adjoint ΣS:𝔗(Γ(S))𝔗(S)\Sigma_{S}:\mathfrak{T}(\Gamma_{\bullet}(S))\to\mathfrak{T}(S), i.e. there is a natural bijection of homsets:

    Hom𝔗(Γ(S))(T,ωΓS(R))Hom𝔗(Γ)(ΣS(T),R)\text{Hom}_{\mathfrak{T}(\Gamma_{\bullet}(S))}(T,\omega_{\Gamma}^{S}(R))\cong\text{Hom}_{\mathfrak{T}(\Gamma)}(\Sigma_{S}(T),R)
  2. (2)

    and if the functors ΣS\Sigma_{S} satisfy the Beck-Chevalley condition, which essentially states that for any f:ΓΔ{f:\Gamma\to\Delta\in\mathfrak{C}} along with S𝔗(Δ)S\in\mathfrak{T}(\Delta) and T𝔗(Δ(S))T\in\mathfrak{T}(\Delta_{\bullet}(S)), there is a canonical isomorphism f(ΣS(T))Σf(S)(f(S)(T))f^{*}(\Sigma_{S}(T))\simeq\Sigma_{f^{*}(S)}(f_{\bullet}(S)^{*}(T)).

A comprehension category with dependent sums as above moreover has strong sums if the canonical substitution

(Γ(S))(T)Γ(ΣS(T))(\Gamma_{\bullet}(S))_{\bullet}(T)\xrightarrow[]{}\Gamma_{\bullet}(\Sigma_{S}(T))\in\mathfrak{C}

is an isomorphism for all Γ\Gamma\in\mathfrak{C} with S𝔗(Γ)S\in\mathfrak{T}(\Gamma) and T𝔗(Γ(S))T\in\mathfrak{T}(\Gamma_{\bullet}(S)).

From the first item in the above definition, one may deduce the usual rules for weak sum types – and if the comprehension category has strong sums, one may likewise deduce the usual rules for strong sum types. The second item – the Beck-Chevalley condition – is necessary for substitution to behave as expected when substituting into dependent sums, i.e. that substituting into a dependent sum yields a dependent sum. More generally, such compositionality of substitution ought to be required of any additional type-theoretic structure we impose upon a comprehension category.

Dependent products (i.e. dependent function types) in a comprehension category are similarly defined as right-adjoints to type-level weakening that satisfy an analogous Beck-Chevalley condition. There is also a notion of unit types in a comprehension category:

Definition 2.3

A comprehension category has unit types if, for each context Γ\Gamma\in\mathfrak{C}, the category 𝔗(Γ)\mathfrak{T}(\Gamma) has a terminal object Γ\top_{\Gamma}, and the substitution functors preserve terminal objects. These unit types are strong if the projection πΓ:Γ(Γ)Γ\pi_{\Gamma}:\Gamma_{\bullet}(\top_{\Gamma})\xrightarrow[]{}\Gamma\in\mathfrak{C} is an isomorphism for all contexts Γ\Gamma\in\mathfrak{C}.

In all of the above cases, we establish type-theoretic structure in comprehension categories by way of certain universal properties. This is evident even in the definition of a comprehension category itself, where context extension gains a universal property through projection maps forming pullback squares with substitutions. This aligns with the intuitionistic nature of ordinary dependent type theory. By way of analogy, context extension in the intuitionistic theory of simple types is given the universal property of a product. One then obtains models for linear logic & linear type theory – i.e. (closed, symmetric) monoidal categories – by replacing the universal property of context extension with the structure of a monoidal product that is unital and associative up to coherent isomorphism.

To obtain models of substructural dependent type theory, we may try replacing the universal property of context extension in comprehension categories with appropriately unital and associative structure. However, a challenge arises in stating unitality and associativity for contexts, since context extension builds up contexts one element at a time. A primitive semantic notion of partial context or telescope (debruijn, de ̵91) is seemingly needed to break up contexts for stating associativity. In ordinary models of dependent type theory, the role of such partial contexts is effectively played by strong sums – the condition for strong sums given in Def. 2.2 can be seen as implicitly capturing a kind of associativity between dependent sums and context extension. This suggests that the proper semantic setting for substructural dependent type theory ought to be a generalization of comprehension categories with strong sums (and strong unit types) wherein the universal properties of both context extension and the dependent pair/unit types are discarded in favor of structure witnessing their mutual associativity and unitality. Such categorical structures, which I call left-fibred double categories (LFDCs), shall be my object of study for the remainder of this section.

2.2. Left-Fibred Double Categories

Definition 2.4

An LFDC consists of the same data as items 1-5 of Def. 2.1, along with the following:

  1. (1)

    For each context Γ\Gamma\in\mathfrak{C} and type S𝔗(Γ)S\in\mathfrak{T}(\Gamma), a dependent pair type functor S:𝔗(Γ(S))𝔗(Γ){\oplus_{S}:\mathfrak{T}(\Gamma_{\bullet}(S))\to\mathfrak{T}(\Gamma)}.

  2. (2)

    For each substitution f:ΓΔf:\Gamma\to\Delta\in\mathfrak{C} and each term g:f(S)S𝔗(Γ)g:f^{*}(S)\xrightarrow[]{}S^{\prime}\in\mathfrak{T}(\Gamma), a natural transformation g,\langle g,-\rangle with components f(S)(Γ(g)(T))S(T)\oplus_{f^{*}(S)}(\Gamma_{\bullet}(g)^{*}(T))\to\oplus_{S^{\prime}}(T).

  3. (3)

    For each context Γ\Gamma\in\mathfrak{C}, an unit type object 𝟙Γ𝔗(Γ)\mathbbm{1}_{\Gamma}\in\mathfrak{T}(\Gamma).

  4. (4)

    Natural isomorphisms η,ρ,,α,β,γ,δ\eta,\rho,\ell,\alpha,\beta,\gamma,\delta with components:

    1. (a)

      ηΓ:Γ(𝟙Γ)Γ\eta_{\Gamma}:\Gamma_{\bullet}(\mathbbm{1}_{\Gamma})\simeq\Gamma for all Γ\Gamma\in\mathfrak{C}

    2. (b)

      ρΓ,S:S(𝟙Γ(S))S\rho_{\Gamma,S}:\oplus_{S}(\mathbbm{1}_{\Gamma_{\bullet}(S)})\simeq S for all Γ\Gamma\in\mathfrak{C} and S𝔗(Γ)S\in\mathfrak{T}(\Gamma)

    3. (c)

      Γ,S:𝟙Γ(ηΓ(S))S\ell_{\Gamma,S}:\oplus_{\mathbbm{1}_{\Gamma}}(\eta_{\Gamma}^{*}(S))\simeq S for all Γ\Gamma\in\mathfrak{C} and S𝔗(Γ)S\in\mathfrak{T}(\Gamma)

    4. (d)

      αΓ,S,T:Γ(S(T))(Γ(S))(T)\alpha_{\Gamma,S,T}:\Gamma_{\bullet}(\oplus_{S}(T))\simeq(\Gamma_{\bullet}(S))_{\bullet}(T) for all Γ\Gamma\in\mathfrak{C} together with S𝔗(Γ)S\in\mathfrak{T}(\Gamma) and T𝔗(Γ(S))T\in\mathfrak{T}(\Gamma_{\bullet}(S))

    5. (e)

      βΓ,S,T,R:S(T(R))S(T)(αΓ,S,T(R))\beta_{\Gamma,S,T,R}:\oplus_{S}(\oplus_{T}(R))\simeq\oplus_{\oplus_{S}(T)}(\alpha_{\Gamma,S,T}^{*}(R)) for all
      Γ,S𝔗(Γ)\Gamma\in\mathfrak{C},~{}S\in\mathfrak{T}(\Gamma) with T𝔗(Γ(S))T\in\mathfrak{T}(\Gamma_{\bullet}(S)) and R𝔗((Γ(S))T)R\in\mathfrak{T}((\Gamma_{\bullet}(S))_{\bullet}T)

    6. (f)

      γΓ,Δ,f,S,T:f(S(T))f(S)(f(S)(T))\gamma_{\Gamma,\Delta,f,S,T}:f^{*}(\oplus_{S}(T))\simeq\oplus_{f^{*}(S)}(f_{\bullet}(S)^{*}(T)) for all Γ,Δ\Gamma,\Delta\in\mathfrak{C} with f:ΓΔ{f:\Gamma\xrightarrow[]{}\Delta}\in\mathfrak{C} and S𝔗(Δ)S\in\mathfrak{T}(\Delta) and T𝔗(Δ(S))T\in\mathfrak{T}(\Delta_{\bullet}(S)) (Beck-Chevalley for pair types)

    7. (g)

      δΓ,Δ,f:f(𝟙Δ)𝟙Γ\delta_{\Gamma,\Delta,f}:f^{*}(\mathbbm{1}_{\Delta})\simeq\mathbbm{1}_{\Gamma} for all Γ,Δ\Gamma,\Delta\in\mathfrak{C} with f:ΓΔ{f:\Gamma\xrightarrow[]{}\Delta}\in\mathfrak{C} (Beck-Chevalley for unit types)

    subject to certain coherence laws.

The above definition, up to and including item 4(e), is equivalently described as a pseudomonad in a certain tricategory (specifically the tricategory whose objects are categories and whose 1-cells are spans of categories with one leg a fibration). This alternative definition makes clear that the above structure is a kind of double category, with the property that its domain projection functor is a fibration, whence the name left-fibred double category.

I am aware of only one place in the category-theoretic literature where structures such as these have been studied before, which is in recent work by David Jaz Myers & Matteo Cappucci (cappucci-myers, MC22), as part of the two authors’ work on Categorical Systems Theory, wherein they refer to such structures as “dependent actegories.” Suffice it to say that, to my knowledge, the use of LFDCs as models of type theory is novel to this paper.

Definition 2.5

One additional piece of type-theoretic structure that has so-far been missing from the above exposition of LFDCs is some notion of empty context from which to build other contexts. To this end, we have the following: a unit context in an LFDC is a context ϵ\epsilon\in\mathfrak{C} such that the context extension functor ϵ{\epsilon_{\bullet}} is an equivalence of categories between 𝔗(ϵ)\mathfrak{T}(\epsilon) and \mathfrak{C}. We think of types T𝔗(ϵ)T\in\mathfrak{T}(\epsilon) as closed types, such that contexts and closed types may be treated interchangeably. Hence we shall hereafter restrict our attention mainly to LFDCs equipped with a choice of unit context.

Example 2.0

Any comprehension category with strong sums and strong unit types is inherently an LFDC, making all models of ordinary dependent type theory naturally LFDCs. Specifically, any intuitionistic dependent type theory with strong sum types and a unit type can be straightforwardly transformed into a comprehension category (the syntactic category of the type theory) with strong sums/unit types (hence an LFDC) by quotienting terms up to α\alpha-equivalence of βη\beta\eta-normal forms, and defining substitution, dependent pair types, etc., as their syntactic counterparts.

Example 2.0

The LFDC concept also encompasses categorical models of linear/ordered logic, specifically monoidal categories. In this context, a monoidal category \mathcal{M} with monoidal product :×\otimes:\mathcal{M}\times\mathcal{M}\to\mathcal{M} and unit II\in\mathcal{M} is interpreted both as the category of contexts and as the category of types for each context Γ\Gamma\in\mathcal{M}. The substitution functors are then simply the identity on \mathcal{M}, and Γ(S)\Gamma_{\bullet}(S) and S(T)\oplus_{S}(T) are interpreted as ΓS\Gamma\otimes S and STS\otimes T, respectively, with unit types interpreted as II.

Observe that in an LFDC based on a monoidal category \mathcal{M}, a term t:ST𝔗(Γ)t:S\xrightarrow[]{}T\in\mathfrak{T}(\Gamma) only trivially depends upon Γ\Gamma, since substitution into Γ\Gamma is given by the identity, while substituting into the term-level context SS involves potentially non-trivial composition of morphisms in \mathcal{M}. LFDCs arising from monoidal categories thus exhibit non-trivial substructural properties, but trivial type dependency, whereas LFDCs arising from comprehension categories exhibit non-trivial type dependency, but trivial substructural properties. As an example of an LFDC with both non-trivial type-dependency and substructural behavior, we have the following:

Example 2.0

The category of linearly ordered sets (with either strictly or weakly order-preserving maps as morphisms) is naturally regarded as an LFDC, by interpreting both context extension and dependent pair types as the lexicographic sum of linear orders. A type in context (Γ,<Γ)(\Gamma,<_{\Gamma}) is defined as a family of linear orders {(Sx,<x)}xΓ\{(S_{x},<x)\}_{x\in\Gamma} indexed by the set Γ\Gamma. Given such a family of linear orders, we define the context extension (Γ,<Γ)({(Sx,<x)}xΓ)(\Gamma,<_{\Gamma})_{\bullet}(\{(S_{x},<_{x})\}_{x\in\Gamma}) as the lexicographic sum of the family, i.e. the set {(x,s)xΓ,sSx}\{(x,s)\mid x\in\Gamma,s\in S_{x}\} ordered such that (x,s)<(x,s)(x,s)<(x^{\prime},s^{\prime}) iff either x<Γxx<_{\Gamma}x^{\prime} or x=xx=x^{\prime} and s<xss<_{x}s^{\prime}. We define the dependent pair type similarly as a family of lexicographic sums, indexed by the underlying set of its context.

This example straightforwardly exhibits both non-trivial type dependency and substructutral properties – on the one hand, any family of linear orders indexed by the underlying set of another linear order counts as a dependent type in this setting, while on the other hand, the lexicographic product, which is an instance of the lexicographic sum over a constant family of linear orders, is notably non-symmetric, and so is distinct from the ordinary product of intuitionistic type theory.

Although the above argument is intuitively clear, we do not yet possess the appropriate structure on LFDCs to phrase such arguments in the internal language of LFDCs themselves – e.g. we defined the lexicographic product of linear orders as the lexicographic sum over a constant family, i.e. a family not dependent upon its context; As it stands, the basic definition of LFDC given above poses no criterion for when a type may be considered independent from (part of) its context. If we examine the above-given examples, we find that they all admit such a notion of independence or type-level weakening. It thus seems appropriate to augment the definition of an LFDC with such a notion of type-level weakening, which is in fact critical to defining further type-theoretic structure on LFDCs.

2.3. Type-Level Weakening

Definition 2.6

An LFDC has type-level weakening if it is additionally equipped with:

  1. (1)

    A functor ωΓS:𝔗(Γ)𝔗(Γ(S))\omega_{\Gamma}^{S}:\mathfrak{T}(\Gamma)\to\mathfrak{T}(\Gamma_{\bullet}(S)) for each context Γ\Gamma\in\mathfrak{C} and type S𝔗(Γ)S\in\mathfrak{T}(\Gamma)

  2. (2)

    A functor ΩΓS,T:𝔗(ΓT)𝔗((ΓS)ωΓS(T))\Omega_{\Gamma}^{S,T}:\mathfrak{T}(\Gamma_{\bullet}T)\to\mathfrak{T}((\Gamma_{\bullet}S)_{\bullet}\omega_{\Gamma}^{S}(T)) for each context Γ\Gamma\in\mathfrak{C} and types S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma)

  3. (3)

    Subject to certain natural isomorphisms and coherence laws thereupon that ensure the compatibility of the above-given functors with each other and with the structure of the ambient LFDC. In particular, there are natural isomorphisms ζ\zeta and θ\theta with components:

    • ζf,g,T:Γ(g)(ωΓS(T))ωΓf(S)(T)\zeta_{f,g,T}:\Gamma_{\bullet}(g)^{*}(\omega_{\Gamma}^{S^{\prime}}(T))\simeq\omega^{f^{*}(S)}_{\Gamma}(T)

    • θf,g,T,R:Γ(g)(ωΓS(T))(ΩΓS,T(R))ζf,g,T(ΩΓf(S),T(R))\theta_{f,g,T,R}:\Gamma_{\bullet}(g)_{\bullet}(\omega_{\Gamma}^{S^{\prime}}(T))^{*}(\Omega_{\Gamma}^{S^{\prime},T}(R))\simeq\zeta_{f,g,T}^{*}(\Omega_{\Gamma}^{f^{*}(S),T}(R))

    for all Γ,Δ\Gamma,\Delta\in\mathfrak{C} with f:ΓΔf:\Gamma\to\Delta\in\mathfrak{C} and S,T,R𝔗(Γ)S^{\prime},T,R\in\mathfrak{T}(\Gamma) and S𝔗(Δ)S\in\mathfrak{T}(\Delta) along with g:f(S)S𝔗(Γ)g:f^{*}(S)\xrightarrow[]{}S^{\prime}\in\mathfrak{T}(\Gamma). These isomorphisms effectively witness that a weakened type does not depend upon the type added to its context by weakening. We also require natural isomorphisms ξ,χ\xi,\chi with components

    • ξΓ,S:ωΓS(𝟙Γ)𝟙Γ(S)\xi_{\Gamma,S}:\omega_{\Gamma}^{S}(\mathbbm{1}_{\Gamma})\simeq\mathbbm{1}_{\Gamma_{\bullet}(S)}

    • χΓ,S,T,R:ωΓS(T(R))ωΓS(T)(ΩΓS,T(R))\chi_{\Gamma,S,T,R}:\omega_{\Gamma}^{S}(\oplus_{T}(R))\simeq\oplus_{\omega_{\Gamma}^{S}(T)}(\Omega_{\Gamma}^{S,T}(R))

    for all Γ\Gamma\in\mathfrak{C} with S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma) and R𝔗(Γ(T))R\in\mathfrak{T}(\Gamma_{\bullet}(T)). These isomorphisms ensure that weakening behaves as we would expect with regard to the type formers available in the ambient LFDC, i.e. the weakening of a unit type is itself (up to isomorphism) a unit type, and likewise for dependent pair types. When positing additional type formers for an LFDC with type-level weakening, we shall therefore generally require these to come equipped with analogous natural isomorphisms to ensure their compatibility with the type-level weakening structure, along with the usual Beck-Chevalley isomorphisms.

Analogous to the definition of the lexicographic product as the lexicographic sum of a constant family of linear orders, we then have the following in any LFDC with type-level weakening:

Definition 2.7

In an LFDC with type-level weakening, each category of types 𝔗(Γ)\mathfrak{T}(\Gamma) for each context Γ\Gamma is naturally equipped with the structure of a monoidal category whose unit object is 𝟙Γ\mathbbm{1}_{\Gamma}, where the monoidal product SΓTS\otimes_{\Gamma}T of S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma) is defined as the dependent pair type S(ωΓS(T))\oplus_{S}(\omega_{\Gamma}^{S}(T)).

Given type-level weakening functors and the associated monoidal products on an LFDC, it becomes straightforward to define function types as suitable right adjoints to these. Since LFDCs distinguish type-level and term-level contexts, we should expect there to correspondingly be notions of both term-level and type-level function types in an LFDC. We thus have the following definitions:

Definition 2.8

An LFDC with type-level weakening has term-level function types if for each context Γ\Gamma\in\mathfrak{C} with S𝔗(Γ)S\in\mathfrak{T}(\Gamma), the functors ΓS-\otimes_{\Gamma}S and SΓS\otimes_{\Gamma}- have right adjoints S\sslash_{S} and S\bbslash_{S}, respectively, with the associated natural bijections of homsets:

Γ,S,T,R:Hom𝔗(Γ)(RS,T)Hom𝔗(Γ)(R,S(T))\small\sslash_{\Gamma,S,T,R}:\text{Hom}_{\mathfrak{T}(\Gamma)}(R\otimes S,T)\cong\text{Hom}_{\mathfrak{T}(\Gamma)}(R,\sslash_{S}(T))
Γ,S,T,R:Hom𝔗(Γ)(SR,T)Hom𝔗(Γ)(R,S(T))\bbslash_{\Gamma,S,T,R}:\text{Hom}_{\mathfrak{T}(\Gamma)}(S\otimes R,T)\cong\text{Hom}_{\mathfrak{T}(\Gamma)}(R,\bbslash_{S}(T))

We additionally require the functors S\sslash_{S} and S\bbslash_{S} to satisfy a Beck-Chevalley condition and compatibility with type-level weakening in the form of canonical isomorphisms

f(S(T))f(S)(f(T))f(S(T))f(S)(f(T))f^{*}(\sslash_{S}(T))\simeq\sslash_{f^{*}(S)}(f^{*}(T))\quad f^{*}(\bbslash_{S}(T))\simeq\bbslash_{f^{*}(S)}(f^{*}(T))
ωΓR(S(T))ωΓR(S)(ωΓR(T))ωΓR(S(T))ωΓR(S)(ωΓR(T))\omega_{\Gamma}^{R}(\sslash_{S}(T))\simeq\sslash_{\omega_{\Gamma}^{R}(S)}(\omega_{\Gamma}^{R}(T))\quad\omega_{\Gamma}^{R}(\bbslash_{S}(T))\simeq\bbslash_{\omega_{\Gamma}^{R}(S)}(\omega_{\Gamma}^{R}(T))

etc.

Definition 2.9

an LFDC with type-level weakening has type-level function types if for each context Γ\Gamma\in\mathfrak{C} with S𝔗(Γ)S\in\mathfrak{T}(\Gamma), the weakening functor ωΓS:𝔗(Γ)𝔗(Γ(S))\omega_{\Gamma}^{S}:\mathfrak{T}(\Gamma)\to\mathfrak{T}(\Gamma_{\bullet}(S)) has a right adjoint S\forall_{S}, with corresponding natural bijection of homsets

ΛΓ,S,T,R:Hom𝔗(Γ(S))(ωΓS(R),T)Hom𝔗(Γ)(R,S(T))\Lambda_{\Gamma,S,T,R}:\text{Hom}_{\mathfrak{T}(\Gamma_{\bullet}(S))}(\omega_{\Gamma}^{S}(R),T)\cong\text{Hom}_{\mathfrak{T}(\Gamma)}(R,\forall_{S}(T))

As in the above definition, we also require the functors S\forall_{S} to be compatible with substitution and type-level weakening in that there are canonical isomorphisms

f(S(T))f(S)(f(S)(T))ωΓR(S(T))ωΓR(S)(ΩΓR,S(T))f^{*}(\forall_{S}(T))\simeq\forall_{f^{*}(S)}(f_{\bullet}(S)^{*}(T))\quad\omega_{\Gamma}^{R}(\forall_{S}(T))\simeq\forall_{\omega_{\Gamma}^{R}(S)}(\Omega_{\Gamma}^{R,S}(T))

and so on. In an LFDC with a unit context ϵ\epsilon and both term-level and type-level function types, “open” terms ST𝔗(Γ)S\xrightarrow[]{}T\in\mathfrak{T}(\Gamma) are equivalent to closed terms of type 𝟙ϵ𝔗(ϵ)ϵ1(Γ)(S(T))\mathbbm{1}_{\epsilon}\to_{\mathfrak{T}(\epsilon)}\forall_{\epsilon_{\bullet}^{-1}(\Gamma)}(\sslash_{S}(T)) (where ϵ1\epsilon_{\bullet}^{-1} is the inverse to context extension by ϵ\epsilon). Such LFDCs thus fully internalize their logic of term formation.

Moving on to structural properties of LFDCs with type-level weakening, among the most important of these is exchange, which allows permuting independent variables in contexts. Having defined the monoidal structure on types arising from type-level weakening, we are now in a position to state this property for LFDCs in general:

Definition 2.10

an LFDC with type-level weakening has exchange if the monoidal structure defined on each category of types 𝔗(Γ)\mathfrak{T}(\Gamma) in Def. 2.7 additionally carries the structure of a symmetric monoidal category, i.e. a natural isomorphism σ\sigma with components

σΓ,S,T:SΓTTΓS\sigma_{\Gamma,S,T}:S\varotimes_{\Gamma}T\simeq T\varotimes_{\Gamma}S

for all S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma), subject to certain coherence conditions.

Beyond exchange, there is also term-level weakening, which allows discarding variables in the term-level context. This property may be defined for any LFDC, with or without type-level weakening, and in fact equips the LFDC with a natural form of type-level weakening.

Definition 2.11

An LFDC has term-level weakening if for each context Γ\Gamma, the type 𝟙Γ\mathbbm{1}_{\Gamma} is a terminal object in the category 𝔗(Γ)\mathfrak{T}(\Gamma). For any context Γ\Gamma, write S:S𝟙Γ𝔗(Γ)\top_{S}:S\xrightarrow[]{}\mathbbm{1}_{\Gamma}\in\mathfrak{T}(\Gamma) for the unique morphism from any type S𝔗(Γ)S\in\mathfrak{T}(\Gamma) to 𝟙Γ\mathbbm{1}_{\Gamma}.

Any LFDC with term-level weakening is naturally equpped with type-level weakening, given by substitution along terminal morphisms. Specifically, given a context Γ\Gamma\in\mathfrak{C} and types S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma) and R𝔗(Γ(T))R\in\mathfrak{T}(\Gamma_{\bullet}(T)), we may define

ωΓS(T)=Γ(S)(ηΓ(T))\omega_{\Gamma}^{S}(T)=\Gamma_{\bullet}(\top_{S})^{*}(\eta_{\Gamma}^{*}(T))

and

ΩΓS,T(R)=(α1)(Γ(S,)(Γ,T(R)))\Omega_{\Gamma}^{S,T}(R)=(\alpha^{-1})^{*}(\Gamma_{\bullet}(\langle\top_{S},-\rangle)^{*}(\ell_{\Gamma,T}^{*}(R)))

We may likewise define the following projection maps:

S(T)S(T)S(𝟙Γ(S))ρΓ,SS\varoplus_{S}(T)\xrightarrow{\varoplus_{S}(\top_{T})}\varoplus_{S}(\mathbbm{1}_{\Gamma_{\bullet}(S)})\xrightarrow{\rho_{\Gamma,S}}S
S(ωΓS(T))S,𝟙Γ(ηΓ(T))Γ,TT\varoplus_{S}(\omega_{\Gamma}^{S}(T))\xrightarrow{\langle\top_{S},-\rangle}\varoplus_{\mathbbm{1}_{\Gamma}}(\eta^{*}_{\Gamma}(T))\xrightarrow{\ell_{\Gamma,T}}T

where ωΓS(T)\omega_{\Gamma}^{S}(T) is as defined above. The latter projection induces a family of natural transformations

Hom𝔗(Γ(S))(T,ωΓS(R))Hom𝔗(Γ)(S(T),R)\text{Hom}_{\mathfrak{T}(\Gamma_{\bullet}(S))}(T,\omega_{\Gamma}^{S}(R))\to\text{Hom}_{\mathfrak{T}(\Gamma)}(\varoplus_{S}(T),R)

by mapping f:TωΓS(R)𝔗(Γ(S))f:T\to\omega_{\Gamma}^{S}(R)\in\mathfrak{T}(\Gamma_{\bullet}(S)) to the composite

S(T)S(f)S(ωΓS(R))S,𝟙Γ(ηΓ(R))Γ,RR\varoplus_{S}(T)\xrightarrow{\varoplus_{S}(f)}\varoplus_{S}(\omega_{\Gamma}^{S}(R))\xrightarrow{\langle\top_{S},-\rangle}\varoplus_{\mathbbm{1}_{\Gamma}}(\eta_{\Gamma}^{*}(R))\xrightarrow{\ell_{\Gamma,R}}R

In this sense, type-level weakening in such an LFDC is “halfway” to forming an adjunction with the dependent pair type. This motivates the following definition of contraction in an LFDC with type-level weakening as forming the other half of such an adjunction.

Definition 2.12

An LFDC with type-level weakening has contraction if there is a natural transformation of homsets:

Hom𝔗(Γ)(S(T),R)Hom𝔗(Γ(S))(T,ωΓS(R))\text{Hom}_{\mathfrak{T}(\Gamma)}(\varoplus_{S}(T),R)\to\text{Hom}_{\mathfrak{T}(\Gamma_{\bullet}(S))}(T,\omega_{\Gamma}^{S}(R))

for all contexts Γ\Gamma\in\mathfrak{C} and types S,R𝔗(Γ)S,R\in\mathfrak{T}(\Gamma) and T𝔗(Γ(S))T\in\mathfrak{T}(\Gamma_{\bullet}(S)), that is suitably compatible with the structure of the LFDC.

By a Yoneda-style argument, the above is equivalent to the existence of a natural family of morphisms

𝔡Γ,S:𝟙Γ(S)ωΓS(S)𝔗(Γ(S))\mathfrak{d}_{\Gamma,S}:\mathbbm{1}_{\Gamma_{\bullet}(S)}\xrightarrow[]{}\omega_{\Gamma}^{S}(S)\in\mathfrak{T}(\Gamma_{\bullet}(S))

for all contexts Γ\Gamma\in\mathfrak{C} with S𝔗(Γ)S\in\mathfrak{T}(\Gamma), suitably compatible with the LFDC structure. In this sense, contraction allows for the term-level use of type-level variables. This makes sense if we think of type-level contexts in LFDCs as consisting of variables that are treated as already having been used elsewhere.

It follows that in an LFDC with contraction, for each context Γ\Gamma\in\mathfrak{C}, there is a natural transformation Δ\Delta with components ΔS:SSΓS𝔗(Γ)\Delta_{S}:S\xrightarrow[]{}S\otimes_{\Gamma}S\in\mathfrak{T}(\Gamma) for all types S𝔗(Γ)S\in\mathfrak{T}(\Gamma), defined as follows:

SρΓ,S1S(𝟙Γ(S))S(𝔡Γ(S),S)S(ωΓS(S))=SΓSS\xrightarrow{\rho_{\Gamma,S}^{-1}}\varoplus_{S}(\mathbbm{1}_{\Gamma_{\bullet}(S)})\xrightarrow{\varoplus_{S}(\mathfrak{d}_{\Gamma_{\bullet}(S),S})}\varoplus_{S}(\omega_{\Gamma}^{S}(S))=S\otimes_{\Gamma}S

If we think of ΔS\Delta_{S} as duplicating its input, then this suffices to show that the above-defined notion of contraction for LFDCs gives rise to the usual notion of contraction as copying of variables.

We may then define a Cartesian LFDC as one which has both term-level weakening and contraction in a compatible way, specifically:

Definition 2.13

An LFDC is Cartesian if 1) it has term-level weakening, and 2) the natural transformations of homsets defined in Def. 2.11 are all invertible, i.e. the type-level weakening functors ωΓS\omega_{\Gamma}^{S} are right-adjoint to the dependent pair type functors S\varoplus_{S}.

Moreover, any Cartesian LFDC is naturally equipped with exchange, since for any context Γ\Gamma\in\mathfrak{C} and types S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma), we may define a morphism σ:SΓTTΓS\sigma:S\otimes_{\Gamma}T\to T\otimes_{\Gamma}S as follows:

SΓTΔST(ST)(ST)(ST)(ST)(𝟙ΓT)(S𝟙Γ)TSS\otimes_{\Gamma}T\xrightarrow{\Delta_{S\otimes T}}\begin{array}[]{c}(S\otimes T)\\ \otimes\\ (S\otimes T)\end{array}\xrightarrow{(\top_{S}\otimes T)\otimes(S\otimes\top_{T})}\begin{array}[]{c}(\mathbbm{1}_{\Gamma}\otimes T)\\ \otimes\\ (S\otimes\mathbbm{1}_{\Gamma})\end{array}\simeq T\otimes S

where Δ\Delta is as defined in Def. 2.12. One then checks that σ\sigma is an isomorphism satisfying all the properties given in Def. 2.10.

More generally, the monoidal product Γ\otimes_{\Gamma} on each category of types 𝔗(Γ)\mathfrak{T}(\Gamma) in a Cartesian LFDC satisfies the universal property of a product. Even if the given LFDC is not Cartesian, it may have such products in its type-theoretic structure, without these necessarily coinciding with the monoidal product, as follows:

Definition 2.14

An LFDC has product types if:

  1. (1)

    For each Γ\Gamma\in\mathfrak{C}, there is a functor ×Γ:𝔗(Γ)×𝔗(Γ)𝔗(Γ)\times_{\Gamma}:\mathfrak{T}(\Gamma)\times\mathfrak{T}(\Gamma)\to\mathfrak{T}(\Gamma) together with natural transformations π1,π2\pi_{1},\pi_{2} with components π1S,T:S×ΓTS\pi_{1}^{S,T}:S\times_{\Gamma}T\to S and π2S,T:S×ΓTT\pi_{2}^{S,T}:S\times_{\Gamma}T\to T, such that for all types S,T,R𝔗(Γ)S,T,R\in\mathfrak{T}(\Gamma) with morphisms f:RS𝔗(Γ)f:R\xrightarrow[]{}S\in\mathfrak{T}(\Gamma) and g:RT𝔗(Γ)g:R\xrightarrow[]{}T\in\mathfrak{T}(\Gamma), there exists a unique morphism (f,g):RS×ΓT𝔗(Γ)(f,g):R\xrightarrow[]{}S\times_{\Gamma}T\in\mathfrak{T}(\Gamma) which factors ff and gg through π1S,T\pi_{1}^{S,T} and π2S,T\pi_{2}^{S,T}, respectively.

  2. (2)

    The substitution functors ff^{*} are all finite-product-preserving, and if the LFDC has type-level weakening, then similarly the type-level weakening functors preserve finite products.

We think of the product S×ΓTS\times_{\Gamma}T of two types S,T𝔗(Γ)S,T\in\mathfrak{T}(\Gamma) as offering a choice between an element of SS and an element of TT, while the monoidal product SΓTS\otimes_{\Gamma}T offers two such elements at once.

2.4. Strictness

Concluding the discussion on LFDCs, I now shift my attention to their role as models of type theory in particular. While the class of LFDCs has so far been defined as to include various mathematical examples, this definition is in a sense still too weak. Specifically, we have so far required substitution and type-level weakening to satisfy their requisite identities only up to coherent isomorphism, when from the perspective of type theory, these should hold on the nose. For this purpose, I introduce the following definition:

Definition 2.15

An LFDC is strict if:

  1. (1)

    The assignment of substitution functors ff^{*} strictly preserves identities and composites of substitutions.

  2. (2)

    The Beck-Chevalley isomorphisms γ,δ\gamma,\delta are identities, i.e. substitution strictly preserves unit and dependent pair types.

For LFDCs with type-level weakening, the natural isomorphisms associated with type-level weakening must also be strict. Similarly, substitution and type-level weakening in LFDCs with function types / products must strictly preserve the associated type formers.

Example 2.0

Most of the above-considered examples of LFDCs fail to be strict. However, one significant class of LFDCs manages to meet these requirements, which is the class of syntactic categories of dependent type theory as in Ex. 2.1. Because (type-level) weakening in such models is given by inclusions of terms into extended contexts, and because substitution is essentially computed by applying the prescribed identities, it follows that these models are in fact strict.

3. The Type Theory of LFDCs

What is a type theory? Standardly, one might answer that a type theory is a definition of some syntax along with rules for forming judgments upon this syntax, and perhaps also for computing therewith. As an alternative, I wish to pose the view that a type theory is a system of translation between syntax and semantics. In the ordinary approach to type theory, the computational dynamics form an elementary semantics for the theory, defined e.g. in terms of equivalence classes of terms modulo α\alpha-equivalence of normal forms, etc. Yet this may be generalized – provided we have a procedure for translating well typed terms of the theory into some semantic domain, we need not restrict ourselves to semantics that are so-dependent upon the syntax of the theory itself. Instead, we may define a type theory parameterized by a class of models in which to interpret it, and then search among this class for a model that yields good computational behavior. This allows for a separation of concerns between the design of the syntax of the type theory and the assurance of its computational adequacy. 111This perspective on type theories also generalizes the more modern approach of specifying the syntax and rules of a type theory within a logical framework using higher-order abstract syntax (HOAS). In that case, the semantic domain in which the type theory is interpreted is simply the ambient logical framework itself; although this offers significant advantages over the tradtional approach to the specification of type theories, it is not suitable for our present purposes of defining substructural dependent type theory, since any type theory specified via HOAS in an intuitionistic logical framework will allow for intuitionistic use of variables in type families – precisely what we wish to avoid in general. Hence I have been compelled to seek a suitable abstraction of this approach, which has led me to the above-described perspective on type theories, and the categorical semantics of substructural type theory sketched in the prior section.

Such separation of concerns is particularly useful in the design of dependent type theory. Typically in dependent type theory, checking whether a term belongs to a given type may require performing some amount of computation within the type. Thus, type checking of terms depends upon semantic information about the types. This suggests that, in a typing judgment such as t:Tt:T, the type TT ought to be an object drawn from the semantics of the theory, while the term tt (the subject of the judgment) is a syntactic representation of an inhabitant of TT. The rules for checking such a judgment can then be designed in such a way as to implicitly compute the semantic denotation of tt. This is moreover in line with the discipline of bidirectional type-checking, wherein the judgments of a type theory are conceived not merely as predicates, but as procedures for computing certain information about terms/types. I hence adopt a bidirectional approach to the type theory I present herein, where every judgment computes the semantic denotation of its subject.

Because we have taken care in the previous section to identify the type-theoretic structure of LFDCs (with type-level weakening, function types, etc.), it is largely straightforward to give a type-theoretic syntax for this structure, as I now illustrate.

3.1. Expressions, Denotations, Signatures & Judgments

Definition 3.1

Assume a countably infinite stock of variables – which I shall write as a,b,c,d,w,x,y,za,b,c,d,w,x,y,z – and countably infinite supplies of type family symbols and constant symbols – written P,QP,Q and p,qp,q, respectively. We then have the following grammar of syntactic expressions:

ContextsΓ,Δ,Θ,Φ::=ϵΓ,x:S\begin{array}[]{rclll}\text{Contexts}~{}\Gamma,\Delta,\Theta,\Phi&::=&\epsilon&\mid&\Gamma,x:S\end{array}
TypesS,T,R,U,V::=𝟙x:S.TSTTSx:S.TS×TPs\begin{array}[]{rclllllll}\text{Types}~{}S,T,R,U,V&::=&\mathbbm{1}&\mid&\bigoplus x:S.T\\ &\mid&S\sslash T&\mid&T\bbslash S\\ &\mid&\forall x:S.T&\mid&S\times T&\mid&Ps\end{array}
Introduction Formss,t,r,u,v::=s,tx.tx.tΛx.t(s,t)e¯\begin{array}[]{rclllllll}\text{Introduction Forms}~{}s,t,r,u,v&::=&\langle\rangle&\mid&\langle s,t\rangle\\ &\mid&\sslash x.t&\mid&\bbslash x.t\\ &\mid&\Lambda x.t&\mid&(s,t)&\mid&\underline{e}\end{array}
Elimination Formse,f::=𝗅𝖾𝗍[]R=e𝗂𝗇r𝗅𝖾𝗍[a.RU]=e𝗐𝗂𝗍𝗁w=u𝗂𝗇r𝗅𝖾𝗍[a,b.RU]=e𝗐𝗂𝗍𝗁w=u𝗂𝗇r𝗅𝖾𝗍[a,b,c.RU,V]=e𝗐𝗂𝗍𝗁w=u𝖺𝗇𝖽z=v𝗂𝗇r𝗅𝖾𝗍[a.RU]x,y=e𝗐𝗂𝗍𝗁w=u𝗂𝗇r𝗅𝖾𝗍[a,b,c.RU,V]x,y=e𝗐𝗂𝗍𝗁w=u𝖺𝗇𝖽z=v𝗂𝗇rfssffsπ1(e)π2(e)t:Txp\begin{array}[]{l}\text{Elimination Forms}~{}e,f\\ \begin{array}[]{cl}::=&\mathsf{let}\left[{}_{R}\right]~{}\langle\rangle=e~{}\mathsf{in}~{}r\\ \mid&\mathsf{let}\left[a._{R}^{U}\right]~{}\langle\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{in}~{}r\\ \mid&\mathsf{let}\left[a,b._{R}^{U}\right]~{}\langle\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{in}~{}r\\ \mid&\mathsf{let}\left[a,b,c._{R}^{U,~{}V}\right]~{}\langle\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{and}~{}z=v~{}\mathsf{in}~{}r\\ \mid&\mathsf{let}\left[a._{R}^{U}\right]~{}\langle x,y\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{in}~{}r\\ \mid&\mathsf{let}\left[a,b,c._{R}^{U,~{}V}\right]~{}\langle x,y\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{and}~{}z=v~{}\mathsf{in}~{}r\\ \mid&\begin{array}[]{lllllllll}f\triangleleft s&\mid&s\triangleright f&\mid&f\cdot s&\mid&\pi_{1}(e)&\mid&\pi_{2}(e)\end{array}\\ \mid&\begin{array}[]{llllll}t:T&\mid&x&\mid&p\end{array}\end{array}\end{array}
Definition 3.2

Fix a strict LFDC with type-level weakening, function types, and products. For each syntactic sort of expressions defined above, we then define a corresponding class of denotations:

  • Contexts: the denotation of a context Γ\Gamma is a list Γ\llparenthesis\Gamma\rrparenthesis of type annotations x:Sx:\llbracket S\rrbracket, which is well-formed if each such S\llbracket S\rrbracket is a type in the context corresponding to the list of annotations preceding xx. We then have the following definition of the semantic context Γ\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket represented by Γ\llparenthesis\Gamma\rrparenthesis

    ϵ=ϵΓ,x:S=Γ(S)\llbracket\epsilon\rrbracket=\epsilon\qquad\llbracket\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket\rrbracket=\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket S\rrbracket)

    I write Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis (or ΓΔ\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis when Γ\llparenthesis\Gamma\rrparenthesis is understood to be the type-level context, and Δ\llparenthesis\Delta\rrparenthesis the term-level context), to mean that 1) Γ\llparenthesis\Gamma\rrparenthesis is well-formed, and 2) the concatenation of Δ\llparenthesis\Delta\rrparenthesis onto the right-hand side of Γ\llparenthesis\Gamma\rrparenthesis is also well-formed, and say that Δ\llparenthesis\Delta\rrparenthesis is a telescope for Γ\llparenthesis\Gamma\rrparenthesis. We then have the following recursive definition of the semantic type ΔΓ\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket_{\llparenthesis\Gamma\rrparenthesis} represented by a telescope Δ\llparenthesis\Delta\rrparenthesis for a semantic context Γ\llparenthesis\Gamma\rrparenthesis:

    ϵΓ=𝟙Γx:S,ΔΓ=S(ΔΓ,x:S)\qquad\llbracket\epsilon\rrbracket_{\llparenthesis\Gamma\rrparenthesis}=\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\quad\llbracket x:\llbracket S\rrbracket,\llparenthesis\Delta\rrparenthesis\rrbracket_{\llparenthesis\Gamma\rrparenthesis}=\varoplus_{\llbracket S\rrbracket}(\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket})
  • Types: given a semantic context Γ\llparenthesis\Gamma\rrparenthesis, the denotation of a type SS wrt Γ\llparenthesis\Gamma\rrparenthesis is defined as an object SΓ𝔗(Γ)\llbracket S\rrbracket_{\llparenthesis\Gamma\rrparenthesis}\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket).

  • Introduction & Elimination Forms: given a semantic context Γ\llparenthesis\Gamma\rrparenthesis and a telescope ΓΔ\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis together with a semantic type SΓ\llbracket S\rrbracket_{\llparenthesis\Gamma\rrparenthesis}, the denotation of an introduction/elimination form ϝ\digamma wrt ΓΔ\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis and SΓ\llbracket S\rrbracket_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket} is defined as a morphism ϝSΓΔ:ΔΓSΓ𝔗(Γ)\llbracket\digamma\rrbracket^{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis}_{\llbracket S\rrbracket}:\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket_{\llparenthesis\Gamma\rrparenthesis}\xrightarrow[]{}\llbracket S\rrbracket_{\llparenthesis\Gamma\rrparenthesis}\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket).

Definition 3.3

In order to capture structure of the LFDC in which the type theory is interpreted, we allow for the type theory to additionally be parameterized by a signature of constant terms and atomic type families. Such a signature Σ\Sigma is defined to be a set of bindings, where each binding has one of the following forms:

  • P(S)PP(\llbracket S\rrbracket)\mapsto\llbracket P\rrbracket, where S𝔗(ϵ)\llbracket S\rrbracket\in\mathfrak{T}(\epsilon) is a closed semantic type, and P𝔗(ϵ(S))\llbracket P\rrbracket\in\mathfrak{T}(\epsilon_{\bullet}(\llbracket S\rrbracket)) is a type family dependent upon S\llbracket S\rrbracket.

  • p:Spp:\llbracket S\rrbracket\mapsto\llbracket p\rrbracket, where S𝔗(ϵ)\llbracket S\rrbracket\in\mathfrak{T}(\epsilon) is a closed semantic type, and p:𝟙ϵS𝔗(ϵ)\llbracket p\rrbracket:\mathbbm{1}_{\epsilon}\xrightarrow[]{}\llbracket S\rrbracket\in\mathfrak{T}(\epsilon) is a closed term of type S\llbracket S\rrbracket.

Definition 3.4

We conceive of judgments as procedures taking inputs (here written in blue) and yielding outputs (here written in red), with one input of each judgment designated the subject (written in violet). I follow McBride (mcbride, McB16) in writing inputs to a judgment to the left of the subject, and outputs to the right, using \ni and \in for the judgments in which types are checked and inferred, respectively. The four main judgments of the type theory are then as follows:

Γ𝖢𝗍𝗑ΓΓT𝖳𝗒𝗉𝖾TΓ{\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}\Gamma}~{}\mathsf{Ctx}\gg{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}\llparenthesis\Gamma\rrparenthesis}\qquad{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}\llparenthesis\Gamma\rrparenthesis}\vdash{\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}T}~{}\mathsf{Type}\gg{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}\llbracket T\rrbracket_{\llparenthesis\Gamma\rrparenthesis}}
ΓΔTΓttTΓΔ{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis}\vdash{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}\llbracket T\rrbracket_{\llparenthesis\Gamma\rrparenthesis}}\ni{\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}t}\gg{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}\llbracket t\rrbracket^{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis}_{\llbracket T\rrbracket}}
ΓΔeRΓeRΓΔ{\color[rgb]{0,0,1}\definecolor[named]{pgfstrokecolor}{rgb}{0,0,1}\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis}\vdash{\color[rgb]{.5,0,.5}\definecolor[named]{pgfstrokecolor}{rgb}{.5,0,.5}e}\in{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}\llbracket R\rrbracket_{\llparenthesis\Gamma\rrparenthesis}}\gg{\color[rgb]{1,0,0}\definecolor[named]{pgfstrokecolor}{rgb}{1,0,0}\llbracket e\rrbracket^{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis}_{\llbracket R\rrbracket}}

Observe that within these judgments all inputs/outputs other than the subject are semantic objects. Hence it is only ever the subject of a judgment which requires checking, and all dependence of type checking upon semantic information about types/contexts/etc. is suitably encoded in the structure of these judgments.

Note.

From this point on, I will generally omit the sub/superscripts from SΓ\llbracket S\rrbracket_{\llparenthesis\Gamma\rrparenthesis} and sSΓΔ\llbracket s\rrbracket^{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis}_{\llbracket S\rrbracket}, as these are readily inferred from their occurrence in the above judgments. Similarly, I will omit sub/super-
scripts from natural transformations where these may inferred.

The reader familiar with traditional expositions of type theory may notice a conspicuous lack of a judgment for equality among those given above. In fact, there is no need for such a judgment, because we have defined the above judgments to compute the semantic denotations of their subjects – we thus may simply consider types S,TS,T judgmentally equal whenever S=T\llbracket S\rrbracket=\llbracket T\rrbracket, introduction forms s,ts,t judgmentally equal whenever s=t\llbracket s\rrbracket=\llbracket t\rrbracket, etc.

Definition 3.5

Before proceeding with the rules of the type theory, I first note some useful constructions on semantic contexts / types / terms (see Appendix A for full definitions):

  • Functoriality of telescopes: given a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis, there is an associated functor Δ:𝔗(Γ,Δ)𝔗(Γ)\varoplus_{\llparenthesis\Delta\rrparenthesis}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket)\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket) given by iterative formation of dependent pair types.

  • Context substitution/weakening: given a telescope Δ,Θ\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis and substitution f:ΓΔf:\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket\to\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket, there is a telescope Γ,f(Θ)\llparenthesis\Gamma\rrparenthesis,f^{*}(\llparenthesis\Theta\rrparenthesis) given by substituting into all types in Θ\llparenthesis\Theta\rrparenthesis. Similarly, for a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis and type S𝔗(Γ)\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket), there is a telescope Γ,x:S,ωΓS(Δ)\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis) given by weakening all types in Δ\llparenthesis\Delta\rrparenthesis.

  • Reassociation: for each telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis there is an isomorphism 𝖺𝗌𝖼ΓΔ:Γ,ΔΓ(ΔΓ){\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}:\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket\simeq\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket_{\llparenthesis\Gamma\rrparenthesis}). Similarly, for each telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis and type S𝔗(Γ,Δ)\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket) there is an isomorphism

    𝖺𝗌𝖼ΓΔS:Δ(S)Δ(((𝖺𝗌𝖼ΓΔ)1)(S))\qquad\quad{\oplus}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}:\varoplus_{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket)\simeq\varoplus_{\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket}((({\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis})^{-1})^{*}(\llbracket S\rrbracket))
  • Term substitution: given a term s:ΔS𝔗(Γ)\llbracket s\rrbracket:\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket\xrightarrow[]{}\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket), there is a substitution (s):Γ,ΔΓ(S){\downarrow}(\llbracket s\rrbracket):\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket\to\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket S\rrbracket), and given a term e:ΔS𝔗(Γ)\llbracket e\rrbracket:\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket\xrightarrow[]{}\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket) and a telescope Γ,x:S,Θ\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis, there is a substitution

    (e):Γ,Δ,(e)(Θ)Γ,x:S,Θ\qquad{\Downarrow}(\llbracket e\rrbracket):\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,{\downarrow}(\llbracket e\rrbracket)^{*}(\llparenthesis\Theta\rrparenthesis)\rrbracket\xrightarrow[]{}\llbracket\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis\rrbracket
  • Lifting: for each telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis and type S𝔗(Γ)\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis), there are lifting functors ΓΔ:𝔗(Γ)𝔗(Γ,Δ)\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket)\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket) and ΓΔS:𝔗(Γ(S))𝔗(Γ,Δ(ΓΔ(S)))\Uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket S\rrbracket))\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket_{\bullet}(\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket))) that lift types into extended contexts by iterative weakening, and a telescopic weakening functor

    𝖶ΓSΔ:𝔗(Γ,Δ)𝔗(Γ,x:S,ωΓS(Δ))\qquad\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket)\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\rrbracket)
  • Projection: in an LFDC with term-level weakening, for a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis and a type S𝔗(Γ)\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket), there is a projection

    𝗉𝗋𝗈𝗃ΓΔS:Δ,x:ΓΔ(S)S𝔗(Γ)\mathsf{proj}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket\Delta\rrbracket\mid\llbracket S\rrbracket}:\llbracket\llparenthesis\Delta\rrparenthesis,x:{\uparrow}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket)\rrbracket\xrightarrow[]{}\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket)

3.2. Inference Rules

In the bidirectional treatment of judgments-as-programs, a rule defines a procedure for evaluating a judgment on a subset of its input domain. For a rule of the form

\inferruleJ1JnJ\inferrule{J_{1}\\ \dots\\ J_{n}}{J}

where JJ and J1,,JnJ_{1},\dots,J_{n} are judgments, the algorithmic interpretation is bottom-to-top: to evaluate the conclusion JJ, evaluate the premises J1,,JnJ_{1},\dots,J_{n} in order. McBride (mcbride, McB16) offers the following heuristic – a rule is a server for its conclusion and a client for its premises, accepting inputs to its conclusion, supplying inputs to its premises, receiving outputs of the premises, and forming the output of its conclusion accordingly. Because of McBride’s discipline of writing all inputs to the left and all outputs to the right of the subject of each judgment, information thus flows clockwise around a rule, starting and ending at the 6 o’clock position.

Judgments are then evaluated by nondeterministically evaluating rules whose input patterns match the input to the judgment. If no rule applies, the judgment signals failure, which is propagated to any rule invoking it as a subroutine. A successful evaluation is given by a derivation tree built from the rules – hence induction on derivations can be applied as usual in the metatheory. To minimize nondeterminism, we shall seek to ensure that at most one rule applies to any syntactic form of the subject of its conclusion, so that judgment evaluation is syntax-directed.

3.2.1. Context Formation

Because we have defined the denotations of contexts in close connection to their syntactic representations, the rules for context formation are straightforward:

\inferrule[right=Emp]ϵ𝖢𝗍𝗑ϵ\inferrule[right=Ext]Γ𝖢𝗍𝗑ΓΓS𝖳𝗒𝗉𝖾SxΓΓ,x:S𝖢𝗍𝗑Γ,x:S\small\inferrule*[right=Emp]{~{}}{\epsilon~{}\mathsf{Ctx}\gg\epsilon}\quad\inferrule*[right=Ext]{\Gamma~{}\mathsf{Ctx}\gg\llparenthesis\Gamma\rrparenthesis\\ \llparenthesis\Gamma\rrparenthesis\vdash S~{}\mathsf{Type}\gg\llbracket S\rrbracket\\ x\notin\Gamma}{\Gamma,x:S~{}\mathsf{Ctx}\gg\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}

3.2.2. Annotation & Embedding

We have the following rules for switching between type checking and inference. The rule for switching from inference to checking requires us to annotate the term to be checked with the type against which to check it:

\inferrule[Right=Annotate]ΓT𝖳𝗒𝗉𝖾TΓΔTttΓΔt:TTt\small\inferrule*[Right=Annotate]{\llparenthesis\Gamma\rrparenthesis\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash t:T\in\llbracket T\rrbracket\gg\llbracket t\rrbracket}

while the rule for switching from checking to inference instead requires that the type we are able to synthesize for a given term is equal to the one already provided for checking:

\inferrule[right=Embed]ΓΔeReR=TΓΔTe¯e\small\inferrule*[right=Embed]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\llbracket R\rrbracket\gg\llbracket e\rrbracket\\ \llbracket R\rrbracket=\llbracket T\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket T\rrbracket\ni\underline{e}\gg\llbracket e\rrbracket}

3.2.3. Atoms & Constants

Fix a signature Σ\Sigma. We then have the following rule for instantiating atomic type families contained in Σ\Sigma:

\inferrule[right=Atom]P(S)PΣΓΔϵΓ(S)ssΓ,Δ,ΘPs𝖳𝗒𝗉𝖾Γ,ΔΘ((s)(ϵΓS(P)))\small\inferrule*[right=Atom]{P(\llbracket S\rrbracket)\mapsto\llbracket P\rrbracket\in\Sigma\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash{\uparrow_{\epsilon}^{\llparenthesis\Gamma\rrparenthesis}}(\llbracket S\rrbracket)\ni s\gg\llbracket s\rrbracket}{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\vdash Ps~{}\mathsf{Type}\gg\uparrow_{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis}^{\llparenthesis\Theta\rrparenthesis}({\downarrow}(\llbracket s\rrbracket)^{*}(\Uparrow_{\epsilon}^{\llparenthesis\Gamma\rrparenthesis\mid\llbracket S\rrbracket}(\llbracket P\rrbracket)))}

Due to type-level weakening, we may make use of some part Δ\llparenthesis\Delta\rrparenthesis of the context in forming the parameter ss for a type family PP, discarding Θ\llparenthesis\Theta\rrparenthesis while keeping Γ\llparenthesis\Gamma\rrparenthesis at the type level. Note that once the part of the context Δ\llparenthesis\Delta\rrparenthesis used in constructing ss has been selected, the term-level typing rules enforce that Δ\llparenthesis\Delta\rrparenthesis must be used in accordance with the substructural constraints of the type theory. Similarly, we have the following rule for instantiating constants from Σ\Sigma:

\inferrule[Right=Const]p:SpΣΓϵpϵΓ(S)ϵΓ(p)\small\inferrule*[Right=Const]{p:\llbracket S\rrbracket\mapsto\llbracket p\rrbracket\in\Sigma}{\llparenthesis\Gamma\rrparenthesis\fatsemi\epsilon\vdash p\in{\uparrow_{\epsilon}^{\llparenthesis\Gamma\rrparenthesis}}(\llbracket S\rrbracket)\gg\uparrow_{\epsilon}^{\llparenthesis\Gamma\rrparenthesis}(\llbracket p\rrbracket)}

3.2.4. Identity, Weakening & Contraction

If the ambient LFDC has neither term-level weakening nor contraction, then we have only the following strict identity rule:

\inferrule[right=StrId]Γx:SxSidS\small\inferrule*[right=StrId]{~{}}{\llparenthesis\Gamma\rrparenthesis\fatsemi x:\llbracket S\rrbracket\vdash x\in\llbracket S\rrbracket\gg\text{id}_{\llbracket S\rrbracket}}

If, on the other hand, the ambient LFDC has term-level weakening, then we may instead make use of the following weak identity rule:

\inferrule[right=WkId]ΓΔ,x:ΓΔ(S),ΘxS𝗉𝗋𝗈𝗃ΓΔSΔ(ρ)Δx:ΓΔ(S)(Θ)\small\inferrule*[right=WkId]{~{}}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:{\uparrow}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket),\llparenthesis\Theta\rrparenthesis\vdash x\in\llbracket S\rrbracket\\ \gg\mathsf{proj}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\rho)\circ\varoplus_{\llparenthesis\Delta\rrparenthesis x:{\uparrow}^{\llparenthesis\Delta\rrparenthesis}_{\llparenthesis\Gamma\rrparenthesis}(\llbracket S\rrbracket)}(\top_{\llbracket\llparenthesis\Theta\rrparenthesis\rrbracket})}

Similarly, if the ambient LFDC has contraction but not term-level weakening, then we may make use of the following in addition to the strict identity rule above:

\inferrule[right=StrContr]Γ,x:SϵxωΓS(S)𝔡Γ,S\small\inferrule*[right=StrContr]{~{}}{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket\mid\epsilon\vdash x\in\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llbracket S\rrbracket)\gg\mathfrak{d}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket,\llbracket S\rrbracket}}

Finally, if the ambient LFDC is Cartesian, then we may instead use the following rule in addition to the weak idenity rule:

\inferrule[right=WkContr]Γ,x:S,ΔΘxΓx:S,Δ(S)Γ,x:SΔ(𝔡Γ,S)Θ\small\inferrule*[right=WkContr]{~{}}{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash x\in\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{x:\llbracket S\rrbracket,\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket)\\ \gg\uparrow_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}^{\llparenthesis\Delta\rrparenthesis}(\mathfrak{d}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket,\llbracket S\rrbracket})\circ\top_{\llbracket\llparenthesis\Theta\rrparenthesis\rrbracket}}

3.2.5. Exchange

Unlike term-level weakening and contraction, exchange cannot be handled merely in the typing rules for individual variables, since it necessarily concerns the use of multiple variables. Thus, the rules for exchange must allow permuting the variables in the term-level context of any typing judgment, i.e:

\inferrule[right=ExchI]ΓΔ,y:T,x:ωΓ,ΔT(S),𝖤𝗑𝖼𝗁(Θ)RrrΓΔ,x:S,y:ωΓ,ΔS(T),ΘRrr𝖾𝗑𝖼𝗁\small\inferrule*[right=ExchI]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,y:\llbracket T\rrbracket,x:\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}^{\llbracket T\rrbracket}(\llbracket S\rrbracket),\mathsf{Exch}^{*}(\llparenthesis\Theta\rrparenthesis)\vdash\llbracket R\rrbracket\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:\llbracket S\rrbracket,y:\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llbracket T\rrbracket),\llparenthesis\Theta\rrparenthesis\vdash\llbracket R\rrbracket\ni r\gg\llbracket r\rrbracket\circ\mathsf{exch}}
\inferrule[right=ExchE]ΓΔ,y:T,x:ωΓ,ΔT(S),𝖤𝗑𝖼𝗁(Θ)eReΓΔ,x:S,y:ωΓ,ΔS(T),ΘeRe𝖾𝗑𝖼𝗁\small\inferrule*[right=ExchE]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,y:\llbracket T\rrbracket,x:\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}^{\llbracket T\rrbracket}(\llbracket S\rrbracket),\mathsf{Exch}^{*}(\llparenthesis\Theta\rrparenthesis)\vdash e\in\llbracket R\rrbracket\gg\llbracket e\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:\llbracket S\rrbracket,y:\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llbracket T\rrbracket),\llparenthesis\Theta\rrparenthesis\vdash e\in\llbracket R\rrbracket\gg\llbracket e\rrbracket\circ\mathsf{exch}}

where

𝖤𝗑𝖼𝗁=α1Γ,Δ(σ)α𝖾𝗑𝖼𝗁=Δ(β1σ,β)\mathsf{Exch}=\alpha^{-1}\circ\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket_{\bullet}(\sigma)\circ\alpha\quad\mathsf{exch}=\varoplus_{\llparenthesis\Delta\rrparenthesis}(\beta^{-1}\circ\langle\sigma,-\rangle\circ\beta)

The rules for exchange are thus not syntax-directed, and so introduce an additional element of nondeterminism to type-checking, since type checking an expression may require trying all valid permutations of the context. For present purposes, this is a tolerable state of affairs, as there are only ever finitely many such permutations, and so this does not impact the decidability of type-checking. However, for practical use, further work will be necessary to find ways of cutting down on this nondeterminism. We can however omit these rules in Cartesian LFDCs, since by Def. 2.13 the exchange structure in a Cartesian LFDC already arises from term-level weakening and contraction.

3.2.6. The Unit Type

The formation rule for the unit type is straightforward

\inferrule[right=𝟙Form]Γ𝟙𝖳𝗒𝗉𝖾𝟙Γ\small\inferrule*[right=\mathbbm{1}Form]{~{}}{\llparenthesis\Gamma\rrparenthesis\vdash\mathbbm{1}~{}\mathsf{Type}\gg\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}}

Likewise the introduction rule, except that this rule admits a variation when the ambient LFDC has term-level weakening:

\inferrule[right=𝟙IntroStr]Γϵ𝟙Γid𝟙Γ\small\inferrule*[right=\mathbbm{1}IntroStr]{~{}}{\llparenthesis\Gamma\rrparenthesis\fatsemi\epsilon\vdash\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\ni\langle\rangle\gg\text{id}_{\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}}}
\inferrule[right=𝟙IntroWk]ΓΔ𝟙ΓΔ\small\inferrule*[right=\mathbbm{1}IntroWk]{~{}}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\ni\langle\rangle\gg\top_{\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket}}

However, the elimination rules for the unit type are fairly complex. There are two main reasons for this: one is that the unit type is positive and so its elimination form is pattern-matching, which may be applied either at the term level or at the type level – hence there must be two distinct rules for such uses. Moreover, when performing such pattern-matching, we use some part Δ\llparenthesis\Delta\rrparenthesis of the ambient context in constructing a term e\llbracket e\rrbracket of the unit type, but the part of the context occurring after Δ\llparenthesis\Delta\rrparenthesis may implicitly depend upon e\llbracket e\rrbracket itself. To solve this issue, we require that a pattern matching expression represent these dependencies explicitly, by wrapping the remaining context in a type dependent upon the expression being matched over. We thus have the following term-level elimination rule:

\inferrule[right=𝟙Elim1]Γ,ΔΘe𝟙Γ,ΔeΓR𝖳𝗒𝗉𝖾RΓ,Δ,a:𝟙Γ,ΔU𝖳𝗒𝗉𝖾UΓ,Δ,ΘΦ(e)(U)uuΓΔ,z:η(U)RrrΓΔ,Θ,Φ𝗅𝖾𝗍[a.RU]=e𝗐𝗂𝗍𝗁z=u𝗂𝗇rRrΔ(e,)Δ,Θ(u)\small\inferrule*[right=\mathbbm{1}Elim1]{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash e\in\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}\gg\llbracket e\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\vdash R~{}\mathsf{Type}\gg\llbracket R\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,a:\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}\vdash U~{}\mathsf{Type}\gg\llbracket U\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket U\rrbracket)\ni u\gg\llbracket u\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,z:\eta^{*}(\llbracket U\rrbracket)\vdash\llbracket R\rrbracket\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis,\llparenthesis\Phi\rrparenthesis\vdash\mathsf{let}[a._{R}^{U}]\langle\rangle=e~{}\mathsf{with}~{}z=u~{}\mathsf{in}~{}r\in\llbracket R\rrbracket\\ \gg\llbracket r\rrbracket\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\ell\circ\langle\llbracket e\rrbracket,-\rangle)\circ\varoplus_{\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis}(\llbracket u\rrbracket)}

and the following type-level elimination rule:

\inferrule[right=𝟙Elim2]ΓΔe𝟙ΓeΓ,a:𝟙ΓR𝖳𝗒𝗉𝖾RΓ,b:𝟙ΓU𝖳𝗒𝗉𝖾UΓ,b:𝟙Γ,c:UV𝖳𝗒𝗉𝖾VΓ,ΔΘ(e)(U)uuΓ,Δ,ΘΦ(u)((e)(U)(V))vvΓ,w:η(U)z:η(U)(V)η(R)rrΓ,Δ,ΘΦ𝗅𝖾𝗍[a,b,c.RU,V]=e𝗐𝗂𝗍𝗁w=u𝖺𝗇𝖽z=v𝗂𝗇r(e)(R)(u)((e)(U)(η1(η(U))(r)))v\small\inferrule*[right=\mathbbm{1}Elim2]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\gg\llbracket e\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,a:\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\vdash R~{}\mathsf{Type}\gg\llbracket R\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,b:\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\vdash U~{}\mathsf{Type}\gg\llbracket U\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,b:\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket},c:\llbracket U\rrbracket\vdash V~{}\mathsf{Type}\gg\llbracket V\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket U\rrbracket)\ni u\gg\llbracket u\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash{\downarrow}(\llbracket u\rrbracket)^{*}({\downarrow}(\llbracket e\rrbracket)_{\bullet}(\llbracket U\rrbracket)^{*}(\llbracket V\rrbracket))\ni v\gg\llbracket v\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,w:\eta^{*}(\llbracket U\rrbracket)\fatsemi z:\eta_{\bullet}(\llbracket U\rrbracket)^{*}(\llbracket V\rrbracket)\vdash\eta^{*}(\llbracket R\rrbracket)\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash\\ \mathsf{let}[a,b,c._{R}^{U,V}]\langle\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{and}~{}z=v~{}\mathsf{in}~{}r\in{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket R\rrbracket)\\ \gg{\downarrow}(\llbracket u\rrbracket)^{*}({\downarrow}(\llbracket e\rrbracket)_{\bullet}(\llbracket U\rrbracket)^{*}(\eta^{-1}_{\bullet}(\eta^{*}(\llbracket U\rrbracket))^{*}(\llbracket r\rrbracket)))\circ\llbracket v\rrbracket}

On their own these rules are not quite sufficient, due to a quirk of the unit type: if the part of a context ocurring after that used in constructing e\llbracket e\rrbracket is empty, we cannot encode this via a variable of the unit type, since we would then generally need to eliminate this variable, bringing us round in a circle. We thus have the following additional rules to handle these exceptional cases at the term level:

\inferrule[right=𝟙Elim3]Γ,ΔΘe𝟙Γ,ΔeΓR𝖳𝗒𝗉𝖾RΓΔRrrΓΔ,Θ𝗅𝖾𝗍[R]=e𝗂𝗇rRrΔ(ρe)\small\inferrule*[right=\mathbbm{1}Elim3]{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash e\in\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket}\gg\llbracket e\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\vdash R~{}\mathsf{Type}\gg\llbracket R\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket R\rrbracket\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\vdash\mathsf{let}[_{R}]\langle\rangle=e~{}\mathsf{in}~{}r\in\llbracket R\rrbracket\gg\llbracket r\rrbracket\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\rho\circ\llbracket e\rrbracket)}

and at the type level:

\inferrule[right=𝟙Elim4]ΓΔe𝟙ΓeΓ,a:𝟙ΓR𝖳𝗒𝗉𝖾RΓ,b:𝟙ΓU𝖳𝗒𝗉𝖾UΓ,ΔΘ(e)(U)uuΓz:η(U)η(R)rrΓ,ΔΘ𝗅𝖾𝗍[a,b.RU]=e𝗐𝗂𝗍𝗁z=u𝗂𝗇r(e)(R)(e)(η(r))u\small\inferrule*[right=\mathbbm{1}Elim4]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\gg\llbracket e\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,a:\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\vdash R~{}\mathsf{Type}\gg\llbracket R\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,b:\mathbbm{1}_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\vdash U~{}\mathsf{Type}\gg\llbracket U\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket U\rrbracket)\ni u\gg\llbracket u\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi z:\eta^{*}(\llbracket U\rrbracket)\vdash\eta^{*}(\llbracket R\rrbracket)\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash\mathsf{let}[a,b._{R}^{U}]\langle\rangle=e~{}\mathsf{with}~{}z=u~{}\mathsf{in}~{}r\\ \in{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket R\rrbracket)\gg{\downarrow}(\llbracket e\rrbracket)^{*}(\eta^{*}(\llbracket r\rrbracket))\circ\llbracket u\rrbracket}

3.2.7. Dependent Pair Types

The formation rule for dependent pair types is straightforward:

\inferrule[right=Form]ΓS𝖳𝗒𝗉𝖾SΓ,x:ST𝖳𝗒𝗉𝖾TΓx:S.T𝖳𝗒𝗉𝖾𝖲(T)\small\inferrule*[right=\varoplus Form]{\llparenthesis\Gamma\rrparenthesis\vdash S~{}\mathsf{Type}\gg\llbracket S\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket}{\llparenthesis\Gamma\rrparenthesis\vdash\bigoplus x:S.T~{}\mathsf{Type\gg\varoplus_{\llbracket S\rrbracket}}(\llbracket T\rrbracket)}

As is the introduction rule:

\inferrule[right=Intro]ΓΔSssΓ,ΔΘ(s)(T)ttΓΔ,ΘS(T)s,ts,𝖺𝗌𝖼ΓΔΘΔ(t)\small\inferrule*[right=\varoplus Intro]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket S\rrbracket\ni s\gg\llbracket s\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash{\downarrow}(\llbracket s\rrbracket)^{*}(\llbracket T\rrbracket)\ni t\gg\llbracket t\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\vdash\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\ni\langle s,t\rangle\\ \gg\langle\llbracket s\rrbracket,-\rangle\circ{\oplus}\mathsf{asc}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket\llparenthesis\Theta\rrparenthesis\rrbracket}_{\llparenthesis\Gamma\rrparenthesis}\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\llbracket t\rrbracket)}

Because the dependent pair type is positive, its elimination rules follow the same pattern as the unit type. We have a term-level rule:

\inferrule[right=Elim1]Γ,ΔΘeS(T)eΓR𝖳𝗒𝗉𝖾RΓ,Δ,a:S(T)U𝖳𝗒𝗉𝖾UΓ,Δ,ΘΦ(e)(U)uuΓΔ,x:S,y:T,z:(α1)(U)RrrΓΔ,Θ,Φ𝗅𝖾𝗍[a.RU]x,y=e𝗐𝗂𝗍𝗁z=u𝗂𝗇rRrΔ(β1e,𝖺𝗌𝖼Γ,ΔΘ(e)(U)Θ(u))\small\inferrule*[right=\varoplus Elim1]{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash e\in\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\gg\llbracket e\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\vdash R~{}\mathsf{Type}\gg\llbracket R\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,a:\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\vdash U~{}\mathsf{Type}\gg\llbracket U\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket U\rrbracket)\ni u\gg\llbracket u\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:\llbracket S\rrbracket,y:\llbracket T\rrbracket,z:(\alpha^{-1})^{*}(\llbracket U\rrbracket)\vdash\llbracket R\rrbracket\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis,\llparenthesis\Phi\rrparenthesis\vdash\mathsf{let}[a._{R}^{U}]\langle x,y\rangle=e~{}\mathsf{with}~{}z=u~{}\mathsf{in}~{}r\in\llbracket R\rrbracket\\ \gg\llbracket r\rrbracket\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\beta^{-1}\circ\langle\llbracket e\rrbracket,-\rangle\circ{\oplus}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis}^{\llparenthesis\Theta\rrparenthesis\mid{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket U\rrbracket)}\circ\varoplus_{\llparenthesis\Theta\rrparenthesis}(\llbracket u\rrbracket))}

and a type-level rule:

\inferrule[right=Elim2]ΓΔeS(T)eΓ,a:S(T)R𝖳𝗒𝗉𝖾RΓ,b:S(T)U𝖳𝗒𝗉𝖾UΓ,b:S(T),c:UV𝖳𝗒𝗉𝖾VΓ,ΔΘ(e)(U)uuΓ,Δ,ΘΦ(u)((e)(U)(V))vvΓ,x:S,y:T,w:(α1)(U)z:α1(U)(V)RrrΓ,Δ,ΘΦ𝗅𝖾𝗍[a,b,c.RU,V]x,y=e𝗐𝗂𝗍𝗁w=u𝖺𝗇𝖽z=v𝗂𝗇r(e)(R)(u)((e)(U)(α((α1)(U))(r)))v\small\inferrule*[right=\varoplus Elim2]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\oplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\gg\llbracket e\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,a:\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\vdash R~{}\mathsf{Type}\gg\llbracket R\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,b:\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\vdash U~{}\mathsf{Type}\gg\llbracket U\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,b:\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket),c:\llbracket U\rrbracket\vdash V~{}\mathsf{Type}\gg\llbracket V\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket U\rrbracket)\ni u\gg\llbracket u\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash{\downarrow}(\llbracket u\rrbracket)^{*}({\downarrow}(\llbracket e\rrbracket)_{\bullet}(\llbracket U\rrbracket)^{*}(\llbracket V\rrbracket))\ni v\gg\llbracket v\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,y:\llbracket T\rrbracket,w:(\alpha^{-1})^{*}(\llbracket U\rrbracket)\fatsemi z:\alpha_{\bullet}^{-1}(\llbracket U\rrbracket)^{*}(\llbracket V\rrbracket)\vdash\\ \llbracket R\rrbracket\ni r\gg\llbracket r\rrbracket}{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash\\ \mathsf{let}[a,b,c._{R}^{U,V}]\langle x,y\rangle=e~{}\mathsf{with}~{}w=u~{}\mathsf{and}~{}z=v~{}\mathsf{in}~{}r\in{\downarrow}(\llbracket e\rrbracket)^{*}(\llbracket R\rrbracket)\\ \gg{\downarrow}(\llbracket u\rrbracket)^{*}({\downarrow}(\llbracket e\rrbracket)_{\bullet}(\llbracket U\rrbracket)^{*}(\alpha_{\bullet}((\alpha^{-1})^{*}(\llbracket U\rrbracket))^{*}(\llbracket r\rrbracket)))\circ\llbracket v\rrbracket}

3.2.8. Term-Level Function Types

The rules for term-level functions are each essentially variations on the rules for function types in intuitionistic type theory. We have the formation rule for \sslash:

\inferrule[right=Form]ΓS𝖳𝗒𝗉𝖾SΓT𝖳𝗒𝗉𝖾TΓST𝖳𝗒𝗉𝖾S(T)\small\inferrule*[right=\sslash Form]{\llparenthesis\Gamma\rrparenthesis\vdash S~{}\mathsf{Type}\gg\llbracket S\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket}{\llparenthesis\Gamma\rrparenthesis\vdash S\sslash T~{}\mathsf{Type}\gg\sslash_{\llbracket S\rrbracket}(\llbracket T\rrbracket)}

and the following for \bbslash:

\inferrule[right=Form]ΓS𝖳𝗒𝗉𝖾SΓT𝖳𝗒𝗉𝖾TΓST𝖳𝗒𝗉𝖾S(T)\small\inferrule*[right=\bbslash Form]{\llparenthesis\Gamma\rrparenthesis\vdash S~{}\mathsf{Type}\gg\llbracket S\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket}{\llparenthesis\Gamma\rrparenthesis\vdash S\bbslash T~{}\mathsf{Type}\gg\bbslash_{\llbracket S\rrbracket}(\llbracket T\rrbracket)}

The intro rule for \sslash follows the usual form of function abstraction, introducing a variable on the left of the term-level context:

\inferrule[right=Intro]Γx:S,ωΓS(Δ)TttΓΔS(T)x.t(t)\small\inferrule*[right=\sslash Intro]{\llparenthesis\Gamma\rrparenthesis\fatsemi x:\llbracket S\rrbracket,\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\sslash_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\ni\sslash x.t\gg\sslash(\llbracket t\rrbracket)}

while the intro rule for \bbslash introduces a variable on right:

\inferrule[right=Intro]ΓΔ,x:ΓΔ(S)TttΓΔS(T)x.t(t)\small\inferrule*[right=\bbslash Intro]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket)\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\bbslash_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\ni\bbslash x.t\gg\bbslash(\llbracket t\rrbracket)}

The elimination rule for \sslash thus forms its argument using part of the context occurring to the left of the part used in forming a function:

\inferrule[right=Elim]ΓΘfS(T)fΓΔSssΓΔ,ΓΔ(Θ)sfT1(f)s,𝖺𝗌𝖼ΓΔΓΔ(Θ)\small\inferrule*[right=\sslash Elim]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash f\in\sslash_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\gg\llbracket f\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket S\rrbracket\ni s\gg\llbracket s\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,{\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}}(\llparenthesis\Theta\rrparenthesis)\vdash s\triangleright f\in\llbracket T\rrbracket\\ \gg\sslash^{-1}(\llbracket f\rrbracket)\circ\langle\llbracket s\rrbracket,-\rangle\circ{\oplus}\mathsf{asc}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llparenthesis\Theta\rrparenthesis)\rrbracket}_{\llparenthesis\Gamma\rrparenthesis}}

while the elimination rule for \bbslash forms the argument to ff using part of the context occurring to the right of the part used in forming ff:

\inferrule[right=Elim]ΓΔfS(T)fΓΘSssΓΔ,ΓΔ(Θ)fsT1(f)ΓΔ(s)\small\inferrule*[right=\bbslash Elim]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash f\in\bbslash_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\gg\llbracket f\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash\llbracket S\rrbracket\ni s\gg\llbracket s\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,{\uparrow_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llparenthesis\Delta\rrparenthesis}}(\llparenthesis\Theta\rrparenthesis)\vdash f\triangleleft s\in\llbracket T\rrbracket\gg\bbslash^{-1}(\llbracket f\rrbracket)\circ\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket s\rrbracket)}

3.2.9. Type-Level Function Types

The rules for type-level functions are again a variation on the rules for function types in intuitionistic type theory, but this time the function types in question are dependent function types. We have the following formation rule:

\inferrule[right=Form]ΓS𝖳𝗒𝗉𝖾SΓ,x:ST𝖳𝗒𝗉𝖾TΓx:S.T𝖳𝗒𝗉𝖾S(T)\small\inferrule*[right=\forall Form]{\llparenthesis\Gamma\rrparenthesis\vdash S~{}\mathsf{Type}\gg\llbracket S\rrbracket\\ \llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket}{\llparenthesis\Gamma\rrparenthesis\vdash\forall x:S.T~{}\mathsf{Type}\gg\forall_{\llbracket S\rrbracket}(\llbracket T\rrbracket)}

and the following introduction rule

\inferrule[right=Intro]Γ,x:SωΓS(Δ)TttΓΔS(T)Λx.tΛ(t)\small\inferrule*[right=\forall Intro]{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket\fatsemi\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\forall_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\ni\Lambda x.t\gg\Lambda(\llbracket t\rrbracket)}

and the corresponding elimination rule

\inferrule[right=Elim]ΓΘfS(T)fΓΔSssΓ,ΔΓΔ(Θ)fs(s)(T)(s)(Λ1(f))\small\inferrule*[right=\forall Elim]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash f\in\forall_{\llbracket S\rrbracket}(\llbracket T\rrbracket)\gg\llbracket f\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket S\rrbracket\ni s\gg\llbracket s\rrbracket}{\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llparenthesis\Theta\rrparenthesis)\vdash f\cdot s\in{\downarrow}(\llbracket s\rrbracket)^{*}(\llbracket T\rrbracket)\\ \gg{\downarrow}(\llbracket s\rrbracket)^{*}(\Lambda^{-1}(\llbracket f\rrbracket))}

wherein we may make use of any part of the type-level context in forming an input to ff, provided that the term-level context does not depend upon this part of the type-level context.

3.2.10. Product Types

The rules for product types are largely straightforward. We have the following type formation rule:

\inferrule[right=×Form]ΓS𝖳𝗒𝗉𝖾SΓT𝖳𝗒𝗉𝖾TΓS×T𝖳𝗒𝗉𝖾S×ΓT\inferrule*[right=\times Form]{\llparenthesis\Gamma\rrparenthesis\vdash S~{}\mathsf{Type}\gg\llbracket S\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket}{\llparenthesis\Gamma\rrparenthesis\vdash S\times T~{}\mathsf{Type}\gg\llbracket S\rrbracket\times_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\llbracket T\rrbracket}

and the following introduction rule

\inferrule[right=×Intro]ΓΔSssΓΔTttΓΔS×ΓT(s,t)(s,t)\inferrule*[right=\times Intro]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket S\rrbracket\ni s\gg\llbracket s\rrbracket\\ \llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\llbracket S\rrbracket\times_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\llbracket T\rrbracket\ni(s,t)\gg(\llbracket s\rrbracket,\llbracket t\rrbracket)}

Note that the term-level context Δ\llparenthesis\Delta\rrparenthesis is used in checking both ss and tt, since (s,t)(s,t) offers a choice of which of s,ts,t to construct from the resources in Δ\llparenthesis\Delta\rrparenthesis. We then have the following elimination rules, which allow for making such a choice:

\inferrule[right=×Elim1]ΓΔeS×ΓTeΓΔπ1(e)Sπ1e\small\inferrule*[right=\times Elim1]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\llbracket S\rrbracket\times_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\llbracket T\rrbracket\gg\llbracket e\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\pi_{1}(e)\in\llbracket S\rrbracket\gg\pi_{1}\circ\llbracket e\rrbracket}

and

\inferrule[right=×Elim2]ΓΔeS×ΓTeΓΔπ2(e)Tπ2e\small\inferrule*[right=\times Elim2]{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\llbracket S\rrbracket\times_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}\llbracket T\rrbracket\gg\llbracket e\rrbracket}{\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash\pi_{2}(e)\in\llbracket T\rrbracket\gg\pi_{2}\circ\llbracket e\rrbracket}

3.3. Syntactic Completeness

As a consequence of the construction of the rules given above, we automatically have a form of type soundness for the theory: every well typed syntactic expression corresponds to a well defined semantic object of the appropriate kind. Beyond such soundness, however, there are further desiderata we may have for such a theory, namely completeness and effectivity/decidability of the above-defined procedure for type-checking/computing denotations of expressions.

As to the completeness of this theory, by soundness we already have that the syntax of the theory may be interpreted in any strict LFDC, so it remains only to show that this syntax is closed under the constructions available in a (strict) LFDC, and therefore that the syntax itself forms such a (strict) LFDC. From this it will follow that a syntactic expression is well typed if and only if a corresponding semantic object of the appropriate kind exists in every strict LFDC.

The syntax of the theory already includes primitive constructs corresponding to all the semantic type-formers in an LFDC with type-level weakening, function types, and product types. Therefore all that remains is to prove the admissibility of syntactic constructions corresponding to the parts of such an LFDC not given by its type-formers, which are namely: type-level weakening, and substitution/composition.

Theorem 3.1.
  • If Γ,ΔT𝖳𝗒𝗉𝖾T\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket then

    Γ,x:S,ωΓS(Δ)T𝖳𝗒𝗉𝖾𝖶ΓSΔ(T)\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\vdash T~{}\mathsf{Type}\gg\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llbracket T\rrbracket)
  • If Γ,ΔΘTtt\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket then

    Γ,x:S,ωΓS(Δ)𝖶ΓSΔ(Θ)𝖶ΓSΔ(T)t𝖶ΓSΔ(t)\begin{array}[]{c}\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\fatsemi\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llparenthesis\Theta\rrparenthesis)\vdash\\ \mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llbracket T\rrbracket)\ni t\gg\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llbracket t\rrbracket)\end{array}
  • If Γ,ΔΘeRe\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash e\in\llbracket R\rrbracket\gg\llbracket e\rrbracket then

    Γ,x:S,ωΓS(Δ)𝖶ΓSΔ(Θ)e𝖶ΓSΔ(R)𝖶ΓSΔ(e)\begin{array}[]{c}\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\fatsemi\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llparenthesis\Theta\rrparenthesis)\vdash\\ e\in\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llbracket R\rrbracket)\gg\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}(\llbracket e\rrbracket)\end{array}
Proof.

Induction on derivations. ∎

Theorem 3.2.

Given expressions T,t,fT,t,f and an expression ee not containing any variable bound in T,t,fT,t,f, respectively, write T[e/x],t[e/x]T[e/x],t[e/x], and f[e/x]f[e/x] for the uniform substitution of ee for all free occurrences of the variable xx in T,t,fT,t,f, respectively. We then have the following:

  • If Γ,x:S,ΘT𝖳𝗒𝗉𝖾T\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis\vdash T~{}\mathsf{Type}\gg\llbracket T\rrbracket and ΓΔeSe\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\llbracket S\rrbracket\gg\llbracket e\rrbracket then

    Γ,Δ,e(Θ)T[e/x](e)(T)\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llbracket e\rrbracket^{*}(\llparenthesis\Theta\rrparenthesis)\vdash T[e/x]\gg{\Downarrow}(\llbracket e\rrbracket)^{*}(\llbracket T\rrbracket)
  • If ΓΔ,x:S,ΦTtt\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Phi\rrparenthesis\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket and Γ,ΔΘeSe\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash e\in\llbracket S\rrbracket\gg\llbracket e\rrbracket, then

    ΓΔ,Θ,e(Φ)Tt[e/x]tΔ(e)\begin{array}[]{c}\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis,\llbracket e\rrbracket^{*}(\llparenthesis\Phi\rrparenthesis)\vdash\\ \llbracket T\rrbracket\ni t[e/x]\gg\llbracket t\rrbracket\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\llbracket e\rrbracket)\end{array}
  • If Γ,x:S,ΘΦTtt\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash\llbracket T\rrbracket\ni t\gg\llbracket t\rrbracket and ΓΔeSe\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\llbracket S\rrbracket\gg\llbracket e\rrbracket, then

    Γ,Δ,e(Θ)(e)(Φ)(e)(T)t[e/x](e)(t)\begin{array}[]{c}\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llbracket e\rrbracket^{*}(\llparenthesis\Theta\rrparenthesis)\fatsemi{\Downarrow}(\llbracket e\rrbracket)^{*}(\llparenthesis\Phi\rrparenthesis)\vdash\\ {\Downarrow}(\llbracket e\rrbracket)^{*}(\llbracket T\rrbracket)\ni t[e/x]\gg{\Downarrow}(\llbracket e\rrbracket)^{*}(\llbracket t\rrbracket)\end{array}
  • If ΓΔ,x:S,ΦfRf\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Phi\rrparenthesis\vdash f\in\llbracket R\rrbracket\gg\llbracket f\rrbracket and Γ,ΔΘeSe\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\fatsemi\llparenthesis\Theta\rrparenthesis\vdash e\in\llbracket S\rrbracket\gg\llbracket e\rrbracket, then

    ΓΔ,Θ,e(Φ)f[e/x]RfΔ(e)\begin{array}[]{c}\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis,\llbracket e\rrbracket^{*}(\llparenthesis\Phi\rrparenthesis)\vdash\\ f[e/x]\in\llbracket R\rrbracket\gg\llbracket f\rrbracket\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\llbracket e\rrbracket)\end{array}
  • If Γ,x:S,ΘΦfRf\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis\fatsemi\llparenthesis\Phi\rrparenthesis\vdash f\in\llbracket R\rrbracket\gg\llbracket f\rrbracket and ΓΔeSe\llparenthesis\Gamma\rrparenthesis\fatsemi\llparenthesis\Delta\rrparenthesis\vdash e\in\llbracket S\rrbracket\gg\llbracket e\rrbracket, then

    Γ,Δ,e(Θ)(e)(Φ)f(e)(T)(e)(f)\begin{array}[]{c}\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,\llbracket e\rrbracket^{*}(\llparenthesis\Theta\rrparenthesis)\fatsemi{\Downarrow}(\llbracket e\rrbracket)^{*}(\llparenthesis\Phi\rrparenthesis)\vdash\\ f\in{\Downarrow}(\llbracket e\rrbracket)^{*}(\llbracket T\rrbracket)\gg{\Downarrow}(\llbracket e\rrbracket)^{*}(\llbracket f\rrbracket)\end{array}
Proof.

Induction on derivations. ∎

I leave to future work a full proof that the well typed syntactic fragment of this type theory, quotiented by judgmental equality as defined in Def. 3.4, forms a strict LFDC with type-level weakening, function types, products, and the appropriate structural properties. Suffice it to say, however, that the above two propositions form the backbone of such a proof, and moreover demonstrate at least morally that the syntax of this type theory completely captures the type-theoretic language of such LFDCs.

3.4. Substructuralization & Decidability

As to the decidability of the described type theory, in general, one should not anticipate decidability when interpreting the type theory in an arbitrary (strict) LFDC. One may hope, however, to isolate a computationally well-behaved subclass of (strict) LFDCs, ensuring decidability for the associated type theories. For this purpose, I define a notion of substructuralization that allows to convert an intuitionistic dependent type theory into a substructural one.

Definition 3.6

Let 𝒯\mathcal{T} be an intuitionistic dependent type theory with judgmentally-distinct type formers ,Σ,Π,,,×\top,\Sigma,\Pi,\leftarrow,\rightarrow,\times such that

  1. (1)

    \top satisfies the rules of a unit type in intuitionistic type theory

  2. (2)

    Σ\Sigma satisfies the rules of a dependent pair type former in intuitionistic type theory

  3. (3)

    Π\Pi satisfies the rules of a dependent function type former in intuitionistic type theory

  4. (4)

    \to and \leftarrow both satisfy the rules of function type formers in intuitionsitic type theory

  5. (5)

    ×\times satisfies the rules of a product type former in intuitionistic type theory

Then the substructuralization 𝔖(𝒯)\mathfrak{S}(\mathcal{T}) of 𝒯\mathcal{T} is defined as the interpretation of the substructural dependent type theory defined above (with any combination of weakening, contraction, and exchange) in the strict LFDC with type-level weakening, function types, and products, given by the syntactic model of 𝒯\mathcal{T} as defined in Ex. 2.4.

The substructuralization of an intuitionistic dependent type theory 𝒯\mathcal{T} essentially inherits its computational procedures from 𝒯\mathcal{T} while imposing substructural constraints upon the typing rules for 𝒯\mathcal{T}. The essential idea behind this is that the terms of substructural type theory denote the same sorts of data as those of intuitionistic type theory, i.e. functions, pairs, etc., whose computational behavior is already well understood and unchanged by the substructural rules. Hence we should be able to bootstrap ourselves up from an intuitionistic dependent type theory to a substructural dependent type theory, whilst preserving all the desirable computational properties thereof. To this effect, we have the following theorem:

Theorem 3.3.

Let 𝒯\mathcal{T} be an intuitionistic dependent type theory that is normalizing (i.e. every term of 𝒯\mathcal{T} computes to a judgmentally-equal normal form), and that has Type-Canonicity in that:

  • if RR is judgmentally equal to \top, then its normal form is \top,

  • if RR is judgmentally equal to ΣS(T)\Sigma_{S}(T), then its normal form is ΣS(T)\Sigma_{S^{\prime}}(T^{\prime}) for some types S,TS^{\prime},T^{\prime} in normal form,

  • etc.

then 𝔖(𝒯)\mathfrak{S}(\mathcal{T}) has the following properties:

  1. (1)

    Judgmental equality of types is decidable. I.e. given semantic types S\llbracket S\rrbracket and T\llbracket T\rrbracket, we may check whether these are equal in the syntactic model of 𝒯\mathcal{T} by reducing them both to normal form and comparing these normal forms for α\alpha-equivalence.

  2. (2)

    Pattern-matching on types is decidable. E.g. to check whether a type is of the form S(T)\varoplus_{\llbracket S\rrbracket}(\llbracket T\rrbracket), we reduce it to normal form and check whether this normal form has the form ΣS(T)\Sigma_{S^{\prime}}(T^{\prime}).

Corollary 3.4.

If an intuitionistic dependent type theory 𝒯\mathcal{T} satisfies the conditions of the above theorem, then type checking for 𝔖(𝒯)\mathfrak{S}(\mathcal{T}) is decidable. Examining the rules for 𝔖(𝒯)\mathfrak{S}(\mathcal{T}), we see that these require only the abilities to 1) pattern match on expressions (trivial), 2) pattern match on types using primitive type formers (follows from the above theorem), 3) pattern match for type-level weakening (can be done by checking that the weakened variable does not occur freely in a type), and 4) check types for equality (follows from the above theorem).

3.5. Application: Linear Logical Frameworks

I come now to an example of the practical advantage of this theory over prior substructural dependent type theories, namely: a suitably substructuralized dependent type theory is particularly well-suited as a logical framework for the metatheory of linear logic.

Definition 3.7

We define the Logic of Left-Fibred Double Categories with Symmetry (LLFDCσ), as the substructuralization of intuitionistic dependent type theory with at least one universe, which includes the exchange rules but neither term-level weakening nor contraction as structural rules.

Definition 3.8

We may add atomic type families and axioms / constants to LLFDCσ by including corresponding variables of the appropriate types in the underlying intuitionistic dependent type theory and then adding these to the signature of its substructuralization. Hence for an atomic type family variable PP and a closed LLFDCσ-type SS, we write P(S)ΣP(S)\in\Sigma to mean P(S)PΣP(\llbracket S\rrbracket)\gg P\in\Sigma, and similarly for a constant variable pp, we write p:SΣp:S\in\Sigma to mean p:SpΣp:\llbracket S\rrbracket\gg p\in\Sigma.

I write x1,,xn:S.T\forall x_{1},\dots,x_{n}:S.T and x1,,xn:S.T\bigoplus x_{1},\dots,x_{n}:S.T as abbreviations for x1:S.xn:S.T\forall x_{1}:S.\dots\forall x_{n}:S.T and x1:S.xn:S.T\bigoplus x_{1}:S.\dots\bigoplus x_{n}:S.T, respectively. Similarly, I write t1,,tn\langle t_{1},\dots,t_{n}\rangle in place of t1,t2,tn1,tn\langle t_{1},\langle t_{2},\dots\langle t_{n-1},t_{n}\rangle\dots\rangle\rangle. Additionally, I shall write STS\varotimes T for x:S.T\bigoplus x:S.T when xx does not occur free in TT, and STS\multimap T instead of TST\bbslash S. I also generally write e¯\underline{e} simply as ee, i.e. I treat embedding of elimination forms into introduction forms as an implicit operation, rather than an explicit one.

I claim that LLFDCσ is an ideal setting in which to conduct the metatheory of ordinary (intuitionistic) linear logic, as I shall now demonstrate. I will show, in particular, that LLFDCσ is capable of representing cut admissibility for intuitionistic linear sequent calculus in a manner which avoids the problems with such representations in prior linear dependent type theories highlighted by Reed (reed, Ree09).

I follow the method of Cervesato & Pfenning (cervesato-pfenning, CP02), as adapted by Reed (reed, Ree09), in representing linear sequent calculus via HOAS, with suitable modifications for the specificities of LLFDCσ. We begin by postualting an atomic type of propositions

𝖯𝗋𝗈𝗉(𝟙)Σ\mathsf{Prop}(\mathbbm{1})\in\Sigma

which is then used to parameterize atomic type families of antecedents and consequents, respectively:

𝖠𝗇𝗍𝖾(𝖯𝗋𝗈𝗉)Σ𝖢𝗈𝗇𝗌𝖾(𝖯𝗋𝗈𝗉)Σ\mathsf{Ante}(\mathsf{Prop}\langle\rangle)\in\Sigma\qquad\mathsf{Conse}(\mathsf{Prop}\langle\rangle)\in\Sigma

the idea being that a derivation a1,,anca_{1},\dots,a_{n}\vdash c in intuitionistic linear sequent calculus corresponds to a closed term of type

a1,,an,c:𝖯𝗋𝗈𝗉.(𝖠𝗇𝗍𝖾(a1)𝖠𝗇𝗍𝖾(an))𝖢𝗈𝗇𝗌𝖾(c)\forall a_{1},\dots,a_{n},c:\mathsf{Prop}\langle\rangle.(\mathsf{Ante}(a_{1})\varotimes\dots\varotimes\mathsf{Ante}(a_{n}))\multimap\mathsf{Conse}(c)

We then include constructors on propositions corresponding to the connectives of linear logic. For illustrative purposes, I concentrate on the linear implication \multimap, represented as follows:

:𝖯𝗋𝗈𝗉𝖯𝗋𝗈𝗉𝖯𝗋𝗈𝗉Σ{\multimap}:\mathsf{Prop}\langle\rangle\multimap\mathsf{Prop}\langle\rangle\multimap\mathsf{Prop}\langle\rangle\in\Sigma

For the sake of legibility, I write and aba\multimap b as an abbreviation for ab\multimap\triangleleft a\triangleleft b. We then have the following constructors for derivations, corresponding to the left/right rules of each of implication in linear sequent calculus:

𝖱:a,b:𝖯𝗋𝗈𝗉.(𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b))𝖢𝗈𝗇𝗌𝖾(ab)Σ𝖫:a,b,c:𝖯𝗋𝗈𝗉.𝖢𝗈𝗇𝗌𝖾(a)(𝖠𝗇𝗍𝖾(b)𝖢𝗈𝗇𝗌𝖾(c))𝖠𝗇𝗍𝖾(ab)𝖢𝗈𝗇𝗌𝖾(c)Σ\begin{array}[]{rcll}{\multimap}\mathsf{R}&:&\forall a,b:\mathsf{Prop}\langle\rangle.\\ &&(\mathsf{Ante}(a)\multimap\mathsf{Conse}(b))\multimap\mathsf{Conse}(a\multimap b)&\in\Sigma\\ {\multimap}\mathsf{L}&:&\forall a,b,c:\mathsf{Prop}\langle\rangle.\mathsf{Conse}(a)\\ &&\multimap(\mathsf{Ante}(b)\multimap\mathsf{Conse}(c))\\ &&\multimap\mathsf{Ante}(a\multimap b)\multimap\mathsf{Conse}(c)&\in\Sigma\end{array}

Additionally, we have the following constructors, corresponding to the Cut and Identity rules:

𝗂𝖽:a:𝖯𝗋𝗈𝗉.𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(a)Σ𝖼𝗎𝗍:a,b:𝖯𝗋𝗈𝗉.(𝖢𝗈𝗇𝗌𝖾(a)(𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b)))𝖢𝗈𝗇𝗌𝖾(b)Σ\begin{array}[]{rcl}\mathsf{id}&:&\forall a:\mathsf{Prop}\langle\rangle.\mathsf{Ante}(a)\multimap\mathsf{Conse}(a)\in\Sigma\\ \mathsf{cut}&:&\forall a,b:\mathsf{Prop}\langle\rangle.\\ &&(\mathsf{Conse}(a)\otimes(\mathsf{Ante}(a)\multimap\mathsf{Conse}(b)))\multimap\mathsf{Conse}(b)\in\Sigma\end{array}

Our goal, then, is to give a procedure for converting a derivation making use of 𝖼𝗎𝗍\mathsf{cut} into a cut-free derivation. For this purpose, we introduce a type family representing constructions of cut-free proofs:

𝖢𝖥(a:𝖯𝗋𝗈𝗉.𝖢𝗈𝗇𝗌𝖾(a))Σ\mathsf{CF}(\bigoplus a:\mathsf{Prop}\langle\rangle.\mathsf{Conse}(a))\in\Sigma

We then have the following constructors for 𝖢𝖥\mathsf{CF} in cases where it is applied to a proof constructed from the identity or left/right rules:

𝖼𝖿𝖨𝖽:a:𝖯𝗋𝗈𝗉.qa:𝖠𝗇𝗍𝖾(a).𝖢𝖥a,𝗂𝖽aqaΣ𝖼𝖿𝖱:a,b:𝖯𝗋𝗈𝗉.f:(𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b)).(q:𝖠𝗇𝗍𝖾(a).𝖢𝖥b,fq)𝖢𝖥b,𝖱abfΣ𝖼𝖿𝖫:a,b,c:𝖯𝗋𝗈𝗉.pa:𝖢𝗈𝗇𝗌𝖾(a).f:(𝖠𝗇𝗍𝖾(b)𝖢𝗈𝗇𝗌𝖾(c)).qab:𝖠𝗇𝗍𝖾(ab).𝖢𝖥a,pa(qb:𝖠𝗇𝗍𝖾(b).𝖢𝖥c,fqb)𝖢𝖥c,𝖫abcpafqabΣ\begin{array}[]{rcll}\mathsf{cfId}&:&\forall a:\mathsf{Prop}\langle\rangle.\forall q_{a}:\mathsf{Ante}(a).\\ &&\mathsf{CF}\langle a,\mathsf{id}\cdot a\triangleleft q_{a}\rangle&\in\Sigma\\ \mathsf{cf}{\multimap}\mathsf{R}&:&\forall a,b:\mathsf{Prop}\langle\rangle.\forall f:(\mathsf{Ante}(a)\multimap\mathsf{Conse}(b)).\\ &&(\forall q:\mathsf{Ante}(a).\mathsf{CF}\langle b,f\triangleleft q\rangle)\\ &&\multimap\mathsf{CF}\langle b,{\multimap}\mathsf{R}\cdot a\cdot b\triangleleft f\rangle&\in\Sigma\\ \mathsf{cf}{\multimap}\mathsf{L}&:&\forall a,b,c:\mathsf{Prop}\langle\rangle.\forall p_{a}:\mathsf{Conse}(a).\\ &&\forall f:(\mathsf{Ante}(b)\multimap\mathsf{Conse}(c)).\\ &&\forall q_{a\multimap b}:\mathsf{Ante}(a\multimap b).\\ &&\mathsf{CF}\langle a,p_{a}\rangle\\ &&\multimap(\forall q_{b}:\mathsf{Ante}(b).\mathsf{CF}\langle c,f\triangleleft q_{b}\rangle)\\ &&\multimap\mathsf{CF}\langle c,{\multimap}\mathsf{L}\cdot a\cdot b\cdot c\triangleleft p_{a}\triangleleft f\triangleleft q_{a\multimap b}\rangle&\in\Sigma\end{array}

To handle the case where 𝖢𝖥\mathsf{CF} is applied to a derivation whose outermost constructor is 𝖼𝗎𝗍\mathsf{cut}, we further introduce the following relation to capture single-step cut reduction:

𝖢𝗎𝗍𝖲𝗍𝖾𝗉(a,b:𝖯𝗋𝗈𝗉.(𝖢𝗈𝗇𝗌𝖾(a)(𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b)))×𝖢𝗈𝗇𝗌𝖾(b))Σ\mathsf{CutStep}\left(\begin{array}[]{l}\bigoplus a,b:\mathsf{Prop}\langle\rangle.\\ (\mathsf{Conse}(a)\otimes(\mathsf{Ante}(a)\multimap\mathsf{Conse}(b)))\times\mathsf{Conse}(b)\end{array}\right)\in\Sigma

Following Reed (reed, Ree09), we use the product type former ×\times to allow forming a derivation of type 𝖢𝗈𝗇𝗌𝖾(b)\mathsf{Conse}(b) in the same context as the corresponding inputs to cut, which are themselves represented with the type 𝖢𝗈𝗇𝗌𝖾(a)(𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b))\mathsf{Conse}(a)\otimes(\mathsf{Ante}(a)\multimap\mathsf{Conse}(b)), which must therefore split up the context accordingly. We then add the following:

𝖼𝖿𝖢𝗎𝗍:a,b:𝖯𝗋𝗈𝗉.p:((𝖢𝗈𝗇𝗌𝖾(a)(𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b)))×𝖢𝗈𝗇𝗌𝖾(b)).𝖢𝗎𝗍𝖲𝗍𝖾𝗉a,b,p𝖢𝖿b,π2(p)𝖢𝖥b,𝖼𝗎𝗍abπ1(p)Σ\begin{array}[]{rcll}\mathsf{cfCut}&:&\forall a,b:\mathsf{Prop}\langle\rangle.\\ &&\forall p:\begin{array}[t]{@{}l}((\mathsf{Conse}(a)\otimes(\mathsf{Ante}(a)\multimap\mathsf{Conse}(b)))\\ ~{}\times~{}\mathsf{Conse}(b)).\end{array}\\ &&\mathsf{CutStep}\langle a,b,p\rangle\\ &&\multimap\mathsf{Cf}\langle b,\pi_{2}(p)\rangle\\ &&\multimap\mathsf{CF}\langle b,\mathsf{cut}\cdot a\cdot b\triangleleft\pi_{1}(p)\rangle&\in\Sigma\end{array}

We encode the cut reduction procedure via axioms of the form

𝖢𝗎𝗍𝖲𝗍𝖾𝗉a,b,(s[p1,,pn],f[pn+1,,pn+m],t[p1,,pn+m])\mathsf{CutStep}\langle a,b,(\langle s[p_{1},\dots,p_{n}],f[p_{n+1},\dots,p_{n+m}]\rangle,t[p_{1},\dots,p_{n+m}])\rangle

where p1,,pn+mp_{1},\dots,p_{n+m} are some universally-quantified parameters. Note that the construction of 𝖢𝗎𝗍𝖲𝗍𝖾𝗉\mathsf{CutStep} forces these parameters to be used linearly in each of s,f,ts,f,t. This is the key to the correct behavior of this representation of Cut Admissibility.

For instance, we have the following axiom for handling Principal Cuts (i.e. where a left rule meets a right rule):

𝗉𝗋𝗂𝗇:a,b,c:𝖯𝗋𝗈𝗉.f:𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b).pa:𝖢𝗈𝗇𝗌𝖾(a)g:𝖠𝗇𝗍𝖾(b)𝖢𝗈𝗇𝗌𝖾(c)𝖢𝗎𝗍𝖲𝗍𝖾𝗉ab,c,(𝖱abf,λq.𝖫abpagq,𝖼𝗎𝗍bc𝖼𝗎𝗍abpa,f,g)\begin{array}[]{rcl}\mathsf{prin}{\multimap}&:&\forall a,b,c:\mathsf{Prop}\langle\rangle.\\ &&\forall f:\mathsf{Ante}(a)\multimap\mathsf{Conse}(b).\\ &&\forall p_{a}:\mathsf{Conse}(a)\\ &&\forall g:\mathsf{Ante}(b)\multimap\mathsf{Conse}(c)\\ &&\multimap\mathsf{CutStep}\langle a\multimap b,c,\\ &&\qquad(\langle{\multimap}\mathsf{R}\cdot a\cdot b\triangleleft f,\lambda q.{\multimap}\mathsf{L}\cdot a\cdot b\triangleleft p_{a}\triangleleft g\triangleleft q\rangle,\\ &&\qquad\qquad\mathsf{cut}\cdot b\cdot c\triangleleft\langle\mathsf{cut}\cdot a\cdot b\triangleleft\langle p_{a},f\rangle,g\rangle)\rangle\end{array}

The other axioms for various cases arising from Cut follow similarly. Note that the linearity constraints enforced upon the parameters to 𝖢𝗎𝗍𝖲𝗍𝖾𝗉\mathsf{CutStep} ensure that every derivation occurring as a parameter in the inputs to a cut must be used in the same quantity in the output of the cut reduction.

It follows that Reed’s examples (reed, Ree09) of spurious Cut Elimination rules that can be written in other linear logical frameworks do not apply to the above. In particular, Reed considers a case where, instead of the usual Right rule for \multimap, we instead had

𝖱𝖻𝖺𝖽2:a,b:𝖯𝗋𝗈𝗉.(𝖠𝗇𝗍𝖾(a)𝖠𝗇𝗍𝖾(a)𝖢𝗈𝗇𝗌𝖾(b))𝖢𝗈𝗇𝗌𝖾(ab)\begin{array}[]{rcl}{\multimap}\mathsf{Rbad}_{2}&:&\forall a,b:\mathsf{Prop}\langle\rangle.\\ &&(\mathsf{Ante}(a)\multimap\mathsf{Ante}(a)\multimap\mathsf{Conse}(b))\\ &&\multimap\mathsf{Conse}(a\multimap b)\end{array}

In which case the corresponding cut reduction axiom for a principal cut would have to look something like

𝖢𝗎𝗍𝖲𝗍𝖾𝗉ab,c,(𝖱𝖻𝖺𝖽2abf,λq.𝖫abpagq,𝖼𝗎𝗍bc𝖼𝗎𝗍abpa,(λqa.fqaqa),g)\begin{array}[]{l}\mathsf{CutStep}\langle a\multimap b,c,\\ \qquad(\langle{\multimap}\mathsf{Rbad}_{2}\cdot a\cdot b\triangleleft f,\lambda q.{\multimap}\mathsf{L}\cdot a\cdot b\triangleleft p_{a}\triangleleft g\triangleleft q\rangle,\\ \qquad\qquad\mathsf{cut}\cdot b\cdot c\triangleleft\langle\mathsf{cut}\cdot a\cdot b\triangleleft\langle p_{a},(\lambda q_{a}.f\triangleright q_{a}\triangleright q_{a})\rangle,g\rangle)\end{array}

but this is ill-typed, because the variable qaq_{a} gets used twice in a term-level position in fqaqaf\triangleleft q_{a}\triangleleft q_{a}. Similarly, if we instead had

𝖱𝖻𝖺𝖽0:a,b:𝖯𝗋𝗈𝗉.𝖢𝗈𝗇𝗌𝖾(b)𝖢𝗈𝗇𝗌𝖾(ab){\multimap}\mathsf{Rbad}_{0}:\forall a,b:\mathsf{Prop}\langle\rangle.\mathsf{Conse}(b)\multimap\mathsf{Conse}(a\multimap b)

then the corresponding cut reduction axiom for a principal cut would have to look something like

𝖢𝗎𝗍𝖲𝗍𝖾𝗉ab,c,(𝖱𝖻𝖺𝖽0abf,λq.𝖫abpagq,𝖼𝗎𝗍bc𝖼𝗎𝗍abpa,(λqa.f),g)\begin{array}[]{l}\mathsf{CutStep}\langle a\multimap b,c,\\ \qquad(\langle{\multimap}\mathsf{Rbad}_{0}\cdot a\cdot b\triangleleft f,\lambda q.{\multimap}\mathsf{L}\cdot a\cdot b\triangleleft p_{a}\triangleleft g\triangleleft q\rangle,\\ \qquad\qquad\mathsf{cut}\cdot b\cdot c\triangleleft\langle\mathsf{cut}\cdot a\cdot b\triangleleft\langle p_{a},(\lambda q_{a}.f)\rangle,g\rangle)\end{array}

but this is again ill-typed because now the variable qaq_{a} does not get used at the term level in the expression ff.

Hence Reed’s problem of representing a cut admissibility relation so as to allow for only linear programs to be represented by this relation is solved in LLFDCσ. From here, one may apply the usual structural induction on complexity of propositions / proofs involved in cuts to show that cut reduction terminates, and hence for every derivation pap_{a} of type 𝖢𝗈𝗇𝗌𝖾(a)\mathsf{Conse}(a) there is a corresponding proof of type 𝖢𝖥a,pa\mathsf{CF}\langle a,p_{a}\rangle.

4. Conclusion & Outlook

The foregoing, I hope, constitutes a first step toward the theory of LFDCs and their internal language, hence also toward a substructural dependent type theory at the right level of generality. Taking stock, we have seen that many of the constructs of ordinary dependent type theory (dependent pair/function types, etc.) can be given suitably-substructural analogues in this setting, and these enjoy many of the same metatheoretic desiderata, including type soundness and decidability. Moreover, these constructs are better-behaved than those of prior substructural dependent type theories, in that they do not suffer the same issues with representing substructural constraints in the formation of parameters to type families.

Of course, much remains to be done in fleshing out this theory. On the syntactic side of things, we may hope to extend the catalogue of constructs available in substructural dependent type theory with other mainstays of type theory, e.g. universes, inductive types, coinductive types, etc. On the semantic side, a fully-rigorous treatment of the informal semantics sketched in this paper is in order, including full definitions of LFDCs and associated constructs, along with a proof that the syntactic models of this type theory are themselves strict LFDCs that are equivalent to those in which they are interpreted. Moreover, the type theory of LFDCs should be applicable in all LFDCs, not just strict ones, provided the following conjecture:

Conjecture 4.1.

Every LFDC (with type-level weakening, function types, products, etc.) is equivalent to a strict one.

4.1. Toward the type theory of monoidal topoi

Beyond general development of the type theory LFDCs, a specific application of this theory is toward constructing a type theory for working internally in monoidal topoi, i.e. topoi equipped with an additional (bi)closed monoidal structure. Such topoi arise naturally in the analysis of substructurally-typed programming languages – if the types of a language LL form a monoidal category L\mathcal{M}_{L}, then the presheaf category on L\mathcal{M}_{L} is a monoidal topos via Day Convolution, whose internal language is essentially the logic of LL-programs.

A type theory for such monoidal topoi must therefore combine aspects of ordinary dependent type theory, arising from the topos in the usual way, with the substructural aspect present in the topos due to its monoidal structure. Viewing this situation through the lens of LFDCs reveals that such monoidal topoi in fact consist of not one but two LFDC structures, one Cartesian and given by the usual comprehension category structure on the topos, the other given by the monoidal structure on the topos as in Ex. 2.2. What these two LFDC structures have in common is their shared category of contexts/closed types, i.e. the underlying topos. Generalizing this situation slightly, we may consider pairs of LFDCs whose categories of contexts/closed types are equivalent. The functors constituting such an equivalence give ways of going back and forth between the type theories of these LFDCs in restricted contexts, and in this sense function as modalities on these type theories.

This in turn suggests that the right way to type-theoretically capture such an equivalence is to make use of constructs from modal type theory (c.f. (multimodal, Gra+20)) in the type theory of LFDCs. Adapting such constructs from the usual categorical semantics of dependent type theory to the setting of LFDCs, and correspondingly from intuitionsitic to substructural dependent type theory, remains to be done. But the above reasoning suggests that if it can be carried out, such a marriage of modal and substructural type theory may yield significant benefits for the analysis of substructural programs.

Going even further, we may consider type theories interpreted not only in monoidal topoi, but monoidal \infty-topoi, i.e. models of Homotopy Type Theory (HoTT) equipped with a suitable notion of substructurality. In some ways, this is more natural from a computational point of view, since the internal language of 1-topoi is extensional Martin-Löf Type Theory, for which type checking is undecidable, while it is possible to give a type theory for HoTT possessing the normalization and canonicity properties (sterling-angiuli, SA21).

A closely related line of recent work is the form of linear dependent type theory devised by Mitchell Riley in his thesis (riley, Ril22). This approach to linear dependent type theory makes use of ideas of bunched logic, and is based on a specific model of Homotopy Type Theory in parameterized spectra. Potential applications of this type theory in quantum certification have been further considered by e.g. Myers, Riley, Sati & Schreiber (quantum, Mye+23). It remains to be seen whether and how this type theory is related to the form of substructural dependent type theory developed in this paper, i.e. whether one subsumes the other, etc. Such intertheoretic connections thus offer yet another avenue to be explored in developing the general theory of substructural dependent types.

References

  • (1) Robert Atkey “The Syntax and Semantics of Quantitative Type Theory” In LICS ’18: 33rd Annual ACM/IEEE Symposium on Logic in Computer Science, July 9–12, 2018, Oxford, United Kingdom, 2018 DOI: 10.1145/3209108.3209189
  • (2) Iliano Cervesato and Frank Pfenning “A Linear Logical Framework” In Information and Computation 179.1, 2002, pp. 19–75 DOI: https://doi.org/10.1006/inco.2001.2951
  • (3) N.G. de Bruijn “Telescopic mappings in typed lambda calculus” In Information and Computation 91.2, 1991, pp. 189–204 DOI: https://doi.org/10.1016/0890-5401(91)90066-B
  • (4) Jean-Yves Girard “Linear logic” In Theoretical Computer Science 50.1, 1987, pp. 1–101 DOI: https://doi.org/10.1016/0304-3975(87)90045-4
  • (5) Daniel Gratzer, G.. Kavvos, Andreas Nuyts and Lars Birkedal “Multimodal Dependent Type Theory”, LICS ’20 Saarbrücken, Germany: Association for Computing Machinery, 2020, pp. 492–506 DOI: 10.1145/3373718.3394736
  • (6) Bart Jacobs “Comprehension categories and the semantics of type dependency” In Theoretical Computer Science 107.2, 1993, pp. 169–207 DOI: https://doi.org/10.1016/0304-3975(93)90169-T
  • (7) Neelakantan R. Krishnaswami, Pierre Pradic and Nick Benton “Integrating Linear and Dependent Types” In Proceedings of the 42nd Annual ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL ’15 Mumbai, India: Association for Computing Machinery, 2015, pp. 17–30 DOI: 10.1145/2676726.2676969
  • (8) Per Martin-Löf “An Intuitionistic Theory of Types: Predicative Part” In Logic Colloquium ’73 80, Studies in Logic and the Foundations of Mathematics Elsevier, 1975, pp. 73–118 DOI: https://doi.org/10.1016/S0049-237X(08)71945-1
  • (9) David Jaz Myers and Matteo Cappucci “The Para Construction as a Distributive Law” Talk given at Virtual Double Categories Workshop, 2022 URL: https://bryceclarke.github.io/virtual-double-categories-workshop/slides/david-jaz-myers.pdf
  • (10) Conor McBride “I Got Plenty o’ Nuttin”’ In A List of Successes That Can Change the World: Essays Dedicated to Philip Wadler on the Occasion of His 60th Birthday Cham: Springer International Publishing, 2016, pp. 207–233 DOI: 10.1007/978-3-319-30936-1˙12
  • (11) David Jaz Myers, Mitchell Riley, Hisham Sati and Urs Schreiber “Effective Quantum Certification via Linear Homotopy Types”, 2023 URL: https://ncatlab.org/schreiber/files/QPinLHOTT-ExtendedAbstract-230315.pdf
  • (12) Jason Reed “A Hybrid Logical Framework”, 2009
  • (13) Mitchell Riley “A Bunched Homotopy Type Theory for Synthetic Stable Homotopy Theory”, 2022 DOI: https://doi.org/10.14418/wes01.3.139
  • (14) Jonathan Sterling and Carlo Angiuli “Normalization for Cubical Type Theory” In 2021 36th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS), 2021, pp. 1–15 DOI: 10.1109/LICS52264.2021.9470719

Appendix A Auxiliary Definitions

Definition A.1

The functor Δ\oplus_{\llparenthesis\Delta\rrparenthesis} associated to a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis is defined by recursion on Δ\llparenthesis\Delta\rrparenthesis as follows:

ϵ=Id𝔗(Γ)Δ,x:S=ΔS\oplus_{\epsilon}=\text{Id}_{\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket)}\qquad\oplus_{\llparenthesis\Delta\rrparenthesis,x:\llbracket S\rrbracket}=\oplus_{\llparenthesis\Delta\rrparenthesis}\circ\oplus_{\llbracket S\rrbracket}
Definition A.2

Similarly, the substitution f(Θ)f^{*}(\llparenthesis\Theta\rrparenthesis) of a morphism f:ΓΔf:\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket\to\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket\in\mathfrak{C} into a telescope Δ,Θ\llparenthesis\Delta\rrparenthesis,\llparenthesis\Theta\rrparenthesis is defined by recursion on Θ\llparenthesis\Theta\rrparenthesis:

f(ϵ)=ϵf(x:S,Θ)=x:f(S),f(S)(Θ)f^{*}(\epsilon)=\epsilon\qquad f^{*}(x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis)=x:f^{*}(\llbracket S\rrbracket),f_{\bullet}(\llbracket S\rrbracket)^{*}(\llparenthesis\Theta\rrparenthesis)

and likewise, the weakening ωΓS(Δ)\omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis) of a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis is defined by recursion on Δ\llparenthesis\Delta\rrparenthesis:

ωΓS(ϵ)=ϵωΓS(y:T,Δ)=y:ωΓS(T),ΩΓS,T(Δ)\omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket}(\epsilon)=\epsilon\quad\omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket}(y:\llbracket T\rrbracket,\llparenthesis\Delta\rrparenthesis)=y:\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket}(\llbracket T\rrbracket),\Omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket,\llbracket T\rrbracket}(\llparenthesis\Delta\rrparenthesis)

where

ΩΓS,T(ϵ)=ϵ\Omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket,\llbracket T\rrbracket}(\epsilon)=\epsilon

and

ΩΓS,T(z:R,Δ)=z:ΩΓS,T(R),(α1)(ΩΓS,T(R)(α(Δ)))\begin{array}[]{l}\Omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket,\llbracket T\rrbracket}(z:\llbracket R\rrbracket,\llparenthesis\Delta\rrparenthesis)=\\ \quad z:\Omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket,\llbracket T\rrbracket}(\llbracket R\rrbracket),(\alpha^{-1})^{*}(\Omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket,\varoplus_{\llbracket T\rrbracket}(\llbracket R\rrbracket)}(\alpha^{*}(\llparenthesis\Delta\rrparenthesis)))\end{array}
Definition A.3

The type-level reassociation

𝖺𝗌𝖼ΓΔ:Γ,ΔΓ(Δ){\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}:\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket\simeq\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket)

of a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis is defined by recursion on Δ\llparenthesis\Delta\rrparenthesis:

𝖺𝗌𝖼Γϵ=η1𝖺𝗌𝖼Γx:S,Δ=𝖺𝗌𝖼Γ,x:SΔα1{\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\epsilon}=\eta^{-1}\qquad{\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{x:\llbracket S\rrbracket,\llparenthesis\Delta\rrparenthesis}={\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}^{\llparenthesis\Delta\rrparenthesis}\circ\alpha^{-1}

and likewise the term-level reassociation

𝖺𝗌𝖼ΓΔS:Δ(S)Δ(((𝖺𝗌𝖼ΓΔ)1)(S)){\oplus}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}:\oplus_{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket)\simeq\oplus_{\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket}((({\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis})^{-1})^{*}(\llbracket S\rrbracket))
𝖺𝗌𝖼ΓϵS=1𝖺𝗌𝖼Γx:T,ΔS=βT(𝖺𝗌𝖼Γ,x:TΔS){\oplus}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\epsilon\mid\llbracket S\rrbracket}=\ell^{-1}\qquad{\oplus}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{x:\llbracket T\rrbracket,\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}=\beta\circ\oplus_{\llbracket T\rrbracket}({\oplus}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket T\rrbracket}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket})
Definition A.4

The substitution (s):Γ,ΔΓ(S){\downarrow}(\llbracket s\rrbracket):\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket\to\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket S\rrbracket) of a term s:ΔS𝔗(Γ)\llbracket s\rrbracket:\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket\to\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket) is defined as

(s)=Γ(s)𝖺𝗌𝖼ΓΔ{\downarrow}(\llbracket s\rrbracket)=\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket s\rrbracket)\circ{\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}

and (s):Γ,Δ,(s)(Θ)Γ,x:S,Θ{\Downarrow}(\llbracket s\rrbracket):\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis,{\downarrow}(\llbracket s\rrbracket)^{*}(\llparenthesis\Theta\rrparenthesis)\rrbracket\to\llbracket\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\llparenthesis\Theta\rrparenthesis\rrbracket is defined as

(s)=𝖺𝗌𝖼Γ,x:SΘ(s)(Θ)(𝖺𝗌𝖼Γ,x:SΘ)1{\Downarrow}(\llbracket s\rrbracket)={\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}^{\llparenthesis\Theta\rrparenthesis}\circ{\downarrow}(\llbracket s\rrbracket)_{\bullet}(\llbracket\llparenthesis\Theta\rrparenthesis\rrbracket)\circ({\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}^{\llparenthesis\Theta\rrparenthesis})^{-1}
Definition A.5

The lifting functors ΓΔ:𝔗(Γ)𝔗(Γ,Δ)\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket)\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket) and ΓΔS:𝔗(Γ(S))𝔗(Γ,Δ(ΓΔ(S)))\Uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket S\rrbracket))\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket_{\bullet}(\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket))) for a telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis and type S𝔗(Γ)\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket) are defined by recursion on Δ\llparenthesis\Delta\rrparenthesis as follows:

Γϵ=Id𝔗(Γ)Γy:T,Δ=Γ,y:TΔωΓT\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\epsilon}=\text{Id}_{\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket)}\qquad\uparrow_{\llparenthesis\Gamma\rrparenthesis}^{y:\llbracket T\rrbracket,\llparenthesis\Delta\rrparenthesis}=\uparrow_{\llparenthesis\Gamma\rrparenthesis,y:\llbracket T\rrbracket}^{\llparenthesis\Delta\rrparenthesis}\circ\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket T\rrbracket}
Γϵ,S=Id𝔗(Γ(S))Γy:T,ΔS=Γ,y:TΔωΓT(S)ΩΓT,S\Uparrow_{\llparenthesis\Gamma\rrparenthesis}^{\epsilon,\llbracket S\rrbracket}=\text{Id}_{\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket_{\bullet}(\llbracket S\rrbracket))}\quad\Uparrow_{\llparenthesis\Gamma\rrparenthesis}^{y:\llbracket T\rrbracket,\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}={\Uparrow}_{\llparenthesis\Gamma\rrparenthesis,y:\llbracket T\rrbracket}^{\llparenthesis\Delta\rrparenthesis\mid\omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket T\rrbracket}(\llbracket S\rrbracket)}\circ\Omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket T\rrbracket,\llbracket S\rrbracket}

and the telescopic weakening functor

𝖶ΓSΔ:𝔗(Γ,Δ)𝔗(Γ,x:S,ωΓS(Δ))\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}:\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis\rrbracket)\to\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket,\omega_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket}(\llparenthesis\Delta\rrparenthesis)\rrbracket)

is defined as

𝖶ΓSΔ=(𝖺𝗌𝖼Γ,x:SΔ)ΩΓS,Δ((𝖺𝗌𝖼Γ,x:SΔ)1)\mathsf{W}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket S\rrbracket\mid\llparenthesis\Delta\rrparenthesis}=({\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}^{\llparenthesis\Delta\rrparenthesis})^{*}\circ\Omega_{\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket}^{\llbracket S\rrbracket,\llbracket\llparenthesis\Delta\rrparenthesis\rrbracket}\circ(({\bullet}\mathsf{asc}_{\llparenthesis\Gamma\rrparenthesis,x:\llbracket S\rrbracket}^{\llparenthesis\Delta\rrparenthesis})^{-1})^{*}
Definition A.6

The projection map

𝗉𝗋𝗈𝗃ΓΔS:Δ,x:ΓΔ(S)S𝔗(Γ)\mathsf{proj}_{\llparenthesis\Gamma\rrparenthesis}^{\llbracket\Delta\rrbracket\mid\llbracket S\rrbracket}:\llbracket\llparenthesis\Delta\rrparenthesis,x:{\uparrow}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis}(\llbracket S\rrbracket)\rrbracket\xrightarrow[]{}\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket)

for each telescope Γ,Δ\llparenthesis\Gamma\rrparenthesis,\llparenthesis\Delta\rrparenthesis and type S𝔗(Γ)\llbracket S\rrbracket\in\mathfrak{T}(\llbracket\llparenthesis\Gamma\rrparenthesis\rrbracket) is defined by recursion on Δ\llparenthesis\Delta\rrparenthesis as follows:

𝗉𝗋𝗈𝗃ΓϵS=idS\mathsf{proj}_{\llparenthesis\Gamma\rrparenthesis}^{\epsilon\mid\llbracket S\rrbracket}=\text{id}_{\llbracket S\rrbracket}
𝗉𝗋𝗈𝗃ΓΔ,x:TS=𝗉𝗋𝗈𝗃ΓΔSΔ(T,)\mathsf{proj}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis,x:\llbracket T\rrbracket\mid\llbracket S\rrbracket}=\mathsf{proj}_{\llparenthesis\Gamma\rrparenthesis}^{\llparenthesis\Delta\rrparenthesis\mid\llbracket S\rrbracket}\circ\varoplus_{\llparenthesis\Delta\rrparenthesis}(\ell\circ\langle\top_{\llbracket T\rrbracket},-\rangle)