This question is related to the question at Recalling a theorem, which uses the thmtools and thm-restate packages and the restatable environment to define a theorem that can be re-stated later on.
Is it possible to refer to something that is defined later on? In an earlier chapter, I have some discussion that is referring to a definition that is defined properly in a later chapter, but I can't reuse the definition before it is defined...
For example, when I do the following
\documentclass{article}
\usepackage{thmtools}
\usepackage{thm-restate}
\declaretheorem[name=Theorem,numberwithin=section]{thm}
\begin{document}
\section{First}
\goldbach*
\begin{restatable}[Goldbach's conjecture]{thm}{goldbach}
\label{thm:goldbach}
Every even integer greater than 2 can be expressed as the sum of two primes.
\end{restatable}
\end{document}
I get an error -
undefined control sequence \goldbach
Is there any way to export these definitions so that they can be referred to before they are actually defined...?

\includeto compile small pieces of your (large) document. If the definition of\goldbachlies under one usage ofincludebut you reference the theorem, i.e use\goldbachunder a different\include. This works against the idea of\include, forcing you to compile the separate\include's simultaneously. Of course, I don't know what would be a reasonable solution to this conundrum. Just leaving a comment highlighting a potential caveat. – Linear Christmas Jan 04 '23 at 13:49\include. But how useful is\includenowadays? – egreg Jan 04 '23 at 17:22\includeis quite useful. :) Compiling 100+ page documents with many packages takes about 1 to 2.5 minutes. Broken into three parts, for instance, around 20 s. – Linear Christmas Jan 05 '23 at 23:26