\documentclass{article} \usepackage{amsfonts, amsthm} \usepackage{hyperref} \newtheorem{theorem}{Theorem} \newtheorem{custominner}{Theorem} \newenvironment{custom}[1]{% \renewcommand\thecustominner{#1}% \custominner }{\endcustominner} \begin{document} \begin{theorem}[Lemma 0A] Assume that $\langle x_1, \ldots, x_m \rangle = \langle y_1, \ldots, y_m, \ldots, y_{m+k} \rangle$. Then $x_1 = \langle y_1, \ldots, y_{k+1} \rangle$. \end{theorem} \begin{proof} \href{Chapter0.lean}{Enderton.Chapter0.lemma\_0a} \end{proof} \end{document}