Lectures onType Theory
Logical frameworks and representations of binding
appendix sectionrules

Logical frameworks and representations of binding

Chapter 61: LF, canonical heads, and adequacy

LF signatures distinguish family declarations a:K from object declarations c:A. In addition to the inherited dependent-product, abstraction, application, structural, and beta–eta conversion rules, the framework-specific rules are XΣtype kindTypea:KΣΓΣa:KFamc:AΣΓΣc:ACon. Products in families and kinds bind only object variables. A canonical object at a product family is an annotated lambda; at an atomic family it is a variable or object constant fully applied to canonical arguments. The implicational object logic has exactly u:PΔΔu:PSupAssmΔ,u:PD:Qudom(Δ)ΔsupI(u.D):PQSupI ΔD:PQΔE:PΔsupE(D,E):QSupE. The STLC object judgment used for the binding-rich encoding has the ordinary variable, annotated-lambda, and application rules. Its LF signature declares tm:tptype, with fully applied heads lam:(tmAtmB)tm(arrAB) and app:tm(arrAB)tmAtmB, including their implicit A,B:tp products.

For the de Bruijn comparison, contexts list their newest declaration first. Membership is generated by

0:A(A,Γ)
Zero
i:AΓ
i+1:A(B,Γ)
Succ

For the locally nameless comparison, the cofinite binder rule is

LfinAxL. Γ,x:Alntx:B
ΓlnλAt:AB
LN-Lam

Chapter 62: nominal support, binding, and substitution

A finite set S supports x exactly when (π)((aS. π(a)=a)πx=x),a#xasupp(x). Name abstraction is the least equivalence generated by (a,x)(b,(a b)x)when b#x,π[a]x=[π(a)](πx). Its support equation is supp([a]x)=supp(x){a}. The complete nominal STLC sheet is

a:AΓ
Γnomvar(a):A
Nom-Var
Γnomt:ABΓnomu:A
Γnomapp(t,u):B
Nom-App
Γ,a:Anomt:Badom(Γ)
ΓnomlamA([a]t):AB
Nom-Lam

Capture-avoiding substitution at a binder first chooses a representative [b]t=[c]t with c#(a,u), then uses lamA([b]t)[u/a]=lamA([c](t[u/a])). The fresh-representative lemma makes the clause total, and abstraction comparison plus equivariance makes it independent of c. For a simultaneous typed substitution σ:ΓΔ, define operatornamesupp(σ) as the union of its component supports. At a binder fresh for both contexts and this support, the complete clause is lamA([b]t)[σ]=lamA([b](t[σ+b])),σ+b(b)=var(b), with σ+b equal to σ on every old atom.

Chapter 63: contextual objects and hereditary substitution

The simply typed modal rules, with all premises, are Δ;ΨM:AΔ;Γbox(Ψ.M):[ΨA]CtxI Δ;ΓM:[ΨA]Δ,u::A[Ψ];ΓN:CΔ;Γletbox(M,u.N):CCtxE u::A[Ψ]ΔΔ;Γσ:ΨΔ;Γclo(u,σ):AMeta. The dependent canonical extension adds Δ mctxΔΨ ctxΔ;ΨAtypeΔ,u::A[Ψ] mctxMCtx ΔΨ ctxΔ;ΨAtypeΔ,u::A[Ψ];ΓBtypeΔ;Γu::A[Ψ]BtypeMPi Δ,u::A[Ψ];ΓMBΔ;Γmlam(u.M)u::A[Ψ]BMLam Δ;ΓRu::A[Ψ]BΔ;ΨNAΔ;Γmapp(R,Ψ^.N)(B[Ψ^.N/u])A[Ψ]aMApp. Closure and explicit-substitution formation are Δ,u::A[Ψ],Δ;ΓσΨΔ,u::A[Ψ],Δ;Γclo(u,σ)(A[σ])ΨaMVar XΔ;ΓSNilΔ;ΓσΨΔ;ΓM(A[σ])ΨaΔ;Γσ,M/xΨ,x:ASNorm Δ;ΓσΨΔ;ΓRAA=(A[σ])ΨaΔ;Γσ,R//xΨ,x:ASAtom. The hereditary operation is partial on raw syntax. Preservation therefore requires the existence and well-formedness premises printed in theorem 63.6; they are part of the theorem, not implicit side conditions.

Search the book

Type to search the local edition.