2 #51 Wilson's theorem forget
Wilson's theorem: if \(p = n + 1\) is prime, then \(p \mid n! + 1\).
2.1 Inverses
Inverses modulo a prime \(p\). Since natural numbers have no subtraction, we write \(xy \equiv 1 \pmod p\) as \(xy = pt + 1\).
If \(pa + r = pb + s\) and \(r, s < p\), then \(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ℤIf \(0 < c < p\) then \(p \nmid c\).
WNDV …
\(p , c \in \mathbb{M} , c \neq 0 , c < p \Longrightarrow \neg ( p \mid c )\) \(\blacktriangleleft\) ∣≤ ,ℙ.' ,∣. ,⋅𝕄:D ,\(\mathbb{W}.\) ,AxℤIf \(xz = ps + 1\) then \(p \nmid z\) (if \(z = pk\) then \(p (xk) = ps + 1\), and since \(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ℤIf \(x \le y < p\) and \(xz \equiv yz \equiv 1\), then \(x = y\): put \(y = x + d\); then \(ps + dz = pt\). Since \(p \nmid z\), \(p \mid d\), and since \(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ℤIf \(x, y < p\) and \(xz \equiv yz \equiv 1\), then \(x = y\) (split cases by size, 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ℤIf \(p = n + 1\) is prime and \(2 \le x < n\), then \(x^2 \equiv 1\) fails (\(x^2 - 1 = (x-1)(x+1)\), and neither factor is divisible by \(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ℤIf \(0 < x < p\), then \(xy = pu + 1\) holds for some \(y, u\). The gcd of \(x\) and \(p\) is 1 (since \(g \mid p\), \(g = 1\) or \(p\); if \(g = p\) then \(p \mid x\), contradicting WNDV). By Bézout (#60), \(xs = pt + 1\) or \(pt = xs + 1\). The former is as is. For the latter, put \(p = c + 2\) and \(t = t' + 1\), then \(y = (c + 1) s\) and \(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ℤWhen \(xy = pu + 1\), the remainder of \(y\) divided by \(p\), \(r\), also satisfies \(xr = pw + 1\) (if \(y = pq + r\) then \(p(xq) + xr = pu + 1\); if \(u < xq\), a multiple of \(p\) would be at most 1, a contradiction).
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ℤIf \(0 < x < p\), then \(xy = pu + 1\) (\(y < p\)) for some \(y, u\) (the remainder of the \(y\) of WI1 divided by \(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 Pairing products
Each \(2 \le x \le n - 1\) can be paired with an inverse whose product leaves remainder 1 on division by \(p\).
For a sequence \(g\), the statement that its first \(n\) terms have "values below \(p\), each value other than 1 has an inverse at another position, and values other than 1 do not overlap" is written \(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 )\) A prime is greater than 1.
WP1 …
\(p \in \mathbb{P} \Longrightarrow 1 < p\) \(\blacktriangleleft\) Lℙ ,ℙ.' ,∣. ,⋅𝕄:D ,⋅0X ,\(\mathbb{W}.\) ,AxℤChanging the values at the two paired positions \(a, b\) to 1 preserves the pairing property.
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ℤChanging the values at two points (\(k\), \(b\)) to 1 gives a sequence \(h\); multiplying its product by the original values \(g(b)\), \(g(k)\) gives the original product (Pupd twice).
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ℤChanging the value at one point (\(k\)) to 1 gives a sequence \(f\), and there is its sequence of partial products \(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ℤChanging to 1 the values at the last position \(k\) with a value other than 1 and at the position \(b\) of its inverse gives a sequence \(h\), and there is a sequence of partial products \(Q\). \((Q(n) \cdot g(b)) \cdot g(k) = P(n)\) (SH1 twice).
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ℤFor a sequence that is 1 from \(k\) on: if the \(k\)-th value is 1, or \(k\) is at least the length, then under the assumption that it is 1 from \(k + 1\) on, it is 1 from \(k\) on.
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ℤThe position \(b\) of the inverse of a value other than 1 is before \(k\). \(h\) is 1 from \(k\) on. Assembling the product.
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ℤIf \(g \rightleftharpoons \langle p,n\rangle\), the product leaves remainder 1 on division by \(p\) (induction on \(k\) for sequences that are 1 from \(k\) on, 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 Main theorem
For \(2 \le x \le n - 1\), use the inverse \(y\) (XY); since the sequence obtained from \(f(i) = i + 1\) by changing the last term to 1 satisfies the pairing property, the product leaves remainder 1 on division by \(p\) by CLM above.
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ℤIf \(p = n + 1\) is prime and \(2 \le x < n\), then a solution of \(xy \equiv 1\), namely \(y\), satisfies \(2 \le y < n\) and \(y \neq x\) (\(y = 0, 1, n, x\) are all impossible).
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ℤIn \(f(i) = i + 1\) (\(i < n = k + 1\)), changing the \(k\)-th term (value \(n\)) to 1 gives a sequence \(h\), and \(h \rightleftharpoons \langle p,n\rangle\). First, the values are below \(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ℤFor a value other than 1, \(h(i) = i + 1\) (\(i < k\)), using the \(y\) of XY, the position \(j = y - 1\) becomes the inverse position.
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ℤExistence of inverse positions (R2p at all positions).
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ℤValues other than 1 do not overlap.
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ℤFor the starting sequence \(f(i) = i + 1\), changing its \(k\)-th term (\(n = k + 1\)) to 1 gives \(h\); with the sequence of partial products \(Q\), \(Q(n) \cdot n = n!\) (Pupd, Pfac) and \(h \rightleftharpoons \langle p,n\rangle\) (R1-R3) give \(n! = (pt + 1) n\) by CLM.
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ℤIf \(p = n + 1\) is prime, then \(p \mid n! + 1\). Rewrite \(n = k + 1\) and use 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ℤ