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

Theorem smufval 13685
Description: Define the addition of two bit sequences, using df-had 1421 and df-cad 1422 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 10597 . . . 4  |-  NN0  e.  _V
32elpw2 4468 . . 3  |-  ( A  e.  ~P NN0  <->  A  C_  NN0 )
41, 3sylibr 212 . 2  |-  ( ph  ->  A  e.  ~P NN0 )
5 smuval.b . . 3  |-  ( ph  ->  B  C_  NN0 )
62elpw2 4468 . . 3  |-  ( B  e.  ~P NN0  <->  B  C_  NN0 )
75, 6sylibr 212 . 2  |-  ( ph  ->  B  e.  ~P NN0 )
8 simp1l 1012 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  x  =  A )
98eleq2d 2510 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
m  e.  x  <->  m  e.  A ) )
10 simp1r 1013 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  y  =  B )
1110eleq2d 2510 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
( n  -  m
)  e.  y  <->  ( n  -  m )  e.  B
) )
129, 11anbi12d 710 . . . . . . . . . . 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 2976 . . . . . . . . . 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 6119 . . . . . . . . 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 6162 . . . . . . . 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 11825 . . . . . . 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 2493 . . . . . 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 5705 . . . . 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 2510 . . . 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 2976 . . 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 13684 . . 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 4455 . . 3  |-  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) }  e.  _V
2421, 22, 23ovmpt2a 6233 . 2  |-  ( ( A  e.  ~P NN0  /\  B  e.  ~P NN0 )  ->  ( A smul  B
)  =  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) } )
254, 7, 24syl2anc 661 1  |-  ( ph  ->  ( A smul  B )  =  { k  e. 
NN0  |  k  e.  ( P `  ( k  +  1 ) ) } )
Colors of variables: wff setvar class
Syntax hints:    -> wi 4    /\ wa 369    /\ w3a 965    = wceq 1369    e. wcel 1756   {crab 2731    C_ wss 3340   (/)c0 3649   ifcif 3803   ~Pcpw 3872    e. cmpt 4362   ` cfv 5430  (class class class)co 6103    e. cmpt2 6105   0cc0 9294   1c1 9295    + caddc 9297    - cmin 9607   NN0cn0 10591    seqcseq 11818   sadd csad 13628   smul csmu 13629
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1591  ax-4 1602  ax-5 1670  ax-6 1708  ax-7 1728  ax-8 1758  ax-9 1760  ax-10 1775  ax-11 1780  ax-12 1792  ax-13 1943  ax-ext 2423  ax-sep 4425  ax-nul 4433  ax-pow 4482  ax-pr 4543  ax-un 6384  ax-cnex 9350  ax-resscn 9351  ax-1cn 9352  ax-icn 9353  ax-addcl 9354  ax-addrcl 9355  ax-mulcl 9356  ax-mulrcl 9357  ax-i2m1 9362  ax-1ne0 9363  ax-rrecex 9366  ax-cnre 9367
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1372  df-ex 1587  df-nf 1590  df-sb 1701  df-eu 2257  df-mo 2258  df-clab 2430  df-cleq 2436  df-clel 2439  df-nfc 2577  df-ne 2620  df-ral 2732  df-rex 2733  df-reu 2734  df-rab 2736  df-v 2986  df-sbc 3199  df-csb 3301  df-dif 3343  df-un 3345  df-in 3347  df-ss 3354  df-pss 3356  df-nul 3650  df-if 3804  df-pw 3874  df-sn 3890  df-pr 3892  df-tp 3894  df-op 3896  df-uni 4104  df-iun 4185  df-br 4305  df-opab 4363  df-mpt 4364  df-tr 4398  df-eprel 4644  df-id 4648  df-po 4653  df-so 4654  df-fr 4691  df-we 4693  df-ord 4734  df-on 4735  df-lim 4736  df-suc 4737  df-xp 4858  df-rel 4859  df-cnv 4860  df-co 4861  df-dm 4862  df-rn 4863  df-res 4864  df-ima 4865  df-iota 5393  df-fun 5432  df-fn 5433  df-f 5434  df-f1 5435  df-fo 5436  df-f1o 5437  df-fv 5438  df-ov 6106  df-oprab 6107  df-mpt2 6108  df-om 6489  df-recs 6844  df-rdg 6878  df-nn 10335  df-n0 10592  df-seq 11819  df-smu 13684
This theorem is referenced by:  smuval  13689  smupvallem  13691  smucl  13692
  Copyright terms: Public domain W3C validator