[Tex/LaTex] line numbering within proof

#enumerateline-numbering

I'm trying to enumerate the lines within my proof, based on the section that I'm working in. For instance I would like something that:

Thereom 2.2 My theorem

Proof: Statement

(2.11) equation for my proof

(2.12) equation for my proof (continued)

                                                                              Q.E.D

Where the 2 is the section number and the numbers after the dot are the line numbers.

Best Answer

A simple method is to locally redefine the labels for the enumerate environment.

\documentclass{article}
\begin{document}
\section{a section}
\begin{enumerate}
\renewcommand\labelenumi{(\arabic{section}.\arabic{enumi})}
\item a line
\item another line
\end{enumerate}
\end{document}

To avoid repeatedly making the redefinition, you can use a new environment.

\documentclass{article}
\newenvironment{proofenum}{%                                     
\begin{enumerate}
\renewcommand\labelenumi{(\arabic{section}.\arabic{enumi})}}
{\end{enumerate}}
\begin{document}
\section{a section}
\begin{proofenum}
\item a line
\item another line
\end{proofenum}
\end{document}