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

Theorem lgslem1 20535
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 3298 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  Prime )
213ad2ant2 977 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  Prime )
3 prmnn 12761 . . . . . . . 8  |-  ( P  e.  Prime  ->  P  e.  NN )
42, 3syl 15 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  NN )
5 simp1 955 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  A  e.  ZZ )
6 prmz 12762 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  ZZ )
72, 6syl 15 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  ZZ )
8 gcdcom 12699 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ZZ )  ->  ( A  gcd  P
)  =  ( P  gcd  A ) )
95, 7, 8syl2anc 642 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A  gcd  P )  =  ( P  gcd  A
) )
10 simp3 957 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  -.  P  ||  A )
11 coprm 12779 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ )  ->  ( -.  P  ||  A  <->  ( P  gcd  A )  =  1 ) )
122, 5, 11syl2anc 642 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( -.  P  ||  A  <->  ( P  gcd  A )  =  1 ) )
1310, 12mpbid 201 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  gcd  A )  =  1 )
149, 13eqtrd 2315 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A  gcd  P )  =  1 )
15 eulerth 12851 . . . . . . 7  |-  ( ( P  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  P )  =  1 )  ->  (
( A ^ ( phi `  P ) )  mod  P )  =  ( 1  mod  P
) )
164, 5, 14, 15syl3anc 1182 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  mod  P )  =  ( 1  mod  P
) )
17 phiprm 12845 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  ( phi `  P )  =  ( P  -  1 ) )
182, 17syl 15 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( P  -  1 ) )
19 nnm1nn0 10005 . . . . . . . . . 10  |-  ( P  e.  NN  ->  ( P  -  1 )  e.  NN0 )
204, 19syl 15 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  -  1 )  e.  NN0 )
2118, 20eqeltrd 2357 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( phi `  P )  e. 
NN0 )
22 zexpcl 11118 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  ( phi `  P )  e.  NN0 )  -> 
( A ^ ( phi `  P ) )  e.  ZZ )
235, 21, 22syl2anc 642 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  e.  ZZ )
24 1z 10053 . . . . . . . 8  |-  1  e.  ZZ
2524a1i 10 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  1  e.  ZZ )
26 moddvds 12538 . . . . . . 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 1182 . . . . . 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 201 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  ||  ( ( A ^
( phi `  P
) )  -  1 ) )
2920nn0cnd 10020 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  -  1 )  e.  CC )
30 2cn 9816 . . . . . . . . . . . . 13  |-  2  e.  CC
3130a1i 10 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  CC )
32 2ne0 9829 . . . . . . . . . . . . 13  |-  2  =/=  0
3332a1i 10 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  =/=  0 )
3429, 31, 33divcan1d 9537 . . . . . . . . . . 11  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( P  - 
1 )  /  2
)  x.  2 )  =  ( P  - 
1 ) )
3518, 34eqtr4d 2318 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( ( ( P  -  1 )  / 
2 )  x.  2 ) )
3635oveq2d 5874 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  =  ( A ^ (
( ( P  - 
1 )  /  2
)  x.  2 ) ) )
375zcnd 10118 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  A  e.  CC )
38 2nn0 9982 . . . . . . . . . . 11  |-  2  e.  NN0
3938a1i 10 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  NN0 )
40 oddprm 12868 . . . . . . . . . . . 12  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN )
41403ad2ant2 977 . . . . . . . . . . 11  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN )
4241nnnn0d 10018 . . . . . . . . . 10  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN0 )
4337, 39, 42expmuld 11248 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( ( ( P  -  1 )  /  2 )  x.  2 ) )  =  ( ( A ^
( ( P  - 
1 )  /  2
) ) ^ 2 ) )
4436, 43eqtrd 2315 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  =  ( ( A ^
( ( P  - 
1 )  /  2
) ) ^ 2 ) )
4544oveq1d 5873 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  1 ) )
46 sq1 11198 . . . . . . . 8  |-  ( 1 ^ 2 )  =  1
4746oveq2i 5869 . . . . . . 7  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) ) ^ 2 )  -  ( 1 ^ 2 ) )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  1 )
4845, 47syl6eqr 2333 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) ) ^
2 )  -  (
1 ^ 2 ) ) )
49 zexpcl 11118 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( A ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
505, 42, 49syl2anc 642 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  ZZ )
5150zcnd 10118 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  CC )
52 ax-1cn 8795 . . . . . . 7  |-  1  e.  CC
53 subsq 11210 . . . . . . 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 643 . . . . . 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 2315 . . . . 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 4047 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  ||  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  x.  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 ) ) )
5750peano2zd 10120 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  e.  ZZ )
58 peano2zm 10062 . . . . . 6  |-  ( ( A ^ ( ( P  -  1 )  /  2 ) )  e.  ZZ  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 )  e.  ZZ )
5950, 58syl 15 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  -  1 )  e.  ZZ )
60 euclemma 12787 . . . . 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 1182 . . . 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 201 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  ( P  ||  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  \/  P  ||  ( ( A ^
( ( P  - 
1 )  /  2
) )  -  1 ) ) )
63 dvdsval3 12535 . . . . 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 642 . . . 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 10054 . . . . . . 7  |-  2  e.  ZZ
6665a1i 10 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  ZZ )
67 moddvds 12538 . . . . . 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 1182 . . . . 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 9815 . . . . . . . 8  |-  2  e.  RR
7069a1i 10 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  e.  RR )
714nnrpd 10389 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  RR+ )
7238nn0ge0i 9993 . . . . . . . 8  |-  0  <_  2
7372a1i 10 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  0  <_  2 )
74 prmuz2 12776 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
752, 74syl 15 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  ( ZZ>= `  2 )
)
76 eluzle 10240 . . . . . . . . 9  |-  ( P  e.  ( ZZ>= `  2
)  ->  2  <_  P )
7775, 76syl 15 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  <_  P )
78 eldifsni 3750 . . . . . . . . 9  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  =/=  2 )
79783ad2ant2 977 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  =/=  2 )
804nnred 9761 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  P  e.  RR )
8170, 80ltlend 8964 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
2  <  P  <->  ( 2  <_  P  /\  P  =/=  2 ) ) )
8277, 79, 81mpbir2and 888 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  2  <  P )
83 modid 10993 . . . . . . 7  |-  ( ( ( 2  e.  RR  /\  P  e.  RR+ )  /\  ( 0  <_  2  /\  2  <  P ) )  ->  ( 2  mod  P )  =  2 )
8470, 71, 73, 82, 83syl22anc 1183 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
2  mod  P )  =  2 )
8584eqeq2d 2294 . . . . 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 9804 . . . . . . . 8  |-  2  =  ( 1  +  1 )
8786oveq2i 5869 . . . . . . 7  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  -  2 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  -  (
1  +  1 ) )
8852a1i 10 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  1  e.  CC )
8951, 88, 88pnpcan2d 9195 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  -  ( 1  +  1 ) )  =  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  - 
1 ) )
9087, 89syl5eq 2327 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  -  2 )  =  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  - 
1 ) )
9190breq2d 4035 . . . . 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 275 . . . 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 690 . . 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 201 . 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 5883 . . 3  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  e. 
_V
9695elpr 3658 . 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 203 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 176    \/ wo 357    /\ w3a 934    = wceq 1623    e. wcel 1684    =/= wne 2446    \ cdif 3149   {csn 3640   {cpr 3641   class class class wbr 4023   ` cfv 5255  (class class class)co 5858   CCcc 8735   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    x. cmul 8742    < clt 8867    <_ cle 8868    - cmin 9037    / cdiv 9423   NNcn 9746   2c2 9795   NN0cn0 9965   ZZcz 10024   ZZ>=cuz 10230   RR+crp 10354    mod cmo 10973   ^cexp 11104    || cdivides 12531    gcd cgcd 12685   Primecprime 12758   phicphi 12832
This theorem is referenced by:  lgslem4  20538
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-2o 6480  df-oadd 6483  df-er 6660  df-map 6774  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-sup 7194  df-card 7572  df-cda 7794  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-2 9804  df-3 9805  df-n0 9966  df-z 10025  df-uz 10231  df-rp 10355  df-fz 10783  df-fzo 10871  df-fl 10925  df-mod 10974  df-seq 11047  df-exp 11105  df-hash 11338  df-cj 11584  df-re 11585  df-im 11586  df-sqr 11720  df-abs 11721  df-dvds 12532  df-gcd 12686  df-prm 12759  df-phi 12834
  Copyright terms: Public domain W3C validator