Environment proof Undefined (Missing amsthm)
! LaTeX Error: Environment proof undefined.
What this error means
The proof, theorem, lemma, corollary, and definition environments are provided by the amsthm package. Without loading it, LaTeX has no definition for these environments.
FormaTeX smart compile
FormaTeX smart compile detects proof, theorem, lemma, corollary, and definition environments and automatically adds \usepackage{amsthm} to the preamble.
Common causes
- \usepackage{amsthm} missing from the preamble
- Using \begin{proof}, \begin{theorem}, or \begin{lemma} without amsthm
- Expecting theorem environments to be defined automatically without amsthm
How to fix it
Add \usepackage{amsthm} to your preamble. You also need to declare theorem-style environments with \newtheorem before using them. The proof environment is predefined by amsthm.
Code examples
\documentclass{article}
% Missing \usepackage{amsthm}
\begin{document}
\begin{proof}
This is the proof.
\end{proof}
\end{document}\documentclass{article}
\usepackage{amsthm}
\newtheorem{theorem}{Theorem}
\begin{document}
\begin{theorem}
Statement of the theorem.
\end{theorem}
\begin{proof}
This is the proof.
\end{proof}
\end{document}Related errors
Test the fix live
Paste your LaTeX into the playground and compile instantly.

