Clones, closed categories, and combinatory logic

We give an exposition of the semantics of the simply-typed lambda-calculus, and its linear and ordered variants, using multi-ary structures. We define universal properties for multicategories, and use these to derive familiar rules for products, tensors, and exponentials. Finally we explain how to recover both the category-theoretic syntactic model and its semantic interpretation from the multi-ary framework. We then use these ideas to study the semantic interpretation of combinatory logic and the simply-typed lambda-calculus without products. We introduce extensional SK-clones and show these are sound and complete for both combinatory logic with extensional weak equality and the simply-typed lambda-calculus without products. We then show such SK-clones are equivalent to a variant of closed categories called SK-categories, so the simply-typed lambda-calculus without products is the internal language of SK-categories. As a corollary, we deduce that SK-categories have the same relationship to cartesian monoidal categories that closed categories have to monoidal categories.


Introduction
Lambek's correspondence between cartesian closed categories and the simplytyped λ-calculus is one of the central pillars of categorical semantics.One way of stating it categorically is to say that the syntax of typed λ-terms over a signature of base types and constants forms the free cartesian closed category (for a readable overview, see [29,11]).The existence of this syntactic model gives completeness: if an equation holds in every model, it holds in the free one, and hence in the syntax.The free property then gives soundness: for any interpretation of basic types and constants in a cartesian closed category pC, Π, ñq one has a functor ´ from the syntactic model to C, which is exactly the semantic interpretation of λ-terms.The fact this functor is required to preserve cartesian closed structure amounts to showing that the semantic interpretation is sound with respect to the usual βη-laws.All this justifies calling the simply-typed λ-calculus the internal language of cartesian closed categories.
This framework is powerful, but hides a fundamental mismatch: morphisms A Ñ B in a category are unary-they have just one input-but terms-in-context such as x 1 : A 1 , . . ., x n : A n $ t : B can have many inputs.The standard solution (e.g.[11,25]) is to use categorical products to model contexts, so a term t as above corresponds to a map ś n i"1 A i Ñ B out of the product.Despite its evident success, this solution remains somewhat unsatisfactory, in two ways (see also [23]).First, it forces us to conflate two different syntactic classes, namely contexts and product types.As a result, some encoding is required to construct the syntactic model: the interpretation of x : A, y : B $ t : C is a term in context p : A ˆB.This adds complexity to the construction, and results in the somewhat unintuitive fact that the semantic interpretation of a term t in the syntactic model may not be just t itself.
Second, we are forced to include products in our type theory if we want a category-theoretic internal language-even though the calculus without products likely has a stronger claim to being called 'the' simply-typed λ-calculus (e.g.see Church's original definition [10]).This raises the question: what categorical structure has the simply-typed λ-calculus without products as its internal language?
This paper.This paper has three main aims.First, to explain how removing the mismatch between terms-in-context and morphisms outlined above clarifies the semantic interpretation of simply-typed λ-calculi.To achieve this, one needs to move from the unary setting of categories to a multi-ary setting, in which we have multimaps A 1 , . . ., A n Ñ B. These ideas are not new, but are under-appreciated, and I hope this will provide self-contained introduction for a wider audience.Second, to initiate a multi-ary investigation of the semantics of (cartesian) combinatory logic, in the style of Hyland's investigation of similar ideas for the untyped λ-calculus ( [20,21]).Finally, to use these results to define a categorical semantics for the simply-typed λ-calculus without products.
Outline.In Sections 2 to 6, we explain how the multi-ary perspective yields a slick way to derive the unary semantic interpretation and syntactic model, together with soundness and completeness results (Section 4.2).We also show how important type-theoretic constructions such as products and exponentials can be derived from the semantics.This framework accommodates different choices of structural rules, such as whether the language is ordered, linear, or cartesian.
The idea of using multi-ary constructions goes back to Lambek ( [27,28]), and has recently been exploited to great effect in a very general setting by Shulman [42].Particular cases can also be found in the works of Hyland ([20,21]), Hyland & de Paiva [22] and Blanco & Zeilberger [9].A reader familiar with these approaches will likely be unsurprised by the technical development below.However, we believe these ideas deserve to be more widely known, so spend time making them explicit in a concrete setting.
In Section 7 we introduce a multi-ary model of (cartesian) combinatory logic, called SK-clones, and prove that the sub-category of extensional SK-clones is equivalent to the category of closed clones modelling simply-typed λ-calculus without products.This provides a categorical statement of the classical correspondence between λ-calculus and extensional combinatory logic (e.g.[6,17]); it may be seen as a purely-semantic counterpart to the proof in [3], where Altenkirch et al. prove the generalised algebraic theories describing extensional combinatory logic and simply-typed λ-calculus are the same.
Finally, in Section 8 we introduce a version of Eilenberg & Kelly's closed categories ( [13,12]), called SK-categories, and show that the category of SKcategories is equivalent to the category of extensional SK-clones, and so to the category of closed clones.Hence, SK-categories are a categorical model for the simply-typed λ-calculus without products.SK-categories are a cartesian version of the prounital-closed categories of Uustalu,Veltri & Zeilberger ([45,46]), which in turn are closely related to an (incomplete) suggestion of Shulman's [41].
Jacobs has also isolated a structure that is sound and complete for simplytyped λ-calculus without products [23].His approach, which fits into his elegant general framework [24], is also predicated on a careful distinction between contexts and products.His models are certain indexed categories, with the contexts encoded by the indexing: this makes them feel closer to multi-ary structures.In SK-categories, by contrast, contexts are modelled within the category itself by using the closed structure (cf.[37, §4.4]).Moreover, unlike other work relating closed categories to multi-ary structures, SK-categories do not force us to include a unit object in the corresponding type theory (cf.[33]).
Technical preliminaries.For a set S we write S ‹ for the set of finite sequences over S, and use Greek letters Γ, ∆, . . . to denote elements of S ‹ .The empty string is denoted ˛, and the length of Γ by |Γ |.Where the length of a sequence is clear, we write simply A ‚ for A 1 , . . ., A n .Contexts are assumed to be ordered lists.
We call multimaps of the form A Ñ B unary and a multimap ˛Ñ B nullary.
We define a signature S to be a set |S| of basic sorts with sets SpΓ ; Bq of constants c : We write Sig for the category of signatures and their homomorphisms.One could also consider versions of higher-order constants, which may use the language's constructs.This extension does not change the theory significantly, and would require introducing multiple categories of signatures, so we do not seek this extra generality here.
We assume familiarity with the simply-typed λ-calculus, as in e.g.[11].We denote the simply-typed λ-calculus with constants and base types given by a signature S, and both product and exponential types modulo αβη-equality, by Λ ˆ,Ñ S .We write Λ Ŝ and Λ Ñ S for the fragments with just products and just exponentials, respectively.Here we focus on the typed cases: the untyped versionsboth in the syntax and the multi-ary models-are recovered by fixing a single base type ‹ such that Θp‹, . . ., ‹q " ‹ for each type constructor Θ.
We also assume familiarity with the basics of cartesian categories, cartesian closed categories, and monoidal categories, as in e.g.[32,29].To avoid having to treat the unit type as a special case, cartesian categories are assumed to have n-ary products ś n for all n P N. We also work with functors preserving structure strictly: this simplifies the exposition without any great loss of generality.Thus, MonCat, SMonCat and CartCat denote the categories of monoidal categories, symmetric monoidal categories, and cartesian categories, respectively, with functors preserving all the data on the nose.

Multicategories and clones
We begin with an intuitive overview of the place of multi-ary structures in semantics.A multi-ary structure has multimaps A 1 , . . ., A n Ñ B with multiple inputs and one output; unlike the morphisms in a category, multimaps correspond directly to terms-in-context.As a result, it is often easier to construct a multi-ary free model than it is to construct a unary one, and the interpretation of a term-in-context t in the free model is given by t itself.Moreover, every multi-ary structure gives rise to a unary one by restricting to multimaps with one input.The multi-ary semantics therefore factors the unary one, as shown: One can then 'read off' the syntactic category, together with a guarantee that it has the right structure, by restricting the free multi-ary structure to unary maps.Similarly, the usual semantic interpretation in (say) a cartesian closed category C is exactly the interpretation that arises by extending C to a multi-ary structure.This gives an algebraic justification for encoding contexts as products: this is how one extends a cartesian closed category to a multi-ary structure.(For the details of these points, see Section 4.2.) The multi-ary perspective also provides a unifying framework for type theories with different structural rules.The simply-typed λ-calculus is cartesian: it admits the structural rules of weakening, contraction, and permutation (as in e.g.[11,Fig. 3.2]).The corresponding multi-ary structures are certain abstract clones.Ordered type theories (e.g.[26,38]), also known as planar type theories (e.g.[2,48]), do not admit weakening, contraction, or permutation, and correspond to certain multicategories.Linear type theories (e.g.[18]), which admit only permutation, correspond to certain symmetric multicategories (see also the alternative 'tangled' option in [35]).Since abstract clones and symmetric multicategories may be seen as special cases of multicategories, we can develop a theory of how to add structure to cartesian, linear, and ordered type theories by analysing how to add structure to multicategories.

Multicategories, clones, and their internal languages
We now introduce multicategories and abstract clones and show how they correspond to certain type theories.An even more general framework for syntax, allowing multi-ary domains and codomains as well as both cartesian and linear contexts, is provided by Shulman's recent work with polycategories [42].Clones, and their correspondence with syntax, also play a key role in the 'algebraic syntax' programme of Fiore and collaborators initiated in [15] (see e.g.[14,4,5]).[30, p. 39]).
We write Multicat (resp.SMulticat) for the category of (symmetric) multicategories and their functors, and write t : Γ Ñ B for t P MpΓ ; Bq.
Example 1.Every monoidal category pC, b, Iq induces a multicategory T C. The objects are those of C, with multimaps pT CqpA 1 , . . ., A n ; Bq :" Cp Â n i"1 A i , Bq for a chosen n-ary bracketing of the tensor product.This determines functors MonCat Ñ Multicat, and SMonCat Ñ SMulticat (see e.g.[30, p. 39]); we denote both of these by T .
Lambek [27] essentially observed that every multicategory has an internal language, as follows.One identifies multimaps t : A 1 , . . ., A n Ñ B with terms x 1 : A 1 , . . ., x n : A n $ t : B, for a fixed ordering of an infinite set of variables tx 1 , x 2 , . . .u.The identity Id A is identified with the variable x : A, and the composition operation becomes a formal substitution operation on the language.Stated in this way, the three axioms become well-known properties of substitution: the unit laws say xrus " u and trx 1 , . . ., x n s " t, and the associativity law is a linear version of the so-called Substitution Lemma (e.g.[6,Lemma 2.1.16]).
The next result shows this terminology does not differ too much from the notion of internal language in the introduction.For a signature S and Γ :" P. Saville px i : A i q i"1,...,n , write O S for the ordered language generated by the two rules on the left below, and L S for the linear language generated by all three rules: Substitution is defined as usual, so that the following rule is admissible: With this rule as composition, O S and L S define a syntactic multicategory SynpO S q and a syntactic symmetric multicategory SynpL S q, respectively.These define left adjoints to the functors Multicat Ñ Sig and SMulticat Ñ Sig sending a (symmetric) multicategory M to the signature with objects |M| and constants MpΓ ; Bq ( Γ P|M| ‹ ,BP|M| ; we denote both these functors by U. Lemma 1. SynpO S q (resp.SynpL S q) is the free multicategory (resp.symmetric multicategory) on S.
Thus, the internal language of a symmetric multicategory is the core of Abramsky's linear λ-calculus [1].To recover a cartesian language, we use (multisorted) abstract clones.These differ from multicategories in that the result of substituting pu i : Abstract clones are equivalently cartesian multicategories (see e.g.[20]), but this formulation is less natural syntactically: it amounts to adding explicit duplication and deletion operations to the language.Definition 3.An abstract clone C consists of a set |C| of sorts and sets CpΓ ; Bq of multimaps for every Γ P |C| ‹ and B P |C|, together with 1. Projection multimaps p A‚ i P CpA 1 , . . ., A n ; A i q for every A 1 , . . ., A n P |C|; 2. For every A 1 , . . ., A n , B P |C| and ∆ P |C| ‹ , a substitution operation CpA 1 , . . ., A n ; Bq ˆśn i"1 Cp∆; A i q Ñ Cp∆; Bq `t, pu 1 , . . ., u n q ˘Þ Ñ tru 1 , . . ., u n s subject to an associativity law and two unit laws for any t P CpA 1 , . . ., A n ; Bq, `ui P CpB 1 , . . ., B m ; A i q ˘i"1,...,n and `vj P CpΘ; B j q ˘j"1,...,m : We distinguish between clones and multicategories by using r. . .s for a clone's substitution operation and x. ..y for a multicategory's composition operation.Every multicategory, and hence every clone, has an underlying category.Definition 4. The nucleus M of a multicategory or clone M is the category with the same objects and MpA, Bq :" MpA; Bq.This defines functors p´q : Multicat Ñ Cat and p´q : Clone Ñ Cat to the category of small categories.
The internal language of a clone is a cartesian version of that for multicategories.Write Λ S for the language below; substitution is defined as usual.
Lemma 2. The canonical forgetful functor U : Clone Ñ Sig has a left adjoint, and the free clone on S is SynpΛ S q.

Universal properties for multicategories
In this section we generalise the categorical notion of universal arrows (as in e.g.[32, §3]) to give a notion of universal property for multicategories.This will provide a uniform way to introduce new connectives to a type theory.One could also define the required conditions directly (see [9,42]), but here we wish to emphasise that they arise from category-theoretic ideas.
We extend this definition-and hence our notion of universal property-to clones by using the next observation (cf. the fact a cartesian category is monoidal).Lemma 3.There is a faithful functor M : Clone Ñ Multicat sending a clone C to the multicategory with the same objects and hom-sets, and composition given using substitution in C and the projections.Definition 5 does not involve 'global' conditions like naturality, so is particularly amenable to a type-theoretic interpretation.As in the categorical setting, however, it can be rephrased using natural isomorphisms (cf.[32, §3.2]).Lemma 4. Let f : M Ñ N be a multicategory functor.
1. Giving a universal arrow from f to X P |N| is equivalent to giving R P M and an isomorphism φ A‚ : MpA 1 , . . ., A n ; Rq A corollary is that giving a right adjoint to a multicategory functor f : N Ñ M in Hermida's 2-category of multicategories [19] is equivalent to giving a mapping g 0 : |M| Ñ |N| and a universal arrow f gpXq Ñ X from f to X for each X P |N|.

Product structure
We now have enough to define products for multicategories, and hence for clones.An n-ary product is exactly a limit over the discrete category with n objects.Rephrasing in terms of universal arrows (e.g.[32, §3]) we get that equipping a category C with n-ary products is exactly equipping it with a universal arrow from the diagonal functor ∆ pnq : C Ñ C ˆn to pA 1 , . . ., A n q for every A 1 , . . ., A n P C.
Since Multicat has finite products defined in much the same way as the category of small categories Cat, we may make the following definition.The prefix 'cartesian' is already used for multicategories, so we use 'finite-products'.Definition 6.An fp-multicategory is a multicategory M equipped with a universal arrow `śn i"1 A i , pπ A‚ 1 , . . ., π A‚ n q ˘from the diagonal functor ∆ pnq : M Ñ M ˆn to pA 1 , . . ., A n q for every n P N and A 1 , . . ., A n P |M|.
Asking for M to have finite products is equivalent to asking for a product object ś n i"1 A i and unary multimaps `πA‚ i : In the internal language, this amounts to the following rules: pi " 1, . . ., nq p : We can now derive the rules for & in linear λ-calculus [1].Indeed, given Γ, x : A i , Θ $ t : B, from (3) we get Γ, p : " u where we write xu i y n i"1 for xu 1 , . . ., u n y.This syntax defines a free property.To see this, say a multicategory functor f (strictly) preserves finite products if it preserves all the data on the nose, so that f p , and f pxt 1 , . . ., t n yq " xf t 1 , . . ., f t n y.Write fpMulticat for the category of fp-multicategories and product-preserving functors, and fpSMulticat for the subcategory of symmetric multicategories with finite products, with functors preserving both structures.Returning to the cartesian setting, we define products in a clone using the corresponding structure for multicategories and Lemma 3. Definition 7. A cartesian clone pC, Πq is a clone C equipped with a choice of finite products on MC.A (strict) homomorphism of cartesian clones is a clone homomorphism f that strictly preserves all the product structure.We write CartClone for the category of cartesian clones and strict homomorphisms.
Writing π i ptq for the multimap π A‚ i rts, the rules (3) translate directly to the usual product rules of λ-calculus.So cartesian clones exactly capture Λ ˆ.
Lemma 6.The composite forgetful functor CartClone Ñ Clone Ñ Sig has a left adjoint, and SynpΛ Ŝ q is the free cartesian clone on S.
Using the characterisation of universal arrows in terms of natural isomorphisms we get the following refinement of Example 2.
Example 4. For any cartesian category pC, Πq the induced clone PC is cartesian, essentially by definition; this extends to a functor P : CartCat Ñ CartClone.Moroever, if pC, Πq is a cartesian clone, then so is its nucleus C. Hence p´q restricts to a functor CartClone Ñ CartCat.
The two functors in this example are actually adjoints, yielding our first version of the schema in (1).The unit is identity-on-objects and sends t : A 1 , . . ., A n Ñ B to trπ A‚ 1 , . . ., π A‚ n s : The functor p´q : CartClone Ñ CartCat fits into the following diagram of adjunctions: Moreover, U ˝P is equal to the canonical forgetful functor CartCat Ñ Sig.Hence, the free cartesian category on S is canonically isomorphic to SynpΛ Ŝ q.

Cartesian structure from representability
In the preceding section we defined products using a multi-ary version of the familiar universal property.There is another way to define 'monoidal structure' in a multicategory: Hermida's representability [19].From the perspective of linear logic, the finite product structure explored above corresponds to the additive conjunction &; Hermida's representability will correspond to the multiplicative conjunction b.We shall also see that, for clones, the two are equivalent.Definition 8.A representable multicategory is a multicategory M equipped with a universal arrow ´TpX 1 , . . ., X n q, ρ X‚ : X 1 , . . ., X n Ñ TpX 1 , . . ., X n q ¯from X 1 , . . ., X n to the identity id M for each X 1 , . . ., X n P |M|; we write T n i"1 X i for TpX 1 , . . ., X n q.These universal arrows must be closed under composition, so must also be universal.A representable multicategory functor f is a multicategory functor that preserves all the universal arrows, so that f pT n i"1 A i q " T n i"1 f A i , f pρ A‚ q " ρ f A‚ and f pt # q " f t # .Write RepMulticat for the category of representable multicategories, and SRepMulticat for the category of representable multicategories whose underlying multicategories are also symmetric, with functors preserving both structures.
Example 5 (cf.Example 1).The multicategory T C induced by a monoidal category pC, b, Iq is representable.We therefore obtain functors MonCat Ñ RepMulticat and SMonCat Ñ SRepMulticat; we denote them both T .
A representable multicategory is a multicategory equipped with rules which are dual to those in (3) in the sense that the universal arrow goes the other direction.Indeed, writing x 1 b . . .b x n for ρ A‚ , and let px 1 , . . ., x n q be p in t for t # , and extending this to all terms by let px 1 , . . ., x n q be u in t :" `let px 1 , . . ., x n q be p in t ˘ru{ps we obtain the following rules, where Γ :" px i : A i q i"1,...,n : p∆i $ ui : Aiqi"1,...,n ∆1, . . ., ∆n $ b n i"1 ui : let px 1 , . . ., x n q be p in trb n i"1 x i {ps " t , let px 1 , . . ., x n q be b n i"1 x i in t " t We write O b S (resp.L b S ) for the extension of O S (resp.L S ) with these rules.This is essentially the tensor fragment of Abramsky's linear λ-calculus [1].The connection with multicategories was already made in by Hyland & de Paiva [22], who showed this type theory arises from Lambek's monoidal multicategories [28].Combining this lemma with Lemma 5, one sees that a multicategory equipped with representable and finite-product structure corresponds to a linear type theory with both b and &.
We can also obtain a linear version of Proposition 1. Hermida [19] showed that the 2-category of representable multicategories is 2-equivalent to the 2-category of monoidal categories, and Weber showed this extends to the symmetric case [47].From these constructions one can extract functors T : RepMulticat Ñ MonCat and T sym : SRepMulticat Ñ SMonCat sending a (symmetric) representable multicategory to a (symmetric) monoidal structure on its nucleus, together with equivalences RepMulticat » MonCat and SRepMulticat » SMonCat.So we get the following.
Proposition 2. The functors N and N sym fit into the following diagram of adjunctions, where in each case the right-hand adjunction is an equivalence: Moreover, U ˝T and U ˝Tsym are both equal to the canonical forgetful functor to Sig.Hence, the free monoidal (resp.symmetric monoidal) category on a signature S is canonically isomorphic to N `SynpO b S q ˘(resp.N `SynpL b S q ˘).We now turn to studying representability in the cartesian setting.A cartesian clone makes the projections primitive (recall (3)), but a representable clone makes the pairing operation primitive (recall (4)).It turns out these perspectives are equivalent.In the proof-theoretic setting such ideas are well-studied (cf. the equivalence of G-systems and N-systems in [44, §3.3]); the categorical statement has also been made by Pisani [36] and Shulman [42].
Proposition 3. Equipping a clone C with representable structure is equivalent to equipping C with cartesian structure.
In Proposition 2 we gave an equivalence of categories but in Proposition 1 we only gave an adjunction.We can now upgrade the latter to an equivalence.Indeed, p´q˝P is equal to the identity.On the other hand, if pC, Πq is a cartesian clone then by Proposition 3 and Lemma 4 we have a multi-natural isomorphism CpA 1 , . . ., A n ; Bq -Cp ś n i"1 A i ; Bq " PpCqpA 1 , . . ., A n ; Bq.Corollary 1.The functors P and p´q of Proposition 1 define an adjoint equivalence CartClone » CartCat.

Recovering the semantic interpretation and syntactic model
We now show how the usual semantic interpretation, syntactic model, and soundness and completeness results can be derived from the multi-ary framework.Although we shall not pursue the point in detail for reasons of space, essentially the same argument holds for all the calculi considered in this paper.
Semantic interpretation and soundness.We recover the usual semantic interpretation of Λ ˆin a cartesian category by Lemma 6 and Example 4 as follows.Let U : CartCat Ñ Sig be the functor sending a cartesian category pC, Πq to the signature with objects those of C and constants Cp ś n i"1 A i , Bq ( A1,...,An,BPC .An interpretation s : S Ñ UC of basic types and constants in C is exactly an interpretation s : S Ñ UpPCq in the induced cartesian clone.The unique extension s ´ : SynpΛ Ŝ q Ñ PC sends a term x 1 : A 1 , . . ., x n : A n $ t : B to a multimap s x 1 : A 1 , . . ., x n : A n Ñ s B in PC, which is exactly a map It is not hard to show this coincides with the usual, inductively defined semantic interpretation.Unlike with the unary approach, we do not need to prove soundness with respect to βη as a separate lemma: this holds immediately from the fact s ´ is a cartesian clone homomorphism. Moreover, for any objects A 1 , . . ., A n in a cartesian clone one can construct a 'multi-isomorphism' pA 1 , . . ., A n q -ś n i"1 A i (see [40,Lemma 4.2.16]).Hence, in a cartesian simple type theory with products, contexts must coincide with product types.Together with the preceding, this provides a mathematical explanation for the identification of contexts and product types in the interpretation of Λ ˆ,Ñ .
For a further example of a soundness property which normally requires a separate, inductively proven, lemma consider the following (cf.[11,Lemma 3.5.2]).Fix a context Γ :" px i : A i q i"1,...,n and a term Γ $ t : B. Then t weakens to Γ, y : A n`1 $ t y : B, which is exactly the term obtained from the substitution rule (2) using the n variables pΓ, y : A n`1 $ x i : A i q i"1,...,n , so t y " trx 1 {x 1 , . . ., x n {x n s.In other words, in the clone SynpΛ Ŝ q we have that t y " trp Γ,An`1 1 , . . ., p Γ,An`1 n s.By the clone structure of PC and the fact any clone homomorphism preserves substitution, it follows that s t y : s " s t ˝xπ 1 , . . ., π n y.Syntactic model.We extract the construction from Proposition 1.For a signature S the cartesian category SynpΛ Ŝ q has objects the types of Λ Ŝ and morphisms A Ñ B given by αβη-equivalence classes of terms x : A $ t : B for a fixed variable x.Composition is substitution and the identity on A is the variable x : A. The projections are x : ś n i"1 A i $ π A‚ i pxq : A i and the pairing of the maps px : C $ t i : A i q i"1,2 is x : C $ xt 1 , t 2 y : A 1 ˆA2 .The usual proofs that this is indeed cartesian (see e.g.[11,Chapter 3]) have been replaced by the simple observation of Example 4.
Completeness.Once again, the proof is largely category-theoretic.Note first that the functor p´q : CartClone Ñ CartCat is faithful.One can prove this directly using Proposition 3 or infer it from Corollary 1 and the fact any equivalence is fully faithful.In any case, it follows by standard results (e.g.[39, Lemma 4.5.13]) that the unit η 1 of the adjunction p´q % P is monic.Just as in Cat, any monomorphism of clones is injective on objects and injective on multimaps.It suffices, therefore, to find a semantic interpretation ι ´ which is equal to a component of η 1 .This is accomplished by the next lemma.
be adjunctions with units η : id C ñ UF and η 1 : id D ñ U 1 F 1 .Then for any C P C, the unit η 1 F C : F C Ñ U 1 F 1 F C is the unique map h such that the following diagram commutes: In the setting of Proposition 1 this lemma implies that the component η 1 F S : SynpΛ Ŝ q Ñ P `SynpΛ Ŝ qq of the unit for the adjunction p´q % P is exactly the unique cartesian clone homomorphism ι ´ extending the obvious interpretation ι :" S ãÑ SynpΛ Ŝ q of base types and constants in the free cartesian category.By our preceding discussion, this clone homomorphism is injective on multimaps: so if ι t " ι t 1 then t " t 1 in SynpΛ Ŝ q, hence t " βη t 1 .

Closed structure
To define closed structure, we follow Lambek's definition and simply upgrade the hom-set definition of exponentials to multicategories.

Definition 10 ([28]
).A closed multicategory is a multicategory M equipped with an object rA, Bs and multimap eval A,B : rA, Bs, A Ñ B for every A, B P |M|, such that composition induces isomorphisms as shown: A (strict) closed multicategory functor is a multicategory functor f which preserves all the data: f prA, Bsq " rf A, f Bs, f peval A,B q " eval f A,f B and f pΛtq " Λpf tq.We write ClMulticat for the category of closed multicategories and their functors, and ClSMulticat for the category of symmetric multicategories with closed structure, and functors preserving both of these.
Example 6.If pC, b, I, r´, "sq is a closed (symmetric) monoidal category then the induced (symmetric) multicategory T C is also closed.
Closed multicategories allow us to model exponentials without requiring a tensor product.Writing out the rules in the internal language, we get the map Λ A in (5) as the usual abstraction rule, and the evaluation map as the application f : A ⊸ B, x : A $ f x : B. We then see that ∆, f : A ⊸ B, x : A $ urf x{ys : C whenever ∆, y : B $ u : C, so we recover a small adaptation of Abramsky's rules for exponentials.Write O ⊸ S (resp.L ⊸ S ) for the extension of O S (resp.L S ) with the following rules and the βη-laws familiar from Λ Ñ : 22]).The composite forgetful functor ClMulticat Ñ Multicat Ñ Sig has a left adjoint, and the free closed multicategory on S is the syntactic multicategory SynpO ⊸ S q.The same holds for symmetric structure, if one replaces ClMulticat by ClSMulticat and O ⊸ by L ⊸ .
For the cartesian case, we follow the same procedure as in Section 4. Definition 11 recovers the usual βη-laws for exponentials in Λ Ñ , complete with the weakenings that are usually implicit.Writing f x for eval, we get the following equations in the internal language when Γ :" px i : A i q i"1,.6 Cartesian closed structure The development above makes defining cartesian closed structure straightforward.For reasons of space we restrict ourselves to the cartesian case, but similar remarks apply to the linear and ordered cases.
Definition 12.A cartesian closed clone is a clone equipped with both closed structure and cartesian structure.We write CCClone for the category of cartesian closed clones and homomorphisms that strictly preserve both structures.
By Lemmas 6 and 10, we already have a free property .As in Section 4.2, the preceding two results are enough to recover the sound semantic interpretation of Λ ˆ,Ñ , and the usual syntactic model.

Cartesian combinatory logic and SK-clones
In this section we begin a multi-ary investigation of cartesian combinatory logic, and give a categorical statement of the classical correspondence between combinatory logic and Λ Ñ (for which see e.g.[17,8]).In Section 8 we shall use this to define SK-categories and show they are sound and complete for Λ Ñ .
We briefly recapitulate the rules of typed combinatory logic CL S over a signature S; for a fuller account see e.g.[8].Types are as in Λ Ñ .Terms are given by the grammar t, u ::" x ˇˇc P SpΓ ; Bq ˇˇpt uq ˇˇS ˇˇK: we have variables, constants and an application operation as in Λ Ñ and, for any context Γ and types A, B and C, two combinators Γ $ S Γ A,B,C : `A ñ pB ñ Cq ˘ñ `pA ñ Cq ñ pA ñ Cq ȃnd Γ $ K Γ A,B : A ñ pB ñ Aq.Substitution is as in Λ Ñ , where the combinators Z P tS, Ku satisfy Zru 1 {x 1 , . . ., u n {x n s " Z so that Z Γ is the weakening of Z ˛.
The correlate of β-equality is weak equality " w , which is the smallest congruence containing S x y z " px zq py zq and K x y " x.The correlate of βη-equality is extensional weak equality " wext , which extends " w with the rule We write CL w for combinatory logic with weak equality and CL wext for combinatory logic with extensional weak equality.The usual encoding of CL w in Λ Ñ sends S and K to λf .λg .λx .pf xq pg xq and λx .λy .x, respectively.
The next definition may be obtained by seeing that CL w can be presented as an algebraic theory, and that clones are equivalent to algebraic theories (e.g.[31,43]).We implicitly bracket application to the left, so t ¨u ¨v :" pt ¨uq ¨v.We also write p´q pt ¨uqrv 1 , . . ., v n s " trv 1 , . . ., v n s ¨urv 1 , . . ., v n s , pK A,B q A,B ¨p1 ¨p2 " p 1 pS A,B,C q rA,rB,Css,rA,Bs,A ¨p1 ¨p2 ¨p3 " pp 1 ¨p3 q ¨pp 2 ¨p3 q A homomorphism of SK-clones is a clone homomorphism that preserves application, S and K: We write SKClone for the category of SK-clones and their homomorphisms.
Lemma 12.The composite forgetful functor SKClone Ñ Clone Ñ Sig has a left adjoint, and the free SK-clone on S is the syntactic clone SynpCL w S q.A core feature of the syntax of combinatory logic, which is at the heart of the correspondence between the terms of CL wext and Λ Ñ , is the admissibility of bracket extension algorithms (see e.g.[6, §7.1]).To express this in the typed setting, we use the following notation.For a binary operation r´, "s on a set S we define r´; "s : S ‹ ˆS Ñ S inductively as follows: r˛; Bs :" B , rA; Bs :" rA, Bs , rΓ, A; Bs :" rΓ ; rA, Bss With this notation, bracket abstraction amounts to saying that if Γ :" px i : A i q i"1,...,n and Γ $ t : B in CL w , there exists a closed term ˛$ t c : rΓ ; Bs such that pt c q Γ x 1 . . .x n " w t.The extensionality axiom (6) then says that t c is unique: in other words, t Þ Ñ t Γ x 1 . . .x n is an isomorphism.
We now translate this into clone-theoretic terms.For any SK-clone C we obtain the operation t Þ Ñ t Γ x 1 . . .x n as the composite below: For Γ :" ˛this is just the identity.The admissibility of bracket abstraction in the syntax of CL w is then captured by the next lemma.Typically bracket abstraction algorithms restrict to closed constants, because an open constant may have no corresponding closed term.We restrict in the same way.Call a signature S nullary if SpΓ ; Aq " H whenever Γ ‰ ˛, and write Sig 0 ãÑ Sig for the full subcategory of nullary signatures.
Lemma 13.Let S be a nullary signature.Then for any Γ P |SynpCL w S q| ‹ and B P |SynpCL w S q| there exists a map p´q c such that i Γ ;B ˝p´q c " id SynpCL w S q .Because bracket abstraction is defined by induction on the syntax, we cannot straightforwardly define it in an arbitrary SK-clone.We can, however, consider the sub-category of SK-clones (= semantic models of CL w ) which admit bracket abstraction in the sense that each i Γ ;B has a retraction.The extensional models are then those for which this retract p´q c also satisfies uniqueness.Definition 14.An SK-clone C is extensional if for every Γ P |C| ‹ and B P |C| the map i Γ ;B defined in (7) is invertible.We write SKClone ext for the full subcategory of SKClone consisting of just the extensional SK-clones.Lemma 14.The composite forgetful functor SKClone ext Ñ Clone Ñ Sig 0 has a left adjoint, and the free extensional SK-clone on a nullary signature S is the syntactic clone SynpCL wext S q.

Extensional SK-clones are closed clones
In this section we outline why SKClone ext is equivalent to ClClone, thereby giving a category-theoretic equivalence not just between the syntax of CL wext and Λ Ñ but also between their models.The proof uses extensionality or the ηlaw to pass from arbitrary multimaps to nullary ones, from which one can build a strict closed clone.We shall rely heavily on the following simple observation.Lemma 15.Let C be a clone and X :" XpΓ ; Bq ( Γ P|C| ‹ ,BP|C| a family of sets together with an isomorphism ν Γ ;A : CpΓ ; Aq Ñ XpΓ ; Aq ( Γ,A between X and the hom-sets of C in the functor category " |C| ‹ ˆ|C|, Set ‰ .Then X acquires a canonical clone structure and ν becomes an isomorphism of clones.
We now introduce strict closed clones.Definition 15.A strict closed clone is a closed clone pC, ñ, evalq such that every Λ A : CpΓ, A; Bq Ñ CpΓ, A ñ Bq is the identity.We write ι : ClClone st ãÑ ClClone for the full subcategory consisting of just the strict closed clones.
Any closed clone pC, ñ, evalq determines a strict closed clone SC and a clone isomorphism λ C : C Ñ SC by applying Lemma 15 to the isomorphisms CpΓ ; Bq -Cp˛; Γ ñ Bq arising from the closed structure.This extends to a functor S : ClClone Ñ ClClone st sending f : pC, ñ, evalq Ñ pD, ñ, evalq to the composite λ D ˝f ˝λ´1 C .A short calculation shows that the isomorphisms λ make S : ClClone ⇆ ClClone st : ι into an equivalence of categories.
We play a similar game for turning extensional SK-clones into (strict) closed clones.Indeed, for any extensional SK-clone we have isomorphisms CpΓ ; Bq -Cp˛; rΓ ; Bsq defining a strict closed clone LC with pLCqpΓ ; Bq :" Cp˛; rΓ ; Bsq, and hence a functor L : SKClone ext Ñ ClClone st in a similar fashion to S.
Finally, for any closed clone pC, ñ, evalq we get an extensional SK-clone EC with the same underlying clone by taking application to be application in Λ Ñ , so t ¨u :" eval A,B rt, us, and encoding the combinators as usual.
L » In Propositions 1 and 4 we recovered a unary semantic interpretation of Λ ˆand Λ ˆ,Ñ from our clone-theoretic ones.But we do not have a corresponding result for Λ Ñ .In this section we fill this gap: we introduce SK-categories and show they play the role for Λ Ñ that cartesian closed categories play for Λ ˆ,Ñ .Our definition is inspired by closed categories ( [13,12]), which axiomatise an 'internal' version of the hom-functor Cp´, "q in the form of a functor r´, "s : C op ˆC Ñ C. Closed categories have a unit object, corresponding to requiring a unit type (cf.[33]); our definition avoids this (see also [41,45]).
Recall that in the presence of contravariance, dinaturality and extranaturality are the right replacements for naturality (see e.g.[32,§IX.4]).This data is subject to the condition that U ˝r´, "s " Cp´, "q : C op ˆC Ñ Set and the 7 axioms of Figure 1a.An SK-functor pF, φ, ψq is a functor F : C Ñ D with natural transformations as below, such that the axioms of Figure 1b hold.
We call pF, φ, ψq strict if φ is the identity, and write SKCat for the category of SK-categories and strict SK-functors.
We think of U C as the set of multimaps ˛Ñ C and ε as a formal application operation p´¨"q.Axioms (1) and ( 2) are the weak equality laws from CL. Axioms (3) and (4) ensure compatibility between the category structure and the corresponding CL constructions: for example, axiom (3) implies U pf qpxq " f ¨x, and axiom (4) says that composition coincides with S pK ´q p"q, corresponding to the weak equality S pK f q g x " f pg xq.Axioms ( 5) -( 7) are coherence laws.
Every extensional SK-clone determines an SK-category.Because we follow [13] and ask for an equality U rA, Bs " CpA, Bq in the definition of SK-categories, but in general an extensional SK-clone pC, r´, "s, S, K, ¨q only has an isomorphism CpA; Bq -Cp˛; rA, Bsq, we need to strictify in the same manner as Section 7.1.As a notational shorthand, we write I, B and B 1 for the closed multimaps satisfying the equations below in the internal language of C (see e.g.[17,8]): I A ¨x " x , B BñC,AñB,A ¨x ¨y ¨z " x ¨py ¨zq , pB 1 q AñB,BñC,A ¨x ¨y ¨z " y ¨px ¨zq   The category NC has objects |C| and hom-sets pNCqpA, Bq :" Cp˛; rA, Bsq (cf.[16]).The identity on A is I A and the composite of t and t 1 is B ¨t ¨t1 .For U we take U A :" Cp˛; Aq with the action on maps given by application.For r´, "s the action on objects is given by the SK-structure, with the action on maps given by rX, ts :" B ¨t and rt, Xs :" B 1 ¨t.The maps S and K are given by the corresponding combinators, and ε is the application operation in C.This extends to a functor N : SKClone ext Ñ SKCat.
The internal language of SK-categories is CL wext , and hence Λ Ñ .We write U for the functor which sends an SK-category pC, U, r´, "s, S, K , εq to the signature with base types |C| and constants U rΓ, Bs.
Proposition 5.The forgetful functor U : SKCat Ñ Sig has a left adjoint, and the free SK-category on S is N `SynpCL wext S q ˘-pN ˝Eq `SynpΛ Ñ S q ˘.
Using Theorem 1, we now obtain a version of Propositions 1 and 4 for Λ Ñ .
Theorem 2. The composite N ˝ι : ClClone st Ñ SKCat is invertible; hence we get the diagram below, in which the right-hand adjunction is an equivalence: Moreover, U ˝Cl is equal to the forgetful functor SKCat Ñ Sig, so the free SK-category on S is canonically isomorphic to pN ˝EqpSynpΛ Ñ S qq.
Recall that a closed monoidal category is a monoidal category pD, b, Iq such that every p´q b D has a right adjoint rD, ´s, and that in a closed category C giving every rC, ´s a C-enriched left adjoint is equivalent to giving closed monoidal structure ( [13,12,45] We now turn to proving the result.We are given universal arrows as follows ȃnd we need to show the composite r ρ :" ρ TpA‚q,TpB‚q ˝xρ A‚ , ρ B‚ y in MC is also universal.To this end, set and define r π i : T `Tn i"1 A i , T n j"1 B m q ˘Ñ X i using iterated applications of the projections π: :" pp A‚ i q # : T n i"1 A i Ñ A i be the multimap defined in Lemma 16, and for pt i : Γ Ñ A i q i"1,...,n set xt 1 , . . ., t n y to be ρ A‚ rt 1 , . . ., t n s.Then, using (8): Proof.Abstractly, it suffices to see that the full subcategory of clones satisfying |C| " S is monadic over the functor category rS ‹ ˆS, Sets, and that every monadic functor is an iso-fibration in the sense of [7].Concretely, the projections are ν Γ ;Ai pp Γ i q and substitution is tru 1 , . . ., u n s :" ν ∆;B `ν´1 Γ ;B ptqr. . ., ν ´1 ∆;Ai pu i q, . ..s The three axioms are then verified by direct calculation.
[ \ Theorem 1.There exist equivalences of categories Proof.The right-hand equivalence is easily checked.For the left-hand one, write E 1 for the restriction E ˝ι of E to strict closed clones.A short calculation shows that L ˝E1 " id ClClone st .For the other direction, the composite E 1 ˝L sends an extensional SK-clone pC, r´, "s, S, K, ¨q to the clone with the same objects and hom-sets pE 1 LCqpΓ ; Bq " pLCqpΓ ; Bq " Cp˛; rΓ ; Bsq Variables and substitution in this clone are as in LC.Since the underlying clone structure of pE 1 LqC is the same as that in LC, and we have a clone isomorphism i C : LC Ñ C induced by the isomorphisms i Γ ;B , we get a clone isomorphism pE 1 LqC Ñ C. So it remains to show this is an isomorphism of SK-clones.
First we show preservation of application.In any closed clone, eval A,B is the multimap Λpp AñB 1 q so in LC we get eval A,B " i ´1 rA,Bs;rA,Bs pp rA,Bs 1 q.Now, by extensionality we have a closed multimap I A : ˛Ñ rA, As satisfying i A;A pI A q " I A ¨pA 1 " p A 1 .Hence, eval A,B " I rA,Bs .We now compute t ¨u in pELqC as follows: For preservation of K and S first recall that pi C q ˛;B " i ˛;B is the identity: pLCqp˛; Bq " Ý Ñ Cp˛; Bq.Thus, we need to show that the combinators K and S in pE 1 LqC are exactly those in C. In pE 1 LqC we have that K A,B is Λ A Λ B pp A,B 1 q in LC.Using the strictness of LC and the definition of projections from Lemma 15, we get that K ¨pA,B Moreover, U ˝Cl is equal to the forgetful functor SKCat Ñ Sig, so the free SK-category on S is canonically isomorphic to pN ˝EqpSynpΛ Ñ S qq.Proof.The main part of the proof is constructing an isomorphism N ˝E1 : ClClone st ⇆ SKCat : Q The claim then follows by setting Cl to be the composite ι ˝Q.The most difficult part of the proof is constructing clone structure from an SK-category P. Saville pC, U, r´, "s, S, K , εq.Here we give an outline: the rough idea is to define substitution using application so that the β-law automatically holds.
We begin with some notation.Write S Γ A,B : rΓ ; rA, Bss Ñ rrΓ ; As, rΓ ; Bss and K Γ A : A Ñ rΓ ; As for the maps defined inductively to be: the identity when |Γ | " 0, S and K when |Γ | " 1, and the composites below for |Γ | ě 2: One can show this forms a clone by a long series of inductive arguments using the axioms of Figure 1a.A short check shows that it is strict closed.
Alternatively, and much more simply, one can employ Proposition 5 and use CL wext as an internal language: we identify maps t : A Ñ B in C with closed terms ˛$ t : rA, Bs, and take the SK-structure as sketched just before Proposition 5. A short series of inductions yields the following for S Γ A,B and K Γ A as defined above, where Γ :" px i : A i q i"1,...,n and n ě 1: A,B f g x 1 . . .x n " pf x 1 . . .x n q pg x 1 . . .x n q K Γ A f x 1 . . .x n " f It follows that the i th projection p A‚ i is the closed term P i which satisfies P i x 1 . . .x n " x i and also that, where ∆ " py j : B j q j"1,...,m in the definitions above, then apppt, uq y 1 . . .y m " pt y 1 . . .y m q pu y 1 . . .y m q cpt, uq y 1 . . .y m " t pu y 1 . . .y m q sub `t, pu 1 , . . ., u n q ˘y1 . . .y m " t pu 1 y 1 . . .y m q . . .pu n y 1 . . .y m q The three clone axioms then reduce to direct calculations with CL wext .Finally, to see this clone is strict closed, one sees as in Theorem 1 that eval A,B is the identity I rA,Bs , and hence that for x 1 : A 1 , .

Lemma 5 .
The composite forgetful functor fpMulticat Ñ Multicat Ñ Sig has a left adjoint, and the free fp-multicategory on S is SynpO & S q.This extends to symmetric structure: replace fpMulticat by fpSMulticat and O & by L & .

Lemma 7 .
The composite forgetful functor RepMulticat Ñ Multicat Ñ Sig has a left adjoint, and the free representable multicategory on S is the syntactic multicategory SynpO b S q.The same holds for symmetric structure, if one replaces RepMulticat by SRepMulticat and O b by L b .

Definition 9 .
A representable clone is a clone C equipped with a choice of representable structure on MC.A representable clone homomorphism is a clone homomorphism which preserves the representable structure as inDefinition 8.

Definition 11 .Example 7 .
A closed clone is a clone C equipped with a closed structure on MC.We write ClClone for the category of closed clones and clone homomorphisms preserving the closed structure as in Definition 10.If pC, Π, ñq is a cartesian closed category, the clone PC is closed.

Lemma 11 .Proposition 4 .
The composite forgetful functor CCClone Ñ Clone Ñ Sig has a left adjoint, and SynpΛ ˆ,Ñ S q is the free cartesian closed clone on S.The nucleus of any cartesian closed clone pC, Π, ñq is also cartesian closed:CpA ˆB, Cq " CpA ˆB; Cq -CpA, B; Cq -CpA; B ñ Cq " CpA, B ñ Cq Similarly, by Examples 4 and 7, for any cartesian closed category pC, Π, ñq the induced category PC is cartesian closed.Proposition 1 then restricts as follows.The functor p´q : CCClone Ñ CCCat fits into the following diagram, in which the right-hand adjunction is an equivalence: Moreover, U˝P is equal to the canonical forgetful functor CCCat Ñ Sig.Hence, the free cartesian closed category on S is canonically isomorphic to SynpΛ ˆ,Ñ S q.

Definition 16 .
An SK-category consists of a category C and functors r´, "s : C op ˆC Ñ C and U : C Ñ Set, together with 1. Maps S C,D,E : rC, rD, Ess Ñ rrC, Ds, rC, Ess dinatural in C and natural in D and E; 2. Maps K C D : D Ñ rC, Ds extranatural in C and natural in D; 3. Maps ε C,D : U rC, Ds ˆUC Ñ U D extranatural in C and natural in D; Es rC, rD, Ess rrC, Ds, rC, Ess rid,K D s K rC,Ds S (a) Axioms for an SK-category.In (1) the unlabelled arrow is the canonical map xxπ1π1, π2y, xπ2π1, π2yy : pX ˆY q ˆZ Ñ pX ˆZq ˆpX ˆZq.In (3) we write xidC y for the set map ˚Þ Ñ idC : 1 Ñ UrC, Cs.U C rC, Ds CpC, Dq DpF C, F Dq U D F rC, Ds U D rF C, F Ds
). Theorem 2 and Proposition 4 imply a cartesian version.Corollary 2. Equipping a category C with cartesian closed structure is equivalent to equipping C with SK-structure and natural isomorphisms CpI, rC, Dsq -CpC, Dq and CpC b D, Eq -CpC, rD, Esq for every C, D, E P C. For proving Proposition 3, we begin with the following lemma, which says that the universal arrows in a representable multicategory are automatically closed under composition.Lemma 16.For any clone C, the multicategory MC is representable if and only if MC is equipped with universal arrows as in Definition 8 for each X 1 , . . ., X n P |C| ‹ .
is inverse to p´q ˝xρ TpA‚q,TpB‚q ˝xρ A‚ , ρ B‚ yy " p´q ˝xr ρy, as required.Suppose first that C has representable structure.Then for A 1 , . . ., A n P |C| ‹ let π A‚ i s for i " n `1, . .., n `mDirectly calculating using (8), we see that p A‚,B‚ i " r π i ˝xr ρy and id TpTpA‚q,TpB‚qq " r ρrr π 1 , . . ., r π n`m s.Hence, setting t # :" trr π 1 , . . ., r π n`m s we get that p´q # t n y " π A‚ i rρ A‚ rt 1 , . .., t n ss " p A‚ i rt 1 , . .., t n s " t i Now suppose that C has cartesian structure.By Lemma 16, it suffices to construct a universal arrow for each A 1 , . .., A n P |C| ‹ .To this end, we set ρ A‚ :" xp A‚ 1 , . .., p A‚ n y : A 1 , . .., A n Ñ A i Ñ B for t : A 1 , . .., A n Ñ B. Then, calculating as in Lemma 16, we have t # rρ A‚ s " trπ A‚ The functors P and p´q of Proposition 1 define an adjoint equivalence CartClone » CartCat.Proof.The counit of the adjunction p´q % P is the identity.On the other hand, the unit η sends a multimap t : A 1 , . . ., A n Ñ B to trπ A‚ 1 , . . ., π A‚ n s.But in Proposition 3 we showed that this mapping has inverse p´qrxp A‚ 1 , . . ., p A‚ n ys.Hence, η is also invertible.
Lemma 15.Let C be a clone and X :" XpΓ ; Bq ( Γ P|C| ‹ ,BP|C| a family of sets together with an isomorphism ν Γ ;A : CpΓ ; Aq Ñ XpΓ ; Aq The composite N ˝ι : ClClone st Ñ SKCat is invertible; hence we get the diagram below, in which the right-hand adjunction is an equivalence: The projections p A‚ i are now defined as the image of id Ai under the map below:UrA i , A i s UK A 1 ,...,A i´1 Ý ÝÝÝÝÝÝÝÝ Ñ UrA 1 , ..., A i ; A i s Urid;K A i`1 ,...,An s Ý ÝÝÝÝÝÝÝÝÝÝÝ Ñ UrA 1 , ..., A n ; A i sNext we define an application operation app byUr∆; rA, Bss ˆUr∆; AsWe then define substitution by induction.Substitution into a closed term is exactly weakening, so for |Γ | " 0 we take For |Γ | " 1 we take the map c and for |Γ | ě 2 we define sub as in the next diagram (we abuse notation somewhat by neglecting the structural isomorphisms for the product structure):UrΓ, A n`1 ; Bs ˆśn`1 ε Ý Ñ Ur∆; Bs and a unary substitution operation c as follows: U rA, Bs ˆU r∆; As UK ∆ ˆid Ý ÝÝÝÝÝ Ñ U r∆; rA, Bss ˆU r∆; As app Ý Ý Ñ U r∆; Bs B ÝÝÑ U r∆; Bs. i"1 UrB; A i s Ur∆; Bs UrΓ ; rA n`1 , Bss ˆśn`1 i"1 UrB; A i s Ur∆; rA n`1 , Bss ˆUrB; A n`1 s subΓ,A n`1 subΓ ˆid app . ., x n : A n $ t : rA, Bs the term eval A,B " trp 1 , ..., p n s, p n`1 ‰ in the induced clone QC must satisfy sub ´eval A,B , `subpt, pP 1 , ..., P n qq, P n`1 q ˘¯x 1 ...x n a " eval A,B ´`subpt, pP 1 , ..., P n qq, P n`1 q ˘x1 ...x n a ¯pP n`1 x 1 ...x n aq " eval A,B ´`subpt, pP 1 , ..., P n qq, P n`1 q ˘x1 ...x n a ¯a " eval A,B `t pP 1 x 1 ...x n aq ...pP n x 1 ...x n aq ˘a" eval A,B `t x 1 ...x n ˘a " t x 1 ...x n aHence, by extensionality, we get that eval A,B " trp 1 , ..., p n s, p n`1 ‰ " t in QC, so this is a strict closed clone.This extends to a functor Q : SKCat Ñ ClClone st in the obvious manner, and similar calculations-either with the respective internal languages or diagrammatically-show that we get the isomorphism claimed.Proof.The given isomorphisms are, by induction, equivalent to giving natural isomorphisms of the form Cpb i A i , Bq -CpI, rA 1 , . .., A n ; Bsq.Now, if C has an SK-structure together with these isomorphisms then we get U rb i A i , Bs -U rA 1 , . .., A n ; Bs, but this is exactly endowing the closed clone ClpCq with a representable structure, making it cartesian closed.Observing that each of the constructions in Proposition 4 and Theorem 2 preserves the underlying category, we see this endows C with cartesian closed structure.Going the other way, if C is cartesian closed then so is the clone PC, and by representability and Lemma 4 we get natural isomorphisms pPCqp ś n i"1 A i ; Bq -pPCqpA 1 , . . ., A n ; Bq for all n.Passing through Proposition 4 and Theorem 2, we see that the induced closed category has isomorphisms ‰ -U rA 1 , . . ., A n ; Bs " C `1, pA 1 , . . ., A n ñ Bq ȃs [ \ Corollary 2. Equipping a category C with cartesian closed structure is equivalent to equipping C with SK-structure and natural isomorphisms CpI, rC, Dsq -CpC, Dq and CpC b D, Eq -CpC, rD, Esq for every C, D, E P C.