proof assistants and the rise of type theory circa 1912
play

Proof Assistants and The Rise of Type Theory: Circa 1912 2012 - PowerPoint PPT Presentation

Proof Assistants and The Rise of Type Theory: Circa 1912 2012 Robert L. Constable Cornell University Mach 19, 2012 Lecture at Carnegie Mellon University Lecture Plan Well look at the role of proof assistants in the rise of type theory


  1. Proof Assistants and The Rise of Type Theory: Circa 1912 – 2012 Robert L. Constable Cornell University Mach 19, 2012 Lecture at Carnegie Mellon University

  2. Lecture Plan We’ll look at the role of proof assistants in the rise of type theory from the publication of Principia Mathematica to the present day. My plan is to show features of the Nuprl and MetaPRL proof assistants and connect them to major ideas in a century long development of type theory, especially constructive type theory.

  3. The Basic Questions Why is the use of interactive proof assistants on the rise? Consider this lot of them: Agda, Coq, HOL, Isabelle HOL (HOL), MetaPRL, Minlog, Nuprl, PVS, Twelf, and others. Why are they all based on type theory, not set theory? Why constructive? The red ones are constructive -- there is a red HOL dialect. (ACL2 is constructive, but not a type theory.)

  4. What is a Proof Assistant? They are interactive software systems that help users create proofs in a formalized mathematical theory. These formal theories arose in logic over the last century. The first implementations of simple fragments were in the 1950s, Davis, Newell, Shaw, Simon, Gelernter in the US, Prawitz in Sweden.

  5. Why are there formal theories? This is a fascinating question to which I’ll give a narrow answer tracing the “main line of logic”, a technical answer. The bigger picture is about AI and the over- arching goal of computer science to automate intellectual processes and build a strong symbiosis between people and machines. It is about remarkable intellectual accomplishment of CS. For fun, see Darwin among the Machines by G. Dyson

  6. Logical Context Consistency Questions and Logic Euclid’s 5 th postulate Computing with infinite series and infinitesimals reveals contradictions (19thC) then infinite sets and the paradoxes cause increasing concern. These days, software errors are of great concern as are vulnerabilities in cyber warfare.

  7. Logical Landmark One Begriffsschrift 1879 Gottlob Frege He invents first-order logic, predicate calculus -- a precise language for concept writing (Begriffsschrift). -- A is sensible |- A is provable

  8. Frege Advances Leibniz’s Vision Another way to see this advance is that Frege did what Leibniz aspired to do already in the 17 th century, create a basic logic for coding all knowledge. He anticipated Gödel numberings. Many modern logicians are in the Leibniz genealogy, and we use “monads.”

  9. Logical Landmark Two The Axiomatic Approach First there was the relative consistency approach, e.g. non-Euclidean geometries. In 1899 Hilbert used the Axiomatic Approach to Geometry, remove intuition. Peano Axioms in 1889, Hilbert 1900 axioms for the Reals. 1908 1908 Russell Types Zermelo Sets

  10. Logical Landmark Three In 1910, Whitehead and Russell published Volume I of their three volume Principia Mathematica , a comprehensive logical foundation for mathematics. It was not completely formal, but Newell, Shaw and Simon drew their examples from it. The logic was Russell’s Type Theory.

  11. Consider the MetaPRL Proof Assistant MetaPRL like Isabelle and Twelf is a Logical Framework designed by Jason Hickey for his Cornell PhD 2001 and implemented in O’Caml by him and extended by other students in the PRL group, A. Nogin, A. Kopylov, and others in Russia. Let’s open the prover. What do we see? MetaPRL - - - - Type Theory Axioms CZF Set Theory Axioms PRL Group Peter Aczel

  12. MetaPRL Offers a Choice of Theories Interestingly these choices are connected due to a fundamental result of Peter Aczel showing how to embedded CZF into Type Theory. This embedding relies on the use of recursive types in constructive type theory. These types create great expressiveness for both Nuprl and Coq. These types came from Nax Mendler’s 1987 Cornell PhD thesis.

  13. Recursive Types Recursive types are good data structures, e.g. can define lists of type A as List(A) = Unit + (A × List(A)). We can define numbers as Nat = Unit + Nat The general form is T = F(T) for F:Type  Type for F a monotone function on Type, e.g. X subt Y implies F(X) subt F(Y)

  14. CZF Sets form a Recursive Type Sets are embedded into constructive type theory using the recursive type Sets = B:Type × (B → Sets) The axioms of CZF are validated using the axioms of type theory, and every theorem can be interpreted as a result in type theory. We can see sets as one kind of type, a very rich data type or a mathematical type.

  15. Very Rich Type Theories Very rich type theories are appealing because they facilitate the formalization of concepts. In this case, CZF is two axioms away from ZFC, a main stream foundation for mathematics. On the other hand, a consistency guarantee is harder, say compared to ACL2 a modern proof assistant that does not use type theory but instead Recursive Arithmetic.

  16. Other Nice Embeddings MetaPRL can define theories like ACL2 and implement a famous result of Gödel that it is possible to translate Peano Arithmetic, PA, a classical first-order theory of numbers, into Heyting Arithmetic, HA, a constructive first-order theory of numbers close to ACL2. Gödel thus showed that PA is consistent iff HA is consistent. This kind of result led him to think that Hilbert’s program was doomed.

  17. Other Key Types The constructive type theory of Nuprl depends on other basic constructors such as quotient types to change the base equality on types, e.g. on Z introduce equality mod n, Z //mod(2), define Bag(T) as a List(T)//permutations. Nuprl also hides computational content using set types {x:A| P(x)}, access to the proof of P(x) is not available; it was produced then hidden. Nuprl can save carrying around unnecessary information.

  18. What else can we do with MetaPRL? We can also formulate incompatible theories in logical frameworks. For example, in Nuprl, our theory of partial recursive functions using bar types is incompatible with classical mathematics whereas most of Nuprl is compatible. So MetaPRL can isolated those results, which are a constructive version of Scott’s domain theory, related to Edinburgh LCF.

  19. What else can we do with MetaPRL? We can read formal mathematics and the “glossing of the theorems”, all the facts are there. Some proofs are extraordinarily clear, like crystals. Let’s read one. Also note: We can automatically translate some theorems and proofs into natural language, a distinctly AI feature.

  20. Math Library

  21. Stamps

  22. Stamps 2

  23. Stamps 2 1

  24. Stamps 2 1 2

  25. Looking Closely at a Proof Let’s look more closely at how a proof is represented in Nuprl and MetaPRL. We’ll take a simple example with interesting computational content. First we look at the normal textbook style proof, and then at the proof tree presentation, also called tableau style or refinement style proof. All these styles are very readable.

  26. Integer Square Root r n r 2 2 ( ) 1 2 2 6 2 8 3 5 4 3 2 1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 26

  27. Theorem n: . r: . Root (r,n) Proof by induction Base n = 0 take r = 0, clearly Root (0,0) Induction assume r: .Root (r, n-1) 2 2 Choose where r Root(r ,n-1), i.e. r n-1 < (r 1) 0 0 0 0 2 2 (r 1) n v n<(r +1) 0 0 2 case (r +1) n then r = (r 1) 0 0 2 2 2 (r 1) n < ((r +1) < (r +2) ) 0 0 0 2 case then n < (r +1) r=r since r n-1< n. 0 0 0 Qed 27

  28. Proof of Root Theorem 2 2 n : . r : . r n r 1 allR BY 2 2 n : r : . r n r 1 BY NatI nd 1 ..... base case. .... 2 2 r : . r r 0 1 existsR Auto BY TH EN 0 ..... induction cas e .. ... 2 i i + 2 : , r : , r r 1 1 2 i 2 r : . r r 1 2 i Decide r Aut o BY THEN 1 28

  29. Proof of Root Theorem (continued) ... . . Case 1..... 2 2 i + i i 2 : , r : , r r , r 1 1 1 2 i 2 r : . r r 1 exist sR r Auto' BY THEN 1 ..... Case 2..... 2 2 i + i i 2 : , r : , r r , r 1 1 1 2 i 2 r : . r r 1 existsR r Auto BY TH EN 29

  30. A Recursive Program for Integer Square Roots Here is a very clean functional program r(n):= n= 0 if then 0 else let r r (n-1) in 0 2 if (r 1) n then r 1 0 0 else r fi 0 fi This program is close to a declarative mathematical description of roots. 30

  31. Closer Look at a Proof We see a refinement style proof here. The proof starts with the goal and works downward to generate sub goals by selecting an applicable rule. The PRL Project, started with Joseph Bates and me in 1979 studies refinement proofs, the Program/Proof Refinement Logic (PRL).

  32. A Picture of Proof Structure ฀ ├ G ฀ H 1 ├ G 1 ฀ H 2 ├ G 2 pf 32

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend