[Tex/LaTex] How to reference in appendix a theorem given in the body

appendicescross-referencingnumberingtheorems

I have a theorem given in the body text of a paper, say Theorem 2 with label {theorem-abc}.
I would like to provide the proof of this theorem in the appendix.

1) How do I cross-reference this theorem in the appendix section title?

The section title that I want is "Proof of Theorem 2".

2) How do I restate the theorem again in the aforementioned section?

What I want is "Theorem 2. xxxxxxx", followed by its proof.

ADD: The document class file has following definitions regarding Appendix.

\def\appendix{\par
\section*{APPENDIX}
\setcounter{section}{0}
\setcounter{subsection}{0}
\def\thesection{\Alph{section}} }

I found similar issues here. But it did not solve my Problem 1) either.

MWE: The class file is downloadable here.

\documentclass{vldb}
\usepackage{thmtools, thm-restate}
\usepackage{hyperref}
\declaretheorem{theorem}

\begin{document}
\section{Test Section}
\begin{theorem}
Test theorem
\end{theorem}

\begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}
\label{thm:FTA}
Every non-constant single-variable polynomial with complex coefficients has at least    one complex root. 
\end{restatable}

\appendix
\section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA} (See page~\pageref{thm:FTA})}
\fta*
\begin{proof}
Assume...
\end{proof}

\end{document}

Best Answer

2- You can use the restatable environment provided by thmtools.

1- Since the environment generates an anchor, you can use the standard \label, \ref (\pageref) mechanism for cross-referencing.

A complete example:

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

\declaretheorem{theorem}

\begin{document}

\section{Test Section}
\begin{theorem}
Test theorem
\end{theorem}

\begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}
\label{thm:FTA}
Every non-constant single-variable polynomial with complex coefficients has at least one complex root. 
\end{restatable}

\appendix
\section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA} (See page~\pageref{thm:FTA})}
\fta*
\begin{proof}
Assume...
\end{proof}

\end{document}

enter image description here

Now that the question has been edited, and the used document class is known, here's a solution using the vldb document class (the link to the class can be found in the question):

\documentclass{vldb}
\usepackage{textcase}
\usepackage{thmtools,thm-restate}
\usepackage{hyperref}

\makeatletter
\def\@sect#1#2#3#4#5#6[#7]#8{%
    \ifnum #2>\c@secnumdepth
        \let\@svsec\@empty
    \else
        \refstepcounter{#1}%
        \edef\@svsec{%
            \begingroup
                %\ifnum#2>2 \noexpand\rm \fi % changed to next 29 July 2002 gkmt
                        \ifnum#2>2 \noexpand#6 \fi
                \csname the#1\endcsname
            \endgroup
            \ifnum #2=1\relax .\fi
            \hskip 1em
        }%
    \fi
    \@tempskipa #5\relax
    \ifdim \@tempskipa>\z@
        \begingroup
            #6\relax
            \@hangfrom{\hskip #3\relax\@svsec}%
            \begingroup
                \interlinepenalty \@M
                \if@uchead
                    \MakeTextUppercase{#8}% HERE
                \else
                    #8%
                \fi
                \par
            \endgroup
        \endgroup
        \csname #1mark\endcsname{#7}%
        \vskip -12pt  %gkmt, 11 aug 99 and GM July 2000 (was -14) - numbered section head spacing
\addcontentsline{toc}{#1}{%
            \ifnum #2>\c@secnumdepth \else
                \protect\numberline{\csname the#1\endcsname}%
            \fi
            #7%
        }%
    \else
        \def\@svsechd{%
            #6%
            \hskip #3\relax
            \@svsec
            \if@uchead
                \uppercase{#8}%
            \else
                #8%
            \fi
            \csname #1mark\endcsname{#7}%
            \addcontentsline{toc}{#1}{%
                \ifnum #2>\c@secnumdepth \else
                    \protect\numberline{\csname the#1\endcsname}%
                \fi
                #7%
            }%
        }%
    \fi
    \@xsect{#5}\hskip 1pt
    \par
}
\makeatother

\declaretheorem{theorem}

\begin{document}

\section{Test Section}
\begin{theorem}
Test theorem
\end{theorem}

\begin{restatable}[Fundamental Theorem of Algebra]{theorem}{fta}
\label{thm:FTA}
Every non-constant single-variable polynomial with complex coefficients has at least one complex root. 
\end{restatable}

\appendix
\section[Proof of the Fundamental Theorem of Algebra]{Proof of Theorem~\ref{thm:FTA}}
\fta*
\begin{proof}
Assume...
\end{proof}

\end{document}

enter image description here

Explanation:

The problem is that vldb.cls sets the section (and also part) titles in upper case and uses the old TeX \uppercase command to this end; this will produce problems if special commands, such as \ref, are inside the argument of \section (or \part) since \uppercase don't recognize them as special commands and tretas them in the wrong way (the LaTeX command \MakeUppercase will also behave bad in this regard). To correct this situation, one can redefine (or patch) the internal command \@sect, to use \MakeTextUppercase (from the textcase package), instead of the problematic \uppercase command. In the example code above, the change was signaled with % HERE.