[Tex/LaTex] Problem with proof environment

proof-package

I've written a proof in LaTeX, and I looked up how to use the proof environment. From what I read, it should start with "Proof:" and end with \qed, but the PDF shows no changes. It simply displays the text verbatim. What could be the cause of this? My code is as follows:

\documentclass[12pt]{report}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{float}
\usepackage{framed}
\usepackage[hang,flushmargin]{footmisc}

\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}{Definition}[section]

\begin{document} 
\begin{proof}
    \noindent Assume that $R$ decides $HALT_{TM}$, and obtain a contradiction. Construct $S$ to decide $A_{TM}$, where $S$ operates as follows: \newline \newline 
    $S=$ ``On input $\langle M, w \rangle$, an encoding of a TM $M$ and a string $w$:
    \begin{enumerate}
    \item Run TM $r$ on input $\langle M, w \rangle$.
    \item If $R$ rejects, reject
    \item If $R$ accepts, accept
    \item If $M$ has accepted, accept; if $M$ has rejected, reject."
    \end{enumerate}

    \noindent \newline If $R$ decides $HALT_{TM}$, then $S$ decides $A_{TM}$. Because $A_{TM}$ is undecidable, $HALT_{TM}$ must also be undecidable. 
    \end{proof}
\end{document}

Best Answer

enter image description here

The proof environment is not defined so you get the error

! LaTeX Error: Environment proof undefined.

a common way to define it is to load amsthm when you get a proof heading and qed box at the end.

\documentclass[12pt]{report}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{float}
\usepackage{framed}
\usepackage[hang,flushmargin]{footmisc}

\usepackage{amsthm}
\newtheorem{theorem}{Theorem}[section]
\newtheorem{corollary}{Corollary}[theorem]
\newtheorem{lemma}[theorem]{Lemma}
\newtheorem{definition}{Definition}[section]

\begin{document} 
\begin{proof}
    Assume that $R$ decides $\mathrm{HALT}_{\mathrm{TM}}$, and obtain a contradiction. Construct $S$ to decide $A_{\mathrm{TM}}$, where $S$ operates as follows: 

    $S={}$ ``On input $\langle M, w \rangle$, an encoding of a TM $M$ and a string $w$:
    \begin{enumerate}
    \item Run TM $r$ on input $\langle M, w \rangle$.
    \item If $R$ rejects, reject
    \item If $R$ accepts, accept
    \item If $M$ has accepted, accept; if $M$ has rejected, reject."
    \end{enumerate}

     If $R$ decides $\mathrm{HALT}_{\mathrm{TM}}$, then $S$ decides $A_{\mathrm{TM}}$. Because $A_{\mathrm{TM}}$ is undecidable, $\mathrm{HALT}_{\mathrm{TM}}$ must also be undecidable. 
    \end{proof}
\end{document}
Related Question