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

Theorem lgsfcl2 20946
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.)
Hypotheses
Ref Expression
lgsval.1  |-  F  =  ( n  e.  NN  |->  if ( n  e.  Prime ,  ( if ( n  =  2 ,  if ( 2  ||  A ,  0 ,  if ( ( A  mod  8 )  e.  {
1 ,  7 } ,  1 ,  -u
1 ) ) ,  ( ( ( ( A ^ ( ( n  -  1 )  /  2 ) )  +  1 )  mod  n )  -  1 ) ) ^ (
n  pCnt  N )
) ,  1 ) )
lgsfcl2.z  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
Assertion
Ref Expression
lgsfcl2  |-  ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  ->  F : NN --> Z )
Distinct variable groups:    x, n, A    x, F    n, N, x    n, Z
Allowed substitution hints:    F( n)    Z( x)

Proof of Theorem lgsfcl2
Dummy variables  a 
b are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 0z 10218 . . . . . . . 8  |-  0  e.  ZZ
2 0le1 9476 . . . . . . . 8  |-  0  <_  1
3 fveq2 5661 . . . . . . . . . . 11  |-  ( x  =  0  ->  ( abs `  x )  =  ( abs `  0
) )
4 abs0 12010 . . . . . . . . . . 11  |-  ( abs `  0 )  =  0
53, 4syl6eq 2428 . . . . . . . . . 10  |-  ( x  =  0  ->  ( abs `  x )  =  0 )
65breq1d 4156 . . . . . . . . 9  |-  ( x  =  0  ->  (
( abs `  x
)  <_  1  <->  0  <_  1 ) )
7 lgsfcl2.z . . . . . . . . 9  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
86, 7elrab2 3030 . . . . . . . 8  |-  ( 0  e.  Z  <->  ( 0  e.  ZZ  /\  0  <_  1 ) )
91, 2, 8mpbir2an 887 . . . . . . 7  |-  0  e.  Z
10 1z 10236 . . . . . . . . 9  |-  1  e.  ZZ
11 1le1 9575 . . . . . . . . 9  |-  1  <_  1
12 fveq2 5661 . . . . . . . . . . . 12  |-  ( x  =  1  ->  ( abs `  x )  =  ( abs `  1
) )
13 abs1 12022 . . . . . . . . . . . 12  |-  ( abs `  1 )  =  1
1412, 13syl6eq 2428 . . . . . . . . . . 11  |-  ( x  =  1  ->  ( abs `  x )  =  1 )
1514breq1d 4156 . . . . . . . . . 10  |-  ( x  =  1  ->  (
( abs `  x
)  <_  1  <->  1  <_  1 ) )
1615, 7elrab2 3030 . . . . . . . . 9  |-  ( 1  e.  Z  <->  ( 1  e.  ZZ  /\  1  <_  1 ) )
1710, 11, 16mpbir2an 887 . . . . . . . 8  |-  1  e.  Z
18 znegcl 10238 . . . . . . . . . 10  |-  ( 1  e.  ZZ  ->  -u 1  e.  ZZ )
1910, 18ax-mp 8 . . . . . . . . 9  |-  -u 1  e.  ZZ
20 fveq2 5661 . . . . . . . . . . . 12  |-  ( x  =  -u 1  ->  ( abs `  x )  =  ( abs `  -u 1
) )
21 ax-1cn 8974 . . . . . . . . . . . . . 14  |-  1  e.  CC
2221absnegi 12123 . . . . . . . . . . . . 13  |-  ( abs `  -u 1 )  =  ( abs `  1
)
2322, 13eqtri 2400 . . . . . . . . . . . 12  |-  ( abs `  -u 1 )  =  1
2420, 23syl6eq 2428 . . . . . . . . . . 11  |-  ( x  =  -u 1  ->  ( abs `  x )  =  1 )
2524breq1d 4156 . . . . . . . . . 10  |-  ( x  =  -u 1  ->  (
( abs `  x
)  <_  1  <->  1  <_  1 ) )
2625, 7elrab2 3030 . . . . . . . . 9  |-  ( -u
1  e.  Z  <->  ( -u 1  e.  ZZ  /\  1  <_ 
1 ) )
2719, 11, 26mpbir2an 887 . . . . . . . 8  |-  -u 1  e.  Z
2817, 27keepel 3732 . . . . . . 7  |-  if ( ( A  mod  8
)  e.  { 1 ,  7 } , 
1 ,  -u 1
)  e.  Z
299, 28keepel 3732 . . . . . 6  |-  if ( 2  ||  A , 
0 ,  if ( ( A  mod  8
)  e.  { 1 ,  7 } , 
1 ,  -u 1
) )  e.  Z
3029a1i 11 . . . . 5  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  n  =  2 )  ->  if ( 2  ||  A ,  0 ,  if ( ( A  mod  8 )  e.  {
1 ,  7 } ,  1 ,  -u
1 ) )  e.  Z )
31 simpl1 960 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  ->  A  e.  ZZ )
3231ad2antrr 707 . . . . . 6  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  A  e.  ZZ )
33 simplr 732 . . . . . . 7  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  e.  Prime )
34 simpr 448 . . . . . . . 8  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  -.  n  = 
2 )
3534neneqad 2613 . . . . . . 7  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  =/=  2
)
36 eldifsn 3863 . . . . . . 7  |-  ( n  e.  ( Prime  \  {
2 } )  <->  ( n  e.  Prime  /\  n  =/=  2 ) )
3733, 35, 36sylanbrc 646 . . . . . 6  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  e.  ( Prime  \  { 2 } ) )
387lgslem4 20943 . . . . . 6  |-  ( ( A  e.  ZZ  /\  n  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( n  - 
1 )  /  2
) )  +  1 )  mod  n )  -  1 )  e.  Z )
3932, 37, 38syl2anc 643 . . . . 5  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  ( ( ( ( A ^ (
( n  -  1 )  /  2 ) )  +  1 )  mod  n )  - 
1 )  e.  Z
)
4030, 39ifclda 3702 . . . 4  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  if ( n  =  2 ,  if ( 2  ||  A ,  0 ,  if ( ( A  mod  8 )  e.  {
1 ,  7 } ,  1 ,  -u
1 ) ) ,  ( ( ( ( A ^ ( ( n  -  1 )  /  2 ) )  +  1 )  mod  n )  -  1 ) )  e.  Z
)
41 simpr 448 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  n  e.  Prime )
42 simpll2 997 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  N  e.  ZZ )
43 simpll3 998 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  N  =/=  0 )
44 pczcl 13142 . . . . 5  |-  ( ( n  e.  Prime  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  -> 
( n  pCnt  N
)  e.  NN0 )
4541, 42, 43, 44syl12anc 1182 . . . 4  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  (
n  pCnt  N )  e.  NN0 )
46 ssrab2 3364 . . . . . . 7  |-  { x  e.  ZZ  |  ( abs `  x )  <_  1 }  C_  ZZ
477, 46eqsstri 3314 . . . . . 6  |-  Z  C_  ZZ
48 zsscn 10215 . . . . . 6  |-  ZZ  C_  CC
4947, 48sstri 3293 . . . . 5  |-  Z  C_  CC
507lgslem3 20942 . . . . 5  |-  ( ( a  e.  Z  /\  b  e.  Z )  ->  ( a  x.  b
)  e.  Z )
5149, 50, 17expcllem 11312 . . . 4  |-  ( ( if ( n  =  2 ,  if ( 2  ||  A , 
0 ,  if ( ( A  mod  8
)  e.  { 1 ,  7 } , 
1 ,  -u 1
) ) ,  ( ( ( ( A ^ ( ( n  -  1 )  / 
2 ) )  +  1 )  mod  n
)  -  1 ) )  e.  Z  /\  ( n  pCnt  N )  e.  NN0 )  -> 
( if ( n  =  2 ,  if ( 2  ||  A ,  0 ,  if ( ( A  mod  8 )  e.  {
1 ,  7 } ,  1 ,  -u
1 ) ) ,  ( ( ( ( A ^ ( ( n  -  1 )  /  2 ) )  +  1 )  mod  n )  -  1 ) ) ^ (
n  pCnt  N )
)  e.  Z )
5240, 45, 51syl2anc 643 . . 3  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  ( if ( n  =  2 ,  if ( 2 
||  A ,  0 ,  if ( ( A  mod  8 )  e.  { 1 ,  7 } ,  1 ,  -u 1 ) ) ,  ( ( ( ( A ^ (
( n  -  1 )  /  2 ) )  +  1 )  mod  n )  - 
1 ) ) ^
( n  pCnt  N
) )  e.  Z
)
5317a1i 11 . . 3  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  -.  n  e.  Prime )  -> 
1  e.  Z )
5452, 53ifclda 3702 . 2  |-  ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  ->  if ( n  e. 
Prime ,  ( if ( n  =  2 ,  if ( 2  ||  A ,  0 ,  if ( ( A  mod  8 )  e.  {
1 ,  7 } ,  1 ,  -u
1 ) ) ,  ( ( ( ( A ^ ( ( n  -  1 )  /  2 ) )  +  1 )  mod  n )  -  1 ) ) ^ (
n  pCnt  N )
) ,  1 )  e.  Z )
55 lgsval.1 . 2  |-  F  =  ( n  e.  NN  |->  if ( n  e.  Prime ,  ( if ( n  =  2 ,  if ( 2  ||  A ,  0 ,  if ( ( A  mod  8 )  e.  {
1 ,  7 } ,  1 ,  -u
1 ) ) ,  ( ( ( ( A ^ ( ( n  -  1 )  /  2 ) )  +  1 )  mod  n )  -  1 ) ) ^ (
n  pCnt  N )
) ,  1 ) )
5654, 55fmptd 5825 1  |-  ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  ->  F : NN --> Z )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 359    /\ w3a 936    = wceq 1649    e. wcel 1717    =/= wne 2543   {crab 2646    \ cdif 3253   ifcif 3675   {csn 3750   {cpr 3751   class class class wbr 4146    e. cmpt 4200   -->wf 5383   ` cfv 5387  (class class class)co 6013   CCcc 8914   0cc0 8916   1c1 8917    + caddc 8919    <_ cle 9047    - cmin 9216   -ucneg 9217    / cdiv 9602   NNcn 9925   2c2 9974   7c7 9979   8c8 9980   NN0cn0 10146   ZZcz 10207    mod cmo 11170   ^cexp 11302   abscabs 11959    || cdivides 12772   Primecprime 12999    pCnt cpc 13130
This theorem is referenced by:  lgscllem  20947  lgsfcl  20948  lgsfle1  20949
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 2361  ax-rep 4254  ax-sep 4264  ax-nul 4272  ax-pow 4311  ax-pr 4337  ax-un 4634  ax-cnex 8972  ax-resscn 8973  ax-1cn 8974  ax-icn 8975  ax-addcl 8976  ax-addrcl 8977  ax-mulcl 8978  ax-mulrcl 8979  ax-mulcom 8980  ax-addass 8981  ax-mulass 8982  ax-distr 8983  ax-i2m1 8984  ax-1ne0 8985  ax-1rid 8986  ax-rnegex 8987  ax-rrecex 8988  ax-cnre 8989  ax-pre-lttri 8990  ax-pre-lttrn 8991  ax-pre-ltadd 8992  ax-pre-mulgt0 8993  ax-pre-sup 8994
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 2235  df-mo 2236  df-clab 2367  df-cleq 2373  df-clel 2376  df-nfc 2505  df-ne 2545  df-nel 2546  df-ral 2647  df-rex 2648  df-reu 2649  df-rmo 2650  df-rab 2651  df-v 2894  df-sbc 3098  df-csb 3188  df-dif 3259  df-un 3261  df-in 3263  df-ss 3270  df-pss 3272  df-nul 3565  df-if 3676  df-pw 3737  df-sn 3756  df-pr 3757  df-tp 3758  df-op 3759  df-uni 3951  df-int 3986  df-iun 4030  df-br 4147  df-opab 4201  df-mpt 4202  df-tr 4237  df-eprel 4428  df-id 4432  df-po 4437  df-so 4438  df-fr 4475  df-we 4477  df-ord 4518  df-on 4519  df-lim 4520  df-suc 4521  df-om 4779  df-xp 4817  df-rel 4818  df-cnv 4819  df-co 4820  df-dm 4821  df-rn 4822  df-res 4823  df-ima 4824  df-iota 5351  df-fun 5389  df-fn 5390  df-f 5391  df-f1 5392  df-fo 5393  df-f1o 5394  df-fv 5395  df-ov 6016  df-oprab 6017  df-mpt2 6018  df-1st 6281  df-2nd 6282  df-riota 6478  df-recs 6562  df-rdg 6597  df-1o 6653  df-2o 6654  df-oadd 6657  df-er 6834  df-map 6949  df-en 7039  df-dom 7040  df-sdom 7041  df-fin 7042  df-sup 7374  df-card 7752  df-cda 7974  df-pnf 9048  df-mnf 9049  df-xr 9050  df-ltxr 9051  df-le 9052  df-sub 9218  df-neg 9219  df-div 9603  df-nn 9926  df-2 9983  df-3 9984  df-n0 10147  df-z 10208  df-uz 10414  df-q 10500  df-rp 10538  df-fz 10969  df-fzo 11059  df-fl 11122  df-mod 11171  df-seq 11244  df-exp 11303  df-hash 11539  df-cj 11824  df-re 11825  df-im 11826  df-sqr 11960  df-abs 11961  df-dvds 12773  df-gcd 12927  df-prm 13000  df-phi 13075  df-pc 13131
  Copyright terms: Public domain W3C validator