Divisibility
Definition
For integers a and b, we say a divides b, written a∣b, if and only if there exists an integer k such that b=ak.
a∣b⟺∃k∈Z.b=ak
Terminology
- a is a divisor or factor of b
- b is a multiple of a
- If a∤b, then a does not divide b
Examples
- 3∣12 since 12=3⋅4
- −3∣12 since 12=(−3)⋅(−4)
- 5∤12 since no integer k satisfies 12=5k
- a∣0 for all a=0 since 0=a⋅0
Properties of Divisibility
Reflexivity
a∣afor all a∈Z
Transitivity
a∣b∧b∣c⇒a∣c
Proof: If b=ak and c=bℓ, then c=akℓ=a(kℓ).
Linearity
a∣b∧a∣c⇒a∣(bx+cy) for all x,y∈Z
Proof: If b=ak and c=aℓ, then bx+cy=akx+aℓy=a(kx+ℓy).
Antisymmetry (up to sign)
a∣b∧b∣a⇒a=±b
Proof: If a∣b and b∣a, then b=ak and a=bℓ for integers k,ℓ.
Hence a=akℓ, so a(1−kℓ)=0.
If a=0, then b=0 and a=b.
If a=0, then kℓ=1. Since k,ℓ∈Z, we have (k,ℓ)=(1,1) or (−1,−1).
Thus b=a or b=−a.
The Division Theorem
Statement
Theorem (Division Theorem): For any integer a and positive integer b>0, there exist unique integers q and r such that:
a=bq+rwith 0≤r<b
- q is the quotient (how many times b fits into a)
- r is the remainder (what is left over)
- We write r=amodb
Examples
| a | b | q | r | Verification |
|---|
| 17 | 5 | 3 | 2 | 17=5⋅3+2 |
| -17 | 5 | -4 | 3 | −17=5⋅(−4)+3 |
| 20 | 7 | 2 | 6 | 20=7⋅2+6 |
| 14 | 2 | 7 | 0 | 14=2⋅7+0 |
Proof Outline
Existence:
Consider the set S={a−bk:k∈Z,a−bk≥0}.
This set is non-empty (take k large and negative if a<0, or k=0 if a≥0).
Let r be the smallest element of S. Then r=a−bq≥0 for some q.
If r≥b, then r−b=a−b(q+1)≥0, contradicting minimality.
So 0≤r<b.
Uniqueness:
If a=bq1+r1=bq2+r2 with 0≤r1,r2<b:
Then b(q1−q2)=r2−r1.
We have ∣r2−r1∣<b, so b∣(r2−r1) forces r2−r1=0.
Thus r1=r2 and hence q1=q2.
Computing Quotient and Remainder
For Non-negative a
q=⌊a/b⌋andr=a−bq
For Negative a
Be careful: −17mod5=3, not −2.
The standard convention requires 0≤r<b:
r=a−b⋅⌊ba⌋
Properties of Remainder
Invariance under Addition
If a≡r(modb) and c≡s(modb) with 0≤r,s<b, then:
a+c≡r+s(modb)
Invariance under Multiplication
If a≡r(modb) and c≡s(modb) with 0≤r,s<b, then:
ac≡rs(modb)
Summary
- a∣b means there exists k with b=ak
- Divisibility is reflexive, transitive, and antisymmetric up to sign
- The Division Theorem: for b>0, unique q,r with a=bq+r and 0≤r<b
- Remainder satisfies 0≤r<b even for negative a