



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




According to Wikipedia, logic is the study of the principles of valid infer- ences and demonstration. From the breadth of this definition it is immedi- ately clear that logic constitutes an important area in the disciplines of phi- losophy and mathematics. Logical tools and methods also play an essential role in the design, specification, and verification of computer hardware and software. It is these applications of logic in computer science which will be the focus of this course. In order to gain a proper understanding of logic and its relevance to computer science, we will need to draw heavily on the much older logical traditions in philosophy and mathematics. We will dis- cuss some of the relevant history of logic and pointers to further reading throughout these notes. In this introduction, we give only a brief overview of the goal, contents, and approach of this class.
The course is divided into four parts:
I. Proofs as Evidence for Truth
II. Proofs as Programs
III. Proof Search as Computation
IV. Substructural and Modal Logics
L1.2 Constructive Logic: Overview
Proofs are central in all parts of the course, and give it its constructive na- ture. In each part, we will exhibit connections between proofs and forms of computations studied in computer science. These connections will take quite different forms, which shows the richness of logic as a foundational discipline at the nexus between philosophy, mathematics, and computer science. In Part I we establish the basic vocabulary and systematically study propositions and proofs, mostly from a philosophical perspective. The treatment will be rather formal in order to permit an easy transition into computational applications. We will also discuss some properties of the logical systems we develop and strategies for proof search. We aim at a sys- tematic account for the usual forms of logical expression, providing us with a flexible and thorough foundation for the remainder of the course. We will also highlight the differences between constructive and non-constructive reasoning. Exercises in this section will test basic understanding of logical connectives and how to reason with them. In Part II we focus on constructive reasoning. This means we consider only proofs that describe algorithms. This turns out to be quite natural in the framework we have established in Part I. In fact, it may be somewhat surprising that many proofs in mathematics today are not constructive in this sense. Concretely, we find that for a certain fragment of logic, con- structive proofs correspond to functional programs and vice versa. More generally, we can extract functional programs from constructive proofs of their specifications. We often refer to constructive reasoning as intuitionis- tic, while non-constructive reasoning is classical. Exercises in this part ex- plore the connections between proofs and programs, and between theorem proving and programming. In Part III we study a different connection between logic and programs where proofs are the result of computation rather than the starting point as in Part II. This gives rise to the paradigm of logic programming where the process of computation is one of systematic proof search. Depending on how we search for proofs, different kinds of algorithms can be described at a very high level of abstraction. Exercises in this part focus on exploiting logic programming to implement various algorithms in concrete languages such as Prolog. In Part IV we study logics with more general and more refined notions of truth. For example, in temporal logic we are concerned with reasoning about truth relative to time. Another example is the modal logic S 5 where we reason about truth in a collection of worlds, each of which is connected to all other worlds. Proofs in this logic can be given an interpretation as dis-
L1.4 Constructive Logic: Overview
4 Intuitionism
We call a logic constructive if its proofs describe effective constructions. The emphasis here is on effective which is to say that the construction conveyed by a proof can actually be carried out mechanically. In other words, con- structive proofs describe algorithms. At first one might think that all proofs describe constructions of this form, and this was historically true for a long time. At some point in the 19th century this direct link between mathe- matics and computation seemed to get lost. Some mathematicians objected to this and started to develop a foundations of mathematics in which all proofs denote effective constructions. In order to understand this distinction better, we start with a theorem that illustrates the distinction, the so-called Banach-Tarski Paradox.^2
Theorem 1 Given a solid ball in 3-dimensional space, there exists a decomposi- tion of the ball into a finite number of disjoint subsets, which can then be put back together in a different way to yield two identical copies of the original ball. The re- assembly process involves only moving pieces around and rotating them, without changing their shape. The reconstruction can work with as few as five pieces.
This is considered paradoxical, since we obviously cannot carry out such a decomposition in reality. The intermediate pieces are in fact non- measurable infinite scatterings of points, motivating the development of mea- sure theory in mathematics. The decomposition relies critically on the ax- iom of choice in set theory, which is highly non-constructive. This is the kind of theorem (and proof, which we not show here but is sketched in the article) that mathematician L.E.J. Brouwer^3 might have objected to. It is meaningless with respect to our understanding of effec- tive constructions, even if the formalities of its proof are sound. This en- tails a criticism of Hilbert’s program, who posited that at the foundations of mathematics should be a formal system of axioms and inference rules with respect to which we can judge the correctness of mathematical argu- ments. Brouwer called himself an intuitionist, perhaps to contrast himself to Hilbert as a formalist.^4 Since intuitionistic logic has subsequently also been formalized (e.g., by Kolmogorov and Heyting), the modern way of framing the opposing sides are intuitionistic logic (or arithmetic) and classical logic (or arithmetic). (^2) See https://en.wikipedia.org/wiki/Banach-Tarski_paradox (^3) See https://en.wikipedia.org/wiki/L._E._J._Brouwer (^4) For more on this controversy in the foundations of mathematics, see https://en.wikipedia.org/wiki/Brouwer-Hilbert_controversy.
Constructive Logic: Overview L1.
One of the key differences is the interpretation of the existential quan- tifier. In intuitionistic logic, proving ∃x. A(x) entails exhibiting a witness t and a proof of A(t). In classical logic, it is sufficient to show that ∀x. ¬A(x) is impossible without exhibiting a witness in the proof. As example, we consider the following theorem and proof.
Theorem 2 There are two irrational numbers a and b such that ab^ is rational.
Proof: Consider
√ (^2). There are two cases:
Case:
√ 2 is rational. Then a = b =
2 satisfies the claim.
Case:
√ 2 is irrational. Then a =
√ 2 and b =
2 satisfy the claim, since ab^ = (
√ 2 )
2 = 2.
At this point, the classical mathematician is profoundly happy, since this is an extremely short and elegant proof of a prima facie nontrivial the- orem. The intuitionist is profoundly unhappy, since it does not actually exhibit irrational witnesses a and b such that ab^ is rational. They might be
a = b =
2 , or they might be a =
√ 2 and b =
2 but the proof does not show which it is. Therefore an intuitionist should reject this proof. The step which turns out to be incorrect here is to assume that there are
two cases (either
√ (^2) is rational or not) without knowing which of the
cases hold. More generally, an intuitionist rejects the law of excluded middle that any proposition is either true or false (in symbols: A ∨ ¬A). Concretely, what counts as a constructive proof of A ∨ B is either a proof of A or a proof of B. So in addition to existential quantification, the intuitionistic and classical mathematician disagree on the interpretation of disjunction. However, all is not lost! Intuitionists look at the above proof and say
Oh, I understand your proof, but it is for a different theorem! What you have proven is:
Theorem. If
√ 2 is rational or it is not, then there are two irrational numbers a and b such that ab^ is rational.
Surprisingly, as long as we stick to pure logic, or perhaps the theory of nat- ural numbers, any classical proof can be reinterpreted as an intuitionistic
Constructive Logic: Overview L1.
Proof: Either everyone in the class has a tattoo, or there is at least one stu- dent s who does not have a tattoo.
Case: Everyone has a tattoo. Then any x will do^6 , because the conclusion of the implication holds.
Case: There is some student s who does not have a tattoo. Then this stu- dent s is a leader: since has(s, tattoo) is false, then the implication has(s, tattoo) ⊃ ∀y. has(y, tattoo) is true.
This is non-constructive, because we use a form of the excluded middle to avoid naming a witness to the existential (which we cannot do without violating students’ privacy in unacceptable ways). Actually, as long as the domain of quantification is non-empty (which is assumed in classical logic except in free logics), this proof has nothing to do with students and tattoos, but the proof above applies to the logical form
∃x. (A(x) ⊃ ∀y. A(y))
Intuitionistically, we cannot prove this without further assumptions about A.^7 In the next lecture we will start to look closely at the intuitionistic mean- ing of the logical connectives and their proof rules, based on the interpre- tation we sketched in this lecture.
(^6) As pointed out by a student, this requires there to be at least one person in the class, which must be the case or that student couldn’t have pointed it out. (^7) Exercise: which intuitionistically true proposition does the proof above establish in- stead?