Patrick B. answered 12/05/20
Math and computer tutor/teacher
The following trivial sub-theorem is needed, which is
proved by contradiction:
For two integers x and y, if xy=1 then x=y=1 or x=y=-1.
Proof:
then y = 1/x for x neither 1 nor -1 nor zero
then y is a proper fraction, a contradiction
===================================================
Main theorem: integers a and b such that a|b and b|a;
then a=b or a=-b
Note that neither a nor b can be zero, since they are divisors!
since a|b, a = nb for some integer n.
since b|a, b = ma for some integer m.
Then
a = nb = n(ma) = (nm)a <-- substitution/associative
so a = (nm)a by transitive/substitution
1 = nm <--- divides by non zero a
since n and m are integers, n=m=1 or n=m=-1
by supporting theorem.
then a = bm = b(1) = b or a=bm = b(-1) = -b
[end of proof]