You are on page 1of 9

# 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 It is not true that Ô.

Ô

or Ô, is the proposition

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

Ô Õ Ô Õ 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. say Ô and Õ . and then follows already accepted rules of inference to determine the truth value of the compound statement (say Ô Õ ). ´Ì Ì µ ´Ì µ ´ Ì µ ´ µ). ..g. Ô Õ ) containing two propositions.. Table 1: The truth table for the negation. for a compound proposition consisting of two propositions (e. and disjunction.e. Ô Õ µ we must consider only four possible assignments of Ì and . 2 . Ô Õ Ô Õ T T F F T F T F T F F F Table 3: The truth table for the disjunction. Therefore. denoted . In the next three tables we show the truth tables for the negation. conjunction. Ô Ô T F F T Table 2: The truth table for the conjunction. one ﬁrst builds two columns with all possible vales of Ô and Õ (i. namely true. or false.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. Exercise 1B: Construct truth tables for the following statements: ¯ ¯ Ô Ô Ô Õ . Observe that any proposition Ô can take only two values.g. denoted Ì ..

then Ü¾ . Ô implies Õ . if Ô. It is false when Ô is true and Õ is false and true otherwise. Ô Õ Ô Õ 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. the proposition Ô is called hypothesis or antecedent and the proposition Õ is known as conclusion or consequent. if Ô. truth cannot imply a false statement. The reader may inspect the truth table of Ô Õ in Table 4 below. then Õ . while the hypothesis expresses a sufﬁcient condition for Õ to hold. The if–then statement is called implication and it is denoted as Ô Õ . 3 . say when Ü ¾.Theme 3: Implications In mathematics we often deal with conditional statements like: “if Ü ¾. In the implication Ô Õ . Ô Õ Õ Õ Exercise 1C: Make truth tables for the following statements: Ô Õ . is necessary for Ô. The conclusion expresses a necessary condition for Ô. if Ô. Table 4: The truth table for the implication. Ô only if Õ . consider the following statement Ü  ¾ Ø Ò Ü¾ which is true even if the ﬁrst part of this compound statement is not true. but false can imply truth. Ö 2. whenever Ô. Õ . Some other common ways of expressing the implication Ô Õ are: ¯ ¯ ¯ ¯ ¯ ¯ ¯ ¯ 1. For example. is sufﬁcient for Õ . ´Ô Õ µ . In words.

Table 6: The truth table for Example 2. The contrapositive of Ô 3. converse. namely: is called the converse. so the above two compound propositions are logically equivalent. Ô Õ Ô Õ Ô Ô Õ T T F F T F T F T F T T 4 F F T T T F T T . Ô Õ Ô Õ Õ Ô Õ Ô Ô Õ 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. contrapositive. Table 5: The truth table for the implication. We shall write È É or È ¸ É It should be observed from Table 5 that the implication Ô Õ has the same truth values as the contrapositive Õ Ô. The inverse is Ô Õ is Õ Ô . The proposition Õ Ô Õ . Comparing the second column with the last one. In Table 5 we compare the truth values of these propositions. Our computation is shown in Table 6. but not as the converse and the inverse. we see that the truth values are the same for Ô Õ and Ô Õ . Õ 2. . and inverse.There are some important related implications following from Ô 1. Thus we can write Ô Ô Ô Õ Õ Õ Õ Õ Ô Ô Ô Õ Example 2: Prove that Ô Õ Ô Õ We use the truth table.

This is an example of many other logical equivalences that we list in Table 7 and prove in the sequel.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. we can prove many new logical equivalences without using the truth table. Having such laws under our belt. Table 7: Logical Equivalences Equivalence Ô Ô Ô Ô Ô Ô Ô Ô Ô Ô Ì Ì Ô Ô Ì Name Identity laws Domination laws Idempotent laws Double negation law Ô Ô ´ Ô Ô Ô Ô Ô Ô Ô Õ Õ µ Õ Õ Ô Commutative laws ´Ô ´Ô ´Ô ´Ô Ô Ô ´Õ ´Õ ´Õ ´Õ ´Ô ´Ô Õ Õ µ Öµ Ö Ö Ö µ Õµ Õ Õ Õ Õ Õ Ö Ö Associative laws Ö Ö µ µ µ µ ´Ô ´Ô µ µ Distributive laws De Morgan’s laws µ µ All laws listed above can be easily proved using the truth table. Example 3: Prove that ´Ô ´ Ô Õ µµ Ô Õ ´Ô Õ µ We proceed as follows ´Ô ´ Ô Õ µµ Ô Ô Ô ´ ´ ´ ´Ô Ô Ô Ô Õ µ Õ De Morgan’s law µ µ µ Õ De Morgan’s law double negation law Õ µ Ô ´ Ô µ ´ distributive law 5 . The reader is encouraged to try to work out all the truth tables.

6 . naturally.g. The rest is simple. but a few words of additional information follows: In the ﬁrst statement above we. Ô Ô Ì no matter what is the value of Ô. A compound proposition is called a contradiction if it is always false.g. no matter what the truth values of the propositions (e. Finally. no matter what the truth values of the propositions (e.. In our case. a proposition that is neither a tautology nor a contradiction is called a contingency. that is. É is a compound statement É Ô Õ .´ ´ ´ Ô Ô Ô Õ Õ Õ Õ µ since Ô Ô µ µ commutative law identity law De Morgan’s law ´Ô µ Thus the above logical equivalence is proved.. Why?). Ô Ô Ì no matter what is the value of Ô. thus another application of De Morgan’s law implies É Ô Õ . A compound proposition is called a tautology if it is always true. Then we “multiply out”. Ô ´Õ Ö µ ´Ô Õ µ ´Ô Ö µ. apply De Morgan’s law ´È Éµ È É. The above is largely self-explanatory. Why?).

Example 4: The statement above È Ü ´ µ Ü ¾  ¾ Ü ·½ ¼ is true when Ü ½ and is false for any Ü ½. The former is called the universal quantiﬁcation while the latter the existential quantiﬁcation. where É´Òµ: “Ò is a prime number”. Consider the following famous syllogism: All men are mortal. The statement É´¿µ is true. More formally. Fermat is mortal. We shall come back in Module 3 to such logical inferences when we discuss mathematical proofs. 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 . We shall denote such statements as È ´Üµ or É´Òµ and call propositional functions or predicates of Ü or Ò. The domain is often called the universe of discourse of È . Then È is called a propositional function or predicate with respect to if for each Ü ¾ the sentence È ´Üµ is a proposition. This conclusion seems to be perfectly correct. let È be a statement involving the variable Ü that belongs to the set . but we do not have rules of inference for propositional logic to justify it. We shall denote is as Ü È Ü ´ µ 7 . Universal quantiﬁcation The universal quantiﬁcation È ´Üµ is the proposition È Ü ´ µ is true for all values of Ü in the universe of discourse . Fermat is a man.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. Therefore. Predicates are very important in mathematics and computer science since they allow us to justify logical inferences or syllogisms. We saw above how to change a propositional function into a proposition: by assigning truth values to the variable Ü.

The symbol (notice that it is mirror image of E) is called an existential quantiﬁer. Example 6: Let É´Üµ denote the statement: Ü ¾ ½. we conclude that Ü É´Üµ is true in the deﬁned universe of discourse. Finally. . say Ü½ Ü¾ ÜÒ . The symbol (notice that it is an ¾ ¼ is a universally quantiﬁed statement that is true. We have just learned how to prove that a universal quantiﬁcation is false. Such a value of Ü is called a counterexample for Ü È ´Üµ. we observe that in order to prove that an existentially qualiﬁed statement È ´Üµ is false.We can also read it as “for all Ü È ´Üµ” or “for every upside down A) is called a universal quantiﬁer. then ÜÈ ´Üµ È ´Ü½ µ È ´Ü¾ µ ¡ ¡ ¡ È ´ÜÒµ since this conjunction is true if and only if È ´Ü½ µ È Ü¾ ´ µ È Ü ´ Ò µ are all true. Finally. 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. observe that if the universe of discourse consists of a ﬁnite number of elements. 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 È ´Üµ”. observe that if the universe of discourse consists of a ﬁnite number of elements. But Ü Ü ¾ ¼ is a universally quantiﬁed statement that is false since for Ü ¼ we have Ü¾ ¼. then Ü É´Üµ is false since there is no integer satisfying Ü¾ ½. But if we demand that the universe of discourse for Ü is the set of integers. say Ü½ Ü¾ ÜÒ . We must show at least one value of Ü for which È ´Üµ is not true. then ÜÈ ´Üµ È ´Ü½ µ È ´Ü¾ µ ¡ ¡ ¡ È ´ÜÒµ since this disjunction is true if and only if at least one of È ´Ü½ µ 8 È Ü¾ ´ µ È Ü ´ Ò µ is true. Example 5: The statement Ü Ü Ü È Ü ´ µ”. Existential quantiﬁcation The existential quantiﬁcation È ´Üµ is the proposition È Ü ´ µ is true for some value(s) of Ü in the universe of discourse . one must show that for all Ü in the universe of discourse the predicate È ´Üµ is false. Here.

9 . We have shown that if ÜÈ ´Üµ is true. we conclude that if ÜÈ ´Üµ is false. form which we infer that Ü È ´Üµ is true. as we seen before such a statement is false if there exists at least one Ü for which È ´Üµ is false. In conclusion.We now generalize De Morgan’s laws to quantiﬁcations. then Ü È ´Üµ is true. Suppose that ÜÈ ´Üµ is true. We claim that ÜÈ Ü ´ µ ´ µ Ü Ü È Ü ´ µ ´ µ (1) (2) ÜÈ Ü È Ü Let us try to prove the ﬁrst statement. the pair of propositions ÜÈ ´Üµ and Ü È ´Üµ have the same truth values. But. This implies that for such Ü the statement È ´Üµ is true. Hence. ÜÈ ´Üµ is false. then Ü È ´Üµ is false. In a similar manner. so they must be logically equivalent.