A.0 Preliminaries

A.0 Preliminaries

In

http://planetmath.org/node/87533

Chapter 1, we presented the two basic

judgments

of

type theory

. The first,

a

:

A

, asserts that a term

a

has type

A

. The second,

a

≡

b

:

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

\autoref

sec: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

difference

between the

presentation

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

x

1

:

A

1

,

x

2

:

A

2

,

…

,

x

n

:

A

n

.

An element

x

i

:

A

i

of the context expresses the assumption that the

variable

x

i

has type

A

i

. The variables

x

1

,

…

,

x

n

appearing in
the context must be distinct. We abbreviate contexts with the letters

Γ

and

Δ

.

The judgment

a

:

A

in context

Γ

is written

Γ

⊢

a

:

A

and means that

a

:

A

under the assumptions listed in

Γ

. When the list of
assumptions is empty, we write simply

⊢

a

:

A

or

⋅

⊢

a

:

A

where

⋅

denotes the empty context. The same applies to the

equality

judgment

Γ

⊢

a

≡

b

:

A

However, such judgments are sensible only for

well-formed

contexts,
a notion captured by our third and final judgment

(

x

1

:

A

1

,

x

2

:

A

2

,

…

,

x

n

:

A

n

)

𝖼𝗍𝗑

expressing that each

A

i

is a type in the context

x

1

:

A

1

,

x

2

:

A

2

,

…

,

x

i

-

1

:

A

i

-

1

. In particular, therefore, if

Γ

⊢

a

:

A

and

Γ

⁢

𝖼𝗍𝗑

, then we know that each

A

i

contains only the variables

x

1

,

…

,

x

i

-

1

, and that

a

and

A

contain only the variables

x

1

,

…

,

x

n

.

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

sentences

such as
“let

x

be a real number”. We discuss some benefits of using explicit
contexts in

\autoref

sec:more-formal-pi,

\autoref

sec: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

B

⁢

[

a

1

,

…

,

a

n

/

x

1

,

…

,

x

n

]

substitutes expressions

a

1

,

…

,

a

n

for the variables

x

1

,

…

,

x

n

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

x

↦

B

,

λ

⁢

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 class

of syntactic forms
which differ in names of bound variables.

One may also regard each variable

x

i

of a judgment

x

1

:

A

1

,

x

2

:

A

2

,

…

,

x

n

:

A

n

⊢

a

:

A

to be bound in its

scope

,
consisting of the expressions

A

i

+

1

,

…

,

A

n

,

a

, and

A

.

Title

A.0 Preliminaries

\metatable

Generated on Thu Feb 8 19:43:19 2018 by

LaTeXML