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

Theorem smumullem 12699
Description: Lemma for smumul 12700. (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 5882 . . . . . . . . . 10  |-  ( x  =  0  ->  (
0..^ x )  =  ( 0..^ 0 ) )
3 fzo0 10909 . . . . . . . . . 10  |-  ( 0..^ 0 )  =  (/)
42, 3syl6eq 2344 . . . . . . . . 9  |-  ( x  =  0  ->  (
0..^ x )  =  (/) )
54ineq2d 3383 . . . . . . . 8  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (/) ) )
6 in0 3493 . . . . . . . 8  |-  ( (bits `  A )  i^i  (/) )  =  (/)
75, 6syl6eq 2344 . . . . . . 7  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  (/) )
87oveq1d 5889 . . . . . 6  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( (/) smul  (bits `  B
) ) )
9 bitsss 12633 . . . . . . 7  |-  (bits `  B )  C_  NN0
10 smu02 12694 . . . . . . 7  |-  ( (bits `  B )  C_  NN0  ->  (
(/) smul  (bits `  B )
)  =  (/) )
119, 10ax-mp 8 . . . . . 6  |-  ( (/) smul  (bits `  B ) )  =  (/)
128, 11syl6eq 2344 . . . . 5  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  (/) )
13 oveq2 5882 . . . . . . . . 9  |-  ( x  =  0  ->  (
2 ^ x )  =  ( 2 ^ 0 ) )
14 2cn 9832 . . . . . . . . . 10  |-  2  e.  CC
15 exp0 11124 . . . . . . . . . 10  |-  ( 2  e.  CC  ->  (
2 ^ 0 )  =  1 )
1614, 15ax-mp 8 . . . . . . . . 9  |-  ( 2 ^ 0 )  =  1
1713, 16syl6eq 2344 . . . . . . . 8  |-  ( x  =  0  ->  (
2 ^ x )  =  1 )
1817oveq2d 5890 . . . . . . 7  |-  ( x  =  0  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  1
) )
1918oveq1d 5889 . . . . . 6  |-  ( x  =  0  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  1 )  x.  B ) )
2019fveq2d 5545 . . . . 5  |-  ( x  =  0  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
2112, 20eqeq12d 2310 . . . 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 5882 . . . . . . 7  |-  ( x  =  k  ->  (
0..^ x )  =  ( 0..^ k ) )
2423ineq2d 3383 . . . . . 6  |-  ( x  =  k  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ k ) ) )
2524oveq1d 5889 . . . . 5  |-  ( x  =  k  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) )
26 oveq2 5882 . . . . . . . 8  |-  ( x  =  k  ->  (
2 ^ x )  =  ( 2 ^ k ) )
2726oveq2d 5890 . . . . . . 7  |-  ( x  =  k  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ k ) ) )
2827oveq1d 5889 . . . . . 6  |-  ( x  =  k  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )
2928fveq2d 5545 . . . . 5  |-  ( x  =  k  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) )
3025, 29eqeq12d 2310 . . . 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 5882 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  (
0..^ x )  =  ( 0..^ ( k  +  1 ) ) )
3332ineq2d 3383 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) )
3433oveq1d 5889 . . . . 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 5882 . . . . . . . 8  |-  ( x  =  ( k  +  1 )  ->  (
2 ^ x )  =  ( 2 ^ ( k  +  1 ) ) )
3635oveq2d 5890 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ ( k  +  1 ) ) ) )
3736oveq1d 5889 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) )
3837fveq2d 5545 . . . . 5  |-  ( x  =  ( k  +  1 )  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) )
3934, 38eqeq12d 2310 . . . 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 5882 . . . . . . 7  |-  ( x  =  N  ->  (
0..^ x )  =  ( 0..^ N ) )
4241ineq2d 3383 . . . . . 6  |-  ( x  =  N  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ N ) ) )
4342oveq1d 5889 . . . . 5  |-  ( x  =  N  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
) )
44 oveq2 5882 . . . . . . . 8  |-  ( x  =  N  ->  (
2 ^ x )  =  ( 2 ^ N ) )
4544oveq2d 5890 . . . . . . 7  |-  ( x  =  N  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ N ) ) )
4645oveq1d 5889 . . . . . 6  |-  ( x  =  N  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ N ) )  x.  B ) )
4746fveq2d 5545 . . . . 5  |-  ( x  =  N  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
4843, 47eqeq12d 2310 . . . 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 11003 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A  mod  1 )  =  0 )
5250, 51syl 15 . . . . . . 7  |-  ( ph  ->  ( A  mod  1
)  =  0 )
5352oveq1d 5889 . . . . . 6  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  ( 0  x.  B ) )
54 smumullem.b . . . . . . . 8  |-  ( ph  ->  B  e.  ZZ )
5554zcnd 10134 . . . . . . 7  |-  ( ph  ->  B  e.  CC )
5655mul02d 9026 . . . . . 6  |-  ( ph  ->  ( 0  x.  B
)  =  0 )
5753, 56eqtrd 2328 . . . . 5  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  0 )
5857fveq2d 5545 . . . 4  |-  ( ph  ->  (bits `  ( ( A  mod  1 )  x.  B ) )  =  (bits `  0 )
)
59 0bits 12646 . . . 4  |-  (bits ` 
0 )  =  (/)
6058, 59syl6req 2345 . . 3  |-  ( ph  -> 
(/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
61 oveq1 5881 . . . . . 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 12633 . . . . . . . . 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 12696 . . . . . . 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 12648 . . . . . . . . . . . 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 5889 . . . . . . . . . 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 9893 . . . . . . . . . . . . . . 15  |-  2  e.  NN
7271a1i 10 . . . . . . . . . . . . . 14  |-  ( (
ph  /\  k  e.  NN0 )  ->  2  e.  NN )
7372, 65nnexpcld 11282 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e.  NN )
7470, 73zmodcld 11006 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  NN0 )
7574nn0cnd 10036 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  CC )
7673nnnn0d 10034 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e. 
NN0 )
77 0nn0 9996 . . . . . . . . . . . . 13  |-  0  e.  NN0
78 ifcl 3614 . . . . . . . . . . . . 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 10036 . . . . . . . . . . 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 8876 . . . . . . . . . 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 8872 . . . . . . . . . . 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 5890 . . . . . . . . . 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 2332 . . . . . . . . 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 5545 . . . . . . . 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 10131 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  ZZ )
8854adantr 451 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  ZZ )
8987, 88zmulcld 10139 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ k ) )  x.  B )  e.  ZZ )
9079nn0zd 10131 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  ZZ )
9188, 90zmulcld 10139 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  e.  ZZ )
92 sadadd 12674 . . . . . . . . 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 5882 . . . . . . . . . . . 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 5545 . . . . . . . . . . 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 2304 . . . . . . . . . 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 5882 . . . . . . . . . . . 12  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  ( B  x.  0 )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
9897fveq2d 5545 . . . . . . . . . . 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 2304 . . . . . . . . . 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 12682 . . . . . . . . . . . 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 2793 . . . . . . . . . . 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 2349 . . . . . . . . . 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 9027 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  ( B  x.  0 )  =  0 )
107106fveq2d 5545 . . . . . . . . . . 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 2640 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  A. n  e.  NN0  -.  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) )
111 rabeq0 3489 . . . . . . . . . . . 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 2354 . . . . . . . . . 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 3608 . . . . . . . . 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 5890 . . . . . . . 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 2334 . . . . . . 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 2310 . . . . . 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 10124 . 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 1632    e. wcel 1696   A.wral 2556   {crab 2560    i^i cin 3164    C_ wss 3165   (/)c0 3468   ifcif 3578   ` cfv 5271  (class class class)co 5874   CCcc 8751   0cc0 8753   1c1 8754    + caddc 8756    x. cmul 8758    - cmin 9053   NNcn 9762   2c2 9811   NN0cn0 9981   ZZcz 10040  ..^cfzo 10886    mod cmo 10989   ^cexp 11120  bitscbits 12626   sadd csad 12627   smul csmu 12628
This theorem is referenced by:  smumul  12700
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1536  ax-5 1547  ax-17 1606  ax-9 1644  ax-8 1661  ax-13 1698  ax-14 1700  ax-6 1715  ax-7 1720  ax-11 1727  ax-12 1878  ax-ext 2277  ax-rep 4147  ax-sep 4157  ax-nul 4165  ax-pow 4204  ax-pr 4230  ax-un 4528  ax-inf2 7358  ax-cnex 8809  ax-resscn 8810  ax-1cn 8811  ax-icn 8812  ax-addcl 8813  ax-addrcl 8814  ax-mulcl 8815  ax-mulrcl 8816  ax-mulcom 8817  ax-addass 8818  ax-mulass 8819  ax-distr 8820  ax-i2m1 8821  ax-1ne0 8822  ax-1rid 8823  ax-rnegex 8824  ax-rrecex 8825  ax-cnre 8826  ax-pre-lttri 8827  ax-pre-lttrn 8828  ax-pre-ltadd 8829  ax-pre-mulgt0 8830  ax-pre-sup 8831
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 1532  df-nf 1535  df-sb 1639  df-eu 2160  df-mo 2161  df-clab 2283  df-cleq 2289  df-clel 2292  df-nfc 2421  df-ne 2461  df-nel 2462  df-ral 2561  df-rex 2562  df-reu 2563  df-rmo 2564  df-rab 2565  df-v 2803  df-sbc 3005  df-csb 3095  df-dif 3168  df-un 3170  df-in 3172  df-ss 3179  df-pss 3181  df-nul 3469  df-if 3579  df-pw 3640  df-sn 3659  df-pr 3660  df-tp 3661  df-op 3662  df-uni 3844  df-int 3879  df-iun 3923  df-disj 4010  df-br 4040  df-opab 4094  df-mpt 4095  df-tr 4130  df-eprel 4321  df-id 4325  df-po 4330  df-so 4331  df-fr 4368  df-se 4369  df-we 4370  df-ord 4411  df-on 4412  df-lim 4413  df-suc 4414  df-om 4673  df-xp 4711  df-rel 4712  df-cnv 4713  df-co 4714  df-dm 4715  df-rn 4716  df-res 4717  df-ima 4718  df-iota 5235  df-fun 5273  df-fn 5274  df-f 5275  df-f1 5276  df-fo 5277  df-f1o 5278  df-fv 5279  df-isom 5280  df-ov 5877  df-oprab 5878  df-mpt2 5879  df-1st 6138  df-2nd 6139  df-riota 6320  df-recs 6404  df-rdg 6439  df-1o 6495  df-2o 6496  df-oadd 6499  df-er 6676  df-map 6790  df-pm 6791  df-en 6880  df-dom 6881  df-sdom 6882  df-fin 6883  df-sup 7210  df-oi 7241  df-card 7588  df-cda 7810  df-pnf 8885  df-mnf 8886  df-xr 8887  df-ltxr 8888  df-le 8889  df-sub 9055  df-neg 9056  df-div 9440  df-nn 9763  df-2 9820  df-3 9821  df-n0 9982  df-z 10041  df-uz 10247  df-rp 10371  df-fz 10799  df-fzo 10887  df-fl 10941  df-mod 10990  df-seq 11063  df-exp 11121  df-hash 11354  df-cj 11600  df-re 11601  df-im 11602  df-sqr 11736  df-abs 11737  df-clim 11978  df-sum 12175  df-dvds 12548  df-bits 12629  df-sad 12658  df-smu 12683
  Copyright terms: Public domain W3C validator