Prerequisites. Direct starred prerequisites: Chapter 17. No later core chapter depends on this route.
Suppose a proof of an existential formula carries both a witness and a proof. With call-by-value control, those two projections need not observe the same return. The following external 𝖼𝖺𝗅𝗅𝖼𝖼/𝗍𝗁𝗋𝗈𝗐 extension provides the negative example 𝑝0:=callcc𝑘(0,throw𝑘(1,refl)):∃𝑥:ℕ.𝑥=1. The witness projection returns 0. Evaluation of the proof projection invokes 𝑘 and replaces the pair by (1,refl), so that the same proof appears to establish wit(𝑝0)=1. Reflexivity also establishes wit(𝑝0)=0. Equality elimination would then produce a proof of 1=0. Neither the usual rule for existential elimination nor the usual rule for control is individually at fault: their unrestricted combination lets a type depend on a control-sensitive proof. The displayed 𝑝0 is not silently treated as syntax of the 𝜇/̃𝜇 calculus developed in this chapter; it is a formal obstruction that determines the latter calculus’s restriction.
The calculus 𝑑𝐿̂𝗍𝗉 repairs this interaction in two places. Only negative-elimination-free proofs may occur in dependencies, and a distinguished continuation ̂𝗍𝗉 delimits the computation that exposes a dependent pair. The restriction is a syntactic invariant, not an assertion that all proofs are irrelevant.
A sequent calculus with proof-dependent formulas
The fragment needed below separates first-order terms, proofs, evaluation contexts, and commands. First-order terms and formulas include 𝑡,𝑢::=𝑥∣¯𝑛∣wit(𝑝),𝐴,𝐵::=𝑡=𝑢∣⊥∣∃𝑥:ℕ.𝐴∣Π𝑎:𝐴.𝐵. Here 𝑥 is a first-order variable, 𝑎 a proof variable, and ¯𝑛 a natural numeral. The formula 𝐵 may mention 𝑎 only when the proof supplied for 𝑎 belongs to the class defined below. Proofs, contexts, and commands contain the following constructors: 𝑝,𝑞::=𝑎∣𝜆𝑎.𝑝∣𝜆𝑥.𝑝∣(𝑡,𝑝)∣refl∣prf𝑝∣subst𝑝𝑞∣𝜇𝛼.𝑐∣𝜇̂𝗍𝗉.𝑐,𝑒::=𝛼∣𝑡⋅𝑒∣𝑞⋅𝑒∣̃𝜇𝑎.𝑐∣̂𝗍𝗉,𝑐::=⟨𝑝∥𝑒⟩. Here 𝜆𝑎.𝑝 abstracts a proof and 𝜆𝑥.𝑝 a first-order term; subst𝑝𝑞 is equality elimination, which rewrites the type of 𝑞 along the equality proved by 𝑝. The omitted source constructors supply natural-number induction and coinductive streams. They are not needed to derive the rules or counterexamples displayed here.
For proof assumptions Γ and continuation assumptions Δ, the regular judgments are Γ⊢𝑝:𝐴∣Δ,Γ∣𝑒:𝐴⊢Δ,𝑐:(Γ⊢Δ). The first places 𝑝 on the right of a sequent, the second places an evaluation context 𝑒 on the left, and the third cuts a proof against a context. The regular judgments carry no dependency list. The control and cut rules are
Γ⊢𝑝:𝐴∣ΔΓ∣𝑒:𝐴⊢Δ
⟨𝑝∥𝑒⟩:(Γ⊢Δ)
Cut
𝑐:(Γ⊢𝛼:𝐴,Δ)
Γ⊢𝜇𝛼.𝑐:𝐴∣Δ
μ-R
𝑐:(Γ,𝑎:𝐴⊢Δ)
Γ∣̃𝜇𝑎.𝑐:𝐴⊢Δ
μ-L
The principal call-by-value step is ⟨𝑉∥̃𝜇𝑎.𝑐⟩⟶𝑐[𝑉/𝑎], where 𝑉 is a proof value. The dual control step substitutes a context for the captured continuation: ⟨𝜇𝛼.𝑐∥𝑒⟩⟶𝑐[𝑒/𝛼].
For a dependent product, introduction and elimination form a cut in which the codomain records the proof argument:
Γ,𝑎:𝐴⊢𝑝:𝐵∣Δ
Γ⊢𝜆𝑎.𝑝:Π𝑎:𝐴.𝐵∣Δ
Π-R
Γ⊢𝑞:𝐴∣ΔΓ∣𝑒:𝐵[𝑞/𝑎]⊢Δ𝑞∉D⟹𝑎∉𝖥𝖵(𝐵)
Γ∣𝑞⋅𝑒:Π𝑎:𝐴.𝐵⊢Δ
Π-L
The class D contains proofs admissible in dependencies. The side condition on Π-L permits a proof outside D only when the codomain does not depend on it. Without that implication, a captured continuation can change the proof named inside 𝐵[𝑞/𝑎] after the context has been typed. In definition 109.3, D is fixed to the NEF fragment.
For existential naturals, a pair is introduced and its projections compute:
Γ⊢𝑡:ℕΓ⊢𝑝:𝐴[𝑡/𝑥]∣Δ
Γ⊢(𝑡,𝑝):∃𝑥:ℕ.𝐴∣Δ
-R
Γ⊢𝑝:∃𝑥:ℕ.𝐴∣Δ𝑝∈D
Γ⊢wit(𝑝):ℕ
Wit
Γ⊢𝑝:∃𝑥:ℕ.𝐴∣Δ𝑝∈D
Γ⊢prf(𝑝):𝐴[wit(𝑝)/𝑥]∣Δ
Prf
For a value (𝑡,𝑝), the projections reduce by the named rules wit(𝑡,𝑝)⟶𝑡(𝑊𝑖𝑡−𝑃𝑎𝑖𝑟),prf(𝑡,𝑝)⟶𝑝(𝑃𝑟𝑓−𝑃𝑎𝑖𝑟). A neutral projection wit(𝑎) does not reduce; its type is nevertheless ℕ by Wit when 𝑎∈D.
★☆☆ Assume Γ⊢𝑓:Π𝑎:𝐴.𝐵∣Δ, Γ⊢𝑞:𝐴∣Δ, and Γ∣𝑒:𝐵[𝑞/𝑎]⊢Δ. Display the Π-L derivation of 𝑞⋅𝑒 and the two uses of Cut that place 𝑓 against that context. Then state the value premise needed for the first call-by-value reduction.
Why subject reduction fails without a dependency restriction
The type of a continuation records the formula expected at its capture site. If a proof later placed in a type can invoke that continuation, evaluation can replace the proof while leaving the surrounding dependent formula unchanged.
Extend the dependent language of definition 109.1 with the operators and typing rules Γ,𝑘:¬𝐴⊢𝑝:𝐴Γ⊢callcc𝑘𝑝:𝐴,Γ,𝑘:¬𝐴⊢𝑝:𝐴Γ,𝑘:¬𝐴⊢throw𝑘𝑝:𝐵. Extend its reduction relation by wit(callcc𝑘𝑝)⟶callcc𝑘(wit(𝑝[𝑘(wit{⋅})/𝑘]))(𝑊𝑖𝑡−𝐶𝑎𝑙𝑙𝑐𝑐),callcc𝑘𝑡⟶𝑡(𝐶𝑎𝑙𝑙𝑐𝑐−𝑇𝑒𝑟𝑚)when𝑘∉𝖥𝖵(𝑡). The context substitution in the first rule makes the replacement throw𝑘𝑞↦throw𝑘(wit𝑞). These rules require the syntax to admit term occurrences callcc𝑘𝑡 as well as proof occurrences throw𝑘𝑡. Then the extension derives 1=0.
Proof of Proposition 109.2 — Unrestricted-control counterexample
Proof. The two displayed rules type the opening term as ⊢𝑝0:∃𝑥:ℕ.𝑥=1. The new commuting rule, the ordinary pair projection, and the second new rule give the annotated reduction wit(𝑝0)𝑊𝑖𝑡−𝐶𝑎𝑙𝑙𝑐𝑐⟶callcc𝑘(wit(0,throw𝑘(wit(1,refl))))𝑊𝑖𝑡−𝑃𝑎𝑖𝑟⟶callcc𝑘0𝐶𝑎𝑙𝑙𝑐𝑐−𝑇𝑒𝑟𝑚⟶0. The side condition of Callcc-Term holds because 𝑘∉𝖥𝖵(0). Reflexivity followed by conversion along this reduction therefore derives ⊢refl:wit(𝑝0)=0. The ordinary proof projection independently gives ⊢prf(𝑝0):wit(𝑝0)=1. Taking 𝐵[𝑥]:=𝑥=0, equality elimination applies the equation prf(𝑝0) to the payload refl and derives ⊢subst(prf(𝑝0))refl:1=0. The calculation uses only the displayed witness/proof equations; no command or reduction of the later 𝜇/̃𝜇 calculus is asserted here. ◻
The example uses no nontermination and no inconsistent assumption. Removing either dependency on the proof or the continuation throw destroys the counterexample. A repair must therefore control which proofs may be copied into types. The later subject-reduction theorem concerns the displayed 𝑑𝐿̂𝗍𝗉 syntax and does not claim that the external extension preserves typing.
Negative-elimination-free dependencies and delimitation
Term values and proof values are 𝑉𝑡::=𝑥∣¯𝑛,𝑉𝑝::=𝑎∣𝜆𝑎.𝑝∣𝜆𝑥.𝑝∣(𝑉𝑡,𝑉𝑝)∣refl. Term values are variables and numerals, and they contain no proofs at all. Ordinary terms are another matter: wit𝑝 embeds an arbitrary proof, so a term can contain a proof that is not a value — wit(𝑝0) of the opening is exactly such a term. That is the reason for the restriction on pairs, and the direction of the reasoning is worth getting right. Because a term may carry an unevaluated proof, a pair would otherwise count as a value while still hiding a computation in its first component; so the calculus requires that a proof value contain only term values, which is what (𝑉𝑡,𝑉𝑝) says. Call-by-value reduction on proofs is enforced by that requirement, not by any property of terms. The negative-elimination-free proofs (NEF proofs) are then generated, simultaneously with NEF commands and NEF contexts, by 𝑝𝑁::=𝑉𝑝∣(𝑡,𝑝𝑁)∣𝜇⋆.𝑐𝑁∣prf𝑝𝑁∣subst𝑝𝑁𝑞𝑁,𝑐𝑁::=⟨𝑝𝑁∥𝑒𝑁⟩,𝑒𝑁::=⋆∣̃𝜇𝑎.𝑐𝑁. The symbol ⋆ is a single distinguished continuation variable belonging to this grammar, not a continuation of the calculus. It is what makes the definition a fragment rather than a subset: a NEF proof may bind one continuation, and the only contexts its commands may use are that same ⋆ and ̃𝜇𝑎.𝑐𝑁. Formula formation and dependent elimination require every proof substituted into a formula to be NEF. Membership is decidable by structural recursion over proof syntax.
Read the third clause carefully; it is the one that gives the fragment its name and its point, and the contrast it draws is exact.
Compare two proofs that both begin with 𝜇. The first is 𝜇𝛼.𝑐, binding an ordinary continuation variable. Its command may use 𝛼 anywhere and any number of times, and—this is the decisive part—the context substituted for 𝛼 is whatever context the proof is eventually cut against, which may have been captured somewhere else entirely. The opening proof 𝑝0 is of exactly this shape. Substituting it into a formula fixes that formula while leaving the proof free to be replaced later by a throw, which is how proposition 109.2 produces two different witnesses for one formula. So 𝜇𝛼.𝑐 is not NEF, and neither is an application spine 𝑞⋅𝑒; those are the negative eliminations the name excludes.
The second is 𝜇⋆.𝑐𝑁, and it is NEF. The difference is not that it avoids control but that the continuation it binds is its own. It cannot be thrown to from outside, because ⋆ is bound here and the grammar admits no other context; and when such a proof is actually placed in a dependency, the reduction replaces ⋆ by the calculus’s delimited continuation, as in ⟨𝜆𝑎.𝑝∥𝑞⋅𝑒⟩⟶⟨𝜇̂𝗍𝗉.⟨𝑞∥̃𝜇𝑎.⟨𝑝∥̂𝗍𝗉⟩⟩∥𝑒⟩(𝑞∈NEF). By definition 109.4 the surrounding context is then frozen until the inner command is fully reduced, so the value 𝑞 produces is the value the dependency sees. That is the whole mechanism: 𝛼 lets an outside context decide the proof after the formula is fixed; ⋆, and the ̂𝗍𝗉 it becomes, does not.
NEF is therefore not the control-free fragment. It is the fragment whose control is confined to a continuation it binds itself.
Two nearby classes fail to replace it, in opposite directions. NEF is strictly larger than the values: prf(0,refl) is NEF and is not a value. NEF is not contained in the normal proofs either, and the same term shows it, since ⟨prf(𝑉𝑡,𝑉𝑝)∥𝑒⟩ reduces to ⟨𝑉𝑝∥𝑒⟩. Conversely, 𝜇𝛼.⟨𝑎∥𝛼⟩ is a weak normal proof when considered without an enclosing cut: its body cuts a variable against a continuation variable, so no reduction applies. It is not NEF, because it binds the ordinary continuation 𝛼. The NEF and normal classes are therefore incomparable, and the restriction cannot be stated as “substitute only values” or as “substitute only normal proofs”.
The continuation ̂𝗍𝗉 marks the boundary at which the term component of a dependent pair is made available to its proof component. A dependency list is generated by 𝜎::=𝜖∣𝜎{𝑟∣𝑞}. For a formula 𝐴, define its compatibility class by 𝐴𝜖:={𝐴},𝐴𝜎{𝑟∣𝑞}:={𝐴𝜎∪(𝐴[𝑞/𝑟])𝜎,𝑞∈NEF,𝐴𝜎,𝑞∉NEF. Thus 𝐵∈𝐴𝜎 means that the open dependencies recorded by 𝜎 can reconcile 𝐴 with 𝐵. The notation 𝜎{⋅∣𝑞} records an open binding whose proof endpoint is 𝑞.
The dependent judgments are Γ∣𝑒:𝐴⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎,𝑐:(Γ⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎). They type only contexts and commands involving the distinguished continuation. In the following rules, 𝑝 names the proof endpoint of the displayed open binding; 𝐴, 𝐵, and 𝜎 range over well-formed formulas and dependency lists in the displayed contexts. The rules that cross or manipulate the boundary are
𝑐:(Γ⊢𝑑Δ,̂𝗍𝗉:𝐴;𝜖)
Γ⊢𝜇̂𝗍𝗉.𝑐:𝐴∣Δ
μtp
𝐵∈𝐴𝜎
Γ∣̂𝗍𝗉:𝐴⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎{⋅∣𝑝}
tp
Γ⊢𝑝:𝐴∣ΔΓ∣𝑒:𝐴⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎{⋅∣𝑝}
⟨𝑝∥𝑒⟩:(Γ⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎)
Cut-d
𝑐:(Γ,𝑎:𝐴⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎{𝑎∣𝑝})
Γ∣̃𝜇𝑎.𝑐:𝐴⊢𝑑Δ,̂𝗍𝗉:𝐵;𝜎{⋅∣𝑝}
μ-d
The proof premise of Cut-𝑑 is deliberately regular: the dependency list belongs only to the dependent context and command judgments. Entering a dependent elimination installs ̂𝗍𝗉; reduction may resume the enclosing ordinary continuation only after the delimited command returns. No source proof can bind, duplicate, or throw directly to ̂𝗍𝗉. It is a continuation of the calculus, produced by reduction; the ⋆ of definition 109.3 is a bound variable of that grammar, and the displayed step above is where the one becomes the other.
The delimiter returns to its frozen context by ⟨𝜇̂𝗍𝗉.⟨𝑝∥̂𝗍𝗉⟩∥𝑒⟩⟶⟨𝑝∥𝑒⟩(̂𝗍𝗉−𝑅𝑒𝑡𝑢𝑟𝑛). If 𝑐⟶𝑐′, the congruence rule reduces the inner command while 𝑒 remains frozen: ⟨𝜇̂𝗍𝗉.𝑐∥𝑒⟩⟶⟨𝜇̂𝗍𝗉.𝑐′∥𝑒⟩(̂𝗍𝗉−𝐶𝑜𝑛𝑔). Together with the dependent-application step above, these equations delimit the interval during which the dependency list is open.
Proof of Lemma 109.5 — Dependent-context substitution
Proof. Induct simultaneously on the dependent derivation and on the list of open dependencies. A variable or value rule does not mention ⋆ and rebuilds unchanged. In a regular cut, apply the induction hypotheses to its proof and context premises and rebuild Cut-𝑑. A ̃𝜇 binder alpha-renames its bound proof variable outside FV(𝑒) before applying the induction hypothesis. The 𝜇⋆ case removes the bound occurrence of ⋆; every other continuation binder commutes with the substitution.
The only case that changes the dependency list is a nested cut. A binding {𝑎∣𝜇⋆.𝑐0} is replaced by the two bindings exposed by 𝑐0. The premise assigning a formula to the old binding says that its proof lies in the old compatibility class. The NEF congruence equations identify that formula with the formula of the two exposed bindings after [𝑒/⋆]. Conversion-left therefore rebuilds the premise for ̂𝗍𝗉. The delimiter cases either substitute through the inner command by the induction hypothesis or discharge the distinguished continuation by ̂𝗍𝗉-Return. These are the regular, binder, dependency-extension, and delimiter rule families, so the simultaneous induction proves the displayed judgment. ◻
Proof. Induct on the reduction rule. For ⟨𝜇𝛼.𝑐0∥𝑒⟩⟶𝑐0[𝑒/𝛼], inversion gives a derivation of 𝑐0 under 𝛼:𝐴 and a context derivation for 𝑒:𝐴; context substitution reconstructs the conclusion. The dual ̃𝜇 root uses proof substitution. Product beta substitutes its value and proof components separately; existential and equality roots use term substitution followed by proof substitution. Each substitution is capture avoiding because the corresponding binder was chosen outside the free variables of the substituted object.
For dependent application, inversion gives an NEF proof together with the open formula family that contains it. The reduct inserts the delimiter and is typed successively by 𝜇̂𝗍𝗉, Cut-𝑑, ̃𝜇-𝑑, and ̂𝗍𝗉; the dependency entry records the same NEF proof, so compatibility membership preserves the formula assigned to the entry. If the NEF proof is 𝜇⋆.𝑐0, apply lemma 109.5 to type 𝑐0[𝑒/⋆].
Rule ̂𝗍𝗉-Return removes a delimiter whose inner command has already produced a proof; inversion of the delimiter typing gives exactly the outer context premise. Rule ̂𝗍𝗉-Cong applies the induction hypothesis to the inner command and rebuilds the delimiter. Congruence for the remaining contexts applies the induction hypothesis to the selected subcommand and rebuilds its typing rule. The ordinary control, product, existential, equality, dependent-application, delimiter, and congruence cases exhaust the displayed reduction relation, proving preservation. ◻
The theorem does not apply to 𝑝0 inside a formula: its outer callcc is represented by 𝜇 and is not NEF. Control remains available in programs and proofs that do not enter dependencies.
★★☆ Classify the five proofs 𝑎, 𝜆𝑎.𝑎, (0,refl), 𝜇⋆.⟨𝑎∥⋆⟩, and 𝜇𝛼.𝑐 using definition 109.3. Four are accepted and one is not. For each accepted proof give one formula in which it may be substituted. For the rejected proof, name the clause of the grammar it would need, and then explain why replacing 𝛼 by ⋆ in it would not help unless the command is also restricted to NEF contexts.
An ordinary double-negation translation erases where a proof occurs in a type. The target here is an intuitionistic dependent theory with naturals, equality, first-order existentials, proof-dependent products, and bottom. It first translates positive values and then wraps computations in a double negation:
Proof variables that occur in 𝐵 remain visible as target variables in [[𝐵]]∗. This dependency is the reason the product translates with a positive domain but a computation-valued codomain. The equality clause needs a second map, written 𝑡+, supplied by definition 109.8.
Two translations are therefore in play, and keeping them apart is the whole content of the section.
We use a continuation-passing translation. Its four maps target syntax: 𝑝↦[[𝑝]]𝑝,𝑡↦[[𝑡]]𝑡,𝑒↦[[𝑒]]𝑒,𝑐↦[[𝑐]]𝑐. The proof translation consumes a continuation. Its decisive clauses are [[𝑉]]𝑝:=𝜆𝑘.𝑘[[𝑉]]𝑉,[[𝜇𝛼.𝑐]]𝑝:=𝜆𝛼.[[𝑐]]𝑐,[[⟨𝑝∥𝑒⟩]]𝑐:=[[𝑒]]𝑒[[𝑝]]𝑝,[[̃𝜇𝑎.𝑐]]𝑒:=𝜆𝑎.[[𝑐]]𝑐,[[prf𝑝]]𝑝:=𝜆𝑘.([[𝑝]]𝑝(𝜆𝑞.𝜆𝑘′.𝑘′(prf𝑞)))𝑘,[[(𝑡,𝑝)]]𝑝:=𝜆𝑘.[[𝑝]]𝑝([[𝑡]]𝑡(𝜆𝑥.𝜆𝑎.𝑘(𝑥,𝑎))). The positive translation sends a term, NEF proof, NEF command, or NEF context to a target value. The complete clause table is 𝑥+:=𝑥,¯𝑛+:=¯𝑛,(wit𝑝)+:=wit𝑝+,𝑎+:=𝑎,refl+:=refl.(𝑡,𝑝)+:=(𝑡+,𝑝+),(prf𝑝)+:=prf𝑝+,(𝜆𝑎.𝑝)+:=𝜆𝑎.[[𝑝]]𝑝,(𝜆𝑥.𝑝)+:=𝜆𝑥.[[𝑝]]𝑝,(subst𝑝𝑞)+:=subst𝑝+𝑞+.(𝜇⋆.𝑐)+:=𝑐+,(𝜇̂𝗍𝗉.𝑐)+:=𝑐+,⟨𝑝∥⋆⟩+:=𝑝+,⟨𝑝∥̂𝗍𝗉⟩+:=𝑝+,⟨𝑝∥̃𝜇𝑎.𝑐̂𝗍𝗉⟩+:=𝑐+[𝑝+/𝑎]. The last clause is for the NEF binding context; its subscript records the dependent command mode. Thus the witnesses used by the mutual induction are defined for every constructor quantified over in lemma 109.9, not merely for proofs.
For every term 𝑡 there is a target term 𝑡+ such that [[𝑡]]𝑡𝑘⟶∗𝑘𝑡+ for every 𝑘, and for every NEF proof 𝑝𝑁 there is a target proof 𝑝+𝑁 such that [[𝑝𝑁]]𝑝𝑘⟶∗𝑘𝑝+𝑁 for every 𝑘.
Proof of Lemma 109.9 — Linearity of the translation of NEF proofs
Proof. Use mutual induction on the term, NEF-proof, NEF-command, and NEF-context grammars, with the positive translation of definition 109.8 supplying the witnesses. A variable, numeral, proof variable, or reflexivity proof beta-reduces immediately to the continuation applied to its positive translation. A lambda uses the induction hypothesis for its body under the extended target context. The pair case shows the nontrivial sequencing mechanism: [[(𝑡,𝑝)]]𝑝𝑘𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑖𝑜𝑛109.8⟶∗[[𝑡]]𝑡(𝜆𝑥.𝜆𝑎.[[𝑝]]𝑝(𝑘(𝑥,𝑎)))𝐼𝐻𝑓𝑜𝑟𝑡⟶∗(𝜆𝑥.𝜆𝑎.[[𝑝]]𝑝(𝑘(𝑥,𝑎)))𝑡+𝐼𝐻𝑓𝑜𝑟𝑝⟶∗𝑘(𝑡+,𝑝+). For prf𝑝𝑁, first apply the proof induction hypothesis to the inner continuation and then beta-reduce the two continuation lambdas; the result is 𝑘(prf𝑝+𝑁). Witness extraction and equality substitution use the term and proof induction hypotheses, respectively, and then their positive eliminator equations. In a command ⟨𝑝𝑁∥𝑒𝑁⟩, the proof and context hypotheses meet at the same positive value. A context ̃𝜇𝑎.𝑐𝑁 uses the command hypothesis after substituting that value for 𝑎. Finally, 𝜇⋆.𝑐𝑁 uses the command induction hypothesis with the supplied continuation substituted for ⋆; because 𝑒𝑁 is generated only by ⋆ and ̃𝜇𝑎.𝑐𝑁, that continuation is used exactly at the unique terminal command. These cases exhaust the four mutually defined grammars.
The reason the statement is restricted to NEF proofs is visible in the 𝜇𝛼 clause: [[𝜇𝛼.𝑐]]𝑝𝑘=[[𝑐]]𝑐[𝑘/𝛼] substitutes 𝑘 for a variable the command may use zero times or many times, so no single 𝑝+ answers every continuation. The restriction is not to control-free proofs: 𝜇⋆.𝑐𝑁 is NEF and does have a positive translation, namely 𝑐+𝑁, because its command may use only ⋆ and ̃𝜇𝑎.𝑐𝑁 and therefore uses its continuation exactly once. ◻
Let Γ⊢𝑝:𝐴∣Δ with 𝑝 NEF. Then the continuation-passing translation of 𝑝 admits the dependent type [[𝑝]]𝑝:Π𝑋:([[𝐴]]+→U).(Π𝑎:[[𝐴]]+.𝑋(𝑎))→𝑋(𝑝+), where 𝑝+ is the positive translation of definition 109.8. The corresponding clause for a first-order term 𝑡 types [[𝑡]]𝑡 at Π𝑋:(ℕ→U).(Π𝑥:ℕ.𝑋(𝑥))→𝑋(𝑡+).
Proof of Lemma 109.10 — Dependent CPS type for NEF proofs
Proof. Note first what the statement is not: assigning that type to 𝑝+ itself would be vacuous, since 𝑝+ already has type [[𝐴]]+ and the type would then follow by applying the supplied function at 𝑝+. The content is that the continuation-passing translation, whose ordinary type is the constant double negation ([[𝐴]]+→⊥)→⊥, can be refined to a parametric answer type 𝑋 once 𝑝 is NEF. lemma 109.9 is exactly what licenses the refinement: [[𝑝]]𝑝 uses its continuation once, so the answer may depend on the value 𝑝+ that it passes.
The induction is simultaneous on the NEF proof, command, and context grammars. A variable applies the supplied dependent function at that variable. A lambda rebuilds a positive product value and applies the proof induction hypothesis to its body in the extended context. A pair translates its term witness first and invokes the induction hypothesis on its NEF component; lemma 109.9 identifies the resulting answer as 𝑋((𝑡,𝑝)+). The prf and subst cases use their positive eliminators, whose motives are obtained by substituting the positive translations into 𝑋. A command applies the translated context to the translated proof. The ̃𝜇 context abstracts over the positive proof value and uses the command induction hypothesis. Finally, 𝜇⋆.𝑐𝑁 substitutes the answer-family continuation for ⋆ and uses the command hypothesis. There is no 𝜇𝛼 case, and there could not be one: it would require manufacturing 𝑋(𝑝+) after an arbitrary outside continuation has already changed the result, which is the impossible step isolated by proposition 109.2. ◻
Proof. Prove the three claims simultaneously by induction on the typing derivation, strengthened to dependent contexts and their compatibility lists. A proof variable is translated at its declared positive type and then double-negated by the surrounding continuation. A context variable is the corresponding target continuation. Rule Cut becomes application of the translated context to the translated proof, producing ⊥.
For 𝜇𝛼.𝑐, the command induction hypothesis has type ⊥ under 𝛼:[[𝐴]]+→⊥; abstraction over 𝛼 gives [[𝐴]]∗. The dual ̃𝜇 rule abstracts over a positive proof value. Product introduction uses the proof induction hypothesis under the translated domain. Dependent product elimination uses lemma 109.10 with result family equal to the translated codomain; the occurrence of the proof argument remains visible in that family. Existential pairing translates the first-order witness and then its proof component. Witness extraction, proof extraction, reflexivity, and equality substitution commute with their positive translations and use the corresponding induction hypotheses.
In the dependent mode, ⋆ is assigned the answer-family continuation and ̂𝗍𝗉 receives the translated formula at the positive proof stored in the compatibility list. Rule 𝜇̂𝗍𝗉 abstracts over that continuation; ̂𝗍𝗉 applies it. Weakening, exchange, conversion, and alpha-renaming follow componentwise from the simultaneous context induction. These are the variable, cut, control-binder, dependent-product, existential, equality, delimiter, and structural families, and they exhaust the displayed typing rules. ◻
Proof of Theorem 109.12 — Normalization and consistency
Proof. The target is the intuitionistic dependent fragment of the top system in the lambda cube, with naturals, equality, and existentials translated by their strictly positive encodings. Strong normalization for the top vertex of the lambda cube says that every well-typed target term admits no infinite beta reduction; the added positive constructors have structurally decreasing eliminators, so the same reducibility interpretation extends with their canonical-value clauses.
We next prove a directed simulation. Induct on a source reduction step and expand the clauses of definition 109.8. A regular 𝜇 or ̃𝜇 root becomes beta substitution. Product, existential, equality, and dependent-application roots become one or more target beta steps followed by the positive eliminator equation. Delimiter congruence uses the induction hypothesis under the translated answer-family context. Thus every principal source step contributes a nonempty target reduction sequence.
Four administrative roots can translate to equality: the two subst rules, delimiter return, and congruence for reduction inside a first-order witness. Assign a command the lexicographic measure (𝑛𝗇𝗈𝗇𝗏𝖺𝗅𝗎𝖾-𝗌𝗎𝖻𝗌𝗍,𝑛𝗌𝗎𝖻𝗌𝗍,𝑛̂𝗍𝗉,𝑛𝗐𝗂𝗍), where the four components count, respectively, substitutions whose proof argument is not a value, all substitution forms, occurrences of the distinguished continuation, and witness eliminators. The first administrative rule decreases the first count while preserving the other three. The second preserves the first and decreases the second. Delimiter return preserves the first two and decreases the third. Witness congruence preserves the first three and decreases the fourth. Thus every administrative step strictly decreases this lexicographic tuple, so no infinite sequence can consist only of administrative roots.
Suppose a typed source command had an infinite reduction. If it contained infinitely many principal steps, directed simulation would give an infinite reduction of its target translation. If it contained only finitely many, its tail would be an infinite descending chain of the administrative measure. Both alternatives are impossible. Hence every typed command normalizes.
If a closed proof 𝑝:⊥ existed, CPS preservation would give a closed target term [[𝑝]]:(⊥→⊥)→⊥. Apply it to the target identity 𝜆𝑥:⊥.𝑥; normalization would produce a canonical inhabitant of ⊥, but the target has no constructor for ⊥. Therefore no closed source proof of ⊥ exists. ◻
The argument reflects normalization through a terminating administrative simulation; it does not claim that every single administrative source step is a nonempty target reduction.
Classical strength without dependent witness instability
Control still derives classical principles. The source calculus directly derives Peirce’s law, but its minimal propositional fragment contains no left rule for ⊥. Double-negation elimination therefore needs one explicit logical delta: for each continuation 𝛼:𝑃, add the bottom-elimination context
Γ∣abort𝛼:⊥⊢𝛼:𝑃,Δ
-L
This rule has no reduction and cannot inspect a proof. Let 𝐴 be a formula and 𝐵(𝑎) a formula well formed under an NEF variable 𝑎:𝐴. Put 𝑃:=Π𝑎:𝐴.𝐵(𝑎). Capturing the continuation of a demanded proof of 𝑃 and throwing any candidate 𝑃 to it then gives dne𝑃:((𝑃→⊥)→⊥)→𝑃. Operationally, the outer 𝜇 names the context demanding 𝑃; the supplied double negation receives the function that throws a candidate 𝑃 to that context. The resulting proof may use control, but it is not itself eligible for substitution into a dependent formula. A value 𝜆𝑎.𝑝:𝑃 is NEF only when its body satisfies the NEF grammar required at the dependent occurrences of 𝐵(𝑎).
The calculus extended only by ⊥-L derives double-negation elimination at the dependent product 𝑃, but it does not validate unrestricted witness extraction from an arbitrary classical proof of ∃𝑥:ℕ.𝐴(𝑥) inside another type.
Proof of Proposition 109.13 — Boundary of the classical dependent principle
Proof. For the first claim, name the demanding context 𝛼:𝑃, assume ℎ:(𝑃→⊥)→⊥, and define 𝑞𝛼:=𝜆𝑎.𝜇𝛽.⟨𝑎∥𝛼⟩:𝑃→⊥,dne𝑃ℎ:=𝜇𝛼.⟨ℎ∥𝑞𝛼⋅abort𝛼⟩. To check 𝑞𝛼, assume 𝑎:𝑃 and extend the continuation context by 𝛽:⊥. The cut ⟨𝑎∥𝛼⟩ is typed under 𝛼:𝑃,𝛽:⊥ by weakening; 𝜇-R at 𝛽 therefore gives 𝜇𝛽.⟨𝑎∥𝛼⟩:⊥, and Π-R gives 𝑞𝛼:𝑃→⊥. Rule ⊥-L types abort𝛼 as a context consuming ⊥ while retaining 𝛼:𝑃. Hence Π-L types 𝑞𝛼⋅abort𝛼 as a context consuming (𝑃→⊥)→⊥. Cutting ℎ against it produces a command under 𝛼:𝑃, and the outer 𝜇-R closes exactly that continuation. The previously tempting tail 𝑞𝛼⋅𝛼 is ill typed: 𝛼 consumes 𝑃, whereas the result of ℎ is ⊥.
For the second claim, unrestricted extraction would admit 𝑝0 in the formula wit(𝑝0)=1. Then the reductions in proposition 109.2 reconstruct a proof of 1=0. Definition 109.3 rejects 𝑝0, so the exact calculus proves the first claim while blocking the second. ◻
This is not extensional type theory: control reduction is an operational relation, not equality reflection, and proofs with the same proposition need not be judgmentally equal. Nor does proof irrelevance alone repair the problem. Even if all proofs of one proposition are identified, the two witnesses 0 and 1 in 𝑝0 remain distinct natural numbers. The NEF and delimiter conditions protect the dependency before any irrelevance principle could be applied.
★★★ Let 𝑃=Π𝑎:𝐴.𝐵(𝑎). Expand [[𝑃]]+ and [[𝑃]]∗. Give the target type of the continuation captured by dne𝑃. Then explain, by pointing to one precise missing premise of lemma 109.10, why the same translation cannot justify placing the resulting 𝜇 proof inside a formula family 𝑋(−).
★★☆ Separate the three classes of definition 109.3 with explicit witnesses. Give a NEF proof that is not a value; a normal proof that is not NEF; and a NEF proof that is not normal, together with the command it reduces to. Conclude that NEF and the normal proofs are incomparable, and state which of the three classes is closed under the reduction of definition 109.1.
★★★ Audit the dependent-product case of CPS preservation, including the answer family consumed by ̂𝗍𝗉. Remove delimitation while retaining the NEF grammar and identify the CPS clause whose target type can no longer be derived.
★★☆ Contrast the operational equality used by control with judgmental equality in extensional type theory and with proof irrelevance. Give one equation accepted by each regime and rejected by either of the other two.
★★★Practical project.dependent-control-nef-checker Implement in Kappa the displayed proof grammar, a decidable NEF classifier, a weak-normality predicate, and the visible-result-family test for equality, existential naturals, and proof-dependent products. Maintain the invariant that a proof value is admitted in a dependency whatever its body, and that a 𝜇 binding the fragment’s own distinguished continuation is admitted, while a 𝜇 binding an ordinary continuation variable and an application spine are not. The named acceptance cases are 𝚟𝚊𝚛𝚒𝚊𝚋𝚕𝚎↦𝚊𝚌𝚌𝚎𝚙𝚝𝚎𝚍𝚒𝚗𝚍𝚎𝚙𝚎𝚗𝚍𝚎𝚗𝚌𝚢,𝚕𝚊𝚖𝚋𝚍𝚊-𝚙𝚊𝚒𝚛↦𝚊𝚌𝚌𝚎𝚙𝚝𝚎𝚍𝚒𝚗𝚍𝚎𝚙𝚎𝚗𝚍𝚎𝚗𝚌𝚢,𝚖𝚞-𝚊𝚕𝚙𝚑𝚊↦𝚛𝚎𝚓𝚎𝚌𝚝𝚎𝚍𝚒𝚗𝚍𝚎𝚙𝚎𝚗𝚍𝚎𝚗𝚌𝚢,𝚖𝚞-𝚝𝚙↦𝚊𝚌𝚌𝚎𝚙𝚝𝚎𝚍𝚒𝚗𝚍𝚎𝚙𝚎𝚗𝚍𝚎𝚗𝚌𝚢,𝚊𝚙𝚙𝚕𝚒𝚌𝚊𝚝𝚒𝚘𝚗-𝚜𝚙𝚒𝚗𝚎↦𝚛𝚎𝚓𝚎𝚌𝚝𝚎𝚍𝚒𝚗𝚍𝚎𝚙𝚎𝚗𝚍𝚎𝚗𝚌𝚢,𝚙𝚛𝚏-𝚙𝚊𝚒𝚛↦𝚗𝚎𝚏𝚋𝚞𝚝𝚗𝚘𝚝𝚗𝚘𝚛𝚖𝚊𝚕. The input named mu-tp is the fragment’s own 𝜇⋆.𝑐𝑁, named in the checker for the delimited continuation it becomes on use. A mutation that admits an undelimited 𝜇 in NEF must fail the mu-alpha oracle and the 𝑝0 mismatch oracle. The classifier decides membership in a finite grammar; it implements neither the full dependency and CPS judgments nor subject reduction, normalization, or consistency.
Sources. Miquey’s TOPLAS article gives the syntax and metatheory used here [Miq19]. Its comparison with earlier dependent sequent calculi explains why both the NEF restriction and the distinguished continuation are present. The subject-reduction, linearity, CPS, and normalization proof packages used here occupy fewer than ten source pages and are proved locally. The target normalization used in theorem 109.12 is Barendregt’s lambda-cube theorem at the same sorts, axiom, product triples, and compatible beta reduction [Bar92].