<<

Module 1: Basic

Theme 1: Propositions

English sentences are either true or or neither. Consider the following sentences:

1. Warsaw is the capital of Poland.

2. ¾·5 = ¿.

3. How are you?

The first 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 ¾·5=¿”).

In order to build compound propositions we need rules on how to combine propositions. We

Õ Ö

denote propositions by lowercase letters Ô, or . Let us define:

Ô Õ Ô ^ Õ

¯ The conjunction of and , denoted as , is the proposition

Ô aÒd Õ; Õ

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 of , denoted either as or , is the proposition

It is not true that Ô.

= Õ = Ô _ Õ Example 1:LetÔ “Hawks swoop” and “Gulls glide”. Then isthesameas“Hawksswoop

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 sym- bolically:

¯ 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

Ì F

Ô can take only two values, namely true, denoted ,orfalse, denoted . Therefore, for a com-

^ Õ µ

pound proposition consisting of two propositions (e.g., Ô we must consider only four possible F assignments of Ì and .

Table 1: The truth table for the negation.

Ô :Ô T F F T

Table 2: The truth table for the conjunction.

Ô Õ Ô ^ Õ TTT TFF FTF FFF

Table 3: The truth table for the disjunction.

Ô Õ Ô _ Õ TTT TFT FTT FFF

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 first builds two columns with all possible vales

Õ ´Ì; Ì µ; ´Ì; F µ; ´F; Ì µ; ´F; F µ

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

¾

=¾ Ü =4

In mathematics we often deal with conditional statements like: “if Ü , then .Theif–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.

Ô Õ Ô ! Õ TTT TFF FTT

FFT

! Õ Ô Õ 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

¾

if Ü = ¾; ØheÒ Ü =4 =¾

which is true even if the first 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 sufficient condition for Õ to hold. Some other common ways of

! Õ

expressing the implication Ô are:

Ô Õ

¯ if ,then ;

Ô Õ

¯ implies ;

Ô Õ

¯ if , ;

Ô Õ

¯ only if ;

Ô Õ

¯ is sufficient 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 Ô , namely:

! Ô

1. The proposition Õ is called the .

! Õ :Õ !:Ô

2. The contrapositive of Ô is ;

Ô !:Õ 3. The inverse is : . In Table 5 we compare the truth values of these propositions.

Table 5: The truth table for the implication, contrapositive, converse, and inverse.

Ô Õ Ô ! Õ :Õ !:Ô Õ ! Ô :Ô !:Õ TTT T T T TFF F T T FTT T F F

FFT T T 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

Ô ! Õ  :Õ !:Ô;

Ô ! Õ 6 :Ô !:Õ;

Ô ! Õ 6 Õ ! Ô:

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.

Ô Õ Ô ! Õ :Ô :Ô _ Õ TTT F T TFF F F FTT T T FFT T T

4

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

Ô _ F  Ô

_ Ì  Ì

Ô Domination laws

Ô ^ F  F

_ Ô  Ô

Ô 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. 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

´Ô _ ´:Ô ^ Õ µµ  :Ô ^:´:Ô ^ Õ µ

: De Morgan’s law

:Ô ^ ´:´:Ôµ _:Õ µ

 De Morgan’s law

:Ô ^ ´Ô _:Õ µ

 double negation law

´:Ô ^ Ôµ _ ´:Ô ^:Õ µ  distributive law

5

F _ ´:Ô ^:Õ µ :Ô ^ Ô  F

 since

´:Ô ^:Õ µ _ F

 commutative law

´:Ô ^:Õ µ

 identity law

:´Ô _ Õ µ :  De Morgan’s law

Thus the above logical equivalence is proved. The above is largely self-explanatory, but a few words

of additional information follows: In the first 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 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 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 Quantifiers

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 specified. We shall denote such statements as or and call propositional Ò

functions or predicates of Ü or .

Ü D È

More formally, let È be a statement involving the variable that belongs to the .Then is

Ü ¾D È ´Üµ

called a or predicate with respect to D if for each the sentence È is a proposition. The domain D is often called the of discourse of .

Example 4: The statement above

¾

È ´Üµ: Ü ¾Ü ·½ = ¼

=½ Ü 6=½ É´¿µ É´Òµ Ò 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

´Üµ Ü D È ´Üµ Ü saying that È is true for all values of belonging to or that is true for some value of in

D . The former is called the universal quantification while the latter the existential quantification.

Universal quantification

´Üµ

The universal quantification È is the proposition

´Üµ Ü D È is true for all values of in the universe of discourse .

We shall denote is as

8Üȴܵ:

7

´Üµ Üȴܵ 8 We can also read it as “for all ÜÈ ” or “for every ”. The (notice that it is an upside down A) is called a universal quantifier.

Example 5: The statement

¾

8ÜÜ  ¼

is a universally quantified statement that is true. But

¾

8ÜÜ > ¼

¾

= ¼ Ü = ¼ is a universally quantified statement that is false since for Ü we have .Wehavejust

learned how to prove that a universal quantification is false. We must show at least one value of Ü for

´Üµ Ü 8Ü; È ´Üµ which È is not true. Such a value of is called a counterexample for .

Finally, observe that if the universe of discourse consists of a finite number of elements, say

Ü ;Ü ;::: ;Ü

¾ Ò

½ ,then

8ÜÈ ´Üµ  È ´Ü µ ^ È ´Ü µ ^ ¡¡¡ ^ È ´Ü µ

½ ¾ Ò

È ´Ü µ;È´Ü µ;::: ;È´Ü µ

¾ Ò since this conjunction is true ½ are all true.

Existential quantification

´Üµ

The existential quantification È is the proposition

´Üµ Ü D È is true for some value(s) of in the universe of discourse .

We shall denote it as

9Üȴܵ:

´Üµ Ü È ´Üµ Ü

We can also read it as “for some ÜÈ ”or“thereisan such that ” or “there is at least one

´Üµ 9

such that È ”. The symbol (notice that it is mirror image of E) is called an existential quantifier.

¾

´Üµ 4Ü =½

Example 6:LetÉ denote the statement: . What is the truth value of the quantification

9Üɴܵ

É´½=¾µ É´ ½=¾µ

when the universe of discourse for Ü is the set of real numbers? Since and are true

Üɴܵ

propositions, we conclude that 9 is true in the defined universe of discourse. But if we demand

9Üɴܵ

that the universe of discourse for Ü is the set of , then is false since there is no

¾

Ü =½

satisfying 4 . Here, we observe that in order to prove that an existentially qualified 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 finite number of elements, say

Ü ;Ü ;::: ;Ü

¾ Ò

½ ,then

9ÜÈ ´Üµ  È ´Ü µ _ È ´Ü µ _ ¡¡¡ _ È ´Ü µ

½ ¾ Ò

È ´Ü µ;È´Ü µ;::: ;È´Ü µ

¾ Ò since this disjunction is true if and only if at least one of ½ is true.

8

We now generalize De Morgan’s laws to quantifications. We claim that

ÜÈ ´Üµ 9Ü:È ´Üµ;

:8 (1)

ÜÈ ´Üµ 8Ü:È ´Üµ

:9 (2)

ÜÈ ´Üµ 8ÜÈ ´Üµ

Let us try to prove the first statement. Suppose that :8 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

:È ´Üµ 9Ü:È ´Üµ

implies that for such Ü the statement is true, form which we infer that is true. We

ÜÈ ´Üµ 9Ü:È ´Üµ

have shown that if :8 is true, then is true. In a similar manner, we conclude that

ÜÈ ´Üµ 9Ü:È ´Üµ :8ÜÈ ´Üµ

if :8 is false, then is false. In conclusion, the pair of propositions and

Ü:È ´Üµ 9 have the same truth values, so they must be logically equivalent.

9