The Lambda Polymorphism (bi?) functor

So, I’m trying to think about how to define a category for lambda calculus. I’m thinking of a category that has as objects all the lambda function signatures and as arrows “the set of all lambda functions” somehow related by the domain and codomain signature. I am not sure exactly how to define the arrows, but currently it is much like Set, so all objects (except * and possibly some initial and terminal objects) are exponential objects. To create the exponentials, products are needed, but they are merely cartesian products, and exponentials are defined using the curry-uncurry isomorphism, as in Set.

Let S be a non product signature with n inputs of signatures 

s1, s2, … , sn, 

so that 

S = s1 -> s2 -> … - > sn -> *. 

and T another non-product signature. Then the homset Hom(T, S) is the set of all lambda functions of signature T -> s1 -> s2 -> … - > sn -> *. If S is a product UxV, the arrows are pairs of arrows  from Hom(T, U) and Hom(T, V), defining a categorical product with the obvious homset isomorphisms. If T is a product UxV, Hom(UxV, S) is the set of all lambda functions of signature U -> V -> s1 -> s2 -> … - > sn -> *.

While it might be possible to implement the same lambda function in many ways, I believe there is a way to define the set of all “(fairly) unique” lambda functions of a certain signature as the set of strings that can be produced by some context free grammar related to the signature. I will get back to that.

Lambda functions do not have to be applied to the exact signatures of their input parameters. They can also be applied to lambda functions defined by signatures where every * is replaced with some fixed other signature and returns a function of that signature. As an example a Church numeral has the signature (* -> *) -> * -> *. If every * is replaced with * -> *, the signature becomes ((* -> *) -> (* -> *)) -> (* -> *) -> (* -> *). Since the -> bifunctor is right associative, it can also be written ((* -> *) -> * -> *) -> (* -> *) -> * -> *. A Church numeral can behave as both those signatures, but they will, in a sense, do the same thing but to different things. 

In this case, we replaced * with * -> *, but we could just as well have replaced it with any other signature. This can be nicely translated into category theory by associating every object O with an endofunctor going to the signature where every * is replaced with the signature of the endofunctor, and just lifting arrows to “the same” lambda function. This association can, in turn, be defined using a functor 

P : Lam -> (Lam ^ Lam), 

That is a functor from the category to the category of endofunctors of the category. Or is it just a bifunctor? I can’t wait to see what I’ll find next!


Kommentarer

Populära inlägg i den här bloggen

The category of lambda calculus with products and coproducts

The universal arrow of the exponential object for combining function and input