转载自 http://blog.youkuaiyun.com/discreeter/article/details/69833579
裴蜀定理:
对任何a,b∈Z和它们的最大公约数d,关于未知数x和y的线性不定方程(称为裴蜀等式):ax+by=c有整数解(x,y)当且仅当d∣c,可知有无穷多解。特别地,一定存在整数x,y,使ax+by=d成立。
推论:
a,b互质的充要条件是存在整数x,y使ax+by=1
对于(a,b∈Z),ax+by=gcd(a,b)一定有整数解x,y的证明:
设d=gcd(a,b),可得d∣a,d∣b,且d∣(ax+by)。
设s是a与b的线性组合集中最小的正元素,并且对于某个x,y∈Z,有s=ax+by,可知s∈Z。
设q=⌊a/s⌋,则有r=amods=a−qs=a−q(ax+by)=a(1−qx)+b(−qy),因此r也是a与b的一个线性组合,已知s是这个线性集合中的最小正整数,又0≤r<s,可得r=0,因此有s∣a,同理有s∣b,因此s是a与b的公约数,所以有d≥s。因为对于任意x,y∈Z,有d∣(ax+by),而对于某个x,y∈Z,有s=ax+by,所以有d∣s。但d∣s且s>0,可得d≤s。综合d≤s和d≥s,得d=s,故s=gcd(a,b)。我们已知s是a与b的线性组合集中的最小正元素,故ax+by=gcd(a,b)一定有整数解x,y,亦可知对于a,b∈Z,gcd(a,b)是ax+by(x,y∈Z)的最小正元素
对于(a,b∈Z),ax+by=c有整数解的条件是gcd(a,b)∣c的证明:
充分性:设d=gcd(a,b),已知ax+by=d一定有整数解,设其解为(x0,y0)。d∣c,则存在k∈Z,使得c=kd=k(ax+by)=a(kx)+b(ky),即解为(kx0,ky0)。
必要性:因x1,y1∈Z,设d=gcd(a,b),有d∣a,d∣b,d∣(ax1,by1),即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