Propositional Logic in Discrete Math
Propositional Logic in Discrete Math
ON
Discrete Mathematics
(15AO5302)
Page 1
UNIT -1
Mathematical Logic
Page 2
1. Discrete Mathematics -Introduction
Discrete Mathematics is a branch of mathematics involving discrete elements that uses algebra and
arithmetic. It is increasingly being applied in the practical fields of mathematics and computer science. It
is a very good tool for improving reasoning and problem-solving capabilities.
Types of Mathematics.
Continuous Mathematics
Discrete Mathematics
Continuous Mathematics is based upon continuous number line or the real numbers. It is
characterized by the fact that between any two numbers, there are almost always an infinite set of
numbers. For example, a function in continuous mathematics can be plotted in a smooth curve
without breaks.
Discrete Mathematics, on the other hand, involves distinct values; i.e. between any two points,
there are a countable number of points. For example, if we have a finite set of objects, the
function can be defined as a list of ordered pairs having these objects, and can be presented as a
complete list of those pairs.
2. Propositional 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.
Page 3
The following is not a Proposition −
"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.
3. Connectives
In propositional logic generally we use five connectives which are − OR (∨), AND (𝖠),
Negation/ NOT (¬), Implication / if-then (→), If and only if (⇔).
A B A∨B
True True True
True False True
False True True
False False False
A B A𝖠B
True True True
True False False
False True False
False False False
Negation (¬) − The negation of a proposition A (written as ¬A) is false when A is true
and istrue when A is false.
A ¬A
True False
False True
Page 4
Implication / if-then (→) − An implication A→B is False if A is true and B is false. The
rest cases are true.
A B A→B
True True True
True False False
False True True
False False True
A B A⇔B
True True True
True False False
False True False
False False True
4. 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
True True True True True
True False False False True
False True True False True
False False True False True
Page 5
5. Contradictions
A Contradiction is a formula which is always false for every value of its propositional variables.
6. 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)
True True True False False
True False True False False
False True True True True
False False False True False
As we can see every value of (A ∨ B) 𝖠 (¬A) has both “True” and “False”, it is a contingency.
7. Propositional Equivalences
Two statements X and Y are logically equivalent if any of the following two conditions −
The truth tables of each statement have the same truth values.
The bi-conditional statement X ⇔ Y is a tautology.
Page 6
Testing by 1st method (Matching truth table)
A B A ∨ B ¬ (A ∨ B) ¬A ¬B [(¬A) 𝖠 (¬B)]
True True True False False False False
True False True False False True False
False True True False True False False
False False False True True True True
Here, we can see the truth values of ¬ (A ∨ B) and [(¬A) 𝖠 (¬B)] are same, hence the statements
are equivalent.
Testing by 2nd method (Bi-conditionality)
A B ¬ (A ∨ B) [(¬A) 𝖠 (¬B)] [¬ (A ∨ B)] ⇔ [(¬A) 𝖠 (¬B)]
True True False False True
True False False False True
False True False False True
False False True True True
Example of Conditional Statement − “If you do your homework, you will not be punished.”
Here, "you do your homework" is the hypothesis and "you will not be punished" is the
conclusion.
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”. 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.”
Page 7
Contra-positive − The contra-positive of the conditional is computed by interchanging the
hypothesis and the conclusion of the inverse statement. If the statement is “If p, then q”, the
inverse will be “If not q, then not p”. The Contra-positive of "If you do your homework, you will
not be punished” is "If you will be punished, you do your homework”.
9. Duality Principle
Duality principle set 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.
Examples
(P 𝖴 Q) ∩ (Q 𝖴 R)
(¬P 𝖴 Q 𝖴 S 𝖴¬T)
Examples
(P ∩ Q) 𝖴 (Q ∩ R)
(¬P ∩ Q ∩ S ∩¬T)
Page 8
11. Predicate Logic
Predicate calculus
we'll symbolize the word "every" (or equivalently "all", "any", etc.) with an upside down 'A': .
And we'll use a backwards-E for "some" and it's synonyms: .
Example1:( x)W(x): read this as "every x is such that it is valid" or as "all x make 'W(x)' true" or
“every x, every member of the universe of discourse, is a valid argument:”
Example2:( x)W(x): read this "there is an x such that x is valid" or as "there is an x making 'Wx'
true.", or “some x, some member of the universe of discourse, is a valid argument.”
We have two logically equivalent ways to think about our "no" statement: "No cats are reptiles".
This statement can be understood to be it's not true that some cat is a reptile ('~( x)R(x)') or it
can be equivalently rendered as all cats are non- reptiles ('( x)~R(x)'). (To say that all cats are
non-reptiles is to say that every cat fails to be a reptile.)
We will see these two ways of expressing "no" again and again, so let's put it in a box:
QN: "no cats are reptiles" can be symbolized '~( x)R(x)' or, equivalently, '( x)~R(x)'.
We will return to the PL symbolizations later. For now keep in mind that "no", "some", and "all"
have this complicated relation just called 'QN'.
These three examples are of categorical statements. They relate categories. For example, "All
dogs are mammals" takes the subject term "dogs" and relates it to the predicate term "mammals".
Page 9
All S are P
f)Contraposition:
Page 10
Now, let's use these diagrams for understanding categorical statements.
All S are P
Some S are P
No S are P
Page 11
d)When we first wrote up a Venn Diagram for the universal form, we put it this way:
No S are non-P.
Quantifiers-Types
1. Existential Form can be manifested in English with phrases not including "some". For
example, if one says any of...
Some W are O
Where 'W' stands for the category of whales, 'O' for things in Ohio.
These clearly are also existential. But see below for similar case that are universal. Think about
this one:
This doesn't fit our existential categorical form only because "not a pet" is not itself a category
phrase. But we can easily turn it into one: "not a pet" goes to "non-pet". So, we can symbolize
this one as
Page 12
Some D are N
where 'N' stands for the collection of non-pets. (Warning: Traditional logic recognizes a forth
form: "Some S are not P". Let's call this existential negation. It's easy to see it's meaning. Now,
how would you diagram it?)
No S are P
Nothing is both S and P
None of S are P
3. Universal Forms
For example, any of the following could be symbolized as a universal form statement:
So, when your job is to symbolize is standard form, you will take such English and change them
into
All W are M.
Where 'W' is interpreted as the predicate naming whales, 'M' for mammals.
Usually these two, 4 and 5, would also be symbolized as of universal form, the same way as for
1-3.
All W are M.
If you say "whales are mammals" you are pretty clearly thinking about all whales.
When "a whale is a mammal" is used, this is normally about an arbitrary whale. So, 5 too is
universal.
6 is similarly about any thing. Keep 6 in mind; it will help us symbolize categorical statements
into English.
Page 13
7. All losers complain.
7 is missing a category term for the predicate. But this is easy to fix. Let 'C' stand for "people
who complain".
All L are C.
8 doesn't even look like a categorical statement at first. But it's about all times. "All times when
Tom comes are times when he's late".
All C are L.
This is "All places one goes are places one finds competition":
All G are F.
where 'G' stands for "places one goes" and 'F' for "places one finds competition".And another
similar one:
This is "All people who did not pass should study harder".
All N are H.
These say that nothing else is rational besides humans: All rational beings are human.
All R are H.
But they do not say that all humans are rational! So, "Only S are P" and "None but S are P"
amount to "All P are S". Note the subject-predicate switch!.However, adding the word "The"
makes all the difference!:
Page 14
13. The only rational creatures are humans.
All R are H.
In general, "The only S are P" is logically equivalent to "All S are P".And, here's a last universal
form symbolization:
Unless means "if not" (you can prove this in SD). So, any person who is unlucky pays taxes.
All U are P.
All L are S.
Note that 15 is a negation of an existential: "Some life should be wasted". But 16 is different, it's
the negation
Some P are N.
Exercises
To symbolize this argument using predicate logic, let's take each statement separately. The first
statement "all dogs are mammals" says predicates doghood of some things, mammalhood of
some things, and then says that all things that have doghood also have mammalhood. In other
Page 15
words, for all things, if it is has doghood then it has mammalhood. We can give a similar
analysis for the other two statements. Using "D" for "doghood," "M" for "mammalhood," "A" for
"animalhood," "x" for "thing," "(x)" for "all things," and "→" for the "if. then" aspect, we have
Example2:
Similarly, we can symbolize arguments involving statements such as "some mammals are dogs"
by using "(Эx)" to stand for "some things" in place of "(x)" for "all things. Instead of ">" for the
"if. then" aspect, for some types of statements we might use "^" for "and" and "v" for "or." And
negation could be captured with a "-."
Page 16
Line no Quantifiers Rule
1. (Эx) (M(x)^D(x)) p
4. (x) (D(x)→B(x)) P
5. D(x)→B(x) US,4
6. B(x) Moduspones,3,5
7. M(x)^B(x) Conjunction,3,6
8. (Эx)(M(x)^B(x)) EG,7
Some mammals are barkers
Example3:
For reasons we cannot go into, logicians use an "^" for "and" to capture the "some mammals are
dogs" type of statement instead of an "→" to characterize it as an "if. ...then."
Solution:
2. D(x)→M(x) US,1
3. (x) C(x)→M(x) P
4. C(x)→M(x) US,3
Page 17
Example4:
All turkeys are birds.: (x) T(x)→B(x)
No birds are mammals. (x) Bx →┐M(x)
therefore
No turkeys are mammals. (x) T(x) → ┐ M(x)
Solution:
Line no Quantifiers Rule
7. (x) T(x)→B(x) P
8. T(x)→B(x) US,1
9. (x) Bx →┐M(x) P
Example5:
All turkeys are birds. (x) T(x) → B(x)
Some birds are not mammals. (Эx) B(x) ^ ┐M(x)
therefore
No turkeys are mammals. (x) T(x) → ┐M(x)
Solution:
1. (Эx)B(x) ^┐M(x) P
2. B(x) ^┐M(x) ES ,1
4. B(x)
5. ךּB(x) Negation,4
8. T(x) Modusponens,5,7
Page 18
9. T(x) →┐M(x) Conjunction,3,8
Example 1
Answers
This argument is valid. The fact that the first premise and conclusion are false doesn’t mean the
argument form is logically invalid. This same argument form can be used to make good
arguments. The argument form is “If A, then B. A. Therefore, B.” A good argument with this
argument form is the following:
How can we prove the argument is valid? We can show that it’s impossible to form a formal
counterexample. We can assume the argument is invalid and prove that such an assumption is
impossible because it will lead to self-contradiction.
The easiest way to realize that this argument form is valid is to realize what it means to say “If
A, then B.” This statement means “If A is true, then B is true” or “B is true whenever A is true).
That also implies that if B is false, then A must be false.
We can prove the argument form is valid using the following reasoning:
Page 19
3. In that case ‘A’ must be false because “if A, then B” is assumed to be true, and ‘B’ is assumed to
be false. (Consider the statement, “If dogs are mammals, then dogs are animals.” If we find out
that dogs aren’t animals, then they can’t be mammals. If the second part of a conditional
statement is false, then the first part must be false.)
4. Therefore, ‘A’ is true and false. That’s a contradiction.
5. The assumption that the argument is has true premises and a false conclusion leads to a
contradiction.
6. Therefore, the argument form can’t be invalid.
7. Therefore, the argument must be valid.
Example 2
Answer:
Although the premises and conclusion are true, the argument form is invalid. The argument form
is the following:
1. If A, then B.
2. B.
3. Therefore, A.
We can then replace the variables to create a counterexample that uses this argument form with
true premises and a false conclusion. The variables will be replaced with the following
statements:
Both premises are true, but the conclusion is false. Therefore, the argument form must be invalid.
Page 20
Example 3
1. Either it’s wrong to indiscriminately kill people, or it’s not wrong to kill someone just because
she has red hair.
2. It’s wrong to kill someone just because she has red hair.
3. Therefore, it’s wrong to indiscriminately kill people.
Answer:
1. Either it’s wrong to indiscriminately kill people, or it’s not wrong to kill someone just
because she has red hair.
2. It’s wrong to kill someone just because she has red hair.
3. Therefore, it’s wrong to indiscriminately kill people.
This time the premises are true, the conclusion is true, and the argument form is valid. The
argument form is the following:
Let’s try to prove this argument is valid by proving it’s impossible to provide a counterexample.
We can assume it’s invalid only to find out that such an assumption will lead to a contradiction.
Page 21
Example 4
1. Either disciplining people is always wrong or it’s not always wrong to discipline people for
committing crimes.
2. Disciplining people hurts them.
3. Therefore, disciplining people is always wrong.
Answer:
1. Either disciplining people is always wrong or it’s not always wrong to discipline people
for committing crimes.
2. Disciplining people hurts them.
3. Therefore, disciplining people is always wrong.
This argument is invalid, and it’s already a counterexample because the premises are true and the
conclusion is false. The argument form is the following:
1. Either A or not-B.
2. C
3. Therefore, B.
1. Either murder is always appropriate or it’s not always appropriate to murder people for making
you angry.
2. Murdering people hurts them.
3. Therefore, murder is always appropriate.
Example 5
Answer:
This argument is logically valid, even though the premises seem to lack relevance. Logical
validity doesn’t guarantee relevance.
Page 22
The argument form is the following:
1. A.
2. If A, then B.
3. Therefore, B.
This is basically the same argument form as the first example, so no further proof of validity is
required.
Example 6
Answer:
1. The death penalty sometimes leads leads to the death of innocent people.
2. Therefore, the death penalty sometimes leads to the death of innocent people.
This argument is circular, but it’s still logically valid. The argument structure is the following:
1. A.
2. Therefore, A.
We can prove the argument is valid by proving that it’s impossible to have a counterexample.
Such an argument looks like the following:
Example 7
Answer:
Page 23
The premises contradict each other, but the argument is still valid because it’s impossible for the
premises to be true and the conclusion to be false at the same time. We can tell that both
premises can’t be true at the same time, so it’s impossible to make a counterexample because
that would require both premises to be true. The argument form looks like the following:
1. A.
2. Not-A
3. Therefore, B.
We can prove this argument to be valid by showing why a counterexample can’t be given:
Example 8
1. It’s wrong to refuse to hire the most qualified applicant due to irrelevant criteria.
2. Therefore, it’s wrong to refuse to hire the most qualified applicant due to the color of her skin.
Answer:
1. It’s wrong to refuse to hire the most qualified applicant due to irrelevant criteria.
2. Therefore, it’s wrong to refuse to hire the most qualified applicant due to the color of her
skin.
This argument might sound like it’s valid, but it’s technically invalid with the following
argument form:
1. A.
2. Therefore, B.
The reason why the argument might sound valid is because we have an assumption that the color
of an applicant’s skin is irrelevant criteria. We could then make the argument valid using the
following reasoning:
Page 24
1. It’s wrong to refuse to hire the most qualified applicant due to irrelevant criteria.
2. If it’s wrong to refuse to hire the most qualified applicant due to irrelevant criteria, then it’s
wrong to refuse to hire the most qualified applicant due to the color of her skin (because skin
color is irrelevant criteria).
3. Therefore, it’s wrong to refuse to hire the most qualified applicant due to the color of her skin.
1. A.
2. If A, then B.
3. Therefore, B.
This argument form is the same as was used in example 1 and has already been proven to be
valid.
Example 9
Answer:
This argument has a premise that seems irrelevant to the conclusion, but it’s still logically valid
because the conclusion will be true no matter what. It can’t be invalid because a counterexample
requires the conclusion to be false. The argument form looks like the following:
1. A.
2. Therefore, B or not-B.
We can prove this argument is valid by proving that we can’t have a counterexample using the
following reasoning:
1. Let’s assume that we can develop a counterexample, so the premise is assumed to be true and
the conclusion is assumed to be false.
2. We assume ‘A’ is true because it’s a premise.
3. We assume “B or not-B” to be false because it’s a conclusion.
4. B or not-B is true. (If ‘B’ is false, then “B or not-B” is true. If ‘B’ is true, then “B or not-B is true.)
5. Therefore ‘B’ is true and false.
6. The assumption that the premise is true and conclusion is false leads to a contraction.
7. Therefore, the argument form can’t be invalid.
8. Therefore, the argument form is valid.
Page 25
Example 10
Answer:
This argument is invalid despite the fact that it might look valid. The statement “All cats are
mammals” is equivalent to “if something is a cat, then it’s a mammal” and the statement “some
cats are mammals” is equivalent to “there is at least one cat and it’s a mammal.” We can then
reveal the logical structure as the following:
The problem here is that it’s the existential fallacy—we can’t assume that something exists in a
conclusion when no premise claims something to exist. In this case we can’t assume a cat exists
just because all cats are mammals. A counterexample could be the following:
1. If you are found guilty for killing everyone on Earth in a court of law, then you will go to prison.
2. Therefore, someone was found guilty for killing everyone on Earth in a court of law, and that
person went to prison.
The main difference between these two arguments is that we know that cats exist. That’s the
hidden premise that can be used to fix the argument:
Example 11:
B : it is a baby L : it is logical
M : it can manage a crocodile D : it is despised ,
Page 26
where “it” in this context refers to a general person. Then the three statements can be rephrased
as
(a) B → ~L : If it is a baby then it is not logical.
(b) M → ~D : If it can manage a crocodile then it is not despised.
(c) ~L → D : If it is not logical then it is despised.
Our aim is to use transitive reasoning several times, stringing together a chain of implications
using all the given statements. We have an arrow pointing from B to ~L, and likewise an arrow
pointing from ~L to D; thus we are able to start with B and arrive at the conclusion D. However,
the second statement is still not utilized. But since any implication is equivalent to its
contrapositive, we may replace the second statement with its contrapositive D → ~M. Then we
get the transitive reasoning chain
B → ~L → D → ~M .
We reason that if B is true, then ~L is true, hence D is true, and therefore ~M is true. Our
ultimate conclusion is the statement
B → ~M : If it is a baby then it cannot manage a crocodile .
In ordinary language we would more likely rephrase this answer to the puzzle as
“No baby can manage a crocodile.”
Alternatively, we could write the answer as the contrapositive statement
M → ~B : If it can manage a crocodile then it is not a baby.
The translation into words then would be something like
“Anyone who can manage a crocodile is not a baby.”
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 ∀. ∀x P(x) is read as for every value of x, P(x) is
true.
Page 27
Example − "Man is mortal" can be transformed into the propositional form ∀x P(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 ∃.
Example − "Some people are dishonest" can be transformed into the propositional form ∃x P(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
In order to use the equivalence and implications, we need some rules on how to eliminate
quantifiers during the course of derivation. This elimination is done by rules of specification
called rules US and ES. Once the quantifiers are eliminated, the derivation proceeds as in the
case of the statement calculus and the conclusion is reached.
The Rules of generalization called rules UG and EG, which can be used to attach a quantifiers.
Page 28
4. Rules of Inference
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.
Addition
P
Q
∴P∨Q
Example
Therefore − "Either he studies very hard Or he is very bad student." Here Q is the proposition
“he is a very bad student”.
Conjunction
P
Q
∴P𝖠Q
Page 29
Example
Therefore − "He studies very hard and he is the best boy in the class"
Simplification
P𝖠Q
∴P
Example
"He studies very hard and he is the best boy in the class"
Modus Ponens
If P and P→Q are two premises, we can use Modus Ponens to derive Q.
P→Q
P
∴Q
Example
Modus Tollens
If P→Q and ¬Q are two premises, we can use Modus Tollens to derive ¬P.
Page 30
P→Q
¬Q
∴ ¬P
Example
Disjunctive Syllogism
¬P
P∨Q
∴Q
Example
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
Page 31
Therefore − "If it rains, I won't need to do homework"
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
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
In the case of arguments exemplifying such patterns, we say they are "truth functionally valid"
because their validity depends on the way the form of the argument involves the truth functional
connectives. Here are some arguments exemplifying some other common argument forms or
"rules of inference.". See if you can test PT-Thinker to determine the validity of the arguments
that use them. (Give it the premises and ask it about the conclusion.)
Page 32
Modus Ponens
If dinosaurs are really birds, Neanderthals wore
metal hats. Dinosaurs are really birds.
therefore
Neanderthals wore metal hats.
Modus Tollens
If logic is worth studying, then logic is worth
studying well. It's not the case that logic is worth
studying well.
therefore
It's not the case that logic is worth studying
Hypothetical Syllogism
If bears are happy campers, then bears won't bother human campers.
If bears won't bother real campers, then human campers will be happy
campers. therefore
If bears are happy campers, then human campers will be happy campers.
See if you can see what is wrong with the following arguments. It may be a little tricky
to see; remember that it is not whether the premises and conclusion are true that
matters, but whetherthe truth of the conclusion would follow necessarily from the truth
of all the premises.
See what PT-Thinker has to say about whether the above arguments are valid.
Page 33