2 #51 Wilson の定理 forget
元の題:Wilson の定理(旧 8.book)。
Wilson の定理:\(p = n + 1\) が素数なら \(p \mid n! + 1\)。
2.1 逆元
素数 \(p\) を法とする逆元。自然数には引き算が無いので、\(xy \equiv 1 \pmod p\) を \(xy = pt + 1\) と書きます。
\(pa + r = pb + s\) で \(r, s < p\) なら \(r = s\)。
WRU …
\(p , a , b , r , s \in \mathbb{M} , r < p , s < p , p \cdot a + r = p \cdot b + s \Longrightarrow r = s\) \(\blacktriangleleft\) L+cl ,Ltot ,ℙ.' ,∣. ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(0 < c < p\) なら \(p \nmid c\)。
WNDV …
\(p , c \in \mathbb{M} , c \neq 0 , c < p \Longrightarrow \neg ( p \mid c )\) \(\blacktriangleleft\) ∣≤ ,ℙ.' ,∣. ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(xz = ps + 1\) なら \(p \nmid z\)(\(z = pk\) なら \(p (xk) = ps + 1\) で、\(p \mid ps\) だから \(p \mid 1\))。
WND1 …
\(p \in \mathbb{P} , x , z , s \in \mathbb{M} , x \cdot z = p \cdot s + 1 \Longrightarrow \neg ( p \mid z )\) \(\blacktriangleleft\) ∣sub ,∣. ,ℙ∤1 ,Lℙ ,ℙ.' ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(x \le y < p\)・\(xz \equiv yz \equiv 1\) なら \(x = y\):\(y = x + d\) とおくと \(ps + dz = pt\)。\(p \nmid z\) なので \(p \mid d\)、\(d < p\) より \(d = 0\)。
WUA …
\(p \in \mathbb{P} , x , y , z , s , t \in \mathbb{M} , x \le y < p , x \cdot z = p \cdot s + 1 , y \cdot z = p \cdot t + 1 \Longrightarrow x = y\) \(\blacktriangleleft\) WND1 ,Euclid ,∣sub ,∣≤ ,Lℙ ,ℙ.' ,∣. ,L+cl ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(x, y < p\) で \(xz \equiv yz \equiv 1\) なら \(x = y\)(大きさで場合分けして WUA)。
WUNIQ …
\(p \in \mathbb{P} , x , y , z , s , t \in \mathbb{M} , x < p , y < p , x \cdot z = p \cdot s + 1 , y \cdot z = p \cdot t + 1 \Longrightarrow x = y\) \(\blacktriangleleft\) WUA ,Ltot ,ℙ.' ,∣. ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(p = n + 1\) が素数で \(2 \le x < n\) なら、\(x^2 \equiv 1\) にならない(\(x^2 - 1 = (x-1)(x+1)\) で、どちらの因数も \(p\) では割り切れない)。
WSELF …
\(p \in \mathbb{P} , p = n + 1 , n , x \in \mathbb{M} , 2 \le x , x < n \Longrightarrow \neg \exists t \in \mathbb{M} . x \cdot x = p \cdot t + 1\) \(\blacktriangleleft\) WNDV ,Euclid ,Lℙ ,ℙ.' ,∣. ,L+cl ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(0 < x < p\) なら \(xy = pu + 1\) となる \(y, u\) がある。\(x\) と \(p\) の最大公約数は 1(\(g \mid p\) で \(g = 1\) か \(p\)。\(g = p\) なら \(p \mid x\) で WNDV に反する)。Bézout(#60)で \(xs = pt + 1\) か \(pt = xs + 1\)。前者はそのまま。後者は \(p = c + 2\)・\(t = t' + 1\) として \(y = (c + 1) s\)・\(u = t'c + t' + c\)。
WI1 …
\(p \in \mathbb{P} , x \in \mathbb{M} , x \neq 0 , x < p \Longrightarrow \exists y , u \in \mathbb{M} . x \cdot y = p \cdot u + 1\) \(\blacktriangleleft\) Lbez ,WNDV ,Lℙ ,ℙ.' ,∣. ,⋅0𝕄 ,⋅0X ,L+cl ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(xy = pu + 1\) のとき、\(y\) を \(p\) で割った余り \(r\) も \(xr = pw + 1\)(\(y = pq + r\) なら \(p(xq) + xr = pu + 1\)。\(u < xq\) とすると \(p\) の倍数が 1 以下になって矛盾)。
WRED …
\(p \in \mathbb{P} , x , y , u , q , r \in \mathbb{M} , x \cdot y = p \cdot u + 1 , y = p \cdot q + r \Longrightarrow \exists w \in \mathbb{M} . x \cdot r = p \cdot w + 1\) \(\blacktriangleleft\) L<∃ ,L≤⋅ ,\(\neg ( 2 \le 1 )\) ,Lℙ ,L+cl ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ\(0 < x < p\) なら \(xy = pu + 1\)(\(y < p\))となる \(y, u\) がある(WI1 の \(y\) を \(p\) で割った余り)。
WINV …
\(p \in \mathbb{P} , x \in \mathbb{M} , x \neq 0 , x < p \Longrightarrow \exists y \in \mathbb{M} . y < p , \exists u \in \mathbb{M} . x \cdot y = p \cdot u + 1\) \(\blacktriangleleft\) WI1 ,WRED ,Ldiv ,Lℙ ,⋅𝕄:D ,\(\mathbb{W}.\) ,Axℤ2.2 組の積
\(2 \le x \le n - 1\) は、積が \(p\) で割って 1 余るような逆元と組にできる。
列 \(g\) の最初の \(n\) 項が「値は \(p\) 未満・1でない値には別の位置に逆元があり・1でない値は重ならない」ことを \(g \rightleftharpoons \langle p,n\rangle\) と書きます。
word(ss,s)F …
\(\mathsf{pr}\)abbr …
\(\langle X , Y \rangle\) ≈
\(\mathsf{pr} ( X , Y )\) word(ss,p) …
\(\rightleftharpoons\)⇌. …
\(g \rightleftharpoons \langle p , n \rangle \Longleftrightarrow \forall i \in \mathbb{M} . ( i < n \Longrightarrow g ( i ) \in \mathbb{M} , g ( i ) < p ) , \forall i \in \mathbb{M} . ( i < n , g ( i ) \neq 1 \Longrightarrow \exists j \in \mathbb{M} . j < n , j \neq i , g ( j ) \neq 1 , \exists t \in \mathbb{M} . g ( i ) \cdot g ( j ) = p \cdot t + 1 ) , \forall i , j \in \mathbb{M} . ( i < n , j < n , g ( i ) \neq 1 , g ( i ) = g ( j ) \Longrightarrow i = j )\) 素数は 1 より大きい。
WP1 …
\(p \in \mathbb{P} \Longrightarrow 1 < p\) \(\blacktriangleleft\) Lℙ ,ℙ.' ,∣. ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ組になっている2つの位置 \(a, b\) の値を 1 に替えても、組の性質は保たれる。
DROP …
\(p \in \mathbb{P} , n \in \mathbb{M} , g \rightleftharpoons \langle p , n \rangle , a , b \in \mathbb{M} , a < n , b < n , \exists u \in \mathbb{M} . g ( a ) \cdot g ( b ) = p \cdot u + 1 , h ( a ) = 1 , h ( b ) = 1 , \forall i \in \mathbb{M} . ( i \neq a , i \neq b \Longrightarrow h ( i ) = g ( i ) ) \Longrightarrow h \rightleftharpoons \langle p , n \rangle\) \(\blacktriangleleft\) WUNIQ ,Lℙ ,⇌. ,ℙ.' ,∣. ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ2点(\(k\)・\(b\))の値を 1 に替えた列 \(h\) の積に、替える前の値 \(g(b)\)・\(g(k)\) をかけると、元の積になる(Pupd を2回)。
Pupd2 …
\(K \in \mathbb{M} , P ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < K \Longrightarrow P ( i + 1 ) = P ( i ) \cdot g ( i ) ) , R ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < K \Longrightarrow R ( i + 1 ) = R ( i ) \cdot f ( i ) ) , Q ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < K \Longrightarrow Q ( i + 1 ) = Q ( i ) \cdot h ( i ) ) , k , b \in \mathbb{M} , k < K , b < K , b \neq k , f ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq k \Longrightarrow f ( i ) = g ( i ) ) , h ( b ) = 1 , \forall i \in \mathbb{M} . ( i \neq b \Longrightarrow h ( i ) = f ( i ) ) , \forall i \in \mathbb{M} . ( i < K \Longrightarrow g ( i ) \in \mathbb{M} ) \Longrightarrow ( Q ( K ) \cdot g ( b ) ) \cdot g ( k ) = P ( K )\) \(\blacktriangleleft\) Pupd ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ1点(\(k\))の値を 1 に替えた列 \(f\) と、その部分積の列 \(R\) がある。\(R(n) \cdot g(k) = P(n)\)(Pupd)。
SH1 …
\(n , k \in \mathbb{M} , k < n , \forall i \in \mathbb{M} . ( i < n \Longrightarrow g ( i ) \in \mathbb{M} ) , P ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < n \Longrightarrow P ( i + 1 ) = P ( i ) \cdot g ( i ) ) \Longrightarrow \exists f \, \exists R \, ( f ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq k \Longrightarrow f ( i ) = g ( i ) ) , R ( 0 ) = 1 , \forall i \in \mathbb{M} . R ( i + 1 ) = R ( i ) \cdot f ( i ) , R ( n ) \cdot g ( k ) = P ( n ) )\) \(\blacktriangleleft\) UPD ,PRD ,Pupd ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ1でない値のうち一番後ろの位置 \(k\) とその逆元の位置 \(b\) の値を 1 に替えた列 \(h\) と部分積の列 \(Q\) がある。\((Q(n) \cdot g(b)) \cdot g(k) = P(n)\)(SH1 を2回)。
SH …
\(n , k , b \in \mathbb{M} , k < n , b < n , b \neq k , \forall i \in \mathbb{M} . ( i < n \Longrightarrow g ( i ) \in \mathbb{M} ) , P ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < n \Longrightarrow P ( i + 1 ) = P ( i ) \cdot g ( i ) ) \Longrightarrow \exists h \, \exists Q \, ( h ( b ) = 1 , h ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq b , i \neq k \Longrightarrow h ( i ) = g ( i ) ) , Q ( 0 ) = 1 , \forall i \in \mathbb{M} . Q ( i + 1 ) = Q ( i ) \cdot h ( i ) , ( Q ( n ) \cdot g ( b ) ) \cdot g ( k ) = P ( n ) )\) \(\blacktriangleleft\) SH1 ,Pupd2 ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ\(k\) 以降が 1 の列について、\(k\) 項目の値が 1 か、\(k\) が長さ以上なら、\(k + 1\) 以降が 1 の仮定のままで \(k\) 以降が 1。
SAx …
\(n , k \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n , ( k + 1 ) \le i \Longrightarrow g ( i ) = 1 ) , ( n \le k \mathbin{\rm o\!r} g ( k ) = 1 ) \Longrightarrow \forall i \in \mathbb{M} . ( i < n , k \le i \Longrightarrow g ( i ) = 1 )\) \(\blacktriangleleft\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ1でない値の逆元の位置 \(b\) は \(k\) より前。\(h\) の \(k\) 以降は 1。積の組み立て。
SBk …
\(n , k , b \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n , ( k + 1 ) \le i \Longrightarrow g ( i ) = 1 ) , b < n , b \neq k , g ( b ) \neq 1 \Longrightarrow b < k\) \(\blacktriangleleft\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,AxℤSh1 …
\(n , k , b \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n , ( k + 1 ) \le i \Longrightarrow g ( i ) = 1 ) , b < k , h ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq b , i \neq k \Longrightarrow h ( i ) = g ( i ) ) \Longrightarrow \forall i \in \mathbb{M} . ( i < n , k \le i \Longrightarrow h ( i ) = 1 )\) \(\blacktriangleleft\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,AxℤSMul …
\(p \in \mathbb{P} , t , u , z , x , y , n \in \mathbb{M} , z = p \cdot t + 1 , y \cdot x = p \cdot u + 1 , ( z \cdot x ) \cdot y = n \Longrightarrow \exists s \in \mathbb{M} . n = p \cdot s + 1\) \(\blacktriangleleft\) Lℙ ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,AxℤSTEP …
\(p \in \mathbb{P} , n , k \in \mathbb{M} , \forall g \, \forall P \, ( g \rightleftharpoons \langle p , n \rangle , P ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < n \Longrightarrow P ( i + 1 ) = P ( i ) \cdot g ( i ) ) , \forall i \in \mathbb{M} . ( i < n , k \le i \Longrightarrow g ( i ) = 1 ) \Longrightarrow \exists t \in \mathbb{M} . P ( n ) = p \cdot t + 1 ) , g \rightleftharpoons \langle p , n \rangle , P ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < n \Longrightarrow P ( i + 1 ) = P ( i ) \cdot g ( i ) ) , \forall i \in \mathbb{M} . ( i < n , ( k + 1 ) \le i \Longrightarrow g ( i ) = 1 ) \Longrightarrow \exists t \in \mathbb{M} . P ( n ) = p \cdot t + 1\) \(\blacktriangleleft\) SAx ,SBk ,Sh1 ,SMul ,SH ,DROP ,Pmem ,⇌. ,Lℙ ,ℙ.' ,∣. ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ\(g \rightleftharpoons \langle p,n\rangle\) なら積は \(p\) で割って 1 余る(\(k\) 以降が 1 の列について \(k\) についての帰納法・STEP)。
CLM …
\(p \in \mathbb{P} , n \in \mathbb{M} , g \rightleftharpoons \langle p , n \rangle , P ( 0 ) = 1 , \forall i \in \mathbb{M} . ( i < n \Longrightarrow P ( i + 1 ) = P ( i ) \cdot g ( i ) ) \Longrightarrow \exists t \in \mathbb{M} . P ( n ) = p \cdot t + 1\) \(\blacktriangleleft\) Pone ,STEP ,⇌. ,Lℙ ,ℙ.' ,∣. ,⋅𝕄:D ,⋅0𝕄 ,⋅0X ,\(\mathbb{W}.\) ,Axℤ2.3 主定理
\(2 \le x \le n - 1\) の逆元 \(y\)(XY)を使い、\(f(i) = i + 1\) の最後の項を 1 に替えた列が組の性質を満たすことから、上の CLM で積が \(p\) で割って 1 余る。
NOTN …
\(p = n + 1 , n , x , u \in \mathbb{M} , x < n , x \cdot n = p \cdot u + 1 \Longrightarrow {\perp}\) \(\blacktriangleleft\) WRU ,Lsuc< ,𝕄0' ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ\(p = n + 1\) が素数で \(2 \le x < n\) なら、\(xy \equiv 1\) となる \(y\) は \(2 \le y < n\) で \(y \neq x\)(\(y = 0, 1, n, x\) はどれも不可能)。
XY …
\(p \in \mathbb{P} , p = n + 1 , n , x \in \mathbb{M} , 2 \le x , x < n \Longrightarrow \exists y \in \mathbb{M} . 2 \le y , y < n , y \neq x , \exists u \in \mathbb{M} . x \cdot y = p \cdot u + 1\) \(\blacktriangleleft\) WINV ,WSELF ,NOTN ,WRU ,Lsuc< ,Lpred ,Lge2 ,Lge2nz ,Lℙ ,ℙ.' ,∣. ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ\(f(i) = i + 1\)(\(i < n = k + 1\))の第 \(k\) 項(値 \(n\))を 1 に替えた列 \(h\) は \(h \rightleftharpoons \langle p,n\rangle\)。まず値が \(p\) 未満。
R1 …
\(p \in \mathbb{P} , p = n + 1 , n = k + 1 , n , k \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n \Longrightarrow f ( i ) = i + 1 ) , h ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq k \Longrightarrow h ( i ) = f ( i ) ) \Longrightarrow \forall i \in \mathbb{M} . ( i < n \Longrightarrow h ( i ) \in \mathbb{M} , h ( i ) < p )\) \(\blacktriangleleft\) WP1 ,Lsuc< ,\(\mathbb{W}.\) ,Axℤ1 でない値 \(h(i) = i + 1\)(\(i < k\))には、XY の \(y\) を使って \(j = y - 1\) の位置が逆元の位置になる。
R2p …
\(p \in \mathbb{P} , p = n + 1 , n = k + 1 , n , k \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n \Longrightarrow f ( i ) = i + 1 ) , h ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq k \Longrightarrow h ( i ) = f ( i ) ) , i \in \mathbb{M} , i < n , h ( i ) \neq 1 \Longrightarrow \exists j \in \mathbb{M} . j < n , j \neq i , h ( j ) \neq 1 , \exists t \in \mathbb{M} . h ( i ) \cdot h ( j ) = p \cdot t + 1\) \(\blacktriangleleft\) XY ,Lge2 ,Lpred ,Lge2nz ,Lsuc< ,𝕄0' ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ逆元の位置の存在(R2p を全ての位置に)。
R2 …
\(p \in \mathbb{P} , p = n + 1 , n = k + 1 , n , k \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n \Longrightarrow f ( i ) = i + 1 ) , h ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq k \Longrightarrow h ( i ) = f ( i ) ) \Longrightarrow \forall i \in \mathbb{M} . ( i < n , h ( i ) \neq 1 \Longrightarrow \exists j \in \mathbb{M} . j < n , j \neq i , h ( j ) \neq 1 , \exists t \in \mathbb{M} . h ( i ) \cdot h ( j ) = p \cdot t + 1 )\) \(\blacktriangleleft\) R2p ,\(\mathbb{W}.\) ,Axℤ1 でない値は重ならない。
R3 …
\(p \in \mathbb{P} , p = n + 1 , n = k + 1 , n , k \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n \Longrightarrow f ( i ) = i + 1 ) , h ( k ) = 1 , \forall i \in \mathbb{M} . ( i \neq k \Longrightarrow h ( i ) = f ( i ) ) \Longrightarrow \forall i , j \in \mathbb{M} . ( i < n , j < n , h ( i ) \neq 1 , h ( i ) = h ( j ) \Longrightarrow i = j )\) \(\blacktriangleleft\) ⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ出発の列 \(f(i) = i + 1\) の第 \(k\) 項(\(n = k + 1\))を 1 に替えた \(h\) と部分積の列 \(Q\) について \(Q(n) \cdot n = n!\)(Pupd・Pfac)と \(h \rightleftharpoons \langle p,n\rangle\)(R1〜R3)から、CLM で \(n! = (pt + 1) n\)。
ST …
\(p \in \mathbb{P} , p = n + 1 , n = k + 1 , n , k \in \mathbb{M} , \forall i \in \mathbb{M} . ( i < n \Longrightarrow f ( i ) = i + 1 ) \Longrightarrow \exists t \in \mathbb{M} . n ! = ( p \cdot t + 1 ) \cdot n\) \(\blacktriangleleft\) UPD ,PRD ,Pupd ,Pfac ,Pmem ,R1 ,R2 ,R3 ,CLM ,⇌. ,Lℙ ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ\(p = n + 1\) が素数なら \(p \mid n! + 1\)。\(n = k + 1\) に直して ST を使い、\((pt + 1) n + 1 = p (tn + 1)\)。
Wilson …
\(p \in \mathbb{P} , n \in \mathbb{M} , p = n + 1 \Longrightarrow p \mid n ! + 1\) \(\blacktriangleleft\) ST ,Pexg ,Lℙ ,∣. ,𝕄0' ,𝕄0-' ,!𝕄 ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,Axℤ3 互いに素な積の準備
元の題:Pythagoras 数と Fermat の最終定理 n = 4(旧 9.book)。
自然数の積は自然数(以下の証明の小さな道具)。
互いに素な \(v, w\) の積 \(vw\) が平方数なら、\(v\) も平方数(#23 の準備)。
素数 \(p\) が \(k^2\) を割れば \(k\) を割る(Euclid の補題)。
\(p \mid v\)、\(p \nmid w\)、\(vw = k^2\) なら、\(v = p^2 u\)・\(uw = j^2\) と書ける。\(p \mid k\) なので \(k = pj\)、\(v = ps\) とおくと \(sw = p j^2\)。\(p \nmid w\) だから \(p \mid s\)。