Processing math: 100%
Lecture Notes: Basic Proof Techniques
Preliminaries
- Name tags
- Sign in
- Announce TA hours
Course Content
Tuesday Review
Questions:
- Write the Extended Pigeonhole Principle, Alternate Version
- Use the Pigeonhole Principle to prove that for a group of 25 people, there is some day of the week for which at least four people were born on that day.
Answers:
Thursday Review
- Sit with your assigned group
- Review your answers to Written Assignment 1
- Identify questions you would like to discuss as a class
The Importance of Mathematical Language
- Write: Everybody loves somebody
- But what does this really mean? Does it mean:
- Write: For every person A, there is a person B such that A loves B.
- Or perhaps: There is a person B such that for every person A, A loves B.
- Notation: ∀ means “for all,” “for any,” “for every”
- Notation: ∃ means “there exists” or “for some”
- Using this notation, “For every person A, there is a person B such that A loves B” can be written succinctly as: ∀x∃yL(x,y)
- L(x,y) is the “loves” relationship, meaning that x loves y.
- Or to express that “There is a person B such that for every person A, A loves B.” you would write: ∃y∀xL(x,y)
- We won’t use relationship notation until later in the course.
- We will be using “for all” and “there exists” notation (e.g., to show that something is true for all integers).
Constructive Proofs
- Write: Theorem: Every odd integer is equal to the difference between the squares of two integers.
- An odd integer can be written as 2k+1
- Give examples of squares from 02 to 42
- We call the squares of integers “perfect squares”
- Give examples of odd integers: 1, 3, 5, 7 for k=0,1,2,3
- And show each square can be written as the difference of squares. For example:
1=1−0=12−02
3=4−1=22−12
5=9−4=32−22
7=16−9=42−32
- Identify the pattern: (k+1)2−k2=k2+2k+1−k2=2k+1
-
Write: Proof: Any odd integer can be written as 2k+1 for some integer k. We can rewrite that expression:
2k+1=(k2+2k+1)−k2 (adding and subtracting k2)
=(k+1)2−k2 (writing the first term as a square)
Now let m=k+1 and n=k.
Then 2k+1=m2−n2, so we have identified integers m and n with the properties that we claimed.
- Notes on style:
- Argument is written in full sentences
- Clear structure: works from the assumption to the conclusion
- Rigorous: uses a mathematical definition of an odd number
- Convincing: uses the appropriate amount of detail
- Definition: An algorithm describes a series of steps in sufficient detail that it can be carried out mechanically by a machine or person.
-
Definition: A constructive proof describes an algorithm for finding the thing that the proof says exists.
- Write pseudocode for finding the difference of squares for a particular odd integer.
- In lab, you will implement this as a Python program.
Logical Equivalence
- Two statements are equivalent if one statement is true whenever the second is true, and vice versa. That is, either both statements are true, or both are false.
- For example:
- “The sun is up” and “it is daytime” are equivalent
A mathematician would write: Write: “The sun is up if and only if it is daytime.”
- “A number is odd” and “a number is not even.”
A mathematician would write: “An integer n is odd if and only if n is not even.”
- Ask: Other examples?
- iff means “if and only if,” meaning the statements are equivalent.
- Let’s refer to the different parts of the equivalence with symbols:
p is “the sun is up”
q is “it is daytime”
- p and q are propositions. Propositions can be true or false.
- p iff q is an equivalence. An equivalence is a shorter way of writing these two statements:
if p then q: “if the sun is up, then it is daytime”
if q then p: “if it is daytime, then the sun is up”
- Furthermore, each of these statements can be rewritten as their contrapositive without changing their meaning:
if not q then not p: “if it is not daytime, then the sun is not up”
if not p then not q: “if the sun is not up, then it is not daytime”
- Take a minute to read the original statements and their contrapositives, and convince yourself they are logically equivalent.
Direct Proof
- Next, we will prove an equivalence:
- Write: Theorem: For any integer n, n2 is odd iff n is odd.
- To prove an equivalence, we must prove the statements in both directions.
- Write: Proof, part 1: Prove that if n is odd, then n2 is odd.
If n is odd, then n=2k+1, where k is some other integer.
n2=(2k+1)2
=4k2+4k+1
=2(2k2+2k)+1
Let j=2k2+2k. Then n2=2j+1, meaning that n2 is odd.
- Next, we prove the other statement.
- Write: Proof, part 2: Prove that if n2 is odd, then n is odd.
First, we rewrite the statement as its contrapositive:
“if n is not odd, then n2 is not odd,” or equivalently:
“if n is even, then n2 is even.”
If n is even, then it can be written as n=2k, where k is some other integer. Then:
n2=(2k)2
=4k2
=2(2k2)
Thus, n2 is also even.
- Using this theorem, it is easy to prove the following:
- Write: Corollary: If n is odd, then n4 is odd.
- Write: Proof: Since n is odd, our theorem says n2 is odd.
- Using the theorem again, since n2 is odd, (n2)2=n4 is also odd.
Inverse, Converse, Contrapositive
- Let’s take a closer look at the theorem we proved
- The statements we proved are implications:
Write: Implications have the form: “if p then q”
Example: “if you live in MA, then you live in the USA”
- We chose to prove the contrapositive of an implication, since contrapositives are logically equivalent
- Write: Contrapositive: “if not q then not p”
“if you do not live in the USA, then you do not live in MA”
- There are two related ways to change implications, but these are not logically equivalent to the original implication
- Write: Inverse: “if not p then not q”
“if you do not live in MA, then you do not live in the USA”
- We negate both parts of the implication
- Ask: Can someone give an example that disproves the inverse?
- Write: Converse: “if q then p”
“if you live in the USA, then you live in MA”
- We change the order of the implication
- Ask: Can someone give an example that disproves the converse?
Rational and Irrational Numbers
- Write: Definition: A rational number can be expressed as the ratio of two integers.
For example: 1.25=54,0.ˉ3=13,…
- Write: Definition: An irrational number cannot be expressed as the ratio of two integers.
For example: π≈3.14,√2≈1.414,…
False Proof
Let a=b. Then:
a2=ab (multiplying both sizes by a)a2−b2=ab−b2 (subtracting b2 from both sides)(a+b)(a−b)=b(a−b) (factoring both sides)(a+b)=b (dividing both sides by a−b)2b=b (substituting a for b, since a = b)2=1 (dividing both sides by b)
- Read each step, and see if you can catch the step where we made a mistake
- Answer: a−b=0, and dividing by 0 is invalid!
Proof by Contradiction
- In the false proof, we arrived at a contradiction due to a logical error
- In a proof by contradiction, we can prove a statement by arriving at a contradiction without making logical errors
- We will use proof by contradiction to prove:
Write: Theorem: √2 is irrational
Proof: To derive a contradiction, assume √2 is rational, meaning it can be represented as a ratio of integers.
Suppose that √2=ab, where ab is the simplest form of the fraction (explain fraction simplification).
This means that at most one of a and b is even, or else we could simplify further.
√2=abb⋅√2=a (multiplying both sides by b)2b2=a2 (squaring both sides)
Thus, a2 is divisible by 2 (i.e., even).
Write: The “Direct Proof” theorem from earlier.
By our earlier theorem this means a is even, too.
So we can write a=2k, where k is some other integer.
2b2=a22b2=(2k)2 (substituting for a)b2=2k2 (dividing both sides by 2)
Thus, b2 is divisible by 2 (i.e., even). By our earlier theorem this means b is even, too.
This is a contradiction, since we said that at most one of a and b is even!
Since we encountered a contradiction, √2 must be irrational.
Case Analysis Proof
- Earlier, we proved an equivalence (if and only if) by proving two implications
- We will see something similar with this proof, which uses case analysis
- In case analysis, you prove a general statement by proving it for subclasses
- Write: In any group of 6 people, there are either at least 3 who all know each other, or at least 3 who are all strangers to each other. “Knowing” is symmetric: if A knows B, then B knows A.
- Draw: Six vertices, representing people: A, B, C, D, E, F. Connect them in triangle, showing three people who all know each other. Use a different color to show that nobody else knows each other.
- We need to prove our statement for all possible combinations.
- Write: Proof: Pick a person X. Of the remaining 5 people, there must be at least 3 whom X knows, or at least 3 whom X does not know.
- We will prove either subcase.
- Write: Case 1: If X knows at least 3 people.
If none of those 3 know each other: they form a set of 3 who don’t know each other. ✓
If at least 2 know each other: since they also know X, with X they form a set of 3 who know each other. ✓
- Write: Case 2: If X does not know at least 3 people.
If all of those 3 know each other: they form a set of 3 who know each other. ✓
If at least 2 don’t know each other: since they also don’t know X, with X they form a set of 3 who do not know each other. ✓
- Note that the logic of the cases is symmetric. So Case 2 could be rewritten:
- Write: Case 2: If X does not know at least 3 people, then the argument is symmetric to Case 1, reversing the roles of “knowing” and “not knowing.”
- Note that my illustration is an example of a graph
- The people are “vertices” and the connections between them are “edges”
- The statement we proved could be rephrased as a graph coloring problem: in a fully connected graph with six vertices and edges of two colors, we will always find a triangle with a single color
- We will learn more about graphs later in the semester
- Graphs are very relevant to Computer Science, since computer networks are naturally modeled as graphs