Go to other chapters or to other volumes of math
Additional Material for this Chapter
Exercises for this Chapter
Answers to Exercises

Chapter 1
Intuitive Logic

Section 1   Logical Statements and Their Equivalence

A statement is sometimes said to be a complete thought. It becomes a basic unit in our discussion of logic when it is fact or falsehood.

[1.1] (Logical statement) A logical statement (or proposition) is a statement that is true or is false (but not both).

By their meanings some statements are obviously true, other statements are obviously false. True are the statements:

2+3=5,   all triangles have three sides,   Los Angeles is a city in the state of California (USA)
False are the statements:
4+2=7,   A right angle is equal to 120°,   the earth is smaller than its moon
The following statements have opposite truth values:
2+3 = 5,     Mexico is in Europe

The "true" and "false" (often abbreviated T and F) assigned to the different logical statements given above are called truth values. By definition [1.1] every logical statement must have a truth value. But consider the statement:

There is life on some planet outside our solar system
It may be true or it may be false. Its truth value is unknown, but it does have a truth value. A conjecture is a logical statement with an unknown truth value, but has the possibility of being true. Later a conjecture may turn out to be true or turn out to be false. Questions and incomplete statements cannot be logical. "Do you like the color red?" is not a logical statement.

Every logical statement must have a truth value, or it is not a logical statement..

To evaluate logically a statement means to assign a truth value to that statement. In these discussions the evaluation of a statement in English usually is obvious from its meaning and common knowledge.

Statements in these discussions are phrased in Englich or symbols of mathematics and logic. Often they can be given using different words or symbols, but somehow give the same meanings. Logic, however, is interested only in the truth values of logical statements. A pair of such statements may concern very different topics, but their truth values are what is important.

[1.2] (Equivalent statements) Two logical statements are (logically) equivalent if they have the same truth value.

The two logical statements   2+3=5   and   "all triangles have 3 sides"   are logically equivalent because both are true.
Also   4+4=9   and   "all houses are red"   are logically equivalent. This time they are both false.
But the statements   5+4=9   and   "All squares have 5 sides"   have opposite truth values, and therefore are not logically equivalent.

In algebra the letters x,y,z,... are used often to represent unknown or known numbers. They receive values when assigned numbers. x=3 gives x a value. In another problem x might be given another value, say 5. In a similar way, a logical variable, p,q, or r might be assigned a logical statement. A logical statement is a value given to a logical variable. For example,

p: the moon is smaller than the earth          q: every triangle has 5 sides
assigns a true statement to p and a false statement to q. In a sense, then p receives a T and q receives an F.

A logical variable is a symbol which can be assigned a logical statement. Any assignment gives the variable a truth value. If a logical statement is assigned to a logical variable then a semi-colon (:) is placed between the variable and its logical statement.

In algebra, an equal sign is placed between a variable and a value assigned to it: x = 2, y = -5, z = 16.4. But the assignment of 2 to x is not permanent. In another problem x may be assigned a different value. It is convenient to use the same variables repeatedly in different discussions if no confusion results. Similarly, the same logical variable may be re-used and assigned different statements. The variable p may be associated with a statement in a discussion, but p may be associated with another statement in a different discussion.

If a logical variable is assigned a logical statement, it is convenient to pass the truth value of the statement onto the variable. But if a variable is not assigned a statement, it is convenient to think of the variable as having unknown truth value. It could be either T or F.

[1.3] (Table of possibilities for a single variable) A table of possibilities for 1 logical variable p
   p
   T
   F

Actually [1.3] is a repeat of definition [1.1] using logical symbols.

[1.4] (Table of possibilities for two variables) A table of possibilities for 2 logical variables p,q
   p   q
   T   T
   T   F
   F   T
   F   F

[1.5] (Table of possibilities for three variables) A table of possibilities for 3 logical variables p,q,r
   p   q   r
   T   T   T
   T   T   F
   T   F   T
   T   F   F
   F   T   T
   F   T   F
   F   F   T
   F   F   F

There are larger tables of possibilities for 4,5,... variables, but seldom will discussions involve more than 3.

Consider the expression    p has the same truth value as q. Another way of saying it is p,q are logically equivalent The symbol <===> is used to declare equivalence Using [1.2] the following table can be formed:

[1.6] (A truth table for equivalence) A truth table for p,q are equivalent
   p   q      p <===> q
   T   T            T            (p,q have the same truth value, so it is true that they are equivalent)
   T   F            F            (p,q have opposite truth values; it is false that they are equivalent)
   F   T            F            (p,q have opposite truth values; it is false that they are equivalent)
   F   F            T            (p,q have the same truth value, so it is true that they are equivalent)

The first line of a truth table (in boldface) is called the header. In the header is a horizontal list of variables and a logical expression to be evaluated. On the next horizontal lines are different possibilities for the truth values of the variables. (A table of possibilities is always a part of any truth table.) Each possibility determines a truth value for the expression. In [1.6] the definition [1.2] of equivalence does the determination. The truth value is always written under the expression.

Three notations are used in these discussions to declare the equivalence of p,q:
p is equivalent to q;
p <===> q;
p if and only if q.
(In some places another form of equivalence is used:
A necessary and sufficient for q is that p.
More of this form will be discussed later.)

Any of these three notations suggest that two logical statements can be combined by placing some connective between them. As a result a logical compound statement is produced. Any logical statement and any logical compound statement will be called a logical expression. For example, p <===> q is a logical compound statement and also a logical expression. The variables p,q,r by themselves also are logical expressions.

More logical connectives will be introduced and discussed in the following sections.

More variables may be in the header of a truth table. In general,
[1.7] (Table of possibilities for n variables) For n logical variables there are 2n possibilities.

Instead of T and F the numbers 1 and 0 could be used in the tables. (These conform to probability values of complete success and utter failure.) Replacing T,F in the table [1.4] by 1,0 produces the following table:

[1.8] (0,1 truth table equivalence) A truth table for p,q are equivalent
   p   q      p <===> q
   0   0              1
   0   1              0
   1   0              0
   1   1              1

In these discussions the T-F notation is used most of the time. Yet some interesting applications will be expressed in the 1-0 notation. In some places (as in [1.8]) the tables of possibilities in the 0-1 notation are written in the reverse order of the T-F notation. The idea here is that 00, 01, 10, 11 are numbers of increasing size.


Section 2   Logical conjunction and logical alternation

An electrical switch either allows electricity to pass through (it is on, it is closed) or it prevents electricity from passing through (it is off, it is open). The adjoining figure Fig C shows four diagrams of a battery BATT and a light bulb BULB connected by a wire that has two switches P and Q (in series). Depending upon the conditions of the switches electricity can flow between the BATT and the BULB and make the BULB shine light. For this to happen both switches must be closed (Fig C11 at the top). Otherwise, if either switch is open (Fig C10, Fig C01 in the middle), or if both are open (Fig C00 at the bottom), then electricity cannot go between BATT and BULB.

The statements

p: electricity can flow through switch P,
q: electricity can flow through switch Q,
The following statement is applied to each of these four situations:
electricity can flow between BATT and BULB
may be true or false. Therefore, they are logical statements. The last statement about flowing through both switches is equivalent to saying
p and q
This says that switch P is closed and switch Q is closed, which may or may not be true. This physical model involving switches suggests the following definition in English and in logic:

[2.1] Conjunction A conjunction is formed when the word "and" is placed between two logical statements. The conjunction is true if and only if both logical statements are true.
In symbols, p and q    is true if and only if both  p  and  q  are true

The conjunction itself becomes a logical statement because definition [2.1] gives it a truth value.

If either   p is false   or   q is false    (or both are false)    then    p and q    is false.

[2.2] (Truth table for conjunction) A the truth table for logical conjunction of statements p,q
   p   q   p and q
   T   T       T
   T   F       F
   F   T       F
   F   F       F                        (because of the last F here, conjunction is different from equivalence)

The form q and p is another way a conjunction can be formed. Using the word- definition of conjunction, instead of the notation, following truth table for q and p can be constructed.

A the truth table for logical conjunction of statements q,p
   p   q   q and p
   T   T       T
   T   F       F
   F   T       F
   F   F       F
The columns under q and p and p and q are identical, signifying equivalence.

[2.2] (Conjunction is commutative) The truth value of a conjunction is not changed if the logical statements are switched.

[2.3] Extended logical conjunction Logical conjunction can be extended to include more than two statements by placing the word "and" between the statements. The extended conjunction is true if and only if all the logical statements in it are true
Notation: p and q and r and ...   is true    if and only if     all statements p,q,r,... are true.

p and q and r and ... is false if any one (or more) of p,q,r,... is false.

The truth table for a conjunction of three variables has under the expression a single T and seven F's. (See [1.5] above.) It is interesting to see what happens if the 1-0 notation is used in place of T-F (1 replaces T, 0 replaces F.). The truth table [2.2]becomes:
   p   q     p*q
   1   1       1
   1   0       0
   0   1       0
   0   0       0

Now rearrange the table of possibilities into numerical order:
   p   q     p*q
   0   0       0
   0   1       0
   1   0       0
   1   1       1
But this is the multiplication table for multiplying the numbers 0 and 1. In fact many years ago logical conjunction was written as an algebraic product of two variables.


The adjoining figure Fig A shows four diagrams of a battery BATT and a light bulb BULB connected by a wire that has two branches (in parallel). In each branch is a switch, P in one branch and Q in the other branch. Depending upon the conditions of the switches electricity can flow between the BATT and the BULB and make the BULB shine light. For this NOT to happen both switches must be open (Fig A00 at the bottom). Otherwise, if either switch is closed (Fig A10, Fig A01 middle two figures), or if both are closed (Fig A11 at the top), then electricity can go between BATT and BULB. Again are the logical statements:

p: electricity can flow through switch P,
q: electricity can flow through switch Q
The following statement is applied to each of these four situations:
electricity can flow between BATT and BULB
The last statement about some connected path between BATT and BULB is equivalent to saying
p or q
This says that switch P is closed or switch Q is closed (either p or q is true).
It must be assumed that this statement is true if either both p,q are true. The connective "or" is not exclusive; it allows both to be true. This physical model of switches suggests the following logic definition:

[2.5] Alternation An alternation is formed when the word "or" is placed between two logical statements. The alternation is false if and only if both logical statements are false.
In symbols, p or q    is true if and only if both  p  and  q  are false

The alternation itself becomes a logical statement because definition [2.5] gives it a truth value.

If either   p is false   or   q is false    (or both are false)    then    p and q    is false.

[2.6] The truth table for logical alternation
   p   q   p or q
   T   T     T
   T   F     T                   (because of the last T here, alternation is different from just the second variable q)
   F   T     T
   F   F     F

[2.7] (Alternation is commutative) The truth value of an alternation is not changed if the logical statements are switched.

[2.8] (Extended logical alternation) Logical alternation can be extended to include more than two statements by placing the word "or" between the statements. The extended alternation is false if and only if all the logical statements in it are false
Notation: p or q or r or ...   is false    if and only if     all statements p,q,r,... are false.

The truth table for an alternation of three variables has under the expression seven T's and a single F (See [2.5] above.)

In table [2.5] the T-F notation may be replaced by the 1-0 notation, and the connective "or" in the header, replaced by the sign of addition "+". However a problem arises when ordinary arithmetic addition is imposed. Click here for a discussion of Boolean arithmetic.

There is another logical connective, but it is not often used in these discussions nor in elementary books on logic. Click here for a discussion of joint denial.



Section 3   Logical Implication

It is a common form of mental activity to make a conclusion from conditions or available information. Even ancient man could look up at the darkening sky and then prepare for a storm. English has a common grammatical structure to indicate this process of deduction (or logical inference) in the form of "if-then." Two examples of this form are:
(I) if it is raining, then clouds are in the sky
(II) if John is in Canada, then John is in Paris (France)
Of these two compound statements, (I) is true, and (II) is false.

[3.1] (Implication) An implication involving two logical statements is formed when the word "if" is placed before the first statement, called the hypothesisand the word "then" is placed between the two statements, before the second statement, called the conclusion. The implication is false if and only if the hypothesis is true and the conclusion is false.
Notation: hypothesis ==> conclusiuon         (the arrow always points from the hypothesis toward the conclusion)
In symbols, p ==> q is false if and only if p is true and q is false.

The implication itself becomes a logical statement because definition [3.1] gives it a truth value.

This form    if p then q   has two parts, p is called the hypothesis and q, is the conclusion. The hypothesis p and conclusion q are themselves logical statements.

The form    if p then q    can be restated as p implies q
(I) can be restated as:    it is raining  implies  clouds are in the sky.
The connective implies suggests the name (logical) implication.
An implication has the notation:
  if p then q;
  p implies q
  p ==> q
A necessary condition for p is q
A sufficient condition for q is p

[3.2] (Truth table for implication) A truth table for implication p ==> q:
   p   q      p ==> q

   T   T         T
   T   F         F
   F   T         T            (because of this last T, an implication is not logically the same as an equivalence)
   F   F         T

The following statements about truth values for implications are based on [3.2] and on [3.1]:

[3.3a] An implication is itself false only if the hypothesis is true and the conclusion is false.
[3.3b] An implication with a false hypothesis is always true.
[3.3c] In a true implication, a true hypotheses always guarantees a true conclusion.      (logical deduction)

By [3.3b] the implication    4=5 implies q    is true, even if the truth value of q is not known.


[3.4] (Converse of an implication) The converse of an implication is obtained by interchanging the hypothesis and conclusion.
Notation: The implication q ==> p is the converse of the implication p ==> q.
Sometimes that same converse is written p <== q, which also makes q the hypothesis.

The implication "clouds are in the sky implies it is raining" is the converse of "it is raining implies clouds are in the sky"

[3.5] Truth table for converse of p ===> q (using definition [3.3b])
   p   q      p <== q
   T   T         T
   T   F         T            ([3.2b])
   F   T         F            ([3.2a])
   F   F         T            ([3.2b])


In English there are other expressions that are really equivalent to the implication p ===> q:
   the truth of p guarantees the truth of q
   from p it follows that q
   from p one can deduce q
   q if p
   p only if q
   a sufficient condition for q is p
   a necessary condition for p is q




Section 4   Logical Negation

As mentioned earlier, logic is concerned only with truth values.

[4.1] Logical negation Any logical statement that has the opposite truth value to a given statement is the logical negative of that given statement.

For example, "The moon is not smaller than the earth" is a logical negative of "the moon is smaller than the earth". 3 + 4 = 8 is also a logical negative of "the USA is in North America", even though both seem unrelated.

The logical negative of 3>3 cannot be 3<3. Both statements are false. The logical negative must have opposite truth value. 3=3 is the logical negative of 3<3. They have opposite truth values.

Notation: ~p is the logical negative of p. The Spanish tilda denotes negation. It may also be said that ~p is the denial of p.

A safe way to produce a logical negative in English is to precede a statement with the phrase "it is false that." The negative of p: all triangles have 4 sides     is    it is false that all triangles have 4 sides.   

[4.2] Truth table for logical negation:
   p      ~p                (Here the expression being evaluated is ~p
   T      F
   F      T For all (both) possibilities p and ~p have opposite truth values.



Section 5   Evaluating and Comparing Expressions

Algebraic quantities or expressions are familiar ideas:   x2 + 4x + 6,   1/y,   x + 2y - 3z   are expressions in 1,2 and 3 variables respectively. Similarly,   ~p,   p ==> q,   p and q and r and "1+3=4"   are logical expressions in 1, 2, and 3 variables. A statement like "The equator is halfway betwen the North Pole and the South Pole" is an expression with no variables. Intuitiveliy speaking, almost anything with truth value is an expression. Therefore, a logical expression has all the properties of a logical statement. Often it contains variables of unknown truth values. Therefore a table of possibilities is made and the expression is evaluated for each possibility.

A major task of logic is the evaluation and comparison of expressions containing variables. In most cases equivalence or implication will be used in making the comparison. Perhaps one expression implies the other, or one expression is equivalent to the other. A simple example is the proof of the following by a truth table.

[5.1] (Double negative) The   negative of the negative of a logical statement   is logically equivalent to   that logical statement itself.
Notation: ~~p <==> p

This is expected. In algebra   -(-x) = x.

Truth table for ~~p:
   p   ~p      ~~p

   T   F      T
   F   T      F
~p has the opposite truth values of p. ~~p has the opposite truth values of ~p. As a result, p and ~~p have the same truth values for all (both) possibilities. The columns of truth values under p and under ~~p are identical. By [1.2] this proves that p and ~~p are equivalent for all possibilities.

For example, the denial that "Washington is not in the USA" is equivalent to saying that "Washington is in the USA". To say that   it is false that "2 + 3 is not equal to 5" is equivalent to saying that "2 + 3 equals 5". Curiously, the grammars of some languages like Spanish and Russian allow a double negative to be equivalent to a single negative.

Obviously an odd number of negative signs produces a logical statement equivalent to the negative of an original statement. An even number produces a logical statement that is equivalent to an original statement.

~ ~ ~ ~ ~p <==> ~p (odd number of tildas)       ~ ~ ~ ~ ~ ~ ~ ~p <==> p (even number of tildas)



In many discussions the expressions involve more than one variable. They may involve conjunction, alternation, implication, equivalence and negation and a mixture of them. For example,   (p and q) or ~(p => q) or q   is a logical expression of two variables. It has a truth value for each of the four possibilities for p,q. In truth tables the possibilities listed in [1.1],[1.2],[1.3],... will be used. In fact these might be omitted but their sequences will still be understood. For example, the following is a truth table listing the truth values for the four expressions, that are conjunction {2.2], alternation [2.6], implication [3.2] and equivalence [1.6] (the numbers above them will be used for reference):

[5.1]
                                                  3                  4                 5                      6
                                             p and q         p or q         p ==> q         p <==> q
                                                 T                  T                T                     T
                                                 F                  T                F                     F
                                                 F                  T                T                     F
                                                 F                  F                T                     T

It is convenient to state the equivalence of expressions that applies to truth tables.

[5.2] (Equivalent expressions) Two logical expressions are equivalent if they have the same column of truth values under them in a truth table.

Obviously, [5.1] shows no equivalence among the four expressions.

However, there is a situation of one expresssion implying the other. But first a clarification.

[5.3] (Implications involving expressions) A logical expression1 implies a logical expression2   if for no possibility is there a T under expression1 and an F under expression2.

Let     expression1 = p and q,     expression2 = p or q     in table [5.1]. The following is the truth table for these expressions:

                                                  3                 4
                                             p and q         p or q
                                                 T                 T
                                                 F                 T
                                                 F                 T
                                                 F                 F

There is no T under (3) with an F under (4) in the same horizontal row. Therefore conjunction implies alternation:

p and q   ==>   p or q

This means that in these discussions the "inclusive or" is used. The connective "and/or" can be simply written as "or".


Suppose expression1 and expression2 involve variables p and q. A truth table can be constructed containing the four possibilities for the variables:

[5.4] Form of a truth table for evaluating two expressions with variables p and q
   p   q          expression1    expression2
   T   T                   ?                      ?
   T   F                   ?                      ?
   F   T                   ?                      ?
   F   F                   ?                      ?

The question marks represent unknown truth values. They become known when the expressions are evaluated. For example, the table of comparisons for implication and its converse is:

   p   q                p ==> q          p <== q
   T   T                   T                      T
   T   F                   F                      T
   F   T                   T                      F
   F   F                   T                      T

Because of the different columns of truth values under the two expressions, the two expressions are not equivalent.


Now put a connective "and" between the implication to receive a compound expression1. Construct a truth table for the expression 1:
   p   q                (p ==> q)  and  (p <== q)

The parenthes indicate that what is in side them must be evaluated first. Therefore expand the header to:

                              3                           7                                          8
                        (p ==> q)             (p <== q)                 (p ==> q)  and  (p <== q)
                              T                          T                                          T
                              F                          T                                          F
                              T                          F                                          F
                              T                          T                                         T

The expressions 3 and 7 have already been evaluated in a previous table above. The truth values in column 8 are determined by the truth values in columns 3 and 7 and the truth values for conjunction.

The truth values in column 8 are those for equivalence [1.6]. Attaching that column as column 6 to this table produces the following:

   1   2                                                                                  8                                       6
   p   q                (p=>q)             (p<=q)                 (p=>q)  and  (p<=q)                   p <==> q
   T   T                                                                                  T                                       T
   T   F                                                                                  F                                       F
   F   T                                                                                  F                                       F
   F   F                                                                                  T                                       T

The columns 8 and 6 of truth values are identical. Therefore the expressions 8 and 6 are equivalent. This can be expressed as a useful theorem, replacing variables p,q by expressions:

[5.5] Each of two expressions implies the other   if and only if   they are equivalent.

Reading expression 6 first and then expression 8 supports the following:

[5.6] Equivalent expressions imply each other.


Previous tables show that an implication and its converse are not equivalent. The hypothesis may be false and the conclusion true, making the implication true and the converse false. With an implication and its contrapositive, the situation is different.

[5.7] (The contrapositive) The contrapositive of an implication is obtained by interchanging and negating the hypothesis and conclusion
The contrapositive of p==>q is ~q==>~p

[5.8] Any implication and its contrapositive are logically equivalent. [*]

implication                                contrapositive
p ==> q                                    ~q ==> ~p
If it is raining, then clouds are in the sky      if clouds are not in the sky, then it is not raining
If John is in Washington, then John is in the USA      if John is not in the USA, then John is not in Washington

In the folowing expression1,expression2 are used in place of variables p,q

Suppose an expression1 is known to be true. Either [5.9a] or [5.9b] will prove that an expression2 is true:
  [5.9a] A (true) implication expression1 ==> expression2 provides a direct proof. [*]
  [5.9b] A (true) contrapositive ~expression2 ==> ~expression1 provides an indirect proof [*]


] formulas


Section 6  Logical Formulas

The following is a list of logical formulas. The variables p,q,r below may be replaced by expression1, expression2, expression3 The connectives in brown are always true (tautologies).

[6.1] Two valued logic:
  [a] p and ~p   is always false
  [b] p or ~p

[6.2] Distributive laws:
  [a] p and (q or r)   is equivalent to   (p and q) or (p and r) [*]                               x(y + z) = xy + xz
  [b] p or (q and r)   is equivalent to   (p or q) and (p or r)

[6.3] Transitive law/ Reduction of a chain of implications:
if    (p ==> q) and (q ==> r)    then    (p ==> r)

[6.4] Replacement of equivalence by implication
  [a] if    (p <==> q)    then    (p ==> q)
  [b] if    (p <==> q)    then    (p <== q)

[6.5] Implication in the form of an alternation:
p ==> q   is equivalent to   ~p or q

[6.6] Negation of expressions:
  [a] ~~p   is equivalent to   p                                                  Double negation is positive
  [b] ~(p and q)   is equivalent to   ~p or ~q                            DeMorgan's law
  [c] ~(p or q)   is equivalent to   ~p and ~q
  [d] ~(p ==> q)   is equivalent to   p and ~q

[6.20] Fundamental properties of conjunction [*]
  [a] p and q   is equivalent to   q and p                                   commutative
  [b] p and p   is equivalent to   p                                             idempotent
  [c] if    p and q   then   p
  [d] if    p and q   then   q
  [e] if    (r ==> p) and (r ==> q)    then    r ==> (p and q)           combine conclusions

[6.25] Fundamental properties of alternation [*]
  [a] p or q   is equivalent to   q or p                                       commutative
  [b] p or p   is equivalent to   p                                               idempotent
  [c] if    p    then   p or q
  [d] if    q    then   p or q
  [e] if    (p ==> r) and (q ==> r)    then    (p or q) ==> r              combine hypotheses

[6.30] Three distinguishing properties of equivalence: [*]
  [a] p   is equivalent to    p                                                   reflexive:
  [b] p <==> q   is equivalent to   q <==> p                               symmetric
  [c] if    (p <==> q) and (q <==> r)    then    (p <==> r)              transitive

[6.35] Logical inference, ways of proving the truth of q: [*]
  [a] if   p and (p ==> q)   then   q                                          direct proof of q
  [b] if   p and (~q ==> ~p)   then   q                                       indirect proof of q
  [c] if   (p or q) and ~p    then   q                                         proof of q by elimination

[6.40] Proving an equivalence by proving an implicatiion and its converse:
if    (p ==> q) and (q ==> p)    then    (p <==> q)