0% found this document useful (0 votes)
17 views27 pages

Unit 2 Mathematical Logic

Unit 2 of the Mathematical Logic course covers propositional logic, including definitions of propositions, logical connectives, truth tables, tautologies, contradictions, and logical equivalence. It provides examples and exercises to identify propositions, construct truth tables, and apply laws of logic. The document also discusses the principle of duality and various laws of logic that simplify logical expressions.

Uploaded by

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

Unit 2 Mathematical Logic

Unit 2 of the Mathematical Logic course covers propositional logic, including definitions of propositions, logical connectives, truth tables, tautologies, contradictions, and logical equivalence. It provides examples and exercises to identify propositions, construct truth tables, and apply laws of logic. The document also discusses the principle of duality and various laws of logic that simplify logical expressions.

Uploaded by

neha.t.n369
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Unit 2 - Mathematical Logic

Department of Mathematics, RVCE

1 Propositional Logic: Basics


1.1 Basic Definitions
A proposition is a declarative sentence that is either true or false, but not
both.

1.2 Examples
The following are examples of propositions because they are declarative sen-
tences with a definite truth value:
1. 2 + 2 = 4
Explanation: This is a proposition with truth value ‘True (1)’.
2. The sky is blue.
Explanation: This is a declarative sentence that is true under normal
daylight conditions.
3. 5 > 10
Explanation: This is a proposition with truth value ‘False (0)’.
4. All birds can fly.
Explanation: This is a proposition with truth value ‘False (0)’.
The following are not propositions because they do not have a definite
truth value:
1. What time is it?
Explanation: This is a question, not a declarative sentence.
2. x + 1 = 5
Explanation: This is not a proposition because it contains a variable x,
and its truth value depends on the value of x.
3. Let’s go to the park!
Explanation: This is an imperative sentence, not a declarative sentence.
4. This statement is false.
Explanation: This is a paradox and cannot be classified as true or false.
Propositions are denoted by letters such as p, q, r.

1
1.3 Logical connectives 1 PROPOSITIONAL LOGIC: BASICS

1.3 Logical connectives


• Negation (¬p): “Not p”.
• Conjunction (p ∧ q): “p and q”.

• Disjunction (p ∨ q): “p or q”.


• Conditional (p → q): “If p, then q”.
• Biconditional (p ↔ q): “p if and only if q”.

1.3.1 Truth Tables


Truth tables are used to determine the truth value of compound propositions
based on the truth values of their components.

p q ¬p p∧q p∨q p→q p↔q


0 0 1 0 0 1 1
0 1 1 0 1 1 0
1 0 0 0 1 0 0
1 1 0 1 1 1 1

1.4 Tautologies and Contradictions


• A tautology (T0 / 1) is a proposition that is always true (e.g., p ∨ ¬p).

• A contradiction (F0 / 0) is a proposition that is always false (e.g.,


p ∧ ¬p).
• A contingency is a proposition that is neither a tautology nor a contra-
diction.

1.4.1 Problems
1. Identify whether the following sentences are propositions. If they are,
determine their truth value.
(a) 12 + 3 = 4
(b) x − 27 = 13
(c) 13 × 5 = 65
(d) How beautiful the sunset is!
(e) This statement is false.
2. Construct the truth table for the following compound propositions and
determine whether they are tautologies, contradictions, or contingencies:

(a) p ∨ ¬p
Solution:

Department of Mathematics 2 RV College of Engineering


1.4 Tautologies and Contradictions 1 PROPOSITIONAL LOGIC: BASICS

p ¬p p ∨ ¬p
0 1 1
1 0 1
∴ p ∨ ¬p is a tautology.
(b) ¬p ∨ q
Solution:
p q ¬p ¬p ∨ q
0 0 1 1
0 1 1 1
1 0 0 0
1 1 0 1
∴ ¬p ∨ q is a contingency.
(c) (p → q) ↔ (¬q → ¬p)
Solution:
p q p→q ¬q ¬p ¬q → ¬p (p → q) ↔ (¬q → ¬p)
0 0 1 1 1 1 1
0 1 1 0 1 1 1
1 0 0 1 0 0 1
1 1 1 0 0 1 1
∴ (p → q) ↔ (¬q → ¬p) is a tautology.
(d) p ∧ (q ∨ ¬r)
Solution:
p q r ¬r q ∨ ¬r p ∧ (q ∨ ¬r)
0 0 0 1 1 0
0 0 1 0 0 0
0 1 0 1 1 0
0 1 1 0 1 0
1 0 0 1 1 1
1 0 1 0 0 0
1 1 0 1 1 1
1 1 1 0 1 1
∴ p ∧ (q ∨ ¬r) is a contingency.
3. Exercise:
(a) Show that p ∧ ¬p is a contradiction.
(b) Check if (p → q) ∧ (q → r) → (p → r) is a tautology, contradiction,
or contingency.

Department of Mathematics 3 RV College of Engineering


2 LOGICAL EQUIVALENCE

2 Logical Equivalence
Two propositions p and q are logically equivalent (p ⇐⇒ q) if they
have the same truth values in all cases. Examples:

p → q ⇐⇒ ¬p ∨ q

p ↔ q ⇐⇒ (p → q) ∧ (q → p)

2.0.1 Problems

(a) Show that p ↔ q is logically equivalent to (p → q) ∧ (q → p) using a


truth table.
Solution:
p q p↔q p→q q→p (p → q) ∧ (q → p)
0 0 1 1 1 1
0 1 0 1 0 0
1 0 0 0 1 0
1 1 1 1 1 1
Since the columns for p ↔ q and (p → q) ∧ (q → p) are identical, the
two expressions are logically equivalent.
(b) Verify whether (p ∧ q) ∨ r is logically equivalent to (p ∨ r) ∧ (q ∨ r)
using a truth table.
Solution:
p q r p∧q (p ∧ q) ∨ r p∨r q∨r (p ∨ r) ∧ (q ∨ r)
0 0 0 0 0 0 0 0
0 0 1 0 1 1 1 1
0 1 0 0 0 0 1 0
0 1 1 0 1 1 1 1
1 0 0 0 0 1 0 0
1 0 1 0 1 1 1 1
1 1 0 1 1 1 1 1
1 1 1 1 1 1 1 1
Since the columns for (p ∧ q) ∨ r and (p ∨ r) ∧ (q ∨ r) are identical,
the two expressions are logically equivalent.
(c) Show that ¬(p ∨ q ∨ r) is logically equivalent to ¬p ∧ ¬q ∧ ¬r (De
Morgan’s Law for three propositions) using a truth table.
Solution:

Department of Mathematics 4 RV College of Engineering


2.1 Exercise 3 LAWS OF LOGIC

p q r p∨q∨r ¬(p ∨ q ∨ r) ¬p ¬q ¬r ¬p ∧ ¬q ∧ ¬r
0 0 0 0 1 1 1 1 1
0 0 1 1 0 1 1 0 0
0 1 0 1 0 1 0 1 0
0 1 1 1 0 1 0 0 0
1 0 0 1 0 0 1 1 0
1 0 1 1 0 0 1 0 0
1 1 0 1 0 0 0 1 0
1 1 1 1 0 0 0 0 0
Since the columns for ¬(p ∨ q ∨ r) and ¬p ∧ ¬q ∧ ¬r are identical, the
two expressions are logically equivalent.

2.1 Exercise
(a) Determine whether ¬(p ∧ q) is logically equivalent to ¬p ∨ ¬q (De
Morgan’s Law) using truth table.

(b) Check if p → (q ∧ r) ⇐⇒ (p → q) ∧ (p → r) using truth table.

2.2 Principle of Duality


The Principle of Duality states that any Boolean expression or logical
statement remains valid if:
• The logical operators ∧ (AND) and ∨ (OR) are interchanged.
• The identity elements 1 (True) and 0 (False) are interchanged.

2.2.1 Examples of Duality

• Distributive law: p ∧ (q ∨ r) ⇐⇒ (p ∧ q) ∨ (p ∧ r)
Dual Distributive law: p ∨ (q ∧ r) ⇐⇒ (p ∨ q) ∧ (p ∨ r)
• Original Identity: p ∧ 1 ⇐⇒ p
Dual Identity: p ∨ 0 ⇐⇒ p

3 Laws of Logic
The laws of logic are fundamental rules that help simplify and manipulate
logical expressions. These laws are used to prove logical equivalence and
to transform complex logical statements into simpler forms.

(a) Identity Laws:

p ∧ True ⇐⇒ p and p ∨ False ⇐⇒ p

Department of Mathematics 5 RV College of Engineering


3.1 Proving Logical Equivalence Using Laws of Logic 3 LAWS OF LOGIC

(b) Domination Laws:


p ∨ True ⇐⇒ True and p ∧ False ⇐⇒ False
(c) Idempotent Laws:
p ∨ p ⇐⇒ p and p ∧ p ⇐⇒ p
(d) Double Negation Law:
¬(¬p) ⇐⇒ p
(e) Commutative Laws:
p ∨ q ⇐⇒ q ∨ p and p ∧ q ⇐⇒ q ∧ p
(f) Associative Laws:
(p ∨ q) ∨ r ⇐⇒ p ∨ (q ∨ r) and (p ∧ q) ∧ r ⇐⇒ p ∧ (q ∧ r)
(g) Distributive Laws:
p ∨ (q ∧ r) ⇐⇒ (p ∨ q) ∧ (p ∨ r) and p ∧ (q ∨ r) ⇐⇒ (p ∧ q) ∨ (p ∧ r)
(h) De Morgan’s Laws:
¬(p ∧ q) ⇐⇒ ¬p ∨ ¬q and ¬(p ∨ q) ⇐⇒ ¬p ∧ ¬q
(i) Absorption Laws:
p ∨ (p ∧ q) ⇐⇒ p and p ∧ (p ∨ q) ⇐⇒ p
(j) Negation Laws:
p ∨ ¬p ⇐⇒ True and p ∧ ¬p ⇐⇒ False
(k) Conditional:
p → q ⇐⇒ ¬p ∨ q

3.1 Proving Logical Equivalence Using Laws of Logic


To prove that two logical expressions are equivalent, we can use the laws
of logic to transform one expression into the other.

3.1.1 Prove p → q ⇐⇒ ¬q → ¬p (Contrapositive)

Solution:
p → q ⇐⇒ ¬p ∨ q (Conditional)
⇐⇒ q ∨ ¬p (Commutative Law)
⇐⇒ ¬(¬q) ∨ ¬p (Double Negation)
⇐⇒ ¬q → ¬p (Conditional)
Thus, p → q ⇐⇒ ¬q → ¬p.

Department of Mathematics 6 RV College of Engineering


3.1 Proving Logical Equivalence Using Laws of Logic 3 LAWS OF LOGIC

3.1.2 Prove p ↔ q ⇐⇒ (p ∧ q) ∨ (¬p ∧ ¬q)

Solution:
p ↔ q ⇐⇒ (p → q) ∧ (q → p) (Biconditional)
⇐⇒ (¬p ∨ q) ∧ (¬q ∨ p) (Conditional)
⇐⇒ (¬p ∧ ¬q) ∨ (¬p ∧ p) ∨ (q ∧ ¬q) ∨ (q ∧ p) (Distributive Law)
⇐⇒ (¬p ∧ ¬q) ∨ False ∨ False ∨ (q ∧ p) (Negation Law)
⇐⇒ (¬p ∧ ¬q) ∨ (p ∧ q) (Identity Law)
⇐⇒ (p ∧ q) ∨ (¬p ∧ ¬q) (Commutative Law)

Thus, p ↔ q ⇐⇒ (p ∧ q) ∨ (¬p ∧ ¬q).

3.1.3 Prove ¬(p ∨ (q ∧ r)) ⇐⇒ ¬p ∧ (¬q ∨ ¬r)

Solution:
¬(p ∨ (q ∧ r)) ⇐⇒ ¬p ∧ ¬(q ∧ r) (De Morgan’s Law)
⇐⇒ ¬p ∧ (¬q ∨ ¬r) (De Morgan’s Law)

Thus, ¬(p ∨ (q ∧ r)) ⇐⇒ ¬p ∧ (¬q ∨ ¬r).

3.1.4 Prove (p → q) ∧ (q → r) ⇐⇒ p → r (Hypothetical Syllo-


gism)

Solution:
(p → q) ∧ (q → r) ⇐⇒ (¬p ∨ q) ∧ (¬q ∨ r) (Conditional)
⇐⇒ (¬p ∧ ¬q) ∨ (¬p ∧ r) ∨ (q ∧ ¬q) ∨ (q ∧ r) (Distributive Law)
⇐⇒ (¬p ∧ ¬q) ∨ (¬p ∧ r) ∨ False ∨ (q ∧ r) (Negation Law)
⇐⇒ (¬p ∧ ¬q) ∨ (¬p ∧ r) ∨ (q ∧ r) (Identity Law)
⇐⇒ ¬p ∧ (¬q ∨ r) ∨ (q ∧ r) (Distributive Law)
⇐⇒ ¬p ∨ (q ∧ r) (Simplification)
⇐⇒ ¬p ∨ r (Absorption Law)
⇐⇒ p → r (Conditional)

Thus, (p → q) ∧ (q → r) ⇐⇒ p → r.

Department of Mathematics 7 RV College of Engineering


4 CONVERSE, INVERSE, AND CONTRAPOSITIVE

3.1.5 Prove ¬(p ↔ q) ⇐⇒ (p ∧ ¬q) ∨ (¬p ∧ q)

Solution:

¬(p ↔ q) ⇐⇒ ¬ (p → q) ∧ (q → p) (Biconditional)
⇐⇒ ¬(p → q) ∨ ¬(q → p) (De Morgan’s Law)
⇐⇒ ¬(¬p ∨ q) ∨ ¬(¬q ∨ p) (Conditional)
⇐⇒ (p ∧ ¬q) ∨ (q ∧ ¬p) (De Morgan’s Law)
⇐⇒ (p ∧ ¬q) ∨ (¬p ∧ q) (Commutative Law)

Thus, ¬(p ↔ q) ⇐⇒ (p ∧ ¬q) ∨ (¬p ∧ q).

3.1.6 Exercise: Prove (p ∨ q) → r ⇐⇒ (p → r) ∧ (q → r)

3.1.7 Exercise: Prove (p → q) ∨ (p → r) ⇐⇒ p → (q ∨ r)

3.1.8 Exercise: Prove (p → q) ∧ (r → s) ⇐⇒ (p ∨ r) → (q ∨ s)

4 Converse, Inverse, and Contrapositive


Given a conditional statement p → q:
• The converse is q → p.
• The inverse is ¬p → ¬q.
• The contrapositive is ¬q → ¬p.

4.1 Problems: Write the converse, inverse and con-


trapositive for the following conditionals
4.1.1 If a number is even, then it is divisible by 2.

(a) Converse: ”If a number is divisible by 2, then it is even.”


(b) Inverse: ”If a number is not even, then it is not divisible by 2.”
(c) Contrapositive: ”If a number is not divisible by 2, then it is not
even.”

4.1.2 If a shape is a square, then it is a rectangle.

(a) Converse: ”If a shape is a rectangle, then it is a square.”


(b) Inverse: ”If a shape is not a square, then it is not a rectangle.”
(c) Contrapositive: ”If a shape is not a rectangle, then it is not a
square.”

Department of Mathematics 8 RV College of Engineering


5 RULES OF INFERENCE

4.1.3 Exercise: If you study hard, then you will pass the exam.

4.1.4 Exercise: If it rains, then the ground becomes wet.

5 Rules of Inference
Rules of inference are logical tools used to derive conclusions from premises,
in other words, to check the validity of an argument. They are funda-
mental in constructing valid arguments and proofs in mathematics and
computer science.
An argument is a sequence of statements where one or more statements,
called premises, are used to support another statement, called the con-
clusion. The goal is to determine whether the conclusion logically follows
from the premises.

5.1 Structure of an Argument


• Premises: The statements that provide evidence or reasons.
• Conclusion: The statement that is being argued for.

p1
p2
.
.
pn
∴q

Equivalently, (p1 ∧ p2 ∧ .. ∧ pn ) =⇒ q

5.2 Validity of an Argument


An argument is valid if the conclusion is true whenever all the premises
are true. If there is even one case where the premises are true and the
conclusion is false, the argument is invalid.
The validity of an argument depends on its logical form, not the specific
content of the statements. Hence, the arguments are generally written in
symbolic form and then checked for their validity.

5.2.1 Example of a Valid Argument

• Premise 1: If it rains, then the ground will be wet.


• Premise 2: It is raining.
• Conclusion: The ground is wet.

Department of Mathematics 9 RV College of Engineering


5.3 Rules of inference 5 RULES OF INFERENCE

The above argument can be symbolically written as follows:


p→q
p
∴q

5.2.2 An Invalid Argument


• Premise 1: If it rains, then the ground will be wet.
• Premise 2: The ground is wet.
• Conclusion: It is raining.

5.3 Rules of inference

Rule of Inference Related Logical Name of Rule


Implication
p∧q (p ∧ q) =⇒ p Conjunctive
Simplification
∴p
p p =⇒ p ∨ q Disjunctive
Amplification
∴p∨q
p→q [p ∧ (p =⇒ q)] → q Modus Ponens
p
∴q
p→q [(p → q) ∧ ¬q] =⇒ ¬p Modus Tollens
¬q
∴ ¬p
p→q [(p → q) ∧ (q → r)] Rule of Syllogism
q→r =⇒ (p → r)
∴p→r
p Rule of Conjunction
q
∴p∧q
p∨q [(p ∨ q) ∧ ¬p] =⇒ q Disjunctive Syllogism
¬p
∴q
¬p → F0 (¬p → F0 ) =⇒ p Rule of Contradiction
∴p

5.4 Direct examples


(a) Use Modus Ponens to derive the conclusion from the premises:
If it rains, then the ground will be wet. It is raining.

Department of Mathematics 10 RV College of Engineering


5.5 Problems 5 RULES OF INFERENCE

Solution:
Therefore, the ground is wet.
(b) Use Modus Tollens to derive the conclusion from the premises:

If the dog barks, then someone is at the door. No one is at the door.

Solution:
Therefore, the dog did not bark.
(c) Use Disjunctive Syllogism to derive the conclusion from the premises:

Either the light is on or the switch is broken. The light is not on.

Solution:
Therefore, the switch is broken.
(d) Use Hypothetical Syllogism to derive the conclusion from the premises:

If I study hard, I will pass the exam. If I pass the exam, I will get a job.

Solution:

Therefore, if I study hard, I will get a job.

(e) Use Constructive Dilemma to derive the conclusion from the premises:
If I go to the party, I will have fun. If I stay home, I will study.
Either I go to the party or I stay home.
Solution:

Therefore, either I will have fun or I will study.

(f) Use Conjunction to derive the conclusion from the premises:

The sky is blue. The grass is green.

Solution:

Therefore, the sky is blue and the grass is green.

5.5 Problems
(a) Prove that the following argument is valid using rules of inference:

If it snows, then I will stay home.


If I stay home, I will watch a movie.
It is snowing.
∴ I will watch a movie.

Department of Mathematics 11 RV College of Engineering


5.5 Problems 5 RULES OF INFERENCE

Solution: The argument can be symbolized as follows:


p→q
q→r
p
∴r

1. p → q premise)
2. q → r (premise)
3. p (premise)
4. q (From 1 and 3 using Modus Ponens.)
5. r (From 2 and 4 using Modus Ponens.)
Therefore, the argument is valid.
(b) Prove the following argument using rules of inference:

If the meeting is canceled, then I will go to the gym.


If I go to the gym, I will feel tired.
I do not feel tired.
∴ The meeting was not canceled.
Solution: The argument can be symbolized as follows:
p→q
q→r
¬r
∴ ¬p
1. p→q (premise)
2. q→r (premise)
3. ¬r (premise)
4. ¬q (From 2 and 3 using Modus Tollens.)
5. ¬p (From 1 and 4 using Modus Tollens.)
Therefore, the argument is valid.
(c) Check if ¬Q follows logically from the premises:
i. P → (Q → R)
ii. ¬R
iii. P
Solution:
i. P → (Q → R) Premise
ii. ¬R Premise
iii. P Premise

Department of Mathematics 12 RV College of Engineering


5.5 Problems 5 RULES OF INFERENCE

iv. Q → R Modus Ponens (from 1 and 3)


v. ¬Q Modus Tollens (from 4 and 2)
Therefore the argument is valid.
(d) Prove that the conclusion s follows logically from the premises p ∨
q, ¬p, q → r, r → s.
Solution:

1. p∨q (Premise 1)
2. ¬p (Premise 2)
3. q→r (Premise 3)
4. r → s (Premise 4)
5. q (From 1 and 2 using Disjunctive Syllogism)
6. r (From 3 and 5 using Modus Ponens)
7. s (From 4 and 6 using Modus Ponens)
Thus, the argument is valid.
(e) Prove the following argument using rules of inference:
Either I will go to the party or I will stay home. If I go to the party,
I will have fun. If I stay home, I will study. Therefore, either I will
have fun or I will study.
Solution:
The argument can be symbolized as follows:
p∨q
p→r
q→s
∴r∨s

1. p∨q (Either I will go to the party or I will stay home.)


2. p→r (If I go to the party, I will have fun.)
3. q → s (If I stay home, I will study.)
4. ¬(¬p) ∨ q (law of double negation on 1)
5. ¬p → q (conditional on 4)
6. ¬p → s (rule of syllogism on 5 and 3)
7. ¬s → p (contrapositive on 6)
8. ¬s → r (rule of syllogism on 7 and 2)
9. ¬(¬s) ∨ r (conditional)
10. s∨r (double negation on 9)

Therefore, the argument is valid.

Department of Mathematics 13 RV College of Engineering


Open statements
Definition: Declarative sentences with variables are called open statements.
Ex: 𝑥 + 3 = 6, 𝑥/4, 𝑥𝑦 < 2
The unspecified symbols (such as 𝑥) are called free variables.
Open statements containing a free variable 𝑥 are denoted by 𝑝(𝑥), 𝑞(𝑥) etc.
If 𝑈 is the set of elements such that 𝑝(𝑥) becomes a proposition when 𝑥 is replaced by the
elements of 𝑈, then 𝑈 is called the universe of discourse (domain of discourse).
If 𝑎 ∈ 𝑈 then the proposition obtained by replacing 𝑥 by 𝑎 is denoted by 𝑝(𝑎).
Ex: Consider the open statement 𝑝(𝑥): 𝑥 + 5 = 7, then
𝑝(2): 2 + 5 = 7 is true and 𝑝(3): 3 + 5 = 7 is false.
Note:
1. An open statement becomes a proposition only when 𝑥 is replaced by any element of the
universe or quantifying the variable.
2. ¬𝑝(𝑥) is negation of 𝑝(𝑥)
3. 𝑝(𝑥)˄ 𝑞(𝑥) is conjunction
4. 𝑝(𝑥)˅ 𝑞(𝑥) is disjunction
5. 𝑝(𝑥) → 𝑞(𝑥) is conditional
6. 𝑝(𝑥) ↔ 𝑞(𝑥) is biconditional
7. For a given open statement and given element of the universe we can determine the truth
or falsity of given open statements using the same rules as we have used in case of
compound propositions.
8. Open statements are also called predicates or propositional functions.
Ex: 𝑝(𝑥): 𝑥 > 2 is a predicate
𝑝(4): 4 > 2 is a proposition (Truth value is T).

Quantifiers:
The words which are associated with the proposition with an idea of quantity are called
quantifiers.
Types of quantifier:

1) Universal quantifier
2) Existential quantifier

Universal quantifier
The universal quantification of 𝑝(𝑥) is the statement “𝑝(𝑥) for all values of 𝑥 in the domain”
The notation is ∀𝑥 𝑝(𝑥) (read as ‘for all 𝑝(𝑥)’ or ‘for every 𝑥 𝑝(𝑥)’). Here ∀ is called universal
quantifier.

Ex:
1) 𝑝(𝑥): 𝑥 + 1 > 𝑥, domain consists of all real numbers. What is the truth value of ∀𝑥 𝑝(𝑥)?
Ans: True
2) 𝑝(𝑥): 𝑥 2 > 𝑥, domain consists of all integers. What is the truth value of ∀𝑥 𝑝(𝑥)?
Ans: False (∵ 12 ≯ 1)

Existential quantifier:
The existential quantification of 𝑝(𝑥) is the statement “There exists an element 𝑥 in the domain
such that 𝑝(𝑥)”. The notation is ∃𝑥 𝑝(𝑥). Here ∃ is called the existential quantifier.
Ex: 𝑝(𝑥): 𝑥 > 3, domain is set of all real numbers.
Truth value of ∃𝑥 𝑝(𝑥) is T.
Statement When True? When False?
∀𝑥 𝑝(𝑥) 𝑝(𝑥) is true for every 𝑥 There is an 𝑥 for which 𝑝(𝑥) is false
∃𝑥 𝑝(𝑥) There is an 𝑥 for which 𝑝(𝑥) is true 𝑝(𝑥) is false for every 𝑥

Remarks: If 𝑝(𝑥) is a propositional function where 𝑥 is defined on 𝐷. Suppose 𝐷 is a finite set


(say 𝐷 = {𝑥1 , 𝑥2 , … 𝑥𝑛 }) then
a) ∀𝑥 𝑝(𝑥) ≡ 𝑝(𝑥1 )˄𝑝(𝑥2 )˄ … . ˄𝑝(𝑥𝑛 )
b) ∃𝑥 𝑝(𝑥) ≡ 𝑝(𝑥1 )˅𝑝(𝑥2 )˅ … . ˅𝑝(𝑥𝑛 )

The Uniqueness quantifier:


There is no limitation on the number of different quantifiers we can define, such as “there are
exactly two”, “there are no more than three” and so on. Of these other quantifiers, one that is
most often seen is the uniqueness quantifier, denoted by ∃! or ∃1 . The notation ∃! 𝑥 𝑝(𝑥) states
“There exists a unique 𝑥 such that 𝑝(𝑥) is true” or “There exists exactly one 𝑥 such that 𝑝(𝑥) is
true”.
Ex: ∃! 𝑥 (𝑥 − 1 = 0) where the domain is ℝ.
∃! 𝑥 (𝑥 − 1 = 0) says that there exists exactly one real number such that 𝑥 − 1 = 0. This
statement is true since 𝑥 = 1 is the unique real number which satisfies 𝑥 − 1 = 0.
Ex: Suppose the universe comprises of all real numbers. The open statements 𝑝(𝑥), 𝑞(𝑥), 𝑟(𝑥)
and 𝑠(𝑥) are given by:
𝑝(𝑥): 𝑥 ≥ 0
𝑞(𝑥): 𝑥 2 ≥ 0
𝑟(𝑥): 𝑥 2 − 3𝑥 − 4 = 0
𝑠(𝑥): 𝑥 2 − 3 > 0.
Obtain the truth value of the following statements.
a) ∃𝑥 (𝑝(𝑥) ∧ 𝑟(𝑥)) b) ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥))
Solution:
a) The truth value is 𝑇. This follows because the real number 4, for example is a member of
the universe and is such that both the statements 𝑝(4) and 𝑟(4) are true.
b) If we replace 𝑥 in 𝑝(𝑥) by a negative real number 𝑎, then 𝑝(𝑎) is false, but 𝑝(𝑎) → 𝑞(𝑎) is
true regardless of the truth value of 𝑞(𝑎). Also, if 𝑥 is non-negative real number 𝑏, then
𝑝(𝑏) and 𝑞(𝑏) are true, as is 𝑝(𝑏) → 𝑞(𝑏). Thus ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥)) is True.

Exercise: Examine the truth value of the following statements where 𝑝(𝑥), 𝑞(𝑥), 𝑟(𝑥) and 𝑠(𝑥)
are as above example.
a) ∀𝑥 (𝑞(𝑥) → 𝑠(𝑥)) (Ans: F)
b) ∀𝑥 (𝑟(𝑥) ∨ 𝑠(𝑥)) (Ans: F)
c) ∀𝑥 (𝑟(𝑥) → 𝑝(𝑥)) (Ans: F)

Quantifiers with restricted domains:


An abbreviated notation is often used to restrict the domain of a quantifier. In this notation, a
variable must satisfy a condition that is included after the quantifier.

Ex: ∀𝑥 < 0 (𝑥 2 > 0), 𝑈 = ℝ states that for every real number 𝑥 with 𝑥 < 0, 𝑥 2 > 0 i.e. “The
square of negative real number is positive”. The truth value of this statement is T. This
statement is same as ∀𝑥 (𝑥 < 0 → 𝑥 2 > 0).

Exercise:
Explain the meaning of the following statements where 𝑈 = ℝ:
a) ∀𝑦 ≠ 0 (𝑦 3 ≠ 0)
b) ∃𝑧 > 0 (𝑧 2 = 2)
Precedence of Quantifiers:
The quantities ∀ and ∃ have higher precedence than all logical operators. For example,
∀𝑥 𝑝(𝑥)˅𝑞(𝑥) is the disjunction of ∀𝑥 𝑝(𝑥) and 𝑞(𝑥).

Translating from English into Logical expressions

Ex: Translate the following sentence into predicate logic

1. Every student in this class has taken a course in Python.


Solution:
The solution depends on the domain 𝑈. If 𝑈 is all the students in this class, define a
propositional function 𝑝(𝑥) denoting “𝑥 has taken a course in Python” and translates as
∀𝑥 𝑝(𝑥).

2. Some student in this class has taken a course in Python.


Solution:
If 𝑈 is all the students in this class then the sentence translates as ∃𝑥 𝑝(𝑥).

Exercise:
1. Every student in this class has visited either Canada or Mexico.
(Ans: ∀𝑥 (𝐶(𝑥) ∨ 𝑀(𝑥)))

2. There exists some integer which is divisible by 3 and is not even.


(Ans: ∃𝑥 (𝑝(𝑥) ∧ ¬𝑞(𝑥))).

Logical Equivalences involving quantifiers


Statements involving predicates and quantifiers are logically equivalent if and only if they
have the same truth value
a) for every domain of discourse used for the variable in the expressions
b) for every predicate substituted into these statements.

The notation 𝑆 ≡ 𝑇 or 𝑆 ↔ 𝑇 indicates that 𝑆 and 𝑇 are logically equivalent.


Ex: ∀𝑥 (𝑝(𝑥) ∧ 𝑞(𝑥)) and ∀𝑥 𝑝(𝑥) ∧ ∀𝑥 𝑞(𝑥) are logically equivalent.

Negating quantified expression

 Universal quantifier:
Consider the statement ∀𝑥 𝑝(𝑥) where 𝑝(𝑥) states “𝑥 has taken a course in Python”. If
domain 𝑈 consists of all the students in this class, then ∀𝑥 𝑝(𝑥) states that “Every student
in this class has taken a course in Python”. The negation of ∀𝑥 𝑝(𝑥) is “It is not the case
that every student in this class has taken a course in Python” OR “There is a student in this
class who has not taken a course in Python”. Symbolically, ¬ ∀𝑥 𝑝(𝑥) is the negation of
∀𝑥 𝑝(𝑥) and it is logically equivalent to ∃𝑥 ¬ 𝑝(𝑥) i.e. ¬ ∀𝒙 𝒑(𝒙) ≡ ∃𝒙 ¬ 𝒑(𝒙).

 Existential quantifier:
Consider the statement ∃𝑥 𝑞(𝑥) which states “Some student in this class has taken a course
in Python”. The negation of this statement is “It is not the case that there is a student in this
class who has taken a course in Python” OR “Every student in this class has not taken a
course in Python”. Symbolically, ¬ ∃𝒙 𝒒(𝒙) ≡ ∀𝒙 ¬ 𝒒(𝒙).

De Morgan’s laws for Quantifiers:

Negation Equivalent When is Negation True? When False?


statement
¬ ∃𝑥 𝑝(𝑥) ∀𝑥 ¬ 𝑝(𝑥) For every 𝑥, 𝑝(𝑥) is false
There is an 𝑥 for which
𝑝(𝑥) is true.
¬ ∀𝑥 𝑝(𝑥) ∃𝑥 ¬ 𝑝(𝑥) There is an 𝑥 for which 𝑝(𝑥) is true for every 𝑥.
𝑝(𝑥) is false.

Example: Negate the following statements


1. ∀𝑥 (𝑥 2 > 𝑥)
2. ∃𝑥 (𝑥 2 = 2)
where 𝑈 = ℝ.
Solution:
1. ¬(∀𝑥 (𝑥 2 > 𝑥)) ≡ ∃𝑥¬(𝑥 2 > 𝑥) ≡ ∃𝑥(𝑥 2 ≤ 𝑥)
2. ¬∃𝑥 (𝑥 2 = 2) ≡ ∀𝑥 ¬(𝑥 2 = 2) ≡ ∀𝑥(𝑥 2 ≠ 2).

Definition: For open statements 𝑝(𝑥) and 𝑞(𝑥) defined for a prescribed universe and the
universally quantified statement ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥)) we define:
1) The contrapositive of ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥)) to be ∀𝑥(¬ 𝑞(𝑥) → ¬ 𝑝(𝑥)).
2) The converse of ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥)) to be ∀𝑥 (𝑞(𝑥) → 𝑝(𝑥)).
3) The inverse of ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥)) to be ∀𝑥(¬ 𝑝(𝑥) → ¬ 𝑞(𝑥)).
Example: For the universe of all quadrilaterals in the plane, let 𝑠(𝑥) and 𝑒(𝑥) denote the open
statements
𝑠(𝑥): 𝑥 is a square
𝑒(𝑥): 𝑥 is equilateral
Obtain the truth value of ∀𝑥(𝑠(𝑥) → 𝑒(𝑥)) and hence its contrapositive. Examine
their logical equivalence.
Solution: The statement ∀𝑥(𝑠(𝑥) → 𝑒(𝑥)) is true and logically equivalent to its contrapositive
∀𝑥 (¬ 𝑒(𝑥) → ¬ 𝑠(𝑥)) because (𝑠(𝑎) → 𝑒(𝑎)) ↔ (¬ 𝑒(𝑎) → ¬ 𝑠(𝑎)) for each
replacement 𝑎. Hence ∀𝑥(𝑠(𝑥) → 𝑒(𝑥)) ≡ ∀𝑥 (¬ 𝑒(𝑥) → ¬ 𝑠(𝑥)).
Exercise: For the universe of all quadrilaterals in the plane, let 𝑠(𝑥) and 𝑒(𝑥) denote the open
statements
𝑠(𝑥): 𝑥 is a square
𝑒(𝑥): 𝑥 is equilateral
Obtain the truth value of ∀𝑥(𝑠(𝑥) → 𝑒(𝑥)) and hence its converse, inverse.
Examine the logical equivalence of converse and inverse of the statement.
(Ans: Truth value of converse and inverse is 𝐹 and are logically equivalent)
Note: Logical equivalences and logical implications for quantified statements in one variable
1) ∃𝑥(𝑝(𝑥) ∧ 𝑞(𝑥)) → (∃𝑥 𝑝(𝑥) ∧ ∃𝑥 𝑞(𝑥))
2) ∃𝑥(𝑝(𝑥) ∨ 𝑞(𝑥)) ↔ (∃𝑥 𝑝(𝑥) ∨ ∃𝑥 𝑞(𝑥))
3) ∀𝑥(𝑝(𝑥) ∧ 𝑞(𝑥)) ↔ (∀𝑥 𝑝(𝑥) ∧ ∀𝑥 𝑞(𝑥))
4) (∀𝑥 𝑝(𝑥) ∨ ∀𝑥 𝑞(𝑥)) → ∀𝑥 (𝑝(𝑥) ∧ 𝑞(𝑥))
Example: Let 𝑝(𝑥), 𝑞(𝑥) and 𝑟(𝑥) denote the open statements for a given universe. Examine
if the following statements are logical equivalent.

1. ∀𝑥 (𝑝(𝑥) ∧ (𝑞(𝑥) ∧ 𝑟(𝑥))) ≡ ∀𝑥 ((𝑝(𝑥) ∧ 𝑞(𝑥)) ∧ 𝑟(𝑥))

Solution: For each 𝑎 in the universe consider the statements 𝑝(𝑎) ∧ (𝑞(𝑎) ∧ 𝑟(𝑎)) and
(𝑝(𝑎) ∧ 𝑞(𝑎)) ∧ 𝑟(𝑎). By the Associative law for ∧, we have
𝑝(𝑎) ∧ (𝑞(𝑎) ∧ 𝑟(𝑎)) ↔ (𝑝(𝑎) ∧ 𝑞(𝑎)) ∧ 𝑟(𝑎)

Consequently, it follows that ∀𝑥 (𝑝(𝑥) ∧ (𝑞(𝑥) ∧ 𝑟(𝑥))) ≡ ∀𝑥 ((𝑝(𝑥) ∧ 𝑞(𝑥)) ∧ 𝑟(𝑥))

2. ∃𝑥 (𝑝(𝑥) → 𝑞(𝑥)) ≡ ∃𝑥 (¬ 𝑝(𝑥) ∨ 𝑞(𝑥))


Solution: If 𝑝(𝑥) is false, both 𝑝(𝑥) → 𝑞(𝑥) and ¬ 𝑝(𝑥) ∨ 𝑞(𝑥) are true regardless of the
truth value of 𝑞(𝑥). If 𝑝(𝑥) is true, both 𝑝(𝑥) → 𝑞(𝑥) and ¬ 𝑝(𝑥) ∨ 𝑞(𝑥) are true
only if 𝑞(𝑥) is true. Thus 𝑝(𝑥) → 𝑞(𝑥) ≡ ¬ 𝑝(𝑥) ∨ 𝑞(𝑥). Consequently,
∃𝑥 (𝑝(𝑥) → 𝑞(𝑥)) ≡ ∃𝑥 (¬ 𝑝(𝑥) ∨ 𝑞(𝑥))
Exercise: Suppose the Universe comprises of all integers. Let 𝑝(𝑥) and 𝑞(𝑥) be given by

𝑝(𝑥): 𝑥 is odd

𝑞(𝑥): 𝑥 2 − 1 is even

Find the negation and truth value of ∀𝑥 (𝑝(𝑥) → 𝑞(𝑥)).


(Ans: ∃𝑥 (𝑝(𝑥) ∧ ¬ 𝑞 (𝑥)), False))

Nested quantifiers
One way to make 𝑝(𝑥, 𝑦) (proposition function with two variables or in general more
than one) a proposition is by quantifying both the variables 𝑥 and 𝑦 where one variable
is quantified within the scope of the other.
Ex: 1. “Every real number has an additive inverse” is ∀𝑥 ∃𝑦(𝑥 + 𝑦 = 0) − −(1) where
the domains of 𝑥 and 𝑦 are real numbers.
Consider ∃𝑦 ∀𝑥(𝑥 + 𝑦 = 0) − −(2). Here (1) is not same as (2). (1) is true and (2) is
false.
Ex: 2. 𝑝(𝑥, 𝑦): 𝑥𝑦 = 0
a) ∀𝑥 ∀𝑦 𝑝(𝑥, 𝑦) − 𝐹𝑎𝑙𝑠𝑒
b) ∀𝑥 ∃𝑦 𝑝(𝑥, 𝑦) − 𝑇𝑟𝑢𝑒
c) ∃𝑥 ∀𝑦 𝑝(𝑥, 𝑦) − 𝑇𝑟𝑢𝑒
d) ∃𝑥 ∃𝑦 𝑝(𝑥, 𝑦) − 𝑇𝑟𝑢𝑒

Statement When True? When False?


∀𝑥 ∀𝑦 𝑝(𝑥, 𝑦) 𝑝(𝑥, 𝑦) is true for every pair of 𝑥 There is a pair 𝑥, 𝑦 for which
∀𝑦 ∀𝑥 𝑝(𝑥, 𝑦) and 𝑦. 𝑝(𝑥, 𝑦) is false.
∀𝑥 ∃𝑦 𝑝(𝑥, 𝑦) For every 𝑥 there is a 𝑦 such that There is an 𝑥 such that 𝑝(𝑥, 𝑦) is
𝑝(𝑥, 𝑦) is true. false for all 𝑦.
∃𝑥 ∀𝑦 𝑝(𝑥, 𝑦) There is an 𝑥 such that 𝑝(𝑥, 𝑦) is For every 𝑥 there is a 𝑦 such that
true for all 𝑦. 𝑝(𝑥, 𝑦) is false.
∃𝑥 ∃𝑦 𝑝(𝑥, 𝑦) There is a pair 𝑥, 𝑦 for which 𝑝(𝑥, 𝑦) is false for every pair of 𝑥
∃𝑦 ∃𝑥 𝑝(𝑥, 𝑦) 𝑝(𝑥, 𝑦) is true. and 𝑦.
Nested quantifiers into English

Example:
1. Let 𝐶(𝑥): 𝑥 has a computer and 𝐹(𝑥, 𝑦): 𝑥 and 𝑦 are friends
The domains for 𝑥 and 𝑦 be all students in a school.

Translate ∀𝑥 ((𝐶(𝑥) ∨ ∃𝑦(𝐶(𝑦) ∧ 𝐹(𝑥, 𝑦))) into English.

Solution: Every student in a school has a computer or has a friend who has a computer.
2. ∃𝑥 ∀𝑦 ∀𝑧 (𝐹(𝑥, 𝑦) ∧ 𝐹(𝑥, 𝑧) ∧ (𝑦 ≠ 𝑧)) → ¬ 𝐹(𝑦, 𝑧). Here 𝐹(𝑥, 𝑦): 𝑥 and 𝑦 are friends.
Domain for 𝑥, 𝑦 and 𝑧 consists of all students in a school.
Solution: There is a student 𝑥 who has two friends, 𝑦 and 𝑧 and those two are not friends with
each other OR There is a student 𝑥 in a school such that none of his friends are also friends with
each other.

English sentence into logical expression

Example: There is a woman who has taken a flight on every airline in the world. Convert to
logical expression.
Solution: Let 𝑝(𝑤, 𝑓): 𝑤 has taken 𝑓 and 𝑞(𝑓, 𝑎): 𝑓 is a flight on 𝑎
Domain for 𝑤 is all women, 𝑓 is all flights, 𝑎 is all airlines.
Logical expression is ∃𝑤 ∀𝑎 ∃𝑓 (𝑝(𝑤, 𝑓) ∧ 𝑞(𝑓, 𝑎)).

Mathematical statements to predicate logic


Example: The sum of two positive integers is always positive. Translate to logical expression.
Solution: ∀𝑥 ∀𝑦 (𝑥 + 𝑦 > 0), domain of 𝑥, 𝑦 consists of positive integers.
Or ∀𝑥 > 0 ∀𝑦 > 0 (𝑥 + 𝑦 > 0), domain of 𝑥, 𝑦 consists of all integers.
Exercise:
Translate “Every real number except zero has a multiplicative inverse” to a logical expression.

Negating nested quantifiers


DeMorgan’s laws:
¬(∀𝑥 ∀𝑦 𝑝(𝑥, 𝑦)) ≡ ∃𝑥 ∃𝑦 ¬ 𝑝(𝑥, 𝑦)
¬(∀𝑥 ∃𝑦 𝑝(𝑥, 𝑦)) ≡ ∃𝑥 ∀𝑦 ¬ 𝑝(𝑥, 𝑦)
¬(∃𝑥 ∀𝑦 𝑝(𝑥, 𝑦)) ≡ ∀𝑥 ∃𝑦 ¬ 𝑝(𝑥, 𝑦)
¬(∃𝑥 ∃𝑦 𝑝(𝑥, 𝑦)) ≡ ∀𝑥 ∀𝑦 ¬ 𝑝(𝑥, 𝑦)
Example: Write the negation for
1. There is a woman who has taken a flight on every airline in the world.
Solution: ∃𝑤 ∀𝑎 ∃𝑓 (𝑝(𝑤, 𝑓) ∧ 𝑞(𝑓, 𝑎)) is logical expression of the given statement.
Negation: ¬ (∃𝑤 ∀𝑎 ∃𝑓 (𝑝(𝑤, 𝑓) ∧ 𝑞(𝑓, 𝑎)) ≡ ∀𝑤 ∃𝑎 ∀𝑓(¬ 𝑝(𝑤, 𝑓) ∨ ¬ 𝑞(𝑓, 𝑎))
For every woman there is an airline such that for all flights, this woman has not taken that flight
or this flight is not on this airline.

Exercise: Write the negation for ∃𝑦 (𝐵(𝑥, 𝑦) ∧ ∀𝑧 ((𝑧 ≠ 𝑦) → ¬ 𝐵(𝑥, 𝑧)))

(Ans: ∀𝑦 (¬ 𝐵(𝑥, 𝑦) ∨ ∃𝑧 ((𝑧 ≠ 𝑦) ∧ 𝐵(𝑥, 𝑦)))

Rules of inference for quantified statements

Rule of Inference Name


∀𝑥 𝑝(𝑥) Universal instantiation
∴ 𝑝(𝑐) or Universal specification
where 𝑐 is any element in the Universe
𝑝(𝑐) for an arbitrary 𝑐 Universal generalisation
∴ ∀𝑥 𝑝(𝑥)
∃𝑥 𝑝(𝑥) Existential instantiation
∴ 𝑝(𝑐) for some element 𝑐
𝑝(𝑐) for some element 𝑐 Existential generalisation
∴ ∃𝑥 𝑝(𝑥)

Example:
1. Show that the premises
“Everyone in this Discrete Math class has taken a course in C. S.”
“John is a student in this class” lead to the conclusion
∴ "John has taken a course in C. S."
Solution: 𝐷(𝑥): 𝑥 is in DM class
𝐶(𝑥): 𝑥 has taken a course in C. S.
Argument form:
∀𝑥 (𝐷(𝑥) → 𝐶(𝑥))
𝐷(𝐽𝑜ℎ𝑛)
∴ 𝐶 (𝐽𝑜ℎ𝑛)
Step Reason
1) ∀𝑥 (𝐷(𝑥) → 𝐶(𝑥)) Premise
2) 𝐷(𝐽𝑜ℎ𝑛) → 𝐶(𝐽𝑜ℎ𝑛) Step 1, Universal instantiation
3) 𝐷(𝐽𝑜ℎ𝑛) Premise
4) 𝐶(𝐽𝑜ℎ𝑛) Step 2 & 3, Modus ponens

2. Show that the premises


“A student in 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”
Solution:
𝐶(𝑥): 𝑥 is in this class
𝐵(𝑥): 𝑥 has read the book
𝑃(𝑥): 𝑥 has passed the first exam
Argument form:
∃𝑥 (𝐶(𝑥) ∧ ¬ 𝐵(𝑥))
∀𝑥 (𝐶(𝑥) → 𝑃(𝑥))
∴ ∃𝑥 (𝑃(𝑥) ∧ ¬ 𝐵(𝑥))
Step Reason
1) ∃𝑥 (𝐶(𝑥) ∧ ¬ 𝐵(𝑥)) Premise
2) 𝐶(𝑎) ∧ ¬ 𝐵(𝑎), 𝑎 is some constant Existential instantiation
3) ∀𝑥 (𝐶(𝑥) → 𝑃(𝑥)) Premise

4) 𝐶(𝑎) → 𝑃(𝑎) Universal instantiation


5) 𝐶(𝑎) Step 2, simplification
6) 𝑃(𝑎) Step 4 & 5, Modus ponens
7) ¬ 𝐵(𝑎) Step 2, simplification
8) 𝑃(𝑎) ∧ ¬ 𝐵(𝑎) Step 6 & 7, conjunction
9) ∃𝑥 (𝑃(𝑥) ∧ ¬ 𝐵(𝑥)) Existential generalisation

Thus the given argument is valid.

Exercise:
1. For each of these arguments, explain which rules of inference are used for each step.
a) “Doug, a student in this class knows how to write programs in JAVA. Everyone who
knows how to write programs in JAVA can get a high-paying job. Therefore, someone
in this class can get a high-paying job”.
b) “Somebody in this class enjoys whale watching. Every person who enjoys whale
watching cares about ocean pollution. Therefore, there is a person in this class who cares
about ocean pollution”.
2. Use rules of inference to show that if ∀𝑥 (𝑝(𝑥) ∨ 𝑞(𝑥)) and

∀𝑥 ((¬ 𝑝(𝑥) ∧ 𝑞(𝑥)) → 𝑟(𝑥)) are true, then ∀𝑥 (¬ 𝑟(𝑥) → 𝑝(𝑥)) is also true, where the

domains of all quantifiers are same.

Methods of proving theorems


1) Direct proof:
Consider the conditional statement 𝑝 → 𝑞. We assume that 𝑝 (hypothesis) is true, we
use axioms, previous proved results, definitions and rule of inference. Finally we prove
𝑞 is true. This is called direct proof.
Example: Prove that “If 𝑛 is an odd integer, then 𝑛2 is odd”.
Proof:
In terms of logical expression, ∀𝑛 (𝑝(𝑛) → 𝑞(𝑛)) where 𝑝(𝑛): 𝑛 is an odd integer,
𝑞(𝑛): 𝑛2 is odd. We prove that 𝑝(𝑎) → 𝑞(𝑎), 𝑎 is an arbitrary integer. Assume that
𝑝(𝑎) is true, that is 𝑎 is an odd integer.
By definition, 𝑎 = 2𝑘 + 1, for some 𝑘 ∈ ℤ.
𝑎2 = (2𝑘 + 1)2 = 4𝑘 2 + 4𝑘 + 1 = 2(2𝑘 2 + 2𝑘) + 1 = 2𝑘 ′ + 1, (𝑘 ′ = 2𝑘 2 + 2𝑘)
Thus, by definition 𝑎2 is an odd integer.
Exercise: Show that if 𝑚 and 𝑛 are both perfect squares, then 𝑚𝑛 is also a perfect
square.
2) Indirect proof:
Proofs that do not start with premises and end with conclusion are called indirect
proofs.
a) Proof by contraposition: In proof by contraposition of 𝑝 → 𝑞 which is ¬ 𝑞 → ¬ 𝑝,
we assume that 𝑞 is false, then show that 𝑝 is also false.

Example: Prove that if 𝑛 is an integer and 3𝑛 + 2 is odd, then 𝑛 is odd.


Proof: Let 𝑛 be any integer. Assume that 3𝑛 + 2 is odd. By definition
3𝑛 + 2 = 2𝑘 + 1, for some 𝑘 ∈ ℤ.
2𝑘 − 1
3𝑛 + 1 = 2𝑘 ⇒ 3𝑛 = 2𝑘 − 1 ⇒ 𝑛 =
3
We failed to show that 𝑛 is odd by direct proof.
Proof by contraposition: Assume that 𝑛 is an even integer. By definition,
𝑛 = 2𝑘, for some 𝑘 ∈ ℤ.
3𝑛 = 3(2𝑘) ⇒ 3𝑛 + 2 = 3(2𝑘) + 2 = 2(3𝑘 + 1) = 2𝑘 ′ , 𝑘 ′ = 3𝑘 + 1
Thus 3𝑛 + 2 is an even integer, by definition.
We have proved the theorem.
Exercise:
1) Prove that if 𝑛 = 𝑎𝑏, where 𝑎 and 𝑏 are positive integers, then 𝑎 ≤ √𝑛 or 𝑏 ≤ √𝑛
2) Prove that if 𝑛 ∈ ℤ and 𝑛2 is odd, then 𝑛 is odd.

Vacuous proof:
Consider the conditional statement 𝑝 → 𝑞. If we could show that 𝑝 is false, then we can say
that 𝑝 → 𝑞 is true.
Ex: Show that 𝑝(0) is true where 𝑝(𝑛): If 𝑛 > 1, then 𝑛2 > 𝑛.
Proof: Clearly, 𝑝(0) is true, ∵ 𝑛 > 1 is false when 𝑛 = 0.
Remark: The fact that the conclusion of this conditional statement, 02 > 0, is false is
irrelevant to the truth value of the conditional statement, because a conditional
statement with a false hypothesis is guaranteed to be true.

Trivial proof:
If we can show (quickly) that 𝑞 is true in the statement 𝑝 → 𝑞 then we can say that 𝑝 → 𝑞 is
true.
Ex: 𝑝(𝑛): If 𝑎 and 𝑏 are positive integers with 𝑎 ≥ 𝑏, then 𝑎𝑛 ≥ 𝑏 𝑛 , when 𝑛 is any non-
negative integer. Show that 𝑝(0) is true.
Proof: Since 𝑎0 ≥ 𝑏 0 for any 𝑎, 𝑏, we can conclude that 𝑝(0) is true.

b) Proof by contradiction:
To prove 𝑝 → 𝑞 by contradiction, assume that 𝑞 is false and 𝑝 is true, i. e. (𝑝 ∧ ¬ 𝑞) is
true. Show that ¬ 𝑝 is also true. But 𝑝 ∧ ¬ 𝑝 is a contradiction.
Ex: Show that if 3𝑛 + 2 is odd, then 𝑛 is odd.
Proof: Proof by contradiction
𝑝: 3𝑛 + 2 is odd, 𝑞: 𝑛 is odd
Assume that 𝑝 ∧ ¬ 𝑞 is true, that is 3𝑛 + 2 is odd and 𝑛 is even.
By definition 𝑛 = 2𝑘 for some 𝑘 ∈ ℤ
⇒ 3𝑛 + 2 = 6𝑘 + 2 = 2(3𝑘 + 1) = 2𝑘 ′ , 𝑘 ′ = 3𝑘 + 1
This implies that 3𝑛 + 2 is even. This contradicts our assumption that 3𝑛 + 2 is odd.
∴ 𝑛 is odd. This completes the proof.
Exercise:
1. Prove that √2 is irrational by giving a proof by contradiction.

Proof by equivalence:
Let us consider a biconditional statement 𝑝 ↔ 𝑞. We know that 𝑝 ↔ 𝑞 ≡ (𝑝 → 𝑞) ∧ (𝑞 → 𝑝)

Ex: Show that these statements about the integer 𝑛 are equivalent
𝑝1 : 𝑛 is even, 𝑝2 : 𝑛 − 1 is odd, 𝑝3 : 𝑛2 is even.
Proof: We will show that these three statements are equivalent by showing that the
conditional statements 𝑝1 → 𝑝2 , 𝑝2 → 𝑝3 and 𝑝3 → 𝑝1 are true.
To prove 𝑝1 → 𝑝2 :
Suppose 𝑛 is even. Then 𝑛 = 2𝑘, for some 𝑘 ∈ ℤ
⇒ 𝑛 − 1 = 2𝑘 − 1 = 2(𝑘 − 1) + 1 = 2𝑚 + 1, 𝑚 = 𝑘 − 1
∴ 𝑛 − 1 is odd
To prove 𝑝2 → 𝑝3 :
Suppose 𝑛 − 1 is odd. Then 𝑛 − 1 = 2𝑘 + 1, for 𝑘 ∈ ℤ
⇒ 𝑛 = 2𝑘 + 2
⇒ 𝑛 = (2𝑘 + 2) = 4𝑘 2 + 4 + 8𝑘 = 2(2𝑘 2 + 4𝑘 + 2) = 2𝑘′
2 2

∴ 𝑛2 is even
To prove 𝑝3 → 𝑝1 :
Let 𝑛2 is even and 𝑛 is odd.
𝑛 = 2𝑘 + 1
⇒ 𝑛2 = (2𝑘 + 1)2 = 4𝑘 2 + 4𝑘 + 1 = 2(2𝑘 2 + 2𝑘) + 1 = 2𝑦 + 1, 𝑦 = 2𝑘 2 + 2𝑘
⇒ 𝑛2 is odd. This contradicts our assumption that 𝑛2 is even.
∴ 𝑛 is even. This completes the proof.

Exercise:
1. Prove that “If 𝑛 is an integer then 𝑛 is odd iff 𝑛2 is odd”.

Counterexample: To show that ∀𝑥 𝑝(𝑥) is incorrect, it is enough to show that 𝑝(𝑥) is false
for some element in the Universe.
Ex: Show that “Every positive integer is the sum of the squares of two integers” is false.
Proof: 7 is a positive integer which cannot be written as sum of squares of two integers.

You might also like