Towards an Intuitionistic Type Theory Vincent Rahli (in collaboration with Mark Bickford, Robert L. Constable, and Liron Cohen) May 29, 2017 Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 1/33
What are we going to cover? Turning Nuprl into an Intuitionistic Type Theory § Formalized Nuprl in Coq (ITP 2014) § Verified validity of inference rules § Added Intuitionistic axioms (continuity and bar induction) § Added named exception to validate continuity (CPP 2016) § Added some sort of choice sequences to validate bar induction (LICS 2017) Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 2/33
Nuprl? Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 3/33
Nuprl in a Nutshell Similar to Coq and Agda Extensional Constructive Type Theory with partial functions Consistency proof in Coq: https://github.com/vrahli/NuprlInCoq Cloud based & virtual machines: http://www.nuprl.org Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 4/33
Extensional CTT with partial functions? Extensional p@ a : A . f p a q “ g p a q P B q Ñ f “ g P A Ñ B Constructive p A Ñ A q true because inhabited by p λ x . x q Partial functions fix p λ x . x q inhabits N Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 5/33
Nuprl Stack Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 6/33
Nuprl Types— Martin-Löf’s extensional type theory Equality : a “ b P T Dependent product : a : A Ñ B r a s Dependent sum : a : A ˆ B r a s Universe : U i Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 7/33
Nuprl Types— Less “conventional types” Partial : A Domain : Base Disjoint union : A ` B Simulation : t 1 ď t 2 Intersection : X a : A . B r a s ( Void “ 0 ď 1 and Unit “ 0 ď 0) Bisimulation : t 1 „ t 2 Union : Y a : A . B r a s Image : Img p A , f q Subset : t a : A | B r a su PER : per p R q Quotient : T {{ E Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 8/33
Nuprl Types— Image type (Nogin & Kopylov) Subset: t a : A | B r a su fi Img p a : A ˆ B r a s , π 1 q Union: Y a : A . B r a s fi Img p a : A ˆ B r a s , π 2 q Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 9/33
Nuprl Types— PER type (inspired by Allen) Top “ per p λ _ , _ . 0 ď 0 q halts p t q “ ‹ ď p let x : “ t in ‹q A [ B “ X x : Base . X y : halts p x q . isaxiom p x , A , B q T {{ E “ per p λ x , y . p x P T q [ p y P T q [ p E x y qq Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 10/33
Nuprl Types— Squashing Proof erasure (1): t Unit | T u Ó T per p λ x .λ y . ‹ ď x [ ‹ ď y [ T q Img p T , λ _ . ‹q Proof irrelevance: å T T {{ True per p λ x .λ y . x P T [ y P T q Proof erasure (2): Û T Top {{ T per p λ _ .λ _ . T q Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 11/33
Nuprl Refinements Nuprl’s proof engine is called a refiner (TB) A generic goal directed reasoner: { a rule interpreter { a proof manager Example of a rule H $ a : A Ñ B r a s t ext λ x . b u BY [lambdaFormation] H , x : A $ B r x s t ext b u H $ A P U i t ext ‹ u Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 12/33
Nuprl PER Semantics Implemented in Coq Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 13/33
The More Inference Rules the Better! All verified Expose more of the metatheory Encode Mathematical knowledge Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 14/33
Let’s now see how far we got towards turning Nuprl into an intuitionistic type theory Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 15/33
Intuitionism § First act: Intuitionistic logic is based on our inner consciousness of time , which gives rise to the two-ity . § As opposed to Platonism, it’s about constructions in the mind and not objects that exist independently of us. There are no mathematical truths outside human thought. § A statement is true when we have an appropriate construction, and false when no construction is possible. Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 16/33
Intuitionism § Second act: New mathematical entities can be created through more or less freely proceeding sequences of mathematical entities. § Also by defining new mathematical species (types, sets) that respect equality of mathematical entities. § Gives rise to (never finished) choice sequences. Could be lawlike or lawless. Laws can be 1st order, 2nd order. . . § The continuum is captured by choice sequences of nested rational intervals. Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 17/33
Intuitionism— The creative subject Brouwer introduced procedures that depend on the mental activity of an idealized mathematician @ x . p$ x A _ � $ x A q CS 1 CS 2 @ x , y . p$ x A ñ $ x ` y A q CS 3 pD x . $ x A q ð ñ A Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 18/33
Intuitionism— A non-classical logic 1. Take p a predicate on numbers such that p p n q is decidable for all n but p@ n : N . p p n qq is not known, e.g., GC. 2. Define the choice sequence α (real number) as follows: α p 0 q α p 1 q α p 2 q α p 3 q α p 4 q α p 5 q α p 6 q α p 7 q ¨ ¨ ¨ “ 2 ´ 0 “ 2 ´ 1 “ 2 ´ 2 “ 2 ´ 3 “ 2 ´ 4 “ 2 ´ 4 “ 2 ´ 4 “ 2 ´ 4 ¨ ¨ ¨ p p 0 q p p 1 q p p 2 q p p 3 q p p 4 q � p p 5 q _ _ 3. We have α “ 0 ð ñ @ n : N . p p n q 4. Therefore, α “ 0 is not decidable Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 19/33
Intuitionism— Lawless sequences “Absolutely free choice sequences”—think of the 2nd order restriction that forbids 1st order restrictions We’ll write s for finite sequences and α for lawless sequences. We write α P s if s is an initial segment of α . ” stands for intensional equality. We write α x for the initial segment of α of length x . LS 1 @ s . D α.α P s LS 2 @ α, β. p α ” β _ � α ” β q LS 3 A p α q ñ D x . @ β. p α x “ β x ñ A p β qq Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 20/33
Intuitionism— Continuity What can we do with these sequences if they are never finished? Brouwer’s answer: one never needs the whole sequence. His continuity axiom for numbers says that functions from sequences to numbers only need initial segments @ F : N B . @ f : B . D n : N . @ g : B . f “ B n g Ñ F p f q “ N F p g q From which his uniform continuity theorem follows: Let f be of type r α, β s Ñ R , then CONT p f , α, β q “ @ ǫ ą 0 . D δ ą 0 . @ x , y : r α, β s . | x ´ y | ď δ Ñ | f p x q ´ f p y q| ď ǫ Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 21/33
Intuitionism— Continuity False (Kreisel 62, Troelstra 77, Escardó & Xu 2015): Π F : B Ñ N . Π f : B . Σ n : N . Π g : B . f “ B n g Ñ F p f q “ N F p g q Easy in Coq model (almost purely by computation) because it doesn’t have computational content: Π F : B Ñ N . Π f : B . Ó Σ n : N . Π g : B . f “ B n g Ñ F p f q “ N F p g q Harder in Coq because it has computational content: uses named exceptions + ν (following Longley’s method): Π F : B Ñ N . Π f : B . å Σ n : N . Π g : B . f “ B n g Ñ F p f q “ N F p g q Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 22/33
Intuitionism— How to compute moduli of continuity? Π F : N B . Π f : B . å Σ n : N . Π g : B . f “ B n g Ñ F p f q “ N F p g q Essence: we want to be able to test whether a finite sequence f of length n is long enough. Following Longley’s method of using effectful computations: l e t exception e in (F ( fun x = > i f x < n then f x e l s e r a i s e e ) ; true ) handle e = > f a l s e Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 23/33
Intuitionism— Bar induction To prove his uniform continuity theorem , Brouwer also used the Fan theorem . The fan theorem says that if for each branch α of a binary tree T , a property A is true about some initial segment of α , then there is a uniform bound on the depth at which A is met. The fan theorem follows from bar induction . Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 24/33
Bar Induction— The intuition Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 25/33
Bar Induction— On decidable bars H $ P p 0 , c q BY [BID] H , n : N , s : N N n $ B p n , s q _ � B p n , s q p dec q H , s : N N $ ÓD n : N . B p n , s q p bar q H , n : N , s : N N n , m : B p n , s q $ P p n , s q p imp q H , n : N , s : N N n , x : p@ m : N . P pp n ` 1 q , s ‘ n m qq $ P p n , s q p ind q Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 26/33
Bar Induction— On monotone bars H $ å P p 0 , c q BY [BIM] H , n : N , s : N N n $ @ m : N . B p n , s q ñ B p n ` 1 , s ‘ n m q p mon q H , s : N N $ åD n : N . B p n , s q p bar q H , n : N , s : N N n , m : B p n , s q $ P p n , s q p imp q H , n : N , s : N N n , x : p@ m : N . P pp n ` 1 q , s ‘ n m qq $ P p n , s q p ind q Vincent Rahli Towards an Intuitionistic Type Theory May 29, 2017 27/33
Recommend
More recommend