The Universal Exponentiable Arrow

We show that the essentially algebraic theory of generalized algebraic theories, regarded as a category with finite limits, has a universal exponentiable arrow in the sense that any exponentiable arrow in any category with finite limits is the image of the universal exponentiable arrow by an essentially unique functor.


Introduction
An arrow in a category with finite limits is said to be exponentiable if the pullback functor along the arrow has a right adjoint. In this paper we construct a universal exponentiable arrow in the sense that any exponentiable arrow in any category with finite limits is the image of the universal exponentiable arrow by an essentially unique functor.
The universal exponentiable arrow comes from the theory of generalized algebraic theories (Cartmell 1978) which are equational theories written in the dependent type theory without any type constructors. Let G be the opposite of the category of finite generalized algebraic theories and (equivalence classes of) interpretations between them. The category G has finite limits. Our main result is that the category G has a universal exponentiable arrow (Theorem 4.1).
For an exponentiable arrow f : B → A in a category C with finite limits, the associated polynomial functor P f : C → C (Gambino and J. Kock 2013;Weber 2015) is of much interest. For an object X ∈ C, the object P f X is known to satisfy the universal property of the partial product of X over f , and conversely, if all partial products over f exist then f is exponentiable (Dyckhoff and Tholen 1987;Niefield 1982). In Section 2 we give an algebraic characterization of the polynomial functor P f . Precisely, we show that if an endofunctor P : C → C is equipped with certain natural transformations, then PX for an object X ∈ C is the partial product of X over f , and thus f is exponentiable and P must be isomorphic to the associated polynomial functor P f .
Using results in Section 2, we construct an exponentiable arrow in G in Section 3. In fact, we find an exponentiable arrow for any type theory satisfying certain mild assumptions. We view type theories as logical frameworks (Harper et al. 1993;Nordström et al. 2001), which are frameworks for defining theories, and for each type theory T , we obtain a category of T -theories and interpretations between them. Let D T be the opposite of the category of finite T -theories. The category D T always has a special arrow ∂ 0 : E 0 → U 0 , where U 0 is the theory generated by a constant type and E 0 is the theory generated by a constant type and a constant term of the type. We show that the structural rules of weakening, projection and substitution yield a polynomial functor P ∂0 : D T → D T for ∂ 0 (Proposition 3.34). Consequently, ∂ 0 is exponentiable. When T is the dependent type theory without any type constructors, we show in Section 4 that the exponentiable arrow in D T = G is, moreover, a universal exponentiable arrow.

Related Work
This work was started as part of a categorical approach to a general notion of a type theory given by the author (Uemura 2019), but it turned out that the construction of the universal exponentiable arrow is interesting in itself, so the author decided to write a separate paper. In that paper (Uemura 2019), the author explained from a semantic point of view that a type theory can be identified with a category equipped with a class of exponentiable arrows. This paper provides a syntactic justification for this definition of a type theory: exponentiable arrows naturally appear in categories of theories.
We call the category G the essentially algebraic theory of generalized algebraic theories because, by the Gabriel-Ulmer duality (Gabriel and Ulmer 1971), the category of generalized algebraic theories is equivalent to the category of "models of G", that is, functors G → Set preserving finite limits. The view of theories as categories originates from Lawvere's functorial semantics of algebraic theories (Lawvere 1963). There are several descriptions of the essentially algebraic theory of generalized algebraic theories. Cartmell (1978) showed that it is equivalent to the essentially algebraic theory of contextual categories. Isaev (2018) and Voevodsky (2014) proposed alternative essentially algebraic theories which have sorts of types, sorts of terms and operator symbols for weakening, projection and substitution. Garner (2015) constructed a monad on a presheaf category whose algebras are the generalized algebraic theories. Our contribution is to give a simple universal property of the essentially algebraic theory of generalized algebraic theories: it is the initial essentially algebraic theory with an exponentiable arrow. Fiore andMahmoud (2010, 2014) used a universal exponential object to give functorial semantics of algebraic theories in languages with variable binding. Our universal exponentiable arrow provides a form of functorial semantics of type theories. Indeed, a natural model of type theory (Awodey 2018;Fiore 2012) can be regarded as a functor from G to a presheaf category preserving finite limits and pushforwards along ∂ 0 . See (Uemura 2019) for details of this style of functorial semantics of type theories.
Polynomial functors are extensively studied in a wide range of areas of mathematics and computer science. We refer the reader to (Gambino and J. Kock 2013) for general information. Our characterization of the polynomial functor P f associated to f : B → A given in Section 2 is based on the equivalence of the exponentiability of f and the existence of a right adjoint of (− × A B) (Niefield 1982). The class of polynomial functors is known to be characterized as the class of local fibred right adjoints (A. Kock and J. Kock 2013). One application of polynomial functors to the study of dependent type theory is the semantics of inductive types (Abbott et al. 2005;Gambino and Hyland 2004;Moerdijk and Palmgren 2000). The polynomial functor associated to the universal exponentiable arrow ∂ 0 is related to the use of polynomial functors for modeling type constructors on natural models (Awodey 2018;Newstead 2018); see Remark 4.10.
Exponentiable morphisms have been studied especially in categories of spaces (Niefield 1982(Niefield , 2001. Exponentiability in categories of theories has received less attention, but some exponentiable morphisms of theories are known. For example, classifying toposes of coherent theories over a topos S are exponentiable in the (2-)category of bounded S-toposes and geometric morphisms over S (Johnstone 2002).

Exponentiable Arrows and Polynomial Functors
In this section we recall the definition of an exponentiable arrow and show that an arrow is exponentiable if and only if there exists a polynomial functor for it (Theorem 2.11).
Definition 2.1. A cartesian category is a category that has finite limits. A cartesian functor between cartesian categories is a functor that preserves finite limits. For cartesian categories C and D, we denote by Cart(C, D) the category of cartesian functors C → D and natural transformations between them.
Notation 2.2. Let C be a cartesian category. For an arrow f : B → A in C, we denote by f * : C/A → C/B the pullback functor along f and by f ! : C/B → C/A its left adjoint, that is, the postcomposition with f . For an object X ∈ C, we denote by X * : C → C/X the pullback along the arrow X → to the terminal object and by X ! : C/X → C its left adjoint.
Definition 2.4. Let f : B → A be an arrow in a cartesian category C. We say f is exponentiable if the pullback functor f * : C/A → C/B has a right adjoint. When f is exponentiable, the right adjoint of f * is called the pushforward along f and denoted by f * .
Construction 2.5. Let f : B → A be an exponentiable arrow in a cartesian category C. We define the polynomial functor P f : C → C associated to f to be the composite We characterize the associated polynomial functor P f as an endofunctor on C equipped with certain natural transformations and show that the existence of a polynomial functor for f is equivalent to the exponentiability of f . First, P f X for an object X ∈ C is equipped with an arrow π X : P f X → A, which defines a natural transformation π : P f ⇒ A. Then P f : C → C and π : for Y ∈ C/A and the counit σ X : P f X × A B → X for X ∈ C satisfying the following triangle identities.
This characterizes the polynomial functor as the partial product over f (Dyckhoff and Tholen 1987), and it is known that the existence of such an endofunctor P f : C → C with natural transformations π, η and σ is equivalent to the exponentiability of f .
Proposition 2.6 (Niefield (1982)). For an arrow f : B → A in a cartesian category C, the following are equivalent: We further decompose the unit η Y into pieces. As special components of η, we have the following arrows over A.
We define a natural transformation where p 1 : X × B → X is the first projection, and let The unit η can be recovered from κ and ι as follows. First, a component of the form η X×A : X × A → P f (X × B) for X ∈ C is determined by the equations This motivates us to characterize the polynomial functor in terms of π, κ, ι and σ. The natural transformation κ and the arrow ι should satisfy some equations. One axiomatization is as follows.
Definition 2.7. Let f : B → A be an arrow in a cartesian category C. A polynomial functor for f is an endofunctor P : C → C preserving pullbacks equipped with the following structure: • a natural transformation π X : PX → A; • a natural transformation κ X : X × A → PX over A; • an arrow ι : A → PB over A; • a natural transformation σ X : PX × A B → X satisfying the following axioms: Remark 2.8. The intuition behind Definition 2.7 will be explained in Section 3.3. Roughly, the data κ, ι and σ correspond to the structural rules of weakening, projection and substitution, respectively, of dependent type theory, and the axioms express the interaction of these rules.
Lemma 2.9. For any exponentiable arrow f : B → A in a cartesian category C, the associated polynomial functor P f : C → C is a polynomial functor for f in the sense of Definition 2.7 with π, κ, ι and σ constructed as above.
Proof. Axiom P1 follows from the naturality of η. Axioms P2 and P3 follow from the special cases of the triangle identity (2) when Y = A and when Y = X × A, respectively. By Eqs.
Lemma 2.10. Let C be a cartesian category, f : B → A an arrow in C, P : C → C an endofunctor preserving pullbacks and π X : PX ⇒ A and σ X : PX × A B → X natural transformations for X ∈ C. Then we have a bijective correspondence between the following sets: • the set of natural transformations η Y : Y → P(Y × A B) for Y ∈ C/A making (P, π) : C → C/A a right adjoint of (− × A B) with unit η and counit σ; • the set of pairs (κ, ι) consisting of a natural transformation κ X : X × A → PX over A for X ∈ C and an arrow ι : A → PB over A making (P, π, κ, ι, σ) a polynomial functor for f .
Concretely, for a natural transformation η Y : Y → P(Y × A B) for Y ∈ C/A, the corresponding pair (κ, ι) is defined by Proof. We have already seen in Lemma 2.9 that (κ, ι) defined as Eqs. (5) and (6) satisfies the axioms of a polynomial functor for f . To give an inverse construction, let (κ, ι) be a pair making (P, π, κ, ι, σ) a polynomial functor for f . Since P preserves pullbacks, we can define a natural transformation η Y : Y → P(Y × A B) for (u : Y → A) ∈ C/A by the equations We check that the triangle identities are satisfied. Equation (9) is the same as Axiom P4. For Eq. (10), it suffices to show that By the naturality of σ, the following squares commute.
From Lemma 2.10, constructing a right adjoint of (− × A B) is equivalent to constructing a polynomial functor for f . Combined with Proposition 2.6, we have the following.
Theorem 2.11. For an arrow f : B → A in a cartesian category C, the following are equivalent: 1. f is exponentiable; 2. there exists a polynomial functor for f . Moreover, if this is the case, then the associated polynomial functor P f is a polynomial functor for f in the sense of Definition 2.7, and any polynomial functor for f is isomorphic to P f .
We also note that a cartesian functor preserves pushforwards precisely when it commutes with the associated polynomial functors in the following sense.
Proposition 2.12. Let C and D be cartesian categories, f : B → A an exponentiable arrow in C and F : C → D a cartesian functor that sends f to an exponentiable arrow. Then, the canonical natural transformation

Exponentiable Arrows from Type Theories
The goal of this section is to construct an exponentiable arrow in a category of theories written in a type theory. Among other aspects of type theories, we think of a type theory as a framework for defining theories. In this sense, what we call a type theory can be called a logical framework (Harper et al. 1993;Nordström et al. 2001); see Examples 3.15 and 3.16. For each type theory, we introduce a category of finite theories in Section 3.2, and construct an exponentiable arrow in the category of finite theories in Section 3.3. Informally, a type theory is a formal system for deriving judgments, but we need a formal definition of a type theory to make the construction of the exponentiable arrow precise. A definition of a general type theory can vary according to purposes (see Bauer et al. 2020;Isaev 2018; Uemura 2019 for some approaches to general definitions of type theories), and our requirements for the definition of a type theory are as follows: • for each type theory T , one can form a category of finite theories within T ; • a type theory is a sufficiently rich structure for building an exponentiable arrow in the category of finite theories; • one can verify that a wide variety of concrete type theories, which are usually presented syntactically, are instances of the definition.
We give a definition of a type theory fulfilling these requirements in Section 3.1. We note that, for our purpose, we need not exclude bad type theories as long as they have enough structure, and there are indeed ill-behaved examples of our definition which people would not consider type theories; see Remark 3.11. We assume that the reader is familiar with the syntax of dependent type theory (Barendregt 1992;Cartmell 1978;Hofmann 1997;Nordström et al. 1990).

Type Theories
A type theory consists of a grammar for raw expressions and a set of inference rules. We regard a grammar for raw expressions as a map sending a set of symbols to a set of expressions generated by the symbols (Definition 3.2) and a set of inference rules as a map sending a set of basic judgments to a set of derivable judgments (Definition 3.7).
The substitution operator is the most important structure on sets of raw expressions for our purpose. Following Altenkirch et al. (2010), we formulate the substitution operator using the notion of a relative monad, which is almost a monad but the domain is restricted.
Definition 3.1. Let C be a category and C 0 ⊂ C is a full subcategory. A relative monad on the inclusion C 0 → C consists of the following data: • a map on objects F : C 0 → C; • for any X ∈ C 0 , a map η X : X → F X called the unit; satisfying the axioms analogous to those of a monad.
Let us fix an infinite set V of variables x, y, . . .. We write x for a finite sequence of distinct variables (x 1 , . . . , x n ). We will silently coerce a sequence x to the set {x 1 , . . . , x n }. Let V × denote the set of finite sequences of distinct variables. We further assume that, for every Definition 3.2. A theory of expressions consists of the following data: • for each pair (S, x) consisting of a family of sets S : V × → Set and a finite sequence of variables x, a set E(S, x); • a structure making the currying of E a monad on Set V × . We refer to the Kleisli extension of a map h : • for each S : V × → Set, a structure making the map E(S, −) a relative monad on the inclusion V × → Set, regarding V × as a full subcategory of Set. We refer to the unit x → E(S, x) as η S,x and the Kleisli extension of a map f : y → E(S, x) as f * : E(S, y) → E(S, x); • a natural transformation ξ : Moreover, these (relative) monads are required to satisfy the following: 1. for any map h : 3. the units of the monad E and the relative monad E(S, −) are monomorphisms; 4. the Kleisli extension h → h † preserves monomorphisms.
The monad structure on E 0 is given by extending a map h : which defines a lax morphism structure on x * 0 . As Example 3.3 illustrates, we think of E(S, x) as a set of expressions over the set of symbols S with variables x. For a map f : y → E(S, x), the Kleisli extension f * is thought of as the substitution of f , and thus we write M [f ] for f * (M ). For a map h : S 1 → E(S 2 ), the Kleisli extension h † is thought of as the extension of the assignment h to symbols to an assignment to all expressions. Axioms 1 and 2 mean that h † is identity on variables and commutes with substitution. Axioms 3 and 4 are not essential, but we assume them for notational conventions. By Axiom 3, we regard x and S(x) as subsets of E(S, x). Axiom 4 implies that if S 1 ⊂ S 2 then E(S 1 ) ⊂ E(S 2 ). For a subsequence y ⊂ x, the substitution of the restriction η| y : y ⊂ x → E(S, x) is called the weakening, and we will omit [η| y ] so that an expression M ∈ E(S, y) may be regarded as an expression in E(S, x).
Definition 3.4. Let E be a theory of expressions and S : V × → Set a family of sets. A context over S is a finite sequence of the form . , x n are distinct variables, and A i ∈ E(S, (x 1 , . . . , x i−1 )). We write x : A for such a context. A statement over (S, x) is one of the following forms

Ctx
A 1 : Type x : A over S and a statement J over (S, x).
Definition 3.5. Let E be a theory of expressions. A E-pretheory Σ consists of the following data: • a family of sets S Σ : V × → Set equipped with a well-founded relation on For an element c ∈ S Σ (x), we write ↓c for the subfamily of S Σ spanned by those elements below c; We write c : Γ ⇒ k when c ∈ S Σ (x) and τ Σ (c) = (Γ, k). In practical example, the well-founded relation on x∈V × S Σ (x) is a well-ordering, and in that case the E-pretheory is presented by a list like An element (c : Γ ⇒ k) ∈ Σ is called a symbol when k = Type or k = A, and is called an axiom when k = (A 1 = A 2 : Type) or k = (a 1 = a 2 : A). The name of an axiom is often irrelevant, so we write : Γ ⇒ k to mean that Σ has an axiom of the form c : Γ ⇒ k. For an element (c : Γ ⇒ k) ∈ Σ, we define the basic judgment (Γ(c), J (c)) as • J (c) = (c : k) when c is a symbol; • J (c) = k when c is an axiom.
Construction 3.6. Let E be a theory of expressions and Σ a E-pretheory.
Recall that we have an adjunction ( By an adjoint argument, the left adjoint (x 0 ) ! is an oplax endomorphism on the monad E with a natural transformation ζ : (x 0 ) ! E ⇒ E(x 0 ) ! , and thus (x 0 ) ! extends to an endofunctor on the Kleisli category for E: for a map h : Furthermore, ζ becomes natural with respect to morphisms in the Kleisli category: for any map h : commutes. By transpose, we have a natural transformation commutes. For a fresh symbol A 0 , we define Σ A0 to be the following Epretheory.
Definition 3.7. A type theory T consists of the following data: • a theory of expressions E T ; • for each E T -pretheory Σ, a set D T (Σ) of judgments over S. Judgments in D T (Σ) are called derivable judgments. We write Γ Σ J when (Γ; J ) ∈ D T (Σ).
Furthermore, it is required to satisfy the following conditions: (TT1) D T (Σ) is closed under the rules listed in Fig. 1 and rules for A 1 = A 2 : Type and a 1 = a 2 : A to be congruence relations; (TT2) derivable judgments are stable under hypothesizing: for any E T -pretheory Σ and for any symbol (TT3) for any E T -pretheories Σ 1 and Σ 2 , and for any map ϕ : (TT4) for any E T -pretheories Σ 1 and Σ 2 , and for any maps ϕ 1 , ϕ 2 : Example 3.8. We define a type theory T 0 as follows. E T0 is E 0 (see Example 3.3). D T0 (Σ) for a E 0 -pretheory Σ is the smallest set of judgments closed under the rules in Fig. 1. Axioms TT2 to TT4 are verified by induction on derivation. T 0 is the dependent type theory without any type constructors. Example 3.9. One can easily define type theories with various type constructors. For example, we define a type theory T Π with dependent function types (Πtypes) by extending the grammar for raw expressions of E 0 as M, N ::= · · · | x:M N | λ(x : M ).N | M N, where the variable x in the expression x.N is considered to be bound, and requiring the set of derivable judgments to be closed under the additional inference rules listed in Fig. 2. The type annotation in λ(x : A).b is often omitted, and we write A → B for x:A B when B does not contain x as a free variable. Remark 3.10. When we specify a type theory by a set of inference rules as in Examples 3.8 and 3.9, Axioms TT3 and TT4 are verified by induction on derivation. The stability under hypothesizing (Axiom TT2) is also verified by induction on derivation, provided that if is an instance of an inference rule, then is also an instance of the inference rule. This condition is satisfied both in Examples 3.8 and 3.9.
Remark 3.11. We do not exclude ill-behaved inference rules. For an extreme example, the system in which all judgments are derivable is a type theory in the sense of Definition 3.7. This is not a problem for our purpose of constructing an exponentiable arrow in a category of theories: for an ill-behaved type theory, the category of theories will just get degenerate.
Example 3.13. A T 0 -theory is essentially the same as a generalized algebraic theory (Cartmell 1978). The difference is that in Cartmell's definition the set of symbols and axioms is not equipped with a well-founded relation. However, one can define a canonical well-founded relation on symbols and axioms: c < c if c appears in the derivation tree for the well-formedness condition for c. We will also see that T -theories with the same symbols and axioms but with different well-founded relations are identified (Remark 3.19).
Example 3.14. The T 0 -theory of categories consists of the following data.
This is read as follows: • O is a type of objects; • H(x 1 , x 2 ) is type of morphisms from x 1 to x 2 when x 1 and x 2 are elements of O; • i(x) is an element of H(x, x) representing the identity on x when x is an element of O. The symbol c represents the composition operator; • c(x 1 , x 1 , x 2 , i(x 1 ), y) and y are equal when x 1 and x 2 are elements of O and y is an element of H(x 1 , x 2 ). The other equations are similar.
Type theories with Π-types are often called logical frameworks (Harper et al. 1993;Nordström et al. 2001) and useful for encoding type theories. Π-types in logical frameworks are used for representing variable binding in target type theories.
Example 3.15. The simply typed λ-calculus is encoded in the following T Πtheory. U and E(A) represent the sets of types and of terms of type A, respectively, in the simply typed λ-calculus. Fun(A, B) represents the type of functions from A to B. Notice that the λ-abstraction is then represented by the higher-order function l.
Example 3.16. Martin-Löf type theory can also be encoded in a T Π -theory. We refer the reader to (Nordström et al. 2001) for details. Like Example 3.15, we first introduce two symbols Dependent function types in Martin-Löf type theory is encoded in the same way as function types in the simply typed λ-calculus. To encode the type of natural numbers, we add the following symbols. ⇒ r(s(n), A, a 0 , a s ) = a s n(r(n, A, a 0 , a s )) One can similarly encode other inductive types.

Categories of Theories
Let T denote a type theory.
Remark 3.18. By Axiom TT3 of Definition 3.7, for an interpretation ϕ :  We have an interpretation Σ 1 → Σ 2 as follows. Note that this is a formal treatment of the fact that the set of endomorphisms at an object in a category is a monoid.
Notation 3.21. We denote by Th T the category whose objects are the Ttheories and morphisms are the equivalence classes of the interpretations.
Definition 3.22. We say a T -theory Σ is finite if the set x∈V × S Σ (x) of symbols and axioms is finite. We denote by D T the opposite of the full subcategory of Th T consisting of finite T -theories.
Proposition 3.23. The category Th T is cocomplete: coproducts are given by disjoint union; coequalizers are obtained by adjoining equational axioms.

Corollary 3.24.
Finite T -theories are closed under finite colimits. Consequently, the category D T has finite limits.
Then Σ 2 is isomorphic to the T -theory consisting of the following data: Proof. This is straightforward, but in order to verify that Σ 2 is indeed a Ttheory, we use well-founded induction on c ∈ Σ 2 . We claim that, for any c ∈ Σ 2 , if Γ ↓c J then ϕ † (Γ) ↓ ϕ(c) ϕ † (J ), and then in particular the well-formedness condition for ϕ(c) for c ∈ Σ 2 − Σ 1 is satisfied. Suppose that the claim is satisfied for any c ∈ Σ 2 below c. Then ↓ ϕ(c) is a T -theory and ϕ determines an interpretation ↓c → ↓ ϕ(c), and thus Γ ↓c J implies ϕ † (Γ) ↓ ϕ(c) ϕ † (J ).
Remark 3.26. In the following, we assume that the reader is familiar with the theory of locally presentable categories (Adámek and Rosický 1994, Chapter 1). A wide variety of type theories including T 0 are inductively defined by finitary grammar and inference rules with finitely many premises. For such a type theory T , we may assume that, for any T -theory Σ and for any c ∈ Σ, the set ↓c is finite: otherwise replace the well-founded relation on symbols and axioms by c < c defined as c appears in the derivation tree for the well-formedness condition for c (see also Example 3.13); by assumption the derivation tree is finite. This implies that every T -theory is written as a directed colimit of finite T -theories. In other words, the category Th T is locally finitely presentable, and the finitely presentable objects of Th T are the finite T -theories. In that case, we call D T the essentially algebraic theory of T -theories or the essentially algebraic theory for T because T -theories are equivalent to "models of D T ", that is, cartesian functors D T → Set. Precisely, the functor is an equivalence.

Exponentiable Arrows Associated to Type Theories
In this subsection we show that, for every type theory T , the cartesian category D T has a certain exponentiable arrow (Corollary 3.35). We fix a type theory T and call a T -theory simply a theory. We also omit the subscript T of D T .
Construction 3.27. We define U n to be the theory consisting of the following symbols A n : (x 0 : A 0 , . . . , x n−1 : A n−1 ) ⇒ Type and E n to be the theory consisting of the symbols A 0 , . . . , A n of U n and a symbol a n : (x 0 : A 0 , . . . , x n−1 : A n−1 ) ⇒ A n .
We denote by ∂ n : E n → U n and ft n : U n+1 → U n the arrows in D represented by the obvious inclusions U n → E n and U n → U n+1 respectively.
We will show that the arrow ∂ 0 : E 0 → U 0 in D is exponentiable (Corollary 3.35). Although it is possible to construct the pushforward (∂ 0 ) * directly, we use Theorem 2.11 to emphasize the connection between the exponentiability of ∂ 0 and the structural rules of weakening, projection and substitution. The idea is that the stability under hypothesizing defines an endofunctor and that the weakening, projection and substitution rules correspond to the data κ, ι and σ, respectively, of a polynomial functor.
Construction 3.28. We define a functor P : D → D as follows: • we reserve a symbol A 0 and define PΣ = Σ A0 , that is, P sends a finite theory to the finite theory which is indeed a theory by the stability under hypothesizing; • P sends an interpretation ϕ : Σ 1 → Σ 2 to the interpretation Pϕ defined to be identity on {A 0 } and (x 0 ) ! ϕ on (x 0 ) ! S Σ1 . By the commutativity of Diagram (15), we have (Pϕ) † ( x 0 M ) = x 0 ϕ † (M ) for any M ∈ E(S Σ1 , x), from which it follows that Pϕ is indeed an interpretation: for any (c : x 0 ϕ(c) : x 0 ϕ † (k) by the stability under hypothesizing, and then rewrite it along the equation The obvious inclusion U 0 → PΣ defines a natural transformation π Σ : PΣ → U 0 . Clearly P sends finite limits in D to finite limits in D/U 0 , and thus P : D → D preserves pullbacks.
Intuitively, PΣ is the theory obtained from Σ by 1. adjoining a fresh type symbol A 0 ; 2. modifying the arity x of each element c ∈ Σ to (x 0 , x) where x 0 is a variable of type A 0 .
Then elements from Σ become indexed over A 0 in PΣ, so the theory PΣ is considered the theory of families of Σ.
Example 3.29. Let Σ be the theory of categories (Example 3.14). Then PΣ is isomorphic to the following theory.
One can think of (O, H, i, c) as a family of categories indexed over A 0 , so PΣ is the theory of families of categories.
Example 3.30. We have isomorphisms We will turn the functor P : D → D into a polynomial functor for ∂ 0 . We extensively use the presentation of a pullback in D (pushout in Th) given in Proposition 3.25. For example, for an arrow ϕ : Σ → U 0 , which is an interpretation U 0 → Σ, the pullback of E 0 along ϕ in D is isomorphic to the following theory.
Construction 3.31. For a finite theory Σ, we define an arrow κ Σ : Σ × U 0 → PΣ over U 0 to be the interpretation PΣ → Σ × U 0 defined by This interpretation is well-defined because of the weakening rule. Clearly κ is natural in Σ ∈ D.
Construction 3.32. We define an arrow ι : This interpretation is well-defined because of the projection rule.
Construction 3.33. For a finite theory Σ, we define an arrow σ Σ : PΣ × U0 E 0 → Σ to be the interpretation Σ → PΣ × U0 E 0 defined by This interpretation is well-defined because of the substitution rule. Clearly σ is natural in Σ ∈ D.
Proof. It remains to check Axioms P1 to P4 of Definition 2.7. Intuitively, these axioms express the interaction of the weakening, projection and substitution operations.
• Axiom P1 expresses that the type of the projection x 0 : A 0 x 0 : A 0 is the weakening of A 0 by (x 0 : A 0 ).
• Axiom P2 expresses that the substitution of a 0 for x 0 in x 0 is a 0 : • Axiom P3 expresses that substitution in weakening is the identity: M [a 0 /x 0 ] = M for any expression M that does not contain x 0 as a free variable.
• Axiom P4 expresses that renaming of a variable is invertible: M for any expression M that does not contain x 1 as a free variable.
Axiom P3 Since M [a 0 /x 0 ] = M for any expression that does not contain x 0 as a free variable, one can see that the composite Axiom P4 Recall that PΣ × U0 E 0 is isomorphic to the theory Thus, P(PΣ × U0 E 0 ) is isomorphic to the theory where x 0 , x 1 is constructed from the adjunction (x 0 ) 2 ! (x * 0 ) 2 in the same way as x 0 . Then, (κ PΣ (id PΣ , π Σ ), ιπ Σ ) : PΣ → P(PΣ × U0 E 0 ) and Pσ Σ : and the interpretation PΣ → P(PΣ × U0 E 0 ) defined by for any expression M that does not contain x 1 as a free variable, the composite Pσ Σ • (κ PΣ (id PΣ , π Σ ), ιπ Σ ) is represented by the identity interpretation.

The Universal Exponentiable Arrow
In this section we restrict our attention to the type theory T 0 without any type constructors (Example 3.8). We can identify the T 0 -theories as the generalized algebraic theories (Example 3.13), so we write GAT for the category Th T0 . Then G := D T0 is the cartesian category such that GAT Cart(G, Set) (Remark 3.26). By Corollary 3.35 the arrow ∂ 0 : E 0 → U 0 in the category G is exponentiable, but this time we can say more: ∂ 0 is the universal exponentiable arrow in the following sense.
Theorem 4.1. For any cartesian category C and exponentiable arrow ∂ : E → U in C, there exists a unique, up to unique isomorphism, cartesian functor F : G → C such that ∂ ∼ = F ∂ 0 and F sends pushforwards along ∂ 0 to those along ∂.
This section is mostly devoted to proving Theorem 4.1. In Section 4.1, we construct a functor F : G → C satisfying the required conditions. In Section 4.2, we show the uniqueness of such a functor. We discuss variants of Theorem 4.1 in Section 4.3.
Throughout the proof of Theorem 4.1, we extensively use the following inductive presentations of finite generalized algebraic theories. By definition, a finite generalized algebraic theory Σ is a finite set of symbols and axioms with a well-founded relation. We can arrange them into a list c n : Γ n ⇒ k n such that ↓c i ⊂ {c 1 , . . . , c i−1 } for every i so that every prefix (c 1 , . . . , c i ) is again a generalized algebraic theory. Then the following inductive clauses cover all the objects of G: • G has a terminal object; • if Σ is an object of G and Γ is a context of length n, which corresponds to an arrow Σ → U n−1 , then we have an object Σ = (Σ, A : Γ ⇒ Type) fitting into the pullback in G, where we set U −1 to be the terminal object; • if Σ is an object of G and A is a type over a context of length n, which corresponds to an arrow Σ → U n , then we have an object Σ = (Σ, a : Γ ⇒ A) fitting into the pullback • if Σ is an object of G and A 1 and A 2 are types over the same context Γ, then we have an object Σ = (Σ, : Γ ⇒ A 1 = A 2 : Type) fitting into the equalizer in G; • if Σ is an object of G and a 1 and a 2 are elements of the same type A, which correspond to arrows Σ → E n , then we have an object Σ = (Σ, : Γ ⇒ a 1 = a 2 : A) fitting into the equalizer From this presentation, we get the following "induction principle".
Lemma 4.2. Let Q be a predicate on objects of G.
1. If all U n and E n satisfy Q and Q is stable under finite limits (that is, for a finite diagram Σ : I → G, if every Σ i satisfies Q then the limit lim i∈I Σ i satisfies Q), then all the objects of G satisfy Q.
2. If U 0 and E 0 satisfy Q and Q is stable under finite limits and stable under P ∂0 (that is, if Σ satisfies Q, then P ∂0 Σ satisfies Q), then all the objects of G satisfy Q.

Constructing a functor F : G → C
Let us fix a cartesian category C and an exponentiable arrow ∂ : E → U in C.
We construct a cartesian functor F : G → C that sends ∂ 0 to ∂ and pushforwards along ∂ 0 to those along ∂. The outline is as follows.
1. A cartesian functor G → C is thought of as an "internal generalized algebraic theory in C", so it would have an "externalization" C op → GAT. The externalization is easier to describe than the internal generalized algebraic theory itself, so we will first define a functor L : C op → GAT.
2. Using the equivalence GAT Cart(G, Set), the functor L corresponds to a cartesian functor L : G → [C op , Set]. We show that the functor L factors through the Yoneda embedding, that is, LΣ is representable for every Σ ∈ G. Let F : G → C be the induced functor.
3. We show that the functor F : G → C satisfies the required conditions.
In what follows, for an arrow A : X → P n ∂ U and i ≤ n, we refer to the composite X We define a functor L : C op → GAT as follows. For an object X ∈ C, we define LX to be the generalized algebraic theory consisting of the following data: • a symbol A : (x 0 : A 0 , . . . , x n−1 : A n−1 (x 0 , . . . , x n−2 )) ⇒ Type for any arrow A : X → P n ∂ U ; • a symbol a : (x 0 : A 0 , . . . , x n−1 : A n−1 (x 0 , . . . , x n−2 )) ⇒ A(x 0 , . . . , x n−1 ) for any arrow a : for any arrow c : X → P n ∂ C with C = U or C = E and any arrow • an equation for any arrow c : X → P n+1 ∂ C with C = U or C = E and any arrow a m : For an arrow u : X 1 → X 2 , the precomposition with u induces an interpretation Lu : LX 2 → LX 1 .
We have equivalences be the cartesian functor corresponding to L : C op → GAT. Concretely, one can define for Σ ∈ G.
We show the following to obtain a functor F : G → C satisfying the required conditions.
Lemma 4.4. L factors through the Yoneda embedding C → [C op , Set] up to natural isomorphism. We write F : G → C for the induced functor which is automatically cartesian as the Yoneda embedding preserves finite limits.
All of these follow from the following lemma.
Lemma 4.7. LU n : C op → Set is representable by P n ∂ U , and LE n : C op → Set is representable by P n ∂ E.
Lemmas 4.2 and 4.7 imply Lemma 4.4, because the predicate " LΣ is representable" is stable under finite limits as L preserves finite limits and C has finite limits. Lemma 4.5 is the special case of Lemma 4.7 when n = 0. For Lemma 4.6, it suffices by Proposition 2.12 to show that the canonical natural transformation F P ∂0 ⇒ P ∂ F is an isomorphism. Since F : G → C preserves finite limits and P ∂0 and P ∂ preserve finite limits as functors G → G/U 0 and C → C/U respectively, the predicate "the canonical arrow F P ∂0 Σ → P ∂ F Σ is an isomorphism" is stable under finite limits. Hence, by Lemma 4.2, it suffices to show the cases of Σ = U n and Σ = E n . But this follows from Lemma 4.7 because P ∂0 U n ∼ = U n+1 and P ∂0 E n ∼ = E n+1 (Example 3.30).
The rest of the subsection is devoted to proving Lemma 4.7. Observe that L(U n , X) = GAT(U n , LX) is the set of equivalence classes of types in LX with n variables and that L(E n , X) = GAT(E n , LX) is the set of equivalence classes of terms in LX with n variables. We have the map that sends an arrow A : X → P n ∂ U to the type x 0 : A 0 , . . . , x n−1 : A n−1 (x 0 , . . . , x n−2 ) A(x 0 , . . . , x n−1 ) : Type and the map I E : C(X, P n ∂ E) → L(E n , X) that sends an arrow a : X → P n ∂ E to the term x 0 : A 0 , . . . , x n−1 : A n−1 (x 0 , . . . , x n−2 ) a(x 0 , . . . , x n−1 ) : A(x 0 , . . . , x n−1 ).
We show that the maps I U and I E are bijective so that LU n and LE n are representable by P n ∂ U and P n ∂ E respectively. Inverses of I U and I E are defined by interpreting the generalized algebraic theory LX in the category with families associated to the arrow ∂ : E → U . By a standard argument in the semantics of dependent type theory (for example Hofmann 1997) • the type symbol A corresponding to an arrow A : X → P 0 ∂ U ∼ = U is interpreted as A itself; • the type symbol A corresponding to an arrow A : X → P n+1 ∂ U is interpreted as the arrow [[A]] : [[A n ]] * E → U corresponding to A via (iterated use of) the adjunction ∂ * ∂ * ; • the term symbol a corresponding to an arrow a : X → P 0 ∂ E ∼ = E is interpreted as a itself; • the term symbol a corresponding to an arrow a : X → P • for the symbol c corresponding to an arrow X → P n ∂ C, • for the weakening Γ, x : A, ∆ J of Γ, ∆ J , • for the projection Γ, x : A x : A, • for the substitution Γ, ∆[a/x] J [a/x] of Γ a : A, where m and n are the lengths of Γ and (Γ, ∆) respectively. Equation (18) is immediate from the definition. Equation (19) follows from the following correspondence via the adjunction ∂ * ∂ * . [ Equations (20) and (21) are similar. The assignments A → I −1 U (A) and a → I −1 E (a) define maps respectively. By Eq. (18)

Uniqueness of F : G → C
For the uniqueness of a cartesian functor F : G → C sending ∂ 0 to ∂ and pushforwards along ∂ 0 to those along ∂, let F : G → C be another cartesian functor satisfying the same conditions. We construct a natural isomorphism commutes and show that such a natural isomorphism is unique. The idea is to construct a natural isomorphism between the "externalizations" L ∼ = L : C op → GAT, and then the Yoneda Lemma implies that it determines a natural isomorphism F ∼ = F . Let L : C op → GAT be the functor corresponding to the composite of F and the Yoneda embedding C → [C op , Set] via the equivalence [C op , GAT] Cart(G, [C op , Set]). Concretely, L X for X ∈ C is given by the filtered colimit L X ∼ = colim (Σ,u)∈(X↓F ) Σ.
We have a natural transformation ϕ : L ⇒ L : C op → GAT defined as follows: • for the type symbol A corresponding to an arrow A : X → P n ∂ U ∼ = F U n , we define ϕ X (A) to be the type in L X corresponding to the inclusion U n → L X at (U n , A) ∈ (X ↓ F ); • for the term symbol a corresponding to an arrow a : X → P n ∂ E ∼ = F E n , we define ϕ X (a) to be the term in L X corresponding to the inclusion E n → L X at (E n , a) ∈ (X ↓ F ).
By Yoneda, ϕ corresponds to a natural transformation θ : F ⇒ F : G → C.
By definition, the diagrams C(X, U ) C(X, F U 0 ) GAT(U 0 , LX) GAT(U 0 , L X) commute for all objects X ∈ C, and thus the diagrams The last three rules of Fig. 2 force Diagram (24) to be a pullback. D TΠ , together with Diagram (24), is universal in the following sense.
Theorem 4.9. For any cartesian category C, exponentiable arrow ∂ : E → U and pullback square of the form there exists a unique, up to unique isomorphism, cartesian functor F : D TΠ → C such that ∂ ∼ = F ∂ 0 and F sends pushforwards along ∂ 0 to those along ∂ and Diagram (24) to Diagram (25).
Remark 4.10. In the natural model semantics of dependent type theory (Awodey 2018;Newstead 2018), Π-types are modeled by a pullback square (25) in a presheaf category. Therefore, Theorem 4.9 implies that a natural model with Πtypes can be identified with a functor from D TΠ to a presheaf category preserving finite limits and pushforwards along ∂ 0 .
Universal properties for type theories with inductive types get complicated. We only describe the simplest case.
Example 4.11. Let T 0 be the type theory with the empty type 0 which is the inductive type without constructors and with the following elimination rule. These arrows make the diagram commute. D T0 , together with Diagram (26), is universal in the following sense.
Theorem 4.12. For any cartesian category C, exponentiable arrow ∂ : E → U and arrows Z : → U and j : Z * P ∂ U → P ∂ E such that the diagram commutes, there exists a unique, up to unique isomorphism, cartesian functor F : D T0 → C such that ∂ ∼ = F ∂ 0 and F sends pushforwards along ∂ 0 to those along ∂ and Diagram (26) to Diagram (27).