0% found this document useful (0 votes)
7 views59 pages

Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views59 pages

Logic

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPSX, PDF, TXT or read online on Scribd

LOGIC

Proposition
Definition 1: A declarative sentence that
is either true or false, but not both, is a
proposition (or a statement), which we will
denote by the lowercase letter p, q, r, s, or t ■
Examples: The following sentences are
Propositions:
1) Socrates was a Greek philosopher;
2) 2+3=5;
3) 1 + 1 = 0;
Proposition
4) the moon is made of green cheese;
5) the equation x  y  z has no positive
n n n

integer solutions, where n  3 .


The following sentences are not propositions:
6) 9x+3=5
7) What a beautiful evening!
8) Close the door!
9) This sentence is false.
Compound proposition
Definition 2: The truthfulness or falsity of a
proposition is called its truth value, denoted by
T(true) and F(false), respectively (or 1 and 0) ■
Definition 3: The conjunction of two
arbitrary propositions p and q, denoted by
pq
is the proposition “p and q” . The conjunction is
Conjunction
defined by the following truth table:

p q pq
Truth table T T T
for p  q
T F F
F T F
F F F
Disjunction
Definition 4: The disjunction of two
arbitrary propositions p and q, denoted by
pq
is the proposition “p or q” . The
disjunction is defined by the following
truth table:
Disjunction
p q pq
T T T
Truth table
for p  q T F T

F T T

F F F
Example:
p: Harry likes pepperoni pizza for lunch
q: Harry likes mushroom pizza for lunch
p v q: Harry likes pepperoni pizza for
lunch or Harry likes mushroom pizza for
lunch
p v q: Harry likes pepperoni or mushroom
pizza for lunch.
Negation
Definition 5: The negation of a proposition
p is “It is not the case that p”, denoted by p.
You may read p as the “negation of p” or
simply “not p”. The negation is defined by
the following truth table:
p p
Truth table T F
for p
F T
Implication
Definition 6: Two propositions p and q can
be combined to form statement: If p, then q.
Such a statement is an implication, denoted by
pq
. Since it involves a condition, it is also
called a conditional statement. The component
p is the hypothesis of the implication and q the
conclusion. The implication is defined by the
following truth table:
Implication

Truth table p q pq


for p  q
T T T
T F F
F T T
F F T
Biconditional Statement
Definition 7: Two propositions p and q can
be combined using the connective if and only if
The resulting proposition “p if and only if q” is
called a biconditional statement, symbolized by

pq
and defined by the following truth table:
Biconditional Statement
Truth table p q pq
for p  q :
T T T
T F F
F T F
F F T
Example: Construct a truth table
for  p  q    q  p

p q p  q q  p  p  q   q  p 
T T T T T
T F F T F
F T T F F
F F T T T
Equivalents
Definition 8: Two compound propositions s
and t, are logically equivalent, symbolized by
st
if they have identical truth tables ■
Examples:
p  q   p  q   q  p 
p  q   q    p 
Example: p  q  p  q
p q  p p  q pq
T T F T T

T F F F F

F T T T T

F F T T T
Tautology and Contradiction
Definition 9: a) A compound statement
that is always true (T) is a tautology;
b) A compound statement that is always false
(F) is a contradiction ■
Examples: 1) p   p  
2) p  p 
3) p  q  p  q 4) p  p

 
The order of precedence: 1) 2)
  
3) 4) 5)
Laws of Logic
Let p, q, and r be any three propositions.
Let t denote a tautology and f a contradiction.
Then:
1) Associative Laws:

p  q  r    p  q   r
p  q  r    p  q   r
Laws of Logic
2) Commutative Laws:
p  q  q  p, pq  q p
3) Distributive Laws:

p  q  r    p  q    p  r  ,
p  q  r    p  q    p  r  .
Laws of Logic
4) De Morgan's Laws:

  p  q   p  q,   p  q   p  q
5) Idempotent Laws:
p  p  p, p p  p
6) Double negation Law:
  p   p
Laws of Logic
7) Properties of the tautology (t) and
contradiction (f):
p  t  t, p  f  f
p  f  p, p  t  p
t  f , f  t
8) Contradiction Law: p  p  f
Laws of Logic
9) Third Exclusion Law:
p  p  t
10) Implication Conversion Law:
p  q  p  q
11) Contrapositive Law:

p  q   q    p 
12) Reductio ad Absurdum Law:
p  q   p  q   f
Laws of Logic
Example: p   q  r    p  q   r
Proof:

p   q  r   10 ,ICL   p   q  r   1, AL 


  p  q   r   4 ,D' ML     p  q   r  10,ICL 
  p  q   r
Predicate
Examples:
1. x  1  5, x  R ;
2. x  1, x  R ;
3. x – money of Kyrgyzstan,
x  $, euro,som,tenge, rouble,...
4. x - Capital of Kyrgyzstan,
x  Washington, Ankara,Bishkek ,Moscow,...
Predicate
Definition 10: Predicate (Proposititional
Function of one variable) P( x ) is a
statement which describes the property the
object x has. Predicate can be transformed
into a proposition by assigning values to x
from the UD - Universe of Discourse. In the
above examples: UD= Set of real numbers –
in 1 and 2; UD= Set of world currencies – in
3; UD= Set of capitals – in 4.
Predicate
In other words: Predicate P is a function from
UD to the Set of all propositions (or on the Set
of truth values T ,F  ):
P : x  UD  P  x   T ,F  ■
Examples:
5. x  y  1, x  N , y  N;
6. y  x , x  R, y  R ;
2

7. x  y  z, x  N , y  N , z  N .
Predicate
Definition 11 (general) :
Predicate P is a function of the following type
P : M 1  M 2  ...  M n  T , F , M i  UD, i  1, 2,..., n

The variables in the predicate P are free
variables. As they vary over the UD, the truth
value of P can vary.
Quantifiers
Definition 12:
Universal quantifier:  - for all, for each, or
for every.
Existential quantifier:  - for some, there
exists a, or for at least.
Uniqueness quantifier: ! - there exists a
unique (meaning exactly one) ■
Quantifiers
The statements

xP  x  , xP  x  , ! xP  x 
are quantified propositions with fixed truth
values. The variable x in quantified proposition
is a bound variable, bound by the appropriate
quantifier.
Quantified propositions
Example: Rewrite each proposition
symbolically, where UD -set of integer numbers:
1) For each integer x, there exists an integer y
such that x + y = 0.
2) There exists an integer x such that x + y = y
for every integer y.
3) For all integers x and y, x y = y x.
4) There are integers x and y such that x + y=
=1.
Quantified propositions
The order is important in the following
quantified propositions:

xyP  x, y  and yxP  x, y 


For example:

xy  x  y   yx  x  y 
Quantified propositions
Example: Determine the truth value of each
proposition, where x and y are real numbers:

1) xy  y  x  ,
2
2) xy  y  x  ,
2

3) xy  y  x  ,
2
4) yx  y  x  ,
2

5) xy  y  x 2  , 6) yx  y  x 2  .
Equivalences involving
Quantified propositions
Definition 13: Statements involving quantified
propositions are logically equivalent if and only if
they have the same truth value no matter which
predicates are substituted into these statements
and which domain is used for the variables ■
Example:
x  P  x   Q  x   xP  x   xQ  x 
x  P  x   Q  x    xP  x   xQ  x 
Negation of a quantified
propositions
De Morgan's laws:

 xP  x   x P  x  ,


 xP  x   x P  x  .
Negation of a quantified
propositions
Example: Negate each proposition, where x is
an arbitrary integer:

1) x x 2  0 
2) x  x 2
 5x  6 
3) Every supercomputer is manufactured in
Japan.
4) There are no white elephants.
Proof Methods
A theorem in mathematics is a true
proposition:
H C
Where H is the hypothesis of the implication
and C the conclusion.
This section presents three standard methods
for proving theorems: trivial proof, direct proof,
indirect proof and their variations.
Proof Methods

Truth table H C H C
for H  C T T T
T F F
F T T
F F T
Trivial proof
The trivial proof is based on the “Implication
Conversion Law”:

H  C  H  C
I) If hypothesis H is false, then the implication
H  C is true regardless of whether C is true
or false.
Trivial proof
Examples:
1) If 1=2, then 3=4.
2) If 1 is even, then 2n+1 is even for all
positive integer n.
II) If conclusion C is true, then the implication
H  C is true regardless of whether H is true
or false.
Trivial proof
Examples:
1) If n is a prime number, then n 2  n is an
even integer.
 
2) Let P  x, n   1  x   1  nx .
n

 
If x is a positive real number, then P x, 0
is true.
3) Prove that for every integer n  41 number
2n  7 is odd.
Direct Proof
In the direct proof of the theorem H  C
assume that the given hypotheses H is true.
Using the laws of logic or previously known facts,
establish that the desired conclusion C is also
true. The result (implication H  C is true)
follows out of Truth table for implication.
Direct Proof
Examples: 1) Product of any two odd integers
Is an odd integer.
PROOF: There exist integers m and n such
that x = 2m + 1 and y = 2n + 1. Thus,

x  y   2m  1   2n  1  4mn  2m  2n  1 
 2  2mn  m  n   1  2k  1

Direct Proof
2) The arithmetic mean of any two nonnegative
real numbers is greater than or equal to their
geometric mean.
PROOF: Let a, b  R and a  0, b  0. Then

 
2
a b  0  a  2 ab  b  0 
ab
  ab ■
2
Indirect Proof
There are two kinds of indirect proofs for the
theorem H  C : proof by contraposition
and proof by contradiction.
The first method is based on the Law of the
Contrapositive:
H  C   C    H 
In this method, assume the desired conclusion
C is false; then using the laws of logic, establish
Proof by contraposition
that hypothesis H is also false. Once you have
done this, the theorem is proved.
Examples:
1) If the square of an integer is odd, then the
integer is odd.
PROOF: Let x be any integer such that x 2 is
odd. We would like to prove that x must be an
odd integer. In the contrapositive method, we
Proof by contraposition
assume the conclusions false; that is, x is not
odd; in other words, assume x is an even
integer: x=2k for some integer k. Then
x   2k   2  2k 
2 2 2

which is an even integer. This makes our


2
hypothesis that x is an odd integer false ■
Proof by contraposition
2) Instead of the theorem:

If lim an  0, then
n 
a
n 1
n is divergent

We prove the contrapositive theorem:



If a
n 1
n is convergent , then lim an  0
n 
Proof by contradiction
Proof by contradiction is based on the law of
reductio ad absurdum:
H  C   H  C   f
In this method, assume the given hypothesis H
is true, but the conclusion C is false. Then
argue logically and reach a contradiction f.
Proof by contradiction
Examples:
1) There is no largest prime number.
PROOF: Suppose the given conclusion is false;
that is, there is a largest prime number p. So
The prime numbers we have are 2, 3, 5,... ,p;
assume there are k such primes,

x   2  3  5  ...  p   1
Proof by contradiction
Clearly, x > p and x is a prime: when x is
divided by each of the primes 2, 3, 5,…,p, we
get 1 as the remainder. But this contradicts the
assumption that p is a largest prime number ■
2) 2 is not a rational number .
PROOF: Suppose the given conclusion is false;
that is, 2 is a rational number :
m
2  , or n 2  2  m 2
n
Proof by contradiction
Without loss of generality We can assume, that
fraction
m
is uncancelled. On the other hand:
n
n  2  m  m  2k  n  2k 
2 2 2 2

n  2p
But this contradicts the assumption that fraction
m n is uncancelled ■
Existence Theorems
Theorems of the form xP  x  also occur in
mathematics. To prove such a theorem,we must
establish the existence of an object a for which
P (a) is true. Such a proof is an existence proof.
There are two kinds of existence proofs:
the constructive existence proof and the
nonconstructive existence proof. If we are able
to find a mathematical object b such that P (b)
Constructive proof

is true, such an existence proof is a constructive


proof.
Example: Prove that there is a positive integer
that can be expressed in two different ways as
the sum of two cubes.
PROOF:

1729  1  12  9  10
3 3 3 3
Nonconstructive proof
A nonconstructive existence proof of the
Theorem xP  x  does not provide us with an
element a for which P (a) is true, but rather
Establishes its existence by an indirect method,
usually contradiction.
Example:
Prove that there is a prime number > 3.
Nonconstructive proof
PROOF: Suppose there are no primes > 3. Then
2 and 3 are the only primes. Since every integer
2
can be expressed as a product of powers of
primes, 25 must be expressible as i a product
25  2  3 j of
powers of 2 and 3, that is, for some
integers i and j. But neither 2 nor 3 is a factor
of 25, so
i 25
25  2  3 j cannot be written in the form

- a contradiction.
Counterexample
Is the statement Every girl is a brunette true or
false? Since we can find at least one girl who is
not a brunette, it is false!
More generally, suppose you would like to show
that the statement xP  x  is false. Since
 xP  x   x  P  x 
by De Morgan's law, the statement xP  x 
Counterexample

is false if there exists an item x in the UD for


which the predicate P(x) is false. Such an object
x is a counterexample. Thus, to disprove the
 
Proposition xP x , all we need is to produce
a counterexample c for which P(c) is false.
Example:

n  N   E  n   n 2
 n  41 is a prime 

You might also like