The judgment
defines a function
from A to B whose rule is given by the expression b. We know this from
the functionality constraint implicit in the judgment, i.e. if a=a' in the
type A, then
b[a/x]=b[a'/x] in the type B. Likewise if b1 is an
expression in x and b' is an expression in x' then
defines such a function. The two rules b, b'are considered equal on equal a, a' in A. Also it is part of the judgment
that
b[a/x]=b'[a'/x']. To this extent at least the notion of equality on
these functions is extensional.
Let us look at patterns of functionality that involve functions as arguments.
The addition function on N is represented by
We know that the pattern of definition used to form
addL, multL, expL can be
extended to any binary function f from
to N using
fLk(l)=L(l; k; h, t, a. f(h, a)). For any specific f we can write this
function fLk(l), but we would like to express the general fact as a function
of f, saying: for any function from
to N and any k in N,
L(l; k; h, t, a. f(h, a)) is a functional expression in l, k and f.
In order to say this, we need a type for f. The notation
is the type used in section 2. We can add
as a type expression for A and B types. But we also need
canonical values for the type, what should they be? Can we use
as a notation for a function in
?
It would be acceptable to use just that notation; it is even similar to the
Bourbaki notation
(see [15]). But
in fact we do not need the type information to define the evaluation relation
nor to describe the typing rule. So we could simply use
.
Instead we adopt the lambda notation
more familiar in computer
science as we did in sections 1 and 2.
We also need notation for function application. We write ap(f; a) for the application of function f to argument a, but often display this as f(a). The new evaluation rules are:
This rule generates the type
as a
term.29