Académique Documents
Professionnel Documents
Culture Documents
LECTURE 2
BY TARAMBIWA E
CATHOLIC UNIVERSITY OF
ZIMBABWE
OBJECTIVES
SCOPE
Laws of Logic
Tautologies and Contradictions
Predicate Logic
Quantifiers
Proofs of mathematical statements
LAWS OF LOGIC
LAWS OF LOGIC
.
TAUTOLOGIES
A Tautology is a proposition form whose truth table is
true for all possible values of its propositional
variables. Example:
.
QUANTIFIERS
Definition: Words that tell how much quantity is
available
Existential
Universal
Some
All
Sometimes
Always
There is
There exists
none
never
or
x, P ( x)
x D, P ( x)
Two-place predicate:
x, y, P ( x, y )
x D, P ( x)
orx, P ( x)
Example:
x, P( x) x, P( x)
x, P ( x) x, P ( x)
PREDICATE LOGIC
Predicates are dependent on the value of the
given variable to get a truth value.
They are written as:
P(x) Unary Predicate
P(x , y) Binary Predicate
P(x1, x2, x3, .. Xn) N-ary Predicate
X and Y can be any integers chosen from a
domain of values called Universe of
discourse
PREDICATE LOGIC
In Predicate logic the statements truth differs with the nature
of values.
As such we have Predicate constants and Predicate Variables.
Example
Sum(x,y,z) Predicate Constant
Sum(x1, x2, x3, .. Xn) Predicate variables
However if a predicate is assigned a value it fits the conditions
of a proposition.
PREDICATE LOGIC
Validity If P(x1, x2, x3, .. Xn) is true for all values (x1, x2,
x3, .. Xn) from the universal U. Then P(x1, x2, x3, .. Xn) is
valid in Universe (U)
Satisfiability
If P(x1, x2, x3, .. Xn) is not true for all
values (x1, x2, x3, .. Xn) from the universal U. Then P(x1,
x2, x3, .. Xn) is satisfiable in Universe (U). And if no
values exists is unsatisfiable in Universe (U)
Binding of predicates is achieved through quantifiers
INFERENCE RULES
INFERENCE RULES
FOR EXAMPLE
The commonly used and important inference
rule is known modus ponens, which is a
tautology based on the expression (p ^ (p q))
q;
1. If it doesnt taste good, you must spit.
[Premise]
2. It doesnt taste good. [Premise]
3. You must spit. [Apply Modus ponens to
1+2]
Modus tollens
1. If it doesnt taste good, you must spit.
OTHER EXAMPLES
DISJUNCTIVE SYLLOGISM
1.
"The ice cream is not vanilla flavoured[Premise]
2. "The ice cream is either vanilla flavoured or
chocolate flavoured[Premise]
3. "The ice cream is chocolate flavoured [Apply rule
to 1+2]
HYPOTHETICAL SYLLOGISM
1.
"If it rains, I shall not go to school[Premise]
2. "If I don't go to school, I won't need to do
homework [Premise]
3. "If it rains, I won't need to do homework
[Apply rule to 1+2]
PROOFS OF MATHEMATICAL
STATEMENTS
Proofs have many practical applications:
verification that computer programs are
correct
establishing that operating systems are
secure
enabling programs to make inferences in
artificial intelligence
showing that system specifications are
consistent
definitions
other theorems
axioms (statements which are given
as true)
rules of inference
PROVING THEOREMS
Many theorems have the form:
x (P(x) Q(x))
P(c) Q(x)
To prove them, we show that 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: p q.
PROVING CONDITIONAL
STATEMENTS: P Q
Trivial Proof:
If we know q is true, then p q
as well. Therefore
If it is raining then 1=1.
Vacuous Proof:
If we know p is false then p q
as well. Therefore
is true
is true
Definition:
The real number r is rational
if there exist integers p and
q where
q 0 such that r = p / q.
PROVING CONDITIONAL
STATEMENTS: P Q
Direct Proof
Example:
Prove that the sum of two rational numbers
is rational.
Solution:
Assume r and s are two rational numbers. Then there
must be integers p, q and also t, u such that r = p / q,
s = t / u, u 0, q 0. Thereforer + s = p/q + t/u
= (pu + qt)/(qu)
Let v = (pu + qt) and w = (qu) where w can not equal 0.
Then r + s = v/w which is rational .
PROOFS CONTRAPOSITION
Assume q and show p is true
also.
This is sometimes called an
indirect proof method.
If we give a direct proof of q
p then we have a proof of
p q.
INDIRECT PROOF
Example:
Prove that if n is an integer and 3n + 2 is odd, then n is odd.
Solution:
Let p be an odd integer.
Assume n is even.
(n is p so we assume the
contrapositive of p q, which is q p).
So, n = 2k for some integer k.
Thus 3n + 2 = 3(2k) + 2
= 6k +2
= 2(3k + 1)
= 2j for j = 3k +1
Therefore 3n + 2 is even.
Since we have shown q p is logically equivalent to p
q, p q must hold as well.
If n is an integer and 3n + 2 is odd (not even),
then n is odd (not even).
, which we write as
PROOF BY CONTRAPOSITION
Example: Prove that for an integer n, if n2 is odd, then
n is odd.
Solution: Use proof by contraposition.
Assume n is even (not odd).
Therefore, there exists an integer k such that n = 2k.
Hence, n2 = 4k2 = 2 (2k2) and n2 is even (not
odd).
We have shown that if n is an even integer, then n2 is
even.
Therefore by contraposition, for an integer n, if n2 is
odd, then n is odd.
CONTRADICTION
Definition:
A contradiction or absurdity is a
propositional form which is always
false
P P = 0
PROOF BY CONTRADICTION
Proof by Contradiction:
To prove p, assume p and
derive a contradiction such as p
p.
(an indirect form of proof).
Since we have shown that p F
is true , it follows that the
contrapositive Tp also holds.
PROOF BY CONTRADICTION
Example:
Use a proof by contradiction to give a proof that 2 is
irrational.
Solution:
Suppose 2 is rational.
Then there exists integers a and b with 2 = a/b,
where b 0 and a and b have no common factors.
Then 2 = a2/b2 and so 2b2 = a2.
Therefore a2 must be even. If a2 is even then a must be
even. Since a is even,
a = 2c for some integer c. Thus, 2b2 = 4c2 and
b2 = 2c2.
Therefore b2 is even. Again then b must be even as well.
PROOF BY CONTRADICTION
But then 2 must divide both a and b.
This contradicts our assumption that a
and b have no common factors.
We have proved by contradiction that
our initial assumption must be false
and therefore 2 is irrational.
PROOF BY CASES
To prove a conditional statement of the form:
is a case.
PROOF BY CASES
Example:
Let a b = max{a, b} = a if a b, otherwise a b = max{a,
b} = b.
Show that for all real numbers a, b, c (a b) c = a (b
c). (This means the operation is associative.) Proof:
Let a, b, and c be arbitrary real numbers.
Then one of the
following 6 cases must hold.
1.
2.
3.
4.
5.
6.
abc
acb
b a c
b c a
cab
cba
PROOF BY CASES
Case 1: a b c
(a b) = a,
a c = a,
bc=b
Hence (a b) c = a = a (b c)
Therefore the equality holds for the first case.
A complete proof requires that the equality
be shown to hold for all 6 cases. But the
proofs of the remaining cases are similar.
LAWS OF LOGIC
LAWS OF LOGIC
USING LOGICAL
EQUIVALENCES: EXAMPLE 1
Logical equivalences can be used to construct additional logical
equivalences
Example: Show that (p q) q is a tautology
0.
1.
2.
on 1
3.
4.
5.
(p q) q
(p q) q
(p q) q
Implication Law on 0
De Morgans Law (1st)
p (q q)
p 1
1
Associative Law on 2
Negation Law on 3
Domination Law on 4
USING LOGICAL
Show that (p q) (p q)
EQUIVALENCES:
EXAMPLE
Start with the second proposition (p q)
0.
(p q)
1. (p q) (q p)
Equivalence Law on 0
2.
(p q) (q p)
Implication Law on 1
3.
(((p q) (q p)))
Double negation on 2
4. ((p q) (q p)
De Morgans Law
5. ((p q) (q p))
De Morgans Law
6.
((p q) (p p) (q q) (q p)) Distribution
Law
7. ((p q) (q p))
Identity Law
8. ((q p ) (p q))
Implication Law
9. (p q)
Equivalence Law
Sets
Functions
Relations