[Tex/LaTex] Numbering assumptions in amsthm by hand and referencing them

cross-referencingnumberingtheorems

I have a situation where there are two alternative assumptions that can hold in order for some estimate to be correct. I would like to number them 2.a and 2.b and refer to them in the text (an assumption 1 already exists). So far I do the following, which gives assumption numbers 2 and 3:

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\theoremstyle{plain}
\newtheorem{assumption}{Assumption}

\begin{document}

\begin{assumption}[Comparability]\label{as:comparability} Individuals with the same $x_{it}$ vector are \textit{comparable} over time.\end{assumption}

\begin{assumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiff} Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.\end{assumption}

What Assumption \ref{as:comparabilityDiff} implies economically can best be explained using an example…

Is there a way to do this in with the amsthm package? I have seen this post (link), but don’t know how to reference the theorem in this case.

Best Answer

Something like this? Not the best solution, I assume, I'll try to improve it later on.

\documentclass[11pt,a4paper]{article}
\usepackage{amsmath,amsfonts,amssymb,amsthm}

\usepackage{chngcntr}



\theoremstyle{plain}
\newtheorem{assumption}{Assumption}

\let\origtheassumption\theassumption

\begin{document}

\begin{assumption}[Comparability]\label{as:comparability} Individuals with the same $x_{it}$ vector are \textit{comparable} over time.\end{assumption}

\edef\oldassumption{\the\numexpr\value{assumption}+1}

\setcounter{assumption}{0}
\renewcommand{\theassumption}{\oldassumption.\alph{assumption}}
\begin{assumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiff} 
  Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.
\end{assumption}

\begin{assumption}[Comparability in differences; replacing Assumption \ref{as:comparability}]\label{as:comparabilityDiffother} 
  Differences between individuals $i$ and $j$ with the vectors $x_{it}$ and $x_{jt}$ are \textit{comparable} over time.
\end{assumption}

\let\theassumption\origtheassumption

What Assumption \ref{as:comparabilityDiff} implies economically can best be explained using an example… and \ref{as:comparabilityDiffother}

\begin{assumption}{Foo}
bar
\end{assumption}

\end{document}

enter image description here

Related Question