Dependent Intersections and Same-Subject Refinement
Prerequisites. Direct starred prerequisites: none. No later core chapter depends on this route.
A dependent pair can store a program and a proof about that program, but its erasure still contains two components. Suppose a function 𝑟 already supports two interfaces. Packaging 𝑟 with a second copy or a certificate changes its runtime representation even though both interfaces describe the same untyped subject. The required type former must attach the second view without adding a runtime component.
The binder in 𝑥:𝐴∩𝐵(𝑥) ranges over the subject inhabiting both 𝐴 and 𝐵(𝑥). It is not a path from 𝑥 to itself, a dependent pair, an object-oriented 𝖲𝖾𝗅𝖿 type, or a recursive DOT binder.
The base of 𝖣𝖨 is a Curry-style dependent type assignment system. Typed expressions erase to untyped lambda terms by erase(−). Type annotations, implicit arguments, and proof annotations are erased; ordinary lambda abstraction and application remain. Untyped beta-eta convertibility is written =𝛽𝜂. The chapter adds only Kopylov’s dependent intersection and an annotated elaboration of its one-subject introduction rule. Its extensional semantics is the PER semantics of the selected Nuprl system; decidable type checking and global normalization are not assumptions.
Two differently typed annotated terms can already denote one untyped term. For instance, if implicit abstraction is written Λ0𝐴.𝑡, then erase(Λ0𝐴.𝜆𝑥.𝑥)=𝜆𝑥.𝑥=erase(𝜆𝑥.𝑥). The first term may have type ∀0𝐴:U0.𝐴→𝐴 and the second an ordinary instance 𝖭→𝖭. Equality of erasures is weaker than judgmental equality of typed expressions; it forgets annotations and implicit binders.
The type 𝑥:𝐴∩𝐵 binds 𝑥 in 𝐵. The introduction form 𝖻𝗈𝗍𝗁(𝑎,𝑏) records two typing derivations but erases to their common subject. Its projections are annotation-level views. The rules occur in formation, introduction, elimination, computation, and uniqueness order:
Γ⊢𝐴𝗍𝗒𝗉𝖾Γ,𝑥:𝐴⊢𝐵𝗍𝗒𝗉𝖾
Γ⊢𝑥:𝐴∩𝐵𝗍𝗒𝗉𝖾
DI-F
Γ⊢𝑎:𝐴Γ⊢𝑏:𝐵[𝑎/𝑥]erase(𝑎)=𝛽𝜂erase(𝑏)
Γ⊢𝖻𝗈𝗍𝗁(𝑎,𝑏):𝑥:𝐴∩𝐵
DI-I
Γ⊢𝑑:𝑥:𝐴∩𝐵
Γ⊢𝗅𝖾𝖿𝗍(𝑑):𝐴
DI-E_1
Γ⊢𝑑:𝑥:𝐴∩𝐵
Γ⊢𝗋𝗂𝗀𝗁𝗍(𝑑):𝐵[𝗅𝖾𝖿𝗍(𝑑)/𝑥]
DI-E_2
Γ⊢𝖻𝗈𝗍𝗁(𝑎,𝑏):𝑥:𝐴∩𝐵
𝗅𝖾𝖿𝗍(𝖻𝗈𝗍𝗁(𝑎,𝑏))≡𝑎
DI-β_1
Γ⊢𝖻𝗈𝗍𝗁(𝑎,𝑏):𝑥:𝐴∩𝐵
𝗋𝗂𝗀𝗁𝗍(𝖻𝗈𝗍𝗁(𝑎,𝑏))≡𝑏
DI-β_2
Γ⊢𝑑:𝑥:𝐴∩𝐵
𝖻𝗈𝗍𝗁(𝗅𝖾𝖿𝗍(𝑑),𝗋𝗂𝗀𝗁𝗍(𝑑))≡𝑑
DI-η
The erasure equations are erase(𝖻𝗈𝗍𝗁(𝑎,𝑏)):=erase(𝑎),erase(𝗅𝖾𝖿𝗍(𝑑)):=erase(𝑑),erase(𝗋𝗂𝗀𝗁𝗍(𝑑)):=erase(𝑑). The premise of DI-I makes the first equation independent of the chosen view. The second elimination type substitutes the first view because 𝐵 is formed for subjects of 𝐴.
Let 𝑢:∀0𝐴:U0.𝐴→𝐴 and 𝑣:𝖭→𝖭 be the two identity annotations above. If 𝐵(𝑓) is the constant type 𝖭→𝖭, then
Γ⊢𝑢:∀0𝐴:U0.𝐴→𝐴Γ⊢𝑣:𝖭→𝖭erase(𝑢)=𝛽𝜂𝜆𝑥.𝑥=𝛽𝜂erase(𝑣)
Γ⊢𝖻𝗈𝗍𝗁(𝑢,𝑣):𝑓:(∀0𝐴:U0.𝐴→𝐴)∩(𝖭→𝖭)
DI-I
is the required first derivation. Both projections erase to 𝜆𝑥.𝑥.
The stuck case is equally important. If 𝑧:𝑥:𝐴∩𝐵 is a variable, neither 𝗅𝖾𝖿𝗍(𝑧) nor 𝗋𝗂𝗀𝗁𝗍(𝑧) contracts; the projections are neutral annotations. Their erasures are nevertheless the same variable 𝑧.
★☆☆ Let 𝑑:𝑥:𝐴∩𝐵 and let 𝐶 be a type independent of 𝑥. Derive 𝖻𝗈𝗍𝗁(𝗅𝖾𝖿𝗍(𝑑),𝗋𝗂𝗀𝗁𝗍(𝑑)):𝑥:𝐴∩𝐵 and calculate its two projections. State where the same-erasure premise is discharged.
An ordinary intersection 𝐴∩𝐶 can express two views, but 𝐶 cannot mention the subject through a binder. A dependent sum ∑𝑥:𝐴𝐵 can express the dependency, but erase((𝑎,𝑏))=(erase(𝑎),erase(𝑏)) contains two runtime components. A refinement {𝑥:𝐴∣𝑃(𝑥)} is same-representation only when 𝑃 is an erased logical predicate; it cannot in general attach a computational interface 𝐵(𝑥). Dependent intersection is determined by the conjunction of the two missing requirements: dependent second view and one erased subject.
Removing the last premise of DI-I admits 𝖻𝗈𝗍𝗁(𝜆𝑥.𝑥,𝜆𝑥.0). Its first projection would erase to 𝜆𝑥.𝑥 and its second to 𝜆𝑥.0, while the intersection itself has only one erasure. At least one projection equation would then be false.
★★☆ For each of ordinary intersection, dependent sum, refinement, and dependent intersection, answer two questions: may the second component mention the first subject, and does elimination return the same erased program? Give a term showing each negative answer.
Proof of Lemma 93.3 — Erasure commutes with substitution
Proof. Proceed by structural induction on 𝑒. The variable and ordinary binder cases are the capture-avoiding substitution calculation. For the new introduction form, erase(𝖻𝗈𝗍𝗁(𝑎,𝑏)[𝑢/𝑥])𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑖𝑜𝑛=erase(𝑎[𝑢/𝑥])𝐼𝐻=erase(𝑎)[erase(𝑢)/𝑥]𝑑𝑒𝑓𝑖𝑛𝑖𝑡𝑖𝑜𝑛=erase(𝖻𝗈𝗍𝗁(𝑎,𝑏))[erase(𝑢)/𝑥]. For either projection, apply the induction hypothesis to its argument. No other constructor changes erasure. ◻
Proof. Induct on the typing derivation. In the DI-I case the induction hypotheses give Γ,Δ[𝑢/𝑥]⊢𝑎[𝑢/𝑥]:𝐴[𝑢/𝑥],Γ,Δ[𝑢/𝑥]⊢𝑏[𝑢/𝑥]:𝐵[𝑎/𝑥][𝑢/𝑥]. Choose bound names outside FV(𝑢)∪FV(𝐴)∪FV(𝐵) before commuting the two substitutions. The old side condition and lemma 93.3 give erase(𝑎[𝑢/𝑥])=erase(𝑎)[erase(𝑢)/𝑥]=𝛽𝜂erase(𝑏)[erase(𝑢)/𝑥]=erase(𝑏[𝑢/𝑥]). Rule DI-I then reconstructs the conclusion. In the DI-E2 case, the induction hypothesis gives the substituted intersection premise, and capture avoidance gives 𝐵[𝗅𝖾𝖿𝗍(𝑑)/𝑦][𝑢/𝑥]=𝐵[𝑢/𝑥][𝗅𝖾𝖿𝗍(𝑑[𝑢/𝑥])/𝑦]. The remaining cases are instances of the base substitution proof with the same substitution. ◻
If Γ⊢𝑒:𝐸, then every annotation-level reduction 𝑒⟶𝑒′ satisfies erase(𝑒)=𝛽𝜂erase(𝑒′). In particular, both dependent-intersection beta rules preserve the untyped subject.
Proof. Induct on the reduction context. Ordinary beta reduction maps to untyped beta reduction by lemma 93.3. At the first new redex, erase(𝗅𝖾𝖿𝗍(𝖻𝗈𝗍𝗁(𝑎,𝑏)))=erase(𝑎)=erase(𝑎). At the second, erase(𝗋𝗂𝗀𝗁𝗍(𝖻𝗈𝗍𝗁(𝑎,𝑏)))=erase(𝑎)=𝛽𝜂erase(𝑏), where the final step is precisely the premise of DI-I. Compatible contexts preserve beta-eta convertibility. ◻
The PER validates one subject
Let 𝑅𝐴 be the PER interpreting 𝐴. For each 𝑅𝐴-related pair 𝑎,𝑎′, let 𝑅𝑎,𝑎′𝐵 interpret 𝐵 and be invariant under the 𝑅𝐴 equivalence class. The dependent-intersection PER is 𝑅𝑥:𝐴∩𝐵(𝑡,𝑡′)⟺𝑅𝐴(𝑡,𝑡′)∧𝑅𝑡,𝑡′𝐵(𝑡,𝑡′). The same programs 𝑡,𝑡′ occur in both conjuncts. A Sigma interpretation would instead relate two pairs and project different components.
Assume the selected Nuprl candidate type system validates the base type formers and functional PER families. Extending it by equation 93.1 validates DI-F, DI-I, both elimination rules, the two computation rules, and extensional equality of dependent-intersection types.
Proof of Theorem 93.6 — Kopylov semantic validation
Proof. Formation follows because 𝑅𝐴 is a PER and the functional-family premise makes the second conjunct independent of representatives. Symmetry of equation 93.1 uses symmetry of 𝑅𝐴 and 𝑅𝑡,𝑡′𝐵; transitivity uses their transitivity after replacing the middle representative by functionality. Introduction supplies both conjuncts for the same erased subject. The first elimination selects the 𝑅𝐴 conjunct. The second selects 𝑅𝑡,𝑡′𝐵 after the first view fixes the subject substituted for 𝑥. The computation rules do not change the subject, and extensional type equality follows by logical equivalence of both conjuncts under equal domain PERs and equal functional families. ◻
This theorem is the semantic Theorem 10 singled out by Kopylov. The paper reports MetaPRL checks for the remaining formal results, not for this semantic argument. The surrounding Nuprl calculus admits partial computations, so the theorem is not a normalization proof.
No annotation-normalization theorem follows merely by choosing a strongly normalizing erased target. A source step may contract an implicit binder, ascription, proof annotation, or a redex inside an erased view while inducing no target step. A normalization argument would therefore need the complete source reduction relation and a measure for every zero-erasure constructor; the frozen Kopylov signature supplies neither. Adding an untyped fixed point also leaves theorem 93.6 meaningful for partial terms. The chapter consequently makes no source- or annotation-normalization claim.
A dependent record with no wrapper
Fix labels 𝖼𝖺𝗋 and 𝗆𝗎𝗅. A single-field record type is {ℓ:𝐴}:={ℓ}→𝐴, and a record is a function on labels. Define 𝖲𝖾𝗆𝗂𝗀𝗋𝗈𝗎𝗉𝖲𝗂𝗀:=𝑟:{𝖼𝖺𝗋:U0}∩{𝗆𝗎𝗅:𝑟.𝖼𝖺𝗋→𝑟.𝖼𝖺𝗋→𝑟.𝖼𝖺𝗋}. Let 𝑠 be the untyped label function whose 𝖼𝖺𝗋 branch returns 𝖭 and whose 𝗆𝗎𝗅 branch returns addition. Give it two annotations: 𝑠𝑐:{𝖼𝖺𝗋:U0},𝑠𝑚:{𝗆𝗎𝗅:𝑠𝑐.𝖼𝖺𝗋→𝑠𝑐.𝖼𝖺𝗋→𝑠𝑐.𝖼𝖺𝗋}. Both erase to 𝑠, so 𝖻𝗈𝗍𝗁(𝑠𝑐,𝑠𝑚) inhabits 𝖲𝖾𝗆𝗂𝗀𝗋𝗈𝗎𝗉𝖲𝗂𝗀. The second field type computes after the first view: 𝑠𝑐.𝖼𝖺𝗋≡𝖭,𝑠𝑚.𝗆𝗎𝗅:𝖭→𝖭→𝖭. Both record projections erase to the same label function 𝑠; field selection chooses a branch, but dependent intersection itself inserts no pair or wrapper.
Associativity can be attached by one more dependent intersection whose second view is the set of the same record functions satisfying the associativity proposition. The runtime program remains 𝑠. A Sigma encoding would instead store (𝑠,𝑝).
★★☆ Extend 𝖲𝖾𝗆𝗂𝗀𝗋𝗈𝗎𝗉𝖲𝗂𝗀 by a unit field and two unit equations. Give the nested dependent-intersection type, the annotation of a natural-number instance, and the erasure of every projection. Verify that reassociating the three views preserves the conjunction 𝑅𝐴(𝑡,𝑡′)∧𝑅𝐵(𝑡,𝑡′)∧𝑅𝐶(𝑡,𝑡′) in the PER model.
No row licenses a rule from another. In particular, dependent intersection does not permit 𝐵 to mention the function whose type is being formed unless that function is already the subject supplied by the left view.
★★☆ Prove, from equation 93.1, the extensional equality 𝑥:𝐴∩(𝑦:𝐵(𝑥)∩𝐶(𝑥,𝑦))=𝑧:(𝑥:𝐴∩𝐵(𝑥))∩𝐶(𝑧,𝑧). Expand membership on both sides until each is the conjunction of three PER relations on the same subject. Check the functionality premise used when a representative changes.
★★★ Reconstruct the DI-I and DI-E2 cases of semantic validation and the corresponding substitution cases. Then remove functionality of the PER family and give related representatives for which the second conjunct changes.
★★★Practical project.dependent-intersection-erasure-checker Implement in Kappa a finite checker whose erasure grammar distinguishes identity, constant, and record shapes and whose annotations include 𝖻𝗈𝗍𝗁/𝗅𝖾𝖿𝗍/𝗋𝗂𝗀𝗁𝗍. Maintain the invariant that each accepted 𝖻𝗈𝗍𝗁(𝑎,𝑏) has identical erased shape. It must accept two annotations of identity and two record views, reject an identity/constant pair, and confirm that both projections of each accepted pair erase to one shape. Removing the same-erasure conjunct must make the test fail.
Sources. The dependent-intersection rules, PER validation, associativity calculation, and record construction are Kopylov’s. The source’s Table 1 and semantic Theorem 10 occur on the third printed page; the derived eliminations and associativity theorem continue on the fourth; the record rules are on pages 7–8. The annotated same-erasure presentation makes the Curry-style one-subject condition checkable without claiming that the historical Nuprl system had decidable typing. Later realizability and Cedille calculi motivate the executable erasure checker but do not strengthen Kopylov’s theorem [Kop03].