Using Agda to Explore Path-Oriented Models of Type Theory

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

An introduction to Homotopy Type Theory

Cubical Homotopy Type Theory

Cubical sets as a classifying topos

Univalent fibrations in type theory and topology

A Model of Type Theory in Simplicial Sets

Recent Work in Homotopy Type Theory

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

Programming in homotopy type theory and erasing propositions Gabe Dijkstra

Programming and Proving with Higher Inductive Types

Unfolding FOLDS. Matthew Weaver and Dimitris Tsementzis. HoTT/UF Workshop. Sept. 9, 2017

Towards elementary -toposes

Constructing the Propositional Truncation using Non-recursive HITs

a brief introduction to (dependent) type theory

Topic 1: What is HoTT and why?

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

Cubical Computational Type Theory & RedPRL

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

ABriefOverviewofAgda A Functional Language with Dependent Types

Research Statement. Daniel R. Licata

Programming with Dependent Types Interactive programs and Coalgebras

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

Computational Higher Type Theory

Categorical models of type theory

Type Theory in Type Theory using Quotient Inductive Types

Guarded Cubical Type Theory: Path Equality for Guarded Recursion

Computational Higher-Dimensional Type Theory

Introduction to dependent types in Coq

Towards the syntax and semantics of higher dimensional type theory

Intuitionistic Type Theory

Refinements for free! 1

From natural numbers to the lambda calculus

Arithmetic universes as generalized point-free spaces

Game Semantics for Dependent Types

Lecture slides & distribution files:

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

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

Representability of Homotopy Groups in Type Theory

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

Calculating the Fundamental Group of the Circle in Homotopy Type Theory

Martin-Löf s Type Theory

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

Does Homotopy Type Theory Provide a Foundation for Mathematics?

HOL DEFINING HIGHER ORDER LOGIC LAST TIME ON HOL CONTENT. Slide 3. Slide 1. Slide 4. Slide 2 WHAT IS HIGHER ORDER LOGIC? 2 LAST TIME ON HOL 1

The Lean Theorem Prover (system description)

Mechanized metatheory revisited

Using context and model categories to define directed homotopies

A MODEL CATEGORY STRUCTURE ON THE CATEGORY OF SIMPLICIAL CATEGORIES

Constructive Homological Algebra V. Algebraic Topology background

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

Foundations and Applications of Higher-Dimensional Directed Type Theory

Equivariant Syntax and Semantics (Abstract of Invited Talk)

Provably Correct Software

Formal Semantics in Modern Type Theories: Is It Model-Theoretic, Proof-Theoretic or Both?

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

An introduction to simplicial sets

Sheaves and Stacks. November 5, Sheaves and Stacks

Automata and Formal Languages - CM0081 Introduction to Agda

in simplicial sets, or equivalently a functor

(Effectul) Game Semantics for Dependent Types

Improving Coq Propositional Reasoning Using a Lazy CNF Conversion

Introduction to Homotopy Type Theory

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

Topological space - Wikipedia, the free encyclopedia

Dependent Record Types Revisited

An Evolution of Mathematical Tools

THE DOLD-KAN CORRESPONDENCE

The Next 700 Syntactic Models of Type Theory

Meta-programming with Names and Necessity p.1

Homotopy theories of dynamical systems

Function compose, Type cut, And the Algebra of logic

Steps towards a directed homotopy hypothesis. (, 1)-categories, directed spaces and perhaps rewriting

Embedding logics in Dedukti

Lost in translation. Leonardo de Moura Microsoft Research. how easy problems become hard due to bad encodings. Vampire Workshop 2015

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

Topoi: Theory and Applications

Lecture 0: Reivew of some basic material

Appendix G: Some questions concerning the representation of theorems

Introduction to -categories

From signatures to monads in UniMath

On a few open problems of the Calculus of Inductive Constructions and on their practical consequences

An Introduction to Martin-Lof s Constructive Type Theory and a computer implementation of it. p.1/??

Bag Equivalence via a Proof-Relevant Membership Relation

Modular dependent induction in Coq, Mendler-style. Paolo Torrini

Partiality and Recursion in Interactive Theorem Provers - An Overview

Category Theory. Andrew Pitts. Module L108, Part III and MPhil. ACS 2019 Computer Science Tripos University of Cambridge L0 1

Introduction to the Calculus of Inductive Definitions

Constructive Type Theory and Interactive Theorem Proving. Peter Dybjer Chalmers Tekniska Högskola Göteborg, Sweden

Lecture 009 (November 25, 2009) Suppose that I is a small category, and let s(r Mod) I be the category of I-diagrams in simplicial modules.

Constructive Coherent Translation of Propositional Logic

1. M,M sequential composition: try tactic M; if it succeeds try tactic M. sequential composition (, )

Fully Generic Programming Over Closed Universes of Inductive- Recursive Types

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

Programming with dependent types: passing fad or useful tool?

Refinement Types as Proof Irrelevance. William Lovas with Frank Pfenning

Formal proofs and certified computation in Coq

MTT-semantics is both model-theoretic and proof-theoretic. Zhaohui Luo Royal Holloway University of London

Integration of SMT Solvers with ITPs There and Back Again

Formalizing the Halting Problem in a Constructive Type Theory

Spaces with algebraic structure

Transcription:

1/22 Using Agda to Explore Path-Oriented Models of Type Theory Andrew Pitts joint work with Ian Orton Computer Laboratory

Outline 2/22 The mathematical problem find new models of Homotopy Type Theory Why use an interactive theorem prover for this? and why Agda particularly?

HoTT 101 3/22

Martin-Löf Type Theory 4/22 is formulated in terms of judgements A is a type (A type) A and B are equal types (A = B type) a is a thing of type A (a : A) a and b are equal things of type A (a = b : A) not in first-order logic just an inductive definition using hypothetical judgements...

Martin-Löf Type Theory 4/22 is formulated in terms of hypothetical judgements, e.g. x : A, y : B(x) a(x, y) : C(x, y) x : A, y : B(x) a(x, y) = b(x, y) : C(x, y)

Martin-Löf Type Theory 4/22 is formulated in terms of hypothetical judgements, e.g. x : A, y : B(x) a(x, y) : C(x, y) x : A, y : B(x) a(x, y) = b(x, y) : C(x, y) involving dependent types. Expressive power comes via three higher-order aspects...

Higher-order features 5/22 function types A B (A B) C ((A B) C) D CS Logic Math.

Higher-order features 5/22 universes types whose elements are (codes for) types Prop : Set : Type : TYPE CS Logic Math

Higher-order features 5/22 identity types types of proofs of equality formation: x : A, y : A Id A (x, y) type introduction: x : A refl : Id A (x, x) elimination & computation: [details omitted DIY!]

Higher-order features 5/22 (intensional) identity types Id A (x, y) Id IdA (x,y)(p, q) Id IdIdA (x,y) (p,q) (P, Q) Id IdIdIdA (x,y) (p,q)(p,q) (P,Q). CS Logic Math

Equality-as-path 6/22 [Awodey-Warren, Voevodsky,... ] elements of Id A (x, y) are analogous to paths from point x to point y in a space A

Equality-as-path 6/22 [Awodey-Warren, Voevodsky,... ] elements of Id A (x, y) are analogous to paths from point x to point y in a space A elements of Id IdA (x,y)(p, q) as homotopies between paths p and q, etc. p p p q

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) Homotopy Theory path p from x to y in a space A degenerate path constantly at x

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) subst Homotopy Theory path p from x to y in a space A degenerate path constantly at x transport along paths in fibred space

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) subst Homotopy Theory path p from x to y in a space A degenerate path constantly at x transport along paths in fibred space

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) subst Homotopy Theory path p from x to y in a space A degenerate path constantly at x transport along paths in fibred space! path-contractible spaces [Voevodsky]

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) subst Homotopy Theory path p from x to y in a space A degenerate path constantly at x transport along paths in fibred space! path-contractible spaces [Voevodsky] univalent universes only properties invariant [Voevodsky] under homotopy equivalence

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) subst Homotopy Theory path p from x to y in a space A degenerate path constantly at x transport along paths in fibred space! path-contractible spaces [Voevodsky] univalent universes only properties invariant [Voevodsky] under homotopy equivalence

7/22 Type Theory p : Id A (x, y) refl : Id A (x, x) subst Homotopy Theory path p from x to y in a space A degenerate path constantly at x transport along paths in fibred space! path-contractible spaces [Voevodsky] univalent universes only properties invariant [Voevodsky] under homotopy equivalence Existing models of univalent type theory: Kan simplicial sets in classical set theory [Voevodsky] uniform-kan cubical sets in constructive set theory [Coquand, et al] We need more (and simpler) ones!

Category Theory 8/22 Use categorical algebra to organize what is needed for a model. categories of (tame) topological spaces

Category Theory 8/22 Use categorical algebra to organize what is needed for a model. categories of (tame) topological spaces Grothendieck s toposes = categories of set-valued sheaves on generalised notion of space

Category Theory 8/22 Use categorical logic to organize what is needed for a model. categories of (tame) topological spaces Grothendieck s toposes = categories of set-valued sheaves on generalised notion of space? elementary toposes = models of intuitionistic HOL Can use the language of (intuitionistic, extensional) higher-order logic / type theory to explore relevant constructions in a topos makes things much easier to understand (for non arrow-heads).

An experiment 9/22 Work in the internal language of a topos equipped with an interval I (with end-points 0, 1 : I) and consider associated path types: formation: x, y : A Path A (x, y) type introduction: f : I A path( f) : Path A ( f 0, f 1) + simplest possible subst structure, Dold fibrations

An experiment 9/22 Work in the internal language of a topos equipped with an interval I (with end-points 0, 1 : I) and consider associated path types: formation: x, y : A Path A (x, y) type introduction: f : I A path( f) : Path A ( f 0, f 1) + simplest possible subst structure, Dold fibrations What properties of I allow one to get a model of MLTT + univalence this way? (with identity types given by Path) We have been using Agda to help us explore this question.

Agda 10/22 http://wiki.portal.chalmers.se/agda At its core: inductive definitions of indexed families of data types involving dependently typed functions. User declares what are the types of data constructors and then Agda assists the user to define well-typed functions on the data using dependently-typed patterns [Coquand], by gradually replacing meta-variables ( holes ). Functional programming = theorem proving: propositions are (some) types, proofs are elements of types.

Agda 10/22 http://wiki.portal.chalmers.se/agda At its core: inductive definitions of indexed families of data types involving dependently typed functions. User declares what are the types of data constructors and then Agda assists the user to define well-typed functions on the data using dependently-typed patterns [Coquand], by gradually replacing meta-variables ( holes ). Functional programming = theorem proving: propositions are (some) types, proofs are elements of types. Simple access to these is the deal clincher for me (background: semantics of programming languages).

Agda 11/22 Just one language (very coherent, with a beautiful, flexible Haskell-style concrete syntax) No separate tactic language (other than elisp!)

Agda 11/22 Just one language (very coherent, with a beautiful, flexible Haskell-style concrete syntax) No separate tactic language (other than elisp!) No tactics (yet)

Agda 11/22 Just one language (very coherent, with a beautiful, flexible Haskell-style concrete syntax) No separate tactic language (other than elisp!) No tactics (yet) Test-bed for new ideas. Test-bed for new ideas.

Agda 11/22 Just one language (very coherent, with a beautiful, flexible Haskell-style concrete syntax) No separate tactic language (other than elisp!) No tactics (yet) Test-bed for new ideas. Test-bed for new ideas.? Can it cope with big proofs?

Agda 11/22 Just one language (very coherent, with a beautiful, flexible Haskell-style concrete syntax) No separate tactic language (other than elisp!) No tactics (yet) Test-bed for new ideas. Test-bed for new ideas.? Can it cope with big proofs? Access to unsafe features great for experimentation rather than trusted verification.

An experiment 12/22 Work in the internal language of a topos To simulate enough of this, we use unsafe features of Agda formation: x, y : A Path A (x, y) type postulates introduction: & f TrustMe : I A path( f) : Path A ( f 0, f 1) + simplest local use possible of --type-in-type subst structure, Dold fibrations REWRITE & POLARITY pragmas What properties of I allow one to get a model of MLTT to add to MLTT + univalence this way? (with identity types given by Path) either impredicative universe of h-propositions [Escardo] or Hofmann s predicative quotient types

Adding quotient types to Agda 13/22

Adding quotient types to Agda 13/22 No need to assume R is an equivalence relation. We work modulo axiom K (uniqueness of identity proofs), so do not need to postulate more than qcomp. As well as quotients with the expected universal property, this gives: propositional truncation, mere existence and disjunction function extensionality BUT programming with qelim is a pain there has to be a better way.

An experiment 14/22 Work in the internal language of a topos equipped with an interval I (with end-points 0, 1 : I) and consider associated path types: formation: x, y : A Path A (x, y) type introduction: f : I A path( f) : Path A ( f 0, f 1) + simplest possible subst structure, Dold fibrations What properties of I allow one to get a model of MLTT + univalence this way? (with identity types given by Path)

15/22 An interval theory non-trivial (0 = 1) connected ( i : I, P(i) P(i)) i, j : I, P(i) P(j) total order i, j : I, i j j i with monus i, j : I, (j i i j i) (i i = 0) (i (i j) = j) Theorem (in Agda) For any such I in a topos, Dold fibrations give a model of MLTT with Σ, Π, Id, 0, 1 +, W types,...

An interval theory non-trivial (0 = 1) connected ( i : I, P(i) P(i)) i, j : I, P(i) P(j) total order i, j : I, i j j i with monus i, j : I, (j i i j i) (i i = 0) (i (i j) = j) Theorem (in Agda) For any such I in a topos, Dold fibrations give a model of MLTT with Σ, Π, Id, 0, 1 +, W types,... Among other things, Agda helped us to calculate correctly with (higher) paths. E.g. stops one confusing x p?? y x q y? with x p? y q 15/22

16/22

An interval theory 17/22 non-trivial (0 = 1) connected ( i : I, P(i) P(i)) i, j : I, P(i) P(j) total order i, j : I, i j j i with monus i, j : I, (j i i j i) (i i = 0) (i (i j) = j) Theorem (in Agda) For any such I in a topos, Dold fibrations give a model of MLTT with Σ, Π, Id, 0, 1 +, W types,... Theorem (pencil-and-paper) There are examples of such toposes

17/22 An interval theory non-trivial (0 = 1) connected ( i : I, P(i) P(i)) i, j : I, P(i) P(j) total order i, j : I, i j j i with monus i, j : I, (j i i j i) (i i = 0) (i (i j) = j) Theorem (in Agda) For any such I in a topos, Dold fibrations give a model of MLTT with Σ, Π, Id, 0, 1 +, W types,... (univalence?) Theorem (pencil-and-paper) There are examples of such toposes (but not presheaf toposes ) :-(

18/22 4. The social exploration and curation of formalised mathematical and scientific knowledge. Q How do I find out about the (possibly obscure) bits of homotopy theory that I might need to build path-based models of type theory?

18/22 4. The social exploration and curation of formalised mathematical and scientific knowledge. Q How do I find out about the (possibly obscure) bits of homotopy theory that I might need to build path-based models of type theory? A Search nlab [Urs Schreiber].

ncatlab.org 19/22

20/22 4. The social exploration and curation of formalised mathematical and scientific knowledge. Q How do I find out about the (possibly obscure) bits of homotopy theory that I might need to build path-based models of type theory? A Search nlab [Urs Schreiber]. For things like nlab is more formalisation desirable? is more automation (ML) possible?

Wanted 21/22 Mathematics: the world s simplest model of univalent type theory. ITP: better support for quotient types (integrated with inductive types + pattern matching). Social exploration :???

22/22 Some details Ian Orton & AMP, Axioms for Modelling Cubical Type Theory in a Topos. In Proc. CSL 2016, LIPIcs 62, pp. 24:1-24:19, 2016. www.cl.cam.ac.uk/~rio22/agda/cubical-topos/root.html Ian Orton & AMP, Models of Type Theory Based on Moore Paths. In Proc. FSCD 2017, LIPIcs, to appear, 2017. Model of MLTT from an ordered-interval-with-monus: www.cl.cam.ac.uk/~amp12/agda/interval-theory/main.html