0% found this document useful (0 votes)
2 views46 pages

UNIT-1 Logic and Proof Methods New1

The document provides an overview of logic and proof methods, focusing on propositional and predicate logic, including definitions and examples of propositions, logical connectives, and truth tables. It explains various logical operations such as negation, conjunction, disjunction, conditional statements, and bi-conditional statements, along with their truth values and implications. Additionally, it discusses the concepts of tautology, contradiction, contingency, and logical equivalences, emphasizing the importance of logical reasoning in mathematics and computer science.

Uploaded by

No Name
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)
2 views46 pages

UNIT-1 Logic and Proof Methods New1

The document provides an overview of logic and proof methods, focusing on propositional and predicate logic, including definitions and examples of propositions, logical connectives, and truth tables. It explains various logical operations such as negation, conjunction, disjunction, conditional statements, and bi-conditional statements, along with their truth values and implications. Additionally, it discusses the concepts of tautology, contradiction, contingency, and logical equivalences, emphasizing the importance of logical reasoning in mathematics and computer science.

Uploaded by

No Name
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/ 46

Unit 1: Logic and Proof Methods

Introduction: Logic is concerned with the study of the principles and techniques of reasoning. It is the
study of correct reasoning, especially as it involves the drawing of inferences. The Greek philosopher and
scientist Aristotle is said to the first person to have studied logical reasoning. Logical reasoning is the
essence of mathematics and is therefore an important starting point for study of discrete mathematics.
Logic, among other things, have provided the theoretical basis for many years of computer science such
as digital logic design, automata theory, computability and artificial intelligence.

The rules of logic give precise meaning to mathematical statements. These rules are used to distinguish
between valid and invalid mathematical arguments.

In logic, on the basis of its representation capability is of two types: propositional Logic and predicate
logic

Proposition: A proposition is a declarative sentence (that is, a sentence that declares a fact) that is either
true or false but not both.

• 2+2= 4 (True ), is a proposition


• 3*6 = 20 (False), is proposition
• Odd numbers are divisible by 2 (False), is a proposition
• Kathmandu is capital of Nepal (true), is a proposition

Propositions are denoted by small letters like p, q, r, s .etc.

Simple proposition and Composite Proposition

Any proposition whose truth value does not depend on another proposition is called simple proposition

Compound propositions are formed from simpler propositions and express relationships among the
constituent sentences. There are six types of compound propositions are: negation, conjunctions,
disjunctions, implications, biconditional and equivalences

Negation: Let p be a proposition. The negation of p, denoted by ¬p is the statement “It is not case that
p”.

The proposition –p is read as “not p”. The truth value of the negation of p, ¬p is the opposite of the truth
value of p.

Example 1: Find the negation of the proposition

“Today is Friday” and express in simple English

Solution: The negation is

“It is not the case that today is Friday”

This negation can be more simply expressed by

1
“Today is not Friday”

Example 2: Find the negation of the proposition “ At least 10 inches of rain fell today in Kathamndu”
and express this in simple English.

Solution: It is not the case that at least 10 inches of rain fell today in Kathmandu”.

This negation can be more simply expressed by:

“Less than 10 inches of rain fell today in Kathmandu”

The truth table for negation operation is:

P -p
T F
F T

Conjunction: Let p and q be propositions. The conjunction of p and q, denoted by p^q, is the proposition
“ p and q”. The conjunction of 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 p and q where p is the proposition “Today is Friday”
and q is the proposition “It is raining today”

Solution: The conjunction of these propositions, p^q, is the proposition “Today is Friday and it is raining
today”. This proposition is true on rainy Friday and is false on any day that is not Friday and on Fridays
when it does not rain.

Disjunction: Let p and q be propositions. The disjunction of p and q, denoted by pvq, is the proposition
“p or q”. The disjunction p v q is false when both p and q are false and is true otherwise.

A disjunction is true when at least one of the two propositions is true. For instance, the inclusive or is
being used in the statement.

“Students who have taken calculus or computer science can take this class”

2
Here, we mean that students who have taken both calculus and computer science can take the class, as
well as the students who have taken one of the two subjects.

Example: Find the disjunction of the propositions p and q where p is the proposition “Today is Friday”
and q is the proposition “It is raining today”.

Solution: The disjunction of p and q, pvq, is the proposition

“Today is Friday or it is raining today”.

This proposition is true on any day that is either a Friday or a rainy day or rainy Fridays. It is only false
on days that are not Fridays when it also does not rain

The truth table for the disjunction of two propositions

P q Pvq
T T T
F T T
T F T
F F F

Conditional Statements

Let p and q be propositions. The conditional statement p→q is the propositions “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 and q is called conclusion or consequence.

The statement p→q is called a conditional statement because p→q asserts that q is true on the condition
that p holds. A conditional statement is also called an implication.

p→q is true when both p and q are true and when p is false (no matter what truth value q has)

A useful way to understand the truth value of a conditional statement is to think of an obligation or a
contract. For example, the pledge many politicians make when running for office is

“If I am elected, then I will lower taxes”.

If the politician is elected, voters would expect this politician to lower taxes. Furthermore, if the politician
is not elected then voters will not have expectation that this person will lower taxes, although the person
may have sufficient influences to cause those in power to lower taxes. It is only when the politician is
elected but does not lower taxes that voters can say the politician has broken the campaign pledge. This
last scenario corresponds to the case when p is true but q is false in p→q.

Similarly, consider a statement that a professor might make:

3
“If you get 100% on the final, then you will get an A”.

If you manage to get a 100% on the final, then you would expect to receive an A. If you do not get 100 %
you may or may not receive an A depending other factors. However, if you do get 100%, but the
professor does not give you an A, you will be cheated.

Example: Let p be a statement “Maria learns discrete mathematics” and q the statement “Maria will find
a good job”. Express the statement p→q as a statement in English.

Solution: From the definition of conditional statements, we see that when p is the statement “Maria learns
discrete mathematics” and q is the statement “Maria will find a good job”, p→q represents the statement

“If Maria learns discrete mathematics then she will find a good job”.

The truth table for the conditional statement p→q is:

P Q p→q
T T T
T F F
F T T
F F T

Converse, Inverse and Contra positive of Implication

Some of the related implications formed from p→q are:

Inverse of Implication: When we add “not” to the hypothesis and conclusion of implication p→q then it
becomes ¬p →¬q, which is known as inverse of p→q

Example

Implication Inverse
p→q ¬p→¬q
If it is raining then the road is muddy If it not raining then the road is not muddy

Converse of Implication

When we interchange the hypothesis and conclusion of implication p→q then the result becomes q→p
which is known as converse of given implication.

Implication Converse
p→q q→p
If it is raining then the road is muddy If the road is muddy then it is raining
Contra positive of Implication

When we interchange the hypothesis and conclusion of inverse statement of implication p→q then the
resulting statement ¬q→¬p is known as contra positive.

4
Implication Contra positive
p→q ¬q→¬p
If it is raining then the road is muddy If the road is not muddy then it is not raining

Bi-Conditional Statements

Let p and q be the propositions. The bi-conditional statements p↔q is the proposition “ p if and only if
q”. The bi-conditional statement ↔ is true when p and q have the same truth values and is false otherwise.
Bi-conditional statements are also called bi-implications.

Some of the terminologies for bi-conditional statements are:

“p if and only if q”.

“If p then q and conversely”

“p is necessary and sufficient for q”.

The truth table for bi-conditional p↔q

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

Example: Let p be the statement “You can take the flight” and let q be the statement “ You buy a ticket”.
Then p↔q is the statement

“You can take the flight if and only if you buy a ticket”

This statement is true if p and q are either true or both false, that is, if you buy a ticket and can take the
flight or if you do not buy a ticket and you cannot take the flight. It is false when p and q have opposite
truth values, that is, when you do not buy a ticket but you can take the flight (such as when you get a free
trip) and when you buy a ticket and cannot take the flight (such as when the airline bumps you)

Translating English Sentences

There are many reasons to translate English sentences into expressions involving propositional variables
and logical connectives. In particular, English and every other human language is often ambiguous.
Translating sentences into compound statements removes the ambiguity. Moreover, once we have
translated sentences from English into logical expressions we can analyze these logical expressions to
determine their truth values, we can manipulate them and we can use rules of inference to reason about
them

5
The process of translating English sentences into logical expression consists of following steps

1. First we break down the given complex English sentences into atomic sentences
2. We represent each atomic sentence by propositional variables
3. Now each atomic sentence is connected with appropriate connectives

Example: If it is raining then home team wins the game

Solution:

• It is raining
• Home team wins the game

p = "It is raining"

q = "Home team wins the game"

Now each sentence is connected with implications p→q

Example 2: Translate the following simple declarative sentences

Let: p: It is raining

q: Sita is sick

r: Ram stayed up late last night

t: Kathmandu is capital of Nepal

u: Ashok is a loud mouth

Solution: Translating Negation:

• It is not raining. :p


• It's not case that Sita is sick :(q)

Translating Conjunction

i. It is raining and Sita is sick : (p^q)


ii. Kathamndu is not Capital of Nepal and it is raining: (t^p)
iii. It is not the case that it is raining and Sita is sick : (p^q)

Translating Disjunction

i. Kathmandu is capital of Nepal and its is not raining or Ashok is a loud mouth: (t^p)vu
ii. Sita is not sick or Sita is sick: qvq
iii. Ram stayed up at last night or Kathmandu is not capital of Nepal (rvt)

Translating Implication

6
i. If it is raining then Sita is sick :p→q
ii. It is raining when Ashok is a loudmouth :u→p
iii. Sita is sick and it is raining implies that Ram stayed up late last night : (q^p)→r

Translating Biconditional

i. It is raining if only if Sita is sick : p↔q


ii. Kathmandu is capital of Nepal is equivalent to Ram stayed up late last night: p↔r

Example: Translate the following sentence into logical expression.

“You can access the Internet from campus only if you are a computer science major or you are not a
freshman”.

Let a, c and f represent “You can access the Internet from campus”, “You are a computer science major”
and “You are a freshman” respectively.

a→(c v ¬f)

Tautology, Contradiction and Contingency

Tautology: A compound proposition that is always true, no matter what the truth values of the
propositions that occur in it, is called a tautology.

Example: Show that pv ¬p is a tautology

Solution: We can verify this statement with the help of truth table as follows:

P ¬P p v ¬p
T F T
F T T

Contradiction: A compound proposition that is always false is called a contradiction.

Example: Show that p ^¬ p is contradiction.

Solution: We can verify this statement with the help of truth table as follows:

P ¬P P ^ ¬P
T F F
F T F

Contingency: A compound proposition that is neither tautology nor contradiction is called contingency.

7
Example: Show that ¬p ^ ¬q is contingency

Solution: We can verify this statement with the help of truth table as follows:

P q ¬p ¬q ¬p ^ ¬q
T T F F F
T F T T F
F T T F F
F F T T F

Logical Equivalences

An important type of step used in a mathematical argument is the replacement of a statement with another
statement with the same truth value. Because of this, methods that produce propositions with the same
truth values as a given compound proposition are used extensively in the construction of mathematical
arguments. The term compound proposition refers to an expression formed from propositional variables
using logical operators such as p^q.

Compound propositions that have the same truth values in all possible cases are called logically
equivalent.

The compound propositions p and q are called logically equivalent if p↔q is a tautology. The notation p
≡ q denotes that p and q are logically equivalent.

One way to determine whether two compound propositions are equivalent is to use truth table. In
particular, the compound propositions p and q are logically equivalent if and only if the columns giving
their truth values agree.

Example: Show that ¬ (p v q) are ¬p ^ ¬q are logically equivalent

Solution:

P q pvq ¬ (p v q) ¬p ¬q ¬p ^ ¬q
T T T F F F F
T F T F T T F
F T T F F F F
F F F T T T T

The truth tables for these compound propositions are displayed in above table. Because the truth values of
the compound propositions ¬(p v q) and ¬p ^ ¬q agree for all possible combinations of the truth values of
p and q, it follows that ¬ (p v q) ↔ ¬p ^ ¬q is a tautology and that these compound propositions are
logically equivalent.

8
Example: Show that p v (q ^ q) and (p v q) ^(p v r) are logically equivalent.

Solution: We construct the truth table for these compound propositions.

Q q r q^r p v (q ^ r) pvq pvr (pvq)^(pvr)


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

Example: Prove that : (p→r)v(q→r)≡(p^q)→r

Solution:

P q R p→r q→r (p→r)v(q→r) q^q (p^q)→r


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

Propositional Equivalences

The compound propositions p and q are logically equivalent, denoted by p↔q or p ≡ q if propositions p↔
is a tautology.

Identity Law P^T ≡ p


pvF ≡ p
Domination Laws pvT ≡ T
p^ F ≡ F
Idempotent Laws pvp ≡ p
P^p ≡ p
Double Negation Laws ¬(¬p) ≡ p
Commutative Laws P^q ≡ q^p
pvq ≡ qvp

9
Associative Laws (pvq)vr ≡ pv(qvr)
(p^q)^r ≡ p^(q^r)
Distributive Laws pv(q^r) ≡ (pvq)^(pvr)
p^(q^r) ≡ (p^q)v(p^r)
De Morgan’s Laws ¬(p^q) ≡ ¬p v ¬q
¬(pvq) ≡ ¬p ^ ¬q
Absorption Laws pv(p^q) ≡ p
P^(pvq) ≡ p
Negation Laws pv¬p ≡ T
p ^ ¬p=F

Logical equivalences involving conditional statements.

p→q  pvq
p→q  q→p
pvq  p→q
p^q  (q→p)
p^q  (p→q)
(p→q)^(q→r)  p→(q^r)
(p→r)^(q→r)  (pvq)→r
(p→q)v(p→r)  p→(qvr)
(p→r)v(q→r)  (p^q)→r

Logical equivalences involving biconditional

pq  (p→q)^(q→p)
pq  pq
pq  (p^q)v(p^q)
(pq)  pq

Example: Show that ¬(p→q) and p ^ ¬p are logically equivalent

Solution: We could use a truth to show that these compound propositions are equivalent. Indeed, it would
not be hard to do so. However, we want to illustrate how to use logical identities that we already know to
establish new logical identities, something that is of practical importance for establishing equivalences of
compound propositions with a large number of variables. So, we will establish this equivalence by
developing a series of logical equivalences using one of the equivalence in the above table.

¬(p→q) ≡ ¬(¬p vq)

≡ p^¬q

10
Example: Sow that ¬(pv(¬p^q)) and ¬p ^ ¬q are logically equivalent by developing a series of
logical equivalences

Solution: ¬(pv(¬p^q))

S.N Step Reason


1 ¬(pv(¬p^q)) Given Statement
2 ¬p^ ¬(¬p^q) De Morgan’s Law
3 ¬p ^(pv ¬q) De Morgan’ Law
4 (¬p^ p)v(¬p^¬q) Distributive Law
5 F v(¬p^¬q) ¬p^p =F
6 (¬p^¬q) Law F v p = p
Proved

Example: Show that (p^q)→(pvq) is a tautology

Solution: To show that this statement is a tautology, we will use logical equivalences to demonstrate that
it is logically equivalent to T

(p^q)→(pvq) ≡ ¬(p^q)v(pvq)

≡(¬pv¬q)v(pvq) [Demorgan’s Laws]

≡ (¬pvp)v(¬qvq) [Commutative Law]

≡T v T

≡T

Predicate: Statements involving the variables such as "x>3", "x=y+1", "z=x+y", "computer x is
functioning properly are often found in mathematical assertions, in programs and in system
specifications. These statements are neither true nor false when the values of the variables are not
specified.

The statement "x is greater than 3" has two parts. The first part, the variable x, is the subject of the
statement. The second part-the predicate, "is greater than 3"-refers to a property that the subject of
the statement can have. We can denote the statement " x is greater than 3" by P(x) where P
denotes the predicate " is greater than 3" and x is the variable. We also call P as a propositional
function where P(x) is also said to be the value of the propositional function P at x. Once a value
has assigned to the variable x, the statement P(x) becomes a proposition and has a truth value.

Example 1: Let P(x) denotes the statement " x >3". What are the truth values of P(4) and P(2)?

Solution:

11
We obtain the statement P(4) by setting x=4 in the statement "x>3". Hence P(4) which is the statement
"4>3" is true. However, P(2) which is the statement "2>3" is false.

Example 2: Let Q(x,y) denote the statement "x = y+3". What are truth values of the propositions Q(1,2)
and Q(3,0)?

Solution: To obtain Q(1,2) set x=1 and y=2 in the statement Q(x,y). Hence, Q(1,2) is the statement
"1=2+3" which is false. The statement Q(1,0) is the proposition "3=0+3 " which is true.

Quantifiers

When the variables in a propositional function are assigned values, the resulting statement becomes a
proposition with certain truth value. However, there is another important way, called
quantification, to create a proposition from a proposition. Quantification expresses the extent to
which a predicate is true over a range of elements. In English, the words all, some, many, none
and few are used in quantifications. We have two types of quantifications.

Quantifiers are the tools that change the propositional function into a proposition. Construction of
propositions from predicate using quantifiers is called quantification.

Universal quantification which tells us that a predicate is true for every element under consideration and
existential quantification which tells us that there is one or more element under consideration for
which the predicate is true.

The Universal Quantifier

Many mathematical statements asserts that a property is true for all values of a variable in a particular
domain, called the domain of discourse or universe of discourse, often just referred to as the
domain. Such a statement is expressed using universal quantification. The universal
quantification of P(x) for a particular domain is the proposition that asserts that P(x) is true for all
values of x in this domain. The domain must always be specified when a universal quantifier is
used, without it, the universal quantification of a statement is not defined.

Definition: The universal quantification of P(x) is the statement " P(x) for all value of x in the domain"

The notation ∀x P(x) denotes the universal quantification of P(x). Here ∀ is called the universal
quantification. We read ∀ x P(x) as "for all x P(x)".

An example for which P(x) is false is called a counterexample of ∀ x P(x).

Example 1: Let P(x) be the statement "x+1>x". What is the truth value of the quantification ∀ x P(x)
where domain consists of all real numbers.

Solution: Because P(x) is true for all real number x, the quantification ∀ x P(x) is true.

Example 2 : Let Q(x) be the statement "x<2". What is the truth value of the quantification ∀ x P(x) where
the domain consists of all real numbers

12
Solution: Q(x) is not true for every real number x because for instance Q(3) is false. That is x=3 is
counterexample for the statement ∀ x P(x)

Thus ∀ x P(x) is false.

Example 3: What is the truth value of ∀ x P(x) where P(x) is the statement "x2<10" and the domain
consists of the positive integers not exceeding 4

Solution: The statement ∀ x P(x) is same as the conjunction

P(1)^P2(2)^p(3)^P(4)

Because the domain consists of the integers 1,2,3,4. Because P(4) which is the statement "42<10" which is
false, it follows that ∀ x P(x) is false.

The Existential Quantifier: Many mathematical statements assert that there is an element with a certain
property. Such statements are expressed using existential quantification. With existential
quantification, we form a proposition that is true if and only if P(x) is true for at least one value of
x in the domain.

Definition

The existential quantification of P(x) is the proposition "There exists an element x in the domain such that
P(x)".

We use the notation ∃ x P(x) for the existential quantification of P(x). Here ∃ is called the existential
quantifier

A domain must always be specified when a statement ∃ x P(x) is used. Furthermore, the domain of ∃ x
P(x) changes when the domain changes. Without specifying the domain, the statement ∃ x P(x)
has no meaning.

Besides the words "there exists", we can also express existential quantification in many other ways, such
as by using the words "for some ", "for at least one", "there is ". The existential quantification ∃x
P(x) us read as

"There is an x such that P(x),"

"There is at least one x such that P(x)"

Example 1: Let P(x) denotes the statement "x>3". What is the truth value of the quantification of ∃ x
P(x), where the domain consists of all real numbers?

Solution: Because "x>3" is sometimes true-for instance, when x=4-the existential quantification of P(x),
which is ∃x P(x), is true.

The statement ∃ x P(x) is false if and only if there is no element x in the domain for which P(x) is true.

That is, ∃x is false if and only if P(x) is false for every element of the domain.

13
Example 2: Let Q(x) denotes the statement "x = x+1". What is the truth value of the quantification ∃ x
Q(x) where the domain consists of all real numbers?

Solution:

Because Q(x) is false for every real number x, the existential quantification of Q(x), which is ∃ x Q(x), is
false.

Example 3: What is the truth value of ∃ x P(x), where P(x) is the statement "x2>10" and the universe of
discourse consists of the positive integers not exceeding 4?

Solution: Because the domain is {1,2,3,4}, the proposition ∃ x P(x ) is same as the disjunction

P(1)vP(2)vP(3)vP(4)

Because P(4) which is the statement 42>10 is true, it follows that ∃ x P(x) is true.

Example 4: Let N = {1,2,3,4,5,6,7,8,9} be set of natural number. Determine the truth value of each of the
following statements;

a. ∃ x N, x+5=12
b. ∀ x N, x+4<15
c. ∀ x N x+5≤10

Solution:

N = {1 ,2,3,4,5,6,7,8,,9}

a. ∃ x N, x+5 =12 is true for if x=5 then x+5=12 or 7+5=12 (true)


b. ∀ x N x+4<15 is true for every x N satisfies x+4<15
c. ∀ x N x+5≤10 is false for 6 N, 6+5≤10 (false)

Binding Variables

When a quantifier is used on variable then it is called bounded variable. An occurrence of a variable that
is not bounded by a quantifier or set equal to a particular value is said to be free.

The part of a logical expression to which a quantifier is applied is called the scope of quantifier.

Example: In the statement ∀ y Q(x,y), the variable y is bounded by universal quantifier ∀ x but variable
x free because it not bounded by a quantifier.

Translating the sentences into Logical Expression

Example 1: Translate “Not every integer is even” where the universe of discourse is set of integers.

Solution:

Let E(x) denotes x is even

14
Then ¬∀ x E(x) represents the above statement “not every integer is even”.

Example 2: Translate “Every man is mortal”

Solution: Let M(x) denote x is mortal, where x is from set of man (here universe of discourse is all man)

Then,∀ x M(x) represent that “ for all x, x is mortal.”.

Example 3: “Every man is precious”

Solution: We translate this as:

For every x, if x is person the x is precious

P(x): x is precious

Q(x): x is precious

There for ∀ x P(x)→Q(x)

Example 4 : Some student of this college passed CSIT entrance examination

Solution: We translate this as:

For some x, x is student of this college and x has passed CSIT entrance

Let C(x): x is student of this college

E(x): x passed CIST entrance examination

Therefore ∃ x C(x) ^E(x)

Where universe of discourse is set of all students

Example 5: Every student in this class has studied discrete mathematics where universe of discourse is set
of person.

Solution: We translate this as:

For every person x, if x is student of this class then x has studied discrete

Let P(x): x is student of this class

Q(x): x has studied discrete

Therefore ∀ x P(x)→Q(x)

Example 6: Let S(x): x is a student

C(x): x is clever

M(x): x is successful

15
Express the following using quantifier

a. There exist a student : ∃ x S(x)


b. Some students are clever :
This can be expressed as:
There exists an x such that x is student and x is clever
∃ x (S(x) ^C(x))
c. Some students are not successful

This can be expressed as:

There exists an x such that x is student and x is not successful

∃ x (S(x)^ ¬M(x))

Negating Quantified Expressions

We will often want to consider the negation of a quantified expression. For instance, consider the
negation of the statement

"Every student in your class has taken a course in calculus"

This statement is a universal quantification, namely ∀ x P(x) where P(x) is the statement "x has taken a
course in calculus" and the domain consists of the students in your class. The negation of this
statement is "It is not the case that every student in your class has taken a course in calculus".
And this is simply the existential quantification of the negation of the original propositional
function namely

∃ x P(x)

This example illustrates the following logical equivalences

∀ x P(x) ∃ x P(x)

To show that ∀ x P(x and ∃ x P(x) are logically equivalent no matter what the propositional function
P(x) is and what the domain is, first note that ∀ x P(x) is true if and only if ∀ x P(x) is false.

Also note that ∀ x P(x) is false if and only if there is an element x in the domain for which P(x) is false.
This holds if and only if there is an element x in the domain for which P(x) is true. Finally, note
that there is an element x in the domain for which P(x) is true if and only if ∃ x P(x) is true.

Putting these steps together, we can conclude that ∀ x P(x) is true if only if ∃ x P(x) is true. It follows
that ∀ x P(x) and ∃ x P(x) are logically equivalent.

16
Suppose that we want to negate an existential quantification. For instance, consider the proposition "
There is a student in this class who has taken a course in calculus" This is the existential
quantification

∃ x Q(x)

Where Q(x) is the statement " x has taken a course in calculus". The negation of this statement is the
proposition "It is not the case that there is a student in this class who has taken a course in
calculus". This is equivalent to " Every student in this class has not taken a course in calculus"
which is just the universal quantification of the negation of the propositional function or phrased
in the language of quantifiers,

∀ x Q(x).

This example illustrates the equivalence

∃ x P(x)  ∀ x Q(x)

De Morgan's Law for Quantifiers

Negation Equivalence Statement When Is negation When False


True?
∃ x P(x) ∀ x P(x) For every x, P(x) is There is an x for
false which P(x) is true
∀ x P(x) ∃ x P(x) There is an x for P(x) is true for
which P(x) is false every x

Example: What are the negations of the statements "There is an honest politician" and "All
Americans eat cheeseburgers"?

Solution: Let H(x) denote " x is honest". Then the statement " There is an honest politician" is represented
by ∃ xH(x) where the domain consists of all politicians. The negation of this statement is ∃
xH(x), which is equivalent to ∀ x H(x). This negation can be expressed as "Every politician is
dishonest"

Let C(x) denotes "x eats cheeseburger". Then the statement "All American eat cheese burgers" is
represented ∀ x C(x), where the domain consists of all Americans. The negation of this statement is is

∀ x C(x) which is equivalent to ∃ x C(x) . This negation can be expressed as "Some Americans does not
eat cheeseburgers.

Translating from English into Logical Expressions

17
Translating sentences from English into logical expression is a crucial task in mathematics, logic
programming, artificial intelligence, software engineering and many other applications.
Translating from English to logical expressions becomes even more complex when quantifiers are
needed. Furthermore, there can be many ways to translate a particular sentence. The goal in this
translation is to produce simple and useful logical expression.

Example: Express the statement “Every student in this class has studied calculus” using predicates and
quantifiers.

Solution: First, we rewrite the statement so that we can clearly identify the appropriate quantifiers to use.

Doing so, we obtain,

“For every student in this class, that student has studied calculus”.

Next, we introduce a variable x so that our statement becomes

“For every student x in this class, x has studied calculus”.

Continuing, we introduce C(x), which is the statement, “x has studied calculus”. Consequently, if the
domain for x consists of the student in the class, we can translate our statement as ∀ x C(x)

If we are interested in a wider group of people than only those in this class then we change the domain to
consist of all people, we will need to express our statement as:

“For every person x, if person x is a student in this class then x has studied calculus”.

If S(x) represent the statements the statement that person x is in this class, we see that our statement can
be expressed as:

∀ x (S(x)→C(x)).

Example 2: Express the statements “Some students in this class has visited Mexico” and “Every student
in this class has visited either Canada or Mexico” using predicate and quantifiers.

Solution: The statement “Some student in this class has visited Mexico” means that

“There is a student in this class with the property that the student has visited Mexico”.

We introduce a variable x, so that our statement becomes

“There is a student x in this class having the property that x has visited Mexico”

We introduce M(x), which is the statement “x has visited Mexico”. If the domain for x consists of the
students in this class, we can translate this statement as ∃ x M(x).

However, if we are interested in people other than those in this class, we look at the statement a little
differently. Our statement can be expressed

“There is a person x having the property that x is a student in this class and x has visited Mexico

18
In this case, the domain for the variable x consists of all people. We introduce S(x) to represent “x is a
student in this class”. Our solution becomes ∃ x(S(x) ^ M(x)) because statement is that there is a person x
who is student in this class and who has visited Mexico.

Similarly, the second statement can be expressed as

For every x in this class, x has the property that x has visited Mexico or x has visited Canada”.

We let C(x) be “x has visited Canada”.

Following our earlier reasoning, we see that if the domain for x consists of the student in this class, this
second statement can be expressed as

∀ x (C(x) v M(x))

However, if the domain for x consists of all people, our statement can be expressed as

“For every person x, if x is a student in this class, then x has visited Mexico or x has visited Canada”.

In this case, the statement can be expressed as ∀ x(S(x)→(C(x) v M(x)))

Example 3: Consider these statements. The first two are called premises and the third is called the
conclusion. The entire set is called an argument

“All lions are fierce.”

“Some lions do not drink coffee.”

“Some fierce creatures do not drink coffee.”

Solution: Let P(x), Q(x) and R(x) be the statements “ x is a lion” ,”x is fierce”, and “x drinks coffee”
respectively. Assuming that domain consists of all creatures, express the statements in the argument using
quantifiers and P(x), Q(x) and R(x)

∀ x (P(x)→Q(x)).

∃ x(P(x) ^ ¬R(x))

∃ x(Q(x) ^¬ R(x))

Example 4: Consider these statements, of which the first three are premises and the fourth is a valid
conclusion:

“All hummingbirds are richy colored.”

“No large birds live on honey”

“Birds that do not line on honey are dull in color.”

“Hummingbirds are small.”

19
Solution: Let P(x), Q(x), R(x) and S(x) be the statements “ x is a humminfbird”, “x is large”, “x lives on
honey” and “ x is richy colored” respectively.

Assuming that the domain consists of all birds, express the statements in the argument using quantifiers
and P(x), Q(x), R(x) and S(x).

∀ x (P(x)→S(x))

∃ x(Q(x) ^R(x))

∀ x (¬R(x)→¬S(x))

∀ x (P(x)→¬Q(x))

Nested Quantifiers

Two quantifiers are nested if one is within the scope of the other such as

∀ x ∃ y(x+y=0)

Note that everything within the scope of a quantifier can be thought of as a propositional function.

Nested quantifiers commonly occur in mathematics and computer science. Although, nested quantifiers
can sometime be difficult to understand.

To understand these statements involving many quantifiers, we need to unravel what the quantifiers and
predicates that appear mean.

Example 1: Assume that the domain for the variables x and y consists of all real numbers. The statements

∀ x ∀ y (x+y = y+x)

Says that x+y = y+x for all real numbers x and y. This the commutative law for addition of real numbers

Example 2: Translate into English statement

∀ 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>0 and y<0
then xy<0. That is, this statement says that for every real number x and y if x is positive and y is negative
then xy is negative. Simply, the product of a positive real number and negative real number is negative.

Example 3: Translate following sentence using quantifier.

a. Everyone loves someone


b. Someone loves somebody
c. Everyone loves everybody

20
Solution:
Let L(x,y): x loves y
Then,
∀ x ∃ y L(x,y)
∃ x ∃ y L(x,y)
∀ x ∀ y L(x,y)

The order of quantifiers


Many mathematical statements involve multiple quantifications of propositional functions involving more
than one variable. It is important to note that the order of the quantifiers is important unless all the
quantifiers are universal quantifiers or all the quantifiers are universal or all are existential quantifiers.

Example 1: Let P(x,y) be the statement “x+y = y+x”. What are the truth values of the quantification ∀ x
∀ y P(x,y) where the domain for all variables consists of all real numbers.

Solution:

∀ x ∀ y P(x,y) denotes the proposition

“For all real numbers x, for all real numbers y, x+y = y+x”

Translating Mathematical Statements into Statements Involving Nested Quantifiers

Mathematical statements expressed in English can be translated into logical expressions

Example 1: Translate the statement “The sum of two positive integers is always positive “into a logical
expression.

Solution: To translate this statement into a logical expression, we first rewrite it so that the implied
quantifiers and a domain are shown: “For every two integers, if these integers are both positive the sum of
these integers is positive.

Next, we introduce the variables x and y to obtain “For all positive integers x and y, x+y is positive.

Consequently, we can press this statement as:

∀ x ∀ y ((x>0)^(y>0)→(x+y>0))

Where the domain for both variables consists of all integers

Example 2: Translate the statement “Every real number except zero has a multiplicative inverse”

Solution: We first rewrite this as “for every real number x except zero, x has a multiplicative inverse”. We
can rewrite as “For every real number x , if x ≠0, then there exists a real number y such that xy = 1”

This can be written as:

21
∀ x ((x≠0)→ ∃ y(xy=1))

Example 3 : 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: The statement “If a person is female and is a parent, then this person is someone’s mother” can
be expressed as “For every person x, if person x is a female and person x is a parent then there exists a
person y such that person y is the mother of person y”. We introduce the propositional function F(x) to
represent “x is female”, P(x) to represent “ x is a apparent”, and M(x,y) to represent “ x is the mother of
y”.

The original statement can be represented as:

∀ x ∃ y ((F(x) ^P(x))→M(x,y)).

Example 4: 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: The statement “Everyone has exactly one best friend” can be expressed as “For every person x,
if person x has exactly one best friend”. Introducing the universal quantifier, we see that this statement is
same as

Example 5: Use quantifiers to express the statement “There is woman who has taken flight on every
airline in the world”.

Solution:

Let P(w,f) be "woman w has taken flight f"

Q(f,a) be " flight f is on airlines a"

We can express the statement as

∃ w ∀ a ∃ (P(w,f) ^Q(f,a))

where the domain of discourse for w,f and a consists of all the woman in the world, all airline flights and
all airlines respectively.

Rules of Inferences

Proofs in mathematics are valid arguments that establish the truth of mathematical statements. By an
argument, we mean a sequence of statements that end with a conclusion. By valid, we mean that
the conclusion or final statement of the argument must follow from the truth of the preceding

22
statements or premises of the argument. That is, an argument is valid if and only if it is
impossible for all the premises to be true and the conclusion to be false. To deduce new
statements from statements we already have, we use rules of inference which are template for
constructing valid arguments. Rules of inference are our basic tools for establishing the truth of
elements.

Rules of Inference

Proofs in mathematics are valid arguments that establish the truth of mathematical statements. By an
argument, we mean a sequence of statements that end with a conclusion. By valid we mean that
the conclusion or final statement of the argument must follow from the truth of the preceding
statements or premises of the argument. That is, an argument is valid if and only if it is
impossible for all the premises to be true and the conclusion to be false. To deduce new
statements from statements we already have, we use rules of inference which are templates for
constructing valid arguments. Rules of inference are our basic tools for establishing the truth of
statements

Valid Arguments in Propositional Logic

An argument in propositional logic is a sequence of propositions. All but the first proposition in the
argument are called premises and the final proposition is called the conclusion. An argument is
valid is the truth of all its premises implies that the conclusion is true.

An argument form in propositional logic is a sequence of compound propositions involving propositional


variables. An argument form is valid if no matter which particular propositions are substituted for
the propositional variables in its premises, the conclusion is true if the premises are all true.

From the definition of a valid argument form we see that the argument form with premises p1, p2, p3….. pn
and conclusion q is valid.

Rules of Inference for propositional Logic

We can always use a truth table to show that an argument form is valid. We do this by showing that
whenever the premises are true, the conclusion must also be true. However, this cannot be a
tedious approach. For example, when an argument form involves 10 different propositional
variables, to use a truth table to show this argument form is valid requires 2 10 = 1024 different
rows. Fortunately, we do not have to resort to truth tables. Instead, we can first establish the
validity of some relatively simple arguments called rules of inference. These rules of inferences
can be used as building blocks to construct more complicated valid argument forms.

The tautology (p^(p→q))→q is the basis of the rule of inference called modus ponens or law of
detachment. This law tells us that if a conditional statement and the hypothesis of this conditional
statement are both true then the conclusion must also be true.

S.N Rule of Tautology Name


Inference
1 P (p^(p→q))→q Modus Ponens
p→q

23
……………
∴q
2 ¬q [¬p^(p→q)]→¬p Modus Tollens
p→q
……………
∴ ¬p
3 p→q [(p→q)^(q→r)]→(p→r) Hypothetical Syllogism

q→r
………..
∴p→r
4 Pvq [(pvq)^¬p]→q Disjunctive Syllogism
¬p
………
∴q

5 P p→(pvq) Addition
……….
∴ pvq
6 P^q (p^q)→p Simplification
………
∴p
7 P ((p)^(q))→(p^q) Conjunction
q
…………
∴ p^q
8 Pvq [(pvq)^(¬pvr)]→(qvr) Resolution
¬pvr
…………..
∴pvr

Example 1: State which rule of inference is the basis for the following arguments: “It is below
freezing now. Therefore, it is either below freezing or raining now”.

Solution: Let p the proposition “ It is below freezing now” and q be the proposition “It is raining now”
Then this argument is of the form

p
…………..
∴ pvq
This is r an argument that uses the addition rule

Example 2: State which rule of inference is the basis of the following argument: “It is below
freezing and raining now. Therefore, it is below freezing now.
Solution:

24
Let p be the proposition “It is below freezing now”. And let q be the proposition “It is raining now”. This
argument is of the form:
P^q
…………..
∴p

Example 3: State which rule of inference is used in the argument:


If it rains now today then we will not have a barbecue today. If we do not have a barbecue today then we
will have a barbecue tomorrow. Therefore, if it rains today then we will have a barbecue tomorrow

Solution:
Let p be the proposition “It is raining today”
Let q be the proposition “ We will not have a barbecue today”
Let r be the proposition “ We will have a barbecue tomorrow”
Then this argument if of the form
p→q
q→r
……..
∴ p→r
Hence, this argument is a hypothetical syllogism
Using Rules of Inferences to Build Arguments
When there are many premises, several rules of inferences are often needed to show that an argument is
valid.

Example 1: Show that the hypothesis "It is not sunny this afternoon and it is colder than
yesterday,". "We will go swimming only if it is sunny", "If we do not go swimming then we will
take a canoe trip", and "If we take a canoe trip then we will be home by sunset" leads to the
conclusion "we will be home by sunset"

Solution: Let p be the proposition " It is sunny this afternoon", q be the proposition "It is colder than
yesterday", r be the proposition, " we will go swimming ", s be the proposition, "We will take a canoe
trip" and t be the proposition "We be home by sunset".

Then the hypothesis become p^q, r→p,r→s and s→t.

The conclusion is simply t

We construct an argument to show that our hypothesis lead to the desired conclusion as follows:

S.N Step Conclusion


1 p^q Hypothesis
2 p Simplification on 1
3 r→p Hypothesis
4 r Modus tollens using 2 and 3

25
5 r→s Hypothesis
6 S Modus ponens using 4 and 5
7 s→t Hypothesis
8 T Modus ponens using 6 and 7

Note that we could have used a truth table to show that whenever each of the four hypotheses is true, the
conclusion is also true. However, because we are working with five propositional variables p, q, r, s and t
such a truth table would have 32 rows.

Example 2: Show that the hypothesis "If you send me an email message then I will finish writing the
program,". If you do not send me an email message then I will go to sleep early", and "If I go to sleep
early the I will wake up feeling refreshed " lead to the conclusion "If I don’t finish writing the program
then I will wake up feeling refreshed"

Solution:

Let p be the proposition “You send me an email”

Let q be the proposition “I will finish writing the program”

Let r be the proposition “ I will go to sleep early”

Let s be the proposition “I will wake up fleeing refreshed”

Then the hypothesis are p→q, ¬q→r , r→s and the conclusion is ¬q→s.

s.n Step Reason


1 p→q Hypothesis
2 ¬q→¬p Contra positive of 1
3 ¬p→r Hypothesis
4 ¬q→r Hypothetical Syllogism using 2 and 3
5 r→s Hypothesis
6 ¬q→s Hypothetical Syllogism using 4 and 5

Example 3: Show that the following argument is valid. If today is Tuesday, I have a test in
mathematics or economics. If my economics professor is sick, I will not have a test in Economics.
Today is Tuesday and my Economics professor is sick. Therefore I have a test in Mathematics.

Solution:

Let p be proposition “Today is Tuesday”

Let q be the proposition “ I have a test in Mathematics”

26
Let r be the proposition “ I have a test in Economics”

Let s be the proposition “Economics professor is sick”

Here hypothesis are: p→(qvr), s→¬r , p^s and conclusion is q

S.N Step Reason


1 p→(qvr) Hypothesis
2 s→¬r Hypothesis
3 p^s Hypothesis
4 P Simplification on 3
5 S Simplification on 3
6 Qvr Moduls Ponens
7 ¬sv¬r Equivalence on 2
8 ¬r Disjunctive syllogism on 5 and 5
9 Q Disjunctive syllogism on 6 and 8

Example 4: Use resolution to show that the hypothesis “Jasmine is skiing or it is not snowing” and
“It is snowing or Bart is playing hockey imply that Jasmine is skiing or Bart is playing hockey”.

Solution: Let p be the proposition “It is snowing”

Let q be the proposition “Jasmine is skiing”

Let r be the proposition “Bart is playing hockey”

S.N Step Reason


1 -pvq Hypothesis
2 Pvr Hypothesis
3 Qvr Using resolution
4
be the proposition “Bart is playing hockey”

Example 5: Show that the hypothesis (p^q)v r and r→s imply the conclusion pvs

Solution:

S.N Step Reason


1 (p^q)vr Hypothesis
2 r→s Hypothesis
3 (pvr)^(qvr) Distributive law on 1
4 Pvr Simplification on 3
5 ¬rvs Equivalence of 2
6 Pvs Resolution on 4 and 5
Example 6: Show that the following argument is valid. If Mohan is lawyer then he is ambitious. If Mohan
is an early riser then he does not like idlies. If Mohan is ambitious, then he is an early riser. Then if
Mohan is a lawyer then he does not like idlies

27
Solution:

Mohan is a layer be denoted by L

Mohan is ambitious be denoted by A

Mohan is an early riser be denoted by E

Mohan likes idlies be denoted by I

The premises and conclusion can be given by

S.n Step Reason


1 L→A Hypothesis
2 E→I Hypothesis
3 A→E Hypothesis
4 L→I Hypothetical Syllogism
5 L→E Hypothetical Syllogism
6 L→I
7
8

Example 7: Construct an argument using rules of inference to show that the hypotheses “If it does not
rain or if it is cloudy today then the swimming competition will be help and the life saving demonstrating
will go on. If the swimming competition is held then the trophy will be awarded and the trophy was not
awarded “imply the conclusion “It rained”

Solution:

Let P = “ It rains”

Q = “It is foggy”

R = “ The sailing race is held”

T = “trophy is awarded”

Then we have to show the argument

[((¬p v ¬q) → (r ^ s)^(r→t ^ ¬t)→p is valid.

Now,

S.N Step Reason


1 r→q Hypothesis
2 ¬t Hypothesis
3 ¬r Modus Tollens using 1 and 2

28
4 (¬p v ¬q) → (r ^ s) Hypothesis
5 ¬(¬p v ¬q) v (r ^ s) Implication on 4
6 (p ^ q) v (r ^s) De Morgan’s Law in step 5
7 p v (r^s) Simplification on 6
8 pvr Simplification on 7
9 rvp Commutative law on 8
10 ¬rv p Addition using 3
11 pvp Resolution law on 9 and 10
12 p Idempotent law

Rules of Inference for Quantifies Statements

Universal Instantiation: It is the rule of inference used to conclude that P© is true where c is a particular
member of the domain, given the premise ∀x P(x). Universal instantiation is used when we
conclude from the statement “All women are wise “that “Lisa is wise” where Lisa is a member of
the domain of all women.

Universal Generalization: It is the rule of inference that states that ∀x P(x) is true, given the premise that
P© is true for all element c in the domain. Universal generalization is used when we know that ∀x
P(x) is true by taking an arbitrary element c from the domain. Universal generalization is used
when we show that ∀x P(x) is true by taking an arbitrary element c from the domain and showing
that P© is true. That is, when we assert from ∀x P(x) the existence of an element c in the domain,
we have no control over c and cannot make any other assumptions about c other than it comes
from the domain. Universal generalization is used implicitly in many proofs in mathematics and
is seldom mentioned explicitly.

Existential Instantiation: It is rule that allows us to conclude that there is an element c in the domain for
which P© is true if we know that ∃ x P(x) is true. We cannot select an arbitrary value of c hare,
but rather it must be a c for which P© is true. Usually we have no knowledge of what c is, only
that it exists. Because it exists, we may give it a name c and continue our argument.

Existential Generalization: It is the rule of inference that is used to conclude that ∃ x P(x) is true when a
particular element c with P© true in known. That is, if we know one element c in the domain for
which P© is true, then we know that ∃ x P(x) is true

29
Rule of Inference Name
∀x P(x) Universal Instantiation
…………
P(c )
P(c ) for an arbitrary c Universal Generalization
………………
∀x P(x)
∃ x P(x) Existential Instantiation
…………..
P (c ) for some element c
P(c ) for some element c Existential Generalization
…………………..
∃ x P(x)

Example 1: Show that the premises “Everyone in this discrete mathematics class has taken a course in
computer science” and “Marla is a student in this class” imply the conclusion “ Marla has taken a
course in computer science”.

Solution:

Let D(x) denotes “x is in this discrete mathematics class”.

Let C(x) denotes “x has taken a course in computer science”

Then the premises are ∀x D(x)→C(x) and D(Marla). The conclusion is C(Marla)

The following steps can be used to establish the conclusion from the premises

S.N Step Reason


1 ∀x D(x)→C(x) Premise
2 D(Marla)→C(Marla) Universal Instantiation From (1)
3 D(Marla) Premise
4 C(Marla) Modus Ponens from 2 and 3

Example 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 passed the first term exam has not
read the book”.

Solution: Let C(x) b “ x is in this class”

Let B(x) be “ x has read the book”

Let P(x) be “ x passed the first exam”

The premises are ∃ x(C(x) ^ B(x)) and ∀x (C(x)→P(x)). The conclusion is ∃ x(P(x) ^
B(x))

30
S.N Step Reason
1 ∃ x(C(x) ^ B(x)) Assumption
2 C(a) ^ B(a) Existential instantiation from 1
3 C(a) Simplification on 2
4 ∀x (C(x)→P(x)) Assumption
5 C(a)→P(a) Universal Instantiation from 4
6 P(a) Modus ponens from 3 and 5
7 B(a) Simplification on
8 P(a) ^ B(a) Conjunction from 6 and 7
9 ∃ x P(x) ^ B(x) Existential generalization from 8

Example 3 : Reema, a student of this class knows how to write programs in Java. Everyone who knows
how to write programs in Java can get a high job. Therefore someone in this class can get a high
paying job.

Solution: Let x represent a student in this class

J(x): x knows how to program in Java

Then J(Reema): Reema knows how to program in Java

H(x): x gets high paying job.

Now, the above given argument in symbolic form becomes

i. ∀x J(x)→H(x)
ii. J(Reema)

And we have to prove ∃ x H(x)

S.N Steps Reason


1 ∀x J(x)→H(x) Hypothesis

2 J(Reema)→H(Reema) Using universal Instantiation in 1


3 J(Reema) Given argument
4 H(Reema) Using modus Ponens
5 ∃x H(x) Using existential Generalization
Now the steps are:

Example 4: Everyone in discrete structure class has taken a course in computer science and Reema is a
student in this class implies the conclusion Reema has taken a course in computer science.

Solution: Let D(x): x is a student in discrete structure class

C(x): x has taken a course in computer science

31
Then, the premises are as:

a. ∀x D(x)→C(x)
b. D(Reema)

And we have to prove that conclusion is C(Reema)

Now,

1. ∀x D(x) → C(x) - Hypothesis


2. D(Reema) → C(Reema)
3. D (Reema)- Hypothesis
4. C(Reema) – Using modus Ponens on 2 and 3

Hence, it is concluded that Reema had taken a computer science course

Example 5: Prove or disprove the validity of argument “Every living thing is a plant or an animal. Hari’s
god is alive and it is not plant. All animals have heart. Hence Hari’s dog has heart.

Solution:

Let, P(x): x is a plant

A(x): x is alive

L(x): x is alive

H(x): x has a heart

d: represent Hari’s dog

Then

1. ∀x P(x) v A(x) – Hypothesis


2. L(d) ^ ¬P(d) - Hypothesis
3. ∀x A(x) →H(x) - Hypothesis
4. P(d) v A(d) - Universal Instantiation
5. ¬P(d) – Simplification on 4
6. A(d) : Disjunctive Syllogism
7. A(d)→ H(d) : Universal Instantiation
8. H(d) – Modus Ponens

The conclusion “ Hari’s dog has heart is valid”

Example 6: Someone in the class who has visited Pokhara. Everyone who has been in Pokhara visits
Fewalake. Therefore someone in this class has visited Fewalake.

Solution: Let P(x) : x has been in Pokhara

F(x) : x has visited Fewalake

32
S(x): x is a student of this class

Then,

1. ∃x S(x) ^ P(x): Hypothesis


2. ∀x P(x) ^ F(x)
3. S( c )^ P( c )
4. P(c)
5. P( c )→F(c )
6. F( c)
7. S (c ) ^F (c )
8. ∃x S(x) ^ F(x) ( Using existential generalization)

Proof Methods

A theorem is a mathematical statement that is can be shown to be true. A proof of given theorem is said to
be well founded if its steps of mathematical statement can be present on argument that makes the
theorem true.

This method of understanding correctness of statements by applying sequences of logical argument is


known as proof of statement

Problem solving is not just a science so there is not hard and fast rule that is applied in problem solving.
However, there are some guiding methods that help us to solve different kinds of problem.

Here we will discuss different method of proving implication p→q

Direct Proof

The implication p→q can be proved by showing that if p is true then q must also be true. To carry out
such as proof, we must assume that hypothesis p is true and using information already available if
conclusion q becomes true then argument becomes valid.

Example: If a and b are odd integers than a+b is an even integer

Solution:

Proof: We know that if a number is even then we can represent it as 2k where k is an integer and if the
number is odd then it can be written as 2I+1 where I is an integer. Assume that a = 2k+1 and b =
2I+1 for some integers I and K.

Then a+b = 2K+1+2I+1 = 2(K+I+1).

Here k+I+1 is an integer so 2(K+I+1) is even integer.

Hence a+b is even

Example: Prove that if n is an odd integer then n2 is odd integer.

33
Solution: Let p→q : if n is odd integer then n2 is an odd integer

We assume that hypothesis of this implication is true. That is, suppose that n is odd and then n can be
expressed as n = 2k+1

N2 = (2k+1)2 = 4k2+4k+1 = 2(2k2+2k)+1

Here 2(2k2+2k) is even and hence 2(2k2+2k)+1 is odd

Therefore n2 is odd.

Example: Prove that sum of two rational number is rational number

Solution:

Proof: Suppose that A and B are two rational number and then by definition of rational number, it follows
𝑝
that there are two integers p and q where q ≠0 such that A = 𝑞 and integers x and y with y≠0 such
𝑥
that B = 𝑦

𝑝 𝑥 𝑝𝑦+𝑞𝑥
Now, A+B = 𝑞 +𝑦 = 𝑞𝑦

Since q≠0 and y≠0, it follows that ay≠0. Here, we have expressed A+B as the ratio of two integers py+qx
and qy with qy≠0

Therefore A+B is rational

Example: Using direct proof, prove that for every positive integer n, n3+n is even

Proof:

Case 1: Suppose that n is even then n = 2k for some integer k

Now,

N3+n = (2k)3+2k = 8k3+2k = 2(4k3+k) which is even

Case II: Suppose that n is odd then we have n = 2k+1 for some integer k

Now,

n3+n = (2k+1)3+(2k+1) = (8k3+12k2+6k+1)+(2k+1) = 2(4k3+6k2+4k+1) which is even. Hence, for any


positive integer n, n3+n is even.

Indirect Proof

We have p→q ≡ ¬q→¬p i.e. contra positive of implication is equivalent to the implication. So, the
implication p→q can be proved by showing that its contra positive ¬q→¬p is true. We prove the
implication p→q by assuming that the conclusion (q) is false and using the known facts we show
that the hypothesis (p) is also true.

34
Example: If the product of two integers a and b is even then either a is even or b is even

Solution: Suppose that a and b are odd then we have a = 2k+1 and b =2l+1

So ab = (2k+1).(2l+1) = 4kl+2k+2k+1 = 2(2kl+k+1)+1 which is odd integer. Hence both a and b being
odd implies that ab is odd. This is indirect proof.

Example: Using indirect proof show that is 3n+2 is odd then n is odd

Solution:

Proof: Let p→q: is 3n+2 is odd then n is odd

Assume that conclusion of this implication is false i.e. n is even then we can express n as

n = 2k for some integer k

It follows that

3n+2 = 3*2k+2

= 6k+2

2(3k+1)

Therefore 3n+2 is even since 2(3k+1) is multiple of 2

Hence, if 3n+2 is odd then n is also odd

Proof by Contradiction

The steps in proof of implication p→q by contradiction are:

• Assume that p ^ ¬q is true


• Try to show that the above assumption p ^ ¬q is false
• When the assumption is found to be false then implication p→q is true
• Since p→q is equivalent to ¬pvq and negation of ¬pvq is p^¬q (By De Morgan Law). So, if our
assumption is false then its negation is true

Example: If a2 is even number then a is an even number

Solution;

Proof: Assume that a2 is an even number and a is odd number. Since a is odd number we have a = 2k+1,
for some integer k. so a2 = (2k+1)2 = 4k2+4k+1 = 2(k2+k)+1. Here k2+1 is some integer say I then a2 =
I2+1 i.e. a2 is odd number. This contradicts our assumption that is a2 is even.

Hence proved.

35
Example: Prove that if n3+5 is odd then n is even

Solution: Let p→q: If n3+5 is odd then n is even

Suppose that n3+5 is odd and n is also odd

Therefore n can be expressed as:

n = 2k+1 for some positive integer k

Now n3+5 = (2k+1)3+5 = 8k3+12k2+6k+1+5

=8k3+12k2+6k+6

=2(4k3+6k2+3k+3) which is even

This contradicts our assumption that n3+5 is even

Proofs By Counter Examples

To prove that the statements of the form x p(x) is false, we just need some value of x. So while proving
for falsity we just look for counter example.

Example: Prove or disprove the product of two irrational numbers is irrational

Example: Here we instantly try to get the product of irrational to try it. Let us take both the number for
product be √2 the √2. √2 = 2 (not rational). Hence by counter example it is shown that the product of two
irrational numbers is not necessarily irrational.

Trivial and Vacuous Proofs

In the implication p→q, we can show that the consequence q is true then regardless of the truth values of
p, the implication p→q is true. Such type of proof technique is called trivial proof.

In the implication p→q, if we can show that the hypothesis p is false, then regardless of truth values of q,
the implication p→q is true. Such kind of proof of an implication p→q is called vacuous proof.

Example: If x is an integer then 3 is an odd integer (Trivial).

If a black is while then pink is blue (Vacuous)

Existence Proofs

A proof of a proposition of the form x(p(x) is called an existence proof. There are different ways of
proving a theorem of this type. Sometime some element a is found to show p(a) to be true. This is called
constructive existence proof. In other method we do not provide a such that p(a) is true but prove that
x(p(x)) in different way, this is called non-constructive existence proof.

Example: Prove that there are 100 consecutive positive integers that are not perfect squares.

36
Solution: Let’s consider 2500 this is a perfect square of 50, and 2601 this is a perfect square of 51. In
between 2500 and 2601 there are 100 consecutive positive integers. Hence the proof.

Proof By Cases:

The implication of the form (p1 v p2 v p3….v pn)→q can be proved by using the tautology ((p1 v p2 v
p3….v pn)→q ↔[(p1→q) ^(p2→q)^(p3→q) ^………..^(pn→q)].

Example If |x|>3 then x2>9, where x is a real number.

Solution: Here we have to consider two cases –x>3 and x>3 since |x| represents an absolute value of x, we
have the following relations

x = x when x≥0 and

-x when x≤0

If –x>3 then x2>9

Similarly, ix x>3 then x2>9

Mistakes in Proofs

There are many common errors in constructing mathematical proofs. Among the most common errors are
mistakes in arithmetic and basic algebra. Even professional mathematicians make such errors, especially
when working with complicated formulae. Whenever you use such computations you should check them
carefully as possible.

Each step of mathematical proof needs to be correct and the conclusion needs to follow logically from the
steps that precede it. Many mistakes result from the introduction of steps that do not logically follow from
that precedes it.

Example: What is wrong with this famous supposed “proof” that 1=2?

Solution:

Proof: We use these steps, where a and b are two equal positive integers

S.N Step Reason


1 a=b Given
2 a2=ab Multiplying both sides by a
3 a2-b2 = ab-b2 Subtracting b2 from both side
4 (a-b)(a+b) = b(a-b) Factoring on both side
5 a+b = b Dividing both side by a-b
6 2b=b Replacing a by b
7 2=1 Dividing both side by b

37
Example 2: What is wrong with this proof?

Theorem: “ If n2 is positive then n is positive”

Proof: Suppose that n2 is positive. Because the conditional statement “ If n is positive then n 2 is positive
is true, we conclude that n is positive

Solution: Let P(n) be “ n is positive” and Q(n) be “n2 is positive”. Then our hypothesis is Q(n). The
statement “If n is positive then n2 is positive” is the statement n (P(n)→Q(n). From the hypothesis
Q(n) and the statement n (P(n)→Q(n)) we cannot conclude P(n), because we are not using a valid
rule of inference. Instead, this is an example of affirming the conclusion.

Assignment 3

1. Express the following statements using predicate and quantifier:


a. Every student in this class has studied discrete mathematics
b. Some student in this class are smart
c. All birds can fly
d. Some men are genius
e. Some numbers are not rational
f. There is a student who likes discrete mathematics but not data communication
g. There is a student at your college who can speak Japanese and who is good in C++
2. What rule of inference is used in each of these arguments:
a. If it rains today, the college will close. The college is not closed today. Therefore, it did
not rain today
b. Ram is volleyball player and Basketball player. Therefore Ram is volleyball player
c. Ashma is an excellent swimmer. If Ashma is an excellent swimmer then she can work as
a lifeguard. Therefore, Ashma can work as a lifeguard.
d. If I work all night on this homework, then I can answer all the exercises. If I answer all
the exercises, I will understand the material. Therefore, If I work all the night on this
homework then I will understand the material.
3. What rule of inferences is used in following: All men are mortal. Socrates is a man. Therefore,
Socrates is mortal.
4. Prove that square of an even number is also even
5. Prove that sum of two odd integers is even
6. Prove that the product of two odd integers is odd
7. Prove that the product of two rational number is rational;
8. Prove that if n is an integer and 3n+2 is even then n is even
9. Prove that if n is an integer then n3+5 is odd then n is even using indirect proof and proof by
contradiction
10. Prove that if n is an integer and 3n+2 is even then n is even using indirect proof and proof by
contradiction

38
11. Prove that the product of rational number is rational

List of C programs

Lab 3

Write a C program to print truth table of AND Operation


Ans
#include<stdio.h>
#include<conio.h>
int AND(int a,int b);
int main()
{
int a,b;
printf("A\tB\tA^B\n");
for(a=0;a<=1;a++)
{
for(b=0;b<=1;b++)
{
printf("%d\t%d\t%d\n",a,b,AND(a,b));
}
}
getch();
return 0;
}
int AND(int a,int b)
{
if(a==1&&b==1)
return 1;
else
return 0;
}
Output:
A B A^B
0 0 0
0 1 0
1 0 0
1 1 1
Write a C program to print truth table of OR Operation
Ans:
#include<stdio.h>
#include<conio.h>

39
int OR(int a,int b);
int main()
{
int a,b;
printf("A\tB\tA V B\n\n");
for(a=0;a<=1;a++)
{
for(b=0;b<=1;b++)
{
printf("%d\t%d\t%d\n\n",a,b,OR(a,b));
}
}
getch();
return 0;
}
int OR(int a,int b)
{
if(a==1||b==1)
return 1;
else
return 0;
}
Output:
A B AVB
0 0 0
0 1 1
1 0 1
1 1 1
Write a C program to print truth table of NOT Operation
Ans:
#include<stdio.h>
#include<conio.h>
int NOT(int a);
int main()
{
int a,b;
printf("A\t~A\n");
for(a=0;a<=1;a++)
{
printf("%d\t%d\n",a,NOT(a));
}
getch();
return 0;
}

40
int NOT(int a)
{
if(a==1)
return 0;
else
return 1;
}
Output:
A ¬A
0 1
1 0
Write a C program to print truth table of IMPLICATION Operation
Ans:
#include<stdio.h>
#include<conio.h>
int IMPLICATION(int a,int b);
int main()
{
int a,b;
printf("A\tB\tA-->B\n\n");
for(a=0;a<=1;a++)
{
for(b=0;b<=1;b++)
{
printf("%d\t%d\t%d\n\n",a,b,IMPLICATION(a,b));
}
}
getch();
return 0;
}
int IMPLICATION(int a,int b)
{
if(a==1&&b==0)
return 0;
else
return 1;
}
Output:
A B A-->B
0 0 1
0 1 1
1 0 0
1 1 1
Write a C program to print truth table of BIDIRECTIONAL Operation

41
Ans:
#include<stdio.h>
#include<conio.h>
int BIDIRECTIONAL(int a,int b);
int main()
{
int a,b;
printf("A\tB\tA<-->B\n\n");
for(a=0;a<=1;a++)
{
for(b=0;b<=1;b++)
{
printf("%d\t%d\t%d\n\n",a,b, BIDIRECTIONAL(a,b));
}
}
getch();
return 0;
}
int BIDIRECTIONAL(int a, int b)
{
if(a==1&&b==0)
return 0;
else if(b==1&&a==0)
return 0;
else
return 1;
}
Output:
A B A<-->B
0 0 1
0 1 0
1 0 0
1 1 1
Write a C program to find validity of arguments by using truth table
Ans: prove that (p-->q)^(q-->r) is equivalent to p-->r
Here we write a C program to prove that (p-->q)^(q-->r)-->(p-->r) is tautology
#include<conio.h>
#include<stdio.h>
int AND(int p,int q)
{
if(p==1&&q==1)
return 1;
else
return 0;

42
}
int OR(int p,int q)
{
if(p==1||q==1)
return 1;
else
return 0;
}
int IMPL(int p,int q)
{
if(p==1&&q==0)
return 0;
else
return 1;
}
int main()
{
int p,q,r;
printf("P\tQ\tR\t(P-->Q)^(Q-->R)-->(P --> R)\n");
for(p=0;p<=1;p++)
{
for(q=0;q<=1;q++)
{
for(r=0;r<=1;r++)
{
printf("%d\t%d\t%d\t\t%d\n\n",p,q,r,IMPL(AND(IMPL(p,q),IMPL(q,r)),IMPL(p,r)));
}
}
}
getch();
return 0;
}
Output:
P Q R (P-->Q)^(Q-->R)-->(P --> R)
0 0 0 1
0 0 1 1
0 1 0 1
0 1 1 1
1 0 0 1
1 0 1 1
1 1 0 1
1 1 1 1
Write a C program to print truth table for tautology and contradiction operations
Ans:

43
Tautology
#include<conio.h>
#include<stdio.h>
int AND(int p,int q)
{
if(p==1&&q==1)
return 1;
else
return 0;
}
int OR(int p,int q)
{
if(p==1||q==1)
return 1;
else
return 0;
}
int IMPLICATION(int p,int q)
{
if(p==1&&q==0)
return 0;
else
return 1;
}
int main()
{
int p,q;
printf("P\tQ\t(P^Q)-->(P V Q)\n");
for(p=0;p<=1;p++)
{
for(q=0;q<=1;q++)
{
printf("%d\t%d\t\t%d\n\n",p,q,IMPLICATION(AND(p,q),OR(p,q)));
}
}
getch();
return 0;
}
Output:
P Q (P^Q)-->(P V Q)
0 0 1
0 1 1
1 0 1
1 1 1

44
Contradiction
#include<conio.h>
#include<stdio.h>
int AND(int p,int q)
{
if(p==1&&q==1)
return 1;
else
return 0;
}
int OR(int p,int q)
{
if(p==1||q==1)
return 1;
else
return 0;
}
int IMPLICATION(int p,int q)
{
if(p==1&&q==0)
return 0;
else
return 1;
}
int NOT(int p)
{
if(p==1)
return 0;
else
return 1;
}
int main()
{
int p,q;
printf("P\tQ\t(P V Q) ^((~P)^~(Q))\n");
for(p=0;p<=1;p++)
{
for(q=0;q<=1;q++)
{
printf("%d\t%d\t\t%d\n\n",p,q,AND(OR(p,q),AND(NOT(p),NOT(q))));
}
}
getch();
return 0;

45
}
Output
P Q (P V Q) ^((~P)^~(Q))
0 0 0
0 1 0
1 0 0
1 1 0

46

You might also like