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

Theorem smumullem 12683
Description: Lemma for smumul 12684. (Contributed by Mario Carneiro, 22-Sep-2016.)
Hypotheses
Ref Expression
smumullem.a  |-  ( ph  ->  A  e.  ZZ )
smumullem.b  |-  ( ph  ->  B  e.  ZZ )
smumullem.n  |-  ( ph  ->  N  e.  NN0 )
Assertion
Ref Expression
smumullem  |-  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )

Proof of Theorem smumullem
Dummy variables  k  n  x are mutually distinct and distinct from all other variables.
StepHypRef Expression
1 smumullem.n . 2  |-  ( ph  ->  N  e.  NN0 )
2 oveq2 5866 . . . . . . . . . 10  |-  ( x  =  0  ->  (
0..^ x )  =  ( 0..^ 0 ) )
3 fzo0 10893 . . . . . . . . . 10  |-  ( 0..^ 0 )  =  (/)
42, 3syl6eq 2331 . . . . . . . . 9  |-  ( x  =  0  ->  (
0..^ x )  =  (/) )
54ineq2d 3370 . . . . . . . 8  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (/) ) )
6 in0 3480 . . . . . . . 8  |-  ( (bits `  A )  i^i  (/) )  =  (/)
75, 6syl6eq 2331 . . . . . . 7  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  (/) )
87oveq1d 5873 . . . . . 6  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( (/) smul  (bits `  B
) ) )
9 bitsss 12617 . . . . . . 7  |-  (bits `  B )  C_  NN0
10 smu02 12678 . . . . . . 7  |-  ( (bits `  B )  C_  NN0  ->  (
(/) smul  (bits `  B )
)  =  (/) )
119, 10ax-mp 8 . . . . . 6  |-  ( (/) smul  (bits `  B ) )  =  (/)
128, 11syl6eq 2331 . . . . 5  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  (/) )
13 oveq2 5866 . . . . . . . . 9  |-  ( x  =  0  ->  (
2 ^ x )  =  ( 2 ^ 0 ) )
14 2cn 9816 . . . . . . . . . 10  |-  2  e.  CC
15 exp0 11108 . . . . . . . . . 10  |-  ( 2  e.  CC  ->  (
2 ^ 0 )  =  1 )
1614, 15ax-mp 8 . . . . . . . . 9  |-  ( 2 ^ 0 )  =  1
1713, 16syl6eq 2331 . . . . . . . 8  |-  ( x  =  0  ->  (
2 ^ x )  =  1 )
1817oveq2d 5874 . . . . . . 7  |-  ( x  =  0  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  1
) )
1918oveq1d 5873 . . . . . 6  |-  ( x  =  0  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  1 )  x.  B ) )
2019fveq2d 5529 . . . . 5  |-  ( x  =  0  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
2112, 20eqeq12d 2297 . . . 4  |-  ( x  =  0  ->  (
( ( (bits `  A )  i^i  (
0..^ x ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  <->  (/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) ) )
2221imbi2d 307 . . 3  |-  ( x  =  0  ->  (
( ph  ->  ( ( (bits `  A )  i^i  ( 0..^ x ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) ) )  <->  ( ph  -> 
(/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) ) ) )
23 oveq2 5866 . . . . . . 7  |-  ( x  =  k  ->  (
0..^ x )  =  ( 0..^ k ) )
2423ineq2d 3370 . . . . . 6  |-  ( x  =  k  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ k ) ) )
2524oveq1d 5873 . . . . 5  |-  ( x  =  k  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) )
26 oveq2 5866 . . . . . . . 8  |-  ( x  =  k  ->  (
2 ^ x )  =  ( 2 ^ k ) )
2726oveq2d 5874 . . . . . . 7  |-  ( x  =  k  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ k ) ) )
2827oveq1d 5873 . . . . . 6  |-  ( x  =  k  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )
2928fveq2d 5529 . . . . 5  |-  ( x  =  k  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) )
3025, 29eqeq12d 2297 . . . 4  |-  ( x  =  k  ->  (
( ( (bits `  A )  i^i  (
0..^ x ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  <->  ( (
(bits `  A )  i^i  ( 0..^ k ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) ) )
3130imbi2d 307 . . 3  |-  ( x  =  k  ->  (
( ph  ->  ( ( (bits `  A )  i^i  ( 0..^ x ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) ) )  <->  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) ) ) )
32 oveq2 5866 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  (
0..^ x )  =  ( 0..^ ( k  +  1 ) ) )
3332ineq2d 3370 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) )
3433oveq1d 5873 . . . . 5  |-  ( x  =  ( k  +  1 )  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) smul  (bits `  B )
) )
35 oveq2 5866 . . . . . . . 8  |-  ( x  =  ( k  +  1 )  ->  (
2 ^ x )  =  ( 2 ^ ( k  +  1 ) ) )
3635oveq2d 5874 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ ( k  +  1 ) ) ) )
3736oveq1d 5873 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) )
3837fveq2d 5529 . . . . 5  |-  ( x  =  ( k  +  1 )  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) )
3934, 38eqeq12d 2297 . . . 4  |-  ( x  =  ( k  +  1 )  ->  (
( ( (bits `  A )  i^i  (
0..^ x ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  <->  ( (
(bits `  A )  i^i  ( 0..^ ( k  +  1 ) ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) ) )
4039imbi2d 307 . . 3  |-  ( x  =  ( k  +  1 )  ->  (
( ph  ->  ( ( (bits `  A )  i^i  ( 0..^ x ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) ) )  <->  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) ) ) )
41 oveq2 5866 . . . . . . 7  |-  ( x  =  N  ->  (
0..^ x )  =  ( 0..^ N ) )
4241ineq2d 3370 . . . . . 6  |-  ( x  =  N  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ N ) ) )
4342oveq1d 5873 . . . . 5  |-  ( x  =  N  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
) )
44 oveq2 5866 . . . . . . . 8  |-  ( x  =  N  ->  (
2 ^ x )  =  ( 2 ^ N ) )
4544oveq2d 5874 . . . . . . 7  |-  ( x  =  N  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ N ) ) )
4645oveq1d 5873 . . . . . 6  |-  ( x  =  N  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ N ) )  x.  B ) )
4746fveq2d 5529 . . . . 5  |-  ( x  =  N  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
4843, 47eqeq12d 2297 . . . 4  |-  ( x  =  N  ->  (
( ( (bits `  A )  i^i  (
0..^ x ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  <->  ( (
(bits `  A )  i^i  ( 0..^ N ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) ) )
4948imbi2d 307 . . 3  |-  ( x  =  N  ->  (
( ph  ->  ( ( (bits `  A )  i^i  ( 0..^ x ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) ) )  <->  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) ) ) )
50 smumullem.a . . . . . . . 8  |-  ( ph  ->  A  e.  ZZ )
51 zmod10 10987 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A  mod  1 )  =  0 )
5250, 51syl 15 . . . . . . 7  |-  ( ph  ->  ( A  mod  1
)  =  0 )
5352oveq1d 5873 . . . . . 6  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  ( 0  x.  B ) )
54 smumullem.b . . . . . . . 8  |-  ( ph  ->  B  e.  ZZ )
5554zcnd 10118 . . . . . . 7  |-  ( ph  ->  B  e.  CC )
5655mul02d 9010 . . . . . 6  |-  ( ph  ->  ( 0  x.  B
)  =  0 )
5753, 56eqtrd 2315 . . . . 5  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  0 )
5857fveq2d 5529 . . . 4  |-  ( ph  ->  (bits `  ( ( A  mod  1 )  x.  B ) )  =  (bits `  0 )
)
59 0bits 12630 . . . 4  |-  (bits ` 
0 )  =  (/)
6058, 59syl6req 2332 . . 3  |-  ( ph  -> 
(/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
61 oveq1 5865 . . . . . 6  |-  ( ( ( (bits `  A
)  i^i  ( 0..^ k ) ) smul  (bits `  B ) )  =  (bits `  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )  -> 
( ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) sadd  { n  e.  NN0  |  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) } )  =  ( (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) sadd  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } ) )
62 bitsss 12617 . . . . . . . . 9  |-  (bits `  A )  C_  NN0
6362a1i 10 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  A
)  C_  NN0 )
649a1i 10 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  B
)  C_  NN0 )
65 simpr 447 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  k  e.  NN0 )
6663, 64, 65smup1 12680 . . . . . . 7  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (
(bits `  A )  i^i  ( 0..^ ( k  +  1 ) ) ) smul  (bits `  B
) )  =  ( ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) sadd  { n  e.  NN0  |  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) } ) )
67 bitsinv1lem 12632 . . . . . . . . . . . 12  |-  ( ( A  e.  ZZ  /\  k  e.  NN0 )  -> 
( A  mod  (
2 ^ ( k  +  1 ) ) )  =  ( ( A  mod  ( 2 ^ k ) )  +  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 ) ) )
6850, 67sylan 457 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ (
k  +  1 ) ) )  =  ( ( A  mod  (
2 ^ k ) )  +  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
6968oveq1d 5873 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B )  =  ( ( ( A  mod  ( 2 ^ k
) )  +  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  x.  B ) )
7050adantr 451 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  A  e.  ZZ )
71 2nn 9877 . . . . . . . . . . . . . . 15  |-  2  e.  NN
7271a1i 10 . . . . . . . . . . . . . 14  |-  ( (
ph  /\  k  e.  NN0 )  ->  2  e.  NN )
7372, 65nnexpcld 11266 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e.  NN )
7470, 73zmodcld 10990 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  NN0 )
7574nn0cnd 10020 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  CC )
7673nnnn0d 10018 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e. 
NN0 )
77 0nn0 9980 . . . . . . . . . . . . 13  |-  0  e.  NN0
78 ifcl 3601 . . . . . . . . . . . . 13  |-  ( ( ( 2 ^ k
)  e.  NN0  /\  0  e.  NN0 )  ->  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e. 
NN0 )
7976, 77, 78sylancl 643 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e. 
NN0 )
8079nn0cnd 10020 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  CC )
8155adantr 451 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  CC )
8275, 80, 81adddird 8860 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (
( A  mod  (
2 ^ k ) )  +  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  x.  B )  =  ( ( ( A  mod  ( 2 ^ k ) )  x.  B )  +  ( if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  x.  B ) ) )
8380, 81mulcomd 8856 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  x.  B )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
8483oveq2d 5874 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (
( A  mod  (
2 ^ k ) )  x.  B )  +  ( if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  x.  B ) )  =  ( ( ( A  mod  ( 2 ^ k ) )  x.  B )  +  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) )
8569, 82, 843eqtrd 2319 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B )  =  ( ( ( A  mod  ( 2 ^ k
) )  x.  B
)  +  ( B  x.  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 ) ) ) )
8685fveq2d 5529 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  (
( A  mod  (
2 ^ ( k  +  1 ) ) )  x.  B ) )  =  (bits `  ( ( ( A  mod  ( 2 ^ k ) )  x.  B )  +  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) ) )
8774nn0zd 10115 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  ZZ )
8854adantr 451 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  ZZ )
8987, 88zmulcld 10123 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ k ) )  x.  B )  e.  ZZ )
9079nn0zd 10115 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  ZZ )
9188, 90zmulcld 10123 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  e.  ZZ )
92 sadadd 12658 . . . . . . . . 9  |-  ( ( ( ( A  mod  ( 2 ^ k
) )  x.  B
)  e.  ZZ  /\  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  e.  ZZ )  -> 
( (bits `  (
( A  mod  (
2 ^ k ) )  x.  B ) ) sadd  (bits `  ( B  x.  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) )  =  (bits `  ( ( ( A  mod  ( 2 ^ k ) )  x.  B )  +  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) ) )
9389, 91, 92syl2anc 642 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) sadd  (bits `  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) )  =  (bits `  ( ( ( A  mod  ( 2 ^ k ) )  x.  B )  +  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) ) )
94 oveq2 5866 . . . . . . . . . . . 12  |-  ( ( 2 ^ k )  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  ( B  x.  ( 2 ^ k ) )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
9594fveq2d 5529 . . . . . . . . . . 11  |-  ( ( 2 ^ k )  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  (bits `  ( B  x.  (
2 ^ k ) ) )  =  (bits `  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) )
9695eqeq1d 2291 . . . . . . . . . 10  |-  ( ( 2 ^ k )  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  (
(bits `  ( B  x.  ( 2 ^ k
) ) )  =  { n  e.  NN0  |  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) }  <->  (bits `  ( B  x.  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )  =  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } ) )
97 oveq2 5866 . . . . . . . . . . . 12  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  ( B  x.  0 )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
9897fveq2d 5529 . . . . . . . . . . 11  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  (bits `  ( B  x.  0 ) )  =  (bits `  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) )
9998eqeq1d 2291 . . . . . . . . . 10  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  (
(bits `  ( B  x.  0 ) )  =  { n  e.  NN0  |  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) }  <->  (bits `  ( B  x.  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )  =  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } ) )
100 bitsshft 12666 . . . . . . . . . . . 12  |-  ( ( B  e.  ZZ  /\  k  e.  NN0 )  ->  { n  e.  NN0  |  ( n  -  k
)  e.  (bits `  B ) }  =  (bits `  ( B  x.  ( 2 ^ k
) ) ) )
10154, 100sylan 457 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  { n  e.  NN0  |  ( n  -  k )  e.  (bits `  B ) }  =  (bits `  ( B  x.  ( 2 ^ k ) ) ) )
102 ibar 490 . . . . . . . . . . . 12  |-  ( k  e.  (bits `  A
)  ->  ( (
n  -  k )  e.  (bits `  B
)  <->  ( k  e.  (bits `  A )  /\  ( n  -  k
)  e.  (bits `  B ) ) ) )
103102rabbidv 2780 . . . . . . . . . . 11  |-  ( k  e.  (bits `  A
)  ->  { n  e.  NN0  |  ( n  -  k )  e.  (bits `  B ) }  =  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } )
104101, 103sylan9req 2336 . . . . . . . . . 10  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  k  e.  (bits `  A )
)  ->  (bits `  ( B  x.  ( 2 ^ k ) ) )  =  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } )
10581adantr 451 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  B  e.  CC )
106105mul01d 9011 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  ( B  x.  0 )  =  0 )
107106fveq2d 5529 . . . . . . . . . . 11  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  (bits `  ( B  x.  0 ) )  =  (bits `  0 ) )
108 simpr 447 . . . . . . . . . . . . . 14  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  -.  k  e.  (bits `  A
) )
109108intnanrd 883 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  -.  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) )
110109ralrimivw 2627 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  A. n  e.  NN0  -.  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) )
111 rabeq0 3476 . . . . . . . . . . . 12  |-  ( { n  e.  NN0  | 
( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) }  =  (/)  <->  A. n  e.  NN0  -.  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) )
112110, 111sylibr 203 . . . . . . . . . . 11  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) }  =  (/) )
11359, 107, 1123eqtr4a 2341 . . . . . . . . . 10  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  (bits `  ( B  x.  0 ) )  =  {
n  e.  NN0  | 
( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) } )
11496, 99, 104, 113ifbothda 3595 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  ( B  x.  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )  =  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } )
115114oveq2d 5874 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) sadd  (bits `  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) ) )  =  ( (bits `  ( ( A  mod  ( 2 ^ k ) )  x.  B ) ) sadd  {
n  e.  NN0  | 
( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) } ) )
11686, 93, 1153eqtr2d 2321 . . . . . . 7  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  (
( A  mod  (
2 ^ ( k  +  1 ) ) )  x.  B ) )  =  ( (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) sadd  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } ) )
11766, 116eqeq12d 2297 . . . . . 6  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (
( (bits `  A
)  i^i  ( 0..^ ( k  +  1 ) ) ) smul  (bits `  B ) )  =  (bits `  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) )  <->  ( (
( (bits `  A
)  i^i  ( 0..^ k ) ) smul  (bits `  B ) ) sadd  {
n  e.  NN0  | 
( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) } )  =  ( (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) sadd  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) } ) ) )
11861, 117syl5ibr 212 . . . . 5  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( (
( (bits `  A
)  i^i  ( 0..^ k ) ) smul  (bits `  B ) )  =  (bits `  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )  -> 
( ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) ) )
119118expcom 424 . . . 4  |-  ( k  e.  NN0  ->  ( ph  ->  ( ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) )  ->  (
( (bits `  A
)  i^i  ( 0..^ ( k  +  1 ) ) ) smul  (bits `  B ) )  =  (bits `  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) ) ) ) )
120119a2d 23 . . 3  |-  ( k  e.  NN0  ->  ( (
ph  ->  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) )  -> 
( ph  ->  ( ( (bits `  A )  i^i  ( 0..^ ( k  +  1 ) ) ) smul  (bits `  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) ) ) )
12122, 31, 40, 49, 60, 120nn0ind 10108 . 2  |-  ( N  e.  NN0  ->  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) ) )
1221, 121mpcom 32 1  |-  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
Colors of variables: wff set class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 358    = wceq 1623    e. wcel 1684   A.wral 2543   {crab 2547    i^i cin 3151    C_ wss 3152   (/)c0 3455   ifcif 3565   ` cfv 5255  (class class class)co 5858   CCcc 8735   0cc0 8737   1c1 8738    + caddc 8740    x. cmul 8742    - cmin 9037   NNcn 9746   2c2 9795   NN0cn0 9965   ZZcz 10024  ..^cfzo 10870    mod cmo 10973   ^cexp 11104  bitscbits 12610   sadd csad 12611   smul csmu 12612
This theorem is referenced by:  smumul  12684
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1533  ax-5 1544  ax-17 1603  ax-9 1635  ax-8 1643  ax-13 1686  ax-14 1688  ax-6 1703  ax-7 1708  ax-11 1715  ax-12 1866  ax-ext 2264  ax-rep 4131  ax-sep 4141  ax-nul 4149  ax-pow 4188  ax-pr 4214  ax-un 4512  ax-inf2 7342  ax-cnex 8793  ax-resscn 8794  ax-1cn 8795  ax-icn 8796  ax-addcl 8797  ax-addrcl 8798  ax-mulcl 8799  ax-mulrcl 8800  ax-mulcom 8801  ax-addass 8802  ax-mulass 8803  ax-distr 8804  ax-i2m1 8805  ax-1ne0 8806  ax-1rid 8807  ax-rnegex 8808  ax-rrecex 8809  ax-cnre 8810  ax-pre-lttri 8811  ax-pre-lttrn 8812  ax-pre-ltadd 8813  ax-pre-mulgt0 8814  ax-pre-sup 8815
This theorem depends on definitions:  df-bi 177  df-or 359  df-an 360  df-3or 935  df-3an 936  df-xor 1296  df-tru 1310  df-had 1370  df-cad 1371  df-ex 1529  df-nf 1532  df-sb 1630  df-eu 2147  df-mo 2148  df-clab 2270  df-cleq 2276  df-clel 2279  df-nfc 2408  df-ne 2448  df-nel 2449  df-ral 2548  df-rex 2549  df-reu 2550  df-rmo 2551  df-rab 2552  df-v 2790  df-sbc 2992  df-csb 3082  df-dif 3155  df-un 3157  df-in 3159  df-ss 3166  df-pss 3168  df-nul 3456  df-if 3566  df-pw 3627  df-sn 3646  df-pr 3647  df-tp 3648  df-op 3649  df-uni 3828  df-int 3863  df-iun 3907  df-disj 3994  df-br 4024  df-opab 4078  df-mpt 4079  df-tr 4114  df-eprel 4305  df-id 4309  df-po 4314  df-so 4315  df-fr 4352  df-se 4353  df-we 4354  df-ord 4395  df-on 4396  df-lim 4397  df-suc 4398  df-om 4657  df-xp 4695  df-rel 4696  df-cnv 4697  df-co 4698  df-dm 4699  df-rn 4700  df-res 4701  df-ima 4702  df-iota 5219  df-fun 5257  df-fn 5258  df-f 5259  df-f1 5260  df-fo 5261  df-f1o 5262  df-fv 5263  df-isom 5264  df-ov 5861  df-oprab 5862  df-mpt2 5863  df-1st 6122  df-2nd 6123  df-riota 6304  df-recs 6388  df-rdg 6423  df-1o 6479  df-2o 6480  df-oadd 6483  df-er 6660  df-map 6774  df-pm 6775  df-en 6864  df-dom 6865  df-sdom 6866  df-fin 6867  df-sup 7194  df-oi 7225  df-card 7572  df-cda 7794  df-pnf 8869  df-mnf 8870  df-xr 8871  df-ltxr 8872  df-le 8873  df-sub 9039  df-neg 9040  df-div 9424  df-nn 9747  df-2 9804  df-3 9805  df-n0 9966  df-z 10025  df-uz 10231  df-rp 10355  df-fz 10783  df-fzo 10871  df-fl 10925  df-mod 10974  df-seq 11047  df-exp 11105  df-hash 11338  df-cj 11584  df-re 11585  df-im 11586  df-sqr 11720  df-abs 11721  df-clim 11962  df-sum 12159  df-dvds 12532  df-bits 12613  df-sad 12642  df-smu 12667
  Copyright terms: Public domain W3C validator