12

Packages I'm using:

\usepackage{amsmath}  
\usepackage{graphicx}  
\usepackage[colorinlistoftodos]{todonotes}  
\usepackage{amsthm}  
\usepackage{amssymb}  
\newtheorem{thm}{Theorem}  
\newtheorem{lma}{Lemma}  
\newtheorem{df}{Definition}  
 \newtheorem{axiom}{Axiom}  
\theoremstyle{definition}  
 \newtheorem{exmp}{Example}[section]  

I'm trying to prove a theorem and I have the following:

\begin{proof} (Proof of theorem)  
...  
\end{proof}

which outputs just "Proof. (Proof of theorem)".

Instead, I would like it to say "Proof of theorem." How can I do this? I tried

\begin{proof}[Proof of theorem \ref{maintheorem}]  
Use the commutative property.    
\end{proof}

which outputs "Proof of theorem??." But I don't want the question marks. How can I fix this?

Werner
  • 603,163

2 Answers2

11

First thing you need is a \label in order to "mark" the theorem. That would give you the option of referencing the theorem using \ref. If you don't have a \label for some corresponding \ref, it will show up as ?? (see Understanding how references and labels work).

Here's one setup that works in your case:

enter image description here

\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}

\begin{theorem}[Some theorem]\label{thm:some-theorem}
This is an important theorem.

\begin{proof}
This is a very important proof.
\end{proof}

\begin{proof}[Proof of Theorem~\ref{thm:some-theorem}]
This is a very important proof.
\end{proof}
\end{theorem}
\end{document}

I would consider the use-case above as the easiest. For example, one could make adjust the proof environment to handle its optional argument differently, but it may be overkill. Here's one such example that yields the same output:

\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}

\makeatletter
\renewenvironment{proof}[1][\relax]{\par
  \pushQED{\qed}%
  \normalfont \topsep6\p@\@plus6\p@\relax
  \trivlist
  \item[\hskip\labelsep\itshape
    \ifx#1\relax \proofname\else\proofname{} of #1\fi\@addpunct{.}]\ignorespaces
}{%
  \popQED\endtrivlist\@endpefalse
}
\makeatother
\begin{document}

\begin{theorem}[Some theorem]\label{thm:some-theorem}
This is an important theorem.

\begin{proof}
This is a very important proof.
\end{proof}

\begin{proof}[Theorem~\ref{thm:some-theorem}]
This is a very important proof.
\end{proof}
\end{theorem}
\end{document}

The above setup now takes the optional argument and prepends it with Proof of, assuming you'll only include some sort of reference.

Werner
  • 603,163
  • Is it possible to get rid of the "1" in "Proof of Theorem 1."? – Eames Cobb May 22 '14 at 20:49
  • @EamesCobb: Hmmm... I thought that's what you wanted. In that case, just use \begin{proof}[Proof of theorem]...\end{proof}. Or, in the case of my updated proof environment, just use \begin{proof}[theorem]...\end{proof}. – Werner May 22 '14 at 20:51
2

As ntheorem has an automatic handling of end-of-proof symbols, here is what one can do with it, and cleveref:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fourier}
\usepackage{heuristica}

 \usepackage{amsmath}
\usepackage[thmmarks, amsmath, thref]{ntheorem}
\usepackage{cleveref}

\theoremstyle{plain}
\theoremheaderfont{\bfseries}
\theoremseparator{.}
\theorembodyfont{\itshape}
\newtheorem{theorem}{Theorem}

\makeatletter
\newtheoremstyle{proof}%
  {\item[\hskip\labelsep\theorem@headerfont\MakeUppercase ##1\theorem@separator]}%
  {\item[\hskip \labelsep\theorem@headerfont\MakeUppercase ##1\ ##3\theorem@separator]}
\makeatother

\theoremstyle{proof}
\theoremheaderfont{\scshape}
\theorembodyfont{\upshape}
\theoremsymbol{\ensuremath{\square}}
\newtheorem{proof}{Proof}

\begin{document}

\begin{theorem}[Some theorem]\label{thm:some-theorem}
This is an important theorem.
\end{theorem}

\begin{proof}
This is a very important proof.
\end{proof}

\begin{proof}[of \nameCref{thm:some-theorem}]
This is a very important proof.
\end{proof}

\begin{proof}[of \Cref{thm:some-theorem}]
This is a very important proof.
\begin{align*}
    a & = b\\ c & = d.
\end{align*}
\end{proof}

\end{document} 

enter image description here

Bernard
  • 271,350