Administrative info
Trouble logging into accounts?
Card key access
Change office hour room
Lecture notes will be on course website
PA1 out!
Review
A proposition is a statement that must be either true or false.
EX: 2+2 = 4, 2+2 = 3
Logical operators
Unary
¬: negation
Binary
∧: and (conjunction)
∨ : or (disjunction)
⊕: xor (exclusive or)
=>: implies
<=>: iff
Truth table
Illustrates logical operators
P Q P∧Q P∨Q P⊕Q P=>Q P<=>Q
T T T T F T T
T F F T T F F
F T F T T T F
F F F F F T T
Implications
1+1=3 => 1+1=2
1+1=3 => 1+1=4
Converse
1+1=2 => 1+1=3
1+1=4 => 1+1=3
Contrapositive
1+1≠2 => 1+1≠3
1+1≠3 => 1+1≠4
A predicate is a proposition that depends on variable(s)
P(x) = "x > 0"
Q(x, y) = "x > y"
Quantifiers
Universe over which quantifier acts
N, Z
Make sure to mention this early in semester; later, might elide if
obvious
Forall
∀x∈N . x > 0
Exists
∃x∈N . x > 0
======
More quantifiers
EX:
"the square of a number is always non-negative"
∀x∈N . x^2 >= 0 (true)
"there is a number that is its own square"
(∃x∈N)(x = x^2)
"doubling a number always makes it larger"
∀x∈N . 2x > x (false; x=0)
∀x∈N . 2x >= x (true.)
but: latter proposition is false in integers! (x<0)
highlights need to include set over which you're quantifying
Domain of statement can be further restricted using implications
"The square of all natural numbers greater than 5 is greater
than 25."
∀x∈N . x > 5 => x^2 > 25
Is predicate true for x = 2? Why?
Is predicate true for x = 6? Why?
Can combine quantifiers
(∀x∈Z)(∀y∈Z)(x^2 - y^2 = (x-y)(x+y))
Equivalent to extra parens around everything after the first
quantifier.
True or false?
∀x∈N ∃y∈N . x = 2*y (false in integers; true
in reals)
∀x∈N ∃y∈N . y = x^2 (true)
(note: y is allowed to depend on x; think of this as a game
where you pick x, then I pick y, and I win if y=2x; the
proposition is true if I have a winning strategy that lets me
win no matter what you do)
In English: "the square of every natural number is a natural
number"
∃x∈N ∃y∈N . y = 2*x (true)
∀x∈N ∀y∈N . y = 2*x (false)
Order of quantifiers matters! Not commutative,
∃y∈N ∀x∈N . y = x^2 (false)
In English: "there is a natural number that is the square of
every natural number", i.e the square of every natural number
is the same!
De Morgan's law
Can move negation inside quantifier, flips quantifier.
¬∃x∈N . ∀y∈N . y <= x
==> ∀x∈N . ¬∀y∈N . y <= x
==> ∀x∈N . ∃y∈N . ¬(y <= x)
==> ∀x∈N . ∃y∈N . y > x
EX: (Lewis Carroll, author of "Alice in Wonderland")
Universe of Discourse = 'Creatures'
"All bears are fierce"
"Some bears do not drink Peet's coffee"
"Some fierce creatures do not drink Peet's coffee"
Let B(x) = "x is a bear"
Let F(x) = "x is fierce"
Let P(x) = "x drinks Peet's coffee"
Express below using ∀, ∃:
"All bears are fierce"
∀x∈Creatures . B(x) => F(x)
"Some bears do not drink Peet's coffee"
why not ∃x∈Creatures . B(x) => ¬P(x)?
∃x∈Creatures . B(x) ∧ ¬P(x)
"Some fierce creatures do not drink Peet's coffee"
∃x∈Creatures . F(x) ∧ ¬P(x)
======
Proofs
Now that we know how to make a statement that has a definite truth
value, we want to be able to prove what the truth value actually is.
I'll show you some proofs. The important point is not these
particular proofs, but rather to use these as examples to learn what
is a valid proof and how to recognize a correct proof.
DEF: "axiom" is a proposition that we assume is true without proof
EX: Peano axioms for natural numbers
DEF: "theorem" is a proposition that we can prove to be true
DEF: "conjecture" is a proposition that we think is true but don't
know how to prove
How to prove implications X => Y? Assume X, prove that Y follows.
Thm: P => (P ∨ Q)
Proof: By enumeration. Draw a truth table; this holds in all cases.
QED.
Alternatively:
Thm: P => (P ∨ Q)
Pf: Assume P. Then P ∨ Q (using the rule that if we know X,
we can deduce X ∨ Y). Therefore P => (P ∨ Q). QED.
Thm: P => (P ∨ Q)
Pf: There are only two cases:
1) P is true.
In this case, P ∨ Q is true, and "anything => true",
so X => (P ∨ Q) is true for all X, and in particular,
P => (P ∨ Q).
2) P is false.
In this case, "false => anything", so P => anything is true,
and in particular, P => (P ∨ Q).
In either case, P => (P ∨ Q) is true. These are the only two
cases possible. QED.
Notice how this is the same proof, just much more elaborate.
How to prove existential statement?
Give an example. (Sometimes called "proof by example.")
Thm: ∃x∈N . x = x^2
Pf: 0 = 0^2 = 0
How to prove universal statement?
Much harder; need to prove for every instance.
In general, consider arbitrary instance x, prove it for x without
making any assumptions about x, conclude that your proof works for
every x.
Theorem: For every n∈N, n^3 - n is divisible by 3.
Proof: Consider any n∈N. n^3 - n = (n-1)n(n+1). One of these is
divisible by three, since they are consecutive. Three divides the
RHS, so it must divide the LHS. So 3 divides n^3. This is true for
any n we choose; our choice of n was completely arbitrary, so it
must be true for all n.
Theorem: For every n∈N, n^3 - n is divisible by 3.
Proof: Consider any n∈N. There are three cases:
case 0: n=3k for some k∈N:
n^3 - n = (3k)^3 - 3k = 27k^3 - 3k, which is divisible by 3.
case 1: n=3k+1 for some k∈N:
n^3 - n = (3k+1)^3 - (3k+1) = 27k^3 + 27k^2 + 6k, which is divisible
by 3.
case 2: n=3k+2 for some k∈N:
n^3 - n = (3k+2)^3 - (3k+2) = 27k^3 + 54k^2 + 33k + 6, which is
divisible by 3.
These 3 cases exhaust all the possibilities, and in every case,
n^3 - n is divisible by 3. So therefore n^3 - n is divisible by 3
for any n we choose; our choice of n was completely arbitrary, so
it must be true for all n.
Question for break
Can you prove the following:
Theorem: For every n∈N, n is even <=> n^2 is even.
Try splitting into two.
Theorem: For all n∈N, n is even => n^2 is even.
Proof: Assume n is even. Then n=2k for some k∈N.
Plugging in, n^2 = (2k)^2. So n^2 = 4k^2 = 2 * (2k),
which is twice an even number. This means that n^2 is even.
Q: Why is this OK? Why can we just assume that n is even?
Proof by contrapositive
Theorem: For all n∈N, if n^2 is even, then n is even
How would you go about proving this? We can assume that n^2 = 2k for
some k, but then what? What can we say about sqrt(2k)?
Instead, let's look at the contrapositive of the statement:
if n is odd, then n^2 is odd
This seems more promising, since we don't have to deal with sqrts.
Theorem: For all n∈N, if n^2 is even, then n is even
Proof: Let n be arbitrary. We prove the contrapositive that if n is
odd, then n^2 is odd. Assume that n is odd. Then n = 2k+1 for some
k∈N. Then n^2 = (2k+1)^2 = 4k^2 + 4k + 1 = 2l + 1, where l =
2k^2+2k. Thus, n^2 is odd. QED.
Having proven both the last two theorems
∀n∈N . n even => n^2 even
∀n∈N . n^2 even => n even
we can conclude that
∀n∈N . n even <=> n^2 even
Proof by contradiction
Assume opposite of what we are trying to prove. Show that it leads
to an impossible situation. So our assumption must have been false.
Theorem: x^5 - x + 1 = 0 has no solution in the rationals.
Lemma: If x^5 - x + 1 = 0 and x=a/b for a,b∈Z, then both a and b
are even.
Proof of lemma: We have (a/b)^5 - a/b + 1 = 0. Multiplying by b^5,
we get a^5 - ab^4 + b^5 = 0;
Now consider possibilities for parity of a and b:
Case 1: a odd, b odd
Then we get odd - odd + odd = even. Impossible.
Case 2: a even, b odd
Then we get even - even + odd = even. Impossible.
Case 3: a odd, b even
Then we get odd - even + even = even. Impossible.
Case 4: a even, b even
Then we get even - even + even = even. Possible.
Since case 4 is the only one that is possible, it must be that a
and b are both even.
Proof of theorem:
Suppose (for a contradiction) that there exists some rational
number x such that x^5 - x + 1 = 0. Then we can write x = a/b,
with a∈Z, b∈N, b ≠ 0. There may be many such a and b, so
let's choose the a and b that make b minimal, so that a and b have
no common factors (i.e. a/b is a reduced fraction). By the lemma,
it must be that a and b are even. But then a/b is not a reduced
fraction, since 2 is a common factor of both a and b!
(Alternative: But then let a'=a/2, b'=b/2, then x=a'/b'. So b is
not minimal!)
This is a contradiction, so our initial assumption must have been
wrong.