\documentstyle[12pt,twoside,amsfonts,amstex]{article}
\input{macros-course-lectures}

\parskip1.5ex
\parindent0pt

\begin{document}

\lecture{notes1}{Class Notes for Lecture 1}{February 4, 1997}

\section{Introduction}

\commentout{
\subsection{Admin}
\begin{itemize}
\item 5 TAs:
\item course secretary: Be, 36098
\item contact info on sheet
\item prereq 18.01
\item antireq 18.063, 18.310, 6.046
\item 5-0-7 course, so lots class time
\item lectures
\item recitation/tutorials: we'll schedule tonite
\item new material in recit.
\item tutorial:
  \begin{itemize}
  \item groups of 5
  \item joint solve
  \item presentation
  \item MANDATORY.  
  \item 100\% for showing up (TA can downgrade for lazy)
  \item 0\% for missing
  \end{itemize}
\item Handouts on web
\item books.  
  \begin{itemize}
  \item all assigned from rosen
  \item optional: nuts and bolts, essentials of probability
  \end{itemize}
\item PSets
  \begin{itemize}
  \item due Tues, STARTY of class
  \item 20\% penalty for up to 2 days late
  \item NEATNESS and CLARITY vital.
  \item collaboration great (except on exams)
  \item cite all collaborators.
  \end{itemize}
\item INFOSHEET: boxes on exit.
\end{itemize}}

\subsection{6.042 Topics}

\begin{itemize}
\item
The most important discrete mathematical
{\em structures} for modelling computer systems. 

Numbers, sets, graphs, state machines, probability distributions, ...

\item
The most useful mathematical {\em techniques} for reasoning
about these mathematical structures.

Propositional and predicate logic, induction, recurrences, generating
functions, ...

\item 
The notion of {\em mathematical proof} as a discipline for
reasoning carefully about such structures.

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

\end{itemize}

This class is divided into 3 parts, each covering a third of the term:

\begin{itemize}
\item Introduction to basic notions of proofs, using
simple, familiar structures like sets and natural numbers. 
\item Methods for analysis and counting.
\item Probability.

\end{itemize}

Proofs appear throughout the term.

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}

\section{Basic Proof Notions}

\subsection{Proofs -- What and Why}

{\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.}

Idea: specify everything so precisely that everyone is convinced.



\subsection{Propositions}

The first thing to specify: what kind of things do we prove?

A {\it proposition} is a statement that is either true or false, but not both.

Knowledge consists of {\em propositions}, such as
\begin{itemize}
\item 2+3=5.
\item For every $a$, $b$ and $c$, if $a=b$ and $b=c$ then $a=c$.
\item The sum of the interior angles of every triangle is $180^\circ$.
\item For all $n \ge 1$, $1+2+\cdots+n = n(n+1)/2$.
\item For all $n \ge 0$, $n^2+n+41$ is a prime number.
  \begin{itemize}
  \item Evidence: 41, 43, 47, 53, 61, 71, $\ldots$.
  \item Works up to 40.
  \item Fails at 41.
  \item Proving by example is classical methodology in many fields.
  \item Some examples in number theory have their first counter-example in the {\bf billions}.
  \end{itemize}
\item With perfect play, chess is a win for white.
\item The Pentium chip does what it claims.
\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 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}
\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 With a fair coin, the probability of getting 50 heads in 100
  tosses is 1/2.
\item O.J. did it.
\item My algorithm gives the right answer on any input.
\end{itemize}

Each of these propositions is either {\em true} or {\em false.} 
We (and Intel) (and Ito) would like to know which.

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{Mathematical proofs}

Now we know what we want to prove.  How do we do it?

In mathematics, a proof is a verification of a proposition by a chain of logical
deductions from a base set of axioms. An axiom is a proposition that
is assumed to be true.

\begin{itemize}
\item Begin with true propositions.
\item Combine using specific inference rules.
\item Derive more true propositions.
\end{itemize}
One should know and admit {\em all} unproven assumptions (axioms).

Example:

\begin{theorem} $\frac{d}{dx} \ln (3x+1) = \frac{3}{3x+1}$
\end{theorem}
\begin{proof}
\begin{eqnarray*}
\frac{d}{dx} 1 &= &0\\
\frac{d}{dx} 3x &= &3\\
\frac{d}{dx} (u+v) &= &\frac{d}{dx} u + \frac{d}{dx} v\\
\end{eqnarray*}
Combine, with $u=3x$, $v=1$:
\begin{eqnarray*}
\frac{d}{dx} (3x+1) &= &3\\
\frac{d}{dx} \ln u &= &\frac{1}{u}\frac{du}{dx}\\
\end{eqnarray*}
Combine, with $u=3x+1$.
 \end{proof}

This was a {\em direct proof:} it started with knowns and plugged them together
until it produced the desired result.
\begin{itemize}
\item Language: numbers, functions, derivative operator.
\item Axioms: chain rule, sum rule.
\item Inference Rule: substitution for equivalents.
\end{itemize}

\subsection{Basic Concepts/Notation}

Our language uses propositional logic as a substrate.

\remove{
Start with sets as a basic data type.

Then do logical concepts/notation.
Propositions, Boolean algebra.
Predicates, quantifiers.
Axioms
Inference rules
Example: Peano axioms:
- As an example of using axioms.
- As a way of defining natural numbers (alternative -- we could treat
these naively too, as we're doing for sets).
}

\commentout{
\subsubsection{Sets}

A {\em set} is a collection of objects:
\begin{itemize}
\item $x \in S$ means ``$x$ is in the set $S$''
\item $\emptyset$ is the empty set  (contains no elements).
\item $A \cap B$ means ``the intersection of $A$ and $B$'' (the set of elements
in both sets).
\item $A \cup B$ means ``the union of $A$ and $B$'' (elements in
either set).
\item Set difference. $A-B=\{x| x \in A, but x \not \in B\} $
\item $\subseteq$, subset.
\item $=$, set equivalence.
\end{itemize}

We won't be axiomatic about sets (``naive set theory'').
}

\subsubsection{Boolean Operators} 

Boolean Operators can be thought of as functions with some number of
inputs (each chosen from true and false) whose value for any particular
inputs must also be either true or false.  Boolean operators
combine Boolean symbols to produce Boolean expressions.  If Boolean
symbols are used to represent propositions, this
allows propositions to be combined to produce new propositions.
Boolean expressions are useful for brevity and precision, just like
arithmetic expressions.  It is important to remember that Boolean operators
are concerned only with whether a proposition is true or false and not
with what the proposition actually might {\bf mean}.
If
\begin{itemize}
\item  $p$ denotes ``I like chocolate'' and
\item  $q$ denotes ``I like ice cream,''
\end{itemize}
then
\begin{itemize}
\item $\neg p$ means ``not $p$'' (I don't like chocolate).  This
expression is true iff (if and only if) $p$ is false.
\item $p \wedge q$ means ``$p$ and $q$'' (I like chocolate
and I like ice cream).  This expression is true iff $p$ and $q$ are both true.
\item $p \vee q$ means ``$p$ or $q$.''  This expression is true iff {\em one or both} of
$p$ and $q$ is true.  This is {\em not} an exclusive or. How could you
formulate an exclusive or?
\item $p \implies q$ means ``$p$ implies $q$'' or ``if $p$ then $q$''
(If I like chocolate, then I like ice cream).  This expression is true
iff the truth values of $p$ and $q$ are {\em consistent} with $p$ representing
something that implies whatever $q$ represents.
  (That is, the expression is true unless $p$ is true but $q$ is
still false.)
{\bf Note:} $p\implies q$ is true when $p$ is false (by definition)!
\item
$p \iff q$ means ``$p$ if and only if $q$'' (I like chocolate if and only if
I like ice cream).  This expression is true iff the truth values of $p$ and $q$ 
are {\em consistent} with $p$ and $q$ representing logically equivalent
things.  That is, this expression is true iff $p$ and $q$ have the
same truth value (either both true or both false).
\end{itemize}

A {\em tautology} is a Boolean expression, such as $p \vee \neg p$, that is true regardless of
the truth values of its Boolean variables.  Two Boolean formulas
are {\em equivalent} iff they have the same truth value regardless of
the truth values of their variables (where common variables have the
same value in both expressions).

The {\em contrapositive} of an implication $p \implies q$ is the
expression $\neg q \implies \neg p$.  An implication and its
contrapositive are equivalent.


{\bf Note:}  neither the converse nor the inverse of an implication are
equivalent to the implication (but the converse is equivalent to the
inverse).

\subsubsection{Predicates}

Predicates are similar to propositions but they depend on variables.
$P(x,y,z)$
denotes a predicate on variables $x,y,z$.  For example, define:
\begin{itemize}
\item $R(x)$: $x$ is an odd number.
\item $Q(x)$: $x > 2$.
\item $P(x)$: $x$ is a prime number.
\end{itemize}
These predicates are {\em not} propositions, because they can be true
or false depending on $x$.  They are like functions from variables to
propositions. 
\begin{itemize} 
\item $P(2)$ is true.
\item $R(2)$ is false.
\item $P(4) \vee R(3)$ is true.
\item $Q(3) \wedge R(4)$ is false.
\item $Q(1) \implies R(2)$ is true.
\end{itemize}

\subsection{Quantifiers}

Many propositions assert that something is true for all or some elements
of a given domain (e.g., all numbers).  The following quantifiers presume
a particular {\em universe of discourse} has been agreed upon in advance.

\begin{itemize}
\item ``$\forall$'' means ``for all.'' $\forall x P(x)$ is a statement
that is true iff $P(x)$ is true for {\em every} $x$ in the universe of
discourse. 
\item ``$\exists$'' means ``there exists.'' $\exists x P(x)$ is true
iff $P(x)$ is true for {\em at least one} $x$ in the universe of
discourse.
\item ``$\not\exists''$ mean ``there does not exist'' (``there is no'').
\item ``$\exists !$'' means ``there exists {\em exactly} one.''
\item ``$\forall x \in S$'' means ``for every $x$ in the set $S$.''
$(\forall x \in S) P(x)$ is equivalent to $(\forall x) (x \in S
\implies P(x)).$
\end{itemize}

Quantifiers can turn predicates into propositions, e.g.
\[
\forall x, P(x) \wedge Q(x) \implies R(x).
\]
Note that each appearance of $x$ is associated with the $\forall$
quantifier.  A variable associated with a quantifier in this way
is said to be {\em bound}.  Since every variable in the above expression
is bound, it is a proposition.  If $P$, $Q$, and $R$ are the predicates
defined above, this proposition is true.

{\bf Note:} $\forall x \exists y$ is {\em different} from $\exists y \forall
x$:
\begin{itemize}
\item $S(x,y):$ student $x$ will fall asleep in class $y$.
\item $\forall y \exists x P(x,y):$ ``In every class, some student will fall asleep.''
\item $\exists x \forall y P(x,y):$ ``There exists a student who will
fall asleep in every class.''
\end{itemize}

What is the universe of discourse above?


\subsection{Axioms}

Axioms are propositions that are {\em assumed} to be true.
One does not prove axioms.  They are simply accepted as
reasonable assumptions. (``Axiom'' comes from Greek:  ``to think
worthy,'' not ``to be true'').  It is not wrong to make assumptions
(in fact, it is unavoidable), but to be rigorous you have to state
your assumptions explicitly.

The rule is {\bf not} ``don't make assumptions'', but rather
{\bf ``state them.''}

Some typical examples of axioms from various parts of mathematics:
\begin{itemize}
\item
If $a=b$ and $b=c$ then $a=c$.
\item
Euclidean geometry has an axiom: Given a line $l$ and a point $p$ not
on $l$, there is exactly one line through $p$ parallel to
$l$. (parallel postulate)
\item
Sometimes an axiom from one domain contradicts an axiom from another.
Spherical geometry has an axiom contradicting Euclid's: Given a line
$l$ and a point $p$ not on $l$, there is {\em no} line through $p$
parallel to $l$.
\item
So does hyperbolic geometry: 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 three axioms is ``better'' than any other:  all yield
equally consistent logical proof systems.
\item
Modern 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}

Of course, different axioms lead to very different theorems.  But
anyone who agrees with your axioms and inference rules has to accept
your theorems.

What axioms to accept will generally be no problem in this class:
\begin{itemize}
\item  You can
assume that everything you've learned so far (e.g., in high school) is true. 
\item  This may change when we cover
 probability because faulty assumptions are easy to make.
Testing on O.J.'s blood was an example of how probabilistic reasoning can be
``assumption dependent.''
\end{itemize}

\subsection{Inference Rules for Propositions}

Once you have axioms and some propositions that are believed to be
true, all you need is a system of rules for combining true proposition to form new
true propositions. Such rules are called {\em inference rules}. The most
famous rule is modus ponens:
\begin{itemize}
\item 
Let $p$ and $q$ be propositions.
\item
If $p$ is true and $p \implies q$ is true then q is true.
\end{itemize}

This rule and some others are written below in a format where the truth
of all expressions above the line permits the expression below the line to be
inferred to be true.


\newcommand{\alaw}[1]{\parbox[t]{1in}{
\begin{tabular}{l}
#1
\end{tabular}}}

Modus Ponens: \alaw{$p$\\
$p\implies q$\\
\hline
$q$}

Syllogism: \alaw{
$p\implies q$\\
$q\implies r$\\
\hline
$p\implies r$}

Modus Tolens (proof by contradiction): 
\alaw{$p\implies q$\\
$\neg q$\\
\hline
$\neg p$}

Proof by cases: \alaw{$a \vee b$\\ $a \implies q $ \\ $b \implies q$
  \\ \hline $q$} 

You don't have to remember the names of these rules:  just use them
correctly.

Boolean Algebra is a useful aid in reasoning and inferring.  
Mathematics accepts as inference rules all propositional tautologies.
That is, if $A\rightarrow B$ is a tautology, then
\alaw{
A\\
\hline
B}
is a valid inference rule.
For
example, 
\[
[(p \vee q) \wedge \neg p] \implies q
\] so we can derive an
inference rule:

Disjunctive Syllogism: \alaw{$p \vee q$\\ $\neg p$ \\ \hline $q$}\\


In fact, you can get the same power with just three inference rules,
but it makes life harder.

\subsection{Inference Rules for Predicates}

Negation:
\begin{itemize}
\item $(\forall x) S(x)$ is equivalent to $\neg (\exists x) \neg S(x)$:
    \begin{itemize}
    \item $(\forall x) S(x):$ For all primes $x > 2$, $x$ is odd.
    \item $\neg(\exists x) \neg S(x):$ There is no prime $x > 2$ such
that $x$ is not odd.
    \end{itemize}
\item $(\exists x) S(x)$ is equivalent to $\neg (\forall x) \neg
S(x)$.
\end{itemize}

Universal generalization is a way to prove $\forall x P(x)$:
\begin{itemize}
\item ``Let $x \ge 2$.  Then $x$ is prime or composite.''
\item  Conclude: $\forall x \ge 2$, $x$ is prime or composite.
\end{itemize}

We often leave out universal quantifiers if they are implicit.

Like axioms, inference rules are an {\em agreement} to believe certain
inferences.  For example, the constructivists (e.g. Brouwer) {\em reject}
the claim that $\neg\forall x \neg P(x)$ implies $\exists x P(x)$.
They claim that to prove something exists, you actually have to
construct it.  Brouwer retracted his most famous theorem after he
became a constructivist, since the proof was nonconstructive.

\end{document}
