[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:
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:
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,
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.
The statements
[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:
[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.
[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.
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
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.
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.
[5.1]
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:
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.
[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. [*]
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:
]
[6.1] Two valued logic:
[6.2] Distributive laws:
[6.3] Transitive law/ Reduction of a chain of implications:
[6.4] Replacement of equivalence by implication
[6.5] Implication in the form of an alternation:
[6.6] Negation of expressions:
[6.20] Fundamental properties of conjunction [*]
[6.25] Fundamental properties of alternation [*]
[6.30] Three distinguishing properties of equivalence: [*]
[6.35] Logical inference, ways of proving the truth of q: [*]
[6.40] Proving an equivalence by proving an implicatiion and its converse: