I want to have an appendix with a theorem's proof. The theorem appears in the main body of the document, and I would like to have it replicated in the appendix as well for convenience.
If I simply copy the original theorem environment, it is rendered in the appendix with a new number. I would like to use the same original number through \ref. What is the cleanest way to accomplish this?
Bonus points: it would be even better to somehow manage an entire copy of the theorem without actually repeating the source code for it, but referencing the first occurrence. This way, if I decide to change details in the theorem, they would be automatically reflected in the appendix's copy. Is there a clean way to do this?