CS 441 Discrete Mathematics for CS Lecture 5. Predicate logic. CS 441 Discrete mathematics for CS. Negation of quantifiers

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

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

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

3. Mathematical Induction

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

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

DISCRETE MATH: LECTURE 3

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

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

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

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

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

Basic Proof Techniques

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

WRITING PROOFS. Christopher Heil Georgia Institute of Technology

Reasoning and Proof Review Questions

WOLLONGONG COLLEGE AUSTRALIA. Diploma in Information Technology

SECTION 10-2 Mathematical Induction

Math 3000 Section 003 Intro to Abstract Math Homework 2

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

6.080/6.089 GITCS Feb 12, Lecture 3

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

1.2 Forms and Validity

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

CHAPTER 7 GENERAL PROOF SYSTEMS

WHAT ARE MATHEMATICAL PROOFS AND WHY THEY ARE IMPORTANT?

Logic Appendix. Section 1 Truth Tables CONJUNCTION EXAMPLE 1

Mathematical Induction. Lecture 10-11

Examination paper for MA0301 Elementær diskret matematikk

Computing exponents modulo a number: Repeated squaring

The Mathematics of GIS. Wolfgang Kainz

Math 319 Problem Set #3 Solution 21 February 2002

Applications of Fermat s Little Theorem and Congruences

Beyond Propositional Logic Lukasiewicz s System

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

Solutions to Homework 6 Mathematics 503 Foundations of Mathematics Spring 2014

Chapter 3. Cartesian Products and Relations. 3.1 Cartesian Products

Mathematical Induction. Mary Barnes Sue Gordon

Predicate Logic. For example, consider the following argument:

Introduction. Appendix D Mathematical Induction D1

Solutions for Practice problems on proofs

Math 55: Discrete Mathematics

mod 10 = mod 10 = 49 mod 10 = 9.

Lecture 13 - Basic Number Theory.

Mathematical Induction

Primes in Sequences. Lee 1. By: Jae Young Lee. Project for MA 341 (Number Theory) Boston University Summer Term I 2009 Instructor: Kalin Kostadinov

Cosmological Arguments for the Existence of God S. Clarke

Properties of Real Numbers

Math Circle Beginners Group October 18, 2015

An Innocent Investigation

INTRODUCTORY SET THEORY

CS510 Software Engineering

Gödel s Ontological Proof of the Existence of God

Dedekind s forgotten axiom and why we should teach it (and why we shouldn t teach mathematical induction in our calculus classes)

Mathematical Induction

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

If n is odd, then 3n + 7 is even.

CS 103X: Discrete Structures Homework Assignment 3 Solutions

Automata and Formal Languages

Cartesian Products and Relations

Lecture 16 : Relations and Functions DRAFT

Math 223 Abstract Algebra Lecture Notes

SYSTEMS OF PYTHAGOREAN TRIPLES. Acknowledgements. I would like to thank Professor Laura Schueller for advising and guiding me

Logic and Reasoning Practice Final Exam Spring Section Number

of Nebraska - Lincoln

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

6.2 Permutations continued

PYTHAGOREAN TRIPLES KEITH CONRAD

8 Primes and Modular Arithmetic

The Fundamental Theorem of Arithmetic

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

APPENDIX 1 PROOFS IN MATHEMATICS. A1.1 Introduction 286 MATHEMATICS

Automated Theorem Proving - summary of lecture 1

Undergraduate Notes in Mathematics. Arkansas Tech University Department of Mathematics

Homework until Test #2

Decision making in the presence of uncertainty II

Read this syllabus very carefully. If there are any reasons why you cannot comply with what I am requiring, then talk with me about this at once.

8 Divisibility and prime numbers

alternate interior angles

Full and Complete Binary Trees

Vocabulary. Term Page Definition Clarifying Example. biconditional statement. conclusion. conditional statement. conjecture.

Indiana State Core Curriculum Standards updated 2009 Algebra I

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

Computational Logic and Cognitive Science: An Overview

Introduction to Logic: Argumentation and Interpretation. Vysoká škola mezinárodních a veřejných vztahů PhDr. Peter Jan Kosmály, Ph.D

The Refutation of Relativism

Hypothetical Syllogisms 1

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

PHILOSOPHY 101: CRITICAL THINKING

INCIDENCE-BETWEENNESS GEOMETRY

Sample Induction Proofs

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

DEDUCTIVE & INDUCTIVE REASONING

CHAPTER 2: METHODS OF PROOF

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

Solution to Exercise 2.2. Both m and n are divisible by d, som = dk and n = dk. Thus m ± n = dk ± dk = d(k ± k ),som + n and m n are divisible by d.

Development of a computer system to support knowledge acquisition of basic logical forms using fairy tale "Alice in Wonderland"

Transcription:

CS 441 Discrete Mathematics for CS Lecture 5 Predicate logic Milos Hauskrecht milos@cs.pitt.edu 5329 Sennott Square Negation of quantifiers English statement: Nothing is perfect. Translation: x Perfect(x) Another way to express the same meaning: Everything... 1

Negation of quantifiers English statement: Nothing is perfect. Translation: x Perfect(x) Another way to express the same meaning: Everything is imperfect. Translation: x Perfect(x) Conclusion: x P (x) is equivalent to x P(x) Negation of quantifiers English statement: It is not the case that all dogs are fleabags. Translation: x Dog(x) Fleabag(x) Another way to express the same meaning: There is a dog that 2

Negation of quantifiers English statement: It is not the case that all dogs are fleabags. Translation: x Dog(x) Fleabag(x) Another way to express the same meaning: There is a dog that is not a fleabag. Translation: x Dog(x) Fleabag(x) Logically equivalent to: x ( Dog(x) Fleabag(x) ) Conclusion: x P (x) is equivalent to x P(x) Negation of quantified statements (aka DeMorgan Laws for quantifiers) Negation x P(x) x P(x) Equivalent x P(x) x P(x) 3

Formal and informal proofs Theorems and proofs The truth value of some statement about the world is obvious and easy to assign The truth of other statements may not be obvious,. But it may still follow (be derived) from known facts about the world To show the truth value of such a statement following from other statements we need to provide a correct supporting argument - a proof Important questions: When is the argument correct? How to construct a correct argument, what method to use? 4

Theorems and proofs Theorem: a statement that can be shown to be true. Typically the theorem looks like this: (p1 p2 p3 pn ) q Premises conclusion Example: Fermat s Little theorem: If p is a prime and a is an integer not divisible by p, then: a p 1 1 mod p Theorems and proofs Theorem: a statement that can be shown to be true. Typically the theorem looks like this: (p1 p2 p3 pn ) q Premises conclusion Example: Premises (hypotheses) Fermat s Little theorem: If p is a prime and a is an integer not divisible by p, then: a p 1 1mod p conclusion 5

Formal proofs Proof: Provides an argument supporting the validity of the statement Proof of the theorem: shows that the conclusion follows from premises May use: Premises Axioms Results of other theorems Formal proofs: steps of the proofs follow logically from the set of premises and axioms Formal proofs Formal proofs: show that steps of the proofs follow logically from the set of hypotheses and axioms premises + axioms + proved theorems conclusion In this class we assume formal proofs in the propositional logic 6

Using logical equivalence rules Proofs based on logical equivalences. A proposition or its part can be transformed using a sequence of equivalence rewrites till some conclusion can be reached. Example: Show that () p is a tautology. Proof: (we must show () p <=> T) () p <=> () p Useful <=> [ p q] p DeMorgan <=> [ q p] p Commutative <=> q [ p p ] Associative <=> q [ T ] Useful Formal proofs Allow us to infer new True statements from known True statements premises + axioms + proved theorems True conclusion True? 7

Rules of inference Rules of inference: Allow us to infer new True statements from existing True statements Represent logically valid inference patterns Example: Modus Ponens, or the Law of Detachment Rule of inference p q Given p is true and the implication is true then q is true. Rules of inference Rules of inference: logically valid inference patterns Example; Modus Ponens, or the Law of Detachment Rule of inference p q Given p is true and the implication is true then q is true. p q False False True False True True True False False True True True 8

Rules of inference Rules of inference: logically valid inference patterns Example; Modus Ponens, or the Law of Detachment Rule of inference p q Given p is true and the implication is true then q is true. p q False False True False True True True False False True True True Rules of inference Rules of inference: logically valid inference patterns Example: Modus Ponens, or the Law of Detachment Rules of inference p q Given p is true and the implication is true then q is true. Tautology Form: (p ()) q 9

Addition p () Rules of inference p Example: It is below freezing now. Therefore, it is below freezing or raining snow. Simplification () p p Example: It is below freezing and snowing. Therefore it is below freezing. Rules of inference Modus Tollens (modus ponens for the contrapositive) [ q ()] p q p Hypothetical Syllogism [() (q r)] (p r) q r p r Disjunctive Syllogism [() p] q p q 10

Rules of inference Logical equivalences (discussed earlier) A <=> B A B is a tautology Example: De Morgan Law ( ) <=> p q ( ) p q is a tautology Rules of inference A valid argument is one built using the rules of inference from premises (hypotheses). When all premises are true the argument should lead us to the correct conclusion. (p1 p2 p3 pn ) q How to use the rules of inference? 11

Applying rules of inference Assume the following statements (hypotheses): It is not sunny this afternoon and it is colder than yesterday. We will go swimming only if it is sunny. If we do not go swimming then we will take a canoe trip. If we take a canoe trip, then we will be home by sunset. Show that all these lead to a conclusion: We will be home by sunset. Applying rules of inference Text: (1) It is not sunny this afternoon and it is colder than yesterday. (2) We will go swimming only if it is sunny. (3) If we do not go swimming then we will take a canoe trip. (4) If we take a canoe trip, then we will be home by sunset. Propositions: p = It is sunny this afternoon, q = it is colder than yesterday, r = We will go swimming, s= we will take a canoe trip t= We will be home by sunset Translation: Assumptions: (1), (2)? We want to show: t 12

Applying rules of inference Approach: p = It is sunny this afternoon, q = it is colder than yesterday, r = We will go swimming, s= we will take a canoe trip t= We will be home by sunset Translation: We will go swimming only if it is sunny. Ambiguity: r p or p r? Sunny is a must before we go swimming Thus, if we indeed go swimming it must be sunny, therefore r p Applying rules of inference Text: (1) It is not sunny this afternoon and it is colder than yesterday. (2) We will go swimming only if it is sunny. (3) If we do not go swimming then we will take a canoe trip. (4) If we take a canoe trip, then we will be home by sunset. Propositions: p = It is sunny this afternoon, q = it is colder than yesterday, r = We will go swimming, s= we will take a canoe trip t= We will be home by sunset Translation: Assumptions: (1), (2) r p, (3) r s, (4) s t We want to show: t 13

Proofs using rules of inference Translations: Assumptions:, r p, r s, s t We want to show: t Proof: 1. Hypothesis 2. p Simplification 3. r p Hypothesis 4. r Modus tollens (step 2 and 3) 5. r s Hypothesis 6. s Modus ponens (steps 4 and 5) 7. s t Hypothesis 8. t Modus ponens (steps 6 and 7) end of proof Informal proofs Proving theorems in practice: The steps of the proofs are not expressed in any formal language as e.g. propositional logic Steps are argued less formally using English, mathematical formulas and so on One must always watch the consistency of the argument made, logic and its rules can often help us to decide the soundness of the argument if it is in question We use (informal) proofs to illustrate different methods of proving theorems 14

Methods of proving theorems Basic methods to prove the theorems: Direct proof is proved by showing that if p is true then q follows Indirect proof Show the contrapositive q p. If q holds then p follows Proof by contradiction Show that (p q) contradicts the assumptions Proof by cases Proofs of equivalence is replaced with () (q p) Sometimes one method of proof does not go through as nicely as the other method. Hint: try more than one approach. Direct proof is proved by showing that if p is true then q follows Example: Prove that If n is odd, then n 2 is odd. Proof: Assume the hypothesis is true, i.e. suppose n is odd. Then n = 2k + 1, where k is an integer. n 2 = (2k + 1) 2 = 4k 2 + 4k + 1 = 2(2k 2 + 2k) + 1 Therefore, n 2 is odd. 15

Indirect proof To show prove its contrapositive q p Why? and q p are equivalent!!! Assume q is true, show that p is true. Example: Prove If 3n + 2 is odd then n is odd. Proof: Assume n is even, that is n = 2k, where k is an integer. Then: 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k+1) Therefore 3n + 2 is even. Indirect proof To show prove its contrapositive q p Why? and q p are equivalent!!! Assume q is true, show that p is true. Example: Prove If 3n + 2 is odd then n is odd. Proof: Assume n is even, that is n = 2k, where k is an integer. Then: 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k+1) Therefore 3n + 2 is even. We proved n is odd 3n + 2 is odd. This is equivalent to 3n + 2 is odd n is odd. 16