A simple type system with two identity types



Similar documents
Dependent Types at Work

SOLUTIONS TO ASSIGNMENT 1 MATH 576

Section IV.1: Recursive Algorithms and Recursion Trees

A CONSTRUCTION OF THE UNIVERSAL COVER AS A FIBER BUNDLE

Verifying security protocols using theorem provers

Introduction. and set F = F ib(f) and G = F ib(g). If the total fiber T of the square is connected, then T >

FIBRATION SEQUENCES AND PULLBACK SQUARES. Contents. 2. Connectivity and fiber sequences. 3

Sets of Fibre Homotopy Classes and Twisted Order Parameter Spaces

GROUPS ACTING ON A SET

This asserts two sets are equal iff they have the same elements, that is, a set is determined by its elements.

(LMCS, p. 317) V.1. First Order Logic. This is the most powerful, most expressive logic that we will examine.

136 CHAPTER 4. INDUCTION, GRAPHS AND TREES

POLYTYPIC PROGRAMMING OR: Programming Language Theory is Helpful

Outline BST Operations Worst case Average case Balancing AVL Red-black B-trees. Binary Search Trees. Lecturer: Georgy Gimel farb

ORIENTATIONS. Contents

Graphs without proper subgraphs of minimum degree 3 and short cycles


A Note on Context Logic

= = 3 4, Now assume that P (k) is true for some fixed k 2. This means that

(2) the identity map id : S 1 S 1 to the symmetry S 1 S 1 : x x (here x is considered a complex number because the circle S 1 is {x C : x = 1}),

Scalable Automated Symbolic Analysis of Administrative Role-Based Access Control Policies by SMT solving

Tree-representation of set families and applications to combinatorial decompositions

Lemma 5.2. Let S be a set. (1) Let f and g be two permutations of S. Then the composition of f and g is a permutation of S.

Chapter 4, Arithmetic in F [x] Polynomial arithmetic and the division algorithm.

Automated Theorem Proving - summary of lecture 1

OPTIMAL SELECTION BASED ON RELATIVE RANK* (the "Secretary Problem")

Binary Multiplication

Termination Checking: Comparing Structural Recursion and Sized Types by Examples

Álvaro Pelayo 1, Michael A. Warren 2

SYNTACTIC THEORY FOR BIGRAPHS

The Basics of Graphical Models

FIBER BUNDLES AND UNIVALENCE

Parametric Domain-theoretic models of Linear Abadi & Plotkin Logic

Tree sums and maximal connected I-spaces

INCIDENCE-BETWEENNESS GEOMETRY

Metric Spaces. Chapter 1

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

On Universes in Type Theory

How To Know If A Domain Is Unique In An Octempo (Euclidean) Or Not (Ecl)

Full and Complete Binary Trees

Programming Languages Featherweight Java David Walker

The Epsilon-Delta Limit Definition:

The Greatest Common Factor; Factoring by Grouping

There is no degree invariant half-jump

Some Polynomial Theorems. John Kennedy Mathematics Department Santa Monica College 1900 Pico Blvd. Santa Monica, CA

ML for the Working Programmer

Introduction to type systems

A Propositional Dynamic Logic for CCS Programs

Probability Using Dice

Catalan Numbers. Thomas A. Dowling, Department of Mathematics, Ohio State Uni- versity.

Regular Languages and Finite Automata

MA651 Topology. Lecture 6. Separation Axioms.

How To Solve A Minimum Set Covering Problem (Mcp)

Non-deterministic Semantics and the Undecidability of Boolean BI

JUST-IN-TIME SCHEDULING WITH PERIODIC TIME SLOTS. Received December May 12, 2003; revised February 5, 2004

UNIVERSITY OF LONDON (University College London) M.Sc. DEGREE 1998 COMPUTER SCIENCE D16: FUNCTIONAL PROGRAMMING. Answer THREE Questions.

6 Commutators and the derived series. [x,y] = xyx 1 y 1.

PROBLEM SET 6: POLYNOMIALS

4. FIRST STEPS IN THE THEORY 4.1. A

COFINAL MAXIMAL CHAINS IN THE TURING DEGREES

The Union-Find Problem Kruskal s algorithm for finding an MST presented us with a problem in data-structure design. As we looked at each edge,

COMBINATORIAL PROPERTIES OF THE HIGMAN-SIMS GRAPH. 1. Introduction

Integer roots of quadratic and cubic polynomials with integer coefficients

Bindings, mobility of bindings, and the -quantifier

MODELS OF SET THEORY

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

Types, Polymorphism, and Type Reconstruction

E3: PROBABILITY AND STATISTICS lecture notes

Mathematical Induction. Lecture 10-11

Notes from Week 1: Algorithms for sequential prediction

Scan Conversion of Filled Primitives Rectangles Polygons. Many concepts are easy in continuous space - Difficult in discrete space

Datatype-generic data migrations

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

C H A P T E R Regular Expressions regular expression

FACTORING POLYNOMIALS IN THE RING OF FORMAL POWER SERIES OVER Z

INTRODUCTORY SET THEORY

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.


6.3 Conditional Probability and Independence

CHAPTER 7 GENERAL PROOF SYSTEMS

INDISTINGUISHABILITY OF ABSOLUTELY CONTINUOUS AND SINGULAR DISTRIBUTIONS

Type Theory & Functional Programming

THE SEARCH FOR NATURAL DEFINABILITY IN THE TURING DEGREES

A REMARK ON ALMOST MOORE DIGRAPHS OF DEGREE THREE. 1. Introduction and Preliminaries

Linear Algebra. A vector space (over R) is an ordered quadruple. such that V is a set; 0 V ; and the following eight axioms hold:

The countdown problem

8 Divisibility and prime numbers

Set theory as a foundation for mathematics

A characterization of trace zero symmetric nonnegative 5x5 matrices

Satisfiability Checking

A Beginner s Guide to Modern Set Theory

~ EQUIVALENT FORMS ~

Transcription:

A simple type system with two identity types Vladimir Voevodsky Started February 23, 201 Work in progress. 1 Introduction We call this system and its further extensions HTS for homotopy type system. It is an extension of the Martin-Lof type system with some additional constructs which reflect the structures which exist in the target of the canonical univalent model of the Martin-Lof system. 2 Core inference rules Structural rules for each i N Γ, x : T, Γ where l(γ) = i Γ, x : T, Γ x : T Γ, x : T Γ T d = T Γ T 1 d = T 2 Γ T 2 d = T 1 Γ T 1 d = T 2 Γ T 2 d = T 3 Γ T 1 d = T 3 5. (*) 6. (*) 7. (*) Γ o : T Γ o = d o : T Γ o d 1 = o 2 : T Γ o d 2 = o 1 : T Γ o d 1 = o 2 : T Γ o d 2 = o 3 : T Γ o d 1 = o 3 : T 1

8. 9. (*) 10. Γ o : T Γ T = d T Γ o : T Γ o = d o : T Γ T = d T Γ o = d o : T Γ T F ib Γ, x : T Dependent products Γ, x : T 1, y : T 2 Γ, y : [ ](T 1, x.t 2 ) Γ T 1 F ib Γ, x : T 1 T 2 F ib Γ [ ](T 1, x.t 2 ) F ib Γ T 1 d = T 1 Γ, x : T 1, y : T 2 Γ [ ](T 1, x.t 2 ) d = [ ](T 1, x.t 2 ) Γ, x : T 1 T 2 d = T 2 Γ [ ](T 1, x.t 2 ) d = [ ](T 1, x.t 2) 5. 6. 7. 8. Γ, x : T 1 o : T 2 Γ [λ](t 1, x.o) : [ ](T 1, x.t 2 ) Γ T 1 d = T 1 Γ, x : T 1 o : T 2 Γ [λ](t 1, x.o) d = [λ](t 1, x.o) : [ ](T 1, x.t 2 ) Γ, x : T 1 o d = o : T 2 Γ [λ](t 1, x.o) d = [λ](t 1, x.o ) : [ ](T 1, x.t 2 ) Γ f : [ ](T 1, x.t 2 ) Γ o : T 1 Γ [ev](f, o) : T 2 [o/x] 2

9. (*) Γ f d = f : [ ](T 1, x.t 2 ) Γ o : T 1 Γ [ev](f, o) d = [ev](f, o) : T 2 [o/x] 10. (*) 1 1 Γ f : [ ](T 1, x.t 2 ) Γ o = o : T 1 Γ [ev](f, o) = d [ev](f, o ) : T 2 [o/x] Γ o 1 : T 1 Γ, x : T 1 o 2 : T 2 Γ [ev]([λ](t 1, x.o 2 ), o 1 ) = d o 2 [o 1 /x] : T 2 [o 1 /x] Γ f : [ ](T 1, x.t 2 ) Γ [λ](t 1, x.[ev](f, x, T 2 [y/x])) = d f : [ ](T 1, x.t 2 ) Exact equality types 5. (*) 6. Γ o 1 : X Γ o 2 : X Γ, x : [Id](o 1, o 2 ) Γ o 1 d = o 1 : X Γ o 2 : X Γ [Id](o 1, o 2 ) d = [Id](o 1, o 2 ) Γ o 1 : X Γ o 2 d = o 2 : X Γ [Id](o 1, o 2 ) d = [Id](o 1, o 2) Γ o : X Γ [refl](o) : [Id](o, o) Γ o d = o : X Γ [refl](o) d = [refl](o ) : [Id](o, o) Γ, x : X Γ o 1 : X Γ, x : X, x : X, e : [Id](x, x ), y : P Γ o 2 : X Γ, x0 : X s0 : P [x0/x, x0/x, [refl](x0)/e] Γ eo : [Id](o 1, o 2 ) Γ [J](X, x.x.e.p, x0.s0, o 1, o 2, eo) : P 7. (*) Behavior of [J] for X d = X, P d = P, o d = o, o 1 d = o 1, o 2 d = o 2 and eo d = eo. 3

8. [J](X, x.x.e.p, x0.s0, o, o, [refl](o)) d = s0[o/x0] 9. Γ o 1 : X Γ o 2 : X Γ o : [Id](o 1, o 2 ) Γ o 1 d = o 2 : X Path equality types 5. (*) 6. Γ X F ib Γ o 1 : X Γ o 2 : X Γ [P aths](o 1, o 2 ) F ib Γ X F ib Γ o 1 = o 1 : X Γ o 2 : X Γ [P aths](o 1, o 2 ) d = [P aths](o 1, o 2 ) Γ X F ib Γ o 1 : X Γ o 2 d = o 2 : X Γ [P aths](o 1, o 2 ) d = [P aths](o 1, o 2) Γ X F ib Γ o : X Γ [idpath](o) : [P aths](o, o) Γ X F ib Γ o d = o : X Γ [idpath](o) d = [idpath](o ) : [P aths](o, o) Γ X F ib Γ o 1 : X Γ, x : X, x : X, e : [P aths](x, x ) P F ib Γ o 2 : X Γ, x0 : X s0 : P [x0/x, x0/x, [idpath](x0)/e] Γ eo : [P aths](o 1, o 2 ) Γ [J F ](X, x.x.e.p, x0.s0, o 1, o 2, eo) : P 7. (*) Behavior of [J F ] for X d = X, P d = P, o d = o, o 1 d = o 1, o 2 d = o 2 and eo d = eo. 8. [J F ](X, x.x.e.p, x0.s0, o, o, [idpath](o)) d = s0[o/x0] Universe of all types Γ Γ U F ib Γ o : U Γ, x : [El](o) 4

(?) 5. 6. 7. 8. Γ o d = o : U Γ [El](o) d = [El](o ) Γ o : U Γ o : U Γ [El](o) d = [El](o ) Γ o d = o : U Γ o 1 : U Γ, x : [El](o 1 ) o 2 : U Γ [forall](o 1, x.o 2 ) : U Γ o 1 : U Γ, x : [El](o 1 ) o 2 : U Γ [El][forall](o 1, x.o 2 ) d = [ ]([El](o 1 ), x.[el](o 2 )) Γ o : U Γ o 1 : [El](o) Γ o 2 : [El](o) Γ [id](o 1, o 2 ) : U Γ o : U Γ o 1 : [El](o) Γ o 2 : [El](o) Γ [El][id](o 1, o 2 ) d = [Id](o 1, o 2 ) Universe of fibrant types (?) Γ Γ U F F ib Γ o : U F Γ [El F ](o) F ib Γ o d = o : U F Γ [El F ](o) d = [El F ](o ) Γ o : U F Γ o : U F Γ [El F ](o) d = [El F ](o ) 5. Γ o 1 : U F Γ o d = o : U F Γ, x : [El F ](o 1 ) o 2 : U F Γ [forall F ](o 1, x.o 2 ) : U F 5

6. 7. 8. Γ o 1 : U F Γ, x : [El F ](o 1 ) o 2 : U F Γ [El F ][forall F ](o 1, x.o 2 ) d = [ ]([El F ](o 1 ), x.[el F ](o 2 )) Γ o : U F Γ o 1 : [El F ](o) Γ o 2 : [El F ](o) Γ [paths](o 1, o 2 ) : U F Γ o : U F Γ o 1 : [El F ](o) Γ o 2 : [El F ](o) Γ [El F ][paths](o 1, o 2 ) d = [P aths](o 1, o 2 ) Universe inclusion Γ Γ [j] : [ ](U F, x.u) Γ o : U F Γ [El F ](o) d = [El][ev]([j], o) Resizing rules Γ T F ib Γ p : W eq(t, [El F ](t )) Γ [rr0](t, t, p) : U F Γ T F ib Γ p : W eq(t, [El F ](t )) Γ [El F ][rr0](t, t, p) d = T Γ T F ib Γ p : Ishprop(T ) Γ [rr1](t, p) : U F Γ T F ib Γ p : Ishprop(T ) Γ [El F ][rr1](t, p) d = T The system described above is the smallest system where some interesting mathematics can be developed. One can also consider the following additional constructions: The unit type and dependent sums 6

The inference rules are the usual ones. The η-rules saying that x = d pair (pr1 x) (pr2 x) for x in a dependent sum and x = d x for x, x in the unit type are derivable. The unit type is fibrant and the dependent sum where both arguments are fibrant is fibrant. There are unit as object of U F and dependent sum operation on families of objects of U (reps. U F ) parametrized by types given by object of U (reps. U F ). The empty type and disjoint union The inference rules are the usual ones. The η-rules are derivable. The empty type is fibrant and the disjoint union of two fibrant types is fibrant. There are empty as object of U F and obvious disjoint union operation on objects of U (reps. U F ). Recursive types As far as I understand the material of the last section of the Notes on Type systems can be made precise in this type systems. Namely, there is a way to express any strictly positive inductive definition as a combination of the constructions already discussed with parametrized W-types. The later correspond to the inductive definitions of Coq of the form Inductive IC(A:Type)(a:A)(B:A->Type)(D:forall x:a, ( B x -> Type ))(q:forall x:a, forall y:b x, forall z: D x y, A):= c: forall b:b a, forall f : (forall d: D a b, IC A (q a b d) B D q), IC A a B D q. and introduced by the inference rule for the type and Γ a : A Γ, x : A, y : B, z : D q : A Γ, w : [IC](A, a, x.b, x.y.d, x.y.z.q) Γ a : A Γ, x : A, y : B, z : D q : A Γ b : B[a/x] Γ, z : D[a/x, b/y] f : ICqa Γ [c](a, a, x.b, x.y.d, x.y.z.q, b, z.f) : [IC](A, a, x.b, x.y.d, x.y.z.q) for the constructor. The inference rule for the eliminator can be more or less copied from the type of IC rect printed by Coq. Similarly one can write down the computation rule (definitional equality associated with the eliminator) from the general such rules used in Coq. The type IC is fibrant if all the arguments are fibrant i.e. if one has Γ A F ib Γ, x : A B F ib Γ, x : A, b : B D F ib There are obvious versions of IC on the level of the universes U and U F. 7

In particular, in this system the datatypes such as the types of natural numbers or binary trees can be expressed through the W-types obtaining types which have both the computation rules obtained in the strictly positive formalism as well as recursive η-rules which allow to prove definitional equality by induction. It will be very interesting to extend to this system the formalism of more general inductive definitions (such as inductive-inductive and inductive-recursive). Multiple universes The system of multiple universes connected by explicit inclusions as in the specification of TS0 is easy to add to HTS. There will be two universes for each universe - one for all types and one for fibrant types. Univalence axiom Univalence axiom can be formulated in the usual way. It should use path equalities and U F. Elementary properties of the system Lemma 1 [strars] The inference rules which are marked with (*) follow from the other inference rules. Proof: Straightforward by transforming definitional equality into exact equality, using J and transforming the exact equality back to the definitional one using the reflexion rule. Lemma 2 [uip] In any type system with exact equality [Id], [ref l], [J] satisfying inference rules given above one has: Γ e 1 : [Id](o 1, o 2 ) Γ e 2 : [Id](o 1, o 2 ) Γ e 1 d = e 2 : [Id](o 1, o 2 ) Proof: It is sufficient to apply J with P defined by which is derivable since Γ, x 1 : X, x 2 : X, e : [Id](x 1, x 2 ), ϕ : [Id](e, [refl](x 1 )) Γ, x 1 : X, x 2 : X, e : [Id](x 1, x 2 ) [refl](x 1 ) : [Id](x 1, x 2 ) is derivable using the reflection rule. Lemma 3 [funext] In any type system with the dependent products and exact equality satisfying the inference rules as above the functional extensionality holds for the exact equality. Proof: Straightforward from the rule ensuring that definitional equality propagates through λ. 8