Relative Full Completeness for Bicategorical Cartesian Closed Structure

The glueing construction, defined as a certain comma category, is an important tool for reasoning about type theories, logics, and programming languages. Here we extend the construction to accommodate ‘2-dimensional theories’ of types, terms between types, and rewrites between terms. Taking bicategories as the semantic framework for such systems, we define the glueing bicategory and establish a bicategorical version of the well-known construction of cartesian closed structure on a glueing category. As an application, we show that free finite-product bicategories are fully complete relative to free cartesian closed bicategories, thereby establishing that the higher-order equational theory of rewriting in the simply-typed lambda calculus is a conservative extension of the algebraic equational theory of rewriting in the fragment with finite products only.


Introduction
Relative full completeness for cartesian closed structure. Every small category C can be viewed as an algebraic theory. This has sorts the objects of C with unary operators for each morphism of C and equations determined by the equalities in C. Suppose one freely extends C with finite products. Categorically, one obtains the free cartesian category F × [C] on C. From the well-known construction of F × [C] (see e.g. [12] and [46, §8]) it is direct that the universal functor C → F × [C] is fully-faithful, a property we will refer to as the relative full completeness (c.f. [2,16]) of C in F × [C]. Type theoretically, F × [C] corresponds to the Simply-Typed Product Calculus (STPC) over the algebraic theory of C, given by taking the fragment of the Simply-Typed Lambda Calculus (STLC) consisting of just the types, rules, and equational theory for products. Relative full completeness corresponds to the STPC being a conservative extension.
Consider now the free cartesian closed category F ×,→ [C] on C, type-theoretically corresponding to the STLC over the algebraic theory of C. Does the relative full completeness property, and hence conservativity, still hold for either C in F ×,→ [C] or for F × [C] in F ×,→ [C]? Precisely, is either the universal functor C → F ×,→ [C] or its universal cartesian extension F × [C] → F ×,→ [C] full and faithful? The answer is affirmative, but the proof is non-trivial. One must either reason prooftheoretically (e.g. in the style of [63,Chapter 8]) or employ semantic techniques such as glueing [39,Annexe C].
In this paper we consider the question of relative full completeness in the bicategorical setting. This corresponds to the question of conservativity for 2-dimensional theories of types, terms between types, and rewrites between terms (see [32,20]). We focus on the particular case of the STLC with invertible rewrites given by β-reductions and η-expansions, and its STPC fragment. By identifying these two systems with cartesian closed, resp. finite product, structure 'up to isomorphism' one recovers a conservative extension result for rewrites akin to that for terms.
2-dimensional categories and rewriting. It has been known since the 1980s that one may consider 2-dimensional categories as abstract reduction systems (e.g. [54,51]): if sorts are 0-cells (objects) and terms are 1-cells (morphisms), then rewrites between terms ought to be 2-cells. Indeed, every sesquicategory (of which 2-categories are a special class) generates a rewriting relation on its 1-cells defined by f g if and only if there exists a 2-cell f ⇒ g (e.g. [60,58]). Invertible 2-cells may be then thought of as equality witnesses.
The rewriting rules of the STLC arise naturally in this framework: Seely [56] observed that β-reduction and η-expansion may be respectively interpreted as the counit and unit of the adjunctions corresponding to lax (directed) products and exponentials in a 2-category (c.f. also [34,27]). This approach was taken up by Hilken [32], who developed a '2-dimensional λ-calculus' with strict products and lax exponentials to study the proof theory of rewriting in the STLC (c.f. also [33]).
Our concern here is with equational theories of rewriting, and we follow Seely in viewing weak categorical structure as a semantic model of rewriting modulo an equational theory. We are not aware of non-syntactic examples of 2-dimensional cartesian closed structure that are lax but not pseudo (i.e. up to isomorphism) and so adopt cartesian closed bicategories as our semantic framework.
From the perspective of rewriting, a sesquicategory embodies the rewriting of terms modulo the monoid laws for identities and composition, while a bicategory embodies the rewriting of terms modulo the equational theory on rewrites given by the triangle and pentagon laws of a monoidal category. Cartesian closed bicategories further embody the usual β-reductions and η-expansions of STLC modulo an equational theory on rewrites; for instance, this identifies the composite rewrite t 1 , t 2 ⇒ π 1 ( t 1 , t 2 ), π 2 ( t 1 , t 2 ) ⇒ t 1 , t 2 with the identity rewrite. Indeed, in the free cartesian closed bicategory over a signature of base types and constant terms, the quotient of 1-cells by the isomorphism relation provided by 2-cells is in bijection with αβη-equivalence classes of STLC-terms (c.f. [55,Chapter 5]).
Bicategorical relative full completeness. The bicategorical notion of relative full completeness arises by generalising from functors that are fully-faithful to pseudofunctors F : B → C that are locally an equivalence, that is, for which every hom-functor F X,Y : B(X, Y ) → C(F X, F Y ) is an equivalence of categories. Interpreted in the context of rewriting, this amounts to the conservativity of rewriting theories. First, the equational theory of rewriting in C is conservative over that in B: the hom-functors do not identify distinct rewrites. Second, the reduction relation in C(F X, F Y ) is conservative over that in B(X, Y ): whenever F f F g in C then already f g in B. Third, the term structure in B gets copied by F in C: modulo the equational theory of rewrites, there are no new terms between types in the image of F .
Contributions. This paper makes two main contributions.
Our first contribution, in Section 3, is to introduce the bicategorical glueing construction and, in Section 4, to initiate the development of its theory. As well as providing an assurance that our notion is the right one, this establishes the basic framework for applications. Importantly, we bicategorify the fundamental folklore result (e.g. [40,12,62]) establishing mild conditions under which a glued bicategory is cartesian closed.
Our second contribution, in Section 5, is to employ bicategorical glueing to show that for a bicategory B with finite-product completion F × [B] and cartesianclosed completion F ×,→ [B], the universal pseudofunctor B → F ×,→ [B] and its universal finite-product-preserving extension F × [B] → F ×,→ [B] are both locally an equivalence. Since one may directly observe that the universal pseudofunctor B → F × [B] is locally an equivalence, we obtain relative full completeness results for bicategorical cartesian closed structure mirroring those of the categorical setting. Establishing this proof-theoretically would require the development of a 2-dimensional proof theory. Given the complexities already present at the categorical level this seems a serious and interesting undertaking. Here, once the basic bicategorical theory has been established, the proof is relatively compact. This highlights the effectiveness of our approach for the application.
The result may also be expressed type-theoretically. For instance, in terms of the type theories of [20], the type theory Λ ×,→ ps for cartesian closed bicategories is a conservative extension of the type theory Λ × ps for finite-product bicategories. It follows that, modulo the equational theory of bicategorical products and exponentials, any rewrite between STPC-terms constructed using the βη-rewrites for both products and exponentials may be equally presented as constructed from just the βη-rewrites for products (see [21,55]).
Further work. We view the foundational theory presented here as the starting point for future work. For instance, we plan to incorporate further type structure into the development, such as coproducts (c.f. [22,16,4]) and monoidal structure (c.f. [31]).
On the other hand, the importance of glueing in the categorical setting suggests that its bicategorical counterpart will find a range of applications. A case in point, which has already been developed, is the proof of a 2-dimensional normalisation property for the type theory Λ ×,→ ps for cartesian closed bicategories of [20] that entails a corresponding bicategorical coherence theorem [21,55]. There are also a variety of syntactic constructions in programming languages and type theory that naturally come with a 2-dimensional semantics (see e.g. the use of 2-categorical constructions in [23,14,6,61,35]). In such scenarios, bicategorical glueing may prove useful for establishing properties corresponding to the notions of adequacy and/or canonicity, or for proving further conservativity properties.

Cartesian closed bicategories
We begin by briefly recapitulating the basic theory of bicategories, including the definition of cartesian closure. A summary of the key definitions is in [41]; for a more extensive introduction see e.g. [5,7].

Bicategories
Bicategories axiomatise structures in which the associativity and unit laws of composition only hold up to coherent isomorphism, for instance when composition is defined by a universal property. They are rife in mathematics and theoretical computer science, appearing in the semantics of computation [29,11,49], datatype models [1,13], categorical logic [26], and categorical algebra [19,25,18].
for every f : W → X, g : X → Y and h : Y → Z, natural in each of their parameters and satisfying a triangle law and a pentagon law analogous to those for monoidal categories.
A bicategory is said to be locally small if every hom-category is small. Example 1. 1. Every 2-category is a bicategory in which the structural isomorphisms are all the identity. 2. For any category C with pullbacks there exists a bicategory of spans over C [5].
The objects are those of C, 1-cells A B are spans (A ← X → B), and 2-cells (A ← X → B) → (A ← X → B) are morphisms X → X making the expected diagram commute. Composition is defined using chosen pullbacks.
A morphism of bicategories is called a pseudofunctor (or homomorphism) [5]. It is a mapping on objects, 1-cells and 2-cells that preserves horizontal composition up to isomorphism. Vertical composition is preserved strictly.
subject to two unit laws and an associativity law. A pseudofunctor for which φ and ψ are both the identity is called strict. A pseudofunctor is called locally P if every functor F X,Y satisfies the property P .
Example 2. A monoidal category is equivalently a one-object bicategory; a monoidal functor is equivalently a pseudofunctor between one-object bicategories.
Pseudofunctors F, G : B → C are related by pseudonatural transformations. A pseudonatural transformation (k, k) : F ⇒ G consists of a family of 1-cells (k X : F X → GX) X∈B and, for every f : X → Y , an invertible 2-cell k f : k Y • F f ⇒ Gf • k X witnessing naturality. The 2-cells k f are required to be natural in f and satisfy two coherence axioms. A morphism of pseudonatural transformations is called a modification, and may be thought of as a coherent family of 2-cells.
Notation 1. For bicategories B and C we write Bicat(B, C) for the (possibly large) bicategory of pseudofunctors, pseudonatural transformations, and modifications (see e.g. [41]). If C is a 2-category, then so is Bicat(B, C). We write Cat for the 2-category of small categories and think of the 2-category Bicat(B op , Cat) as a bicategorical version of the presheaf category Set C op . As for presheaf categories, one must take care to avoid size issues. We therefore adopt the convention that when considering Bicat(B op , Cat) the bicategory B is small or locally small as appropriate. The notion of equivalence between bicategories is called biequivalence. A biequivalence B C consists of a pair of pseudofunctors F : B G : C together with equivalences F G id C and GF id B in Bicat(C, C) and Bicat(B, B) respectively. Equivalences in an arbitrary bicategory are defined by analogy with equivalences of categories, see e.g. [42, pp. 28].
Remark 1. The coherence theorem for monoidal categories [44, Chapter VII] generalises to bicategories: any bicategory is biequivalent to a 2-category [45] (see [42] for a readable summary of the argument). We are therefore justified in writing simply ∼ = for composites of a, l and r.
As a rule of thumb, a category-theoretic proposition lifts to a bicategorical proposition so long as one takes care to weaken isomorphisms to equivalences and sprinkle the prefixes 'pseudo' and 'bi' in appropriate places. For instance, bicategorical adjoints are called biadjoints and bicategorical limits are called bilimits [59]. The latter may be thought of as limits in which every cone is filled by a coherent choice of invertible 2-cell. Bilimits are preserved by representable pseudofunctors and by right biadjoints. The bicategorical Yoneda lemma [59, §1.9] says that for any pseudofunctor P : B op → Cat, evaluation at the identity determines a pseudonatural family of equivalences Bicat(B op , Cat)(YX, P ) P X. One may then deduce that the Yoneda pseudofunctor Y : B → Bicat(B op , Cat) : X → YX is locally an equivalence. Another 'bicategorified' lemma is the following, which we shall employ in Section 5.
are local equivalences, then so is F .

fp-Bicategories
It is convenient to directly consider all finite products, as this reduces the need to deal with the equivalent objects given by re-bracketing binary products. To avoid confusion with the 'cartesian bicategories' of Carboni and Walters [10,8], we call a bicategory with all finite products an fp-bicategory.
Explicitly, the universal property of = ( (1) , . . . , (n) ) is the following. For any finite family of 2-cells (α i : . . , n. One thereby obtains a functor −, . . . , = and an adjunction as in (1) with counit = ( (1) , . . . , (n) ) and unit ς g := p † (id π1•g , . . . , id πn•g ) : g ⇒ π 1 • g, . . . , π n • g . This defines a lax n-ary product structure: one merely obtains an adjunction in (1). One turns it into a bicategorical (pseudo) product by further requiring the unit and counit to be invertible. The terminal object 1 arises as 0 (). We adopt the same notation as for categorical products, for example by writing Example 4. The bicategory of spans over a lextensive category [9] has finite products; such a bicategory is biequivalent to its opposite, so these are in fact biproducts [38,Theorem 6.2]. Biproduct structure arises using the coproduct structure of the underlying category (c.f. the biproduct structure of the category of relations).
Remark 2 ( c.f. Remark 1). fp-Bicategories satisfy the following coherence theorem: every fp-bicategory is biequivalent to a 2-category with 2-categorical products [52,Theorem 4.1]. Thus, we shall sometimes simply write ∼ = in diagrams for composites of 2-cells arising from either the bicategorical or product structure. In pasting diagrams we shall omit such 2-cells completely (c.f. [ One may think of bicategorical product structure as an intensional version of the familiar categorical structure, except the usual equations (e.g. [28]) are now witnessed by natural families of invertible 2-cells. It is useful to introduce explicit names for these 2-cells.
Notation 2. In the following, and throughout, we write A • for a finite sequence A 1 , . . . , A n . Lemma 2. For any fp-bicategory (B, Π n (−)) there exist canonical choices for the following natural families of invertible 2-cells: . . , h n • g n . In particular, it follows from Lemma 2(2) that there exists a canonical natural family of invertible 2-cells Φ h•,g• : ( ..,n and (g j : X j → A j ) j=1,...,n .
Definition 6. A cartesian closed bicategory or cc-bicategory is an fp-bicategory (B, Π n (−)) equipped with the following data for every A, B ∈ B: Just as fp-pseudofunctors preserve products up to equivalence, cartesian closed pseudofunctors preserve products and exponentials up to equivalence.

A chosen object (A = B), 2. A specified 1-cell eval
with equivalences given by the 2-cells where κ is the canonical isomorphism Remark 3. As is well-known in the case of Cat (e.g. [44, IV.2]), every equivalence X Y in a bicategory gives rise to an adjoint equivalence between X and Y with the same 1-cells (see e.g. [42, pp. 28-29]). Thus, one may assume without loss of generality that all the equivalences in the preceding definition are adjoint equivalences. The same observation applies to the definition of fp-pseudofunctors.

Bicategorical glueing
The glueing construction has been discovered in various forms, with correspondingly various names: the notions of logical relation [50,57], sconing [24], Freyd covers, and glueing (e.g. [40]) are all closely related (see e.g. [47] for an overview of the connections). Originally presented set-theoretically, the technique was quickly given categorical expression [43,47] and is now a standard component of the armoury for studying type theories (e.g. [40,12]).
The glueing gl(F ) of categories C and D along a functor F : C → D may be defined as the comma category (id D ↓ F ). We define bicategorical glueing analogously. such that the following diagram commutes: Identities and horizontal composition are given by the following pasting diagrams.
Vertical composition, the identity 2-cell, and the structural isomorphisms are given component-wise. 2. The glueing bicategory gl(J) of bicategories B and C along a pseudofunctor J : B → C is the comma bicategory (id C ↓ J).
We call axiom (2) the cylinder condition due to its shape when viewed as a (3-dimensional) pasting diagram. Note that one directly obtains projection pseudofunctors B We develop some basic theory of glueing bicategories, which we shall put to use in Section 5. We follow the terminology of [15]. Following [15], one might call the glueing bicategory gl( J ) associated to a relative hom-pseudofunctor the bicategory of B-intensional Kripke relations of arity J, and view it as an intensional, bicategorical, version of the category of Kripke relations.
The relative hom-pseudofunctor preserves all bilimits that exist in its domain. For products, this may be described explicitly.
Proof. Take q × X• to be the n-ary tupling   Proof. The arrow marked is the composite of a projection and the equivalence arising from the Yoneda lemma. Its pseudo-inverse is the composite in which the equivalence arises from the Yoneda lemma and the unlabelled pseudofunctor takes a pseudonatural transformation (j, j) : YB ⇒ P to the triple with first component (j, j), third component j B (k B (Id B )) : JB → X and second component defined using k and j. Chasing the definitions through and evaluating at A, B ∈ B, one sees that when P := YB the composite (3) is equivalent to Y A,B . Since (3) is locally an equivalence, Lemma 1(1) completes the proof.

Cartesian closed structure on the glueing bicategory
It is well-known that, if C and D are cartesian closed categories, D has pullbacks, and F : C → D is cartesian, then gl(F ) is cartesian closed (e.g. [40,12]). In this section we prove a corresponding result for the glueing bicategory. We shall be guided by the categorical proof, for which see e.g. [43, Proposition 2].

Exponentials in gl(J)
As in the 1-categorical case, the definition of currying in gl(J) employs pullbacks. A pullback of the cospan (X 1 − → X 0 ← − X 2 ) in a bicategory B is a bilimit for the strict pseudofunctor X : (1 − → 0 ← − 2) → B determined by the cospan. We state the universal property in the form that will be most useful for our applications.
such that 1. for any other diagram as on the right above there exists a fill-in (u, Ξ 1 , Ξ 2 ), namely a 1-cell u : Q → P and invertible 2-cells Ξ i : 2. for any 1-cells v, w : Q → P and 2-cells We now define exponentials in the glueing bicategory. Precisely, we extend Proposition 1 to the following.
Example 7. The pullback (4) generalises the well-known definition of a logical relation of varying arity [36]. Indeed, where J := K is the relative hom-pseudofunctor for an fp-pseudofunctor (K, q × ) : B → X between cc-bicategories, A ∈ B and X, X ∈ X , the functor m X,X (A) takes a 1-cell f : KA → (X = X ) in X to the pseudonatural transformation YA × X (K(−), X) ⇒ X (K(−), X ) with components λB . λ(ρ : B → A, u : KB → X) . eval X,X • f • K(ρ), u . Intuitively, therefore, the pullback enforces the usual closure condition defining a logical relation at exponential type, while also tracking the isomorphism witnessing that this condition holds (c.f. [36,3,15]). Here the bottom ∼ = denotes a composite of Φ, structural isomorphisms and Φ −1 , and the top ∼ = denotes a composite of ω c,c × C with instances of Φ, Φ −1 , and the structural isomorphisms.
The currying operation. Let R := (R, r, Q), C := (C, c, B) and C := (C , c , B ) and suppose given a 1-cell (t, α, s) : R×C → C . We construct λ(t, α, s) using the universal property (4) of the pullback. To this end, we define invertible composites U α and T α as in the following two diagrams and set L α : The unlabelled arrow is the canonical composite of nat λs,id B with φ J eval,λ(s)×B and structural isomorphisms. T α is then defined using U α : Applying the universal property of the pullback (4) to L α , one obtains a 1-cell lam(t) and a pair of invertible 2-cells Γ c,c and ∆ c,c filling the diagram We define λ(t, α, s) := lam(t), Γ c,c , λs .
The counit 2-cell. Finally we come to the counit.
For the counit ε t we take the 2-cell with first component e t defined by One checks this satisfies the required universal property in a manner analogous to the 1-categorical case (see [55] for the full details). This completes the proof of Theorem 5.

Relative full completeness
We apply the theory developed in the preceding two sections to prove the relative full completeness result. As outlined in the introduction, this corresponds to a proof of conservativity of the theory of rewriting for the higher-order equational theory of rewriting in STLC over the algebraic equational theory of rewriting in STPC. We adapt 'Lafont's argument' [39, Annexe C] from the form presented in [16], for which we require bicategorical versions of the free cartesian category F × [C] and free cartesian closed category F ×,→ [C] over a category C. In line with the strategy for the STLC (c.f. [12, pp. 173-4]), we deal with the contravariance of the pseudofunctor (− = =) by restricting to a bicategory of cc-pseudofunctors, pseudonatural equivalences (that is, pseudonatural transformations for which each component is a given equivalence), and invertible modifications. We denote this with the subscript , ∼ =.
Next, examining the definition of Y one sees that π dom • Y = ι, and so It follows that π dom • K # id F ×,→ [B] , and hence that π dom • K # is also locally an equivalence.

Now consider the composite
. By Lemma 1(2) and the preceding, ι is locally an equivalence. Finally, it is direct from the construction of F × [B] that η × is locally an equivalence; thus, so are ι • η × η = .
Acknowledgements. We thank all the anonymous reviewers for their comments: these improved the paper substantially. We are especially grateful to the reviewer who pointed out an oversight in the original formulation of Lemma 1(2), which consequently affected the argument in Theorem 7, and provided the elegant fix therein.
The second author was supported by a Royal Society University Research Fellow Enhancement Award.