A.0 Preliminaries

In http://planetmath.org/node/87533Chapter 1, we presented the two basic judgments of type theoryPlanetmathPlanetmath. The first, a:A, asserts that a term a has type A. The second, ab:A, states that the two terms a and b are judgmentally equal at type A. These judgments are inductively defined by a set of inference rules described in \autorefsec:syntax-more-formally.

To construct an element a of a type A is to derive a:A; in the book, we give informal arguments which describe the construction of a, but formally, one must specify a precise term a and a full derivation that a:A.

However, the main differencePlanetmathPlanetmath between the presentationMathworldPlanetmathPlanetmathPlanetmath of type theory in the book and in this appendix is that here judgments are explicitly formulated in an ambient context, or list of assumptions, of the form


An element xi:Ai of the context expresses the assumption that the variable xi has type Ai. The variables x1,,xn appearing in the context must be distinct. We abbreviate contexts with the letters Γ and Δ.

The judgment a:A in context Γ is written


and means that a:A under the assumptions listed in Γ. When the list of assumptions is empty, we write simply




where denotes the empty context. The same applies to the equality judgment


However, such judgments are sensible only for well-formed contexts, a notion captured by our third and final judgment


expressing that each Ai is a type in the context x1:A1,x2:A2,,xi-1:Ai-1. In particular, therefore, if Γa:A and Γ𝖼𝗍𝗑, then we know that each Ai contains only the variables x1,,xi-1, and that a and A contain only the variables x1,,xn.

In informal mathematical presentations, the context is implicit. At each point in a proof, the mathematician knows which variables are available and what types they have, either by historical convention (n is usually a number, f is a function, etc.) or because variables are explicitly introduced with sentencesMathworldPlanetmath such as “let x be a real number”. We discuss some benefits of using explicit contexts in \autorefsec:more-formal-pi,\autorefsec:more-formal-sigma.

We write B[a/x] for the substitution of a term a for free occurrences of the variable x in the term B, with possible capture-avoiding renaming of bound variables, as discussed in §1.2 (http://planetmath.org/12functiontypes). The general form of substitution


substitutes expressions a1,,an for the variables x1,,xn simultaneously.

To bind a variable x in an expression B means to incorporate both of them into a larger expression, called an abstraction, whose purpose is to express the fact that x is “local” to B, i.e., it is not to be confused with other occurrences of x appearing elsewhere. Bound variables are familiar to programmers, but less so to mathematicians. Various notations are used for binding, such as xB, λx.B, and x.B, depending on the situation. We may write C[a] for the substitution of a term a for the variable in the abstracted expression, i.e., we may define (x.B)[a] to be B[a/x]. 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 very precise, an expression is an equivalence classMathworldPlanetmathPlanetmath of syntactic forms which differ in names of bound variables.

One may also regard each variable xi of a judgment


to be bound in its scope, consisting of the expressions Ai+1,,An, a, and A.

Title A.0 Preliminaries