# Enumerate environment without vertical space in tabular

I am trying to typeset a hierarchical proof structure as defined by Leslie Lamport in How to Write a Proof.

In particular, I am trying to typeset the portion

Assume:  1. $r \in \mathbf{Q}$
2. $r^2 = 2$
Prove:   False


by putting an enumerate in a tabular.

My current best attempt is

\documentclass{article}

\begin{document}

\begin{tabular}{lp{10cm}}
\scshape Assume: &
\begin{enumerate}
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\\
\scshape Prove: &
False
\end{tabular}

\end{document}


As you can see, there is some rather ugly extra vertical space before and after the enumerate environment. How do I get rid of this extra vertical space?

-

In case if you want to keep table:

\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{tabular}{lp{10cm}}
\scshape Assume: &
\begin{minipage}[t]{\linewidth}
\begin{enumerate}[leftmargin=*,itemsep=-4pt]
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\end{minipage}
\\[3ex]
\scshape Prove: &
False\\
\end{tabular}

\end{document}


-
Is there a way to reduce the extra vertical space between "1." and "2."? –  I Like to Code Feb 28 at 0:27
@ILiketoCode Certainly, use itemsep. I updated the answer. –  Harish Kumar Feb 28 at 0:38
How did you know the "right" value is -4pt? –  I Like to Code Feb 28 at 0:44
@ILiketoCode I just experimented ;). Adjust to your liking please. –  Harish Kumar Feb 28 at 0:44

I would consider doing this a little differently, and use an itemize environment instead:

\begin{itemize}
\item[Assume]
\begin{enumerate}
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\item[Prove] False
\end{itemize}


You can get the scshape by loading the enumitem package:

\begin{itemize}[font=\sc]
\item[Assume]
\begin{enumerate}
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\item[Prove] False
\end{itemize}


Using an itemize environment is beneficial because it will allow page breaks; a tabular environment wraps things firmly in a box.

Here's a complete MWE.

% arara: pdflatex
% !arara: indent: {overwrite: yes}
\documentclass{article}
\usepackage{enumitem}
\begin{document}

\begin{itemize}
\item[Assume]
\begin{enumerate}
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\item[Prove] False
\end{itemize}

\begin{itemize}[font=\sc]
\item[Assume]
\begin{enumerate}
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\item[Prove] False
\end{itemize}
\end{document}

-
I think the "Prove" and "Assume" should be left aligned. –  Peter Grill Feb 27 at 23:52
Indeed, I want "Assume" and "Prove" to be left-aligned as in Lamport's document. –  I Like to Code Feb 28 at 0:23
@ILiketoCode You can just add align=left to the options passed to the list environment. –  cfr Feb 28 at 0:49

Yet another version with enumitem:

Code:

\documentclass{article}
\usepackage{enumitem}

\begin{document}

\noindent some text before
\begin{description}[font=\normalfont\scshape,nosep,labelwidth=45pt,leftmargin=\dimexpr\labelwidth+\labelsep]
\item[Assume:]
\begin{enumerate}[leftmargin=*,nosep]
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\end{enumerate}
\item[Prove:] False
\end{description}
\end{document}

-

This is a variation on cmhughes's solution. It uses description and enumerate with enumitem to define two new lists and some new commands to keep things consistent.

Anyway, the idea was to provide the following new commands:

\mythm
\myproofsketch
\myassume
\myprove


for starting the various parts of the proof. And the following environments:

mytheorem


to contain the whole thing and to list the assumptions with enumeration, respectively.

\documentclass{article}
\usepackage{enumitem}
\newlength{\mylstindent}
\settowidth\mylstindent{\bfseries Theorem}
\newlist{mytheoremlst}{description}{1}
\setlist[mytheoremlst]{leftmargin=0pt,itemindent=\mylstindent,style=sameline,font={\normalfont\textsc},noitemsep}
\newlist{myassumptions}{enumerate}{1}
\setlist[myassumptions]{nosep,label=\arabic*.,align=left,itemindent=\mylstindent,before={\hspace*{-\mylstindent}\vspace*{-1.2em}}}
\newcommand*{\myproofsketch}{%
\vskip 5pt
\item[Proof Sketch:]}
\newcommand*{\myassume}{\item[Assume:]\begin{myassumptions}}
\newcommand*{\myprove}{\end{myassumptions}\item[Prove:]}
\newcommand*{\mythm}{\item[\normalfont\bfseries Theorem]}
\newenvironment{mytheorem}{%
\begin{mytheoremlst}%
}%
{\end{mytheoremlst}%
}

\begin{document}

\begin{mytheorem}
\mythm There does not exist $r$ in $\mathbf{Q}$ such that $r^2=2$.
\myproofsketch We assume $r^2=2$ for $r \in \mathbf{Q}$ and argue to a \emph{reductio}. Writing $r=\frac{a}{b}$ where the HCD of $a$ and $b$ is $1$, we deduce from $\frac{m}{n}^2=2$\dots
\myassume%
\item $r \in \mathbf{Q}$
\item $r^2 = 2$
\myprove False
\end{mytheorem}

\end{document}


Produces:

Can anybody suggest a better way of setting up myassumption to get the first assumption aligned vertically with 'Assume:' without losing the horizontal alignment with the second assumption? This is somewhat of a hack and likely fragile...

-
+1 This is interesting, as it moves one step further towards automating the hierarchical proof structure by Lamport by defining new environments and commands. –  I Like to Code Feb 28 at 14:41