On Synthetic Undecidability in Coq, with an Application to the Entscheidungsproblem

On Synthetic Undecidability in Coq, with an Application to the Entscheidungsproblem

On Synthetic Undecidability in Coq, with an Application to the Entscheidungsproblem Yannick Forster, Dominik Kirst, Gert Smolka CPP 2019 January 15 saarland university computer science Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 1 How to formalise decidability? Classical approach: Pick a concrete model of computation (Turing machines, µ-recursive functions, untyped λ-calculus, etc.) Invent a decision procedure for the given problem Explicitly code the algorithm in the chosen model! Synthetic approach: Work in a constructive type theory Define a decision procedure e.g. as a Boolean function Definable functions are computable, so that’s it! (Similar for other notions like enumerability and reducibility) Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 2 How to formalise undecidability? Problem of the synthetic approach: Constructive type theories like MLTT or CIC are consistent with the assumption that every problem is decidable Proving a given problem undecidable is not outright possible Possible solutions: Resort to a concrete model of computation Verify a synthetic reduction from an undecidable problem Deduce that the undecidability of the base problem implies the undecidability of the considered problem (Again similar for other notions of computability theory) Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 3 Related Work Andrej Bauer. First steps in synthetic computability theory. Electronic Notes in Theoretical Computer Science, 155:5–31, 2006. Yannick Forster, Edith Heiter, and Gert Smolka. Verification of PCP-Related Computational Reductions in Coq. In International Conference on Interactive Theorem Proving, 2018. Zohar Manna. Mathematical Theory of Computation. McGraw-Hill computer science series. McGraw-Hill, 1974. Alan M. Turing. On computable numbers, with an application to the entscheidungsproblem. Proceedings of the London mathematical society, 2(1):230–265, 1937. Emil L. Post. A variant of a recursively unsolvable problem. Bulletin of the American Mathematical Society, 52(4):264–268, 1946. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 4 Elementary Synthetic Computability Theory Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 5 Decidability and Enumerability A problem interpreted as a predicate p : X ! P on a type X is decidable if there is a function f : X ! B with 8x: p x $ f x = tt; enumerable if there is a function f : N !O(X ) with 8x: p x $ 9n: f n = pxq: Fact Let p : X ! P be a predicate, then p is decidable iff 8x: p x + :(p x) is inhabited and enumerable iff there is L : N !L(X ) s.t. 8x: p x $ 9n: x 2 L n. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 6 Data Types Computability theory is usually developed for computational domains. A type X is called enumerable if λx: > is enumerable, discrete if λxy: x = y is decidable, and data type if it is both enumerable and discrete. Fact Decidable predicates on data types are enumerable and co-enumerable. Proof. Let fX : N !O(X ) enumerate X and fp : X ! B decide p. Then f n := match fX n with pxq ) if fp x then pxq else ; j ; ) ; defines an enumerator for p. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 7 Many-One Reductions Given predicates p : X ! P and q : Y ! P we call a function f : X ! Y a (many-one) reduction from p to q if 8x: p x $ q (f x): We write p 4 q if a reduction from p to q exists. Theorem (Reduction) Let p and q be predicates on data types with p 4 q. If q is decidable/enumerable/co-enumerable, then so is p. If p is not co-enumerable, then q is not co-enumerable. Proof. If f witnesses p 4 q and g decides q, then g ◦ f decides p. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 8 Post’s Theorem and Markov’s Principle Post: Bi-enumerable predicates on data types are decidable. Not directly provable, needs extra assumption: Lemma Post holds for logically decidable predicates. Proof. By (guarded) unbounded linear search and parallel enumeration. Markov: 8f : N ! B: ::(9n: f n = tt) ! 9n: f n = tt Theorem Markov is equivalent to the logical decidability of bi-enumerable predicates on discrete types. So in particular, Markov is equivalent to Post. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 9 The Post Correspondence Problem Recap: given a stack S of cards s=t, find a derivable match. This (undecidable) problem can be expressed by an inductive predicate: s=t 2 S S . u=v s=t 2 S S . s=s S . s=t S . su=tv PCP S Fact The type S of stacks is a data type and PCP is enumerable. Proof. The former follows from closure properties and for the latter L 0 := [] L (S n) := L n ++[(S; (s; t)) j S 2 LS n; (s; t) 2 S] ++[(S; (su; tv)) j (S; (u; v)) 2 L n; (s; t) 2 S] defines a list enumerator for λSst: S . s=t. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 10 Undecidability of First-Order Logic Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 11 Syntax and Tarski Semantics Terms and formulas are defined for a fixed signature: τ : T := x j a j e j gtt τ j gff τ x; a : N '; : F := ?_ j Q j P τ1 τ2 j '!_ j 8_ x:' I I I I I Formulas are interpreted in models I = (D; η; e ; gtt; gff ; Q ; P ) given a variable environment ρ : N ! D: ρ j=I ?_ := ? I ρ j=I Q := Q I ρ j=I P τ1 τ2 := P (^ρ τ1) (^ρ τ2) ρ j=I '!_ := ρ j=I ' ! ρ j=I ρ j=I 8_ x:' := 8d : D: ρ[x := d] j=I ' A formula ' is valid if ρ j=I ' for all I and ρ. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 12 A Standard Model Strings can be encoded as terms, e.g. tt ff ff tt = gtt (gff (gff (gtt e))). The standard model B over the type L(B) of Boolean strings captures exactly the cards derivable from a fixed stack S: eB := [] QB := PCP S B B gb s := b :: s P s t := S . s=t: Lemma Let ρ : N !L(B) be an environment for the standard model B. Then ρ^s = s and ρ j=B P τ1 τ2 $ S . ρ^ τ1=ρ^ τ2. Fact Markov ! ::ρ j=B ' ! ρ j=B ' Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 13 Undecidability of Validity We express the constructors of S . s=t and PCP as formulas: '1 := [P s t j s=t 2 S ] '2 := [ 8_ xy: P x y!_ P (sx)(ty) j s=t 2 S ] '3 := 8_ x: P x x!_ Q 'S := '1!_ '2!_ '3!_ Q Theorem PCP S iff 'S is valid. Proof. Let 'S be valid, so in particular B j= 'S . Since B satisfies all of '1, '2, and '3 it follows that B j= Q and thus PCP S. Now suppose that S . s=s for some s and that some model I satisfies all of '1, '2, and '3. Then I j= P s s by '1 and '2, hence I j= Q by '3, and thus I j= 'S . Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 14 Undecidability of Minimal Provability We define a minimal natural deduction system inductively: ' 2 A ' :: A ` A ` '!_ A ` ' A II IE A ` ' A ` '!_ A ` x A ` 'a a 62 P(') [P(A) A ` 8_ x:' V(τ) = ; AI AE _ x A ` 8x:' A ` 'τ A formula ' is provable if ` '. Fact (Soundness) A ` ' implies A j= ', so provable formulas are valid. Theorem PCP S iff 'S is provable. (as before using soundness) Provability is enumerable. (by giving a list enumerator) Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 15 Undecidability of Classical Provability We extend the deduction system by a classical rule for falsity: A `C :_ :_ ' DN A `C ' Unfortunately, this rule is not sound constructively! As a remedy, we define a Gödel-Gentzen-Friedman translation 'Q of Q Q formulas ' such that A `C ' implies A ` ' . Theorem PCP S iff 'S is classically provable. Proof. If PCP S then ` 'S by the previous theorem and hence `C 'S . Conversely, Q Q let `C 'S and hence ` 'S . Then by soundness B j= 'S which implies B j= Q and PCP S as before. Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 16 Wrap-Up Y. Forster, D. Kirst, G. Smolka Synthetic Undecidability in Coq CPP 2019 – January 15 17 Coq Formalisation Structure: Elementary synthetic computability (900 loc) Metatheory of first-order logic (750 loc) Undecidability of first-order logic (550 loc) Features: Tagged inductive types and predicates representing syntax and deduction systems to avoid code duplication Convenient method to define enumerators for inductive types and predicates via cumulative lists Type class inference for automated decidability proofs www.ps.uni-saarland.de/extras/fol-undec Y. Forster, D.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    23 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us