A.0 Preliminaries
In http://planetmath.org/node/87533Chapter 1, we presented the two basic judgmentsof type theory. The first, , asserts that a term has type . The second,, states that the two terms and are judgmentallyequalat type . These judgments are inductively defined by a set ofinference rules described in \\autorefsec:syntax-more-formally.
To construct an element of a type is to derive ; in the book, wegive informal arguments which describe the construction of , but formally,one must specify a precise term and a full derivation that .
However, the main difference between the presentation
of type theory in the bookand in this appendix is that here judgments are explicitlyformulated in an ambient context,or list of assumptions, of the form
An element of the context expresses the assumption that thevariable has type . The variables appearing inthe context must be distinct. We abbreviate contexts with the letters and .
The judgment in context is written
and means that under the assumptions listed in . When the list ofassumptions is empty, we write simply
or
where denotes the empty context. The same applies to the equalityjudgment
However, such judgments are sensible only for well-formed contexts,a notion captured by our third and final judgment
expressing that each is a type in the context . In particular, therefore, if and, then we know that each contains only the variables, and that and contain only the variables.
In informal mathematical presentations, the context isimplicit. At each point in a proof, the mathematician knows whichvariables are available and what types they have, either by historicalconvention ( is usually a number, is a function, etc.) orbecause variables are explicitly introduced with sentences such as“let be a real number”. We discuss some benefits of using explicitcontexts in \\autorefsec:more-formal-pi,\\autorefsec:more-formal-sigma.
We write for the substitutionof a term for free occurrences ofthe variable in the term , with possible capture-avoidingrenaming of bound variables,as discussed in§1.2 (http://planetmath.org/12functiontypes). The general form of substitution
substitutes expressions for the variables simultaneously.
To bind a variable in an expression means to incorporate both of them into a larger expression, called an abstraction,whose purpose is to express the fact that is “local” to , i.e., itis not to be confused with other occurrences of appearingelsewhere. Bound variables are familiar to programmers, but less so to mathematicians.Various notations are used for binding, such as ,, and , depending on the situation. We may write for thesubstitution of a term for the variable in the abstracted expression, i.e.,we may define to be . As discussed in§1.2 (http://planetmath.org/12functiontypes), changing the name of a bound variable everywhere within an expression (“-conversion”)does not change the expression. Thus, to be veryprecise, an expression is an equivalence class of syntactic formswhich differ in names of bound variables.
One may also regard each variable of a judgment
to be bound in its scope,consisting of the expressions , , and .