2

I would like to use ntheorem to produce theorems and proofs. I've got an end-of-proof symbol that works ok but, in the case of a trivial result, I'd like to place the symbol in the theorem itself. I've got something that works ok, except when the theorem ends with an equation.

I'm not 100% sure that I'm using the package correctly. The following is my attempt at a MWE:

\documentclass{article}
\usepackage{amssymb}
\usepackage[thmmarks]{ntheorem}

\newtheorem{thm}{Theorem} \theoremstyle{nonumberplain} \theorembodyfont{\normalfont} \theoremsymbol{\ensuremath\square} \newtheorem{proof}{Proof:}

\begin{document}

\begin{thm} Some theorems need a proof. \end{thm} \begin{proof} And the end of proof symbol works even with an equation such as [ P = NP. ] \end{proof}

\begin{thm} Some are trivial and don't need a proof. \hfill\proofSymbol \end{thm}

\begin{thm} But how do you place the symbol when the trivial result ends with an equation [ x^{2}-1 = (x-1)(x+1)? \hfill\proofSymbol ] \end{thm}

\end{document}

Output of this code

Any corrections to what I've done? And, most importantly, how do I place the end-of-proof symbol correcly in Theorem 3?

Martyn Quick
  • 549
  • 3
  • 13

1 Answers1

1

You can define a trivthm environment, which shares the counter of thm, and declare \theoremsymbol just before this environment:

\documentclass{article}
\usepackage{amssymb}
\usepackage[thmmarks]{ntheorem}

\newtheorem{thm}{Theorem}

\theoremsymbol{\ensuremath\square} \newtheorem{trivthm}[thm]{Theorem} \theoremstyle{nonumberplain} \theorembodyfont{\normalfont} \newtheorem{proof}{Proof:}

\begin{document}

\begin{thm} Some theorems need a proof. \end{thm} \begin{proof} And the end of proof symbol works even with an equation such as [ P = NP. ] \end{proof}

\begin{trivthm} Some are trivial and don't need a proof. \end{trivthm}

\begin{trivthm} But how do you place the symbol when the trivial result ends with an equation [ x^{2}-1 = (x-1)(x+1)? ] \end{trivthm}

\end{document}

enter image description here

Bernard
  • 271,350