MPE Home Metamath Proof Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  MPE Home  >  Th. List  >  lgslem1 Structured version   Unicode version

Theorem lgslem1 21082
Description: When  a is coprime to the prime  p,  a ^ ( ( p  -  1 )  / 
2 ) is equivalent  mod  p to  1 or  -u
1, and so adding  1 makes it equivalent to  0 or  2. (Contributed by Mario Carneiro, 4-Feb-2015.)
Assertion
Ref Expression
lgslem1  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  e.  { 0 ,  2 } )

Proof of Theorem lgslem1
StepHypRef Expression
1 eldifi 3471 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  Prime )
213ad2ant2 980 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  Prime )
3 prmnn 13084 . . . . . . . 8  |-  ( P  e.  Prime  ->  P  e.  NN )
42, 3syl 16 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  NN )
5 simp1 958 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  A  e.  ZZ )
6 prmz 13085 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  ZZ )
72, 6syl 16 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  ZZ )
8 gcdcom 13022 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ZZ )  ->  ( A  gcd  P
)  =  ( P  gcd  A ) )
95, 7, 8syl2anc 644 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A  gcd  P )  =  ( P  gcd  A
) )
10 simp3 960 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  -.  P  ||  A )
11 coprm 13102 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ )  ->  ( -.  P  ||  A  <->  ( P  gcd  A )  =  1 ) )
122, 5, 11syl2anc 644 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( -.  P  ||  A  <->  ( P  gcd  A )  =  1 ) )
1310, 12mpbid 203 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  gcd  A )  =  1 )
149, 13eqtrd 2470 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A  gcd  P )  =  1 )
15 eulerth 13174 . . . . . . 7  |-  ( ( P  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  P )  =  1 )  ->  (
( A ^ ( phi `  P ) )  mod  P )  =  ( 1  mod  P
) )
164, 5, 14, 15syl3anc 1185 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  mod  P )  =  ( 1  mod  P
) )
17 phiprm 13168 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  ( phi `  P )  =  ( P  -  1 ) )
182, 17syl 16 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( P  -  1 ) )
19 nnm1nn0 10263 . . . . . . . . . 10  |-  ( P  e.  NN  ->  ( P  -  1 )  e.  NN0 )
204, 19syl 16 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  -  1 )  e.  NN0 )
2118, 20eqeltrd 2512 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( phi `  P )  e. 
NN0 )
22 zexpcl 11398 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  ( phi `  P )  e.  NN0 )  -> 
( A ^ ( phi `  P ) )  e.  ZZ )
235, 21, 22syl2anc 644 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  e.  ZZ )
24 1z 10313 . . . . . . . 8  |-  1  e.  ZZ
2524a1i 11 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  1  e.  ZZ )
26 moddvds 12861 . . . . . . 7  |-  ( ( P  e.  NN  /\  ( A ^ ( phi `  P ) )  e.  ZZ  /\  1  e.  ZZ )  ->  (
( ( A ^
( phi `  P
) )  mod  P
)  =  ( 1  mod  P )  <->  P  ||  (
( A ^ ( phi `  P ) )  -  1 ) ) )
274, 23, 25, 26syl3anc 1185 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( phi `  P
) )  mod  P
)  =  ( 1  mod  P )  <->  P  ||  (
( A ^ ( phi `  P ) )  -  1 ) ) )
2816, 27mpbid 203 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  ||  ( ( A ^
( phi `  P
) )  -  1 ) )
2920nn0cnd 10278 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  -  1 )  e.  CC )
30 2cn 10072 . . . . . . . . . . . . 13  |-  2  e.  CC
3130a1i 11 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  CC )
32 2ne0 10085 . . . . . . . . . . . . 13  |-  2  =/=  0
3332a1i 11 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  =/=  0 )
3429, 31, 33divcan1d 9793 . . . . . . . . . . 11  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( P  - 
1 )  /  2
)  x.  2 )  =  ( P  - 
1 ) )
3518, 34eqtr4d 2473 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( ( ( P  -  1 )  / 
2 )  x.  2 ) )
3635oveq2d 6099 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  =  ( A ^ (
( ( P  - 
1 )  /  2
)  x.  2 ) ) )
375zcnd 10378 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  A  e.  CC )
38 2nn0 10240 . . . . . . . . . . 11  |-  2  e.  NN0
3938a1i 11 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  NN0 )
40 oddprm 13191 . . . . . . . . . . . 12  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN )
41403ad2ant2 980 . . . . . . . . . . 11  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN )
4241nnnn0d 10276 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN0 )
4337, 39, 42expmuld 11528 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( ( ( P  -  1 )  /  2 )  x.  2 ) )  =  ( ( A ^
( ( P  - 
1 )  /  2
) ) ^ 2 ) )
4436, 43eqtrd 2470 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  =  ( ( A ^
( ( P  - 
1 )  /  2
) ) ^ 2 ) )
4544oveq1d 6098 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  1 ) )
46 sq1 11478 . . . . . . . 8  |-  ( 1 ^ 2 )  =  1
4746oveq2i 6094 . . . . . . 7  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) ) ^ 2 )  -  ( 1 ^ 2 ) )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  1 )
4845, 47syl6eqr 2488 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  (
1 ^ 2 ) ) )
49 zexpcl 11398 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( A ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
505, 42, 49syl2anc 644 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  ZZ )
5150zcnd 10378 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  CC )
52 ax-1cn 9050 . . . . . . 7  |-  1  e.  CC
53 subsq 11490 . . . . . . 7  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  e.  CC  /\  1  e.  CC )  ->  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  (
1 ^ 2 ) )  =  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  x.  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  - 
1 ) ) )
5451, 52, 53sylancl 645 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) ) ^ 2 )  -  ( 1 ^ 2 ) )  =  ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  x.  ( ( A ^
( ( P  - 
1 )  /  2
) )  -  1 ) ) )
5548, 54eqtrd 2470 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  x.  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 ) ) )
5628, 55breqtrd 4238 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  ||  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  x.  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 ) ) )
5750peano2zd 10380 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  e.  ZZ )
58 peano2zm 10322 . . . . . 6  |-  ( ( A ^ ( ( P  -  1 )  /  2 ) )  e.  ZZ  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 )  e.  ZZ )
5950, 58syl 16 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 )  e.  ZZ )
60 euclemma 13110 . . . . 5  |-  ( ( P  e.  Prime  /\  (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  e.  ZZ  /\  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 )  e.  ZZ )  -> 
( P  ||  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  x.  ( ( A ^ ( ( P  -  1 )  /  2 ) )  -  1 ) )  <-> 
( P  ||  (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  \/  P  ||  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 ) ) ) )
612, 57, 59, 60syl3anc 1185 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  ||  ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  x.  ( ( A ^
( ( P  - 
1 )  /  2
) )  -  1 ) )  <->  ( P  ||  ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  \/  P  ||  ( ( A ^
( ( P  - 
1 )  /  2
) )  -  1 ) ) ) )
6256, 61mpbid 203 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  ||  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  \/  P  ||  ( ( A ^
( ( P  - 
1 )  /  2
) )  -  1 ) ) )
63 dvdsval3 12858 . . . . 5  |-  ( ( P  e.  NN  /\  ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  e.  ZZ )  ->  ( P  ||  ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  <->  ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  =  0 ) )
644, 57, 63syl2anc 644 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  ||  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  <->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  =  0 ) )
65 2z 10314 . . . . . . 7  |-  2  e.  ZZ
6665a1i 11 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  ZZ )
67 moddvds 12861 . . . . . 6  |-  ( ( P  e.  NN  /\  ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  e.  ZZ  /\  2  e.  ZZ )  ->  ( ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  =  ( 2  mod  P )  <-> 
P  ||  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  -  2 ) ) )
684, 57, 66, 67syl3anc 1185 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  ( 2  mod  P )  <->  P  ||  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  -  2 ) ) )
69 2re 10071 . . . . . . . 8  |-  2  e.  RR
7069a1i 11 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  RR )
714nnrpd 10649 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  RR+ )
7238nn0ge0i 10251 . . . . . . . 8  |-  0  <_  2
7372a1i 11 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  0  <_  2 )
74 prmuz2 13099 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
752, 74syl 16 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  ( ZZ>= `  2 )
)
76 eluzle 10500 . . . . . . . . 9  |-  ( P  e.  ( ZZ>= `  2
)  ->  2  <_  P )
7775, 76syl 16 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  <_  P )
78 eldifsni 3930 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  =/=  2 )
79783ad2ant2 980 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  =/=  2 )
804nnred 10017 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  RR )
8170, 80ltlend 9220 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
2  <  P  <->  ( 2  <_  P  /\  P  =/=  2 ) ) )
8277, 79, 81mpbir2and 890 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  <  P )
83 modid 11272 . . . . . . 7  |-  ( ( ( 2  e.  RR  /\  P  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  P ) )  ->  ( 2  mod  P )  =  2 )
8470, 71, 73, 82, 83syl22anc 1186 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
2  mod  P )  =  2 )
8584eqeq2d 2449 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  ( 2  mod  P )  <->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  =  2 ) )
86 df-2 10060 . . . . . . . 8  |-  2  =  ( 1  +  1 )
8786oveq2i 6094 . . . . . . 7  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  -  2 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  -  (
1  +  1 ) )
8852a1i 11 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  1  e.  CC )
8951, 88, 88pnpcan2d 9451 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  -  ( 1  +  1 ) )  =  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  - 
1 ) )
9087, 89syl5eq 2482 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  -  2 )  =  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  - 
1 ) )
9190breq2d 4226 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  ||  ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  - 
2 )  <->  P  ||  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 ) ) )
9268, 85, 913bitr3rd 277 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  ||  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  - 
1 )  <->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  =  2 ) )
9364, 92orbi12d 692 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( P  ||  (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  \/  P  ||  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 ) )  <->  ( ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  =  0  \/  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  =  2 ) ) )
9462, 93mpbid 203 . 2  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  0  \/  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  2 ) )
95 ovex 6108 . . 3  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  e. 
_V
9695elpr 3834 . 2  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  e.  { 0 ,  2 }  <->  ( (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  0  \/  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  2 ) )
9794, 96sylibr 205 1  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  e.  { 0 ,  2 } )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 178    \/ wo 359    /\ w3a 937    = wceq 1653    e. wcel 1726    =/= wne 2601    \ cdif 3319   {csn 3816   {cpr 3817   class class class wbr 4214   ` cfv 5456  (class class class)co 6083   CCcc 8990   RRcr 8991   0cc0 8992   1c1 8993    + caddc 8995    x. cmul 8997    < clt 9122    <_ cle 9123    - cmin 9293    / cdiv 9679   NNcn 10002   2c2 10051   NN0cn0 10223   ZZcz 10284   ZZ>=cuz 10490   RR+crp 10614    mod cmo 11252   ^cexp 11384    || cdivides 12854    gcd cgcd 13008   Primecprime 13081   phicphi 13155
This theorem is referenced by:  lgslem4  21085
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-rep 4322  ax-sep 4332  ax-nul 4340  ax-pow 4379  ax-pr 4405  ax-un 4703  ax-cnex 9048  ax-resscn 9049  ax-1cn 9050  ax-icn 9051  ax-addcl 9052  ax-addrcl 9053  ax-mulcl 9054  ax-mulrcl 9055  ax-mulcom 9056  ax-addass 9057  ax-mulass 9058  ax-distr 9059  ax-i2m1 9060  ax-1ne0 9061  ax-1rid 9062  ax-rnegex 9063  ax-rrecex 9064  ax-cnre 9065  ax-pre-lttri 9066  ax-pre-lttrn 9067  ax-pre-ltadd 9068  ax-pre-mulgt0 9069  ax-pre-sup 9070
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2712  df-rex 2713  df-reu 2714  df-rmo 2715  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-int 4053  df-iun 4097  df-br 4215  df-opab 4269  df-mpt 4270  df-tr 4305  df-eprel 4496  df-id 4500  df-po 4505  df-so 4506  df-fr 4543  df-we 4545  df-ord 4586  df-on 4587  df-lim 4588  df-suc 4589  df-om 4848  df-xp 4886  df-rel 4887  df-cnv 4888  df-co 4889  df-dm 4890  df-rn 4891  df-res 4892  df-ima 4893  df-iota 5420  df-fun 5458  df-fn 5459  df-f 5460  df-f1 5461  df-fo 5462  df-f1o 5463  df-fv 5464  df-ov 6086  df-oprab 6087  df-mpt2 6088  df-1st 6351  df-2nd 6352  df-riota 6551  df-recs 6635  df-rdg 6670  df-1o 6726  df-2o 6727  df-oadd 6730  df-er 6907  df-map 7022  df-en 7112  df-dom 7113  df-sdom 7114  df-fin 7115  df-sup 7448  df-card 7828  df-cda 8050  df-pnf 9124  df-mnf 9125  df-xr 9126  df-ltxr 9127  df-le 9128  df-sub 9295  df-neg 9296  df-div 9680  df-nn 10003  df-2 10060  df-3 10061  df-n0 10224  df-z 10285  df-uz 10491  df-rp 10615  df-fz 11046  df-fzo 11138  df-fl 11204  df-mod 11253  df-seq 11326  df-exp 11385  df-hash 11621  df-cj 11906  df-re 11907  df-im 11908  df-sqr 12042  df-abs 12043  df-dvds 12855  df-gcd 13009  df-prm 13082  df-phi 13157
  Copyright terms: Public domain W3C validator