Marking the end of a definition

The amsthm isn't the best on its own; however, thmtools provides a really neat 'front-end' for amsthm and other theorem packages.

In particular, thmtools includes a prefoothook and postfoothook which can be used for your need. Below is a small use case of thmtools in conjunction with amsthm which finishes examples with a simple horizontal line. You can easily adapt this to your need. For example, you could combine this with the tcolorbox for really fancy boxes, or you could flush right the text "End of Example".

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
  headfont=\normalfont\scshape,
  numbered=unless unique,
  bodyfont=\normalfont,
  spaceabove=1em plus 0.75em minus 0.25em,
  prefoothook=\newline\rule{\linewidth}{1pt},
  spacebelow=1em plus 0.75em minus 0.25em,
]{exmpstyle}

\declaretheorem[
  style=exmpstyle,
  title=Example,
  refname={example,examples},
  Refname={Example,Examples}
]{exmp}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pustibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum uris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, nec vehicula augue eu
neque. Pellentesque habitant morbi tristique t netus et malesuada fames ac
turpis egestas. Mauris ut leo.
\begin{exmp}
  \lipsum*[1]
\end{exmp}
\lipsum[2-3]
\begin{exmp}
  \lipsum*[4]
\end{exmp}
\end{document}

and the output:

output

Addendum

As mentioned by Caramdir and requested by Barbara Beeton in the comments, here is an example that works with equations and uses the qed option:

\documentclass{article}
\usepackage{amsmath}
\usepackage{amsthm}
\usepackage{thmtools}
\usepackage{lipsum}

\declaretheoremstyle[
  headfont=\normalfont\bfseries\itshape,
  numbered=unless unique,
  bodyfont=\normalfont,
  spaceabove=1em plus 0.75em minus 0.25em,
  spacebelow=1em plus 0.75em minus 0.25em,
  qed={\itshape That's All Folks!},
]{exmpstyle2}

\declaretheorem[
  style=exmpstyle2,
  title=Example,
  refname={example,examples},
  Refname={Example,Examples}
]{exmp2}

\begin{document}
Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Ut pustibulum ut,
placerat ac, adipiscing vitae, felis. Curabitur dictum uris. Nam arcu libero,
nonummy eget, consectetuer id, vulputate a, nec vehicula augue eu
neque. Pellentesque habitant morbi tristique t netus et malesuada fames ac
turpis egestas. Mauris ut leo.
\begin{exmp2}
  \lipsum*[1]
\end{exmp2}
\lipsum[2-3]
\begin{exmp2}
  \lipsum*[4]
  \begin{equation*}
    \mathcal{L} = \overline \psi (i \gamma \cdot \partial - m) \psi
    \qedhere
  \end{equation*}
\end{exmp2}
\end{document}

which produces:

output2


I really can't see the need for it. But since you're asking,

\documentclass{article}
\usepackage{amsthm}

\usepackage{lipsum}

\theoremstyle{definition}
\newtheorem{defi/}{Definition}

\newenvironment{defi}
  {\renewcommand{\qedsymbol}{$\heartsuit$}%
   \pushQED{\qed}\begin{defi/}}
  {\popQED\end{defi/}}

\begin{document}

\lipsum[2]

\begin{defi}
This is the definition of \emph{definition}.
\end{defi}

\lipsum[3]

\begin{defi}
This is the definition of recursion,
\[
x\gets x+1 \qedhere
\]
\end{defi}

\lipsum[2]

\end{document}

enter image description here

I just assume you don't have proofs in the middle of definitions.


You can define another environment (eg. myproof) to use another QED symbol. In the example below, the new QED symbol \myqed is a vertical bar.

\documentclass{report}
\usepackage{amsthm}
\usepackage{lipsum}

\newcommand{\myqed}{\rule{2pt}{1em}}
\newenvironment{myproof}{\begin{proof}}{\let\qedsymbol\myqed\end{proof}}

\begin{document}    
\begin{proof}
\lipsum*[1]
\end{proof}

\begin{myproof}
\lipsum*[2]
\end{myproof}

\begin{proof}
\lipsum*[3]
\end{proof}

\end{document}

enter image description here