%
% A proof-by-cases environment. This gives you a nicely-indented list
% of cases for use in proofs.
%
% Example:
%
% Case 1 (x >= 0): herp.
%
% Case 2 (x < 0): derp.
%

% Used below to define pcases.
\usepackage{enumitem}

% Using the enumitem package, we define a new type of list, called
% ``pcases'' (proof by cases).
\newlist{pcases}{enumerate}{1}
\setlist[pcases]{
  label=\textbf{Case~\arabic*}~(\protect\thiscase)\textbf{:},
  ref=\arabic*,
  align=left,
  leftmargin=\parindent}

\newcommand{\case}[1][]{
  \def\thiscase{#1}%
  \item
}
