FormaTeX
FatalMath Mode

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

Causes the error
\documentclass{article}
% Missing \usepackage{amsthm}
\begin{document}

\begin{proof}
  This is the proof.
\end{proof}

\end{document}
Fixed
\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.

Una cosa rápida

Registramos el uso anónimo — visitas a páginas, uso de funciones, eventos de compilación — para entender qué funciona y qué no. Sin publicidad, sin datos personales, sin compartir con terceros.

Política de cookies