%!TEX program = xelatex
\documentclass{article}

% Execute before loading fancyhdr
\usepackage{geometry}
%% Geometry
\geometry{a4paper}
\geometry{includeheadfoot, margin=15mm}

\usepackage{LaTeX-Submodule/template}

% Additional packages & macros
\usepackage{changepage} % Modify page width
\usepackage{multicol} % Use multiple columns

%% Table Cell Stretch
\setlength{\tabcolsep}{10pt} % Default value: 6pt
\renewcommand{\arraystretch}{1.5} % Default value: 1

%% Set symbols
\DeclareMathOperator{\setunion}{\cup} % defined for clarity/consistency
\DeclareMathOperator{\setintersection}{\cap}

%% Quotation in math mode
\newcommand{\quo}[1]{\text{``}#1\text{''}}

% Metadata for README
\newcommand{\unitName}{Abstract Mathematical Reasoning}
\newcommand{\unitTime}{Semester 1, 2021}
\newcommand{\unitCoordinator}{Dr Adrianne Jenner}

%% Title page
\title{\textbf{Abstract Mathematical Reasoning}
    \texorpdfstring{\\}{ } {\large Exam Notes}
    \texorpdfstring{\\}{ } {\normalsize 2021, Semester 1}}
\author{
    Rohan Boas \and Tarang Janawalkar \and Oliver Strong
}

% Header and footer
\setlength\headheight{15.2pt}

\fancyhead[L]{2021 Semester 1}
\fancyhead[C]{Abstract Mathematical Reasoning Exam Notes}
\fancyhead[R]{\thepage}
\fancyfoot[C]{}

% Copyright
\usepackage[
    type={CC},
    modifier={by},
    version={4.0},
    imagewidth={5em},
]{doclicense}

\date{}

\begin{document}
%
\begin{titlepage}
    \maketitle
    \thispagestyle{empty}
    \vspace*{\fill}
    \begin{adjustwidth}{4cm}{4cm}
        {\Large\bf Preface}
        \vspace{0.7em}

        This document is a succinct reference for the unit MXB102.
        We hope this document is useful, particularly to those undertaking this unit's final exam.
        This document is not intended to be a replacement for the lecture notes and unit guide.
        We would personally like to thank our lecturer, Dr Adrianne Jenner,
        and all of the tutors for the great amount of support and teachings
        that we have been able to receive over the course of this unit.
    \end{adjustwidth}
    \vspace*{\fill}
    \doclicenseThis
    \thispagestyle{empty}
\end{titlepage}
%
\newpage
%
\section{Logic}
\begin{table}[H]
    \centering
    \begin{tabular}{c c c}
        \textbf{Name}         & \textbf{Symbol}  & \textbf{Truth Table} \\
        \midrule
        Negation (NOT)        & \(\neg\)                    &
        \begingroup
        \renewcommand{\arraystretch}{1}
        \begin{tabular}{c c}
            \(P\)          & \(\neg{P}\)    \\
            \midrule
            {\sffamily{T}} & {\sffamily{F}} \\
            {\sffamily{F}} & {\sffamily{T}}
        \end{tabular}
        \endgroup
        \\
        Conjunction (AND)     & \(\land\)                   &
        \begingroup
        \renewcommand{\arraystretch}{1}
        \begin{tabular}{c c c}
            \(P\)          & \(Q\)          & \(P\land Q\)   \\
            \midrule
            {\sffamily{T}} & {\sffamily{T}} & {\sffamily{T}} \\
            {\sffamily{T}} & {\sffamily{F}} & {\sffamily{F}} \\
            {\sffamily{F}} & {\sffamily{T}} & {\sffamily{F}} \\
            {\sffamily{F}} & {\sffamily{F}} & {\sffamily{F}}
        \end{tabular}
        \endgroup
        \\
        Disjunction (OR)      & \(\lor\)                    &
        \begingroup
        \renewcommand{\arraystretch}{1}
        \begin{tabular}{c c c}
            \(P\)          & \(Q\)          & \(P\lor Q\)    \\
            \midrule
            {\sffamily{T}} & {\sffamily{T}} & {\sffamily{T}} \\
            {\sffamily{T}} & {\sffamily{F}} & {\sffamily{T}} \\
            {\sffamily{F}} & {\sffamily{T}} & {\sffamily{T}} \\
            {\sffamily{F}} & {\sffamily{F}} & {\sffamily{F}}
        \end{tabular}
        \endgroup
        \\
        Conditional (IF-THEN) & \(\implies\)                &
        \begingroup
        \renewcommand{\arraystretch}{1}
        \begin{tabular}{c c c}
            \(P\)          & \(Q\)          & \(P\implies Q\) \\
            \midrule
            {\sffamily{T}} & {\sffamily{T}} & {\sffamily{T}}  \\
            {\sffamily{T}} & {\sffamily{F}} & {\sffamily{F}}  \\
            {\sffamily{F}} & {\sffamily{T}} & {\sffamily{T}}  \\
            {\sffamily{F}} & {\sffamily{F}} & {\sffamily{T}}
        \end{tabular}
        \endgroup
        \\
        Equivalence (IFF)     & \(\iff\) or \(\equiv\) &
        \begingroup
        \renewcommand{\arraystretch}{1}
        \begin{tabular}{c c c}
            \(P\)          & \(Q\)          & \(P\iff Q\)    \\
            \midrule
            {\sffamily{T}} & {\sffamily{T}} & {\sffamily{T}} \\
            {\sffamily{T}} & {\sffamily{F}} & {\sffamily{F}} \\
            {\sffamily{F}} & {\sffamily{T}} & {\sffamily{F}} \\
            {\sffamily{F}} & {\sffamily{F}} & {\sffamily{T}}
        \end{tabular}
        \endgroup
    \end{tabular}\label{tab:Logic Symbols}
    \caption{Boolean operators in order of precedence.}
\end{table}
\begin{theorem}[de Morgan's Law]
    \(\neg{\left(P \land Q\right)} \iff \neg{P} \lor \neg{Q}\).
\end{theorem}
%
\begin{definition}[Tautology]
    A tautology is a statement that is always true.
\end{definition}
%
\begin{definition}[Paradox]
    A paradox is a statement that is always false.
\end{definition}
%
\begin{definition}[Converse]
    The converse of the statement \(P\implies Q\)	is the statement \(Q\implies P\).
\end{definition}
%
\begin{definition}[Contrapositive]
    The contrapositive of \(P\implies Q\)	is the statement \(\neg{Q}\implies \neg{P}\).
\end{definition}
%
\section{Sets}
\begin{table}[H]
    \centering
    \begin{tabular}{c c c}
        \textbf{Name}             & \textbf{Symbol}              & \textbf{Definition}                                               \\
        \midrule
        Empty set                 & \(\emptyset\)                & A set with no elements: \(\left\{{}\right\}\)                     \\
        Intersection              & \(\setintersection\)         & \(S \setintersection T = \left\{x:x\in S \land x \in T\right\}\)  \\
        Union                     & \(\setunion\)                & \(S \setunion T = \left\{x:x\in S \lor x \in T\right\}\)          \\
        Set difference            & \(\backslash \text{ or } -\) & \(S - T = \left\{x:x\in S \land x \notin T\right\}\)              \\
        Subset                    & \(\subseteq\)                & If \(\#S=\#T, \quad S \subseteq T \equiv \forall x\in S:x \in T\) \\
        Strict (or proper) subset & \(\subset\)                  & If \(\#S<\#T, \quad S \subset T \equiv \forall x\in S:x \in T\)   \\
        Complement                & \(\overline{S}\)             & If \(S \subseteq T, \quad \overline{S}=T \backslash S\)
    \end{tabular}\label{tab:Set Symbols}
    % \caption{Set symbols}
\end{table}
%
\begin{definition}[Disjoint]
    If \(S \setintersection T = \emptyset\), then \(S\) and \(T\) are disjoint
    (i.e.\ two sets are disjoint if their intersection is empty).
\end{definition}
%
\subsection{Construction of the Natural Numbers}
\begin{definition}[\(\quo{0}\)]
    \(\quo{0}\) is defined as the empty set, \(\emptyset\) or \(\left\{\right\}\), which is the first element of the natural numbers.
\end{definition}
%
\begin{definition}[Successor function]
    The successor function, \(S(n)\), is defined as \(n \setunion \{n\}\).
\end{definition}
%
\begin{definition}[Addition]
    Addition (\(+\)) is defined recursively by the following axioms:
    \begin{enumerate}[label={(A\arabic*)}, leftmargin=3.5em, itemsep=0.2em, topsep=0.35em]
        \item \(\mathrm{\quo{a} + \quo{0} = \quo{a}}\)
        \item \(\mathrm{\quo{a} + S(\quo{b}) = S(\quo{a} + \quo{b})}\)
    \end{enumerate}
\end{definition}
%
\begin{definition}[Multiplication]
    Multiplication (\(\cdot\)) is defined recursively by the following axioms:
    \begin{enumerate}[label={(M\arabic*)}, leftmargin=3.5em, itemsep=0.2em, topsep=0.35em]
        \item \(\mathrm{\quo{a} \cdot \quo{0} = \quo{0}}\)
        \item \(\mathrm{\quo{a} \cdot S(\quo{b}) = \quo{a} + (\quo{a} \cdot \quo{b})}\)
    \end{enumerate}
\end{definition}
%
\begin{definition}[Exponentiation]
    Exponentiation (\(\uparrow\)) is defined recursively by the following axioms:
    \begin{enumerate}[label={(E\arabic*)}, leftmargin=3.5em, itemsep=0.2em, topsep=0.35em]
        \item \(\mathrm{\quo{a} \uparrow \quo{0} = \quo{1}}\)
        \item \(\mathrm{\quo{a} \uparrow S(\quo{b}) = \quo{a} \cdot (\quo{a} \uparrow \quo{b})}\)
    \end{enumerate}
\end{definition}
%
\subsubsection{Properties of Natural Numbers}
\begin{description}[style=sameline]
    \item[Commutativity of addition]
        \(\mathrm{ \quo{a} + \quo{b} = \quo{b} + \quo{a}}\)
    \item[Associativity of addition]
        \(\mathrm{(\quo{a} + \quo{b}) + \quo{c} = \quo{a} + (\quo{b} + \quo{c})}\)
    \item[Commutativity of multiplication]
        \(\mathrm{\quo{a} \cdot \quo{b} = \quo{b} \cdot \quo{a}}\)
    \item[Associativity of multiplication]
        \(\mathrm{(\quo{a} \cdot \quo{b}) \cdot \quo{c} = \quo{a} \cdot (\quo{b} \cdot \quo{c})}\)
    \item[Distributivity of multiplication over addition]
        \(\mathrm{\quo{a} \cdot  (\quo{b} + \quo{c}) = (\quo{a} \cdot \quo{b}) + (\quo{a} \cdot \quo{c})}\)
    \item[Cancellation law]
        If \(\mathrm{\quo{a} \cdot \quo{b} = \quo{a} \cdot \quo{c}}\)
        and \(\mathrm{\quo{a} \ne \quo{0}}\)
        then \(\mathrm{\quo{b} = \quo{c}}\)
\end{description}
\begin{theorem}
    \(\forall n\in\N\backslash\{0\} : 2^n>n\).
\end{theorem}
\begin{theorem}
    \(\forall n\in\N\backslash\{0\} : 1+2+\cdots+n=\frac{n(n+1)}{2}\).
\end{theorem}
%
\subsection{Cartesian Product}
\begin{definition}[Cartesian product]
    The Cartesian product of two sets \(S\) and \(T\) is the set
    \(S\times T\) consisting of all ordered pairs \((x, y)\) where
    \(x \in S\) and \(y \in T\).
\end{definition}
%
\subsection{Quantifiers}
\begin{table}[H]
    \centering
    \begin{tabular}{c c c}
        \textbf{Name}                             & \textbf{Symbol} & \textbf{Usage}     \\
        \midrule
        Universal Quantification (For All)        & \(\forall\)     & \(\forall x:P(x)\) \\
        Existential Quantification (There Exists) & \(\exists\)     & \(\exists x:P(x)\) \\
    \end{tabular}\label{tab:Quantifiers}
    % \caption{Quantifiers}
\end{table}
%
\begin{theorem}
    \(\neg{\left(\forall x:P(x)\right)} \equiv \exists x:\neg P(x)\)
\end{theorem}
%
\begin{theorem}
    \(\neg{\left(\exists x:P(x)\right)} \equiv \forall x:\neg P(x)\)
\end{theorem}
%
\begin{definition}[Greater than (\(>\))]
    \(x > y \iff \exists a \in \N\backslash\{0\} : x=y+a\)
\end{definition}
%
\begin{definition}[Greater than or equal to (\(\geqslant\))]
    \(x \geqslant y \iff \exists a \in \N : x=y+a\)
\end{definition}
%
\section{Relations}
\begin{definition}[Binary relation]
    A binary relation \(R\) on \(S\) is the subset \(S\times S\).
    If \(a, \: b \in S\) and  \((a, \: b) \in R\),
    then \(aRb\) (``\(a\) is related to \(b\) under \(R\)'')
\end{definition}
%
\begin{tcolorboxlarge}[title={Relation Properties}]
    \begin{description}[style=sameline]
        \item[Reflexive]
            \(\forall x \in S : xRx\)
        \item[Symmetric]
            \(\forall x,\: y \in S : xRy \implies yRx\)
        \item[Antisymmetric]
            \(\forall_\text{distinct} \: x,\: y \in S : xRy \implies \neg (yRx)\)
        \item[Transitive]
            \(\forall x,\: y, \: z \in S : (xRy \land yRz) \implies xRz\)
    \end{description}
    \begin{definition}[Equivalence relation]
        A relation is an equivalence relation if it is
        reflexive, symmetric, and transitive.
    \end{definition}
\end{tcolorboxlarge}
%
\begin{definition}[Functions as rules]
    A function \(f\) is a rule which maps
    from some set \(S\) (the domain)
    to some set \(T\) (the codomain)
    (i.e. \(f: S \to T\)) where each \(x \in S\) maps to a unique \(f(x) \in T\).
\end{definition}
\begin{definition}[Image]
    The image of a function \(f: S \to T\) is the set \(f(S)\),
    which is equal to \(\{f(x):x \in S\}\).
\end{definition}
\begin{definition}[Functional]
    A relation is functional if
    \(\forall x \in S \land \forall y,\: z \in T
    : (xRy \, \land \, xRz) \implies y=z\).
\end{definition}
\begin{note}
    The functional property corresponds to the vertical line test.
\end{note}
\begin{definition}[Left-total]
    A relation is left-total if
    \(\forall x \in S : \exists y \in T : xRy\).
\end{definition}
\begin{definition}[Functions as relations]
    A function \(f\) is some relation that is functional and left-total.
\end{definition}
%
\begin{tcolorboxlarge}[title={Function Properties}]
    \begin{description}[style=sameline]
        \item[Injective (one-to-one)]
            \(\forall x,\: z \in S : \forall y \in T
            : (xRy \,\land\, zRy) \implies x = z\)

            Put in words, every element in the codomain (\(T\))
            is being mapped to by \textit{at most} one element from the domain (\(S\)).
        \item[Surjective (onto)]
            \(\forall y \in T : \exists x \in S : xRy\)

            Put in words, every element in the codomain (\(T\))
            is being mapped to by \textit{at least} one element from the domain (\(S\)).
        \item[Bijective]
            \(R\) is injective and surjective.
    \end{description}
\end{tcolorboxlarge}
%
\begin{definition}[Equal functions]
    Two functions are equal if they have the same domain and codomain
    for all \(x\), so that \(f(x) = g(x)\).
\end{definition}
%
\begin{definition}[Function composition]
    The composition of two functions \(f:X \to Y\) and \(g:Y \to Z\),
    denoted \(g \circ f\), maps \(X\) to \(Z\), and is defined as
    \((g \circ f)(x) = g(f(x))\).
\end{definition}
%
\begin{theorem}
    For \(f:X \to Y\) and \(g:Y \to Z\) and  \(h:Z \to W\),
    \(h \circ (g \circ f) = (h \circ g) \circ f\).
\end{theorem}
%
\begin{definition}[Identity function]
    The identity function of \(X\) is \(1_X:X \to X\) and is defined as
    \(1_X (x)=x\) for all \(x \in X\).
\end{definition}
%
\begin{definition}[Inverse function]
    If \(f:X \to Y\) and \(g:Y \to X\) are functions where
    \(g \circ f = 1_X\) and \(f \circ g = 1_Y\),
    then \(g\) is the inverse of \(f\), denoted \(f^{-1}\).
\end{definition}
%
\begin{theorem}
    A function \(f\) has an inverse if and only if \(f\) is bijective.
\end{theorem}
%
\begin{definition}[Equivalence class]
    Let \(R\) be an equivalence relation on \(S\) and \(x \in S\).
    The equivalence class of \(x\) is \([x] = \{y \in S : xRy\}\),
    i.e.\ the set of all elements in \(S\) that are related to \(x\).

    \(x\) is a representative of the equivalence class \([x]\).
    There may be different representations of the same equivalence class.
\end{definition}
%
\section{Number Sets}
\subsection{Rational Numbers}
\begin{definition}[Rational numbers]
    Define an equivalence relation \(\sim\) on \(\Z \times (\N\backslash\{0\}\)
    as \((a,\: b) \sim (c,\: d) \iff ad=bc\).
    The equivalence classes of \(\sim\) are rational numbers.
    \([(a,\: b)] = \frac{a}{b}\).
    The set of all rational numbers is
    \(\Q = \left\{ \frac{a}{b} : a\in \Z, b\in \N_{>0} \right\}\).
\end{definition}
%
\begin{definition}[Addition on rational numbers]
    \((a,\: b) + (c,\: d) = (ad+bc,\: bd)\)
\end{definition}
%
\begin{definition}[Multiplication on rational numbers]
    \((a,\: b) \cdot (c,\: d) = (ac,\: bd)\)
\end{definition}
\begin{theorem}
    There is no smallest positive rational number.
\end{theorem}
%
\section{Algebraic Structures}
\begin{tcolorboxlarge}[title={Ring Axioms}]
    \begin{definition}[Commutativite ring with identity]
        A commutative ring with identity is a set \(S\) with two binary operations \(+\) and \(\cdot\) such that the following ring axioms are satisfied.
    \end{definition}
    \begin{enumerate}[leftmargin=3.5em, itemsep=0.2em, topsep=0.35em]
        \item[(C1)] \(+\) is closed: \(\forall a,\:b \in S: a+b \in S\).
        \item[(A1)] \(+\) is associative: \(\forall a,\:b,\:c \in S: (a+b)+c = a+(b+c)\).
        \item[(A2)] \(+\) is commutative: \(\forall a,\:b \in S: a+b=b+a\).
        \item[(A3)] additive identity: \(\forall a\in S:\exists z \in S:a+z=a\).
        \item[(A4)] additive inverse: \(\forall a \in S, \exists b\in S: a+b = z\) (denoted ``\(0\)'').
        \item[(C2)] \(\cdot\) is closed: \(\forall a,\:b \in S: a \cdot b \in S\).
        \item[(M1)] \(\cdot\) is associative: \(\forall a,\:b,\:c \in S:a \cdot (b \cdot c) = (a \cdot c) \cdot c\).
        \item[(M2)] \(\cdot\) is commutative: \(\forall a,\:b \in S:a \cdot b = b \cdot a\).
        \item[(M3)] multiplicative identity: \(\forall a \in S:\exists e \in S:a \cdot e = a\) (denoted ``\(1\)'').
        \item[(D)] distributivity: \(\forall a,\:b,\:c \in S: a \cdot (b + c) = (a \cdot b) + (a \cdot c)\).
    \end{enumerate}
\end{tcolorboxlarge}
\begin{note}
    \(\Z\), \(\Q\), \(\R\), and \(\C\) are rings.
\end{note}
% \marginpar{\raggedright\footnotesize The definition of rings and fields has been excluded from this document for brevity}
%
\begin{definition}[Integers]
    The set of integers (\(\Z\)) is the smallest ring containing the natural numbers.
\end{definition}
\begin{note}
    The integers are the closure of the natural numbers in regards to the ring axioms.
\end{note}
%
\begin{definition}[Real numbers]
    Let \(D = \Z \times \{\mathrm{sequence\ of\ digits\ 0\dots 9}\}\).
    Define an equivalence relation on \(D\) such that
    \begin{equation*}
        x_0 . x_1 x_2 \dots x_{k-1} x_k \overline{000} = x_0 . x_1 x_2 \dots x_{k-1} \left(x_k - 1\right)\overline{999}
    \end{equation*}
    The real numbers (\(\R\)) is the set of the equivalence classes of D using the equivalence relation above.
\end{definition}
%
\begin{definition}[Irrational numbers]
    The irrational numbers (\(\I\) or \(\overline{\Q}\)) are defined as \(\R\backslash\Q\).
\end{definition}
\begin{theorem}
    If \(a,\:b\in\R\) are such that \(ab\) is irrational, then at least one of \(a\) or \(b\) is irrational.
\end{theorem}
%
\begin{note}
    Let \(a,\: b\in \R\). If \(ab\in\I\), then either \(a\in\I\) or \(b\in\I\).
\end{note}
%
\begin{tcolorboxlarge}[title={Field Axioms}]
    \begin{definition}[Field]
        A field is a set \(S\) which is a commutative ring with identity so that it satisfies all ring axioms and also the following axiom.
    \end{definition}
    \begin{enumerate}
        \item[(M4)] multiplicative inverse: \(\forall a \in S \ \{0\}:\exists b \in S: a\cdot b=e\).
    \end{enumerate}
\end{tcolorboxlarge}
\begin{note}
    \(\Q\), \(\R\), and \(\C\) are fields.
\end{note}
%
\section{Cardinality}
\nopagebreak
\begin{multicols}{2}
    \begin{definition}[Cardinality]
        The cardinality of \(X\) (\(\#X\) or \(\abs{X}\)), is the number of elements in \(X\).
        If there is a bijection between two sets \(X\) and \(Y\),
        then \(\#X=\#Y\) or equivalently, \(\abs{X} = \abs{Y}\).
    \end{definition}
    %
    \begin{definition}[\(\N_{<n}\)]
        The subset of \(\N\) containing all naturals less than \(n\).
    \end{definition}
    %
    \begin{definition}[Finite and infinite sets]
        If a set \(X\) is such that \(\#X=\#\N_{<n}\),
        then the number of elements in \(X\) is \(n\) and \(X\) is a finite set.
        If there is no \(n\) such that there is a bijection between \(X\) and \(\N_{<n}\),
        then \(X\) is an infinite set.
    \end{definition}
    %
    \begin{definition}[Countable and uncountable infinities]
        If there exists a bijection between an infinite set \(X\) and \(\N\),
        then \(X\) is countably infinite, else uncountably infinite.
    \end{definition}
    %
    \columnbreak
    %
    \begin{theorem}\(\#\N = \#\Z\)\end{theorem}
    \begin{theorem}\(\#(\N\times\N) = \#\N\)\end{theorem}
    \begin{theorem}\(\#\Q = \#\N\)\end{theorem}
    \begin{theorem}\(\#\N \ne \#\R\)\end{theorem}
    %
    \begin{definition}[Power set]
        The power set of \(X\), \(\mathscr{P}(X)\), is the set of all subsets of \(X\),
        including \(\emptyset\) and \(X\).
    \end{definition}
    \begin{theorem}
        The cardinality of \(\mathscr{P}(X)\) is \(2^{\abs{X}}\).
    \end{theorem}
\end{multicols}
%
\section{Proofs}
\begin{tcolorboxlarge}[title={Proof Structure}]
    \begin{enumerate}[leftmargin=3.5em, itemsep=0.2em, topsep=0.35em]
        \item State the proof method that will be used.
        \item If the proof method has conditions show that these conditions have been satisfied before using the proof method.
        \item Clearly state any assumptions and definitions as required by the proof.
        \item Apply the proof method.
        \item Write a sentence summarising the proof method.
        \item Conclude the proof with QED, \(\square\), or \(\blacksquare\).
    \end{enumerate}
\end{tcolorboxlarge}
\begin{note}[Disprove]
    To disprove a statement is to prove its negation.
\end{note}
%
\subsection{Direct Proof}
\begin{enumerate}
    \item Use a definition, i.e.\ even/odd numbers.
    \item Show LHS = RHS\@.
    \item For an equivalence (\(\iff\)) statement, show that both forward (\(\implies\)) and backward (\(\impliedby\)) directions are true.
\end{enumerate}
%
\subsection{Truth Table, Tautology, and Paradox}
\begin{enumerate}
    \item Draw a truth table for the statement.
    \item For a proof by truth table, show that two truth tables are the same.
    \item For a proof by tautology, show that the truth table is always true.
    \item For a proof by paradox, show that the truth table is always false.
\end{enumerate}
%
\subsection{Contradiction}
\begin{enumerate}
    \item Assume that the statement is false.
    \item Make a sequence of logical statements that follow from the assumption.
    \item Arrive at a contradiction.
    \item Since we arrive at a contradiction, the original assumption must have been wrong.
    \item Hence the original statement must be true.
    \item The \(\contradiction\) and \(\implies\!\!\!\!\impliedby\) symbols
          are often used to show a contradiction.
\end{enumerate}
%
\subsection{Contrapositive}
\begin{enumerate}
    \item Write the original statement as a conditional statement.
    \item Rewrite the statement in the contrapositive form.
    \item Try to prove the contrapositive statement, usually a direct proof.
    \item By proving the contrapositive, you have also proved the original statement.
\end{enumerate}
%
\subsection{Contradiction vs. Contrapositive}
For the conditional statement: ``If \(P\), then \(Q\)''.

\textbf{By contradiction:} Assume \(P\) and \(\neg{Q}\), and find some contradiction.

\textbf{By contrapositive:} Assume \(\neg{Q}\), and show \(\neg{P}\).
%
\subsection{Induction}
\begin{enumerate}
    \item Find the logical statement \(P(n)\) so that the theorem can be written in the form: ``Show \(P(n)\) is true for all \(n \in \N_{\geqslant n_0}\)''.
    \item Prove the base case is true: \(P(n)\) is true for \(n=n_0\).
    \item Write the inductive hypothesis: ``Assume \(P(n)\) is true for \(n=k\)''.
    \item Write the inductive step: ``\(P(n)\) is true for \(n=k+1\)''.
    \item Prove the inductive step is true, usually a direct proof. Remember to utilise the inductive hypothesis.
    \item Conclusion: Since \(P(n_0)\) is true, and \(P(k+1)\) is true whenever \(P(k)\) is true, then the principle of mathematical induction implies \(P(n)\) is true for all \(n\in \N_{\geqslant n_0}\).
\end{enumerate}
%
\subsection{Strong Induction}
\begin{enumerate}
    \item Find the logical statement \(P(n)\) so that the theorem can be written in the form: ``Show \(P(n)\) is true for all \(n \in \N_{\geqslant n_0}\)''.
    \item Prove the base case is true: \(P(n)\) is true for \(n=n_0\).
    \item Write the inductive hypothesis: ``Assume \(P(n)\) is true for \(n\leqslant k\)''.
    \item Write the inductive step: ``\(P(n)\) is true for \(n=k+1\)''.
    \item Prove the inductive step is true, usually a direct proof. Remember to utilise the inductive hypothesis.
    \item Conclusion: Since \(P(n_0)\) is true, and \(P(k+1)\) is true whenever \(P(n_0),\: \ldots,\: P(k)\) is true, then the principle of strong mathematical induction implies \(P(n)\) is true for all \(n\in \N_{\geqslant n_0}\).
\end{enumerate}
%
\pagebreak
\subsection{Useful Techniques}
\nopagebreak
\begin{multicols}{2}
    \begin{enumerate}
        \item Use the definition of the numbers, i.e.\ even and odd numbers.
        \item The product of two odd numbers is also odd.
        \item For rational numbers assume that \((a,b)\) is fully simplified, so that \(a\) and \(b\) are co-prime.
        \item When using strong induction, remember that \(P(k), \ldots, P(n_0)\) are assumed to be true.
              \columnbreak
        \item \(a^b=e^{\ln{a^b}}=e^{b\ln{a}}\)
        \item \(a^k = a^k + b - b\)
        \item \(a^{k+1} = a \cdot a^k\)
        \item \(\sum_{i}^{k+1} a_i = a_{k+1} + \sum_{i}^{k} a_i\)
    \end{enumerate}
\end{multicols}
%
\section{Sequences}
An infinite sequence on \(X\) is a function \(a\) with domain \(\N_{> 0}\) and codomain \(X\). That is, \(a:\N_{> 0}\to X\).

For infinite sequences we write \(a_n\) and the sequence can be represented as \(\left\{a_n\right\}_{n=1}^\infty\), where \(n\) is the index of the sequence.
%
\subsection{Convergence}
\begin{theorem}
    A sequence \(\left\{a_n\right\}_{n=1}^\infty\) converges to \(a\in \R\) if
    \begin{equation*}
        \lim_{n \to \infty}a_n = a \iff \forall \varepsilon > 0 : \exists n_0 \in \N_{> 0}:\forall n \geqslant n_0 : \abs{a_n - a} < \varepsilon
    \end{equation*}
\end{theorem}
%
\begin{theorem}
    A sequence \(\left\{a_n\right\}_{n=1}^\infty\) diverges to \(+\infty\) if
    \begin{equation*}
        \lim_{n \to \infty}a_n = +\infty \iff \forall N \in \R : \exists n_0 \in \N_{> 0}:\forall n \geqslant n_0 : a_n > N
    \end{equation*}
\end{theorem}
%
\begin{theorem}
    A sequence \(\left\{a_n\right\}_{n=1}^\infty\) diverges to \(-\infty\) if
    \begin{equation*}
        \lim_{n \to \infty}a_n = -\infty \iff \forall M \in \R : \exists n_0 \in \N_{> 0}:\forall n \geqslant n_0 : a_n < M
    \end{equation*}
\end{theorem}
%
\begin{theorem}[Triangle inequality]
    \(\abs{a+b}\leqslant\abs{a}+\abs{b}\).
\end{theorem}
%
\begin{theorem}
    The sequence \(\left\{ a_n \right\}_{n=1}^\infty\) converges to \(a\) if and only if the sequences \(\left\{ a_{2n} \right\}_{n=1}^\infty\) and \(\left\{ a_{2n-1} \right\}_{n=1}^\infty\) both converge to \(a\).
\end{theorem}
%
\begin{theorem}[Squeeze theorem for sequences]
    Let \(\left\{ a_n \right\}_{n=1}^\infty\), \(\left\{ b_n \right\}_{n=1}^\infty\), and \(\left\{ c_n \right\}_{n=1}^\infty\) be infinite sequences such that \(a_n \leqslant b_n \leqslant c_n\) for all \(n>n_0\). If \(\lim_{n\to\infty}a_n=\lim_{n\to\infty}c_n=d\), then \(\lim_{n\to\infty}b_n=d\).
\end{theorem}
%
\begin{tcolorboxlarge}[title={Limit Laws for Sequences}]
    \begin{theorem}
        Suppose that \(\left\{a_n\right\}\) and \(\left\{b_n\right\}\) are convergent infinite sequences on \(\R\) that converge to \(a\) and \(b\) respectively, and let \(c\in\R\) be a constant, then
        \begin{enumerate}[label=\normalfont\alph*)] % chktex 9
            \item \(\lim_{n\to\infty}c=c\).
            \item \(\lim_{n\to\infty}ca_n=ca\).
            \item \(\lim_{n\to\infty}\left( a_n + b_n \right)=a+b\).
            \item \(\lim_{n\to\infty}\left( a_n - b_n \right)=a-b\).
            \item \(\lim_{n\to\infty}\left( a_n b_n \right)=ab\).
            \item \(\lim_{n\to\infty}\left( \frac{a_n}{b_n} \right)=\frac{a}{b}\), (\(b\neq 0\)).
        \end{enumerate}
    \end{theorem}
\end{tcolorboxlarge}
%
\subsection{Cauchy Sequences}
\begin{definition}[Cauchy sequence]
    A sequence \(\{a_n\}_{n=1}^\infty\) on \(\R\) is a Cauchy sequence if
    \begin{equation*}
        \forall \varepsilon > 0:\exists n_0\in\N_{>0}:\forall n,\: m \geqslant n_0:\abs{a_n-a_m}<\varepsilon
    \end{equation*}
\end{definition}
\begin{theorem}
    A sequence on \(\R\) is convergent if and only if is a Cauchy sequence.
\end{theorem}
\subsection{Monotonicity}
%
\begin{definition}[Monotone]
    A sequence is (strictly) monotone if it is
    (strictly) increasing or (strictly) decreasing.
\end{definition}
%
\begin{definition}[Eventually]
    If after removing a finite number of terms from the beginning from a sequence
    it has a certain property, the original sequence has that property eventually.
\end{definition}
%
\begin{definition}[Bounded]
    An infinite sequence is bounded if \(L \leqslant a_n \leqslant K\) for all \(n\).
\end{definition}
%
\begin{theorem}
    Every bounded eventually monotone sequence converges.
\end{theorem}
%
\subsection{Monotonicity Tests}
\nopagebreak
\begin{multicols}{2}
    \begin{tcolorboxcols}[title={Difference Test}]
        \begin{theorem}[Difference test]
            A sequence \(\{a_n\}^\infty_{n=1}\) is
        \end{theorem}
        \begin{description}[style=sameline]
            \item[Strictly increasing] if \(a_{n+1} - a_n > 0\) for all \(n\)
            \item[Increasing] if \(a_{n+1} - a_n \geqslant 0\) for all \(n\)
            \item[Strictly decreasing] if \(a_{n+1} - a_n < 0\) for all \(n\)
            \item[Decreasing] if \(a_{n+1} - a_n \leqslant 0\) for all \(n\)
        \end{description}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Ratio Test}]
        \begin{theorem}[Ratio test]
            A sequence \(\{a_n\}^\infty_{n=1}\) where all \(a_n\) are positive is
        \end{theorem}
        \begin{description}[style=sameline]
            \item[Strictly increasing] if \(a_{n+1} \div a_n > 1\) for all \(n\)
            \item[Increasing] if \(a_{n+1} \div a_n \geqslant 1\) for all \(n\)
            \item[Strictly decreasing] if \(a_{n+1} \div a_n < 1\) for all \(n\)
            \item[Decreasing] if \(a_{n+1} \div a_n \leqslant 1\) for all \(n\)
        \end{description}
    \end{tcolorboxcols}
    \begin{note}
        If \(\lim_{n\to\infty}a_{n+1}\div a_n < 1\),
        then \(a_n\to0\) as \(n\to\infty\).
    \end{note}
    \columnbreak
    \begin{tcolorboxcols}[title={Derivative Test}]
        \begin{theorem}[Derivative test]
            If \(\{a_n\}^\infty_{n=1}\) is an infinite sequence on \(\R\) and
            \(a(x)\) is differentiable for \(x\in\R_{\geqslant1}\),
            then \(\{a_n\}^\infty_{n=1}\) is
        \end{theorem}
        \begin{description}[style=sameline]
            \item[Strictly increasing] if \(a'(x) > 0\) for all \(x\in\R_{\geqslant 1}\)
            \item[Increasing] if \(a'(x) \geqslant 0\) for all \(x\in\R_{\geqslant 1}\)
            \item[Strictly decreasing] if \(a'(x) < 0\) for all \(x\in\R_{\geqslant 1}\)
            \item[Decreasing] if \(a'(x) \leqslant 0\) for all \(x\in\R_{\geqslant 1}\)
        \end{description}
    \end{tcolorboxcols}
\end{multicols}
%
\pagebreak
\section{Series}
\subsection{Infinite Series}
\begin{multicols}{2}
    \begin{definition}[Infinite Series]
        An infinite series is an expansion that can be written as
        \begin{equation*}
            \sum_{i=1}^\infty a_i = a_1 + a_2 + a_3 + \cdots
        \end{equation*}
        The numbers \(a_i\) are the terms of the series.
    \end{definition}
    \begin{definition}[Partial Sums]
        The sequence of partial sums \(\{s_n\}_{n=1}^\infty\) is defined as
        \begin{equation*}
            s_n = \sum_{i=1}^n a_i
        \end{equation*}
        where \(s_n\) is the \(n\)th partial sum of the infinite series.
    \end{definition}
    \columnbreak
    \begin{definition}[Convergence of series]
        The infinite series \(\sum_{i=1}^\infty a_i\) converges to \(A\) if the associated sequence of partial sums \(\{s_n\}_{n=1}^\infty\) converges to \(A\).
    \end{definition}
    \begin{definition}[Divergence of series]
        The infinite series \(\sum_{i=1}^\infty a_i\) diverges to \(\pm\infty\), if the associated sequence of partial sums \(\{s_n\}_{n=1}^\infty\) diverges to \(\pm\infty\).
    \end{definition}
    \begin{theorem}
        If \(\sum_{i=1}^{\infty}a_i\) converges, then \(\lim_{i\to\infty}a_i=0\).
    \end{theorem}
\end{multicols}
%
\begin{tcolorboxlarge}
    \begin{theorem}
        Similar to sequences, we can add and subtract convergent infinite series.
    \end{theorem}
    \begin{enumerate}
        \item Suppose \(\sum a_i\) and \(\sum b_i\) are both convergent infinite series with the same starting index. Then \(\sum a_i \pm b_i\) is also convergent.
        \item Suppose \(\sum c_i\) is a convergent infinite series and \(\sum d_i\) is a divergent infinite series with the same starting index. Then \(\sum c_i \pm d_i\) is divergent.
        \item Let \(\sum e_i\) be an infinite series and let \(d\in\R\) be a constant, and \(K\in\N\).
              \begin{enumerate}
                  \item \(\sum e_i\) and \(\sum d e_i\) both converge or both diverge.
                  \item \(\sum_{i=i_0}^\infty e_i\) and \(\sum_{i=K}^\infty e_i\) both converge or both diverge.
              \end{enumerate}
    \end{enumerate}
\end{tcolorboxlarge}
%
\begin{definition}[Absolute Convergence]
    An infinite series \(\sum a_i\) converges (or diverges) absolutely if the series of absolute values \(\sum a_i\) also converges (or diverges).
\end{definition}
\begin{theorem}
    If an infinite series is absolutely convergent, then it is also convergent.
\end{theorem}
%
\begin{definition}[Conditional Convergence]
    A convergent infinite series that diverges absolutely, converges \linebreak conditionally.
\end{definition}
%
\pagebreak
\subsection{Convergence Tests}
For any infinite series of the form \(\displaystyle\sum_{i=i_0}^\infty a_i\).
\begin{multicols}{2}
    \begin{tcolorboxcols}[title={Divergence Test}]
        \begin{equation*}
            \text{\(\lim_{i\to\infty}a_i\neq0\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Diverges} \\
                \text{NO}  & \text{Inconclusive}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={\(p\)-Series}]
        \textbf{Conditions} \(i_0=1\) and \(a_i = \frac{1}{i^p}\).
        \begin{equation*}
            \text{\(p>1\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Geometric Series}]
        \textbf{Conditions} \(i_0=0\) and \(a_i = a r^i\) or \(i_0=1\) and \(a_i = a r^{i-1}\).
        \begin{equation*}
            \text{\(\abs{r}<1\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges to \(\frac{a}{1-r}\)} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{note}
        The sequence of partial sums is given by \(\displaystyle s_n=a\frac{1-r^{n+1}}{1-r}\).
    \end{note}
    \begin{tcolorboxcols}[title={Alternating Series}]
        \textbf{Conditions} \(a_i = \left( -1 \right)^i b_i\) or \(a_i = \left( -1 \right)^{i+1} b_i\). \(b_i>0\).
        \begin{equation*}
            \text{\(b_{i+1}\leqslant b_i\) \& \(\lim_{i\to\infty}b_i=0\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges} \\
                \text{NO}  & \text{Inconclusive}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Telescoping Series}]
        \textbf{Conditions} Subsequent terms cancel out previous terms in the sum.
        \begin{equation*}
            \text{\(\lim_{n\to\infty}s_n=s\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges to \(s\)} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Limit Comparison Test}]
        \textbf{Conditions} Pick \(b_i\) so that \(\displaystyle \lim_{i\to\infty}\frac{a_i}{b_i}=c>0\) \& \(a_i,\:b_n>0\).
        \begin{equation*}
            \text{\(\sum_{i=i_0}^\infty b_i\) convergent?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Comparison Test}]
        \textbf{Conditions} Pick \(b_i\).

        \noindent If \(\displaystyle \sum_{i=i_0}^\infty b_i\) converges:
        \begin{equation*}
            \text{\(0\leqslant a_i \leqslant b_i\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges} \\
                \text{NO}  & \text{Inconclusive}
            \end{cases}
        \end{equation*}
        If \(\displaystyle \sum_{i=i_0}^\infty b_i\) diverges:
        \begin{equation*}
            \text{\(0\leqslant b_i \leqslant a_i\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Diverges} \\
                \text{NO}  & \text{Inconclusive}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Integral Test}]
        \textbf{Conditions} Let \(a_i=f(i)\), so that \(f(x)\) is continuous, positive and decreasing on \(\left[a,\:\infty\right)\). % chktex 9

        \noindent If \(\displaystyle\int_a^\infty f(x) \odif{x}\) converges:
        \begin{equation*}
            \begin{cases}
                \text{YES} & \text{\(\sum_{i=a}^\infty a_i\) Converges} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Ratio Test}]
        \textbf{Conditions} \(\forall i:a_i>0\) and \(\displaystyle \lim_{i\to\infty}\frac{a_{i+1}}{a_i}\neq 1\).
        \begin{equation*}
            \text{\(\lim_{i\to\infty}\frac{a_{i+1}}{a_i} < 1\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
        \begin{equation*}
            \text{\(\lim_{i\to\infty}\abs{\frac{a_{i+1}}{a_i}} < 1\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges Abs.} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
    \begin{tcolorboxcols}[title={Root Test}]
        \textbf{Conditions} \(\forall i:a_i>0\) and \(\displaystyle \lim_{i\to\infty}\sqrt[i]{a_i}\neq 1\).
        \begin{equation*}
            \text{\(\lim_{i\to\infty}\sqrt[i]{a_i} < 1\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
        \begin{equation*}
            \text{\(\lim_{i\to\infty}\sqrt[i]{\abs{a_i}} < 1\)?}\:
            \begin{cases}
                \text{YES} & \text{\(\sum a_i\) Converges Abs.} \\
                \text{NO}  & \text{\(\sum a_i\) Diverges}
            \end{cases}
        \end{equation*}
    \end{tcolorboxcols}
\end{multicols}
\pagebreak
%
\section{Limits of Functions}
\subsection{Limits of Functions on \texorpdfstring{\(\mathbb{R}\)}{the Reals}}
\begin{definition}[Finite limits using the \(\varepsilon\)-\(\delta\) definition]
    Let a function \(f(x)\) be defined for all \(x\) in an open interval \(I\)
    (which contains \(x_0 \in \R\)), except for \(x_0\) which may or may not be defined.
    \begin{equation*}
        \lim_{x\to x_0} f(x) = L \iff \forall\varepsilon>0: \exists\delta>0: \forall x \in I: 0<\abs{x-x_0}<\delta \implies \abs{f(x)-L}<\varepsilon
    \end{equation*}
\end{definition}
%
\begin{tcolorboxlarge}[title={Limit Laws for Functions}]
    \begin{theorem} The limit of a sum equals the sum of the limits, i.e.
        \begin{equation*}
            \lim_{x\to x_0}\left(f(x)+g(x)\right)
            = \left(\lim_{x\to x_0}f(x)\right) + \left(\lim_{x\to x_0}g(x)\right)
        \end{equation*}
    \end{theorem}
    \begin{theorem} The limit of a product equals the product of the limits, i.e.
        \begin{equation*}
            \lim_{x\to x_0}\left(f(x)\cdot g(x)\right)
            = \left(\lim_{x\to x_0}f(x)\right) \cdot \left(\lim_{x\to x_0}g(x)\right)
        \end{equation*}
    \end{theorem}
    These are trivially extended to
    division (if the divisor is non-zero),
    subtraction, exponentiation, and moving constants in or outside of a limit, i.e.
    \begin{align*}
         & \lim_{x\to x_0}\left(f(x) - g(x)\right)
        = \left(\lim_{x\to x_0}f(x)\right) - \left(\lim_{x\to x_0}g(x)\right)
         & \qquad
         & \lim_{x\to x_0}\frac{f(x)}{g(x)}
        = \frac{\lim_{x\to x_0}f(x)}{\lim_{x\to x_0}g(x)}
        \\
         & \lim_{x\to x_0}\left(f(x)\right)^n
        = \left(\lim_{x\to x_0}f(x)\right)^n
         & \qquad
         & \lim_{x\to x_0} c \cdot f(x)
        = c \cdot \lim_{x\to x_0}f(x)
    \end{align*}
\end{tcolorboxlarge}
%
\begin{definition}[Limits towards \(\pm\infty\) using the \(\varepsilon\)-\(\delta\) definition]
    Let a function \(f(x)\) be defined for all \(x\) in an open interval \(I\)
    (which contains \(x_0 \in \R\)), except for \(x_0\) which may or may not be defined.
    \begin{equation*}
        \lim_{x\to x_0} f(x) = +\infty \iff \forall M \in \R: \exists\delta>0: \forall x \in I: 0<\abs{x-x_0}<\delta \implies f(x) > M
    \end{equation*}
    \begin{equation*}
        \lim_{x\to x_0} f(x) = -\infty \iff \forall N \in \R: \exists\delta>0: \forall x \in I: 0<\abs{x-x_0}<\delta \implies f(x) < N
    \end{equation*}
\end{definition}
%
\begin{definition}[Limits towards \(\pm\infty\)]
    Let a function \(f(x)\) be defined for all \(x\) in an infinite open interval \(I\)
    extending in the positive \(x\) direction.
    \begin{equation*}
        \lim_{x\to\infty} f(x) = L \iff \forall \varepsilon>0: \exists M \in I: x>M \implies \abs{f(x)-L}<\varepsilon
    \end{equation*}
    Let a function \(g(x)\) be defined for all \(x\) in an infinite open interval \(I\)
    extending in the negative \(x\) direction.
    \begin{equation*}
        \lim_{x\to-\infty} g(x) = L \iff \forall \varepsilon>0: \exists N \in I: x<N \implies \abs{g(x)-L}<\varepsilon
    \end{equation*}
\end{definition}
%
\begin{theorem}
    \(\displaystyle\lim_{x\to x_0} f(x)\) exists if and only if
    \(\displaystyle\lim_{x\to {x_0}^+} f(x)\) and \(\displaystyle\lim_{x\to {x_0}^-} f(x)\)
    exist and are equal.
\end{theorem}
%
\begin{theorem}[Squeeze theorem for functions]
    Let an interval \(I\) contain \(x_0\).
    If \(f,\:g,\:h : I \to \R\) are functions such that
    \(\forall x \in I\backslash\{x_0\},\; f(x)\leqslant g(x)\leqslant h(x)\)
    and
    \(\displaystyle\lim_{x\to x_0} f(x) = \lim_{x\to x_0} h(x) = L\),
    then
    \(\displaystyle\lim_{x\to x_0} g(x) = L\).
\end{theorem}
%
\begin{note}
    The squeeze theorem holds for left- and right-handed and limits to \(\pm\infty\).
\end{note}
%
\begin{definition}[Function continuity using the \(\varepsilon\)-\(\delta\) definition]
    A function \(f(x):I\to\R\) is continuous at \(c \in I\), if
    \begin{equation*}
        \forall\varepsilon>0: \exists\delta>0: \forall x\in I:0<\abs{x-c}<\delta \implies \abs{f(x)-f(c)}<\varepsilon
    \end{equation*}
    \(f(x)\) is continuous on \(I\) if \(f(x)\) is continuous for all \(x \in I\).
\end{definition}
%
\begin{definition}[Function continuity as a sequence]
    A function \(f(x):I\to\R\) is continuous at \(c \in I\), if
    for every sequence \(\{a_n\}^{\infty}_{n=1}\) in \(I\) that converges to \(c\),
    \(\{f(a_n)\}^{\infty}_{n=1}\) converges to \(f(c)\).
\end{definition}
%
\begin{note}
    ``\(f(x)\) is continuous at \(c\)'' is equivalent to
    ``\(\displaystyle \lim_{x\to c} f(x) = f(c)\)''.
\end{note}
%
\begin{note}
    Polynomials are continuous everywhere.
\end{note}
%
\begin{note}
    \(\sin\) and \(\cos\) are continuous everywhere.
\end{note}
%
\begin{theorem}
    For a function \(f\) continuous at \(L\)
    and another function \(g\) where \(\displaystyle \lim_{x\to c}g(x) = L\),
    \(\displaystyle \lim_{x\to c} (f \circ g)(x) = f(L)\).
\end{theorem}
\begin{note}
    The above theorem still applies when \(c\) is \(c^\pm\) or \(\pm\infty\).
\end{note}
%
\begin{theorem}
    For two functions \(f\) and \(g\) that are continuous at \(c\),
    \begin{enumerate}[label=\normalfont\alph*)] % chktex 9 chktex 10
        \item \(f(x) + g(x)\) is continuous at \(c\);
        \item \(f(x) - g(x)\) is continuous at \(c\);
        \item \(f(x) \cdot g(x)\) is continuous at \(c\); and
        \item \(\dfrac{f(x)}{g(x)}\) is continuous at \(c\) when \(g(c)\ne0\).
    \end{enumerate}
\end{theorem}
%
\begin{theorem}
    For a function \(g(x)\) which is continuous at \(c\) and
    a function \(h(x)\) which is continuous at \(g(c)\),
    \(h \circ g\) is continuous at \(c\).
\end{theorem}
%
\begin{theorem}[L'Hôpital rule]
    For two differentiable (and therefore continuous) functions \(f(x)\) and \(g(x)\)
    except possibly at \(x_0\).
    If \(\displaystyle \lim_{x\to x_0}f(x)=\lim_{x\to x_0}g(x)=0\),
    or \(\displaystyle \lim_{x\to x_0}f(x)=\pm\infty\)
    and \(\displaystyle \lim_{x\to x_0}g(x)=\pm\infty\),
    then
    \(\lim_{x\to x_0}\frac{f(x)}{g(x)} = \lim_{x\to x_0}\frac{f'(x)}{g'(x)}\)
    (as long as the limit exists, or diverges to \(\pm\infty\)).
\end{theorem}
%
\begin{note}
    L'Hôpital's rule also holds for left- and right-handed, and limits that approach \(\pm\infty\).
\end{note}
%
\pagebreak
\section{Addenda}
\subsection{Assumed Knowledge}
\subsubsection{Factorials}
\(\displaystyle n! = \prod_{i=1}^{n} i = 1 \times 2 \times 3 \times \cdots \times (n-1) \times n\)

\subsubsection{Quadratic Equation}
\(\displaystyle x = \frac{-b\pm\sqrt{b^2-4ac}}{2a}\)

\subsection{Table of Derivatives}
Let \(a\in\R\) be a constant, and \(n\in\Z\backslash\{0\}\).
\begin{table}[H]
    \centering
    \renewcommand{\arraystretch}{2.5}
    \begin{tabular}[t]{c c}
        \(f(x)\)     & \(\odv{f}{x}\)    \\[1em]
        \midrule
        \(a\)        & \(0\)             \\
        \(x\)        & \(1\)             \\
        \(x^n\)      & \(n x^{n-1}\)     \\
        \(e^x\)      & \(e^x\)           \\
        \(e^{nx}\)   & \(ne^{nx}\)       \\
        \(e^{g(x)}\) & \(g'(x)e^{g(x)}\) \\
        \(a^x\)      & \(a^x \ln(a)\)
    \end{tabular}
    \quad
    \begin{tabular}[t]{c c}
        \(f(x)\)                   & \(\odv{f}{x}\)                  \\[1em]
        \midrule
        \(\ln{\left(x\right)}\)    & \(\frac{1}{x}\)                 \\
        \(\log_a{\left(x\right)}\) & \(\frac{1}{x \ln(a)}\)          \\
        \(\sqrt{x}\)               & \(\frac{1}{2 \sqrt{x}}\)        \\[0.5em]
        \(\sqrt[n]{x}\)            & \(\frac{x^{\frac{1}{n}-1}}{n}\)
    \end{tabular}
    \quad
    \begin{tabular}[t]{c c}
        \(f(x)\)                 & \(\odv{f}{x}\)                       \\[1em]
        \midrule
        \(\sin{\left(x\right)}\) & \(\cos{\left(x\right)}\)             \\
        \(\cos{\left(x\right)}\) & \(-\sin{\left(x\right)}\)            \\
        \(\tan{\left(x\right)}\) & \(\frac{1}{\cos^2{\left(x\right)}}\)
    \end{tabular}
\end{table}
\end{document} % chktex 17


\chapter{Graphics}
\label{graphics}

\index{AWT}
\index{java.awt}

The Java library includes the package \java{java.awt} for drawing 2D graphics.
{\bf AWT} stands for ``Abstract Window Toolkit''.
We are only going to scratch the surface of graphics programming.
You can read more about it in the Java tutorials at \url{https://thinkjava.org/java2d}.

\section{Creating Graphics}

\index{Canvas}
\index{class!Canvas}
\index{Graphics}
\index{class!Graphics}

There are several ways to create graphics in Java; the simplest way is to use \java{java.awt.Canvas} and \java{java.awt.Graphics}.
A \java{Canvas} is a blank rectangular area of the screen onto which the application can draw.
The \java{Graphics} class provides basic drawing methods such as \java{drawLine}, \java{drawRect}, and \java{drawString}.

Here is an example program that draws a circle using the \java{fillOval} method:

%\begin{code}
%import java.awt.Canvas;
%import java.awt.Graphics;
%import javax.swing.JFrame;
%
%public class Drawing extends Canvas {
%\end{code}

\begin{code}
import java.awt.Canvas;
import java.awt.Graphics;
import javax.swing.JFrame;

public class Drawing extends Canvas {
    public static void main(String[] args) {
        JFrame frame = new JFrame("My Drawing");
        frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        Drawing drawing = new Drawing();
        drawing.setSize(400, 400);
        frame.add(drawing);
        frame.pack();
        frame.setVisible(true);
    }

    public void paint(Graphics g) {
        g.fillOval(100, 100, 200, 200);
    }
}
\end{code}

The \java{Drawing} class extends \java{Canvas}, so it has all the methods provided by \java{Canvas}, including \java{setSize}.
You can read about the other methods in the documentation, which you can find by doing a web search for ``Java Canvas''.

\index{JFrame}
\index{class!JFrame}

In the \java{main} method, we:

\begin{enumerate}

\item Create a \java{JFrame} object, which is the window that will contain the canvas.

\item Create a \java{Drawing} object (which is the canvas), set its width and height, and add it to the frame.

\item Pack the frame (resize it) to fit the canvas, and display it on the screen.
\end{enumerate}

\index{paint}

Once the frame is visible, the \java{paint} method is called whenever the canvas needs to be drawn; for example, when the window is moved or resized.
If you run this code, you should see a black circle on a gray background.

The application doesn't end after the \java{main} method returns; instead, it waits for the \java{JFrame} to close.
When the \java{JFrame} closes, it calls \java{System.exit}, which ends the program.

\section{Graphics Methods}

\index{coordinate}

You are probably used to Cartesian {\bf coordinates}, where $x$ and $y$ values can be positive or negative.
In contrast, Java uses a coordinate system where the origin is in the upper-left corner.
That way, $x$ and $y$ can always be positive integers.
Figure~\ref{fig.coordinates} shows these coordinate systems side-by-side.

\begin{figure}[!ht]
\begin{center}
\includegraphics[width=5in]{figs/coordinates.pdf}
\caption{Diagram of the difference between Cartesian coordinates and Java graphical coordinates.}
\label{fig.coordinates}
\end{center}
\end{figure}

\index{pixel}

Graphical coordinates are measured in {\bf pixels}; each pixel corresponds to a dot on the screen.

To draw on the canvas, you invoke methods on a \java{Graphics} object.
You don't have to create the \java{Graphics} object; it gets created when you create the \java{Canvas}, and it gets passed as an argument to \java{paint}.

The previous example used \java{fillOval}, which has the following signature:

\begin{code}
/**
 * Fills an oval bounded by the specified rectangle with
 * the current color.
 */
public void fillOval(int x, int y, int width, int height)
\end{code}

\index{bounding box}

The four parameters specify a {\bf bounding box}, which is the rectangle in which the oval is drawn.
\java{x} and \java{y} specify the location of the upper-left corner of the bounding box.
The bounding box itself is not drawn (see Figure~\ref{fig.circle}).

\begin{figure}[!ht]
\begin{center}
\includegraphics{figs/circle.pdf}
\caption{Diagram of an oval inside its bounding box.}
\label{fig.circle}
\end{center}
\end{figure}

\index{Color}

To choose the color of a shape, invoke \java{setColor} on the \java{Graphics} object:

\begin{code}
g.setColor(Color.RED);
\end{code}

The \java{setColor} method determines the color of everything that gets drawn afterward.
\java{Color.red} is a constant provided by the \java{Color} class; to use it you have to \java{import java.awt.Color}.
Other colors include:

\begin{stdout}
BLACK       BLUE      CYAN     DARKGRAY   GRAY    LIGHTGRAY
GREEN       MAGENTA   ORANGE   PINK       WHITE   YELLOW
\end{stdout}

\index{RGB}

You can create your own colors by specifying the red, green, and blue ({\bf RGB}) components.
For example:

\begin{code}
Color purple = new Color(128, 0, 128);
\end{code}

Each value is an integer in the range 0 (darkest) to 255 (lightest).
The color \java{(0, 0, 0)} is black, and \java{(255, 255, 255)} is white.

You can set the background color of the \java{Canvas} by invoking \java{setBackground}:

\begin{code}
canvas.setBackground(Color.WHITE);
\end{code}

\section{Example Drawing}

\index{Mickey Mouse}

Suppose we want to draw a ``Hidden Mickey'', which is an icon that represents Mickey Mouse (see \url{https://en.wikipedia.org/wiki/Hidden_Mickey}).
We can use the oval we just drew as the face, and then add two ears.
To make the code more readable, let's use \java{Rectangle} objects to represent bounding boxes.

Here's a method that takes a \java{Rectangle} and invokes \java{fillOval}:

\begin{code}
public void boxOval(Graphics g, Rectangle bb) {
    g.fillOval(bb.x, bb.y, bb.width, bb.height);
}
\end{code}

And here's a method that draws Mickey Mouse:

\begin{code}
public void mickey(Graphics g, Rectangle bb) {
    boxOval(g, bb);

    int hx = bb.width / 2;
    int hy = bb.height / 2;
    Rectangle half = new Rectangle(bb.x, bb.y, hx, hy);

    half.translate(-hx / 2, -hy / 2);
    boxOval(g, half);

    half.translate(hx * 2, 0);
    boxOval(g, half);
}
\end{code}

The first line draws the face.
The next three lines create a smaller rectangle for the ears.
We \java{translate} the rectangle up and left for the first ear, then to the right for the second ear.
The result is shown in Figure~\ref{fig.mickey}.

\begin{figure}[!ht]
\begin{center}
\includegraphics[height=2in]{figs/mickey.png}
\caption{A ``Hidden Mickey'' drawn using Java graphics.}
\label{fig.mickey}
\end{center}
\end{figure}

You can read more about \java{Rectangle} and \java{translate} in Chapter~\ref{mutable}.
See the exercises at the end of this appendix for more example drawings.

\section{Vocabulary}

\begin{description}

\term{AWT}
The ``Abstract Window Toolkit'', a Java package for creating graphical user interfaces.

\term{coordinate}
A value that specifies a location in a 2D graphical window.

\term{pixel}
The unit in which coordinates are measured.

\term{bounding box}
A way to specify the coordinates of a rectangular area.

\term{RGB}
A color model based on adding red, green, and blue light.

\end{description}

\section{Exercises}

The code for this chapter is in the {\tt appc} directory of {\tt ThinkJavaCode2}.
See page~\pageref{code} for instructions on how to download the repository.
Before you start the exercises, we recommend that you compile and run the examples.

\begin{exercise}

Draw the flag of Japan: a red circle on a white background that is wider than it is tall.

\end{exercise}

\begin{exercise}

Modify {\tt Mickey.java} to draw ears on the ears, and ears on those ears, and more ears all the way down until the smallest ears are only 3 pixels wide.
The result should look like ``Mickey Moose'', shown in Figure~\ref{fig.moose}.
{\it Hint:} You should only have to add or modify a few lines of code.

\begin{figure}[!ht]
\begin{center}
\includegraphics[height=2in]{figs/moose.png}
\caption{A recursive shape we call ``Mickey Moose''.}
\label{fig.moose}
\end{center}
\end{figure}

\end{exercise}

\begin{exercise}

In this exercise, you will draw ``Moir\'{e} patterns'' that seem to shift around as you move.
For an explanation of what is going on, see \url{https://en.wikipedia.org/wiki/Moire_pattern}.

\begin{enumerate}

\item Open {\tt Moire.java} and read the \java{paint} method.
Draw a sketch of what you expect it to do.
Now run it.
Did you get what you expected?

\item Modify the program so that the space between the circles is larger or smaller.
See what happens to the image.

\item Modify the program so that the circles are drawn in the center of the screen and concentric, as in Figure~\ref{fig.moire} (left).
The distance between the circles should be small enough that the Moir\'{e} interference is apparent.

\begin{figure}[!ht]
\begin{center}
\includegraphics[height=2in]{figs/moire.pdf}
\caption{Graphical patterns that can exhibit Moir\'{e} interference.}
\label{fig.moire}
\end{center}
\end{figure}

\item Write a method named \java{radial} that draws a radial set of line segments as shown in Figure~\ref{fig.moire} (right), but they should be close enough together to create a Moir\'{e} pattern.

\item Just about any kind of graphical pattern can generate Moir\'{e}-like interference patterns.
Play around and see what you can create.

\end{enumerate}

\end{exercise}


\setcounter{framenumber}{163}
\begin{frame}
	\maketitle
\end{frame}

\begin{frame}{Overview}
\tableofcontents
\end{frame}

\section{Rehash}
\begin{frame}{Rehash}

 \begin{itemize}

	\item Models in propositional logic are \emph{valuations}: functions from sentence letters to truth-values.

	\item We can calculate the value of a formula under a valuation recursively using the Boolean \emph{truth-functions}.

	\item The validity of inferences over formal languages can be understood in terms of the concept of logical consequence.

	\item \alert{A set of formulas entails a formula iff in every valuation s.t. all the members of the set have value 1, the formula has value 1.}

	\item \alert{A formula is a logical truth if it's a consequence of $\emptyset$.}

	\item The question whether a given set of premises entails a conclusion can be reduced to the question whether the conditional with the conjunction of the premises as the if-part and the conclusion as the then-part is logically valid.

	\item The method of truth-tables allows us to decide in finitely many steps whether a given formula is valid. This gives us a decision procedure for propositional logic.

\end{itemize}

\end{frame}

\section{6 Tableaux for Propositional Logic}
\subsection{6.1 Proof Systems}

\begin{frame}{6.1 Proof Systems}

	\begin{itemize}

		\item (6.1.1) The aim is formulate \emph{inference rules} that allow us to derive the conclusion from the premises in all (and only) the valid inferences.

		\item Proof theory provides a \emph{syntactic} approach to validity.

		\item This is good for implementability:

		\begin{center}
			\begin{tabular}{c c c}

				\includegraphics[height=15ex]{coq-screenshot} & &					\includegraphics[height=15ex]{prover9-mace4-screenshot} \\
				{\tiny \textcopyright~Wiki author \texttt{Matj\v{e}j Grabovsk\'y}, LGPLv2.1} & &{\tiny \textcopyright~\url{https://slidewiki.org/user/OlliG}, CC BY-SA 4.0} \\[1ex]

				Proof Assistants (Coq) &\qquad & Theorem Provers (Prover9)

			\end{tabular}
		\end{center}

		\item There are also several mathematical upshots (e.h. consistency of arithmetic).

		\end{itemize}

\end{frame}

\begin{frame}{Hilbert Systems}

	\begin{itemize}

		\item (6.1.2) Modeled after axiomatic reasoning: axioms + inference rules.

		\item Hilbert calculus for propositional logic:

		 \begin{description}

						\item[Hilbert$_1$] $\phi\to (\psi\to \phi)$

						\item[Hilbert$_2$] $(\phi\to (\psi\to \chi))\to((\phi\to \psi)\to (\phi\to \chi))$

						\item[Hilbert$_3$] $(\neg \phi\to \neg \psi)\to (\psi\to\phi)$

						\item[Modus Ponens.] From $\phi$ and $(\phi\to\psi)$ infer $\psi$.

						\item[Definitions.] From $(\phi\land\psi)$ infer $\neg(\phi\to\neg\psi)$ and vice versa; from $(\phi\lor\psi)$ infer  $(\neg\phi\to\psi)$ and vice versa; and from $(\phi\leftrightarrow\psi)$ infer $((\phi\to\psi)\land(\psi\to\phi))$ and vice versa.

		\end{description}

		\item A \emph{proof} in the Hilbert system is a sequence of formulas such that each formulas is either an axiom (in our case, an instance of \textbf{Hilbert}$_\text{1--3}$) or inferred from some formulas earlier in the proof via an inference rule (in our case, \textbf{Modus Ponens}  or \textbf{Definitions}). Notation: $\vdash_H\phi$

	\end{itemize}

\end{frame}

\begin{frame}{Example}

\begin{center}
		\begin{tabular}{c}
		\includegraphics[width=10ex]{hilbert}\\[-1ex]
		{\tiny $\not\hspace{-1ex}\textcopyright$ David Hilbert, work in public domain}
		\end{tabular}
		\vspace{2ex}

		$\vdash_H p\to p$
		\end{center}

			\begin{enumerate}[1.]

	\item $((p \to ((p \to p) \to p)) \to ((p \to (p \to p)) \to (p \to p)))$

	\item[] \ \hfill (Axiom 2. with $\phi=p, \psi=(p\to p),$ and $\chi=p$)

	\item $(p \to ((p \to p) \to p))$ \hfill (Axiom 1. with $\phi=p$ and $\psi=(p\to p)$)

	\item $((p \to (p \to p)) \to (p \to p))$ \hfill (From 1. and 2. by MP.)

	\item $(p \to (p \to p))$ \hfill (Axiom 1. with $\phi=p$ and $\psi=p$.)

	\item $(p \to p)$\hfill (From 3. and 4. by MP.)

\end{enumerate}

\end{frame}

\begin{frame}{Sequent Calculus}

	\begin{itemize}

		\item (6.1.4) Reasoning \emph{about} consequence using sequents $\Gamma\Rightarrow\Delta$.

		\item  $\phi_1,\mathellipsis,\phi_n\Rightarrow\psi_1,\mathellipsis, \psi_m$ means $\phi_1\land\mathellipsis\land\phi_n\vDash\psi_1\lor\mathellipsis\lor\psi_m$

		\item Calculus for propositional logic: $\phi\Rightarrow\phi$ +

		{\tiny\begin{center}
		\begin{tabular}{c c c}
			\infer[Weak L]{\Gamma\cup\{\phi\}\Rightarrow \Delta}{\Gamma\Rightarrow\Delta} & \infer[Weak R]{\Gamma\Rightarrow \Delta\cup\{\phi\}}{\Gamma\Rightarrow\Delta}\\[2ex]

			\infer[Cut]{\Gamma\cup\Gamma'\Rightarrow\Delta,\Delta'}{\Gamma\Rightarrow \{\phi\}\cup \Delta & \{\phi\}\cup\Gamma'\Rightarrow\Delta'}\\[2ex]

				\infer[\neg L]{\Gamma\cup\{\neg\phi\}\Rightarrow\Delta}{\Gamma\Rightarrow\Delta\cup\{\phi\}} & \infer[\neg R]{\Gamma\Rightarrow\Delta\cup\{\neg\phi\}}{\Gamma\cup\{\phi\}\Rightarrow\Delta} \\[2ex]

				\infer[\land L]{\Gamma\cup\{\phi\land \psi\}\Rightarrow \Delta}{\Gamma\cup\{\phi,\psi\}\Rightarrow \Delta} & \infer[\land R]{\Gamma\cup\Gamma'\Rightarrow \{\phi\land \psi\}\cup\Delta\cup\Delta'}{\Gamma\Rightarrow \{\phi\}\cup\Delta & \Gamma'\Rightarrow \{\psi\}\cup\Delta'}\\[2ex]

				 \infer[\lor L]{\Gamma\cup\Gamma'\cup \{\phi\lor \psi\}\Rightarrow\Delta\cup\Delta'}{\Gamma\cup \{\phi\}\Rightarrow\Delta & \Gamma'\cup\{\psi\}\Rightarrow \Delta'} & \infer[\lor R]{\Gamma\Rightarrow \Delta\cup\{\phi\lor \psi\}}{\Gamma\Rightarrow \Delta\cup\{\phi,\psi\}}\\[2ex]

				 \infer[\to L]{\Gamma\cup\Gamma'\cup\{\phi\to\psi\}\Rightarrow\Delta\cup\Delta'}{\Gamma\Rightarrow \{\phi\}\cup\Delta' & \Gamma'\cup\{\psi\}\Rightarrow \Delta'} & \infer[\to R]{\Gamma\Rightarrow \{\phi\to\psi\}\cup\Delta}{\Gamma\cup\{\phi\}\Rightarrow\{\psi\}\cup\Delta}

			\end{tabular}
			\end{center}
	}

	\item A proof is a tree whose leafs are axioms and that's constructed according to the rules. $\Gamma\vdash_G\Delta$ means there's a proof that ends in $\Gamma\Rightarrow\Delta$.
	\end{itemize}

\end{frame}

\begin{frame}{Example}

\begin{center}
		\begin{tabular}{c}
		\includegraphics[width=10ex]{gentzen}\\[-1ex]
		{\tiny $\textcopyright$ Eckart Menzler-Trott, Gerhard Gentzen, \texttt{CC BY-SA 2.0 DE}}
		\end{tabular}
		\vspace{2ex}

		$\neg(p\lor q)\vdash_G \neg p\land \neg q$
		\end{center}

\begin{center}
		\begin{tabular}{c}
		\infer[\land R]{\neg(p\lor q)\Rightarrow \neg p\land \neg q}{\infer[\neg R]{\neg(p\lor q)\Rightarrow \neg p}{\infer[\neg L]{\neg (p\lor q),p\Rightarrow \emptyset}{\infer[\lor R]{p\Rightarrow p\lor q}{\infer[Weak R]{p\Rightarrow p,q}{p\Rightarrow p}}}} & \infer[\neg R]{\neg(p\lor q)\Rightarrow \neg q}{\infer[\neg L]{\neg (p\lor q),q\Rightarrow \emptyset}{\infer[\lor R]{q\Rightarrow p\lor q}{\infer[Weak R]{q\Rightarrow p,q}{q\Rightarrow q}}}}}
		\end{tabular}
	\end{center}
\end{frame}

\begin{frame}{Natural Deduction}

	\begin{itemize}

		\item (6.1.6) Modeled after natural reasoning using assumptions. Only rules.

		\item System for propositional logic:

				\begin{center}
{\tiny
			\begin{tabular}{c c c}

				\infer[EFQ]{\psi}{\phi & \neg \phi} & & \infer[Biv]{\psi}{\infer*{\psi}{[\phi]} & \infer*{\psi}{[\neg\phi]}}\\[1ex]

				\infer[\land I]{\phi\land \psi}{\phi & \psi} & \infer[\land E_1]{\phi}{\phi\land \psi} & \infer[\land E_2]{\psi}{\phi\land \psi}\\[1ex]

				\infer[\lor I_1]{\phi\lor\psi}{\phi} & \infer[\lor I_2]{\phi\lor\psi}{\psi} & \infer[\lor E]{\theta}{\phi\lor\psi & \infer*{\theta}{[\phi]} & \infer*{\theta}{[\psi]}}\\[1ex]

				\infer[\to I]{\phi\to \psi}{\infer*{\psi}{[\phi]}} & & \infer[\to E]{\psi}{\phi\to\psi & \phi}

			\end{tabular}
			}
			\end{center}

		\item A proof is a tree whose branches are constructed according to the rules. $\Gamma\vdash_N\phi$ means that there's a proof with only $\Gamma$'s at the leafs and $\phi$ at the root.

	\end{itemize}

\end{frame}

\begin{frame}{Example}

\begin{center}
		\begin{tabular}{c}
		\includegraphics[width=10ex]{gentzen}\\[-1ex]
		{\tiny $\textcopyright$ Eckart Menzler-Trott, Gerhard Gentzen, \texttt{CC BY-SA 2.0 DE}}
		\end{tabular}
		\vspace{2ex}

		 $p\lor q,\neg q\vdash_N p$
		\end{center}

\begin{center}
			\begin{tabular}{c}
				\infer[\lor E, 1]{q}{p\lor q & [q] &\infer[EFQ]{q}{[p] & \neg q}}
			\end{tabular}
		\end{center}
\end{frame}

\subsection{6.2 Satisfiability and Consequence}

\begin{frame}{6.2 Satisfiability and Consequence}

	\begin{itemize}

		\item (6.1.1) The method of analytic tableaux is based on a theorem (just like the truth-tables).

		\item	(6.2.2)  A set of formulas $\Gamma\subseteq\mathcal{L}$ is said to be satisfiable iff there exists a valuation $v$ such that $\llbracket\phi\rrbracket_v=1$ for all $\phi\in\Gamma$.

		\item (6.2.3) \emph{Examples}:

			\begin{enumerate}[(a)]

				\item $\mathcal{P}$

				\item $X\subseteq\mathcal{P}$

				\item$\emptyset$!

				\item \textbf{Proposition}. Let $\Gamma,\Delta\subseteq\mathcal{L}$ be sets of formulas. If $\Gamma$ is satisfiable and $\Delta\subseteq \Gamma$, then $\Delta$ is satisfiable.
				\item[] \emph{Proof (Sketch).} If $\Gamma$ is satisfiable, then there's a valuation that makes all the $\Gamma$'s true. But if $\Delta\subseteq\Gamma$, then all the $\Delta$'s are also $\Gamma$'s. Hence also $\Delta$ is satisfiable.

				\item $\{p\lor\neg p\}$

				\item $\{p\to q, \neg q\}$ is satisfiable with $v(p)=0$ and $v(q)=0$

			\end{enumerate}

	\end{itemize}

\end{frame}

\begin{frame}{\emph{Un}satisfiability}

	\begin{itemize}

		\item (6.2.4) A set $\Gamma$ is \emph{un}satisfiable iff there exists no valuation $v$ such that $\llbracket\phi\rrbracket_v=1$ for all $\phi\in\Gamma$.

		\item (6.2.5) \emph{Examples}:

			\begin{enumerate}[(a)]

				\item $\{\phi,\neg\phi\}$ (Reason: if $\llbracket\phi\rrbracket_v=1$ and $\llbracket\neg \phi\rrbracket_v=1$, it follows that $\llbracket\phi\rrbracket_v=1$ or $\llbracket\phi\rrbracket_v=0$ \lightning)

				\item $\mathcal{L}$!

				\item \textbf{Proposition}. Let $\Gamma,\Delta\subseteq\mathcal{L}$ be sets of formulas. If $\Gamma$ is unsatisfiable and $\Gamma\subseteq \Delta$, then $\Delta$ is unsatisfiable.

				\item[] \emph{Proof (Sketch)}. If $\Delta$ would be satisfiable, then there'd be a valuation $v$ that makes all the $\Delta$'s true. But if $\Gamma\subseteq\Delta$, then all the $\Gamma$'s are $\Delta$'s and so $v$ would make all the $\Gamma$'s true. But that's a contradiction to $\Gamma$ being unsatisfiable.

				\item $\{p\lor q, \neg p, \neg q\}$ (Reason: $\llbracket\neg p\rrbracket_v=1$ means $\llbracket p\rrbracket_v=0$, $\llbracket\neg q\rrbracket_v=1$ means $\llbracket q\rrbracket_v=0$, and $\llbracket p\lor q\rrbracket_v=1$ means that either $\llbracket p\rrbracket_v=1$ or $\llbracket q\rrbracket_v=1$. \lightning)

			\end{enumerate}

	\end{itemize}

\end{frame}

\begin{frame}{The ``I Can't Get No Satisfaction''--Theorem}

	\begin{itemize}

		\item \textbf{Theorem}. Let $\Gamma\subseteq\mathcal{L}$ be a set of formulas and $\phi\in\mathcal{L}$ a formula. Then, the following are equivalent:
			\begin{enumerate}[1.]

				\item $\Gamma\vDash\phi$

				\item $\Gamma\cup\{\neg\phi\}$ is unsatisfiable

			\end{enumerate}

		\item \emph{Proof}:

			\begin{itemize}

				\item ($1.\Rightarrow 2.$) Suppose that $\Gamma\vDash\phi$. We prove indirectly that $\Gamma\cup\{\neg\phi\}$ is unsatisfiable. So, suppose that  $\Gamma\cup\{\neg\phi\}$  is satisfiable by $v$. Then $v$ makes all the members of $\Gamma$ and $\neg\phi$ true. Since $\Gamma\vDash\phi$, this means that $v$ makes $\phi$ true. But now we have that both $\phi$ and $\neg\phi$ are true, which is impossible. Hence $\Gamma\cup\{\neg\phi\}$ is unsatisfiable.

				\item ($2.\Rightarrow 1.$) Suppose that $\Gamma\cup\{\neg\phi\}$ is unsatisfiable. We prove that $\Gamma\vDash\phi$ indirectly. For suppose that $\Gamma\nvDash\phi$, i.e. there exists a valuation $v$ that makes all the $\Gamma$'s true and $\phi$ false. But if $\phi$ is false under $v$, then $\neg\phi$ is true. So $v$ makes all the $\Gamma$'s and $\neg\phi$ true, which means that $\Gamma\cup\{\neg\phi\}$ is satisfiable---in contradiction to our assumption that it's not.

			\end{itemize}

	\end{itemize}

\end{frame}

\subsection{6.3 Analytic Tableaux}

\begin{frame}{6.3 Analytic Tableaux}

	\begin{itemize}

		\item (6.3.1) Analytic tableaux are a method for determining satisfiability.

		\item This allows us to determine consequence using the ICGNS-theorem.

		\item In contrast to truth-tables, tableaux are purely syntactic.

		\item We describe it step-by-step:

		\begin{enumerate}[1.]

			\item We begin by writing down the members of $\Gamma$ as the \emph{initial list}. This list forms the root of our tableau.

			\item[] \emph{Examples}.

			\begin{itemize}

				\item $\Gamma=\{p\lor q, \neg p, \neg q\}$

				\item[] Initial List:

					\begin{prooftree}
						{
						line numbering=false,
						line no sep= 2cm,
						for tree={s sep'=5mm},
						single branches=true,
						close with=\xmark
						}
						[p\lor q, grouped [\neg p, grouped [\neg q, grouped] ] ]
					\end{prooftree}

				\item $\Gamma=\{p\land q, \neg p\lor q, \neg (q\land \neg \neg r)\}$

					\item[] Initial List:

					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[p\land q, grouped [ \neg p\lor q, grouped [\neg (q\land \neg \neg r), grouped ] ] ]
					\end{prooftree}

			\end{itemize}

		\end{enumerate}

	\end{itemize}

\end{frame}

\begin{frame}{Tableaux --- \emph{How To}}

	\begin{enumerate}
	\setcounter{enumi}{1}

	\item Next, we repeatedly apply the following rules:
					\vspace{2ex}

					\begin{center}
							{\tiny

					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\neg\neg \phi [\phi ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\phi\land\psi [\phi [\psi ] ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\neg (\phi\land\psi) [\neg \phi ] [\neg \psi ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\phi\lor\psi [\phi ] [\psi ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\neg(\phi\lor\psi) [\neg\phi [\neg\psi ] ] ]
					\end{prooftree}

					\vspace{2ex}

					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\neg (\phi\to\psi) [\phi [\neg \psi ] ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\phi\to\psi [\neg \phi ] [\psi ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\phi\leftrightarrow \psi [\phi [\psi] ] [\neg \phi [\neg \psi] ] ]]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\neg(\phi\leftrightarrow \psi) [\phi [\neg \psi] ] [\neg \phi [ \psi] ] ]]
					\end{prooftree}}

				\end{center}
			We read these rules as follows:

				\begin{itemize}

			\item If there's a node with a formula to which no rule has been applied yet, then we apply the rule by extending every branch that goes through the node as shown by the rule.

			\end{itemize}

			 If all the rules that can be applied have been applied, then we say that the tableau is \emph{complete}.

	\end{enumerate}

\end{frame}

\begin{frame}{Examples}

\begin{center}
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[p\lor q, grouped [\neg p, grouped [\neg q, 					grouped [p] [q] ] ] ]
					\end{prooftree}
					\qquad
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 1cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[p\land q, grouped [ \neg p\lor q, grouped [\neg (q\land \neg\neg r), grouped [p [q [\neg p [\neg q] [\neg\neg\neg r [\neg r] ] ] [q [\neg q] [\neg\neg\neg r [\neg r] ] ] ] ] ] ] ]
					\end{prooftree}
				\end{center}

\end{frame}

\begin{frame}{Tableaux --- \emph{How To}}

	\begin{enumerate}
	\setcounter{enumi}{2}

		 \item Once we've completed our tableau, we check on every branch $B$ whether there is a $p\in\mathcal{P}$ such that $p\in B$ and $\neg p\in B$.

			\begin{itemize}

			\item if yes, then we say that $B$ is \emph{closed}, and mark it by writing an {\xmark} under it;

			\item if no, then we say that $B$ is \emph{open}.

		\end{itemize}

	\end{enumerate}

\begin{center}
{\tiny\begin{prooftree}
{
line numbering=false,
line no sep= 2cm,
for tree={s sep'=5mm},
single branches=true,
close with=\xmark
}
[p\lor q, grouped [\neg p, grouped [\neg q, grouped [p, close] [q, close] ] ] ]
\end{prooftree}
\qquad\begin{prooftree}
{
line numbering=false,
line no sep= 1cm,
for tree={s sep'=5mm},
single branches=true,
close with=\xmark
}
[p\land q, grouped [ \neg p\lor q, grouped [\neg (q\land \neg\neg r), grouped [p [q [\neg p [\neg q, close] [\neg\neg\neg r [\neg r, close] ] ] [q [\neg q, close] [\neg\neg\neg r [\neg r ] ] ] ] ] ] ] ]
\end{prooftree}}
\end{center}

\end{frame}

\begin{frame}{Tableaux --- \emph{How To}}

	\begin{enumerate}
	\setcounter{enumi}{3}

		\item We now check our tableau whether there an open branch in the tree (i.e. a branch without an {\xmark} underneath):
			\begin{itemize}

				\item If yes, the tableau is called \emph{open} and the set is satisfiable.

				\item If no, the tableau is called \emph{closed} and the set is unsatisfiable.

			\end{itemize}
	\end{enumerate}

\begin{center}
{\tiny\begin{prooftree}
{
line numbering=false,
line no sep= 2cm,
for tree={s sep'=5mm},
single branches=true,
close with=\xmark
}
[p\lor q, grouped [\neg p, grouped [\neg q, grouped [p, close] [q, close] ] ] ]
\end{prooftree}
\qquad\begin{prooftree}
{
line numbering=false,
line no sep= 1cm,
for tree={s sep'=5mm},
single branches=true,
close with=\xmark
}
[p\land q, grouped [ \neg p\lor q, grouped [\neg (q\land \neg\neg r), grouped [p [q [\neg p [\neg q, close] [\neg\neg\neg r [\neg r, close] ] ] [q [\neg q, close] [\neg\neg\neg r [\neg r ] ] ] ] ] ] ] ]
\end{prooftree}}
\end{center}

\end{frame}

\begin{frame}{Tableaux --- The Idea}

	\begin{itemize}

		\item (6.3.3.) The rules allow us to test, step-by-step, what would need to be the case for the formulas in the tree to be true. A rule creates new branches if there's more than one possibility for the formula to be true:

		\begin{description}

				\item[Down Preservation.] If the formula $\phi$ at the parent node of a rule is true under a valuation $v$, then at least one formula $\psi$ on a newly generated child node is true under $v$.

				\begin{center}{\tiny
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\neg (\phi\to\psi) [\phi [\neg \psi ] ] ]
					\end{prooftree}
					%
					\begin{prooftree}
					{
					line numbering=false,
					line no sep= 2cm,
					for tree={s sep'=5mm},
					single branches=true,
					close with=\xmark
					}
					[\phi\lor\psi [\phi ] [\psi ] ]
					\end{prooftree}}
				\end{center}

				\item[Up Preservation.] If a formula $\psi$ at a newly generated child node is true under $v$, then the formula $\phi$ at the parent node is true.

			\end{description}

	\end{itemize}

\end{frame}

\begin{frame}{Associated Interpretations and Closure}

	\begin{itemize}

		\item (6.3.3) Each branch $B$ corresponds to a valuation $v_B$ such that $\llbracket\phi\rrbracket_{v_B}=1$ whenever $\phi\in B$.

		\item (6.3.4) If both $p,\neg p\in B$, then there can't be such a valuation $v_B$. Hence we close the branch.

		%\item In this way, we go through all the possibilities. Hence, if we only find \xmark's, we know that there is no interpretation that makes all the formulas on the branch true.

		\item (6.3.5) If $B$ is an open branch of a tableau, then we define $v_B:\mathcal{P}\to\{0,1\}$ by setting:\[v_B(p):=\begin{cases} 1 &\text{if }p\in B\\0&\text{if }p\notin B\end{cases}\]

		\item \textbf{Theorem} (to be proven later). Let $B$ be an open branch of a complete tableau and $v_B$ its associated valuation. Then for all $\phi\in B$, we have that $\llbracket\phi\rrbracket_{v_B}=1$.

	\end{itemize}

\end{frame}

\begin{frame}{Example}

		\begin{center}
{\small\begin{prooftree}
{
line numbering=false,
line no sep= 2cm,
for tree={s sep'=5mm},
single branches=true,
close with=\xmark
}
[p\land q, grouped [ \neg p\lor q, grouped [\neg (q\land \neg\neg r), grouped [p [q [\neg p [\neg q, close] [\neg\neg\neg r [\neg r, close] ] ] [q [\neg q, close] [\neg\neg\neg r [\neg r ] ] ] ] ] ] ] ]
\end{prooftree}}
\end{center}

	There's only one open branch $B$ (the right-most one), $v_B$ is given by $v_B(p)=1, v_B(q)=1, v_B(r)=0$.

\end{frame}

\begin{frame}{From (Un)Satisfiability Checking to Provability}

	\begin{itemize}

		\item (6.3.7) Note that $\Gamma$ is on every branch (it's the root).

		\item Hence if there's an open branch $B$, then $\Gamma\subseteq B$.

		\item This means that $v_B$ makes all the members of $\Gamma$ true.

		\item Using the ICGNS-theorem, we can use tableaux to determine whether $\Gamma\vDash\phi$ by doing the tableau for $\Gamma\cup\{\neg\phi\}$.

		\item (6.3.8) $\Gamma\vdash_T \phi$ iff the complete tableau for $\Gamma\cup\{\neg\phi\}$ is closed.

		\item It follows that $\Gamma\nvdash_T \phi$ iff the complete tableau for $\Gamma\cup\{\neg\phi\}$ is open.

		\item The complete tableau is our proof. If it's open, we get a countermodel for free.

	\end{itemize}

\end{frame}

\begin{frame}{Example 1 --- De Morgan 1}

{\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={\neg p\lor \neg q\vdash \neg (p\land q)},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[\neg p\lor \neg q, grouped [\neg \neg (p\land q), grouped [p\land q [\neg p [p [q, close] ]] [\neg q [p [q, close] ]]] ] ]
\end{prooftree}
\begin{prooftree}
{
proof statement format={centered},
to prove={\neg (p\land q)\vdash \neg p\lor \neg q},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[\neg (p\land q), grouped [\neg(\neg p\lor \neg q), grouped [\neg\neg p [\neg\neg q [\neg p [p [q, close ] ] ] [\neg q [p [q, close]] ]] ]]]
\end{prooftree}
\end{center}}

\end{frame}

\begin{frame}{Example 2 -- De Morgan 2}

\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={\neg p\land \neg q\vdash \neg (p\lor q)},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[\neg p\land \neg q, grouped [\neg \neg (p\lor q), grouped [p\lor q [ p [\neg p [\neg q, close]]] [q [\neg p [\neg q, close] ]]] ] ]
\end{prooftree}
\begin{prooftree}
{
proof statement format={centered},
to prove={\neg (p\lor q)\vdash \neg p\land \neg q},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[\neg (p\lor q), grouped [\neg(\neg p\land \neg q), grouped [\neg p [\neg q [\neg \neg p [p, close]] [\neg \neg q [q, close]] ]] ]]
\end{prooftree}
\end{center}

\end{frame}

\begin{frame}{Example 3 --- Law of Excluded Middle}

\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={\vdash p\lor \neg p},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[\neg(p\lor \neg p) [\neg p [\neg\neg p [p, close]] ] ]
\end{prooftree}
\end{center}

\end{frame}

\begin{frame}{Example 4 --- Definition of Conditional}

\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={\vdash (\neg p\lor q)\leftrightarrow (p\to q)},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[\neg((\neg p\lor q)\leftrightarrow (p\to q)) [(\neg p\lor q) [\neg  (p\to q) [p [\neg q [\neg p, close] [q, close]] ]  ]] [\neg(\neg p\lor q) [(p\to q) [\neg\neg p [\neg q [\neg p [p, close ] ] [q [p, close ] ] ]] ] ] ]
\end{prooftree}
\end{center}

\end{frame}

\begin{frame}{Example 5 --- Transitivity}

\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={(p\to q), (q\to r)\vdash (p\to r)},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[p\to q, grouped [q\to r, grouped [\neg (p\to r), grouped [p [\neg r [\neg p [\neg q, close] [r, close] ] [q [\neg q, close] [r, close]] ] ]] ] ]
\end{prooftree}
\end{center}

\end{frame}

\begin{frame}{Example 6 --- Distributivity}

{\scriptsize\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={(p\lor q)\land r\vdash (p\land r)\lor (q\land r)},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[(p\lor q)\land r, grouped [\neg((p\land r)\lor (q\land r)), grouped [p\lor q [r [\neg (p\land r) [\neg (q\land r) [p [\neg p [\neg q,close] [\neg r, close]] [\neg r [\neg q,close] [\neg r, close]]] [q [\neg p [\neg q,close] [\neg r, close]] [\neg r [\neg q,close] [\neg r, close]]]]]]]]]
\end{prooftree}
\end{center}}

\end{frame}

\begin{frame}{Example 7 --- Fallacy Affirming the Consequent}

\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={p\to q, q\nvdash p},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[p\to q, grouped [q, grouped [\neg p, grouped [\neg p] [q]]]]
\end{prooftree}
\end{center}

\begin{itemize}[<+->]

\item Countermodel: $v(q)=1, v(p)=0$.

\end{itemize}

\end{frame}

\begin{frame}{Example 8 --- Fallacy of Affirming the Disjunct}

\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={p\lor q, p\nvdash \neg q},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[p\lor q, grouped [p, grouped [\neg\neg q, grouped [q [p] [q]] ]]]
\end{prooftree}
\end{center}

\begin{itemize}[<+->]
\item Countermodel: $v(p)=1, v(q)=1$.

\end{itemize}

\end{frame}

\begin{frame}{Example 9 --- Messed-Up Distributivity}

{\tiny\begin{center}
\begin{prooftree}
{
proof statement format={centered},
to prove={(p\lor r)\land (q\lor r)\nvdash (p\lor q)\land r},
line numbering=false,
for tree={s sep'=10mm},
single branches=true,
close with=\xmark
}
[(p\lor r)\land (q\lor r), grouped [\neg((p\lor q)\land r), grouped  [p\lor r [q\lor r [\neg(p\lor q) [\neg p [\neg q [p [q,close] [r, close]] [r[q,close] [r]]]]] [\neg r [p [q] [r, close ]] [r [q,close] [r, close]]]] ] ]] ]
\end{prooftree}
\end{center}}

\begin{itemize}[<+->]
\item Countermodel: $v(p)=0, v(q)=0, v(r)=1$.

\end{itemize}

\end{frame}
\begin{frame}{Core Ideas (Lecture Version)}

\begin{itemize}

	\item There are several different \emph{kinds} of proof systems: Hilbert calculi, sequent calculi, natural deduction, and analytic tableaux. In this course, we use analytic tableaux.

	\item A set of formulas is satisfiable iff there is a valuation that makes all of its members true.

	\item An inference is valid iff the set of the premises and the negation of the conclusion is unsatisfiable.

	\item The method of analytic tableaux is an algorithm for checking whether a set of formulas is satisfiable: if the tableau for a set is open, then the set is satisfiable.

	\item We define a proof system using analytic tableaux by defining derivability as the tableau for the set of premises plus negation of conclusion being closed.

	\item We can read-off a countermodel from an open branch of an open tableau.

\end{itemize}

\end{frame}

\section{Exam}

\begin{frame}{Exam}

\begin{center}
		\includegraphics[width=40ex]{xkcd-students}\\
		{\tiny \textcopyright~\url{https://xkcd.com/557/}, CC BY-NC 2.5}
		\end{center}

	\begin{itemize}

		\item Digital

		\item Multiple-choice/fill-in-the-gaps/etc.

		\item Questions formulated both in English and Dutch.

		\item Tests understanding of core concepts (see next slide).

		\item Length: \textbf{2 hours} (+extra time)!

		\item Q\&A next Tuesday.

	\end{itemize}

\end{frame}

\begin{frame}{Core concepts}

	\begin{description}

		\item[\S1. Introduction] \

			\begin{itemize}

				\item Validity as truth-preservation across all situations

				\item Logical truth as truth in all situations

				\item Bivalence

				\item Soundness and Completeness

				\item Decidability

			\end{itemize}

		\item[\S2. Mathematics] \

			\begin{itemize}

				\item Variables vs. Constants

				\item Definitions of objects (uniqueness + existence)

				\item Definitions of properties and relations (non-circular)

				\item Concept of informal rigor

			\end{itemize}

	\end{description}

\end{frame}

\begin{frame}{Core concepts}

	\begin{description}

		\item[\S3. Set Theory] \

			\begin{itemize}

				\item Extensional definitions and class abstracts.

				\item Subset relation and the power set

				\item Axiom of extensionality

				\item Set-theoretical operations: $\cup,\cap,\setminus$

				\item Ordered tuples and Cartesian products

				\item Properties and relations

				\item Functions

				\item Inductive definitions, function recursion, proof by induction

			\end{itemize}

		\item[\S4. Syntax] \

			\begin{itemize}

				\item Formalization

				\item Parsing trees

				\item Syntactic recursion

				\item Unique readability theorem

				\item Criteria for formula-hood

				\item Conventional notation

			\end{itemize}

	\end{description}

\end{frame}

\begin{frame}{Core concepts}

	\begin{description}

		\item[\S5. Semantics] \

			\begin{itemize}

				\item Valuations as situations

				\item Recursive definition of truth

				\item Validity of inferences as truth-preservation across valuations

				\item Logical truth as consequence of $\emptyset$

				\item The reduction of validity to logical truth

				\item The method of truth-tables

				\item Decidability of propositional logic

			\end{itemize}

		\item[\S6. Tableaux] \

			\begin{itemize}

				\item Different proof systems

				\item Reduction of validity to satisfiability

				\item Complete, open, and closed tableaux

				\item Associated valuations

				\item Definition of $\vdash_T$

			\end{itemize}

	\end{description}

\end{frame}

\begin{frame}

	\begin{center}
	{\huge\bf Thanks!}
	\end{center}

\end{frame}