Tarski asked whether the arithmetic identities taught in high school are complete for showing all arithmetic equations valid for the natural numbers. The answer to this question for the language of arithmetic expressions using a constant for the number one and the operations of product and exponentiation is affirmative, and the complete equational theory also characterises isomorphism in the typed lambda calculus, where the constant for one and the operations of product and exponentiation respectively correspond to the unit type and the product and arrow type constructors. This paper studies isomorphisms in typed lambda calculi with empty and sum types from this viewpoint. We close an open problem by establishing that the theory of type isomorphisms in the presence of product, arrow, and sum types (with or without the unit type) is not finitely axiomatisable. Further, we observe that for type theories with arrow, empty and sum types the correspondence between isomorphism and arithmetic equality generally breaks down, but that it still holds in some particular cases including that of type isomorphism with the empty type and equality with zero.

We study isomorphisms in typed lambda calculi with empty and sum types from the viewpoint of programming language theory, category theory, and logic.

data types are isomorphic if it is possible to convert data between them without loss of information. The equivalence relation on types induced by the notion of isomorphism allows to abstract from inessential details in the representation of data in programming languages, and it has found applications to various aspects of code reuse that become more and more relevant in the heterogeneous environment of what is emerging as global computing.

In Functional Programming, type isomorphisms provide
a means to search functions by type (see [

A characterisation of type isomorphisms has been
obtained for monomorphic type systems with various
combinations of the unit, product, and arrow type
constructors [

phism in foundational theories of functional programming
languages, like typed lambda calculi, can be studied by their
associated categorical models. From this perspective, our
investigations fall in the context of Lawvere and Schanuel?s
Objective Number Theory, which is the study of addition,
multiplication, and exponentiation of objects in suitable
categories [

Type isomorphism and Tarski?s high school algebra
problem. There is a connection between the
characterisation of type isomorphisms in typed lambda calculi and
some logical results related to Tarski?s high school
algebra problem [

Raw terms are defined by the grammar (a) We show that the extension functors between the various type theories are full and faithful. Consequently, the theory of type isomorphisms of the various extensions are conservative.

Section 2 recalls the basic definitions. Sections 3 and 4, respectively establish the relative full completeness result (a), and the non finite axiomatisability and separation results (b) and (c). Section 5 concludes with remarks and directions for further work. (b) We establish that the equational theory of type isomorphisms in the presence of the product, arrow, and sum type constructors is not finitely axiomatisable. (c) We observe that in the presence of arrow, empty and sum types, type isomorphism and arithmetic equality no longer coincide. However, the coincidence still holds for certain classes of arithmetic equations.

Summary of results and organisation of the paper.
sions (obtained by interpreting the unit by the number one,
product by multiplication, and arrow by exponentiation) are
equal in the standard model of natural numbers. In these
cases, type isomorphism (and numerical equality) is finitely
axiomatisable and decidable; hence so is the equational
theory of isomorphisms in cartesian closed categories. In the
same vein, Soloviev [

The question has been open as to whether such
correspondence was limited to the case of the well-behaved
unit, product, and arrow type constructors and, in
particular, if it could be extended to more problematic types
involving the empty type and the sum type constructor. From
a practical perspective, one is interested in knowing whether
type isomorphisms in the presence of sums are finitely
axiomatisable, a definitive advantage when implementing
decision procedures in library search tools like those described
in [

In this section we relate the various type theories that
interest us in the paper. We do this by relating their
associated categorical free constructions using a
generalisation of a glueing method due to Lafont [20, Annexe C], see
also [

of coproduct cones satisfy

The same proof method works for all functors and other variations; indicating that there is an underlying general theory underpinning the theorem. For instance, we also have the following result.

structure preserving functor from the free distributive category over a small category into the free BiCCC over the be a parametric family of coprod

A consequence of these theorems is the conservativity of the various type theories. Thus, not only isomorphisms of types that hold in a type theory still hold in its extensions but also non-isomorphic types in the original type theory same small category is full and faithful. be a parametric family of coproducts in a small remain non-isomorphic in the extended one.

Below, we will just spell out the proof of relative full (2) 2 ? t : commutes.

The situation (2) induces the embedding

Explicitly, the glueing category has objects

, and mor( ) + E if the equational theory of the usual arithmetic identities

K + First notice that, for the parametric family of all fiF + [ C ] nite coproduct diagrams in , we have the following is an embedding.

situation
where
h N; ; "i complete for the standard model of positive natural
( E 6 ) showed that the identity is complete for the standard
h N; i" model of positive natural numbers with
exponenti( E 2 ) ( E 3 ) ( E 6 ) ( E 7 ) ation, and that the identities , , , and are
that are taught in high school are complete for the standard
model of positive natural numbers; i.e., if they are enough
to prove all the arithmetic equations. He conjectured that
they were, but was not able to prove the result. Martin [

We consider the case of distributive categories; the categorical counterpart of the type theory with unit and empty types, and product and sum type constructors.

where E Type isomorphisms. The equations in together with the ( E 1 ) ( E 2 ) ( E 3 ) ( E 8 ) ( E 9 ) ( E 10 ) ( D 1 ) ( D 2 ) , , , , , and , , we have 4.1

have a clear combinatorial interpretation which is made evident when interpreting them as isomorphisms in the catobvious translation given below. F egory of finite sets , or indeed in any BiCCC, under the

following ones

.) nite sets are isomorphic iff they have the same cardinality, and that the type constructors on finite sets coincide with cardinal arithmetic.

The implications as in (4) for the cartesian closed case
have been shown to be equivalences [

are amounts is complete for the the same polynomial (i.e., syntactically equal) as the polybers has an infinite number of zeroes and hence it is null. holds in the its canonical polynomial form which can in turn be transa canonical polynomial form, which can in fact be made unique. is decidable. As a further corollary, we have the following multiplicative cancellation property.

where F 0 ; + [ T ] does not always hold. Indeed, for all types in , we

It is interesting to note that in the further presence of exponentials, the above multiplicative cancellation property have the isomorphism h N; Proposition 4.4 The equational theory of finitely axiomatisable. y 1 u x v 2 x (5) Notice that replacing by , by , and by in one obtains the equations (3). Hence the non finite axiomatisability result does not depend on the presence of constants in the language. ; " ; + i is not n = 3 identities (5) for the case we found an isomorphism.

phisms of types. Analysing the normal forms between the types corresponding to the generalised Wilkie-Gurevic? Below we present the general construction, which is a type theoretic method for establishing the identities that exhibits their combinatorial content.

Aiming at understanding type isomorphism in the presence of product, arrow, and sum types, it is natural to ask whether Gurevic??s equations are also type isomorphisms.

We first consider two ways of establishing the identities (3) for the natural numbers respectively due to Wilkie and Gurevic?. ! 0 0 2 T an isomorphism (for instance, =6 for all ).

from which the cancellation of does not generally yield

Since the above methods respectively use negative
numbers (which do not have a type-theoretic counterpart) and
multiplicative cancellation (which is not known to be type
theoretically sound), we speculated that Gurevic??s identities
did not hold as isomorphisms. Hence, we set out to prove
that no term between the types corresponding to Gurevic??s
equations is an isomorphism by a careful study of normal
forms in the typed lambda calculus with empty and sum
types [

study of the normal forms between the types induced by the expressions in (3), we introduced the following generalised Wilkie-Gurevic? identities with no constants and (n

Corollary 4.6 The equational theory of type isomorphism in cartesian closed categories with binary coproducts is not finitely axiomatisable. 4.3

given by the definition in Figure 3 are mutually inverse. PROOF: See Appendix A. 1 h; typed lambda calculus with empty and sum types over a set where derived from the above by taking the base type to be negated where and the following facts: to type isomorphisms.

We conjecture that Gurevic??s
result [

. Analothat do not correspond (7) and istic tautology. tautology, and we are done.

, are straightforward.

.

, and we will use the given by

Corollary 4.9 The problem of whether two negated types are isomorphic in the theory of BiCCCs is decidable. 5

The results of this paper are the first significant advance in the study of type isomorphisms in the presence of empty and sum types.

Many questions still remain open, as for instance whether there are arithmetic equations in the lanh N; bers

the equational theory of the model of positive natural num1 ; ; " ; + i can be generalised to the case of the h N 0 ; 1 ; 0 ; ; " ; + i model of natural numbers , and hence, by the results of this paper, that the equational theory of type isomorphism in bicartesian closed categories is not finitely axiomatisable. Decidability questions of the equational theory of type isomorphisms in the extensions of the typed lambda calculus with empty and/or sum types should be addressed. Finally, the observations in Subsection 4.3 suggest that the appropriate framework for characterising the type isomorphisms that hold in the category of finite sets for types with arrow, empty and sum constructors may be calculi for classical or intermediate logics.

Acknowledgements. We are grateful to Claude Kirchner and Sergei Soloviev for interesting discussions on the subject, and to Alex Simpson for pointing out (7). equals the following one is established similarly.

We show that in the equational theory of the typed lambda calculus with empty and sum types the composite

Indeed, by routine calculation, one sees that the second component of the pair equals the term