440 likes | 968 Views
3/22/2012 9:10:46 AM. Propositional Equivalence. Definition A compound proposition that is always true, no matter what the truth values of the propositions that occur in it, is called a tautology. A compound proposition that is always false is called a contradiction. A compound proposition that is neither a tautology nor a contradiction is called a contingency.Example: .
E N D
1. CpE602: Applied Discrete Mathematics The Foundations: Logic and Proofs
Propositional Equivalence
Predicates and Quantifiers
Nested Quantifiers
Rules of Inference
Introduction to Proofs
Proof methods and Strategy
2. 3/22/2012 10:50:27 AM Propositional Equivalence Definition
A compound proposition that is always true, no matter what the truth values of the propositions that occur in it, is called a tautology.
A compound proposition that is always false is called a contradiction.
A compound proposition that is neither a tautology nor a contradiction is called a contingency.
Example:
3. 3/22/2012 10:50:27 AM Propositional Equivalence Definition
Two compound propositions p and q are logically equivalent if p?q is a tautology.
The notation p=q denotes that p and q are logically equivalent. The symbol = is not a logical operator and p=q is not a compound proposition.
We also use to denote logical equivalence.
Example: De Morgan Laws
4. 3/22/2012 10:50:27 AM Propositional Equivalence Example:
Example: The distributive law of disjunction over conjunction
5. 3/22/2012 10:50:27 AM Propositional Equivalence Identity laws:
Domination laws:
Idempotent laws:
6. 3/22/2012 10:50:27 AM Propositional Equivalence Double negation law:
Commutative laws:
Associative laws:
Distributive law of conjunction over disjunction:
7. 3/22/2012 10:50:27 AM Propositional Equivalence Equivalences involving conditional statements and biconditionals:
Using the existing one can derive new logical equivalences.
8. 3/22/2012 10:50:27 AM Predicates and Quantifiers Propositional logic cannot adequately express the meaning of all statements in mathematics and natural language.
“Every computer connected to the university network is functioning properly.”
“There is a computer on the university network that is under attack by an intruder.”
We need a more powerful type of logic: predicate logic.
9. 3/22/2012 10:50:27 AM Predicates and Quantifiers Examples:
“x > 3”, “x=y+3”, “x+y=z”
“computer x is under attack by an intruder”
“computer x is functioning properly”
“x is greater than 3” has two parts:
A variable x
A predicate “is greater than 3”
We can denote “x is greater than 3” by P(x), where P is the propositional function
See examples 1-5 in the textbook
10. 3/22/2012 10:50:27 AM Predicates and Quantifiers In general, a statement involving n variables, x1, …, xn can be denoted by P(x1,…,xn)
A statement of the form P(x1,…,xn) is the value of the propositional function P at the n-tuple (x1, …, xn), and P is also called an n-tuple predicate or n-ary predicate
Propositional functions occur in computer programs
Example 6: if statement
Example 7: verification of computer programs using preconditions and postconditions
11. 3/22/2012 10:50:27 AM Predicates and Quantifiers When the variables in the propositional function are assigned values, then the resulting statement becomes a proposition with a certain truth value.
Another important way of creating propositions from propositional functions is quantification.
all, some, many, none and few
The logic that deals with predicates and quantifiers is called predicate calculus.
12. 3/22/2012 10:50:27 AM Predicates and Quantifiers Definition (The Universal Quantifier)
The universal quantification of P(x) is the statement
“P(x) for all x in the domain.”
The notation denotes the universal quantification of P(x). Here is called the universal quantifier. We read as “for all x P(x)” or “for every x P(x)”. An element for which P(x) is false is called a counterexample.
See examples 8-13.
13. 3/22/2012 10:50:27 AM Predicates and Quantifiers Definition (The Existential Quantifier)
The existential quantification of P(x) is the statement
“There exist an element x in the domain such that P(x).”
The notation denotes the existential quantification of P(x). Here is called the existential quantifier. We also read the existantial quantification as “there is an x such that P(x)” or “there is at least one x such that P(x)”.
See examples 14-16.
14. 3/22/2012 10:50:27 AM Predicates and Quantifiers Other quantifiers
Uniqueness quantifier
Quantifiers with restrected domains (Example17)
Precedence of quantifiers
Binding variables (Example18)
15. 3/22/2012 10:50:27 AM Predicates and Quantifiers Definition (Logical Equivalence)
Statements involving predicates and quantifiers are logically equivalent if and only if they have the same truth value no matter which predicates are substituted in these statements and which domains of discourse are used for the variables in the propositional functions. We use S = T to indicate that two statements S and T involving predicates and quantifiers are equivalent.
Example 19: distribution of a universal quantifier over a conjuntion.
16. 3/22/2012 10:50:27 AM Predicates and Quantifiers Negating quantified expressions (De Morgan’s laws for quantifiers)
Examples 20-22.
17. 3/22/2012 10:50:27 AM Predicates and Quantifiers Translating from English to logical expressions
Examples 23&24
Examples from Lewis Carroll
Examples 26&27
Logic programming
Prolog facts
Prolog rules
Example 28
18. 3/22/2012 10:50:27 AM Nested Quantifiers We say that two quantifiers are nested if one is within the scope of the other.
Example: is same as
where Q(x) is and P(x,y) is the
statement “x + y = 0”.
Example:
Example: Translate into English the following statement
19. 3/22/2012 10:50:27 AM Nested Quantifiers THINKING OF QUANTIFICATION AS LOOPS. To understand nested quantifiers, it is useful to think in terms of nested loops. Of course, if the domain is infinite, we cannot actually loop through all the possible values.
Example: To determine whether is true, we loop through all the possible values of x. For each x, we loop through the values of y until we find a value such that P(x,y) is true. If for every x, we hit such a y, then the quantified statement is true. Otherwise, it is false.
20. 3/22/2012 10:50:27 AM Nested Quantifiers The order of the nested quantifiers is important.
Example: What are the truth values of the quantifiers
and where P(x,y) is the
statement “x + y = y + x” and the domain is the set of real
numbers.
Example: What are the truth values of the quantifiers
and where Q(x,y) is the
statement “x + y = 0” and the domain is the set of real numbers.
Example: What are the truth values of the quantifiers
and where Q(x,y,z) is the
statement “x + y = z” and the domain is the set of real numbers.
21. 3/22/2012 10:50:27 AM Nested Quantifiers Translating mathematical statements into statements involving
quantifiers
Example: Translate the statements
“The sum of two positive integers is always positive” and
“Every real number different than zero has a multiplicative inverse”
Into logical expressions.
Translating from nested quantifiers into English
Example: Translate into English the following statements
and
.
Here, C(x) is “x has a computer”, F(x,y) is “x and y are friends”, and the
domain is the set of students at Stevens.
22. 3/22/2012 10:50:27 AM Nested Quantifiers Transforming English sentences into logical expressions
Example: Express the following statements as logical expressions.
“If a person is a female and is a parent, then this person is someone’s
mother.”
“Everyone has exactly one best friend.”
“There is a woman that has taken a flight on every airline in the world.”
23. 3/22/2012 10:50:27 AM Nested Quantifiers Negating nested quantifiers
Example: Express the negation of the statement so that
no negation precedes a quantifier.
Example: Use quantifiers to express the statement “There is no woman
that has taken a flight on every airline”.
Example: Use quantifiers and predicates to express the fact that
does not exist (the limit definition is given in the book).
24. 3/22/2012 10:50:27 AM Rules of Inference An argument in propositional logic is a sequence of propositions. The final proposition in an argument is called a conclusion. All the other propositions in the argument are called premises. An argument is valid if the truth value of its premises implies that the conclusion is true as well.
An argument form in propositional logic is a sequence of compound propositions involving propositional variables. An argument form is valid if the conclusion is true whenever the premises are true regardless of which propositions are substituted for the propositional variables.
Note that a valid argument can lead to a false conclusion if one or more of the premises are false.
25. 3/22/2012 10:50:27 AM Rules of Inference Modus ponens
Modus tollens
Hypothetical syllogism
Disjunctive syllogism
26. 3/22/2012 10:50:27 AM Rules of Inference Addition
Simplification
Conjunction
Resolution
27. 3/22/2012 10:50:27 AM Rules of Inference Example: Suppose that the conditional “If it snows today, then we will go skiing” and its hypothesis “It is snowing today” are true. Then, by modus ponens, “We will go skiing” is also true.
Example:Which rule is the basis for the following argument: “It is below freezing now. Therefore, it is either below freezing or raining now.”
Example: Which rule is used in the following argument: “It is below freezing and raining now. Therefore, it is below freezing now.”
Example: Which rule is used in the argument: “If it rains today, we will not have barbecue today. If we do not have a barbecue today, we will have barbecue tomorrow. Therefore, if it rains today, we will have barbecue tomorrow.”
28. 3/22/2012 10:50:27 AM Rules of Inference Using rules of inference to build arguments
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, we will be home by sunset” lead to the conclusion “We will be home by sunset”.
Example: Show 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, 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.”
29. 3/22/2012 10:50:27 AM Rules of Inference Resolution is used in the programming languages based on logic and in automatic theorem proving systems. The premises and the conclusion must be expressed as clauses (disjunctions of variables or negations of variables). Resolution is based on the tautology:
Example: Use resolution to show that “Jasmine is skiing or it is not snowing” and “It is snowing or Bart is playing hockey” imply “Jasmine is skiing or Bart is palying hockey”.
Example: Show that the hypotheses and
imply .
30. 3/22/2012 10:50:27 AM Rules of Inference Fallacies
Fallacy of affirming the conclusion
Fallacy of denying the hypothesis
31. 3/22/2012 10:50:27 AM Rules of Inference Universal instantiation
Universal generalization
Existential instantiation
Existential generalization
Universal modus ponens
Universal modus tollens
32. 3/22/2012 10:50:27 AM Introduction to Proofs Proofs are valid arguments that establish the truth of mathematical statements.
Usually informal
A theorem is a statement that can be shown to be true.
Less important theorems are called propositions.
A theorem is shown to be true by a proof.
Axioms (or postulates) are statements that are assumed to be true without a proof.
A less important theorem that is used to prove other facts is called a lemma.
A theorem that can be established directly from a theorem is called corollary.
A conjecture is a statement that is proposed to be true.
33. 3/22/2012 10:50:27 AM Introduction to Proofs Many theorems assert that a property holds for all elements in a
domain (e.g., integers or real numbers) without using quantifiers.
“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.”
The law of universal instantiation is used to prove that the property
holds for an arbitrary element. Then, the law of universal generalization
is used to conclude that the property holds for all the elements.
34. 3/22/2012 10:50:27 AM Introduction to Proofs Direct Proofs
In a direct proof of an implication p ? q, the hypothesis p, some axioms
or other theorems and definitions are used as premises in the
argument. Then, the rules of inference are applied to conclude q.
Def. An integer n is even if there is an integer k s.t. n=2k, and it is odd if
there is an integer k s.t. n=2k+1.
Example: Show that “If n is an odd integer, then n2 is odd.”
Def. An integer a is a perfect square if there is an integer b s.t. a=b2.
Example: Give a direct proof that if m and n are perfect squares, then
mn is a perfect square too.
35. 3/22/2012 10:50:27 AM Introduction to Proofs Proof by contraposition
Proofs by contraposition make use of the fact the
conditional statements p ? q and +q ? +p are equivalent.
In this case, +q along with other facts and definitions is
used as a premise, and the rules of inference are applied to
conclude +p.
Example: Prove that if n is an integer and 3n+2 is odd, then
n is odd.
Example: Prove that if n = ab, where a and b are positive
integers, then a and b are less or equal to the square root
of n.
36. 3/22/2012 10:50:27 AM Introduction to Proofs We can prove that p ? q is true by showing that p is false. Such a proof
is called a vacuous proof. Used to prove special cases.
Example: Show that the proposition P(0) is true where P(n) is the
statement “If n > 1, then n2 > n” in the domain of integers.
We can also prove p ? q by proving that q is true. Such a proof is
called a trivial proof.
Example: Let P(n) be “If a and b are positive integers with a = b, then
an = bn,” where the domain consists of all integers. Prove P(0).
37. 3/22/2012 10:50:27 AM Introduction to Proofs A little proof strategy: Try to construct a direct proof. If it
does not work, then try a proof by contraposition.
Def. A real number r is rational if there exist integers p and
q ? 0 such that r = p/q. A real number that is not rational is
called irrational.
Example: Prove that the sum of two rational numbers is
rational.
Example: Prove that if n is an integer and n2 is odd, then n
is odd.
38. 3/22/2012 10:50:27 AM Introduction to Proofs Proofs by contradiction
To prove that a statement p is true we assume that +p is true, and then
show that some contradiction q follows from +p. Since q is a
contradiction, +p ? q can be true only if +p is false (i.e., p is true).
The contradiction q is usually a conjunction of a proposition and the
negation of the same proposition.
Example: Show that at least four of any 22 days must fall on the same
day of the week.
Example: Prove that the square root of 2 is irrational.
Example: If 3n+2 is odd, then n is odd.
39. 3/22/2012 10:50:27 AM Introduction to Proofs Proofs of equivalence
(p ? q) ? [(p ? q) AND (q ? p)]
(p1?p2? … ?pn) ? [(p1?p2) AND(p2?p3) AND … (pn-1?pn) AND(pn?p1)]
Examples 12-14
Mistakes in proofs
Examples 15-18
40. 3/22/2012 10:50:27 AM Proof Methods and Strategy Proof by cases – The hypothesis p in p ? q is “broken” into multiple
cases p1, … ,pn and each case is proved separately. It is based on the
Following tautology:
Exhaustive proof – Each instance is considered.
Example: (n+1)2 = 3n if n is a positive integer less than 5.
Example: Prove that the only consecutive positive integers not
exceeding 100 that are perfect powers are 8 an 9.
Proof by cases – Sometimes the domain is too large
Example: Prove that if n is an integer, then n2 = n.
Example: Show that |xy|= |x||y|, where x and y are real numbers.
41. 3/22/2012 10:50:27 AM Proof Methods and Strategy More examples
Example: Formulate a conjecture about the decimal digits that occur as
the final digit of perfect squares.
Example: Show that there are no integers x and y such that x2+3y2 = 8.
Without loss of generality
Example: Show that (x + y)r < xr + yr for any positive real numbers x
and y and a real number r s.t. 0 < r < 1.
42. 3/22/2012 10:50:27 AM Proof Methods and Strategy Common errors with proof by cases – The theorem is not proven until
all possible cases are proven.
Example: Theorem: If x is a real number, then x2 is a positive real.
Existence Proofs
Example (Constructive Existence Proof): Show that there is an integer
that can be written as the sum of cubes of positive integers in two
different ways. Solution: 1729 = 103 + 93 = 123 + 13.
Example (Non-constructive Existence Proof). Show that there are two
irrational numbers x and y such that xy is a rational number.
43. 3/22/2012 10:50:27 AM Proof Methods and Strategy Uniqueness proof – Consists of two parts:
Existence: Show that element x with a desired property exists.
Uniqueness: Show that for every y ? x the property does not hold.
Same as proving:
Example: Show that if a and b are real numbers and a ? 0,
then there is a unique real number r such that ar + b = 0.
44. 3/22/2012 10:50:27 AM Proof Methods and Strategy Backward reasoning – To prove a statement q, one works backwards
to find a statement p that implies q such that p is known or can be
proven to be true.
Example: Show that the arithmetic mean of two distinct real numbers is
greater than their geometric mean.
Example 15 in the book.
Adapting existing proofs
Example: Show that square root of 3 is irrational.
Looking for counterexamples
Example: Disprove that “Every positive integer is the sum of the
squares of three integers.”
45. 3/22/2012 10:50:27 AM Proof Methods and Strategy - The texts in Mathematics formally present theorems and proofs.
- However, they do not convey the discovery process.
- Conjectures are made based on some evidence (examination of
different cases, identification of possible patterns, etc.)
- Then, one tries to prove the conjecture, find a counterexample to
disprove the conjecture if it is hard to find a proof, and so on.
See examples on Tilings (Example 18 - 20).
- Many conjectures remain open problems for a long time (e.g., The
Fermat’s Last Theorem).