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

Theorem bitsinvp1 12888
Description: Recursive definition of the inverse of the bits function. (Contributed by Mario Carneiro, 8-Sep-2016.)
Hypothesis
Ref Expression
bitsinv.k  |-  K  =  `' (bits  |`  NN0 )
Assertion
Ref Expression
bitsinvp1  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( K `  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  =  ( ( K `  ( A  i^i  ( 0..^ N ) ) )  +  if ( N  e.  A ,  ( 2 ^ N ) ,  0 ) ) )

Proof of Theorem bitsinvp1
Dummy variable  k is distinct from all other variables.
StepHypRef Expression
1 fzonel 11082 . . . . . . 7  |-  -.  N  e.  ( 0..^ N )
21a1i 11 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  -.  N  e.  ( 0..^ N ) )
3 disjsn 3811 . . . . . 6  |-  ( ( ( 0..^ N )  i^i  { N }
)  =  (/)  <->  -.  N  e.  ( 0..^ N ) )
42, 3sylibr 204 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
( 0..^ N )  i^i  { N }
)  =  (/) )
54ineq2d 3485 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( A  i^i  (/) ) )
6 inindi 3501 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  i^i  ( A  i^i  { N } ) )
7 in0 3596 . . . 4  |-  ( A  i^i  (/) )  =  (/)
85, 6, 73eqtr3g 2442 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
( A  i^i  (
0..^ N ) )  i^i  ( A  i^i  { N } ) )  =  (/) )
9 simpr 448 . . . . . . 7  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  N  e.  NN0 )
10 nn0uz 10452 . . . . . . 7  |-  NN0  =  ( ZZ>= `  0 )
119, 10syl6eleq 2477 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  N  e.  ( ZZ>= `  0 )
)
12 fzosplitsn 11122 . . . . . 6  |-  ( N  e.  ( ZZ>= `  0
)  ->  ( 0..^ ( N  +  1 ) )  =  ( ( 0..^ N )  u.  { N }
) )
1311, 12syl 16 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ ( N  + 
1 ) )  =  ( ( 0..^ N )  u.  { N } ) )
1413ineq2d 3485 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  =  ( A  i^i  ( ( 0..^ N )  u. 
{ N } ) ) )
15 indi 3530 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  u.  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  u.  ( A  i^i  { N } ) )
1614, 15syl6eq 2435 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  =  ( ( A  i^i  (
0..^ N ) )  u.  ( A  i^i  { N } ) ) )
17 fzofi 11240 . . . . 5  |-  ( 0..^ ( N  +  1 ) )  e.  Fin
1817a1i 11 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ ( N  + 
1 ) )  e. 
Fin )
19 inss2 3505 . . . 4  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  (
0..^ ( N  + 
1 ) )
20 ssfi 7265 . . . 4  |-  ( ( ( 0..^ ( N  +  1 ) )  e.  Fin  /\  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  (
0..^ ( N  + 
1 ) ) )  ->  ( A  i^i  ( 0..^ ( N  + 
1 ) ) )  e.  Fin )
2118, 19, 20sylancl 644 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  e.  Fin )
22 2nn 10065 . . . . . 6  |-  2  e.  NN
2322a1i 11 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  2  e.  NN )
24 inss1 3504 . . . . . . 7  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  A
25 simpl 444 . . . . . . 7  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  A  C_ 
NN0 )
2624, 25syl5ss 3302 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  NN0 )
2726sselda 3291 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  k  e.  NN0 )
2823, 27nnexpcld 11471 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  NN )
2928nncnd 9948 . . 3  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  CC )
308, 16, 21, 29fsumsplit 12460 . 2  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  sum_ k  e.  ( A  i^i  (
0..^ ( N  + 
1 ) ) ) ( 2 ^ k
)  =  ( sum_ k  e.  ( A  i^i  ( 0..^ N ) ) ( 2 ^ k )  +  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k
) ) )
31 elfpw 7343 . . . 4  |-  ( ( A  i^i  ( 0..^ ( N  +  1 ) ) )  e.  ( ~P NN0  i^i  Fin )  <->  ( ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  NN0  /\  ( A  i^i  (
0..^ ( N  + 
1 ) ) )  e.  Fin ) )
3226, 21, 31sylanbrc 646 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  e.  ( ~P NN0  i^i  Fin ) )
33 bitsinv.k . . . 4  |-  K  =  `' (bits  |`  NN0 )
3433bitsinv 12887 . . 3  |-  ( ( A  i^i  ( 0..^ ( N  +  1 ) ) )  e.  ( ~P NN0  i^i  Fin )  ->  ( K `  ( A  i^i  (
0..^ ( N  + 
1 ) ) ) )  =  sum_ k  e.  ( A  i^i  (
0..^ ( N  + 
1 ) ) ) ( 2 ^ k
) )
3532, 34syl 16 . 2  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( K `  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  =  sum_ k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) ( 2 ^ k ) )
36 inss1 3504 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  A
3736, 25syl5ss 3302 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  C_  NN0 )
38 fzofi 11240 . . . . . . 7  |-  ( 0..^ N )  e.  Fin
3938a1i 11 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ N )  e. 
Fin )
40 inss2 3505 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  (
0..^ N )
41 ssfi 7265 . . . . . 6  |-  ( ( ( 0..^ N )  e.  Fin  /\  ( A  i^i  ( 0..^ N ) )  C_  (
0..^ N ) )  ->  ( A  i^i  ( 0..^ N ) )  e.  Fin )
4239, 40, 41sylancl 644 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  e.  Fin )
43 elfpw 7343 . . . . 5  |-  ( ( A  i^i  ( 0..^ N ) )  e.  ( ~P NN0  i^i  Fin )  <->  ( ( A  i^i  ( 0..^ N ) )  C_  NN0  /\  ( A  i^i  (
0..^ N ) )  e.  Fin ) )
4437, 42, 43sylanbrc 646 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  e.  ( ~P NN0  i^i  Fin ) )
4533bitsinv 12887 . . . 4  |-  ( ( A  i^i  ( 0..^ N ) )  e.  ( ~P NN0  i^i  Fin )  ->  ( K `  ( A  i^i  (
0..^ N ) ) )  =  sum_ k  e.  ( A  i^i  (
0..^ N ) ) ( 2 ^ k
) )
4644, 45syl 16 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( K `  ( A  i^i  ( 0..^ N ) ) )  =  sum_ k  e.  ( A  i^i  ( 0..^ N ) ) ( 2 ^ k ) )
47 eqeq1 2393 . . . 4  |-  ( ( 2 ^ N )  =  if ( N  e.  A ,  ( 2 ^ N ) ,  0 )  -> 
( ( 2 ^ N )  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k
)  <->  if ( N  e.  A ,  ( 2 ^ N ) ,  0 )  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k
) ) )
48 eqeq1 2393 . . . 4  |-  ( 0  =  if ( N  e.  A ,  ( 2 ^ N ) ,  0 )  -> 
( 0  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k
)  <->  if ( N  e.  A ,  ( 2 ^ N ) ,  0 )  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k
) ) )
49 snssi 3885 . . . . . . . 8  |-  ( N  e.  A  ->  { N }  C_  A )
5049adantl 453 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  { N }  C_  A )
51 dfss1 3488 . . . . . . 7  |-  ( { N }  C_  A  <->  ( A  i^i  { N } )  =  { N } )
5250, 51sylib 189 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( A  i^i  { N } )  =  { N } )
5352sumeq1d 12422 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  -> 
sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k )  = 
sum_ k  e.  { N }  ( 2 ^ k ) )
54 simpr 448 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  N  e.  A )
5522a1i 11 . . . . . . . 8  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  2  e.  NN )
56 simplr 732 . . . . . . . 8  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  N  e.  NN0 )
5755, 56nnexpcld 11471 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  NN )
5857nncnd 9948 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  CC )
59 oveq2 6028 . . . . . . 7  |-  ( k  =  N  ->  (
2 ^ k )  =  ( 2 ^ N ) )
6059sumsn 12461 . . . . . 6  |-  ( ( N  e.  A  /\  ( 2 ^ N
)  e.  CC )  ->  sum_ k  e.  { N }  ( 2 ^ k )  =  ( 2 ^ N
) )
6154, 58, 60syl2anc 643 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  -> 
sum_ k  e.  { N }  ( 2 ^ k )  =  ( 2 ^ N
) )
6253, 61eqtr2d 2420 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k ) )
63 simpr 448 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  -.  N  e.  A )
64 disjsn 3811 . . . . . . 7  |-  ( ( A  i^i  { N } )  =  (/)  <->  -.  N  e.  A )
6563, 64sylibr 204 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  ( A  i^i  { N } )  =  (/) )
6665sumeq1d 12422 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k )  = 
sum_ k  e.  (/)  ( 2 ^ k
) )
67 sum0 12442 . . . . 5  |-  sum_ k  e.  (/)  ( 2 ^ k )  =  0
6866, 67syl6req 2436 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  0  =  sum_ k  e.  ( A  i^i  { N }
) ( 2 ^ k ) )
6947, 48, 62, 68ifbothda 3712 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  if ( N  e.  A ,  ( 2 ^ N ) ,  0 )  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k ) )
7046, 69oveq12d 6038 . 2  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
( K `  ( A  i^i  ( 0..^ N ) ) )  +  if ( N  e.  A ,  ( 2 ^ N ) ,  0 ) )  =  ( sum_ k  e.  ( A  i^i  ( 0..^ N ) ) ( 2 ^ k )  +  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k ) ) )
7130, 35, 703eqtr4d 2429 1  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( K `  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  =  ( ( K `  ( A  i^i  ( 0..^ N ) ) )  +  if ( N  e.  A ,  ( 2 ^ N ) ,  0 ) ) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 359    = wceq 1649    e. wcel 1717    u. cun 3261    i^i cin 3262    C_ wss 3263   (/)c0 3571   ifcif 3682   ~Pcpw 3742   {csn 3757   `'ccnv 4817    |` cres 4820   ` cfv 5394  (class class class)co 6020   Fincfn 7045   CCcc 8921   0cc0 8923   1c1 8924    + caddc 8926   NNcn 9932   2c2 9981   NN0cn0 10153   ZZ>=cuz 10420  ..^cfzo 11065   ^cexp 11309   sum_csu 12406  bitscbits 12858
This theorem is referenced by:  sadcaddlem  12896  sadadd2lem  12898
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-inf2 7529  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-disj 4124  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-se 4483  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-isom 5403  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-pm 6957  df-en 7046  df-dom 7047  df-sdom 7048  df-fin 7049  df-sup 7381  df-oi 7412  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-clim 12209  df-sum 12407  df-dvds 12780  df-bits 12861
  Copyright terms: Public domain W3C validator