12

I have a document with a lemma (using amsthm), like so:

\begin{lem} \label{mylemma}
  % ...
\end{lem}

The proof of this lemma can be found in the appendix (see section \ref{sec:proof_of_mylemma}).

I now place a copy of the lemma in the appendix, with proof included:

\section{Appendix}

\section{Proof of lemma \ref{mylemma}} \label{sec:proof_of_my_lemma}

\begin{lem}
  % ...
\end{lem}

\begin{proof}
  % ...
\end{proof}

The problem is that the second copy of my lemma has a new number. How can I renumber this lemma to mimick the number of mylemma?

Thanks!

1

3 Answers 3

20

You can use the restatable environment provided by the thmtools package:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools,thm-restate}

\newtheorem{lem}{Lemma}

\begin{document}

\begin{restatable}{lem}{primelemma}
\label{mylemma}
Let $p$ be a prime number, and assume $p$ divides the product of two integers $a$ and $b$. Then $p$ divides $a$ or $p$ divides $b$.
\end{restatable}

\section{Proof of lemma~\ref{mylemma}} 
\primelemma*

\end{document}

enter image description here

2
  • What about the opposite: cite the lemma before? For example, cite on Introduction the Lema 1.2 with the same numbering.
    – Sigur
    Commented Feb 4, 2014 at 14:03
  • 2
    @Sigur in that case, use the starred version restatable* in the Introduction and the un-starred \primelemma further on in the document. Commented Feb 4, 2014 at 16:57
1

This really should be a comment rather than an answer, but I do not have sufficient reputation to comment. Hopefully someone will find this helpful and avoid some headache. You cannot use a number at the end of the reference. The following will fail:

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools,thm-restate}

\newtheorem{lem}{Lemma}

\begin{document}

\begin{restatable}{lem}{mylemma1}
\label{mylemma}
I claim that $1+1=2$.
\end{restatable}

\section{Proof of lemma~\ref{mylemma}} 
\mylemma1*

\end{document}

but the following will compile properly

\documentclass{article}
\usepackage{amsthm}
\usepackage{thmtools,thm-restate}

\newtheorem{lem}{Lemma}

\begin{document}

\begin{restatable}{lem}{mylemmaone}
\label{mylemma}
I claim that $1+1=2$.
\end{restatable}

\section{Proof of lemma~\ref{mylemma}} 
\mylemmaone*

\end{document}
0

(Disclaimer: I wrote the package, keytheorems, used below.)

With keytheorems, you can restate a theorem before or after it is given with the store=<tag> key. To have labels and counters point to the restated theorem, use store*=<tag> (in this case it can only be restated once).

First approach

\documentclass{article}
\usepackage{keytheorems}

\newkeytheorem{lem}[name=Lemma]

\begin{document}

\begin{lem}[store=primelemma]
\label{mylemma}
Let $p$ be a prime number, and assume $p$ divides the product of two integers $a$ and $b$. Then $p$ divides $a$ or $p$ divides $b$.
\end{lem}

\section{Proof of lemma~\ref{mylemma}} 
\getkeytheorem{primelemma}

\end{document}

Second approach

\documentclass{article}
\usepackage{keytheorems}

\newkeytheorem{lem}[name=Lemma]

\begin{document}

\getkeytheorem{primelemma}

\section{Proof of lemma~\ref{mylemma}}
\begin{lem}[store*=primelemma]
\label{mylemma}
Let $p$ be a prime number, and assume $p$ divides the product of two integers $a$ and $b$. Then $p$ divides $a$ or $p$ divides $b$.
\end{lem}

\end{document}

restated theorems

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .