A.2.9 The natural number type
We give the rules for natural numbers, following §1.9 (http://planetmath.org/19thenaturalnumbers).
*[right=-form]Γ Γ ⊢ : _i\\inferrule*[right=-intro]Γ Γ ⊢0 : \\inferrule*[right=-intro]Γ ⊢n : Γ ⊢succ(n) : \\inferrule*[right=-elim]Γ,x : ⊢C : _i
Γ ⊢c_0 : C[0/x]
Γ,x : ,y : C ⊢c_s : C[succ(x)/x]
Γ ⊢n : Γ ⊢ind_(x.C,c_0,x.y.c_s,n) : C[n/x]\\inferrule*[right=-comp]Γ,x : ⊢C : _i
Γ ⊢c_0 : C[0/x]
Γ,x : ,y : C ⊢c_s : C[succ(x)/x]Γ ⊢ind_(x.C,c_0,x.y.c_s,0) ≡c_0 : C[0/x]\\inferrule*[right=-comp]Γ,x : ⊢C : _i
Γ ⊢c_0 : C[0/x]
Γ,x : ,y : C ⊢c_s : C[succ(x)/x]
Γ ⊢n : Γ⊢ind (x.C,c 0 ,x.y.c s ,succ(n)) ≡c s [n,ind (x.C,c 0 ,x.y.c s ,n)/x,y] : C[succ(n)/x]In , is bound in , and and are bound in .
Other inductively defined types follow the same general scheme.