# CS 103 Discrete Structures Lecture 07b

## Presentation on theme: "CS 103 Discrete Structures Lecture 07b"— Presentation transcript:

CS 103 Discrete Structures Lecture 07b
Logic and Proofs (6) Chapter 1 section 1.1 by Dr. Mosaad Hassan

The Foundations: Logic and Proofs
Chapter 1, Part III: Proofs With Question/Answer Animations

Summary Valid Arguments and Rules of Inference

Rules of Inference Section 1.6

Section Summary Valid Arguments
Inference Rules for Propositional Logic Using Rules of Inference to Build Arguments Rules of Inference for Quantified Statements Building Arguments for Quantified Statements

Arguments & Rules of Inference
An argument in propositional logic is a sequence of propositions. All but the final proposition are called premises. The last proposition is the conclusion. An argument is valid if the premises imply the conclusion To deduce new propositions from existing propositions, we use rules of inference Rules of inference are templates for constructing valid arguments Rules of inference are our basic tools for establishing the truth of statements

Valid Arguments in Propositional Logic
Consider the following argument: "If you have a password, you can log in" [premise] "You have a password" [premise] Therefore, "You can log in" [conclusion] Assume that: p is "You have a password" q is "You can log in" Then, the argument has the form: p → q p q where  is the symbol that denotes "therefore"

Valid Arguments in Propositional Logic
We would like to determine whether the argument on the previous slide is a valid argument. That is, we would like to determine whether the conclusion q must be true when the premises p → q and p are both true When p and q are propositional variables, the statement [(p → q)  p] → q is a tautology When both p → q and p are true, then q must also be true We say this form of argument is valid because whenever all its premises (all statements in the argument other than the final one, i.e. the conclusion) are true, the conclusion must also be true

Argument Validity An argument is valid if the truth of all its premises implies that the conclusion is true An argument form is a sequence of compound propositions involving propositional variables An argument form is valid if no matter which particular propositions are substituted for the propositional variables in its premises, the conclusion is true if the premises are all true, i.e. (p1  p2  …  pn)  q is a tautology, where p1 , p2 , … , pn are the premises and q is the conclusion

How to Show Validity of an Argument Form?
A truth table can be used to show that an argument form is valid We do this by showing that whenever the premises are true, the conclusion must also be true However, this can be a tedious approach. For example, if there exist 10 different propositional variables in an argument, then 210 = 1024 different rows required in a truth table to show this argument form is valid Instead, we can use rules of inference These rules can be used as building blocks to construct more complicated valid argument forms

Important Rules of Inference
The tautology [p  (p → q)] → q is the basis of the rule of inference called modus ponens. This tautology is a valid argument form and may be written as follow: p p → q  q Modus ponens tells us that if a conditional statement p → q and the hypothesis of this conditional statement p are both true, the conclusion q must also be true

Modus Ponens Consider [p  (p → q)] → q p p → q  q

Modus Ponens: Example Suppose that the conditional statement "If it snows today, then we will go skiing" and its hypothesis, "It is snowing today," are true Then, by modus ponens, it follows that the conclusion of the conditional statement, "We will go skiing," is true Remark: A valid argument can lead to an incorrect conclusion if one or more of its premises are false

Valid Argument with a False Premise
Consider the argument: The premises of the argument are p → q and p, and q is its conclusion This argument is valid because it is constructed by using modus ponens However, one of its premises is false. Therefore, the conclusion is false Valid argument with a false premise can lead to an incorrect conclusion

The most important rules of inference for propositional logic

Which Rule of Inference?
State which rule of inference is the basis of the following argument: "It is below freezing and raining now. Therefore, it is below freezing now." Solution: Let p be "It is below freezing now" and q is "It is raining now" Then the argument is of the form: p  q p This argument uses the simplification rule

Which Rule of Inference?
Which rule of inference is used in the argument: If it rains today, then we will not have a sheep today. If we do not have a sheep today, then we will have a sheep tomorrow. Therefore, if it rains today, then we will have a sheep tomorrow. Let: p be “It is raining today” q be “We will have a sheep today” r be “We will have a sheep tomorrow” Then this argument is of the form p → q q → r p → r This argument is a hypothetical syllogism

CS 103 Discrete Structures Lecture 08
Logic and Proofs (7) Chapter 1 section 1.1 by Dr. Mosaad Hassan

First Midterm Exam 2nd Lecture, week 7 (same time as the lecture)
75 minute duration Will cover all lectures delivered before the exam date Will consist of MCQ’s, fill-in-the-blanks, questions with short answers, writing of proofs, and drawing of diagrams If you miss this exam for any reason, you will have to appear for a makeup exam on the Thursday of the last week of teaching. That exam will cover all lectures delivered in the semester. It will consist of writing of proofs, drawing of diagrams and answering questions having page answers.

Using Rules to Build Arguments
If there are many premises, several rules of inference are often needed to show that an argument is valid Example: Show that the 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" and "If we take a canoe trip, then we will be home by sunset" lead to the conclusion "We will be home by sunset" Solution: Let, 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" Then the hypotheses become ¬p  q, r → p, ¬r → s, and s → t The conclusion is simply t

Using Rules to Build Arguments
We need to give a valid argument with hypotheses and conclusion We construct an argument to show that our hypotheses lead to the desired conclusion as follows: Remark: If we are to use a truth table to show this to be a valid argument, we require a table with 32 rows

Rules of Inference: Example
Show that the hypotheses "If you send me an message, then I will finish writing the program" "If you do not send me an message, then I will go to sleep early" and "If I go to sleep early, then I will wake up feeling refreshed" lead to the conclusion "If I do not finish writing the program, then I will wake up feeling refreshed" Solution: Let, p: "You send me an message" q: "I will finish writing the program" r: "I will go to sleep early" s: "I will wake up feeling refreshed" Then the hypotheses are p → q, ¬p → r, and r → s The desired conclusion is ¬q → s

Rules of Inference: Example
We need to give a valid argument with hypotheses and conclusion. We construct an argument to show that our hypotheses lead to the desired conclusion as follows: If we use a truth table to show the validity of this argument, we will require 16 rows

The Resolution Rule Computer programs have been developed to automate the task of reasoning and proving theorems Many of these programs make use of a rule of inference known as resolution This rule of inference is based on the tautology [(p  q)  (¬p  r)] → (q  r) The final disjunction in the resolution rule (q  r) is called the resolvent

The Resolution Rule: Example
Use resolution to show that the hypotheses "Omar is skiing or it is not snowing" and "It is snowing or Ali is playing hockey" imply that "Omar is skiing or Ali is playing hockey" Let: p: "It is snowing" q: "Omar is skiing" r: "Ali is playing hockey" Then the hypotheses are ¬p  q and p  r, respectively. Using resolution, the proposition q  r, "Omar is skiing or Ali is playing hockey," follows

The Resolution Rule: Example
Show that the hypotheses (p  q)  r and r → s imply the conclusion p  s We can rewrite the hypothesis (p  q)  r as two clauses, p  r and q  r (p  q)  r  (p  r)  (q  r) We can replace r → s by the equivalent clause ¬r  s r → s  ¬r  s Using the two clauses p  r and ¬r  s, we can use resolution to conclude p  s

Fallacies Fallacy: An argument that seems correct, but is not Several common fallacies arise in incorrect arguments These fallacies are discussed here to show the distinction between correct and incorrect reasoning The proposition [(p → q)  q] → p is not a tautology, because it is false when p is false and q is true However, there are many incorrect arguments that treat this as a tautology. In other words, they treat the argument with premises p → q and q and conclusion p as a valid argument form, which it is not This type of incorrect reasoning is called the fallacy of affirming the conclusion

Fallacies: Example Is this argument valid? If you do every problem in this book, then you will learn discrete structures. You learned discrete mathematics. Therefore, you did every problem in this book. Let: p: “You did every problem in this book” q: “You learned discrete structures” Then this argument is of the form: if (p → q and q) then p. [(p → q)  q] → p This is an example of an incorrect argument using the fallacy of affirming the conclusion. Indeed, it is possible for you to learn discrete structures in some way other than by doing every problem in this book. You may learn discrete structures by reading, listening to lectures, doing some, but not all, the problems in this book, and so on

Fallacies The proposition [(p → q)  ¬p] → ¬q is not a tautology, because it is false when p is false and q is true. However, many incorrect arguments use it as rule of inference This type of incorrect reasoning is called the fallacy of denying the hypothesis Example: Let p and q be as in previous example. If the conditional statement p → q is true, and ¬p is true, is it correct to conclude that ¬q is true? Solution: This incorrect argument is of the form p → q and ¬p imply ¬q, which is an example of the fallacy of denying the hypothesis

Rules of Inference for Quantifications
Universal instantiation is the rule of inference used to conclude that P(c) is true, where c is included in the domain of the premise x P(x). Example: Chinese cars are inexpensive. Geely is inexpensive. Universal generalization is the rule of inference that states that x P(x) is true, given the premise that P(c) is true for all elements c in the domain Universal generalization is used when we show that x P(x) is true by taking an arbitrary element c from the domain and showing that P(c) is true

Rules of Inference for Quantifications
Existential instantiation is the rule that allows us to conclude that there is an element c in the domain for which P(c) is true if we know that x P(x) is true We cannot select an arbitrary value of c here, but rather it must be a c for which P(c) is true Usually we have no knowledge of what c is, only that it exists Because it exists, we may give it a name ‘c’ and continue our argument Existential generalization is the rule of inference that is used to conclude that x P(x) is true when a particular element c with P(c) true is known That is, if we know one element c in the domain for which P(c) is true, then we know that x P(x) is true

Rules of Inference for Quantifications

Rules of Inference for Quantifications
Show that the premises "Everyone in this discrete mathematics class has taken a course in computer science" and "Ahmad is a student in this class" imply the conclusion "Ahmad has taken a course in computer science" Solution: Let, D(x): "x is in this discrete mathematics class" C(x): "x has taken a course in computer science" Then, premises are x [D(x) → C(x)] and D(Ahmad) conclusion is C(Ahmad) This is how we establish the conclusion from the premises

Rules of Inference for Quantifications
Show that the premises "A student in this class has not read the book" and "Everyone in this class passed the first exam" imply the conclusion "Someone who passed the first exam has not read the book" Solution: Let, C(x): "x is in this class" B(x): "x has read the book" P(x): "x passed the first exam" Premises are x [C(x)  ¬B(x)] & x [C(x ) → P(x)] Conclusion is x [P(x)  ¬B(x)] The steps on the following slide can be used to establish the conclusion from the premises

Rules of Inference for Quantifications

Combining Rules of Inference for Propositions and Quantified Statements
In previous two examples we used both universal instantiation and modus ponens This combination of rules is sometimes called the universal modus ponens rule: If x [P(x) → Q(x)] is true, and if P(a) is true for a particular element a in the domain of the universal quantifier, then Q(a) must also be true We can describe universal modus ponens as follows : x [P(x) → Q(x)] P(a), where a is a particular element in the domain  Q(a)

Combining Rules of Inference for Propositions and Quantified Statements
Assume that "For all positive integers n, if n is greater than 4, then n2 is less than 2n" is true. Use universal modus ponens to show that 1002 < 2100 Solution: Let, P(n) denote "n > 4" Q(n) denote "n2 < 2n" The original statement can be n [P(n) → Q(n)], where the domain consists of all positive integers We are assuming that n [P(n) → Q(n)] is true. Note that P(100) is true because 100 > 4 It follows, by universal modus ponens, that Q(100) is true, namely that 1002 < 2100

Section 1.6: Exercises 1. Find the argument form for the following argument and determine whether it is valid. Can we conclude that the conclusion is true if the premises are true?

Exercises 2. What rule of inference is used in each of these arguments?

Exercises 3. What rule of inference is used in each of these arguments?

Exercises 4. For each of these sets of premises, what relevant conclusion or conclusions can be drawn? Explain the rules of inference used to obtain each conclusion from the premises

Exercises 5. For each of these sets of premises, what relevant conclusion or conclusions can be drawn? Explain the rules of inference used to obtain each conclusion from the premises

Exercises 6. Determine whether each of these arguments is valid. If an argument is correct, what rule of inference is being used? If it is not, what logical error occurs? 7. Determine whether these are valid arguments.

Exercises

Exercises 10. Use resolution to show the hypotheses "Allen is a bad boy or Hillary is a good girl" and "Allen is a good boy or David is happy" imply the conclusion "Hillary is a good girl or David is happy”

Introduction to Proofs
Section 1.8

Section Summary Mathematical Proofs Forms of Theorems Direct Proofs
Indirect Proofs Proof of the Contrapositive Proof by Contradiction

Proofs We introduce the notion of a proof and describe methods for constructing proofs A proof is a valid argument that establishes the truth of a mathematical statement A proof can use: The hypotheses of the theorem Axioms assumed to be true Previously proven theorems

Types of Proofs Formal, where: all steps are supplied
the rules for each step in the argument were given Informal, where: more than one rule of inference may be used in each step steps may be skipped the axioms being assumed and the rules of inference used are not explicitly stated Informal proofs can explain to humans why theorems are true, while computers are producing formal proofs using automated reasoning systems

Proofs: Terminology Theorem is a statement that can be shown to be true. Its is sometimes referred to as a fact or result Proof is a valid argument that establishes the truth of a theorem. We demonstrate that a theorem is true with a proof. Axiom is the statement used in a proof, which is assumed to be true Lemma is less important theorem that is helpful in the proof of other results Corollary is a theorem that can be established directly from a theorem that has been proved. Conjecture is a statement that is being proposed to be a true statement, usually on the basis of some partial evidence, a heuristic argument, or the intuition of an expert

How to State A Theorem? Many theorems assert that a property holds for all elements in a domain, such as all integers Although the precise statement of such theorems needs to include a universal quantifier, sometimes we ignore the quantifiers For example, the statement: "If x > y, where x and y are positive real numbers, then x2 > y2" really means "For all positive real numbers x and y, if x > y, then x2 > y2" Steps of A Proof Select a general element of the domain Show that it has the property in question Assure that the theorem holds for all members of the domain

Proving Theorems Many theorems have the form:
To prove them, we show that where c is an arbitrary element of the domain, By universal generalization the truth of the original formula follows So, we must prove something of the form:

Methods of Proving Theorems
Direct proofs Proof by contraposition Vacuous proofs Trivial proofs Proof by contradiction Proofs of equivalence Counterexamples Proof by cases Existence proofs Uniqueness proofs

CS 103 Discrete Structures Lecture 09
Logic and Proofs (8) Chapter 1 section 1.1 by Dr. Mosaad Hassan

First Midterm Exam 2nd Lecture, week 7 (same time as the lecture)
75 minute duration Will cover all lectures delivered before the exam date Will consist of MCQ’s, fill-in-the-blanks, questions with short answers, writing of proofs, and drawing of diagrams If you miss this exam for any reason, you will have to appear for a makeup exam on the Thursday of the last week of teaching. That exam will cover all lectures delivered in the semester. It will consist of writing of proofs, drawing of diagrams and answering questions having page answers.

Direct Proofs A direct proof of a conditional statement p → q (theorem of the form x [P(x) → Q(x)]) is constructed when we: Assume that p is true Use rules of inference, axioms, previously proven theorems to show that q must also be true We ensure that the combination p true and q false never occurs

Even and Odd Integers The integer n is:
Even if there exists an integer k such that n = 2k Odd if there exists an integer k such that n = 2k+1 Note: An integer is either even or odd, and no integer is both even and odd

Direct Proofs: Example
Theorem: If n is an odd integer, then n2 is odd Proof: This theorem states n [P(n) → Q(n)], where P(n) is n is an odd integer Q(n) is n2 is odd Assume that the hypothesis of this conditional statement is true (i.e. n is an odd integer) Then n = 2k + I, where k is some integer To show that n2 is also odd, we square both sides n2 = (2k + 1)2 = 4k2 + 4k + I = 2(2k2 + 2k) + I Since k is integer, then 2k2 + 2k is also integer By the definition of an odd integer, we can conclude that n2 is an odd integer

Direct Proofs: Example
Theorem: If m and n are both perfect squares, then nm is also a perfect square (An integer a is a perfect square if there is an integer b such that a = b2) Proof Assume that the hypothesis of this conditional statement is true (i.e. m and n are perfect squares) By definition of a perfect square, there are integers s and t such that m = s2 and n = t2 By multiplying the two equations m = s2 and n = t2 we have mn = (st)2 By the definition of perfect square, it follows that mn is also a perfect square, because it is the square of st, which is an integer

Indirect Proof Direct proofs begin with the premises, continue with a sequence of deductions, end with the conclusion Indirect proofs do not start with the hypothesis and end with the conclusion

Proof by Contraposition
Proof by contraposition is a type of indirect proofs Proofs by contraposition depend on the equivalence between p → q and its contrapositive, ¬q → ¬p To perform an indirect proof of p → q, do a direct proof of ¬q → ¬p In a proof by contraposition of p → q, we take ¬q as a hypothesis, and continue to show that ¬p must follow

Proof by Contraposition: Example
Theorem: If n2 is an odd integer then n is odd p: n2 is an odd integer q: n is an odd integer p → q Proof We prove the contrapositive: If n is an even integer, then n2 is even ¬q: ¬(n is an odd integer)  n is an even integer ¬p: ¬(n2 is an odd integer)  n2 is an even integer ¬q → ¬p n = 2k is even for some integer k (definition of even numbers) n2 = (2k)2 = 4k2 = 2(2k2) Since n2 is 2 times an integer, it is even. ¬q → ¬p  p → q

Proof by Contraposition: Example
Theorem: if n is an integer and 3n + 2 is odd, then n is odd Direct Proof Assume that 3n + 2 is an odd integer This means that 3n + 2 = 2k + 1 for some integer k Can we use this fact to show that n is odd? We see that 3n + 1 = 2k, but there does not seem to be any direct way to conclude that n is odd Proof by Contraposition (Indirect Proof) Assume that conclusion of the theorem is false (i.e. n is even) Then n = 2k for some integer k Substituting 2k for n: 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) This tells us that 3n + 2 is even and therefore not odd. This is the negation of the hypothesis of the theorem. Then the original conditional statement is true since the negation of the conclusion of the conditional statement implies that the hypothesis is false

Proof by Contraposition: Example
Theorem: if n is an integer & n3+5 is odd, then n is even Direct Proof Assume n3 + 5 is odd then n3 + 5 = 2k + 1 for some integer k (definition of odd numbers) Then n3 = 2k - 4, but there does not seem to be any direct way to conclude that n is even Proof by Contraposition (Indirect Proof) Contrapositive: If n is odd, then n3 + 5 is even Assume n is odd then n = 2k + 1 for some integer k (definition of odd numbers) n3 + 5 = (2k + 1)3 + 5 = 8k3 + 12k2 + 6k + 6 = 2(4k3 + 6k2 + 3k + 3). As 2(4k3+6k2+3k+3) is 2 times an integer, it is even  n3+5 is even. Then the original statement is true.

Vacuous Proofs A conditional statement p → q can be proved quickly that is true when we know that p is false Consequently, if we can show that p is false, then we have a proof, called a vacuous proof Vacuous proofs are often used to establish special cases of theorems that state that a conditional statement is true for all positive integers, i.e., a theorem of the kind n P(n), where P(n) is a propositional function

Vacuous Proofs: Example
Theorem: P(0) is true, where P(n) is If n > 1, then n2 > n and the domain consists of all integers Proof: Note that P(0) is If 0 > 1, then 02 > 0 The hypothesis 0 > 1 is false. By using vacuous proof, this tells us that P(0) is automatically true. Remark: A conditional statement with a false hypothesis is guaranteed to be true. So that the conclusion of this conditional statement, 02 > 0, is false is irrelevant to the truth value of the conditional statement

Trivial Proofs A conditional statement p → q can be proved quickly that is true when we know that q is true Consequently, if we can show that q is true, then we have a proof, called a trivial proof Trivial proofs are often important when special cases of theorems are proved and in mathematical induction

Trivial Proofs: Example
Theorem: P(0) is true, where P(n) is If a and b are positive integers with a ≥ b, then an ≥ bn and the domain consists of all integers Proof The proposition P(0) is If a ≥ b, then a0 ≥ b0 Because a0 = b0 = 1, the conclusion of the conditional statement is true Then this conditional statement P(0) is true Note that the hypothesis, which is the statement a ≥ b, was not needed in this proof

To prove that a statement p is true, we can find a contradiction q such that ¬p → q is true As q is always false, and ¬p → q is true, then ¬p must be false, which means that p is true How do we find a contradiction q? It is known that r  ¬r is a contradiction whenever r is a proposition Then we can prove that p is true if we can show that ¬p → (r  ¬r) is true for some proposition r Proofs of this type are called proofs by contradiction Remark: Because a proof by contradiction does not prove a result directly, it is a type of indirect proof p q ¬p ¬p → q 1

Theorem: If you pick 22 days from the calendar, at least 4 must fall on the same day of the week Proof: Assume that no more than 3 of the 22 days fall on the same day of the week Because there are 7 days of the week, we could only have picked 21 days This contradicts the assumption that we have picked 22 days

Theorem: If 3n + 2 is odd, then n is odd Proof: Let p be 3n + 2 is odd and q be n is odd, then p → q To prove by contradiction, assume that both p and ¬q are true, i.e. 3n + 2 is odd and n is even Now we show the contradiction that if n is even, then 3n + 2 is even, i.e. ¬q → ¬p Since n is even, there is an integer k such that n=2k This implies that: 3n + 2 = 3(2k) + 2 = 6k + 2 = 2(3k + 1) 2(3k + 1) is even as k is an integer  3n + 2 is even Therefore, we have a contradiction This completes the proof by contradiction, proving that if 3n + 2 is odd, then n is odd

Theorem: If n is an integer & n3 +5 is odd, then n is even Proof: We can rewrite the theorem as If n3 + 5 is odd, then n is even Let p be n3 + 5 is odd and q be n is even Assume p is true and ¬q is true This means that n3 + 5 is odd, and n is odd n = 2k + 1 for some integer k (definition of odd numbers) n3+5 = (2k+1)3+5 = 8k3+12k2+6k+6 = 2(4k3+6k2+3k+3) As 2(4k3+6k2+3k+3) is 2 times an integer, it is even This leads to contradiction, which proves the theorem

Proofs of Equivalence To prove a theorem that is a bi-conditional statement (of the form p  q), we show that p → q and q → p are both true. The validity of this approach is based on the tautology: (p  q)  [(p → q)  (q → p)] Theorem: If n is a positive integer, then n is odd if and only if n2 is odd Proof This theorem has the form p if and only if q where p is n is odd and q is n2 is odd To prove this theorem, we need to show that p →q and q → p are true We have already shown that p → q and q → p are true Then the theorem is true

Proofs of Equivalence: Example
Theorem: m2 = n2 iff m = n or m = -n Proof: Rephrased: (m2 = n2) ↔ [(m = n)  (m = -n)] Consider [(m = n)  (m = -n)] → (m2 = n2) If (m = n)  (m = -n) is true then m = n or m = -n are true In both cases we can conclude that m2 = n2  [(m = n)  (m = -n)] → (m2 = n2) is true Consider (m2 = n2) → [(m = n)  (m = -n)] If (m2 = n2) is true then (m = n) or (m = -n) are true  (m = n)  (m = -n) is true  (m2 = n2) → [(m = n)  (m = -n)] is true Since both [(m = n)  (m = -n)] → (m2 = n2) and (m2 = n2) → [(m = n)  (m = -n)] are true, (m2 = n2) ↔ [(m = n)  (m = -n)] is true. End of proof.

Proofs: Example Theorem: The following about the integer n are equivalent: p1: n is even p2: n - 1 is odd p3: n2 is even Proof: To show that these three statements are equivalent we show the statements p1 → p2, p2 →p3, and p3 →p1 are true We use a direct proof to show that p1 → p2 Suppose that n is even. Then n = 2k for some integer k  n - 1 = 2k - 1 = 2(k - 1) + 1. This means that n - 1 is odd, because it is of the form 2m + 1, where m is the integer k-1 We also use a direct proof to show that p2 →p3 Suppose n - 1 is odd. Then n -1= 2k + 1 for some integer k n = 2k+2 & n2 =(2k+2)2 = 4k2 + 8k + 4 = 2(2k2 + 4k + 2) This means that n2 is twice the integer 2k2 + 4k + 2, and hence is even To prove p3 →p1 , we use a proof by contraposition That is, we prove that if n is not even, then n2 is not even This is the same as proving that if n is odd, then n2 is odd, which we have already done in previous example This completes the proof

Counterexamples To show that a statement of the form x P(x) is false, we need only find a counterexample, that is, an example x for which P(x) is false When is counterexample needed? If there is a statement of the form x P(x): which we believe to be false or which has resisted all proof attempts Note that this is DISPROVING a UNIVERSAL statement by a counterexample Examples x ¬R(x), where R(x) means x has red hair Find one person (in the domain) who has red hair Every positive integer is the square of another Square root of 5 is 2.236, which is not an integer

Proof by Counterexample
Theorem: Every positive integer is the sum of the squares of two integers is false Proof To show that this statement is false, we look for a counterexample, which is a particular integer that is not the sum of the squares of two integers The integer 3 cannot be written as the sum of the squares of two integers Consequently, we have shown that Every positive integer is the sum of the squares of two integers is false

Mistakes in Proofs There are many common errors made in constructing mathematical proofs Among the most common errors are mistakes in arithmetic and basic algebra. Whenever you use such computations you should check them as carefully as possible. Each step of a mathematical proof needs to be correct and the conclusion needs to follow logically from the steps that precede it. Many mistakes result from the introduction of steps that do not logically follow from those that precede them

Mistakes in Proofs: Example
What is wrong with the following proof of 1 = 2? Proof: We use these steps, where a and b are two equal positive integers Every step is valid except step 5, where we divided both sides by a - b. The error is that a - b equals zero Note: Division of both sides of an equation by the same quantity is valid as long as that quantity is not zero

Mistakes in Proofs: Example
What is wrong with this proof of if n2 is positive, then n is positive? Proof: Suppose that n2 is positive. Because the conditional statement if n is positive, then n2 is positive is true, we can conclude that n is positive. Let P(n) be n is positive and Q(n) be n2 is positive Then our hypothesis is Q(n). The statement if n is positive, then n2 is positive is the statement n(P(n) → Q(n)) From the hypothesis Q(n) and the statement n(P(n) → Q(n)) we cannot conclude P(n) Because we are not using a valid rule of inference Instead, this is an example of the fallacy of affirming the conclusion A counterexample is supplied by n = -1 for which n2 = 1 is positive, but n is negative

Section 1.8: Exercises 1. Use a direct proof to show that:
a) The sum of two odd integers is even. b) The sum of two even integers is even. c) The square of an even number is an even number d) The additive inverse, or negative, of an even number is an even number e) The product of two odd numbers is odd. f) Every odd integer is the difference of two squares. g) The product of two rational numbers is rational.

Exercises 2. Prove that if m + n and n + p are even integers, where m, n, and p are integers, then m + p is even. What kind of proof did you use? 4. Use a proof by contradiction to prove that the sum of an irrational number and a rational number is irrational. 5. Prove or disprove that: a) The product of two irrational numbers is irrational. b) The product of a nonzero rational number and an irrational number is irrational. 6. Prove that: a) If x is irrational, then 1/x is irrational. b) If x is rational and x ≠ 0, then 1/x is rational. c) If m and n are integers and m n is even, then m is even or n is even. e) If n is a perfect square, then n + 2 is not a perfect square

Exercises 7. Show that: i) If n is an integer and n3 + 5 is odd, then n is even ii) If n is an integer and 3n + 2 is even, then n is even Using: a) a proof by contraposition. b) a proof by contradiction. 8. Use a proof by contraposition to show that if x + y ≥2, where x and y are real numbers, then x ≥ 1 or y ≥ 1 9. Prove the proposition P(0), where P(n) is the proposition "If n is a positive integer greater than 1, then n2 > n.“ What kind of proof did you use? 10. Prove the proposition P(1), where p(n) is the proposition "If n is a positive integer, then n2 ≥ n." What kind of proof did you use? 11. Find a counterexample to the statement that every positive integer can be written as the sum of the squares of three integers

Exercises