数论二 · 裴蜀定理
D5SY_GuoJunning
·
·
算法·理论
裴蜀定理
内容
::::info[内容]{open}
设整数 a,b 满足 a\ne 0\lor b\ne 0,则对于任意的 整数x,y,都有 gcd(a,b)|(ax+by) 成立,而且存在整数 x 和 y 满足 ax+by=gcd(a,b)
::::
证明
::::success[证明定理一]{open}
法一
设d=gcd(a,b)\\
\because d|a 且 d|b\\
\therefore d|ax 且 d|by\\
\therefore d|(ax+by)\\
\therefore gcd(a,b)|(ax+by)\\
\therefore 得证
法二
设d=gcd(a,b)\\
\because d|a 且 d|b\\
\therefore a=du,b=dv\\
\therefore ax=dux,by=dvy\\
\therefore ax+by=d(ux+vy)\\
\therefore d|(ax+by)\\
\therefore gcd(a,b)|(ax+by)\\
\therefore 得证
::::
::::success[证明定理二]{open}
定义集合S=\{ax+by|x,y\in \mathbb Z,ax+by\ge 0\}\\
可以证明|S|\ge 0\\
\because 任意k\in S满足k\in \mathbb Z\land k\ge0\\
\therefore 集合中存在一个最小值,设为m\\
\because m=ax_0+by_0\\
设a\% m=r\\
\because r=a-mq,1\le r < m\\
\therefore r=a-(ax_0+by_0)q\\
\therefore r=a-ax_0q-by_0q\\
\therefore r=a(1-x_0q)+b(-y_0q)\\
如果r>0,那么 r\in S\\
但是r<m,说明m不是S最小值\\
\because 与命题矛盾\\
\therefore r=0\\
\therefore m|a\\
\because a和b是对称的\\
\therefore m|b\\
\because m为a和b的公约数\\
\therefore m\le gcd(a,b)\\
\because m>0,gcd(a,b)|m\\
\therefore m\ge gcd(a,b)\\
\therefore m=gcd(a,b)\\
综上得证
::::