User:Emlightened/Type Theories/I

Type theory is one of three main competing foundations for mathematics, and surprisingly relevant to googology. These posts will not necessarily continuations of the previous posts.

This post explains a simple, non-dependent type theory that is as strong as PA, Gödel's \(\mathcal T\).

Type theory is generally concerned with two (not necessarily distinct) groups of objects: terms and types. We will use lowercase letters for terms and uppercase letters for types.

Each term has a unique type. To say that term \(a\) has type \(A\) we write \(a:A\). The \(:\) has the same 'meaning' as \(\in\), but reminds us that each term is contained in only one type, not an infinite class of them, like with sets.

For Gödel's \(\mathcal T\), the types are \(\mathcal N\), and \(A \to B\), where \(A\) and \(B\) are types. This is written stylistically as followed, in a notation called BNF:

\(T := \mathcal N \, | \, (T \to T)\)

The type \(\mathcal N\) represents the type of the natural numbers, and the type \(A \to B\) represents the type of functions from \(A\) to \(B\). In general, all of these functions will be recursive.

\(c := 0 \, | \, s \, | \, r_T\)

\(e := x \, | \, (\lambda x^T.e) \, | \, (ee) \, | \, c\)

Represents the syntax of terms (expressions), where \(x\) is a free variable, and \(c\) represents the constants in our theory. The \(\lambda\) is a lambda, which forms a function, and the \(fx\) is an application of the function \(f\) to the term \(x\).

We freely remove brackets when necessary. For types, we associate to the right, so \((A \to (B \to C)) = A \to B \to C\). For terms, we assume the body of the lambda expression goes as far to the right as possible, and associate application to the left. This means that \(\lambda x^A.xab\lambda y^{\mathcal N}.y = (\lambda x^A.(((xa)b)(\lambda y^{\mathcal N}.y)))\)

We also have some typing rules, which say how to construct expressions and what type they belong to, and reduction rules, which say how to reduce one expression to its normal form.

The typing rules are these:

\(x:A \vdash x:A\)

\(\vdash 0 : \mathcal N\)

\(\vdash s : \mathcal N \to \mathcal N\)

\(\vdash r_T : (T \to \mathcal N \to T) \to T \to \mathcal N \to T\)

\(\frac{x:A \vdash e:B}{\vdash \lambda x^A.e:A \to B}\)

\(\frac{\vdash f : S \to T \qquad \vdash x : S}{\vdash fx : T}\)

The reduction rules are these:

\((\lambda x^T.e)a \Rightarrow e[x:=a]\)

\((\lambda x^T.fx) \Rightarrow f\)

\(r_Afa0 \Rightarrow a\)

\(\(r_Afa(sn) \Rightarrow fn(r_Afan)\)