Unformatted text preview: Module 1: Basic Logic
Theme 1: Propositions
English sentences are either true or false or neither. Consider the following sentences:
1. Warsaw is the capital of Poland.
2. ¾ · ¿. 3. How are you?
The ﬁrst sentence is true, the second is false, while the last one is neither true nor false. A statement
that is either true or false but not both is called a proposition. Propositional logic deals with such
statements and compound propositions that combine together simple propositions (e.g., combining
sentences (1) and (2) above we may say “Warsaw is the capital of Poland and ¾ ·
¿”).
In order to build compound propositions we need rules on how to combine propositions. We
denote propositions by lowercase letters Ô, Õ or Ö . Let us deﬁne: ¯ The conjunction of Ô and Õ , denoted as Ô Õ , is the proposition Ò Ô Õ and it is true when both Ô and Õ are true and false otherwise. ¯ The disjunction of Ô and Õ , denoted as Ô Õ , is the proposition Ô ÓÖ Õ and it is false when both Ô and Õ are false and true otherwise. ¯ The negation of Ô, denoted either as Ô or Ô, is the proposition It is not true that Ô.
Example 1: Let Ô “Hawks swoop” and Õ “Gulls glide”. Then Ô Õ is the same as “Hawks swoop
or gulls glide”. We also can translate back. For example, the English sentence “it is not true that
hawks swoop” can be written as Ô.
Exercise 1A: With the same notation as in the example above write the following propositions symbolically: ¯ It is not true that “Hawks swoop and gulls glide”.
¯ “Hawks do not swoop or gulls do not glide”.
1 Theme 2: Truth Tables
We can express compound propositions using a truth table that displays the relationships between
the truth values of the simple propositions and the compound proposition. In the next three tables
we show the truth tables for the negation, conjunction, and disjunction. Observe that any proposition
Ô can take only two values, namely true, denoted Ì , or false, denoted
. Therefore, for a compound proposition consisting of two propositions (e.g., Ô Õ µ we must consider only four possible
assignments of Ì and .
Table 1: The truth table for the negation.
Ô Ô T
F F
T Table 2: The truth table for the conjunction.
Ô Õ Ô T
T
F
F T
F
T
F Õ T
F
F
F Table 3: The truth table for the disjunction.
Ô Õ Ô T
T
F
F T
F
T
F Õ T
T
T
F In this module we will often use truth tables. To construct a truth table for a statement (e.g.,
Ô
Õ ) containing two propositions, say Ô and Õ , one ﬁrst builds two columns with all possible vales
of Ô and Õ (i.e., ´Ì Ì µ ´Ì µ ´ Ì µ ´
µ), and then follows already accepted rules of inference
to determine the truth value of the compound statement (say Ô Õ ).
Exercise 1B: Construct truth tables for the following statements: ¯
¯ Ô
Ô ; Ô
Õ . 2 Theme 3: Implications
In mathematics we often deal with conditional statements like: “if Ü ¾, then Ü¾
. The if–then
statement is called implication and it is denoted as Ô
Õ . It is false when Ô is true and Õ is false and
true otherwise. The reader may inspect the truth table of Ô
Õ in Table 4 below.
Table 4: The truth table for the implication.
Ô Õ Ô T
T
F
F T
F
T
F Õ T
F
T
T It is important to emphasize that Ô
Õ is false only when Ô is true and Õ is false. In words,
truth cannot imply a false statement, but false can imply truth. For example, consider the following
statement
Ü ¾ Ø Ò Ü¾
which is true even if the ﬁrst part of this compound statement is not true, say when Ü ¾.
In the implication Ô
Õ , the proposition Ô is called hypothesis or antecedent and the proposition
Õ is known as conclusion or consequent. The conclusion expresses a necessary condition for Ô,
while the hypothesis expresses a sufﬁcient condition for Õ to hold. Some other common ways of
expressing the implication Ô
Õ are: ¯
¯
¯
¯
¯
¯
¯
¯ if Ô, then Õ ;
Ô implies Õ ; if Ô, Õ ;
Ô only if Õ ; Ô is sufﬁcient for Õ ; Õ if Ô; Õ whenever Ô; Õ is necessary for Ô. Exercise 1C: Make truth tables for the following statements:
1. Ô 2. ´Ô Õ Õ ; µ Ö .
3 There are some important related implications following from Ô
1. The proposition Õ Ô Ô , namely: is called the converse. 2. The contrapositive of Ô
3. The inverse is Õ Õ Õ is ; Õ Ô . In Table 5 we compare the truth values of these propositions.
Table 5: The truth table for the implication, contrapositive, converse, and inverse.
Ô Õ Ô T
T
F
F T
F
T
F Õ Õ T
F
T
T Ô Õ T
F
T
T Ô T
T
F
T Ô Õ T
T
F
T We say that two compound propositions È and É are logically equivalent if they have the same
truth values. We shall write
È or
È É ¸ É It should be observed from Table 5 that the implication Ô
Õ has the same truth values as the
contrapositive Õ
Ô, but not as the converse and the inverse. Thus we can write
Ô Õ Õ Ô Ô Õ Ô Õ Ô Õ Õ Ô Example 2: Prove that
Ô Õ Ô Õ We use the truth table. Our computation is shown in Table 6. Comparing the second column with the
last one, we see that the truth values are the same for Ô
Õ and
Ô
Õ , so the above two compound
propositions are logically equivalent.
Table 6: The truth table for Example 2.
Ô Õ Ô T
T
F
F T
F
T
F Õ T
F
T
T Ô F
F
T
T
4 Ô T
F
T
T Õ Exercise 1D: Using the truth table prove that the following propositions are logically equivalent:
´Õ Ô Ö µ ´Ô Õ µ ´Ô Ö µ In Exercise 1D the reader was asked to prove logical equivalence that is known under the name
distributive law. This is an example of many other logical equivalences that we list in Table 7 and
prove in the sequel.
Table 7: Logical Equivalences
Equivalence Name Ô Identity laws Ì Ô Ô Ô Ô Ì Domination laws Ì Ô
Ô Ô Ô Ô Idempotent laws Ô
Ô ´ µ Ô Double negation law Ô Ô Õ Õ Ô Õ Õ Commutative laws Ô
Ô Ô ´Õ
´Õ Ô ´Õ Ö µ ´Ô Õ µ ´Ô Ö µ Ô ´Õ Ö µ ´Ô Õ µ ´Ô Ö µ Ô µ
Öµ ´Ô
´Ô Ö µ
Õµ
Õ ´Ô Õ µ Ô Õ µ Ô Ö Distributive laws Õ ´Ô Associative laws Ö Õ De Morgan’s laws All laws listed above can be easily proved using the truth table. The reader is encouraged to try
to work out all the truth tables. Having such laws under our belt, we can prove many new logical
equivalences without using the truth table.
Example 3: Prove that
´Ô ´ Ô Õ µµ Ô ´Ô Õ Õ µ We proceed as follows
´Ô ´ Ô Õ µµ Ô
Ô ´ ´ Ô ´ ´
´Ô Ô µ Ô Ô Õ Ô µ
Õ ´ 5 µ De Morgan’s law
Õ µ De Morgan’s law µ
Ô double negation law
Õ µ distributive law ´ Ô Õ µ since Ô Ô ´ Ô Õ µ commutative law ´ Ô Õ µ identity law ´Ô Õ µ De Morgan’s law Thus the above logical equivalence is proved. The above is largely selfexplanatory, but a few words
of additional information follows: In the ﬁrst statement above we, naturally, apply De Morgan’s law
´È Éµ
È
É. In our case, É is a compound statement É
Ô
Õ , thus another application
of De Morgan’s law implies É Ô Õ . Then we “multiply out”, that is, Ô ´Õ Ö µ ´Ô Õ µ ´Ô Ö µ.
The rest is simple.
A compound proposition is called a tautology if it is always true, no matter what the truth values
of the propositions (e.g., Ô
Ô
Ì no matter what is the value of Ô. Why?).
A compound proposition is called a contradiction if it is always false, no matter what the truth
values of the propositions (e.g., Ô
Ô
Ì no matter what is the value of Ô. Why?).
Finally, a proposition that is neither a tautology nor a contradiction is called a contingency. 6 Theme 4: Predicates and Quantiﬁers
In mathematics we often have to deal with sentences like
Ô ¾ Ü ¾ Ü ·½ ¼ or Õ Ò is a prime number which are not propositions since their values are neither true nor false since the values of the variables
Ü and Ò are not speciﬁed. We shall denote such statements as È ´Üµ or É´Ò and call propositional
functions or predicates of Ü or Ò.
More formally, let È be a statement involving the variable Ü that belongs to the set . Then È is
called a propositional function or predicate with respect to if for each Ü ¾ the sentence È ´Üµ
is a proposition. The domain is often called the universe of discourse of È .
Example 4: The statement above
´ µ È Ü ¾ Ü ¾ Ü ·½ ¼ is true when Ü ½ and is false for any Ü ½. The statement É´¿µ is true, where É´Òµ: “Ò is a prime
number”.
Predicates are very important in mathematics and computer science since they allow us to justify
logical inferences or syllogisms. Consider the following famous syllogism:
All men are mortal.
Fermat is a man.
Therefore, Fermat is mortal.
This conclusion seems to be perfectly correct, but we do not have rules of inference for propositional
logic to justify it. We shall come back in Module 3 to such logical inferences when we discuss
mathematical proofs.
We saw above how to change a propositional function into a proposition: by assigning truth values
to the variable Ü. There is another way of changing a predicate È ´Üµ into a proposition: either by
saying that È ´Üµ is true for all values of Ü belonging to or that È ´Üµ is true for some value of Ü in
. The former is called the universal quantiﬁcation while the latter the existential quantiﬁcation. Universal quantiﬁcation
The universal quantiﬁcation È ´Üµ is the proposition
´ µ is true for all values of Ü in the universe of discourse È Ü We shall denote is as
´ µ Ü È Ü 7 . We can also read it as “for all Ü È ´Üµ” or “for every
upside down A) is called a universal quantiﬁer. ´ µ”. The symbol (notice that it is an Ü È Ü Example 5: The statement
¾ ¼ Ü Ü is a universally quantiﬁed statement that is true. But
¾ ¼ Ü Ü is a universally quantiﬁed statement that is false since for Ü
¼ we have Ü¾
¼. We have just
learned how to prove that a universal quantiﬁcation is false. We must show at least one value of Ü for
which È ´Üµ is not true. Such a value of Ü is called a counterexample for Ü È ´Üµ.
Finally, observe that if the universe of discourse consists of a ﬁnite number of elements, say
Ü½ Ü¾
ÜÒ , then
ÜÈ ´Üµ
È ´Ü½ µ
È ´Ü¾ µ
¡ ¡ ¡ È ´ÜÒµ
since this conjunction is true if and only if È ´Ü½ µ ´ È Ü¾ µ ´ Ò µ are all true. È Ü Existential quantiﬁcation
The existential quantiﬁcation È ´Üµ is the proposition
´ µ is true for some value(s) of Ü in the universe of discourse . È Ü We shall denote it as
´ µ Ü È Ü We can also read it as “for some Ü È ´Üµ” or “there is an Ü such that È ´Üµ” or “there is at least one Ü
such that È ´Üµ”. The symbol (notice that it is mirror image of E) is called an existential quantiﬁer.
Example 6: Let É´Üµ denote the statement: ¾ ½. What is the truth value of the quantiﬁcation Ü ´ µ Ü É Ü when the universe of discourse for Ü is the set of real numbers? Since É´½ ¾µ and É´ ½ ¾µ are true
propositions, we conclude that Ü É´Üµ is true in the deﬁned universe of discourse. But if we demand
that the universe of discourse for Ü is the set of integers, then Ü É´Üµ is false since there is no integer
satisfying Ü¾
½. Here, we observe that in order to prove that an existentially qualiﬁed statement
È ´Üµ is false, one must show that for all Ü in the universe of discourse the predicate È ´Üµ is false.
Finally, observe that if the universe of discourse consists of a ﬁnite number of elements, say
Ü½ Ü¾
ÜÒ , then
ÜÈ ´Üµ
È ´Ü½ µ
È ´Ü¾ µ
¡ ¡ ¡ È ´ÜÒµ
since this disjunction is true if and only if at least one of È ´Ü½ µ
8 ´ È Ü¾ µ ´ Ò µ is true. È Ü We now generalize De Morgan’s laws to quantiﬁcations. We claim that
´ µ ÜÈ Ü Ü ´ µ ÜÈ Ü Ü ´ µ È Ü ´ µ È Ü (1)
(2) Let us try to prove the ﬁrst statement. Suppose that
ÜÈ ´Üµ is true. Hence,
ÜÈ ´Üµ is false. But,
as we seen before such a statement is false if there exists at least one Ü for which È ´Üµ is false. This
implies that for such Ü the statement È ´Üµ is true, form which we infer that Ü È ´Üµ is true. We
have shown that if
ÜÈ ´Üµ is true, then
Ü È ´Üµ is true. In a similar manner, we conclude that
if
ÜÈ ´Üµ is false, then
Ü È ´Üµ is false. In conclusion, the pair of propositions
ÜÈ ´Üµ and
Ü È ´Üµ have the same truth values, so they must be logically equivalent. 9 ...
View
Full
Document
 Fall '08
 W.Szpankowski
 Logic

Click to edit the document details