FR UB4 EVak AESawh
FR UB4 EVak AESawh
Douglas Bauer
1 Symbolic Logic
• 10 is a prime number
•4x2=8
• George Washington was mayor of N.Y.C.
• This class has 35 students
• 10100 can be written as the sum of 2 primes
1
In what follows, the propositions p and q are often called
atomic propositions or atoms. We now define a number of
compound propositions.
1. Negation
p ¬p
F T
T F
2. Conjunction(and)
p q p∧q
F F F
F T F
T F F
T T T
3. Disjunction(inclusive or)
p q p∨q
F F F
F T T
T F T
T T T
2
4. Implication
p q p→q
F F T
F T T
T F F
T T T
• if p, then q
• p only if q
• q if p
• q whenever p
Definition: Converse: q → p.
Definition: Inverse: ¬p → ¬q.
Definition: Contrapositive: ¬q → ¬p.
3
5. Logical Equivalence
p q p↔q
F F T
F T F
T F F
T T T
4
Examples of Tautologies
Note: The first 2 above are called DeMorgan’s Laws. The last
shows that the truth or falsity of a statement is the same as
that of its contrapositive. This can be proved with a truth
table.
Note: Do the truth tables for DeMorgan’s Laws and for some
of the other logical equivalences on page 14 of the text.
5
Valid Arguments
• G: being great
• M: being misunderstood
G M G → M (G → M ) ∧ G [(G → M ) ∧ G] → M
F F T F T
F T T F T
T F F F T
T T T T T
6
Example:
1. P: x is positive
2. N: x is negative
3. G: x2 > 0
P N G P ∨ N P → G N → G [(P ∨ N ) ∧ (P → G) ∧ (N → G)] → G
F F F x x x x
F F T x x x x
F T F x x x x
F T T x x x x
T F F x x x x
T F T x x x x
T T F x x x x
T T T x x x x
7
Here are some fallacies:
8
Example:
H F ¬F H → ¬F ¬H (H → ¬F ) ∧ ¬H [(H → ¬F ) ∧ ¬H] → F
F F T T T T F
F T F T T T T
T F T T F F T
T T F F F F T
9
Sometimes it is not easy to quickly determine if an argument
is valid.
• F : horses fly
• A: cows eat artichokes
• M : mosquito is the national bird
• P : peanut butter tastes good on hot dogs
10
Proving Theorems
11
7. For any real number x, the floor of x, denoted bxc, is
the unique integer n such that n ≤ x < n + 1.
8. For any real number x, the ceiling of x, denoted dxe, is
the unique integer n such that n − 1 < x ≤ n.
9. We say d divides n, denoted d|n if, and only if, there
exists an integer k such that n = d · k.
Proof: p: 5 is prime.
p ¬p p ∨ ¬p
F T T
T F T
Implication
p q p→q
F F T
F T T
T F F
T T T
12
Methods of Proof
13
4. Indirect Proof: Prove ¬q → ¬p directly.
Case 1: n = 4q + 1.
Case 2: n = 4q + 3.
14
6. Reductio ad Absurdum or Proof by Contradiction: To
prove a proposition p, assume p is false and show this
leads to an absurd conclusion. Thus p must be true.
√
Theorem 1.7 2 is irrational.
√
Proof: Suppose 2 = m/n, i.e., it is rational. We may
assume that m/n is reduced to lowest terms. Then
(a) 2 = m2/n2
(b) m2 = 2n2
(c) m2 is even
(d) m is even
(e) m = 2k for some integer k
(f) By (b), 4k 2 = 2n2
(g) n2 = 2k 2
(h) n2 is even
(i) As in (d), n is even
Thus both m and n are even, and hence m/n is √ not
reduced to lowest terms, a contradiction. Thus 2 is
irrational.2
2
√
Theorem 1.8 If k 6= a for any integer a, then k is
irrational.
√
Corollary 1.9 2 is irrational.
15
To disprove a theorem it is only necessary to construct one
counterexample.
Proof: 4 + 2 = 6.
16
2 Quantifiers
The following are not propositions. They are often called open
sentences or open propositions.
1. y > 5
2. He is tall
3. x is a rational number
4. x1 ∨ x2 ∨ . . . ∨ xn = 4
They are not true or false until values are assigned to the vari-
ables.
1. y
2. He
3. x
4. x1, x2, . . . , xn
1. >
2. is tall
3. is a rational number
4. =
17
A (unary) predicate with variable x is a formula or sentence
describing the variable x.
Quantification
• for all
• for every
• for any
• for arbitrary
• for each
18
Definition: Existential quantifier - ∃.
• there exists
• for some
• for at least one
19
Examples:
20
Validity in Predicate Logic
21
Example:
1. ∀x ∃y [x is married to y]
2. ∃y ∀x [x is married to y]
(1) and (2) above are not saying the same thing.
Example: Let D = I.
1. ∀x ∃y [x + y = 10] is true.
2. ∃y ∀x [x + y = 10] is false.
Example: ∀x ∀y ∃z [x + z = y].
22
Question: Since there are infinitely many interpretations of
any quantified proposition, how can we ever decide if a quan-
tified proposition is valid?
Answer: No general algorithm (like using truth tables to de-
cide tautologies) exists to answer this question.
Note: It’s not because we’re too stupid to find the algorithm.
In 1936 Alonzo Church proved that no such algorithm exists.
23
Proving Theorems (again)
25
Theorem 2.6 If the sum of 2 integers is even, then
so is their difference.
26
3 Elementary Set Theory
Examples:
• S = {1, 3, 6}
• S = {0, 2, 4, 6, . . .} - the nonnegative even integers
• S = {x | x is a prime and 10 ≤ x ≤ 20}
A = B ⇔ ∀x [x ∈ A ↔ x ∈ B]
27
The following theorem is used to show 2 sets are equal.
28
Operations on Sets
• A ∪ B = {0, 1, 2, 3}
• A ∩ B = {1, 2}
• A − B = {0}
• B − A = {3}
• A ⊕ B = {0, 3}
• Ac in B is not defined.
29
The following two theorems are immediate.
Theorem 3.4 A ∪ B = B ∪ A.
Theorem 3.5 A ∩ B = B ∩ A.
Case 1: x ∈ C.
Then x ∈ B ∪ C. Thus x ∈ A ∪ (B ∪ C).
Case 2: x ∈ A ∪ B
Then x ∈ A ∨ x ∈ B. If x ∈ A, then x ∈ A ∪ (B ∪ C). If
x ∈ B, then x ∈ B ∪ C. Hence x ∈ A ∪ (B ∪ C).
30
The next theorem says that set intersection is also associative.
(10 − 5) − 2 = 5 − 2 = 3 and 10 − (5 − 2) = 10 − 3 = 7.
31
There is a version of De Morgan’s Laws that is exactly anal-
ogous to the version we’ve seen concerning the connectives ∨
and ∧. We’ll state them without proof for now.
1. (A ∪ B)c = Ac ∩ B c.
2. (A ∩ B)c = Ac ∪ B c.
32
Answer: |P (A)| = 2n. Every subset of A can be thought of
as assigning a 0 or 1 to each element in A. There are 2n ways
to do this.
0 0 0 φ
0 0 1 {3}
0 1 0 {2}
0 1 1 {2, 3}
1 0 0 {1}
1 0 1 {1, 3}
1 1 0 {1, 2}
1 1 1 {1, 2, 3}.
33
Definition: A collection of nonempty sets {A1, A2, . . . , An} is
a partition of a set A if, and only if
1. A = A1 ∪ A2 ∪ . . . ∪ An;
2. A1, A2, . . . , An are pairwise disjoint.
Two n-tuples (u1, u2, . . . , un) and (v1, v2, . . . , vn) are equal iff
ui = vi, 1 ≤ i ≤ n.
34
Definition: The Cartesian Product of sets S and T , de-
noted SxT , is the set of all ordered pairs (s, t), where s ∈ S
and t ∈ T , i.e., SxT = {(s, t) | s ∈ S ∧ t ∈ T }. If S = T we
denote SxT as S 2.
Some Examples:
1. A = {1, 2}, B = {3, 4}. AxB = {(1, 3), (1, 4), (2, 3), (2, 4)}.
2. φxA = Axφ = φ.
3. If R is the real numbers, then R2 = RxR represents the
points in the plane. In general, Rn = RxRx . . . xR are
the points in n dimentional space. If C is the complex
numbers, then C = RxR, e.g., 3 + 5i is identified with
(3, 5).
4. Let A1 = A2 = · · · = An = {0, 1}. Then A1xA2x . . . xAn =
{0, 1}n. What is |{0, 1}n|?
5. A = {x, y}, B = {1, 2, 3}, C = {a, b}.
Then (AxB)xC = {((x, 1), a), ((x, 2), a), ((x, 3), a), ((y, 1), a),
((y, 2), a), ((y, 3), a), ((x, 1), b), ((x, 2), b), ((x, 3), b),
((y, 1), b), ((y, 2), b), ((y, 3), b)}.
35
Formal Languages
Example: Σ = {a, b}. Then aba, bb, aab are strings over Σ.
36
Definition: The set of nonempty strings over an alphabet Σ
is given by Σ+. If we wish to include the empty string, we use
Σ∗, i.e., Σ∗ = Σ+ ∪ {e} is the set of all finite strings over Σ.
37
Before leaving “elementary” set theory, we discuss Russell’s
Paradox. This will indicate that set theory is more compli-
cated than it first appears.
Russell’s Paradox
• John ∈ S1
• John ∈
/ S2
• John ∈
/ S3
• S1 ∈ S2
• S1 ∈
/ S3
• S2 ∈ S3
38
Note: It is also possible for a set to be an element of itself.
• If S ∈ S, then S ∈
/ S.
• If S ∈
/ S, then S ∈ S.
Russell, together with A. N. Whitehead, spent 10 years writ-
ing Principia Mathematica to correct this problem and put set
theory back on a firm foundation. A simple solution, given in
our book, is to require that whenever a set is defined using a
predicate as a defining property, it must be stipulated that the
set is a subset of a known set. Thus we can not talk about
“the set of all sets that are not elements of themselves”. We
can only talk about “the set of all sets that are elements of a
“collection” of sets and are not elements of themselves”.
39
Let U be a collection of sets.
S = {A ∈ U | A ∈
/ A}.
Question: Is S ∈ S?
Halting Problem
40
The argument is similar to the one used in Russell’s Paradox.
Now run algorithm Test with input Test, i.e., run Test(Test).
41