# Handling tedious casework

I'm typesetting a math paper, where at many points I need to break proofs into several cases. I've been putting these just in an itemize environment, but this is a confusing, because things like "Case 1" are no longer uniquely-defined; I want the names to have global scope, so I can refer back to sub-cases of previous theorems.

Ideally, I'd like something like itemize, but with a separate counter indicating how many times the environment has been used. Then the cases should show as something like (A1) (A2) (A3) in the first appearance of the environment, (B1) (B2) (B3) in the second, etc.

Is there a package or other easy way to handle this?

I'm against enumerated or itemized lists in a proof; they just confuse the reader with moved margins.

Here's an implementation that mimics lists in that it allows \label without adding unwanted spaces.

\documentclass{article}
\usepackage{amsthm}
\newtheorem{thm}{Theorem}[section]

\newcounter{case}
\renewcommand{\thecase}{\Alph{case}}
\newcounter{proofcase}[case]
\renewcommand{\theproofcase}{(\thecase\arabic{proofcase})}
\newif\ifusedcase

\newcommand{\proofcase}{%
\ifusedcase\else\usedcasetrue\stepcounter{case}\fi
\par
\refstepcounter{proofcase}
\everypar=\expandafter{\the\everypar{\setbox0=\lastbox}\everypar{}Case \theproofcase\ }%
}

\begin{document}

\section{Preliminaries}

\begin{thm}
There exists a talking mule.
\end{thm}

\begin{proof}
We shall prove the statements in a few steps.

\proofcase\label{talkingmule-start}
Go to a suitable cinema.

\proofcase\label{talkingmule-end}
It's that easy.
\end{proof}

\section{The tough thing}

\begin{thm}
We can do it!
\end{thm}
\begin{proof}
\proofcase\label{Yes}
Go in an old castle.

\proofcase\label{Inga}
Ensure you have a pretty assistant.

\proofcase\label{Igor}
Send the other assistant to get a brain.

\proofcase\label{End}
That's it.
\end{proof}

Case~\ref{talkingmule-start} may be difficult. Case~\ref{Igor} can
have unexpected consequences.

\end{document}


• Interesting -- hadn't really thought about the indentation as a problem, but I see your point! Accepting this as the highest-voted answer, since I think either is workable for me. – Mark Nov 6 '14 at 16:24
• can this be extended to allow for subcases? i imagine that would require indentation so it is more "would it make sense to extend to allow subcases?" – afiori Mar 16 '17 at 16:54
• @KiriaKasis It certainly can be extended; the problem is: do you really need cross references to subcases? – egreg Mar 16 '17 at 17:49
• @egreg actually I needed something else (one day when it clearer to me what i want i will likely post a questio), basically I work in proof theory and there are lots of subcases in three or more levels, right now i'm using some quick and dirty \subparagraphs with manual cross references – afiori Mar 18 '17 at 21:30

Here is an elementary implementation that shows how you could use enumitem to create a customized list environment, say thmcases, that prints Case X.# for every case, where X is the theorem number, and # is the case number. Of course, you can modify this to suit your needs.

\documentclass{article}
\usepackage{amsthm,enumitem}

\newtheorem{theorem}{Theorem}
\newlist{thmcases}{enumerate}{1}
\setlist[thmcases]{
label=\textbf{\upshape Case~\thetheorem.\arabic*},
leftmargin=*,
ref={\thetheorem.\arabic*}}

\begin{document}

\begin{theorem}
This is a theorem.
\begin{thmcases}
\item This is the first case
\item This is the second case\label{casetwo}
\item This is the last case
\end{thmcases}
\end{theorem}

See Case~\ref{casetwo} that you should \ldots

\end{document}