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

Theorem bitsinvp1 12953
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 11144 . . . . . . 7  |-  -.  N  e.  ( 0..^ N )
21a1i 11 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  -.  N  e.  ( 0..^ N ) )
3 disjsn 3860 . . . . . 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 3534 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( A  i^i  (/) ) )
6 inindi 3550 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  i^i  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  i^i  ( A  i^i  { N } ) )
7 in0 3645 . . . 4  |-  ( A  i^i  (/) )  =  (/)
85, 6, 73eqtr3g 2490 . . 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 10512 . . . . . . 7  |-  NN0  =  ( ZZ>= `  0 )
119, 10syl6eleq 2525 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  N  e.  ( ZZ>= `  0 )
)
12 fzosplitsn 11187 . . . . . 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 3534 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  =  ( A  i^i  ( ( 0..^ N )  u. 
{ N } ) ) )
15 indi 3579 . . . 4  |-  ( A  i^i  ( ( 0..^ N )  u.  { N } ) )  =  ( ( A  i^i  ( 0..^ N ) )  u.  ( A  i^i  { N } ) )
1614, 15syl6eq 2483 . . 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 11305 . . . . 5  |-  ( 0..^ ( N  +  1 ) )  e.  Fin
1817a1i 11 . . . 4  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ ( N  + 
1 ) )  e. 
Fin )
19 inss2 3554 . . . 4  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  (
0..^ ( N  + 
1 ) )
20 ssfi 7321 . . . 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 10125 . . . . . 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 3553 . . . . . . 7  |-  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  A
25 simpl 444 . . . . . . 7  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  A  C_ 
NN0 )
2624, 25syl5ss 3351 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ ( N  +  1 ) ) )  C_  NN0 )
2726sselda 3340 . . . . 5  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  k  e.  NN0 )
2823, 27nnexpcld 11536 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  NN )
2928nncnd 10008 . . 3  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  k  e.  ( A  i^i  ( 0..^ ( N  +  1 ) ) ) )  ->  (
2 ^ k )  e.  CC )
308, 16, 21, 29fsumsplit 12525 . 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 7400 . . . 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 12952 . . 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 3553 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  A
3736, 25syl5ss 3351 . . . . 5  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  ( A  i^i  ( 0..^ N ) )  C_  NN0 )
38 fzofi 11305 . . . . . . 7  |-  ( 0..^ N )  e.  Fin
3938a1i 11 . . . . . 6  |-  ( ( A  C_  NN0  /\  N  e.  NN0 )  ->  (
0..^ N )  e. 
Fin )
40 inss2 3554 . . . . . 6  |-  ( A  i^i  ( 0..^ N ) )  C_  (
0..^ N )
41 ssfi 7321 . . . . . 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 7400 . . . . 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 12952 . . . 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 2441 . . . 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 2441 . . . 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 3934 . . . . . . . 8  |-  ( N  e.  A  ->  { N }  C_  A )
5049adantl 453 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  { N }  C_  A )
51 dfss1 3537 . . . . . . 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 12487 . . . . 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 11536 . . . . . . 7  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  NN )
5857nncnd 10008 . . . . . 6  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  N  e.  A )  ->  ( 2 ^ N
)  e.  CC )
59 oveq2 6081 . . . . . . 7  |-  ( k  =  N  ->  (
2 ^ k )  =  ( 2 ^ N ) )
6059sumsn 12526 . . . . . 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 2468 . . . 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 3860 . . . . . . 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 12487 . . . . 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 12507 . . . . 5  |-  sum_ k  e.  (/)  ( 2 ^ k )  =  0
6866, 67syl6req 2484 . . . 4  |-  ( ( ( A  C_  NN0  /\  N  e.  NN0 )  /\  -.  N  e.  A
)  ->  0  =  sum_ k  e.  ( A  i^i  { N }
) ( 2 ^ k ) )
6947, 48, 62, 68ifbothda 3761 . . 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 6091 . 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 2477 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 1652    e. wcel 1725    u. cun 3310    i^i cin 3311    C_ wss 3312   (/)c0 3620   ifcif 3731   ~Pcpw 3791   {csn 3806   `'ccnv 4869    |` cres 4872   ` cfv 5446  (class class class)co 6073   Fincfn 7101   CCcc 8980   0cc0 8982   1c1 8983    + caddc 8985   NNcn 9992   2c2 10041   NN0cn0 10213   ZZ>=cuz 10480  ..^cfzo 11127   ^cexp 11374   sum_csu 12471  bitscbits 12923
This theorem is referenced by:  sadcaddlem  12961  sadadd2lem  12963
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-rep 4312  ax-sep 4322  ax-nul 4330  ax-pow 4369  ax-pr 4395  ax-un 4693  ax-inf2 7588  ax-cnex 9038  ax-resscn 9039  ax-1cn 9040  ax-icn 9041  ax-addcl 9042  ax-addrcl 9043  ax-mulcl 9044  ax-mulrcl 9045  ax-mulcom 9046  ax-addass 9047  ax-mulass 9048  ax-distr 9049  ax-i2m1 9050  ax-1ne0 9051  ax-1rid 9052  ax-rnegex 9053  ax-rrecex 9054  ax-cnre 9055  ax-pre-lttri 9056  ax-pre-lttrn 9057  ax-pre-ltadd 9058  ax-pre-mulgt0 9059  ax-pre-sup 9060
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1328  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-nel 2601  df-ral 2702  df-rex 2703  df-reu 2704  df-rmo 2705  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-pss 3328  df-nul 3621  df-if 3732  df-pw 3793  df-sn 3812  df-pr 3813  df-tp 3814  df-op 3815  df-uni 4008  df-int 4043  df-iun 4087  df-disj 4175  df-br 4205  df-opab 4259  df-mpt 4260  df-tr 4295  df-eprel 4486  df-id 4490  df-po 4495  df-so 4496  df-fr 4533  df-se 4534  df-we 4535  df-ord 4576  df-on 4577  df-lim 4578  df-suc 4579  df-om 4838  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-isom 5455  df-ov 6076  df-oprab 6077  df-mpt2 6078  df-1st 6341  df-2nd 6342  df-riota 6541  df-recs 6625  df-rdg 6660  df-1o 6716  df-2o 6717  df-oadd 6720  df-er 6897  df-map 7012  df-pm 7013  df-en 7102  df-dom 7103  df-sdom 7104  df-fin 7105  df-sup 7438  df-oi 7471  df-card 7818  df-cda 8040  df-pnf 9114  df-mnf 9115  df-xr 9116  df-ltxr 9117  df-le 9118  df-sub 9285  df-neg 9286  df-div 9670  df-nn 9993  df-2 10050  df-3 10051  df-n0 10214  df-z 10275  df-uz 10481  df-rp 10605  df-fz 11036  df-fzo 11128  df-fl 11194  df-mod 11243  df-seq 11316  df-exp 11375  df-hash 11611  df-cj 11896  df-re 11897  df-im 11898  df-sqr 12032  df-abs 12033  df-clim 12274  df-sum 12472  df-dvds 12845  df-bits 12926
  Copyright terms: Public domain W3C validator