3

I often break long proofs into smaller pieces, in order to make it easier to read and understand. I'm doing that by adding a fbox with "Part X: ...". However, this doesn't work out very well all the time: the box and the according part of the proof can be split by a pagebreak, as illustrated in the code underneath.

\documentclass{article}

\usepackage{amsthm}
\usepackage{lipsum}

\parskip 12pt
\parindent 0pt
\newtheorem{theorem}{Theorem}

\begin{document}
    \lipsum[1-4]
    \begin{theorem}
        This is my theorem.
    \end{theorem}
    \begin{proof}
        Let's cut this long proof into little pieces.

        \fbox{Part 1: firstly}

        This is part 1.

        \fbox{Part 2: secondly}

        This is part 2.
    \end{proof}
\end{document}

Is there a way to prevent this in general? Is it possible to create a new environment that prevents splitting and that makes adding such a subproof easier (I'm sick of having to type \fbox{Part X: ...} all over again)? I'm looking for something that allows me to type for example

\begin{proof}
  Let's cut this long proof into little pieces.
  \begin{subproof}{Title of subproof 1}
    (subproof 1)
  \end{subproof}
  \begin{subproof}{Title of subproof 2}
    (subproof 2)
  \end{subproof}
\end{proof}

and that would result in

A proof with subproofs

Maybe Parts numbering in Proofs can help to number the subproofs automatically.

6

You could use the same mechanism as section titles:

\documentclass{article}

\usepackage{amsthm}
\usepackage{lipsum}

\newtheorem{theorem}{Theorem}

\makeatletter
\newcommand{\proofpart}[2]{%
  \par
  \addvspace{\medskipamount}%
  \noindent\emph{Part #1: #2}\par\nobreak
  \addvspace{\smallskipamount}%
  \@afterheading
}
\makeatother

\begin{document}
\lipsum[1-4]

\begin{theorem}
This is my theorem.
\end{theorem}

\begin{proof}
Let's cut this long proof into little pieces.

\proofpart{1}{firstly}

This is part 1.

\proofpart{2}{secondly}

This is part 2.

\proofpart{3}{thirdly}

This is part 3.
\end{proof}

\end{document}

Sorry, but I can't stand seeing nonzero parskip documents, that I find a waste of paper that adds nothing to clarity and readability.

A frame around “Part 1: firstly” is a punch in the eye, I suggest just italics like for “Proof”. In all honesty, I wouldn't add a line break after the proof part heading, but it's personal taste.

A variant that automatically numbers proof parts.

\documentclass{article}

\usepackage{amsthm,xpatch}
\usepackage{lipsum}

\newtheorem{theorem}{Theorem}

\makeatletter
\newcounter{proofpart}
\xpretocmd{\proof}{\setcounter{proofpart}{0}}{}{}
\newcommand{\proofpart}[1]{%
  \par
  \addvspace{\medskipamount}%
  \stepcounter{proofpart}%
  \noindent\emph{Part \theproofpart: #1}\par\nobreak\smallskip
  \@afterheading
}
\makeatother

\begin{document}

\lipsum[1-4]

\begin{theorem}
This is my theorem.
\end{theorem}

\begin{proof}
Let's cut this long proof into little pieces.

\proofpart{firstly}

This is part 1.

\proofpart{secondly}

This is part 2. \lipsum*[1]

\proofpart{thirdly}

This is part 3. \lipsum*[1]
\end{proof}

\end{document}
  • 1
    Can you explain why you put \@afterheading? What does it do? – Bordaigorl Oct 15 '14 at 17:59
  • 2
    @Bordaigorl It sets things up so that no page break is possible before the first two lines of the following paragraph. – egreg Oct 15 '14 at 19:23
  • @egreg This solution differs from the section titles as it does not provide an automatic numbering, do you have any clue how to recreate that instead of manually entering the numbers? – Olivier Massicot Aug 2 '19 at 13:36
  • 1
    @OlivierMassicot It would be easy to add a counter, but you need to patch \proof in order to reset the counter. – egreg Aug 2 '19 at 13:39
  • 1
    @OlivierMassicot I added the code – egreg Aug 2 '19 at 15:23
0

If the proof parts don't need a description, one can use the enumitem package and use this code:

\documentclass{article}

\usepackage{amsthm}
\usepackage{lipsum}
\usepackage{enumitem}

\newtheorem{theorem}{Theorem}

\begin{document}
\lipsum[1]

\begin{theorem}
This is my theorem.
\end{theorem}

\begin{proof}
Let's cut this long proof into little pieces.

\begin{enumerate}[label={{Part} \arabic*.}, leftmargin=*]
    \item This is part 1.
    \item This is part 2.
    \item This is part 3.
\end{enumerate}
\end{proof}

\end{document}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.