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

Theorem smufval 12994
Description: Define the addition of two bit sequences, using df-had 1390 and df-cad 1391 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 10232 . . . 4  |-  NN0  e.  _V
32elpw2 4367 . . 3  |-  ( A  e.  ~P NN0  <->  A  C_  NN0 )
41, 3sylibr 205 . 2  |-  ( ph  ->  A  e.  ~P NN0 )
5 smuval.b . . 3  |-  ( ph  ->  B  C_  NN0 )
62elpw2 4367 . . 3  |-  ( B  e.  ~P NN0  <->  B  C_  NN0 )
75, 6sylibr 205 . 2  |-  ( ph  ->  B  e.  ~P NN0 )
8 simp1l 982 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  x  =  A )
98eleq2d 2505 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
m  e.  x  <->  m  e.  A ) )
10 simp1r 983 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  y  =  B )
1110eleq2d 2505 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
( n  -  m
)  e.  y  <->  ( n  -  m )  e.  B
) )
129, 11anbi12d 693 . . . . . . . . . . 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 2950 . . . . . . . . . 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 6100 . . . . . . . . 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 6141 . . . . . . . 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 11335 . . . . . . 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 2488 . . . . . 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 5733 . . . . 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 2505 . . . 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 2950 . . 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 12993 . . 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 4357 . . 3  |-  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) }  e.  _V
2421, 22, 23ovmpt2a 6207 . 2  |-  ( ( A  e.  ~P NN0  /\  B  e.  ~P NN0 )  ->  ( A smul  B
)  =  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) } )
254, 7, 24syl2anc 644 1  |-  ( ph  ->  ( A smul  B )  =  { k  e. 
NN0  |  k  e.  ( P `  ( k  +  1 ) ) } )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 360    /\ w3a 937    = wceq 1653    e. wcel 1726   {crab 2711    C_ wss 3322   (/)c0 3630   ifcif 3741   ~Pcpw 3801    e. cmpt 4269   ` cfv 5457  (class class class)co 6084    e. cmpt2 6086   0cc0 8995   1c1 8996    + caddc 8998    - cmin 9296   NN0cn0 10226    seq cseq 11328   sadd csad 12937   smul csmu 12938
This theorem is referenced by:  smuval  12998  smupvallem  13000  smucl  13001
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1556  ax-5 1567  ax-17 1627  ax-9 1667  ax-8 1688  ax-13 1728  ax-14 1730  ax-6 1745  ax-7 1750  ax-11 1762  ax-12 1951  ax-ext 2419  ax-sep 4333  ax-nul 4341  ax-pow 4380  ax-pr 4406  ax-un 4704  ax-cnex 9051  ax-resscn 9052  ax-1cn 9053  ax-icn 9054  ax-addcl 9055  ax-addrcl 9056  ax-mulcl 9057  ax-mulrcl 9058  ax-i2m1 9063  ax-1ne0 9064  ax-rrecex 9067  ax-cnre 9068
This theorem depends on definitions:  df-bi 179  df-or 361  df-an 362  df-3or 938  df-3an 939  df-tru 1329  df-ex 1552  df-nf 1555  df-sb 1660  df-eu 2287  df-mo 2288  df-clab 2425  df-cleq 2431  df-clel 2434  df-nfc 2563  df-ne 2603  df-ral 2712  df-rex 2713  df-reu 2714  df-rab 2716  df-v 2960  df-sbc 3164  df-csb 3254  df-dif 3325  df-un 3327  df-in 3329  df-ss 3336  df-pss 3338  df-nul 3631  df-if 3742  df-pw 3803  df-sn 3822  df-pr 3823  df-tp 3824  df-op 3825  df-uni 4018  df-iun 4097  df-br 4216  df-opab 4270  df-mpt 4271  df-tr 4306  df-eprel 4497  df-id 4501  df-po 4506  df-so 4507  df-fr 4544  df-we 4546  df-ord 4587  df-on 4588  df-lim 4589  df-suc 4590  df-om 4849  df-xp 4887  df-rel 4888  df-cnv 4889  df-co 4890  df-dm 4891  df-rn 4892  df-res 4893  df-ima 4894  df-iota 5421  df-fun 5459  df-fn 5460  df-f 5461  df-f1 5462  df-fo 5463  df-f1o 5464  df-fv 5465  df-ov 6087  df-oprab 6088  df-mpt2 6089  df-recs 6636  df-rdg 6671  df-nn 10006  df-n0 10227  df-seq 11329  df-smu 12993
  Copyright terms: Public domain W3C validator