TITLE: Prove that $(n\mid m$ and $m\mid n) \iff (n=m)$
QUESTION [1 upvotes]: Prove that $(n\mid m\text{ and }m\mid n) \iff (n=m)$.
$\rightarrow$
$n\mid m$ and $m\mid n \rightarrow m=an$ and $n=bm \rightarrow a \geq 1$ and $b \geq 1 \rightarrow m=n$.
$\leftarrow$
How do I do this direction?

REPLY [1 votes]: If $m = n$, since $m = 1 \cdot n$, $n \; | \; m$.  By symmetry, $m \; |\; n$ also.

REPLY [1 votes]: The theorem
$$
( n | m \land m | n ) \iff n = m
$$
isn't actually true. It would be true if the right hand expression was replaced with $n = \pm m$.
If $n=km$, $m=jn$, then $n = kjn \implies 1=kj$.
Because $k,j \in \mathbb{Z}$, this can only be true if either $k = j = 1$ or $k = j = -1$.
Nonetheless, the opposite implication holds:
If $n=m$, then
$$
n = m \cdot 1 \implies m|n \\
m = n \cdot 1 \implies n|m
$$
And amending the theorem with what I stated above we would also need to show the following:
If $n=-m$, then
$$
n = m \cdot -1 \implies m|n \\
m = n \cdot -1 \implies n|m
$$

REPLY [0 votes]: More generally $a\mid b\implies b=ak$ so that $|b|=|k||a|\geqslant |a|$. Thus $a\mid b$ and $b\mid a$ imply $|a|=|b|$.
{"set_name": "stack_exchange", "score": 1, "question_id": 804739}