[Tex/LaTex] QED symbol after statements without proof

amsthmnewtheorem

I use the amsbook document class and I would like to show \qed symbols at the end of statements without proofs (using the theorem environment, such as theorem, proposition, lemma, …) to indicate that these are known but I do not present a proof.

Is there a simple (or even predefined way) of doing so, such as using

\begin{mytheorem}{\qed}
...
\end{mytheorem}

for any theorem environment mytheorem without doing

\newtheorem{mytheorem}[theorem]{Theorem}
\newtheorem{mytheoremqed}[theorem]{Theorem}
\AtEndEnvironment{mytheoremqed}{\null\hfill\qedsymbol}
... % repeat for proposition, lemma, corollary, ...

for every theorem environment I have (this solution was described in \qed for theorems without proofs) ?

Preferrably, also both versions

\begin{mytheorem}[{\cite{myref}}]

and

\begin{mytheorem}{\qed}[{\cite{myref}}]

should work.

Best Answer

First let me show an example where \null\hfill\qedsymbol doesn't do the right thing. Note that adding \null\hfill\qedsymbol explicitly is the same as doing it with \AtEndEnvironment, with the only difference that the indirect method does not take care of a possible space before \null, making things worse.

\documentclass{amsbook}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

\begin{theorem}
Some long theorem statement,
long long long long long
long long long long long
long long long long long
long long long long
enough to show bad effect.\null\hfill\qedsymbol
\end{theorem}

\end{document}

enter image description here

You have several better choices for this. The simpler, in my opinion, is to append \qed at the end of statements you don't give a proof of.

\documentclass{amsbook}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}

\begin{document}

\begin{theorem}
Some long theorem statement,
long long long long long
long long long long long
long long long long long
long long long long
enough to show bad effect.\qed
\end{theorem}

\end{document}

Same text as before, but the tombstone ends up where desired.

enter image description here

A different approach would be to define a different environment, say a *-variant:

\documentclass{amsbook}
\usepackage{amsthm}

\newtheorem{theorem}{Theorem}
\newenvironment{theorem*}
 {\pushQED{\qed}\theorem}
 {\popQED\endtheorem}

\begin{document}

\begin{theorem*}
Some long theorem statement,
long long long long long
long long long long long
long long long long long
long long long long
enough to show bad effect.
\end{theorem*}

\end{document}

This has the disadvantage of requiring the * in both the \begin and \end part, but has some advantages: you don't need to change the input in case you decide for suppressing those tombstones; you can easily change the tombstone for these cases.

A third possibility could be defining theorem as an environment with a mandatory argument, like

\begin{theorem}{}
...<statement>...
\end{theorem}

when you don't want a tombstone and

\begin{theorem}{\qed}
...<statement>...
\end{theorem}

It could be arranged so as to support

\begin{theorem}
...<statement>...
\end{theorem}

\begin{theorem}\qed
...<statement>...
\end{theorem}

with the following trick:

\documentclass{amsbook}
\usepackage{amsthm}

\newif\ifstumpqed

\newtheorem{theoremInner}{Theorem}
\newenvironment{theorem}[1]
 {\ifx#1\qed\stumpqedtrue\pushQED{\qed}\fi\theoremInner}
 {\ifstumpqed\popQED\fi\endtheoremInner}

\begin{document}

\begin{theorem}
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\begin{theorem}\qed
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\begin{theorem}\qed\label{whatever}
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\begin{theorem}\qed[Whatever]\label{foo}
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\end{document}

If you have several of these declarations to manage, you can abstract the procedure:

\documentclass{amsbook}
\usepackage{amsthm}

\newcommand{\addqed}[1]{%
  \expandafter\let\csname #1Inner\expandafter\endcsname\csname #1\endcsname
  \expandafter\let\csname end#1Inner\expandafter\endcsname\csname end#1\endcsname
  \expandafter\def\csname #1\endcsname##1{%
    \ifx##1\qed\stumpqedtrue\pushQED{\qed}\fi\csname #1Inner\endcsname
  }%
  \expandafter\def\csname end#1\endcsname{%
    \ifstumpqed\popQED\fi\csname end#1Inner\endcsname
  }%
}
\newif\ifstumpqed

\newtheorem{theorem}{Theorem}[chapter]
\addqed{theorem}

\begin{document}

\begin{theorem}
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\begin{theorem}\qed
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\begin{theorem}\qed\label{whatever}
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\begin{theorem}\qed[Whatever]\label{foo}
Some long theorem statement, 
long long long long long
long long long long long
long long long long long
long long long long 
enough to show bad effect.
\end{theorem}

\end{document}

So, after a \newtheorem declaration with the usual methods, add

\addqed{<env name>}

and you're done.