ILE Home Intuitionistic Logic Explorer < Previous   Next >
Nearby theorems
Mirrors  >  Home  >  ILE Home  >  Th. List  >  prmdiv Unicode version

Theorem prmdiv 12110
Description: Show an explicit expression for the modular inverse of  A  mod  P. (Contributed by Mario Carneiro, 24-Jan-2015.)
Hypothesis
Ref Expression
prmdiv.1  |-  R  =  ( ( A ^
( P  -  2 ) )  mod  P
)
Assertion
Ref Expression
prmdiv  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  e.  ( 1 ... ( P  - 
1 ) )  /\  P  ||  ( ( A  x.  R )  - 
1 ) ) )

Proof of Theorem prmdiv
StepHypRef Expression
1 nprmdvds1 12017 . . . . . 6  |-  ( P  e.  Prime  ->  -.  P  ||  1 )
213ad2ant1 1003 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  -.  P  ||  1 )
3 prmz 11988 . . . . . . . . . 10  |-  ( P  e.  Prime  ->  P  e.  ZZ )
433ad2ant1 1003 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  e.  ZZ )
5 simp2 983 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  A  e.  ZZ )
6 phiprm 12098 . . . . . . . . . . . . 13  |-  ( P  e.  Prime  ->  ( phi `  P )  =  ( P  -  1 ) )
763ad2ant1 1003 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( P  -  1 ) )
8 prmnn 11987 . . . . . . . . . . . . . 14  |-  ( P  e.  Prime  ->  P  e.  NN )
983ad2ant1 1003 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  e.  NN )
10 nnm1nn0 9131 . . . . . . . . . . . . 13  |-  ( P  e.  NN  ->  ( P  -  1 )  e.  NN0 )
119, 10syl 14 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  -  1 )  e.  NN0 )
127, 11eqeltrd 2234 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( phi `  P )  e. 
NN0 )
13 zexpcl 10434 . . . . . . . . . . 11  |-  ( ( A  e.  ZZ  /\  ( phi `  P )  e.  NN0 )  -> 
( A ^ ( phi `  P ) )  e.  ZZ )
145, 12, 13syl2anc 409 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  e.  ZZ )
15 1z 9193 . . . . . . . . . 10  |-  1  e.  ZZ
16 zsubcl 9208 . . . . . . . . . 10  |-  ( ( ( A ^ ( phi `  P ) )  e.  ZZ  /\  1  e.  ZZ )  ->  (
( A ^ ( phi `  P ) )  -  1 )  e.  ZZ )
1714, 15, 16sylancl 410 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  1 )  e.  ZZ )
18 prmuz2 12008 . . . . . . . . . . . . . . . 16  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
19183ad2ant1 1003 . . . . . . . . . . . . . . 15  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  e.  ( ZZ>= `  2 )
)
20 uznn0sub 9470 . . . . . . . . . . . . . . 15  |-  ( P  e.  ( ZZ>= `  2
)  ->  ( P  -  2 )  e. 
NN0 )
2119, 20syl 14 . . . . . . . . . . . . . 14  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  -  2 )  e.  NN0 )
22 zexpcl 10434 . . . . . . . . . . . . . 14  |-  ( ( A  e.  ZZ  /\  ( P  -  2
)  e.  NN0 )  ->  ( A ^ ( P  -  2 ) )  e.  ZZ )
235, 21, 22syl2anc 409 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( P  - 
2 ) )  e.  ZZ )
24 znq 9533 . . . . . . . . . . . . 13  |-  ( ( ( A ^ ( P  -  2 ) )  e.  ZZ  /\  P  e.  NN )  ->  ( ( A ^
( P  -  2 ) )  /  P
)  e.  QQ )
2523, 9, 24syl2anc 409 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( P  -  2 ) )  /  P )  e.  QQ )
2625flqcld 10176 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) )  e.  ZZ )
275, 26zmulcld 9292 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) )  e.  ZZ )
284, 27zmulcld 9292 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) )  e.  ZZ )
295, 4gcdcomd 11858 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  gcd  P )  =  ( P  gcd  A
) )
30 coprm 12019 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ )  ->  ( -.  P  ||  A  <->  ( P  gcd  A )  =  1 ) )
3130biimp3a 1327 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  gcd  A )  =  1 )
3229, 31eqtrd 2190 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  gcd  P )  =  1 )
33 eulerth 12108 . . . . . . . . . . 11  |-  ( ( P  e.  NN  /\  A  e.  ZZ  /\  ( A  gcd  P )  =  1 )  ->  (
( A ^ ( phi `  P ) )  mod  P )  =  ( 1  mod  P
) )
349, 5, 32, 33syl3anc 1220 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  mod  P )  =  ( 1  mod  P
) )
35 1zzd 9194 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  1  e.  ZZ )
36 moddvds 11695 . . . . . . . . . . 11  |-  ( ( P  e.  NN  /\  ( A ^ ( phi `  P ) )  e.  ZZ  /\  1  e.  ZZ )  ->  (
( ( A ^
( phi `  P
) )  mod  P
)  =  ( 1  mod  P )  <->  P  ||  (
( A ^ ( phi `  P ) )  -  1 ) ) )
379, 14, 35, 36syl3anc 1220 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( ( A ^
( phi `  P
) )  mod  P
)  =  ( 1  mod  P )  <->  P  ||  (
( A ^ ( phi `  P ) )  -  1 ) ) )
3834, 37mpbid 146 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  ||  ( ( A ^
( phi `  P
) )  -  1 ) )
39 dvdsmul1 11709 . . . . . . . . . 10  |-  ( ( P  e.  ZZ  /\  ( A  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) )  e.  ZZ )  ->  P  ||  ( P  x.  ( A  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) )
404, 27, 39syl2anc 409 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  ||  ( P  x.  ( A  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) ) ) )
414, 17, 28, 38, 40dvds2subd 11723 . . . . . . . 8  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  ||  ( ( ( A ^ ( phi `  P ) )  - 
1 )  -  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) ) ) )
425zcnd 9287 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  A  e.  CC )
4323zcnd 9287 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( P  - 
2 ) )  e.  CC )
444, 26zmulcld 9292 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) )  e.  ZZ )
4544zcnd 9287 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) )  e.  CC )
4642, 43, 45subdid 8289 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  x.  ( ( A ^ ( P  - 
2 ) )  -  ( P  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) )  =  ( ( A  x.  ( A ^ ( P  - 
2 ) ) )  -  ( A  x.  ( P  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) ) )
47 prmdiv.1 . . . . . . . . . . . . 13  |-  R  =  ( ( A ^
( P  -  2 ) )  mod  P
)
48 zq 9535 . . . . . . . . . . . . . . 15  |-  ( ( A ^ ( P  -  2 ) )  e.  ZZ  ->  ( A ^ ( P  - 
2 ) )  e.  QQ )
4923, 48syl 14 . . . . . . . . . . . . . 14  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( P  - 
2 ) )  e.  QQ )
50 nnq 9542 . . . . . . . . . . . . . . 15  |-  ( P  e.  NN  ->  P  e.  QQ )
519, 50syl 14 . . . . . . . . . . . . . 14  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  e.  QQ )
529nngt0d 8877 . . . . . . . . . . . . . 14  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  0  <  P )
53 modqval 10223 . . . . . . . . . . . . . 14  |-  ( ( ( A ^ ( P  -  2 ) )  e.  QQ  /\  P  e.  QQ  /\  0  <  P )  ->  (
( A ^ ( P  -  2 ) )  mod  P )  =  ( ( A ^ ( P  - 
2 ) )  -  ( P  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) )
5449, 51, 52, 53syl3anc 1220 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( P  -  2 ) )  mod  P )  =  ( ( A ^ ( P  - 
2 ) )  -  ( P  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) )
5547, 54syl5eq 2202 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  R  =  ( ( A ^ ( P  - 
2 ) )  -  ( P  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) )
5655oveq2d 5840 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  x.  R )  =  ( A  x.  ( ( A ^
( P  -  2 ) )  -  ( P  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) ) ) ) )
57 2m1e1 8951 . . . . . . . . . . . . . . . . 17  |-  ( 2  -  1 )  =  1
5857oveq2i 5835 . . . . . . . . . . . . . . . 16  |-  ( P  -  ( 2  -  1 ) )  =  ( P  -  1 )
597, 58eqtr4di 2208 . . . . . . . . . . . . . . 15  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( P  -  (
2  -  1 ) ) )
609nncnd 8847 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  e.  CC )
61 2cnd 8906 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  2  e.  CC )
62 1cnd 7894 . . . . . . . . . . . . . . . 16  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  1  e.  CC )
6360, 61, 62subsubd 8214 . . . . . . . . . . . . . . 15  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  -  ( 2  -  1 ) )  =  ( ( P  -  2 )  +  1 ) )
6459, 63eqtrd 2190 . . . . . . . . . . . . . 14  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( phi `  P )  =  ( ( P  - 
2 )  +  1 ) )
6564oveq2d 5840 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  =  ( A ^ (
( P  -  2 )  +  1 ) ) )
6642, 21expp1d 10552 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( ( P  -  2 )  +  1 ) )  =  ( ( A ^
( P  -  2 ) )  x.  A
) )
6743, 42mulcomd 7899 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( P  -  2 ) )  x.  A )  =  ( A  x.  ( A ^ ( P  -  2 ) ) ) )
6865, 66, 673eqtrd 2194 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  =  ( A  x.  ( A ^ ( P  - 
2 ) ) ) )
6926zcnd 9287 . . . . . . . . . . . . 13  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) )  e.  CC )
7060, 42, 69mul12d 8027 . . . . . . . . . . . 12  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) )  =  ( A  x.  ( P  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) ) ) )
7168, 70oveq12d 5842 . . . . . . . . . . 11  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( phi `  P ) )  -  ( P  x.  ( A  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) )  =  ( ( A  x.  ( A ^ ( P  - 
2 ) ) )  -  ( A  x.  ( P  x.  ( |_ `  ( ( A ^ ( P  - 
2 ) )  /  P ) ) ) ) ) )
7246, 56, 713eqtr4d 2200 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  x.  R )  =  ( ( A ^ ( phi `  P ) )  -  ( P  x.  ( A  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) ) ) ) )
7372oveq1d 5839 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A  x.  R
)  -  1 )  =  ( ( ( A ^ ( phi `  P ) )  -  ( P  x.  ( A  x.  ( |_ `  ( ( A ^
( P  -  2 ) )  /  P
) ) ) ) )  -  1 ) )
7414zcnd 9287 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A ^ ( phi `  P ) )  e.  CC )
7528zcnd 9287 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) )  e.  CC )
7674, 75, 62sub32d 8218 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( ( A ^
( phi `  P
) )  -  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) ) )  -  1 )  =  ( ( ( A ^ ( phi `  P ) )  - 
1 )  -  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) ) ) )
7773, 76eqtrd 2190 . . . . . . . 8  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A  x.  R
)  -  1 )  =  ( ( ( A ^ ( phi `  P ) )  - 
1 )  -  ( P  x.  ( A  x.  ( |_ `  (
( A ^ ( P  -  2 ) )  /  P ) ) ) ) ) )
7841, 77breqtrrd 3992 . . . . . . 7  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  P  ||  ( ( A  x.  R )  -  1 ) )
79 oveq2 5832 . . . . . . . . 9  |-  ( R  =  0  ->  ( A  x.  R )  =  ( A  x.  0 ) )
8079oveq1d 5839 . . . . . . . 8  |-  ( R  =  0  ->  (
( A  x.  R
)  -  1 )  =  ( ( A  x.  0 )  - 
1 ) )
8180breq2d 3977 . . . . . . 7  |-  ( R  =  0  ->  ( P  ||  ( ( A  x.  R )  - 
1 )  <->  P  ||  (
( A  x.  0 )  -  1 ) ) )
8278, 81syl5ibcom 154 . . . . . 6  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  =  0  ->  P 
||  ( ( A  x.  0 )  - 
1 ) ) )
8342mul01d 8268 . . . . . . . . . 10  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( A  x.  0 )  =  0 )
8483oveq1d 5839 . . . . . . . . 9  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A  x.  0 )  -  1 )  =  ( 0  -  1 ) )
85 df-neg 8049 . . . . . . . . 9  |-  -u 1  =  ( 0  -  1 )
8684, 85eqtr4di 2208 . . . . . . . 8  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A  x.  0 )  -  1 )  =  -u 1 )
8786breq2d 3977 . . . . . . 7  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  ||  ( ( A  x.  0 )  - 
1 )  <->  P  ||  -u 1
) )
88 dvdsnegb 11704 . . . . . . . 8  |-  ( ( P  e.  ZZ  /\  1  e.  ZZ )  ->  ( P  ||  1  <->  P 
||  -u 1 ) )
894, 15, 88sylancl 410 . . . . . . 7  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  ||  1  <->  P  ||  -u 1
) )
9087, 89bitr4d 190 . . . . . 6  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  ||  ( ( A  x.  0 )  - 
1 )  <->  P  ||  1
) )
9182, 90sylibd 148 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  =  0  ->  P 
||  1 ) )
922, 91mtod 653 . . . 4  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  -.  R  =  0 )
93 zmodfz 10245 . . . . . . . 8  |-  ( ( ( A ^ ( P  -  2 ) )  e.  ZZ  /\  P  e.  NN )  ->  ( ( A ^
( P  -  2 ) )  mod  P
)  e.  ( 0 ... ( P  - 
1 ) ) )
9423, 9, 93syl2anc 409 . . . . . . 7  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  (
( A ^ ( P  -  2 ) )  mod  P )  e.  ( 0 ... ( P  -  1 ) ) )
9547, 94eqeltrid 2244 . . . . . 6  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  R  e.  ( 0 ... ( P  -  1 ) ) )
96 nn0uz 9473 . . . . . . . 8  |-  NN0  =  ( ZZ>= `  0 )
9711, 96eleqtrdi 2250 . . . . . . 7  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( P  -  1 )  e.  ( ZZ>= `  0
) )
98 elfzp12 10001 . . . . . . 7  |-  ( ( P  -  1 )  e.  ( ZZ>= `  0
)  ->  ( R  e.  ( 0 ... ( P  -  1 ) )  <->  ( R  =  0  \/  R  e.  ( ( 0  +  1 ) ... ( P  -  1 ) ) ) ) )
9997, 98syl 14 . . . . . 6  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  e.  ( 0 ... ( P  - 
1 ) )  <->  ( R  =  0  \/  R  e.  ( ( 0  +  1 ) ... ( P  -  1 ) ) ) ) )
10095, 99mpbid 146 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  =  0  \/  R  e.  ( (
0  +  1 ) ... ( P  - 
1 ) ) ) )
101100ord 714 . . . 4  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( -.  R  =  0  ->  R  e.  ( ( 0  +  1 ) ... ( P  - 
1 ) ) ) )
10292, 101mpd 13 . . 3  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  R  e.  ( ( 0  +  1 ) ... ( P  -  1 ) ) )
103 1e0p1 9336 . . . 4  |-  1  =  ( 0  +  1 )
104103oveq1i 5834 . . 3  |-  ( 1 ... ( P  - 
1 ) )  =  ( ( 0  +  1 ) ... ( P  -  1 ) )
105102, 104eleqtrrdi 2251 . 2  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  R  e.  ( 1 ... ( P  -  1 ) ) )
106105, 78jca 304 1  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  e.  ( 1 ... ( P  - 
1 ) )  /\  P  ||  ( ( A  x.  R )  - 
1 ) ) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 103    <-> wb 104    \/ wo 698    /\ w3a 963    = wceq 1335    e. wcel 2128   class class class wbr 3965   ` cfv 5170  (class class class)co 5824   0cc0 7732   1c1 7733    + caddc 7735    x. cmul 7737    < clt 7912    - cmin 8046   -ucneg 8047    / cdiv 8545   NNcn 8833   2c2 8884   NN0cn0 9090   ZZcz 9167   ZZ>=cuz 9439   QQcq 9528   ...cfz 9912   |_cfl 10167    mod cmo 10221   ^cexp 10418    || cdvds 11683    gcd cgcd 11829   Primecprime 11984   phicphi 12084
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-ia1 105  ax-ia2 106  ax-ia3 107  ax-in1 604  ax-in2 605  ax-io 699  ax-5 1427  ax-7 1428  ax-gen 1429  ax-ie1 1473  ax-ie2 1474  ax-8 1484  ax-10 1485  ax-11 1486  ax-i12 1487  ax-bndl 1489  ax-4 1490  ax-17 1506  ax-i9 1510  ax-ial 1514  ax-i5r 1515  ax-13 2130  ax-14 2131  ax-ext 2139  ax-coll 4079  ax-sep 4082  ax-nul 4090  ax-pow 4135  ax-pr 4169  ax-un 4393  ax-setind 4496  ax-iinf 4547  ax-cnex 7823  ax-resscn 7824  ax-1cn 7825  ax-1re 7826  ax-icn 7827  ax-addcl 7828  ax-addrcl 7829  ax-mulcl 7830  ax-mulrcl 7831  ax-addcom 7832  ax-mulcom 7833  ax-addass 7834  ax-mulass 7835  ax-distr 7836  ax-i2m1 7837  ax-0lt1 7838  ax-1rid 7839  ax-0id 7840  ax-rnegex 7841  ax-precex 7842  ax-cnre 7843  ax-pre-ltirr 7844  ax-pre-ltwlin 7845  ax-pre-lttrn 7846  ax-pre-apti 7847  ax-pre-ltadd 7848  ax-pre-mulgt0 7849  ax-pre-mulext 7850  ax-arch 7851  ax-caucvg 7852
This theorem depends on definitions:  df-bi 116  df-stab 817  df-dc 821  df-3or 964  df-3an 965  df-tru 1338  df-fal 1341  df-nf 1441  df-sb 1743  df-eu 2009  df-mo 2010  df-clab 2144  df-cleq 2150  df-clel 2153  df-nfc 2288  df-ne 2328  df-nel 2423  df-ral 2440  df-rex 2441  df-reu 2442  df-rmo 2443  df-rab 2444  df-v 2714  df-sbc 2938  df-csb 3032  df-dif 3104  df-un 3106  df-in 3108  df-ss 3115  df-nul 3395  df-if 3506  df-pw 3545  df-sn 3566  df-pr 3567  df-op 3569  df-uni 3773  df-int 3808  df-iun 3851  df-br 3966  df-opab 4026  df-mpt 4027  df-tr 4063  df-id 4253  df-po 4256  df-iso 4257  df-iord 4326  df-on 4328  df-ilim 4329  df-suc 4331  df-iom 4550  df-xp 4592  df-rel 4593  df-cnv 4594  df-co 4595  df-dm 4596  df-rn 4597  df-res 4598  df-ima 4599  df-iota 5135  df-fun 5172  df-fn 5173  df-f 5174  df-f1 5175  df-fo 5176  df-f1o 5177  df-fv 5178  df-isom 5179  df-riota 5780  df-ov 5827  df-oprab 5828  df-mpo 5829  df-1st 6088  df-2nd 6089  df-recs 6252  df-irdg 6317  df-frec 6338  df-1o 6363  df-2o 6364  df-oadd 6367  df-er 6480  df-en 6686  df-dom 6687  df-fin 6688  df-sup 6928  df-pnf 7914  df-mnf 7915  df-xr 7916  df-ltxr 7917  df-le 7918  df-sub 8048  df-neg 8049  df-reap 8450  df-ap 8457  df-div 8546  df-inn 8834  df-2 8892  df-3 8893  df-4 8894  df-n0 9091  df-z 9168  df-uz 9440  df-q 9529  df-rp 9561  df-fz 9913  df-fzo 10042  df-fl 10169  df-mod 10222  df-seqfrec 10345  df-exp 10419  df-ihash 10650  df-cj 10742  df-re 10743  df-im 10744  df-rsqrt 10898  df-abs 10899  df-clim 11176  df-proddc 11448  df-dvds 11684  df-gcd 11830  df-prm 11985  df-phi 12086
This theorem is referenced by:  prmdiveq  12111  prmdivdiv  12112  modprminv  12124
  Copyright terms: Public domain W3C validator