# How to typeset a proof via structural induction

Structural induction differs from "mathmatical" induction in the number of cases: While mathmatical induction requires exactly two cases, structural induction may require many more.

A proof via structural induction thus requires:

1. An environment for Cases (preferably labeled and numbered, preferably without further indentation)
2. A sub-proof environment that contains the proof for the specific case (preferably with a distinctive q.e.d. sign)

Is there any support inside a \begin{proof}\end{\proof} environment that covers this?

• This definition of 'mathematical induction' is new to me. Maybe I'm just out of date but, when I learnt it, what you are calling 'structural induction' would have (also) been mathematical induction. – cfr Oct 20 '15 at 12:34
• @cfr I think what the OP is calling "mathematical induction" is induction over the naturals, while structural induction works on any algebra (as in universal algebra). The induction principle on naturals is just a special case – Bordaigorl Oct 20 '15 at 12:47

Is this what you are looking for? If the way Cases work here does not please you, you should clarify the question because it's not clear what do you want exactly.

\documentclass{scrartcl}
\usepackage{mathtools,amssymb,amsthm,enumitem}

\SetEnumitemKey{ncases}{itemindent=!,before=\let\makelabel\ncasesmakelabel}
\newcommand*\ncasesmakelabel[1]{Case #1}

\newenvironment{subproof}
{\def\proofname{Subproof}%
\def\qedsymbol{$\triangleleft$}%
\proof}
{\endproof}

\begin{document}
\begin{proof}
Some text or \texttt{\string\leavevmode} (so the enumerate starts in another line)
\begin{enumerate}[ncases]
\item Foo.
\begin{subproof}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{subproof}
\item Bar.
\begin{subproof}
Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
\end{subproof}
\end{enumerate}
And more text.
\end{proof}

\end{document}

• Thanks! that looks great. \edef extends a definition? – choeger Oct 20 '15 at 12:30
• No, in this case it was wrong what I used (not entirely wrong, but didn't achive what I wanted), I updated the code. – Manuel Oct 20 '15 at 12:32
• \MakeLowercase, not \lowercase: the latter works for English, not necessarily for other languages. – egreg Oct 20 '15 at 12:33
• You can put any name you want inside the definition of \proofname I just used a trick that adds Sub before the original name of the proof (after being converted to lowercase). In English that definition is the same as \def\proofname{Subproof}. @egreg True, corrected. – Manuel Oct 20 '15 at 12:33
• I suggest forgetting such clever tricks and defining a \subproofname command. – egreg Oct 20 '15 at 12:49