DMS Notes
DMS Notes
DMS Notes
Mathematical Logic
INTRODUCTION
Proposition: A proposition or statement is a declarative sentence which is either
true or false but not both. The truth or falsity of a proposition is called its truth-value.
These two values ‘true’ and ‘false’ are denoted by the symbols T and F
respectively. Sometimes these are also denoted by the symbols 1 and 0 respectively.
Example 1: Consider the following sentences:
1. Delhi is the capital of India.
2. Kolkata is a country.
3. 5 is a prime number.
4. 2 + 3 = 4.
These are propositions (or statements) because they are either true of false.
Next consider the following sentences:
5. How beautiful are you?
6. Wish you a happy new year
7. x + y = z
8. Take one book.
These are not propositions as they are not declarative in nature, that is, they do not
declare a definite truth value T or F.
Propositional Calculus is also known as statement calculus. It is the branch of
mathematics that is used to describe a logical system or structure. A logical system
consists of (1) a universe of propositions, (2) truth tables (as axioms) for the logical
operators and (3) definitions that explain equivalence and implication of propositions.
Connectives
The words or phrases or symbols which are used to make a proposition by two or more
propositions are called logical connectives or simply connectives. There are five basic
connectives called negation, conjunction, disjunction, conditional and biconditional.
Negation
The negation of a statement is generally formed by writing the word ‘not’ at a
proper place in the statement (proposition) or by prefixing the statement with the phrase
‘It is not the case that’. If p denotes a statement then the negation of p is written as p and
read as ‘not p’. If the truth value of p is T then the truth value of p is F. Also if the truth
value of p is F then the truth value of p is T.
Table 1. Truth table for negation
p ¬p
T F
F T
4
Example 2: Consider the statement p: Kolkata is a city. Then ¬p: Kolkata is not a city.
Although the two statements ‘Kolkata is not a city’ and ‘It is not the case that Kolkata is a
city’ are not identical, we have translated both of them by p. The reason is that both these
statements have the same meaning.
Conjunction
The conjunction of two statements (or propositions) p and q is the statement p רq which is
read as ‘p and q’. The statement p רq has the truth value T whenever both p and q have the truth
value T. Otherwise it has truth value F.
p q p רq
T T T
T F F
F T F
F F F
Disjunction
The disjunction of two statements p and q is the statement p שq which is read as ‘p or q’.
The statement p שq has the truth value F only when both p and q have the truth value F. Otherwise
it has truth value T.
p q p שq
T T T
T F T
F T T
F F F
5
Then p שq : I shall go to the game or watch the game on television.
Conditional proposition
If p and q are any two statements (or propositions) then the statement p → q which is read as,
‘If p, then q’ is called a conditional statement (or proposition) or implication and the connective
is the conditional connective.
p q p→q
T T T
T F F
F T T
F F T
To understand better, this connective can be looked as a conditional promise. If the promise
is violated (broken), the conditional (implication) is false. Otherwise it is true. For this reason, the
only circumstances under which the conditional p → q is false is when p is true and q is false.
‘The crop will be destroyed if there is a flood’ into symbolic form using conditional
connective.
(i) You will get a speeding ticket if you drive over 70 km per hour.
(ii) Driving over 70 km per hour is sufficient for getting a speeding ticket.
(iii) If you do not drive over 70 km per hour then you will not get a speeding ticket.
(iv) Whenever you get a speeding ticket, you drive over 70 km per hour.
Solution: (i) p → q (ii) p → q (iii) p → q (iv) q → p.
6
consequent in a conditional statement are not required to refer to the same subject matter. For
example, the statement ‘If I get sufficient money then I shall purchase a high-speed computer’
sounds reasonable. On the other hand, a statement such as ‘If I purchase a computer then this pen is
red’ does not make sense in our conventional language. But according to the definition of
conditional, this proposition is perfectly acceptable and has a truth-value which depends on the
truth-values of the component statements.
2. Some of the alternative terminologies used to express p → q (if p, then q) are the
following: (i) p implies q
(ii) p only if q (‘If p, then q’ formulation emphasizes the antecedent, whereas ‘p only if q’
formulation emphasizes the consequent. The difference is only stylistic.)
(iii) q if p, or q when p.
(v) p is sufficient for q, or a sufficient condition for q is p. (vi) q is necessary for p, or a necessary
condition for p is q. (vii) q is consequence of p.
Converse, Inverse and Contrapositive
If P → Q is a conditional statement, then
(1). Q → P is called its converse
(2). ¬P → ¬Q is called its inverse
(3). ¬Q → ¬P is called its contrapositive.
Truth table for Q → P (converse of P → Q)
P Q Q→P
T T T
T F T
F T F
F F T
Truth table for ¬P → ¬Q (inverse of P → Q)
P Q ¬P ¬Q ¬P → ¬Q
T T F F T
T F F T T
F T T F F
F F T T T
Truth table for ¬Q → ¬P (contrapositive of P → Q)
P Q ¬Q ¬P ¬Q → ¬P
T T F F T
T F T F F
F T F T T
F F T T T
7
Example: Consider the statement
P : It rains.
Q: The crop will grow.
The implication P → Q states that
R: If it rains then the crop will grow.
The converse of the implication P → Q, namely Q → P sates that S: If
the crop will grow then there has been rain.
The inverse of the implication P → Q, namely ¬P → ¬Q sates that
U: If it does not rain then the crop will not grow.
The contraposition of the implication P → Q, namely ¬Q → ¬P states that T : If
the crop do not grow then there has been no rain.
T T T T T
T F F T F
F T T F F
F F T T T
Biconditional proposition
If p and q are any two statements (propositions), then the statement p↔ q which is read as ‘p if and
only if q’ and abbreviated as ‘p iff q’ is called a biconditional statement and the connective is the
biconditional connective.
The truth table of p↔q is given by the following table:
Table 6. Truth table for biconditional
p q p↔q
T T T
T F F
F T F
F F T
It may be noted that p q is true only when both p and q are true or when both p and q are
false. Observe that p q is true when both the conditionals p → q and q → p are true, i.e., the truth-
values of (p → q) ( רq → p), given in Ex. 9, are identical to the truth-values of p q defined here.
Tautology: A statement formula which is true regardless of the truth values of the statements
which replace the variables in it is called a universally valid formula or a logical truth or a
tautology.
Contradiction: A statement formula which is false regardless of the truth values of the
statements which replace the variables in it is said to be a contradiction.
Contingency: A statement formula which is neither a tautology nor a contradiction is known
as a contingency.
8
Substitution Instance
A formula A is called a substitution instance of another formula B if A can be obtained form
B by substituting formulas for some variables of B, with the condition that the same formula
is substituted for the same variable each time it occurs.
Example: Let B : P → (J P ).
Substitute R↔S for P in B, we get
(i) : (R ↔ S) → (J (R ↔ S))
Then A is a substitution instance of B.
Note that (R ↔ S) → (J P) is not a substitution instance of B because the variables
P in J P was not replaced by R ↔ S.
Equivalence of Formulas
Two formulas A and B are said to equivalent to each other if and only if A↔ B is a
tautology.
If A↔B is a tautology, we write A B which is read as A is equivalent to B.
Note : 1. is only symbol, but not connective.
2. A ↔ B is a tautology if and only if truth tables of A and B are the same.
3. Equivalence relation is symmetric and transitive.
Method I. Truth Table Method: One method to determine whether any two statement
formulas are equivalent is to construct their truth tables.
Example: Prove P Q ¬(¬P ¬Q).
Solution:
P Q PQ ¬P ¬Q ¬P ¬Q ¬(¬P ¬Q) (P Q) ¬(¬P ¬Q)
T T T F F F T T
T F T F T F T T
F T T T F F T T
F F F T T T F T
As P Q ¬(¬P ¬Q) is a tautology, then P Q ¬(¬P ¬Q).
Example: Prove (P → Q) (¬P Q).
Solution:
P Q P→Q ¬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 T T T T
9
Equivalence Formulas:
1. Idempotent laws:
(a) P P P (b) P P P
2. Associative laws:
(a) (P Q) R P (Q R) (b) (P Q) R P (Q R)
3. Commutative laws:
(a) P Q Q P (b) P Q Q P
4. Distributive laws:
P (Q R) (P Q) (P R) P (Q R) (P Q) (P R)
5. Identity laws:
(a) (i) P F P (ii) P T T
(b) (i) P T P (ii) P F F
6. Component laws:
(a) P (P Q) P (b) P (P Q) P
8. Demorgan’s laws:
10
Example: Prove that P → (Q → P ) ¬P → (P → Q).
Solution: P→ (Q → P ) ¬P (Q → P )
¬P (¬Q P )
(¬P P ) ¬Q
T ¬Q
T
and
¬P → (P → Q) ¬(¬P ) (P → Q)
P (¬P Q)
(P ¬P ) Q T
Q
T
So, P → (Q → P ) ¬P → (P → Q).
***Example: Prove that (¬P (¬Q R)) (Q R) (P R) R. (Nov. 2009)
Solution:
(¬P (¬Q R)) (Q R) (P R)
((¬P ¬Q) R) ((Q P ) R) [Associative and Distributive laws]
(¬(P Q) R) ((Q P ) R) [De Morgan’s laws]
…(¬(P ßQ) ß(P ßQ)) œR [Distributive laws]
…T œR [ ¬P ßP …T ]
…R
**Example: Show ((P ßQ) œ¬(¬P œ(¬Q ߬R))) ß(¬P œ¬Q) ß(¬P œ¬R) is tautology.
Solution: By De Morgan’s laws, we have
¬P œ¬Q …¬(P ßQ)
¬P ߬R …¬(P œR)
Therefore
(¬P œ¬Q) ß(¬P œ¬R) …¬(P ßQ) ߬(P œR)
…¬((P ßQ) œ(P ßR))
Also
¬(¬P œ(¬Q ߬R)) …¬(¬P œ¬(Q œR))
…P ß(Q œR)
…(P ßQ) œ(P ßR)
Hence ((P ßQ) œ¬(¬P œ(¬Q ߬R))) …(P ßQ) œ(P ßQ) œ(P ßR)
…(P ßQ) œ(P ßR)
Thus ((P ßQ) œ¬(¬P œ(¬Q ߬R))) ß(¬P œ¬Q) ß(¬P œ¬R)
11
[(P Q) (P R)] ¬[(P Q) (P R)]
T
Hence the given formula is a tautology.
Example: Show that (P Q) → (P Q) is a tautology. (Nov. 2009)
Solution: (P Q) → (P Q) ¬(P Q) (P Q) [จ P → Q ¬P Q]
(¬P ¬Q) (P Q) [by De Morgan’s laws]
…(¬P ßP ) ß(¬Q ßQ) [by Associative laws and commutative
laws]
…(T ßT )[by negation laws]
…T
Hence, the result.
12
(c). I have not fallen or I can get up.
(d). You can not study and you get a good grade.
Exercises: 1. Write the negation of the following statements.
(a). If it is raining, then the game is canceled.
(b). If he studies then he will pass the examination.
Are (p → q) → r and p → (q → r) logically equivalent? Justify your answer by using the
rules of logic to simply both expressions and also by using truth tables. Solution: (p → q) →
r and p → (q → r) are not logically equivalent because
Method I: Consider
(p → q) → r (¬p ßq) → r
…¬(¬p ßq) ßr …
(p œ¬q) ßr
…(p œr) ß(¬q œr)
and
p → (q → r) …p → (¬q ßr)
…¬p ß(¬q ßr) …
¬p ߬q ßr.
Consider the statement: ”If you study hard, then you will excel”. Write its converse,
contra positive and logical negation in logic.
Duality Law
Two formulas A and A Œare said to be duals of each other if either one can be obtained from the
other by replacing œby ßand ßby .œThe connectives ßand œare called duals of each other. If the
formula A contains the special variable T or F , then A ,Œits dual is obtained by replacing T by F and
F by T in addition to the above mentioned interchanges.
Example: Write the dual of the following formulas:
13
(i). (P Q) œR (ii). (P œQ) ßT (iii). (P œQ) ß(P ߬(Q œ¬S))
Solution: The duals of the formulas may be written as
(i). (P œQ) ßR (ii). (P ßQ) œF (iii). (P ßQ) œ(P œ¬(Q ߬S))
Result 1: The negation of the formula is equivalent to its dual in which every variable
is replaced by its negation.
We can prove
¬A(P1, P2, ..., Pn) …A (¬P
Œ
1, ¬P2, ..., ¬Pn)
Example: Prove that (a). ¬(P œQ) → (¬P ß(¬P ßQ)) …(¬P ßQ)
(b). (P ßQ) œ(¬P œ(¬P œQ)) …(¬P œQ)
Solution: (a).¬(P œQ) → (¬P ß(¬P ßQ)) …(P œQ) ß(¬P ß(¬P ßQ)) [ P → Q …¬P ßQ]
…(P œQ) ß(¬P ßQ)
…(P œQ) ߬P ßQ
…((P œQ) ߬P )) ßQ
…((P ߬P ) œ(Q ߬P )) ßQ
…(T œ(Q ߬P )) ßQ
…(Q ߬P ) ßQ
…Q ߬P
…¬P ßQ
(b). From (a)
(P œQ) ß(¬P ß(¬P ßQ)) …¬P ßQ
Writing the dual
(P ßQ) œ(¬P œ(¬P œQ)) …(¬P œQ)
Tautological Implications
A statement formula A is said to tautologically imply a statement B if and only if A → B
is a tautology.
In this case we write A ”B, which is read as ’A implies B’.
Note: ”is not a connective, A ”B is not a statement formula.
A ”B states that A → B is tautology.
Clearly A ”B guarantees that B has a truth value T whenever A has the truth value T .
One can determine whether A ”B by constructing the truth tables of A and B in the same manner as
was done in the determination of A …B. Example: Prove that (P → Q) ”(¬Q → ¬P ).
14
Solution:
P Q ¬P ¬Q P→Q ¬Q → ¬P (P → Q) → (¬Q → ¬P )
T T F F T T T
T F F T F F T
F T T F T T T
F F T T T T T
Since all the entries in the last column are true, (P → Q) → (¬Q → ¬P ) is a
tautology.
Hence (P → Q) ය (¬Q → ¬P ).
In order to show any of the given implications, it is suƥcient to show that an
assignment of the truth value T to the antecedent of the corresponding condi-
tional leads to the truth value T for the consequent. This procedure guarantees that the
conditional becomes tautology, thereby proving the implication.
Other Connectives
We introduce the connectives NAND, NOR which have useful applications in the design of
computers.
NAND: The word NAND is a combination of ’NOT’ and ’AND’ where ’NOT’ stands for negation
and ’AND’ for the conjunction. It is denoted by the symbol ↑.
If P and Q are two formulas then
P ↑ Q …¬(P œQ)
The connective ↑ has the following equivalence:
P ↑ P …¬(P œP ) …¬P ߬P …¬P .
15
(P ↑ Q) ↑ (P ↑ Q) ¬(P ↑ Q) ¬(¬(P Q)) P Q.
(P ↑ P ) ↑ (Q ↑ Q) ¬P ↑ ¬Q ¬(¬P ¬Q) P Q.
NAND is Commutative: Let P and Q be any two statement formulas.
(P ↑ Q) ¬(P Q)
¬(Q P )
(Q ↑ P )
ง NAND is commutative.
NAND is not Associative: Let P , Q and R be any three statement formulas.
Consider ↑ (Q ↑ R) ¬(P (Q ↑ R)) ¬(P (¬(Q R)))
¬P (Q R))
(P ↑ Q) ↑ R ¬(P Q) ↑ R
¬(¬(P Q) R)
(P Q) ¬R
Therefore the connective ↑ is not associative.
NOR: The word NOR is a combination of ’NOT’ and ’OR’ where ’NOT’ stands for negation and
‘OR’ for the disjunction. It is denoted by the symbol ↓.
If P and Q are two formulas then
P ↓ Q ¬(P Q)
The connective ↓ has the following equivalence:
P ↓ P ¬(P P ) ¬P ¬P ¬P .
(P ↓ Q) ↓ (P ↓ Q) ¬(P ↓ Q) ¬(¬(P Q)) P Q.
(P ↓ P ) ↓ (Q ↓ Q) ¬P ↓ ¬Q ¬(¬P ¬Q) P Q.
NOR is Commutative: Let P and Q be any two statement formulas.
(P ↓ Q) ¬(P Q)
¬(Q P )
(Q ↓ P )
ง NOR is commutative.
NOR is not Associative: Let P , Q and R be any three statement formulas. Consider
P↓ (Q ↓ R) ¬(P (Q ↓ R))
¬(P (¬(Q R)))
¬P (Q R)
(P ↓ Q) ↓ R ¬(P Q) ↓ R
¬(¬(P Q) R)
(P Q) ¬R
Therefore the connective ↓ is not associative.
16
¬(P Q) ¬P ¬Q
¬(P Q) ¬P ¬Q.
Example: Express P ↓ Q interms of ↑ only.
Solution:
↓ Q ¬(P Q)
(P Q) ↑ (P Q)
[(P ↑ P ) ↑ (Q ↑ Q)] ↑ [(P ↑ P ) ↑ (Q ↑ Q)]
Example: Express P ↑ Q interms of ↓ only. (May-2012)
Solution: ↑ Q ¬(P Q)
(P Q) ↓ (P Q)
[(P ↓ P ) ↓ (Q ↓ Q)] ↓ [(P ↓ P ) ↓ (Q ↓ Q)]
Truth Tables
Example: Show that (A B) (A ↓ B) (A ↑ B). (May-2012)
Solution: We prove this by constructing truth table.
A B AB A↓B (A B) (A ↓ B) A↑B
T T F F F F
T F T F T T
F T T F T T
F F F T T T
As columns (A B) (A ↓ B) and (A ↑ B) are identical.
ง (A B) (A ↓ B) (A ↑ B).
Normal Forms
n
If a given statement formula A(p1, p2, ...pn) involves n atomic variables, we have 2
possible combinations of truth values of statements replacing the variables.
The formula A is a tautology if A has the truth value T for all possible assignments of the
truth values to the variables p1, p2, ...pn and A is called a contradiction if A has the truth
value F for all possible assignments of the truth values of the n variables. A is said to be satis
able if A has the truth value T for atleast one combination of truth values assigned to p1, p2,
...pn.
The problem of determining whether a given statement formula is a Tautology, or a
Contradiction is called a decision problem.
The construction of truth table involves a finite number of steps, but the construc-tion
may not be practical. We therefore reduce the given statement formula to normal form and
find whether a given statement formula is a Tautology or Contradiction or atleast satisfiable.
It will be convenient to use the word ”product” in place of ”conjunction” and ”sum” in
place of ”disjunction” in our current discussion.
17
A product of the variables and their negations in a formula is called an elementary
product. Similarly, a sum of the variables and their negations in a formula is called an
elementary sum.
Let P and Q be any atomic variables. Then P , ¬P Q, ¬QP ¬P , P ¬P , and Q ¬P
are some examples of elementary products. On the other hand, P , ¬P Q, ¬Q P ¬P , P
¬P , and Q ¬P are some examples of elementary sums.
Any part of an elementary sum or product which is itself an elementary sum or product is
called a factor of the original elementary sum or product. Thus ¬Q, ¬P , and ¬Q P are
some of the factors of ¬Q P ¬P .
A formula which is equivalent to a given formula and which consists of a sum of elementary
products is called a disjunctive normal form of the given formula.
The method for obtaining conjunctive normal form of a given formula is similar to the one
given for disjunctive normal form. Again, the conjunctive normal form is not unique.
18
Example: Obtain conjunctive normal forms of
(a) P (P → Q); (b) ¬(P Q)↔ (P Q).
Solution: (a). P (P → Q) P (¬P Q)
(b).¬(P Q)↔ (P Q)
(¬(P Q) → (P Q)) ((P Q) → ¬(P Q))
((P Q) (P Q)) (¬(P Q) ¬(P Q))
[(P Q P ) (P Q Q)] [(¬P ¬Q) (¬P ¬Q)]
(P Q P ) (P Q Q) (¬P ¬Q ¬P ) (¬P ¬Q ¬Q)
Minterm: For a given number of variables, the minterm consists of conjunctions in which each
statement variable or its negation, but not both, appears only once.
2
Let P and Q be the two statement variables. Then there are 2 minterms given by P œQ, P œ¬Q,
¬P œQ, and ¬P œ¬Q.
Minterms for three variables P , Q and R are P œQ œR, P œQ œ¬R, P œ¬Q œR,3 œ¬Q œ¬R, ¬P
œQ œR, ¬P œQ œ¬R, ¬P œ¬Q œR and ¬P œ¬Q œ¬R. From the truth tables of these minterms
of P and Q, it is clear that
P Q P œQ P œ¬Q ¬P œQ ¬P œ¬Q
T T T F F F
T F F T F F
F T F F T F
F F F F F T
19
Methods to obtain PDNF of a given formula
T T T PQ
T F F P ¬Q
F T T ¬P Q
F F T ¬P ¬Q
T T T PQR T F T T
T T F P Q ¬R T F F T
T F T P ¬Q R F F F F
T F F P ¬Q ¬R F F F F
F T T ¬P Q R F T T T
F T F ¬P Q ¬R F F F F
F F T ¬P ¬Q R F T F T
F F F ¬P ¬Q ¬R F F F F
In order to obtain the principal disjunctive normal form of a given formula is con-
structed as follows:
20
(1). First replace →, by their equivalent formula containing only , ßand ¬.
(2). Next, negations are applied to the variables by De Morgan’s laws followed by the
application of distributive laws.
(3). Any elementarily product which is a contradiction is dropped. Minterms are ob-tained in
the disjunctions by introducing the missing factors. Identical minterms appearing in the
disjunctions are deleted.
P ß(P œQ) …P
P ß(¬P œQ) …P ßQ
Solution: We write the principal disjunctive normal form of each formula and com-pare these
normal forms.
(a) P ß(P œQ) …(P œT ) ß(P œQ) [ P œQ …P ]
…(P œ(Q ߬Q)) ß(P œQ) [ P ߬P …T ]
…((P œQ) ß(P œ¬Q)) ß(P œQ) [by distributive laws]
…(P œQ) ß(P œ¬Q) [ P ßP …P ]
which is the required PDNF.
Now, …P œT
…P œ(Q ߬Q)
…(P œQ) ß(P œ¬Q)
which is the required PDNF.
Hence, P ß(P œQ) …P .
21
(b) P (¬P Q) (P T ) (¬P Q)
(P (Q ¬Q)) (¬P Q)
(P Q) (P ¬Q) (¬P Q)
which is the required PDNF.
Now,
P Q (P T ) (Q T )
(P (Q ¬Q)) (Q (P ¬P ))
(P Q) (P ¬Q) (Q P ) (Q ¬P )
(P Q) (P ¬Q) (¬P Q)
which is the required PDNF.
Hence, P (¬P Q) P Q.
Example: Obtain the principal disjunctive normal form of
→ ((P → Q) ¬(¬Q ¬P )) ¬P
((¬P Q) (Q P ))
¬P ((¬P Q P ) (Q Q P ))
¬P F (P Q)
¬P (P Q)
(¬P T ) (P Q)
(¬P (Q ¬Q)) (P Q)
22
For a given formula, an equivalent formula consisting of conjunctions of the max-terms only is
known as its principle conjunctive normal form. This normal form is also called the product-of-sums
canonical form.The method for obtaining the PCNF for a given formula is similar to the one
described previously for PDNF.
Example: Obtain the principal conjunctive normal form of the formula (¬P→R)(רQ↔P)
Solution:
(¬P → R) (Q ↔ P )
[¬(¬P ) R] [(Q → P ) (P → Q)]
(P R) [(¬Q P ) (¬P Q)]
(P R F ) [(¬Q P F ) (¬P Q F )]
[(P R) (Q ¬Q)] [¬Q P ) (R ¬R)] [(¬P Q) (R ¬R)]
(P R Q) (P R ¬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)
which is required principal conjunctive normal form.
Note: If the principal disjunctive (conjunctive) normal form of a given formula A containing n
variables is known, then the principal disjunctive (conjunctive) normal form of ¬A will consist of
the disjunction (conjunction) of the remaining minterms (maxterms) which do not appear in the
principal disjunctive (conjunctive) normal form of A. From A ¬¬A one can obtain the principal
conjunctive (disjunctive) normal form of A by repeated applications of De Morgan’s laws to the
principal disjunctive (conjunctive) normal form of ¬A.
23
Theory of Inference for Statement Calculus
Definition: The main aim of logic is to provide rules of inference to infer a conclusion from
certain premises. The theory associated with rules of inference is known as inference theory .
Definition: If a conclusion is derived from a set of premises by using the accepted rules of
reasoning, then such a process of derivation is called a deduction or a formal proof and the argument
is called a valid argument or conclusion is called a valid conclusion.
Definition: Let A and B be two statement formulas. We say that ”B logically follows from A” or
”B is a valid conclusion (consequence) of the premise A” iff A → B is a tautology, that is A ය B.
We say that from a set of premises {H1, H2, · · · , Hm}, a conclusion C follows logically iff
H1 œH2 œ... œHm ”C
(1)
24
Note: To determine whether the conclusion logically follows from the given premises, we use the
following methods:
x Truth table method
x Without constructing truth table method.
Let P1, P2, · · · , Pn be all the atomic variables appearing in the premises H1, H2, · · · , Hm and
in the conclusion C. If all possible combinations of truth values are assigned to P1, P2, · · · , Pn and if
the truth values of H1, H2, ..., Hm and C are entered in a table. We look for the rows in which all H1,
H2, · · · , Hm have the value T. If, for every such row, C also has the value T, then (1) holds. That is,
the conclusion follows logically.
Alternatively, we look for the rows on which C has the value F. If, in every such row, at
least one of the values of H1, H2, · · · , Hm is F, then (1) also holds. We call such a method a
‘truth table technique’ for the determination of the validity of a conclusion.
Example: Determine whether the conclusion C follows logically from the premises
H1 and H2.
(a) H1 : P → Q H2 : P C : Q
(b) H1 : P → Q H2 : ¬P C : Q
(c) H1 : P → Q H2 : ¬(P Q) C : ¬P
(d) H1 : ¬P H2 : P Q C : ¬(P Q)
(e) H1 : P → Q H2 : Q C : P
Solution: We first construct the appropriate truth table, as shown in table.
P Q P→Q ¬P ¬(P Q) P Q
T T T F F T
T F F F T F
F T T T T F
F F T T T T
25
(a) We observe that the first row is the only row in which both the premises have the value T
. The conclusion also has the value T in that row. Hence it is valid.
In (b) the third and fourth rows, the conclusion Q is true only in the third row, but not in the
fourth, and hence the conclusion is not valid.
Similarly, we can show that the conclusions are valid in (c) and (d) but not in (e).
Rules of Inference
The following are two important rules of inferences.
Implication Formulas
I1 : P Q ය P (simplification)
I2 : P Q ය Q
I3 : P ය P Q
I4 : Q ය P Q
I5 : ¬P ය P → Q
I6 : Q ය P → Q
I7 : ¬(P → Q) ය P
I8 : ¬(P → Q) ය ¬Q
I9 : P, Q ය P Q
I :
10 ¬P, P Q ය Q (disjunctive syllogism)
I
11 : P, P → Q ය Q (modus ponens)
I
12 : ¬Q, P → Q ය ¬P (modus tollens)
I
13 : P → Q, Q → R ය P → R (hypothetical syllogism)
I
: P Q, P → R, Q → R ය R
14 (dilemma)
Example: Demonstrate that R is a valid inference from the premises P → Q, Q → R, and P .
Solution:
{1} (1) P → Q Rule P
{2} (2) P Rule P,
{1, 2} (3) Q Rule T, (1), (2), and I13
{4} (4) Q → R Rule P
{1, 2, 4} (5) R Rule T, (3), (4), and I13
Hence the result.
26
Example: Show that RS follows logically from the premises C D, (C D) → ¬H, ¬H → (A
¬B), and (A ¬B) → (R S).
Solution:
{1} (1) (C D) → ¬H Rule P
{2} (2) ¬H → (A ¬B) Rule P
{1, 2} (3) (C D) → (A ¬B) Rule T, (1), (2), and I13
{4} (4) (A ¬B) → (R S) Rule P
{1, 2, 4} (5) (C D) → (R S) Rule T, (3), (4), and I13
{6} (6) C D Rule P
{1, 2, 4, 6} (7) R S Rule T, (5), (6), and I11
Hence the result.
Solution:
Q → R, P → M, and ¬M.
Solution:
27
{1, 2, 4, 6} (7) R Rule T, (5), (6), and I11
{1, 2, 4, 6} (8) R (P Q) Rule T, (4), (7) and I9
Hence the result.
”If you work hard, you will pass the exam. You did not pass. Therefore, you did not work
hard”.
”If Sachin hits a century, then he gets a free car. Sachin does not get a free car.
28
(P R) → S P → (R → S)
Let P denote the conjunction of the set of premises and let R be any formula. The above
equivalence states that if R is included as an additional premise and S is derived from P R, then
R → S can be derived from the premises P alone.
Rule CP is also called the deduction theorem and is generally used if the conclu-sion of the form
R → S. In such cases, R is taken as an additional premise and S is derived from the given
premises and R.
Example: Show that R → S can be derived from the premises P → (Q → S), ¬R P , and Q.
(Nov. 2011)
29
Hence, the given premises are P → Q, R → ¬Q, and R. The conclusion is ¬P .
Example: By using the method of derivation, show that following statements con-stitute a valid
argument: ”If A works hard, then either B or C will enjoy. If B enjoys, then A will not work hard.
If D enjoys, then C will not. Therefore, if A works hard, D will not enjoy.
Example: Determine the validity of the following arguments using propositional logic:
”Smoking is healthy. If smoking is healthy, then cigarettes are prescribed by physi-
cians. Therefore, cigarettes are prescribed by physicians”. (May-2012)
Solution: Let us indicate the statements as follows:
P : Smoking is healthy.
Q: Cigarettes are prescribed by physicians.
30
{1, 2} (3) Q Rule T, (1), (2), and I11
Hence, the given statements constitute a valid argument.
Consistency of Premises
A set of formulas H1, H2, · · · , Hm is said to be consistent if their conjunction has the
truth value T for some assignment of the truth values to the atomic variables appearing in H1, H2,
· · · , Hm.
If, for every assignment of the truth values to the atomic variables, at least one of the
formulas H1, H2, · · · , Hm is false, so that their conjunction is identically false, then the formulas
H1, H2, · · · , Hm are called inconsistent.
Alternatively, a set of formulas H1, H2, · · · , Hm is inconsistent if their conjunction implies a
contradiction, that is,
H1 H2 œ· · · œHm ”R œ¬R
where R is any formula.
Thus, the given set of premises leads to a contradiction and hence it is inconsistent.
31
Example: Show that the following set of premises is inconsistent: ”If the contract is valid, then
John is liable for penalty. If John is liable for penalty, he will go bankrupt. If the bank will loan
him money, he will not go bankrupt. As a matter of fact, the contract is valid, and the bank will
loan him money.”
Solution: Let us indicate the statements as follows:
V : The contract is valid.
L: John is liable for penalty.
M: Bank will loan him money.
B: John will go bankrupt.
In order to show that a conclusion C follows logically from the premises H1, H2, · · · ,
Hm, we assume that C is false and consider ¬C as an additional premise. If the new set of
premises is inconsistent, so that they imply a contradiction. Therefore, the assump-tion that ¬C is
true does not hold.
Hence, C is true whenever H1, H2, · · · , Hm are true. Thus, C follows logically from
the premises H1, H2, · · · , Hm.
32
Example: Show that ¬(P Q) follows from ¬P œ¬Q.
Solution: We introduce ¬¬(P Q
œ ) as additional premise and show that this additional premise
leads to a contradiction.
Example: Show that the following set of premises are inconsistent, using proof by contradiction
P → (Q ßR), Q → ¬P, S → ¬R, P ”P → ¬S.
Solution: We include ¬(P → ¬S) as an additional premise. Then we show that this leads to a
contradiction.
¬(P → ¬S) …¬(¬P ߬S) …P œS.
33
{6} (6) S → ¬R Rule P
{1, 2, 4, 6} (7) ¬R Rule T, (5), (6) and Modus Ponens
{1, 2, 4, 6} (8) Q Rule T, (3), (7), and P Q, ¬Q ”P
{9} (9) Q → ¬P Rule P
{1, 2, 4, 6} (10) ¬P Rule T, (8), (9), and P œQ, ¬Q ”P
{1, 2, 4, 6} (11) P œ¬P Rule T, (2), (10), and P, Q ”P œQ
{1, 2, 4, 6} (12) F Rule T, (11), and P œ¬P …F
Hence, it is proved that the given premises are inconsistent.
Quantifiers
Quantifiers: Quantifiers are words that are refer to quantities such as ’some’ or ’all’.
Universal Quantifier: The phrase ’forall’ (denoted by ) is called the universal quantifier.
For example, consider the sentence ”All human beings are mortal”.
Let P (x) denote ’x is a mortal’.
Then, the above sentence can be written as
( x S)P (x) or xP (x)
where S denote the set of all human beings.
x represents each of the following phrases, since they have essentially the same for all x
For every x
For each x.
Existential Quantifier: The phrase ’there exists’ (denoted by ) is called the exis-tential
quantifier.
34
For example, consider the sentence
2
”There exists x such that x = 5.
This sentence can be written as
(ූx R)P (x) or ( x)P (x),
2
where P (x) : x = 5.
x represents each of the following phrases
There exists an x
There is an x
For some x
There is at least one x.
35
Free and Bound Variables
Given a formula containing a part of the form (x)P (x) or (ූx)P (x), such a part is called
an x-bound part of the formula. Any occurrence of x in an x-bound part of the formula is
called a bound occurrence of x, while any occurrence of x or of any variable that is not a
bound occurrence is called a free occurrence. The smallest formula immediately
following ( x) or ( x) is called the scope of the quantifier.
Consider the following formulas:
x (x)P (x, y)
x (x)(P (x) → Q(x))
x (x)(P (x) → ( y)R(x, y))
x (x)(P (x) → R(x)) ß(x)(R(x) → Q(x))
x ( x)(P (x) œQ(x))
x ( x)P (x) œQ(x).
In (1), P (x, y) is the scope of the quantifier, and occurrence of x is bound occurrence,
while the occurrence of y is free occurrence.
In (2), the scope of the universal quantifier is P (x) → Q(x), and all concrescences of x are
bound.
In (3), the scope of (x) is P (x) → ( y)R(x, y), while the scope of ( y) is R(x, y). All
occurrences of both x and y are bound occurrences.
In (4), the scope of the first quantifier is P (x) → R(x) and the scope of the second is
R(x) → Q(x). All occurrences of x are bound occurrences.
In (6), the scope of ( x) is P (x) and the last of occurrence of x in Q(x) is free.
36
”Some professional athletes paly soccer”.
(iii). For all x, x is a professional athlete or x plays soccer.
”Every person is either professional athlete or plays soccer”.
Equivalence formulas:
E31 : (ූx)[A(x) B(x)] (ූx)A(x) (ූx)B(x)
E32 : (x)[A(x) B(x)] (x)A(x) (x)B(x)
E33 : ¬(ූx)A(x) (x)¬A(x)
E34 : ¬(x)A(x) (ූx)¬A(x)
E35 : (x)(A B(x)) A (x)B(x)
E36 : (ූx)(A B(x)) A (ූx)B(x)
E37 : (x)A(x) → B (x)(A(x) → B)
E38 : (ූx)A(x) → B (x)(A(x) → B)
E39 : A → (x)B(x) (x)(A → B(x))
37
E40 : A → (ූx)B(x) (ූx)(A → B(x))
E41 : (ූx)(A(x) → B(x)) (x)A(x) → (ූx)B(x)
E42 : (ූx)A(x) → (x)B(X) (x)(A(x) → B(X)).
Example: Establish the validity of the following argument:”All integers are ratio-nal numbers.
Some integers are powers of 2. Therefore, some rational numbers are powers of 2”.
Solution: Let P (x) : x is an integer
R(x) : x is rational number
S(x) : x is a power of 2
Hence, the given statements becomes
38
Example: Show that (x)(P (x) → Q(x)) (x)(Q(x) → R(x)) ය (x)(P (x) → R(x)).
Solution:
{1} (1) (x)(P (x) → Q(x)) Rule P
{1} (2) P (y) → Q(y) Rule US, (1)
{3} (3) (x)(Q(x) → R(x)) Rule P
{3} (4) Q(y) → R(y) Rule US, (3)
{1, 3} (5) P (y) → R(y) Rule T, (2), (4), and I13
{1, 3} (6) (x)(P (x) → R(x)) Rule UG, (5)
Example: Show that (ූx)M(x) follows logically from the premises
(x)(H(x) → M(x)) and (ූx)H(x).
Solution:
39
Here in step (4), y is fixed, and it is not possible to use that variable again in step (5).
Hence, the converse is not true.
Example: Show that from (ූx)[F (x) S(x)] → (y)[M(y) → W (y)] and (ූy)[M(y) ¬W (y)] the
conclusion (x)[F (x) → ¬S(x)] follows.
40
which is a contradiction.Hence, the statement is valid.
Example: Using predicate logic, prove the validity of the following argument: ”Every
husband argues with his wife. x is a husband. Therefore, x argues with his wife”.
1. Test the Validity of the Following argument: “All dogs are barking. Some animals are
dogs. Therefore, some animals are barking”.
2. Test the Validity of the Following argument:
“Some cats are animals. Some dogs are animals. Therefore, some cats are dogs”.
3. Symbolizes and prove the validity of the following arguments :
(i) Himalaya is large. Therefore every thing is large.
(ii) Not every thing is edible. Therefore nothing is edible.
4. a) Find the PCNF of (~p↔r) ^(q↔p) ?
b) Explain in brief about duality Law?
41
7. Obtain the principal conjunctive normal form of the formula (┐P→R)Λ(Q↔P)
8. Prove that (x)P(x)Q(x) → (x)P(x)(x)Q(x). Does the converse hold?
9. Show that from i) (x)(F(x) S(x)) o(y)(M(y) oW(y))
ii) (y) (M(y) ┐W(y)) the conclusion (x)(F(x) o┐S(x)) follows.
10. Obtain the principal disjunctive and conjunctive normal forms of (P o(QR)) (┐Po(┐Q┐R)). Is
this formula a tautology?
11. Prove that the following argument is valid: No Mathematicians are fools. No one who is not a fool
is an administrator. Sitha is a mathematician. Therefore Sitha is not an administrator.
12. Test the Validity of the Following argument: If you work hard, you will pass the exam. You did not
pass. Therefore you did not work hard.
13. Without constructing the Truth Table prove that (poq)oq=pvq?
14. Using normal forms, show that the formula Q(P┐Q)( ┐P┐Q) is a tautology.
15. Show that (x) (P(x) Q(x)) o (x)P(x) (x)Q(x)
16. Show that ┐(PQ) o( ┐P( ┐PQ)) ( ┐PQ)
(PQ)( ┐P( ┐PQ)) (┐PQ)
17. Prove that (x) (P(x) Q(x)) o(x)P(x) (x)Q(x)
18. Example: Prove or disprove the validity of the following arguments using the rules of
inference. (i) All men are fallible (ii) All kings are men (iii) Therefore, all kings are
fallible.
19. Test the Validity of the Following argument:
“Lions are dangerous animals, there are lions, and therefore there are dangerous
animals.”
42
Option: B
11. Consider two well-formed formulas in propositional logic
F1 : P →˥P F2 : (P →˥P) v ( ˥P →) Which of the following statement is correct?
A.F1 is satisfiable, F2 is unsatisfiable B.F1 is unsatisfiable, F2 is satisfiable
C.F1 is unsatisfiable, F2 is valid D.F1 & F2 are both satisfiable
Option: C
12: What can we correctly say about proposition P1 : (p v ˥q) ^ (q →r) v (r v p)
A.P1 is tautology B.P1 is satisfiable
C.If p is true and q is false and r is false, the P1 is true
D.If p as true and q is true and r is false, then P1 is true
Option: C
13: (P v Q) ^ (P → R )^ (Q →S) is equivalent to
A.S ^ R B.S → R C.S v R D.All of above
Option: C
14: The functionally complete set is
A.{ ˥, ^, v } B.{↓, ^ }C.{↑} D.None of these
Option: C
15: (P v Q) ^ (P→R) ^ (Q → R) is equivalent to
A.P B.Q C.R D.True = T
Option: C
16: ˥(P → Q) is equivalent to
A.P ^ ˥Q B.P ^ QC.˥P v Q D.None of these
Option: A
17: In propositional logic , which of the following is equivalent to p → q?
A.~p → q B.~p v q C.~p v~ q D.p →q
Option: B
18: Which of the following is FALSE? Read ^ as And, v as OR, ~as NOT, →as one way implication
and ↔ as two way implication?
A.((x → y)^ x) →y B.((~x →y)^ ( ~x ^ ~y))→y C.(x → ( x v y)) D.((x v y) ↔( ~x v ~y))
Option: D
19: Which of the following well-formed formula(s) are valid?
A.((P → Q)^(Q → R))→ (P → R) B.(P → Q) →(˥P → ˥Q)
C.(P v (˥P v ˥Q)) →P D.((P → R) v (Q → R)) → (P v Q}→R)
Option: A
20: Let p and q be propositions. Using only the truth table decide whether p ↔ q does not imply p
→ ˥q is
A.True B.False C.None D.Both A and B
Option: A
43
Automatic Theorem Proving
Automatic Theorem Proving describes the rules of inference theory for
statement calculus and describes a procedure of derivation which can be
conducted mechanically.
The system consists of 10 rules, an axiom schema, and rules of well formed
sequents and formulas.
1. Variables :
2. Connectives:
3. String of Formulas :
Page |1
4. Sequents :
s
If α and β are string of formulas, then α → β is called a sequent in
which α is denoted the antecedent and β the consequent of the sequent.
s
Sequent α → β is true iff either atleast one of the formulas of the antecedent
is false or atleast one of the formulas of the consequent is true. Thus
s
A, B, C, → , E, F is true iff A∧ B∧ C→ D∨ E∨ F is true.
s
The symbol → is a generalization of the connective → to strings of formulas.
s
A⇒ B means "A implies B" or "A→ B is a tautology" while α ⇒ β means
s
that α →β is true.
s
For example P, Q, R ⇒ P, N.
Occasionally we have sequents which have empty strings of formulas as
antecedent or as consequent. The empty antecedent is interpreted as the
logical constant "true" or T, and empty consequent is interpreted as the
logical constant "false" or F.
5. Axiom Schema :
If α and β are strings of formulas such that every formula in both α and β is a
s
variable only, then the sequent α →β is an axiom iff α and β have atleast
s
one variable in common. As an example, A,B,C → P,B, R, where A, B, C, P
and R are variables, is an axiom
s s
If α → β is an axiom, then α ⇒ β .
6. Theorem :
The following sequents are theorems of our system.
7. Rules :
Page |2
two rules, one for the introduction of the connective in the antecedent and
the other for its introduction in the consequent. In the description of these
rules α,β,γ,… are strings of formulas while X and Y are formulas to which the
connectives are applied.
Antecedent Rules
s s
Rule ⇒ : If α , β ⇒ X, γ , then α , X, β ⇒ γ .
s s
Rule ∧ ⇒ : If X, Y, α , β ⇒ γ , then α , X∧ Y, β ⇒ γ .
s s s
Rule ∨ ⇒ : If X, α , β ⇒ γ and Y, α , β ⇒ γ , then α , X ∨ Y, β ⇒ γ .
s s s
Rule → ⇒ : If Y, α , β ⇒ γ and α , β ⇒ X, γ then α , X→ Y, β ⇒ γ.
s s s
Rule ↔ ⇒ : If X, Y, α , β ⇒ γ and α , β ⇒ X, Y, γ, then α , X ↔ Y, β ⇒ γ.
Consequent Rules
s s
Rule ⇒ : If X, α ⇒ β , γ, then α ⇒ β , X, γ .
s s s
Rule ⇒ ∧ : If α ⇒ X, β , γ and α ⇒ Y, β , γ, then α ⇒ β , X∧ Y, γ.
s s
Rule ⇒ ∨ : If α ⇒ X, Y, β , γ then α ⇒ β , X ∨ Y, γ.
s s
Rule ⇒ → : If X, α ⇒ Y, β , γ then α ⇒ β , X→ Y, γ .
s s s
Rule ⇒ ↔ : If X, α ⇒ Y, β , γ and Y, α ⇒ X, β , γ, then α ↔β , X ⇒ Y, γ.
We first assume (2) and then show that this assumption is or is not justified. This task
is accomplished by working backward from (2), using the rules, and showing that (2) holds if
some simpler sequent is a theorem. We continue working backward until we arrive at the
simplest possible sequents i.e., those which do not have any connectives.
If these sequents are axioms, then we have justified our assumption of (2). If atleast
one of the simplest sequent is not an axiom, then the assumption of (2) is not justified and C
does not follows from H 1 ,H 2 ,…,H m . In the case C follows from H 1 ,H 2 ,…,H m the derivation
of (2) is easily constructed by simply working through the same steps, starting from the
axioms obtained.
Page |3
Example 1:
Show that P∨Q follows from P.
Solution:
We need to show that
s
(1) ⇒ P→ (P∨ Q)
s
(1) if (2) P ⇒ P∨ Q (⇒ → )
s
(2) if (3) P ⇒ P, Q (⇒ ∨ )
We first eliminate the connective → in (1). Using the rule ⇒ → we have "if P
s s s
⇒ P∨ Q then ⇒ P→ (P∨ Q)". Here we have named P ⇒ P∨ Q by (2). Each line
of derivation thus introduces the name as well as gives a rule "(1) if (2)"
means "if (2) then (1)". The chain of arguments is then given by (1) holds if
(2), and (2) holds if (3). Finally (3) is a theorem, because it is an axiom. (3)
s
is an axiom that leads to ⇒ P→ (P∨ Q) as shown.
s
(a) P ⇒ P, Q Axiom
s
(b) P ⇒ P∨ Q Rule (⇒ ∨ ), (a)
s
(c) ⇒ P→ (P∨ Q) Rule (⇒ → ), (b).
Example 2:
s
Show that ⇒ (Q∧ (P→ Q)) → P.
Solution:
s
(1) ⇒ (Q∧ (P→ Q))→ P
s
(1) if (2) Q∧ (P→ Q) ⇒ P (⇒ → )
s
(2) if (3) Q, P→ Q ⇒ P (∧ ⇒ )
s
(3) if (4) P→ Q ⇒ P, Q ( ⇒)
s s
(4) if (5) Q ⇒ P, Q and (6) ⇒ P, P, Q (→ ⇒ )
s
(5) if (7) P, Q ⇒ Q (⇒ )
s
(6) if (8) P ⇒ P, Q (⇒ )
Now (7) and (8) are axioms, hence the theorem (1) follows.
Example 3:
Does P follows from P ∨ Q?
Solution:
s
We investigate whether ⇒ (P∨ Q) → P is a theorem.
s
Assume (1) ⇒ (P∨ Q)→ P
s
(1) if (2) (P ∨ Q) ⇒ P (⇒ → )
s s
(2) if (3) P ⇒ P and (4) Q ⇒ P (∨ ⇒ )
Page |4
Here (3) is an axiom, but (4) is not. Hence P does not follow from P ∨ Q.
Example 4:
Show that S∨ R is tautologically implied by (P∨ Q) ∧ (P→ R)∧ (Q→ S).
Solution:
s
To show (1) ⇒ ((P∨ Q)∧ (P→ R)) ∧ (Q→ S))→ (S∨ R).
s
(1) if (2) (P∨ Q)∧ (P→ R)∧ (Q→ S) ⇒ (S∨ R) (⇒ → )
s
(2) if (3) (P∨ Q)∧ (P→ R)∧ (Q→ S) ⇒ S, R (⇒ ∨ )
s
(3) if (4) (P∨ Q), (P→ R), (Q→ S) ⇒ S, R (∧ ⇒ twice)
s s
(4) if (5) P, P→ R, Q→ S ⇒ S,R and (6) Q, P→ R, Q→ S ⇒ S,R (∨ ⇒ )
s s
(5) if (7) P, R, Q→ S ⇒ S,R and (8) P, Q→ S ⇒ P,S,R (→ ⇒ )
s s
(6) if (9) P, R, S, ⇒ S, R and (10) P, R ⇒ S,R,Q (→ ⇒ )
s s
(7) if (11) P, S ⇒ P, S, R and (12) P ⇒ P, S, R, Q (→ ⇒ )
s s
(8) if (13) Q, R, Q→ S ⇒ S, R and (14) Q, Q→ S ⇒ S, R, P (→ ⇒ )
s s
(9) if (15) Q, R, S ⇒ S, R and (16) Q, R ⇒ S, R, Q (→ ⇒ )
s s
(10) if (17) Q, S ⇒ S, R, P and (18) Q ⇒ S, R, P, Q (→ ⇒ )
Now (9) to (12) and (15) to (18) are all axioms. Therefore, the result follows.
Page |5