User:Thepigdog/Typed lambda calculus

In solving equations formed from functions it is necessary in a technical sense to know the domain of the function. In principle the solution set of an equation is formed by considering every possible value from the domain of a function to see if it satisfies the equation. Even when properties of the function may allow solutions more efficiently, from a definitional point of view, the solution set is created by considering every possible value from the domain.

The untyped lambda calculus implicitly uses the set of all functions as the domain for all functions.

The domain of untyped lambda calculus
The set of all functions from a domain D to a range R is defined by,
 * $$f \in F \iff (\forall x : x \in D \implies f\ x \in R) $$

Then the definition of the set of all functions of functions is,


 * $$f \in F \iff (\forall x : x \in F \implies f\ x \in F) $$

This definition is an unsolved equation for F. So is there a solution for F?

Consider a function g that is defined on all functions other than itself.
 * $$g\ g \not \in F$$
 * $$x \not = g \implies g\ x \in F$$

Then first assume g is in F.
 * $$g \in F \iff (\forall x : x \in F \implies g\ x \in F) $$

instantiate x as g.
 * $$g \in F \implies (g \in F \implies g\ g\in F) $$
 * $$g \in F \implies g\ g \in F$$

which is false because.
 * $$g\ g \not \in F$$

Now consider g not in F,
 * $$g \not \in F$$
 * $$ (\forall x : x \in F \implies g\ x \in F) \implies g \in F$$
 * $$ (\forall x : x \in F \implies g \ne x \implies g\ x \in F) \implies g \in F$$
 * $$ g \in F$$

So g is an element of F and not an element of F. Therefore there is no set F satisfying the above definition of "all functions".

Type solution
As there is no definition for all functions, then only functions of constructable sets may be considered. Then consider the function,


 * $$f\ x = x\ x $$

Then the type of f is,
 * $$f : t \to s $$

But because x is of type t, and x is called on a value of type t and returns type s,
 * $$t \supset t \to s$$

This implies,
 * $$t \supset t \to s \to s$$
 * $$t \supset t \to s \to s \to s$$ ...

But there is no finite solution to this type equation.

???? What does this mean for lambda calculus. A calculation may end after a fixed number of steps requiring only a finite number of levels in the set. But the set to which the value belongs is recursive. ????

Links

 * Lambda Calculus