Constructive Completeness Proofs and Delimited Control Phd Thesis Defence
Total Page:16
File Type:pdf, Size:1020Kb
Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Constructive completeness proofs and delimited control PhD thesis defence Danko Ilik École Polytechnique – INRIA – Université Paris Diderot thesis directed by Hugo Herbelin Paris, October 22, 2010 Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Constructive Mathematics and Computer Science Ï The Curry-Howard correspondence: Ï proofs are programs; Ï theorems are specifications. Ï Constructive type theory and the Coq proof assistant Ï Coq is a tool for developing formal proofs: Ï of theorems in Constructive Mathematics; Ï of correctness of programs with respect to a specification. Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Completeness theorems as programs Ï A formalised Completeness theorem – a tool to switch between model theoretic and proof theory arguments inside Coq Ï Conections between Completeness and Normalisation-by-Evaluation Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Outline Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Outline Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Completeness for standard semantics Theorem (Gödel 1930) A is valid if and only if A is derivable A - derivable there is a derivation tree for A in classical 1st-order logic A - valid Tarski’s truth definition: M A B : M A and M B Í ^ Æ Í Í M A B : M A or M B Í _ Æ Í Í M A B : M A implies M B Í ! Æ Í Í M xA(x): exists t with M A(t) Í 9 Æ Í M xA(x): for any t,M A(t) Í 8 Æ Í M : false Í? Æ Theorem (Krivine 1996) Yes? – Gödel’s proof is constructive, if we allow one more model – the model that validates ? Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Is it constructive? Theorem (McCarty 1996) No? – Completeness implies Markov’s Principle (MP) Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Is it constructive? Theorem (McCarty 1996) No? – Completeness implies Markov’s Principle (MP) Theorem (Krivine 1996) Yes? – Gödel’s proof is constructive, if we allow one more model – the model that validates ? Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic What is the algorithm behind Krivine’s proof? Ï Krivine’s proof carried out in classical 2nd-order arithmetic Ï From the form of the statement, he concludes there is a proof in intuitionistic 2nd-order arithmetic Ï Formalisation in Phox (PA2) by Raffalli; algorithm extracted but “unreadable” Ï Proof unwound in (Berardi-Valentini 2004): main ingredient a constructive ultra-filter theorem Theorem (Berardi-Valentini 2004) Every filter F can be extended to a complete filter Z(F), so that F Z(F) ( F Z(F)) » ? 2 Ã!? 2 Proof. F : F 0 Æ Fn 1 : (Fn {b pbq n,Fn (Fn {b})}) Å Æ"[ [ j Æ »" [ Z : Fn Æ n N 2 Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Constructive Ultra-filter Theorem B countable Boolean algebra Filter subset of B which is inhabited, -closed and · -closed ^ b X a ,...,a X. a a b 2" Æ 9 1 n 2 1 ^ ¢¢¢ ^ n · X-complete (˙ c X ˙ X) c X, for all c B : 2 ¡! ? 2 ¡! 2 2 Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Constructive Ultra-filter Theorem B countable Boolean algebra Filter subset of B which is inhabited, -closed and · -closed ^ b X a ,...,a X. a a b 2" Æ 9 1 n 2 1 ^ ¢¢¢ ^ n · X-complete (˙ c X ˙ X) c X, for all c B : 2 ¡! ? 2 ¡! 2 2 Theorem (Berardi-Valentini 2004) Every filter F can be extended to a complete filter Z(F), so that F Z(F) ( F Z(F)) » ? 2 Ã!? 2 Proof. F : F 0 Æ Fn 1 : (Fn {b pbq n,Fn (Fn {b})}) Å Æ"[ [ j Æ »" [ Z : Fn Æ n N 2 Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic From Ultra-filter theorem to Completeness Instantiate B with the Lindenbaum Boolean algebra: a b : a b · Æ ` a b : (a b) ^ Æ ` : ): If X is a set of axioms, then a Z( X) 2 " means n. ¡ F ( X). ¡ a, 9 9 ⊆ n " ` which implies, ¡ X. ¡ a. 9 ⊆ ` Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Computational content Reflection: (a b) Z a Z b Z ) 2 ¡! 2 ¡! 2 m n max(m,n) 7! 7! Reification: (a Z b Z) (a b) Z 2 ¡! 2 ¡! ) 2 let c : (a b) in Z-complete Æ ) Z-complete is a kind of meta-level : ::E ((c Z Z) Z) c Z 2 ¡!? 2 ¡!? 2 ¡! 2 Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Conclusion Contribution: Ï detailed Henkin-style argument formalised in Type Theory; Ï generalisation to setoids of the Ultra-filter Theorem. Future work: Ï develop a proof/algorithm not parametrised by an enumeration (using delimited control); Ï finish the Coq formalisation. Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Outline Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Classical Completeness via Kripke-style Models Motivation Get a completeness theorem for computational classical calculi – reduction relation should be preserved. Follow Normalization-by-Evaluation (NBE) methodology (Berger-Schwichtenberg 1991): Theorem (Soundness/Evaluation) ¡ A w,w ¡ w A ` ¡!8 ¡! Theorem (Completeness/Reification) ( w,w ¡ w A) ¡ nf A 8 ¡! ¡! ` Corollary (NBE) The composition (Completeness Soundness) normalizes proof ± terms into ´-long ¯-normal form. Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Standard Kripke models Start with a structure (K , ,D, , ), and extend to non-atomic · ? formulas: w A Bw A and w B ^ A Bw A or w B _ A B for any w0 w, if w0 A then w0 B ! ¸ xP(x) for any w0 w and any a D(w0), w0 P(a) 8 ¸ 2 xP(x) there is a D(w) such that w P(a) 9 2 Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Kripke-style models (Call-by-value variant) Like with Kripke models, start with a structure (K , ,D, s, ), and · ? extend strong forcing ( s) to non-atomic formulas: w s A Bw A and w B ^ A Bw A or w B _ A B for any w0 w, if w0 A then w0 B ! ¸ xP(x) for any w0 w and any a D(w0), w0 P(a) 8 ¸ 2 xP(x) there is a D(w) such that w P(a) 9 2 where the non-s-annotated is (non-strong) forcing: w A : w1 w.( w2 w1.w2 sA w2 ) w1 Æ 8 ¸ |8 ¸ {z ! ?} ! ? "refutation"w1:A Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Completeness for Kripke-style models and LK¹¹˜ Theorem (Soundness) c :(¡ ¢) for any w,w ¡ and w : ¢ implies w ` Æ) ? ¡ t : A ¢ for any w,w ¡ and w : ¢ implies w A ` j Æ) ¡ e : A ¢ for any w,w ¡ and w : ¢ implies w : A j ` Æ) Theorem (Completeness) (¡,¢) A there is a term t such that ¡ t : A ¢ Æ) `cf j (¡,¢): A there is an ev. context e such that ¡ e : A ¢ Æ) j `cf Proof. Make a Universal model U from the derivation system: Ï worlds are pairs (¡,¢) Ï strong forcing is cut-free derivability of atoms: (¡,¢) X : t. ¡ t : X ¢ s Æ 9 `cf j exploding nodes are cuts: (¡,¢) : c. c :(¡ cf ¢) Ï ? Æ 9 ` Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Conclusion Ï New notion of model for classical logic Ï Not as simple as Boolean models Ï But, reduction is preserved Ï Dual notion of model that gives call-by-name normalization strategy Ï Proofs formalised in Coq Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Outline Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Completeness of Intuitionistic Logic for Kripke models Ï Kripke models are a standard semantics for intuitionistic logic Ï But, there is no (simple) constructive proof with , : _ 9 Ï classical Henkin-style proofs (Kripke 1965) Ï using Fan Theorem (Veldman 1976) Ï a constructive proof would imply MP (Kreisel 1962) Ï On the other hand, a well-typed functional program for NBE of ¸!_ (Danvy 1996) Ï using delimited-control operators shift and reset (Danvy-Filinski 1989) Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Completeness/NBE for ¸!_ What the problem is Theorem (NBE) A ("reify") : ¡ A ¡ nf A #¡ ¡! ` A ("reflect") : ¡ ne A ¡ A "¡ ` ¡! A B Proof of case _ . " Given a derivation ¡ ne A B, decide: ¡ A or ¡ B? ` _ 1 #(2 S k.k(k4)) Å Å 1 #((¸a.#(2 a))((¸a.#(2 a))4)) ! Å Å Å Å1 #(#(#8)) ! Å Å9 ! Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Shift (S ) and reset (#) delimited control operators Examples #V V ! #F[S k.p] #p{k : ¸x.#F[x]} ! Æ Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Shift (S ) and reset (#) delimited control operators Examples #V V ! #F[S k.p] #p{k : ¸x.#F[x]} ! Æ 1 #(2 S k.k(k4)) Å Å 1 #((¸a.#(2 a))((¸a.#(2 a))4)) ! Å Å Å Å1 #(#(#8)) ! Å Å9 ! Introduction Boolean completeness Classical NBE Intuitionistic NBE Delimited control in Logic Completeness/NBE for ¸!_ Solution of Danvy: use delimited control operators shift (S ) and reset (#) Theorem (NBE) A ("reify") : ¡ A ¡ nf A #¡ ¡! ` A ("reflect") : ¡ ne A ¡ A "¡ ` ¡! A B Proof of case _ .