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

Theorem smufval 12948
Description: Define the addition of two bit sequences, using df-had 1386 and df-cad 1387 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 10187 . . . 4  |-  NN0  e.  _V
32elpw2 4328 . . 3  |-  ( A  e.  ~P NN0  <->  A  C_  NN0 )
41, 3sylibr 204 . 2  |-  ( ph  ->  A  e.  ~P NN0 )
5 smuval.b . . 3  |-  ( ph  ->  B  C_  NN0 )
62elpw2 4328 . . 3  |-  ( B  e.  ~P NN0  <->  B  C_  NN0 )
75, 6sylibr 204 . 2  |-  ( ph  ->  B  e.  ~P NN0 )
8 simp1l 981 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  x  =  A )
98eleq2d 2475 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
m  e.  x  <->  m  e.  A ) )
10 simp1r 982 . . . . . . . . . . . . 13  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  y  =  B )
1110eleq2d 2475 . . . . . . . . . . . 12  |-  ( ( ( x  =  A  /\  y  =  B )  /\  p  e. 
~P NN0  /\  m  e.  NN0 )  ->  (
( n  -  m
)  e.  y  <->  ( n  -  m )  e.  B
) )
129, 11anbi12d 692 . . . . . . . . . . 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 2912 . . . . . . . . . 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 6060 . . . . . . . . 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 6101 . . . . . . . 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 11289 . . . . . . 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 2458 . . . . . 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 5693 . . . . 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 2475 . . . 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 2912 . . 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 12947 . . 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 4318 . . 3  |-  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) }  e.  _V
2421, 22, 23ovmpt2a 6167 . 2  |-  ( ( A  e.  ~P NN0  /\  B  e.  ~P NN0 )  ->  ( A smul  B
)  =  { k  e.  NN0  |  k  e.  ( P `  (
k  +  1 ) ) } )
254, 7, 24syl2anc 643 1  |-  ( ph  ->  ( A smul  B )  =  { k  e. 
NN0  |  k  e.  ( P `  ( k  +  1 ) ) } )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 359    /\ w3a 936    = wceq 1649    e. wcel 1721   {crab 2674    C_ wss 3284   (/)c0 3592   ifcif 3703   ~Pcpw 3763    e. cmpt 4230   ` cfv 5417  (class class class)co 6044    e. cmpt2 6046   0cc0 8950   1c1 8951    + caddc 8953    - cmin 9251   NN0cn0 10181    seq cseq 11282   sadd csad 12891   smul csmu 12892
This theorem is referenced by:  smuval  12952  smupvallem  12954  smucl  12955
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1552  ax-5 1563  ax-17 1623  ax-9 1662  ax-8 1683  ax-13 1723  ax-14 1725  ax-6 1740  ax-7 1745  ax-11 1757  ax-12 1946  ax-ext 2389  ax-sep 4294  ax-nul 4302  ax-pow 4341  ax-pr 4367  ax-un 4664  ax-cnex 9006  ax-resscn 9007  ax-1cn 9008  ax-icn 9009  ax-addcl 9010  ax-addrcl 9011  ax-mulcl 9012  ax-mulrcl 9013  ax-i2m1 9018  ax-1ne0 9019  ax-rrecex 9022  ax-cnre 9023
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2262  df-mo 2263  df-clab 2395  df-cleq 2401  df-clel 2404  df-nfc 2533  df-ne 2573  df-ral 2675  df-rex 2676  df-reu 2677  df-rab 2679  df-v 2922  df-sbc 3126  df-csb 3216  df-dif 3287  df-un 3289  df-in 3291  df-ss 3298  df-pss 3300  df-nul 3593  df-if 3704  df-pw 3765  df-sn 3784  df-pr 3785  df-tp 3786  df-op 3787  df-uni 3980  df-iun 4059  df-br 4177  df-opab 4231  df-mpt 4232  df-tr 4267  df-eprel 4458  df-id 4462  df-po 4467  df-so 4468  df-fr 4505  df-we 4507  df-ord 4548  df-on 4549  df-lim 4550  df-suc 4551  df-om 4809  df-xp 4847  df-rel 4848  df-cnv 4849  df-co 4850  df-dm 4851  df-rn 4852  df-res 4853  df-ima 4854  df-iota 5381  df-fun 5419  df-fn 5420  df-f 5421  df-f1 5422  df-fo 5423  df-f1o 5424  df-fv 5425  df-ov 6047  df-oprab 6048  df-mpt2 6049  df-recs 6596  df-rdg 6631  df-nn 9961  df-n0 10182  df-seq 11283  df-smu 12947
  Copyright terms: Public domain W3C validator