Subnumber equations within theorem environments but keep them intact otherwise

I want to number my equations in a manner similar to this. However, what I want is that when the equation is not within a theorem environment, there should be normal numbering 1,2,3,4. However, each equation within the theorem environment should be subnumbered. For example, in the code like below:

$$\lim x = 0 % Suppose this equation is numbered 55 \lim x = 0 % Then this equation should be numbered 56$$

\begin{theorem}
$$\lim x = 1 %This equation should be numbered 57.1$$

$$\lim x = 1 %This equation should be numbered 57.2 \lim x = 1 %This equation should be numbered 57.3$$
\begin{theorem}

$$\lim x = 1 %This equation should be numbered 58$$


Is such a thing possible? If it helps, I am using the following declaration in my package.

\usepackage[amsthm, framed, thmmarks]{ntheorem}


EDIT: I want to change my question a little bit. Is it possible to define a discontinuous environment so that I can subnumber my equations within that environment? For example, I already know that I can use environments like align with conditions so that the equations are subnumbered within that environment, but then, it is a consecutive sets of equations which are subnumbered, I am looking for something which would enable me to separate the environment while still maintaining the numbering.

This is useful when I am discussing equations both inside and outside of a theorem environment. Sometimes a proof of the theorem is very long and there are a lot of substitutions, and a lot of equations are numbered, however, the numbering then takes the focus away from the nested-property of the equation making the equation numbers hard to follow. For example, you are more likely to remember equations 4.1 4.2 inside a theorem rather than equations 117 and 118 since you are in that proof reading mode and hence, you can more easily remember the first equation in that proof or ninth equation in that proof.

So probably something like \startsubnumbering,\endsubnumbering commands which I can then insert at the beginning of whatever I see fit.

-
What if a theorem contains only one equation to be numbered? – egreg Oct 10 '12 at 12:18
@egreg Hmm. Yup, I am not decided if this is a good idea or not, as of now. I might be able to do with just $57.1$. I wanted to know if it is possible in a nice manner that is, without doing too much of low level programming. – Jayesh Badwaik Oct 10 '12 at 12:21

You can do it with some work and the help of etoolbox.

\documentclass{article}
\usepackage{amsmath}
\usepackage[amsmath,amsthm,framed,thmmarks]{ntheorem}

\newtheorem{theorem}{Theorem}

\usepackage{etoolbox}

% First of all we want to change how subequations numbers equations
\patchcmd{\subequations}{\alph{equation}}{.\arabic{equation}}{}{}

% Now we patch the theorem-like environments where we want subnumbering
\newtheorem{theorem}{Theorem}
\AtBeginEnvironment{theorem}{\subequations}
\AtEndEnvironment{theorem}{\endsubequations}
% add similar lines for the other theorems you need

\begin{document}
\setcounter{equation}{54} % not to start from 1, only by way of example

Here are two equations
\begin{gather}
\lim x = 0 \label{A} % Suppose this equation is numbered 55
\\
\lim x = 0 \label{B} % Then this equation should be numbered 56
\end{gather}

\begin{theorem}
Here is a theorem, which states an equation
$$\lim x = 1 \label{C} %This equation should be numbered 57.1$$
and then two other equations
\begin{gather}
\lim x = 1 \label{D} %This equation should be numbered 57.2
\\
\lim x = 1 \label{E} %This equation should be numbered 57.3
\end{gather}
So this finishes the theorem.
\end{theorem}

Now another equation.
$$\lim x = 1 \label{F} %This equation should be numbered 58$$
and that's all, folks. But let's cite all equations we wrote: \eqref{A}, \eqref{B},
\eqref{C}, \eqref{D}, \eqref{E}, and \eqref{F}.
\end{document}


Personally, I don't find this a good idea.

-
Thank You. Your application uses patchcmd and then I can patch any environment I want, so it is nice. Also, you might look at the second paragraph of my edit, if you want to understand my motivation for doing so, and if you think there might be a better way to do what I am doing, I would be thankful to know it. Thank you again. – Jayesh Badwaik Oct 10 '12 at 12:46