\subsection{second order proposition logic} Reasoning can be very well expressed in our language. To focus on reasoning, we will give a representation of second order proposition logic. But this example can easily be extended to handle predicate logic (including existential and universal quantification). Second order proposition logic can be represented as follows: \begin{itemize} \item We have a type prop} for propositions and a type type} for prop}.
Specials} = $\{$ prop, type}$\}$. \item We have one axiom stating that prop} has type type}.
Axioms} = $\{($ prop,type}$)\}$. \item We have a rule for implication, and a rule for quantification over propositions.
PiRules} = $\{($ prop,prop,prop}$),($ type,prop,prop}$)\}$. \item We don't have rules for pair-types in proposition logic.
SigmaRules} = $\emptyset$ \end{itemize} We can represent the logical connectives as follows. Let $A,B$ be propositions. \table mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=\kill $A \rightarrow B$ is represented by: {\sf PiType}({\tt local=}$x$,{\tt domain=}$A$,{\tt range=}$B$).
We can define false} by:
\>{\sf Definition}( {\tt subject=} false}, {\tt body=}{\sf PiType}({\tt local=}$P$,{\tt domain=} prop},{\tt range=}$P$), {\tt type=} prop}.
$\neg A$ is represented by: {\sf PiType}({\tt domain=}$A$,{\tt range=} false}).
$A \wedge B$ is represented by:
\>{\sf PiType}(
\>\>{\tt local=}$P$,
\>\>{\tt domain=} prop},
\>\>{\tt range=}{\sf PiType}(
\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>{\tt domain=}$A$,
\>\>\>\>{\tt range=}{\sf PiType}(
\>\>\>\>\>{\tt domain=}$B$,
\>\>\>\>\>{\tt range=}$P$))
\>\>\>{\tt range=}$P$)).
$A \vee B$ is represented by:
\>{\sf PiType}(
\>\>{\tt local=}$P$,
\>\>{\tt domain=} prop},
\>\>{\tt range=}{\sf PiType}(
\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>{\tt domain=}$A$,
\>\>\>\>{\tt range=}$P$),
\>\>\>{\tt range=}{\sf PiType}(
\>\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>\>{\tt domain=}$B$,
\>\>\>\>\>{\tt range=}$P$),
\>\>\>\>{\tt range=}$P$. <\table> \table mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=mm\=\kill The usual logical rules for these connectives are valid in our system.
For instance, we can derive the following proof of $A \rightarrow A \vee B$:
{\sf Declaration}({\tt subject=}$A$, {\tt type=} prop}), {\sf Declaration}({\tt subject=}$B$,{\tt type=} prop}) $\vdash$
{\sf Abstraction}(
\>{\tt local=}$a$,
\>{\tt domain=}$A$,
\>{\tt body=}{\sf Abstraction}(
\>\>{\tt local=}$P$,
\>\>{\tt domain=} prop},
\>\>{\tt body=}{\sf Abstraction}(
\>\>\>{\tt local=}$ap$,
\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>{\tt domain=}$A$,
\>\>\>\>{\tt range=}$P$)
\>\>\>{\tt body=}{\sf Abstraction}(
\>\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>\>{\tt domain=}$B$,
\>\>\>\>\>{\tt range=}$P$)
\>\>\>\>{\tt body=}{\sf Application}(
\>\>\>\>\>{\tt function=}$ap$,
\>\>\>\>\>{\tt argument=}$a$))))):
{\sf PiType}(
\>{\tt domain=}$A$,
\>{\tt range=}{\sf PiType}(
\>\>{\tt local=}$P$,
\>\>{\tt domain=} prop},
\>\>{\tt range=}{\sf PiType}(
\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>{\tt domain=}$A$,
\>\>\>\>{\tt range=}$P$)
\>\>\>{\tt range=}{\sf PiType}(
\>\>\>\>{\tt domain=}{\sf PiType}(
\>\>\>\>\>{\tt domain=}$B$,
\>\>\>\>\>{\tt range=}$P$)
\>\>\>\>{\tt range=}$P$)))). <\table>