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

Theorem smumullem 12996
Description: Lemma for smumul 12997. (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 6081 . . . . . . . . . 10  |-  ( x  =  0  ->  (
0..^ x )  =  ( 0..^ 0 ) )
3 fzo0 11151 . . . . . . . . . 10  |-  ( 0..^ 0 )  =  (/)
42, 3syl6eq 2483 . . . . . . . . 9  |-  ( x  =  0  ->  (
0..^ x )  =  (/) )
54ineq2d 3534 . . . . . . . 8  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (/) ) )
6 in0 3645 . . . . . . . 8  |-  ( (bits `  A )  i^i  (/) )  =  (/)
75, 6syl6eq 2483 . . . . . . 7  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  (/) )
87oveq1d 6088 . . . . . 6  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( (/) smul  (bits `  B
) ) )
9 bitsss 12930 . . . . . . 7  |-  (bits `  B )  C_  NN0
10 smu02 12991 . . . . . . 7  |-  ( (bits `  B )  C_  NN0  ->  (
(/) smul  (bits `  B )
)  =  (/) )
119, 10ax-mp 8 . . . . . 6  |-  ( (/) smul  (bits `  B ) )  =  (/)
128, 11syl6eq 2483 . . . . 5  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  (/) )
13 oveq2 6081 . . . . . . . . 9  |-  ( x  =  0  ->  (
2 ^ x )  =  ( 2 ^ 0 ) )
14 2cn 10062 . . . . . . . . . 10  |-  2  e.  CC
15 exp0 11378 . . . . . . . . . 10  |-  ( 2  e.  CC  ->  (
2 ^ 0 )  =  1 )
1614, 15ax-mp 8 . . . . . . . . 9  |-  ( 2 ^ 0 )  =  1
1713, 16syl6eq 2483 . . . . . . . 8  |-  ( x  =  0  ->  (
2 ^ x )  =  1 )
1817oveq2d 6089 . . . . . . 7  |-  ( x  =  0  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  1
) )
1918oveq1d 6088 . . . . . 6  |-  ( x  =  0  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  1 )  x.  B ) )
2019fveq2d 5724 . . . . 5  |-  ( x  =  0  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
2112, 20eqeq12d 2449 . . . 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 6081 . . . . . . 7  |-  ( x  =  k  ->  (
0..^ x )  =  ( 0..^ k ) )
2423ineq2d 3534 . . . . . 6  |-  ( x  =  k  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ k ) ) )
2524oveq1d 6088 . . . . 5  |-  ( x  =  k  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) )
26 oveq2 6081 . . . . . . . 8  |-  ( x  =  k  ->  (
2 ^ x )  =  ( 2 ^ k ) )
2726oveq2d 6089 . . . . . . 7  |-  ( x  =  k  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ k ) ) )
2827oveq1d 6088 . . . . . 6  |-  ( x  =  k  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )
2928fveq2d 5724 . . . . 5  |-  ( x  =  k  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) )
3025, 29eqeq12d 2449 . . . 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 6081 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  (
0..^ x )  =  ( 0..^ ( k  +  1 ) ) )
3332ineq2d 3534 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) )
3433oveq1d 6088 . . . . 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 6081 . . . . . . . 8  |-  ( x  =  ( k  +  1 )  ->  (
2 ^ x )  =  ( 2 ^ ( k  +  1 ) ) )
3635oveq2d 6089 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ ( k  +  1 ) ) ) )
3736oveq1d 6088 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) )
3837fveq2d 5724 . . . . 5  |-  ( x  =  ( k  +  1 )  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) )
3934, 38eqeq12d 2449 . . . 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 6081 . . . . . . 7  |-  ( x  =  N  ->  (
0..^ x )  =  ( 0..^ N ) )
4241ineq2d 3534 . . . . . 6  |-  ( x  =  N  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ N ) ) )
4342oveq1d 6088 . . . . 5  |-  ( x  =  N  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
) )
44 oveq2 6081 . . . . . . . 8  |-  ( x  =  N  ->  (
2 ^ x )  =  ( 2 ^ N ) )
4544oveq2d 6089 . . . . . . 7  |-  ( x  =  N  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ N ) ) )
4645oveq1d 6088 . . . . . 6  |-  ( x  =  N  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ N ) )  x.  B ) )
4746fveq2d 5724 . . . . 5  |-  ( x  =  N  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
4843, 47eqeq12d 2449 . . . 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 11256 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A  mod  1 )  =  0 )
5250, 51syl 16 . . . . . . 7  |-  ( ph  ->  ( A  mod  1
)  =  0 )
5352oveq1d 6088 . . . . . 6  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  ( 0  x.  B ) )
54 smumullem.b . . . . . . . 8  |-  ( ph  ->  B  e.  ZZ )
5554zcnd 10368 . . . . . . 7  |-  ( ph  ->  B  e.  CC )
5655mul02d 9256 . . . . . 6  |-  ( ph  ->  ( 0  x.  B
)  =  0 )
5753, 56eqtrd 2467 . . . . 5  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  0 )
5857fveq2d 5724 . . . 4  |-  ( ph  ->  (bits `  ( ( A  mod  1 )  x.  B ) )  =  (bits `  0 )
)
59 0bits 12943 . . . 4  |-  (bits ` 
0 )  =  (/)
6058, 59syl6req 2484 . . 3  |-  ( ph  -> 
(/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
61 oveq1 6080 . . . . . 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 12930 . . . . . . . . 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 12993 . . . . . . 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 12945 . . . . . . . . . . . 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 6088 . . . . . . . . . 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 10125 . . . . . . . . . . . . . . 15  |-  2  e.  NN
7271a1i 11 . . . . . . . . . . . . . 14  |-  ( (
ph  /\  k  e.  NN0 )  ->  2  e.  NN )
7372, 65nnexpcld 11536 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e.  NN )
7470, 73zmodcld 11259 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  NN0 )
7574nn0cnd 10268 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  CC )
7673nnnn0d 10266 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e. 
NN0 )
77 0nn0 10228 . . . . . . . . . . . . 13  |-  0  e.  NN0
78 ifcl 3767 . . . . . . . . . . . . 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 10268 . . . . . . . . . . 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 9105 . . . . . . . . . 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 9101 . . . . . . . . . . 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 6089 . . . . . . . . . 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 2471 . . . . . . . . 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 5724 . . . . . . . 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 10365 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  ZZ )
8854adantr 452 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  ZZ )
8987, 88zmulcld 10373 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ k ) )  x.  B )  e.  ZZ )
9079nn0zd 10365 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  ZZ )
9188, 90zmulcld 10373 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  e.  ZZ )
92 sadadd 12971 . . . . . . . . 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 6081 . . . . . . . . . . . 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 5724 . . . . . . . . . . 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 2443 . . . . . . . . . 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 6081 . . . . . . . . . . . 12  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  ( B  x.  0 )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
9897fveq2d 5724 . . . . . . . . . . 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 2443 . . . . . . . . . 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 12979 . . . . . . . . . . . 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 2940 . . . . . . . . . . 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 2488 . . . . . . . . . 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 9257 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  ( B  x.  0 )  =  0 )
107106fveq2d 5724 . . . . . . . . . . 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 2782 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  A. n  e.  NN0  -.  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) )
111 rabeq0 3641 . . . . . . . . . . . 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 2493 . . . . . . . . . 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 3761 . . . . . . . . 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 6089 . . . . . . . 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 2473 . . . . . . 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 2449 . . . . . 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 10358 . 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 1652    e. wcel 1725   A.wral 2697   {crab 2701    i^i cin 3311    C_ wss 3312   (/)c0 3620   ifcif 3731   ` cfv 5446  (class class class)co 6073   CCcc 8980   0cc0 8982   1c1 8983    + caddc 8985    x. cmul 8987    - cmin 9283   NNcn 9992   2c2 10041   NN0cn0 10213   ZZcz 10274  ..^cfzo 11127    mod cmo 11242   ^cexp 11374  bitscbits 12923   sadd csad 12924   smul csmu 12925
This theorem is referenced by:  smumul  12997
This theorem was proved from axioms:  ax-1 5  ax-2 6  ax-3 7  ax-mp 8  ax-gen 1555  ax-5 1566  ax-17 1626  ax-9 1666  ax-8 1687  ax-13 1727  ax-14 1729  ax-6 1744  ax-7 1749  ax-11 1761  ax-12 1950  ax-ext 2416  ax-rep 4312  ax-sep 4322  ax-nul 4330  ax-pow 4369  ax-pr 4395  ax-un 4693  ax-inf2 7588  ax-cnex 9038  ax-resscn 9039  ax-1cn 9040  ax-icn 9041  ax-addcl 9042  ax-addrcl 9043  ax-mulcl 9044  ax-mulrcl 9045  ax-mulcom 9046  ax-addass 9047  ax-mulass 9048  ax-distr 9049  ax-i2m1 9050  ax-1ne0 9051  ax-1rid 9052  ax-rnegex 9053  ax-rrecex 9054  ax-cnre 9055  ax-pre-lttri 9056  ax-pre-lttrn 9057  ax-pre-ltadd 9058  ax-pre-mulgt0 9059  ax-pre-sup 9060
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-xor 1314  df-tru 1328  df-had 1389  df-cad 1390  df-ex 1551  df-nf 1554  df-sb 1659  df-eu 2284  df-mo 2285  df-clab 2422  df-cleq 2428  df-clel 2431  df-nfc 2560  df-ne 2600  df-nel 2601  df-ral 2702  df-rex 2703  df-reu 2704  df-rmo 2705  df-rab 2706  df-v 2950  df-sbc 3154  df-csb 3244  df-dif 3315  df-un 3317  df-in 3319  df-ss 3326  df-pss 3328  df-nul 3621  df-if 3732  df-pw 3793  df-sn 3812  df-pr 3813  df-tp 3814  df-op 3815  df-uni 4008  df-int 4043  df-iun 4087  df-disj 4175  df-br 4205  df-opab 4259  df-mpt 4260  df-tr 4295  df-eprel 4486  df-id 4490  df-po 4495  df-so 4496  df-fr 4533  df-se 4534  df-we 4535  df-ord 4576  df-on 4577  df-lim 4578  df-suc 4579  df-om 4838  df-xp 4876  df-rel 4877  df-cnv 4878  df-co 4879  df-dm 4880  df-rn 4881  df-res 4882  df-ima 4883  df-iota 5410  df-fun 5448  df-fn 5449  df-f 5450  df-f1 5451  df-fo 5452  df-f1o 5453  df-fv 5454  df-isom 5455  df-ov 6076  df-oprab 6077  df-mpt2 6078  df-1st 6341  df-2nd 6342  df-riota 6541  df-recs 6625  df-rdg 6660  df-1o 6716  df-2o 6717  df-oadd 6720  df-er 6897  df-map 7012  df-pm 7013  df-en 7102  df-dom 7103  df-sdom 7104  df-fin 7105  df-sup 7438  df-oi 7471  df-card 7818  df-cda 8040  df-pnf 9114  df-mnf 9115  df-xr 9116  df-ltxr 9117  df-le 9118  df-sub 9285  df-neg 9286  df-div 9670  df-nn 9993  df-2 10050  df-3 10051  df-n0 10214  df-z 10275  df-uz 10481  df-rp 10605  df-fz 11036  df-fzo 11128  df-fl 11194  df-mod 11243  df-seq 11316  df-exp 11375  df-hash 11611  df-cj 11896  df-re 11897  df-im 11898  df-sqr 12032  df-abs 12033  df-clim 12274  df-sum 12472  df-dvds 12845  df-bits 12926  df-sad 12955  df-smu 12980
  Copyright terms: Public domain W3C validator