Professional Documents
Culture Documents
210 182 Logic PDF
210 182 Logic PDF
210 182 Logic PDF
Notes based on Chartrand, Polimeni & Zhang’s "Mathematical Proofs: A Transition to Advanced Mathematics" (3 Ed.)
Logic
Statements
A statement (or proposition) is a declarative sentence (or assertion) that has a truth
value, i.e. that is either true (T) or false (F), but not both.
Examples
Note that it is not necessary for a statement that its truth value can be determined. For
100
example, we may perhaps never know if the statement "For n = 1010 ; the nth digit in the
decimal expansion of is a 9." is true, but we know it has a truth value.
Open Sentences
A declarative sentence containing one or more variables (where each variable is in some set
or domain) and which becomes a statement once the variables are given speci…c values from
their domains, is called an open sentence.
Examples
2. Let P (x; y) : x + jy + 1j 1; where the domain of x is the set A = f0; 1; 2g and the
domain of y is the set B = f 1; 0g ; is an open sentence. It is false if (x; y) = (0; 1)
and is true otherwise.
1
Negation of a Statement
The negation (or denial) of a statement P is the statement "Not P " and is denoted P
(or :P ).
Example. The negation of the statement P : "The integer 3 is even." is the statement P:
"The integer 3 is not even." (Since every integer is either even or odd, we can also say that
P is the statement "The integer 3 is odd.")
2
Implication and Biconditional
Given statements P and Q; the conditional statement "If P; then Q:" is called an implica-
tion and is denoted P ! Q (or P ) Q).
P implies Q:
P only if Q.
Q if P .
The statement (P ! Q)^(Q ! P ) ; which we often state as "P if and only if Q." (or
"P is necessary and su¢ cient for Q.", or simply "P i¤ Q:") is called the biconditional
of P and Q and is denoted P ! Q:
For convenience (e.g. to avoid excessive use of parentheses), we will use the following
order of precedence: ; ^; _; !; !:
Logical connectives can be used not only for statements (as we saw above) but also
for open sentences.
3
Consider for example the open sentences
Then
P (x) : x2 6= 4
Q (x) : x 6= 2
P (x) _ Q (x) : x2 = 4 or x = 2
P (x) ! Q (x) : x2 = 4 i¤ x = 2
Note that:
P (x) ^ Q (x) is true precisely when x2 = 4 and x = 2: Hence P (x) ^ Q (x) is true
precisely when x = 2:
4
For example, if P and Q are statements, then P and P ^ (Q ! P ) are compound
statements.
A compound statement is a tautology if it is true for all possible truth values of its
components.
Logical Equivalence
Let P and Q be compound statements composed of the same components (but possibly with
di¤erent connectives). If P and Q take the same truth value for each combination of the
truth values of the components, then we say that P and Q are logically equivalent and
write P Q:
Note that if P; Q; R are statements, then
P P
If P Q; then Q P
If P Q and Q R; then P R:
We also have
P !Q P _Q
5
which can easily be veri…ed by comparing the truth values in the last two columns of the
following truth table.
P Q P P !Q P _Q
T T F T T
F T T T T
T F F F F
F F T T T
It follows that P !Q ( P _ Q) ^ (P _ Q) :
( P) P (double negation)
P _P P and P ^ P P (idempotence)
P !Q Q ! P (contrapositive)
P _Q Q _ P and P ^ Q Q ^ P (commutativity)
(P _ Q) _ R P _ (Q _ R) and (P ^ Q) ^ R P ^ (Q ^ R) (associativity)
P _Q Q; P ^ Q P; P _ R P; P ^ R R
P ^ (P ! Q) P ^ Q and P _ (P ! Q) P !Q
(P ! Q) ! ((P ^ R) ! (Q ^ R))
is a tautology.
6
(a) Using a truth table.
P Q P P !Q P ^Q P ^ (P ! Q) P _ (P ! Q) P !Q
T T F T T T T T
F T T F F F T T
T F F F F F F F
F F T T F F T T
P Q R P !Q P ^R Q^R U S
T T T T T T T T
F T T F F T T T
T F T F T F F T
F F T T F F T T
T T F T F F T T
F T F F F F T T
T F F F F F T T
F F F T F F T T
The last column in the above table shows that S is true for all possible truth values of P;
Q, and R: Hence S is a tautology.
P ^ (P ! Q) P ^ (( P _ Q) ^ (P _ Q))
(P ^ ( P _ Q)) ^ (P _ Q)
(P ^ P ) _ (P ^ Q) ^ (P _ Q)
(P ^ Q) ^ (P _ Q) (since P ^ P is a contradiction)
(P ^ Q) _ ((P ^ Q) ^ Q)
P ^Q
7
( P ) _ (P ! Q) P _ ((P ! Q) ^ (Q ! P ))
P _ (( P _ Q) ^ (P _ Q))
( P _( P _ Q)) ^ ( P _ (P _ Q))
( P _ Q) ^ ( P _ P)
P _Q
P !Q
(P ! Q) ! U (P ! Q) _ ((P ^ R) ! (Q ^ R))
(P ! Q) _ ( (P ^ R) _ (Q ^ R))
(P ! Q) _ ( P_ R) _ (Q ^ R)
(P ! Q) _ P _ (( R _ Q) ^ ( R _ R))
(P ! Q) _ P _( R _ Q)
((P ! Q) ^ P ) _ ( R _ Q)
P_ Q_ R_Q
( P_ R) _ ( Q _ Q)
Q _ Q; which is a tautology.
Quanti…ed Statements
We have seen that an open sentence P (x) (where x is in a domain S) can be changed into
a statement by specifying a value for x: Another way to change it into a statement is by
quantifying it, i.e. adding such phrases as "for every x 2 S" or "for some x 2 S" to obtain
the quanti…ed statements:
8
The symbols 8 and 9 are respectively called universal quanti…er and existential quan-
ti…er.
There are several ways of expressing quanti…ed statements, e.g.:
"For every x 2 S; P (x) :" can be written "For each x 2 S; P (x) :", "P (x) for all
x 2 S.", "If x 2 S; then P (x)."
"For some x 2 S; P (x) : can be written "There exists x 2 S such that P (x) :", "There
is x 2 S such that P (x) :"
Note that if S = ;; then "8x 2 S; P (x)" is true and "9x 2 S; P (x)" is false for all open
sentences P (x) :
For open sentences with two or more variables, similar logical equivalences hold. For exam-
ple,
Note that, in general, the statements "9x 2 S; 8y 2 T; P (x; y)" and "8x 2 S; 9y 2
T; P (x; y)" are not logically equivalent.
9
Example. Let S = T = Z and let P (x; y) be the statement x + y is odd. Then
9x 2 S; 8y 2 T; P (x; y) means "There is an integer x such that for each integer y; x + y is
odd." This sentence is false since x + x is not odd.
However, 8x 2 S; 9y 2 T; P (x; y) means "For each integer x; there is an integer y such that
x + y is odd.", which is true since x + (1 x) is odd.
Note. There are other quanti…ers (in addition to 8 and 9) that can be applied to open
sentences. One such is the quanti…er 9! often used to write existence-uniqueness statements
such as
9!x 2 S; P (x)
and which means "There exists a unique x in S such that P (x).", or, in symbols,
10