# Thread: Prove that if a|b and b|a, then a=b or a=-b

1. ## Prove that if a|b and b|a, then a=b or a=-b

Course: Foundations of Higher Math

This is in the chapter titled, "More on Direct Proof and Proof by Contrapositive"

Let $a,b\in Z$, where $a\neq 0$ and $b\neq 0$. Prove that if $a|b$ and $b|a$ , then $a=b$ or $a=-b$

Proof by contrapositive seems too difficult, so I'm trying a direct proof.

Assume that $a|b$ and $b|a$, i.e. $b=ax$ and $a=by$, for some $x,y\in Z$

Then,

$a=b \Rightarrow by=ax \Rightarrow (ax)y=(by)x \Rightarrow a(xy)=b(yx)$. Then divide both sides by (xy), so $a=b$

Is this sufficient?

2. ## Re: Prove that if a|b and b|a, then a=b or a=-b

Again, you are starting with the conclusion when you write $a = b \Rightarrow \cdots$. Starting with the conclusion is circular. When you arrive back at the same conclusion, it is based on the fact that you assumed it to start with.

You were correct to assume $a|b$ and $b|a$. So begin with the equalities you have from those assumptions.

$b = ax, a = by$

Start with one of them: $b = ax \Rightarrow b = (by)x$ By cancellation, $1 = xy$. The only integers whose product is 1 are $x=y=1$ or $x=y=-1$. So, $a = b(1)$ or $a = b(-1)$.

3. ## Re: Prove that if a|b and b|a, then a=b or a=-b

Ok. Take a look at this:

$b = ax \Rightarrow b = (by)x \Rightarrow b=b(xy) \Rightarrow b - b(xy) = 0$ The only way that $b-b(xy)=0$ is when $xy = 1$. The only way that $xy =1$ is if $x=y=1$, as you said. So $a=b(1)$

I can't work it out get $a=b(-1)$ though.

4. ## Re: Prove that if a|b and b|a, then a=b or a=-b

There are two ways for a product of two integers to be 1. Either $x=y=1$ OR $x=y=-1$. Your professor may ask you to prove that those are the only possibilities, which is simple. Just show that if x and y have opposite signs, then their product is negative. Hence, the have the same sign. Suppose they are both positive and $x>1$ then $xy \ge x>1$. Next, suppose they are both negative and $x<-1$ then $xy \ge x(-1) = -x > 1$.