CS 103 Discrete Structures Lecture 07b Logic and Proofs (6)

84
CS 103 Discrete Structures Lecture 07b Logic and Proofs (6)

Transcript of CS 103 Discrete Structures Lecture 07b Logic and Proofs (6)

The Foundations: Logic and Proofs

CS 103 Discrete Structures Lecture 07bLogic and Proofs (6)

1Chapter 1 section 1.1 by Dr. Mosaad HassanThe Foundations: Logic and ProofsChapter 1, Part III: ProofsWith Question/Answer AnimationsSummaryValid Arguments and Rules of InferenceRules of InferenceSection 1.6Section SummaryValid ArgumentsInference Rules for Propositional LogicUsing Rules of Inference to Build ArgumentsRules of Inference for Quantified StatementsBuilding Arguments for Quantified Statements

Arguments & Rules of InferenceAn 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 inferenceRules of inference are templates for constructing valid argumentsRules of inference are our basic tools for establishing the truth of statementsValid Arguments in Propositional LogicConsider 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 qpqwhere is the symbol that denotes "therefore" Valid Arguments in Propositional LogicWe 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 tautologyWhen 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 trueArgument ValidityAn argument is valid if the truth of all its premises implies that the conclusion is trueAn argument form is a sequence of compound propositions involving propositional variablesAn 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 conclusionHow to Show Validity of an Argument Form?A truth table can be used to show that an argument form is validWe do this by showing that whenever the premises are true, the conclusion must also be trueHowever, 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 validInstead, we can use rules of inferenceThese rules can be used as building blocks to construct more complicated valid argument forms

Important Rules of InferenceThe 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:pp q q

Modus ponens tells us that if a conditional statementp q and the hypothesis of this conditional statement p are both true, the conclusion q must also be true Modus PonensConsider [p (p q)] q pp q q

Modus Ponens: ExampleSuppose that the conditional statement "If it snows today, then we will go skiing" and its hypothesis, "It is snowing today," are trueThen, 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 falseValid Argument with a False PremiseConsider 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 qp This argument uses the simplification ruleWhich 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 todayq be We will have a sheep todayr be We will have a sheep tomorrowThen this argument is of the form p q q r p r This argument is a hypothetical syllogismCS 103 Discrete Structures Lecture 08Logic and Proofs (7)

18Chapter 1 section 1.1 by Dr. Mosaad HassanFirst Midterm Exam2nd Lecture, week 7 (same time as the lecture)75 minute durationWill cover all lectures delivered before the exam dateWill consist of MCQs, 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 0.5-1 page answers.Using Rules to Build ArgumentsIf 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 afternoonq:"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 becomep q, r p, r s, and s t

The conclusion is simply tUsing Rules to Build ArgumentsWe 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: ExampleShow that the hypotheses "If you send me an e-mail message, then I will finish writing the program" "If you do not send me an e-mail 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 e-mail 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 sRules of Inference: ExampleWe 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 RuleComputer 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 resolventThe Resolution Rule: ExampleUse 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," followsThe Resolution Rule: ExampleShow 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 sr s r s

Using the two clauses p r and r s, we can use resolution to conclude p sFallacies Fallacy: An argument that seems correct, but is notSeveral common fallacies arise in incorrect arguments These fallacies are discussed here to show the distinction between correct and incorrect reasoningThe proposition [(p q) q] p is not a tautology, because it is false when p is false and q is trueHowever, 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 notThis type of incorrect reasoning is called the fallacy of affirming the conclusionFallacies: ExampleIs 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 bookq: 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 onFallaciesThe 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 formp q and p imply q, which is an example of the fallacy of denying the hypothesisRules of Inference for QuantificationsUniversal 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 isinexpensive.

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 domainUniversal generalization is used when we show thatx P(x) is true by taking an arbitrary element c from the domain and showing that P(c) is trueRules of Inference for QuantificationsExistential 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 trueUsually 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 argumentExistential 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 trueRules of Inference for Quantifications

Rules of Inference for QuantificationsShow 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 QuantificationsShow 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 premisesRules of Inference for Quantifications

Combining Rules of Inference for Propositions and Quantified Statements In previous two examples we used both universal instantiation and modus ponensThis 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 trueWe 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)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 < 2100Solution: 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 integersWe are assuming that n [P(n) Q(n)] is true.Note that P(100) is true because 100 > 4It follows, by universal modus ponens, that Q(100) is true, namely that 1002 < 2100Combining Rules of Inference for Propositions and Quantified Statements 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?

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

Exercises4. 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

Exercises5. 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

Exercises6. 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

Exercises10. 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 ProofsSection 1.8Section SummaryMathematical ProofsForms of TheoremsDirect ProofsIndirect ProofsProof of the ContrapositiveProof by Contradiction

ProofsWe 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 theoremAxioms assumed to be truePreviously proven theoremsTypes of ProofsFormal, where:all steps are suppliedthe rules for each step in the argument were given

Informal, where:more than one rule of inference may be used in each stepsteps may be skippedthe 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 systemsProofs: Terminology Theorem is a statement that can be shown to be true. Its is sometimes referred to as a fact or resultProof 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 trueLemma is less important theorem that is helpful in the proof of other resultsCorollary 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 expertHow 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 ProofSelect a general element of the domainShow that it has the property in questionAssure that the theorem holds for all members of the domainProving TheoremsMany 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 followsSo, we must prove something of the form:

Methods of Proving TheoremsDirect proofsProof by contrapositionVacuous proofsTrivial proofsProof by contradictionProofs of equivalenceCounterexamplesProof by casesExistence proofsUniqueness proofs

CS 103 Discrete Structures Lecture 09Logic and Proofs (8)

54Chapter 1 section 1.1 by Dr. Mosaad HassanFirst Midterm Exam2nd Lecture, week 7 (same time as the lecture)75 minute durationWill cover all lectures delivered before the exam dateWill consist of MCQs, 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 0.5-1 page answers.Direct ProofsA 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 trueUse rules of inference, axioms, previously proven theorems to show that q must also be trueWe ensure that the combination p true and q false never occursEven and Odd IntegersThe 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 oddDirect Proofs: ExampleTheorem: If n is an odd integer, then n2 is oddProof:This theorem states n [P(n) Q(n)], where P(n) is n is an odd integerQ(n) is n2 is oddAssume that the hypothesis of this conditional statement is true (i.e. n is an odd integer)Then n = 2k + I, where k is some integerTo show that n2 is also odd, we square both sidesn2 = (2k + 1)2 = 4k2 + 4k + I = 2(2k2 + 2k) + ISince k is integer, then 2k2 + 2k is also integerBy the definition of an odd integer, we can conclude that n2 is an odd integerDirect Proofs: ExampleTheorem: 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)

ProofAssume 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 = t2By 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 integerIndirect ProofDirect 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 conclusionProof by ContrapositionProof by contraposition is a type of indirect proofs

Proofs by contraposition depend on the equivalence between p q and its contrapositive, q pTo perform an indirect proof of p q, do a direct proof of q pIn a proof by contraposition of p q, we take q as a hypothesis, and continue to show that p must followProof by Contraposition: ExampleTheorem: If n2 is an odd integer then n is oddp: n2 is an odd integerq: n is an odd integerp q ProofWe prove the contrapositive: If n is an even integer, then n2 is evenq: (n is an odd integer) n is an even integerp: (n2 is an odd integer) n2 is an even integerq pn = 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 qProof by Contraposition: ExampleTheorem: if n is an integer and 3n + 2 is odd, then n is odd

Direct ProofAssume that 3n + 2 is an odd integerThis means that 3n + 2 = 2k + 1 for some integer kCan 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 kSubstituting 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. Thisis 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: ExampleTheorem: if n is an integer & n3+5 is odd, then n is even

Direct ProofAssume 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 evenAssume 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 ProofsA 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 functionVacuous Proofs: ExampleTheorem: P(0) is true, where P(n) is If n > 1, thenn2 > 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 statementTrivial ProofsA 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: ExampleTheorem: 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

ProofThe proposition P(0) is If a b, then a0 b0 Because a0 = b0 = 1, the conclusion of the conditional statement is trueThen this conditional statement P(0) is trueNote that the hypothesis, which is the statement a b, was not needed in this proofProof by Contradiction 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 acontradiction whenever r is a propositionThen we can prove that p is true if we can show that p (r r) is true for some proposition rProofs 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 proofpqp p q0010011110011101Proof by Contradiction: ExampleTheorem: 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 weekBecause there are 7 days of the week, we could only have picked 21 daysThis contradicts the assumption that we have picked 22 daysProof by Contradiction: ExampleTheorem: If 3n + 2 is odd, then n is oddProof: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 evenNow we show the contradiction that if n is even, then 3n + 2 is even, i.e. q pSince 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 evenTherefore, we have a contradictionThis completes the proof by contradiction, proving that if 3n + 2 is odd, then n is oddProof by Contradiction: ExampleTheorem: If n is an integer & n3 +5 is odd, then n is evenProof:We can rewrite the theorem as If n3 + 5 is odd, then n is evenLet p be n3 + 5 is odd and q be n is evenAssume p is true and q is trueThis means that n3 + 5 is odd, and n is oddn = 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 evenThis leads to contradiction, which proves the theoremProofs of EquivalenceTo 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 oddProofThis theorem has the form p if and only if q where p is n is odd and q is n2 is oddTo prove this theorem, we need to show thatp q and q p are trueWe have already shown that p q and q p are trueThen the theorem is trueProofs of Equivalence: ExampleTheorem: m2 = n2 iff m = n or m = -nProof: 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 trueConsider (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 trueSince 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: ExampleTheorem: The following about the integer n are equivalent:p1: n is even p2: n - 1 is odd p3: n2 is evenProof: To show that these three statements are equivalent we show the statements p1 p2, p2 p3, and p3 p1 are trueWe use a direct proof to show that p1 p2Suppose 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-1We also use a direct proof to show that p2 p3Suppose n - 1 is odd. Then n -1= 2k + 1 for some integer kn = 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 evenTo prove p3 p1 , we use a proof by contrapositionThat 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 exampleThis completes the proofCounterexamplesTo 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 attemptsNote that this is DISPROVING a UNIVERSAL statement by a counterexample

Examplesx R(x), where R(x) means x has red hairFind one person (in the domain) who has red hairEvery positive integer is the square of anotherSquare root of 5 is 2.236, which is not an integerProof by CounterexampleTheorem: Every positive integer is the sum of the squares of two integers is false

ProofTo 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 integersThe integer 3 cannot be written as the sum of the squares of two integersConsequently, we have shown that Every positive integer is the sum of the squares of two integers is falseMistakes in ProofsThere 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 themMistakes in Proofs: ExampleWhat 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 zeroMistakes in Proofs: ExampleWhat 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 positiveThen 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 statementn(P(n) Q(n)) we cannot conclude P(n)Because we are not using a valid rule of inferenceInstead, this is an example of the fallacy of affirming the conclusionA counterexample is supplied by n = -1 for which n2 = 1 is positive, but n is negativeSection 1.8: Exercises1. 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 numberd) The additive inverse, or negative, of an even number is an even numbere) 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.

Exercises2. 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 squareExercises7. Show that:i) If n is an integer and n3 + 5 is odd, then n is evenii) 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