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

Theorem lgsfcl2 24228
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 10955 . . . . . . . 8  |-  0  e.  ZZ
2 0le1 10144 . . . . . . . 8  |-  0  <_  1
3 fveq2 5881 . . . . . . . . . . 11  |-  ( x  =  0  ->  ( abs `  x )  =  ( abs `  0
) )
4 abs0 13348 . . . . . . . . . . 11  |-  ( abs `  0 )  =  0
53, 4syl6eq 2479 . . . . . . . . . 10  |-  ( x  =  0  ->  ( abs `  x )  =  0 )
65breq1d 4433 . . . . . . . . 9  |-  ( x  =  0  ->  (
( abs `  x
)  <_  1  <->  0  <_  1 ) )
7 lgsfcl2.z . . . . . . . . 9  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
86, 7elrab2 3230 . . . . . . . 8  |-  ( 0  e.  Z  <->  ( 0  e.  ZZ  /\  0  <_  1 ) )
91, 2, 8mpbir2an 928 . . . . . . 7  |-  0  e.  Z
10 1z 10974 . . . . . . . . 9  |-  1  e.  ZZ
11 1le1 10247 . . . . . . . . 9  |-  1  <_  1
12 fveq2 5881 . . . . . . . . . . . 12  |-  ( x  =  1  ->  ( abs `  x )  =  ( abs `  1
) )
13 abs1 13360 . . . . . . . . . . . 12  |-  ( abs `  1 )  =  1
1412, 13syl6eq 2479 . . . . . . . . . . 11  |-  ( x  =  1  ->  ( abs `  x )  =  1 )
1514breq1d 4433 . . . . . . . . . 10  |-  ( x  =  1  ->  (
( abs `  x
)  <_  1  <->  1  <_  1 ) )
1615, 7elrab2 3230 . . . . . . . . 9  |-  ( 1  e.  Z  <->  ( 1  e.  ZZ  /\  1  <_  1 ) )
1710, 11, 16mpbir2an 928 . . . . . . . 8  |-  1  e.  Z
18 neg1z 10980 . . . . . . . . 9  |-  -u 1  e.  ZZ
19 fveq2 5881 . . . . . . . . . . . 12  |-  ( x  =  -u 1  ->  ( abs `  x )  =  ( abs `  -u 1
) )
20 ax-1cn 9604 . . . . . . . . . . . . . 14  |-  1  e.  CC
2120absnegi 13462 . . . . . . . . . . . . 13  |-  ( abs `  -u 1 )  =  ( abs `  1
)
2221, 13eqtri 2451 . . . . . . . . . . . 12  |-  ( abs `  -u 1 )  =  1
2319, 22syl6eq 2479 . . . . . . . . . . 11  |-  ( x  =  -u 1  ->  ( abs `  x )  =  1 )
2423breq1d 4433 . . . . . . . . . 10  |-  ( x  =  -u 1  ->  (
( abs `  x
)  <_  1  <->  1  <_  1 ) )
2524, 7elrab2 3230 . . . . . . . . 9  |-  ( -u
1  e.  Z  <->  ( -u 1  e.  ZZ  /\  1  <_ 
1 ) )
2618, 11, 25mpbir2an 928 . . . . . . . 8  |-  -u 1  e.  Z
2717, 26keepel 3978 . . . . . . 7  |-  if ( ( A  mod  8
)  e.  { 1 ,  7 } , 
1 ,  -u 1
)  e.  Z
289, 27keepel 3978 . . . . . 6  |-  if ( 2  ||  A , 
0 ,  if ( ( A  mod  8
)  e.  { 1 ,  7 } , 
1 ,  -u 1
) )  e.  Z
2928a1i 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 )
30 simpl1 1008 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  ->  A  e.  ZZ )
3130ad2antrr 730 . . . . . 6  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  A  e.  ZZ )
32 simplr 760 . . . . . . 7  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  e.  Prime )
33 simpr 462 . . . . . . . 8  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  -.  n  = 
2 )
3433neqned 2623 . . . . . . 7  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  =/=  2
)
35 eldifsn 4125 . . . . . . 7  |-  ( n  e.  ( Prime  \  {
2 } )  <->  ( n  e.  Prime  /\  n  =/=  2 ) )
3632, 34, 35sylanbrc 668 . . . . . 6  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  e.  ( Prime  \  { 2 } ) )
377lgslem4 24225 . . . . . 6  |-  ( ( A  e.  ZZ  /\  n  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( n  - 
1 )  /  2
) )  +  1 )  mod  n )  -  1 )  e.  Z )
3831, 36, 37syl2anc 665 . . . . 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
)
3929, 38ifclda 3943 . . . 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
)
40 simpr 462 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  n  e.  Prime )
41 simpll2 1045 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  N  e.  ZZ )
42 simpll3 1046 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  N  =/=  0 )
43 pczcl 14797 . . . . 5  |-  ( ( n  e.  Prime  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  -> 
( n  pCnt  N
)  e.  NN0 )
4440, 41, 42, 43syl12anc 1262 . . . 4  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  (
n  pCnt  N )  e.  NN0 )
45 ssrab2 3546 . . . . . . 7  |-  { x  e.  ZZ  |  ( abs `  x )  <_  1 }  C_  ZZ
467, 45eqsstri 3494 . . . . . 6  |-  Z  C_  ZZ
47 zsscn 10952 . . . . . 6  |-  ZZ  C_  CC
4846, 47sstri 3473 . . . . 5  |-  Z  C_  CC
497lgslem3 24224 . . . . 5  |-  ( ( a  e.  Z  /\  b  e.  Z )  ->  ( a  x.  b
)  e.  Z )
5048, 49, 17expcllem 12289 . . . 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 )
5139, 44, 50syl2anc 665 . . 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
)
5217a1i 11 . . 3  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  -.  n  e.  Prime )  -> 
1  e.  Z )
5351, 52ifclda 3943 . 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 )
54 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 ) )
5553, 54fmptd 6061 1  |-  ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  ->  F : NN --> Z )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 370    /\ w3a 982    = wceq 1437    e. wcel 1872    =/= wne 2614   {crab 2775    \ cdif 3433   ifcif 3911   {csn 3998   {cpr 4000   class class class wbr 4423    |-> cmpt 4482   -->wf 5597   ` cfv 5601  (class class class)co 6305   CCcc 9544   0cc0 9546   1c1 9547    + caddc 9549    <_ cle 9683    - cmin 9867   -ucneg 9868    / cdiv 10276   NNcn 10616   2c2 10666   7c7 10671   8c8 10672   NN0cn0 10876   ZZcz 10944    mod cmo 12102   ^cexp 12278   abscabs 13297    || cdvds 14304   Primecprime 14621    pCnt cpc 14785
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1663  ax-4 1676  ax-5 1752  ax-6 1798  ax-7 1843  ax-8 1874  ax-9 1876  ax-10 1891  ax-11 1896  ax-12 1909  ax-13 2057  ax-ext 2401  ax-rep 4536  ax-sep 4546  ax-nul 4555  ax-pow 4602  ax-pr 4660  ax-un 6597  ax-cnex 9602  ax-resscn 9603  ax-1cn 9604  ax-icn 9605  ax-addcl 9606  ax-addrcl 9607  ax-mulcl 9608  ax-mulrcl 9609  ax-mulcom 9610  ax-addass 9611  ax-mulass 9612  ax-distr 9613  ax-i2m1 9614  ax-1ne0 9615  ax-1rid 9616  ax-rnegex 9617  ax-rrecex 9618  ax-cnre 9619  ax-pre-lttri 9620  ax-pre-lttrn 9621  ax-pre-ltadd 9622  ax-pre-mulgt0 9623  ax-pre-sup 9624
This theorem depends on definitions:  df-bi 188  df-or 371  df-an 372  df-3or 983  df-3an 984  df-tru 1440  df-ex 1658  df-nf 1662  df-sb 1791  df-eu 2273  df-mo 2274  df-clab 2408  df-cleq 2414  df-clel 2417  df-nfc 2568  df-ne 2616  df-nel 2617  df-ral 2776  df-rex 2777  df-reu 2778  df-rmo 2779  df-rab 2780  df-v 3082  df-sbc 3300  df-csb 3396  df-dif 3439  df-un 3441  df-in 3443  df-ss 3450  df-pss 3452  df-nul 3762  df-if 3912  df-pw 3983  df-sn 3999  df-pr 4001  df-tp 4003  df-op 4005  df-uni 4220  df-int 4256  df-iun 4301  df-br 4424  df-opab 4483  df-mpt 4484  df-tr 4519  df-eprel 4764  df-id 4768  df-po 4774  df-so 4775  df-fr 4812  df-we 4814  df-xp 4859  df-rel 4860  df-cnv 4861  df-co 4862  df-dm 4863  df-rn 4864  df-res 4865  df-ima 4866  df-pred 5399  df-ord 5445  df-on 5446  df-lim 5447  df-suc 5448  df-iota 5565  df-fun 5603  df-fn 5604  df-f 5605  df-f1 5606  df-fo 5607  df-f1o 5608  df-fv 5609  df-riota 6267  df-ov 6308  df-oprab 6309  df-mpt2 6310  df-om 6707  df-1st 6807  df-2nd 6808  df-wrecs 7039  df-recs 7101  df-rdg 7139  df-1o 7193  df-2o 7194  df-oadd 7197  df-er 7374  df-map 7485  df-en 7581  df-dom 7582  df-sdom 7583  df-fin 7584  df-sup 7965  df-inf 7966  df-card 8381  df-cda 8605  df-pnf 9684  df-mnf 9685  df-xr 9686  df-ltxr 9687  df-le 9688  df-sub 9869  df-neg 9870  df-div 10277  df-nn 10617  df-2 10675  df-3 10676  df-n0 10877  df-z 10945  df-uz 11167  df-q 11272  df-rp 11310  df-fz 11792  df-fzo 11923  df-fl 12034  df-mod 12103  df-seq 12220  df-exp 12279  df-hash 12522  df-cj 13162  df-re 13163  df-im 13164  df-sqrt 13298  df-abs 13299  df-dvds 14305  df-gcd 14468  df-prm 14622  df-phi 14713  df-pc 14786
This theorem is referenced by:  lgscllem  24229  lgsfcl  24230  lgsfle1  24231
  Copyright terms: Public domain W3C validator