Lectures onType Theory
Logic enrichment, same-subject types, and erased induction
appendix sectionrules

Logic enrichment, same-subject types, and erased induction

The LTT logical and set fragments

For typed contexts Γ and proposition lists Δ, the logical rules used in chapter 92 are

Γvalid
ΓProp
LTT–F
ΓPPropΓQProp
ΓPQProp
LTT–F
ΓA typeΓ,x:APProp
Γx:A.PProp
LTT–F
Γa:UΓt:T(a)ΓX:Set(T(a))
ΓtaXProp
LTT–F
PΔ
Γ;ΔP
LTT-Hyp
Γ;Δ,PQ
Γ;ΔPQ
LTT–I
Γ;ΔPQΓ;ΔP
Γ;ΔQ
LTT–E
Γ,x:A;ΔPxFV(Δ)
Γ;Δx:A.P
LTT–I
Γ;Δx:A.PΓt:A
Γ;ΔP[t/x]
LTT–E
Γ;Δ,P
Γ;ΔP
LTT-Classical

The small-set rules, in formation through uniqueness order, are

Γa:U
ΓSet(T(a)) type
LTT-Set-F
Γa:UΓ,x:T(a)pprop
Γ{x:T(a)p}:Set(T(a))
LTT-Set-I
ΓX:Set(T(a))Γt:T(a)
ΓtaXProp
LTT-Set-E
Γ,x:T(a)ppropΓt:T(a)
Γ;(ta{x:T(a)p})V(p[t/x])
LTT-Set-β
ΓX:Set(T(a))ΓY:Set(T(a))Γ;x:T(a).(xaXxaY)
ΓXY:Set(T(a))
LTT-Set-η

For b:NU, put B(n)=T(bn). Given c:B(0) and f:Πn:N.B(n)B(Sn), recursion has type recB(c,f):Πn:N.B(n) with equations recB(c,f,0)c and recB(c,f,Sn)f(n,recB(c,f,n)) (LTT-Nat-rec, LTT-Nat-rec-0, and LTT-Nat-rec-S). Rule LTT-Nat-Ind0 is

Γ,n:NppropΓ;ΔV(p[0/n])Γ,n:N;Δ,V(p)V(p[Sn/n])
Γ;Δn:N.V(p)
LTT-Nat-Ind_0

Dependent intersections and System S self types

ΓA typeΓ,x:AB type
Γx:AB type
DI-F
Γa:AΓb:B[a/x]erase(a)=βηerase(b)
Γboth(a,b):x:AB
DI-I
Γd:x:AB
Γleft(d):A
DI-E_1
Γd:x:AB
Γright(d):B[left(d)/x]
DI-E_2

The computations and uniqueness are left(both(a,b))a,right(both(a,b))b,both(left(d),right(d))d. These are DI-β1, DI-β2, and DI-η.

System S implicit products have

ΓA typeΓ,x:AB type
Γx:A.B type
S–F
Γ,x:At:BxFV(t)
Γt:x:A.B
S–I
Γt:x:A.BΓu:A
Γt:B[u/x]
S–E

Rule S--β records erase(t)=erase(t). Self formation, generation, and instantiation are

Γ,x:ιx.TT type
Γιx.T type
S-Self-F
Γt:T[t/x]Γιx.T type
Γt:ιx.T
S-Self-Gen
Γt:ιx.T
Γt:T[t/x]
S-Self-Inst

Rule S-Self-Erase states that the generation and instantiation views both erase to erase(t).

Very-dependent functions

Write g:Pred(y) for the predecessor function at y.

ΓA typeΓ⊢<:AAUiWellFoundedi(A,<)Γ,y:A,g:Pred(y)B[g,y/f,x] type
Γ{fx:AB[f,x]} type
VDF-F
WellFoundedi(A,<)Γ,x:A,g:Pred(x)b:B[g,x/f,x]ExtA,B(b)
Γλx.b:{fx:AB[f,x]}
VDF-I
Γf:{fx:AB[f,x]}Γa:AWellFoundedi(A,<)
Γf(a):B[f,a/f,x]
VDF-E
Γa:A
(λx.b)(a)b[a/x][(λx.b)A<a/g]
VDF-β
Γf1:{fx:AB[f,x]}Γf2:{fx:AB[f,x]}a:A.Γf1(a)f2(a):B[f1,a/f,x]
Γf1f2:{fx:AB[f,x]}
VDF-Ext

Cedille Core

The kinding rules for Π, erased , dependent intersection, and heterogeneous equality are

ΓTΓ,x:TT
ΓΠx:T.T
CDLE-Π-F
ΓTΓ,x:TT
Γx:T.T
CDLE–F
ΓTΓ,x:TT
Γιx:T.T
CDLE-Isect-F
FV(t,t)dom(Γ)
Γ{tt}
CDLE-Eq-F

Retained and erased functions use

TcbnΠx:T1.T2Γ,x:T1tT2
Γλx.tT
CDLE-Π-I
ΓfΠx:T1.T2ΓuT1
ΓfuT2[u/x]
CDLE-Π-E
(λx.t)ut[u/x]
CDLE-Π-β
Tcbnx:T1.T2Γ,x:T1tT2xFV(erase(t))
ΓΛx.tT
CDLE–I
Γfx:T1.T2ΓuT1
ΓfuT2[u/x]
CDLE–E

Rule CDLE--β states erase((Λx.t)u)=erase(t). Dependent intersections use

Tcbnιx:T1.T2Γt1T1Γt2T2[t1/x]erase(t1)=βηerase(t2)
Γ[t1,t2]T
CDLE-Isect-I
Γtιx:T.T
Γt.1T
CDLE-Isect-E_1
Γtιx:T.T
Γt.2T[t.1/x]
CDLE-Isect-E_2

Rule CDLE-Isect-β is erase([t1,t2].1)=erase(t1)=βηerase(t2)=erase([t1,t2].2). Finally,

Tcbn{t1t2}FV(u)dom(Γ)erase(t1)=βηerase(t2)
Γβ{u}T
CDLE-Eq-I
Γp{t1t2}erase(t2)=βηerase(t2)ΓT[t2/x]ΓuT[t2/x]T[t1/x]T
Γρp @xt2.TuT
CDLE-Eq-E
Γp{tu}ΓtTFV(u)dom(Γ)
Γϕpt{u}T
CDLE-φ
Γp{λx.λy.xλx.λy.y}
ΓδpT
CDLE-δ
ΓTΓtT
ΓχTtT
CDLE-Ascribe

Search the book

Type to search the local edition.