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

Theorem lgsfcl2 22639
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 10655 . . . . . . . 8  |-  0  e.  ZZ
2 0le1 9861 . . . . . . . 8  |-  0  <_  1
3 fveq2 5689 . . . . . . . . . . 11  |-  ( x  =  0  ->  ( abs `  x )  =  ( abs `  0
) )
4 abs0 12772 . . . . . . . . . . 11  |-  ( abs `  0 )  =  0
53, 4syl6eq 2489 . . . . . . . . . 10  |-  ( x  =  0  ->  ( abs `  x )  =  0 )
65breq1d 4300 . . . . . . . . 9  |-  ( x  =  0  ->  (
( abs `  x
)  <_  1  <->  0  <_  1 ) )
7 lgsfcl2.z . . . . . . . . 9  |-  Z  =  { x  e.  ZZ  |  ( abs `  x
)  <_  1 }
86, 7elrab2 3117 . . . . . . . 8  |-  ( 0  e.  Z  <->  ( 0  e.  ZZ  /\  0  <_  1 ) )
91, 2, 8mpbir2an 911 . . . . . . 7  |-  0  e.  Z
10 1z 10674 . . . . . . . . 9  |-  1  e.  ZZ
11 1le1 9962 . . . . . . . . 9  |-  1  <_  1
12 fveq2 5689 . . . . . . . . . . . 12  |-  ( x  =  1  ->  ( abs `  x )  =  ( abs `  1
) )
13 abs1 12784 . . . . . . . . . . . 12  |-  ( abs `  1 )  =  1
1412, 13syl6eq 2489 . . . . . . . . . . 11  |-  ( x  =  1  ->  ( abs `  x )  =  1 )
1514breq1d 4300 . . . . . . . . . 10  |-  ( x  =  1  ->  (
( abs `  x
)  <_  1  <->  1  <_  1 ) )
1615, 7elrab2 3117 . . . . . . . . 9  |-  ( 1  e.  Z  <->  ( 1  e.  ZZ  /\  1  <_  1 ) )
1710, 11, 16mpbir2an 911 . . . . . . . 8  |-  1  e.  Z
18 neg1z 10679 . . . . . . . . 9  |-  -u 1  e.  ZZ
19 fveq2 5689 . . . . . . . . . . . 12  |-  ( x  =  -u 1  ->  ( abs `  x )  =  ( abs `  -u 1
) )
20 ax-1cn 9338 . . . . . . . . . . . . . 14  |-  1  e.  CC
2120absnegi 12885 . . . . . . . . . . . . 13  |-  ( abs `  -u 1 )  =  ( abs `  1
)
2221, 13eqtri 2461 . . . . . . . . . . . 12  |-  ( abs `  -u 1 )  =  1
2319, 22syl6eq 2489 . . . . . . . . . . 11  |-  ( x  =  -u 1  ->  ( abs `  x )  =  1 )
2423breq1d 4300 . . . . . . . . . 10  |-  ( x  =  -u 1  ->  (
( abs `  x
)  <_  1  <->  1  <_  1 ) )
2524, 7elrab2 3117 . . . . . . . . 9  |-  ( -u
1  e.  Z  <->  ( -u 1  e.  ZZ  /\  1  <_ 
1 ) )
2618, 11, 25mpbir2an 911 . . . . . . . 8  |-  -u 1  e.  Z
2717, 26keepel 3855 . . . . . . 7  |-  if ( ( A  mod  8
)  e.  { 1 ,  7 } , 
1 ,  -u 1
)  e.  Z
289, 27keepel 3855 . . . . . 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 991 . . . . . . 7  |-  ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  ->  A  e.  ZZ )
3130ad2antrr 725 . . . . . 6  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  A  e.  ZZ )
32 simplr 754 . . . . . . 7  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  e.  Prime )
33 simpr 461 . . . . . . . 8  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  -.  n  = 
2 )
3433neneqad 2679 . . . . . . 7  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  =/=  2
)
35 eldifsn 3998 . . . . . . 7  |-  ( n  e.  ( Prime  \  {
2 } )  <->  ( n  e.  Prime  /\  n  =/=  2 ) )
3632, 34, 35sylanbrc 664 . . . . . 6  |-  ( ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  /\  -.  n  =  2 )  ->  n  e.  ( Prime  \  { 2 } ) )
377lgslem4 22636 . . . . . 6  |-  ( ( A  e.  ZZ  /\  n  e.  ( Prime  \  { 2 } ) )  ->  ( (
( ( A ^
( ( n  - 
1 )  /  2
) )  +  1 )  mod  n )  -  1 )  e.  Z )
3831, 36, 37syl2anc 661 . . . . 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 3819 . . . 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 461 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  n  e.  Prime )
41 simpll2 1028 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  N  e.  ZZ )
42 simpll3 1029 . . . . 5  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  N  =/=  0 )
43 pczcl 13913 . . . . 5  |-  ( ( n  e.  Prime  /\  ( N  e.  ZZ  /\  N  =/=  0 ) )  -> 
( n  pCnt  N
)  e.  NN0 )
4440, 41, 42, 43syl12anc 1216 . . . 4  |-  ( ( ( ( A  e.  ZZ  /\  N  e.  ZZ  /\  N  =/=  0 )  /\  n  e.  NN )  /\  n  e.  Prime )  ->  (
n  pCnt  N )  e.  NN0 )
45 ssrab2 3435 . . . . . . 7  |-  { x  e.  ZZ  |  ( abs `  x )  <_  1 }  C_  ZZ
467, 45eqsstri 3384 . . . . . 6  |-  Z  C_  ZZ
47 zsscn 10652 . . . . . 6  |-  ZZ  C_  CC
4846, 47sstri 3363 . . . . 5  |-  Z  C_  CC
497lgslem3 22635 . . . . 5  |-  ( ( a  e.  Z  /\  b  e.  Z )  ->  ( a  x.  b
)  e.  Z )
5048, 49, 17expcllem 11874 . . . 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 661 . . 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 3819 . 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 5865 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 369    /\ w3a 965    = wceq 1369    e. wcel 1756    =/= wne 2604   {crab 2717    \ cdif 3323   ifcif 3789   {csn 3875   {cpr 3877   class class class wbr 4290    e. cmpt 4348   -->wf 5412   ` cfv 5416  (class class class)co 6089   CCcc 9278   0cc0 9280   1c1 9281    + caddc 9283    <_ cle 9417    - cmin 9593   -ucneg 9594    / cdiv 9991   NNcn 10320   2c2 10369   7c7 10374   8c8 10375   NN0cn0 10577   ZZcz 10644    mod cmo 11706   ^cexp 11863   abscabs 12721    || cdivides 13533   Primecprime 13761    pCnt cpc 13901
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 2422  ax-rep 4401  ax-sep 4411  ax-nul 4419  ax-pow 4468  ax-pr 4529  ax-un 6370  ax-cnex 9336  ax-resscn 9337  ax-1cn 9338  ax-icn 9339  ax-addcl 9340  ax-addrcl 9341  ax-mulcl 9342  ax-mulrcl 9343  ax-mulcom 9344  ax-addass 9345  ax-mulass 9346  ax-distr 9347  ax-i2m1 9348  ax-1ne0 9349  ax-1rid 9350  ax-rnegex 9351  ax-rrecex 9352  ax-cnre 9353  ax-pre-lttri 9354  ax-pre-lttrn 9355  ax-pre-ltadd 9356  ax-pre-mulgt0 9357  ax-pre-sup 9358
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 2257  df-mo 2258  df-clab 2428  df-cleq 2434  df-clel 2437  df-nfc 2566  df-ne 2606  df-nel 2607  df-ral 2718  df-rex 2719  df-reu 2720  df-rmo 2721  df-rab 2722  df-v 2972  df-sbc 3185  df-csb 3287  df-dif 3329  df-un 3331  df-in 3333  df-ss 3340  df-pss 3342  df-nul 3636  df-if 3790  df-pw 3860  df-sn 3876  df-pr 3878  df-tp 3880  df-op 3882  df-uni 4090  df-int 4127  df-iun 4171  df-br 4291  df-opab 4349  df-mpt 4350  df-tr 4384  df-eprel 4630  df-id 4634  df-po 4639  df-so 4640  df-fr 4677  df-we 4679  df-ord 4720  df-on 4721  df-lim 4722  df-suc 4723  df-xp 4844  df-rel 4845  df-cnv 4846  df-co 4847  df-dm 4848  df-rn 4849  df-res 4850  df-ima 4851  df-iota 5379  df-fun 5418  df-fn 5419  df-f 5420  df-f1 5421  df-fo 5422  df-f1o 5423  df-fv 5424  df-riota 6050  df-ov 6092  df-oprab 6093  df-mpt2 6094  df-om 6475  df-1st 6575  df-2nd 6576  df-recs 6830  df-rdg 6864  df-1o 6918  df-2o 6919  df-oadd 6922  df-er 7099  df-map 7214  df-en 7309  df-dom 7310  df-sdom 7311  df-fin 7312  df-sup 7689  df-card 8107  df-cda 8335  df-pnf 9418  df-mnf 9419  df-xr 9420  df-ltxr 9421  df-le 9422  df-sub 9595  df-neg 9596  df-div 9992  df-nn 10321  df-2 10378  df-3 10379  df-n0 10578  df-z 10645  df-uz 10860  df-q 10952  df-rp 10990  df-fz 11436  df-fzo 11547  df-fl 11640  df-mod 11707  df-seq 11805  df-exp 11864  df-hash 12102  df-cj 12586  df-re 12587  df-im 12588  df-sqr 12722  df-abs 12723  df-dvds 13534  df-gcd 13689  df-prm 13762  df-phi 13839  df-pc 13902
This theorem is referenced by:  lgscllem  22640  lgsfcl  22641  lgsfle1  22642
  Copyright terms: Public domain W3C validator