Definitional Functoriality and Generic Type-Former Action
Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
Even a coherent cast graph leaves repetitive work. Composable casts 𝑔:𝐴→𝐵 and 𝑓:𝐵→𝐶 induce list actions, dependent-pair actions, and actions for every other positive type former. Writing these functions separately gives only propositional equations 𝗆𝖺𝗉𝗂𝖽=𝗂𝖽 and 𝗆𝖺𝗉𝑓(𝗆𝖺𝗉𝑔𝑥)=𝗆𝖺𝗉(𝑓∘𝑔)𝑥. Propositional proofs do not make nested casts disappear during conversion. The calculus below adds generic actions and the two functor laws to judgmental equality at a boundary where normalization and checking remain decidable.
Write MLTT𝗆𝖺𝗉 for the principal system. The calculus extends intensional MLTT with a primitive 𝗆𝖺𝗉𝐹 for each parametrized type former 𝐹 of MLTT, namely Π, Σ, +, lists, 𝖶, and the identity type; 0 and 1 are unparametrized and retain their ordinary MLTT rules. The source proves metatheory for a smaller, representative fragment: one universe with 0, Π, Σ, lists, and ℕ, together with their map operators. Every endpoint below is stated for that proved fragment, and the paper owns the rest. Each type former 𝐹 has a domain of parameters, a family of morphisms 𝗁𝗈𝗆𝐹(𝑋,𝑌), identity and composition in that domain, and an action 𝗆𝖺𝗉𝐹. The annotated action syntax stores the tuple of former, source parameter, target parameter, morphism, and argument. Surface notation suppresses the two endpoints after the typing premises fix them. The rules Map-Id and Map-Comp are judgmental equalities. Reduction computes maps on constructors and compacts consecutive maps on stuck neutrals; identity on a neutral is handled by conversion rather than by an expanding reduction. The source metatheory proves normalization, canonicity, equivalence of declarative and algorithmic typing, and decidable checking for the exact proved fragment. It does not generate maps for arbitrary strictly positive declarations.
The primitive action and its two new conversion rules are therefore not left implicit. If 𝑋,𝑌,𝑍 are parameters of 𝐹, 𝛼:𝗁𝗈𝗆𝐹(𝑋,𝑌), and 𝛽:𝗁𝗈𝗆𝐹(𝑌,𝑍), the rule delta is
Γ⊢𝛼:𝗁𝗈𝗆𝐹(𝑋,𝑌)Γ⊢𝑡:𝐹(𝑋)
Γ⊢𝗆𝖺𝗉𝐹(𝛼)(𝑡):𝐹(𝑌)
Map-Ty
Γ⊢𝑡:𝐹(𝑋)
Γ⊢𝗆𝖺𝗉𝐹(𝗂𝖽𝐹,𝑋)(𝑡)≡𝑡:𝐹(𝑋)
Map-Id
Γ⊢𝛼:𝗁𝗈𝗆𝐹(𝑋,𝑌)Γ⊢𝛽:𝗁𝗈𝗆𝐹(𝑌,𝑍)Γ⊢𝑡:𝐹(𝑋)
Γ⊢𝗆𝖺𝗉𝐹(𝛽)(𝗆𝖺𝗉𝐹(𝛼)(𝑡))≡𝗆𝖺𝗉𝐹(𝛽∘𝐹𝐹𝛼)(𝑡):𝐹(𝑍)
Map-Comp
The subscript on ∘𝐹𝐹 records that identities and composition are those of 𝗁𝗈𝗆𝐹; for Π and Σ they are the variance-sensitive operations calculated below.
Positive descriptions force an action
Before using the paper’s primitive type formers, compute the generic action on a small description language.
Fix a context Γ and reserve 𝐗 as a parameter marker, not as a variable that an ambient type expression may mention. The formation judgment Γ⊢𝐷𝖽𝖾𝗌𝖼 is generated as follows. The codes 𝟏 and 𝐗 are well formed. A constant code 𝐊(𝐴) is well formed only if Γ⊢𝐴𝗍𝗒𝗉𝖾 and 𝐗∉𝖥𝖵(𝐴). Products and sums require both component codes to be well formed. Finally, 𝚺(𝑎:𝐴).𝐷(𝑎) is well formed only if Γ⊢𝐴𝗍𝗒𝗉𝖾, 𝐗∉𝖥𝖵(𝐴), and Γ,𝑎:𝐴⊢𝐷(𝑎)𝖽𝖾𝗌𝖼. Thus descriptions have grammar 𝐷::=𝟏∣𝐊(𝐴)∣𝐗∣𝐷1×𝐷2∣𝐷1+𝐷2∣𝚺(𝑎:𝐴).𝐷(𝑎). For any Γ⊢𝑋𝗍𝗒𝗉𝖾, the interpretation [[𝐷]]𝑋 replaces 𝐗 by 𝑋, constants by their named types, and description products, sums, and dependent sums by the corresponding type formers. In particular, neither a constant nor the index type of a dependent sum changes when 𝑋 changes. Negative occurrences such as 𝐗→𝐴 are not descriptions.
For 𝑓:𝑋→𝑌, define 𝗆𝖺𝗉𝐷(𝑓):[[𝐷]]𝑋→[[𝐷]]𝑌 by recursion on 𝐷: 𝗆𝖺𝗉𝟏(𝑓)(∗)=∗,𝗆𝖺𝗉𝐊(𝐴)(𝑓)(𝑎)=𝑎,𝗆𝖺𝗉𝐗(𝑓)(𝑥)=𝑓(𝑥),𝗆𝖺𝗉𝐷1×𝐷2(𝑓)(𝑥1,𝑥2)=(𝗆𝖺𝗉𝐷1(𝑓)(𝑥1),𝗆𝖺𝗉𝐷2(𝑓)(𝑥2)),𝗆𝖺𝗉𝐷1+𝐷2(𝑓)(𝗂𝗇𝗅𝑥)=𝗂𝗇𝗅(𝗆𝖺𝗉𝐷1(𝑓)(𝑥)),𝗆𝖺𝗉𝐷1+𝐷2(𝑓)(𝗂𝗇𝗋𝑦)=𝗂𝗇𝗋(𝗆𝖺𝗉𝐷2(𝑓)(𝑦)),𝗆𝖺𝗉𝚺(𝑎:𝐴).𝐷(𝑎)(𝑓)(𝑎,𝑥)=(𝑎,𝗆𝖺𝗉𝐷(𝑎)(𝑓)(𝑥)). These equations are the computation rules of the generated operation. They do not silently choose an eliminator branch for a neutral. The final clause of the generated action is the typed neutral form
Γ⊢𝐷𝖽𝖾𝗌𝖼Γ⊢𝑓:𝑋→𝑌Γ⊢𝑛:[[𝐷]]𝑋𝑛𝗇𝖾𝗎𝗍𝗋𝖺𝗅
Γ⊢𝗆𝖺𝗉𝐷(𝑓)(𝑛):[[𝐷]]𝑌
Desc-Map-Neutral
and its conclusion is neutral unless a composition-compaction rule applies. For a neutral sum, product, or dependent sum, the action therefore remains stuck at the outer 𝗆𝖺𝗉𝐷; it does not project or case-split the neutral input.
For the list-layer description 𝐷:=𝟏+(𝐊(𝐴)×𝐗), the interpretation is [[𝐷]]𝑋=𝟏+(𝐴×𝑋), and the two constructors of a list layer are the two injections: 𝗇𝗂𝗅:=𝗂𝗇𝗅(∗),𝖼𝗈𝗇𝗌(𝑎,𝑥):=𝗂𝗇𝗋(𝑎,𝑥). For every 𝑓:𝑋→𝑌, the clauses of definition 120.3 compute to 𝗆𝖺𝗉𝐷(𝑓)(𝗇𝗂𝗅)≡𝗇𝗂𝗅,𝗆𝖺𝗉𝐷(𝑓)(𝖼𝗈𝗇𝗌(𝑎,𝑥))≡𝖼𝗈𝗇𝗌(𝑎,𝑓(𝑥)), because the sum clause preserves the injection, the constant clause returns 𝑎 unchanged, and the parameter clause applies 𝑓 to 𝑥. A negative description would require an action (𝑋→𝐴)→(𝑌→𝐴) from only 𝑓:𝑋→𝑌; its direction is wrong. One would need a map 𝑌→𝑋, which explains the positivity restriction.
Constructor computation does not prove these equations for a neutral input. For example, if 𝐷=𝐗+𝟏 and 𝑧:[[𝐷]]𝑋 is a variable, then 𝗆𝖺𝗉𝐷(𝗂𝖽)(𝑧) is stuck: the sum clause cannot choose 𝗂𝗇𝗅 or 𝗂𝗇𝗋. Hence it is not judgmentally equal to 𝑧 in the pre-extension calculus.
Suppose Γ⊢𝐷𝖽𝖾𝗌𝖼, Γ⊢𝑋𝗍𝗒𝗉𝖾, Γ⊢𝑌𝗍𝗒𝗉𝖾, and Γ⊢𝑍𝗍𝗒𝗉𝖾. For every Γ⊢𝑔:𝑋→𝑌, Γ⊢𝑓:𝑌→𝑍, and constructor-headed canonical value Γ⊢𝑣:[[𝐷]]𝑋, constructor computation derives 𝗆𝖺𝗉𝐷(𝗂𝖽)(𝑣)≡𝑣,𝗆𝖺𝗉𝐷(𝑓)(𝗆𝖺𝗉𝐷(𝑔)(𝑣))≡𝗆𝖺𝗉𝐷(𝑓∘𝑔)(𝑣).
Proof of Proposition 120.4 — Constructor functor laws for descriptions
Proof. Structural induction on 𝐷. For 𝟏 and 𝐊(𝐴), both sides reduce to the input. For 𝐗, the first equation is the identity computation and the second is the definition of composition. For 𝐷1×𝐷2, the computation rule exposes two components; the two induction hypotheses make the corresponding components judgmentally equal, and pair congruence closes the equations. For 𝐷1+𝐷2, case analysis exposes 𝗂𝗇𝗅 or 𝗂𝗇𝗋, and the corresponding induction hypothesis closes that branch. For 𝚺(𝑎:𝐴).𝐷(𝑎), the first component is constant and the induction hypothesis for 𝐷(𝑎) proves the second component. These are all description constructors. The sum step uses the hypothesis that 𝑣 is constructor headed. Without it, the stuck term displayed before the proposition prevents the reduction. ◻
Constructor equations remain the reduction rules of definition 120.3; Desc-Map-Comp may additionally be oriented from left to right only when its mapped argument is neutral. Thus the delta compacts neutrals without pretending that the two laws followed from the pre-extension computation rules.
Proof of Theorem 120.6 — Extended definitional functor laws for descriptions
Proof. Identity is Desc-Map-Id. Composition is Desc-Map-Comp. The premises of those rules are exactly the typing hypotheses in the theorem; no case analysis on the argument is required. ◻
The description language above has one varying parameter. An indexed family varies over a whole family at once, and the generic action follows the same recursion once the parameter code is given an index.
Fix Γ⊢𝐼𝗍𝗒𝗉𝖾. Indexed descriptions replace the code 𝐗 by a family of codes 𝐗(𝑗) for Γ⊢𝑗:𝐼: 𝐷::=𝟏∣𝐊(𝐴)∣𝐗(𝑗)∣𝐷1×𝐷2∣𝐷1+𝐷2∣𝚺(𝑎:𝐴).𝐷(𝑎). Formation is the indexed version of definition 120.2: 𝐊(𝐴), every index term 𝑗, and every dependent-sum index type 𝐴 must be formed in the ambient context and may not mention the varying family marker 𝐗. The body 𝐷(𝑎) may depend on the bound index 𝑎, and may contain the family only through codes 𝐗(𝑗). Their interpretation [[𝐷]]𝑋 is taken at a family 𝑋:𝐼→U𝑘, with [[𝐗(𝑗)]]𝑋:=𝑋(𝑗) and the remaining clauses unchanged. For a family of maps 𝑓𝑗:𝑋(𝑗)→𝑌(𝑗), the generated action 𝗆𝖺𝗉𝐷(𝑓) has the clauses of definition 120.3 together with 𝗆𝖺𝗉𝐗(𝑗)(𝑓)(𝑥)=𝑓𝑗(𝑥).
★★☆ In definition 120.7, let 𝑅:𝐼→𝐼→U𝑘 and 𝐷𝑖:=𝚺(𝑗:𝐼).(𝐊(𝑅(𝑖,𝑗))×𝐗(𝑗)). Write 𝗆𝖺𝗉𝐷𝑖(𝑓) in full for a family 𝑓𝑗:𝑋(𝑗)→𝑌(𝑗), and prove its constructor identity law by the exact induction used in proposition 120.4. Name the one clause of that induction that changes.
The domain category of a dependent product remembers variance. For 𝑋=(𝐴,𝐵) and 𝑌=(𝐴′,𝐵′), a morphism consists of 𝑔:𝐴′→𝐴,𝑓:∏𝑥:𝐴′𝐵(𝑔(𝑥))→𝐵′(𝑥). Its action is 𝗆𝖺𝗉Π(𝑔,𝑓)(ℎ):=𝜆𝑥.𝑓(𝑥)(ℎ(𝑔(𝑥))). The base map is contravariant. For dependent sums, a morphism consists of 𝑔:𝐴→𝐴′ and 𝑓:∏𝑥:𝐴𝐵(𝑥)→𝐵′(𝑔(𝑥)), with 𝗆𝖺𝗉Σ(𝑔,𝑓)(𝑥,𝑦):=(𝑔(𝑥),𝑓(𝑥)(𝑦)).
For 𝑋=(𝐴,𝐵), the product identity is (𝗂𝖽𝐴,𝜆𝑥.𝗂𝖽𝐵(𝑥)). If (𝑔1,𝑓1):𝑋→𝑌 and (𝑔2,𝑓2):𝑌→𝑍 in the contravariant product domain, their composite has 𝑔12(𝑧):=𝑔1(𝑔2(𝑧)),𝑓12(𝑧)(𝑏):=𝑓2(𝑧)(𝑓1(𝑔2(𝑧))(𝑏)). For the covariant sum domain, the identity has the same componentwise form. If (𝑔1,𝑓1):𝑋→𝑌 and (𝑔2,𝑓2):𝑌→𝑍, its composite is 𝑔21(𝑥):=𝑔2(𝑔1(𝑥)),𝑓21(𝑥)(𝑏):=𝑓2(𝑔1(𝑥))(𝑓1(𝑥)(𝑏)). The displayed fiber types determine the order; reversing either base composition makes the corresponding fiber map ill typed.
With componentwise identities and the variance-correct compositions of the displayed morphisms, 𝗆𝖺𝗉Π and 𝗆𝖺𝗉Σ satisfy identity and composition by judgmental equality.
Proof of Lemma 120.8 — Product and sum functor laws
Proof. For Π, apply the identity action to ℎ and 𝑥: beta reduction gives 𝗂𝖽(ℎ(𝗂𝖽(𝑥))), which reduces to ℎ(𝑥); function eta closes the equation. For composition, beta-reduce the two nested actions. Both sides become the same term 𝜆𝑥.𝑓2(𝑥)(𝑓1(𝑔2(𝑥))(ℎ(𝑔1(𝑔2(𝑥))))) after unfolding componentwise composition. For Σ, projection and pair computation reduce identity to (𝑥,𝑦), while both composite actions reduce to (𝑔2(𝑔1(𝑥)),𝑓2(𝑔1(𝑥))(𝑓1(𝑥)(𝑦))). ◻
These extensional type formers need no new neutral equation: beta and eta already prove their laws. Lists do not have a judgmental eta law, so a neutral 𝑙:𝖫𝗂𝗌𝗍𝐴 leaves 𝗆𝖺𝗉𝖫𝗂𝗌𝗍𝗂𝖽𝑙 stuck.
Let 𝐹 be a nonextensional positive type former, let 𝑋,𝑌,𝑍 be parameters, and in a context Γ let 𝑔:𝗁𝗈𝗆𝐹(𝑋,𝑌), 𝑓:𝗁𝗈𝗆𝐹(𝑌,𝑍), and 𝑛:𝐹(𝑋) be well typed. A compacted neutral is either a neutral 𝑛 or one outer action 𝗆𝖺𝗉𝐹(ℎ)(𝑛) for a well-typed morphism ℎ. Weak-head reduction includes 𝗆𝖺𝗉𝐹(𝑓)(𝗆𝖺𝗉𝐹(𝑔)(𝑛))⟶𝗆𝖺𝗉𝐹(𝑓∘𝐹𝐹𝑔)(𝑛) only when the mapped argument is neutral and no constructor computation applies. Conversion additionally identifies 𝗆𝖺𝗉𝐹(𝗂𝖽)(𝑛) with 𝑛.
A base weak-head frame has one of the following forms: 𝐾::=[]𝑢∣𝜋1[]∣𝜋2[]∣𝗂𝗇𝖽ℕ([];𝑃;𝑏0;𝑏𝑠)∣𝗂𝗇𝖽𝖫𝗂𝗌𝗍([];𝑃;𝑏𝜀;𝑏::)∣𝗆𝖺𝗉𝐹(𝛼)([]). No frame places its hole in an argument, motive, branch, type annotation, or morphism. Evaluation contexts are generated inductively by 𝐸::=[]∣𝐾[𝐸]; hence every context contains exactly one distinguished term occurrence. Their typing is generated from
The final premise forbids another term occurrence of the hole name; dependence on 𝑧 in the displayed types remains permitted. The ordinary typing rules instantiate Ctx-Frame for application, projections, and the two eliminators. The functorial extension adds exactly the frame
Γ⊢𝛼:𝗁𝗈𝗆𝐹(𝑋,𝑌)
Γ,𝑧:𝐹(𝑋)⊢𝗆𝖺𝗉𝐹(𝛼)(𝑧):𝐹(𝑌)
Frame-Map
The base frames include genuinely dependent conclusions. For example, the list-eliminator frame and dependent second projection have the exact shapes
Thus the result family is 𝑃(𝑧) for dependent list elimination and 𝐶(𝜋1𝑧) for the second projection; replacing either by a fixed result type would lose the typing rule.
It remains to select a redex rather than merely describe a hole. Let 𝗁𝗋𝖾𝖽(𝑟) hold exactly for beta redexes, projections of pairs, the zero and successor cases of ℕ-elimination, the nil and cons cases of list elimination, an action applied to a constructor covered by its action equation, and 𝗆𝖺𝗉𝐹(𝛽)(𝗆𝖺𝗉𝐹(𝛼)(𝑛)) with neutral 𝑛. The latter is the compaction redex; an identity action on a neutral is not a head redex because Map-Id belongs to conversion. The selection predicate 𝖲𝖾𝗅𝖾𝖼𝗍(𝐸,𝑡,𝑟) is generated by
𝗁𝗋𝖾𝖽(𝑡)
𝖲𝖾𝗅𝖾𝖼𝗍([],𝑡,𝑡)
Select-Here
¬𝗁𝗋𝖾𝖽(𝐾[𝑡])𝖲𝖾𝗅𝖾𝖼𝗍(𝐸,𝑡,𝑟)
𝖲𝖾𝗅𝖾𝖼𝗍(𝐾[𝐸],𝐾[𝑡],𝑟)
Select-Under
The negative premise gives outermost priority to constructor computation and map compaction. Plugging is capture avoiding.
Proof of Lemma 120.11 — Uniqueness of weak-head selection
Proof. Induct on the first selection derivation. In Select-Here, 𝗁𝗋𝖾𝖽(𝑡) excludes Select-Under, whose first premise would be its negation; the second derivation is Select-Here. In Select-Under, the outer constructor of 𝑡 determines its unique frame 𝐾 because the frame grammar has one computational position per constructor. The second derivation cannot be Select-Here by the negative premise, so it uses the same frame. The induction hypothesis identifies the inner contexts and selected redexes. ◻
If Γ,𝑧:𝐴⊢𝐸[𝑧]:𝐵(𝑧), Γ⊢𝑢:𝐴, and Γ⊢𝑢′:𝐴, then Γ⊢𝐸[𝑢]:𝐵(𝑢),Γ⊢𝐸[𝑢′]:𝐵(𝑢′). If moreover Γ⊢𝑢≡𝑢′:𝐴, then Γ⊢𝐵(𝑢)≡𝐵(𝑢′)𝗍𝗒𝗉𝖾, and after converting the second term to 𝐵(𝑢), Γ⊢𝐸[𝑢]≡𝐸[𝑢′]:𝐵(𝑢).
Proof of Lemma 120.12 — Typed-context preservation
Proof. Apply the ordinary substitution lemma to the displayed derivation, first with (𝗂𝖽,𝑢) and then with (𝗂𝖽,𝑢′). This gives the two typing judgments with their possibly different result types. Substitution congruence applied to 𝑢≡𝑢′:𝐴 gives both 𝐵(𝑢)≡𝐵(𝑢′) and equality of the plugged terms. The conversion rule changes the right-hand term from type 𝐵(𝑢′) to type 𝐵(𝑢), yielding the homogeneous equality displayed in the statement. For Frame-ListInd, these two types are exactly 𝑃(𝑢) and 𝑃(𝑢′); for Frame-Snd, they are 𝐶(𝜋1𝑢) and 𝐶(𝜋1𝑢′). The new Frame-Map has the constant family 𝐵(𝑧)=𝐹(𝑌), so its case is Map-Ty and map congruence. ◻
Let 𝜎:Γ′→Γ be a well-typed simultaneous substitution, Γ⊢𝐷𝖽𝖾𝗌𝖼, Γ⊢𝑋𝗍𝗒𝗉𝖾, Γ⊢𝑌𝗍𝗒𝗉𝖾, Γ⊢𝑓:𝑋→𝑌, and Γ⊢𝑡:[[𝐷]]𝑋. Then capture-avoiding substitution in the generated syntax satisfies (𝗆𝖺𝗉𝐷(𝑓)(𝑡))[𝜎]=𝛼𝗆𝖺𝗉𝐷[𝜎](𝑓[𝜎])(𝑡[𝜎]). Here equality is alpha-equivalence of generated terms. In the named presentation, before descending under a binder, alpha-rename it outside the finite set 𝖥𝖵(𝐷)∪𝖥𝖵(𝑓)∪𝖥𝖵(𝑡)∪𝖥𝖵(𝗋𝖺𝗇𝜎)∪𝗌𝗎𝗉𝗉(Γ′), where 𝗌𝗎𝗉𝗉(Γ′) contains every name declared or occurring in the target context. Different fresh choices produce alpha-equivalent terms; no literal syntactic equality is claimed. Freshness from the domain of 𝜎 alone does not prevent capture by a term in its range.
Proof of Lemma 120.13 — Generated action commutes with substitution
Proof. Induct on 𝐷. The unit, constant, and parameter clauses follow by the definitions of substitution and generated action. The product clause applies the two induction hypotheses to the projections. The sum clauses apply the corresponding induction hypothesis below 𝗂𝗇𝗅 or 𝗂𝗇𝗋. For 𝚺(𝑎:𝐴).𝐷(𝑎), choose 𝑎 outside the five-set union printed in the statement. The first projection is substituted once, and the induction hypothesis for 𝐷(𝑎) gives the second projection. These are all description constructors. ◻
Let 𝐹 be an action-bearing primitive former in the proved fragment, let 𝜎:Γ′→Γ be well typed, and suppose Γ⊢𝑋𝗍𝗒𝗉𝖾, Γ⊢𝑌𝗍𝗒𝗉𝖾, Γ⊢𝑍𝗍𝗒𝗉𝖾, Γ⊢𝛼:𝗁𝗈𝗆𝐹(𝑋,𝑌), Γ⊢𝛽:𝗁𝗈𝗆𝐹(𝑌,𝑍), and Γ⊢𝑡:𝐹(𝑋). Then (𝗆𝖺𝗉𝐹(𝛼)(𝑡))[𝜎]=𝛼𝗆𝖺𝗉𝐹(𝛼[𝜎])(𝑡[𝜎]), with 𝑋,𝑌 and every family component of 𝛼 substituted as well. Moreover substitution sends 𝗂𝖽𝐹,𝑋 to 𝗂𝖽𝐹,𝑋[𝜎] and (𝛽∘𝐹𝐹𝛼)[𝜎] to 𝛽[𝜎]∘𝐹𝐹𝛼[𝜎]. In named syntax, every binder introduced by a primitive action is renamed outside the exact finite set 𝖥𝖵(𝐹)∪𝖥𝖵(𝛼)∪𝖥𝖵(𝛽)∪𝖥𝖵(𝑡)∪𝖥𝖵(𝗋𝖺𝗇𝜎)∪𝗌𝗎𝗉𝗉(Γ′).
Proof of Lemma 120.14 — Primitive actions commute with substitution
Proof. There are three action-bearing primitive families in the proved fragment. For Π, write 𝛼=(𝑔,𝑓) and substitute into 𝜆𝑥.𝑓(𝑥)(ℎ(𝑔(𝑥))), alpha-renaming 𝑥 outside the six-set union printed in the statement; the ordinary substitution-under-binder equation gives the displayed right-hand side, and the formulas for 𝑔12 and 𝑓12 give identity and composition. For Σ, again write 𝛼=(𝑔,𝑓) and substitute componentwise into (𝑔(𝑥),𝑓(𝑥)(𝑦)); the formulas for 𝑔21 and 𝑓21 give the composition equation. For lists, substitution is defined homomorphically on the primitive syntax constructor 𝗆𝖺𝗉𝖫𝗂𝗌𝗍; identities and composites substitute in its map argument. ℕ has no varying parameter and hence no action rule. These are all primitive formers in the proved fragment. ◻
Orienting the identity equation as 𝑛⟶𝗆𝖺𝗉𝐹(𝗂𝖽)(𝑛) would expand forever. Orienting it in the other direction requires type-directed matching and interacts with eta. The principal calculus therefore keeps identity in conversion and uses reduction only to compact composition.
Assume Map-Comp holds for 𝐹. Let Γ⊢𝑔:𝗁𝗈𝗆𝐹(𝑋,𝑌), Γ⊢𝑓:𝗁𝗈𝗆𝐹(𝑌,𝑍), and let Γ⊢𝑛:𝐹(𝑋) be neutral. Put 𝑠:=𝗆𝖺𝗉𝐹(𝑓)(𝗆𝖺𝗉𝐹(𝑔)(𝑛)),𝑠′:=𝗆𝖺𝗉𝐹(𝑓∘𝐹𝐹𝑔)(𝑛). If Γ,𝑧:𝐹(𝑍)⊢𝐸[𝑧]:𝐵(𝑧), then Γ⊢𝐵(𝑠)≡𝐵(𝑠′)𝗍𝗒𝗉𝖾,Γ⊢𝐸[𝑠]≡𝐸[𝑠′]:𝐵(𝑠), where the right-hand term is converted from 𝐵(𝑠′) to 𝐵(𝑠).
Proof of Proposition 120.15 — Compaction is an instance of the composition law
Proof.Map-Comp instantiated at 𝑓, 𝑔 and 𝑛 is exactly Γ⊢𝗆𝖺𝗉𝐹(𝑓)(𝗆𝖺𝗉𝐹(𝑔)(𝑛))≡𝗆𝖺𝗉𝐹(𝑓∘𝐹𝐹𝑔)(𝑛):𝐹(𝑍) and hence says 𝑠≡𝑠′:𝐹(𝑍). lemma 120.12 gives the type equality and places both sides in 𝐸, using conversion to compare them at 𝐵(𝑠). The neutrality side condition of definition 120.9 plays no part here: it schedules weak-head reduction deterministically and does not restrict the equation. ◻
For the proved fragment with 0, ℕ, Π, Σ, lists, and one universe, the source proves normalization, subject reduction, injectivity, canonicity, equivalence of declarative and algorithmic typing, and decidability of conversion and type checking after adding compacted neutrals and the functor laws.
Proof. We give the logical-relation argument, concentrating on the one clause changed by functoriality. Parameterize typing, multi-step weak-head reduction, and neutral conversion by an interface 𝐼 satisfying weakening, substitution, subject conversion, and deterministic weak-head reduction. Define type reducibility and reducible term conversion simultaneously by induction on a type-former tag. The 0,ℕ,Π,Σ, and universe clauses are the usual Kripke clauses. A type 𝑋 is reducible as a list when it weak-head reduces to 𝖫𝗂𝗌𝗍(𝐴) and every weakening of 𝐴 is reducible.
At a reducible list type, reduce both terms to normal forms. Two constructor forms are related when they are both nil with convertible stored parameters, or both cons with reducibly convertible heads and tails. For compacted neutrals use four clauses. Two ordinary neutrals are related by neutral conversion in 𝐼. Two forms 𝗆𝖺𝗉𝖫𝗂𝗌𝗍(𝑓)(𝑛) and 𝗆𝖺𝗉𝖫𝗂𝗌𝗍(𝑓′)(𝑛′) are related when 𝑛 and 𝑛′ are neutrally convertible and, in every weakened context with 𝑥:𝐴, the terms 𝑓𝑥 and 𝑓′𝑥 are reducibly convertible at the target parameter. A mapped neutral is related to an ordinary neutral when the same condition compares its function body with 𝑥; the fourth clause is the converse. Eta-expansion of the two functions makes these clauses well typed even before reducibility of their source is known.
Simultaneous induction on the reducibility witnesses proves reflexivity, symmetry, transitivity, irrelevance of the chosen type witness, weakening, and closure under anti-reduction. Only transitivity of compacted neutrals is new. There are three middle-form possibilities: ordinary, mapped, or one of each. In each, transitivity of neutral conversion identifies the underlying neutrals; the induction hypothesis in the extended context composes the two body relations. If one side supplied the identity body, beta conversion turns that body into 𝑥. This produces exactly one of the four clauses above.
We next validate the functor equations. Induct on a reducible list term. Nil and cons compute constructorwise, using the induction hypotheses for the head and tail. An ordinary neutral uses the mixed compacted-neutral clause with body 𝗂𝖽𝑥≡𝑥. A mapped neutral first uses definitionally associative composition in the domain category to compact nested maps, then uses the mapped–mapped clause and the induction hypothesis on the composed body. These four cases prove reducible identity and composition; no fusion equation is used.
The fundamental lemma is a simultaneous induction on typing and conversion. Variables use the related environment; substitution uses its Kripke extension; the ordinary constructor and eliminator cases use the corresponding reducibility clauses. Map-Ty uses the list clause just defined, Map-Id and Map-Comp use the preceding validation, and neutral compaction uses anti-reduction. Thus every well-typed term is reducible and every judgmental equality is reducible conversion. Instantiating 𝐼 by declarative typing gives weak-head normalization and subject reduction. Inspection of related normal forms gives injectivity and nonconfusion; inspection at ℕ gives numeral canonicity.
For algorithmic typing, compare reduced types, ordinary neutrals, and compacted neutrals by mutual recursion. The compacted-neutral clauses are the four logical-relation clauses above, now read as syntax-directed rules; every recursive call either removes a constructor, descends into a neutral spine, or descends into a function body at a structurally smaller type. Hence comparison is decidable. Induction on algorithmic derivations proves soundness. Instantiating the same fundamental lemma by the algorithmic interface proves that every declarative equality is accepted, so declarative and algorithmic typing coincide. Decidable conversion and syntax-directed checking then give decidable type checking. This establishes every item in the theorem at the stated finite signature; no clause constructs actions for arbitrary indexed inductives. ◻
Proof of Lemma 120.17 — Local uniqueness of typing
Proof. Use the type-former injectivity supplied by theorem 120.16. Induct on the first typing derivation and invert the second derivation after removing its final conversions. A variable has the unique declaration found at its de Bruijn position. The universe, ℕ, zero, and successor rules have fixed conclusions. Formation of Π, Σ, and lists is fixed by the types of their displayed components. For lambda and application, the induction hypotheses identify the annotated domain and function type; dependent-Π injectivity identifies the codomain after substitution. For a pair, the induction hypotheses identify the first component type and the second component type in its substituted fiber; dependent-Σ injectivity identifies the domain and fiber. For either projection, inversion gives the two candidate Σ-types, and dependent-Σ injectivity identifies the selected component type. The ℕ- and list-eliminator syntax stores its motive and branches; inversion therefore gives the same motive instance, while the induction hypotheses identify the scrutinee and branch types.
For an action term, the annotated syntax stores 𝐹,𝑋,𝑌. Inverting Map-Ty in both derivations gives the same result type 𝐹(𝑌); constructor-action and neutral-action rules are instances of that rule, not additional typing conclusions. Map-Id, Map-Comp, and their description counterparts derive equality and introduce no typing alternative. Finally, if the first derivation ends in conversion, apply the induction hypothesis before that conversion and compose type equalities; if only the second ends in conversion, compose with its conversion premise. This list covers every term and conversion rule in the stated fragment. ◻
Both sides of every instance of Desc-Map-Id, Desc-Map-Comp, Map-Id, and Map-Comp have the type printed in that rule.
Let 𝑔:𝗁𝗈𝗆𝐹(𝑋,𝑌), 𝑓:𝗁𝗈𝗆𝐹(𝑌,𝑍), and neutral 𝑛:𝐹(𝑋) be well typed in Γ, let 𝑠=𝗆𝖺𝗉𝐹(𝑓)(𝗆𝖺𝗉𝐹(𝑔)(𝑛)) and 𝑠′=𝗆𝖺𝗉𝐹(𝑓∘𝐹𝐹𝑔)(𝑛), and suppose Γ,𝑧:𝐹(𝑍)⊢𝐸[𝑧]:𝐵(𝑧). If Γ⊢𝐸[𝑠]:𝐴 and contextual compaction takes 𝐸[𝑠] to 𝐸[𝑠′], then Γ⊢𝐸[𝑠′]:𝐴.
Every rule instance remains an instance after a well-typed substitution 𝜎:Γ′→Γ.
Proof of Theorem 120.18 — Typing preservation for the functoriality delta
Proof. For the description rules, induction on 𝐷 gives 𝗆𝖺𝗉𝐷(𝑓):[[𝐷]]𝑋→[[𝐷]]𝑌; application typing then assigns the displayed common types. The fixed-former rules use the domain-morphism signatures in convention 120.1. This proves clause 1.
For clause 2, the only new reduction has source and target 𝑠=𝗆𝖺𝗉𝐹(𝑓)(𝗆𝖺𝗉𝐹(𝑔)(𝑛)),𝑠′=𝗆𝖺𝗉𝐹(𝑓∘𝐹𝐹𝑔)(𝑛). The rule premises type both terms at 𝐹(𝑍). The contextual reduction instance supplies Γ,𝑧:𝐹(𝑍)⊢𝐸[𝑧]:𝐵(𝑧). By lemma 120.12, the target has type 𝐵(𝑠′) and 𝐵(𝑠)≡𝐵(𝑠′). Lemma 120.17 gives 𝐴≡𝐵(𝑠); two conversions therefore assign 𝐸[𝑠′] the original type 𝐴. This argument includes Frame-ListInd, where the two intermediate result types are 𝑃(𝑠) and 𝑃(𝑠′).
For clause 3, apply lemma 120.13 to the description rules and lemma 120.14 to Map-Ty, Map-Id, and Map-Comp. Substituting the typing premises rebuilds the same rule. These are the constructor computation, identity, composition, and neutral-compaction families introduced by the delta. ◻
No eliminator-map fusion rule is added: no rule pushes an outer 𝗆𝖺𝗉𝐹 through the eliminator of 𝐹 into its branches. The source records that such a rule is unnecessary for the functorial equations and takes the conservative option of leaving it out, and notes separately that it becomes necessary only when the parameters of an inductive type are inferred from the scrutinee rather than stored at the eliminator. The absence is therefore part of the system card, not an omitted optimization.
AdapTT is a separate calculus, not an extension of the Coq fragment in convention 120.1. Besides contexts, types, terms, and substitution, its primitive judgments include Γ⊢𝑓:𝐴⇒𝐵andΓ⊢𝑎⟨𝑓⟩:𝐵 for an adapter𝑓 and its action on 𝑎:𝐴. Adapters have identity and composition; substitution preserves both; and action satisfies the judgmental identity, composition, and substitution laws printed in the paper’s Figure 2. No uniqueness of parallel adapters is assumed.
AdapTT2 adds positive and negative type variables, positive and negative context extension, substitutions, and transformations. These construct a variance-sensitive domain category for a type former. Section 4 then describes indexed inductive families by a parameter context, an index telescope, a finite list of constructor descriptions, and recursive arguments whose arity telescope is contravariant. The construction derives an adapter for the described family and its computation on constructors. It does not derive a recursor, a recursor–adapter fusion law, mixed-variance telescopes, or nested inductive types.
At the signature of convention 120.19, the following statements hold.
AdapTT has a sound interpretation in every natural model whose types and terms form the stated discrete-opfibration structure (Theorem 2.3).
For every small such model C, the 2-category of category-valued presheaves on C models AdapTT2 (Theorem 3.4).
The Section 4 signature construction yields the type and adapter, together with constructor-action equations, for each description admitted by that construction.
The source proves neither normalization nor decidability of type checking for AdapTT or AdapTT2. It also leaves mixed variance, the conjectured embedding of AdapTT into AdapTT2, nested types, recursors, and fusion outside the proposition.
Proof of Proposition 120.20 — AdapTT semantic boundary
Proof. For clause 1, fix a natural model with a representable natural transformation 𝑝:𝖳𝗆→𝖳𝗒 that is an objectwise discrete opfibration. Interpret a type in Γ as an object of 𝖳𝗒(Γ), an adapter as one of its arrows, and a term as an object of 𝖳𝗆(Γ) above its type. Given 𝑡:𝖳𝗆(Γ) above 𝐴 and 𝑓:𝐴→𝐵, the discrete opfibration supplies a unique lift ¯𝑓:𝑡→𝑡′ above 𝑓. Define 𝑡⟨𝑓⟩=𝑡′. Uniqueness identifies the lift of an identity with the identity and the lift of a composite with the composite of lifts. Naturality of the opfibration identifies reindexing of ¯𝑓 with the lift of the reindexed adapter. These are exactly the adapter identity, composition, and substitution equations. Representability of 𝑝 supplies context extension, weakening, and the variable, so every rule of the AdapTT card is interpreted.
For clause 2, let C be small. In the 2-category [Cop,𝐂𝐚𝐭], take contexts to be category-valued presheaves, substitutions to be 2-natural transformations, and transformations to be modifications. Positive context extension is the Grothendieck construction of a covariant family; negative extension uses the same construction after taking the stipulated dual. Whiskering and composition are the strict 2-categorical operations, so their identity, associativity, interchange, and duality equations hold on the nose. Types, terms, adapters, and adapter action are interpreted pointwise by the model of clause 1. The positive and negative extension equations follow from the universal property of the two Grothendieck constructions. This verifies each rule family in the AdapTT2 card and proves the model claim.
For clause 3, induct on an admitted datatype description. The parameter and index telescopes interpret as the iterated positive or negative extensions just constructed. A nonrecursive constructor argument is reindexed by the induction hypothesis for its telescope. A recursive argument uses the contravariant arity extension followed by the covariant recursive result. The outer constructor is preserved, while all fields receive their induced adapters; this is the displayed constructor-action equation. Finite lists of constructors are handled componentwise. Thus the interpretation yields the described type, its adapter, and every constructor equation.
The induction contains no case defining a recursor or a recursor–adapter fusion equation, and the grammar has no mixed-variance or nested-description case. The semantic construction is not a normalization or decision procedure. None of the excluded claims follows. ◻
The cited source does not prove preservation, normalization, canonicity, coherence, or either semantic result above for an executable checker. No result after this chapter depends on the adapter extension.
Sources
The MLTT𝗆𝖺𝗉 calculus follows Laurent, Lennon-Bertrand, and Maillard [LLBM24]. The adapter calculus follows Adjedj, Lennon-Bertrand, Benjamin, and Maillard [ALBBM25].
Suggested first pass.
None of these problems is a prerequisite for a later chapter. Begin with exercise 120.2, then complete exercise 120.4.
★★☆ Calculate composition of two list maps on nil, a two-element constructor list, and a neutral variable. Mark the constructor reductions and the one neutral-compaction step separately.
★★★ Derive identity and composition for the dependent-product action without omitting the substituted fiber types. Then reverse the domain morphism and display the first ill-typed application.
★★★Practical project.positive-description-action-checker Implement in Agda or Kappa the descriptions of definition 120.2, their finite values, and generated action. Maintain the invariant that action preserves the outer constructor of a description value. Represent a finite dependent sum whose zero-index fiber is constant and whose successor-index fiber contains the parameter. On identity-product, compose-sigma, and dependent-sigma, print identity, composition, and dependent-sigma, respectively. The last oracle must show that the same parameter map leaves the zero fiber unchanged and maps the successor fiber. On negative-description, print rejected: negative-occurrence. A mutation that maps only the left product component must fail identity-product; a mutation that always selects the zero sigma fiber must fail dependent-sigma. The program checks the finite description language; it is not a mechanization of the normalization or semantic proofs above.