跳到正文

算法·理论

数论二 · 裴蜀定理

D5SY_GuoJunning约 3 分钟
原文
文章信息与版本

文章信息

发布
2026年8月16日
收录
2026年8月16日
更新
2026年11月10日
篇幅
约 3 分钟

版本

  1. v1当前

裴蜀定理

内容

内容

设整数 a,ba,b 满足 a≠0∨b≠0a\ne 0\lor b\ne 0,则对于任意的 整数x,yx,y,都有 gcd(a,b)∣(ax+by)gcd(a,b)|(ax+by) 成立,而且存在整数 xx 和 yy 满足 ax+by=gcd(a,b)ax+by=gcd(a,b)


证明

证明定理一

法一

设d=gcd(a,b)∵d∣a且d∣b∴d∣ax且d∣by∴d∣(ax+by)∴gcd(a,b)∣(ax+by)∴得证 设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)∵d∣a且d∣b∴a=du,b=dv∴ax=dux,by=dvy∴ax+by=d(ux+vy)∴d∣(ax+by)∴gcd(a,b)∣(ax+by)∴得证 设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 得证
证明定理二
定义集合S={ax+by∣x,y∈Z,ax+by≥0}可以证明∣S∣≥0∵任意k∈S满足k∈Z∧k≥0∴集合中存在一个最小值,设为m∵m=ax0+by0设a%m=r∵r=a−mq,1≤r<m∴r=a−(ax0+by0)q∴r=a−ax0q−by0q∴r=a(1−x0q)+b(−y0q)如果r>0,那么r∈S但是r<m,说明m不是S最小值∵与命题矛盾∴r=0∴m∣a∵a和b是对称的∴m∣b∵m为a和b的公约数∴m≤gcd(a,b)∵m>0,gcd(a,b)∣m∴m≥gcd(a,b)∴m=gcd(a,b)综上得证 定义集合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)\\ 综上得证
原文