from hilbert’s program to a logic toolbox - technionjanos/public/ttl.pdf · ttl 20015, rennesjune...
TRANSCRIPT
TTL 20015, Rennes June 2015
From Hilbert’s Program to a Logic Toolbox
How to teach Sets and Logic for students in Computer Science
Johann A. Makowsky
Department of Computer ScienceTechnion – Israel Institute of Technology
Haifa, Israel
[email protected]/∼janos
2005-2009: President of the
European Association of Computer Science Logic
ttl2015.tex 1
TTL 20015, Rennes June 2015
Previous presentations of similar talks
Conference presentations:
• LPAR 2007, Eriwan
• International Symposiums on Artificial Intelligence and Mathematics, 2008,Fort Lauderdale, Florida
• CSR 2008, Moscow
• CiE 2008, Athens
• 2009, ETH Zurich
Full paper:J.A. Makowsky, From Hilbert’s Program to a Logic Toolbox.
Annals of Mathematics and Artificial Intelligence, 53.1-4 (2008), pp. 225-250.
ttl2015.tex 2
TTL 20015, Rennes June 2015
Logic for the ”Working Computer Scientist”:
towards a re-orientation
The classical approach: The misleading narrative.
Modeling artefacts: Reality, models, and side-effects.
Semantics and Formal Methodes: Programming, verification,
and querying knowledge bases.
Understanding limitations: What cannot be achieved in a given framework.
A logic tollbox: From foundations to engineering.
ttl2015.tex 3
TTL 20015, Rennes June 2015
My own background
Research: Mathematical Logic, Foundations of Computer Science,Application of Logic to Combinatorics.
Teaching: Mathematical Logic and Logic in Computer Science, Foundationsof AI and Databases.
Industry: European Space Agency, Zurich Financial Services,Co-founder of mental images, GmbH, Berlin, in 1986 (sold to NVIDIA in2007)Regular columnist for Finanz & Wirtschaft, Zurich (1987-1989)
More details, Skip details,
ttl2015.tex 4
TTL 20015, Rennes June 2015
My own research background:
1970-85: Mathematical Logic, Classical Model Theory,Abstract Model Theory and Generalized Quantifiers;
1980-95: Application of Logic to Semantics, Logic Programming and Databases;
1995-today: Application of Logic to Algorithmics and Combinatorics.
My own undergraduate teaching experience: Courses I have designed
• Logic for Computer Science,Sets and Logic for Computer Science
• Database Systems, Database Theory
• Foundations of Logic Programming,Foundations of Automated Theorem Proving
ttl2015.tex 5
TTL 20015, Rennes June 2015
My own industrial experience:
1969-70: Buro Dr. Haller subcontracting from the European Space Agency.
Exact computation of geostationary orbits of satelites.
1987-1989: Zurich Insurance (ZFS).
Feasibility study concerning insurability of computer related risk.
1987-1989: Finanz und Wirtschaft. Columnist.
Writing a regular column on computing related issues.
1987-2007: mental images g.m.b.h. Chief scientific consultant.mental images, founded in 1986, is the recognized international leader in providingcomponent and platform software for the creation, manipulation and visualization of3D content. Its world leading rendering and other technologies are used by the enter-tainment, computer-aided design, architecture, scientific visualization, and other indus-tries that require sophisticated images primarily as part of their software products andapplication services.
Since 2008, mental images, is a wholly-owned subsidiary of NVIDIA Corporation withheadquarters in Berlin, Germany, a subsidiary in the United States, mental images, Inc.,and offices in Melbourne, Australia and Stockholm, Sweden.
ttl2015.tex 6
TTL 20015, Rennes June 2015
What to teach from logic?
In this lecture I want to examine what we should teach fromlogic to our
non-specialized undergraduate students.
I mean, what does every graduate of Computer Science have tolearn in/from logic?
The current syllabus is often justified
more by the traditional narrative
than by the practitioner’s needs.
ttl2015.tex 7
TTL 20015, Rennes June 2015
Outline of the talk
Part 1: The Logical Foundations of Mathematics
• From Frege to Godel: the traditional narrative
• Sets for the Working Mathematician: the practical narrative
Part 2: Lessons for the Working Computer Science Graduate
• My Toolbox
• Sets as universal data structure
• Computability
• Syntax and semantics
• Definability and interpretability
ttl2015.tex 8
TTL 20015, Rennes June 2015
From Frege to Godel:
The traditional narrative
ttl2015.tex 9
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Act I: Cantors Paradise
Act II: Paradise lost
Act III: Hilbert’s Program
Act IV: Rise and fall of Hilberts Program
Act V: Clarifications and repairs
Interlude: Sets for the working mathematician
Act VI: 100 years later - Fixing Frege
Skip details
ttl2015.tex 10
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Act I: Cantors Paradise
• First G. Cantor (1874 - 1884) created the Paradise of Sets
• Then G. Frege (1879) created the modern Logical Formalisms,
including the correct binding rules for quantification, and
• set out to lay the Foundations of Mathematics with hisDie Grundgesetze der Arithmetik, Volume1 (1893).
• G. Peano, author of ”The principles of arithmetic, presented by a newmethod” (1889), wrote a positive review of it.
Frege’s Program:
Explain all of Mathematics
using Logic (and Set Theory).
ttl2015.tex 11
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Act II: Paradise lost
• On 16 June 1902, Bertrand Russell pointed out, with great modesty, thatthe Russell paradox gave a contradiction in Frege’s system of axioms.
• And with Russel’s paradox started the crisis of the Foundations ofMathematics,
• G. Cantor had sensed this, when he noticed trouble with the”set of all sets”.
Let V be the set of all sets. Then its power set P (V ) ⊂ V .
But | V |<| P (V ) |, a contradiction.
ttl2015.tex 12
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Act III: Hilbert’s Program
(quoted from Wikipedia)
D. Hilbert around 1920 designs a program to provide secure foundations forall mathematics. In particular this should include:
• Formalization of all mathematics: all mathematical statements shouldbe written in a precise formal language, and manipulated according towell defined rules.
• Completeness: a proof that all true mathematical statements can beproved in the formalism.
• Consistency: a proof that no contradiction can be obtained in the for-malism of mathematics. This consistency proof should preferably useonly ”finitistic” reasoning about finite mathematical objects.
ttl2015.tex 13
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Hilbert’s Program (contd)
• Conservation: a proof that any result about ”real objects” obtainedusing reasoning about ”ideal objects” (such as uncountable sets) can beproved without using ideal objects.
• Decidability: there should be an algorithm for deciding the truth orfalsity of any mathematical statement.
In 1928, D. Hilbert and W. Ackermann publish ”Grundzuge der theoretischenLogik”.
• The Logic in question is Second Order Logic.
• What we call First Order Logic, is called there the restricted calculus.
• They prove soundness of the calculus, andask the question of completeness.
ttl2015.tex 14
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Act IV: Rise and Fall of Hilberts Program
Initial successes:
• Leopold Lowenheim (1915), Thoralf Skolem (1920),Mojzesz Pressburger (1929), Alfred Tarski (1930),Frank Plumpton Ramsey (1930), Laszlo Kalmar (1939)
and many others prove partial decidability resultsfor fragments of Logic, and for Arithmetic, Algebra, Geometry.
• In 1929 Kurt Godel proves the completeness of the Hilbert-Ackermannaxiomatization of the the restricted (first order) calculus.
ttl2015.tex 15
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Rise and Fall of Hilberts Program (contd)
Final blows:
• 1931 K. Godel proves that every recursive theory which contains arith-metic is incomplete.
• 1931 K. Godel proves that every recursive consistent theory which con-tains arithmetic cannot prove its own consistency.
• 1936 Alonzo Church and Alain Turing show that already for the re-stricted calculus with free relation variables the set of tautologies is notcomputable (but is semi-computable).
ttl2015.tex 16
TTL 20015, Rennes June 2015
Logical Foundations of Mathematics
Act V: Clarifications and repairs
Proof Theory arises from work by W. Ackermann, G. Gentzen, J. Herbrand,D. Hilbert and P. Bernays.
Set Theory arises from work by E. Zermelo, D. Mirimanoff, J. von Neumann,A. Frankel, K. Godel and P. Bernays.
Alternative approaches are developed by, among others,W. Quine, W. Ackermann, and J.L. Kelley and A.P. Morse
Recursion Theory arises from work by E. Post, J. Herbrand, K. Godel, A.Church, A. Turing, H. Curry.
Model theory arises from work by T. Skolem, A. Tarski, A. Robinson, R.Fraısse and A. Mal’cev,
And for long this remained the classical divide of Mathematical Logic.
ttl2015.tex 17
TTL 20015, Rennes June 2015
Interlude: The Foundations of Modern Analysis
A pragmatic Frege program
It used to be customary to teach the foundations of calculus by:
• Starting with sets.
• Defining the number systems N, Z, Q and their arithmetic operationsinductively and using quotient structures.
• Defining the reals R, using Dedekind cuts.
• Defining structures, say, groups, fields, Banach spaces, Lie algebras,axiomatically.
• Existence of axiomatically defined objects had to be established by anexplicit sequence of set construction steps within the cumulativehierarchy.
ttl2015.tex 18
TTL 20015, Rennes June 2015
Logical Foundations of MathematicsAct VI: 100 years later - Fixing Frege
C. Wright, P. Geach and H. Hodes suggested, and G. Boolos proved (1987)that the modified Frege program actually is feasible.
G. Boolos, On the Consistency of Frege’s Foundation of Mathematics, reprintedin: G. Boolos, Logic, Logic and Logic, Harvard University Press, 1998.
So we have:
Frege: The Peano Postulates can be deduced in dyadic second order logicfrom Hume’s principle and suitable definitions of the natural numbers(Frege’s Arithmetic).
Boolos: Frege’s arithmetic is interpretable in second order Peano Arithmetic.
J.P. Burgess, Fixing Frege, Princeton University Press, 2005
That much for the ”big crisis”.
ttl2015.tex 19
TTL 20015, Rennes June 2015
The classical textbooks in Logic and Naive Set Theory
The Classical Texts follow this narrative:
• Logic is needed to resolve the paradoxes of set theory.
• First Order Logic is THE LOGIC due to its completeness theorem.
• The main theorems of logic are theCompleteness Theorem and the Compactness Theorem
• The tautologies of First Order Logic are not recursive.
• Arithmetic Truth is not recursive enumerable.
• One cannot prove CONSISTENCY within rich enough systems.
• Naive Set Theory is used for theFoundations of Analysis and Topology.
ttl2015.tex 20
TTL 20015, Rennes June 2015
This is NOT what a
Practitioner of Computing Sciences
NEEDS !
ttl2015.tex 21
TTL 20015, Rennes June 2015
So WHAT aspects of Logic does a
Practitioner of Computing Sciences
NEED ?
ttl2015.tex 22
TTL 20015, Rennes June 2015
Knowledge of theoretical orientation
vs
practical knowledge, I
Theoretical orientation:
• awareness that his domain of discourse is an
idealized world of artefacts which models fairly accurately the
artefacts which allow us to run and interact
with computing machinery.
• awareness of the different levels of abstractions.
• awareness that in this world of artefacts there area priori limitations.
Not everything is realizable, computable, etc.
ttl2015.tex 23
TTL 20015, Rennes June 2015
Knowledge of theoretical orientation
vs
practical knowledge, II
Practical knowledge:
• tools which allow him to model new artefacts, whenever they arise;
• languages which allow him to describe properties of the modeledartefacts in Second Order Logic.
• tools which allow him to manipulate quantifiers.
including: Ehrenfeucht-Fraısse Games.
• tools which allow him to prove properties of the modeled artefactsin the language of sets.
ttl2015.tex 24
TTL 20015, Rennes June 2015
He needs a carefully adapted blend of
• the practical Frege program, with
• the knowledge of its limitations.
He needs both proficiency and performance in his practical
knowledge.
ttl2015.tex 25
TTL 20015, Rennes June 2015
He does NOT need to see (in a first course)
• A a proof of the completenss theorem for Propositional Order Logic
for Hilbert-style or Gentzen-style proof systems.
• A a proof of the completenss theorem for First Order Logic,
(Hilbert-Ackermann: the restricted calculus)
• the Compactness Theorem.
In the sequel of this talk, as time permits, I elaborate.
ttl2015.tex 26
TTL 20015, Rennes June 2015
My Logic Toolbox
• The Fundamental Property of Transductions and Interpretations.
• The Ehrenfeucht-Fraısse Theorem and its refinements.
• The Feferman-Vaught Decomposition Theorem and its many varia-tions.
Note that all these tools were already developed before 1960,and used by specialists, but not included in introductory textbooks.
I have surveyed how to use these tools in Computer Science in my papers
• J.A. Makowsky and E.V. Ravve,Dependency Preserving Refinements and the Fundamental Problem of Database Design,Data & Knowledge Engineering, vol. 24.3 (1998) pp. 277-312.
• J.A. Makowsky, Algorithmic uses of the Feferman-Vaught theorem,Annals of Pure and Applied Logic, vol. 126 (2004) pp. 159-213
ttl2015.tex 27
TTL 20015, Rennes June 2015
Where these tools work
Linear Algebra in Math is pervasive.
Logic, as traditionally tought, is NOT pervasive in the CS curriculum.
It is important that the student sees the tools work in the basic courses,and in the follow-up courses.
My toolbox is (or could/should be) at work in
• Automata Theory and Computability
• Database Systems
• Graph Algorithms and Complexity
• Formal Methods and Verification, in all their ramifications
• Decision procedures in Automated Theorem Proving
ttl2015.tex 28
TTL 20015, Rennes June 2015
Lessons from 150 years of Modern Logic
and the Foundations of Mathematics
As much as time permits . . ., or read the full paper!
• Modeling the world
• Modeling computability
• Modeling syntax and semantics
• Limitations of formalisms
• Intepretatbility and Reducibility
ttl2015.tex 29
TTL 20015, Rennes June 2015
1. Modeling the world
Our scientific language: Natural Language enhanced by precise use of booleanoperations, quantification and the use of naive language of sets.
Our universal data structure: A cumulative world of sets.
Modeling the world: We model ALL artefacts of our computing world byconstructed objects in the world of sets.
Modeling involves side effects:Modeled artefact have properties not intended.
Ordered pairs:N. Wiener: (x, y) := {{{x}, ∅}, {{y}}}, K. Kuratowski {{x}, {x, y}},Simplified {a, {a, b}}.
Fixing levels of abstraction: Introducing structures, and fixing which setsare not further to be analyzed.
A graph is a pair < V,E >. A finite automaton is a tuple < S,Σ, R, I, T >.
ttl2015.tex 30
TTL 20015, Rennes June 2015
Lesson 1 (contd)
Like in the foundations of Analysis,as practiced by R. Dedekind, E. Landau and N. Bourbaki,we need the precise language mix ofnormalized natural language augmented by the language of setsto model the idealized artefacts of computer science.
Artefacts:strings, concatenation, natural numbers,graphs, relational structures stacks, arrays;circuits, Turing machines, register machines;specification and programming languages,
Tools: Inductive definitions, proofs by induction;enumerations, proving countability and uncountability;well-orderings (for termination)
ttl2015.tex 31
TTL 20015, Rennes June 2015
Is this not ”too denotational” ? ....
... a worried friend asked me once.
• It does map everything into sets.
• But ”truth” does not presuppose a world of sets.
• Truth in the sense of Frege’s world is defined by the laws (introductionand elimination rules) of logic and of the Fregean constructs.
• It leaves your foundational options open ...
ttl2015.tex 32
TTL 20015, Rennes June 2015
2. Modeling Computability and its limitations (when modeled)
Computability is modeled over different domains, computing operations, re-source restrictions.
Natural numbers and recursion:The original definition of the set of recursive functions.
Natural numbers and register machines:Close to early programming languages.
Turing machines and words: Close to assembly languages.
Other models: Logic programs, Lambda calculus, cellular automata, quan-tum computing
Showing their equivalence involves
• Translation between the domains.
• Translations between programs (interpreters and compilers).
ttl2015.tex 33
TTL 20015, Rennes June 2015
Lesson 2 (contd)
Computability may be taught before logic in a more naive way.
Here I want to stress The different basic structures involved,and their bi-interpretability.
Orientation:
Not everything is computable.Precise statement of various versions of the the Church TuringHypothesis.Separating slogans from precise definitionsEffectively computable = P, NP, RP, QP, .... ?
Tools:
Proving non-computability.Establishing simulations.
ttl2015.tex 34
TTL 20015, Rennes June 2015
3. Modeling Syntax and Semantics
We look at Propositional, First Order, Second Order Logic,or any other logic of assertions.
Syntax:
The syntax is an inductively defined set of words,the well formed expressions.
Semantics:
Structures are interpretations of the basicnon-logical symbols.
Assignments are interpretations of the variables.
The meaning function associates with structures, assignments,and formulas a truth value.
What is the meaning of an assertion ?
ttl2015.tex 35
TTL 20015, Rennes June 2015
Lesson 3 (contd)
The meaning of an assertion is:
Without free variables: A truth value.
But this is misleading!
With free variables: The set of interpretations of its free variables.
Only first order variables: A relation
We define usually logical validity via truth values.
It would be preferable to define
validity and logical consequence directly
for formulas with free variables.
ttl2015.tex 36
TTL 20015, Rennes June 2015
Do we need the Completeness Theorem?
For the practical knowledge we need:
• The semantic notion of logical consequence.
• Enough basic logical equivalences to to prove the Prenex Normal FormTheorem (PNF).
• Introduction and elimination rules for quantifiers (via constants).
• A game theoretic interpretation of formulas in PNF.
For the knowledge of orientation we might state (but not prove) the Com-pleteness Theorem for our redundant set of manipulation rules.
ttl2015.tex 37
TTL 20015, Rennes June 2015
Arguments for/ against proving the Completeness Theorem
The classical argument pro:
• Completeness and its corollary, Compactness is at the heart of logic.
My arguments contra:
• None of these are part of the practical knowledge we aim at.
• The proof of the Completeness Theorem is a waste of time at the costof teaching more important skill of understanding the manipulation andmeaning of formulas.
• First Order Logic is not privileged in our context. We deal very oftenwith finite structures, where the Completeness Theorem is not true.
• Second Order Logic anyhow is the natural logic we work in, and nottaking that seriously confuses the student.
ttl2015.tex 38
TTL 20015, Rennes June 2015
Lesson 3 (contd)
We should concentrate on understanding quantification:
Tools:
• Read, write and understand the meaning ofFirst Order and Second Order formulas.
• Understand the relationship betweenprojection of relations and quantification.
• Understand that Relational Calculus and First Order Logicare really the same (i.e., bi-interpretable).
• Play with the game interpretation of quantifiers to analyze theamount of quantification needed to express, say
”there exists at least n elements x such that φ(x)”.
ttl2015.tex 39
TTL 20015, Rennes June 2015
4. Limitations of formalisms: Definability
Before we prove the Completeness Theorem I would like the students tounderstand the difference between First Order (FO) and Second Order (SO)Logic.
• ”There are an equal number of x with P (x) and Q(x)”
where P,Q are unary predicate symbols, is expressible in SO but not inFO.
We can prove this having the games available.
• In the natural numbers N, multiplication is SO-definable using additiononly, but not FO-definable.
Multiplications is FO-definable using addition and squaring.
The negative result we can not prove in an undergraduate course, as we need the
decidability of FO Pressburger Arithmetic. But we can explain it.
ttl2015.tex 40
TTL 20015, Rennes June 2015
5. Interpretability and Reducibility
Before we prove the Completeness Theorem I would like the students tounderstand what it means that
The integers Z with their arithmetic are interpretable inside thenatural numbers N with their arithmetic.
We define a transduction T (N) = Z as follows.
• The new universe consists of equivalence classes of pairs of natural numbers such that(x, y) ∼ (x′, y′) iff x+ y′ = x′ + y.
• The new equality is this equivalence.
• The new addition is the old addition on representatives.
• Same for multiplication.
ttl2015.tex 41
TTL 20015, Rennes June 2015
Lesson 5 (contd)
We define the interpretation S : Formulas→ Formulas as follows:
For any SO-formula φ we let S(φ) be the result of substituting the newdefinitions of addition and multiplication and equality for the correspondingsymbols.
S and T are intimately related:
Z = T (N) |= φ iff N |= S(φ)
which is the Fundamental Property of Transductions and Interpretations.
ttl2015.tex 42
TTL 20015, Rennes June 2015
Lesson 5 (contd)
In the same way we can see that
• The Cartesian product is interpretable in the disjoint union.
• Many graph transformations are given as transductions.
• All implementations of one data structure in another are of this form.
• Transductions and interpretations are everywhere
ttl2015.tex 43
TTL 20015, Rennes June 2015
The Fundamental Properties of SO
• Isomorphic structures satisfy the same SO sentences
• That Fundamental Property of Transductions and Interpretations.
• The Prenex Normal Form Theorem and its visualization as a two persongame.
ttl2015.tex 44
TTL 20015, Rennes June 2015
The Fundamental Properties of FO
Besides the properties of SO we have
The Ehrenfeucht-Fraısse Theorem:
Two structures can be distinguished by a sentences of quantifierdepth k iff Player I can force a win in the EF-game of length k.
or, equivalently
Two structures cannot be distinguished by a sentences of quanti-fier depth k iff they are k-isomorphic.
Furthermore:
k-isomorphism is preserved under the formation of disjoint unions ofstructures.
Modified versions also hold for Monadic Second Order Logic, but not for SO.
ttl2015.tex 45
TTL 20015, Rennes June 2015
Combining EF-Games and Transductions
Combining games and transductions gives a very powerful tool to computethe meaning function of a FO formula in a complex structure by reducing thiscomputation to simpler structures.
If G is obtained from graphs H1, H2 by applying disjoint unions, Cartesianproducts, and first order definable transductions T1, T2, say
G = T1(H1 × T2(H2))
then the truth of the formulas of quantifier rank k in G is uniquely andeffectively determined by the the truth of the formulas of quantifier rank kwhich hold in H1 and H2.
This is the Feferman-Vaught Theorem.
ttl2015.tex 46
TTL 20015, Rennes June 2015
THANK YOU FOR YOUR ATTENTION !
ttl2015.tex 47