When studying logic, we presuppose that statements have a truth value, and we are basically interested in the truth value of compound statements, that is, statements whose truth value depends on the truth value of simpler statements.
For examples and practice, see the exercises below.
A common error is to write the negation of "x < 3" as "x > 3". To see this is incorrect, suppose x = 3. Then "x < 3" and "x > 3" are both false. The correct negation of "x < 3" is "x >= 3".
In mathematics, the most commonly used logical operators are:
Here are the basics:
For examples and practice, see the exercises below.
Clearly the first conditional is not logically equivalent to its converse or inverse.
For examples and practice, see the exercises below.
To negate a statement with a quantifier, change the quantifier and negate the statement. In symbols, ~(x, p(x)) is equivalent to x, ~p(x). Also, ~(x, p(x)) is equivalent to x, ~p(x)
For example. The negation of
For examples and practice, see the exercises below.
Consider the statement:
For this reason, proving an equivalence usually requires two separate proofs.
Furthermore, implications and equivalences are useful because one side may be substituted for the other in any argument (provided one follows the arrows), without affecting the validity of the argument.
Some useful tautologies, along with their traditional names, are
Negations
The simplest compound statement is called the negation. We usually use the English word "not" to indicate a negation. By definition, the negation of a statement is a new statement with the property that, if the statement is true, then the negation is false, and vice versa. The negation of a statement p is denoted ~p, pronounced "not p".
Other Logical operators
Besides negating a statement, we get a compound statement by joining two statements together using logical operators indicated in English by "and", "or", "if ... then..." etc. While there are many English words and phrases that are used as logical operators, each of these is equivalent to one of only 16 possibilities.
Besides knowing and agreeing on these basic definitions so that you and I both know when a compound statement is true or false, what logical rules are important for us to know for this class? (p -> q) /\ (q -> p)
Conditionals
The most often encountered logical errors occur when using conditional statements. Given a conditional "p -> q", there are 3 closely related conditional statements:
The conditional and its contrapositive are logically equivalent, as are the converse and inverse, but the original conditional is not equivalent to either the converse or the inverse. To illustrate, consider the following conditional and its three relatives:
Note that if x > 5 then all these conditionals are true. (Check it out!)
If 0 < x <= 5 then the conditional and its contrapositive are true while the converse and inverse are false. (Check it out!)
Quantifiers
Many statements contain variables and therefore may be true for some values of the variable and false for others. For example, consider the following statements:
In (1) the variable is obviously x, which stands for any real number. In (2) the phrase "a triangle" and the word "it" refer to any conceivable triangle. We let p(x) denote a statement whose truth value depends on a variable x. Statement (1) is true if we are saying that there is at least one real number x >= 0. On the other hand, it is false if we are saying that every real number x >= 0. Hence we need a quantifier to tell us "how many" values of x there are for which p(x) is true. We distinguish two quantifiers.
When a statement with a variable is made and there is no quantifier specified, we usually assume the universal quantifier.
If |x| > 1 then x > 0 for all real numbers x
is
There exists a real number x with |x| > 1 and x <= 0
Logical Relations
Besides numbers, the statement 1+ 2 < 8 has the two familiar symbols "+" and "<". The first is an arithmetic operator. Its job is to operate on two numbers to give a third. The symbol "<" combines two expressions for numbers into a statement that has a truth value (in this case, the statement is true.) In logic, there are two relations of importance, namely implication and equivalence.
Operator Denoted Meaning p implies q p => q p -> q is always true. p is equivalent to q p <=> q p <-> q is always true. For all x, if x > 0 then x^2 > 0
Let us check some cases.
Clearly the conditional is always true, so that it is correct to say
For all x, x > 0 implies x^2 > 0
For all non zero x and y, xy > 0 iff x and y have the same sign.
This means that both of the following statements are true:
If xy > 0 then x and y have the same sign
and
If x and y have the same sign, then xy > 0.
Tautologies and proofs
We will see lots of meaningful proofs in the course of this semester, so I will not try to cover all the possible types of proofs abstractly at the beginning. Here it is sufficient to make the following observation. A tautology is a statement that is true for every assignment of truth values to its components. Tautologies play a key role in the construction of proofs for two reasons. The first is given in [SM, 27]
In writing proofs, a working knowledge of tautologies is helpful for several reasons. One reason is that a sentence whose symbolic translation is a tautology may be used at any time in a proof. For example, if a proof involves a number x, one could at any time correctly assert "Either x = 0 or x 0" since this is an instance of the tautology p \/ ~p.
p \/ ~p Excluded middle p -> q <=> ~q -> ~p Contrapositive p /\ (q \/ r) <=> (p /\ q) \/ (p /\ r) Distributivity p \/ (q /\ r) <=> (p /\ q) \/ (p /\ r) Distributivity p -> (q /\ ~q) <=> ~p Contradiction (p -> q) /\ (q -> r) => (p -> r) Transitivity (p -> q) /\ p => q Modus Ponens (p -> q) /\ ~q => ~p Modus Tollens (p \/ q) /\ ~p => q
Exercises and Practice
Return
Return
Return
Return
This small pamphlet (120 pages with exercises) covers the basics of propositional and predicate calculus. The terminology "tf-statement" is used where we use "statement", but the prefix "tf-" is quickly dropped, and should cause no confusion.
This treatment reserves the words "proposition" and "denial" where we use "statement" and "negation." They also use "=>" and "<=>" where we use "->" and "<->", respectively, for the logical connectives and do not introduce relations as a separate concept.
p | q | p*q |
T | T | ? |
T | F | ? |
F | T | ? |
F | F | ? |
p | q | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 |
T | T | T | T | T | T | T | T | T | T | F | F | F | F | F | F | F | F |
T | F | T | T | T | T | F | F | F | F | T | T | T | T | F | F | F | F |
F | T | T | T | F | F | T | T | F | F | T | T | F | F | T | T | F | F |
F | F | T | F | T | F | T | F | T | F | T | F | T | F | T | F | T | F |
Fortunately, we do not use a different word for the operator implied by each possible column. It is possible to express each of the possibilities using only negation and 3 or 4 of the operators defined by these columns. All the rest are can be expressed as more or less complicated expressions involving these simple operators.
Specifically, in column 8 we find our compound statement is true only when p and q are both true. This is the logical operator we always mean when we say the word "and". In column 2 we find that the compound statement is true whenever p or q is true. This is the logical operator we always mean when we say the word "or". Note that in English, we sometimes use "or" when we mean "p or q but not both p and q." Which column is this? (10). This is called the "exclusive or" since it excludes the case in which we have both p and q true. In mathematics, we are very careful to use the words "but not both" when we mean to exclude this case, or sometimes we use "p xor q".
Column 6 is probably the most important logical operator to understand. This statement is only false when p is true and q is false. This is the conditional statement "if p then q." In common use, we sometimes use the same phrase to mean column 7. In mathematics, we use "p iff q" for column 7. It is important to realize that we must all agree to mean the same thing when we use words in mathematics, and there are many ways to justify this choice of the words "if ... then..." for column 6. Here is one which may at least convince you that this is the better choice.
Mathematicians all agree that the statement "If x > 5, then x > 1" is true for all numbers x. Do you? Surely if "x>5" is true, then "x>1" must be true. If the compound statement is true for all values of x, then it is true when x = 3. In this case, the first statement is false and the second is true. Again, if the compound statement is true when x = 0 then it is true even when both component statements are false. This is why we need to use column 6 as the definition of "If...then..."
Every column can be written in terms of "not", "and", "or", and "if...then...". For example, column 10 could be written "p xor q". It could also be written "p or q and not both p and q". Similarly, column 7 could be written "p iff q". It could also be written "if p then q and if q then p."
Because it is difficult to use several different kinds of operators when making small computer components, it became important to try and find a single logical operator and write everything in terms of that operator. In fact it is possible to write every column using only one operator. First called the "Sheffer stroke", it is column 9, which computer scientists call "NAND" for not (p and q). Equivalently, one can use column 15 which is called "NOR" for not (p or q).
Challenge: Write each of the 16 possible logical operators in terms of NAND only. Return