The Foundations Logic and Proofs CSC2259 Discrete Structures

  • Slides: 76
Download presentation
The Foundations: Logic and Proofs CSC-2259 Discrete Structures K. Busch - LSU 1

The Foundations: Logic and Proofs CSC-2259 Discrete Structures K. Busch - LSU 1

Propositional Logic Proposition is a declarative statement that is either true of false •

Propositional Logic Proposition is a declarative statement that is either true of false • Baton Rouge is the capital of Louisiana • Toronto is the capital of Canada • 1+1=2 • 2+2=3 True False Statements which are not propositions: • What time is it? • x+1 = 2 K. Busch - LSU 2

Negation: truth table T F F T K. Busch - LSU 3

Negation: truth table T F F T K. Busch - LSU 3

Conjunction: truth table T T F F F T F F K. Busch -

Conjunction: truth table T T F F F T F F K. Busch - LSU 4

Disjunction: truth table T T F F F K. Busch - LSU 5

Disjunction: truth table T T F F F K. Busch - LSU 5

Exclusive-or: one or the other but not both truth table T T F T

Exclusive-or: one or the other but not both truth table T T F T F T T F F F K. Busch - LSU 6

(hypothesis) (conclusion) Conditional statement: if p then q p implies q q follows from

(hypothesis) (conclusion) Conditional statement: if p then q p implies q q follows from p p only if q p is sufficient for q K. Busch - LSU truth table T T F F F T T F F T 7

Conditional statement: equivalent (same truth table) Contrapositive: Converse: equivalent Inverse: K. Busch - LSU

Conditional statement: equivalent (same truth table) Contrapositive: Converse: equivalent Inverse: K. Busch - LSU 8

Biconditional statement: p if and only if q p iff q truth table If

Biconditional statement: p if and only if q p iff q truth table If p then q and conversely p is necessary and sufficient for q K. Busch - LSU T T F F F T 9

Compound propositions T T F F F T T F F Precedence of operators

Compound propositions T T F F F T T F F Precedence of operators higher lower K. Busch - LSU 10

Translating English into propositions K. Busch - LSU 11

Translating English into propositions K. Busch - LSU 11

Logic and Bit Operations Boolean variables OR AND XOR 0 0 0 1 1

Logic and Bit Operations Boolean variables OR AND XOR 0 0 0 1 1 0 1 0 1 1 1 0 Bit string K. Busch - LSU 12

Propositional Equivalences Compound proposition Tautology: always true Contradiction: always false tautology contradiction T F

Propositional Equivalences Compound proposition Tautology: always true Contradiction: always false tautology contradiction T F F T T F Contingency: not a tautology and not a contradiction K. Busch - LSU 13

Logically equivalent compound propositions: is a tautology Have same truth table Example: T T

Logically equivalent compound propositions: is a tautology Have same truth table Example: T T F T T T F F F T T T K. Busch - LSU 14

De Morgan’s laws T T T F F T F F T T F

De Morgan’s laws T T T F F T F F T T F F F T T K. Busch - LSU 15

Identity laws Domination laws Idempotent laws Negation laws Double Negation law K. Busch -

Identity laws Domination laws Idempotent laws Negation laws Double Negation law K. Busch - LSU 16

Commutative laws Associative laws Distributive laws K. Busch - LSU Absorption laws 17

Commutative laws Associative laws Distributive laws K. Busch - LSU Absorption laws 17

Conditional Statements Biconditional Statements K. Busch - LSU 18

Conditional Statements Biconditional Statements K. Busch - LSU 18

Construct new logical equivalences (De Morgan’s laws) (Double negation law) K. Busch - LSU

Construct new logical equivalences (De Morgan’s laws) (Double negation law) K. Busch - LSU 19

Predicates and Quantifiers variable predicate Propositional functions K. Busch - LSU 20

Predicates and Quantifiers variable predicate Propositional functions K. Busch - LSU 20

Predicate logic K. Busch - LSU 21

Predicate logic K. Busch - LSU 21

Predicate logic predicate 2 -ary predicate 3 -ary predicate n-ary predicate K. Busch -

Predicate logic predicate 2 -ary predicate 3 -ary predicate n-ary predicate K. Busch - LSU 22

Universal quantifier: for all it holds (for every element in domain) is true for

Universal quantifier: for all it holds (for every element in domain) is true for every real number (for every element in domain) is not true for every real number Counterexample: K. Busch - LSU 23

Existential quantifier: there is such that is true because is not true K. Busch

Existential quantifier: there is such that is true because is not true K. Busch - LSU 24

For finite domain K. Busch - LSU 25

For finite domain K. Busch - LSU 25

Quantifiers with restricted domain Precedence of operators higher lower K. Busch - LSU 26

Quantifiers with restricted domain Precedence of operators higher lower K. Busch - LSU 26

Bound variable free variable Scope of K. Busch - LSU 27

Bound variable free variable Scope of K. Busch - LSU 27

Logical equivalences with quantifiers False K. Busch - LSU 28

Logical equivalences with quantifiers False K. Busch - LSU 28

De Morgan’s Laws for Quantifiers K. Busch - LSU 29

De Morgan’s Laws for Quantifiers K. Busch - LSU 29

Example Recall that: K. Busch - LSU 30

Example Recall that: K. Busch - LSU 30

Translating English into Logical Expressions “All hummingbirds are richly colored” “No large birds live

Translating English into Logical Expressions “All hummingbirds are richly colored” “No large birds live on honey” “Birds that do not live on honey are dull in color” “Hummingbirds are small” K. Busch - LSU 31

Nested Quantifiers Additive inverse Commutative law for addition Associative law for addition K. Busch

Nested Quantifiers Additive inverse Commutative law for addition Associative law for addition K. Busch - LSU 32

Order of quantifiers K. Busch - LSU 33

Order of quantifiers K. Busch - LSU 33

We cannot always change the order of quantifiers true false But not the converse

We cannot always change the order of quantifiers true false But not the converse K. Busch - LSU 34

Translating Math Statements “The sum of two positive integers is always positive” “Every real

Translating Math Statements “The sum of two positive integers is always positive” “Every real number except zero has a multiplicative inverse” K. Busch - LSU 35

For every real number there exists a real number such that whenever K. Busch

For every real number there exists a real number such that whenever K. Busch - LSU 36

Translating into English “Every student has a computer or has a friend who has

Translating into English “Every student has a computer or has a friend who has a computer” K. Busch - LSU 37

“There is a student none of whose friends are also friends with each other”

“There is a student none of whose friends are also friends with each other” K. Busch - LSU 38

Translating English into Logical Expressions “If a person is female and is a parent,

Translating English into Logical Expressions “If a person is female and is a parent, then this person is someone’s mother” female parent K. Busch - LSU mother of 39

“Everyone has exactly one best friend” Best friends K. Busch - LSU 40

“Everyone has exactly one best friend” Best friends K. Busch - LSU 40

Negating nested quantifiers Recall: K. Busch - LSU 41

Negating nested quantifiers Recall: K. Busch - LSU 41

Rules of Inference If you have a current password, then you can log onto

Rules of Inference If you have a current password, then you can log onto the network You have a current password Therefore, you can log onto the network Modus Ponens Valid argument: if premises are true then conclusion is true K. Busch - LSU 42

If , then We know that (true) Therefore, (true) Valid argument, true conclusion K.

If , then We know that (true) Therefore, (true) Valid argument, true conclusion K. Busch - LSU 43

If , then We know that (false) Therefore, (false) Valid argument, false conclusion K.

If , then We know that (false) Therefore, (false) Valid argument, false conclusion K. Busch - LSU 44

Modus Ponens If and then K. Busch - LSU 45

Modus Ponens If and then K. Busch - LSU 45

Rules of Inference Modus Ponens Modus Tollens Hypothetical Syllogism Disjunctive Syllogism K. Busch -

Rules of Inference Modus Ponens Modus Tollens Hypothetical Syllogism Disjunctive Syllogism K. Busch - LSU 46

Rules of Inference Addition Simplification Conjunction Resolution K. Busch - LSU 47

Rules of Inference Addition Simplification Conjunction Resolution K. Busch - LSU 47

It is below freezing now Therefore, it is either below freezing or raining now

It is below freezing now Therefore, it is either below freezing or raining now Addition K. Busch - LSU 48

It is below freezing and raining now Therefore, it is below freezing now Simplification

It is below freezing and raining now Therefore, it is below freezing now Simplification K. Busch - LSU 49

If it rains today then we will not have a barbecue today If we

If it rains today then we will not have a barbecue today If we do not have a barbecue today then we will have a barbecue tomorrow Therefore, if it rains today then we will have a barbecue tomorrow Hypothetical Syllogism K. Busch - LSU 50

it is not snowing or Jasmine is skiing It is snowing or Bart is

it is not snowing or Jasmine is skiing It is snowing or Bart is playing hockey Therefore, Jasmine is skiing or Bart is playing hockey Resolution K. Busch - LSU 51

Hypothesis: It is not sunny this afternoon and it is colder than yesterday We

Hypothesis: 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 Conclusion: We will be home by sunset K. Busch - LSU 52

Hypothesis Simplification from 1 Hypothesis Modus tollens from 2, 3 Hypothesis Modus ponens from

Hypothesis Simplification from 1 Hypothesis Modus tollens from 2, 3 Hypothesis Modus ponens from 4, 5 Hypothesis Modus ponens from 6, 7 K. Busch - LSU 53

Fallacy of affirming the conclusion If you do every problem in this book then

Fallacy of affirming the conclusion If you do every problem in this book then you will learn discrete mathematics You learned discrete mathematics Therefore, you did every problem in this book K. Busch - LSU 54

Fallacy of denying the hypothesis If you do every problem in this book then

Fallacy of denying the hypothesis If you do every problem in this book then you will learn discrete mathematics You didn’t do every problem in this book Therefore, you didn’t learn discrete mathematics K. Busch - LSU 55

Rules of inference for quantifiers Universal Instantiation Universal Generalization Existential Instantiation Existential Generalization K.

Rules of inference for quantifiers Universal Instantiation Universal Generalization Existential Instantiation Existential Generalization K. Busch - LSU 56

Premises: A student in this class has not read the book Everyone in this

Premises: A student in this class has not read the book Everyone in this class passed the first exam Conclusion: Someone who passed the first exam has not read the book K. Busch - LSU 57

Premise Existential instantiation from 1 Simplification from 2 Premise Universal instantiation from 1 Modus

Premise Existential instantiation from 1 Simplification from 2 Premise Universal instantiation from 1 Modus Ponens from 3, 5 Simplification from 2 Conjunction from 6, 7 Existential generalization from 8 K. Busch - LSU 58

Universal Modus Ponens For all positive integers , if then Therefore, K. Busch -

Universal Modus Ponens For all positive integers , if then Therefore, K. Busch - LSU 59

Proofs Theorem: the main result that we want to prove Lemma: intermediate result used

Proofs Theorem: the main result that we want to prove Lemma: intermediate result used in theorem proof Axiom: basic truth Corollary: immediate consequence of theorem Conjecture: something to be proven K. Busch - LSU 60

Typically, we want to prove statements Proof technique: show that for some arbitrary and

Typically, we want to prove statements Proof technique: show that for some arbitrary and apply universal generalization K. Busch - LSU 61

Direct proof: Proof by contraposition: Proof by contradiction: If we want to prove K.

Direct proof: Proof by contraposition: Proof by contradiction: If we want to prove K. Busch - LSU 62

Definition: An integer is either even or odd K. Busch - LSU 63

Definition: An integer is either even or odd K. Busch - LSU 63

Theorem: if is an even integer, then is even Proof: (direct proof Therefore, )

Theorem: if is an even integer, then is even Proof: (direct proof Therefore, ) is even End of proof K. Busch - LSU 64

Theorem: if is an odd integer, then is odd Proof: (direct proof Therefore, )

Theorem: if is an odd integer, then is odd Proof: (direct proof Therefore, ) is odd End of proof K. Busch - LSU 65

Theorem: if is an even integer, then is even Proof: (proof by contraposition )

Theorem: if is an even integer, then is even Proof: (proof by contraposition ) (see last proof) Therefore: End of proof K. Busch - LSU 66

Theorem: if is an odd integer, then is odd Proof: (proof by contraposition )

Theorem: if is an odd integer, then is odd Proof: (proof by contraposition ) Therefore: End of proof K. Busch - LSU 67

Theorem: is irrational Proof: (proof by contradiction Assume ) is rational and have no

Theorem: is irrational Proof: (proof by contradiction Assume ) is rational and have no common divisor greater than 1 Therefore: K. Busch - LSU 68

common divisor is 2 Therefore: K. Busch - LSU 69

common divisor is 2 Therefore: K. Busch - LSU 69

Therefore: Conjunction contradiction K. Busch - LSU 70

Therefore: Conjunction contradiction K. Busch - LSU 70

Therefore: Modus Tollens End of proof K. Busch - LSU 71

Therefore: Modus Tollens End of proof K. Busch - LSU 71

Counterexamples False statement: “Every positive integer is the sum of the squares of two

Counterexamples False statement: “Every positive integer is the sum of the squares of two integers” Counterexample: Any other combination gives sum larger than 3 K. Busch - LSU 72

Proof by cases We want to prove We know Instead, we can prove each

Proof by cases We want to prove We know Instead, we can prove each case Case 1 Case 2 K. Busch - LSU Case n 73

Theorem: If is integer, then Case 1 Proof: Case 2 Case 3 Case 1:

Theorem: If is integer, then Case 1 Proof: Case 2 Case 3 Case 1: Case 2: Case 3: End of proof K. Busch - LSU 74

Existence Proofs Theorem: There is a positive integer that can be written as the

Existence Proofs Theorem: There is a positive integer that can be written as the sum of cubes in two different ways Proof: (constructive existence proof) End of proof K. Busch - LSU 75

Theorem: There exist irrational numbers such that is rational Proof: (non-constructive existence proof) We

Theorem: There exist irrational numbers such that is rational Proof: (non-constructive existence proof) We know: is irrational If is irrational K. Busch - LSU End of proof 76