A NEW PROOF-ASSISTANT THAT REVISITS HOMOTOPY TYPE THEORY THE THEORETICAL FOUNDATIONS OF COQ USING NICOLAS TABAREAU

Similar documents
A NEW PROOF-ASSISTANT THAT REVISITS HOMOTOPY TYPE THEORY THE THEORETICAL FOUNDATIONS OF COQ USING NICOLAS TABAREAU

Univalent fibrations in type theory and topology

Using Agda to Explore Path-Oriented Models of Type Theory

An introduction to Homotopy Type Theory

Recent Work in Homotopy Type Theory

The three faces of homotopy type theory. Type theory and category theory. Minicourse plan. Typing judgments. Michael Shulman.

Cubical Homotopy Type Theory

Topic 1: What is HoTT and why?

Cubical sets as a classifying topos

Categorical models of type theory

Introduction to dependent types in Coq

Mathematics for Computer Scientists 2 (G52MC2)

Computational Higher-Dimensional Type Theory

Introduction to Homotopy Type Theory

Lecture slides & distribution files:

Programming and Proving with Higher Inductive Types

A Model of Type Theory in Simplicial Sets

Representability of Homotopy Groups in Type Theory

Towards elementary -toposes

Constructing the Propositional Truncation using Non-recursive HITs

Identity in Homotopy Type Theory, Part I: The Justification of Path Induction

Types Summer School Gothenburg Sweden August Dogma oftype Theory. Everything has a type

From natural numbers to the lambda calculus

Topic 3: Propositions as types

Automata and Formal Languages - CM0081 Introduction to Agda

Introduction to Coq Proof Assistant

Does Homotopy Type Theory Provide a Foundation for Mathematics?

Programming in homotopy type theory and erasing propositions Gabe Dijkstra

Univalent Foundations Project (a modified version of an NSF grant application)

EXTENSIONS OF FIRST ORDER LOGIC

An Introduction to Programming and Proving in Agda (incomplete draft)

Typed Lambda Calculus

Typed Lambda Calculus for Syntacticians

a brief introduction to (dependent) type theory

ABriefOverviewofAgda A Functional Language with Dependent Types

ACLT: Algebra, Categories, Logic in Topology - Grothendieck's generalized topological spaces (toposes)

Intuitionistic Type Theory

Proofs-Programs correspondance and Security

Lecture 3: Typed Lambda Calculus and Curry-Howard

Foundations and Applications of Higher-Dimensional Directed Type Theory

Game Semantics for Dependent Types

CIS 194: Homework 8. Due Wednesday, 8 April. Propositional Logic. Implication

Cubical Computational Type Theory & RedPRL

The Truth about Types. Bartosz Milewski

Logical Grammar: Introduction to Hyperintensional S

Mathematics for Computer Scientists 2 (G52MC2)

Computational Higher Type Theory

TOPOLOGY, DR. BLOCK, FALL 2015, NOTES, PART 3.

Universes. Universes for Data. Peter Morris. University of Nottingham. November 12, 2009

Inference rule for Induction

Embedding logics in Dedukti

Heq: a Coq library for Heterogeneous Equality

A MODEL CATEGORY STRUCTURE ON THE CATEGORY OF SIMPLICIAL CATEGORIES

CS152: Programming Languages. Lecture 11 STLC Extensions and Related Topics. Dan Grossman Spring 2011

First-Class Type Classes

Equivalences for Free!

Modal Logic: Implications for Design of a Language for Distributed Computation p.1/53

Static and User-Extensible Proof Checking. Antonis Stampoulis Zhong Shao Yale University POPL 2012

Equations: a tool for dependent pattern-matching

Introduction to the Calculus of Inductive Definitions

Logical Verification Course Notes. Femke van Raamsdonk Vrije Universiteit Amsterdam

Coq, a formal proof development environment combining logic and programming. Hugo Herbelin

Introduction to -categories

Natural Numbers. We will use natural numbers to illustrate several ideas that will apply to Haskell data types in general.

Type Theory in Type Theory using Quotient Inductive Types

Contents. Chapter 1 SPECIFYING SYNTAX 1

MLW. Henk Barendregt and Freek Wiedijk assisted by Andrew Polonsky. March 26, Radboud University Nijmegen

(Effectul) Game Semantics for Dependent Types

On Agda JAIST/AIST WS CVS/AIST Yoshiki Kinoshita, Yoriyuki Yamagata. Agenda

The Next 700 Syntactic Models of Type Theory

A BRIEF INTRODUCTION TO TYPE THEORY AND THE UNIVALENCE AXIOM

Using context and model categories to define directed homotopies

Homotopical Patch Theory

Programming Proofs and Proving Programs. Nick Benton Microsoft Research, Cambridge

Martin-Löf s Type Theory

Introductory logic and sets for Computer scientists

Programming with dependent types: passing fad or useful tool?

LOGIC AND DISCRETE MATHEMATICS

This is already grossly inconvenient in present formalisms. Why do we want to make this convenient? GENERAL GOALS

On the Logical Foundations of Staged Computation

A GRAPH FROM THE VIEWPOINT OF ALGEBRAIC TOPOLOGY

Symmetry in Type Theory

Calculus of Inductive Constructions

Function compose, Type cut, And the Algebra of logic

Research Statement. Daniel R. Licata

Spaces with algebraic structure

Synthesis of distributed mobile programs using monadic types in Coq

Lecture 8: Summary of Haskell course + Type Level Programming

An experiment with variable binding, denotational semantics, and logical relations in Coq. Adam Chlipala University of California, Berkeley

3.4 Deduction and Evaluation: Tools Conditional-Equational Logic

Lecture 0: Reivew of some basic material

Automated Reasoning. Natural Deduction in First-Order Logic

A MECHANIZATION OF TYPE THEORY. Gerard P. HUBT IRIA - LABORIA Rocquencourt FRANCE

Martin-L f's Type Theory. B. Nordstr m, K. Petersson and J. M. Smith. Contents. 5.4 The set of functions (Cartesian product of a family of sets) 24

THREE LECTURES ON BASIC TOPOLOGY. 1. Basic notions.

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning

Towards a Logical Reconstruction of Relational Database Theory

From Types to Sets in Isabelle/HOL

Calculating the Fundamental Group of the Circle in Homotopy Type Theory

Homotopy theory of higher categorical structures

Transcription:

COQHOTT A NEW PROOF-ASSISTANT THAT REVISITS THE THEORETICAL FOUNDATIONS OF COQ USING HOMOTOPY TYPE THEORY NICOLAS TABAREAU

The CoqHoTT project Design and implement a brand-new proof assistant by revisiting the theoretical foundations of Coq. Type Theory Homotopy Type Theory 2

Coq: a success but... Based on the correspondence: Formula Type Proof Program Type Theory has been developed, providing a common language for mathematics and computer science Coq Program certification CompCert Compiler Theorem Proving The 4 Colour Theorem 3

Coq: a success but... Program certification: First ever certified C-Compiler CompCert Compiler Theorem proving: High impact in computer science as well as in mathematics extraction The 4 Colour Theorem 3

... not the last word Many weaknesses cannot be solved without changing the theoretical foundations of Coq: common operators/principles cannot be constructed (eg., general fixpoints or the law of excluded middle) the notion of equality is too weak 4

... not the last word Many weaknesses cannot be solved without changing the theoretical foundations of Coq: common operators/principles cannot be constructed (eg., general fixpoints or the law of excluded middle) the notion of equality is too weak Example: bounded integers (n;bounded_n) (n;bounded_n) 4

Only one way out make use of axioms consistency issues valid axioms can be wrong altogether breaks the extraction mechanism axioms have no computational meaning limits possibility of automation can not use reflection in the proof 5

The CoqHoTT project Design and implement a brand-new proof assistant by revisiting the theoretical foundations of Coq. Type Theory Homotopy Type Theory 6

The CoqHoTT project Design and implement a brand-new proof assistant by revisiting the theoretical foundations of Coq. Type Theory Homotopy Type Theory Uniform equality (syntactic) Relativized equality (semantic) 6

Wait, what is Type Theory about? 7

The denotational semantics trinity 8

The denotational semantics trinity Curry-Howard Correspondance 9

The simply typed λ-calculus variable abstraction application weakening contraction exchange x :A x :A, x :A P :B x.p :A B P :A B Q :A, PQ :B P :B, x :A P :B, x :A, y :A P :B, z :A P [x, y z] :B, x :A, y :B, P :C, y :B, x :A, P :C 10

Intuitionistic minimal logic axiom I E weakening contraction exchange x :A x :A, x :A P :B x.p :A B P :A B Q :A, PQ :B P :B, x :A P :B, x :A, y :A P :B, z :A P [x, y z] :B, x :A, y :B, P :C, y :B, x :A, P :C 10

Intuitionistic minimal logic axiom I E weakening Curry Howard contraction exchange x :A x :A, x :A P :B x.p :A B P :A B Q :A, PQ :B P :B, x :A P :B, x :A, y :A P :B, z :A P [x, y z] :B, x :A, y :B, P :C, y :B, x :A, P :C 10

Other correspondances Cut elimination β-reduction 11

Type Theory of Coq Lifting the Curry-Howard correspondance to dependent types more complex formulas n : nat. m : nat. Id (m, n + 1) n : nat. m : nat. m = n + 1 12

Type Theory of Coq Lifting the Curry-Howard correspondance to dependent types more complex formulas ` Prod/Sigma,x: A ` B type ` / x : A.B type 13

Type Theory of Coq Lifting the Curry-Howard correspondance to dependent types more complex formulas ` Prod/Sigma,x: A ` B type ` / x : A.B type Type checking Correctness checking 13

Type Theory and Logic Types Logic A proposition a : A proof B(x) predicate b(x) : B(x) conditional proof 0, 1?, > A + B A_ B A B A^ B A! B A ) B Â (x:a) B(x) 9 x:a B(x) (x:a) B(x) 8 x:a B(x) Id A equality = 14

Type Theory and Logic Types Logic A proposition a : A proof B(x) predicate b(x) : B(x) conditional proof 0, 1?, > A + B A_ B A B A^ B A! B A ) B Â (x:a) B(x) 9 x:a B(x) (x:a) B(x) 8 x:a B(x) Id A equality = How is equality modeled? 14

Equality in Type Theory Equality is described using Martin-Löf Identity Type. refl : a:a (a = A a) Path induction: Given a family and a function there is a function such that C : x,y:a c : x:a f : (x,y:a) (x = A y)! U C(x, x, refl x ), (p:x= A y) C(x, y, p) f (x, x, refl x ) : c(x). 15

Equality in Type Theory Equality is described using Martin-Löf Identity Type. refl : a:a (a = A a) Leibniz principle of Indiscernability of Identicals Path induction: Given a family and a function there is a function such that C : x,y:a c : x:a f : (x,y:a) (x = A y)! U C(x, x, refl x ), (p:x= A y) C(x, y, p) f (x, x, refl x ) : c(x). 15

Equality in Type Theory A formulation using the type system: ` ` { } Id ` T type ` A, B : T ` Id T ABtype Id-Intro ` t : T ` refl T t : Id T tt Id-Elim (J) ` i : Id T tu,x: T,e : Id T tx`p type ` p : P {t/x, refl T t/e} ` J x e.p ip: P {u/x, i/e} 16

Type and Set Theory Types A a : A B(x) b(x) : B(x) 0, 1 A + B A B A! B Â (x:a) B(x) (x:a) B(x) Id A Sets set element family of sets family of elements, { } disjoint union set of pairs set of functions disjoint sum product { (x, x) x 2 A } view on type-theoreti 17

Problem with Identity Type The following definitions should coincides with equality. Functional Extensionality: ( f g) : x:a ( f (x) =g(x)). Univalence: (A ' B) : Â f :A!B isequiv( f ). where isequiv( f ) : Â g:b!a ( f g id B ) Â h:b!a (h f id A )! 18

Type and Homotopy Theory Types A a : A B(x) b(x) : B(x) 0, 1 A + B A B A! B Â (x:a) B(x) (x:a) B(x) Id A Homotopy space point fibration section, coproduct product space function space total space space of sections path space A I 19

Type and Homotopy Theory From an homotopy theoretic perspective, functional extensionality and univalence are perfectly valid. Problem: How to enhance Type Theory in order to reflect homotopic intuition? 20

The Big Challenge Revisit the theory behind Coq using HoTT and provide a brand-new proof assistant with: equality as a first-class citizen axiom-free extensions of the logic 21

The Big Challenge Revisit the theory behind Coq using HoTT and provide a brand-new proof assistant with: equality as a first-class citizen axiom-free extensions of the logic Apart from relaxing the drawbacks of using axioms, it will simplify a lot the development of new proofs for users. (n;bounded_n) = (n;bounded_n) 21

State of the art. Homotopy Type Theory Idea: equality homotopy + the univalence principle [Streicher, Voevodsky], which allows to derive equality principles used in mathematics: Definition univalence := 8 TU: Type, T U! T = U. 22

State of the art. Homotopy Type Theory Idea: equality homotopy + the univalence principle [Streicher, Voevodsky], which allows to derive equality principles used in mathematics: Definition univalence := 8 TU: Type, T U! T = U. Issue: Univalence is still stated as an axiom. 22

State of the art. Logic Extension in Mathematical Logic Idea: Translating formulas of rich logic into formulas of a simpler logic by using complex proof transformations logic with new principles forcing sheafification original logic 23

State of the art. Logic Extension in Mathematical Logic Idea: Translating formulas of rich logic into formulas of a simpler logic by using complex proof transformations logic with new principles forcing sheafification original logic Issue: Type Theory Mathematical Logic 23

CoqHoTT Challenges C1 Type Theory with a built-in notion of univalence C2 Implement CoqHoTT without overhead C3 Define and implement Higher Inductive Types C4 Extend Type Theory without axioms 24

CoqHoTT Challenges C1 Type Theory with a built-in notion of univalence C2 Implement CoqHoTT without overhead C3 Define and implement Higher Inductive Types C4 Extend Type Theory without axioms 24

Type Theory with Univalence type T is a space 25

Type Theory with Univalence type T is a space programs a:t are points proofs of equality p : a = b are paths 25

Type Theory with Univalence type T is a space Path operations: id p -1 q o p : a =T a : b =T a : a =T c Homotopies: left-id : id o p =a=b p programs a:t are points proofs of equality p : a = b are paths right-id : p o id =a=b p assoc : r o (q o p) = a=d (r o q) o p 25

Type Theory with Univalence and Higher Homotopies Equality Homotopy -Groupoid reflexivity constant path identity morphism symmetry inversion of paths inverse morphism transitivity concatenation of paths composition of morphisms Because of proof-relevance, we can t stop after proving symmetry and transitivity of equality: we need to know that these operations on equalities are well-behaved. 26

Type Theory with Univalence and Higher Homotopies The main novelty of this approach is to realize that homotopies between homotopies cannot be omitted, and this up to infinite dimension. 27

Type Theory with Univalence and Higher Homotopies The main novelty of this approach is to realize that homotopies between homotopies cannot be omitted, and this up to infinite dimension. Requires to consider types as -groupoids 27

A hierarchy of types HoTT classifies types based on the complexity of the equality type. Simplest (singleton) types are called contractible: iscontr(a) : Â (a:a) (x:a) (a = x). 28

A hierarchy of types HoTT classifies types based on the complexity of the equality type. Then, n-types are defined inductively: Define the predicate is-n-type : U! U for n 2 by recursion as follows: is-n-type(x) : ( iscontr(x) if n = 2, (x,y:x) is-n 0 -type(x = X y) if n = n 0 + 1. 29

A hierarchy of types This defines the following hierarchy: Level of Type (-2)-Type (-1)-Type 0-Type 1-Type Type Homotopy Type Theory unit / contactible type h-propositions h-sets h-groupoids -groupoids 30

How to reflect this new point of view on equality in type theory while keeping decidable type inference? 31

How to reflect this new point of view on equality in type theory while keeping decidable type inference? Idea: Extend type theory with new constructors, such as Kan fillers. 31

Compilation to Type Theory Our approach is to provide a meaning to HoTT by a compilation/translation to Type Theory. 32

Compilation to Type Theory Our approach is to provide a meaning to HoTT by a compilation/translation to Type Theory. Homotopy Type Theory Compilation Type Theory Type-Checker Relativized equality Uniform equality Correct a p p -1 b q Univalence Higher algebraic structure Incorrect c This compilation phase uses higher algebraic structure (e.g., -groupoids, cubical sets [Coquand et al.]) 32

Extend Type Theory without Axioms We will use the fact that: Homotopy Type Theory = Higher Mathematical Logic 33

Extend Type Theory without Axioms Using Compilation Phases We will use the fact that: Homotopy Type Theory = Higher Mathematical Logic Consider logical transformations (forcing, sheafification) of mathematical logic as compilation phases in HoTT: increase the power of the logic without axioms change the logic at compile time, according to a trade-off between efficiency and logical expressivity 33

Extend Type Theory without Axioms Using Compilation Phases We will use the fact that: Homotopy Type Theory = Higher Topos Theory [Lurie] Consider logical transformations (forcing, sheafification) of mathematical logic as compilation phases in HoTT: increase the power of the logic without axioms change the logic at compile time, according to a trade-off between efficiency and logical expressivity 33

Extend Type Theory without axioms using a compilation phase CoqHoTT + Classical Logic Added principle : Excluded Middle Sheaf Translation w/ Dense Topology Forcing Translation w/ Natural Numbers CoqHoTT + General Induction Added principles : General Inductive Types Löb Rule CoqHoTT CoqHoTT + Axiom of Choice CoqHoTT + Kripke Semantics Added principle : Dependent AC Sheaf Translation w/ Dense Topology Natural Numbers Forcing Translation w/ worlds Added principle : Modal Logic 34

Methodology. Distinct compilation phases II Compile complex type theories into simpler ones. Full CoqHoTT w/o Axiom of Choice w/o General Fixpoints inherit consistency of Coq w/o Univalence w/o Kripke Semantics w/o Classical Logic split the complexity Kernel of Coq Compiled Coq of type checking 35

Expected Impacts Our expectation is that CoqHoTT will become a popular proof assistant among: software engineers : faster and simpler developments computer scientists: integration of type isomorphisms mathematicians : new equality and logical expressivity 36

The CoqHoTT team The PI (75 % of his time) will take charge of the overall scientific direction. Matthieu Sozeau (20%) is one of the main developers of Coq and its expertise on the subject is crucial to the CoqHoTT project. Non-Permanent Staff (ERC): 3 PhD, 5 Post-Docs, 1 software engineer Non-Permanent Staff (Host Institution, Inria): 1 PhD, 1 Post-Doc, 1 support engineer and hopefully more CoqHoTT, Coq for Homotopy Type Theory 37

inside a very active community CoqHoTT, Coq for Homotopy Type Theory 37

CoqHoTT in a nutshell New proof-assistant based on HoTT Equality as a first-class citizen Axiom-free extensions of the logic Defined using distinct compilations phases A world-class group on a new generation of proof assistants 38

Bibliography [1] Homotopy Type Theory: Univalent Foundations of Mathematics. The Univalent Foundations Program. Institute for Advanced Study. [2] A Model of Type Theory in Cubical Sets. Bezem M., Coquand T., Huber S. (2013). [3] Higher Topos Theory. Lurie J. Annals of Mathematics Studies, Princeton University Press, 2009. 39