[Tex/LaTex] A theorem and its proof in different places

numberingpositioningtheorems

I have a couple of theorems, proofs of which are quite boring and longish. I would like to place theorem formulations in a usual place and stack up the proofs at the end of the chapter. How to do this?

In particular I would like to:

  • keep the original theorem numbering – the same number should be visible in both places, where the theorem is formulated originally, and at the end of the chapter,
  • if possible, copy the original formulation of the theorem right before the proof is given without having to write the text twice

Best Answer

Here's a MWE that demonstrates how the answers package can be used in this context. It preserves all of the numbering, as requested in your first bullet. Sadly I haven't managed to copy the original formulation of the theorem (your second bullet); perhaps someone else will be able to build from this though.

screenshot

\documentclass{article}

\usepackage{answers}
\usepackage{lipsum}

% open prooffile.tex
\Opensolutionfile{prooffile}
\Newassociation{myproof}{myProof}{prooffile}

% new theorem for demonstration
\newtheorem{mytheorem}{Theorem}

\begin{document}

\section{The theorems\ldots}
\begin{mytheorem}
\lipsum[1]
\begin{myproof}
This proves everything! 

\lipsum[2]
\end{myproof}
\end{mytheorem}

% close prooffile.tex
\Closesolutionfile{prooffile}

\clearpage
\section{The proofs!}
% can renew the environment to your liking
\renewenvironment{myProof}[1]{{\bfseries Proof of Theorem #1}}{}

\IfFileExists{prooffile.tex}{\input{prooffile.tex}}{}

\end{document}
Related Question