Class 2: Proof Methods
Schedule
Before Friday (tomorrow), 6:29pm:
- Read, print, and sign the Course Pledge. You should print the PDF version for signing, and submit a scan of your signed pledge using Collab.
- Read Jeremy Kun’s Habits of Highly Mathematical People.
- Submit a Course Registration Survey (which includes some questions based on Kun’s essay).
Next week:
- Before Tuesday’s class: Read MCS Chapter 2
- Before Thursday’s class: Read MCS Chapter 3
- Due Friday at 6:29pm: Problem Set 1
Sorry the proof in class got so messed up! Although part of my goal for class today was to illustrated the subjectiveness of human-written and read proofs, I apologize for making things so confusing and broken. I’d updated the notes to include the full proof (hopefully correct now!) at the level of detail intended in class. Its good to see students are being skeptical proof-readers and noticing mistakes like this.
We didn’t get to the “if and only if” proof in the notes in class today, but you are encouraged to try this on your own. We’ll look at this the Well Ordering Principle (Chapter 2) in Tuesday’s class.
Links
Dan Ariely, Honor Codes
The Coq Proof Assistant tool I mentioned in class today is available from https://coq.inria.fr/. (You are not expected to use this for cs2102, or generate proofs at this level of rigor or details, but are certainly welcome to if you want!)
Anatomy of a Miracle, Vanity Fair, June 2009.
Intel’s FDIV bug (there’s even a web page for jokes about Intel’s FDIV bug).
How should one decide what can be accepted as an axiom, and what must be proven?
What is the purpose of a proof? (in cs2102? in software development? in algorithm design?)
Proof from Class
Proposition: If the product of $x$ and $y$ is even, at least one of $x$ or $y$ must be even.
Our goal is to prove the implication, $P \implies Q$, where:
- $P$ is “the product of $x$ and $y$ is even”
- $Q$ is “at least one of $x$ and $y$ must be even”
We will prove the contrapositive. The inference rule,
$$ \infer{P \implies Q}{NOT(Q) \implies NOT(P)} $$ will be the last step in our proof. To be able to use this rule, we need to make the antecedent true. So, our goal is to prove $NOT(Q) \implies NOT(P)$.
To prove an implication, we assume the left side and short the right side. So, our proof begins:
- We prove the contrapositive.
- Assume NOT(at least one of $x$ and $y$ must be even).
- By the meaning of negation, this means both $x$ and $y$ are not even.
- By the “Odd-Even Lemma”, both $x$ and $y$ are odd.
- By the definition of odd, there exist integers $k$ and $m$ such that $x = 2k + 1$ and $y = 2m + 1$.
- Substituting, $xy = (2k + 1)(2m + 1) = 4mk + 2m + 2k + 1 = 2(2mk + m + k) + 1$.
- By the closure of addition and multiplication over the integers, there is some integer $r = 2mk + m + k$, so $xy = 2r + 1$.
- By the definition of odd, $xy$ is odd.
- By the (not proven) “Even-Odd Lemma”, this means $xy$ is not even.
- So, we have shown NOT(the product of $x$ and $y$ is even).
- Since we concluded this starting from the assumption (step 2), this proves the implication: NOT(at least one of $x$ and $y$ must be even) $\implies$ NOT(the product of $x$ and $y$ is even).
- Using the contrapositive inference rule, we can conclude: the product of $x$ and $y$ is even $\implies$ at least one of $x$ and $y$ must be even. \QEDA
\dbox{ {\bf Challenge Problem Opportunity.} I wasn’t very satisfied with my proof of the “Odd-Even Lemma” in class. I hope a student will come up with a better proof. A proof that passes the “skeptical reader” test and would convince someone with no prior knowledge of odd and even numbers is worth up to 10 bonus points. }
Proving “If and Only If”
Strategy: To prove $P$ if and only if $Q$:
- Prove $P \implies Q$.
- Prove $Q \implies P$.
Definition. The standard deviation of a sequence of values $x_1, x_2, \ldots, x_n$ is $$ \sqrt{\frac{(x_1 - \mu)^2 + (x_2 - \mu)^2 + \ldots + (x_n - \mu)^2}{n}} $$ where $\mu$ is the mean of the values: $$ \mu ::= \frac{x_1 + x_2 + \ldots + x_n}{n} $$.
Theorem 1.6.1. The standard deviation of a sequence of values, $x_1, x_2, \ldots, x_n$ is $0$ if and only if all of the $x_i$ values are equal to the mean of $x_1, x_2, \ldots, x_n$.
The book proves this using a chain of iff implications; prove it using the two-implications strategy.
#
#
#
#
#
#
#
#
In physics, your solution should convince a reasonable person. In math, you have to convince a person who’s trying to make trouble. Frank Wilczek