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

Theorem lgslem4 20538
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 730 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  A  e.  ZZ )
2 oddprm 12868 . . . . . . . . . . 11  |-  ( P  e.  ( Prime  \  {
2 } )  -> 
( ( P  - 
1 )  /  2
)  e.  NN )
32ad2antlr 707 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN )
43nnnn0d 10018 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( P  -  1 )  /  2 )  e.  NN0 )
5 zexpcl 11118 . . . . . . . . 9  |-  ( ( A  e.  ZZ  /\  ( ( P  - 
1 )  /  2
)  e.  NN0 )  ->  ( A ^ (
( P  -  1 )  /  2 ) )  e.  ZZ )
61, 4, 5syl2anc 642 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  ZZ )
76zred 10117 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A ^ ( ( P  -  1 )  / 
2 ) )  e.  RR )
8 0re 8838 . . . . . . . 8  |-  0  e.  RR
98a1i 10 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  0  e.  RR )
10 1re 8837 . . . . . . . 8  |-  1  e.  RR
1110a1i 10 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  1  e.  RR )
12 eldifi 3298 . . . . . . . . . . . 12  |-  ( P  e.  ( Prime  \  {
2 } )  ->  P  e.  Prime )
1312ad2antlr 707 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  Prime )
14 prmuz2 12776 . . . . . . . . . . 11  |-  ( P  e.  Prime  ->  P  e.  ( ZZ>= `  2 )
)
1513, 14syl 15 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  ( ZZ>= `  2 )
)
16 eluz2b2 10290 . . . . . . . . . 10  |-  ( P  e.  ( ZZ>= `  2
)  <->  ( P  e.  NN  /\  1  < 
P ) )
1715, 16sylib 188 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( P  e.  NN  /\  1  <  P ) )
1817simpld 445 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  NN )
1918nnrpd 10389 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  RR+ )
20 0z 10035 . . . . . . . . . 10  |-  0  e.  ZZ
2120a1i 10 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  0  e.  ZZ )
22 simpr 447 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  ||  A )
23 dvdsval3 12535 . . . . . . . . . . . 12  |-  ( ( P  e.  NN  /\  A  e.  ZZ )  ->  ( P  ||  A  <->  ( A  mod  P )  =  0 ) )
2418, 1, 23syl2anc 642 . . . . . . . . . . 11  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( P  ||  A  <->  ( A  mod  P )  =  0 ) )
2522, 24mpbid 201 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A  mod  P )  =  0 )
26 0mod 10995 . . . . . . . . . . 11  |-  ( P  e.  RR+  ->  ( 0  mod  P )  =  0 )
2719, 26syl 15 . . . . . . . . . 10  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
0  mod  P )  =  0 )
2825, 27eqtr4d 2318 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  ( A  mod  P )  =  ( 0  mod  P
) )
29 modexp 11236 . . . . . . . . 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 1193 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( ( 0 ^ ( ( P  -  1 )  / 
2 ) )  mod 
P ) )
3130expd 11261 . . . . . . . . 9  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
0 ^ ( ( P  -  1 )  /  2 ) )  =  0 )
3231oveq1d 5873 . . . . . . . 8  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( 0 ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( 0  mod 
P ) )
3330, 32eqtrd 2315 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( A ^ (
( P  -  1 )  /  2 ) )  mod  P )  =  ( 0  mod 
P ) )
34 modadd1 11001 . . . . . . 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 1193 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  ( ( 0  +  1 )  mod 
P ) )
36 0p1e1 9839 . . . . . . 7  |-  ( 0  +  1 )  =  1
3736oveq1i 5868 . . . . . 6  |-  ( ( 0  +  1 )  mod  P )  =  ( 1  mod  P
)
3835, 37syl6eq 2331 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  ( 1  mod 
P ) )
3918nnred 9761 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  P  e.  RR )
4017simprd 449 . . . . . 6  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  1  <  P )
41 1mod 10996 . . . . . 6  |-  ( ( P  e.  RR  /\  1  <  P )  -> 
( 1  mod  P
)  =  1 )
4239, 40, 41syl2anc 642 . . . . 5  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
1  mod  P )  =  1 )
4338, 42eqtrd 2315 . . . 4  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  1 )
4443oveq1d 5873 . . 3  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( 1  -  1 ) )
45 1m1e0 9814 . . . 4  |-  ( 1  -  1 )  =  0
46 lgslem2.z . . . . . 6  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
4746lgslem2 20536 . . . . 5  |-  ( -u
1  e.  Z  /\  0  e.  Z  /\  1  e.  Z )
4847simp2i 965 . . . 4  |-  0  e.  Z
4945, 48eqeltri 2353 . . 3  |-  ( 1  -  1 )  e.  Z
5044, 49syl6eqel 2371 . 2  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
51 lgslem1 20535 . . . 4  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  e.  { 0 ,  2 } )
52 elpri 3660 . . . 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 5865 . . . . . 6  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  0  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( 0  -  1 ) )
54 df-neg 9040 . . . . . . 7  |-  -u 1  =  ( 0  -  1 )
5547simp1i 964 . . . . . . 7  |-  -u 1  e.  Z
5654, 55eqeltrri 2354 . . . . . 6  |-  ( 0  -  1 )  e.  Z
5753, 56syl6eqel 2371 . . . . 5  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  0  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
58 oveq1 5865 . . . . . 6  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  2  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  =  ( 2  -  1 ) )
59 2cn 9816 . . . . . . . 8  |-  2  e.  CC
60 ax-1cn 8795 . . . . . . . 8  |-  1  e.  CC
61 1p1e2 9840 . . . . . . . 8  |-  ( 1  +  1 )  =  2
6259, 60, 60, 61subaddrii 9135 . . . . . . 7  |-  ( 2  -  1 )  =  1
6347simp3i 966 . . . . . . 7  |-  1  e.  Z
6462, 63eqeltri 2353 . . . . . 6  |-  ( 2  -  1 )  e.  Z
6558, 64syl6eqel 2371 . . . . 5  |-  ( ( ( ( A ^
( ( P  - 
1 )  /  2
) )  +  1 )  mod  P )  =  2  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
6657, 65jaoi 368 . . . 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
)
6751, 52, 663syl 18 . . 3  |-  ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
68673expa 1151 . 2  |-  ( ( ( A  e.  ZZ  /\  P  e.  ( Prime  \  { 2 } ) )  /\  -.  P  ||  A )  ->  (
( ( ( A ^ ( ( P  -  1 )  / 
2 ) )  +  1 )  mod  P
)  -  1 )  e.  Z )
6950, 68pm2.61dan 766 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 176    \/ wo 357    /\ wa 358    /\ w3a 934    = wceq 1623    e. wcel 1684   {crab 2547    \ cdif 3149   {csn 3640   {cpr 3641   class class class wbr 4023   ` cfv 5255  (class class class)co 5858   RRcr 8736   0cc0 8737   1c1 8738    + caddc 8740    < clt 8867    <_ cle 8868    - cmin 9037   -ucneg 9038    / cdiv 9423   NNcn 9746   2c2 9795   NN0cn0 9965   ZZcz 10024   ZZ>=cuz 10230   RR+crp 10354    mod cmo 10973   ^cexp 11104   abscabs 11719    || cdivides 12531   Primecprime 12758
This theorem is referenced by:  lgsfcl2  20541
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