COMPARISON OF TWO CATEGORICAL MODELS OF TYPED $ lambda $-CALCULUS

This paper discusses a relation between two categorical models of typed Acalculus which are both cartesian closed categories. One of them has a concept of variables in it. The other does not have such concept and based on de Bruijn's name-free expression. We show that the second one is obtained by certain construction over cartesian closed category and they are isomorphic from the categorical point of view.


Introduction
Category, particularly cartesian closed category (CCC for short), recently began to be treated as a model of typed Acalculus by several authors [2], [4], [5], [9]. The work of this paper is a Comparison of two categorical models of typed Acalculus which are introduced by Curien [2] and Koymans [4].
The first model has indeterminate, a concept of variables in Acalculus, and is obtained by universal construction over certain CCC. That is, it assigns indeterminates to variables and translates A-terms into not the CCC but socalled polynomial category of it (polynomial CCC [5], another term is free CCC [2]). It is important that free variables are treated as themselves. For example, in [9], they were handled as being bound and only closed A-terms were considered.
On the other hand, the second model does not have such concept but it is based on de Bruijn's name-free expression to make up for it. That is, it assigns not indeterminates but projections characterized by socalled their indexes to variables and translates A terms into the CCC itself.
But our observation shows that the second model is also obtained by certain construction over certain CCC known as Kleisli's construction. Kleisli category gotten by his construction becomes extended CCC just as polynomial CCC does. Therefore, we can regard that the second one deals with A-terms in Kleisli category of the CCC instead of in itself.
Moreover, functional completeness of CCC [5] tells us that Kleisli category is isomorphic to polynomial CCC. This means that two categorical models of typed A calculus are both not merely CCCs but also extended ones obtained by certain con 148H. OHTSUKA structions over it and have certain universality. In particular, the second model has been considered as merely CCC in early categorical model and it has been hard to investigate the categorical property of it. We conclude that the second model is gotten by Kleisli's construction just as the first one does by universal construction, and consequently, two categorical models are equivalent from the categorical point of view.
Section 2 sketches the basic notions of categories, CCC, polynomial CCC, Kleisli's construction. Section 3 introduces typed Acalculus and two translations of it into CCC. Section 4 gives some properties of them respectively. Section 5 contains the main result mentioned that these translations have reciprocal relationship from the categorical point of view. The functional completeness of CCC due to Lambek and Scott [5] is essential for this relation.

Cartesian Closed Categories
In this section, we recall some relevant notions and notations of CCC, in particular Kleisli's construction and universal construction over CCC and their relation. DEFINITION  5. If f : B -* C and g : A -B then fog :A C. 6. If f: A -> B and g : A -* C then < f, g > : A ---> B x C. 7. If h : A x C -B then A(h) : A --> B`. We omit the required structure of cartesian closedness. It is referred [5], [7]. We omit the subscript of morphisms and the symbol of composition o if no confusion occurs. In the rest of this section, and 0 denote CCCs. If a functor F: --j preserves cartesian closed structure, we call it cartesian closed functor (CCF for short).
In the next paragraph, we present two constructions over CCC and certain relation between them [5]. First, we construct an adjoint pair of functors which induces a comonad < SA, r]A > over an c2X and an object A in 21. The comonad consists of an endofunctor SA over ~l associated with two natural transformations : SA -Ic (identity functor) and 7A : SA -> S2 (composition of S with S), which are defined as follows. for any objects B, C in '21. Then it is easy to show that < SA, cA, riA > becomes comonad (c.f. [7], [8]).
It is known that inducing pairs of functors are not uniquely determined by the comonads. But there are two essentially different pairs of adjoint functors satisfying this condition and having certain universal property. These pairs were independently found by Eilenberg-Moore and Kleisli. As pointed out by Lambek and Scott, the Kleisli category of < SA, , 71A > over c2t is isomorphic to polynomial CCC of %. That is why we present Kleisli's construction and its universal property.
Let usA be the the Kleisli category of < SA, TJA >, which has the same objects as %. Of course, this theorem still holds in the situation of < SA, ~A, r1A > over CCC t .
On the other hand, universal construction of CCC 'u gives rise to polynomial CCC V1[x], where x : A -* B is an indeterminate over Vt. A polynomial category 2t[x] over Vt is freely constructed by adding x as a morphism to VT. Morphisms in ct[x] are called polynomials. We introduce equality `=x' between polynomials such that rendering tt[x] CCC [5]. The subscript of equality is a set of indeterminates (if one element , then abbreviate like as above and for a set of indeterminates X , we write =X). PROPOSITION 2.1. (Universality [5], [6]) Let x: A -B be an indeterminate over Vt . We only exhibit the algorithm finding morphism f for a polynomial 4)(x) . We take the following xrirp(x) as f satisfying above equation.
1. xxk = k ItA , B : A x B -C for constant polynomial k : B -C.
The next proposition is taken another look at the Proposition 2 .2 ([5], [6]). Although we concern only one indeterminate above, the following situation holds in general:

Typed Acalculus
We abbreviate typed A/3icalculus with product types (another term is surjective pairing) to typed Acalculus. In this section, we present the system of typed Acalculus and two translations of it into CCC. The formal system of typed Acalculus consists of types, A-terms of each type and certain rules between A-terms of the same type ( [1], [2], [6]). DEFINITION 3.1. Types have the same structure as objects of CCC. Let C be a set of basic types. Types are defined as follows.
1. Elements of C are types. 2. The special object 1 C is a type. Next, we present two translations of typed Acalculus into the CCC 2l which has the same objects as types. Because we concern categorical properties of them, we restrict free variables in typed Acalculus to finite. They are gathered up and make right associative ordered list, FV = (x0, (x1, (... , (x_1 ,*)... ))) = (x0, x1, ... , xn_1,*) Remark that numbering is started with 0. If we assume a finite list of variables as several pairings, it can have the same type of the pairing. Particularly , FV has the type Ao x (Al x (... x (An_1 x 1) ... )), where each variable x, has type A1 . We denote typed Acalculus whose free variables are included in FV for A(FV) The first translation translates k-terms into polynomial CCC, that is, indeterminates are assigned to variables. This is due to Lambek and Scott [5] and introduced by Curien [2]. In Poigne [9], free variables are handled as being bound in the sense that his method assigns idA to all free variables with same type A. Thus, A-terms have been translated not into polynomial CCC but into CCC. We extend his method to be able to treat free variables themselves and adopt polynomial CCC. Moreover, this is a simple version of Curien's one which translates A-terms into polynomials via socalled Categ orical Combinatory Logic. First of all, we add the indeterminates , having the same name as variables in FV, The second translation translates A-terms not into polynomial CCC but into CCC. This method is given by Curien [2] and typed version of Koymans's one [4]. Although it does not use indeterminates, it treats free variables as themselves using so-caled indexes of them instead of their names. Therefore, it may be based on the variable concept of de Bruijn's name-free expression.

ENV(i, m, -) denotes the list which is made by removing m variables starting
with the order i in ENV. Of course, we assume that there are enough variables in ENV to be able to define above definitions. Next, we define the morphisms corresponding with above notations of list. Let X be the type of FV (or FV(i, m, +)) and Xl m be FV(i, m, -) (or FV resp). We define y, m : X * Xi m as follows. By inductive assumption, G(P, (y, ENV)(i + 1, m, +)) = fS(P, (y, ENV))yi+i ,m hence above two formulas are identical. ^ Next, we consider the order of variables in the list of them. ENVi denotes the list which is made by exchanging ith variable with (i + 1)th one in the list ENV. Of course, we assume there are enough variables in X to be able to define ENVi. On the other hand, we define the morphisms corresponding with above notation. Let X be the type of FV and Xi be FVi. We define 6i: X -Xi as follows. By inductive assumption, C(P, (z, ENV)1+1) = ((P, (z, ENV))81+1 hence above two formulas are identical. 4 . Some Properties of Two Categorical Models Before we compare LFV with CCFV in the categorical situation, in this section, we investigate some properties of them respectively. First, we extend the algorithm K introduced in Section 2 to be able to treat several indeterminates. We get the following commutativity for the order of several applications of algorithm K. 60 is isomorphism which replaces the order of products. That is, the essential part of above equation is that the order of several applications of algorithm K only effects the order of products of the domain of the resulting morphism. For (i(xo, ... , xn_1) in polynomial CCC cMxo, ... , xn_1], we abbreviate several applications of K, Kr (.. . (Kx(4(x0, ... , xn_ )) ... ), to Kx"_1, .. , x0 4)(x0, ... , xn-1).
The first translation LFV gives the following identities.  ,(x,y, FV)))<n,Ky<L (N,(y,FV)),id>><it',it>) = {FV} A(K y,x(L(P, (x, y, FV))) < it, < L (N, (y, FV)), id > it' >< ,Tt', ,~t >) = {FV} A(K y,x(L(P, (x, y, FV))) < ,Tt', < L (N, (y, FV)), id > n >) = {FV} A(K x,y(L(P, (x, y, FV))) < L (N, (y, FV)   where FV = (xo, ... , xn_1,*) and xi : 1 -A,(0 < i < n). Additionally, we get the following corollary. Moreover, it is important that above Kleisli category is an extended CCC and has the cartesian closed structure. This theorem asserts that LFV translates A-terms into not only morphisms in the CCC but also ones in Kleisli category of it. It means that from the categorical point of view, LFV essentially adopt Kleisli category, while LFV does polynomial CCC. However polynomial CCC does have indeterminates, Kleisli category does not have them. This difference corresponds with that between Acalculus and de Bruijn's name-free expression. Moreover socalled indexes of variables in FV, which characterize the composition of several projections, correspond with the minimal components in de Bruijn's name-free expression. That is, it gives rise to not only de Bruijn's name-free expression in Acalculus but also Kleisli category (or it's construction) in the categorical model.

Conclusion
We have compared two categorical models of typed Xcalculus which are both CCC. It is clear that the first model (polynomial CCC) is not merely CCC but extended one and has certain universal property. We show that the second one is also does. Consequently, two categorical models are both extended CCC having certain universality and equivalent from the categorical point of view. Of course, categorical models presented in this paper are quite simpler than others in Curien [2], Koymans [4]. But essential parts of them are same those of others. For example, it is indeterminate corresponding with variable for the first model. On the other hand, it is socalled index of variable based on de Bruijn's name-free expression for the second model.
For the purpose that we will investigate the categorical properties and relation of models, we adopt simple models instead of original but complicated ones in Curien [2], Koymans [4] .
The studies of categorical investigation of Acalculus are actively accomplished by Curien [3] et al. They would treat CCC or Cmonoid (type free version of CCC) as syntactic systems, e.g., categorical combinatory logic, while we do as description of semantics of Acalculus. They extend classical combinatory logic to categorical one and try to reconstruct several properties, e.g., syntactic equivalence theorem, confluency under some systems of several axioms. Because our investigation mainly consider CCC as a (categorical) semantics of typed Acalculus, it would not be immediately concat enated with their studies.
By the way, because Kleisli category of some comonad over CCC becomes categ orical model of typed Acalculus and it is based on de Bruijn's name-free expression, we can consider Cmonoid (not polynomial Cmonoid) as a categorical model of not A calculus but de Bruijn's name-free expression in the type free situation. Moreover, diverting Kleisli's method to certain construction of Cmonoid, we will deal with extended Cmonoid (of course, this is not polynomial Cmonoid) as a categorical model of it.