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

Theorem bitsinvp1 12916
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 11107 . . . . . . 7  |-  -.  N  e.  ( 0..^ N )
21a1i 11 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  -.  N  e.  ( 0..^ N ) )
3 disjsn 3828 . . . . . 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 3502 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( A  i^i  (/) ) )
6 inindi 3518 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  i^i  ( A  i^i  { N } ) )
7 in0 3613 . . . 4  |-  ( A  i^i  (/) )  =  (/)
85, 6, 73eqtr3g 2459 . . 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 10476 . . . . . . 7  |-  NN0  =  ( ZZ>= `  0 )
119, 10syl6eleq 2494 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  N  e.  ( ZZ>= `  0 )
)
12 fzosplitsn 11150 . . . . . 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 3502 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  =  ( A  i^i  ( ( 0..^ N )  u. 
{ N } ) ) )
15 indi 3547 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  u.  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  u.  ( A  i^i  { N } ) )
1614, 15syl6eq 2452 . . 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 11268 . . . . 5  |-  ( 0..^ ( N  +  1 ) )  e.  Fin
1817a1i 11 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ ( N  + 
1 ) )  e. 
Fin )
19 inss2 3522 . . . 4  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  (
0..^ ( N  + 
1 ) )
20 ssfi 7288 . . . 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 10089 . . . . . 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 3521 . . . . . . 7  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  A
25 simpl 444 . . . . . . 7  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  A  C_ 
NN0 )
2624, 25syl5ss 3319 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  NN0 )
2726sselda 3308 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  k  e.  NN0 )
2823, 27nnexpcld 11499 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  NN )
2928nncnd 9972 . . 3  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  CC )
308, 16, 21, 29fsumsplit 12488 . 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 7366 . . . 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 12915 . . 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 3521 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  A
3736, 25syl5ss 3319 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  C_  NN0 )
38 fzofi 11268 . . . . . . 7  |-  ( 0..^ N )  e.  Fin
3938a1i 11 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ N )  e. 
Fin )
40 inss2 3522 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  (
0..^ N )
41 ssfi 7288 . . . . . 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 7366 . . . . 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 12915 . . . 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 2410 . . . 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 2410 . . . 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 3902 . . . . . . . 8  |-  ( N  e.  A  ->  { N }  C_  A )
5049adantl 453 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  { N }  C_  A )
51 dfss1 3505 . . . . . . 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 12450 . . . . 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 11499 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  NN )
5857nncnd 9972 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  CC )
59 oveq2 6048 . . . . . . 7  |-  ( k  =  N  ->  (
2 ^ k )  =  ( 2 ^ N ) )
6059sumsn 12489 . . . . . 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 2437 . . . 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 3828 . . . . . . 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 12450 . . . . 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 12470 . . . . 5  |-  sum_ k  e.  (/)  ( 2 ^ k )  =  0
6866, 67syl6req 2453 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  0  =  sum_ k  e.  ( A  i^i  { N }
) ( 2 ^ k ) )
6947, 48, 62, 68ifbothda 3729 . . 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 6058 . 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 2446 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 1721    u. cun 3278    i^i cin 3279    C_ wss 3280   (/)c0 3588   ifcif 3699   ~Pcpw 3759   {csn 3774   `'ccnv 4836    |` cres 4839   ` cfv 5413  (class class class)co 6040   Fincfn 7068   CCcc 8944   0cc0 8946   1c1 8947    + caddc 8949   NNcn 9956   2c2 10005   NN0cn0 10177   ZZ>=cuz 10444  ..^cfzo 11090   ^cexp 11337   sum_csu 12434  bitscbits 12886
This theorem is referenced by:  sadcaddlem  12924  sadadd2lem  12926
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 1662  ax-8 1683  ax-13 1723  ax-14 1725  ax-6 1740  ax-7 1745  ax-11 1757  ax-12 1946  ax-ext 2385  ax-rep 4280  ax-sep 4290  ax-nul 4298  ax-pow 4337  ax-pr 4363  ax-un 4660  ax-inf2 7552  ax-cnex 9002  ax-resscn 9003  ax-1cn 9004  ax-icn 9005  ax-addcl 9006  ax-addrcl 9007  ax-mulcl 9008  ax-mulrcl 9009  ax-mulcom 9010  ax-addass 9011  ax-mulass 9012  ax-distr 9013  ax-i2m1 9014  ax-1ne0 9015  ax-1rid 9016  ax-rnegex 9017  ax-rrecex 9018  ax-cnre 9019  ax-pre-lttri 9020  ax-pre-lttrn 9021  ax-pre-ltadd 9022  ax-pre-mulgt0 9023  ax-pre-sup 9024
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 2258  df-mo 2259  df-clab 2391  df-cleq 2397  df-clel 2400  df-nfc 2529  df-ne 2569  df-nel 2570  df-ral 2671  df-rex 2672  df-reu 2673  df-rmo 2674  df-rab 2675  df-v 2918  df-sbc 3122  df-csb 3212  df-dif 3283  df-un 3285  df-in 3287  df-ss 3294  df-pss 3296  df-nul 3589  df-if 3700  df-pw 3761  df-sn 3780  df-pr 3781  df-tp 3782  df-op 3783  df-uni 3976  df-int 4011  df-iun 4055  df-disj 4143  df-br 4173  df-opab 4227  df-mpt 4228  df-tr 4263  df-eprel 4454  df-id 4458  df-po 4463  df-so 4464  df-fr 4501  df-se 4502  df-we 4503  df-ord 4544  df-on 4545  df-lim 4546  df-suc 4547  df-om 4805  df-xp 4843  df-rel 4844  df-cnv 4845  df-co 4846  df-dm 4847  df-rn 4848  df-res 4849  df-ima 4850  df-iota 5377  df-fun 5415  df-fn 5416  df-f 5417  df-f1 5418  df-fo 5419  df-f1o 5420  df-fv 5421  df-isom 5422  df-ov 6043  df-oprab 6044  df-mpt2 6045  df-1st 6308  df-2nd 6309  df-riota 6508  df-recs 6592  df-rdg 6627  df-1o 6683  df-2o 6684  df-oadd 6687  df-er 6864  df-map 6979  df-pm 6980  df-en 7069  df-dom 7070  df-sdom 7071  df-fin 7072  df-sup 7404  df-oi 7435  df-card 7782  df-cda 8004  df-pnf 9078  df-mnf 9079  df-xr 9080  df-ltxr 9081  df-le 9082  df-sub 9249  df-neg 9250  df-div 9634  df-nn 9957  df-2 10014  df-3 10015  df-n0 10178  df-z 10239  df-uz 10445  df-rp 10569  df-fz 11000  df-fzo 11091  df-fl 11157  df-mod 11206  df-seq 11279  df-exp 11338  df-hash 11574  df-cj 11859  df-re 11860  df-im 11861  df-sqr 11995  df-abs 11996  df-clim 12237  df-sum 12435  df-dvds 12808  df-bits 12889
  Copyright terms: Public domain W3C validator