U-I-Logic and Proofs - Notes
U-I-Logic and Proofs - Notes
UNIT I
LOGIC AND PROOFS
Propositional Logic
Propositional equivalences
Predicate and quantifiers
Nested quantifiers
Rules of inference
Introduction to proof
Methods and strategy
UNIT-I
LOGIC AND PROOFS
Logic is concerned with all kinds of reasoning, the rules of Logic give precise meaning to
mathematical statements, and these rules are used to distinguish between valid and invalid
mathematical arguments.
Propositions
A Proposition is a declarative sentence (that is, a sentence that declares a fact) that is
either true or false, but not both.
Which of the following sentences are Propositions? Indicate the truth values
Connectives:
Statement which contains one or more primary statement and some connectives are called
compound or molecular or composite statements.
Truth Tables
P Q P Q
T F F
F T F
T T T
F F F
P or Q
P Q P Q
T T T
T F T
F T T
F F F
Truth table
P P
T F
F T
Condtitional Statement
Truth table
P Q P Q
T T T
T F F
F T T
F F T
“S. Pavithra can access the internet from campus only if she is a Computer
Science major or she is not a fresh girl”.
Solve:
2. “If Tigers have wings then the earth travels round the Sun”.
Expression: P Q(T )
Construct the Truth Table
1. P ( P Q)
P Q Q P Q P ( P Q)
T T F T T
T F T T T
F T F F F
F F T T F
2. S: ( P Q) (P Q) ( P Q)
3. P ( P Q)
P Q Q P Q P ( P Q)
T T F T T
T F T T T
F T F F F
F F T T F
4. ( 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
5. ( P Q) (P Q) ( P Q) (P Q)
Sol:
Let A = ( P Q) (P Q)
P Q P Q P Q A P Q P Q) B C
T T F F F T F F F T
T F F T F F T F T T
F T T F T T F F F T
F F T T T F F T T T
Let A= p (q r )
B= ((q r ) ( p r ))
p q r p q q r A qr pr B C
T T T F F F F T T T T
T T F F F F F F F F F
T F T F T T F F T T T
T F F F T F F F F F F
F T T T F F F T F T T
F T F T F F F F F F F
F F T T T T T F F F T
F F F T T F F F F F F
7. ( p q) (r s)
Sol:
p q r s pq rs ( p q) ( r s )
T T T T T T T
T T T F T F F
T T F T T F F
T T F F T T T
T F T T F T F
T F T F F F T
T F F T F F T
T F F F F T F
F T T T F T F
F T T F F F T
F T F T F F T
F T F F F T F
F F T T T T T
F F T F T F F
F F F T T F F
F F F F T T T
Prepositional Equivalence
Examples:
p P p p p p
T F T F
F T T F
Equivalence of Prepositions:
It is denoted by A B or A B
Read as “A is equivalent to B”
p q where p q is tautology
Example:
p q pq p p q ( p q) (p q)
T T T F T T
T F F F F T
F T T T T T
F F F T T T
Here p q p q
( p q) (p r ) is tautology
B A
A is a tautology
Logical Equivalence:
Compound prepositions that have been the same truth values in all possible
cases are called logically equivalent.
DeMorgan’s Laws:
( p q) p q
( p q) p q
Logical Equivalences:
Equivalence Name
pI p
1. Identity laws
pF p
pI T
2. Domination laws
pF F
p p p
3. Idempotent laws
p p p
4. (p) p Double Negation laws
pq q p
5. Commutative law
pq q p
( p q) r p (q r )
6. Associative law
( p q) r p (q r )
p (q r ) ( p q) ( p r )
7. Distributive laws
p (q r ) ( p q) ( p r )
p ( p q) p
8. Absorption laws
p ( p q) p
p p T
9. Negation laws
p p F
Logical Equivalences Involving Conditional state
p q p q
p q q p
p q p q
p q ( p q )
( p q ) p q
( p q) ( p r ) p (q r )
( p r ) (q r ) ( p q) r
( p q) ( p r ) p (q r )
( p r ) (q r ) ( p q) r
p q ( p q) (q p)
p q p q
p q ( p q ) ( p q )
( p q) p q
Problems:
Sol:
F (p q)] ( p p F
p q (Identity law)
2. S.T ( p q) ( p q) is a tautology
Sol:
( p q) ( p q) ( p q) ( p q) (Conditional law)
T T
T
It is a tautology
Converse: q p is a converse of p q
Contra positive : q p of p q
Examples:
1. What are the contra positive, converse and inverse of the conditional statement
“The home team wins whenever it is raining:?
Sol:
Contra positive: q p
“If the home team does not win, then it is not raining”.
Converse: q p
Inverse: p q
“If it s not raining, then the home team does not win”.
2. If p is “you can take the flight” & q is “you buy a ticket:. Find p & q
Sol:
Given you can take the flight if you buy a ticket i.e p q
This statement is true if p & q are either both true and both false i.e if you buy a
ticket and can take the flight or if you do not buy a ticket & you cannot take the flight.
If it is false when p & q have opposite truth values i.e when you do not buy a
ticket but you can take the flight and when you buy a ticket & cannot take the flight.
i.e
p q pq
T T T
T F F
F T F
F F T
3. “You cannot ride the roller coaster if you are under 4 feet tall undress you are
older than 16 years old”.
Sol:
p (q r )
Normal Forms:
CNF:
= ( p q r ) ( p q) ( p r )
Problems
i. ( p q) [ p ( p q)] p q
Solve:
( F q) ( p q)
F ( p q) Dominant law
( p q)
ii) p (q p) p ( p q)
LHS p (q p) p (q p)
p (q p)
q Complement law
T Dominant law
RHS p ( p q) p (p q)
p Complement law
T
2. Prove p (q r ) q ( p r )
Sol: p (q r ) p (q r )
(p) (q r )
p (q r )
p (r q)
( p r ) q
q ( p r )
q ( p r)
3. p (q r ) p (q r ) ( p q) r
Sol:
p (q r ) p (q r )
p (q r )
(p q) r
( p q) r
( p q) r
Sol:
( p q) ( p q ) T
( p q) ( p q) ( p q) ( p q) Implication conversation
T T By Negative law
T By dominant law
given is a tautology
5. S.T. [p (q r )] (q r ) ( p r ) r
Sol:
[p (q r )] (q r ) ( p r )
(( p q) (q p)) r
T r Complement law
r Identity law
LHS
( p q) (p q)
(T q) (q p)
T (q p)
(q p)
p q
Hence proved
Without constructing the truth tables, find the principal disjunctive normal forms
(pdnf) of the fello statements.
I) ( (p q) (q p)
II) ( p q) ( p q) (q r )
Solve:
( p q) (( p q) ( p q))
(( p q) ( p q) (( p q) ( p q))
( p q) (( p q) F )
( p q) ( p q )
( p q)
( p q r ) ( p q r ) (p q r ) (p q r ) ( p q r ) ( p q r )
( p q r ) ( p q r ) (p q r ) (p q r )
Introduction:
I) X>3, “The first part, the variable x is the subject of the statement. The
second part, the predicate is greater than 3”
Note:
A statement of the form P (x1, x2……xn) is the value of the prepositional function
P at the n tuple (x1, x2,……xn) and P is also called an predicate or a nary predicate.
Quantifiers:
Quantification
Universal Existential
The universal quantification of p(x) is the statement “ p(x) for all values of x in
the domain”
The notation xp (x) denotes the universal quantification. Here is called
universal quantifier.
Quantifiers:
p(x) is false
xp (x) p(x) is true of their exists p(x) is false for every x
an x
Essential Quantifiers:
We use the notation xp (x) . Here is called the essential quantifier.
Solve:
Let c(x) denotes x has studied calculus where the domain consists of the
students in the class.
xc(x)
2. Consider these statements the first two called premises and the 3 rd is called the
conclusion. The entire set is called an argument.
Solve:
Let P(x), Q(x) & R(x) be “x is a lion” “x is fierce”. “x drinks coffee” respectively.
Assuming that the domain consists of all creatures, express the statements in the
argument using quantifiers and P(x), Q(x) & R(x)
x( P( x) Q( x))
“Birds that do not live on honey are dull in color”. “Huming birds are small”.
Q(x = x is large
R(x)=x lives on honey
x( P( x) S ( x)
x(Q( x) R( x))
x(R( x) S ( x))
Solve:
Theory of Inference
The rules of inference are only means used to draw a conclusion from a set of
premises in a finite sequence of steps called argument.
( p q) p
Simplication
( p q) q
p ( p q)
Addition
q ( p q)
(( p) (q)) ( p q) Conjuction
[( p q) (q r )] ( p r ) Hypothetical Syllogism
[( p q) (p r )] (q r ) Resolution
[( p q) ( p r ) (q r )] r Dilemma
Rule CP:
If a formula S derived from another formula r and set of premises, then the
statement (r s) can be derived from the set of premises alone.
1. S.T the hypotheses “ It is not sunny this afternoon and it is colder than
yesterday”. 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
go home by sunset”.
Sol:
Steps Reason
r s Premises
s t Premises
rp Rule P
p q Rule P
Aliter :
Steps Reason
( p q) Rule P
rp Rule P
r s Rule P
s t Rule P
Solve:
Statement Reasons
p (q s) P
r p P
q P
(r s) q P
(r s) T, 11, a b a
r s T,12, a b a b
Sol:
r q rule p
s q rule p
(r s) q rule T (2&3)
rs rule p
pq rule p
q rule T,1,7,p, p q p q
q q rule T, 6,8, p, q p q
Sol:
Statement Reasons
pq p
( p q) r p
r T ,using1,2 ( p q) p q
r (s t ) p
s t T ,using 3,4
(s t ) (a b) p, (( p q) p) q
(a b) T, using 5,6
b is an additional premises
a b rule p
c b rule p
( a c) b rule T,1,2 p q, r q ( p r ) q
d (a b) rule p
d b rule T,3&4
d rule p
b rule p
b b rule T ,7,8
Sol:
Statement Reasons
a (b c) rule p
ad rule p
a rule T,2 p q p
d rule T,3,1,p, p q q
d (b c) p
d T,6,9
d d T,4,10
F T,11,& Negation
PROBLEMS
1. S.T the premises “A student is 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”.
Sol
Steps Reason
x(c( x) B( x)) Premises
x(c( x) E ( x)) p
Sol
T(x) : x is a mortal
S: x is Socrates
Statement Reason
x(M ( x) T ( x)) p
M ( s) T ( s) using 1
M(s) p
Sol:
(p q) r s, r t , t p
Introduction to proofs
Definition:
Definition:
The real number r is rational if integer p & q with q 0 r=p/q. A real number
that is not rational is called irrational.
Examples
Proof:
Direct proof:
3n+2=3(2k)+2=6k+2=2(3k+1)
Which shows that 3n+2 is even, But 3n+2 is odd as given premises
Proof:
By Contra positive
Let p be “ 2 is irrational”
p be 2 is rational
Here 2 is rational, so 2 =a/b where a&b are integers, both have no common
divisor (ie) 2 =a/b
2 = a2/b2 2b2=a2---------------(1)
(ie) a=2k
(1) 2b2=4k2 b2=2k2
Which shows that b2 is even, b is even finally a & b both even. Common divisor 2
2 is not rational
2 is irrational