\documentclass[usenames,dvipsnames,svgnames]{beamer}

\usepackage{enumerate}
\usepackage{mathtools,amssymb,amsfonts,amsthm}
\usepackage{comment}
\usepackage{multirow}
\usepackage{multicol}
\usepackage{tabularx}
\usepackage{tikz}
\usetikzlibrary{petri}
\usetikzlibrary{trees}
\usepackage{url}
\usepackage{newverbs}
\usepackage{euscript,mathrsfs}
\usepackage{pdfpages}

\specialcomment{lecturenotes}{}{}\excludecomment{lecturenotes}
\specialcomment{answers}{\sss \textsc{Answer: }}{\sss}
%\excludecomment{answers} % comment to compile with answers.
\specialcomment{remarks}{

\sss
\begingroup\color{blue}}
{\endgroup

\sss}
\specialcomment{inremarks}{\begingroup\color{blue}[}{]\endgroup}
\specialcomment{undefined}{\begingroup\color{orange}}{\endgroup}
\specialcomment{unjustified}{\begingroup\color{red}}{\endgroup}
\specialcomment{grammar}{\begingroup\color{Green}}{\endgroup}
\specialcomment{tex}{\begingroup\color{purple}}{\endgroup}

\newverbcommand{\cverb}{\small\color{purple}}{}
\newverbcommand{\everb}{\small\color{blue}}{}
\newcommand{\hl}[1]{\textit{\color{magenta}#1}}

\newcolumntype{L}[1]{>{\hsize=#1\hsize\raggedright\arraybackslash}X}
\newcolumntype{R}[1]{>{\hsize=#1\hsize\raggedleft\arraybackslash}X}
\newcolumntype{C}[1]{>{\hsize=#1\hsize\centering\arraybackslash}X}

\newcommand{\sss}{\vspace{2 mm}\noindent}
\newcommand{\lss}{\vspace{5 mm}\noindent}
\newcommand{\lls}{\vspace{7 mm}\noindent}
\newcommand\Tstrut{\rule{0pt}{2.6ex}}         % = `top' strut
\newcommand\Bstrut{\rule[-1ex]{0pt}{0pt}}   % = `bottom' strut
\newcommand{\ds}{\displaystyle}
\newcommand{\HR}{\vspace{5pt}\hrule height 1pt \vspace{5pt}}
\newcommand{\atext}[1]{\text{\quad #1 \quad }}

\newcommand{\ca}{\mathcal}
\newcommand{\fr}{\mathfrak}
\newcommand{\eucal}{\EuScript}
\newcommand{\scr}{\mathscr}
\newcommand{\bbf}{\mathbb{F}}
\newcommand{\bbn}{\mathbb{N}}
\newcommand{\bbr}{\mathbb{R}}
\newcommand{\bbq}{\mathbb{Q}}
\newcommand{\bbc}{\mathbb{C}}
\newcommand{\bbz}{\mathbb{Z}}
\newcommand{\bbp}{\mathbb{P}}
\newcommand{\bfa}{\mathbf{a}}
\newcommand{\bfb}{\mathbf{b}}
\newcommand{\bfc}{\mathbf{c}}
\newcommand{\bfu}{\mathbf{u}}
\newcommand{\bfv}{\mathbf{v}}
\newcommand{\bfx}{\mathbf{x}}

\newcommand{\inv}{^{-1}}
\newcommand{\into}{\hookrightarrow}
\newcommand{\onto}{\twoheadrightarrow}
\newcommand{\isom}{\overset{\sim}{\to}}
\renewcommand{\iff}{\Leftrightarrow}
\renewcommand{\implies}{\Rightarrow}
\renewcommand{\impliedby}{\Leftarrow}
\newcommand{\contradiction}{\Rightarrow\Leftarrow}

\newcommand{\bmat}[1]{\begin{bmatrix}#1\end{bmatrix}}
\newcommand{\pmat}[1]{\begin{pmatrix}#1\end{pmatrix}}
\newcommand{\vmat}[1]{\begin{vmatrix}#1\end{vmatrix}}
\newcommand{\floor}[1]{\lfloor #1 \rfloor}
\newcommand{\Floor}[1]{\left\lfloor #1 \right\rfloor}
\newcommand{\vect}[1]{\langle #1 \rangle}

\newcommand{\Ad}{\operatorname{Ad}}
\newcommand{\ad}{\operatorname{ad}}
\newcommand{\disc}{\operatorname{disc}}
\newcommand{\domain}{\operatorname{domain}}
\newcommand{\Id}{\operatorname{Id}}
\newcommand{\im}{\operatorname{im}}
\newcommand{\ind}{\operatorname{ind}}
\newcommand{\nul}{\operatorname{Nul}}
\newcommand{\nullity}{\operatorname{nullity}}
\newcommand{\ord}{\operatorname{ord}}
\newcommand{\proj}{\operatorname{proj}}
\newcommand{\rank}{\operatorname{rank}}
\newcommand{\red}{\operatorname{red}}
\newcommand{\bbref}{\operatorname{rref}}
\newcommand{\tr}{\operatorname{tr}}
\newcommand{\trunc}{\operatorname{Trunc}}
\newcommand{\vspan}{\operatorname{span}}

\newtheorem{thm}{Theorem}[section]
\newtheorem{prop}[thm]{Proposition}
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lem}[thm]{Lemma}
\newtheorem*{prop*}{Proposition}
\newtheorem*{cor*}{Corollary}
\newtheorem*{lem*}{Lemma}
\newtheorem*{thm*}{Theorem}

\theoremstyle{definition}
\newtheorem{conj}[thm]{Conjecture}
\newtheorem{defn}[thm]{Definition}
\newtheorem{claim}[thm]{Claim}
\newtheorem{ex}[thm]{Example}
\newtheorem*{conj*}{Conjecture}
\newtheorem*{rd}{Read from the text}
\newenvironment{answer}{\noindent\textsc{Answer:}}{\hfill $\square$}

\newcounter{homework}
\newtheorem{hw}[homework]{Homework}

\newcounter{exercise}[homework]
\newtheorem{exer}[exercise]{Exercise}
\renewcommand{\theexercise}{\arabic{homework}.\arabic{exercise}}

\theoremstyle{remark}
\newtheorem*{defn*}{Definition}
\newtheorem{remark}[thm]{Remark}
\newtheorem*{remark*}{Remark}
\newtheorem{notation}[thm]{Notation}

\usetheme{Pittsburgh}
\usecolortheme{rose}

\title{Hello world!}
\subtitle{A First Proof}
\date{}

\begin{document}
%0	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\maketitle
\end{frame}

%1	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{overlayarea}{\textwidth}{90mm}
\begin{defn}[\hl{Set equality}]
Let $A$ and $B$ be sets, then $A=B$ if $A$ and $B$ contain exactly the same elements.
\end{defn}
\begin{align*}
&\text{sets are equal} &&\iff &&\text{elements are the same}
\end{align*}

\only<2->{
If $A=B$ and $x \in A$, then \only<2>{\dotso}\only<3->{$x \in B$.}

\only<4->{
If $A=B$ and $x \in B$, then \only<4>{\dotso}\only<5->{$x \in A$.}
}

\begin{center}
\begin{tikzpicture}
\draw (0,0) rectangle (2,2) node at (1,-.5) {$A$}
	(3,0) rectangle (5,2) node at (4,-.5) {$B$};
\node[circle,ball color=red] at (1,1) {};
\only<3->{\node[circle,ball color=red] at (3.5,.7) {};}
\only<4->{\node[circle,ball color=blue] at (3.9,1.4) {};}
\only<5->{\node[circle,ball color=blue] at (1.5,.5) {};}
\end{tikzpicture}
\end{center}
}
\end{overlayarea}
\end{frame}

%2	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{overlayarea}{\textwidth}{90mm}
\only<1-3>{
\begin{defn}[\hl{Set equality}]
Let $A$ and $B$ be sets, then $A=B$ if $A$ and $B$ contain exactly the same elements.
\end{defn}

{\color{red}Know}: Given that $A = B$, we \emph{know} that
\begin{itemize}
\item if $x \in A$, then $x \in B$, and
\item if $x \in B$, then $x \in A$.
\end{itemize}
}

\only<1>{
\begin{center}
\begin{tikzpicture}
\draw (0,-2) rectangle (8,2);
\node at (4,1.5) {Definition of set equality};
\node at (1,0) (0) {$A=B$};
\draw (6,1) node (1) {$x \in A \Rightarrow x \in B$};
\draw (6,-1) node (-1) {$x \in B \Rightarrow x \in A$};
\draw[->] (0) -- node[sloped,above] {\footnotesize know} (1.west);
\draw[->] (0) -- node[sloped,below] {\footnotesize know} (-1.west);
\end{tikzpicture}
\end{center}
}

\only<2-3>{
{\color{red}Show}: How would you show that two sets are equal?

\only<3>{
If we can \emph{show} the following: 
\begin{itemize}
\item if $x \in A$, then $x \in B$, and
\item if $x \in B$, then $x \in A$,
\end{itemize}
then we would know that $A=B$.
}
}

\only<4>{
\begin{defn}
Let $A$ and $B$ be sets, then $A=B$ if $x \in A \Rightarrow x \in B$ and $x \in B \Rightarrow x \in A$.
\end{defn}

\vspace{5mm}

\begin{center}
\begin{tikzpicture}
\draw (0,-2) rectangle (8,2);
\node at (4,1.5) {Definition of set equality};
\node at (1,0) (0) {$A=B$};
\draw (6,1) node (1) {$x \in A \Rightarrow x \in B$};
\draw (6,-1) node (-1) {$x \in B \Rightarrow x \in A$};
\draw[->] (0) -- node[sloped,above] {\footnotesize know} (1.west);
\draw[->] (0) -- node[sloped,below] {\footnotesize know} (-1.west);
\draw[->] (-1.north) -- (5,0) (1.south) -- (5,0) (5,0) -- node[above, pos=.3] {\footnotesize show} (0);
\end{tikzpicture}
\end{center}
}
\end{overlayarea}
\end{frame}

%3	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{overlayarea}{\textwidth}{90mm}
\begin{defn}[\hl{Subset}]
Let $A$ and $B$ be sets, then $A \subseteq B$ if every element of $A$ is also an element of $B$.
\end{defn}

\only<2->{
If $A \subseteq B$ and $x \in A$, then \only<2>{\dotso}\only<3->{$x \in B$.}

\begin{center}
\begin{tikzpicture}
\draw (0,0) rectangle (2,2) node at (1,-.5) {$A$}
	(3,0) rectangle (5,2) node at (4,-.5) {$B$};
\node[circle,ball color=red] at (1,1) {};
\only<3->{\node[circle,ball color=red] at (3.5,.7) {};}
\only<3->{\node[circle,ball color=blue] at (3.9,1.4) {};}
\end{tikzpicture}
\end{center}

\only<3->{{\color{red}Know}: Given that $A\subseteq B$, we \emph{know} that if $x \in A$, then $x \in B$.}
}

\only<4->{
{\color{red}Show}: Knowing \only<4>{\dotso}\only<5>{if $x \in A$, then $x \in B$}

\only<4>{\dotso} would \emph{show} that $A \subseteq B$.
}
\end{overlayarea}
\end{frame}

%4	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{overlayarea}{\textwidth}{90mm}
\begin{defn}[\hl{Subset}]
Let $A$ and $B$ be sets, then $A \subseteq B$ if $x \in A \Rightarrow x \in B$.
\end{defn}

\vspace{5mm}

\begin{center}
\begin{tikzpicture}
\draw (0,-2) rectangle (8,2);
\node at (4,1.5) {Definition of subset};
\node at (1,0) (0) {$A\subseteq B$};
\draw (6,0) node (1) {$x \in A \Rightarrow x \in B$};
\draw[bend left] (0.north east) edge[->,bend left] node[sloped,above] {\footnotesize know} (1.north west);
\draw[bend left] (1.south west) edge[->,bend left] node[below] {\footnotesize show} (0.south east);
\end{tikzpicture}
\end{center}
\end{overlayarea}
\end{frame}

%4	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{overlayarea}{\textwidth}{90mm}
Prove the following.

\begin{thm}
Let $A$ and $B$ be sets. If $A=B$, then $A \subseteq B$.
\end{thm}

``\emph{Knowing} that $A$ and $B$ are sets and $A=B$, \emph{show} that $A \subseteq B$."

\only<2>{

\vspace{2mm}
\begin{tikzpicture}[scale=.6,font=\tiny]
\draw (0,-2) rectangle (8,2);
\node[blue] at (4,1.5) {Definition of set equality};
\node at (1,0) (0) {$A=B$};
\draw (6,1) node (1) {$x \in A \Rightarrow x \in B$};
\draw (6,-1) node (-1) {$x \in B \Rightarrow x \in A$};
\draw[->] (0) -- node[sloped,above] {know} (1.west);
\draw[->] (0) -- node[sloped,below] {know} (-1.west);
\draw[->] (-1.north) -- (5,0) (1.south) -- (5,0) (5,0) -- node[above, pos=.3] {show} (0);
\end{tikzpicture}

\begin{tikzpicture}[scale=.6, font=\tiny]
\draw (0,-2) rectangle (8,2);
\node[blue] at (4,1.5) {Definition of subset};
\node at (1,0) (0) {$A\subseteq B$};
\draw (6,0) node (1) {$x \in A \Rightarrow x \in B$};
\draw[bend left] (0.north east) edge[->,bend left] node[sloped,above] {know} (1.north west);
\draw[bend left] (1.south west) edge[->,bend left] node[below] {show} (0.south east);
\end{tikzpicture}
}

\only<3>{

\vspace{2mm}
\begin{tikzpicture}[scale=.6,font=\tiny]
\draw (0,-2) rectangle (8,2);
\node[blue] at (4,1.5) {Definition of set equality};
\node at (1,0) (0) {$A=B$};
\draw (6,1) node (1) {$x \in A \Rightarrow x \in B$};
\draw (6,-1) node (-1) {$x \in B \Rightarrow x \in A$};
\draw[->] (0) -- node[sloped,above] {know} (1.west);
\draw[->] (0) -- node[sloped,below] {know} (-1.west);
\end{tikzpicture}

\begin{tikzpicture}[scale=.6, font=\tiny]
\draw (0,-2) rectangle (8,2);
\node[blue] at (4,1.5) {Definition of subset};
\node at (1,0) (0) {$A\subseteq B$};
\draw (6,0) node (1) {$x \in A \Rightarrow x \in B$};
\draw[bend left] (1.south west) edge[->,bend left] node[below] {show} (0.south east);
\end{tikzpicture}
}

\only<4->{

\vspace{2mm}
\begin{tikzpicture}[scale=.6,font=\tiny]
\draw (0,-2) rectangle (8,2);
\node[blue] at (4,1.5) {Definition of set equality};
\node at (1,0) (0) {$A=B$};
\draw (6,1) node (1) {$x \in A \Rightarrow x \in B$\quad $\color{red}\star$};
\draw (6,-1) node (-1) {$x \in B \Rightarrow x \in A$ \quad $\color{Green}\star$};
\draw[->] (0) -- node[sloped,above] {know} (1.west);
\draw[->] (0) -- node[sloped,below] {know} (-1.west);

\draw (8,.1) rectangle (16,2);
\node[blue] at (12,1.5) {Definition of subset};
\node at (10,1) (0) {$\color{red}\star$ \quad $x \in A \Rightarrow x \in B$};
\draw (15,1) node (1) {$A\subseteq B$};
\draw (1) edge[<-] node[below] {show} (0);
\end{tikzpicture}
}

\only<5->{
\begin{proof}
{\only<5>{\color{blue}} Suppose that $A$ and $B$ are sets, and $A=B$.} \only<6->{\only<6>{\color{blue}}We prove that $A\subseteq B$ by showing that if $x \in A$, then $x \in B$.}

\vspace{1mm}
\only<7->{{\only<7>{\color{blue}}Suppose $x \in A$.} \only<8->{{\only<8>{\color{blue}}By the definition of set equality, if $x \in A$, then $x \in B$.} \only<9->{{\only<9>{\color{blue}}Thus by the definition of subset, we conclude that $A \subseteq B$.}}}}
\end{proof}
}
\end{overlayarea}
\end{frame}
\end{document}

%4	%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\begin{overlayarea}{\textwidth}{90mm}
Prove the following.

\begin{thm}
Let $A$ and $B$ be sets. If $A=B$, then $A \subseteq B$ and $B \subseteq A$.
\end{thm}

\begin{thm}
Let $A$ and $B$ be sets. If $A \subseteq B$ and $B \subseteq A$, then $A=B$.
\end{thm}

Once you've written these proofs, complete the following card:

\begin{center}
\begin{tikzpicture}[scale=.6, font=\tiny]
\draw (0,-1) rectangle (8,1);
\node at (2,0) (0) {$x \in A \Rightarrow x \in B$};
\draw (6,0) node (1) {$x \notin B \Rightarrow $};
\draw (0.north east) edge[->,bend left] (1.north west);
\draw (1.south west) edge[->,bend left] (0.south east);
\end{tikzpicture}
\end{center}

Prove the following.

\begin{thm}
Let $A, B$, and $C$ be sets where $\overline A = B$ and $\overline B = C$. Then $A = C$.
\end{thm}
\end{overlayarea}
\end{frame}
