The checked vector append declaration carries an element type, two lengths, and the vectors themselves. At run time only the constructor blocks and elements determine the result. Keeping the indices makes execution carry proof data; deleting every marked argument without a proof can change which substitution a function body receives. Erasure therefore needs a relevance judgment, a target representation, and an operational theorem.
An exact untyped target
The source is the full Timpl signature of convention 110.16, extended by the accepted datatype and recursive declarations of chapter 122, chapter 123 together with the relevance annotation of definition 126.9. Neither definition 122.1 nor definition 123.1 carries relevance marks, so the annotation is extra data supplied with an already accepted declaration; it is checked by the judgment in definition 126.3, and no QTT grade or starred modality is assumed. Accepted source annotations are rechecked by the kernel-soundness theorem theorem 48.19; erasure does not replace that source judgment.
The target Texec is the untyped call-by-value calculus 𝑡::=𝑥∣𝜆𝑥.𝑡∣𝑡𝑡∣𝐶𝑘(𝑡1,…,𝑡𝑛)∣𝖼𝖺𝗌𝖾 𝑡 𝗈𝖿 {𝐶𝑘(⃗𝑥)⇒𝑡𝑘}∣𝖼𝗅𝗈𝗌(𝑓,⃗𝑡)∣𝖼𝖺𝗅𝗅(𝑡,⃗𝑡). A constructor tag records its runtime arity. A closure records a recursive function tag and the runtime part of its environment. Values are 𝑤::=𝜆𝑥.𝑡∣𝐶𝑘(𝑤1,…,𝑤𝑛)∣𝖼𝗅𝗈𝗌(𝑓,⃗𝑤). Every target case has pairwise distinct branch tags. Erasure obtains one branch per constructor from an accepted source case; raw case lists with a duplicate tag are not Texec phrases. This side condition makes branch selection functional. Write 𝛿𝑡(𝑓) =(⃗𝑦;⃗𝑥;𝑡𝑓) for the compiled recursive tag 𝑓, with captured environment ⃗𝑦 and formal parameters ⃗𝑥. Each occurrence of a primitive natural-number or vector eliminator also receives a fresh recursive tag. The tag records the occurrence, its ordered runtime free variables, and the relevance marks on its branch binders. Thus primitive eliminators add no target syntax: they compile to the same 𝖼𝗅𝗈𝗌/𝖼𝖺𝗅𝗅 forms as user declarations. Their exact tag bodies are given with the erasure equations in definition 126.10. Evaluation is the deterministic left-to-right call-by-value relation 𝑡 ⇓𝑤 generated by 𝑋𝑤⇓𝑤E−Val𝑡1⇓𝜆𝑥.𝑡𝑡2⇓𝑤2𝑡[𝑤2/𝑥]⇓𝑤𝑡1𝑡2⇓𝑤E−App (𝑡𝑖⇓𝑤𝑖)1≤𝑖≤𝑛𝐶𝑘(𝑡1,…,𝑡𝑛)⇓𝐶𝑘(𝑤1,…,𝑤𝑛)E−Con(𝑡𝑖⇓𝑤𝑖)𝑖𝖼𝗅𝗈𝗌(𝑓,⃗𝑡)⇓𝖼𝗅𝗈𝗌(𝑓,⃗𝑤)E−Clos 𝑡⇓𝐶𝑘(⃗𝑤)𝑡𝑘[⃗𝑤/⃗𝑥𝑘]⇓𝑤𝖼𝖺𝗌𝖾 𝑡 𝗈𝖿 {𝐶𝑗(⃗𝑥𝑗)⇒𝑡𝑗}𝑗⇓𝑤E−Case 𝛿𝑡(𝑓)=(⃗𝑦;⃗𝑥;𝑡𝑓)𝑡⇓𝖼𝗅𝗈𝗌(𝑓,⃗𝑤)(𝑡𝑖⇓𝑤𝑖)1≤𝑖≤𝑛𝑡𝑓[⃗𝑤/⃗𝑦][⃗𝑤𝑖/⃗𝑥]⇓𝑤𝖼𝖺𝗅𝗅(𝑡,𝑡1,…,𝑡𝑛)⇓𝑤E−Call There is no rule for a case whose scrutinee is a lambda or a closure, none for an application whose head is a constructor block, and none for a 𝖼𝖺𝗅𝗅 whose head is not a closure or whose argument count differs from |⃗𝑥|; a term that reaches such a configuration is stuck. Representation well-formedness rules out malformed stored arities, but it does not by itself prove that an arbitrary target application reaches a lambda or that an arbitrary case reaches a block. For a source term equipped with an evaluation derivation, theorem 126.14 constructs the matching target derivation and thereby rules out those dynamic failures.
The observation on closed terminating Timpl data is the constructor tree with erased fields removed. The theorem below proves target well-formedness, a constructor/closure representation invariant, and forward simulation. Since Texec is untyped, no target type-preservation claim is made.
Referenced from 5 locations
Assume that 𝛿𝑡 contains at most one entry for each closure tag and that every Texec case has pairwise distinct branch tags.
If 𝑤 is a Texec value and 𝑤 ⇓𝑢, then 𝑢 =𝑤.
If 𝑡 ⇓𝑤 and 𝑡 ⇓𝑤′, then 𝑤 =𝑤′.
Referenced from 4 locations
Proof of Lemma 126.2 — Texec values and evaluation are functional
Proof. For item 1, induct on the structure of 𝑤. A lambda has only E-Val. A constructor block can use E-Val or E-Con; in the latter derivation the induction hypotheses make every field evaluate to itself, so the conclusion is the original block. For a closure, replace the constructor tag and its fields by the fixed closure tag and environment, and replace E-Con by E-Clos; the componentwise induction hypotheses are unchanged. These are all value forms.
For item 2, induct on the first evaluation derivation and invert the second derivation on the outer syntax of 𝑡. The E-Val case is item 1. Two E-App derivations have equal function results by the induction hypothesis, hence the same lambda binder and body; their argument results and then their substituted-body results are equal by the corresponding induction hypotheses. Two E-Con derivations and two E-Clos derivations agree componentwise by the induction hypotheses. The possible overlap of E-Val with either rule is item 1.
For E-Case, the scrutinee induction hypothesis gives the same constructor block. Pairwise distinct tags select one common branch, simultaneous substitution installs the same field values, and the branch induction hypothesis gives the same result. For E-Call, the head induction hypothesis gives one closure tag and environment, functionality of 𝛿𝑡 gives one body and two formal telescopes, and the argument induction hypotheses give one argument vector. Both final premises therefore evaluate the same instantiated body, so their results agree by the body induction hypothesis. No other top rule applies to an application, constructor, closure, case, or call. This treats every evaluation-rule family. ◻
Fix an environment marking each source variable 𝑥𝜚 :𝐴, with 𝜚 ∈{𝗋𝗎𝗇𝗍𝗂𝗆𝖾,𝖾𝗋𝖺𝗌𝖾𝖽}. The runtime source phrases used by this chapter are 𝑒::=𝑥∣𝜆𝜖,𝜚(𝑥:𝐴).𝑒∣𝑒𝜖,𝜚𝑒∣(𝑒,𝑒)∣𝗉𝗋1(𝑒)∣𝗉𝗋2(𝑒)∣𝑐(⃗𝑒)∣𝗋𝖾𝖿𝗅𝑒∣𝗂𝗇𝖽𝟐(𝑥.𝐶;𝑒𝑡,𝑒𝑓,𝑒)∣𝐼𝐶(𝑒0;𝑛𝜚𝑛.𝑟𝜚𝑟.𝑒𝑠;𝑒)∣𝖩(𝑥.𝑦.𝑝.𝐶;𝑧𝜚𝑧.𝑒𝑟;𝑒𝑞)∣𝗏𝗂𝗇𝖽(𝑃;𝑒0;𝑛𝜚𝑛.𝑎𝜚𝑎.𝑥𝑠.𝑟𝜚𝑟.𝑒𝑠;𝑚,𝑒)∣𝖼𝖺𝗌𝖾 𝑒 𝗈𝖿 {𝑐𝑘(⃗𝑥𝑘)⇒𝑒𝑘}𝑘∣𝑓⟨⃗𝑦⟩(⃗𝑒). Here 𝐼𝐶 is the raw natural-number eliminator of definition 28.21. Its displayed branch is a checked eta-long branch; the successor branch of 𝗏𝗂𝗇𝖽 is treated the same way. Eta expansion preserves source typing and judgmental equality by Timpl’s Π-eta rule. This erasure card chooses the checked eta-long representative, and the source term 𝑒 in the simulation theorem below is that representative; no operational equation for a different surface spelling is assumed. The grammar therefore covers every term former in convention 110.16: universes, lifts, and type expressions occur in annotations, motives, and opaque erased argument slots and are static premises, while the remaining term constructors occur explicitly above. The generic constructor and case forms cover accepted user datatypes. The primitive constructors of 𝟏,𝟐,ℕ, and 𝖵𝖾𝖼 use the fixed annotations below; their primitive eliminators use the four displayed forms. Formally, let 𝑎𝗌 range over any checked raw Timpl term. An application argument, constructor field, call capture, or call input whose declaration mark is erased is an opaque 𝑎𝗌 slot rather than a recursive 𝑒 slot. In particular, a type argument may occupy an erased application or call slot without becoming a runtime phrase. Other premises concluded by Rel-Erased remain the explicit syntax shown in their rule: for example, S-J evaluates its proof to expose reflexivity even though the target deletes that proof. Thus target deletion does not by itself mean that every erased source premise is unevaluated.
The last form is a saturated call to a declaration in an accepted first-order Timpl-rec group; ⃗𝑦 is its captured environment. Unsaturated or first-class uses of a recursive declaration are outside this erasure card.
There are two judgments Γ ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾 and Γ ⊢𝑒 𝖾𝗋𝖺𝗌𝖾𝖽. The second means that the whole phrase occupies a static position and is deleted. It is generated by source typing: Γ⊢𝑒:𝐴Γ⊢𝑒 𝖾𝗋𝖺𝗌𝖾𝖽Rel−Erased. The runtime rules are 𝑥𝗋𝗎𝗇𝗍𝗂𝗆𝖾:𝐴∈ΓΓ⊢𝑥 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−VarΓ,𝑥𝗋𝗎𝗇𝗍𝗂𝗆𝖾:𝐴⊢𝑏 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝜆𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾(𝑥:𝐴).𝑏 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Lam−R Γ⊢𝑓 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑓𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−App−R. Γ,𝑥𝖾𝗋𝖺𝗌𝖾𝖽:𝐴⊢𝑏 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑎 𝖾𝗋𝖺𝗌𝖾𝖽Γ⊢𝜆𝜖′,𝖾𝗋𝖺𝗌𝖾𝖽(𝑥:𝐴).𝑏𝜖,𝖾𝗋𝖺𝗌𝖾𝖽𝑎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−App−E. Thus this exact fragment accepts erased application only as an administrative redex with its erased abstraction visible. A surface elaborator may expose such a redex when a closed head normalizes to an erased abstraction, but that preprocessing theorem is not part of Timpl-erasure; an application of a variable at an erased domain is rejected by this card. Dependent pairs and their projections retain both components: Γ⊢𝑎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑏 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢(𝑎,𝑏) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Pair. Γ⊢𝑠 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝗉𝗋1(𝑠) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−FstΓ⊢𝑠 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝗉𝗋2(𝑠) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Snd. The proof constructor has a target tag when a proof is retained inside a runtime pair or user constructor: Γ⊢𝑎:𝐴Γ⊢𝗋𝖾𝖿𝗅𝑎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Refl. If the accepted constructor annotation is 𝑐 :(𝑥𝜅11 :𝐴1)⋯(𝑥𝜅𝑛𝑛 :𝐴𝑛) →𝐷 ⃗𝑝 ⃗ı, where 𝜅𝑖 is the constructor-field retention mark, then (Γ⊢𝑎𝑖 𝜅𝑖)1≤𝑖≤𝑛Γ⊢𝑐(⃗𝑎) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Con. For a constructor case, give the variables of branch 𝑘 independent branch-use marks ⃗𝜚𝑘, and write ⃗𝑥⃗𝜚𝑘𝑘 for the resulting branch context. If the field-retention vector of 𝑐𝑘 is ⃗𝜅𝑘, admissibility requires 𝜚𝑘,𝑖=𝗋𝗎𝗇𝗍𝗂𝗆𝖾⟹𝜅𝑘,𝑖=𝗋𝗎𝗇𝗍𝗂𝗆𝖾. The converse is not required: a retained constructor field may be ignored by the branch body. Then Γ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾(Γ,⃗𝑥⃗𝜚𝑘𝑘⊢𝑒𝑘 𝗋𝗎𝗇𝗍𝗂𝗆𝖾)𝑘Γ⊢𝖼𝖺𝗌𝖾 𝑒 𝗈𝖿 {𝑐𝑘(⃗𝑥𝑘)⇒𝑒𝑘}𝑘 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Case. Motives, index equations, and inaccessible patterns belong to the Rel-Erased premises of the source typing derivation and produce no target phrase. Finally, if the checked source declaration record is 𝛿𝑠(𝑓)=(⃗𝑦⃗𝜎;⃗𝑥⃗𝜚;𝑏𝑓), then (Γ⊢𝑦𝑗 𝜎𝑗)𝑗(Γ⊢𝑎𝑖 𝜚𝑖)𝑖⃗𝑦⃗𝜎,⃗𝑥⃗𝜚⊢𝑏𝑓 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑓⟨⃗𝑦⟩(⃗𝑎) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Call.
The four primitive eliminators have separate rules. Their omitted formation premises are exactly their Timpl typing rules and are not replaced by the relevance judgment: Γ⊢𝑏 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑒𝑡 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑒𝑓 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝗂𝗇𝖽𝟐(𝑥.𝐶;𝑒𝑡,𝑒𝑓,𝑏) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Bool−Elim. Γ⊢𝑒0 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ,𝑛𝜚𝑛:ℕ,𝑟𝜚𝑟:𝐶(𝑛)⊢𝑒𝑠 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑚 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝐼𝐶(𝑒0;𝑛𝜚𝑛.𝑟𝜚𝑟.𝑒𝑠;𝑚) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Nat−Elim. The predecessor stored by 𝐶𝗌𝗎𝖼 is runtime even when the branch mark 𝜚𝑛 is erased: the recursive closure needs it to make its next call. The branch mark controls only whether 𝑒𝑠 may use that predecessor. For identity elimination, the proof and motive are static, but the reflexive endpoint is retained exactly when the reflexive branch uses it: Γ,𝑧𝜚𝑧:𝐴⊢𝑒𝑟 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑎 𝜚𝑧Γ⊢𝑒𝑞 𝖾𝗋𝖺𝗌𝖾𝖽Γ⊢𝖩𝐴;𝑎;𝑏(𝑥.𝑦.𝑝.𝐶;𝑧𝜚𝑧.𝑒𝑟;𝑒𝑞) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−J. The annotations 𝐴,𝑎,𝑏,𝐶 are the raw annotations of definition 30.1; in particular, 𝑎 is not guessed from the proof. Finally, abbreviate the successor-branch context by Δ𝑠:=Γ,𝑛𝜚𝑛:ℕ,𝑎𝜚𝑎:𝐴,𝑥𝑠𝗋𝗎𝗇𝗍𝗂𝗆𝖾:𝖵𝖾𝖼(𝐴,𝑛),𝑟𝜚𝑟:𝑃(𝑛,𝑥𝑠). Then Γ⊢𝑒0 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Δ𝑠⊢𝑒𝑠 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝑚 𝜚𝑚Γ⊢𝑦𝑠 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Γ⊢𝗏𝗂𝗇𝖽(𝑃;𝑒0;𝑛𝜚𝑛.𝑎𝜚𝑎.𝑥𝑠.𝑟𝜚𝑟.𝑒𝑠;𝑚,𝑦𝑠) 𝗋𝗎𝗇𝗍𝗂𝗆𝖾Rel−Vec−Elim. If 𝜚𝑚 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾, admissibility also requires the predecessor field of 𝗏𝖼𝗈𝗇𝗌 to be runtime, because the recursive target call then receives that predecessor as its runtime index. The structural field 𝑥𝑠 is runtime in every admissible annotation. More generally, a runtime-marked branch variable may name only a runtime constructor field; an erased branch variable may name a retained field and simply leave it unused.
Thus an erased variable can occur only below a premise concluded by Rel-Erased; recursive closures capture exactly the runtime variables listed in ⃗𝑦. An accepted source declaration is erasable when its checked Timpl term satisfies this judgment.
Referenced from 13 locations
★☆☆ Let Γ =(𝑦𝗋𝗎𝗇𝗍𝗂𝗆𝖾 :𝟐,𝑥𝖾𝗋𝖺𝗌𝖾𝖽 :𝟐). Give the complete relevance derivation for 𝜆𝖾𝗑𝗉𝗅𝗂𝖼𝗂𝗍,𝗋𝗎𝗇𝗍𝗂𝗆𝖾(𝑧:𝟐).𝑧𝖾𝗑𝗉𝗅𝗂𝖼𝗂𝗍,𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑦. Then prove by inversion that 𝗂𝗇𝖽𝟐(𝑢.ℕ;𝟢,𝗌𝗎𝖼𝟢,𝑥) has no runtime-relevance derivation in Γ. Name the missing premise. (Eight lines.)
Referenced from 3 locations
Suppose Γ ⊢𝑎 :𝐴.
If Γ ⊢𝑎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾 and Γ,𝑥𝗋𝗎𝗇𝗍𝗂𝗆𝖾 :𝐴 ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, then Γ⊢𝑒[𝑎/𝑥] 𝗋𝗎𝗇𝗍𝗂𝗆𝖾.
If Γ ⊢𝑎 𝖾𝗋𝖺𝗌𝖾𝖽 and Γ,𝑥𝖾𝗋𝖺𝗌𝖾𝖽 :𝐴 ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, then Γ⊢𝑒[𝑎/𝑥] 𝗋𝗎𝗇𝗍𝗂𝗆𝖾.
Both clauses extend componentwise to a well-typed simultaneous substitution that respects the marks of a telescope.
Referenced from 4 locations
Proof of Lemma 126.4 — Relevance is stable under marked substitution
Proof. Induct on the relevance derivation for 𝑒, renaming every traversed binder away from the free variables of 𝑎. In Rel-Var, a runtime variable is either 𝑥, in which case item 1 uses its premise, or a different runtime variable retained by substitution; item 2 cannot meet 𝑥 in a runtime variable rule. Rule Rel-Erased is reconstructed from ordinary Timpl substitution. Every congruence rule applies the induction hypotheses to its runtime premises and ordinary typing substitution to its erased premises. For Rel-Con and Rel-Case, use the stored field and branch marks one component at a time. The four eliminator rules apply the hypotheses to the retained scrutinee and branch premises; Rel-J uses item 1 or item 2 according to 𝜚𝑧. Rule Rel-Call treats the capture and input telescopes componentwise and reuses its checked body premise. These are all rule families of definition 126.3. Induction on a telescope gives the simultaneous form. ◻
Write 𝑒 ⇓𝑣 for the source evaluation relation used by this chapter. Texec uses the same evaluation glyph in definition 126.1; the disjoint source and target grammars determine which rule card applies, and no derivation mixes their rules. Source values are lambdas under either relevance mark, pairs of values, reflexivity values, and primitive or declared constructors whose runtime fields are values and whose erased fields remain as checked static source terms. Call the pairs, reflexivity values, and primitive or declared constructor values the source data values. An erased abstraction may be an intermediate source value, but Rel-App-E admits it in a runtime term only at a visible administrative redex; hence it has no final target value-representation clause. If a source argument 𝑎𝑖 has mark 𝜚𝑖, write ̂𝑎𝑖 for the runtime value 𝑣𝑖 when 𝜚𝑖 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾 and 𝑎𝑖 ⇓𝑣𝑖, and write ̂𝑎𝑖 =𝑎𝑖 without an evaluation premise when 𝜚𝑖 =𝖾𝗋𝖺𝗌𝖾𝖽. Thus erased type arguments are well-typed static syntax, not source runtime phrases. If 𝛿𝑠(𝑓) =(⃗𝑦⃗𝜎;⃗𝑥⃗𝜚;𝑏𝑓) is a checked source declaration, the rules are as follows.
On values, annotated applications, pairs, projections, constructors, cases, and the four primitive eliminators, this card is exactly the optional implementation relation ⇓𝖳,𝖼𝖻𝗏 of definition 124.2, after the uniform renaming 𝑇 − ∗ ↦𝑆 − ∗ and ⇓𝖳,𝖼𝖻𝗏 ↦ ⇓. The only rule added here is S-Call for a checked recursive declaration record 𝛿𝑠. Thus the two cards do not choose different call-by-value orders on their common grammar.
Values and functions use 𝑋𝑣⇓𝑣S−Val 𝑓⇓𝜆𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾(𝑥:𝐴).𝑏𝑎⇓𝑣𝑎𝑏[𝑣𝑎/𝑥]⇓𝑣𝑓𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑎⇓𝑣S−App−R 𝑓⇓𝜆𝜖,𝖾𝗋𝖺𝗌𝖾𝖽(𝑥:𝐴).𝑏𝑏[𝑎/𝑥]⇓𝑣𝑓𝜖,𝖾𝗋𝖺𝗌𝖾𝖽𝑎⇓𝑣S−App−E. The erased rule substitutes its checked static argument but does not evaluate it. Pairing and projection use 𝑎⇓𝑣𝑎𝑏⇓𝑣𝑏(𝑎,𝑏)⇓(𝑣𝑎,𝑣𝑏)S−Pair𝑠⇓(𝑣𝑎,𝑣𝑏)𝗉𝗋1(𝑠)⇓𝑣𝑎S−Fst𝑠⇓(𝑣𝑎,𝑣𝑏)𝗉𝗋2(𝑠)⇓𝑣𝑏S−Snd. For every primitive or declared constructor and every accepted datatype case, (𝑎𝑖⇓𝑣𝑖)𝜅𝑖=𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑐(𝑎1,…,𝑎𝑛)⇓𝑐(̂𝑎1,…,̂𝑎𝑛)S−Con 𝑒⇓𝑐𝑘(̂⃗𝑎)𝑒𝑘[̂⃗𝑎/⃗𝑥𝑘]⇓𝑣𝖼𝖺𝗌𝖾 𝑒 𝗈𝖿 {𝑐𝑗(⃗𝑥𝑗)⇒𝑒𝑗}𝑗⇓𝑣S−Case. The Boolean rules are the two instances 𝑏⇓𝗍𝗍𝑒𝑡⇓𝑣𝗂𝗇𝖽𝟐(𝑥.𝐶;𝑒𝑡,𝑒𝑓,𝑏)⇓𝑣S−Bool−T𝑏⇓𝖿𝖿𝑒𝑓⇓𝑣𝗂𝗇𝖽𝟐(𝑥.𝐶;𝑒𝑡,𝑒𝑓,𝑏)⇓𝑣S−Bool−F. For the next two rules, abbreviate 𝑁𝐶(𝑒0,𝑒𝑠;𝑚):=𝐼𝐶(𝑒0;𝑛𝜚𝑛.𝑟𝜚𝑟.𝑒𝑠;𝑚). Natural-number elimination is generated by 𝑚⇓𝟢𝑒0⇓𝑣𝑁𝐶(𝑒0,𝑒𝑠;𝑚)⇓𝑣S−Nat−Z 𝑚⇓𝗌𝗎𝖼(𝑣𝑛)𝑁𝐶(𝑒0,𝑒𝑠;𝑣𝑛)⇓𝑣𝑟𝑒𝑠[𝑣𝑛/𝑛,𝑣𝑟/𝑟]⇓𝑣𝑁𝐶(𝑒0,𝑒𝑠;𝑚)⇓𝑣S−Nat−S. The identity rule evaluates the proof to the only constructor that exposes a root computation: 𝑒𝑞⇓𝗋𝖾𝖿𝗅𝑣𝑞𝑒𝑟[𝑎/𝑧]⇓𝑣𝖩𝐴;𝑎;𝑏(𝑥.𝑦.𝑝.𝐶;𝑧𝜚𝑧.𝑒𝑟;𝑒𝑞)⇓𝑣S−J. Vector elimination has its two indexed rules: 𝑚⇓𝟢𝑦𝑠⇓𝗏𝗇𝗂𝗅𝑒0⇓𝑣𝗏𝗂𝗇𝖽(𝑃;𝑒0;𝑛𝜚𝑛.𝑎𝜚𝑎.𝑥𝑠.𝑟𝜚𝑟.𝑒𝑠;𝑚,𝑦𝑠)⇓𝑣S−Vec−Nil 𝑚⇓𝗌𝗎𝖼(𝑣𝑛)𝑦𝑠⇓𝗏𝖼𝗈𝗇𝗌(𝑣𝑛,𝑣𝑎,𝑣𝑥𝑠)𝗏𝗂𝗇𝖽(𝑃;𝑒0;𝑛𝜚𝑛.𝑎𝜚𝑎.𝑥𝑠.𝑟𝜚𝑟.𝑒𝑠;𝑣𝑛,𝑣𝑥𝑠)⇓𝑣𝑟𝑒𝑠[𝑣𝑛/𝑛,𝑣𝑎/𝑎,𝑣𝑥𝑠/𝑥𝑠,𝑣𝑟/𝑟]⇓𝑣𝗏𝗂𝗇𝖽(𝑃;𝑒0;𝑛𝜚𝑛.𝑎𝜚𝑎.𝑥𝑠.𝑟𝜚𝑟.𝑒𝑠;𝑚,𝑦𝑠)⇓𝑣S−Vec−Cons. Finally, saturated user recursion evaluates only its runtime captures and inputs; erased captures and inputs are substituted as checked static syntax: (𝑦𝑗⇓𝑢𝑗)𝜎𝑗=𝗋𝗎𝗇𝗍𝗂𝗆𝖾(𝑎𝑖⇓𝑣𝑖)𝜚𝑖=𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑏𝑓[̂⃗𝑦/⃗𝑦,̂⃗𝑎/⃗𝑥]⇓𝑣𝛿𝑠(𝑓)=(⃗𝑦⃗𝜎;⃗𝑥⃗𝜚;𝑏𝑓)𝑓⟨⃗𝑦⟩(⃗𝑎)⇓𝑣S−Call. There is no rule for a neutral scrutinee, a mismatched constructor, or a call with the wrong arity. Hence the relation is partial on raw closed syntax; the theorem below assumes an evaluation derivation rather than inferring termination from typing.
Referenced from 6 locations
If Γ ⊢𝑒 :𝐴 and 𝑒 ⇓𝑣, then Γ ⊢𝑒 ≡𝑣 :𝐴.
Referenced from 5 locations
Proof of Lemma 126.6 — Source evaluation is sound for judgmental equality
Proof. Induct on the displayed evaluation derivation, retaining its source typing derivation. Rule S-Val uses reflexivity. For S-App-R, inversion gives 𝑓 :∏𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑥:𝐴0𝐵 and 𝑎 :𝐴0. The first two induction hypotheses give 𝑓 ≡𝜆𝑥.𝑏 and 𝑎 ≡𝑣𝑎. Application congruence, Π-computation, and the body induction hypothesis form the annotated chain 𝑓𝑎𝑐𝑜𝑛𝑔𝑟𝑢𝑒𝑛𝑐𝑒≡(𝜆𝑥.𝑏)𝑣𝑎Π−𝛽≡𝑏[𝑣𝑎/𝑥]𝐼𝐻≡𝑣. The middle equality has type 𝐵[𝑣𝑎/𝑥]; substitution congruence for 𝑎 ≡𝑣𝑎 gives 𝐵[𝑎/𝑥] ≡𝐵[𝑣𝑎/𝑥], and conversion puts the entire chain at the required 𝐵[𝑎/𝑥]. The erased-binder case uses the same chain with the unchanged checked argument 𝑎, so its middle term is 𝑏[𝑎/𝑥].
For S-Pair, congruence combines the two induction hypotheses; the second one is converted from 𝐵[𝑎] to 𝐵[𝑣𝑎] using the first component equality. For S-Fst, compose scrutinee congruence with Σ-first computation. For S-Snd, compose it with Σ-second computation and convert the result from the fibre over the evaluated first component to the fibre over 𝗉𝗋1(𝑠), using congruence of first projection.
Rule S-Con uses constructor congruence on each runtime field, with its induction hypothesis, and reflexivity on every retained static field. In S-Case, scrutinee congruence reaches the selected constructor; the generated Block-comp equation reduces the case to the selected branch, and simultaneous substitution congruence followed by the branch induction hypothesis reaches 𝑣. The motive instance is converted along the scrutinee equality. Rules S-Bool-T and S-Bool-F instantiate this case argument with the primitive 𝗍𝗍 and 𝖿𝖿 computation equations, respectively.
For S-Nat-Z, combine scrutinee congruence, Nat-comp1, and the base induction hypothesis. For S-Nat-S, scrutinee congruence and Nat-comp2 expose the step body. The induction hypotheses for the predecessor and recursive result justify its simultaneous substitution; the step-body induction hypothesis reaches 𝑣. Substitution congruence along 𝑚 ≡𝗌𝗎𝖼(𝑣𝑛) converts the final motive from 𝐶(𝗌𝗎𝖼(𝑣𝑛)) to 𝐶(𝑚).
For S-J, the proof induction hypothesis gives 𝑒𝑞 ≡𝗋𝖾𝖿𝗅𝑣𝑞. Identity-value inversion supplies the endpoint equalities, so 𝑣𝑞 ≡𝑎 ≡𝑏. After these conversions, Id-comp exposes 𝑒𝑟[𝑎/𝑧], and the branch induction hypothesis reaches 𝑣 at the original motive instance. Rule S-Vec-Nil uses the index and vector induction hypotheses, Vec-comp1, and conversion along 𝑚 ≡0 and 𝑦𝑠 ≡𝗏𝗇𝗂𝗅. Rule S-Vec-Cons uses Vec-comp2; simultaneous congruence substitutes the equal predecessor, head, tail, and recursive result, while conversion along 𝑚 ≡𝗌𝗎𝖼(𝑣𝑛) and 𝑦𝑠 ≡𝗏𝖼𝗈𝗇𝗌(𝑣𝑛,𝑣𝑎,𝑣𝑥𝑠) restores the declared indexed motive.
Finally, S-Call applies congruence to every evaluated runtime capture and input and reflexivity to the static ones. The defining equation committed for the accepted saturated Timpl-rec declaration exposes 𝑏𝑓[̂⃗𝑦,̂⃗𝑎]; simultaneous substitution congruence and the body induction hypothesis reach 𝑣. These are all rule families of definition 126.5. ◻
If Γ ⊢𝑒 :𝐴 and 𝑒 ⇓𝑣, then Γ ⊢𝑣 :𝐴.
Referenced from 4 locations
Proof of Lemma 126.7 — Source evaluation preserves typing
Proof. By lemma 126.6, Γ ⊢𝑒 ≡𝑣 :𝐴. Formation of a judgmental-equality derivation includes typing of both endpoints at its displayed type, hence Γ ⊢𝑣 :𝐴. The dependent conversions needed to obtain that single equality are the application, pair, projection, motive, index, endpoint, and call cases printed in the preceding proof. ◻
Suppose Γ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾and𝑒⇓𝑣. Then Γ ⊢𝑣 𝗋𝗎𝗇𝗍𝗂𝗆𝖾 in the unchanged marked context.
Referenced from 4 locations
Proof of Lemma 126.8 — Source evaluation preserves runtime relevance
Proof. Induct on the evaluation derivation while inverting the runtime-relevance derivation for its conclusion. Rule S-Val retains that derivation. In S-App-R, the induction hypotheses make the resulting runtime-binder lambda and argument value runtime; inversion of Rel-Lam-R, followed by the runtime clause of lemma 126.4, makes the substituted body runtime, and the third induction hypothesis gives the result. For S-App-E, inversion of Rel-App-E supplies the runtime body under an erased binder and the erased argument. The erased substitution clause makes 𝑏[𝑎/𝑥] runtime, so the body induction hypothesis applies.
Rule S-Pair reconstructs Rel-Pair from its two induction hypotheses. Projection inversion supplies runtime relevance for the selected pair component. In S-Con, apply the induction hypotheses to precisely the runtime fields and retain the original Rel-Erased premises for the static fields; Rel-Con then reconstructs the value judgment. For S-Case, the constructor induction hypothesis and relevance inversion recover the marked fields. Apply the simultaneous form of lemma 126.4 to the selected branch and then its evaluation induction hypothesis.
The two Boolean cases reuse the selected branch judgment. In S-Nat-S and S-Vec-Cons, the induction hypotheses make the retained predecessor, structural child, element, and recursive result runtime exactly when their branch marks demand them. Marked simultaneous substitution makes the successor body runtime; its induction hypothesis concludes. The zero and nil cases use their base judgments. In S-J, the proof remains erased; substitute the annotated endpoint 𝑎 into the reflexive branch according to 𝜚𝑧, then apply the branch induction hypothesis. Finally, S-Call uses the induction hypotheses for runtime captures and inputs, the unchanged erased premises for the other components, and marked simultaneous substitution in the Rel-Call body before applying the body induction hypothesis. These cases exhaust definition 126.5. ◻
Let B be a block accepted by definition 122.1 and G a group accepted by definition 123.1. A relevance annotation of the pair assigns one 𝜚 ∈{𝗋𝗎𝗇𝗍𝗂𝗆𝖾,𝖾𝗋𝖺𝗌𝖾𝖽} to every constructor field of every Θ𝑠, to every binder of every input telescope Δ𝑖, to every binder introduced by a clause split of G, and to the branch binders of each primitive natural-number, identity, or vector eliminator occurrence. The primitive constructors use the same convention: 𝗌𝗎𝖼’s predecessor and 𝗏𝖼𝗈𝗇𝗌’s recursive vector field are runtime. Write 𝜅𝑛,𝜅𝑎 for the chosen constructor-field marks on 𝗏𝖼𝗈𝗇𝗌’s predecessor and element fields, respectively; these are distinct from the branch-use marks 𝜚𝑛,𝜚𝑎. It is admissible when
every type-valued binder—a binder whose declared type is judgmentally a universe—is marked erased;
every position at which the accepted clause matrices split is marked runtime;
every argument named by an accepted structural or lexicographic certificate of definition 123.1 is marked runtime; and
for a primitive vector branch, 𝜚𝑛 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾 implies 𝜅𝑛 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾, and 𝜚𝑎 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾 implies 𝜅𝑎 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾; and
for every user-constructor branch binder, 𝜚𝑘,𝑖 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾 implies 𝜅𝑘,𝑖 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾; and
the runtime arity recorded for a target constructor tag 𝐶𝑐 is the number of runtime fields of 𝑐, taken in source order.
For a vector eliminator whose index 𝑚 is runtime, 𝜅𝑛 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾 as well. Every type-valued argument is erased: Texec has no representation for a universe or a source type expression. A data-valued index, such as a natural-number length, may instead be marked runtime when the source runtime grammar and the target representation contain its value forms. Subject to these constraints, the remaining annotation is a choice, and definition 126.3 is the judgment that decides whether that choice survives deletion; the counterexample after it is the choice that does not.
Referenced from 4 locations
The first clause of the relevance judgment is load bearing. Suppose 𝑥𝖾𝗋𝖺𝗌𝖾𝖽 :𝟐. Allowing the term 𝗂𝖿 𝑥 𝗍𝗁𝖾𝗇 0 𝖾𝗅𝗌𝖾 1 would leave the target with no branch selector after deleting 𝑥.
For an erasable term 𝑒, write |𝑒| for its Texec erasure. The decisive clauses are |𝑥|=𝑥,|𝜆𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾(𝑥:𝐴).𝑏|=𝜆𝑥.|𝑏|,|𝑓𝜖,𝗋𝗎𝗇𝗍𝗂𝗆𝖾𝑎|=|𝑓||𝑎|,|𝜆𝜖,𝖾𝗋𝖺𝗌𝖾𝖽(𝑥:𝐴).𝑏|=|𝑏|,|𝑓𝜖,𝖾𝗋𝖺𝗌𝖾𝖽𝑎|=|𝑓|. Dependent pairs, projections, reflexivity, and the nonrecursive Boolean eliminator erase by |(𝑎,𝑏)|=𝐶𝗉𝖺𝗂𝗋(|𝑎|,|𝑏|),|𝗉𝗋1(𝑠)|=𝖼𝖺𝗌𝖾 |𝑠| 𝗈𝖿 {𝐶𝗉𝖺𝗂𝗋(𝑥,𝑦)⇒𝑥},|𝗉𝗋2(𝑠)|=𝖼𝖺𝗌𝖾 |𝑠| 𝗈𝖿 {𝐶𝗉𝖺𝗂𝗋(𝑥,𝑦)⇒𝑦},|𝗋𝖾𝖿𝗅𝑎|=𝐶𝗋𝖾𝖿𝗅,|𝗂𝗇𝖽𝟐(𝑥.𝐶;𝑒𝑡,𝑒𝑓,𝑏)|=𝖼𝖺𝗌𝖾 |𝑏| 𝗈𝖿 {𝐶𝗍𝗍⇒|𝑒𝑡|,𝐶𝖿𝖿⇒|𝑒𝑓|}. Let 𝗋𝗎𝗇(𝑐) =(𝑗1 <⋯ <𝑗𝑟) list the runtime fields of a constructor. For a recursive input telescope (𝑥𝜚11 :𝐴1),…,(𝑥𝜚𝑛𝑛 :𝐴𝑛), define 𝗋𝗎𝗇(𝑓) =(𝑗1 <⋯ <𝑗𝑟) by 𝜚𝑗𝑘 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾, in source order. The remaining clauses are |𝑐(𝑎1,…,𝑎𝑛)|=𝐶𝑐(|𝑎𝑗1|,…,|𝑎𝑗𝑟|),|𝑓⟨⃗𝑦⟩(𝑎1,…,𝑎𝑛)|=𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(𝑓,|⃗𝑦|),|𝑎𝑗1|,…,|𝑎𝑗𝑟|),∣𝖼𝖺𝗌𝖾 𝑒 𝗈𝖿 {𝑐𝑘(⃗𝑥𝑘)⇒𝑒𝑘}𝑘∣=𝖼𝖺𝗌𝖾 |𝑒| 𝗈𝖿 {𝐶𝑐𝑘(⃗𝑥𝑘|⃗𝜅𝑘=𝗋𝗎𝗇𝗍𝗂𝗆𝖾)⇒|𝑒𝑘|}𝑘. Here |⃗𝑦| contains exactly those captures whose source marks are runtime, in declaration order, and the target pattern retains 𝑥𝑘,𝑖 exactly when the corresponding constructor field has 𝜅𝑘,𝑖 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾. A retained field whose branch-use mark is erased therefore still contributes an unused target pattern binder; this is what makes the pattern arity equal to the target constructor arity. Types, motives, the proof argument of Rel-J, and every entire premise concluded by Rel-Erased produce no target phrase. A proof retained in a pair or a constructor is represented by 𝐶𝗋𝖾𝖿𝗅; erasure does not silently delete an unmarked Σ-component.
It remains to give the exact recursive tags promised above. Erasure is defined on the checked annotated derivation, whose eliminator nodes carry stable occurrence identifiers and lexical capture slots. Substitution fills a slot with a target expression; it does not regenerate the tag or flatten that expression’s free variables. This convention is the one needed for the literal substitution equation below.
For an ordinary checked recursive declaration 𝛿𝑠(𝑓)=(⃗𝑦⃗𝜎;⃗𝑥⃗𝜚;𝑏𝑓)with⃗𝑦⃗𝜎,⃗𝑥⃗𝜚⊢𝑏𝑓 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, the compiler creates the target entry 𝛿𝑡(𝑓)=(⃗𝑦|⃗𝜎=𝗋𝗎𝗇𝗍𝗂𝗆𝖾;⃗𝑥|⃗𝜚=𝗋𝗎𝗇𝗍𝗂𝗆𝖾;|𝑏𝑓|). The relevance derivation proves that the free variables of |𝑏𝑓| are among precisely those two retained lists. Thus the closure emitted at a call stores the first list, the call supplies the second list, and E-Call substitutes the target values in source declaration order. This construction is applied simultaneously to every declaration of an accepted recursive group; a recursive occurrence in |𝑏𝑓| names the corresponding compiled tag rather than unfolding its body.
For a natural-number eliminator at occurrence 𝑜, put 𝑡0 =|𝑒0|, 𝑡𝑠 =|𝑒𝑠|, let ⃗𝑦 be its lexical runtime capture slots in source-context order, and choose the tag 𝜈𝑁(𝑜). Set 𝛿𝑡(𝜈𝑁(𝑜))=(⃗𝑦;𝑚;𝖼𝖺𝗌𝖾 𝑚 𝗈𝖿{𝐶𝟢⇒𝑡0,𝐶𝗌𝗎𝖼(𝑛)⇒𝑡♮𝑠.) When 𝜚𝑟 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾, define 𝑡♮𝑠:=(𝜆𝑟.𝑡𝑠)𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(𝜈𝑁(𝑜),⃗𝑦),𝑛); when 𝜚𝑟 =𝖾𝗋𝖺𝗌𝖾𝖽, put 𝑡♮𝑠 =𝑡𝑠. The explicit beta-redex is load bearing: target call-by-value evaluates the recursive call to a value before substituting that value for 𝑟, just as S-Nat-S does. A direct occurrence of 𝑛 in 𝑡𝑠 requires 𝜚𝑛 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾; the administrative recursive call also uses the retained successor field 𝑛 whenever 𝜚𝑟 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾. Then |𝐼𝐶(𝑒0;𝑛𝜚𝑛.𝑟𝜚𝑟.𝑒𝑠;𝑚)|=𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(𝜈𝑁(𝑜),⃗𝑦),|𝑚|).
For a vector eliminator, define 𝑢0 =|𝑒0|, 𝑢𝑠 =|𝑒𝑠|, take the ordered lexical runtime capture slots ⃗𝑧, and choose the occurrence tag 𝜈𝑉(𝑜′). Its one scrutinee input follows an optional runtime index input: 𝛿𝑡(𝜈𝑉(𝑜′))=(⃗𝑧;[𝑚]𝜚𝑚,𝑦𝑠;𝖼𝖺𝗌𝖾 𝑦𝑠 𝗈𝖿{𝐶𝗏𝗇𝗂𝗅⇒𝑢0,𝐶𝗏𝖼𝗈𝗇𝗌([𝑛]𝜅𝑛,[𝑎]𝜅𝑎,𝑥𝑠)⇒𝑢♮𝑠.) The pattern retains the predecessor and element exactly under their constructor-field marks, and 𝑥𝑠 is the retained structural child. The admissibility implications above ensure that every runtime occurrence of a branch variable has a corresponding target binder. When 𝜚𝑟 =𝗋𝗎𝗇𝗍𝗂𝗆𝖾, put 𝑢♮𝑠:=(𝜆𝑟.𝑢𝑠)𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(𝜈𝑉(𝑜′),⃗𝑧),[𝑛]𝜚𝑚,𝑥𝑠). For 𝜚𝑟 =𝖾𝗋𝖺𝗌𝖾𝖽, put 𝑢♮𝑠 =𝑢𝑠. As in the natural-number tag, the beta-redex forces the recursive call before installing its value in the step body.
Erased branch variables do not occur in 𝑢𝑠 by the relevance derivation. Consequently ∣𝗏𝗂𝗇𝖽(𝑃;𝑒0;𝑛𝜚𝑛.𝑎𝜚𝑎.𝑥𝑠.𝑟𝜚𝑟.𝑒𝑠;𝑚,𝑦𝑠)∣=𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(𝜈𝑉(𝑜′),⃗𝑧),[|𝑚|]𝜚𝑚,|𝑦𝑠|). Square brackets mean that the listed target argument is present exactly for the runtime mark. Freshness of 𝜈𝑁(𝑜),𝜈𝑉(𝑜′) includes the source eliminator occurrence, so two syntactically equal branch bodies at different scopes cannot capture one another’s variables.
Finally, identity elimination has no recursive tag: ∣𝖩𝐴;𝑎;𝑏(𝑥.𝑦.𝑝.𝐶;𝑧𝜚𝑧.𝑒𝑟;𝑒𝑞)∣={|𝑒𝑟|[|𝑎|/𝑧],𝜚𝑧=𝗋𝗎𝗇𝗍𝗂𝗆𝖾,|𝑒𝑟|,𝜚𝑧=𝖾𝗋𝖺𝗌𝖾𝖽. This structural clause recurses only on the displayed branch subderivation. By lemma 126.11 it agrees with |𝑒𝑟[𝑎/𝑧]|, but that larger substituted phrase is not used to define erasure. The clause is safe only with the three premises of Rel-J; in particular it is not a rule saying that an arbitrary proof may be inspected or that equality reflection holds. These equations exhaust the source grammar of definition 126.3.
Referenced from 4 locations
For vector append, mark 𝐴,𝑚,𝑛 erased and 𝑥𝑠,𝑦𝑠 runtime. Erasure emits the closure |𝖺𝗉𝗉𝖾𝗇𝖽| =𝖼𝗅𝗈𝗌(𝖺𝗉𝗉𝖾𝗇𝖽, ⋅) with an empty captured environment. Its compiled entry is 𝛿𝑡(𝖺𝗉𝗉𝖾𝗇𝖽)=(⋅;𝑥𝑠,𝑦𝑠;𝑏𝖺𝗉𝗉𝖾𝗇𝖽), where 𝑟𝖺𝗉𝗉𝖾𝗇𝖽(𝑎,𝑧𝑠,𝑦𝑠):=𝐶𝗏𝖼𝗈𝗇𝗌(𝑎,𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(𝖺𝗉𝗉𝖾𝗇𝖽,⋅),𝑧𝑠,𝑦𝑠)) and 𝑏𝖺𝗉𝗉𝖾𝗇𝖽:=𝖼𝖺𝗌𝖾 𝑥𝑠 𝗈𝖿 {𝐶𝗏𝗇𝗂𝗅⇒𝑦𝑠,𝐶𝗏𝖼𝗈𝗇𝗌(𝑎,𝑧𝑠)⇒𝑟𝖺𝗉𝗉𝖾𝗇𝖽(𝑎,𝑧𝑠,𝑦𝑠). This is a target body definition, not a small-step equation. A run is a big-step derivation using E-Call, E-Case, and E-Con. The target constructor stores neither the predecessor length nor the result index. The recursive runtime argument remains the direct child 𝑥𝑠.
★☆☆ Fix an accepted constructor 𝗉𝖺𝖼𝗄:(𝑖𝖾𝗋𝖺𝗌𝖾𝖽:ℕ)(𝑏𝗋𝗎𝗇𝗍𝗂𝗆𝖾:𝟐)→𝐷 whose target tag has runtime arity one. Calculate the erasure of 𝗉𝖺𝖼𝗄(𝗌𝗎𝖼𝟢,𝗍𝗍). Then calculate the target pattern for a source case branch 𝗉𝖺𝖼𝗄(𝑖𝖾𝗋𝖺𝗌𝖾𝖽,𝑏𝖾𝗋𝖺𝗌𝖾𝖽)⇒𝟢. State why the target pattern must retain 𝑏, even though the branch body does not use it. (Six lines.)
Referenced from 3 locations
Let Γ ⊢𝑣 :𝐴 be an erasable source term with Γ ⊢𝑣 𝗋𝗎𝗇𝗍𝗂𝗆𝖾. If Γ,𝑥𝗋𝗎𝗇𝗍𝗂𝗆𝖾 :𝐴 ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, then Γ⊢𝑒[𝑣/𝑥] 𝗋𝗎𝗇𝗍𝗂𝗆𝖾,|𝑒[𝑣/𝑥]|=|𝑒|[|𝑣|/𝑥]. If instead Γ ⊢𝑎 :𝐴 is any checked source term and Γ,𝑥𝖾𝗋𝖺𝗌𝖾𝖽 :𝐴 ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, then Γ⊢𝑒[𝑎/𝑥] 𝗋𝗎𝗇𝗍𝗂𝗆𝖾,|𝑒[𝑎/𝑥]|=|𝑒|.
Referenced from 10 locations
Proof of Lemma 126.11 — Relevance and erasure under substitution
Proof. Induct on the relevance derivation. Ordinary source substitution gives the relevance conclusion in every rule; the following induction simultaneously proves the erasure equation. The variable case is the displayed substitution in the runtime branch; the erased-variable case cannot occur in a runtime position. At a binder, rename its variable away from the free variables of the substituend and apply the induction hypothesis to the body. Runtime application preserves both subterms. Erased application deletes the argument, so substitution in that argument also disappears. Pair and projection cases apply the induction hypotheses to their retained subterms; reflexivity emits a nullary tag, so either substitution equation is immediate there. Constructor, Boolean case, and user-datatype case clauses apply the induction hypotheses exactly to retained fields and runtime-used branch variables. The target pattern also binds retained-but-unused fields; because those names do not occur in |𝑒𝑘|, substitution for them leaves the target branch body unchanged.
For Rel-Nat-Elim and Rel-Vec-Elim, the stable occurrence tag is unchanged. A runtime substitution fills the corresponding lexical capture slot with |𝑣|, while an erased substitution has no slot. Applying the induction hypotheses to the base and step bodies therefore gives the same 𝛿-record on both sides, up to the binder renaming fixed before the induction. In Rel-J, apply the induction hypothesis to 𝑒𝑟 and use associativity of capture-avoiding substitution after renaming 𝑧 away from the free variables of 𝑣; the erased proof premise produces no target subterm. A user recursive call substitutes in its explicit capture vector and retained inputs. These cases exhaust the relevance rules and prove both formulas. ◻
★☆☆ In the marked context 𝑥𝗋𝗎𝗇𝗍𝗂𝗆𝖾 :𝟐, let 𝑒 =(𝑥,𝗋𝖾𝖿𝗅𝑥), with type ∑𝑧:𝟐𝖨𝖽𝟐(𝑧,𝑧). For 𝑣 =𝗍𝗍, compute both sides of |𝑒[𝑣/𝑥]| =|𝑒|[|𝑣|/𝑥] and identify the erasure clause that prevents the proof annotation from creating a target free variable. (Five lines.)
Referenced from 3 locations
Representation replaces target typing
The relation 𝑣R𝑤 between a closed source value and a closed Texec value is generated by
a source lambda with a runtime binder relates to the target lambda that erasure emits. Erased abstractions occur only inside the administrative redex of Rel-App-E, so they have no standalone clause in this value relation. The administrative closure 𝖼𝗅𝗈𝗌(𝑓,⃗𝑤) occurring inside a translated saturated call is well formed when its tag is the compiled tag and its stored values are related to the runtime captures. It has no standalone source-value case, because definition 126.3 excludes first-class recursive declarations;
a source constructor relates to the target block with the same tag and runtime arity when corresponding retained fields are related; and
(𝑣1,𝑣2) relates to 𝐶𝗉𝖺𝗂𝗋(𝑤1,𝑤2) when 𝑣𝑖R𝑤𝑖 for 𝑖 =1,2, and every reflexivity value relates to the nullary tag 𝐶𝗋𝖾𝖿𝗅; and
the canonical Timpl constants 𝟢, 𝗍𝗍, 𝖿𝖿, ⋆ relate to their fixed nullary target tags, and 𝗌𝗎𝖼(𝑣) relates to 𝐶𝗌𝗎𝖼(𝑤) whenever 𝑣R𝑤.
A target term is representation well formed for a declaration environment when every constructor has the declared runtime arity, every case has pairwise distinct tags, every branch for a constructor tag binds that same runtime arity, every closure tag names an erased body, every captured environment has the stored runtime length, and every generated call supplies the target entry’s runtime input arity. The property is inherited by subterms under their displayed binders. It is a syntactic representation invariant, not a progress theorem: it does not assert that an arbitrary application head evaluates to a lambda or that an arbitrary case scrutinee evaluates to a constructor.
Referenced from 3 locations
Proof of Lemma 126.13 — Erasure produces well-formed target syntax
Proof. Induct on the relevance derivation. Runtime binders account for all target free variables, while erased binders introduce none. Constructor acceptance fixes the retained-field order and arity. Pairing fixes arity two; reflexivity fixes arity zero; and either projection emits a one-branch case over the pair tag. A runtime abstraction erases to a target lambda. The Rel-Call case emits a closure only as the head of a saturated target call. The recursive declaration compiler records the function tag, runtime environment length, and runtime input arity used by that clause. The two primitive recursive eliminators record the same data in their occurrence tags. Case erasure binds exactly the fields present in the target tag, including a retained field unused by its source branch body, and Rel-J emits the checked reflexive branch after the displayed capture-avoiding substitution. For a data value or runtime-binder lambda, the same induction ends in the corresponding clause of R. The Rel-App-E case is not a value. The Rel-Call case produces an administrative closure but cannot be the final source-value case. ◻
Let 𝑒 be a closed Timpl term with ⋅ ⊢𝑒 :𝐴 and ⋅ ⊢𝑒 𝗋𝗎𝗇𝗍𝗂𝗆𝖾. If source call-by-value evaluation derives 𝑒 ⇓𝑣, then 𝑣 is either a source data value or a lambda with a runtime binder, and Texec evaluation derives |𝑒| ⇓𝑤 for a unique value 𝑤 satisfying 𝑣R𝑤.
Referenced from 8 locations
Proof of Theorem 126.14 — Forward execution simulation
Proof. By lemma 126.7, lemma 126.8, the result 𝑣 is typed at 𝐴 and runtime relevant. Inversion of its value grammar therefore yields a source data value or a lambda with a runtime binder. To construct the target derivation, induct on the source evaluation derivation while carrying its typing and runtime-relevance derivations. In the value case, relevance inversion excludes an erased-binder lambda and leaves exactly a data value or runtime-binder lambda; apply lemma 126.13. In the runtime beta case, use the induction hypotheses for the function and argument. Target beta substitutes their erasures. Source typing preservation and source relevance preservation make the evaluated argument both typed and runtime; by lemma 126.11, the result is the erasure of the substituted source body. In the erased beta case the target term is the erasure of the visible abstraction, hence |𝑏|, immediately. Typing of S-App-E supplies the checked static argument 𝑎 :𝐴, and the erased equation of lemma 126.11 identifies |𝑏| with |𝑏[𝑎/𝑥]|, the source reduct used by that rule. Neither source nor target evaluates the erased argument. The syntactic visibility needed for this step is exactly the premise shape of Rel-App-E: its erased-lambda head is a source value and needs no simulation hypothesis. Apply the induction hypothesis to the strict derivation of 𝑏[𝑎/𝑥] ⇓𝑣; its target term is |𝑏[𝑎/𝑥]| =|𝑏|, which completes the erased beta case.
A pair evaluates both components by the two induction hypotheses and then uses E-Con at 𝐶𝗉𝖺𝗂𝗋. Either projection first obtains that pair block and then uses E-Case to select the corresponding target component. Reflexivity is a value and emits 𝐶𝗋𝖾𝖿𝗅. A primitive or declared constructor evaluates precisely its retained fields by the induction hypotheses, leaves the erased fields as static syntax on the source side, and uses E-Con at its declared target arity.
For a user-datatype case, source typing preservation and source relevance preservation make every retained selected field a typed runtime term. The simultaneous form of lemma 126.11 identifies the erased source branch with the target branch after runtime substitution; its erased clause deletes the static-field substitutions. The branch induction hypothesis then finishes. Target pattern matching also binds every retained-but-unused field, so its arity agrees with the constructor block.
For Boolean elimination, the induction hypothesis for the scrutinee yields either 𝐶𝗍𝗍 or 𝐶𝖿𝖿; E-Case selects the same branch as the source computation rule, and the branch induction hypothesis finishes. For natural-number elimination, distinguish the source zero and successor rules. The zero rule enters the 𝐶𝟢 branch of 𝛿𝑡(𝜈𝑁(𝑜)). The successor rule enters its 𝐶𝗌𝗎𝖼 branch; the recursive source subderivation is strictly smaller than the displayed eliminator derivation, so its induction hypothesis evaluates the recursive target call to the erasure of 𝑣𝑟 when 𝑟 is runtime. Rule E-App then contracts the displayed administrative beta-redex, installing that value in 𝑡𝑠 before the branch-body induction hypothesis is used. Source typing preservation and source relevance preservation make the predecessor and recursive result admissible for the simultaneous runtime substitutions. When 𝑟 is erased that call is absent, and the erased-substitution half of lemma 126.11 identifies the target body. Runtime or erased use of the predecessor is handled by the other half of the same lemma.
For S-Vec-Nil, replace the natural tag 𝜈𝑁(𝑜) in the preceding zero-case construction by the vector tag 𝜈𝑉(𝑜′), replace branch 𝐶𝟢 by 𝐶𝗏𝗇𝗂𝗅, and use the base method 𝑡0; these renamings preserve the empty capture telescope and the base-result typing premise. For S-Vec-Cons, replace 𝐶𝗌𝗎𝖼 by 𝐶𝗏𝖼𝗈𝗇𝗌, its predecessor binder by the four binders 𝑛,𝑎,𝑥𝑠,𝑟, and 𝜈𝑁(𝑜) by 𝜈𝑉(𝑜′). In that rule the structural child 𝑥𝑠 is retained, so the target recursive call is on exactly the child used by the source eliminator. If the index input is runtime, admissibility also retains its predecessor and the recursive target call receives it. The recursive induction hypothesis and E-App evaluate the displayed administrative beta-redex before substituting the recursive value for 𝑟. The induction hypotheses for the retained element and branch body, followed by simultaneous erasure substitution for 𝑛,𝑎,𝑥𝑠,𝑟, establish the successor equation. The premises of that substitution are supplied by source typing preservation and source relevance preservation for the evaluated predecessor, element, structural child, and recursive result.
In the identity rule, the source derivation evaluates 𝑒𝑞 to some 𝗋𝖾𝖿𝗅𝑣𝑞 and then evaluates 𝑒𝑟[𝑎/𝑧], where 𝑎 is the printed annotation rather than the evaluated endpoint. Source typing preservation and source relevance preservation, together with the marked premise for 𝑎, justify the appropriate clause of lemma 126.11. The target has already deleted the proof evaluation and is exactly |𝑒𝑟[𝑎/𝑧]|; the induction hypothesis for the reflexive branch finishes. This use neither inspects a neutral proof nor requires equality reflection. At a user recursive call, the source and target evaluate the same runtime captures and inputs. The source additionally substitutes the unchanged erased syntax, which disappears by the erased substitution lemma. Source typing preservation and source relevance preservation make each evaluated runtime capture and input admissible for the runtime clauses of that lemma; the Rel-Call body premise supplies the remaining marked substitutions. Closure well-formedness supplies the compiled body and the induction hypothesis applies to the strict body-evaluation subderivation. These cases cover every runtime form in definition 126.3. Uniqueness of 𝑤 is lemma 126.2. ◻
Removing runtime relevance makes the theorem false. The Boolean counterexample after definition 126.3 evaluates to two different numerals for its two erased inputs, while both source applications have the same target erasure.
★☆☆ Erase and evaluate 𝖺𝗉𝗉𝖾𝗇𝖽(𝐴,1,1,𝗏𝖼𝗈𝗇𝗌(0,𝑎,𝗏𝗇𝗂𝗅),𝗏𝖼𝗈𝗇𝗌(0,𝑏,𝗏𝗇𝗂𝗅)). Display the target constructor tree and annotate each case selection.
Referenced from 3 locations
Coinductive execution has a separate theorem
Timpl-co-erasure instantiates the stream type and head/tail definitions of definition 124.1 at one fixed closed accepted Timpl data type 𝐴 :U𝑖, with accepted retention annotations for every constructor of 𝐴. Function-valued and otherwise non-data stream elements remain outside this card. For a compiled group with the generated state datatype 𝑆 =𝖲𝗍𝖺𝗍𝖾G of definition 124.11, that helper block must be an accepted Timpl data type with explicit admissible retention annotations, and its generated maps ℎ :𝑆 →𝐴 and 𝑡 :𝑆 →𝑆 must satisfy runtime relevance under those annotations.
There is one further execution restriction. Call a closed data type runtime first order when every retained constructor or pair field is again runtime-first-order data and no retained field has a Π-type; erased fields may have arbitrary accepted Timpl types. A first-order map body is built from variables of runtime-first-order data type, ⋆,𝗍𝗍,𝖿𝖿,𝟢,𝗌𝗎𝖼, reflexivity, pairs, and accepted data constructors, together with datatype cases and the Boolean, natural, identity, and vector eliminators when every runtime premise and branch is again a first-order map body. Constructor arguments at erased fields are arbitrary checked static terms. There is no lambda or application inside a body and no named call; the only permitted lambda and application are the outer 𝜆𝑠.𝑟 defining ℎ or 𝑡 and its saturated call at the state. Acceptance requires 𝐴, 𝑆, the initial state expression, and both generated map bodies to satisfy these conditions. This finite grammar is exactly the boundary at which weak source CBV and the normalizer of lemma 124.3 have the same retained constructor result.
Write Γr;Γe⊢𝖿𝗈𝑟:𝐵 for the least formation judgment generated by those clauses. The context Γr contains data variables at runtime-first-order types. The context Γe contains variables that may occur only in checked static arguments. A branch extends the appropriate context by each field according to its relevance annotation; the recursive-result binder of a natural or vector eliminator extends Γr. Thus the judgment records a finite syntax derivation. It is not the extensional relation ⇓𝖳 of definition 124.2.
Thus the card covers neither an arbitrary unannotated state telescope nor a head or transition rejected by Timpl-erasure, and it excludes a generated map with a retained higher-order field or an internal helper application. The target signature fixes 𝐶𝗌𝗍𝗋𝖾𝖺𝗆 as an arity-two tag whose fields are nullary closures: ℎ is a nullary head thunk and 𝑘 a nullary tail closure. Erasure of the coiterator elaboration of definition 124.11 is |𝖼𝗈𝗂𝗍𝖾𝗋(ℎ,𝑡,𝑠)|:=𝐶𝗌𝗍𝗋𝖾𝖺𝗆(𝖼𝗅𝗈𝗌(ℎ∗,|𝑠|),𝖼𝗅𝗈𝗌(𝑡∗,|𝑠|)), where ℎ∗ and 𝑡∗ are fresh nullary closure tags, not the ordinary compiled tags of ℎ and 𝑡. For a fresh target variable 𝑠′, their entries are 𝛿𝑡(ℎ∗)=(𝑠;⋅;|ℎ(𝑠)|) and 𝛿𝑡(𝑡∗)=(𝑠;⋅;(𝜆𝑠′.𝐶𝗌𝗍𝗋𝖾𝖺𝗆(𝖼𝗅𝗈𝗌(ℎ∗,𝑠′),𝖼𝗅𝗈𝗌(𝑡∗,𝑠′)))|𝑡(𝑠)|). The beta-redex in the second body computes the next state once and stores the result in both closures of the next stream block. In particular, compiling 𝑡 :𝑆 →𝑆 as an ordinary tag would be wrong: that tag returns a state, whereas a tail observation must return a 𝐶𝗌𝗍𝗋𝖾𝖺𝗆 block. The target observer is a separate inductive judgment rather than an extra Texec term former. Write 𝖮𝖻𝗌(𝑞,𝑜,𝑤) when the target stream block 𝑞 produces value 𝑤 after observation word 𝑜. It is generated by 𝖼𝖺𝗅𝗅(ℎ)⇓𝑤𝖮𝖻𝗌(𝐶𝗌𝗍𝗋𝖾𝖺𝗆(ℎ,𝑘),𝗁𝖾𝖺𝖽,𝑤)Obs−Head and 𝖼𝖺𝗅𝗅(𝑘)⇓𝐶𝗌𝗍𝗋𝖾𝖺𝗆(ℎ′,𝑘′)𝖮𝖻𝗌(𝐶𝗌𝗍𝗋𝖾𝖺𝗆(ℎ′,𝑘′),𝑜,𝑤)𝖮𝖻𝗌(𝐶𝗌𝗍𝗋𝖾𝖺𝗆(ℎ,𝑘),𝗍𝖺𝗂𝗅⋅𝑜,𝑤)Obs−Tail. Thus exactly one of the two closures is forced per observation symbol, and the tail premise requires the forced closure to return the next 𝐶𝗌𝗍𝗋𝖾𝖺𝗆 block. This card inherits the source productivity theorem only for accepted stream groups and proves no normalization or generic coinductive simulation.
Referenced from 9 locations
Assume that the target signature and case tables satisfy the hypotheses of lemma 126.2. If 𝖮𝖻𝗌(𝑞,𝑜,𝑤) and 𝖮𝖻𝗌(𝑞,𝑜,𝑤′), then 𝑤 =𝑤′.
Referenced from 3 locations
Proof of Lemma 126.16 — Target observation is functional
Proof. Induct on the first observation derivation and invert the second derivation on the common observation word. In the head case, both premises evaluate 𝖼𝖺𝗅𝗅(ℎ); target determinism gives equal results. In the tail case, target determinism makes the two evaluations of 𝖼𝖺𝗅𝗅(𝑘) return the same stream block 𝐶𝗌𝗍𝗋𝖾𝖺𝗆(ℎ′,𝑘′). The induction hypothesis applied to the two remaining derivations at that block gives equal final values. These are the two observation rules. ◻
For 𝖿𝗋𝗈𝗆(0), the target head closure returns zero. Forcing the tail closure constructs the state one; forcing the resulting head closure returns one. No finite target value contains all future naturals.
★☆☆ Let 𝑞0 =|𝖼𝗈𝗂𝗍𝖾𝗋(ℎ,𝑡,0)| for ℎ(𝑛) =𝑛 and 𝑡(𝑛) =𝗌𝗎𝖼𝑛. Derive 𝖮𝖻𝗌(𝑞0,𝗁𝖾𝖺𝖽,𝐶𝟢) and 𝖮𝖻𝗌(𝑞0,𝗍𝖺𝗂𝗅 ⋅𝗁𝖾𝖺𝖽,𝐶𝗌𝗎𝖼(𝐶𝟢)). Name the closure forced at each premise and the stream block returned by the tail closure.
Referenced from 3 locations
Let Σ be the accepted group-free Timpl signature determined by definition 126.15. Let Γr;Γe ⊢𝖿𝗈𝑟 :𝐵, where 𝐵 is runtime first order. Let 𝜃 be a well-typed closing substitution that maps every variable of Γr to a closed source data value and every variable of Γe to a closed checked static term. Put 𝑛𝑟,𝜃:=nf𝐵[𝜃]Σ,⋅(𝑟[𝜃]). There is a unique source data value 𝑢 :𝐵[𝜃], among the results of source evaluation of 𝑟[𝜃], such that 𝑟[𝜃]⇓𝑢,nf(𝑢)=𝑛𝑟,𝜃,|𝑢|=|𝑛𝑟,𝜃|. Moreover, for every target value 𝑤, 𝑢R𝑤⟺𝑛𝑟,𝜃R𝑤.
Referenced from 3 locations
Proof of Lemma 126.17 — First-order source and normalizer agreement
Proof. The induction is on the displayed first-order formation derivation and is strengthened over all closing substitutions 𝜃. The simultaneous invariant consists of source existence, uniqueness of its data result, the normalizer equation, the erasure equation, and both directions of the representation equivalence.
For a runtime variable 𝑥, the value 𝜃(𝑥) is the required result by S-Val. Unit, Booleans, zero, and reflexivity use the corresponding value rule. The successor case applies the induction hypothesis to its predecessor and then S-Con. A pair applies the two induction hypotheses in source evaluation order and concludes with S-Pair. An accepted data constructor does the same for precisely its runtime fields and leaves each erased field at the checked term supplied by 𝜃; S-Con constructs the source value. In each of these cases, NbE evaluates the same components, readback preserves the outer data tag, and erasure drops exactly the fields marked erased. Disjoint data tags and the component uniqueness hypotheses give uniqueness. The definition of R then gives its two directions field by field.
Consider a datatype case. The scrutinee induction hypothesis returns one constructor value 𝑐(⃗𝑣;⃗𝑎), with runtime fields ⃗𝑣 and checked erased fields ⃗𝑎. NbE sees the same constructor tag because the simultaneous normalizer equation preserves that tag. Extend 𝜃 by the fields according to their relevance marks and apply the induction hypothesis for the selected branch body. Rule S-Case gives the source evaluation. Any second source derivation must select the same constructor by scrutinee uniqueness and disjointness of tags, after which branch-result uniqueness applies. The Boolean cases are the two nullary instances, using S-Bool-T and S-Bool-F.
For a natural eliminator, first apply the structural induction hypothesis to its scrutinee. Perform a subsidiary induction on the resulting canonical natural value. At zero, apply the structural hypothesis for the base body and S-Nat-Z. At 𝗌𝗎𝖼𝑣, the subsidiary hypothesis supplies the unique result of the recursive eliminator at 𝑣; extend 𝜃 by 𝑣 and that result, apply the structural hypothesis for the step body, and conclude with S-Nat-S. NbE recursion follows the identical finite canonical numeral, so the subsidiary induction also proves the normalizer, erasure, and representation clauses. Inversion of a second source derivation exposes the same predecessor, recursive result, and step instance, giving uniqueness in that order.
The vector eliminator uses a separate subsidiary induction on the canonical vector returned by the scrutinee hypothesis. The nil case uses S-Vec-Nil. In the cons case, the structural hypotheses identify the index, head, and tail; the subsidiary hypothesis supplies the recursive result on the tail; and the branch-body hypothesis concludes with S-Vec-Cons. The branch-body derivation is a strict subderivation of the first-order grammar derivation, whereas the recursive call decreases the canonical vector.
For identity elimination, the proof hypothesis returns a reflexivity value. After endpoint conversion, extend 𝜃 by its witness, apply the structural hypothesis to the reflexive branch, and use S-J. NbE selects the same reflexive branch. Proof-value inversion and branch uniqueness give the uniqueness clause. These cases exhaust the grammar: it contains no retained lambda, internal application, or named call. Hence the simultaneous structural and subsidiary inductions establish all assertions. ◻
Let 𝑔 be either generated map ℎ :𝑆 →𝐴 or 𝑡 :𝑆 →𝑆 of definition 124.11, equipped with the runtime-relevance derivation and first-order body required by definition 126.15. Let 𝜎 :𝑆 be a closed runtime-first-order expression satisfying that card. If 𝑔(𝜎)⇓𝖳𝑛, then there is a unique source data value 𝑣 such that 𝑔(𝜎)⇓𝑣,nf(𝑣)=𝑛,|𝑣|=|𝑛|. Moreover, for every target value 𝑤, 𝑣R𝑤 if and only if 𝑛R𝑤.
Referenced from 7 locations
Proof of Lemma 126.18 — Generated-map evaluation agreement
Proof. Apply lemma 126.17 to the closed state expression with the empty substitution. It gives a unique source data value 𝑣𝜎 with 𝜎⇓𝑣𝜎,nf(𝜎)=nf(𝑣𝜎). By lemma 126.6, 𝜎 ≡𝑣𝜎.
Write the generated map as 𝑔 =𝜆𝑠.𝑏. Its card supplies the formation derivation 𝑠 :𝑆; ⋅ ⊢𝖿𝗈𝑏 :𝐵, where 𝐵 =𝐴 for ℎ and 𝐵 =𝑆 for 𝑡. Apply the fundamental lemma again with the closing substitution 𝑠 ↦𝑣𝜎. It gives a unique source data value 𝑣 such that 𝑏[𝑣𝜎/𝑠]⇓𝑣,nf(𝑣)=nf(𝑏[𝑣𝜎/𝑠]),|𝑣|=|nf(𝑏[𝑣𝜎/𝑠])|, and the corresponding representation equivalence.
It remains to identify the displayed normal form with 𝑛. Beta equality gives 𝑔(𝜎) ≡𝑏[𝜎/𝑠]. Substitution congruence applied to 𝜎 ≡𝑣𝜎 gives 𝑏[𝜎/𝑠] ≡𝑏[𝑣𝜎/𝑠]. Completeness in lemma 124.3 therefore yields nf(𝑔(𝜎))=nf(𝑏[𝑣𝜎/𝑠]). The premise 𝑔(𝜎) ⇓𝖳𝑛 is, by definition, the equation 𝑛 =nf(𝑔(𝜎)). Hence 𝑛 =nf(𝑏[𝑣𝜎/𝑠]), so the equations and representation equivalence supplied for 𝑣 have exactly the form stated in the lemma. Rule S-App-R, using S-Val for the outer lambda, now derives 𝑔(𝜎) ⇓𝑣.
For uniqueness, invert any second source evaluation of 𝑔(𝜎). Its argument premise evaluates 𝜎; the first use of the fundamental lemma identifies that result with 𝑣𝜎. The remaining premise therefore evaluates 𝑏[𝑣𝜎/𝑠], and the second use identifies its result with 𝑣. Thus no other source data value can be the result. ◻
Let 𝐴, the generated state datatype 𝑆, and the maps ℎ :𝑆 →𝐴, 𝑡 :𝑆 →𝑆 satisfy the premises of definition 126.15. Let 𝜎 :𝑆 be a closed source state term with ⋅ ⊢𝜎 :𝑆 and ⋅ ⊢𝜎 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, and assume that 𝜎 is in the runtime-first-order expression grammar of that card. For every observation word 𝑜, if 𝖼𝗈𝗂𝗍𝖾𝗋(ℎ,𝑡,𝜎)⇓𝑜𝑣, then there is a unique target value 𝑤 such that 𝖮𝖻𝗌(|𝖼𝗈𝗂𝗍𝖾𝗋(ℎ,𝑡,𝜎)|,𝑜,𝑤)and𝑣R𝑤.
Referenced from 5 locations
Proof of Theorem 126.19 — Coiterator erasure simulation
Proof. Generalize over the closed state term 𝜎 and induct on 𝑜. In the head case, inversion of the source observation and Coiter-Head from definition 124.11 give a state normal form 𝜎0 :𝑆, 𝜎 ⇓𝖳𝜎0, and ℎ(𝜎0) ⇓𝖳𝑣. Soundness of the first judgment and substitution invariance in lemma 124.3 give ℎ(𝜎) ⇓𝖳𝑣. Apply lemma 126.18 to obtain the unique source-CBV value 𝑣0 with ℎ(𝜎) ⇓𝑣0, nf(𝑣0) =𝑣, and |𝑣0| =|𝑣|. Typing and runtime relevance of ℎ(𝜎) permit theorem 126.14; its target derivation is precisely the body forced by 𝖼𝖺𝗅𝗅(𝖼𝗅𝗈𝗌(ℎ∗,|𝜎|)), using lemma 126.11 for the stored state. Conclude with Obs-Head; the representation equivalence in lemma 126.18 converts 𝑣0R𝑤 to 𝑣R𝑤.
For 𝗍𝖺𝗂𝗅 ⋅𝑜′, inversion of the observation rule and Coiter-Tail gives closed source state normal forms 𝜎0,𝜎′ :𝑆, subevaluations 𝜎 ⇓𝖳𝜎0 and 𝑡(𝜎0) ⇓𝖳𝜎′, and the strictly shorter observation derivation 𝖼𝗈𝗂𝗍𝖾𝗋(ℎ,𝑡,𝜎′) ⇓𝑜′𝑣. Normalizer substitution invariance gives 𝑡(𝜎) ⇓𝖳𝜎′. Apply lemma 126.18 to obtain a unique source-CBV state 𝜎𝑣 with 𝑡(𝜎) ⇓𝜎𝑣, nf(𝜎𝑣) =𝜎′, and |𝜎𝑣| =|𝜎′|, and then apply forward simulation to that source evaluation. The target tail wrapper evaluates the displayed beta-redex, installs |𝜎𝑣| =|𝜎′| in both closures, and therefore returns 𝐶𝗌𝗍𝗋𝖾𝖺𝗆(𝖼𝗅𝗈𝗌(ℎ∗,|𝜎′|),𝖼𝗅𝗈𝗌(𝑡∗,|𝜎′|)). The generalized induction hypothesis at 𝜎′ applies because normal forms in the accepted first-order grammar remain first order, and supplies the remaining observation premise; conclude with Obs-Tail. In both cases, lemma 126.16 gives uniqueness. ◻
Let 𝑐 =𝑑𝑖 ⃗𝑎 be a closed Timpl-co call accepted by the guardedness checker, and let 𝜎𝑐:=𝗂𝗇𝑖(⃗𝑎):𝖲𝗍𝖺𝗍𝖾G,𝑐†:=𝖼𝗈𝗂𝗍𝖾𝗋(ℎ,𝑡,𝜎𝑐). Assume the element type, state datatype, arguments, and generated maps satisfy definition 126.15; in particular, ⋅ ⊢𝜎𝑐 :𝖲𝗍𝖺𝗍𝖾G and ⋅ ⊢𝜎𝑐 𝗋𝗎𝗇𝗍𝗂𝗆𝖾, and 𝜎𝑐 is a runtime-first-order expression. Define the co-erasure of the source call by |𝑐|𝖼𝗈:=|𝑐†|. If 𝑐 ⇓𝑜𝑣, then there is a unique 𝑤 with 𝖮𝖻𝗌(|𝑐|𝖼𝗈,𝑜,𝑤) and 𝑣R𝑤.
Referenced from 3 locations
Proof of Corollary 126.20 — Accepted stream-call erasure
Proof. By theorem 124.15, the source premise is equivalent to 𝑐† ⇓𝑜𝑣. Apply theorem 126.19 at the generated state 𝜎𝑐. ◻
This theorem is not an instance of normalization: both source and target streams denote computations with arbitrarily long observation paths. It is also not a new productivity proof; acceptance and theorem 124.10 supply the finite source derivation used by the corollary’s premise.
Typed-target erasure through System Fi.
System Fi has type-level contexts Δ ::= ⋅ ∣Δ,𝑋𝜅 ∣Δ,𝑖𝐴, term contexts Γ ::= ⋅ ∣Γ,𝑥 :𝐴, and Curry-style terms 𝑡 ::=𝑥 ∣𝜆𝑥.𝑡 ∣𝑡 𝑡. Its kinds and type constructors are 𝜅::=∗∣𝜅→𝜅∣𝐴⇒𝜅,𝐹::=𝑋∣𝐴→𝐵∣𝜆𝑋𝜅.𝐹∣𝐹𝐺∣∀𝑋𝜅.𝐵∣𝜆𝑖𝐴.𝐹∣𝐹{𝑠}∣∀𝑖𝐴.𝐵. The index domain 𝐴 in 𝐴 ⇒𝜅 is closed and has kind ∗. The source writes this index arrow as 𝐴 →𝜅; the card uses ⇒ only to distinguish it visually from the ordinary kind arrow 𝜅 →𝜅′. An index application 𝐹{𝑠} requires Δ; ⋅ ⊢𝑠 :𝐴. Index generalization requires 𝑖 ∉𝖥𝖵(𝑡) ∪𝖥𝖵(Γ). The judgments are well-sorted kinds, well-formed Δ, kinding and constructor equality, well-formed Γ, and typing Δ;Γ ⊢𝑡 :𝐴.
The target is Curry-style 𝐹𝜔 with the same term grammar and without index-arrow kinds, index bindings, index abstractions, index applications, or index-polymorphic types. Index erasure is the homomorphism on the shared constructors together with (𝐴⇒𝜅)∘=𝜅∘,(𝜆𝑖𝐴.𝐹)∘=𝐹∘,(𝐹{𝑠})∘=𝐹∘,(∀𝑖𝐴.𝐵)∘=𝐵∘,(Δ,𝑖𝐴)∘=Δ∘,(Γ,𝑥:𝐴)∘=Γ∘,𝑥:𝐴∘. Terms are unchanged. The auxiliary context Δ∙ drops type variables and moves every index binding 𝑖𝐴 to the term binding 𝑖 :𝐴.
Referenced from 3 locations
For the exact card of definition 126.21, index erasure has these seven properties.
⊢𝜅 :◻ implies ⊢𝜅∘ :◻.
⊢Δ implies ⊢Δ∘.
⊢𝜅 =𝜅′ :◻ implies ⊢𝜅∘ =𝜅′∘ :◻.
⊢Δ and Δ ⊢𝐹 :𝜅 imply Δ∘ ⊢𝐹∘ :𝜅∘.
Δ ⊢𝐹 =𝐺 :𝜅 implies Δ∘ ⊢𝐹∘ =𝐺∘ :𝜅∘.
Δ ⊢Γ implies Δ∘ ⊢(Δ∙,Γ)∘.
If Δ ⊢Γ and Δ;Γ ⊢𝑡 :𝐴, then Δ∘;(Δ∙,Γ)∘⊢𝐹𝜔𝑡:𝐴∘.
If 𝖽𝗈𝗆(Δ) ∩𝖥𝖵(𝑡) =∅, item 7 sharpens to Δ∘;Γ∘ ⊢𝐹𝜔𝑡 :𝐴∘.
Referenced from 5 locations
Proof of Theorem 126.22 — System Fi index-erasure interface
Proof. Prove the seven claims simultaneously. The induction hypotheses are the corresponding erasure claims for every premise derivation; mutual induction is needed because kinding invokes kind sorting, constructor equality invokes kinding, and typing invokes all the preceding judgments.
For kind sorting, ∗ is unchanged and ordinary kind arrows use the two induction hypotheses. An index arrow 𝐴 ⇒𝜅 erases to 𝜅∘, whose sorting derivation is the induction hypothesis for the codomain. Context formation is then immediate: an ordinary type-variable declaration is rebuilt from the erased sorting premise, while an index declaration disappears. These are items 1 and 2.
For kind equality, reflexivity, symmetry, and transitivity are rebuilt in the target. Congruence for an ordinary arrow uses both induction hypotheses. Congruence for an index arrow has conclusion 𝜅∘ =𝜅′∘, so its domain-equality premise disappears and the codomain induction hypothesis closes the case. Beta and eta equations for ordinary type abstraction erase to the corresponding 𝐹𝜔 equations; the index-beta and index-eta equations erase to reflexivity because both index abstraction and index application disappear. This proves item 3.
For kinding, variables, ordinary arrows, ordinary abstraction and application, and ordinary universal quantification are reconstructed with the target rules and the induction hypotheses. Weakening across an erased index declaration is admissible because that declaration contributes no free target variable. In the three index-specific cases one calculates (𝜆𝑖𝐴.𝐹)∘=𝐹∘,(𝐹{𝑠})∘=𝐹∘,(∀𝑖𝐴.𝐵)∘=𝐵∘. The induction hypothesis for 𝐹 or 𝐵 therefore already has the required target conclusion; the closed index term 𝑠 has no target occurrence. Conversion uses item 3. This proves item 4.
The constructor-equality induction follows the same rule partition. The ordinary congruence, beta, eta, symmetry, transitivity, and conversion cases are rebuilt in 𝐹𝜔. Index congruence retains only the induction hypothesis for the constructor. Index beta uses (𝐹[𝑠/𝑖])∘=𝐹∘, proved by structural induction on 𝐹: the variable and ordinary-binder cases commute with substitution, and every occurrence of 𝑖 lies in an index position deleted by erasure. Ordinary type beta uses the companion structural equation (𝐹[𝐺/𝑋])∘=𝐹∘[𝐺∘/𝑋]. Both equations are stable under binders after alpha-renaming the binder away from the substituted variable. These calculations prove item 5.
For item 6, induct on term-context formation. The empty context is unchanged. An ordinary term declaration 𝑥 :𝐴 is rebuilt using item 4. Extending Δ by 𝑖𝐴 deletes that type-level declaration but adds 𝑖 :𝐴 to Δ∙; item 4 gives the required formation of 𝐴∘. Extending Δ by 𝑋𝜅 keeps the erased type-level declaration and adds nothing to Δ∙.
Finally, induct on typing. A term variable is found either in Γ∘ or in the moved index context (Δ∙)∘. Term abstraction and application are homomorphic and use the induction hypotheses. Ordinary type generalization and instantiation use items 1–5. Index generalization erases its quantifier; its freshness premise 𝑖 ∉𝖥𝖵(𝑡) ∪𝖥𝖵(Γ) permits strengthening away the moved term declaration. Index instantiation leaves the Curry term unchanged and replaces its type using (𝐵[𝑠/𝑖])∘ =𝐵∘. The conversion case uses item 5. These cases exhaust the typing rules and prove item 7.
If 𝖽𝗈𝗆(Δ) ∩𝖥𝖵(𝑡) =∅, repeated strengthening removes every declaration contributed by Δ∙, which gives the sharpened conclusion. ◻
Every well-typed System Fi term is strongly normalizing for its displayed beta reduction. There is no closed System Fi term of type ∀𝑋∗.𝑋.
Referenced from 3 locations
Proof of Corollary 126.23 — Normalization and consistency of System Fi
Proof. By item 7 of theorem 126.22, the unchanged Curry term is well typed in 𝐹𝜔 at its erased type. Source and target have the same term reduction, so an infinite System Fi reduction would be an infinite well-typed 𝐹𝜔 reduction, contradicting theorem 60.23. The void type erases to itself. If a closed Fi term had type ∀𝑋∗.𝑋, normalization and subject reduction in the 𝐹𝜔 vertex would give a closed beta-normal term of that type. Its head must be a type abstraction Λ𝑋.𝑢, with 𝑋 : ∗; ⋅ ⊢𝑢 :𝑋. A beta-normal term of atomic type is neutral, and a neutral term has a free term-variable head. The empty term context has no such head, a contradiction. ◻
The source Church encoding is 𝖵𝖾𝖼:=𝜆𝐴∗.𝜆𝑖ℕ.∀𝑋ℕ⇒∗.(∀𝑗ℕ.𝐴→𝑋{𝑗}→𝑋{𝗌𝗎𝖼𝑗})→𝑋{0}→𝑋{𝑖}. Applying the four erasure clauses gives 𝖵𝖾𝖼∘=𝜆𝐴∗.∀𝑋∗.(𝐴→𝑋→𝑋)→𝑋→𝑋:=𝖫𝗂𝗌𝗍.
★☆☆ Erase the System Fi type ∀𝑖ℕ.𝖵𝖾𝖼 𝐴{𝑖} →ℕ, using the Church encoding displayed above. State which binder and applications disappear.
Referenced from 3 locations
The source discusses 𝗌𝖺𝖿𝖾𝖳𝖺𝗂𝗅 later under a different encoding: the equality-constraint encoding of its Section 6, not the preceding Church encoding. Write Leibniz index equality as 𝑖=ℕ𝑗:=∀𝑋ℕ⇒∗.𝑋{𝑖}→𝑋{𝑗}, and put 𝖵𝖾𝖼=:=𝜆𝐴∗.𝜆𝑖ℕ.∀𝑋ℕ⇒∗.(∃𝑗ℕ.(𝗌𝗎𝖼𝑗=ℕ𝑖)×𝐴×𝑋{𝑗})+(0=ℕ𝑖). Fix an index 𝑛 :ℕ. The index theory used by the example supplies the two no-confusion consequences 𝗌𝗎𝖼𝖨𝗇𝗃𝑗,𝑛:(𝗌𝗎𝖼𝑗=ℕ𝗌𝗎𝖼𝑛)→(𝑗=ℕ𝑛),𝗓𝖾𝗋𝗈𝖭𝖾𝖲𝗎𝖼𝑛,𝐵:(0=ℕ𝗌𝗎𝖼𝑛)→𝐵. With the usual impredicative sum, product, and existential eliminators, the source witness is the following Curry term; the displayed type/index instantiations are typing annotations, not term constructors: 𝑠𝑛(𝑗,𝑒,𝑎,𝑥𝑠):=𝗍𝗋𝑘.𝖵𝖾𝖼=𝐴{𝑘}(𝗌𝗎𝖼𝖨𝗇𝗃𝑗,𝑛(𝑒),𝑥𝑠),𝑧𝑛(𝑒0):=𝗓𝖾𝗋𝗈𝖭𝖾𝖲𝗎𝖼𝑛,𝖵𝖾𝖼=𝐴{𝑛}(𝑒0),𝗌𝖺𝖿𝖾𝖳𝖺𝗂𝗅𝑛:=𝜆𝑣.𝖼𝖺𝗌𝖾+(𝑣[𝖵𝖾𝖼=𝐴/𝑋];𝑝.𝗎𝗇𝗉𝖺𝖼𝗄(𝑝;𝑠𝑛),𝑧𝑛). Here 𝗎𝗇𝗉𝖺𝖼𝗄(𝑝;𝑠𝑛) eliminates the existential package into its four components (𝑗,𝑒,𝑎,𝑥𝑠) and applies 𝑠𝑛 to them. Here the first branch transports the stored tail 𝑥𝑠 :𝖵𝖾𝖼=𝐴{𝑗} along 𝑗 =ℕ𝑛; the second branch uses the impossible equality 0 =ℕ𝗌𝗎𝖼𝑛. Thus every branch has exactly the claimed result type.
Let 𝑃:=∀𝑌∗.𝑌 →𝑌, the erasure of index equality, and let 𝖤𝗑(𝐵):=∀𝑍∗.(𝐵 →𝑍) →𝑍, the erasure of an index existential. Direct application of the four erasure clauses gives (𝖵𝖾𝖼=𝐴{𝑖})∘=∀𝑋∗.𝖤𝗑(𝑃×𝐴×𝑋)+𝑃:=𝖫𝗂𝗌𝗍=(𝐴), independently of 𝑖. Erasing the witness removes the type instantiation and every index component: [𝖵𝖾𝖼=𝐴/𝑋],𝑗,all index arguments. It retains term-level equality evidence: 𝑠∘𝑛(𝑒,𝑎,𝑥𝑠):=𝗌𝗎𝖼𝖨𝗇𝗃∘(𝑒)𝑥𝑠,𝑧∘𝑛(𝑒0):=𝗓𝖾𝗋𝗈𝖭𝖾𝖲𝗎𝖼∘(𝑒0),(𝗌𝖺𝖿𝖾𝖳𝖺𝗂𝗅𝑛)∘:=𝜆𝑣.𝖼𝖺𝗌𝖾+(𝑣;𝑝.𝗎𝗇𝗉𝖺𝖼𝗄(𝑝;𝑠∘𝑛),𝑧∘𝑛). In the target unpacking, the erased index 𝑗 is absent and the remaining package components are (𝑒,𝑎,𝑥𝑠). Its target type is 𝖫𝗂𝗌𝗍=(𝐴) →𝖫𝗂𝗌𝗍=(𝐴). The calculation therefore does not conflate the paper’s Church and equality-constraint encodings, and it does not claim that term-level evidence vanishes under index erasure.
The System Fi theorem is typed-target preservation. It supplies neither the constructor/closure invariant of Texec nor an operational simulation for Timpl. Conversely, theorem 126.14 proves no 𝐹𝜔 kinding or strong-normalization result.
Sources. The System Fi syntax, erasure equations, and seven theorem signatures are from Ahn, Sheard, Fiore, and Pitts, Section 5.2, Definitions 1–2 and Theorems 1–7 [ASFP13]; their short proof span on physical pp. 10–12 is incorporated in theorem 126.22. The separation between an untyped erasure relation and its execution theorem follows the verified architecture of the PCUIC erasure development, especially its target calculus, structural lemmas, and erasure-correctness theorem . Those results concern PCUIC; all Timpl and Texec cases were proved locally above.
Suggested first pass.
None of these problems is a prerequisite for a later chapter. Begin with exercise 126.7, then complete exercise 126.9.
★★☆ State the representation relation for the two source values 𝗏𝗇𝗂𝗅 and 𝗏𝖼𝗈𝗇𝗌(𝑛,𝑎,𝑥𝑠). Prove the constructor case of theorem 126.14, including the runtime substitution for the recursive branch.
Referenced from 4 locations
★★☆ Give two closed substitutions for the erased Boolean counterexample that produce different source numerals. Calculate their identical erasures and show that no deterministic target can forward-simulate both results.
Referenced from 3 locations
★★★ Practical project.dependent-definition-erasure-runner Build a Kappa runner for the finite executable slice of definition 126.3, definition 126.10 containing variables, annotated lambdas and applications, pairs and projections, reflexivity, Boolean and identity elimination, user constructors and cases, and ordinary compiled closures and saturated calls. The runner has three parts: an environment-directed relevance check followed by erasure for that slice; a Texec evaluator implementing E-Val, E-App, E-Con, E-Clos, E-Case and E-Call with real substitution and closure environments; and the observer of definition 126.15. Preserve target arities through one global constructor-signature table, require pairwise distinct case tags, preserve closure sizes, and make fuel a checked budget so that exhaustion is reported and is distinct from a stuck configuration. Execute 𝖺𝗉𝗉𝖾𝗇𝖽 rather than simulating it: require append-two-singletons=vcons(a,vcons(b,vnil)), print its runtime arity, and require from-0=0,1,2,3 from the two stream closures. Reject erased-boolean-branch, naming the erased scrutinee, and print the erasure of the visible administrative redex 𝜆𝖾𝗑𝗉𝗅𝗂𝖼𝗂𝗍,𝖾𝗋𝖺𝗌𝖾𝖽(𝑥 :𝐴). 𝑓 𝖾𝗑𝗉𝗅𝗂𝖼𝗂𝗍,𝖾𝗋𝖺𝗌𝖾𝖽𝑖, which is 𝑓. Also reject an erased application whose head is a variable, naming it non-administrative erased application. Also check a retained-but-unused case field, rejection of an erased branch variable used at runtime, and capture avoidance for open identity-branch substitution. Replay mutations that retain erased declaration binders, allow an erased scrutinee, derive target branch arity from branch use, bypass branch admissibility, omit freshening, ignore the binder environment, bypass the constructor-signature comparison, and accept duplicate branch tags. Primitive natural and vector eliminator occurrence-tag generation is outside this finite runner; the ordinary 𝖺𝗉𝗉𝖾𝗇𝖽 record exercises the same target closure/call evaluator but is not an implementation of those two primitive compilers. This execution illustrates both simulations for the listed slice and proves neither.
Referenced from 5 locations