Locally cartesian closed categories

Similar documents
Adjunctions! Everywhere!

University of Oxford, Michaelis November 16, Categorical Semantics and Topos Theory Homotopy type theor

The equivalence axiom and univalent models of type theory.

Kripke Semantics for Martin-Löf s Extensional Type Theory

Higher Order Containers

Categorical Homotopy Type Theory

arxiv: v1 [math.ct] 8 Apr 2019

Two-dimensional models of type theory

Review of category theory

Parameterizations and Fixed-Point Operators on Control Categories

A brief Introduction to Category Theory

From Categories with Families to Locally Cartesian Closed Categories. Pierre Clairambault June 12, 2006

Boolean Algebra and Propositional Logic

On the Interpretation of Type Theory in Locally. Department of Computer Science, University of Edinburgh

A Model of Guarded Recursion via Generalised Equilogical Spaces

Boolean Algebra and Propositional Logic

Algebraic models of homotopy type theory

Elements of Category Theory

Categorical models of homotopy type theory

Limit Preservation from Naturality

Homotopy type theory: a new connection between logic, category theory and topology

Topos Theory. Lectures 17-20: The interpretation of logic in categories. Olivia Caramello. Topos Theory. Olivia Caramello.

Categories, Proofs and Programs

WHAT IS AN ELEMENTARY HIGHER TOPOS?

FUNCTORS AND ADJUNCTIONS. 1. Functors

Introduction to type theory and homotopy theory

1 / A bird s-eye view of type theory. 2 A bird s-eye view of homotopy theory. 3 Path spaces and identity types. 4 Homotopy type theory

Category Theory. Travis Dirle. December 12, 2017

Lecture 9: Sheaves. February 11, 2018

Algebraic Geometry

Universal Algebra for Logics

Elementary (ha-ha) Aspects of Topos Theory

Two-dimensional models of type theory

Categories and Modules

Applications of 2-categorical algebra to the theory of operads. Mark Weber

A Fibrational View of Geometric Morphisms

Representable presheaves

C2.7: CATEGORY THEORY

Coreflections in Algebraic Quantum Logic

Topos Theory. Lectures 21 and 22: Classifying toposes. Olivia Caramello. Topos Theory. Olivia Caramello. The notion of classifying topos

PART I. Abstract algebraic categories

Undecidability of Equality in the Free Locally Cartesian Closed Category

sset(x, Y ) n = sset(x [n], Y ).

A model-independent theory of -categories

Reconsidering MacLane. Peter M. Hines

A Grothendieck site is a small category C equipped with a Grothendieck topology T. A Grothendieck topology T consists of a collection of subfunctors

1 Categorical Background

Olivia Caramello. University of Insubria - Como. Deductive systems and. Grothendieck topologies. Olivia Caramello. Introduction.

Embedding locales and formal topologies into positive topologies

An Algebraic View of the Relation between Largest Common Subtrees and Smallest Common Supertrees

THE SIMPLICIAL MODEL OF UNIVALENT FOUNDATIONS

Aspects of Predicative Algebraic Set Theory I: Exact Completion (DRAFT)

Kripke Semantics for Martin-Löf s Extensional Type Theory

INTRODUCTION TO PART V: CATEGORIES OF CORRESPONDENCES

Categorical coherence in the untyped setting. Peter M. Hines

Some glances at topos theory. Francis Borceux

The Biequivalence of Locally Cartesian Closed Categories and Martin-Löf Type Theories

The synthetic theory of -categories vs the synthetic theory of -categories

Aspects of Predicative Algebraic Set Theory III: Sheaves

Waldhausen Additivity and Approximation in Quasicategorical K-Theory

Compactness in Toposes

Cronfa - Swansea University Open Access Repository

Semantics and syntax of higher inductive types

via Topos Theory Olivia Caramello University of Cambridge The unification of Mathematics via Topos Theory Olivia Caramello

Γ-Ultrametric Spaces and Separated Presheaves. Nathanael Leedom Ackerman

The space of located subsets

OMEGA-CATEGORIES AND CHAIN COMPLEXES. 1. Introduction. Homology, Homotopy and Applications, vol.6(1), 2004, pp RICHARD STEINER

PART II.1. IND-COHERENT SHEAVES ON SCHEMES

The Biequivalence of Locally Cartesian Closed Categories and Martin-Löf Type Theories

Dependent type theory

Weak ω-groupoids in Type Theory

A categorical model for a quantum circuit description language

1. Introduction and preliminaries

FINITE INVERSE CATEGORIES AS SIGNATURES

Comparing cartesian closed categories of (core) compactly generated spaces

Homotopy Type Theory

Generic Fibrational Induction

Category Theory 1 Categories and functors

The Grothendieck construction for model categories

UNIVERSAL DERIVED EQUIVALENCES OF POSETS

Logic for Computational Effects: work in progress

Semantics for algebraic operations

Axiomatics for Data Refinement in Call by Value Programming Languages

From syntax to semantics of Dependent Type Theories - Formalized

arxiv: v1 [math.ct] 23 Oct 2016

1 Categories, Functors, and Natural Transformations. Discrete categories. A category is discrete when every arrow is an identity.

A Non-Topological View of Dcpos as Convergence Spaces

SJÄLVSTÄNDIGA ARBETEN I MATEMATIK

Category theory and set theory: algebraic set theory as an example of their interaction

A unifying model of variables and names

Homotopy Theoretic Aspects of Constructive Type Theory

Polynomial functors and trees

Derived Algebraic Geometry I: Stable -Categories

Second-Order Algebraic Theories

ELEMENTARY TOPOI: SETS, GENERALIZED

arxiv: v1 [math.ct] 28 Oct 2017

Topos Theory. Jaap van Oosten Department of Mathematics Utrecht University

An Algebraic Weak Factorisation System on 01-Substitution Sets: A Constructive Proof

CATEGORY THEORY. Cats have been around for 70 years. Eilenberg + Mac Lane =. Cats are about building bridges between different parts of maths.

Homotopy theory in type theory

Transcription:

Locally cartesian closed categories Clive Newstead 80-814 Categorical Logic, Carnegie Mellon University Wednesday 1st March 2017 Abstract Cartesian closed categories provide a natural setting for the interpretation of λ-theories; however, in Martin-Löf type theory, unlike in λ-calculus, types can depend on other types. This adds a new layer of complication that cartesian closed categories are not equipped to deal with. In this talk, I will introduce the notion of a locally cartesian closed category, and discuss how to interpret ML-theories in such categories. I will mention a coherence problem in Robert Seely s original paper, and propose some possible ways around this problem. Contents 1 Review of cartesian closed categories 2 2 Locally cartesian closed categories 3 3 Syntax of Martin Löf type theory 9 4 Semantics of dependent type theory in LCCCs 11 Rules of inference for Martin-Löf type theory 15 References 16

1 Review of cartesian closed categories Recall the definition of cartesian closed categories from last week. Definition 1.1. A cartesian closed category is a category C with finite products, such that for each object X, the functor ( ) X : C C has a right adjoint ( ) X : C C. Given objects X, Y, the object Y X is called the exponential of Y by X. The components of the counit of the adjunction are called evaluation morphisms: ε X,Y : Y X X Y They satisfies the following universal property: for all objects A and morphisms f : A X Y, there is a unique morphism Λf : A Y X such that ε X,Y (Λf id X ) = f. Λf A Λf id X A X f Y X Y X X Y ε X,Y As we saw, cartesian closed categories provide a natural setting for the interpretation of the simply typed λ-calculus. Informally speaking: The terminal object 1 interprets the unit type; The product X Y interprets the product type X Y ; and The exponential object Y X interprets the function type X Y. This sets up a natural correspondence λ-theories internal logic syntactic category cartesian closed categories Whereas λ-calculus only allows for closed types that is, types cannot depend on terms of other types dependent type theory does allow types to depend on terms of other types. This dependence introduces a new layer of complication that cartesian closed categories alone cannot cope with. 2

2 Locally cartesian closed categories Lemma 2.1. Let E be a category with finite limits and let f : A B in E. The pullback functor f : E/B E/A has a left adjoint Σ f, given by postcomposition by f. Proof. We need to prove that there is a bijection (E/B)(Σ f x, y) = (E/A)(x, f y) which is natural in X x A E/A and Y y B E/B. By the universal property of pullbacks in E, a morphism h : x f y in E/A is precisely a morphism h : X f Y in E such that (f y) h = x. By the universal property of pullbacks in E, such morphisms h : X f Y are in natural bijection with morphisms k : X Y such that y k = f x: X k h x f Y f y Y y A f B But f x = Σ f x as an object of E/B, so this is precisely to say that k is a morphism Σ f x y in E/B. Hence the desired natural bijection is established. Example 2.2. We can think of the objects X x A of Set/A, for a fixed set A, as being families of sets (X a ) a A indexed by A; the equivalence is established by taking X a = x 1 (a) for each a A. With this in mind, given a function f : A B, the functor Σ f : Set/A Set/B is defined on objects by Σ f (X a ) a A = X a a f 1 (b) b B 3

For example, when f : A 1 is the unique function to the terminal set, we have Σ f (X a ) a A = X a = a f 1 ( ) which is just the disjoint union of all the sets X a. It is natural to ask when pullback functors f have right adjoints, as well as left adjoints. Such categories are called locally cartesian closed categories. Definition 2.3. A locally cartesian closed category is a category E with finite limits 1 such that, for each morphism f : A B, the pullback functor has a right adjoint Π f : E/A E/B. f : E/B E/A Example 2.4. The category Set is locally cartesian closed. Given a function f : X Y, the functor Π f : Set/X Set/Y is defined on objects A X Π f A = A x = h : f 1 (y) A x h(x) A x for all x f 1 (y) x f 1 (y) y Y x f 1 (y) Example 2.5. Despite the fact that the category Cat is cartesian closed, it is not locally cartesian closed. To see this, we can adapt Homework 2 Question 3. Let A be the category a A X a y Y f 0 2 Let B be the category g h 0 1 2 and let C = A + A be the category k l a b c d 1 Some people define locally cartesian closed categories to be categories with pullbacks for which all pullback functors have right adjoints. It is convenient for our purposes to assume the existence of a terminal object, in which case existence of all finite limits follows. 4

Let F : A B be the functor sending f to h g, and let G : C B be the functor sending k to g and l to h. (Note that the actions of F and G on objects is determined by their actions on morphisms.) Then G is a cover to see this, let D be the discrete category with three objects 0, 1, 2 and let U, V : D C be the functors defined by U(0) = a, U(1) = b, U(2) = d and V (0) = a, V (1) = c, V (2) = d It can be checked (along the same lines as HW2 Q3) that G is the coequaliser of U and V, but that the pullback F G is not a coequaliser. This means that F G does not preserve colimits, and hence does not have a right adjoint. (In fact, for the same reason, Homework 2 Question 3 demonstrates that Poset is not locally cartesian closed.) Theorem 2.6 provides a useful characterisation of locally cartesian closed categories in terms of their slices in fact, the condition given in the theorem is often taken to be the definition of locally cartesian closed. Theorem 2.6. Let E be a category with a terminal object. Then E is locally cartesian closed if and only if each slice E/A is cartesian closed. Proof. ( ) Suppose E be a locally cartesian closed category and let A be an object of E. We need to prove that E/A is cartesian closed. First note that E/A has a terminal object, namely A id A A. Given objects X x A and Y y A, the product of x and y in E/A is given by their pullback in E: X A Y π 2 π 1 X x Y y A Hence E/A has finite products. For all X x A, the product functor ( ) x : E/A E/A is thus precisely the composite Σ x x : E/A x E/X Σx E/A But Σ x x Π x, and hence Σ x x Π x x. So E/A is cartesian closed, with exponentials given by y x = Π x x y for all Y y A in E/A. 5

( ) Suppose each slice of E is cartesian closed. We need to show that E has finite limits, and that, for each f : A B in E, the pullback functor has a right adjoint Π f : E/A E/B. f : E/B E/A To see that E has finite limits, note that E has a terminal object, so it remains to prove that E has pullbacks. To this end, let X f B g C be morphisms in E. Then f and g are objects of E/A, which has products. Forming their product yields the following diagram in E: B A C q p B f C g A The universal property of products in E/A is precisely the universal property of pullbacks in E, so that this is a pullback square. Hence E has pullbacks. Fix f : A B in E. Define Π f on objects X x B of E/B as in the following pullback square over B: Π f X Π f x X f x f (f x) f B ι A f f f id B B where ι : id B f f is the exponential transpose of id f : f f in E/B. Now Π f x = ι x f (with the exponential ( ) f computed in E/B and the pullback ι computed in E); this is functorial in x, so that Π f defines a functor E/A E/B. It remains to prove that there is a bijection (E/A)(f y, x) = (E/B)(y, Π f x) 6

which is natural in Y y B E/B and X x A E/A. By the universal property of the pullback, morphisms y h Π f x in E/B correspond naturally with pairs of morphisms such that x f h 1 = ι h 2 : (Y y B) h 1 (X f (f x)f B) and (Y y B) h 2 (B id B B) Y h 1 h h 2 Π f X Π f x X f x f B ι A f Under the product exponential adjunction in E/B, the morphism h 2 corresponds with the projection f Y f y A, so that morphisms y h Π f x correspond with morphisms k : f Y X such that x k = f y: f Y k X f y x f x A id A A f f B But such a morphism k is precisely a morphism f y x in E/A. This establishes the required natural bijection, so that Π f is right adjoint to f, as required. Corollary 2.7. Let E be locally cartesian closed. Then all slices E/A of E are locally cartesian closed, and E is cartesian closed. 7

Proof. Let E be a locally cartesian closed category and let A be an object. For each X x A in E/A, we have (E/A)/x = E/X. The latter is cartesian closed by Theorem 2.6, since it is a slice of E. But then all the slices of E/A are cartesian closed, so by Theorem 2.6 again it follows that E/A is locally cartesian closed. Since E = E/1, we see immediately that E is cartesian closed. Corollary 2.8. For any small category C, the category Ĉ = SetCop of presheaves on C is locally cartesian closed. Proof. Let X be a presheaf on C. Then Ĉ/X = C X where CX is the category of elements of X. Since C X is a presheaf category, it is cartesian closed. Since all slices of Ĉ are cartesian closed, it follows from Theorem 2.6 that Ĉ is locally cartesian closed. One final technical result of note is the following theorem. Theorem 2.9. Let E be a locally cartesian closed category. If E has finite colimits, then E is a Heyting category. Proof. Note first that E has finite limits and finite colimits by assumption. Let f : A B in E. The pullback functor f : E/B E/A is a left adjoint, hence it preserves coequalisers, so that E is regular. Now since Sub(B) is a full subcategory of E/A, which is cartesian closed by Theorem 2.6, Sub(B) has finite joins again, these are preserved by pullback along f, since f is a left adjoint and so E is coherent. Finally, note that the adjunction f E/A E/B Π f restricts to an adjunction Sub(A) Sub(B), so that E is a Heyting category. 8

3 Syntax of Martin Löf type theory This section provides an informal presentation of the syntax of Martin Löf type theory with unit types, dependent sum types, dependent product types and extensional identity types, based loosely on the presentation given in Robert Seely s original paper [See84]. This syntax concerns four kinds of object: Types A, B,..., which may contain typed variables (hence the terminology dependent type ) variable-free types are called closed types; Terms a, b,..., each of which has a unique type; Contexts Γ,,..., which are lists of typed variables Γ = (x 1 : A 1, x 2 : A 2,..., x n : A n ) such that for each k < n, only the variables x i for i < k may appear in A k ; and Substitutions σ : Γ, which are lists of terms to be substituted for variables of the appropriate type. Given contexts Γ = (x 1 : A 1, x 2 : A 2,..., x n : A n ) and, a substitution σ : Γ is a list (t 1, t 2,..., t n ) of terms such that t 1 : A 1, t 2 : A 2 [t 1 /x 1 ],... t n : A n [t 1, t 2..., t n 1 /x 1, x 2..., x n 1 ] The judgements of type theory take the following forms: Context judgements: (Γ ctx), which says Γ is a valid context, and (Γ = Γ ctx), which says that Γ and Γ are equal contexts; Substitution judgements: (σ : Γ), which says that σ is a valid substitution of a context into a context Γ, and (σ = σ : Γ), which says that σ and σ are equal substitutions from to Γ; Type judgements: (Γ A type), which says that A is a valid type in context Γ, and (Γ A = A type), which says that A and A are equal types in context Γ; and Term judgements: (Γ a : A), which says that a is a valid term of type A in context Γ, and (Γ a = a : A), which says that a and a are equal terms of type A in context Γ. There are many rules that these judgements must satisfy, including properties of equality, which we shall merrily sweep under the rug. All we will refer to is an empty context () and context extension, which states that if (Γ ctx) and (Γ A type) are valid judgements, and x is a variable 9

of type A not appearing in Γ, then (Γ, x : A ctx) is a valid judgement. Moreover, there is a substitution (p A : Γ, x : A Γ) called projection, defined by simply listing the variables in Γ. Furthermore, we add four special kinds of types, whose properties are stated informally below a formal set of rules of inference can be found on page 15. Unit type. There is a type 1 which has exactly one term, in any context. Dependent sum types. Given a type A and a type B depending on a variable x : A, there is a type x:a B, whose terms are dependent pairs a, b such that a : A and b : B[a/x]. This comes equipped with projections, i.e. for each c : x:a B, we have π 1(c) : A and π 2 (c) : B[π 1 (c)/x]. Dependent product types. Given a type A and a type B depending on a variable x : A, there is a type x:a B, whose terms are dependent functions, i.e. if f : x:a B and a : A, then f(a) : B[a/x]. This comes equipped with λ-abstraction, i.e. if there is a term t : B depending on the variable x : A, then λ x:a t : x:a B. Extensional identity types. Given a type A and terms a, b : A, there is a type I A (a, b). For any a : A, there is a term r(a) : I A (a, a); and, moreover, if the type I A (a, b) has a term, then that term is unique and moreover a = b : A. The type 1 and the operators, and I are collectively called type constructors, since they build new types out of old types. Definition 3.1. A signature for Martin-Löf type theory (or an ML-signature) is a pair Σ = (Σ 1, Σ 0 ) consisting of a set Σ 1 of type function symbols S(x 1,..., x n ) and a set Σ 0 of typed term function symbols s(x 1,..., x n ), such that each variable x i is typed in such a way that (x 1 : A 1,..., x n : A n ) is a valid context. Together with the type constructors, Σ inductively generates a set Ty(Σ) of types-in-context over Σ and a set Tm(Σ) of typed terms-in-context over Σ. Again, the details are swept under the rug. See [Pal16] for a much more thorough approach to defining signatures for dependent type theory. Definition 3.2. An ML-theory T is a pair (Σ, E) consisting of an ML-signature Σ and a set E of equations of the form (Γ A = B type) or (Γ a = b : A), where A, B Ty(Σ) and a, b Tm(Σ) are such that are all valid judgements. (Γ A type), (Γ B type), (Γ a : A), (Γ b : A) Without loss of generality, we will assume that E only contains equations between types, since equations between terms can be encoded in a new signature as terms of an identity type. 10

4 Semantics of dependent type theory in LCCCs We are now ready to interpret ML-theories in locally cartesian closed categories. We follow the presentation in [Gam09]. Let E be a locally cartesian closed category and let T be an ML-theory. An interpretation of T in E is defined as follows. Contexts (Γ ctx) are interpreted as objects of E; moreover, the empty context is interpreted as the terminal object of E. Substitutions (σ : Γ) will be interpreted as morphisms σ : in E. Types (Γ A type) will be interpreted as the object A of E/ which corresponds to the morphism π A = p A in E, where p A : Γ, x : A Γ is the projection substitution: Γ, x : A π A In light of the fact that E/1 = E, we will identify the interpretations of closed types ( A type), which are objects of E/1, with their domains x : A, which are objects of E. Terms (Γ a : A) will be interpreted as points of A in E/, which are precisely sections of π A in E: a Γ, x : A π A The action of substitution on types and on terms is given by pullback: σ aσ a id, y : Aσ σ,y:aσ Γ, x : A id π Aσ π A σ 11

The unit type 1, which is a closed type, is interpreted as the the terminal object of E. This has a unique point, which is precisely the interpretation of the unique term ( : 1). Dependent sum types are interpreted as follows. Given types (Γ A type) and (Γ, x : A B type), the type (Γ x:a B) is interpreted as the object Σ πa B of E/, which as a morphism in E is precisely the composite π Γ, x : A, y : B B π Γ, x : A A Given terms (Γ a : A) and (Γ b : B[a/x]), we can interpret the term (Γ a, b : x:a B) to be the top horizontal composite of the following diagram: a,b b Γ, y : B[a/x] Γ, x : A, y : B π B[a/x] π B a Γ, x : A π x:a B π A Dependent product types are interpreted as follows. Given types (Γ A type) and (Γ, x : A B type), the type (Γ x:a B) is interpreted as the object Π πa B of E/. Given a term (Γ, x : A t : B), we can interpret (Γ λ x:a t : x:a B) as the transpose of t under the adjunction πa Π π A : Γ, x : A t Γ, x : A, y : B λ x:a t Γ, z : x:a B π B Π πa π B Γ, x : A 12

Identity types are interpreted as follows. Given a type (Γ A type) and terms (Γ a : A) and (Γ b : A), the identity type (Γ I(a, b) type) is the object of E/ which corresponds to the equaliser of a and b in E: Γ, z : I A (a, b) π IA (a,b) a Γ, x : A b The reflexivity term (Γ r(a) : I A (a, a)) is interpreted as the point of I A (a, a) in E/ arising from the universal property of equalisers: π IA (a,a) Γ, z : I A (a, a) Γ, x : A a a r(a) id Note that any term (Γ p : I A (a, b)) is interpreted as a section of π IA (a,b) in E thus, if I A (a, b) has a term, then π IA (a,b) is an equaliser which is split epic, hence an isomorphism, so that in fact a = b. This is consistent with the rule I-R1 (see page 15); then, since equalisers are monic, we obtain p = r(a), which is consistent with rule I-R2. Theorem 4.1 (Almost-soundness). Let T be an ML-theory, let E be a locally cartesian closed category, and let be an interpretation of T in E. Any equation which is provable in T is true up to isomorphism under the interpretation in E. The qualification up to isomorphism means that soundness is not strictly satisfied. section below on the coherence problem. See the Syntactic category Let T be an ML-theory. We define a category E(T) as follows: The objects of E(T) are those Γ such that (Γ ctx) is in T; A morphism Γ in E(T) is a substitution (σ : Γ) in T; The identity morphism on an object Γ is the identity substitution on the context Γ, and composition of morphisms is given by the usual composition of substitutions;... all modulo provable equality in T. Theorem 4.2 (Completeness). Let T be an ML-theory. Then E(T) is locally cartesian closed and admits a natural interpretation of T, in which only those equations provable by T are true. 13

Coherence problem An issue with the substitution-as-pullback interpretation arises because substitution in the syntax of type theory is strict, whereas pullbacks are weak that is, defined only up to isomorphism. Indeed, suppose in our ML-theory T we have substitutions Then for any type (Γ A type) we have σ : Γ and τ : Θ (Θ A(σ τ) = (Aσ)τ type) and likewise for terms. However, when we interpret T in a locally cartesian closed category E, we have A(σ τ) = (σ τ) A and (Aσ)τ = τ σ A in E/Θ. Specifically, in E, this These are isomorphic, but they are not equal indeed, the diagram in E looks like this: Θ, w : A(σ τ) π A(σ τ) Θ, z : (Aσ)τ, y : Aσ Γ, x : A π(aσ)τ π Aσ π A Θ τ σ σ τ The dashed morphism is an isomorphism in E/Θ, but not in general an identity morphism. Many solutions have been proposed to this problem, including: Modify the syntax, e.g. by allowing substitution up to isomorphism [Cur93]. Modify the semantics, e.g. comprehension categories [Jac93], categories with attributes [Car86], categories with families [Dyb96], natural models [Awo14], and many more; relationships between these approaches and locally cartesian closed categories and each other have also been studied at length, e.g. in [CD14] and [Hof94]. 14

Rules of inference for Martin-Löf type theory Γ 1 type 1-F Γ : 1 1-I Γ x : 1 Γ x = : 1 1-C Γ A type Γ, x : A B type Σ-F Γ Γ a : A Γ b : B[a/x] x:a B type Γ a, b : x:a B Σ-I Γ c : x:a B Σ-E1 Γ π 1 (c) : A Γ c : x:a B Γ π 2 (c) : B[π 1 (c)/x] Σ-E2 Γ a : A Γ b : B[a/x] Γ π 1 ( a, b ) = a : A Σ-β1 Γ a : A Γ b : B[a/x] Γ π 2 ( a, b ) = b : B[a/x] Σ-β2 Γ c : x:a B Γ c = π 1 (c), π 2 (c) : x:a B Σ-η Γ A type Γ, x : A B type Π-F Γ Γ, x : A t : B x:a B type Π-I Γ λ x:a t : Γ a : A Γ f : x:a B x:a B Π-E Γ f(a) : B[a/x] Γ, x : A t : B Γ a : A Π-β Γ (λ x:a t)(a) = t[a/x] : B[a/x] Γ f : x:a B Γ λ x:a f(x) = f : x:a B Π-η Γ A type Γ a : A Γ b : A I-F Γ I A (a, b) type Γ a : A Γ r(a) : I A (a, a) I-I Γ a : A Γ b : A Γ p : I A (a, b) Γ, x : A, y : A, z : I A (x, y) C type Γ c : C[a, a, r(a)/x, y, z] Γ σ(c; a, b, p) : C[a, b, p/x, y, z] I-E Γ a : A Γ, x : A, y : A, z : I A (x, y) C type Γ c : C[a, a, r(a)/x, y, z] Γ σ(c; a, a, r(a)) = c : C[a, a, r(a)/x, y, z] I-β Γ a : A Γ b : A Γ p : I A (a, b) Γ, x : A, y : A, z : I A (x, y) c : C I-η Γ σ(c[a, a, r(a)/x, y, z]; a, b, p) = c[a, b, p/x, y, z] : C[a, b, p/x, y, z] Γ p : I A (a, b) I-R1 Γ a = b : A Γ p : I A (a, b) Γ p = r(a) : I A (a, a) I-R2

References [Awo10] Steve Awodey. Category theory. Oxford University Press, 2010. [Awo14] Steve Awodey. Natural models of homotopy type theory, 2014. arxiv:1406.3219. [Car86] John Cartmell. Generalised algebraic theories and contextual categories. Annals of Pure and Applied Logic, 32:209 243, 1986. [CD14] Pierre Clairambault and Peter Dybjer. The biequivalence of locally cartesian closed categories and Martin-Löf type theories. Mathematical Structures in Computer Science, 24(6), Dec 2014. [Cur93] P-L Curien. Substitution up to isomorphism. Fundamenta Informaticae, 19(1-2):51 85, 1993. [Dyb96] Peter Dybjer. Internal type theory. TYPES 95, LNCS, 1158:120 134, 1996. [Gam09] Nicola Gambino. Dependent type theory: Lecture 3 (from midlands graduate school 2009, leicester uk). http://www1.maths.leeds.ac.uk/~pmtng/research/lectures/ lecture3.pdf, 2009. Accessed: 2017-02-27. [Hof94] [Jac93] Martin Hofmann. On the interpretation of type theory in locally cartesian closed categories. In International Workshop on Computer Science Logic, pages 427 441. Springer, 1994. Bart Jacobs. Comprehension categories and the semantics of type dependency. Theoretical Computer Science, 107(2):169 207, 1993. [Pal16] Erik Palmgren. Categories with families, folds and logic enriched type theory, 2016. arxiv:1605.01586. [See84] Robert A. G. Seely. Locally cartesian closed categories and type theory. In Mathematical proceedings of the Cambridge philosophical society, volume 95, pages 33 48. Cambridge Univ Press, 1984. 16