[Tex/LaTex] ntheorem: numbering of claim and its proof

ntheoremtheorems

I am trying to create a claim environment in ntheorem to use within the proof environment.
I tried around with the following code

\documentclass{article}


\usepackage{ntheorem}

\newtheorem{theorem}{Theorem}
\newtheorem{lemma}{Lemma}

\theoremheaderfont{\normalfont\itshape}
\newtheorem{claim}{Claim}
\theoremsymbol{\ensuremath{\blacksquare}} % \theoremsymbol{\ensuremath{_\square}}
\newtheorem{claimproof}{Proof of Claim}[claim]

\theoremstyle{nonumberplain}
\newtheorem{proof}{Proof}


\begin{document}
\begin{theorem}
asdjas aasdj adj 
\end{theorem}
\begin{proof}
\begin{claim}
some claim
\end{claim}
\begin{claimproof}
asdasd asdasd
\end{claimproof}

\begin{claim} some other claim \end{claim}
\begin{claimproof}proof of claim\end{claimproof}
\end{proof}

\begin{lemma}
some lemma
\end{lemma}
\begin{proof}
asdlasd
\begin{claim} claim for lemma\end{claim}
\begin{claimproof}
askl adlksd
\end{claimproof}
\begin{claim} asdljkd
\end{claim}
\begin{claimproof}
asd aspdok
\end{claimproof}
\end{proof}

\end{document}

which works somehow. But it gives this result:

Theorem 1
...
Proof
...
Claim 1
Proof of Claim 1.1
..

Claim 2
Proof of Claim 2.1

but I would like to get something like

Theorem 1
...
Proof
...
Claim 1
Proof of Claim 1
..

Claim 2
Proof of Claim 2

Even better would be to have a numbering as a subnumbering of the theorem or lemma that the proof refers to, but I guess that would make everything more complicated

Theorem 1
...
Proof
...
Claim 1.1
Proof of Claim 1.1
..

Claim 1.2
Proof of Claim 2.1

Lemma 3
Proof
Claim 3.1
Proof of Claim 3.1
...

Best Answer

It is important to understand the optional arguments to \newtheorem.

\newtheorem{claim}{Claim}

produces "Claims" numbered 1,2,3,... throughout the document. With a final optional argument

\newtheorem{claimproof}{Proof of claim}[claim]

produces numbers X.1,X.2,X.3,... where X is the number of the previous claim.

For correct numbering of your Claims you want something like

\newtheorem{claim}{Claim}[theorem]

so claims get subnumbers according to the previous theorem.

For your proof of claims, I think your request is misguided, but I'll show how do what you request in the second example below. In general one would like the freedom to take the proofs of claims in a different order to which they are presented; also a proof of a claim immediately after its statement does not really require labelling with the number; if the proof is further away or in a different order then it would be more appropriate to use LaTeX's \label/\ref mechanism to provide the correct numbering.

Here is an example:

Sample output

\documentclass{article}

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

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}

\newtheorem{claim}{Claim}[theorem]

\theoremstyle{nonumberplain}
\theoremsymbol{\ensuremath{\Box}}
\newtheorem{proof}{Proof}

\makeatletter
\newtheoremstyle{nonumberplainnobrackets}%
  {\item[\theorem@headerfont\hskip\labelsep ##1\theorem@separator]}%
  {\item[\theorem@headerfont\hskip \labelsep ##1\ ##3\theorem@separator]}
\makeatother

\theoremstyle{nonumberplainnobrackets}
\theoremsymbol{\ensuremath{\blacksquare}} 
\newtheorem{claimproof}{Proof of claim}
\begin{document}

\begin{lemma}
  A theorem.
\end{lemma}

\begin{proof}
  Proof starts.
  \begin{claim}
    A claim.
  \end{claim}
  \begin{claimproof}
    Proof of claim.
  \end{claimproof}
  Proof ends.
\end{proof}

\begin{theorem}
  A theorem.
\end{theorem}

\begin{proof}
  Proof starts.
  \begin{claim}
    A claim.
  \end{claim}
  \begin{claimproof}
    Proof of claim.
  \end{claimproof}
  Proof continues.
  \begin{claim}
    \label{claim:one}
    One claim.
  \end{claim}
  \begin{claim}
    \label{claim:another}
    Another claim.
  \end{claim}
  \begin{claimproof}[\ref{claim:another}]
    Proving another claim.
  \end{claimproof}
  Text.
  \begin{claimproof}[\ref{claim:one}]
    Proving claim one.
  \end{claimproof}
  Finally the end.
\end{proof}

\end{document}

Note I introduced a new theorem style to cope with the required typography of the number claims of proofs.

If you are really certain claimproofs will not come in a different order to the claims then you can set them up with

\theoremstyle{nonumberplain}
\theoremsymbol{\ensuremath{\blacksquare}} 
\newtheorem{claimproof}{Proof of claim \theclaim}

A full example is

Second sample

\documentclass{article}

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

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}
\newtheorem{lemma}[theorem]{Lemma}

\newtheorem{claim}{Claim}[theorem]

\theoremstyle{nonumberplain}
\theoremsymbol{\ensuremath{\Box}}
\newtheorem{proof}{Proof}

\theoremsymbol{\ensuremath{\blacksquare}} 
\newtheorem{claimproof}{Proof of claim \theclaim}

\begin{document}

\begin{lemma}
  A theorem.
\end{lemma}

\begin{proof}
  Proof starts.
  \begin{claim}
    A claim.
  \end{claim}
  \begin{claimproof}
    Proof of claim.
  \end{claimproof}
  Proof ends.
\end{proof}

\begin{theorem}
  A theorem.
\end{theorem}

\begin{proof}
  Proof starts.
  \begin{claim}
    A claim.
  \end{claim}
  \begin{claimproof}
    Proof of claim.
  \end{claimproof}
  Proof continues.
  \begin{claim}
    \label{claim:one}
    One claim.
  \end{claim}
  Text.
  \begin{claimproof}
    Proving claim one.
  \end{claimproof}
  Finally the end.
\end{proof}

\end{document}