LOGICAL INFERENCE & PROOFs. Debdeep Mukhopadhyay Dept of CSE, IIT Madras

Similar documents
CHAPTER 3. Methods of Proofs. 1. Logical Arguments and Formal Proofs

def: An axiom is a statement that is assumed to be true, or in the case of a mathematical system, is used to specify the system.

Handout #1: Mathematical Reasoning

Elementary Number Theory and Methods of Proof. CSE 215, Foundations of Computer Science Stony Brook University

3. Mathematical Induction

DISCRETE MATH: LECTURE 3

Discrete Mathematics and Probability Theory Fall 2009 Satish Rao, David Tse Note 2

Rules of Inference Friday, January 18, 2013 Chittu Tripathy Lecture 05

The last three chapters introduced three major proof techniques: direct,

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

CS 103X: Discrete Structures Homework Assignment 3 Solutions

The Prime Numbers. Definition. A prime number is a positive integer with exactly two positive divisors.

Homework until Test #2

Likewise, we have contradictions: formulas that can only be false, e.g. (p p).

Mathematical Induction

Predicate Logic. Example: All men are mortal. Socrates is a man. Socrates is mortal.

Math 3000 Section 003 Intro to Abstract Math Homework 2

SECTION 10-2 Mathematical Induction

MATH 289 PROBLEM SET 4: NUMBER THEORY

Basic Proof Techniques

MATH10040 Chapter 2: Prime and relatively prime numbers

CONTINUED FRACTIONS AND PELL S EQUATION. Contents 1. Continued Fractions 1 2. Solution to Pell s Equation 9 References 12

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Propositional Logic. A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not both.

Chapter 1. Use the following to answer questions 1-5: In the questions below determine whether the proposition is TRUE or FALSE

Lecture Notes in Discrete Mathematics. Marcel B. Finan Arkansas Tech University c All Rights Reserved

MATHEMATICAL INDUCTION. Mathematical Induction. This is a powerful method to prove properties of positive integers.

CHAPTER 5. Number Theory. 1. Integers and Division. Discussion

Theorem3.1.1 Thedivisionalgorithm;theorem2.2.1insection2.2 If m, n Z and n is a positive

INTRODUCTORY SET THEORY

Introduction. Appendix D Mathematical Induction D1

Mathematics for Computer Science/Software Engineering. Notes for the course MSM1F3 Dr. R. A. Wilson

Solutions for Practice problems on proofs

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

I. GROUPS: BASIC DEFINITIONS AND EXAMPLES

Continued Fractions and the Euclidean Algorithm

CHAPTER 7 GENERAL PROOF SYSTEMS

Solutions Q1, Q3, Q4.(a), Q5, Q6 to INTLOGS16 Test 1

8 Primes and Modular Arithmetic

8 Divisibility and prime numbers

Mathematical Induction

Predicate Logic. For example, consider the following argument:

Today s Topics. Primes & Greatest Common Divisors

Every Positive Integer is the Sum of Four Squares! (and other exciting problems)

Predicate logic Proofs Artificial intelligence. Predicate logic. SET07106 Mathematics for Software Engineering

A Few Basics of Probability

Hypothetical Syllogisms 1

Number Theory. Proof. Suppose otherwise. Then there would be a finite number n of primes, which we may

This chapter is all about cardinality of sets. At first this looks like a

SUBGROUPS OF CYCLIC GROUPS. 1. Introduction In a group G, we denote the (cyclic) group of powers of some g G by

CHAPTER 2. Logic. 1. Logic Definitions. Notation: Variables are used to represent propositions. The most common variables used are p, q, and r.

k, then n = p2α 1 1 pα k

INCIDENCE-BETWEENNESS GEOMETRY

6.080 / Great Ideas in Theoretical Computer Science Spring 2008

Math 55: Discrete Mathematics

6.080/6.089 GITCS Feb 12, Lecture 3

Introduction to Automata Theory. Reading: Chapter 1

Reasoning and Proof Review Questions

Cosmological Arguments for the Existence of God S. Clarke

Mathematical Induction. Lecture 10-11

Logic is a systematic way of thinking that allows us to deduce new information

Factoring Algorithms

Answer Key for California State Standards: Algebra I

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Cycles in a Graph Whose Lengths Differ by One or Two

U.C. Berkeley CS276: Cryptography Handout 0.1 Luca Trevisan January, Notes on Algebra

A Study on the Necessary Conditions for Odd Perfect Numbers

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Lecture 13 - Basic Number Theory.

Math 223 Abstract Algebra Lecture Notes

Public Key Cryptography: RSA and Lots of Number Theory

Kevin James. MTHSC 412 Section 2.4 Prime Factors and Greatest Comm

Integer roots of quadratic and cubic polynomials with integer coefficients

Winter Camp 2011 Polynomials Alexander Remorov. Polynomials. Alexander Remorov

Turing Machines: An Introduction

The Fundamental Theorem of Arithmetic

Examination paper for MA0301 Elementær diskret matematikk

a 11 x 1 + a 12 x a 1n x n = b 1 a 21 x 1 + a 22 x a 2n x n = b 2.

PYTHAGOREAN TRIPLES KEITH CONRAD

Chapter 11 Number Theory

11 Ideals Revisiting Z

Automata and Formal Languages

Cartesian Products and Relations

of Nebraska - Lincoln

The Mathematics of GIS. Wolfgang Kainz

Notes on Factoring. MA 206 Kurt Bryan

God created the integers and the rest is the work of man. (Leopold Kronecker, in an after-dinner speech at a conference, Berlin, 1886)

alternate interior angles

1 if 1 x 0 1 if 0 x 1

An Innocent Investigation

Factoring & Primality

The Graphical Method: An Example

Math Workshop October 2010 Fractions and Repeating Decimals

People have thought about, and defined, probability in different ways. important to note the consequences of the definition:

An example of a computable

PUTNAM TRAINING POLYNOMIALS. Exercises 1. Find a polynomial with integral coefficients whose zeros include

6 EXTENDING ALGEBRA. 6.0 Introduction. 6.1 The cubic equation. Objectives

Math 4310 Handout - Quotient Vector Spaces

The Chinese Remainder Theorem

Transcription:

LOGICAL INFERENCE & PROOFs Debdeep Mukhopadhyay Dept of CSE, IIT Madras

Defn A theorem is a mathematical assertion which can be shown to be true. A proof is an argument which establishes the truth of a theorem.

Nature & Importance of Proofs In mathematics, a proof is: a correct (well-reasoned, logically valid) and complete (clear, detailed) argument that rigorously & undeniably establishes the truth of a mathematical statement. Why must the argument be correct & complete? Correctness prevents us from fooling ourselves. Completeness allows anyone to verify the result. In this course (& throughout mathematics), a very high standard for correctness and completeness of proofs is demanded!!

Overview Methods of mathematical argument (i.e., proof methods) can be formalized in terms of rules of logical inference. Mathematical proofs can themselves be represented formally as discrete structures. We will review both correct & fallacious inference rules, & several proof methods.

Applications of Proofs An exercise in clear communication of logical arguments in any area of study. The fundamental activity of mathematics is the discovery and elucidation, through proofs, of interesting new theorems. Theorem-proving has applications in program verification, computer security, automated reasoning systems, etc. Proving a theorem allows us to rely upon on its correctness even in the most critical scenarios.

Theorem Proof Terminology A statement that has been proven to be true. Axioms, postulates, hypotheses, premises Assumptions (often unproven) defining the structures about which we are reasoning. Rules of inference Patterns of logically valid deductions from hypotheses to conclusions.

More Proof Terminology Lemma - A minor theorem used as a steppingstone to proving a major theorem. Corollary - A minor theorem proved as an easy consequence of a major theorem. Conjecture - A statement whose truth value has not been proven. (A conjecture may be widely believed to be true, regardless.) Theory The set of all theorems that can be proven from a given set of axioms.

Graphical Visualization A Particular Theory A proof The Axioms of the Theory Various Theorems

Inference Rules - General Form An Inference Rule is A pattern establishing that if we know that a set of antecedent statements of certain forms are all true, then we can validly deduce that a certain related consequent statement is true. antecedent 1 antecedent 2 consequent means therefore

Inference Rules & Implications Each valid logical inference rule corresponds to an implication that is a tautology. antecedent 1 Inference rule antecedent 2 consequent Corresponding tautology: ((ante. 1) (ante. 2) ) consequent

Some Inference Rules p Rule of Addition p q p q Rule of Simplification p p Rule of Conjunction q p q

Modus Ponens & Tollens p Rule of modus ponens p q (a.k.a. law of detachment) q the mode of q affirming p q Rule of modus tollens p the mode of denying

Syllogism Inference Rules p q Rule of hypothetical q r syllogism p r p q Rule of disjunctive p syllogism q Aristotle (ca. 384-322 B.C.)

Formal Proofs A formal proof of a conclusion C, given premises p 1, p 2,,p n consists of a sequence of steps, each of which applies some inference rule to premises or previously-proven statements (antecedents) to yield a new true statement (the consequent). A proof demonstrates that if the premises are true, then the conclusion is true.

Formal Proof Example Suppose we have the following premises: It is not sunny and it is cold. We will swim only if it is sunny. If we do not swim, then we will canoe. If we canoe, then we will be home early. Given these premises, prove the theorem We will be home early using inference rules.

Proof Example cont. Let us adopt the following abbreviations: sunny = It is sunny ; cold = It is cold ; swim = We will swim ; canoe = We will canoe ; early = We will be home early. Then, the premises can be written as: (1) sunny cold (2) swim sunny (3) swim canoe (4) canoe early

Proof Example cont. Step Proved by 1. sunny cold Premise #1. 2. sunny Simplification of 1. 3. swim sunny Premise #2. 4. swim Modus tollens on 2,3. 5. swim canoe Premise #3. 6. canoe Modus ponens on 4,5. 7. canoe early Premise #4. 8. early Modus ponens on 6,7.

Inference Rules for Quantifiers x P(x) P(o) (substitute any specific object o) P(g) (for g a general element of u.d.) x P(x) x P(x) P(c) (substitute a new constant c) P(o) (substitute any extant object o) x P(x)

Common Fallacies A fallacy is an inference rule or other proof method that is not logically valid. A fallacy may yield a false conclusion! Fallacy of affirming the conclusion: p q is true, and q is true, so p must be true. (No, because F T is true.) If he stole, he will be nervous when he is interrogated. He was nervous when interrogated, so he stole.

Fallacy Fallacy of denying the hypothesis: p q is true, and p is false, so q must be false. (No, again because F T is true.) If his hands are full of blood, he has murdered. But he is sitting on his sofa, well dressed (without any sign of blood), so he did not murder. He may have washed his hands!!!

Slightly complicated example Statement: x[p(x) Q(x)] xp(x) xq(x) Quick Check: P(x): x is even, Q(x): x is odd Fallacious Proof: x [P(x) Q(x)] x [P(x) Q(x)] x[ P(x) Λ Q(x)] [ x P(x) Λ x Q(x)] [ x P(x) x Q(x)] xp(x) xq(x) Fallacy of denying the antecedent Remember we Proved in the last class

Circular Reasoning The fallacy of (explicitly or implicitly) assuming the very statement you are trying to prove in the course of its proof. Example: Prove that an integer n is even, if n 2 is even. Attempted proof: Assume n 2 is even. Then n 2 =2k for some integer k. Dividing both sides by n gives n = (2k)/n = 2(k/n). So there is an integer j (namely k/n) such that n=2j. Therefore n is even. How do Circular reasoning you is used show in that this j=k/n=n/2 proof. Where? is an integer, without first assuming that n is even?

A Correct Proof We know that n must be either odd or even. If n were odd, then n 2 would be odd, since an odd number times an odd number is always an odd number. Since n 2 is even, it is not odd, since no even number is also an odd number. Thus, by modus tollens, n is not odd either. Thus, by disjunctive syllogism, n must be even. This proof is correct, but not quite complete, since we used several lemmas without proving them. Can you identify what they are?

A More Verbose Version Suppose n 2 is even 2 n 2 n 2 mod 2 = 0. Of course n mod 2 is either 0 or 1. If it s 1, then n 1 (mod 2), so n 2 1 (mod 2) Now n 2 1 (mod 2) implies that n 2 mod 2 = 1. So by the hypothetical syllogism rule, (n mod 2 = 1) implies (n 2 mod 2 = 1). Since we know n 2 mod 2 = 0 1, by modus tollens we know that n mod 2 1. So by disjunctive syllogism we have that n mod 2 = 0 2 n n is even. Q.E.D.

Proof Methods for Implications For proving implications p q, we have: Direct proof: Assume p is true, and prove q. Indirect proof: Assume q, and prove p. Vacuous proof: Prove p by itself. Trivial proof: Prove q by itself. Proof by cases: Show p (a b), and (a q) and (b q).

Direct Proof Example Definition: An integer n is called odd iff n=2k+1 for some integer k; n is even iff n=2k for some k. Theorem: (For all numbers n) If n is an odd integer, then n 2 is an odd integer. Proof: If n is odd, then n = 2k+1 for some integer k. Thus, n 2 = (2k+1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1. Therefore n 2 is of the form 2j + 1 (with j the integer 2k 2 + 2k), thus n 2 is odd.

Indirect Proof Example Theorem: (For all integers n) If 3n+2 is odd, then n is odd. Proof: Suppose that the conclusion is false, i.e., that n is even. Then n=2k for some integer k. Then 3n+2 = 3(2k)+2 = 6k+2 = 2(3k+1). Thus 3n+2 is even, because it equals 2j for integer j = 3k+1. So 3n+2 is not odd. We have shown that (n is odd) (3n+2 is odd), thus its contrapositive (3n+2 is odd) (n is odd) is also true.

Vacuous Proof Example Theorem: (For all n) If n is both odd and even, then n 2 = n + n. Proof: The statement n is both odd and even is necessarily false, since no number can be both odd and even. So, the theorem is vacuously true.

Trivial Proof Example Theorem: (For integers n) If n is the sum of two prime numbers, then either n is odd or n is even. Proof: Any integer n is either odd or even. So the conclusion of the implication is true regardless of the truth of the antecedent. Thus the implication is true trivially.

Proof by Contradiction A method for proving p. Assume p, and prove both q and q for some proposition q. (Can be anything!) Thus p (q q) (q q) is a trivial contradiction, equal to F Thus p F, which is only true if p=f Thus p is true.

Proof by Contradiction Example Theorem: 2 is irrational. Proof: Assume 2 1/2 were rational. This means there are integers i,j with no common divisors such that 2 1/2 = i/j. Squaring both sides, 2 = i 2 /j 2, so 2j 2 = i 2. So i 2 is even; thus i is even. Let i=2k. So 2j 2 = (2k) 2 = 4k 2. Dividing both sides by 2, j 2 = 2k 2. Thus j 2 is even, so j is even. But then i and j have a common divisor, namely 2, so we have a contradiction.

Review: Proof Methods So Far Direct, indirect, vacuous, and trivial proofs of statements of the form p q. Proof by contradiction of any statements. Next: Constructive and nonconstructive existence proofs.

Proving Existentials A proof of a statement of the form x P(x) is called an existence proof. If the proof demonstrates how to actually find or construct a specific element a such that P(a) is true, then it is a constructive proof. Otherwise, it is nonconstructive.

Constructive Existence Proof Theorem: There exists a positive integer n that is the sum of two perfect cubes in two different ways: equal to j 3 + k 3 and l 3 + m 3 where j, k, l, m are positive integers, and {j,k} {l,m} Proof: Consider n = 1729, j = 9, k = 10, l = 1, m = 12. Now just check that the equalities hold.

Another Constructive Existence Proof Theorem: For any integer n>0, there exists a sequence of n consecutive composite integers. Same statement in predicate logic: n>0 x i (1 i n) (x+i is composite) Proof follows on next slide

The proof... Given n>0, let x = (n + 1)! + 1. Let i 1 and i n, and consider x+i. Note x+i = (n + 1)! + (i + 1). Note (i+1) (n+1)!, since 2 i+1 n+1. Also (i+1) (i+1). So, (i+1) (x+i). x+i is composite. n x 1 i n : x+i is composite. Q.E.D.

Nonconstructive Existence Proof Principle of extremum Theorem: There are infinitely many prime numbers. Any finite set of numbers must contain a maximal element, so we can prove the theorem if we can just show that there is no largest prime number. i.e., show that for any prime number, there is a larger number that is also prime. More generally: For any number, a larger prime. Formally: Show n p>n : p is prime.

The proof, using proof by cases... Given n>0, prove there is a prime p>n. Consider x = n!+1. Since x>1, we know (x is prime) (x is composite). Case 1: x is prime. Obviously x>n, so let p=x and we re done. Case 2: x has a prime factor p. But if p n, then x mod p = 1. So p>n, and we re done.

Proof by contradiction Assume a largest prime number exists; call it p. Form the product of the finite number of prime numbers, r=2.3.5.7 p Now inspect r+1: It cannot be divisible by any of the above prime numbers So, either r+1 is a prime or divisible by a prime greater than p (There is a fallacy in Stanat s proof). Thus, in either case there is a prime greater than p, and hence we have a contradiction Thus, there is no maximum prime number and the set is infinite.

Adaptive proofs Adapt the previous proof to prove that there are infinite prime numbers of the form 4k+3, where k is a non-negative integer.

The Halting Problem (Turing 36) The halting problem was the first mathematical function proven to have no algorithm that computes it! We say, it is uncomputable. The desired function is Halts(P,I) : the truth value of this statement: Program P, given input I, eventually terminates. Theorem: Halts is uncomputable! I.e., There does not exist any algorithm A that computes Halts correctly for all possible inputs. Its proof is thus a non-existence proof. Corollary: General impossibility of predictive analysis of arbitrary computer programs. Alan Turing 1912-1954

The Proof Absurd makes a liar out of HALT, by doing the opposite of whatever HALT predicts. Given any arbitrary program HALT(P) Consider algorithm Absurd, defined as: procedure Absurd: if HALT(Absurd)==T while T begin end Note that Absurd halts iff H(Absurd) = F. So H does not compute the function Halts!

Limits on Proofs Some very simple statements of number theory haven t been proved or disproved! E.g. Goldbach s conjecture: Every integer n 2 is exactly the average of some two primes. n 2 primes p,q: n=(p+q)/2. There are true statements of number theory (or any sufficiently powerful system) that can never be proved (or disproved) (Gödel).