Lectures onType Theory
Structural rules
appendix sectionrules

Structural rules

Contexts and variables

 ctx
Ctx-Emp
Γ ctxΓA type
Γ,x:A ctx
Ctx-Ext
Γ ctxΓA type
Γ,x:Ax:A
Var

Presuppositions

ΓA type
Γ ctx
Presup-Ctx
Γ,x:A ctx
ΓA type
Presup-Ext
Γa:A
ΓA type
Presup-Ty
ΓAB type
ΓA type
Presup-Eq-Ty
Γab:A
Γa:A
Presup-Eq-Tm

The omitted right-hand presuppositions follow by symmetry: from ΓAB type derive ΓB type, and from Γab:A derive Γb:A.

Equivalence and conversion

Γ ctxΓA type
ΓAA type
Ty-Refl
Γ ctxΓA typeΓB typeΓAB type
ΓBA type
Ty-Sym
Γ ctxΓA typeΓB typeΓC typeΓAB typeΓBC type
ΓAC type
Ty-Trans
Γ ctxΓA typeΓa:A
Γaa:A
Tm-Refl
Γ ctxΓA typeΓa:AΓb:AΓab:A
Γba:A
Tm-Sym
Γ ctxΓA typeΓa:AΓb:AΓc:AΓab:AΓbc:A
Γac:A
Tm-Trans

Derived conversion and assumption (primitive economically)

Γ ctxΓA typeΓB typeΓAB typeΓa:A
Γa:B
Conv
Γ ctxΓA typeΓB typeΓa:AΓb:AΓab:AΓAB type
Γab:B
Conv-Eq
Γ ctxΓA type(x:A)Γ
Γx:A
Assum

These three rules are not primitive in the official presentation: they are the derived rules of lemma 26.31, lemma 26.32, lemma 26.34. They are recorded here because they are used constantly and become primitive in the economical presentation of definition 26.35.

Weakening, substitution, and context conversion

In the next rules J is any of the four judgment theses of convention 26.17, and all contexts occurring in premises are required to be well formed.

Γ,x:A,Δ ctxΓA typeΓ,ΔJ
Γ,x:A,ΔJ
Wk
Γ ctxΓ,x:A,Δ ctxΓA typeΓa:AΓ,x:A,ΔJ
Γ,Δ[a/x]J[a/x]
Subst
Γ,x:A,Δ ctxΓA typeΓAA typeΓ,x:A,ΔJ
Γ,x:A,ΔJ
Ctx-Conv

Derived renaming and interchange

The freshness and independence side conditions belong to the reference rules:

Γ,x:A,Δ ctxΓ,x:A,ΔJxFV(Γ,A,Δ,J)
Γ,x:A,Δ[x/x]J[x/x]
Rename
Γ,x:A,y:B,Δ ctxΓB typeΓ,x:A,y:B,ΔJ
Γ,y:B,x:A,ΔJ
Exch
Γ,x:A,Δ ctxΓA typeΓa:AΓa:AΓaa:AΓ,x:A,ΔB type
Γ,Δ[a/x]B[a/x]B[a/x] type
Subst-Eq-Ty
Γ,x:A,Δ ctxΓA typeΓa:AΓa:AΓaa:AΓ,x:A,ΔB typeΓ,x:A,Δb:B
Γ,Δ[a/x]b[a/x]b[a/x]:B[a/x]
Subst-Eq-Tm

Congruence scheme

The phrase congruence in every argument is interpreted through a classified parameter telescope, as in definition 26.36. Write P=(p1:J1,,pn:Jn), where each Ji is either a type formation judgment or a term typing judgment in a displayed local context; both that context and the classifier may depend on p1,,pi1. Given a primed telescope P, compare the parameters in order. A type parameter is compared by type equality in the local context already transported along the earlier equalities. A term parameter is compared at the unprimed classifier after transporting the primed classifier and local context along those same earlier equalities. For a type former F and a term former f:F, the resulting rules are

PP in classified order
ΓF(p)F(p) type
Cong-Ty
PP in classified order
Γf(p)f(p):F(p)
Cong-Tm

where the primed result in Cong-Tm is first converted along Cong-Ty. Thus PP abbreviates one precisely classified equality premise per parameter; it is not a new judgment.

For reference, the classified telescopes of the annotated inductive eliminators are as follows. Every entry is in ambient context Γ; a context in brackets is local to that parameter.

  • For ind0(z.C;v): first C type [z:0], then v:0.

  • For ind2(z.C;ct,cf;b): first C type [z:2], followed in order by ct:C[tt/z], cf:C[ff/z], and b:2.

  • For ind+(z.C;f,g;s): first A type and B type, then C type [z:A+B],f:x:AC[inl(x)/z],g:y:BC[inr(y)/z],s:A+B.

  • For indN(n.C;c0,cs;m): first C type [n:N], then c0:C[0/n],cs:k:N(C[k/n]C[suc(k)/n]),m:N.

For indW(w.C;h,t) the telescope is A type;B type [x:A];W:=Wx:AB;C type [w:W];h:a:Aα:B[a/x]W((y:B[a/x]C[α(y)/w])C[sup(a,α)/w]);t:W. Applying the ordered scheme to these lists supplies motive equality beneath its binder, branch equalities in their substituted fibers, equality of the scrutinee, and conversion of the primed result to the unprimed result type.

Illustrative stable binding extension

The structurally stable operator used to test the congruence scheme has the full rules

Γ ctxΓC typeΓ,y:CD type
ΓQ(C;y.D) type
Q-form
Γ ctxΓC typeΓC typeΓCC typeΓ,y:CD typeΓ,y:CD typeΓ,y:CDD typeΓ,y:CD type
ΓQ(C;y.D)Q(C;y.D) type
Q-form-eq

Search the book

Type to search the local edition.