Module 2_ MATHEMATICAL LOGIC
Module 2_ MATHEMATICAL LOGIC
MATHEMATICAL LOGIC
The rules of mathematical logic specify methods of reasoning mathematical statements. Greek
philosopher, Aristotle, was the pioneer of logical reasoning. Logical reasoning provides the
theoretical base for many areas of mathematics and consequently computer science. It has many
practical applications in computer science like design of computing machines, artificial
intelligence, definition of data structures for programming languages etc.
Propositional Logic is concerned with statements to which the truth values, “true” and “false”,
can be assigned. The purpose is to analyze these statements either individually or in a composite
manner.
A proposition is a collection of declarative statements that has either a truth value "true” or a
truth value "false". A propositional consists of propositional variables and connectives. We
denote the propositional variables by capital letters (A, B, etc). The connectives connect the
propositional variables.
"A is less than 2". It is because unless we give a specific value of A, we cannot say
whether the statement is true or false.
Connectives
OR (∨∨)
AND (∧∧)
Negation/ NOT (¬¬)
Implication / if-then (→→)
If and only if (⇔⇔).
OR (∨∨) − The OR operation of two propositions A and B (written as A∨B) is true if at least any
of the propositional variable A or B is true.
A B A∨B
AND (∧∧) − The AND operation of two propositions A and B (written as A∧B) is true if both
the propositional variable A and B is true.
A B A∧B
Negation (¬¬) − The negation of a proposition A (written as ¬A) is false when A is true and is
true when A is false.
True False
False True
Implication / if-then (→→) − An implication A→B is the proposition “if A, then B”. It is false
if A is true and B is false. The rest cases are true.
A B A→B
If and only if (⇔⇔) − A⇔B is bi-conditional logical connective which is true when p and q are
same, i.e. both are false or both are true.
A B A⇔B
Tautologies
A Tautology is a formula which is always true for every value of its propositional variables.
A B A→B (A → B) ∧ A [( A → B ) ∧ A] → B
Contradictions
A Contradiction is a formula which is always false for every value of its propositional variables.
A B A∨B ¬A ¬B (¬ A) ∧ ( ¬ B) (A ∨ B) ∧ [( ¬ A) ∧ (¬ B)]
Contingency
A Contingency is a formula which has both some true and some false values for every value of
its propositional variables.
A B A∨B ¬A (A ∨ B) ∧ (¬ A)
As we can see every value of (A∨B)∧(¬A) has both “True” and “False”, it is a contingency.
Propositional Equivalences
Two statements X and Y are logically equivalent if any of the following two conditions hold −
The truth tables of each statement have the same truth values.
The bi-conditional statement X⇔Y is a tautology.
Example − Prove ¬(A∨B)and[(¬A)∧(¬B)] are equivalent
Testing by 1st method (Matching truth table)
Implication / if-then (→)(→) is also called a conditional statement. It has two parts −
Hypothesis, p
Conclusion, q
As mentioned earlier, it is denoted as p→q
Example of Conditional Statement − “If you do your homework, you will not be punished.”
Here, "you do your homework" is the hypothesis, p, and "you will not be punished" is the
conclusion, q.
Inverse − An inverse of the conditional statement is the negation of both the hypothesis and the
conclusion. If the statement is “If p, then q”, the inverse will be “If not p, then not q”. Thus the
inverse of p→q is ¬p→¬q
Example − The inverse of “If you do your homework, you will not be punished” is “If you do
not do your homework, you will be punished.”
Example − The Contra-positive of " If you do your homework, you will not be punished” is "If
you are punished, you did not do your homework”.
Duality Principle
Duality principle states that for any true statement, the dual statement obtained by interchanging
unions into intersections (and vice versa) and interchanging Universal set into Null set (and vice
versa) is also true. If dual of any statement is the statement itself, it is said self-dual statement.
Normal Forms
Examples
(A∨B)∧(A∨C)∧(B∨C∨D)
(P∪Q)∩(Q∪R)
Disjunctive Normal Form
A compound statement is in disjunctive normal form if it is obtained by operating OR among
variables (negation of variables included) connected with ANDs. In terms of set operations, it is
a compound statement obtained by Union among variables connected with Intersections.
Examples
(A∧B)∨(A∧C)∨(B∧C∧D)
(P∩Q)∪(Q∩R)
Quantifiers
The variable of predicates is quantified by quantifiers. There are two types of quantifier in
predicate logic − Universal Quantifier and Existential Quantifier.
Universal Quantifier
Universal quantifier states that the statements within its scope are true for every value of the
specific variable. It is denoted by the symbol ∀∀.
∀xP(x) is read as for every value of x, P(x) is true.
Example − "Man is mortal" can be transformed into the propositional form ∀xP(x) where P(x) is
the predicate which denotes x is mortal and the universe of discourse is all men.
Existential Quantifier
Existential quantifier states that the statements within its scope are true for some values of the
specific variable. It is denoted by the symbol ∃∃.
∃xP(x) is read as for some values of x, P(x) is true.
Example − "Some people are dishonest" can be transformed into the propositional form ∃xP(x)
where P(x) is the predicate which denotes x is dishonest and the universe of discourse is some
people.
Nested Quantifiers
If we use a quantifier that appears within the scope of another quantifier, it is called nested
quantifier.
Example
To deduce new statements from the statements whose truth that we already know, Rules of
Inference are used.
Mathematical logic is often used for logical proofs. Proofs are valid arguments that determine the
truth values of mathematical statements.
An argument is a sequence of statements. The last statement is the conclusion and all its
preceding statements are called premises (or hypothesis). The symbol “∴∴”, (read therefore) is
placed before the conclusion. A valid argument is one where the conclusion follows from the
truth values of the premises.
Rules of Inference provide the templates or guidelines for constructing valid arguments from the
statements that we already have.
P∴P∨Q P∨Q¬P∴Q
Addition Disjunctive Syllogism
PQ∴P∧Q P→QQ→R∴P→R
Conjunction Hypothetical Syllogism
P∧Q∴P (P→Q)∧(R→S)P∨R∴Q∨S
Simplification Constructive Dilemma
P→QP∴Q (P→Q)∧(R→S)¬Q∨¬S∴¬P
Modus Ponens Destructive Dilemma
∨¬R
P→Q¬Q∴¬P
Modus Tollens
Addition
Example
Conjunction
If P and Q are two premises, we can use Conjunction rule to derive P∧Q
PQ∴P∧Q
Example
Therefore − "He studies very hard and he is the best boy in the class"
Simplification
Example
"He studies very hard and he is the best boy in the class", P∧Q
Modus Ponens
If P and P→Q are two premises, we can use Modus Ponens to derive Q.
P→QP∴Q
Example
"If you have a password, then you can log on to facebook", P→Q
Modus Tollens
If P→Q and ¬Q are two premises, we can use Modus Tollens to derive ¬P
P→Q¬Q∴¬P
Example
"If you have a password, then you can log on to facebook", P→Q
"You cannot log on to facebook", ¬Q
Disjunctive Syllogism
If ¬P and P∨Q are two premises, we can use Disjunctive Syllogism to derive Q.
¬PP∨Q∴Q
Example
"The ice cream is not vanilla flavored", ¬P
"The ice cream is either vanilla flavored or chocolate flavored", P∨Q
Hypothetical Syllogism
If P→Q and Q→R are two premises, we can use Hypothetical Syllogism to derive P→R
P→Q Q→R∴P→R
Example
"If it rains, I shall not go to school”, P→Q
"If I don't go to school, I won't need to do homework", Q→R
Constructive Dilemma
If (P→Q)∧(R→S) and P∨R are two premises, we can use constructive dilemma to derive Q∨S
(P→Q)∧(R→S)P∨R∴Q∨S
Example
“If it rains, I will take a leave”, (P→Q)
“If it is hot outside, I will go for a shower”, (R→S)
“Either it will rain or it is hot outside”, P∨R
Destructive Dilemma
If (P→Q)∧(R→S) and ¬Q∨¬S are two premises, we can use destructive dilemma to
derive ¬P∨¬R
(P→Q)∧(R→S)¬Q∨¬S∴¬P∨¬R
Example
“If it rains, I will take a leave”, (P→Q)
“If it is hot outside, I will go for a shower”, (R→S)
“Either I will not take a leave or I will not go for a shower”, ¬Q∨¬S