Uniqueness of least common multiple up to associates

After being given the following definition of the least common multiple, $lcm$:

Let $R$ be a commutative ring with identity. Let $x,y\in R$. It is said that $m \in R$ is the least common multiplier of $x$ and $y$ if the following conditions are satisfied:

• $x | m$ and $y | m$

• If $x|m^{\prime}$ and $y|m^{\prime}$, then $m|m^{\prime}$

As is the case for the greatest common divisor in such a ring, I want to say that the $lcm$ is unique up to associates, meaning if $m$ and $m^{\prime}$ are both $lcm(x,y)$, then $m | m^{\prime}$ and $m^{\prime}|m$, and we write $m \sim m^{\prime}$.

To justify this, I give the following argument:

Suppose first that $m = lcm(x,y)$. Then this implies that $x|m$, $y|m$. If $m^{\prime}$ is any other multiple of $x$ and $y$ (including another alleged $lcm$), we also have that $x|m^{\prime}$, $y|m^{\prime}$. So, we must have that $m|m^{\prime}$.

Suppose instead that $m^{\prime} = lcm(x,y)$. Then this implies that $x|m^{\prime}$, $y|m^{\prime}$. If $m$ is any other multiple of $x$ and $y$ (including another alleged $lcm$), we also have that $x|m$, $y|m$. So, we must have that $m^{\prime}|m$.

Since both $m$ and $m^{\prime}$ are the $lcm(x,y)$, we must have that $m|m^{\prime}$ and $m^{\prime}|m$. Therefore, $m$ and $m^{\prime}$ are associates - i.e., $m \sim m^{\prime}$.

My question is whether my proof is correct and looks how it's generally supposed to look.

If not, how should I fix it?

Your overall plan is good, but I think the phrasing of

Suppose first that $m = lcm(x,y)$. ...

Suppose instead that $m^{\prime} = lcm(x,y)$. ....

is off. In both of these paragraph, you're actually assuming that both $m$ and $m'$ satisfy your definition, so you should make these two assumptions once and for all at the beginning of the proof.

And the notation $m = \mathit{lcm}(x,y)$ is not really fortunate when the concept is not the least common multiple, but a least common multiple. (Even in good old $\mathbb Z$ there will generally be two least common multiples, namely a positive one and its opposite).

So the beginning should be written something like

Suppose that $m$ and $m'$ are both least common multiples of $x$ and $y$.

Then, by definition, we have $x\mid m$, $y\mid m$, $x\mid m'$, $y\mid m'$.

Since $x\mid m'$ and $y\mid m'$ we have (again by definition) $m\mid m'$. . . .