Q:

Name of the proof instead of just proof

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?

A:

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:

\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.

