Download as pdf or txt
Download as pdf or txt
You are on page 1of 59

Logic and Proofs

Why one should study logic?


Logic is very much important in mathematical reasoning. Beside
that it has numerous applications to computer science.
It is used in the design of computer circuits, the construction of
computer programs, the verification of the correctness of pro-
grams, and in many other ways.
Software systems have been developed for constructing some
types of proofs automatically.
Propositions

Proposition:
A proposition or a statement is a declarative sentence that is either
true or false, but not both.
Examples:
Vijayawada is the capital of India.
I am in Vyzag.
1+3=4.
2+2=7.
Who are you?
Give me a cup of tea.
x+3=6.
xy=z.
First four sentences are declarative sentences which are either true
or false, but not both. So those are propositions. Fifth and sixth
sentences are not propositions because they are not declarative
sentences. Last two sentences are not propositions because they are
neither true nor false.
Propositional variables and truth value:
We use letters to denote propositional variables which represent
propositions. The truth value of a proposition is true, denoted by T, if it
is a true proposition, and the truth value of a proposition is false,
denoted by F, if it is a false proposition.
Compound propositions:
New propositions which are formed from existing propositions using
logical operators, are called compound propositions.
We discuss some of the compound propositions as follows:
Negation of a proposition: Let p be a proposition. The negation of
p, denoted by ¬p, is the statement:
“It is not the case that p.”
The proposition ¬p is read “not p”. The truth value of ¬p is the
opposite of the truth value of p.

The Truth Table for the Negation of a Proposition:

p ¬p
T F
F T

Example: Find the negation of the proposition “It is raining” and


express this in simple English.
Solution: The negation is
“It is not the case that it is raining.”
More simply it can be expressed as
“It is not raining.”
The conjunction of propositions: Let p and q be propositions. The
conjunction of p and q, denoted by p ∧ q, is the proposition “p and q”.
The conjunction p ∧ q is true when both p and q are true and is false
otherwise.

The Truth Table for the Conjunction of Two Propositions:

p q p∧q
T T T
T F F
F T F
F F F

Example: Find the conjunction of the propositions “Ram loves to play


football”, “Ram has scored a goal in the last match”.
Solution: The conjunction is
“Ram loves to play football and he has scored a goal in the last
match”.
The disjunction of propositions: Let p and q be propositions. The
disjunction of p and q, denoted by p ∨ q, is the proposition “p or q”.
The disjunction p ∨ q is false when both p and q are false and is true
otherwise.

The Truth Table for the disjunction of two proposition:

p q p∨q
T T T
T F T
F T T
F F F

Example: Find the disjunction of the propositions “Ram loves to play


football”, “Ram loves to play cricket”.
Solution: The disjunction is
“Ram loves to play football or cricket”.
The exclusive or of propositions: Let p and q be propositions. The
exclusive or of p and q, denoted by p ⊕ q, is the proposition that is
true when exactly one of p and q is true and false otherwise.

The Truth Table for the Exclusive Or of Two Propositions:

p q p⊕q
T T F
T F T
F T T
F F F
Conditional Statements: Let p and q be propositions. The
conditional statement p → q, is the proposition “if p, then q”. The
conditional statement p → q is false when p is true and q is false and
true otherwise. In the conditional statement p → q, p is called the
hypothesis or condition and q is called the conclusion or
consequence.
Example: If it is raining, then I will stay at home.
The Truth Table for Conditional Statement:

p q p→q
T T T
T F F
F T T
F F T

A variety of terminology is used to express p → q. Some of them are


as follows: “p implies q”, “p is sufficient for q”, “q whenever p”,
“p only if q”, “q is necessary for p”, “q when p”.
The proposition q → p is called the converse of p → q.
The proposition ¬q → ¬p is called the contrapositive of p → q.
The proposition ¬p → ¬q is called the inverse of p → q.
When two compound propositions always have the same truth
value we call them equivalent.

Example: A conditional statement and its contrapositive are


equivalent.
Example: The converse and the inverse of a conditional statement
are equivalent.
Biconditional Statements: Let p and q be propositions. The
biconditional statement p ↔ q, is the proposition “p if and only if q”.
The biconditional statement p ↔ q is true when p and q have the
same truth values, and is false otherwise.
The Truth Table for Biconditional Statement:

p q p↔q
T T T
T F F
F T F
F F T

A variety of terminology is used to express p ↔ q are as follows: “p is


necessary and sufficient for q”, “if p then q, and conversely”, “p iff q”.
Truth Table for Compound Propositions:
Example: Construct the truth table of the compound proposition
(¬p ∨ ¬q) ↔ (p ∧ q).
Solution:

p q p∧q ¬p ¬q ¬p ∨ ¬q (¬p ∨ ¬q) ↔ (p ∧ q)


T T T F F F F
T F F F T T F
F T F T F T F
F F F T T T F

Precedence of logical operators:


¬, ∧, ∨, →, ↔.
Bit Operations:
A bit is a symbol with two possible values, namely, 0 (zero) and 1
(one). Here 1 represents T (true), 0 represents F (false). A variable is
called a Boolean variable if its value is either true or false.
Consequently, a Boolean variable can be represented using a bit. We
will use the notation NOT, OR, AND, and XOR for the operators ¬, ∨,
∧ and ⊕.
Bit String:
A bit string is a sequence of bits. The length of bit string is the
number of bits in the string.
Table for the Bit Operators NOT, OR, AND, and XOR:

x y ¬x x ∨y x ∧y x ⊕y
1 1 0 1 1 0
1 0 0 1 0 1
0 1 1 1 0 1
0 0 1 0 0 0
Applications of Propositional Logic

Translating English Sentence into Logical Expression:


Example: Translate the sentence "It is raining or I will not go to
School only if I will stay at home” into logical expression.
Solution: Let p be the statement "It is raining”, q be the statement "I
will go to School”, r be the statement "I will stay at home”.
Then the required logical expression is
(p ∨ ¬q) → r .

System Specifications: A system is consistent if there is an


assignment of truth values to the variables in the expression for
system specifications that makes each specification true. When
specifications are not consistent, there is no way to develop a system
that satisfies all specifications.
Example: Determine whether these system specifications are
consistent:
“The user has paid the subscription fee, but does not enter a valid
password.”
“Access is granted whenever the user has paid the subscription fee
and enters a valid password.”
“Access is denied if the user has not paid the subscription fee.”
“If the user has not entered a valid password but has paid the
subscription fee, then access is granted.”
Solution: let p denote “The user has paid the subscription fee", q
denote “the user enters a valid password”, r denote “Access is
granted”.
Then system specifications are given by
p ∧ ¬q, p ∧ q → r , ¬p → ¬r , p ∧ ¬q → r .
If p is true, q is false and r is true, then all the specifications are true.
Hence the system specifications are consistent.
Logic Circuits:
A logic circuit (or digital circuit) receives input signals, each a bit
[either 0 or 1], and produces output signals, each a bit.
Complicated digital circuits can be constructed from three basic
circuits, called gates.
NOT gate (Inverter) takes an input bit p and produces as output
¬p.
OR gate takes two input signals p and q, each a bit, and pro-
duces output p ∨ q.
AND gate takes two input signals p and q, each a bit, and pro-
duces output p ∧ q. We use combinations of these three basic
gates to build more complicated circuits.
Example:

Logic Puzzles:
Example: An island has two kinds of inhabitants, knights, who always
tell the truth, and knaves, who always lie. You met two people A and
B in that island. Identify A and B if A says “B is a knight” and B says
“We are of same type”.
Solution: Both A and B are knights.
Propositional Equivalences

A compound proposition that is always true is called a tautology.


Example: p ∨ ¬p, p ∨ T .
A compound proposition that is always false is called a contra-
diction.
Example: p ∧ ¬p, p ∧ F .
A compound proposition that is neither a tautology nor a contra-
diction is called a contingency.
Example: p ∨ q, p ∧ q.
A compound proposition is called a satisfiable if it is true for
some particular truth value of propositional variables.
Example: p ∨ q, p ∧ q.
The compound propositions p and q are called logically equiv-
alent if p ↔ q is a tautology i.e, p and q always have same truth
value. The notation p ≡ q denotes that p and q are logically
equivalent.
Example: Show that ¬(p ∧ q) and ¬p ∨ ¬q are logically equivalent
Solution:

p q p∧q ¬(p ∧ q) ¬p ¬q ¬p ∨ ¬q
T T T F F F F
T F F T F T T
F T F T T F T
F F F T T T T

Example: Show that p → q and ¬p ∨ q are logically equivalent.


Solution:

p q p→q ¬p ¬p ∨ q
T T T F T
T F F F F
F T T T T
F F T T T
Logical Equivalences:

Equivalence Name
p ∧ T ≡ p, p ∨ F ≡ p Identity laws
p ∨ T ≡ T, p ∧ F ≡ F Domination laws
p ∨ p ≡ p, p ∧ p ≡ p Idempotent laws
¬(¬p) ≡ p Double negation law
p ∨ q ≡ q ∨ p, p ∧ q ≡ q ∧ p Commutative laws
(p ∨ q) ∨ r ≡ p ∨ (q ∨ r ), (p ∧ q) ∧ r ≡ p ∧ (q ∧ r ) Associative laws
p ∧ (q ∨ r ) ≡ (p ∧ q) ∨ (p ∧ r ), p ∨ (q ∧ r ) ≡ (p ∨ q) ∧ (p ∨ r ) Distributive laws
¬(p ∨ q) ≡ ¬p ∧ ¬q, ¬(p ∧ q) ≡ ¬p ∨ ¬q De Morgan’s Laws
p ∨ (p ∧ q) ≡ p, p ∧ (p ∨ q) ≡ p Absorption laws
p ∨ ¬p ≡ T , p ∧ ¬p ≡ F Negation laws
Constructing New Logical Equivalences:
Example: Show that ¬(p ∨ (¬p ∧ q)) and ¬(p ∨ q) are logically
equivalent.
Solution:
¬(p ∨ (¬p ∧ q) ≡ ¬p ∧ ¬(¬p ∧ q) (by De Morgan’s law)
≡ ¬p ∧ (¬(¬p) ∨ ¬q) (by De Morgan’s law)
≡ ¬p ∧ (p ∨ ¬q) (by Double negation law)
≡ (¬p ∧ p) ∨ (¬p ∧ ¬q) (by Distributive law)
≡ F ∨ (¬p ∧ ¬q) (by Negation law)
≡ ¬p ∧ ¬q (by Identity law)
≡ ¬(p ∨ q) (by De Morgan’s law)
Example: Show that ¬(p ↔ q) and p ↔ ¬q are logically equivalent.
Solution:
¬(p ↔ q) ≡ ¬((p → q) ∧ (q → p)) (by definition of biconditional operator)
≡ ¬(p → q) ∨ ¬(q → p) (by De Morgan’s law)
≡ ¬(¬p ∨ q) ∨ ¬(¬q ∨ p) (p → q ≡ ¬p ∨ q)
≡ (p ∧ ¬q) ∨ (q ∧ ¬p) (by De Morgan and Double negation law)
≡ ((p ∧ ¬q) ∨ q) ∧ ((p ∧ ¬q) ∨ ¬p) (by Distributive law)
≡ ((p ∨ q) ∧ (¬q ∨ q)) ∧ ((p ∨ ¬p) ∧ (¬q ∨ ¬p))
≡ ((p ∨ q) ∧ T ) ∧ (T ∧ (¬q ∨ ¬p)) (by Negation law)
≡ (p ∨ q) ∧ (¬q ∨ ¬p) (by Identity law)
≡ (¬(¬p) ∨ q) ∧ (¬p ∨ ¬q) (by Double negation law)
≡ (¬p → q) ∧ (p → ¬q) (p → q ≡ ¬p ∨ q)
≡ (¬q → p) ∧ (p → ¬q) (p → q ≡ ¬q → ¬p)
≡ p ↔ ¬q
Example: Show that (p → q) → r and p → (q → r ) are not logically
equivalent.
Solution:

(p → q) → r ≡ ¬(p → q) ∨ r (p → q ≡ ¬p ∨ q)
≡ ¬(¬p ∨ q) ∨ r (p → q ≡ ¬p ∨ q)
≡ (p ∧ ¬q) ∨ r (by De Morgan’s and Double negation law)

p → (q → r ) ≡ ¬p ∨ (q → r ) (p → q ≡ ¬p ∨ q)
≡ ¬p ∨ (¬q ∨ r ) (p → q ≡ ¬p ∨ q)
≡ (¬p ∨ ¬q) ∨ r (by Associative law)

If p is false and q is true, then p ∧ ¬q is false and ¬p ∨ ¬q is true.


Hence p ∧ ¬q and ¬p ∨ ¬q are not equivalent.
Therefore (p → q) → r and p → (q → r ) are not logically equivalent.
Predicates

Statements involving variables, such as


“x > 2”, “x = y + 1”, “x + y = z”
are neither true nor false. Propositions can be produced from such
statements.
• We denote the statement “x is greater than 2" by P(x), where P
denotes the predicate “is greater than 2" and x is the variable.
• The statement P(x) is said to be the value of the propositional
function P at x. For a fixed assigned value to x, the statement P(x)
becomes a proposition and has a truth value.

Example: Let P(x) denote the statement “x > 2". P(5) is true and
P(2) is false.
Example: Let Q(x, y ) denote the statement “x = y + 1". Q(2, 1) is
true and Q(3, 0) is false.

• A statement of the form P(x1 , x2 , ..., xn ) is the value of the


propositional function P at the n-tuple (x1 , x2 , ..., xn ).
Quantifiers

When the variables in a propositional function are assigned values,


the resulting statement becomes a proposition with a certain truth
value. There is another way to create a proposition from a
propositional function, is called quantification.

The Universal Quantifier:


The universal quantification of P(x) is the statement

“P(x) for all values of x in the domain".


The notation ∀xP(x) denotes the universal quantification of P(x).
Here ∀ is called the universal quantifier. We read ∀xP(x) as “for all
xP(x)" or “for every xP(x)". An element in the domain for which P(x)
is false is called a counterexample of ∀xP(x).

∀xP(x) is true when P(x) is true for every x in the domain.


∀xP(x) is false when P(x) is false for some x in the domain.
Example: Let P(x) be the statement “x + 5 > x". What is the truth
value of the quantification ∀xP(x), where the domain consists of all
real numbers?
Solution: ∀xP(x) is true since for every real x, x + 5 > x.
Example: Let P(x) be the statement “x < 0". What is the truth value
of the quantification ∀xP(x), where the domain consists of all real
numbers?
Solution: ∀xP(x) is false since x = 0, P(0) is not true.
Example: Let P(x) be such that “x 2 ̸= 2". What is the truth value of
∀xP(x), where the domain consists of all integers?
Solution: ∀xP(x) is true since for integer x, x 2 ̸= 2.
Example: What is the truth value of ∀x(x 2 ≥ 3x), if the domain
consists of all integers?
Solution: Let P(x) be the statement “x 2 ≥ 3x". Hence ∀xP(x) is
false since for x = 1, P(1) is false.
The Existential Quantifier:
The existential quantification of P(x) is the statement
“There exists an element x in the domain such that P(x)."
The notation ∃xP(x) denotes the existential quantification of P(x).
Here ∃ is called the existential quantifier. We read ∃xP(x) as
“There is an x such that P(x)" or “There is at least one x such that
P(x)" or “For some xP(x)".

∃xP(x) is true when there exists x in the domain for which P(x)
is true.
∃xP(x) is false when P(x) is false for every x in the domain.
Example: Let P(x) be the statement “x < 5". What is the truth value
of the quantification ∃xP(x), where the domain consists of all real
numbers?
Solution: ∃xP(x) is true since P(x) is true for x = 2.
Example: Let P(x) be the statement “x 2 ≤ 0". What is the truth value
of ∃xP(x), where the domain consists of all real numbers?
Solution: ∃xP(x) is true since P(x) is true for x = 0.
Example: Let P(x) be such that “x 2 < 18". What is the truth value of
∃xP(x), where the domain consists of all integers bigger than 5?
Solution: ∃xP(x) is false since P(x) is false for all integers x > 5.
Example: Let P(x) be such that “x 2 − 4 = 0". What is the truth value
of ∃xP(x), where the domain consists of all positive integers?
Solution: ∃xP(x) is true since P(x) is true for x = 2.
The Uniqueness Quantifier:
The Uniqueness quantification of P(x) is denoted by ∃!xP(x), is the
statement
“There exists a unique x in the domain such that P(x) is true."

∃!xP(x) is true when there is exactly one x in the domain for


which P(x) is true.
∃!xP(x) is false when P(x) is false for every x in the domain or
P(x) is true for more than one x in the domain.
Example: Let P(x) be the statement “x 2 − x − 2 = 0". What is the
truth value of ∃!xP(x), where the domain consists of all positive real
numbers?
Solution: ∃!xP(x) is true since P(x) is true only when x = 2.
Example: Let P(x) be the statement “x 2 = 2". What is the truth value
of ∃!xP(x), where the domain consists of all real numbers?
Solution: ∃!xP(x) is false since P(x) is true for x = 2, x = −2.
Quantifiers with Restricted Domains:
The statement “∀x < 0(x 2 > 0), where the domain consists of
all real numbers" states that for every real number x with x < 0,
x 2 > 0. This statement can be written as ∀x(x < 0 → x 2 > 0).
The statement “∃x > 0(x 2 = 7), where the domain consists of all
real numbers" states that there exists a real number x with x > 0,
such that x 2 = 7. This statement can be written in a different way
as ∃x(x > 0 ∧ x 2 = 7).
Precedence of Quantifiers:
The quantifiers ∀ and ∃ have higher precedence than all logical
operators ¬, ∧, ∨, →, ↔ from propositional calculus. For example,
∃xP(x) ∨ Q(x) is same as (∃xP(x)) ∨ Q(x) rather than
∃x(P(x) ∨ Q(x)).
Logical Equivalences between Quantified Statements:
Quantified statements are logically equivalent if and only if they have
the same truth value. We use the notation A ≡ B to indicate that two
quantified statements A and B are logically equivalent.
Example: Show that ∀x(P(x) ∧ Q(x)) and (∀xP(x)) ∧ (∀xQ(x)) are
equivalent.
Solution: To prove equivalence, we show that they take same truth
values.
Assume that ∀x(P(x) ∧ Q(x)) is true. Therefore P(a) ∧ Q(a) is true
for some a in the domain. Hence, P(a) is true and Q(a) is true. Since
a is arbitrary in the domain, we can conclude that ∀xP(x) and ∀xQ(x)
are both true. Therefore (∀xP(x)) ∧ (∀xQ(x)) is true.
Also we can prove that, if (∀xP(x)) ∧ (∀xQ(x)) is true, then
∀x(P(x) ∧ Q(x)) is true.
Example: Show that ∃x(P(x) ∨ Q(x)) and (∃xP(x)) ∨ (∃xQ(x)) are
equivalent.
Negation of Quantified Statements:
De Morgan’s Laws for Quantifiers:
¬∀xP(x) ≡ ∃x¬P(x),
¬∃xQ(x) ≡ ∀x¬Q(x).
Example: What is the negation of the statement “Every student in
this class has Discrete Mathematics"?
Solution: Negation of the statement “Every student in this class has
Discrete Mathematics" is “There is a student in this class who does
not have Discrete Mathematics".
Example: What are the negations of the statements ∀x(x 2 > 5) and
∃x(x 2 = 2x)?
Solution:
¬∀x(x 2 > 5) ≡ ∃x¬(x 2 > 5) ≡ ∃x(x 2 ≤ 5).
¬∃x(x 2 = 2x) ≡ ∀x¬(x 2 = 2x) ≡ ∀x(x 2 ̸= 2x).
Translating from English into Logical Expressions:
Example: Express the statement “Every student in this class has
Discrete Mathematics" in logical expression.
Solution: Let D(x) be the statement “x has Discrete Mathematics".
So we can express the given statement as ∀xD(x), where the domain
consists of all students in the class.
Nested Quantifiers
Nested quantifiers are quantifiers that occur within the scope of other
quantifiers.
Example: Assume that the domain for the variables x and y is the
set of all real numbers. The statement ∀x∀y (xy = yx) says that
xy = yx for all real numbers x and y .
Example: Assume that the domain for the variables x and y is the
set of all real numbers. The statement ∀x∃y (x + y = 3) says that for
every real numbers x there is a real number y such that x + y = 3
Example: Translate the statement into English sentence
∀x∀y ((x > 0) ∧ (y < 0) → (xy < 0)), where the domain for both
variables consists of all real numbers.
Solution:
This statement says that for every real number x and for every real
number y , if x is negative and y is negative, then xy is positive.
The Order of Quantifiers:
∀y ∀xP(x, y ) and ∀x∀yP(x, y ) have the same meaning. Truth
value of these are true if P(x, y ) is true for every x, y in domain.
∃y ∃xP(x, y ) and ∃x∃yP(x, y ) have the same meaning. Truth
value of these are true if P(x, y ) is true for some x, y in domain.
∃y ∀xP(x, y ) and ∀x∃yP(x, y ) are not same. Truth value of ∃y ∀xP(x, y )
is true if there is a y such that P(x, y ) is true for all x in domain.
Truth value of ∀x∃yP(x, y ) is true if for all x in domain there is a y
such that P(x, y ) is true.
Example: Let P(x, y ) be the statement “xy = yx". Then the truth
value of the quantified statement ∀x∀yP(x, y ) is true, where the
domain for all variables consists of all real numbers.
Example: Let P(x, y ) denote “x + y = 3". The truth value of
quantified statement ∀x∃yQ(x, y ) is true and the truth value of
quantified statement ∃y ∀xP(x, y ) is false, where the domain for all
variables consists of all real numbers.
Translating Mathematical Statements into Statements Involving
Nested Quantifiers:
Example: “The product of two negative integers is always positive".
⇒ ∀x∀y ((x < 0) ∧ (y < 0) → (xy > 0)), where the domain for both
variables consists of all integers.
or ∀x∀y (xy > 0), where the domain for both variables consists of all
negative integers.
• A multiplicative inverse of a real number x is a real number y such
that xy = 1.
Example: “Every real number except zero has a multiplicative
inverse".
⇒ ∀x((x ̸= 0) → ∃y (xy = 1)), where the domain for both variables
consists of real numbers.
Example: Use quantifiers to express the definition of the limit of a
real-valued function f (x) of a real variable x at a point a in its domain.
Solution:

lim f (x) = L
x→a
means
For every real number ϵ > 0 there exists a real number δ > 0 such
that |f (x) − L| < ϵ whenever 0 < |x − a| < δ.
This definition of a limit can be expressed as

∀ϵ > 0 ∃δ > 0 ∀x(0 < |x − a| < δ → |f (x) − L| < ϵ),


when the domain for the variables x, ϵ and δ consists of all real
numbers.
Translating from Nested Quantifiers into English Statement:
Example: Translate the statement

∀x(C(x) ∨ ∃y (C(y ) ∧ F (x, y )))


into English, where C(x) is “x has a mobile", F (x, y ) is “x and y are
friends", and the domain for both x and y consists of all students in
your college.
Solution: The statement says that for every student x in your college,
x has a mobile or there is a student y such that y has a mobile and x
and y are friends. In other words, every student in your college has a
mobile or has a friend who has a mobile.
Example: Translate the statement
∃x∀y ∀z((F (x, y ) ∧ F (x, z) ∧ (y ̸= z)) → ¬F (y , z)))

into English, where F (a, b) means a and b are friends and the
domain for x, y , and z consists of all students in your college.
Solution: The statement says that there is a student x such that for
all students y and all students z if x and y are friends and x and z are
friends and y and z are not the same student, then y and z are not
friends. In other words, there is a student none of whose friends are
also friends with each other.
Translating English Sentences into Logical Expressions:
Example: Express the statement “If a person is female and is a
parent, then this person is someone’s mother" as a logical expression
involving predicates, quantifiers with a domain consisting of all
people, and logical connectives.
Solution: We introduce the propositional functions F (x) to represent
“x is female", P(x) to represent “x is a parent," and M(x, y ) to
represent “x is the mother of y ." The original statement can be
represented as
∀x((F (x) ∧ P(x)) → ∃yM(x, y ))
or
∀x∃y ((F (x) ∧ P(x)) → M(x, y )).
Example: Express the statement “Everyone has exactly one best
friend" as a logical expression involving predicates, quantifiers with a
domain consisting of all people, and logical connectives.
Solution: We introduce the predicate B(x, y ) to be the statement “y
is the best friend of x". Then the statement is expressed as
∀x∃!yB(x, y )
or
∀x∃y (B(x, y ) ∧ ∀z((z ̸= y ) → ¬B(x, z))).
Negating Nested Quantifiers:
Example: Express the negation of the statement ∀x∃y (xy = 1) so
that no negation precedes a quantifier.
Solution: ¬∀x∃y (xy = 1) ≡ ∃x(¬∃y (xy = 1)) ≡ ∃x∀y ¬(xy = 1) ≡
∃x∀y (xy ̸= 1).
Example: Use quantifiers and predicates to express the fact that
limx→a f (x) does not exist where f (x) is a real-valued function of a
real variable x and a belongs to the domain of f .
Solution:
lim f (x) ̸= L
x→a
means
¬∀ϵ > 0 ∃δ > 0 ∀x(0 < |x − a| < δ → |f (x) − L| < ϵ)
≡∃ϵ > 0 ∀δ > 0 ∃x¬(0 < |x − a| < δ → |f (x) − L| < ϵ)
≡∃ϵ > 0 ∀δ > 0 ∃x(0 < |x − a| < δ ∧ |f (x) − L| ≥ ϵ).

limx→a f (x) does not exist means


∀L∃ϵ > 0 ∀δ > 0 ∃x(0 < |x − a| < δ ∧ |f (x) − L| ≥ ϵ).
Rules of Inference
Definitions:
An argument in propositional logic is a sequence of propositions.
Each proposition except the final proposition in an argument is
called premise and the final proposition is called the conclu-
sion.
An argument is valid if all its premises are true implies that the
conclusion is true.
An argument form in propositional logic is a sequence of com-
pound propositions involving propositional variables.
Consider an argument form with premises p1 , p2 , ..., pn and con-
clusion q, then the argument form is valid if (p1 ∧ p2 ∧ ... ∧ pn ) → q
is a tautology.
Without using the truth table, to show that an argument form is
valid one can first establish the validity of some relatively simple
argument forms, called rules of inference.
Example: “Sourav loves to play cricket. Therefore, Sourav loves to
play cricket or football".
Solution: Let p be the proposition “Sourav loves to play cricket" and
q be the proposition “Sourav loves to play football". The argument
form is given by
p
∴p∨q
The argument is valid by addition rule.
Example: “It is below freezing now. Therefore, it is either below
freezing or raining now."
Solution: Let p be the proposition “Sourav loves to play cricket" and
q be the proposition “Sourav loves to play football". The argument
form is given by
p∧q
∴q
The argument is valid by simplification rule.
Example: Show that the following hypothesis p → q, ¬p → r , and
r → s lead to the conclusion ¬q → s.
Solution: Here the argument form is given by
p→q
¬p → r
r →s
∴¬q → s

Step:
(1) p → q [Premise]
(2) ¬q → ¬p [Contrapositive of (1)]
(3) ¬p → r [Premise]
(4) ¬q → r [From (2) and (3), Hypothetical syllogism]
(5) r → s [Premise]
(6) ¬q → s [From (4) and (5), Hypothetical syllogism]
Hence the argument form is valid. So hypothesis p → q, ¬p → r , and
r → s lead to the conclusion ¬q → s.
Example: Show the following argument is valid. “If today is Monday, I
have a test in Mathematics or Economics. If my Economics professor
is sick, then I will not have a test in Economics. Today is Monday, and
my Economics professor is sick. Therefore, I will have a test in
Mathematics".
Solution: Let p be the statement “Today is Monday", q be the
statement “I have a test in Mathematics", r be the statement “I have a
test in Economics", s be the statement “My Economics professor is
sick".
Here the argument form is given by
p →q∨r
s → ¬r
p∧s
∴q
Step:
(1) p ∧ s [Premise]
(2) p [From (1), Simplification]
(3) s [From (1), Simplification]
(4) p → q ∨ r [Premise]
(5) q ∨ r [From (2) and (4), Modus ponens]
(6) s → ¬r [Premise]
(7) ¬r [From (3) and (6), Modus ponens]
(8) q [From (5) and (7), Disjunctive syllogism]
Hence the argument form is valid.
Rules of Inference for Quantified Statements:
Example: Show that the premises “A student in this class has not
read the book," and “Everyone in this class passed the exam" imply
the conclusion “Someone who passed the first exam has not read the
book."
Solution: Let C(x) be “x is in this class", B(x) be “x read the book",
E(x) be “x passed the exam".
Step:
(1) ∃x(C(x) ∧ ¬B(x)) [Premise]
(2) C(a) ∧ ¬B(a) [Existential instantiation from (1)]
(3) C(a) [Simplification from (2)]
(4) ∀x(c(x) → E(x) [Premise]
(5) (c(a) → E(a) [Universal instantiation from (4)]
(6) E(a) [From (3) and (5), Modus ponens]
(7) ¬B(a) [Simplification from (2)]
(8) E(a) ∧ ¬B(a) [From (6) and (7), conjunction ]
(9) ∃x(E(x) ∧ ¬B(x)) [Existential generalization from (8)]
Introduction to Proofs

Some Terminology:
A theorem is a statement that can be proved to be true by logical
arguments.
Less important theorem sometimes is called a proposition.
An axiom is a statement which we assume to be true without
proof.
A less important theorem that is helpful in the proof of other re-
sults or facts is called a lemma.
A corollary is a statement that follows directly from a theorem
that has been proved.
A conjecture is a statement that is being proposed to be a true
statement but neither proved nor disproved yet.
A proof is a valid argument that establishes the truth of a theo-
rem.
Proof Methods
Direct Proof:
A direct proof of a conditional statement p → q starts by assuming p
and finishes by establishing q. In a direct proof, we can use
definitions, axioms, previously proven facts or results, and rules of
inference.
Example: Prove that “If n is an odd integer, then n3 is odd".
Solution: If n is odd, then n = 2k + 1 for some integer k . Hence
n2 = (2k + 1)3 = 8k 3 + 12k 2 + 6k + 1 = 2(4k 3 + 6k 2 + 3k ) + 1.
Therefore n2 = 2t + 1, where t = 4k 3 + 6k 2 + 1 is an integer. Hence
n2 is odd.
Proof by Contraposition:
This method make use of the fact that the conditional statement
p → q is equivalent to its contrapositive, ¬q → ¬p.
Example: Prove that ∀n ∈ Z, if 5n + 4 is odd, then n is odd.
Solution: Let p be the statement “5n + 4 is odd" and q be the
statement “n is odd". Contrapositively, we have to prove that if n is
even then 5n + 4 is even. Assume that n is even. Then n = 2k for
some integer k . Therefore 5n + 4 = 2(5k + 2). Hence 5n + 4 is even.
Vacuous proof:
Vacuous proof is based on the fact that the conditional statement
p → q is always true if p is false. Thus in vacuous proof we have to
show that p is false.
Example: Show that the proposition P(0) is true, where P(n) is “If
n > 1, then n3 > n" and the domain consists of all integers.
Solution: Let p be the statement “n > 1" and q be the statement
“n3 > n2 ". Since p is false for n = 0, P(n) is true for n = 0. Hence
P(0) is vacuously true.

Trivial proof:
A proof of p → q that uses the fact that q is true, is called a trivial
proof.
Example: Let P(n) be “If a and b are positive integers with a ≥ b,
then an ≥ bn ", where the domain consists of all nonnegative integers.
Show that P(0) is true.
Solution: Let p be the statement “a > b" and q be the statement
“an ≥ bn ". For n = 0, q is true and q is independent of p. Hence P(0)
is trivially true.
Proof by Contradiction:
Target is to prove that a statement p is true. If for a false proposition
q, we prove that ¬p → q is true, then we can conclude that ¬p is false
and thus p is true. Proof of this type are called proof by
contradiction.

Example: Prove that 2 is irrational by giving a proof by
contradiction.
√ √
Solution: Assume that 2 is rational,i.e, 2 = ba for some integers
a, b with b ̸= 0 and gcd(a, b) = 1. Therefore a2 = 2b2 . Since 2 | a2 ,
hence 2 | a. Let a = 2c for some integer c. Therefore b2 = 2c 2 .
Hence 2 | b2 and so 2 | b. Since 2 | a and 2 | b, we have 2 | gcd(a, b),
which is a contradiction
√ to gcd(a, b) = 1. Hence our assumption is
wrong. Therefore 2 is irrational.


Note: Generalizing proof of last example one can show that p is
irrational for any prime p.
Proof by Equivalence:
To prove a theorem that is a biconditional statement, that is, a
statement of the form p ↔ q, we show that p → q and q → p are both
true.
Example: Prove the theorem “If n is an integer, then n is even if and
only if n2 is even."
Solution:
Note: Sometimes a theorem states that several propositions are
equivalent. Such a theorem states that propositions p1 , p2 , p3 , ..., pn
are equivalent. To show they are equivalent one can show p1 → p2 ,
p2 → p3 ,..., pn−1 → pn , pn → p1 .
Example: Show that these statements about the integer n are
equivalent:
p1 : n is odd.
p2 : n + 5 is even.
p3 : n2 + 1 is even.
Solution:
Proof by Cases:
A proof by cases must cover all possible cases that arise in a
theorem. We illustrate proof by cases with few examples.
Example: Prove that if n is an integer, then n3 ≥ n.
Solution:

Example: Show that |xy | = |x||y |, where x and y are real numbers.
Solution:
Proof Without Loss of Generality:
To prove |xy | = |x||y |, we consider the cases x > 0, y < 0 and
x < 0, y > 0. But these are same cases with the roles of x and y
reversed. To make the proof shorter, we could have proved these
cases together by assuming, without loss of generality, that x > 0 and
y < 0. One can proof the case with x < 0 and y > 0 by using similar
argument.
Example: Show that if x and y are integers and both xy , x + y are
even, then both x and y are even.
Solution:
Proof of Existence:
Many theorems are assertions that objects of a particular type exist.
A theorem of this type is a proposition of the form ∃xP(x), where P is
a predicate. A proof of a proposition of this kind is called a proof of
existence.
Example: Show that there is a positive integer that can be written as
the sum of cubes of positive integers in two different ways.
Solution:
Proof of Uniqueness:
Some theorems assert the existence of a unique element with a
particular property. To prove a statement of this type we need to show
that an element with this property exists and that no other element
has this property.
Example: Show that if a and b are real numbers and a ̸= 0, then
there is a unique real number r such that ar + b = 0.
Solution:
Backward Proof:
Target of backward proof method is to prove a statement q and For
that we have to find a statement p with the help of q such that we can
prove with the property that p → q.
Example: Prove that the arithmetic mean of two different positive
numbers is greater than their geometric mean.
Solution:
Counterexample:
To show that a statement of the form ∀xP(x) is false, we need only a
counterexample, that is, an example x for which P(x) is false.
Example: Show that the statement “Every positive integer is the sum
of the squares of three integers" is false.
Solution:

You might also like