Division Algorithm
Theorem 1. (Division Algorithm) Let a,b∈Z, with b≠0. Then !∃q,r∈Z such that a=qb+r(0≤r<|b|).
임의의 정수를 나누었을 때 그 표현의 유일성을 보장해주는 정리이다. 또한 나머지의 범위가 제한되어있는데, 정수라는 점을 고려할 때 임의의 모든 정수는 나머지가 0,1,...,|b|−1인 경우들로 각각 나눠서 모두 표현할 수 있다.
Proof. Let b>0, and let S:={a−xb≥0|x∈Z}. Since b≥1, 0≤a+|a|≤a+|a|b= a−(−|a|)b. Thus S≠∅.
By Well-Ordering Principle, there is the least element r∈S. Then ∃q∈Z such that r=a−qb. Suppose that r≥b. Then 0≤r−b=r−(q+1)b∈S, but r−(q+1)b≤r⨂. Thus 0≤r<b=|b|.
Let b<0. Then ∃q′,r∈Z such that a=q′|b|+r(0≤r<|b|). Noting that |b|=−b, we may take q=−q′. Then we have a=qb+r(0≤r<|b|).
Assume that a has two representations of the form, say, a=qb+r=q′b+r′, where 0≤r,r′<|b|. Then r−r′=(q′−q)b⟹|r−r′|=|q′−q||b|.
Since −|b|<r′≤0≤r<|b|, |r−r′|<|b|. Then |r−r′|=|q′−q||b|<|b|⟹0≤|q′−q|<1⟹|q′−q|=0⟺q=q′⟹r=r′. Thus the representation of a is unique. ◼