Let $R$ be a principal ideal domain. Let $a$ and $b$ be two elements of $R$. Let $g$ be a greatest common divisor of $a$ and $b$, and let $\ell$ be a least common multiple of $a$ and $b$. (Of course, each of $g$ and $\ell$ is unique up to associates.)
Using prime factorization and the Chinese Remainder Theorem, it is not hard to see that
\begin{align} \left(R/a\right) \times \left(R/b\right) \cong \left(R/g\right) \times \left(R/\ell\right) \qquad \text{ as $R$-algebras} \label{eq.darij1.1} \tag{1} \end{align}
(where $R/r$ is shorthand for the quotient algebra $R/\left(rR\right)$ whenever $r\in R$).
If $g = 1$ (so that $a$ and $b$ are coprime), this is an instance of the well-known isomorphism $\left(R/a\right) \times \left(R/b\right) \cong R/\left(ab\right)$ that follows from the Chinese Remainder Theorem. This latter isomorphism can be described explicitly, as soon as we know two elements $x,y\in R$ satisfying $xa+yb=1$; indeed, it sends each pair $\left(\overline{u}, \overline{v}\right)$ to $\overline{ybu+xav}$, and its inverse sends each $\overline{r}$ to the pair $\left(\overline{r},\overline{r}\right)$.
I'm struggling to find a similarly explicit description of the isomorphism \eqref{eq.darij1.1}, even assuming that $x,y,p,q\in R$ are given such that $g = xa+yb$ and $a = pg$ and $b = qg$ and $\ell = pqg$. In fact, I think this kind of data is not enough, because if it was, then we could probably replace the requirement that $R$ is a PID by the weaker requirement that $Ra+Rb$ is a principal ideal, but that weaker requirement is insufficient for the isomorphism \eqref{eq.darij1.1} to exist (e.g., let $R = \mathbb{Z}\left[x\right]$, $a = 2x$, $b = 3x$, $g = x$ and $\ell = 6x$).
However, I can imagine various constructions that could work around this hurdle (e.g., taking further gcds). So I'm wondering:
Question. What is the most general (not-too-artificial) setting in which the isomorphism \eqref{eq.darij1.1} exists? What is the most natural way to construct it?
Note that if we lower our sights and ask for an $R$-module isomorphism $\left(R/a\right) \times \left(R/b\right) \cong \left(R/g\right) \times \left(R/\ell\right)$, then we can easily find an explicit isomorphism using matrix algebra. Namely, picking $x,y,p,q\in R$ such that $g = xa+yb$ and $a = pg$ and $b = qg$ and $\ell = pqg$, we have the matrix transformation \begin{align*} \begin{pmatrix} a & 0 \\ 0 & b \end{pmatrix} & \overset{C}{\to} \begin{pmatrix} a & xa \\ 0 & b \end{pmatrix} \overset{R}{\to} \begin{pmatrix} a & xa+yb \\ 0 & b \end{pmatrix} = \begin{pmatrix} pg & g \\ 0 & qg \end{pmatrix} \overset{C}{\to} \begin{pmatrix} 0 & g \\ -pqg & qg \end{pmatrix} \\ & \overset{R}{\to} \begin{pmatrix} 0 & g \\ -pqg & 0 \end{pmatrix} \overset{R}{\to} \begin{pmatrix} -pqg & 0 \\ 0 & g \end{pmatrix} \overset{C}{\to} \begin{pmatrix} pqg & 0 \\ 0 & g \end{pmatrix} = \begin{pmatrix} \ell & 0 \\ 0 & g \end{pmatrix} \end{align*} (where $\overset{R}{\to}$ means an elementary row transformation, and $\overset{C}{\to}$ means an elementary column transformation), and therefore we conclude that $\left(R/a\right) \times \left(R/b\right) \cong \left(R/g\right) \times \left(R/\ell\right)$ as $R$-modules because congruent matrices have isomorphic cokernels. But I don't believe that this isomorphism will respect multiplication.
I have a hunch that Dedekind domains might have a role to play here.
R/\gcd(a, b)
, distracting. I didn't edit out in case you wanted it, but, if it bothers you too, then you can suppress it with braces: $R/{\gcd(a, b)}$R/{\gcd(a, b)}
. $\endgroup$