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
What Is Proposition?
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
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
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:
| OR |
| P | Q | (P ⋁Q) |
| F | F | F |
| F | T | T |
| T | F | T |
| T | T | T |
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
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.
| AND |
| P | Q | (P ⋀Q) |
| F | F | F |
| F | T | F |
| T | F | F |
| T | T | T |
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.
| OR |
| P |
Q |
(P ⋁Q) |
| F |
F |
F |
| F |
T |
T |
| T |
F |
T |
| T |
T |
T |
| IMPLIES |
| P | Q | (P→Q) |
| F | F | T |
| F | T | T |
| T | F | F |
| T | T | T |
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.
| IF AND ONLY IF |
| P | Q | ( P ↔Q ) |
| F | F | T |
| F | T | F |
| T | F | F |
| T | T | T |
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
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 which we see later.
Example : [ P → [Q ⋁ R] ] is a proposition and it is obtained by first constructing [Q ⋁ R] by applying [X ⋁ 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 ⋁ 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
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.
From English to Proposition
If_Then Variations
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
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.
Reasoning with Propositions
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".
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 as we see in identities and implications.
Identities
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.
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 section 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.
Implications
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 ⋁Q |
P ⇒(P ⋁Q) |
addition |
| P ⋀Q -----------------P |
(P ⋀Q) ⇒P |
simplification |
| P P→Q -----------------Q |
[P ⋀(P→Q)] ⇒Q |
modus ponens |
| ¬Q P→Q -----------------¬P |
[¬Q ⋀(P→Q)] ⇒¬P |
modus tollens |
| P ⋁Q ¬P -----------------Q |
[(P ⋁Q) ⋀¬P] ⇒Q |
disjunctive syllogism |
| P →Q Q→R -----------------P →R |
[(P →Q) ⋀(Q →R)] ⇒[P→R] |
hypothetical syllogism |
| P Q -----------------P ⋀Q |
|
conjunction |
| (P→Q) ⋀(R→S) P ⋁R -----------------Q ⋁S |
[(P→Q) ⋀(R→S) ⋀(P ⋁R)] ⇒[Q ⋁S] |
constructive dilemma |
| (P→Q) ⋀(R→S) ¬Q ⋁¬S -----------------¬P ⋁¬R |
[(P→Q) ⋀(R→S) ⋀( ¬Q ⋁¬S)] ⇒[ ¬P ⋁¬R] |
destructive dilemma |
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 ⋁ 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
T ⋁ W
------------
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
T ⋁ W
------------
T
Proof of Identities
All the identities in Section 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
1. All the implications in Section 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 ⋁ Q) | P →(P ⋁ 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.
Questions and Exercises
1. Which of the following sentences is a proposition?
a. Every one is happy.
b. If it snows, then schools are closed in Norfolk, VA.
c. x + 2 is positive
d. Take an umbrella with you.
e. I suggest that you take an umbrella with you
2. Which of the following tables is a truth table?
Z below represents a proposition involving P and Q.
| Table 1 |
| P |
Q |
Proposition Z |
| F |
F |
F |
| T |
F |
T |
| T |
T |
T |
| T |
F |
T |
| Table 2 |
| P |
Q |
Proposition Z |
| F |
F |
F |
| T |
F |
T |
| T |
T |
F |
| Table 3 |
| P |
Q |
Proposition Z |
| F |
F |
F |
| F |
T |
T |
| T |
F |
T |
| T |
T |
T |
| Table 4 |
| P |
Proposition Z |
| F |
F |
| F |
T |
| T |
F |
3. Indicate which of the following statements are correct and which ones are incorrect.
a. If P is True and Q is False, then P⋀Q is True.
b. If P is False and Q is True, then P → Q is True.
c. If P is False and Q is False, then P ↔ Q is False
d. If P is True and Q is False, then P ⋁ Q is True.
e. If P is True and Q is False, then ¬[P⋀Q] is False
4. Indicate which of the following expressions are propositions and which are not.
a. P⋀¬Q.
b. [[P ⋁ Q] → [Q ⋀ R]]
c. [¬[P ↔ ⋀ Q ] ⋁ Q ]
d. [¬¬P ⋁ Q]
e. [[Q ⋁ R][P ⋀ Q]]
5. Indicate which of the following converses and contrapositives are correct and which are not.
a. If it snows, the schools will be closed.
Converse: If the schools are closed, it snows.
Contrapositive: If the schools are not closed, it does not snow.
b. If I work all night, I can finish this project.
Converse: If I cannot finish this project, I work all night.
Contrapositive: If I can finish this project, I don’t work all night.
c. I eat spicy food, only if it upsets my stomach.
Converse: If I eat spicy food, it upsets my stomach.
Contrapositive: If I don’t eat spicy food, it doesn’t upset my stomach.
6. Which of the following pairs of propositions are logically equivalent?
a. (1) You get promoted only if you have worked hard.
(2) If you have worked hard, you get promoted
b. (1) To get promoted you must work hard.
(2) If you work hard, then you get promoted
c. (1) Whenever there is a noreaster, the beach erodes
(2) If there is a noreaster, the beach erodes.
d. (1) I will stay home, if it snows tonight.
(2) If it snows tonight, I stay home.
7. Indicate which of the following sentences are translated correctly.
Let S represent “It is snowing”, F represent “It is below freezing” and G represent “I go outside”.
a. “If it is snowing or below freezing, then I don’t go outside.”
translates to (S ⋁ F) → ¬G
b. “I go outside only if it is neither snowing nor below freezing.”
translates to (¬S ⋀ ¬F) → G
c. “Whenever I go outside, it is snowing.”
translates to S → G
d. “It is either snowing or below freezing.”
translates to S ⋁ F
8. For each of the following propositions, indicate what they are (Tautology, Contingency or Contraction).
a. P → P
b. ¬P → P
c. [[P → Q] ⋀ P] ⋀ ¬Q
d. [P ⋁ [P⋀ Q] → P
e. [P ⋀ [P⋁ Q] ↔ ¬P
10. Indicate which of the following statements are correct and which are not.
a. [R ⋀ ¬S] ↔ [¬S ⋀ R]
b. ¬[P ⋁ [Q ⋀ R]] ↔ [¬P ⋀ ¬[Q ⋀ R]]
c. [[P ⋀ S] ⋁ R] ↔ [[P ⋀ R] ⋁ S]
d. [¬¬P ⋁ Q] ↔ [P → Q]
e. [[Q ⋁ R] ⋀ ¬[R ⋀ Q]] ↔ [Q ⋁ R]
11. Indicate which of the following statements are correct and which are not. If it is correct, what implications are used?
a. If it snows, the schools will be closed. It is snowing.
Therefore, the school is closed.
b. Tom is healthy and (Tom is) happy.
Therefore, Tom is happy
c. John will work at a software company this summer.
Therefore, this summer John will work at a software company and a grocery store.
d. If I work all night, I can finish this project.
But I did not work all night. Therefore, I did not finish the project.
e. If I eat spicy food, it upsets my stomach. If my stomach is upset, I get a bad a dream.
Therefore, if I eat spicy food, I get a bad dream.
12. Indicate which of the following statements are correct and which are not.
Let G(x,y) represent the predicate x > y.
a. G(6, 13) means 13 is greater than 6.
b. G(2, 0) is true.
c. G(7, 1) means 7 is greater than 1.
d. “4 is less than 5) can be represented by G(5,4).
13. Indicate which of the following statements are correct and which are not.
Let E(x) mean x is even and G(x,y) mean x > y. Let the universe be the set of naturals.
a. ∀x ∃y G(y, x) is true, but ∃x ∀y G(y, x) is false.
b. ∃y E(x) is true.
c. ∀x ∀y G(x, y) is true.
d. ∀x G(∃y, x) is a proposition.
14. Indicate which of the following statements are correct and which are not.
a. ∃x [P(x, y) ∀x ⋀ Q(x,y)] is a wff.
b. ∀x [P(x) → ∀y [ Q(y) → ∃z R(z) ]] is a wff.
c. 2 > 1 ⋀ 3 < 5 is a wff.
15. Indicate which of the following statements are correct and which are not.
Let P(x) mean x is happy.
a. {Tom} is an interpretation for [∃x P(x) ⋀ P(y)].
b. ∀x P(x) is unsatisfiable.
c. {P(Tom) ⋁ ∃x ¬P(x)] is valid.
d. ∀x P(x) is equivalent to ∀y P(y)
16. Indicate which of the following statements are correct and which are not.
Let H(x) mean x is happy.
Let the universe be the set of people
a. “If everyone is happy, then Tom is happy” translates to
∀x [H(x) → H(Tom)].
b. “There are happy people” translates to
∃x H(x)
c. “Not everyone is happy” translates to
∀x ¬[H(x)]
d. ”Some people are happy and some are not happy” translates to
∃x [H(x) ⋀¬H(x)]
17. Which of the following sentences are propositions? What are the truth values of those that are propositions?
a. Richmond is the capital of Virginia.
b. 2 + 3 = 7.
c. Open the door.
d. 5 + 7 < 10.
e. The moon is a satellite of the earth.
f. x + 5 = 7.
g. x + 5 > 9 for every real number x.
18. What is the negation of each of the following propositions?
a. Norfolk is the capital of Virginia.
b. Food is not expensive in the United States.
c. 3 + 5 = 7.
d. The summer in Illinois is hot and sunny.
19. 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.
20. Determine whether each of the following implications is true or false.
a. Your car is not out of gas.
b. If 0.5 is an integer, then 1 + 0.5 = 3.
c. If cars can fly, then 1 + 1 = 3.
d. If 5 > 2 then pigs can fly.
e. If 3*5 = 15 then 1 + 2 = 3.
21. 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.
22. Construct a truth table for each of the following compound propositions.
a. p ⋀¬p
b. (p ⋁¬q) →q
c. (p →q) ↔(¬q →¬p)
23. 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.
24. 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.
25. Use truth table to verify the following equivalences.
a. p ⋀ False ⇔ False
b. p ⋁ True ⇔ True
c. p ⋁p ⇔ p
26. Use truth tables to verify the distributive law p ⋀ (q ⋁r) ⇔ (p ⋀q) ⋁ (p ⋀r).
27. 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
28. Verify the following equivalences, which are known as the absorption laws.
a. [ p ⋁(p ⋀q) ] ⇔ p
b. [ p ⋀(p ⋁q) ] ⇔ p
29. Find the dual of each of the following propositions.
a. p ⋁¬q ⋁¬r
b. (p ⋁q ⋁r) ⋀s
c. (p ⋀F) ⋁(q ⋀T)
30. 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 proposition is true. Each conjunction should include each of the three propositions or their negations).
31. What rule of inference is used in each of the following arguments?
a. John likes apple pies. Therefore, John likes apple 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.
32. 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).
33. Let Q(x, y) denote the statement "x is greater than y." What are the truth values of the following?
a. Q (3, 1)
b. Q (5, 5)
c. Q (6, -6)
d. Q (28, 256)
34. Let P(x) be the statement "x is happy," where the universe of discourse for x is the set of students. Express each of the following quantifications in English.
a. ∃x P(x)
b. ∀x ¬P(x)
c. ∃x ¬P(x)
d. ¬∀x ¬P(x)
35. Let P(x) be the statement " x > x2." If the universe of discourse is the set of real numbers, what are the truth values of the following?
a. P(0)
b. P(1/2)
c. P(2)
d. P(-1)
e. ∃x P(x)
f. ∀x P(x)
36. Suppose that the universe of discourse of the atomic formula P(x,y) is {1, 2, 3}. Write out the following propositions using disjunctions and conjunctions.
a. ∃x P(x, 2)
b. ∀y P(3, y)
c. ∀x ∀yP(x, y)
d. ∃x∃ yP(x, y)
e. ∃x ∀y P(x, y)
f. ∀y ∃x P(x, y)
37. Let L(x, y) be the predicate "x likes y," and let the universe of discourse be the set of all people. Use quantifiers to express each of the following statements.
a. Everyone likes everyone.
b. Everyone likes someone.
c. Someone does not like anyone.
d. Everyone likes George.
e. There is someone whom everyone likes.
f. There is no one whom everyone likes.
g. Everyone does not like someone.
38. Let S(x) be the predicate "x is a student," B(x) the predicate "x is a book," and H(x,y) the predicate "x has y, " where the universe of discourse is the universe, that is the set of all objects. Use quantifiers to express each of the following statements.
a. Every student has a book.
b. Some student does not have any book.
c. Some student has all the books.
d. Not every student has a book.
e. There is a book which every student has.
39. Let B(x), E(x) and G(x) be the statements "x is a book," "x is expensive, "and "x is good," respectively. Express each of the following statements using quantifiers; logical connectives; and B(x), E(x) and G(x), where the universe of discourse is the set of all objects.
a. No books are expensive.
b. All expensive books are good.
c. No books are good.
d. Does (c) follow from (a) and (b)?
40. Let G(x), F(x), Z(x), and M(x) be the statements "x is a giraffe," "x is 15 feet or higher, ""x is in this zoo, "and "x belongs to me," respectively. Suppose that the universe of discourse is the set of animals. Express each of the following statements using quantifiers; logical connectives; and G(x), F(x), Z(x), and M(x).
a. No animals, except giraffes, are 15 feet or higher;
b. There are no animals in this zoo that belong to anyone but me;
c. I have no animals less than 15 feet high.
d. Therefore, all animals in this zoo are giraffes.
e. Does (d) follow from (a), (b), and (c)? If not, is there a correct conclusion?
41. Show that the statements ¬∃x ∀y P(x, y) and ∀x ∃y ¬P(x, y) have the same truth value.
42. For each of the following arguments, explain which rules of inference are used for each step. The universe is the set of people.
a. "John, a student in this class, is 16 years old. Everyone who is 16 years old can get a driver's license. Therefore, someone in this class can get a driver's license."
b. "Somebody in this class enjoys hiking. Every person who enjoys hiking also likes biking. Therefore, there is a person in this class who likes biking."
c. "Every student in this class owns a personal computer. Everyone who owns a personal computer can use the Internet. Therefore, John, a student in this class, can use the Internet."
d. "Everyone in this class owns a personal computer. Someone in this class has never used the Internet. Therefore, someone who owns a personal computer has never used the Internet."
43. Determine whether each of the following arguments is valid. If an argument is correct, what rule of inference is being used? If it is not, what fallacy occurs?
a. "If n is a real number with n > 1, then n2 > 1. Suppose that n2 ≤ 1. Then n