[Tex/LaTex] How to obtain claim numbered within proof without changing the default look

amsmathamsthm

I have a problem that I could not solve, even after looking around for a while on the site.

Quite simply, I do like how the following MWE looks like in terms of spacing, but I would like to have the claims numbered within each proof starting from 1.

\documentclass{article}
\usepackage{amsmath}%
\usepackage{amsthm}%
\usepackage{amsfonts}%
\usepackage{amssymb}%

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}

\theoremstyle{remark}
\newtheorem{claim}{Claim}

\begin{document}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\end{document}

The problem is that all the solutions I found modified in some way the present spacing between the objects, which is the default look.

Is it possible to avoid such a situation?

Thank you for your time.

Best Answer

This may be what you want.

\usepackage{etoolbox}
\AtEndEnvironment{proof}{\setcounter{claim}{0}}

Here we reset the claim counter after each proof environment.

\documentclass{article}
\usepackage{amsmath}%
\usepackage{amsthm}%
\usepackage{amsfonts}%
\usepackage{amssymb}%

\theoremstyle{plain}
\newtheorem{theorem}{Theorem}

\theoremstyle{remark}
\newtheorem{claim}{Claim}
%\numberwithin{claim}{theorem} %% <-- This is another alternative if you like little difference.
\usepackage{etoolbox}
\AtEndEnvironment{proof}{\setcounter{claim}{0}}
\begin{document}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\begin{theorem}
Bla
\end{theorem}

\begin{proof} There are some claims.
\begin{claim}
Bla
\end{claim}
\begin{claim}
Bla bla
\end{claim}
\end{proof}

\end{document}

enter image description here