\documentclass[aspectratio=169,t,xcolor=table]{beamer}
\mode<presentation>
{
  \usetheme{Ufg}
}

\setPrimaryColor{DarkOrange}
\setLogos{./images/computerHead-300.png}{./images/computerHead.png}{./images/circuitBoard.png}

\usepackage[utf8]{inputenc}
\usefonttheme{serif}

\usepackage{booktabs}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{hyperref}

\usepackage{datetime}

\usepackage{enumerate}
\usepackage{enumitem}

\usepackage{xltxtra}
\usepackage{listings}

\usepackage{graphicx}
\usepackage{makecell}
\usepackage{multicol}
\usepackage{multirow}

\usepackage{tabularx}
\usepackage{textcomp}
\usepackage{tikz}
\usetikzlibrary{arrows,automata,decorations.pathmorphing,backgrounds,positioning,fit}

\usepackage{fontspec}
\setmainfont{Gentium Book Basic}
\setmonofont{Comic Code}[
  Scale          = 0.85,
]

\lstset{
  basicstyle=\ttfamily,
  language=java
}

\DeclareMathOperator{\limplies}{\Rightarrow}
\DeclareMathOperator{\liff}{\iff}
\DeclareMathOperator{\lxor}{\oplus}
\DeclareMathOperator{\qeq}{\overset{?}{=}}
\DeclareMathOperator{\modulus}{\mathbf{mod}}
\DeclareMathOperator{\even}{even}
\DeclareMathOperator{\odd}{odd}
\DeclareMathOperator{\ddiv}{|}
\DeclareMathOperator{\ndiv}{\not|}
\DeclareMathOperator{\contra}{\Rightarrow\mskip-\thinmuskip\Leftarrow}
\newcommand{\Q}{\mathbb{Q}}
\newcommand{\R}{\mathbb{R}}
\newcommand{\Z}{\mathbb{Z}}
\renewcommand{\P}[1]{\mathbb{P}(#1)}
\newcommand{\mathcheckmark}{\text{ \ding{51}}}

\DeclareMathOperator{\vowel}{vowel}
\DeclareMathOperator{\consonant}{consonant}
\DeclareMathOperator{\isprime}{prime}
\DeclareMathOperator{\equals}{equals}
\DeclareMathOperator{\divides}{divides}


\title{The Foundations: Logic and Proofs }

%\beamerdefaultoverlayspecification{<+->}
\begin{document}

\begin{frame}
  \titlepage
\end{frame}
\setLayout{vertical}

\begin{frame}
  \frametitle{Outline}
  \tableofcontents
\end{frame}

\section{Simple Direct Proof}

\begin{frame}
  \frametitle{Example}
  \framesubtitle{Convert English to Logic}

  \begin{example}
    If Jimmy moves to Anchorage, then he will freeze in winter; but
    if he moves to Augusta, then he will burn up in summer.  Either
    he will move to Anchorage or Augusta.  Therefore, he will either
    freeze this winter or burn up next summer.

    Propositions\pause

    $a$ - Jimmy moves to Anchorage.\\
    $g$ - Jimmy moves to Augusta.\\
    $f$ - Jimmy freezes next winter.\\
    $b$ - Jimmy burns up next summer.

    \pause
    Given:\\
    $a \limplies f$\\
    $g \limplies b$\\
    $a \lor g$
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Example}
  \framesubtitle{Convert English to Logic}

  \begin{example}
    Propositions

    $a$ - Jimmy moves to Anchorage.\\
    $g$ - Jimmy moves to Augusta.\\
    $f$ - Jimmy freezes next winter.\\
    $b$ - Jimmy burns up next summer.

    Given:\\
    $a \limplies f$\\
    $g \limplies b$\\
    $a \lor g$

    Prove:\\
    $f \lor b$
  \end{example}
\end{frame}

\subsection{Proof w/o Quantifiers}
\begin{frame}
  \frametitle{Example}
  \framesubtitle{Proof w/o Quantifiers}

  \emph{To be proven:} $(a \limplies f) \land (g \limplies b) \land (a
  \lor g) \limplies (f \lor b)$


  \begin{proof}
    \begin{tabular}{lllr}
      &$a \limplies f$&Premise&1\\
      &$g \limplies b$&Premise&2\\
      &$a \lor g$&Premise&3\\\pause
      &$\lnot a \limplies g$&Material implication, 3&4\\\pause
      &$\lnot a \limplies b$&Hypothetical Syllogism 2, 4&5\\\pause
      &$\lnot b \limplies a$&Contrapositive and Double Negative 5&6\\\pause
      &$\lnot b \limplies f$&HS 1,6&7\\\pause
      &$b \lor f$&MI, DN 7&8\\\cline{2-3}\pause
      $\therefore$&$f \lor b$&Commutation of $\lor$ 8&\\
      $\therefore$&$(a \limplies f) \land (g \limplies b) \land (a \lor g) \limplies (f \lor b)$&\\
    \end{tabular}
  \end{proof}
\end{frame}

\begin{frame}
  \frametitle{Fallacies}
  \framesubtitle{Affirming the Conclusion}

  If you are a font geek, then you are disappointed with
  the subtitles in \emph{Avatar}. You are disappointed with the
  subtitles in \emph{Avatar}.

  Therefore, you are a font geek.

  \pause
  $g$ - you are a font geek\\
  $d$ - you are disappointed with the subtitles

  Is this a tautology?
  $$((g \limplies d) \land d) \limplies g$$

  \pause
  No, not true for $\lnot g$ and $d$. Exactly the case that the
  ``proof'' is wrong.
\end{frame}

\begin{frame}
  \frametitle{Fallacies}
  \framesubtitle{Denying the Hypothesis}

  If you are a font geek, then you are disappointed with
  the subtitles in \emph{Avatar}. You are not a font geek.

  Therefore, you are happy with the subtitles.

  \pause
  $g$ - you are a font geek\\
  $d$ - you are disappointed with the subtitles

  Is this a tautology?
  $$((g \limplies d) \land \lnot g) \limplies \lnot d$$

  \pause
  No, not true for $\lnot g$ and $d$. Exactly the case that the
  ``proof'' is wrong.
\end{frame}

\begin{frame}
  \frametitle{Example: Superman}
  \framesubtitle{Superman [1.6 35]}

  Is the following argument valid?
  \smallskip

  \begin{example}
  If Superman were able and willing to prevent evil, he would do so.
  If Superman were unable to prevent evil, he would be impotent; if he
  were unwilling to prevent evil, he would be malevolent. Superman
  does not prevent evil. If Superman exists, he is neither impotent
  nor malevolent. Therefore, Superman does not exist.
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Example: Superman}
  \framesubtitle{Extracting the Propositions}
  \begin{example}
    If Superman were ($a$)ble and ($w$)illing to prevent ($e$)vil, he would do so.
  If Superman were unable to prevent evil ($\neg a$), he would be ($i$)mpotent; if he
  were unwilling to prevent evil ($\neg w$), he would be ($m$)alevolent. Superman
  does not prevent evil ($\neg e$). If Superman e($x$)ists, he is neither impotent
  nor malevolent ($\neg i \land \neg m$). Therefore, Superman does not
  exist ($\neg x$).
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Example: Superman}
  \framesubtitle{Extracting the Propositions}
  \begin{example}
    $a$ - Superman is able to prevent evil\\
    $w$ - Superman is willing to prevent evil\\
    $e$ - Superman prevents evil\\
    $i$ - Superman is impotent\\
    $m$ - Superman is malevolent\\
    $x$ - Superman exists

  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Example: Superman}
  \framesubtitle{To Be Proven}
  \begin{example}
    $a$ - Superman is able to prevent evil\\
    $w$ - Superman is willing to prevent evil\\
    $e$ - Superman prevents evil\\
    $i$ - Superman is impotent\\
    $m$ - Superman is malevolent\\
    $x$ - Superman exists

    To be proven:\\
    \begin{tabular}{llll}
    &$(a \land w) \limplies e$&1&Premise\\
    &$\neg a \limplies i$&2&Premise\\
    &$\neg w \limplies m$&3&Premise\\
    &$\neg e$&4&Premise\\
    &$x \limplies (\neg i \land \neg m)$&5&Premise\\\cline{2-2}
    &$\neg x$&&\\
    \end{tabular}
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Example: Superman}
  \framesubtitle{Proof}
  \begin{example}
    {\small
    \begin{tabular}{llll}
      &$(a \land w) \limplies e$&1&Premise\\
      &$\neg a \limplies i$&2&Premise\\
      &$\neg w \limplies m$&3&Premise\\
      &$\neg e$&4&Premise\\
      &$x \limplies (\neg i \land \neg m)$&5&Premise\\
      &$\neg e \limplies (\neg a \lor \neg w)$&6&Contrapositive 1\\
      &$\neg a \lor \neg w$&7&Modus Ponens 4, 6\\
      &$a \lor i$&8&Material Implication 2\\
      &$w \lor m$&9&MI 3\\
      &$\neg a \lor m$&10&Resolution 7, 9\\
      &$i \lor m$&11&Resolution 8, 10\\
      &$\neg \neg (i \lor m)$&12&Double Negative 11\\
      &$\neg (\neg i \land \neg m)$&13&DeMorgan's 12\\
      $\therefore$&$\neg x$&14&Modus Tolens 5, 13\\
    \end{tabular}
    }
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Example: Superman}
  \framesubtitle{Conclusion}
  \begin{example}
    \begin{tabular}{ll}
    &$(a \land w) \limplies e \;\land$\\
    &$\neg a \limplies i\;\land$\\
    &$\neg w \limplies m\;\land$\\
    &$\neg e \;\land$\\
    &$x \limplies (\neg i \land \neg m)$\\\cline{2-2}
    $\therefore$&$\neg x$\\
    \end{tabular}
  \end{example}
\end{frame}

\subsection{Inference with Quantifiers}
\begin{frame}
  \frametitle{Inference with Quantifiers}

  \begin{example}
    John is a lawyer. All lawyers are rich. Every person has a house. If
    a person is rich and they have a house, the house is big. If a
    person lives in a big house, they have a mortgage. Everyone with a
    mortgage has to work.
    \smallskip
    $\therefore$ John has to work.
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Inference with Quantifiers}

  \begin{example}
    $L(p)$ - person $p$ is a lawyer\\
    $R(p)$ - person $p$ is rich\\
    $H(p, h)$ - person $p$ owns house $h$\\
    $B(h)$ - house $h$ is big\\
    $M(p)$ - person $p$ has a mortgage\\
    $W(p)$ - person $p$ must work
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Inference with Quantifiers}
  \begin{example}
    \begin{tabular}{ll}
      &\alt<2->{$L(J)$}{John is a lawyer.}\\
      &\alt<3->{$\forall p \in \{$People$\} (L(p) \limplies R(p))$}{All lawyers are rich.}\\
      &\alt<4->{$\forall p \in \{$People$\} \exists h \in \{$Houses$\} H(p, h)$}{Every person has a house.}\\
      &\alt<5->{$\forall p \in \{$People$\}\forall i \in \{$Houses$\} (R(p) \land H(p, i) \limplies B(i))$}{If a person is rich and they have a house, the house is big.}\\
      &\alt<6->{$\forall p \in \{$People$\} \forall j \in \{$Houses$\} (H(p, j) \land B(j)) \limplies M(p)$}{If a person lives in a big house, they have a mortgage.}\\
      &\alt<7->{$\forall p \in \{$People$\} (M(p) \limplies W(p))$}{Everyone with a mortgage has to work.}\\\cline{2-2}
      $\therefore$&\alt<8->{W(J)}{John has to work.}\\

    \end{tabular}
  \end{example}
\end{frame}

\begin{frame}
  \frametitle{Inference with Quantifiers}
  \begin{definition}[Universal Instantiation]
  \begin{tabular}{ll}
    &$\forall x P(x)$\\\cline{2-2}
    $\therefore$&$P(c)$ (for any particular $c$)
  \end{tabular}
  \end{definition}
  \pause
  \begin{proof}
    \begin{tabular}{lll}
      &$\forall p (L(p) \limplies R(p))$&Premise\\\cline{2-2}
      $\therefore$&$L(J) \limplies R(J)$&Universal Instantiation\\
      &&\\\pause
      &$L(J)$&Premise\\\cline{2-2}
      $\therefore$&$R(J)$&Modus Ponens with conclusion\\
    \end{tabular}
  \end{proof}
\end{frame}

\begin{frame}
  \frametitle{Inference with Quantifiers}

  \begin{definition}[Existential Instantiation]
    \begin{tabular}{ll}
      &$\exists x P(x)$\\\cline{2-2}
      $\therefore$&$P(c)$ (for some element $c$)
    \end{tabular}
  \end{definition}
  \pause
  \begin{proof}
    \begin{tabular}{lll}
      &$\forall p \exists h H(p, h)$&Premise\\
      &$\exists h H(J, h)$&UI\\\cline{2-2}
      &$H(J,Q)$&Existential Instantiation\\
      &&\\
      &$\forall p \forall i (R(p) \land H(p, i) \limplies B(i))$\\
      &$R(J) \land H(J, Q) \limplies B(Q)$&2 $\times$ UI\\\cline{2-2}
      $\therefore$&$B(Q)$\\
    \end{tabular}
  \end{proof}
\end{frame}

\begin{frame}
  \frametitle{Inference with Quantifiers}

  \begin{proof}
    \begin{tabular}{llll}
      &$L(J)$&1\\
      &$\forall p (L(p) \limplies R(p))$&2&\\
      &$\forall p \exists h H(p, h)$&3&\\
      &$\forall p \forall i (R(p) \land H(p, i) \limplies B(i))$&4&\\
      &$\forall p \forall j (H(p, j) \land B(j)) \limplies M(p)$&5&\\
      &$\forall p (M(p) \limplies W(p))$&6&\\\pause
      &$L(J) \limplies R(J)$&7&Univ Instan 2\\\pause
      &$R(J)$&8&MP 1, 7\\\pause
      &$H(J,Q)$&9&Exist Instan 3\\\pause
      &$B(Q)$&10&UI + MP 8, 9 and 4\\\pause
      &$M(J)$&11&UI + MP 9, 10, and 5\\\cline{2-2}\pause
    $\therefore$&$W(J)$&&UI + MP 11, 6\\
    \end{tabular}
  \end{proof}


\end{frame}

\begin{frame}
  \frametitle{Inference with Quantifiers}
  \framesubtitle{Table}

  \begin{tabular}{|l|l|}
    \hline
    \emph{Rule of Inference}&\emph{Name}\\\hline
    \begin{tabular}{ll}
      &$\forall x P(x)$\\\cline{2-2}
      $\therefore$&$P(c)$ (for any $c$)
    \end{tabular}
    &Universal Instantiation\\\hline
    \begin{tabular}{ll}
      &$P(c)$ for an arbitrary $c$\\\cline{2-2}
      $\therefore$&$\forall x P(x)$\\
    \end{tabular}
    &Universal Generalization\\\hline
    \begin{tabular}{ll}
      &$\exists x P(x)$\\\cline{2-2}
      $\therefore$&$P(c)$ (for some element $c$)
    \end{tabular}
    &Existential Instantiation\\\hline
    \begin{tabular}{ll}
      &$P(c)$ for some $c$\\\cline{2-2}
      $\therefore$&$\exists x P(x)$\\
    \end{tabular}
    &Existential Generalization\\\hline
  \end{tabular}
\end{frame}

\section{Proofs }
\subsection{Getting Started}
\begin{frame}
  \frametitle{Transitivity of Implication}
  \framesubtitle{Poof}
  Justify the rule of \textbf{universal transitivity},
    which states that if $\forall x (P(x) \limplies Q(x))$ and
    $\forall x (Q(x) \limplies R(x))$ are true, then $\forall x
    (P(x) \limplies R(x))$ is true, where the domains of all
    quantifiers are the same.
    \pause

    To be proven:  $(\forall x (P(x) \limplies Q(x)) \land \forall
    (Q(x) \limplies R(x))) \limplies \forall x
    (P(x) \limplies R(x))$\\
    \begin{tabular}{llll}
      &$\forall x (P(x) \limplies Q(x))$&1&Premise\\
      &$P(c) \limplies Q(c)$ for arbitrary $c$&2&UI 1\\
      &$\forall x (Q(x) \limplies R(x))$&3&Premise\\
      &$Q(c) \limplies R(c)$ for same $c$&4&UI 3\\
      &$P(c) \limplies R(c)$&5&HS 2, 4\\\cline{2-2}
      $\therefore$&$\forall x (P(x) \limplies R(x))$&6&U Gen 5\\
    \end{tabular}\\
    $\therefore$ $(\forall x (P(x) \limplies Q(x)) \land \forall
    (Q(x) \limplies R(x))) \limplies \forall x
    (P(x) \limplies R(x))$\\
\end{frame}

\subsection{Terminology}

\begin{frame}
  \frametitle{Proofs}
  \framesubtitle{Terminology}
  \begin{definitions}
    A \alert<2>{theorem} \visible<2->{is a statement that can be proved
      to be true. Synonyms: \alert<2>{proposition}, \alert<2>{fact},
      \alert<2>{result}}

    A \alert<3>{premise} \visible<3->{is a proposition given as true as
      part of the statement of a theorem. Synonyms: \alert<3>{given}}

    A \alert<4>{proof} \visible<4->{is a valid argument that establishes
      the truth of a theorem.}

    An \alert<5>{axiom} \visible<5->{is a statement that is assumed to be
      true; used for definitional conditions of mathematics. Synonyms:
      \alert<5>{postulate}}

    A \alert<6>{lemma} \visible<6->{is a less important proof useful in
    proving other results (typically not interesting on its own).}
  \end{definitions}
\end{frame}

\begin{frame}
  \frametitle{Proofs}
  \framesubtitle{More Terminology}

  \begin{definitions}
    A \alert<2>{corollary} \visible<2->{is a theorem that can be
      established directly from the theorem just proved.}

    A \alert<3>{conjecture} \visible<3->{is a statement that is
      \textbf{proposed} to be true but which lacks a valid proof.}
  \end{definitions}
\end{frame}

\begin{frame}
  \frametitle{Formatting}
  \framesubtitle{How Proofs are Stated}

  Remember: \textbf{All} proofs begin with a statement of what is
  being proved and end by concluding that that thing has been proved:

  \begin{proof}
    \alert{To be proved: $\forall x \in D \forall y \in D \; P_1(x) \land
    P_2(x) \ldots P_n(x) \limplies Q(x)$}\\

    <Proof of statement goes here>\\

     \alert{$\therefore$ $\forall x \in D \forall y \in D \; P_1(x) \land
    P_2(x) \ldots P_n(x) \limplies Q(x)$}\\
  \end{proof}
\end{frame}

\begin{frame}
  \frametitle{Formatting}
  \framesubtitle{How Proofs are Stated}

  \begin{example}
    \begin{quote}
      If $x > y$, where $x$ and $y$ are positive real numbers, then $x^2
      > y^2$.
    \end{quote}

    What does this really mean?
    \pause

    \begin{quote}
      For all positive real numbers $x$ and $y$, if $x > y$, then $x^2 >
      y^2$.
    \end{quote}

    Or, in logical notation
    \pause

    $$\forall x \forall y ~ x,y\in\mathbb{R}^+ (x > y) \limplies (x^2 > y^2)$$
  \end{example}
\end{frame}

\subsection{Direct Proofs}

\begin{frame}
  \frametitle{Definition}
  \begin{definition}[Direct Proof]
    A proof of $p \limplies q$ where $p$ is given to be true and a
    sequence of logical steps leads to $q$ being equivalently true.
  \end{definition}

  \begin{theorem}
    Every odd integer is the difference of two squares.\\
    Which means:\\
    \pause
    $\forall n \in \mathbb{Z} \; odd(n) \limplies \exists a \in
    \mathbb{Z}\;\exists b \in \mathbb{Z} \;\ni\; n = a^2 - b^2$\\
  \end{theorem}
\end{frame}

\begin{frame}
  \frametitle{Difference of Squares}
  \framesubtitle{Two-column Proof}
  \begin{theorem}
    Every odd integer is the difference of two squares.\\
    $\forall n \in \mathbb{Z} \; odd(n) \limplies \exists a \in
    \mathbb{Z}\;\exists b \in \mathbb{Z} \;\ni\; n = a^2 - b^2$\\
  \end{theorem}
  \begin{proof}
    To be proven:
    $\forall n \in \mathbb{Z} \; odd(n) \limplies \exists a \in
    \mathbb{Z}\;\exists b \in \mathbb{Z} \;\ni\; n = a^2 - b^2$\\

    \begin{tabular}{llll}
        &$\forall n~odd(n)$&1&Premise\\\pause
        &$odd(x)$&2&UI\\\pause
        &$\exists y \in \mathbb{Z} \ni x = (2y + 1)$&3&Definition of $odd$\\\pause
        &$x = (2y + 1)$&3&Existential Inst.\\\pause
        &$y^2 = y^2$&4&Definition of =\\\pause
        &$y^2 + x = y^2 + 2y + 1$&5&Sub equality 4 - 3\\\pause
        &$y^2 + x = (y + 1)^2$&6&Factoring\\\cline{2-2}\pause
        $\therefore$&$x = (y + 1)^2 - y^2$&7&Subtract equality\\
        $\therefore$&$\forall n~odd(n) \limplies \exists a \in \mathbb{Z}\;
        \exists b \in \mathbb{Z} \;\ni\; n = a^2 - b^2$&8&Generalization\\
    \end{tabular}
  \end{proof}

\end{frame}

\subsection{Proof by Contrapositive}
\begin{frame}
  \frametitle{Defining}
  \framesubtitle{Proof by Contraposition}

  \begin{definition}[Proof by Contrapositive]
    Assume the \alert<1>{negation} of the conclusion as given; prove,
    ``directly,'' that the \alert<1>{negation} of the hypothesis
    follows.
  \end{definition}

  \pause

  \begin{theorem}
    If $n = ab$, where $a$ and $b$ are positive integers, then $a \leq
    \sqrt{n} \lor b \leq \sqrt{n}$\\
    Which means:\\
    \pause
    $\forall a \forall b \; a,b\in\mathbb{Z}^+$ let
    $n = ab \; a \leq \sqrt{n} \lor b \leq \sqrt{n}$
  \end{theorem}
\end{frame}

\begin{frame}
  \frametitle{Working Out the Contrapositive}
  \framesubtitle{Getting ``To be proved''}

  \begin{theorem}
    For any two positive integers, at least one of them is less than
    or equal to the square root of their product.
    $\forall a \forall b \; a,b\in\mathbb{Z}^+$ let
    $n = ab \; a \leq \sqrt{n} \lor b \leq \sqrt{n}$\\
    Contrapositive:\\
    \pause
    $\forall a \forall b \; a,b \in \mathbb{Z}^+$
    if $\lnot (a \leq \sqrt{n} \lor b \leq \sqrt{n})$ then
    $\lnot (n = ab)$\\
    \pause
    $\forall a \forall b \; a,b \in \mathbb{Z}^+$
    if $a > \sqrt{n} \land b > \sqrt{n}$ then
    $n \neq ab$
  \end{theorem}
\end{frame}

\begin{frame}
  \frametitle{Factor above/below $\sqrt{product}$}
  \framesubtitle{Two-column Proof}

  \begin{proof}
     To be proven: $\forall a \forall b \; a,b\in\mathbb{Z}^+$ let
     $n = ab \; a \leq \sqrt{n} \lor b \leq \sqrt{n}$\\
     Proof proceeds by \emph{contrapositive}\\
   Contrapositive:
    $\forall a \forall b \; a,b \in \mathbb{Z}^+ \; $ let $n = ab \: (a > \sqrt{n}
    \land b > \sqrt{n}) \limplies n \neq ab$\\
    \begin{tabular}{llll}
      &$a > \sqrt{n}$&1&Premise and simplification\\
      &$b > \sqrt{n}$&2&Premise and simplification\\
      &$ab > n$&3&Positive Product of Inequality 1, 2\\
      &$ab \ne n$&4&Defn. of =, 3\\
    \end{tabular}
      $\therefore$$ (a > \sqrt{n} \land b > \sqrt{n}) \limplies n \neq ab$\\
      $\therefore$ $\forall a \forall b \; a,b \in \mathbb{Z}^+ \; (a > \sqrt{n} \land b > \sqrt{n}) \limplies n \neq ab$\\
    $\therefore$  $\forall a \forall b \; a,b\in\mathbb{Z}^+$ let
     $n = ab \; a \leq \sqrt{n} \lor b \leq \sqrt{n}$
  \end{proof}
\end{frame}

\subsection{Proof by Contradiction}
\begin{frame}
  \frametitle{Defining}
  \framesubtitle{Proof by Contradiction}

  \begin{definition}[Proof by Contradiction]
  Assume we want to prove $q$ true. If $\exists r$ such that $r$ is a
  contradiction and we can show $\lnot q \limplies r$ then it follows
  that $\lnot q$ must be \alert{false} \only<1>{Why?}

  \pause If $\lnot q$ is \emph{false}, $q$ is \alert{true} and we have
  proved our statement.
  \end{definition}
\end{frame}

\begin{frame}
  \frametitle{Diversion I: Definitions}
  \framesubtitle{Rational}
  \begin{definition}
    A real number, $q$ is \alert<1>{rational} if it can be written as
    a \alert<1>{ratio} (fraction) of two integers: $q \in \mathbb{Q}$ if $\exists n \;
    \exists d \; n,d \in \mathbb{Z} \; d \neq 0 \; q = \frac{n}{d}$

    \pause
    A real number $r$ is \alert<2>{irrational} if it is not rational:
    $\lnot (\exists n \; \exists d \; n,d \in \mathbb{Z} \; d \neq 0
    \; r = \frac{n}{d})$
  \end{definition}
\end{frame}

\begin{frame}
  \frametitle{Diversion II: A Lemma}
  \framesubtitle{Even squares come from even numbers}
  \begin{lemma}
    $\forall n \in \mathbb{Z} \; 2 | n^2 \limplies 2 |
    n$
  \end{lemma}
  {\small
  \begin{proof}
    To be proven: $\forall n \in \mathbb{Z} \; 2 | n^2 \limplies 2 |
    n$\\
    Proof by contrapositive\\
    Contrapositive: $\forall n \in \mathbb{Z} \; 2 \ndiv n \limplies
    2 \ndiv n^2$\\\pause
    Equivalently: $\forall n \in \mathbb{Z} \; odd(n) \limplies odd(n^2)$\\\pause
    \begin{tabular}{llll}
      &$odd(n)$&1&UI, Premise \\
      &$\exists k \in \mathbb{Z} | n = 2k + 1$&2&Defn. odd \\
      &$n^2 = (2k + 1)^2$&3&Substitution \\
      &$n^2 = 4k^2 + 4k + 1 = 2(2k^2 + 2k) + 1$&4&Algebra, 3 \\
      &$\exists j \in \mathbb{Z} | n^2 = 2j + 1$&5&EG, 4 \\\cline{2-2}
      $\therefore$&$odd(n^2)$&6&Defn odd \\
    \end{tabular}

    $\therefore$ $\forall n \in \mathbb{Z} \; odd(n) \limplies
    odd(n^2)$\\
    $\therefore$ $\forall n \in \mathbb{Z} \; 2 | n^2 \limplies 2 |
    n$
  \end{proof}
  }
\end{frame}

\begin{frame}
  \frametitle{Irrational Square Root}
  \framesubtitle{Starting the Proof}

  \begin{theorem}
    $\sqrt{2}$ is irrational.
  \end{theorem}
  \pause

  \begin{proof}
    To be proven: $\sqrt{2}$ is irrational.\\
    Proof is by \emph{contradiction}\\
    For Sake of Contradiction: Assume $\lnot (\sqrt{2}$ is irrational) \\ or
    \pause
    $\sqrt{2}$ is rational
  \end{proof}
\end{frame}

\begin{frame}
  \frametitle{Irrational Square Root}
  \framesubtitle{Two-column Proof}
    {\small
  \begin{proof}
    To be proven: $\sqrt{2}$ is irrational.\\
    Proof is by \emph{contradiction}\\
    FSOC: $\sqrt{2}$ is rational\\

    \begin{tabular}{llll}
      &$\sqrt{2}$ is rational&1&Assumption\\\pause
      &$\sqrt{2} = \frac{a}{b}$&2&Defn rational\\
      &&&without loss of generality,\\
      &&&$lowest(\frac{a}{b})$\\\pause
      &$2 = \frac{a^2}{b^2}$ and $2b^2 = a^2$&3&Square both sides\\\pause
      &$even(a)$&4&$even(x^2) \limplies even(x)$\\
      &$a = 2c$ thus $2b^2 = 4c^2$ &5&Defn $even$\\\pause
      &$b^2 = 2c^2$; $even(b)$&6&Algebra and as (4)\\\pause
      &$2|a \land 2|b$&7&Defn divisibility\\
      &$\lnot lowest(\frac{a}{b})$&8&Defn lowest terms\\\pause
      &$\lnot (\sqrt{2}$ is rational$)$&9&Contradiction 2,8\\\cline{2-2}
      $\therefore$&$\sqrt{2}$ is irrational&&\\
    \end{tabular}

  \end{proof}
  }
\end{frame}

\begin{frame}
  \frametitle{Proof by Contradiction}
  \framesubtitle{Your Turn}

  Prove that if you pick three marbles from an urn containing only
  black and white marbles, you must have a pair of white marbles or a
  pair of black marbles.

\end{frame}
\end{document}

%%% Local Variables:
%%% mode: latex
%%% TeX-master: t
%%% End:
