\documentclass{article}

\usepackage{fullpage,parskip}
\usepackage{amsmath,amssymb}
\usepackage{xcolor}

\newcommand{\XXX}{{\color{red} \textsf{\textbf{XXX}}}}

\begin{document}

\noindent
% fill in the XXXs below
{\Large CS054 Informal HW IndProp \hfill Name: \XXX \qquad CAS ID: \XXX} \\[.5em]
% We 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.
%
% NOTE: However much you work with other students, you must write your
% solution yourself.
Collaborators: \XXX

% Okay! Solve the problems below. please don't delete the problem
% statement after `\item` or the `enumerate' bracketing which provides
% the numbering. Make sure the `\clearpage` comes after your answer.

\begin{enumerate}

\item Prove that for every $n \in \mathbb{N}$, $\neg (S(n) \le n)$.

    A formal proof of this is an optional exercise in the Coq file,
    but try writing an informal proof without doing the formal proof
    first.

    \textbf{Proof:} \XXX
\clearpage
      
\item We can define three-place relations, four-place relations,
    etc., in just the same way as binary relations.  For example,
    consider the following three-place relation on numbers:

\begin{verbatim}
  Inductive R : nat -> nat -> nat -> Prop :=
   | c1 : R 0 0 0
   | c2 m n o (H : R m n o) : R (S m) n (S o)
   | c3 m n o (H : R m n o) : R m (S n) (S o)
   | c4 m n o (H : R (S m) (S n) (S (S o))) : R m n o
   | c5 m n o (H : R m n o) : R n m o.
\end{verbatim}

  \begin{enumerate}
  \item Which of the following propositions are provable?
    \subitem \texttt{R 1 1 2}
    \subitem \texttt{R 2 2 6}

    \textbf{Answer:} \XXX
    
  \item If we dropped constructor \texttt{c5} from the definition of
    \texttt{R}, would the set of provable propositions change?
    Briefly (1 sentence) explain your answer.

    \textbf{Answer:} \XXX
    
  \item If we dropped constructor \texttt{c4} from the definition of
    \texttt{R}, would the set of provable propositions change?
    Briefly (1 sentence) explain your answer.

    \textbf{Answer:} \XXX

  \end{enumerate}
  \clearpage
  
   \item Suppose we give Coq the following definition:
\begin{verbatim}
    Inductive R : nat -> list nat -> Prop :=
      | c1 : R 0 []
      | c2 n l (H: R n l) : R (S n) (n :: l)
      | c3 n l (H: R (S n) l) : R n l.
\end{verbatim}

    Which of the following propositions are provable?

    \subitem \texttt{R 2 [1;0]}
    \subitem \texttt{R 1 [1;2;1;0]}
    \subitem \texttt{R 6 [3;2;1;0]}

    \textbf{Answer:} \XXX

    \clearpage
    
\item \newcommand{\pow}{\ensuremath{\operatorname{pow}}} 
  % the above command defines a /macro/, a convenient way of not
  % having to say the same thing over and over again
  %
  % feel free to define your own!
  
  In class, we defined the function $\pow : \mathbb{N} \times
  \mathbb{N} \rightarrow \mathbb{N}$ as follows:
  \[ \begin{array}{rcl}
    \pow(m,0) &=& 1 \\
    \pow(m,n) &=& \begin{cases}
      \pow(m*m,n/2)       & n \textrm{ even} \\
      m \cdot \pow(m,n-1) & n \textrm{ odd}
    \end{cases}
  \end{array} \]
  
  Prove that $\pow(1,k) = 1$ for all $k$.
  
  \textbf{Proof:} \XXX

\item \newcommand{\down}{\ensuremath{\operatorname{down}}}

  Define the function $\down : \mathbb{N} \rightarrow \mathbb{N}$ as:
  \[ \begin{array}{rcl}
    \down(0) &=& 0 \\
    \down(n) &=& \begin{cases}
      \down(n/2) & n \textrm{ even} \\
      \down(n-1) & n \textrm{ odd}
    \end{cases}
  \end{array} \]

  Prove that $\down(n) = 0$ for all $n$.

  \textbf{Proof:} \XXX

 
  
\end{enumerate}
\end{document}
 
