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

Theorem smufval 12876
Description: Define the addition of two bit sequences, using df-had 1385 and df-cad 1386 bit operations. (Contributed by Mario Carneiro, 9-Sep-2016.)
Hypotheses
Ref Expression
smuval.a  |-  ( ph  ->  A  C_  NN0 )
smuval.b  |-  ( ph  ->  B  C_  NN0 )
smuval.p  |-  P  =  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  A  /\  ( n  -  m
)  e.  B ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) )
Assertion
Ref Expression
smufval  |-  ( ph  ->  ( A smul  B )  =  { k  e. 
NN0  |  k  e.  ( P `  ( k  +  1 ) ) } )
Distinct variable groups:    k, m, n, p, A    ph, k, n    B, k, m, n, p    P, k
Allowed substitution hints:    ph( m, p)    P( m, n, p)

Proof of Theorem smufval
Dummy variables  x  y are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 smuval.a . . 3  |-  ( ph  ->  A  C_  NN0 )
2 nn0ex 10120 . . . 4  |-  NN0  e.  _V
32elpw2 4277 . . 3  |-  ( A  e.  ~P NN0  <->  A  C_  NN0 )
41, 3sylibr 203 . 2  |-  ( ph  ->  A  e.  ~P NN0 )
5 smuval.b . . 3  |-  ( ph  ->  B  C_  NN0 )
62elpw2 4277 . . 3  |-  ( B  e.  ~P NN0  <->  B  C_  NN0 )
75, 6sylibr 203 . 2  |-  ( ph  ->  B  e.  ~P NN0 )
8 simp1l 980 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  x  =  A )
98eleq2d 2433 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
m  e.  x  <->  m  e.  A ) )
10 simp1r 981 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  y  =  B )
1110eleq2d 2433 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
( n  -  m
)  e.  y  <->  ( n  -  m )  e.  B
) )
129, 11anbi12d 691 . . . . . . . . . . 11  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
( m  e.  x  /\  ( n  -  m
)  e.  y )  <-> 
( m  e.  A  /\  ( n  -  m
)  e.  B ) ) )
1312rabbidv 2865 . . . . . . . . . 10  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  { n  e.  NN0  |  ( m  e.  x  /\  (
n  -  m )  e.  y ) }  =  { n  e. 
NN0  |  ( m  e.  A  /\  (
n  -  m )  e.  B ) } )
1413oveq2d 5997 . . . . . . . . 9  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
p sadd  { n  e.  NN0  |  ( m  e.  x  /\  ( n  -  m
)  e.  y ) } )  =  ( p sadd  { n  e. 
NN0  |  ( m  e.  A  /\  (
n  -  m )  e.  B ) } ) )
1514mpt2eq3dva 6038 . . . . . . . 8  |-  ( ( x  =  A  /\  y  =  B )  ->  ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e. 
NN0  |  ( m  e.  x  /\  (
n  -  m )  e.  y ) } ) )  =  ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  A  /\  ( n  -  m
)  e.  B ) } ) ) )
1615seqeq2d 11217 . . . . . . 7  |-  ( ( x  =  A  /\  y  =  B )  ->  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  x  /\  ( n  -  m
)  e.  y ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) )  =  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  A  /\  ( n  -  m
)  e.  B ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) ) )
17 smuval.p . . . . . . 7  |-  P  =  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  A  /\  ( n  -  m
)  e.  B ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) )
1816, 17syl6eqr 2416 . . . . . 6  |-  ( ( x  =  A  /\  y  =  B )  ->  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  x  /\  ( n  -  m
)  e.  y ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) )  =  P )
1918fveq1d 5634 . . . . 5  |-  ( ( x  =  A  /\  y  =  B )  ->  (  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e. 
NN0  |  ( m  e.  x  /\  (
n  -  m )  e.  y ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  - 
1 ) ) ) ) `  ( k  +  1 ) )  =  ( P `  ( k  +  1 ) ) )
2019eleq2d 2433 . . . 4  |-  ( ( x  =  A  /\  y  =  B )  ->  ( k  e.  (  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  x  /\  ( n  -  m
)  e.  y ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) ) `  (
k  +  1 ) )  <->  k  e.  ( P `  ( k  +  1 ) ) ) )
2120rabbidv 2865 . . 3  |-  ( ( x  =  A  /\  y  =  B )  ->  { k  e.  NN0  |  k  e.  (  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  x  /\  ( n  -  m
)  e.  y ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) ) `  (
k  +  1 ) ) }  =  {
k  e.  NN0  | 
k  e.  ( P `
 ( k  +  1 ) ) } )
22 df-smu 12875 . . 3  |- smul  =  ( x  e.  ~P NN0 ,  y  e.  ~P NN0  |->  { k  e.  NN0  |  k  e.  (  seq  0 ( ( p  e.  ~P NN0 ,  m  e.  NN0  |->  ( p sadd  { n  e.  NN0  |  ( m  e.  x  /\  ( n  -  m
)  e.  y ) } ) ) ,  ( n  e.  NN0  |->  if ( n  =  0 ,  (/) ,  ( n  -  1 ) ) ) ) `  (
k  +  1 ) ) } )
232rabex 4267 . . 3  |-  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) }  e.  _V
2421, 22, 23ovmpt2a 6104 . 2  |-  ( ( A  e.  ~P NN0  /\  B  e.  ~P NN0 )  ->  ( A smul  B
)  =  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) } )
254, 7, 24syl2anc 642 1  |-  ( ph  ->  ( A smul  B )  =  { k  e. 
NN0  |  k  e.  ( P `  ( k  +  1 ) ) } )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 358    /\ w3a 935    = wceq 1647    e. wcel 1715   {crab 2632    C_ wss 3238   (/)c0 3543   ifcif 3654   ~Pcpw 3714    e. cmpt 4179   ` cfv 5358  (class class class)co 5981    e. cmpt2 5983   0cc0 8884   1c1 8885    + caddc 8887    - cmin 9184   NN0cn0 10114    seq cseq 11210   sadd csad 12819   smul csmu 12820
This theorem is referenced by:  smuval  12880  smupvallem  12882  smucl  12883
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1551  ax-5 1562  ax-17 1621  ax-9 1659  ax-8 1680  ax-13 1717  ax-14 1719  ax-6 1734  ax-7 1739  ax-11 1751  ax-12 1937  ax-ext 2347  ax-sep 4243  ax-nul 4251  ax-pow 4290  ax-pr 4316  ax-un 4615  ax-cnex 8940  ax-resscn 8941  ax-1cn 8942  ax-icn 8943  ax-addcl 8944  ax-addrcl 8945  ax-mulcl 8946  ax-mulrcl 8947  ax-i2m1 8952  ax-1ne0 8953  ax-rrecex 8956  ax-cnre 8957
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 936  df-3an 937  df-tru 1324  df-ex 1547  df-nf 1550  df-sb 1654  df-eu 2221  df-mo 2222  df-clab 2353  df-cleq 2359  df-clel 2362  df-nfc 2491  df-ne 2531  df-ral 2633  df-rex 2634  df-reu 2635  df-rab 2637  df-v 2875  df-sbc 3078  df-csb 3168  df-dif 3241  df-un 3243  df-in 3245  df-ss 3252  df-pss 3254  df-nul 3544  df-if 3655  df-pw 3716  df-sn 3735  df-pr 3736  df-tp 3737  df-op 3738  df-uni 3930  df-iun 4009  df-br 4126  df-opab 4180  df-mpt 4181  df-tr 4216  df-eprel 4408  df-id 4412  df-po 4417  df-so 4418  df-fr 4455  df-we 4457  df-ord 4498  df-on 4499  df-lim 4500  df-suc 4501  df-om 4760  df-xp 4798  df-rel 4799  df-cnv 4800  df-co 4801  df-dm 4802  df-rn 4803  df-res 4804  df-ima 4805  df-iota 5322  df-fun 5360  df-fn 5361  df-f 5362  df-f1 5363  df-fo 5364  df-f1o 5365  df-fv 5366  df-ov 5984  df-oprab 5985  df-mpt2 5986  df-recs 6530  df-rdg 6565  df-nn 9894  df-n0 10115  df-seq 11211  df-smu 12875
  Copyright terms: Public domain W3C validator