# Trouble setting up to prove unique factorization

1. Aug 16, 2014

### lants

This lemma the book states, I can't make sense of it.

Lemma: If a,b$\in$ $Z$ and b > 0, there exist q,r $\in$ $Z$ such that a = qb + r with 0 $\leq$ r < b.

Proof: Consider the set of all integers of the form a-xb with x $\in$ $Z$. This set includes positive elements. Let r = a - qb be the least nonnegative element in this set. We claim that 0$\leq$ r < b. If not, r = a - qb $\geq$ b and so 0$\leq$ a-(q+1)b<r, which contradicts the minimality of r.

Can someone help explain this to me? Why can't a = 3, and b = 8. Then no q,r could exist so that r is less than b, right?

2. Aug 16, 2014

### lants

Is this considered a textbook style question? Sorry, how can I move it? I just saw number theory and posted

3. Aug 16, 2014

### Terandol

What is wrong with $a=3$ and $b=8$? Here you simply take $q=0$ and $r=3$ (there is no condition that says either q or r have to be nonzero) to get $3=(0)(8) +3$ and $0\leq 3< 8$ as required.

4. Aug 16, 2014

### lants

Wow I'm quitting now

thanks