# Counters for claims

I want to redefine the claim environment so that it will be numbered but I'm having a hard time with the counters.

I want the following:

\begin{theorem}
thm 1
\end{theorem}
\begin{proof}
\begin{claim}
blah 1
\end{claim}

\begin{claim}
blah 2
\end{claim}
\end{proof}

\begin{theorem}
thm 2
\end{theorem}
\begin{proof}
\begin{claim}
blah 3
\end{claim}
\end{proof}


to produce:

Theorem 1: thm 1
Claim 1.1: blah 1
Claim 1.2: blah 2

Theorem 2: thm 2
Claim 2.1: blah 3

-
First of all it is good practice to provide a full minimal example. Might be nice for example to see now claim was defined. –  daleif Feb 12 at 12:16
Isn't that what I did? My question concerns the counters. You can replace claim with proposition, example, etc.. –  Guy Feb 12 at 12:41
A MWE should be something that shows how you've already tried to implement the idea. It'll show the class you're using, the packages you're loading, and the commands and environments you've created. Of course, it's a minimal working example. So it should reflect only that which is necessary for the question as hand. –  A.Ellett Feb 12 at 12:47
Exactly, it should be something people can copy'n'paste to their favourite editor and try out without having to guess the preamble or add extra stuff. –  daleif Feb 13 at 13:23

Here's a MWE that shows how to do this.

\documentclass{article}
\usepackage{amsmath,amssymb,amsthm}
\newtheorem{thm}{Theorem}
\newcounter{claimcounter}
\numberwithin{claimcounter}{thm}
\newenvironment{claim}{\stepcounter{claimcounter}{Claim \theclaimcounter:}}{}
\begin{document}

\begin{thm}
Just testing.
\end{thm}
\begin{proof}
\begin{claim}
first
\end{claim}

\begin{claim}
second
\end{claim}

\begin{claim}
third
\end{claim}
\end{proof}

\begin{thm}
Just testing.
\end{thm}

\begin{thm}
Just testing.
\end{thm}

\begin{claim}
first
\end{claim}

\begin{claim}
second
\end{claim}

\begin{claim}
third
\end{claim}

\end{document}


The command \numberwithin allows the claims to be counted with respect to the theorem they are most closely associated with. \newenvironment allows you to create the environment for the claim---I haven't done much here other than issue out claim numbers.

-
\newcounter{claimcounter}[thm] avoids the need of \numberwithin –  egreg Feb 12 at 13:04
wasn't aware of that trick. Thanks. –  A.Ellett Feb 12 at 13:05