Note03 1x2
Note03 1x2
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 1 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 3 / 66
What is a inference rule?
Definition:
P1
P2
Q
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 4 / 66
Implication rule
The first (and simplest) rule is:
Modus Ponens (MP) Rule:
P
P→Q
Q
Example:
P means: “there is a storm.”
P→Q means: “if there is a storm, then the office is closed.”
Q means: “the office is closed.”
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 5 / 66
Another implication rule
Recall that P → Q ≡ ¬ P ∨ Q ≡ Q ∨ ¬ P ≡ ¬ Q → ¬ P.
The MP rule just studied above tells us that:
¬Q
¬Q→¬P
¬P
If we replace the ¬ Q → ¬ P in the above with the logically
equivalent proposition P → Q, then we get another implication
rule:
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 6 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 7 / 66
Yet another implication rule
Example:
P→Q means “if there is a storm, then the office is closed.”
Q→R means “if the office is closed, then I don’t go to work.”
P→R means “if there is a storm, then I don’t go to work.”
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 8 / 66
Conjunction rule
P
Q
P∧Q
Intuitively, this means when you have P and Q both being true, then
P ∧ Q is also true.
Simplification Rule
P∧Q
P
Intuitively, this means when you have P ∧ Q being true, clearly P is also
true.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 9 / 66
Disjunction rules
Addition Rule:
P
P∨Q
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 10 / 66
Resolution Rule
P∨Q
¬P∨R
Q∨R
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 11 / 66
Other rules
We have:
P∨Q
P→R
Q→S
R∨S
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 12 / 66
Inference Rules
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 13 / 66
Valid Arguments
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 14 / 66
Remark:
If P1 , P2 , . . . , Pn , Q is a valid argument, then we can always show:
[q1 ∧ q2 ∧ · · · ∧ qk ] → q ≡ T (1)
Example:
Premises:
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 16 / 66
Inference example
This is a valid argument showing that from the premises (a), (b), (c)
and (d), we can prove the conclusion t.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 17 / 66
Inference example
Example:
Suppose P → Q; ¬ P → R; Q → S. Prove that ¬ R → S.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 18 / 66
Example: Suppose:
(1) If it is Saturday today, then we play soccer or basketball.
(2) If the soccer field is occupied, we dont play soccer.
(3) It is Saturday today, and the soccer field is occupied.
Prove: “we play basketball or volleyball”.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 19 / 66
A more concrete example
(1) P → (Q ∨ R) Premise
(2) P Premise
(3) Q∨R Apply MP rule to (1)(2)
(4) S→¬Q Premise
(5) S Premise
(6) ¬Q Apply MP rule to (4)(5)
(7) R Apply DS rule to (3)(6)
(8) R∨T Apply Addition rule to (7)
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 20 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 21 / 66
Solving a murder case
Known premises:
1 If it’s a robbery, something would have been taken.
2 Nothing was taken.
3 If it’s not a robbery, it must be politics or a woman.
4 It it’s politics, the assassin would have left immediately.
5 If assassin left tracks all over the room, he cannot have left
immediately.
6 The assassin left tracks all over the room.
Show the conclusion: “It was a woman”.
We will discuss this example in class.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 22 / 66
Example 1:
All computer science majors must take CSE 191.
CSE 191 students study discrete structures.
So, all computer science majors must study discrete structures.
Question:
How do you show limx→a f (x) 6= b?
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 24 / 66
Universal quantification rules
Example:
Everybody has a nose.
C has a nose (where C can be anybody).
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 25 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 26 / 66
Existential quantification rules
Example:
There is a student living in Amherst.
John lives in Amherst.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 27 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 28 / 66
Rules of Inference for Quantified Statements
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 29 / 66
Inference example
Example:
Premises:
1 “A student in this class has not read the book”.
2 “Everyone in this class passed the first exam”.
Conclusion: “Someone who passed the first exam has not read the
book”.
Example: Suppose:
all natural numbers are integers;
there exists a natural number;
Prove that there exists an integer.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 31 / 66
An arithmetic example
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 32 / 66
From Inference to Proof
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 34 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 35 / 66
Some terminology
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 36 / 66
Example:
If a > b, then a − b > 0.
This actually means, for all real numbers a and b, if a > b, then
a − b > 0.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 37 / 66
Proof method: direct proof
Definition
A direct proof for p → q starts by assuming p and finishes by
establishing q.
Proof by contraposition
Definition
A proof by contraposition for p → q is actually a direct proof for
¬ q → ¬ p.
It starts by assuming ¬ q, and finishes by establishing ¬ p.
In the proof, we can also use axioms, previously proven theorems,
and inference rules.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 39 / 66
Example for proof by contraposition
Example:
Prove that if n is an integer and 3n + 2 is odd, then n is odd.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 40 / 66
Proof by contradiction
Definition
A proof by contradiction for p is actually a direct proof for
¬ p → (r ∧ ¬ r).
It starts by assuming ¬ p and finishes by establishing both r and ¬ r.
In the proof, we can also use axioms, previously proven theorems, and
inference rules.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 41 / 66
Example for proof by contradiction (1)
Example:
Prove that there is no positive integer n such that n3 + 1 = 100.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 42 / 66
Definition
A prime number is a positive integer whose only divisors are 1 and
itself.
Theorem:
There are infinitely many prime numbers.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 44 / 66
It is the first proof in the book “Proofs from THE BOOK”, where
THE BOOK refers to the imagined collection of the most elegant
proofs that the famous mathematician Paul Erdös claimed is
maintained by the God.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 45 / 66
Proof by cases
Definition:
A proof by cases for (p1 ∨ p2 ∨ . . . ∨ pn ) → q is actually a direct proof for
(p1 → q) ∧ (p2 → q) ∧ . . . ∧ (pn → q).
First, it lists n cases. In the ith case, it starts by assuming pi and
finishes by establishing q.
In the proof, we can also use axioms, previously proven theorems,
and inference rules.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 46 / 66
Example:
Prove that n + 100 > 3n if n is a positive integer with 1 ≤ n ≤ 3.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 47 / 66
Example for proof by cases (2)
Example:
Prove that if n is an integer, then n2 ≥ n.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 48 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 49 / 66
Example of Without Loss of Generality
Example:
Prove that if x and y are integers and both x + y and x · y are even, then
both x and y are even.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 50 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 51 / 66
Constructive proof
Definition
A constructive proof for ∃ x P(x) finds c such that P(c) is true. Hence,
we can conclude that ∃ x P(x) is also true.
Example:
Prove that there is a positive integer that can be written as the sum of
cubes of positive integers in two different ways.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 52 / 66
Non-constructive proof
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 53 / 66
Non-Constructive proof example
Example:
Prove that there exist irrational numbers a and b such that ab is rational.
√ √ √2
Proof: We already know 2 is irrational. Consider the number 2 .
√ √2 √ √
Case 1: If 2 is rational. Then let a = 2 and b = 2. Then ab is
rational.
√ √2 √ √2 √
Case 2: If 2 √ is not rational. Then let a = 2 and b = 2.
√ 2 √ √ 2
Then ab = ( 2 ) 2 = 2 = 2 is rational.
√ √2
Note that, in this proof, we do not claim/know if 2 is a rational
number or not.
But in either case, we prove the proposition.
√ √2
Actually, 2 is irrational. But the proof requires high powered
mathematical theory, far beyond our reach.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 54 / 66
Uniqueness proof
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 55 / 66
Example for uniqueness proof
Example:
Prove that if a and b are real numbers and a is not 0, then there is a
unique real number r such that ar + b = 0.
(In other words: There is a unique solution for the equation ax + b = 0.
Proof:
First, we show that there exists such an r. Let r = −b/a. Then:
ar + b = a(−b/a) + b = −b + b = 0
So this r satisfies the condition.
Second, suppose that r and r0 both satisfy the condition.
Then, r − r0 = ((ar + b) − (ar0 + b))/a = (0 − 0)/a = 0, which
implies that r = r0 .
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 56 / 66
Logic Dilemmas
Definition
A statement p is a dilemma if we cannot prove p ≡ T nor p ≡ F.
If p is true: Then the premises states that he does not give haircut
to himself. This implies p is false.
If p is false: Then the premises states that he does give haircut to
himself. This implies p is true.
So we cannot say if p is true or false. And the statement is a
dilemma.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 57 / 66
Gödel’s Incompleteness Theorem.
Definition:
A “logic inference system” consists of a collection of “rules of
inferences” and a collection of “axioms”.
Definition:
A logic inference” system is “consistent” if for any proposition p, we can
prove either p ≡ T, or p ≡ F, (or neither), but not both.
Definition:
A logic inference system is “complete” if for any proposition p, we can
prove either p ≡ T or p ≡ F, (or both).
Question:
It is unsettling that our logic inference system (the foundation of all
mathematics, computer science ....) is INCOMPLETE.
Can we make it “stronger” by adding a few new “rules of
inferences”?
If these new rules can be derived from existing rules, we don’t
gain anything.
If the new rules are too “strong”, they will make our inference
system “inconsistent”.
It would be ideal if we have a logic inference system that is both
consistent and complete.
Can this be done?
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 59 / 66
Gödel’s Incompleteness Theorem.
Unfortunately:
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 60 / 66
Hilbert’s Problems
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 61 / 66
Hilbert’s Second Problem
What is Hilbert 2nd problem really asking?
Axioms of Arithmetic
Basic objects: The set of natural numbers: 1, 2, 3, 4 . . .
Operations: +, −, ×, ÷
Axioms:
if a = b then b = a. i.e ∀a∀b(a = b) → (b = a).
if a = b and b = c then a = c i.e ∀a∀b∀c(a = b) ∧ (b = c) → (a = c).
a + 0 = a i.e ∀a(a + 0 = a).
a + b = b + a i.e ∀a∀b(a + b = b + a).
(a + b) + c = a + (b + c) i.e ∀a∀b∀c(a + b) + c = a + (b + c).
..
.
plus all basic arithmetic laws you learned before the third grade.
These axioms plus our table of inference rules constitute ”the logic
inference system for arithmetic”.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 62 / 66
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 63 / 66
Some hard arithmetic problems
There are many integer solutions for the equation: x2 + y2 = z2 .
For examples: 32 + 42 = 52 , 52 + 122 = 132 . . .
Are there positive integer solutions for the equation: x3 + y3 = z3 ?
This problem had been open for more than 350 years. It was proved by
Andrew Wildes (a Math professor at Princeton University) in 1995.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 64 / 66
It has been verified that this conjecture is true for n up to 1.6 · 1018 .
British publisher Tony Faber offered a $1,000,000 prize if a proof
was submitted before April 2002. The prize was not claimed.
It remains unsolved today.
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 65 / 66
Hilbert’s 2nd Problem
c
Xin He (University at Buffalo) CSE 191 Discrete Structures 66 / 66