\documentclass[11pt]{article}
\usepackage{fullpage}
\usepackage{pslatex}
\usepackage{amsmath,proof,amsthm,amssymb}

%% part of a problem
\newcommand{\task}[2]
  {\bigskip \noindent
   {\bf Task #1} (#2 pts).}

\newcommand{\ectask}[1]
  {\bigskip \noindent
   {\bf Task #1} (Extra Credit).}

\newcommand{\dsd}[1]{\ensuremath{\mathsf{#1}}}
\newcommand{\irl}[1]{\texttt{#1}}

\newcommand{\true}[1]{\ensuremath{#1 \, \dsd{true}}}

\title{Assignment 3: \\
       Quantifiers}
\author{15-317: Constructive Logic}
\date{Out: Thursday, September 18, 2008 \\
Due: Thursday, September 25, 2008, before class}

\begin{document}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}

\maketitle

\section{Tutch Proofs (28 pts)}

For each of the following propositions:
\begin{enumerate}
\item Determine whether it is true (constructively).
\item If the proposition is true, give a Tutch proof, and (sometimes) a
  proof term, as indicated below.
\end{enumerate}

\begin{verbatim}
proof compose : (!x:t.A(x) => B(x)) => (!x:t.B(x) => C(x)) => (!x:t.A(x) => C(x))
term  compose : (!x:t.A(x) => B(x)) => (!x:t.B(x) => C(x)) => (!x:t.A(x) => C(x))

proof dea1 : (?x:t.A(x) & B(x)) => (?x:t.A(x)) & (?x:t.B(x))
proof dea2 : ((?x:t.A(x)) & (?x:t.B(x))) => (?x:t.A(x) & B(x)) 

proof dao1 : (!x:t.A(x) | B(x)) => (!x:t.A(x)) | (!x:t.B(x))
proof dao2 : ((!x:t.A(x)) | (!x:t.B(x))) => (!x:t.A(x) | B(x)) 

proof daa1 : (!x:t.A(x) & B(x)) => (!x:t.A(x)) & (!x:t.B(x))
term  daa1 : (!x:t.A(x) & B(x)) => (!x:t.A(x)) & (!x:t.B(x))
proof daa2 : ((!x:t.A(x)) & (!x:t.B(x))) => (!x:t.A(x) & B(x)) 
term  daa2 : ((!x:t.A(x)) & (!x:t.B(x))) => (!x:t.A(x) & B(x)) 

proof deo1 : (?x:t.A(x) | B(x)) => (?x:t.A(x)) | (?x:t.B(x))
term  deo1 : (?x:t.A(x) | B(x)) => (?x:t.A(x)) | (?x:t.B(x))
proof deo2 : ((?x:t.A(x)) | (?x:t.B(x))) => (?x:t.A(x) | B(x)) 
term  deo2 : ((?x:t.A(x)) | (?x:t.B(x))) => (?x:t.A(x) | B(x)) 

proof dm1 : ~(?x:t.A(x)) => !x:t.~A(x)
term  dm1 : ~(?x:t.A(x)) => !x:t.~A(x)
proof dm2 : (!x:t.~A(x)) => ~(?x:t.A(x))
term  dm2 : (!x:t.~A(x)) => ~(?x:t.A(x))
\end{verbatim}

\noindent 
Here is the new Tutch syntax you'll need:
\begin{itemize}
\item $\forall x:\tau.A$ is written \verb|!x:t.A|

\item $\exists x:\tau.A$ is written \verb|?x:t.A|
\item The existential elimination rule requires a hypothetical with two
  assumptions.  These are written by separating the assumptions with a
  comma.  For example:
\begin{verbatim}
proof exp : (?x:t.A(x)) => ?x:t.A(x) =
begin
[(?x:t.A(x));
 [a:t , A(a);
  ?x:t.A(x)];
 ?x:t.A(x)];
(?x:t.A(x)) => ?x:t.A(x);
end;
\end{verbatim}

\item Proof terms for the quantifiers are written as follows:

\begin{tabular}{c|c}
Rule & Proof Term \\
\hline
$\forall I$  & \verb|fn x => M| \\
$\forall E$  & \verb|M N| \\
$\exists I$  & \verb|(M , N)| \\
$\exists E$  & \verb|let (x,u) = M in N| \\
\end{tabular}

\end{itemize}

\section{Verifications and Uses (12 pts, Written)}

For each of the following propositions:
\begin{enumerate}
\item Determine whether it is true (constructively).
\item If the proposition is true, give a verification/use derivation.
\item If the proposition is not true, argue that there is no
verification/use derivation.  
\end{enumerate}
See the Lecture 6 notes for the verification/use rules for the
quantifiers.  See the Lecture 3 notes for the verification/use rules for
the propositional connectives.

\begin{verbatim}
dea1 : (?x:t.A(x) & B(x)) => (?x:t.A(x)) & (?x:t.B(x))
dea2 : ((?x:t.A(x)) & (?x:t.B(x))) => (?x:t.A(x) & B(x)) 
dao1 : (!x:t.A(x) | B(x)) => (!x:t.A(x)) | (!x:t.B(x))
dao2 : ((!x:t.A(x)) | (!x:t.B(x))) => (!x:t.A(x) | B(x)) 
\end{verbatim}

\section{Handin Instructions}

\begin{itemize}
\item 
To run Tutch with the requirements files, run

\begin{verbatim}
/afs/andrew/course/15/317/bin/tutch -r hw04.req <your file>
\end{verbatim}

This uses the requirements file
\verb|/afs/andrew/course/15/317/req/hw04.req|.

\item To submit your Tutch proofs, run

\begin{verbatim}
/afs/andrew/course/15/317/bin/submit -r hw04.req <your file>
\end{verbatim}

To check the status of your submission, run
\verb|/afs/andrew/course/15/317/bin/status hw03|.

It is expected for Tutch to report that you have unsolved problems
corresponding to those propositions in Problem 1 that you think are
false.

\item Submit your written work at the beginning of class, or, if you
  wish to do an electronic handin, copy a PDF to 

\begin{verbatim}
/afs/andrew/course/15/317/submit/<yourid>/hw03.pdf
\end{verbatim}

\end{itemize}

\end{document}
