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

Theorem smumullem 12931
Description: Lemma for smumul 12932. (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 6028 . . . . . . . . . 10  |-  ( x  =  0  ->  (
0..^ x )  =  ( 0..^ 0 ) )
3 fzo0 11089 . . . . . . . . . 10  |-  ( 0..^ 0 )  =  (/)
42, 3syl6eq 2435 . . . . . . . . 9  |-  ( x  =  0  ->  (
0..^ x )  =  (/) )
54ineq2d 3485 . . . . . . . 8  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (/) ) )
6 in0 3596 . . . . . . . 8  |-  ( (bits `  A )  i^i  (/) )  =  (/)
75, 6syl6eq 2435 . . . . . . 7  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  (/) )
87oveq1d 6035 . . . . . 6  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( (/) smul  (bits `  B
) ) )
9 bitsss 12865 . . . . . . 7  |-  (bits `  B )  C_  NN0
10 smu02 12926 . . . . . . 7  |-  ( (bits `  B )  C_  NN0  ->  (
(/) smul  (bits `  B )
)  =  (/) )
119, 10ax-mp 8 . . . . . 6  |-  ( (/) smul  (bits `  B ) )  =  (/)
128, 11syl6eq 2435 . . . . 5  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  (/) )
13 oveq2 6028 . . . . . . . . 9  |-  ( x  =  0  ->  (
2 ^ x )  =  ( 2 ^ 0 ) )
14 2cn 10002 . . . . . . . . . 10  |-  2  e.  CC
15 exp0 11313 . . . . . . . . . 10  |-  ( 2  e.  CC  ->  (
2 ^ 0 )  =  1 )
1614, 15ax-mp 8 . . . . . . . . 9  |-  ( 2 ^ 0 )  =  1
1713, 16syl6eq 2435 . . . . . . . 8  |-  ( x  =  0  ->  (
2 ^ x )  =  1 )
1817oveq2d 6036 . . . . . . 7  |-  ( x  =  0  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  1
) )
1918oveq1d 6035 . . . . . 6  |-  ( x  =  0  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  1 )  x.  B ) )
2019fveq2d 5672 . . . . 5  |-  ( x  =  0  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
2112, 20eqeq12d 2401 . . . 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 308 . . 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 6028 . . . . . . 7  |-  ( x  =  k  ->  (
0..^ x )  =  ( 0..^ k ) )
2423ineq2d 3485 . . . . . 6  |-  ( x  =  k  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ k ) ) )
2524oveq1d 6035 . . . . 5  |-  ( x  =  k  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) )
26 oveq2 6028 . . . . . . . 8  |-  ( x  =  k  ->  (
2 ^ x )  =  ( 2 ^ k ) )
2726oveq2d 6036 . . . . . . 7  |-  ( x  =  k  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ k ) ) )
2827oveq1d 6035 . . . . . 6  |-  ( x  =  k  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )
2928fveq2d 5672 . . . . 5  |-  ( x  =  k  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) )
3025, 29eqeq12d 2401 . . . 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 308 . . 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 6028 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  (
0..^ x )  =  ( 0..^ ( k  +  1 ) ) )
3332ineq2d 3485 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) )
3433oveq1d 6035 . . . . 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 6028 . . . . . . . 8  |-  ( x  =  ( k  +  1 )  ->  (
2 ^ x )  =  ( 2 ^ ( k  +  1 ) ) )
3635oveq2d 6036 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ ( k  +  1 ) ) ) )
3736oveq1d 6035 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) )
3837fveq2d 5672 . . . . 5  |-  ( x  =  ( k  +  1 )  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) )
3934, 38eqeq12d 2401 . . . 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 308 . . 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 6028 . . . . . . 7  |-  ( x  =  N  ->  (
0..^ x )  =  ( 0..^ N ) )
4241ineq2d 3485 . . . . . 6  |-  ( x  =  N  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ N ) ) )
4342oveq1d 6035 . . . . 5  |-  ( x  =  N  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
) )
44 oveq2 6028 . . . . . . . 8  |-  ( x  =  N  ->  (
2 ^ x )  =  ( 2 ^ N ) )
4544oveq2d 6036 . . . . . . 7  |-  ( x  =  N  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ N ) ) )
4645oveq1d 6035 . . . . . 6  |-  ( x  =  N  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ N ) )  x.  B ) )
4746fveq2d 5672 . . . . 5  |-  ( x  =  N  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
4843, 47eqeq12d 2401 . . . 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 308 . . 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 11191 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A  mod  1 )  =  0 )
5250, 51syl 16 . . . . . . 7  |-  ( ph  ->  ( A  mod  1
)  =  0 )
5352oveq1d 6035 . . . . . 6  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  ( 0  x.  B ) )
54 smumullem.b . . . . . . . 8  |-  ( ph  ->  B  e.  ZZ )
5554zcnd 10308 . . . . . . 7  |-  ( ph  ->  B  e.  CC )
5655mul02d 9196 . . . . . 6  |-  ( ph  ->  ( 0  x.  B
)  =  0 )
5753, 56eqtrd 2419 . . . . 5  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  0 )
5857fveq2d 5672 . . . 4  |-  ( ph  ->  (bits `  ( ( A  mod  1 )  x.  B ) )  =  (bits `  0 )
)
59 0bits 12878 . . . 4  |-  (bits ` 
0 )  =  (/)
6058, 59syl6req 2436 . . 3  |-  ( ph  -> 
(/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
61 oveq1 6027 . . . . . 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 12865 . . . . . . . . 9  |-  (bits `  A )  C_  NN0
6362a1i 11 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  A
)  C_  NN0 )
649a1i 11 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  (bits `  B
)  C_  NN0 )
65 simpr 448 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  k  e.  NN0 )
6663, 64, 65smup1 12928 . . . . . . 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 12880 . . . . . . . . . . . 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 458 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ (
k  +  1 ) ) )  =  ( ( A  mod  (
2 ^ k ) )  +  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
6968oveq1d 6035 . . . . . . . . . 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 452 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  A  e.  ZZ )
71 2nn 10065 . . . . . . . . . . . . . . 15  |-  2  e.  NN
7271a1i 11 . . . . . . . . . . . . . 14  |-  ( (
ph  /\  k  e.  NN0 )  ->  2  e.  NN )
7372, 65nnexpcld 11471 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e.  NN )
7470, 73zmodcld 11194 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  NN0 )
7574nn0cnd 10208 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  CC )
7673nnnn0d 10206 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e. 
NN0 )
77 0nn0 10168 . . . . . . . . . . . . 13  |-  0  e.  NN0
78 ifcl 3718 . . . . . . . . . . . . 13  |-  ( ( ( 2 ^ k
)  e.  NN0  /\  0  e.  NN0 )  ->  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e. 
NN0 )
7976, 77, 78sylancl 644 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e. 
NN0 )
8079nn0cnd 10208 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  CC )
8155adantr 452 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  CC )
8275, 80, 81adddird 9046 . . . . . . . . . 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 9042 . . . . . . . . . . 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 6036 . . . . . . . . . 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 2423 . . . . . . . . 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 5672 . . . . . . . 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 10305 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  ZZ )
8854adantr 452 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  ZZ )
8987, 88zmulcld 10313 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ k ) )  x.  B )  e.  ZZ )
9079nn0zd 10305 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  ZZ )
9188, 90zmulcld 10313 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  e.  ZZ )
92 sadadd 12906 . . . . . . . . 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 643 . . . . . . . 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 6028 . . . . . . . . . . . 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 5672 . . . . . . . . . . 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 2395 . . . . . . . . . 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 6028 . . . . . . . . . . . 12  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  ( B  x.  0 )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
9897fveq2d 5672 . . . . . . . . . . 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 2395 . . . . . . . . . 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 12914 . . . . . . . . . . . 12  |-  ( ( B  e.  ZZ  /\  k  e.  NN0 )  ->  { n  e.  NN0  |  ( n  -  k
)  e.  (bits `  B ) }  =  (bits `  ( B  x.  ( 2 ^ k
) ) ) )
10154, 100sylan 458 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  { n  e.  NN0  |  ( n  -  k )  e.  (bits `  B ) }  =  (bits `  ( B  x.  ( 2 ^ k ) ) ) )
102 ibar 491 . . . . . . . . . . . 12  |-  ( k  e.  (bits `  A
)  ->  ( (
n  -  k )  e.  (bits `  B
)  <->  ( k  e.  (bits `  A )  /\  ( n  -  k
)  e.  (bits `  B ) ) ) )
103102rabbidv 2891 . . . . . . . . . . 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 2440 . . . . . . . . . 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 452 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  B  e.  CC )
106105mul01d 9197 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  ( B  x.  0 )  =  0 )
107106fveq2d 5672 . . . . . . . . . . 11  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  (bits `  ( B  x.  0 ) )  =  (bits `  0 ) )
108 simpr 448 . . . . . . . . . . . . . 14  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  -.  k  e.  (bits `  A
) )
109108intnanrd 884 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  -.  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) )
110109ralrimivw 2733 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  A. n  e.  NN0  -.  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) )
111 rabeq0 3592 . . . . . . . . . . . 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 204 . . . . . . . . . . 11  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) }  =  (/) )
11359, 107, 1123eqtr4a 2445 . . . . . . . . . 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 3712 . . . . . . . . 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 6036 . . . . . . . 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 2425 . . . . . . 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 2401 . . . . . 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 213 . . . . 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 425 . . . 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 24 . . 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 10298 . 2  |-  ( N  e.  NN0  ->  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) ) )
1221, 121mpcom 34 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 359    = wceq 1649    e. wcel 1717   A.wral 2649   {crab 2653    i^i cin 3262    C_ wss 3263   (/)c0 3571   ifcif 3682   ` cfv 5394  (class class class)co 6020   CCcc 8921   0cc0 8923   1c1 8924    + caddc 8926    x. cmul 8928    - cmin 9223   NNcn 9932   2c2 9981   NN0cn0 10153   ZZcz 10214  ..^cfzo 11065    mod cmo 11177   ^cexp 11309  bitscbits 12858   sadd csad 12859   smul csmu 12860
This theorem is referenced by:  smumul  12932
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 1661  ax-8 1682  ax-13 1719  ax-14 1721  ax-6 1736  ax-7 1741  ax-11 1753  ax-12 1939  ax-ext 2368  ax-rep 4261  ax-sep 4271  ax-nul 4279  ax-pow 4318  ax-pr 4344  ax-un 4641  ax-inf2 7529  ax-cnex 8979  ax-resscn 8980  ax-1cn 8981  ax-icn 8982  ax-addcl 8983  ax-addrcl 8984  ax-mulcl 8985  ax-mulrcl 8986  ax-mulcom 8987  ax-addass 8988  ax-mulass 8989  ax-distr 8990  ax-i2m1 8991  ax-1ne0 8992  ax-1rid 8993  ax-rnegex 8994  ax-rrecex 8995  ax-cnre 8996  ax-pre-lttri 8997  ax-pre-lttrn 8998  ax-pre-ltadd 8999  ax-pre-mulgt0 9000  ax-pre-sup 9001
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-xor 1311  df-tru 1325  df-had 1386  df-cad 1387  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2242  df-mo 2243  df-clab 2374  df-cleq 2380  df-clel 2383  df-nfc 2512  df-ne 2552  df-nel 2553  df-ral 2654  df-rex 2655  df-reu 2656  df-rmo 2657  df-rab 2658  df-v 2901  df-sbc 3105  df-csb 3195  df-dif 3266  df-un 3268  df-in 3270  df-ss 3277  df-pss 3279  df-nul 3572  df-if 3683  df-pw 3744  df-sn 3763  df-pr 3764  df-tp 3765  df-op 3766  df-uni 3958  df-int 3993  df-iun 4037  df-disj 4124  df-br 4154  df-opab 4208  df-mpt 4209  df-tr 4244  df-eprel 4435  df-id 4439  df-po 4444  df-so 4445  df-fr 4482  df-se 4483  df-we 4484  df-ord 4525  df-on 4526  df-lim 4527  df-suc 4528  df-om 4786  df-xp 4824  df-rel 4825  df-cnv 4826  df-co 4827  df-dm 4828  df-rn 4829  df-res 4830  df-ima 4831  df-iota 5358  df-fun 5396  df-fn 5397  df-f 5398  df-f1 5399  df-fo 5400  df-f1o 5401  df-fv 5402  df-isom 5403  df-ov 6023  df-oprab 6024  df-mpt2 6025  df-1st 6288  df-2nd 6289  df-riota 6485  df-recs 6569  df-rdg 6604  df-1o 6660  df-2o 6661  df-oadd 6664  df-er 6841  df-map 6956  df-pm 6957  df-en 7046  df-dom 7047  df-sdom 7048  df-fin 7049  df-sup 7381  df-oi 7412  df-card 7759  df-cda 7981  df-pnf 9055  df-mnf 9056  df-xr 9057  df-ltxr 9058  df-le 9059  df-sub 9225  df-neg 9226  df-div 9610  df-nn 9933  df-2 9990  df-3 9991  df-n0 10154  df-z 10215  df-uz 10421  df-rp 10545  df-fz 10976  df-fzo 11066  df-fl 11129  df-mod 11178  df-seq 11251  df-exp 11310  df-hash 11546  df-cj 11831  df-re 11832  df-im 11833  df-sqr 11967  df-abs 11968  df-clim 12209  df-sum 12407  df-dvds 12780  df-bits 12861  df-sad 12890  df-smu 12915
  Copyright terms: Public domain W3C validator