Lectures onType Theory
Scoped signatures and explicit substitution
appendix sectionrules

Scoped signatures and explicit substitution

The signature of chapter 23 is a pair (Σ,Γ) of endofunctors on Set. In polynomial form, ΣX=oOPo×XRo,ΓX=sSPs×XQs. Its exact nested syntax is the initial solution of (GH)A=A+Σ(HA)+Γ(H(HA)),T=μG, with constructors Var:ATA,Op:Σ(TA)TA,Scope:Γ(T(TA))TA. For the elementwise recursion and induction rules below, Chapter 23 assumes that the transfinite initial chain of G is monic and converges to T; it does not claim a general existence theorem for arbitrary (Σ,Γ).

For a polynomial scoped symbol s, the equivalent elementwise scope data are p:Ps,X:Set,m:QsTX,k:XTA, written Scopes(p;X;m;k), modulo Scopes(p;X;m;kh)=Scopes(p;Y;λq.Th(m(q));k)(h:XY). The canonical nested representative is [X,m,k]λq.Tk(m(q)):QsT(TA), and the inverse sends u:QsT(TA) to [TA,u,idTA].

For a reindexing-respecting predicate family PA(t), the well-founded elementwise recursion and induction principle has constructor premises PA(Var(a)),(r.PA(k(r)))PA(Opo(p,k)),(q.PX(m(q)))(x.PA(k(x)))PA(Scopes(p;X;m;k)). It is obtained from the assumed monic convergent initial chain of G; the scoped premises come from the two nested earlier-stage occurrences.

For f:ATB, explicit substitution is Var(a)[f]=f(a),Opo(p,k)[f]=Opo(p,λr.k(r)[f]),Scopes(p;X;m;k)[f]=Scopes(p;X;m;λx.k(x)[f]). In nested form, if bf(u)=u[f], the scoped clause is Scope(v)[f]=Scope(Γ(Tbf)(v)). Return and bind are returna=Var(a),t=f=t[f]. The proved equations are Var(a)[f]=f(a),t[Var]=t,t[f][g]=t[λa.f(a)[g]]. They imply the three monad laws. No operational handler rules are part of the signature in chapter 23.

Search the book

Type to search the local edition.