转载自 http://blog.youkuaiyun.com/discreeter/article/details/69833579
裴蜀定理:
对任何
a,b∈Z
和它们的最大公约数
d
,关于未知数
x
和
y
的线性不定方程(称为裴蜀等式):
ax+b
y
=c
有整数解
(x,y
)
当且仅当
d∣c
,可知有无穷多解。特别地,一定存在整数
x,y
,使
ax+b
y
=d
成立。
推论:
a,b
互质的充要条件是存在整数
x,y
使
ax+b
y
=1
对于
(a
,b∈Z),
ax+
by=gcd(a,b)一定有整数解
x,
y的证明:
设
d=g
c
d
(a,b)
,可得
d∣a
,
d∣b
,且
d∣(a
x+b
y
)
。
设
s
是
a
与
b
的线性组合集中最小的正元素,并且对于某个
x,y
∈Z
,有
s=a
x+b
y
,可知
s∈Z
。
设
q=⌊a
/
s⌋
,则有
r=a
m
o
d
s=a−q
s=a−q
(a
x+b
y
)
=a(1−q
x)
+b(−q
y
)
,因此
r
也是
a
与
b
的一个线性组合,已知
s
是这个线性集合中的最小正整数,又
0≤r<s
,可得
r=0
,因此有
s∣a
,同理有
s∣b
,因此
s
是
a
与
b
的公约数,所以有
d≥s
。因为对于任意
x,y
∈Z
,有
d∣(a
x+b
y
)
,而对于某个
x,y
∈Z
,有
s=a
x+b
y
,所以有
d∣s
。但
d∣s
且
s>0
,可得
d≤s
。综合
d≤s
和
d≥s
,得
d=s
,故
s
=
gcd(a,b)
。我们已知
s
是
a
与
b
的线性组合集中的最小正元素,故
ax+b
y
=g
c
d
(a,b)
一定有整数解
x,y
,亦可知对于
a,b∈Z
,
gcd(a,b)
是
ax+b
y
(x,y
∈Z
)
的最小正元素
对于
(a
,b∈Z),
ax+
by=c有整数解的条件是
gcd
(a,b)∣c的证明:
充分性:设
d=g
c
d
(a,b)
,已知
ax+b
y
=d
一定有整数解,设其解为
(x
0
,
y
0
)
。
d∣c
,则存在
k∈Z
,使得
c=k
d
=k(a
x+b
y
)
=a(k
x)
+b(k
y
)
,即解为
(kx
0
,k
y
0
)
。
必要性:因
x
1
,y
1∈Z
,设
d=g
c
d
(a,b)
,有
d∣a
,
d∣b
,
d∣(a
x
1
,b
y
1
)
,即
d∣c
Proof by Well-OrderingPrinciple
Let the set S to be all positive integers of the form ua + vb for some Integer u and v. Then S must have at least one element.[let u = 1 and v = 1 and a+b is in S]
Let gcd(a, b) = d Then d|a and d|b,by the def of divisibility.a = dn, b = dm for some integer n,m.
then ua + vb = dnu + dmv =d(nu + mv) [nu + mv is a integer because sum and product of integers]
thus d | (ua + vb) .therefore all of the element in S is divisible by d.
By well-ordering principle,S contains a least element called it t,Then d | t. by theorem 3.3.3 t>= d. (1)
Let q = ⌊a/s⌋ ,then r = a mod t = a - qt = a - (ua +vb)q = a(1-qu) + b(-qv).
And (1-qu), (-qv)are all integers, thus r is the integer has the form au + bv. and because 0<= r < t. and t is the least element in set S.
Hence r can't be in set S , so r must be zero. and t | a.
By the same step we can proved that t | b. Hence t is a common divisor of a and b. and therefore t<= gcd(a, b) = d. (2)
by (1) (2) t >=d and t<=d then t = d. The least element in set S is the gcd(a, b). QED