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

Theorem bitsinvp1 12640
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 10887 . . . . . . 7  |-  -.  N  e.  ( 0..^ N )
21a1i 10 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  -.  N  e.  ( 0..^ N ) )
3 disjsn 3693 . . . . . 6  |-  ( ( ( 0..^ N )  i^i  { N }
)  =  (/)  <->  -.  N  e.  ( 0..^ N ) )
42, 3sylibr 203 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
( 0..^ N )  i^i  { N }
)  =  (/) )
54ineq2d 3370 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( A  i^i  (/) ) )
6 inindi 3386 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  i^i  ( A  i^i  { N } ) )
7 in0 3480 . . . 4  |-  ( A  i^i  (/) )  =  (/)
85, 6, 73eqtr3g 2338 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
( A  i^i  (
0..^ N ) )  i^i  ( A  i^i  { N } ) )  =  (/) )
9 simpr 447 . . . . . . 7  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  N  e.  NN0 )
10 nn0uz 10262 . . . . . . 7  |-  NN0  =  ( ZZ>= `  0 )
119, 10syl6eleq 2373 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  N  e.  ( ZZ>= `  0 )
)
12 fzosplitsn 10920 . . . . . 6  |-  ( N  e.  ( ZZ>= `  0
)  ->  ( 0..^ ( N  +  1 ) )  =  ( ( 0..^ N )  u.  { N }
) )
1311, 12syl 15 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ ( N  + 
1 ) )  =  ( ( 0..^ N )  u.  { N } ) )
1413ineq2d 3370 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  =  ( A  i^i  ( ( 0..^ N )  u. 
{ N } ) ) )
15 indi 3415 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  u.  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  u.  ( A  i^i  { N } ) )
1614, 15syl6eq 2331 . . 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 11036 . . . . 5  |-  ( 0..^ ( N  +  1 ) )  e.  Fin
1817a1i 10 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ ( N  + 
1 ) )  e. 
Fin )
19 inss2 3390 . . . 4  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  (
0..^ ( N  + 
1 ) )
20 ssfi 7083 . . . 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 643 . . 3  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  e.  Fin )
22 2nn 9877 . . . . . 6  |-  2  e.  NN
2322a1i 10 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  2  e.  NN )
24 inss1 3389 . . . . . . 7  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  A
25 simpl 443 . . . . . . 7  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  A  C_ 
NN0 )
2624, 25syl5ss 3190 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  NN0 )
2726sselda 3180 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  k  e.  NN0 )
2823, 27nnexpcld 11266 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  NN )
2928nncnd 9762 . . 3  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  CC )
308, 16, 21, 29fsumsplit 12212 . 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 7157 . . . 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 645 . . 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 12639 . . 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 15 . 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 3389 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  A
3736, 25syl5ss 3190 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  C_  NN0 )
38 fzofi 11036 . . . . . . 7  |-  ( 0..^ N )  e.  Fin
3938a1i 10 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ N )  e. 
Fin )
40 inss2 3390 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  (
0..^ N )
41 ssfi 7083 . . . . . 6  |-  ( ( ( 0..^ N )  e.  Fin  /\  ( A  i^i  ( 0..^ N ) )  C_  (
0..^ N ) )  ->  ( A  i^i  ( 0..^ N ) )  e.  Fin )
4239, 40, 41sylancl 643 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  e.  Fin )
43 elfpw 7157 . . . . 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 645 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  e.  ( ~P NN0  i^i  Fin ) )
4533bitsinv 12639 . . . 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 15 . . 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 2289 . . . 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 2289 . . . 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 3759 . . . . . . . 8  |-  ( N  e.  A  ->  { N }  C_  A )
5049adantl 452 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  { N }  C_  A )
51 dfss1 3373 . . . . . . 7  |-  ( { N }  C_  A  <->  ( A  i^i  { N } )  =  { N } )
5250, 51sylib 188 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( A  i^i  { N } )  =  { N } )
5352sumeq1d 12174 . . . . 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 447 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  N  e.  A )
5522a1i 10 . . . . . . . 8  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  2  e.  NN )
56 simplr 731 . . . . . . . 8  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  N  e.  NN0 )
5755, 56nnexpcld 11266 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  NN )
5857nncnd 9762 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  CC )
59 oveq2 5866 . . . . . . 7  |-  ( k  =  N  ->  (
2 ^ k )  =  ( 2 ^ N ) )
6059sumsn 12213 . . . . . 6  |-  ( ( N  e.  A  /\  ( 2 ^ N
)  e.  CC )  ->  sum_ k  e.  { N }  ( 2 ^ k )  =  ( 2 ^ N
) )
6154, 58, 60syl2anc 642 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  -> 
sum_ k  e.  { N }  ( 2 ^ k )  =  ( 2 ^ N
) )
6253, 61eqtr2d 2316 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  =  sum_ k  e.  ( A  i^i  { N } ) ( 2 ^ k ) )
63 simpr 447 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  -.  N  e.  A )
64 disjsn 3693 . . . . . . 7  |-  ( ( A  i^i  { N } )  =  (/)  <->  -.  N  e.  A )
6563, 64sylibr 203 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  ( A  i^i  { N } )  =  (/) )
6665sumeq1d 12174 . . . . 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 12194 . . . . 5  |-  sum_ k  e.  (/)  ( 2 ^ k )  =  0
6866, 67syl6req 2332 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  0  =  sum_ k  e.  ( A  i^i  { N }
) ( 2 ^ k ) )
6947, 48, 62, 68ifbothda 3595 . . 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 5876 . 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 2325 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 358    = wceq 1623    e. wcel 1684    u. cun 3150    i^i cin 3151    C_ wss 3152   (/)c0 3455   ifcif 3565   ~Pcpw 3625   {csn 3640   `'ccnv 4688    |` cres 4691   ` cfv 5255  (class class class)co 5858   Fincfn 6863   CCcc 8735   0cc0 8737   1c1 8738    + caddc 8740   NNcn 9746   2c2 9795   NN0cn0 9965   ZZ>=cuz 10230  ..^cfzo 10870   ^cexp 11104   sum_csu 12158  bitscbits 12610
This theorem is referenced by:  sadcaddlem  12648  sadadd2lem  12650
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-inf2 7342  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-tru 1310  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-disj 3994  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-se 4353  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-isom 5264  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-2o 6480  df-oadd 6483  df-er 6660  df-map 6774  df-pm 6775  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-sup 7194  df-oi 7225  df-card 7572  df-cda 7794  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-2 9804  df-3 9805  df-n0 9966  df-z 10025  df-uz 10231  df-rp 10355  df-fz 10783  df-fzo 10871  df-fl 10925  df-mod 10974  df-seq 11047  df-exp 11105  df-hash 11338  df-cj 11584  df-re 11585  df-im 11586  df-sqr 11720  df-abs 11721  df-clim 11962  df-sum 12159  df-dvds 12532  df-bits 12613
  Copyright terms: Public domain W3C validator