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

Theorem prmdivdiv 13973
Description: The (modular) inverse of the inverse of a number is itself. (Contributed by Mario Carneiro, 24-Jan-2015.)
Hypothesis
Ref Expression
prmdiv.1  |-  R  =  ( ( A ^
( P  -  2 ) )  mod  P
)
Assertion
Ref Expression
prmdivdiv  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  =  ( ( R ^ ( P  - 
2 ) )  mod 
P ) )

Proof of Theorem prmdivdiv
StepHypRef Expression
1 1e0p1 10887 . . . . 5  |-  1  =  ( 0  +  1 )
21oveq1i 6203 . . . 4  |-  ( 1 ... ( P  - 
1 ) )  =  ( ( 0  +  1 ) ... ( P  -  1 ) )
3 0z 10761 . . . . 5  |-  0  e.  ZZ
4 fzp1ss 11616 . . . . 5  |-  ( 0  e.  ZZ  ->  (
( 0  +  1 ) ... ( P  -  1 ) ) 
C_  ( 0 ... ( P  -  1 ) ) )
53, 4ax-mp 5 . . . 4  |-  ( ( 0  +  1 ) ... ( P  - 
1 ) )  C_  ( 0 ... ( P  -  1 ) )
62, 5eqsstri 3487 . . 3  |-  ( 1 ... ( P  - 
1 ) )  C_  ( 0 ... ( P  -  1 ) )
7 simpr 461 . . 3  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  e.  ( 1 ... ( P  -  1 ) ) )
86, 7sseldi 3455 . 2  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  e.  ( 0 ... ( P  -  1 ) ) )
9 simpl 457 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  P  e.  Prime )
10 elfznn 11588 . . . . . . 7  |-  ( A  e.  ( 1 ... ( P  -  1 ) )  ->  A  e.  NN )
1110adantl 466 . . . . . 6  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  e.  NN )
1211nnzd 10850 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  e.  ZZ )
13 prmnn 13877 . . . . . 6  |-  ( P  e.  Prime  ->  P  e.  NN )
14 fzm1ndvds 13696 . . . . . 6  |-  ( ( P  e.  NN  /\  A  e.  ( 1 ... ( P  - 
1 ) ) )  ->  -.  P  ||  A
)
1513, 14sylan 471 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  -.  P  ||  A )
16 prmdiv.1 . . . . . 6  |-  R  =  ( ( A ^
( P  -  2 ) )  mod  P
)
1716prmdiv 13971 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ZZ  /\  -.  P  ||  A )  ->  ( R  e.  ( 1 ... ( P  - 
1 ) )  /\  P  ||  ( ( A  x.  R )  - 
1 ) ) )
189, 12, 15, 17syl3anc 1219 . . . 4  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  ( R  e.  ( 1 ... ( P  - 
1 ) )  /\  P  ||  ( ( A  x.  R )  - 
1 ) ) )
1918simprd 463 . . 3  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  P  ||  ( ( A  x.  R )  -  1 ) )
2011nncnd 10442 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  e.  CC )
2118simpld 459 . . . . . . 7  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  R  e.  ( 1 ... ( P  -  1 ) ) )
22 elfznn 11588 . . . . . . 7  |-  ( R  e.  ( 1 ... ( P  -  1 ) )  ->  R  e.  NN )
2321, 22syl 16 . . . . . 6  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  R  e.  NN )
2423nncnd 10442 . . . . 5  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  R  e.  CC )
2520, 24mulcomd 9511 . . . 4  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  ( A  x.  R )  =  ( R  x.  A ) )
2625oveq1d 6208 . . 3  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  (
( A  x.  R
)  -  1 )  =  ( ( R  x.  A )  - 
1 ) )
2719, 26breqtrd 4417 . 2  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  P  ||  ( ( R  x.  A )  -  1 ) )
28 elfzelz 11563 . . . 4  |-  ( R  e.  ( 1 ... ( P  -  1 ) )  ->  R  e.  ZZ )
2921, 28syl 16 . . 3  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  R  e.  ZZ )
3013adantr 465 . . . 4  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  P  e.  NN )
31 fzm1ndvds 13696 . . . 4  |-  ( ( P  e.  NN  /\  R  e.  ( 1 ... ( P  - 
1 ) ) )  ->  -.  P  ||  R
)
3230, 21, 31syl2anc 661 . . 3  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  -.  P  ||  R )
33 eqid 2451 . . . 4  |-  ( ( R ^ ( P  -  2 ) )  mod  P )  =  ( ( R ^
( P  -  2 ) )  mod  P
)
3433prmdiveq 13972 . . 3  |-  ( ( P  e.  Prime  /\  R  e.  ZZ  /\  -.  P  ||  R )  ->  (
( A  e.  ( 0 ... ( P  -  1 ) )  /\  P  ||  (
( R  x.  A
)  -  1 ) )  <->  A  =  (
( R ^ ( P  -  2 ) )  mod  P ) ) )
359, 29, 32, 34syl3anc 1219 . 2  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  (
( A  e.  ( 0 ... ( P  -  1 ) )  /\  P  ||  (
( R  x.  A
)  -  1 ) )  <->  A  =  (
( R ^ ( P  -  2 ) )  mod  P ) ) )
368, 27, 35mpbi2and 912 1  |-  ( ( P  e.  Prime  /\  A  e.  ( 1 ... ( P  -  1 ) ) )  ->  A  =  ( ( R ^ ( P  - 
2 ) )  mod 
P ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 184    /\ wa 369    = wceq 1370    e. wcel 1758    C_ wss 3429   class class class wbr 4393  (class class class)co 6193   0cc0 9386   1c1 9387    + caddc 9389    x. cmul 9391    - cmin 9699   NNcn 10426   2c2 10475   ZZcz 10750   ...cfz 11547    mod cmo 11818   ^cexp 11975    || cdivides 13646   Primecprime 13874
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1710  ax-7 1730  ax-8 1760  ax-9 1762  ax-10 1777  ax-11 1782  ax-12 1794  ax-13 1952  ax-ext 2430  ax-rep 4504  ax-sep 4514  ax-nul 4522  ax-pow 4571  ax-pr 4632  ax-un 6475  ax-cnex 9442  ax-resscn 9443  ax-1cn 9444  ax-icn 9445  ax-addcl 9446  ax-addrcl 9447  ax-mulcl 9448  ax-mulrcl 9449  ax-mulcom 9450  ax-addass 9451  ax-mulass 9452  ax-distr 9453  ax-i2m1 9454  ax-1ne0 9455  ax-1rid 9456  ax-rnegex 9457  ax-rrecex 9458  ax-cnre 9459  ax-pre-lttri 9460  ax-pre-lttrn 9461  ax-pre-ltadd 9462  ax-pre-mulgt0 9463  ax-pre-sup 9464
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1703  df-eu 2264  df-mo 2265  df-clab 2437  df-cleq 2443  df-clel 2446  df-nfc 2601  df-ne 2646  df-nel 2647  df-ral 2800  df-rex 2801  df-reu 2802  df-rmo 2803  df-rab 2804  df-v 3073  df-sbc 3288  df-csb 3390  df-dif 3432  df-un 3434  df-in 3436  df-ss 3443  df-pss 3445  df-nul 3739  df-if 3893  df-pw 3963  df-sn 3979  df-pr 3981  df-tp 3983  df-op 3985  df-uni 4193  df-int 4230  df-iun 4274  df-br 4394  df-opab 4452  df-mpt 4453  df-tr 4487  df-eprel 4733  df-id 4737  df-po 4742  df-so 4743  df-fr 4780  df-we 4782  df-ord 4823  df-on 4824  df-lim 4825  df-suc 4826  df-xp 4947  df-rel 4948  df-cnv 4949  df-co 4950  df-dm 4951  df-rn 4952  df-res 4953  df-ima 4954  df-iota 5482  df-fun 5521  df-fn 5522  df-f 5523  df-f1 5524  df-fo 5525  df-f1o 5526  df-fv 5527  df-riota 6154  df-ov 6196  df-oprab 6197  df-mpt2 6198  df-om 6580  df-1st 6680  df-2nd 6681  df-recs 6935  df-rdg 6969  df-1o 7023  df-2o 7024  df-oadd 7027  df-er 7204  df-map 7319  df-en 7414  df-dom 7415  df-sdom 7416  df-fin 7417  df-sup 7795  df-card 8213  df-cda 8441  df-pnf 9524  df-mnf 9525  df-xr 9526  df-ltxr 9527  df-le 9528  df-sub 9701  df-neg 9702  df-div 10098  df-nn 10427  df-2 10484  df-3 10485  df-n0 10684  df-z 10751  df-uz 10966  df-rp 11096  df-fz 11548  df-fzo 11659  df-fl 11752  df-mod 11819  df-seq 11917  df-exp 11976  df-hash 12214  df-cj 12699  df-re 12700  df-im 12701  df-sqr 12835  df-abs 12836  df-dvds 13647  df-gcd 13802  df-prm 13875  df-phi 13952
This theorem is referenced by:  wilthlem2  22533
  Copyright terms: Public domain W3C validator