Users' Mathboxes Mathbox for Alexander van der Vekens < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >   Mathboxes  >  proththd Structured version   Visualization version   Unicode version

Theorem proththd 38914
Description: Proth's theorem (1878). If P is a Proth number, i.e. a number of the form k2^n+1 with k less than 2^n, and if there exists an integer x for which x^((P-1)/2) is -1 modulo P, then P is prime. Such a prime is called a Proth prime. Like Pocklington's theorem (see pockthg 14850), Proth's theorem allows for a convenient method for verifying large primes. (Contributed by AV, 5-Jul-2020.)
Hypotheses
Ref Expression
proththd.n  |-  ( ph  ->  N  e.  NN )
proththd.k  |-  ( ph  ->  K  e.  NN )
proththd.p  |-  ( ph  ->  P  =  ( ( K  x.  ( 2 ^ N ) )  +  1 ) )
proththd.l  |-  ( ph  ->  K  <  ( 2 ^ N ) )
proththd.x  |-  ( ph  ->  E. x  e.  ZZ  ( ( x ^
( ( P  - 
1 )  /  2
) )  mod  P
)  =  ( -u
1  mod  P )
)
Assertion
Ref Expression
proththd  |-  ( ph  ->  P  e.  Prime )
Distinct variable groups:    x, N    x, P    ph, x
Allowed substitution hint:    K( x)

Proof of Theorem proththd
Dummy variable  p is distinct from all other variables.
StepHypRef Expression
1 2nn 10767 . . . 4  |-  2  e.  NN
21a1i 11 . . 3  |-  ( ph  ->  2  e.  NN )
3 proththd.n . . . 4  |-  ( ph  ->  N  e.  NN )
43nnnn0d 10925 . . 3  |-  ( ph  ->  N  e.  NN0 )
52, 4nnexpcld 12437 . 2  |-  ( ph  ->  ( 2 ^ N
)  e.  NN )
6 proththd.k . 2  |-  ( ph  ->  K  e.  NN )
7 proththd.l . 2  |-  ( ph  ->  K  <  ( 2 ^ N ) )
8 proththd.p . . 3  |-  ( ph  ->  P  =  ( ( K  x.  ( 2 ^ N ) )  +  1 ) )
96nncnd 10625 . . . . 5  |-  ( ph  ->  K  e.  CC )
105nncnd 10625 . . . . 5  |-  ( ph  ->  ( 2 ^ N
)  e.  CC )
119, 10mulcomd 9664 . . . 4  |-  ( ph  ->  ( K  x.  (
2 ^ N ) )  =  ( ( 2 ^ N )  x.  K ) )
1211oveq1d 6305 . . 3  |-  ( ph  ->  ( ( K  x.  ( 2 ^ N
) )  +  1 )  =  ( ( ( 2 ^ N
)  x.  K )  +  1 ) )
138, 12eqtrd 2485 . 2  |-  ( ph  ->  P  =  ( ( ( 2 ^ N
)  x.  K )  +  1 ) )
14 simpr 463 . . . . 5  |-  ( (
ph  /\  p  e.  Prime )  ->  p  e.  Prime )
15 2prm 14640 . . . . . 6  |-  2  e.  Prime
1615a1i 11 . . . . 5  |-  ( (
ph  /\  p  e.  Prime )  ->  2  e.  Prime )
173adantr 467 . . . . 5  |-  ( (
ph  /\  p  e.  Prime )  ->  N  e.  NN )
18 prmdvdsexpb 14668 . . . . 5  |-  ( ( p  e.  Prime  /\  2  e.  Prime  /\  N  e.  NN )  ->  ( p 
||  ( 2 ^ N )  <->  p  = 
2 ) )
1914, 16, 17, 18syl3anc 1268 . . . 4  |-  ( (
ph  /\  p  e.  Prime )  ->  ( p  ||  ( 2 ^ N
)  <->  p  =  2
) )
20 proththd.x . . . . . 6  |-  ( ph  ->  E. x  e.  ZZ  ( ( x ^
( ( P  - 
1 )  /  2
) )  mod  P
)  =  ( -u
1  mod  P )
)
213, 6, 8proththdlem 38913 . . . . . . . . . . . . . . . . . . . . . 22  |-  ( ph  ->  ( P  e.  NN  /\  1  <  P  /\  ( ( P  - 
1 )  /  2
)  e.  NN ) )
2221simp1d 1020 . . . . . . . . . . . . . . . . . . . . 21  |-  ( ph  ->  P  e.  NN )
2322nncnd 10625 . . . . . . . . . . . . . . . . . . . 20  |-  ( ph  ->  P  e.  CC )
24 peano2cnm 9940 . . . . . . . . . . . . . . . . . . . 20  |-  ( P  e.  CC  ->  ( P  -  1 )  e.  CC )
2523, 24syl 17 . . . . . . . . . . . . . . . . . . 19  |-  ( ph  ->  ( P  -  1 )  e.  CC )
2625adantr 467 . . . . . . . . . . . . . . . . . 18  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( P  -  1 )  e.  CC )
27 2cnd 10682 . . . . . . . . . . . . . . . . . 18  |-  ( (
ph  /\  x  e.  ZZ )  ->  2  e.  CC )
28 2ne0 10702 . . . . . . . . . . . . . . . . . . 19  |-  2  =/=  0
2928a1i 11 . . . . . . . . . . . . . . . . . 18  |-  ( (
ph  /\  x  e.  ZZ )  ->  2  =/=  0 )
3026, 27, 29divcan1d 10384 . . . . . . . . . . . . . . . . 17  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( ( ( P  -  1 )  /  2 )  x.  2 )  =  ( P  -  1 ) )
3130eqcomd 2457 . . . . . . . . . . . . . . . 16  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( P  -  1 )  =  ( ( ( P  -  1 )  / 
2 )  x.  2 ) )
3231oveq2d 6306 . . . . . . . . . . . . . . 15  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( x ^ ( P  - 
1 ) )  =  ( x ^ (
( ( P  - 
1 )  /  2
)  x.  2 ) ) )
33 zcn 10942 . . . . . . . . . . . . . . . . 17  |-  ( x  e.  ZZ  ->  x  e.  CC )
3433adantl 468 . . . . . . . . . . . . . . . 16  |-  ( (
ph  /\  x  e.  ZZ )  ->  x  e.  CC )
35 2nn0 10886 . . . . . . . . . . . . . . . . 17  |-  2  e.  NN0
3635a1i 11 . . . . . . . . . . . . . . . 16  |-  ( (
ph  /\  x  e.  ZZ )  ->  2  e. 
NN0 )
3721simp3d 1022 . . . . . . . . . . . . . . . . . 18  |-  ( ph  ->  ( ( P  - 
1 )  /  2
)  e.  NN )
3837nnnn0d 10925 . . . . . . . . . . . . . . . . 17  |-  ( ph  ->  ( ( P  - 
1 )  /  2
)  e.  NN0 )
3938adantr 467 . . . . . . . . . . . . . . . 16  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( ( P  -  1 )  /  2 )  e. 
NN0 )
4034, 36, 39expmuld 12419 . . . . . . . . . . . . . . 15  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( x ^ ( ( ( P  -  1 )  /  2 )  x.  2 ) )  =  ( ( x ^
( ( P  - 
1 )  /  2
) ) ^ 2 ) )
4132, 40eqtrd 2485 . . . . . . . . . . . . . 14  |-  ( (
ph  /\  x  e.  ZZ )  ->  ( x ^ ( P  - 
1 ) )  =  ( ( x ^
( ( P  - 
1 )  /  2
) ) ^ 2 ) )
4241adantlr 721 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( x ^ ( P  -  1 ) )  =  ( ( x ^ ( ( P  -  1 )  /  2 ) ) ^ 2 ) )
4342adantr 467 . . . . . . . . . . . 12  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
x ^ ( P  -  1 ) )  =  ( ( x ^ ( ( P  -  1 )  / 
2 ) ) ^
2 ) )
4443oveq1d 6305 . . . . . . . . . . 11  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( x ^ ( P  -  1 ) )  mod  P )  =  ( ( ( x ^ ( ( P  -  1 )  /  2 ) ) ^ 2 )  mod 
P ) )
4538adantr 467 . . . . . . . . . . . . . . . 16  |-  ( (
ph  /\  p  = 
2 )  ->  (
( P  -  1 )  /  2 )  e.  NN0 )
4645anim1i 572 . . . . . . . . . . . . . . 15  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( ( ( P  -  1 )  / 
2 )  e.  NN0  /\  x  e.  ZZ ) )
4746ancomd 453 . . . . . . . . . . . . . 14  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( x  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )
)
48 zexpcl 12287 . . . . . . . . . . . . . 14  |-  ( ( x  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( x ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
4947, 48syl 17 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( x ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
5049adantr 467 . . . . . . . . . . . 12  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
x ^ ( ( P  -  1 )  /  2 ) )  e.  ZZ )
5122nnrpd 11339 . . . . . . . . . . . . 13  |-  ( ph  ->  P  e.  RR+ )
5251ad3antrrr 736 . . . . . . . . . . . 12  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  P  e.  RR+ )
5321simp2d 1021 . . . . . . . . . . . . 13  |-  ( ph  ->  1  <  P )
5453ad3antrrr 736 . . . . . . . . . . . 12  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  1  <  P )
55 simpr 463 . . . . . . . . . . . 12  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( x ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( -u 1  mod  P ) )
5650, 52, 54, 55modexp2m1d 38912 . . . . . . . . . . 11  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( x ^
( ( P  - 
1 )  /  2
) ) ^ 2 )  mod  P )  =  1 )
5744, 56eqtrd 2485 . . . . . . . . . 10  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( x ^ ( P  -  1 ) )  mod  P )  =  1 )
58 oveq2 6298 . . . . . . . . . . . . . . . . . . . . 21  |-  ( p  =  2  ->  (
( P  -  1 )  /  p )  =  ( ( P  -  1 )  / 
2 ) )
5958eleq1d 2513 . . . . . . . . . . . . . . . . . . . 20  |-  ( p  =  2  ->  (
( ( P  - 
1 )  /  p
)  e.  NN0  <->  ( ( P  -  1 )  /  2 )  e. 
NN0 ) )
6059adantl 468 . . . . . . . . . . . . . . . . . . 19  |-  ( (
ph  /\  p  = 
2 )  ->  (
( ( P  - 
1 )  /  p
)  e.  NN0  <->  ( ( P  -  1 )  /  2 )  e. 
NN0 ) )
6145, 60mpbird 236 . . . . . . . . . . . . . . . . . 18  |-  ( (
ph  /\  p  = 
2 )  ->  (
( P  -  1 )  /  p )  e.  NN0 )
6261anim2i 573 . . . . . . . . . . . . . . . . 17  |-  ( ( x  e.  ZZ  /\  ( ph  /\  p  =  2 ) )  -> 
( x  e.  ZZ  /\  ( ( P  - 
1 )  /  p
)  e.  NN0 )
)
6362ancoms 455 . . . . . . . . . . . . . . . 16  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( x  e.  ZZ  /\  ( ( P  - 
1 )  /  p
)  e.  NN0 )
)
64 zexpcl 12287 . . . . . . . . . . . . . . . 16  |-  ( ( x  e.  ZZ  /\  ( ( P  - 
1 )  /  p
)  e.  NN0 )  ->  ( x ^ (
( P  -  1 )  /  p ) )  e.  ZZ )
6563, 64syl 17 . . . . . . . . . . . . . . 15  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( x ^ (
( P  -  1 )  /  p ) )  e.  ZZ )
6665zred 11040 . . . . . . . . . . . . . 14  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( x ^ (
( P  -  1 )  /  p ) )  e.  RR )
6766adantr 467 . . . . . . . . . . . . 13  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
x ^ ( ( P  -  1 )  /  p ) )  e.  RR )
68 1red 9658 . . . . . . . . . . . . . 14  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  1  e.  RR )
6968renegcld 10046 . . . . . . . . . . . . 13  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  -u 1  e.  RR )
70 oveq2 6298 . . . . . . . . . . . . . . . . . . . 20  |-  ( 2  =  p  ->  (
( P  -  1 )  /  2 )  =  ( ( P  -  1 )  /  p ) )
7170eqcoms 2459 . . . . . . . . . . . . . . . . . . 19  |-  ( p  =  2  ->  (
( P  -  1 )  /  2 )  =  ( ( P  -  1 )  /  p ) )
7271oveq2d 6306 . . . . . . . . . . . . . . . . . 18  |-  ( p  =  2  ->  (
x ^ ( ( P  -  1 )  /  2 ) )  =  ( x ^
( ( P  - 
1 )  /  p
) ) )
7372oveq1d 6305 . . . . . . . . . . . . . . . . 17  |-  ( p  =  2  ->  (
( x ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( ( x ^ ( ( P  -  1 )  /  p ) )  mod 
P ) )
7473eqeq1d 2453 . . . . . . . . . . . . . . . 16  |-  ( p  =  2  ->  (
( ( x ^
( ( P  - 
1 )  /  2
) )  mod  P
)  =  ( -u
1  mod  P )  <->  ( ( x ^ (
( P  -  1 )  /  p ) )  mod  P )  =  ( -u 1  mod  P ) ) )
7574adantl 468 . . . . . . . . . . . . . . 15  |-  ( (
ph  /\  p  = 
2 )  ->  (
( ( x ^
( ( P  - 
1 )  /  2
) )  mod  P
)  =  ( -u
1  mod  P )  <->  ( ( x ^ (
( P  -  1 )  /  p ) )  mod  P )  =  ( -u 1  mod  P ) ) )
7675adantr 467 . . . . . . . . . . . . . 14  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
)  <->  ( ( x ^ ( ( P  -  1 )  /  p ) )  mod 
P )  =  (
-u 1  mod  P
) ) )
7776biimpa 487 . . . . . . . . . . . . 13  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( x ^ (
( P  -  1 )  /  p ) )  mod  P )  =  ( -u 1  mod  P ) )
78 eqidd 2452 . . . . . . . . . . . . 13  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
1  mod  P )  =  ( 1  mod 
P ) )
7967, 69, 68, 68, 52, 77, 78modsub12d 12147 . . . . . . . . . . . 12  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( x ^
( ( P  - 
1 )  /  p
) )  -  1 )  mod  P )  =  ( ( -u
1  -  1 )  mod  P ) )
8079oveq1d 6305 . . . . . . . . . . 11  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( ( x ^ ( ( P  -  1 )  /  p ) )  - 
1 )  mod  P
)  gcd  P )  =  ( ( (
-u 1  -  1 )  mod  P )  gcd  P ) )
81 peano2zm 10980 . . . . . . . . . . . . . 14  |-  ( ( x ^ ( ( P  -  1 )  /  p ) )  e.  ZZ  ->  (
( x ^ (
( P  -  1 )  /  p ) )  -  1 )  e.  ZZ )
8265, 81syl 17 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( ( x ^
( ( P  - 
1 )  /  p
) )  -  1 )  e.  ZZ )
8322ad2antrr 732 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  P  e.  NN )
84 modgcd 14500 . . . . . . . . . . . . 13  |-  ( ( ( ( x ^
( ( P  - 
1 )  /  p
) )  -  1 )  e.  ZZ  /\  P  e.  NN )  ->  ( ( ( ( x ^ ( ( P  -  1 )  /  p ) )  -  1 )  mod 
P )  gcd  P
)  =  ( ( ( x ^ (
( P  -  1 )  /  p ) )  -  1 )  gcd  P ) )
8582, 83, 84syl2anc 667 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( ( ( ( x ^ ( ( P  -  1 )  /  p ) )  -  1 )  mod 
P )  gcd  P
)  =  ( ( ( x ^ (
( P  -  1 )  /  p ) )  -  1 )  gcd  P ) )
8685adantr 467 . . . . . . . . . . 11  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( ( x ^ ( ( P  -  1 )  /  p ) )  - 
1 )  mod  P
)  gcd  P )  =  ( ( ( x ^ ( ( P  -  1 )  /  p ) )  -  1 )  gcd 
P ) )
87 ax-1cn 9597 . . . . . . . . . . . . . . . . . 18  |-  1  e.  CC
88 negdi2 9932 . . . . . . . . . . . . . . . . . . 19  |-  ( ( 1  e.  CC  /\  1  e.  CC )  -> 
-u ( 1  +  1 )  =  (
-u 1  -  1 ) )
8988eqcomd 2457 . . . . . . . . . . . . . . . . . 18  |-  ( ( 1  e.  CC  /\  1  e.  CC )  ->  ( -u 1  -  1 )  =  -u ( 1  +  1 ) )
9087, 87, 89mp2an 678 . . . . . . . . . . . . . . . . 17  |-  ( -u
1  -  1 )  =  -u ( 1  +  1 )
91 1p1e2 10723 . . . . . . . . . . . . . . . . . 18  |-  ( 1  +  1 )  =  2
9291negeqi 9868 . . . . . . . . . . . . . . . . 17  |-  -u (
1  +  1 )  =  -u 2
9390, 92eqtri 2473 . . . . . . . . . . . . . . . 16  |-  ( -u
1  -  1 )  =  -u 2
9493a1i 11 . . . . . . . . . . . . . . 15  |-  ( ph  ->  ( -u 1  -  1 )  =  -u
2 )
9594oveq1d 6305 . . . . . . . . . . . . . 14  |-  ( ph  ->  ( ( -u 1  -  1 )  mod 
P )  =  (
-u 2  mod  P
) )
9695oveq1d 6305 . . . . . . . . . . . . 13  |-  ( ph  ->  ( ( ( -u
1  -  1 )  mod  P )  gcd 
P )  =  ( ( -u 2  mod 
P )  gcd  P
) )
97 nnnegz 10940 . . . . . . . . . . . . . . . 16  |-  ( 2  e.  NN  ->  -u 2  e.  ZZ )
982, 97syl 17 . . . . . . . . . . . . . . 15  |-  ( ph  -> 
-u 2  e.  ZZ )
99 modgcd 14500 . . . . . . . . . . . . . . 15  |-  ( (
-u 2  e.  ZZ  /\  P  e.  NN )  ->  ( ( -u
2  mod  P )  gcd  P )  =  (
-u 2  gcd  P
) )
10098, 22, 99syl2anc 667 . . . . . . . . . . . . . 14  |-  ( ph  ->  ( ( -u 2  mod  P )  gcd  P
)  =  ( -u
2  gcd  P )
)
101 2z 10969 . . . . . . . . . . . . . . . 16  |-  2  e.  ZZ
10222nnzd 11039 . . . . . . . . . . . . . . . 16  |-  ( ph  ->  P  e.  ZZ )
103 neggcd 14491 . . . . . . . . . . . . . . . 16  |-  ( ( 2  e.  ZZ  /\  P  e.  ZZ )  ->  ( -u 2  gcd 
P )  =  ( 2  gcd  P ) )
104101, 102, 103sylancr 669 . . . . . . . . . . . . . . 15  |-  ( ph  ->  ( -u 2  gcd 
P )  =  ( 2  gcd  P ) )
10537nnzd 11039 . . . . . . . . . . . . . . . . . 18  |-  ( ph  ->  ( ( P  - 
1 )  /  2
)  e.  ZZ )
106 isodd2 38765 . . . . . . . . . . . . . . . . . 18  |-  ( P  e. Odd 
<->  ( P  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  ZZ ) )
107102, 105, 106sylanbrc 670 . . . . . . . . . . . . . . . . 17  |-  ( ph  ->  P  e. Odd  )
108 isodd7 38795 . . . . . . . . . . . . . . . . 17  |-  ( P  e. Odd 
<->  ( P  e.  ZZ  /\  ( 2  gcd  P
)  =  1 ) )
109107, 108sylib 200 . . . . . . . . . . . . . . . 16  |-  ( ph  ->  ( P  e.  ZZ  /\  ( 2  gcd  P
)  =  1 ) )
110109simprd 465 . . . . . . . . . . . . . . 15  |-  ( ph  ->  ( 2  gcd  P
)  =  1 )
111104, 110eqtrd 2485 . . . . . . . . . . . . . 14  |-  ( ph  ->  ( -u 2  gcd 
P )  =  1 )
112100, 111eqtrd 2485 . . . . . . . . . . . . 13  |-  ( ph  ->  ( ( -u 2  mod  P )  gcd  P
)  =  1 )
11396, 112eqtrd 2485 . . . . . . . . . . . 12  |-  ( ph  ->  ( ( ( -u
1  -  1 )  mod  P )  gcd 
P )  =  1 )
114113ad3antrrr 736 . . . . . . . . . . 11  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( -u 1  -  1 )  mod 
P )  gcd  P
)  =  1 )
11580, 86, 1143eqtr3d 2493 . . . . . . . . . 10  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( x ^
( ( P  - 
1 )  /  p
) )  -  1 )  gcd  P )  =  1 )
11657, 115jca 535 . . . . . . . . 9  |-  ( ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  /\  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
) )  ->  (
( ( x ^
( P  -  1 ) )  mod  P
)  =  1  /\  ( ( ( x ^ ( ( P  -  1 )  /  p ) )  - 
1 )  gcd  P
)  =  1 ) )
117116ex 436 . . . . . . . 8  |-  ( ( ( ph  /\  p  =  2 )  /\  x  e.  ZZ )  ->  ( ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
)  ->  ( (
( x ^ ( P  -  1 ) )  mod  P )  =  1  /\  (
( ( x ^
( ( P  - 
1 )  /  p
) )  -  1 )  gcd  P )  =  1 ) ) )
118117reximdva 2862 . . . . . . 7  |-  ( (
ph  /\  p  = 
2 )  ->  ( E. x  e.  ZZ  ( ( x ^
( ( P  - 
1 )  /  2
) )  mod  P
)  =  ( -u
1  mod  P )  ->  E. x  e.  ZZ  ( ( ( x ^ ( P  - 
1 ) )  mod 
P )  =  1  /\  ( ( ( x ^ ( ( P  -  1 )  /  p ) )  -  1 )  gcd 
P )  =  1 ) ) )
119118ex 436 . . . . . 6  |-  ( ph  ->  ( p  =  2  ->  ( E. x  e.  ZZ  ( ( x ^ ( ( P  -  1 )  / 
2 ) )  mod 
P )  =  (
-u 1  mod  P
)  ->  E. x  e.  ZZ  ( ( ( x ^ ( P  -  1 ) )  mod  P )  =  1  /\  ( ( ( x ^ (
( P  -  1 )  /  p ) )  -  1 )  gcd  P )  =  1 ) ) ) )
12020, 119mpid 42 . . . . 5  |-  ( ph  ->  ( p  =  2  ->  E. x  e.  ZZ  ( ( ( x ^ ( P  - 
1 ) )  mod 
P )  =  1  /\  ( ( ( x ^ ( ( P  -  1 )  /  p ) )  -  1 )  gcd 
P )  =  1 ) ) )
121120adantr 467 . . . 4  |-  ( (
ph  /\  p  e.  Prime )  ->  ( p  =  2  ->  E. x  e.  ZZ  ( ( ( x ^ ( P  -  1 ) )  mod  P )  =  1  /\  ( ( ( x ^ (
( P  -  1 )  /  p ) )  -  1 )  gcd  P )  =  1 ) ) )
12219, 121sylbid 219 . . 3  |-  ( (
ph  /\  p  e.  Prime )  ->  ( p  ||  ( 2 ^ N
)  ->  E. x  e.  ZZ  ( ( ( x ^ ( P  -  1 ) )  mod  P )  =  1  /\  ( ( ( x ^ (
( P  -  1 )  /  p ) )  -  1 )  gcd  P )  =  1 ) ) )
123122ralrimiva 2802 . 2  |-  ( ph  ->  A. p  e.  Prime  ( p  ||  ( 2 ^ N )  ->  E. x  e.  ZZ  ( ( ( x ^ ( P  - 
1 ) )  mod 
P )  =  1  /\  ( ( ( x ^ ( ( P  -  1 )  /  p ) )  -  1 )  gcd 
P )  =  1 ) ) )
1245, 6, 7, 13, 123pockthg 14850 1  |-  ( ph  ->  P  e.  Prime )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    <-> wb 188    /\ wa 371    = wceq 1444    e. wcel 1887    =/= wne 2622   E.wrex 2738   class class class wbr 4402  (class class class)co 6290   CCcc 9537   RRcr 9538   0cc0 9539   1c1 9540    + caddc 9542    x. cmul 9544    < clt 9675    - cmin 9860   -ucneg 9861    / cdiv 10269   NNcn 10609   2c2 10659   NN0cn0 10869   ZZcz 10937   RR+crp 11302    mod cmo 12096   ^cexp 12272    || cdvds 14305    gcd cgcd 14468   Primecprime 14622   Odd codd 38754
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1669  ax-4 1682  ax-5 1758  ax-6 1805  ax-7 1851  ax-8 1889  ax-9 1896  ax-10 1915  ax-11 1920  ax-12 1933  ax-13 2091  ax-ext 2431  ax-rep 4515  ax-sep 4525  ax-nul 4534  ax-pow 4581  ax-pr 4639  ax-un 6583  ax-cnex 9595  ax-resscn 9596  ax-1cn 9597  ax-icn 9598  ax-addcl 9599  ax-addrcl 9600  ax-mulcl 9601  ax-mulrcl 9602  ax-mulcom 9603  ax-addass 9604  ax-mulass 9605  ax-distr 9606  ax-i2m1 9607  ax-1ne0 9608  ax-1rid 9609  ax-rnegex 9610  ax-rrecex 9611  ax-cnre 9612  ax-pre-lttri 9613  ax-pre-lttrn 9614  ax-pre-ltadd 9615  ax-pre-mulgt0 9616  ax-pre-sup 9617
This theorem depends on definitions:  df-bi 189  df-or 372  df-an 373  df-3or 986  df-3an 987  df-tru 1447  df-ex 1664  df-nf 1668  df-sb 1798  df-eu 2303  df-mo 2304  df-clab 2438  df-cleq 2444  df-clel 2447  df-nfc 2581  df-ne 2624  df-nel 2625  df-ral 2742  df-rex 2743  df-reu 2744  df-rmo 2745  df-rab 2746  df-v 3047  df-sbc 3268  df-csb 3364  df-dif 3407  df-un 3409  df-in 3411  df-ss 3418  df-pss 3420  df-nul 3732  df-if 3882  df-pw 3953  df-sn 3969  df-pr 3971  df-tp 3973  df-op 3975  df-uni 4199  df-int 4235  df-iun 4280  df-br 4403  df-opab 4462  df-mpt 4463  df-tr 4498  df-eprel 4745  df-id 4749  df-po 4755  df-so 4756  df-fr 4793  df-we 4795  df-xp 4840  df-rel 4841  df-cnv 4842  df-co 4843  df-dm 4844  df-rn 4845  df-res 4846  df-ima 4847  df-pred 5380  df-ord 5426  df-on 5427  df-lim 5428  df-suc 5429  df-iota 5546  df-fun 5584  df-fn 5585  df-f 5586  df-f1 5587  df-fo 5588  df-f1o 5589  df-fv 5590  df-riota 6252  df-ov 6293  df-oprab 6294  df-mpt2 6295  df-om 6693  df-1st 6793  df-2nd 6794  df-wrecs 7028  df-recs 7090  df-rdg 7128  df-1o 7182  df-2o 7183  df-oadd 7186  df-er 7363  df-map 7474  df-en 7570  df-dom 7571  df-sdom 7572  df-fin 7573  df-sup 7956  df-inf 7957  df-card 8373  df-cda 8598  df-pnf 9677  df-mnf 9678  df-xr 9679  df-ltxr 9680  df-le 9681  df-sub 9862  df-neg 9863  df-div 10270  df-nn 10610  df-2 10668  df-3 10669  df-n0 10870  df-z 10938  df-uz 11160  df-q 11265  df-rp 11303  df-fz 11785  df-fzo 11916  df-fl 12028  df-mod 12097  df-seq 12214  df-exp 12273  df-hash 12516  df-cj 13162  df-re 13163  df-im 13164  df-sqrt 13298  df-abs 13299  df-dvds 14306  df-gcd 14469  df-prm 14623  df-odz 14712  df-phi 14714  df-pc 14787  df-odd 38756
This theorem is referenced by:  41prothprm  38919
  Copyright terms: Public domain W3C validator