\documentclass{article}
\usepackage{fullpage,parskip}
\usepackage{amsmath,amssymb,amsthm}
\usepackage{xcolor}
\newcommand{\XXX}{{\color{red} \textsf{\textbf{XXX}}}}
\begin{document}
% To run this file, you'll need to have LaTeX installed. All of the
% lab computers have it. You can download a complete LaTeX
% distribution from
% https://www.tug.org/texlive/acquire-netinstall.html.
% Once you have LaTeX, you can either build your PDF on the
% command-line by running 'pdflatex hwXX.tex' to generate hwXX.pdf, or
% you can use an editor like LyX, TeXShop, or ShareLaTeX which
% automates the building of your PDF.
% Please print out your solution double-sided (a/k/a duplex) and bring
% it to class on the Wednesday it's due.
\noindent
% fill in the XXXs below
{\Large CS055 HW03 \qquad Name: \XXX \qquad CAS ID: \XXX} \\[.5em]
% I encourage you to collaborate, but please list any other students
% you talked to about the homework. If you worked alone, please just
% remove the XXXs.
Collaborators: \XXX
% Okay! Solve the problems below. please don't delete the problem
% statement or the ``enumerate'' bracketing which provides the
% numbering.
\begin{enumerate}
\item Let $B(x,y)$ mean ``$x$ is a strictly better rapper than $y$''.
\begin{enumerate}
\item Write a proposition expressing the idea that "Kanye is the
best rapper".
\textbf{Answer:} \XXX
\item Write a proposition expressing the idea that ``there is no
best rapper''.
\textbf{Answer:} \XXX
\end{enumerate}
\item \label{neg} What type does boolean negation ($\neg$) have as a relation?
\textbf{Answer:} $N \subseteq \XXX$
% \mathord tells latex to typeset something as an ordinary symbol,
% rather than a relation or an operator
Write out the set for the $N$ relation.
\textbf{Answer:} \XXX
\item Let $E$ be a unary relation meaning that ``x is even''. Write
out the definition for $E$ if we restrict it to numbers between 0
and 5, i.e, $E \subseteq \{ 0, 1, 2, 3, 4, 5 \}$.
\textbf{Answer:} \XXX
Now write a binary relation $E' \subseteq \{ 0, 1, 2, 3, 4, 5 \}
\times \textbf{2}$ such that $n \mathrel{E'} \top$ if $n$ is even
and $n \mathrel{E'} \bot$ otherwise. (Recall that $\textbf{2}$ is
the Booleans, i.e., $\textbf{2} = \{ \bot, \top \}$.)
% \mathrel tells latex to typeset a symbol as a relation, with extra space on both sides
\textbf{Answer:} \XXX
Write out $N \circ E'$, using the negation relation from
Problem~(\ref{neg}). What did you get out? That is, $N \circ E'$ is
the characteristic function of which relation?
\textbf{Answer:} \XXX
\item Let $C$ be the set of city names in the United States and let
$S$ be the set of states and provinces in the United States. Let $I
\subseteq C \times S$ where $c \mathrel{I} s$ if the city $c$ is in
the state or province $s$.
Is $I$ a function? If so, explain why; if not, give a
counterexample.
\textbf{Answer:} \XXX
\item Find and explain the error in the following proof. Give a
counterexample (i.e., give a relation $R$ which is symmetric and
transitive but not reflexive).
\begin{quote}
\textbf{Theorem.} If $R \subseteq A \times A$ and $R$ is symmetric
and transitive, then $R$ is reflexive.
\textit{Proof.} Let $A$ and $R$ be given. We must show that
$\forall a \in A, a \mathrel{R} a$. Let some $a$ be given. Suppose
$a \mathrel{R} b$; by symmetry of $R$, we have $b \mathrel{R}
a$. By transitivity of $R$, we have $a \mathrel{R} a$. \qed
\end{quote}
\textbf{Answer:} \XXX
\item Write a function of type $\mathbb{N} \rightarrow \mathbb{N}$ that is
symmetric.
\textbf{Answer:} \XXX
\item Write a function of type $\textbf{2} \rightarrow \textbf{2}$
that is transitive.
\textbf{Answer:} \XXX
\item Write a function of type $\textbf{2} \rightarrow \textbf{2}$
that is \textit{not} a bijection.
\textbf{Answer:} \XXX
\item How many functions are there of type $\textbf{2} \rightarrow
\textbf{2}$?
\textbf{Answer:} \XXX
\item Prove that a function $f : \textbf{2} \rightarrow \textbf{2}$ is
injective iff it is surjective.
\textbf{Proof:} \XXX
\item If $f : A \rightarrow B$ for some sets $A$ and $B$, we can
\textit{lift} the function $f$ to sets by defining $f(S) = \{ f(s)
\mid s \in S \}$ for $S \subseteq A$.
\begin{enumerate}
\item Prove that $f(A)$ is the image of $f$.
\textbf{Proof:} \XXX
\item Prove that $f(S \cup T) = f(S) \cup f(T)$ for all $S, T
\subseteq A$.
\textbf{Proof:} \XXX
\item \label{cap} Prove that $f(S \cap T) \subseteq f(S) \cap f(T)$.
\textbf{Proof:} \XXX
\item Why can't you prove equality in Problem~(\ref{cap})? Give an
example of a function $f$, sets $A$ and $B$, and $S, T \subseteq
A$ where $f(A) \cap f(B) \nsubseteq f(A \cap B)$.
\textbf{Answer:} \XXX
\end{enumerate}
\item Let $M(S) = S \uplus \{ \bullet \}$, i.e., let $M(S)$ be the
same as the set $S$ except for a ``null'' element, $\bullet$,
distinct from every other element in $S$.
Prove that for all sets $S$, for every partial function $f : A
\rightharpoonup S$ from an arbitrary set $A$ to $S$, there exists a
total function $f_\bullet : A \rightarrow M(S)$ such that $f(a) = s$
implies $f_\bullet(a) = s$.
\textbf{Proof:} \XXX
\item Suppose we have characteristic function $C : A \rightarrow
\textbf{2}$ of a set $S_C$. When is $C$ surjective? Write a
proposition that says \textit{exactly} when $C$ is or is not
surjective---and prove it.
\textbf{Theorem:} \XXX % your proposition goes here
\textbf{Proof:} \XXX % your proof goes here
\end{enumerate}
\end{document}