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

Theorem lgsvalmod 22634
Description: The Legendre symbol is equivalent to  a ^ (
( p  -  1 )  /  2 ),  mod  p. (Contributed by Mario Carneiro, 4-Feb-2015.)
Assertion
Ref Expression
lgsvalmod  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A  /L P )  mod  P )  =  ( ( A ^
( ( P  - 
1 )  /  2
) )  mod  P
) )

Proof of Theorem lgsvalmod
StepHypRef Expression
1 eldifi 3473 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  Prime )
21adantl 466 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  P  e.  Prime )
3 prmz 13759 . . . . . . 7  |-  ( P  e.  Prime  ->  P  e.  ZZ )
42, 3syl 16 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  P  e.  ZZ )
5 lgscl 22629 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ZZ )  ->  ( A  /L
P )  e.  ZZ )
64, 5syldan 470 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A  /L P )  e.  ZZ )
76zred 10739 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A  /L P )  e.  RR )
8 peano2re 9534 . . . 4  |-  ( ( A  /L P )  e.  RR  ->  ( ( A  /L
P )  +  1 )  e.  RR )
97, 8syl 16 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A  /L P )  +  1 )  e.  RR )
10 oddprm 13874 . . . . . . . 8  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN )
1110adantl 466 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( P  -  1 )  /  2 )  e.  NN )
1211nnnn0d 10628 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( P  -  1 )  /  2 )  e. 
NN0 )
13 zexpcl 11872 . . . . . 6  |-  ( ( A  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( A ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
1412, 13syldan 470 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  ZZ )
1514zred 10739 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  RR )
16 peano2re 9534 . . . 4  |-  ( ( A ^ ( ( P  -  1 )  /  2 ) )  e.  RR  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  e.  RR )
1715, 16syl 16 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  e.  RR )
18 neg1rr 10418 . . . 4  |-  -u 1  e.  RR
1918a1i 11 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  -u 1  e.  RR )
20 prmnn 13758 . . . . 5  |-  ( P  e.  Prime  ->  P  e.  NN )
212, 20syl 16 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  P  e.  NN )
2221nnrpd 11018 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  P  e.  RR+ )
23 lgsval3 22633 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A  /L P )  =  ( ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  -  1 ) )
2423eqcomd 2443 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  -  1 )  =  ( A  /L
P ) )
2517, 22modcld 11706 . . . . . . . 8  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  e.  RR )
2625recnd 9404 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  e.  CC )
27 ax-1cn 9332 . . . . . . . 8  |-  1  e.  CC
2827a1i 11 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  1  e.  CC )
297recnd 9404 . . . . . . 7  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A  /L P )  e.  CC )
3026, 28, 29subadd2d 9730 . . . . . 6  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( A  /L P )  <->  ( ( A  /L P )  +  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
) ) )
3124, 30mpbid 210 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A  /L P )  +  1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
) )
3231oveq1d 6101 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A  /L
P )  +  1 )  mod  P )  =  ( ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  mod 
P ) )
33 modabs2 11734 . . . . 5  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  e.  RR  /\  P  e.  RR+ )  -> 
( ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P )  mod  P
)  =  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P ) )
3417, 22, 33syl2anc 661 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  mod  P )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
) )
3532, 34eqtrd 2470 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A  /L
P )  +  1 )  mod  P )  =  ( ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  mod 
P ) )
36 modadd1 11737 . . 3  |-  ( ( ( ( ( A  /L P )  +  1 )  e.  RR  /\  ( ( A ^ ( ( P  -  1 )  /  2 ) )  +  1 )  e.  RR )  /\  ( -u 1  e.  RR  /\  P  e.  RR+ )  /\  ( ( ( A  /L P )  +  1 )  mod 
P )  =  ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P ) )  ->  ( (
( ( A  /L P )  +  1 )  +  -u
1 )  mod  P
)  =  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  +  -u 1
)  mod  P )
)
379, 17, 19, 22, 35, 36syl221anc 1229 . 2  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A  /L P )  +  1 )  +  -u
1 )  mod  P
)  =  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  +  -u 1
)  mod  P )
)
389recnd 9404 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A  /L P )  +  1 )  e.  CC )
39 negsub 9649 . . . . 5  |-  ( ( ( ( A  /L P )  +  1 )  e.  CC  /\  1  e.  CC )  ->  ( ( ( A  /L P )  +  1 )  +  -u 1 )  =  ( ( ( A  /L P )  +  1 )  - 
1 ) )
4038, 27, 39sylancl 662 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A  /L
P )  +  1 )  +  -u 1
)  =  ( ( ( A  /L
P )  +  1 )  -  1 ) )
41 pncan 9608 . . . . 5  |-  ( ( ( A  /L
P )  e.  CC  /\  1  e.  CC )  ->  ( ( ( A  /L P )  +  1 )  -  1 )  =  ( A  /L
P ) )
4229, 27, 41sylancl 662 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A  /L
P )  +  1 )  -  1 )  =  ( A  /L P ) )
4340, 42eqtrd 2470 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A  /L
P )  +  1 )  +  -u 1
)  =  ( A  /L P ) )
4443oveq1d 6101 . 2  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A  /L P )  +  1 )  +  -u
1 )  mod  P
)  =  ( ( A  /L P )  mod  P ) )
4517recnd 9404 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  e.  CC )
46 negsub 9649 . . . . 5  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  e.  CC  /\  1  e.  CC )  ->  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  +  -u
1 )  =  ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  -  1 ) )
4745, 27, 46sylancl 662 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  +  -u 1 )  =  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  -  1 ) )
4815recnd 9404 . . . . 5  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  CC )
49 pncan 9608 . . . . 5  |-  ( ( ( A ^ (
( P  -  1 )  /  2 ) )  e.  CC  /\  1  e.  CC )  ->  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  -  1 )  =  ( A ^ ( ( P  -  1 )  / 
2 ) ) )
5048, 27, 49sylancl 662 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  -  1 )  =  ( A ^ (
( P  -  1 )  /  2 ) ) )
5147, 50eqtrd 2470 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  +  -u 1 )  =  ( A ^ (
( P  -  1 )  /  2 ) ) )
5251oveq1d 6101 . 2  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  +  -u 1
)  mod  P )  =  ( ( A ^ ( ( P  -  1 )  / 
2 ) )  mod 
P ) )
5337, 44, 523eqtr3d 2478 1  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( ( A  /L P )  mod  P )  =  ( ( A ^
( ( P  - 
1 )  /  2
) )  mod  P
) )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    = wceq 1369    e. wcel 1756    \ cdif 3320   {csn 3872  (class class class)co 6086   CCcc 9272   RRcr 9273   1c1 9275    + caddc 9277    - cmin 9587   -ucneg 9588    / cdiv 9985   NNcn 10314   2c2 10363   NN0cn0 10571   ZZcz 10638   RR+crp 10983    mod cmo 11700   ^cexp 11857   Primecprime 13755    /Lclgs 22613
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2419  ax-rep 4398  ax-sep 4408  ax-nul 4416  ax-pow 4465  ax-pr 4526  ax-un 6367  ax-cnex 9330  ax-resscn 9331  ax-1cn 9332  ax-icn 9333  ax-addcl 9334  ax-addrcl 9335  ax-mulcl 9336  ax-mulrcl 9337  ax-mulcom 9338  ax-addass 9339  ax-mulass 9340  ax-distr 9341  ax-i2m1 9342  ax-1ne0 9343  ax-1rid 9344  ax-rnegex 9345  ax-rrecex 9346  ax-cnre 9347  ax-pre-lttri 9348  ax-pre-lttrn 9349  ax-pre-ltadd 9350  ax-pre-mulgt0 9351  ax-pre-sup 9352
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2256  df-mo 2257  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-nel 2604  df-ral 2715  df-rex 2716  df-reu 2717  df-rmo 2718  df-rab 2719  df-v 2969  df-sbc 3182  df-csb 3284  df-dif 3326  df-un 3328  df-in 3330  df-ss 3337  df-pss 3339  df-nul 3633  df-if 3787  df-pw 3857  df-sn 3873  df-pr 3875  df-tp 3877  df-op 3879  df-uni 4087  df-int 4124  df-iun 4168  df-br 4288  df-opab 4346  df-mpt 4347  df-tr 4381  df-eprel 4627  df-id 4631  df-po 4636  df-so 4637  df-fr 4674  df-we 4676  df-ord 4717  df-on 4718  df-lim 4719  df-suc 4720  df-xp 4841  df-rel 4842  df-cnv 4843  df-co 4844  df-dm 4845  df-rn 4846  df-res 4847  df-ima 4848  df-iota 5376  df-fun 5415  df-fn 5416  df-f 5417  df-f1 5418  df-fo 5419  df-f1o 5420  df-fv 5421  df-riota 6047  df-ov 6089  df-oprab 6090  df-mpt2 6091  df-om 6472  df-1st 6572  df-2nd 6573  df-recs 6824  df-rdg 6858  df-1o 6912  df-2o 6913  df-oadd 6916  df-er 7093  df-map 7208  df-en 7303  df-dom 7304  df-sdom 7305  df-fin 7306  df-sup 7683  df-card 8101  df-cda 8329  df-pnf 9412  df-mnf 9413  df-xr 9414  df-ltxr 9415  df-le 9416  df-sub 9589  df-neg 9590  df-div 9986  df-nn 10315  df-2 10372  df-3 10373  df-n0 10572  df-z 10639  df-uz 10854  df-q 10946  df-rp 10984  df-fz 11430  df-fzo 11541  df-fl 11634  df-mod 11701  df-seq 11799  df-exp 11858  df-hash 12096  df-cj 12580  df-re 12581  df-im 12582  df-sqr 12716  df-abs 12717  df-dvds 13528  df-gcd 13683  df-prm 13756  df-phi 13833  df-pc 13896  df-lgs 22614
This theorem is referenced by:  lgsdirprm  22648  lgsne0  22652  lgsqrlem3  22662
  Copyright terms: Public domain W3C validator