Unit 3 - Logic

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

Logic

Logic is a language for reasoning. It is a collection of rules we use when doing logical
reasoning. Human reasoning has been observed over centuries from at least the times of
Greeks, and patterns appearing in reasoning have been extracted, abstracted, and streamlined.
The foundation of the logic we are going to learn here was laid down by a British mathematician
George Boole in the middle of the 19th century, and it was further developed and used in an
attempt to derive all of mathematics by Gottlob Frege, a German mathematician, towards the
end of the 19th century. A British philosopher/mathematician, Bertrand Russell, found a flaw in
basic assumptions in Frege's attempt but he, together with Alfred Whitehead, developed Frege's
work further and repaired the damage. The logic we study today is more or less along this line.

In logic we are interested in true or false of statements, and how the truth/falsehood of a
statement can be determined from other statements. However, instead of dealing with individual
specific statements, we are going to use symbols to represent arbitrary statements so that the
results can be used in many similar but different cases. The formalization also promotes the
clarity of thought and eliminates mistakes.

There are various types of logic such as logic of sentences (propositional logic), logic of objects
(predicate logic), logic involving uncertainties, logic dealing with fuzziness, temporal logic etc.
Here we are going to be concerned with propositional logic and predicate logic, which are
fundamental to all types of logic.

Introduction to Propositional Logic

Propositional logic is a logic at the sentential level. The smallest unit we deal with in
propositional logic is a sentence. We do not go inside individual sentences and analyze or
discuss their meanings. We are going to be interested only in true or false of sentences, and
major concern is whether or not the truth or falsehood of a certain sentence follows from those
of a set of sentences, and if so, how. Thus sentences considered in this logic are not arbitrary
sentences but are the ones that are true or false. This kind of sentences are called propositions.

Proposition

Subjects to be Learned
proposition

Contents
Sentences considered in propositional logic are not arbitrary sentences but are the ones that
are either true or false, but not both. This kind of sentences are called propositions.
If a proposition is true, then we say it has a truth value of "true"; if a proposition is false, its truth
value is "false".

For example, "Grass is green", and "2 + 5 = 5" are propositions.


The first proposition has the truth value of "true" and the second "false".

But "Close the door", and "Is it hot outside ?" are not propositions.

Also "x is greater than 2", where x is a variable representing a number, is not a proposition,
because unless a specific value is given to x we can not say whether it is true or false, nor do
we know what x represents.

Similarly "x = x" is not a proposition because we don't know what "x" represents hence what "="
means. For example, while we understand what "3 = 3" means, what does "Air is equal to air" or
"Water is equal to water" mean? Does it mean a mass of air is equal to another mass or the
concept of air is equal to the concept of air? We don't quite know what "x = x" mean. Thus we
can not say whether it is true or not. Hence it is not a proposition.

Elements of Propositional Logic

Subjects to be Learned
elements used for constructing complex propositions

Contents
Simple sentences which are true or false are basic propositions. Larger and more complex
sentences are constructed from basic propositions by combining them with connectives. Thus
propositions and connectives are the basic elements of propositional logic. Though there are
many connectives, we are going to use the following five basic connectives here:

NOT, AND, OR, IF_THEN (or IMPLY), IF_AND_ONLY_IF.

They are also denoted by the symbols:


, , , , ,

respectively.

Truth Table

Subjects to be Learned
truth table
Contents
Often we want to discuss properties/relations common to all propositions. In such a case rather
than stating them for each individual proposition we use variables representing an arbitrary
proposition and state properties/relations in terms of those variables. Those variables are called
a propositional variable. Propositional variables are also considered a proposition and called a
proposition since they represent a proposition hence they behave the same way as
propositions. A proposition in general contains a number of variables. For example (P Q)
contains variables P and Q each of which represents an arbitrary proposition. Thus a
proposition takes different values depending on the values of the constituent variables. This
relationship of the value of a proposition and those of its constituent variables can be
represented by a table. It tabulates the value of a proposition for all possible values of its
variables and it is called a truth table.

For example the following table shows the relationship between the values of P, Q and P Q:

In the table, F represents truth value false and T true.


This table shows that P Q is false if P and Q are both false, and it is true in all the other
cases.

Meaning of the Connectives

Subjects to be Learned
meaning of connectives: NOT, AND, OR, IMPLIES, IF AND ONLY IF

Contents
Let us define the meaning of the five connectives by showing the relationship between the truth
value (i.e. true or false) of composite propositions and those of their component propositions.
They are going to be shown using truth table. In the tables P and Q represent arbitrary
propositions, and true and false are represented by T and F, respectively.
This table shows that if P is true, then ( P) is false, and that if P is false, then ( P) is true.

This table shows that (P Q) is true if both P and Q are true, and that it is false in any other
case.

Similarly for the rest of the tables.

When P Q is always true, we express that by P Q. That is P Q is used when


proposition P always implies proposition Q regardless of the value of the variables in them.

When P Q is always true, we express that by P Q. That is is used when two


propositions always take the same value regardless of the value of the variables in them.

Construction of Complex Propositions


Subjects to be Learned
how to construct complex propositions i.e. syntax of proposition

Contents
Syntax of propositions

First it is informally shown how complex propositions are constructed from simple ones. Then
more general way of constructing propositions is given.
In everyday life we often combine propositions to form more complex propositions without
paying much attention to them. For example combining "Grass is green", and "The sun is red"
we say something like "Grass is green and the sun is red", "If the sun is red, grass is green",
"The sun is red and the grass is not green" etc. Here "Grass is green", and "The sun is red" are
propositions, and form them using connectives "and", "if... then ..." and "not" a little more
complex propositions are formed. These new propositions can in turn be combined with other
propositions to construct more complex propositions. They then can be combined to form even
more complex propositions. This process of obtaining more and more complex propositions can
be described more generally as follows:

Let X and Y represent arbitrary propositions. Then

[ X], [X Y], [X Y], [X Y], and [X Y]

are propositions.

Note that X and Y here represent an arbitrary proposition.

This is actually a part of more rigorous definition of proposition.

Example : [ P -> [Q V R] ] is a proposition and it is obtained by first constructing [Q V R] by


applying [X V Y] to propositions Q and R considering them as X and Y, respectively, then by
applying [ X -> Y ] to the two propositions P and [Q V R] considering them as X and Y,
respectively.

Note: Rigorously speaking X and Y above are place holders for propositions, and so they are
not exactly a proposition. They are called a propositional variable, and propositions formed from
them using connectives are called a propositional form. However, we are not going to
distinguish them here, and both specific propositions such as "2 is greater than 1" and
propositional forms such as (P Q) are going to be called a proposition.

Converse and Contrapositive

Subjects to be Learned
converse of proposition
contrapositive of proposition

Contents
For the proposition P Q, the proposition Q P is called its converse, and the proposition
Q P is called its contrapositive.

For example for the proposition "If it rains, then I get wet",

Converse: If I get wet, then it rains.


Contrapositive: If I don't get wet, then it does not rain.

The converse of a proposition is not necessarily logically equivalent to it, that is they may or
may not take the same truth value at the same time.

On the other hand, the contrapositive of a proposition is always logically equivalent to the
proposition. That is, they take the same truth value regardless of the values of their constituent
variables. Therefore, "If it rains, then I get wet." and "If I don't get wet, then it does not rain."
are logically equivalent. If one is true then the other is also true, and vice versa.

Activity 1 Unit 3
1. Which of the following sentences are propositions? What are the truth values of those that
are propositions?

a. Manila is the capital of the Philippines.


b. 2 + 4 = 7.
c. Close the door.
d. 5 + 8 < 10.
e. The moon is a satelite of the earth.
f. x + 5 = 7.
g. x + 5 > 9 for every real number x.

2. What is the negation of each of the following propositions?

a. Beijing is the capital of China.


b. Food is not expensive in the United States.
c. 3 + 5 = 7.
d. The summer in Africa is hot and sunny.

3. Let p and q be the propositions

p: Your car is out of gas.

q: You can't drive your car.

Write the following propositions using p and q and logical connectives.

a) Your car is not out of gas.

b) You can't drive your car if it is out of gas.

c) Your car is not out of gas if you can drive it.

d) If you can't drive your car then it is out of gas.


4. Determine whether each of the following implications is true or false.

a) If 0.5 is an integer, then 1 + 0.5 = 3.

b) If cars can fly, then 1 + 1 = 3.

c) If 5 > 2 then pigs can fly.

d) If 3*5 = 15 then 1 + 2 = 3.

5. State the converse and contrapositive of each of the following implications.

a. If it snows today, I will stay home.


b. We play the game if it is sunny.
c. If a positive integer is a prime then it has no divisors other than 1 and itself.

6. Construct a truth table for each of the following compound propositions.

a) p p

b) (p q) q

c) (p q) ( q p)

If_Then Variations

Subjects to be Learned
different ways of saying if_then: only if, necessary, sufficient

Contents
If-then statements appear in various forms in practice. The following list presents some of the
variations. These are all logically equivalent, that is as far as true or false of statement is
concerned there is no difference between them. Thus if one is true then all the others are also
true, and if one is false all the others are false.

● If p, then q.
● p implies q.
● If p, q.
● p only if q.
● p is sufficient for q.
● q if p.
● q whenever p.
● q is necessary for p.
● It is necessary for p that q.
For instance, instead of saying "If she smiles then she is happy", we can say "If she smiles, she
is happy", "She is happy whenever she smiles", "She smiles only if she is happy" etc. without
changing their truth values.

"Only if" can be translated as "then". For example, "She smiles only if she is happy" is
equivalent to "If she smiles, then she is happy".
Note that "She smiles only if she is happy" means "If she is not happy, she does not smile",
which is the contrapositive of "If she smiles, she is happy".
You can also look at it this way: "She smiles only if she is happy" means "She smiles only when
she is happy". So any time you see her smile you know she is happy. Hence "If she smiles, then
she is happy". Thus they are logically equivalent.

Also "If she smiles, she is happy" is equivalent to "It is necessary for her to smile that
she is happy". For "If she smiles, she is happy" means "If she smiles, she is always happy".
That is, she never fails to be happy when she smiles. "Being happy" is inevitable
consequence/necessity of "smile". Thus if "being happy" is missing, then "smile" can not be
there either. "Being happy" is necessary "for her to smile" or equivalently "It is necessary for her
to smile that she is happy".

From English to Proposition

Subjects to be Learned
translation of English sentences to propositions

Contents
As we are going to see in the next section, reasoning is done on propositions using inference
rules. For example, if the two propositions "if it snows, then the school is closed", and "it snows"
are true, then we can conclude that "the school is closed" is true. In everyday life, that is how we
reason.

To check the correctness of reasoning, we must check whether or not rules of inference have
been followed to draw the conclusion from the premises. However, for reasoning in English or in
general for reasoning in a natural language, that is not necessarily straightforward and it often
encounters some difficulties. Firstly, connectives are not necessarily easily identified as we can
get a flavor of that from the previous topic on variations of if_then statements. Secondly, if the
argument becomes complicated involving many statements in a number of different forms
twisted and tangled up, it can easily get out of hand unless it is simplified in some way.

One solution for that is to use symbols (and mechanize it). Each sentence is represented by
symbols representing building block sentences, and connectives. For example, if P represents
"it snows" and Q represents "the school is closed", then the previous argument can be
expressed as
[ [ P -> Q ] ^ P ] -> Q ,

or

P -> Q
P
-----------------------------
Q

This representation is concise, much simpler and much easier to deal with. In addition today
there are a number of automatic reasoning systems and we can verify our arguments in
symbolic form using them. One such system called TPS is used for reasoning exercises in this
course. For example, we can check the correctness of our argument using it.

To convert English statements into a symbolic form, we restate the given statements
using the building block sentences, those for which symbols are given, and the
connectives of propositional logic (not, and, or, if_then, if_and_only_if), and then
substitute the symbols for the building blocks and the connectives.

For example, let P be the proposition "It is snowing", Q be the proposition "I will go the beach",
and R be the proposition "I have time".

Then first "I will go to the beach if it is not snowing" is restated as "If it is not snowing, I will go to
the beach". Then symbols P and Q are substituted for the respective sentences to obtain ~P ->
Q.

Similarly, "It is not snowing and I have time only if I will go to the beach" is restated as "If it is not
snowing and I have time, then I will go to the beach", and it is translated as ( ~P ^ R ) -> Q.

Activity 2 Unit 3
1. Write each of the following statements in the form "if p, then q" in English. (Hint: Refer to the
list of common ways to express implications listed in this section.)

a. The newspaper will not come if there is an inch of snow on the street.
b. It snows whenever the wind blows from the northeast.
c. That prices go up implies that supply will be plentiful.
d. It is necessary to read the textbook to understand the materials of this course.
e. For a number to be divisible by 3, it is sufficient that it is the sum of three consecutive
integers.
f. Your guarantee is good only if you bought your TV less than 90 days ago.
2. Write each of the following propositions in the form "p if and only if q" in English.

a. If it is hot outside you drink a lot of water, and if you drink a lot of water it is hot outside.
b. For a program to be readable it is necessary and sufficient that it is well structured.
c. I like fruits only if they are fresh, and fruits are fresh only if I like them.
d. If you eat too much sweets your teeth will decay, and conversely.
e. The store is closed on exactly those days when I want to shop there.

Introduction to Reasoning

Subjects to be Learned
tautology
contradiction
contingency

Contents
Introduction to Reasoning

Logical reasoning is the process of drawing conclusions from premises using rules of
inference. Here we are going to study reasoning with propositions. Later we are going to see
reasoning with predicate logic, which allows us to reason about individual objects. However,
inference rules of propositional logic are also applicable to predicate logic and reasoning
with propositions is fundamental to reasoning with predicate logic.
These inference rules are results of observations of human reasoning over centuries. Though
there is nothing absolute about them, they have contributed significantly in the scientific and
engineering progress the mankind have made. Today they are universally accepted as the rules
of logical reasoning and they should be followed in our reasoning.

Since inference rules are based on identities and implications, we are going to study them first.
We start with three types of proposition which are used to define the meaning of "identity" and
"implication".

Types of Proposition

Some propositions are always true regardless of the truth value of its component propositions.

For example (P P) is always true regardless of the value of the proposition P.

A proposition that is always true called a tautology.

There are also propositions that are always false such as (P P).

Such a proposition is called a contradiction.


A proposition that is neither a tautology nor a contradiction is called a contingency.

For example (P Q) is a contingency.

These types of propositions play a crucial role in reasoning. In particular every inference rule
is a tautology.

Identities
Subjects to be Learned
Identities(tautologies) of propositional logic
Dual of proposition

Contents

From the definitions(meaning) of connectives, a number of relations between propositions which


are useful in reasoning can be derived. Below some of the often encountered pairs of logically
equivalent propositions, also called identities, are listed.

These identities are used in logical reasoning. In fact we use them in our daily life, often more
than one at a time, without realizing it.

If two propositions are logically equivalent, one can be substituted for the other in any
proposition in which they occur without changing the logical value of the proposition.

Below corresponds to and it means that the equivalence is always true (a tautology),
while means the equivalence may be false in some cases, that is in general a contingency.

That these equivalences hold can be verified by constructing truth tables for them. Click here for
more detailed discussions about it.

First the identities are listed, then examples are given to illustrate them.

List of Identities:

1. P (P P) ----- idempotence of
2. P (P P) ----- idempotence of
3. (P Q) (Q P) ----- commutativity of
4. (P Q) (Q P) ----- commutativity of
5. [(P Q) R] [P (Q R)] ----- associativity of
6. [(P Q) R] [P (Q R)] ----- associativity of
7. (P Q) ( P Q) ----- DeMorgan's Law
8. (P Q) ( P Q) ----- DeMorgan's Law
9. [P (Q R] [(P Q) (P R)] ----- distributivity of over
10. [P (Q R] [(P Q) (P R)] ----- distributivity of over
11. (P True) True
12. (P False) False
13. (P False) P
14. (P True) P
15. (P P) True
16. (P P) False
17. P ( P) ----- double negation
18. (P Q) ( P Q) ----- implication
19. (P Q) [(P Q) (Q P)]----- equivalence
20. [(P Q) R] [P (Q R)] ----- exportation
21. [(P Q) (P Q)] P ----- absurdity
22. (P Q) ( Q P) ----- contrapositive

Let us see some example statements in English that illustrate these identities.

Examples:

1. P (P P) ----- idempotence of

What this says is, for example, that "Tom is happy." is equivalent to "Tom is happy or Tom is
happy". This and the next identity are rarely used, if ever, in everyday life. However, these are
useful when manipulating propositions in reasoning in symbolic form.

2. P (P P) ----- idempotence of

Similar to 1. above.

3. (P Q) (Q P) ----- commutativity of

What this says is, for example, that "Tom is rich or (Tom is) famous." is equivalent to "Tom is
famous or (Tom is) rich".

4. (P Q) (Q P) ----- commutativity of

What this says is, for example, that "Tom is rich and (Tom is) famous." is equivalent to "Tom is
famous and (Tom is) rich".

5. [(P Q) R] [P (Q R)] ----- associativity of

What this says is, for example, that "Tom is rich or (Tom is) famous, or he is also happy." is
equivalent to "Tom is rich, or he is also famous or (he is) happy".

6. [(P Q) R] [P (Q R)] ----- associativity of

Similar to 5. above.
7. (P Q) ( P Q) ----- DeMorgan's Law

For example, "It is not the case that Tom is rich or famous." is true if and only if "Tom is not rich
and he is not famous."

8. (P Q) ( P Q) ----- DeMorgan's Law

For example, "It is not the case that Tom is rich and famous." is true if and only if "Tom is not
rich or he is not famous."

9. [P (Q R] [(P Q) (P R)] ----- distributivity of over

What this says is, for example, that "Tom is rich, and he is famous or (he is) happy." is
equivalent to "Tom is rich and (he is) famous, or Tom is rich and (he is) happy".

10. [P (Q R] [(P Q) (P R)] ----- distributivity of over

Similarly to 9. above, what this says is, for example, that "Tom is rich, or he is famous and (he
is) happy." is equivalent to "Tom is rich or (he is) famous, and Tom is rich or (he is) happy".

11. (P True) True. Here True is a proposition that is always true. Thus the proposition (P
True) is always true regardless of what P is.

This and the next three identities, like identities 1 and 2, are rarely used, if ever, in everyday life.
However, these are useful when manipulating propositions in reasoning in symbolic form.

12. (P False) False

13. (P False) P

14. (P True) P

15. (P P) True

What this says is that a statement such as "Tom is 6 foot tall or he is not 6 foot tall." is always
true.

16. (P P) False

What this says is that a statement such as "Tom is 6 foot tall and he is not 6 foot tall." is always
false.

17. P ( P) ----- double negation

What this says is, for example, that "It is not the case that Tom is not 6 foot tall." is equivalent to
"Tom is 6 foot tall."
18. (P Q) ( P Q) ----- implication

For example, the statement "If I win the lottery, I will give you a million dollars." is not true, that
is, I am lying, if I win the lottery and don't give you a million dollars. It is true in all the other
cases. Similarly, the statement "I don't win the lottery or I give you a million dollars." is false, if I
win the lottery and don't give you a million dollars. It is true in all the other cases. Thus these
two statements are logically equivalent.

19. (P Q) [(P Q) (Q P)]----- equivalence

What this says is, for example, that "Tom is happy if and only if he is healthy." is logically
equivalent to ""if Tom is happy then he is healthy, and if Tom is healthy he is happy."

20. [(P Q) R] [P (Q R)] ----- exportation

For example, "If Tom is healthy, then if he is rich, then he is happy." is logically equivalent to "If
Tom is healthy and rich, then he is happy."

21. [(P Q) (P Q)] P ----- absurdity

For example, if "If Tom is guilty then he must have been in that room." and "If Tom is guilty then
he could not have been in that room." are both true, then there must be something wrong about
the assumption that Tom is guilty.

22. (P Q) ( Q P) ----- contrapositive

For example, "If Tom is healthy, then he is happy." is logically equivalent to "If Tom is not happy,
he is not healthy."

The identities 1 ~ 16 listed above can be paired by duality relation, which is defined below, as 1
and 2, 3 and 4, ..., 15 and 16. That is 1 and 2 are dual to each other, 3 and 4 are dual to each
other, .... Thus if you know one of a pair, you can obtain the other of the pair by using the duality.

Dual of Proposition

Let X be a proposition involving only , , and as a connective. Let X* be the proposition


obtained from X by replacing with , with , T with F, and F with T. Then X* is called the
dual of X.

For example, the dual of [P Q] P is [P Q] P, and the dual of [ P Q] [T


R] is [ P Q] [F R] .

Property of Dual: If two propositions P and Q involving only , , and as connectives are
equivalent, then their duals P* and Q* are also equivalent.
Examples of Use of Identities
Here a few examples are presented to show how the identities in Identities can be used to prove
some useful results.

1. (P Q) (P Q)

What this means is that the negation of "if P then Q" is "P but not Q". For example, if you said
to someone "If I win a lottery, I will give you $100,000." and later that person says "You lied to
me." Then what that person means is that you won the lottery but you did not give that person
$100,000 you promised.

To prove this, first let us get rid of using one of the identities: ( P Q) ( P Q ).

That is, (P Q) ( P Q ).

Then by De Morgan, it is equivalent to P Q , which is equivalent to P Q, since


the double negation of a proposition is equivalent to the original proposition as seen in the
identities.

2. P (P Q) P --- Absorption

What this tells us is that P (P Q ) can be simplified to P, or if necessary P can be


expanded into P (P Q).

To prove this, first note that P (P T ).

Hence

P (P Q)

(P T) (P Q)

P (T Q ) , by the distributive law.

(P T ) , since ( T Q) T.

P, since ( P T) P.

Note that by the duality

P (P Q) P also holds.

More examples of use of identities can be found in the Proof of Implications.


Activity 3 Unit 3
1. Use truth table to verify the following equivalences.

a) p F F

b) p T T

c) p p p

2. Use truth tables to verify the distributive law p (q r) (p q) (p r).

3. Show that each of the following implications is a tautology without using truth tables.

a) p (p q)

b) (p q) (p q)

c) (p q) q

4. Verify the following equivalences, which are known as the absorption laws.

a) [ p (p q) ] p

b) [ p (p q) ] p

5. Find the dual of each of the following propostions.

a. p q r
b. (p q r) s
c. (p F) (q T)

6. Find a compound proposition involving the propositions p,q, and r that is true when exactly
one of p, q, and r is true and is false otherwise. (Hint: Form a disjunction of conjunctions.
Include a conjunction for each combination of values for which the propostion istrue. Each
conjunction should include each of the three propositions or theirnegations.)

Implications
Subjects to be Learned
implications (tautologies) of propositional logic

Contents
The following implications are some of the relationships between propositions that can be
derived from the definitions(meaning) of connectives.
below corresponds to and it means that the implication always holds. That is it is a
tautology.

These implications are used in logical reasoning. When the right hand side of these implications
is substituted for the left hand side appearing in a proposition, the resulting proposition is
implied by the original proposition, that is, one can deduce the new proposition from the original
one.

First the implications are listed, then examples to illustrate them are given.

List of Implications:

1. P (P Q) ----- addition
2. (P Q) P ----- simplification
3. [P (P Q] Q ----- modus ponens
4. [(P Q) Q] P ----- modus tollens
5. [ P (P Q] Q ----- disjunctive syllogism
6. [(P Q) (Q R)] (P R) ----- hypothetical syllogism
7. (P Q) [(Q R) (P R)]
8. [(P Q) (R S)] [(P R) (Q S)]
9. [(P Q) (Q R)] (P R)

Examples:

1. P (P Q) ----- addition
For example, if the sun is shining, then certainly the sun is shining or it is snowing. Thus "if the

sun is shining, then the sun is shining or it is snowing." "If 0 < 1, then 0 1 or a similar
statement is also often seen.

2. (P Q) P ----- simplification
For example, if it is freezing and (it is) snowing, then certainly it is freezing. Thus "If it is freezing
and (it is) snowing, then it is freezing."

3. [P (P Q] Q ----- modus ponens


For example, if the statement "If it snows, the schools are closed" is true and it actually snows,
then the schools are closed.
This implication is the basis of all reasoning. Theoretically, this is all that is necessary for
reasoning. But reasoning using only this becomes very tedious.

4. [(P Q) Q] P ----- modus tollens


For example, if the statement "If it snows, the schools are closed" is true and the schools are not
closed, then one can conclude that it is not snowing.
Note that this can also be looked at as the application of the contrapositive and modus ponens.
That is, (P Q) is equivalent to ( Q) ( P ). Thus if in addition Q holds, then by the
modus ponens, P is concluded.

5. [ P (P Q] Q ----- disjunctive syllogism


For example, if the statement "It snows or (it) rains." is true and it does not snow, then one can
conclude that it rains.

6. [(P Q) (Q R)] (P R) ----- hypothetical syllogism


For example, if the statements "If the streets are slippery, the school buses can not be
operated." and "If the school buses can not be operated, the schools are closed." are true, then
the statement "If the streets are slippery, the schools are closed." is also true.

7. (P Q) [(Q R) (P R)]
This is actually the hypothetical syllogism in another form. For by considering (P Q) as a
proposition S, (Q R) as a proposition T, and (P R) as a proposition U in the hypothetical
syllogism above, and then by applying the "exportation" from the identities, this is obtained.

8. [(P Q) (R S)] [(P R) (Q S)]


For example, if the statements "If the wind blows hard, the beach erodes." and "If it rains
heavily, the streets get flooded." are true, then the statement "If the wind blows hard and it rains
heavily, then the beach erodes and the streets get flooded." is also true.

9. [(P Q) (Q R)] (P R)
This just says that the logical equivalence is transitive, that is, if P and Q are equivalent, and if Q
and R are also equivalent, then P and R are equivalent.

Reasoning with Propositions

Logical reasoning is the process of drawing conclusions from premises using rules of inference.
The basic inference rule is modus ponens. It states that if both P Q and P hold, then Q can
be concluded, and it is written as
P
P Q
-----
Q

Here the lines above the dotted line are premises and the line below it is the conclusion drawn
from the premises.

For example if "if it rains, then the game is not played" and "it rains" are both true, then we can
conclude that the game is not played.

In addition to modus ponens, one can also reason by using identities and implications.

If the left(right) hand side of an identity appearing in a proposition is replaced by the right(left)
hand side of the identity, then the resulting proposition is logically equivalent to the original
proposition. Thus the new proposition is deduced from the original proposition. For example in
the proposition P (Q R), (Q R) can be replaced with ( Q R) to conclude P ( Q
R), since (Q R) ( Q R)
Similarly if the left(right) hand side of an implication appearing in a proposition is replaced by the
right(left) hand side of the implication, then the resulting proposition is logically implied by the
original proposition. Thus the new proposition is deduced from the original proposition.

The tautologies listed as "implications" can also be considered inference rules as shown below.

Rules of Inference Tautological Form Name

P P (P Q) addition
-------
P Q

P Q (P Q) P simplification
-----
P

P [P (P Q)] Q modus ponens


P Q
-----
Q

Q [ Q (P Q)] P modus tollens


P Q
-----
P

P Q [(P Q) P] Q disjunctive syllogism


P
-----
Q

P Q [(P Q) (Q R)] [P R] hypothetical syllogism


Q R
-------
P R

P conjunction
Q
-------
P Q
(P Q) (R S) [(P Q) (R S) (P R)] [Q S] constructive dilemma
P R
-------
Q S

(P Q) (R S) [(P Q) (R S) ( Q S)] [ destructive dilemma


Q S P R]
----------
P R

Example of Inferencing
Consider the following argument:

1. Today is Tuesday or Wednesday.

2. But it can't be Wednesday, since the doctor's office is open today, and that office is always
closed on Wednesdays.

3. Therefore today must be Tuesday.

This sequence of reasoning (inferencing) can be represented as a series of application of


modus ponens to the corresponding propositions as follows.

The modus ponens is an inference rule which deduces Q from P -> Q and P.

T: Today is Tuesday.

W: Today is Wednesday.

D: The doctor's office is open today.

C: The doctor's office is always closed on Wednesdays.

The above reasoning can be represented by propositions as follows.

1. T V W

2. D
C
------------
~W
------------

3. T
To see if this conclusion T is correct, let us first find the relationship among C, D, and W:
C can be expressed using D and W. That is, restate C first as the doctor's office is always
closed if it is Wednesday. Then C <-> (W -> ~D) Thus substituting (W -> ~D) for C, we can
proceed as follows.

D
W -> ~D
------------
~W

which is correct by modus tollens.

From this ~W combined with T V W of 1. above,

~W
TVW
------------
T

which is correct by disjunctive syllogism.


Thus we can conclude that the given argument is correct.

To save space we also write this process as follows eliminating one of the ~W's:

D
W -> ~D
------------
~W
TVW
------------
T

Proof of Identities

Subjects to be Learned
Proving identities using truth table

Contents
All the identities in Identities can be proven to hold using truth tables as follows. In general two
propositions are logically equivalent if they take the same value for each set of values of their
variables. Thus to see whether or not two propositions are equivalent, we construct truth tables
for them and compare to see whether or not they take the same value for each set of values of
their variables.

For example consider the commutativity of :


(P Q) (Q P).

To prove that this equivalence holds, let us construct a truth table for each of the proposition (P
Q) and (Q P).
A truth table for (P Q) is, by the definition of ,

P Q (P Q)

F F F

F T T

T F T

T T T

A truth table for (Q P) is, by the definition of ,

P Q (Q P)

F F F

F T T

T F T

T T T

As we can see from these tables (P Q) and (Q P) take the same value for the same set of
value of P and Q. Thus they are (logically) equivalent.

We can also put these two tables into one as follows:

P Q (P Q) (Q P)

F F F F

F T T T

T F T T

T T T T
Using this convention for truth table we can show that the first of De Morgan's Laws also holds.

P Q (P Q) P
Q

F F T T

F T F F

T F F F

T T F F

By comparing the two right columns we can see that (P Q) and P Q are
equivalent.

Proof of Implications
Subjects to be Learned
Proving implications using truth table
Proving implications using tautologies

Contents
1. All the implications in Implications can be proven to hold by constructing truth tables and
showing that they are always true.

For example consider the first implication "addition": P (P Q).

To prove that this implication holds, let us first construct a truth table for the proposition P Q.

P Q (P
Q)

F F F

F T T

T F T

T T T
Then by the definition of , we can add a column for P (P Q) to obtain the following
truth table.

P Q (P P (P
Q) Q)

F F F T

F T T T

T F T T

T T T T

The first row in the rightmost column results since P is false, and the others in that column
follow since (P Q) is true.
The rightmost column shows that P (P Q) is always true.

2. Some of the implications can also be proven by using identities and implications that have
already been proven.

For example suppose that the identity "exportation":

[(X Y) Z] [X (Y Z)] ,

and the implication "hypothetical syllogism":

[(P Q) (Q R)] (P R)

have been proven. Then the implication No. 7:

(P Q) [(Q R) (P R)]

can be proven by applying the "exportation" to the "hypothetical syllogism" as follows:

Consider (P Q) , (Q R) , and (P R) in the "hypothetical syllogism" as X, Y and


Z of the "exportation", respectively.

Then since [ (X Y) Z] [X (Y Z ) ] implies [ ( X Y) Z] [X (


Y Z ) ] , the implication of No. 7 follows.

Similarly the modus ponens (implication No. 3) can be proven as follows:

Noting that ( P Q) ( P Q),

P (P Q)

P ( P Q)

(P P) (P Q) --- by the distributive law

F (P Q)

(P Q)

Q
Also the exportation (identity No. 20), ( P (Q R)) (P Q) R ) can be
proven using identities as follows:

(P (Q R)) P (Q R)

P ( Q R)

( P Q) R

(P Q) R

(P Q) R

3. Some of them can be proven by noting that a proposition in an implication can be replaced by
an equivalent proposition without affecting its value.

For example by substituting ( Q P ) for ( P Q ) , since they are equivalent being


contrapositive to each other, modus tollens (the implication No. 4): [ ( P Q) Q]
P , reduces to the modus ponens: [ X (X Y)] Y. Hence if the modus ponens and
the "contrapositive" in the "Identities" have been proven, then the modus tollens follows from
them.

Activity 4 Unit 3
1. What rule of inference is used in each of the following arguments?

a. Ricky likes mango pies. Therefore, Ricky likes mango pies or icecream.
b. Mary likes chocolate and icecream. Therefore, Mary likes chocolate.
c. If it snows, then the roads are closed; it snows . Therefore, the roads are closed.
d. If it snows, then the roads are closed; the roads are not closed. Therefore, it does not
snow.
e. To go to Tahiti, one must fly or take a boat; there is no seat on any flight to Tahiti this
year. Therefore, one must take a boat to go to Tahiti this year.

2. Express the following arguments using the symbols indicated. What rules of inference are
used in each of them?

a. If the teens like it, then the sales volume will go up; Either the teens like it or the store
will close; The sales volume will not go up. Therefore, the store will close.
Symbols to be used: The teens like it (T). The sales volume will go up (S). The store will
close (C).
b. It is not the case that if there is not a lot of sun, then there is enough water, nor is it true
that either there is a lot of rain or the crop is good. Therefore, there is not enough water
and the crop is not good.
Symbols to be used: There is not a lot of sun (S). There is enough water (W). There is a
lot of rain (R). The crop is good (C).
c. If flowers are colored, they are always scented; I don't like flowers that are not grown in
the open air; All flowers grown in the open air are colored . Therefore, I don't like any
flowers that are scentless.
Symbols to be used: Flowers are colored (C). Flowers are scented (S). I like flowers (L).
Flowers are grown in the open air (O).
d. No animals, except giraffes, are 15 feet or higher; There are no animals in this zoo that
belong to anyone but me; I have no animals less than 15 feet high. Therefore, all
animals in this zoo are giraffes.
Symbols to be used: Animals are giraffes (G). Animals are 15 feet or higher (F). Animals
are in the zoo (Z). Animals belong to me (M).
e. Bees like red flowers, or my hat is red and bees like hats; However, my hat is not red,
or bees don't like hats but they like red flowers. Therefore bees like red flowers.
Symbols to be used: Bees like red flowers (R). My hat is red (H). Bees like hats (L).

You might also like