\documentclass[11pt]{article}
\usepackage{macros-course-lectures}

%\makeslides

\begin{document}

\mainlylecture

\lecture{notes1}{What is a Proof?}{1 Feb 00}

\renewcommand{\thepage}{\arabic{page}}

\section{Course Overview}

\forlecture{
6.042, Mathematics for Computer Science \\
\\
Prerequisites: First year calculus. \\
\\
Introductions. \\
Faculty, TAs, secys
}


\subsection{Course Goals and Content}

What we want you to learn this term: thinking (9 lectures), counting (8),
gambling (9)
\begin{enumerate}
\item
Basic discrete math concepts.

Basic data types and structures used in programming and in reasoning
about computer science (numbers, Booleans, strings; sets, functions;
relations, trees, graphs,...). \\
Their properties.

\item
Proofs.

\noindent
How to do them, how to read them, how to recognize correct/incorrect ones.

\noindent
Reasoning about propositions, predicates (with quantifiers). \\
Basic proof strategies: Direct proof, contradiction, cases...\\
Induction (very important in this course and other places in CS).\\
\\
Throughout the term. 

\item
Math foundations for software engineering (6170).


\noindent
Working with Profs. Chapin, Guttag to select material for this course...\\
Models for programs and their required behavior.\\
Showing a program satisfies its requirements.

\item
Analysis methods of discrete math (arises in CS) (6046).

\noindent
Summations of series. \\
Asymptotic analysis, recurrences. \\
Counting methods and theorems; basic combinatorics. \\
Which leads into:

\item
Discrete probability (6046, 6033?)
\end{enumerate}

\noindent
Course also supports 6045 (theory of computation). \\

\noindent
Overall: \\
We want you to learn how to use mathematics to help you think about
concepts in computer science. 

\noindent
(E.g., define abstract models for real-world objects like programs,
computers, communication channels.
Reason about these models carefully, correctly.
Use the conclusions to help understand the real-world objects.)



Careful proofs associated with virtually everything covered
in the course, proofs in class, proofs in homework, lots of
examples of pitfalls in writing proofs ...


This course moves rapidly from topic to topic.
\begin{itemize}
\item Disadvantage:  none last long enough for thorough coverage.
\item Advantage: boredom/confusion is temporary.
\end{itemize}


\subsection{Administrivia}

{\large \bf SIGN UP} {\tt http://bigred.lcs.mit.edu/6.042/}

\noindent
See Handout 1. \\
\\
Lectures, tutorials \\
\\
Handouts \\
\\
Books \\
Old lecture notes, see Fall99 Web site \\
\\
Exams \\
\\
Problem sets \\
\\
Collaboration policy \\
\\
Grading


\section{What are proofs?  Why do we do them?}

{\bf What is a proof?}

Layman's definition of proof: ``A method of ascertaining the truth.''

There are many ways to decide what's true in society and even in science:
\begin{itemize}
\item Law: judge and jury.
\item Religion: inner conviction.
\item Education: reputable authority (e.g., the professor).
\item Science: evidence of experiment/observation (e.g., General
  Relativity, The Big Bang).
\item Statistics: sampling (testing examples).
\end{itemize}
But these methods can go wrong:
\begin{itemize}
\item Conviction: There aren't any bugs in {\em my} programs$\ldots$.
\item Authority: Intel says the Pentium is fine.   Stalin said evolution
  was wrong.
\item Religion: whose?
\end{itemize}
General problem: these methods don't convince everyone.

So mathematics focuses on a particularly convincing kind of
argument: a {\em proof.}
\begin{itemize}
\item Agreement on common language of discussion (syntax, {\bf
    definitions})
\item Precise statement of what your are proving ({\bf propositions})
\item Careful listing of what you are assuming in your proof ({\bf axioms})
\item Agreement on {\bf rules of deduction}
\end{itemize}

In the rest of this lecture, I'll explain what these things are, 
present the most basic proof methods, and give examples.

Idea: specify everything so precisely that everyone is convinced.

Benefit: if there is agreement on assumptions and deduction rules,
that forces agreement on conclusions as well.

Also, even if can't understand entire argument as once, if can
follow/believe each deductive step, can be comfortable accepting
conclusions

By learning to read and do proofs, you will be able to
\begin{itemize}
\item Convince others
\item Find flaws in others' attempts to convince you
\item Find flaws in own proofs, so can figure out what else you need
  to find out or assume
\end{itemize}

%\newpage
\section{Basic data types}

As a first step, we need to agree on some basic language of discourse
so we can say things to each other.  These are our ``nouns.''

\noindent
Reading: \\
Velleman chapter 1, Rosen 1.1-1.5 \\
\\
The standard basic data types used in programming:  numbers, Booleans
(true/false), and strings. \\
\\
And other basic data types used in mathematics: sets, functions. \\
Used in reasoning about programs. \\
\\
This is review for most of you. \\
So I won't lecture about it. \\
Just list the basic notions: definitions, operations, some properties. \\
You will be expected to read this material carefully on your
own, making sure you can do all the study exercises. 

\subsection{Booleans}

\noindent
Velleman 1.1--1.2, Rosen 1.1 \\
\\
Values: 1 (true), 0 (false) \\
Operations: and ($\wedge$), or ($\vee$), not ($\neg$), exclusive-or
($\oplus$). \\
\\
Explain how they work with tables: \\
\\
\begin{tabular}{cc}
$x$ & $\neg x$ \\
\hline 1    &   0 \\
0     &  1 \\
\end{tabular}
\\
\begin{tabular}{ccccc}
$x$ &  $y$  & $x \wedge y$ & $x \vee y$&   $x \oplus y$ \\
\hline 1    & 1   &  1&             1&            1\\ 
1     &0  &   1 &            0 &           0\\
0&     1 &    1  &           0  &          0\\
0 &    0&     0   &          0   &         1\\
\end{tabular}

\subsection{Numbers}

Rosen, Section 1.4 


\subsubsection{Natural numbers}

\noindent
$N = \{ 0, 1, 2, \ldots \}$ \\
\\
Most math books actually let N start at 1, not 0, but computer
scientists like to start counting with 0. \\
We'll stay consistent with texts. \\
I'll write $N^+$ for the positive naturals. \\
\\
Operations: +, - (partial), times, integer div (round down), remainder
(mod), exp \\
\\
Prime number = Any natural number greater than or equal to $2$ that
has no divisors (except itself and $1$). \\
\\
Even, odd ($2x$ vs. $2x + 1$).


\subsubsection{Integers}

\noindent
$Z$: $N$ and negatives 

\subsubsection{Rationals}

$Q$ \\
\\
Defined to be expressible as a ratio of two integers ${a \over b}$,
where $b \neq 0$. \\
\\
Basic property (we might prove later) says can write in lowest terms.


\subsection{Strings}

Over alphabet $A$ of symbols \\
\\
Example: 
$A$ consists of $a, b, c$. \\
Strings: $abc$, $aaa$, $b$, empty string ($\lambda$, no symbols) \\
\\
Operations: concat(string, symbol), concat(string, string)


\subsection{Sets}

Velleman 1.3--1.4, Rosen  1.4--1.5 \\
\\
$\emptyset$, universal set, subset, proper subset \\
power set (define) \\
Cartesian product \\
\\
Operations: union ($\cup$), intersection ($\cap$), complement (overbar) \\
Venn diagrams (show for 2 sets). \\
\\
Some laws about how the ops behave---see Rosen p. 49 \\
E.g.: $A \cup A = A$.


\subsection{Functions}

Rosen, Section 1.6 \\
\\
A rule that assigns an element of one set (range, codomain) to each element of
another set (domain). \\
\\
Properties of functions: \\
One-to-one (no two domain elements get the same range element) \\
Onto (every element of the range gets used) \\
\\
Function inverse, composition ($f \circ g(x) = f(g(x))$)
\\
Pointwise ops (e.g., add, for functions whose range is integers,
$f+g(x) = f(x) + g(x)$) 

\section{Propositions}

Now we have a language.  Let's use it to say some things we might want
to convince people about.

\subsection{What are propositions?}

A {\em proposition\/} is a statement that has a truth value,
$\ms{true}$ or $\ms{false}$. \\
\\
Examples:
\begin{enumerate}
\item
$5$ is a prime number. 

It's a proposition, and it's true. 

\item
$8$ is a prime number. 

A false proposition.

\item
$x$ is a prime number. 

Not a proposition. \\
Has no truth value, because we don't know what $x$ is. \\
It's said to be an {\em unbound variable}. \\

\item
There is an least one prime number. 

A true proposition. \\
In math notation, this can be written as $\exists x (x \mbox{ is a prime})$. \\
The quantifier $\exists$ ``binds'' $x$.

\item
All natural numbers $\geq 2$ are primes. 

A false proposition. \\
This can be written as $\forall x \in N, x \geq 2 (\ldots)$. \\
The quantifier $\forall$ also binds $x$. \\
\\
We will revisit the quantifiers soon (they have their own reasoning
methods). \\
For now, just using them as shorthand notation. \\

\item
All $x$ of the form $n^2 + n + 41$, where $n \in N$, are prime. 

A proposition, but not so immediate to determine if true or false. \\
Can test:  For $n = 0, 1, 2 \ldots$, $x$ is prime. \\
But if $n = 41$, get $41^1 + 41 + 41$ = $41(43)$, not prime. \\
So, false. \\

\item
T, F 

Regarded as special cases of propositions, with the obvious truth
values. 

\item
$\forall A, B (\bar{A} \cup \bar{B} = \bar{A \cup B})$. 

Propositions can be about other things besides numbers, e.g., sets. \\
This one is false. 

\item
$\forall A, B (\bar{A} \cup \bar{B} = \bar{A \cap B})$. \\
$\forall A, B (\bar{A} \cap \bar{B} = \bar{A \cup B})$. \\

De Morgan's laws, true.

\item
The original Pentium chip always divided correctly. 

A false proposition. 

\item White can always win at chess

\item Every even integer greater than 2 is the sum of two prime
  numbers (Goldbach's conjecture, 1742).
\begin{itemize}
\item Raised in {\em The Boston Globe} as ``one of great unsolved mysteries.''
\item Globe gave example: $20=9+11$ (oops).
\end{itemize}

\item
$\exists x, y, z \in N^+, n \geq 3 (x^n + y^n = z^n)$. 

Fermat's last theorem, 1640s, says this is false, but he never proved it. \\
Only recently have we learned for sure that it's false (Andrew Wiles, 1994,
130-page proof.  After months of work, other mathematicians found
bugs. Needed 100s more pages to fix). \\
But even while we didn't know if it's true or false, it was still a
proposition.


\item $a^4+b^4+c^4=d^4$ has no positive integer solutions.
\begin{itemize}
\item Conjectured by Euler (1769).
\item Counterexample by Elkies, 218 years later.
\item Smallest counterexample: $95800^4+217519^4+414560^4=422481^4$.
\end{itemize}

\item Every map can be colored with four colors, so that no two
  adjacent regions have the same color (Four Color Theorem).
\begin{itemize}
\item First ``proved'' in 1879.
\item The ``proof'' stood for 10 years before a flaw was found.
\item Recently proved with computer aid.
\item Still debated whether this is a valid proof
 (need to prove the computer is working correctly).
\end{itemize}

\end{enumerate}

Notes:
\begin{itemize}
\item Not all sentences are propositions:
     \begin{itemize}
     \item $+x**z=f$.
     \item What time is it?
     \item This sentence is false.
     \end{itemize}
\item Propositions involve previously {\em defined} terms:
     \begin{itemize}
     \item prime, map, triangle, chess, fair coin, probability.
     \item $+$, $=$, $1$, $\ge$.
     \end{itemize}
\end{itemize}


\subsection{Compound propositions and truth tables}

Logical connectives are used to combine simple propositions: \\
And ($\wedge$), or ($\vee$), exclusive-or ($\oplus$), not ($\neg$) \\
As I already mentioned for Booleans. \\
\\
Also implication (if-then, $\implies$), double implication (equivalence,
$\Leftrightarrow$). \\
Very important in logical reasoning. \\
\\
Truth values of compound propositions are obtained from the 
truth values of the simpler propositions according to {\em truth
tables\/}: 

\begin{tabular}{cc}
$P$  & $\neg P$ \\
 \hline T  &   F \\
F  &   T \\
\end{tabular}

\noindent
If a proposition $P$ is true, its negation is said to be false, and
vice versa. 

\begin{tabular}{ccccc}
$P$  & $Q$ &    $P \wedge Q$ &  $P \vee Q$ & $P \oplus Q$ \\
\hline
T  &  T     &  T &             T   &        F\\
T  &  F    &   F  &            T  &         T\\
F  &  T   &    F   &           T &          T\\
F  &  F  &     F    &          F&           F\\
\end{tabular}

Import: $\vee$ is {\bf inclusive} or.  Sometimes or is exclusive in
English: Karger or Lynch will teach today.

\vspace{2ex}

\begin{tabular}{cccc}
$P$ & $Q$ &   $P \Rightarrow Q$ &  $P \Leftrightarrow Q$ \\
\hline
T&    T   &       T  &               T \\
T &   F  &        F   &              F \\
F  &  T &         T    &             F \\
F   & F&          T     &            T \\
\end{tabular}

\noindent Nice thing about these truth tables: doesn't matter what the
specific propositions are; we know how to get compound truth value
from basic truth values.

\noindent
The only slightly mysterious column here is the implication column. \\
We say that $P \Rightarrow Q$ is false only if the hypothesis $P$ is
true and the conclusion $Q$ is false. \\
\\
Example: \\
If Ricky gets at least six hours of sleep then he passes his 6042
final. \\
($P \Rightarrow Q$) \\
\\
Under what circumstances is this a true statement? \\
Well, it's clearly false if Ricky gets at least 6 hours of sleep and
doesn't pass ($P$ true, $Q$ false). \\
But it's a perfectly OK statement if he sleeps a lot and passes ($P$
and $Q$ both true), \\
or if he does not sleep (my statement did not promise anything about this case). \\
\\
One way to determine truth values for compound propositions is by 
adding new columns to the basic truth table(s): \\
\\
Example: $R = (P \Rightarrow Q) \Leftrightarrow (\neg Q \Rightarrow \neg P)$ \\
\\
Trace through the columns, using the expression structure. \\
Determine that the column contains all T. 

\begin{tabular}{ccccccc}
$P$  &$Q$  &  $P \Rightarrow Q$  & $\neg Q$&  $\neg P$ &  $\neg Q\Rightarrow\neg P$ & $R$ \\
\hline
T&    T   &       T &              F   &      F&        T &T\\
T &   F  &        F  &             T  &       F &       F &T\\
F  &  T &         T   &            F &        T  &      T &T\\
F   & F&          T    &           T&         T   &     T &T\\
\end{tabular}

\noindent
An expression (like this one) whose column contains all T is called a
{\em tautology}.


\section{Logical Systems}

Now to proofs.  A proof takes {\bf axioms} and {\bf definitions} and
uses {\bf deduction rules} to get desired conclusion.

\subsection{Axioms}

Propositions that are {\em assumed} to be true. \\
Not proved---just accepted as reasonable assumptions. \\
(``Axiom'' = (Greek)  ``to think worthy,'' not ``to be true''). \\
\\
To be rigorous, important to state assumptions explicitly. \\
\\
Typical examples of axioms from math:
\begin{itemize}
\item
If $a=b$ and $b=c$ then $a=c$.
\item
(Euclidean geometry parallel postulate) \\
Given a line $l$ and a point $p$ not on $l$, there is exactly one line
through $p$ parallel to $l$.
\item
(Spherical geometry parallel postulate) \\
Given a line $l$ and a point $p$ not on $l$, there is {\em no} line through $p$
parallel to $l$. \\
Contradicts the Euclidean axiom. 
\item
(Hyperbolic geometry parallel postulate) \\
Given a line $l$ and a point $p$ not on $l$, there are {\em infinitely
many} lines through $p$ parallel to $l$. \\
\\
None of these is ``better'' axiom. 
All of these yield consistent logical proof systems.  We just need
agreement on which we will use.
\item
Mathematicians still argue about which axioms are ``right,''
e.g., the Axiom of Choice (whose assertion and denial are equally
consistent with other commonly agreed upon axioms).
\end{itemize}

Different axioms lead to different theorems. \\
Anyone who accepts your axioms and deduction rules has to accept your
theorems.

\subsection{Definitions}

Used to agree on what something means.
\begin{itemize}
\item A number is prime if no divisors other than itself
\item A divisor is a number...
\item A triangle is a polygon with 3 sides
\end{itemize}
Axiomatic: we can decide whatever we want, so long as we are
explicit.\\
Generally built from prior definitions.

\subsection{Deduction Rules}

Deduction rules = inference rules.

These are rules for deducing (inferring) that some propositions are
true, assuming that others are true.
\begin{enumerate}
\item Modus ponens \\
Given (assumptions, axioms): $P$, $P \Rightarrow Q$ \\
We can conclude:  $Q$ 

%Modus ponens:
%Check in the truth table: \\
%Situations where $P$ is true are covered by rows 1 and 2. \\
%$Situations where $P \Rightarrow Q$ is true are covered by rows 1, 3, and 4. \\
%So, situations where both statements are true are covered by row 1 (only). \\
%But in that row, $Q$ is also true. 

\item Modus tolens (proof by contradiction) \\
Given:  $P \Rightarrow Q$, $\neg Q$ \\
We can conclude: $\neg P$ 

\item Syllogism \\
Given:  $P \Rightarrow Q$, $Q \Rightarrow R$ \\
We can conclude:  $P \Rightarrow R$ \\


\item Given:  $\neg P \Rightarrow \ms{false}$ \\
We can conclude:  $P$ 


\item Given: $P$, $\neg P$ \\
We can conclude: $\ms{false}$ \\
(common way to get to previous rule: ``proof by contradiction'')
%\\
%No tt rows satisfy the combination of conditions (they're contradictory). \\
%So from this utter nonsense, anything can be concluded (including ``false''). \\
%(A convention) \\

\item (Cases) \\
Given: $Q \Rightarrow P$, $\neg Q \Rightarrow P$ \\
We can conclude: $P$.
\end{enumerate}

Truth tables provide a source of deduction rules; all such rules are
accepted in mathematics. \\
Namely, if $P \Rightarrow Q$ is a tautology, then 
Given: $P$ \\
Conclude: $Q$ \\
is a valid inference rule. \\
\\
Example: 
\[
[(P \vee Q) \wedge \neg P] \implies Q
\]
is a tautology, which leads to the following inference rule: \\
\\
(Disjunctive Syllogism) 
Given: $P \vee Q$, $\neg P$ \\ 
Conclude: $Q$ 

\subsection{Formal proofs}

In a complete, formal proof of a theorem, each step follows from
previous steps using formal deduction rules. \\
So systematic that it could be checked mechanically by a program. \\
\\
Mathematicians generally don't write proofs that formally. \\
Rather, they write them in concise prose, but in such a way that others who
are knowledgeable about proof methods can understand how to fill in the
gaps. \\
\\
Since proofs are supposed to be mechanically checkable, 
you might think of using a computer to produce proofs of true
theorems automatically. \\
Russel and Whitehead, in {\em Principia Mathematica}, tried to write
down a sufficient set of axioms that would let us prove everything
interesting. \\
Then Hilbert posed (as one is his 23 famous problems) the problem
of finding such a method. \\
One of the great accomplishments of 20th century math is the proof
that no such method exists (Godel). \\
In fact, we don't even have a proof that the axioms of math are
consistent!  Maybe they are all self contradictory!   But they have
stood up well over time.
\\
%[[[I deleted the details here.]]]
\\
Even if we limit ourselves to things that can be proven, computers
won't be much help.  
Finding a proof---even, say, just a proof that a
given propositional logic statement is a tautology---is {\bf
NP-complete}, meaning that it is intractable in a certain formal
sense you will learn about in 6.045 or 6.046. \\
\\
So we will always rely on human intuition to find the proofs, although
we will be using computers more and more to check if they are right.



\subsection{Proofs and the Real World}
\begin{itemize}
\item 
In the real world axioms capture our beliefs about what we are
studying (e.g. Newton's mechanics).  
\item And definitions capture what we think is important (eg force, velocity)
\item If we prove something with those
axioms, we tend to believe it about the real world.  
\item If the real world turns out different, we need to change our
  axioms (Einstein)
\end{itemize}


\section{Propositional reasoning examples}

Velleman Chapter 3, Rosen, Section 3.1 \\
\\
Some common types of proofs are direct proof, proof by contradiction,
and proof by cases. \\
Here, I'll say what these are and give some tiny examples. \\
\\
Proof style: \\
I'm not presenting formal logical proofs, but rather, proofs at about
the level of detail commonly used by mathematicians. \\
\\
I'm using a pretty stylized, structured format, \\
listing statements and reasons, as in high school geometry proofs. \\
Uses of proof rules explicit. \\
Look like programs (but I don't have a formally-defined language). \\
\\
In math books (incl. the ones in this course), proofs don't look like this. \\
Written in paragraphs, with the logical structure implicit in the prose. \\
Caution: To really understand them, and write them yourself, you have to
understand the logical structure. \\
That's why I'm starting out by laying it out carefully. \\
\\
Later in the course, as we become surer that you understand the 
logical structure, we will present many proofs in less structured styles. \\
Paragraphs, semi-structured (laying out only the major steps). \\
But ideally, it should be possible to rewrite any of these proofs in
structured form (given enough time). \\
\\
For your own proofs: \\
You can write them in structured form, paragraphs, or somewhere in
between. \\
Just make sure you get the proof logic right. 

\subsection{Direct proof}

To prove that a proposition of the form $P \Rightarrow Q$ is true, it
is enough to assume $P$ and show $Q$. \\
Written in a structured style, the pattern of such a proof is: 

\begin{structproof}
Prove:  $P \Rightarrow Q$ \\
1. Assume $P$. \\
2. $Q$ \\
3. QED 
\> \> \> \> \> Implication \\
\end{structproof}

QED = Quod Erat Demonstrandum = ``which was to be proved''. \\
Here, it's a shorthand for writing the goal out again as the final
step. \\
\\
%[[[I thought about trying to ``derive'' these rules also from the truth
%table, but, e.g., ``assume'' is confusing---you have to consider all
%the rows where the assumption is false...]]]
\\
Example: \\
\\
Prove: The sum of the first 100 numbers, $1 + ... + 100$, is 5050. \\
Rewrite as an implication: 

\begin{proofoverhead}
Prove:  $S = 1 + ... + 100 \Rightarrow S = 5050$. \\
1. Assume  $S = 1 + ... + 100$. \\
2. $S = 5050$ 
\> \> \> \> \> ??? \\
3. QED        
\> \> \> \> \> Implication \\
\end{proofoverhead}

Of course, the interesting part is showing step 2, where I've put the ???. \\
Fill in steps (calculations): 

\begin{proofoverhead}
Prove:  $S = 1 + ... + 100 \Rightarrow S = 5050$. \\
1. Assume  $S = 1 + ... + 100$. \\
2. $S = 5050$ \\
\> 1. $S = 100 + 99 +...+ 1$  
   \> \> \> \> Commutativity of addition \\
\> 2. $2S = 101 + 101 + ... + 101$  (100 terms) 
   \> \> \> \> Add term-by-term \\
\> 3. $2S = 10,100$           
   \> \> \> \> Add the terms up \\
\> 4. QED  
   \> \> \> \> Divide by 2 \\
3. QED                       
\> \> \> \> \> Implication 
\end{proofoverhead}

\subsection{Proof by contradiction}

To prove that a proposition $P$ is true, it is enough to prove that 
$\neg P \Rightarrow \ms{false}$. \\
The pattern is: 

\begin{structproof}
Prove:  $P$ \\
1. $\neg P \Rightarrow \ms{false}$ \\
2. QED   
\> \> \> \> \> Contradiction
\end{structproof}

\noindent
Some variants of this:

\begin{structproof}
Prove: $P$ \\
1. $\neg P \Rightarrow (Q \wedge \neg Q)$ \\
2. QED 
\> \> \> \> \> Contradiction \\
\\
\\
Prove: $P$ \\
1. $\neg P \Rightarrow Q$ \\
2. $\neg Q$ \\
3. QED       
\> \> \> \> \> Contradiction \\
\end{structproof}

\noindent
Example:

\begin{structproof}
Assume: If Ricky gets at least six hours of sleep then he passes his 6042 final. \\
Ricky fails his 6042 final. \\
Prove: Ricky gets less than six hours of sleep.
\end{structproof}

\noindent
Here, let $P= \mbox{``Ricky gets less than six hours sleep.''}$.\\
$Q= \mbox{``Ricky passes.''}$. So the proof steps for proving $P$ are:

\begin{structproof}
1. If Ricky gets at least six hours of sleep then he passes. 
   ($\neg P \Rightarrow Q$). \\
\> \> \> \> \> Assumed \\
2. Ricky fails ($\neg Q$). 
\> \> \> \> \> Assumed \\
3. QED       
\> \> \> \> \> Contradiction 
\end{structproof}

\subsection{Cases}

To prove that a proposition $P$ is true, it is enough to prove that
$Q$ and $\neg Q$ both imply $P$, 
where $Q$ is any other proposition. \\
Says $P$ is true in either case.

\begin{structproof}
Prove: $P$ \\
1. $Q \Rightarrow P$ \\
2. $\neg Q \Rightarrow P$ \\
3. QED                     
\> \> \> \> \> Cases 
\end{structproof}

\noindent
Of course, generalize this to any number of predicates, provided that
together they cover all possibilities: \\
$Q_1 \vee Q_2 \vee \ldots \vee Q_k$ is true. \\
\\
Example: 

\begin{structproof}
Assume: $d =$ Britney's birth date (day of month, 1-31). \\
Prove: $d^2 + d$ is even. \\
1. $d = 1 \Rightarrow d^2 + d \mbox{ is even}$. \\
2. $d = 2 \Rightarrow d^2 + d \mbox{ is even}$. \\
3. $\ldots$ \\
31. $d = 31 \Rightarrow d^2 + d \mbox{ is even}$. \\
32. QED   
\> \> \> \> \> Cases 
\end{structproof}
Of course we might imagine more clever proofs than this one, e.g., by 
breaking up the proof into only two cases based on whether $d$ is even/odd.

\end{document}

% Names (from teeny-bopper rock music):  Ricky, Enrique, Britney, Christina.
% Jessica, Kid, Lou
%
% Monica, Erica, Rita, Tina, Sandra, Mary, Jessica.

Slides: 

- What we want you to learn this term (5 bullets)

- List of 5 basic data types; under each, list the operations,...??

- Truth tables for Booleans

- List of proposition examples

- Truth tables for propositional logic

- Propositional logic sample proof rules


- Direct proof pattern

- Direct proof example, short version

- Direct proof example, full version

- Contradiction pattern 1

- Contra pattern 2, pattern 2

- Contra example, full version, but without the comments.

- Cases pattern

- Cases example


- Birthdate example, short proof; cases; odd; even

- De Morgan short proof; ... all the separate versions/pieces

- Contradiction proofs...













\\
