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

Theorem lgslem4 20950
Description: The function  F is closed in integers with absolute value less than  1 (namely  { -u
1 ,  0 ,  1 } although this representation is less useful to us). (Contributed by Mario Carneiro, 4-Feb-2015.)
Hypothesis
Ref Expression
lgslem2.z  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
Assertion
Ref Expression
lgslem4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  -  1 )  e.  Z )
Distinct variable group:    x, A
Allowed substitution hints:    P( x)    Z( x)

Proof of Theorem lgslem4
StepHypRef Expression
1 simpll 731 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  A  e.  ZZ )
2 oddprm 13116 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN )
32ad2antlr 708 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN )
43nnnn0d 10206 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN0 )
5 zexpcl 11323 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( A ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
61, 4, 5syl2anc 643 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  ZZ )
76zred 10307 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  RR )
8 0re 9024 . . . . . . . 8  |-  0  e.  RR
98a1i 11 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  0  e.  RR )
10 1re 9023 . . . . . . . 8  |-  1  e.  RR
1110a1i 11 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  1  e.  RR )
12 eldifi 3412 . . . . . . . . . . . 12  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  Prime )
1312ad2antlr 708 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  Prime )
14 prmuz2 13024 . . . . . . . . . . 11  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
1513, 14syl 16 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  ( ZZ>= `  2 )
)
16 eluz2b2 10480 . . . . . . . . . 10  |-  ( P  e.  ( ZZ>= `  2
)  <->  ( P  e.  NN  /\  1  < 
P ) )
1715, 16sylib 189 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( P  e.  NN  /\  1  <  P ) )
1817simpld 446 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  NN )
1918nnrpd 10579 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  RR+ )
20 0z 10225 . . . . . . . . . 10  |-  0  e.  ZZ
2120a1i 11 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  0  e.  ZZ )
22 simpr 448 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  ||  A )
23 dvdsval3 12783 . . . . . . . . . . . 12  |-  ( ( P  e.  NN  /\  A  e.  ZZ )  ->  ( P  ||  A  <->  ( A  mod  P )  =  0 ) )
2418, 1, 23syl2anc 643 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( P  ||  A  <->  ( A  mod  P )  =  0 ) )
2522, 24mpbid 202 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A  mod  P )  =  0 )
26 0mod 11199 . . . . . . . . . . 11  |-  ( P  e.  RR+  ->  ( 0  mod  P )  =  0 )
2719, 26syl 16 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
0  mod  P )  =  0 )
2825, 27eqtr4d 2422 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A  mod  P )  =  ( 0  mod  P
) )
29 modexp 11441 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  0  e.  ZZ )  /\  ( ( ( P  -  1 )  /  2 )  e. 
NN0  /\  P  e.  RR+ )  /\  ( A  mod  P )  =  ( 0  mod  P
) )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( ( 0 ^ ( ( P  -  1 )  / 
2 ) )  mod 
P ) )
301, 21, 4, 19, 28, 29syl221anc 1195 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( ( 0 ^ ( ( P  -  1 )  / 
2 ) )  mod 
P ) )
3130expd 11466 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
0 ^ ( ( P  -  1 )  /  2 ) )  =  0 )
3231oveq1d 6035 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( 0 ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( 0  mod 
P ) )
3330, 32eqtrd 2419 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( 0  mod 
P ) )
34 modadd1 11205 . . . . . . 7  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  e.  RR  /\  0  e.  RR )  /\  ( 1  e.  RR  /\  P  e.  RR+ )  /\  (
( A ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( 0  mod 
P ) )  -> 
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  ( ( 0  +  1 )  mod  P ) )
357, 9, 11, 19, 33, 34syl221anc 1195 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  ( ( 0  +  1 )  mod 
P ) )
36 0p1e1 10025 . . . . . . 7  |-  ( 0  +  1 )  =  1
3736oveq1i 6030 . . . . . 6  |-  ( ( 0  +  1 )  mod  P )  =  ( 1  mod  P
)
3835, 37syl6eq 2435 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  ( 1  mod 
P ) )
3918nnred 9947 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  RR )
4017simprd 450 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  1  <  P )
41 1mod 11200 . . . . . 6  |-  ( ( P  e.  RR  /\  1  <  P )  -> 
( 1  mod  P
)  =  1 )
4239, 40, 41syl2anc 643 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
1  mod  P )  =  1 )
4338, 42eqtrd 2419 . . . 4  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  1 )
4443oveq1d 6035 . . 3  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 10000 . . . 4  |-  ( 1  -  1 )  =  0
46 lgslem2.z . . . . . 6  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
4746lgslem2 20948 . . . . 5  |-  ( -u
1  e.  Z  /\  0  e.  Z  /\  1  e.  Z )
4847simp2i 967 . . . 4  |-  0  e.  Z
4945, 48eqeltri 2457 . . 3  |-  ( 1  -  1 )  e.  Z
5044, 49syl6eqel 2475 . 2  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
51 lgslem1 20947 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  e.  { 0 ,  2 } )
52 elpri 3777 . . . 4  |-  ( ( ( ( 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 ) )
53 oveq1 6027 . . . . . 6  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  0  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( 0  -  1 ) )
54 df-neg 9226 . . . . . . 7  |-  -u 1  =  ( 0  -  1 )
5547simp1i 966 . . . . . . 7  |-  -u 1  e.  Z
5654, 55eqeltrri 2458 . . . . . 6  |-  ( 0  -  1 )  e.  Z
5753, 56syl6eqel 2475 . . . . 5  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  0  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
58 oveq1 6027 . . . . . 6  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  2  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( 2  -  1 ) )
59 2m1e1 10027 . . . . . . 7  |-  ( 2  -  1 )  =  1
6047simp3i 968 . . . . . . 7  |-  1  e.  Z
6159, 60eqeltri 2457 . . . . . 6  |-  ( 2  -  1 )  e.  Z
6258, 61syl6eqel 2475 . . . . 5  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  2  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
6357, 62jaoi 369 . . . 4  |-  ( ( ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  0  \/  ( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  =  2 )  ->  ( ( ( ( A ^ (
( P  -  1 )  /  2 ) )  +  1 )  mod  P )  - 
1 )  e.  Z
)
6451, 52, 633syl 19 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
65643expa 1153 . 2  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
6650, 65pm2.61dan 767 1  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  -  1 )  e.  Z )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    <-> wb 177    \/ wo 358    /\ wa 359    /\ w3a 936    = wceq 1649    e. wcel 1717   {crab 2653    \ cdif 3260   {csn 3757   {cpr 3758   class class class wbr 4153   ` cfv 5394  (class class class)co 6020   RRcr 8922   0cc0 8923   1c1 8924    + caddc 8926    < clt 9053    <_ cle 9054    - cmin 9223   -ucneg 9224    / cdiv 9609   NNcn 9932   2c2 9981   NN0cn0 10153   ZZcz 10214   ZZ>=cuz 10420   RR+crp 10544    mod cmo 11177   ^cexp 11309   abscabs 11966    || cdivides 12779   Primecprime 13006
This theorem is referenced by:  lgsfcl2  20953
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2368  ax-rep 4261  ax-sep 4271  ax-nul 4279  ax-pow 4318  ax-pr 4344  ax-un 4641  ax-cnex 8979  ax-resscn 8980  ax-1cn 8981  ax-icn 8982  ax-addcl 8983  ax-addrcl 8984  ax-mulcl 8985  ax-mulrcl 8986  ax-mulcom 8987  ax-addass 8988  ax-mulass 8989  ax-distr 8990  ax-i2m1 8991  ax-1ne0 8992  ax-1rid 8993  ax-rnegex 8994  ax-rrecex 8995  ax-cnre 8996  ax-pre-lttri 8997  ax-pre-lttrn 8998  ax-pre-ltadd 8999  ax-pre-mulgt0 9000  ax-pre-sup 9001
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2242  df-mo 2243  df-clab 2374  df-cleq 2380  df-clel 2383  df-nfc 2512  df-ne 2552  df-nel 2553  df-ral 2654  df-rex 2655  df-reu 2656  df-rmo 2657  df-rab 2658  df-v 2901  df-sbc 3105  df-csb 3195  df-dif 3266  df-un 3268  df-in 3270  df-ss 3277  df-pss 3279  df-nul 3572  df-if 3683  df-pw 3744  df-sn 3763  df-pr 3764  df-tp 3765  df-op 3766  df-uni 3958  df-int 3993  df-iun 4037  df-br 4154  df-opab 4208  df-mpt 4209  df-tr 4244  df-eprel 4435  df-id 4439  df-po 4444  df-so 4445  df-fr 4482  df-we 4484  df-ord 4525  df-on 4526  df-lim 4527  df-suc 4528  df-om 4786  df-xp 4824  df-rel 4825  df-cnv 4826  df-co 4827  df-dm 4828  df-rn 4829  df-res 4830  df-ima 4831  df-iota 5358  df-fun 5396  df-fn 5397  df-f 5398  df-f1 5399  df-fo 5400  df-f1o 5401  df-fv 5402  df-ov 6023  df-oprab 6024  df-mpt2 6025  df-1st 6288  df-2nd 6289  df-riota 6485  df-recs 6569  df-rdg 6604  df-1o 6660  df-2o 6661  df-oadd 6664  df-er 6841  df-map 6956  df-en 7046  df-dom 7047  df-sdom 7048  df-fin 7049  df-sup 7381  df-card 7759  df-cda 7981  df-pnf 9055  df-mnf 9056  df-xr 9057  df-ltxr 9058  df-le 9059  df-sub 9225  df-neg 9226  df-div 9610  df-nn 9933  df-2 9990  df-3 9991  df-n0 10154  df-z 10215  df-uz 10421  df-rp 10545  df-fz 10976  df-fzo 11066  df-fl 11129  df-mod 11178  df-seq 11251  df-exp 11310  df-hash 11546  df-cj 11831  df-re 11832  df-im 11833  df-sqr 11967  df-abs 11968  df-dvds 12780  df-gcd 12934  df-prm 13007  df-phi 13082
  Copyright terms: Public domain W3C validator