On Mon, Sep 3, 2018 at 12:17 PM Sunrise Confusion
<
hobbye...@gmail.com> wrote:
> Is there a problem with throwing away lambda abstraction as a term forming
> operation, and instead defining all functions using "defining equations"? Then
> we can still introduce lambda-abstraction as syntactic sugar (as a
> shorthand for defining a new function, and referencing it).
I think you can sort of do this, but you have to be more careful about
where and how "defining new constants" is allowed. The way the system
in A.1 is presented, it appears that the collection of constants and
their defining equations is a parameter of the theory, i.e. it is
fixed once and for all at the beginning. This already doesn't match
the way "defining a function by equations" is used in the main body of
the text, where we introduce *new* functions with their defining
equations all the time. But if you are trying to do away with
lambda-abstraction completely, then I think you also need to be able
to define new constants "in context" and "inside a term". That is, if
a lambda-abstraction is constructed on-the-fly as an argument to some
other function, maybe even inside *another* lambda-abstraction:
H (\lambda x. K (\lambda y. y+x))
then you need to translate that to something like
H f
where f x = K g
where g y = y + x
(which is pretty close to actual Agda syntax), i.e. introducing a new
function f "locally" by a defining equation and then *inside* the body
of f, in particular inside the scope of the variable x, introducing
another new function g by a defining equation. This is essentially
the same as let-binding a lambda abstraction:
let f := (\lambda x. let g := (\lambda y. y + x) in K g) in H f
One would then have to give rules for manipulating such "local
definitions", which I don't think would end up being any simpler than
the rules for lambda-abstractions. (Moreover, lambda-notation is
universally used in type theory, so even if there were a slightly
simpler alternative it wouldn't be helpful to insulate the student
from it.)
> I also have the following possibly related question on the definition of
> convertibility in section A.1. The book says shortly before A.1.1 that
> "Convertibility between terms t and t' is the equivalence relation generated by
> the defining equations for constants,...". Does this mean that, if all defining
> equations for two constants c, c' are the same, we should introduce an
> equivalence between c and c' (the judgmental analog of function
> extensionality)?
I believe that this would follow, at least for functions defined by
single equations, if we add eta-conversion to the system in section
A.1 (which should really be done, since eta-conversion is used in the
main text of the book and is also present in the presentation of A.2).
For then if f and g are defined by equations
f(x) = M
g(x) = M
where M is some expression involving x, then we would have
f = (\lambda x. f(x)) = (\lambda x. M) = (\lambda x. g(x)) = g.
For functions defined by multiple equations using recursion/induction,
things are less clear. Most of the book I believe takes the
perspective of A.2, that defining functions by equations is really
just syntactic sugar for defining them to equal lambda-abstractions or
recursor-expressions, in which case two functions defined by the same
equations would indeed be judgmentally equal. However, the
presentation in A.1 does seem to be unclear about what attitude is
taken towards this question.
Mike