nLab
pure type system

Context

Type theory

natural deduction metalanguage, practical foundations

  1. type formation rule
  2. term introduction rule
  3. term elimination rule
  4. computation rule

type theory (dependent, intensional, observational type theory, homotopy type theory)

syntax object language

computational trinitarianism = propositions as types +programs as proofs +relation type theory/category theory

logiccategory theorytype theory
trueterminal object/(-2)-truncated objecth-level 0-type/unit type
falseinitial objectempty type
proposition(-1)-truncated objecth-level 1-type/h-prop
proofgeneralized elementprogram
conjunctionproductproduct type
disjunctioncoproduct ((-1)-truncation of)sum type (bracket type of)
implicationinternal homfunction type
negationinternal hom into initial objectfunction type into empty type
universal quantificationdependent productdependent product type
existential quantificationdependent sum ((-1)-truncation of)dependent sum type (bracket type of)
equivalencepath space objectidentity type
equivalence classquotientquotient type
inductioncolimitinductive type, W-type, M-type
higher inductionhigher colimithigher inductive type
completely presented setdiscrete object/0-truncated objecth-level 2-type/preset/h-set
setinternal 0-groupoidBishop set/setoid
universeobject classifiertype of types
modalityclosure operator monadmodal type theory, monad (in computer science)

homotopy levels

semantics

Deduction and Induction

Foundations

Contents

Idea

A pure type system is an explicitly typed lambda calculus using dependent product as the type of lambda expressions: the basic idea is that

Γ,x:AB:C\Gamma, x:A \vdash B:C

implies

Γ(λx:A.B):(x:A.C).\Gamma \vdash (\lambda x:A . B) : (\prod x:A . C).

In other words a pure type system is

  1. a system of natural deduction;

  2. for dependent types;

  3. and with (only) the dependent product type formation rule specified.

Definition

A pure type system is defined by

  • a set S of sorts, all of which are constants,
  • a set A of axioms of the form c:s with c a constant and s a sort,
  • a set RS×S×S of relations: triples (s 1,s 2,s 3) of sorts. Relations (s 1,s 2,s 2) are abbreviated as (s 1,s 2).
Remark

These relations will appear in the type formation rule for dependent product types below. They will say that for a type of sort s 2 depending on a type of sort s 1 its dependent product is a type of sort s 3.

Remark

In fact all such triples appearing in the following have s 2=s 3. So we can just as well regard them as binary relations RS×S (rather than ternary ones).

From the above input data we derive the following

  1. The terms of a pure type system are the following (recursive definition):

    • variables and constants
    • (λx:A.B) (abstraction)
    • (x:A.B) (product)
    • AB (application)

    Here x is a variable and A, B are terms. The operators λ and bind the variable x.

  2. The typing of terms is inductively defined by the following rules.

    A typing is of the form

    x 1:A 1,,x n:A nA:Bx_{1} : A_{1}, \dots, x_{n} : A_{n} \vdash A : B

    meaning that the types of the variables declared on the left induces the term A has type B. Note that types are also terms.

    The order of variable declarations is significant: the declaration x i:A i may depend on declarations to its left.

The natural deduction rules are defined to be the following, for all sS and where x ranges over the set of variables.

namerulecondition
(axioms)Γc:sif (c:s) is an axiom;
(start)ΓA:sΓ,x:Ax:Aif xΓ
(weakening)ΓA:B;ΓC:sΓ,x:CA:Bif xΓ
(product)ΓA:s 1;Γx:AB:s 2Γ(x:A.B):s 3if (s 1,s 2.s 3)R;
(application)ΓF:(x:A.B);Γa:AΓFa:B[x:=a]
(abstraction)Γ,x:Ab:B;Γ(x:A.B):sΓ(λx:A:b):(x:A:B)
(conversion)ΓA:B;ΓB:s;B= βBΓA:B

Examples

Strongly normalizing systems

Intuitionistic (higher-order) logic

Lambda cube

The lambda cube consists of eight systems arranged in a cube. The most expressive is given by the following choice of sorts, axioms and relations:

symbolactual value
S={*,}
A={(*:)}
R={(*,*),(*,),(,*),(,)}

(Here {*,} denotes the 2-element set.)

The other systems omit some of the last three relations. Some specific systems are the following:

name(*,*)(*,)(,*)(,)
λ simply typed lambda calculusyes
λP logical frameworkyesyes
λ2 system F?yesyes
λω̲yesyes
λC calculus of constructionsyesyesyesyes

Calculus of constructions

For instance for the calculus of constructions we have

The single axiom *: hence says that Prop:Type, hence that Prop is a type.

The relations express the usual rule for dependent product type:

Inconsistent systems

The most permissive pure type system:

symbolactual value
S={*}
A={(*:*)}
R={(*,*)}

But there is an example with even non-circular system of axioms:

symbolactual value
S={*,,}
A={(*:),(:)}
R={(*,*),(,*),(,),(,)}

The calculus of inductive constructions can be formulated as a particular pure type system (with a hierarchy of type of types) augmented by rules for introduing inductive types.

References

  • Henk Barendregt (Catholic University Nijmegen), Lambda calculi with types?, To appear in Samson Abramsky, D.M. Gabbay and T.S.E. Maibaum (eds.) Handbook of Logic in Computer Science, Volume II, Oxford University Press

A quick survey is in

  • Frade, Calculus of inductive constructions (pdf)

Revised on February 27, 2013 18:36:55 by DAY? (137.248.121.147)