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

Theorem smumullem 14000
Description: Lemma for smumul 14001. (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 6291 . . . . . . . . . 10  |-  ( x  =  0  ->  (
0..^ x )  =  ( 0..^ 0 ) )
3 fzo0 11816 . . . . . . . . . 10  |-  ( 0..^ 0 )  =  (/)
42, 3syl6eq 2524 . . . . . . . . 9  |-  ( x  =  0  ->  (
0..^ x )  =  (/) )
54ineq2d 3700 . . . . . . . 8  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (/) ) )
6 in0 3811 . . . . . . . 8  |-  ( (bits `  A )  i^i  (/) )  =  (/)
75, 6syl6eq 2524 . . . . . . 7  |-  ( x  =  0  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  (/) )
87oveq1d 6298 . . . . . 6  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( (/) smul  (bits `  B
) ) )
9 bitsss 13934 . . . . . . 7  |-  (bits `  B )  C_  NN0
10 smu02 13995 . . . . . . 7  |-  ( (bits `  B )  C_  NN0  ->  (
(/) smul  (bits `  B )
)  =  (/) )
119, 10ax-mp 5 . . . . . 6  |-  ( (/) smul  (bits `  B ) )  =  (/)
128, 11syl6eq 2524 . . . . 5  |-  ( x  =  0  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  (/) )
13 oveq2 6291 . . . . . . . . 9  |-  ( x  =  0  ->  (
2 ^ x )  =  ( 2 ^ 0 ) )
14 2cn 10605 . . . . . . . . . 10  |-  2  e.  CC
15 exp0 12137 . . . . . . . . . 10  |-  ( 2  e.  CC  ->  (
2 ^ 0 )  =  1 )
1614, 15ax-mp 5 . . . . . . . . 9  |-  ( 2 ^ 0 )  =  1
1713, 16syl6eq 2524 . . . . . . . 8  |-  ( x  =  0  ->  (
2 ^ x )  =  1 )
1817oveq2d 6299 . . . . . . 7  |-  ( x  =  0  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  1
) )
1918oveq1d 6298 . . . . . 6  |-  ( x  =  0  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  1 )  x.  B ) )
2019fveq2d 5869 . . . . 5  |-  ( x  =  0  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
2112, 20eqeq12d 2489 . . . 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 316 . . 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 6291 . . . . . . 7  |-  ( x  =  k  ->  (
0..^ x )  =  ( 0..^ k ) )
2423ineq2d 3700 . . . . . 6  |-  ( x  =  k  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ k ) ) )
2524oveq1d 6298 . . . . 5  |-  ( x  =  k  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ k ) ) smul  (bits `  B )
) )
26 oveq2 6291 . . . . . . . 8  |-  ( x  =  k  ->  (
2 ^ x )  =  ( 2 ^ k ) )
2726oveq2d 6299 . . . . . . 7  |-  ( x  =  k  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ k ) ) )
2827oveq1d 6298 . . . . . 6  |-  ( x  =  k  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ k ) )  x.  B ) )
2928fveq2d 5869 . . . . 5  |-  ( x  =  k  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ k
) )  x.  B
) ) )
3025, 29eqeq12d 2489 . . . 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 316 . . 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 6291 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  (
0..^ x )  =  ( 0..^ ( k  +  1 ) ) )
3332ineq2d 3700 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ ( k  +  1 ) ) ) )
3433oveq1d 6298 . . . . 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 6291 . . . . . . . 8  |-  ( x  =  ( k  +  1 )  ->  (
2 ^ x )  =  ( 2 ^ ( k  +  1 ) ) )
3635oveq2d 6299 . . . . . . 7  |-  ( x  =  ( k  +  1 )  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ ( k  +  1 ) ) ) )
3736oveq1d 6298 . . . . . 6  |-  ( x  =  ( k  +  1 )  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ ( k  +  1 ) ) )  x.  B ) )
3837fveq2d 5869 . . . . 5  |-  ( x  =  ( k  +  1 )  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ (
k  +  1 ) ) )  x.  B
) ) )
3934, 38eqeq12d 2489 . . . 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 316 . . 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 6291 . . . . . . 7  |-  ( x  =  N  ->  (
0..^ x )  =  ( 0..^ N ) )
4241ineq2d 3700 . . . . . 6  |-  ( x  =  N  ->  (
(bits `  A )  i^i  ( 0..^ x ) )  =  ( (bits `  A )  i^i  (
0..^ N ) ) )
4342oveq1d 6298 . . . . 5  |-  ( x  =  N  ->  (
( (bits `  A
)  i^i  ( 0..^ x ) ) smul  (bits `  B ) )  =  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
) )
44 oveq2 6291 . . . . . . . 8  |-  ( x  =  N  ->  (
2 ^ x )  =  ( 2 ^ N ) )
4544oveq2d 6299 . . . . . . 7  |-  ( x  =  N  ->  ( A  mod  ( 2 ^ x ) )  =  ( A  mod  (
2 ^ N ) ) )
4645oveq1d 6298 . . . . . 6  |-  ( x  =  N  ->  (
( A  mod  (
2 ^ x ) )  x.  B )  =  ( ( A  mod  ( 2 ^ N ) )  x.  B ) )
4746fveq2d 5869 . . . . 5  |-  ( x  =  N  ->  (bits `  ( ( A  mod  ( 2 ^ x
) )  x.  B
) )  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
4843, 47eqeq12d 2489 . . . 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 316 . . 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 11979 . . . . . . . 8  |-  ( A  e.  ZZ  ->  ( A  mod  1 )  =  0 )
5250, 51syl 16 . . . . . . 7  |-  ( ph  ->  ( A  mod  1
)  =  0 )
5352oveq1d 6298 . . . . . 6  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  ( 0  x.  B ) )
54 smumullem.b . . . . . . . 8  |-  ( ph  ->  B  e.  ZZ )
5554zcnd 10966 . . . . . . 7  |-  ( ph  ->  B  e.  CC )
5655mul02d 9776 . . . . . 6  |-  ( ph  ->  ( 0  x.  B
)  =  0 )
5753, 56eqtrd 2508 . . . . 5  |-  ( ph  ->  ( ( A  mod  1 )  x.  B
)  =  0 )
5857fveq2d 5869 . . . 4  |-  ( ph  ->  (bits `  ( ( A  mod  1 )  x.  B ) )  =  (bits `  0 )
)
59 0bits 13947 . . . 4  |-  (bits ` 
0 )  =  (/)
6058, 59syl6req 2525 . . 3  |-  ( ph  -> 
(/)  =  (bits `  ( ( A  mod  1 )  x.  B
) ) )
61 oveq1 6290 . . . . . 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 13934 . . . . . . . . 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 461 . . . . . . . 8  |-  ( (
ph  /\  k  e.  NN0 )  ->  k  e.  NN0 )
6663, 64, 65smup1 13997 . . . . . . 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 13949 . . . . . . . . . . . 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 471 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ (
k  +  1 ) ) )  =  ( ( A  mod  (
2 ^ k ) )  +  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
6968oveq1d 6298 . . . . . . . . . 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 465 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  A  e.  ZZ )
71 2nn 10692 . . . . . . . . . . . . . . 15  |-  2  e.  NN
7271a1i 11 . . . . . . . . . . . . . 14  |-  ( (
ph  /\  k  e.  NN0 )  ->  2  e.  NN )
7372, 65nnexpcld 12298 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e.  NN )
7470, 73zmodcld 11983 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  NN0 )
7574nn0cnd 10853 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  CC )
7673nnnn0d 10851 . . . . . . . . . . . . 13  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( 2 ^ k )  e. 
NN0 )
77 0nn0 10809 . . . . . . . . . . . . 13  |-  0  e.  NN0
78 ifcl 3981 . . . . . . . . . . . . 13  |-  ( ( ( 2 ^ k
)  e.  NN0  /\  0  e.  NN0 )  ->  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e. 
NN0 )
7976, 77, 78sylancl 662 . . . . . . . . . . . 12  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e. 
NN0 )
8079nn0cnd 10853 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  CC )
8155adantr 465 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  CC )
8275, 80, 81adddird 9620 . . . . . . . . . 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 9616 . . . . . . . . . . 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 6299 . . . . . . . . . 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 2512 . . . . . . . . 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 5869 . . . . . . . 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 10963 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( A  mod  ( 2 ^ k
) )  e.  ZZ )
8854adantr 465 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  B  e.  ZZ )
8987, 88zmulcld 10971 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( ( A  mod  ( 2 ^ k ) )  x.  B )  e.  ZZ )
9079nn0zd 10963 . . . . . . . . . 10  |-  ( (
ph  /\  k  e.  NN0 )  ->  if (
k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 )  e.  ZZ )
9188, 90zmulcld 10971 . . . . . . . . 9  |-  ( (
ph  /\  k  e.  NN0 )  ->  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) )  e.  ZZ )
92 sadadd 13975 . . . . . . . . 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 661 . . . . . . . 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 6291 . . . . . . . . . . . 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 5869 . . . . . . . . . . 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 2469 . . . . . . . . . 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 6291 . . . . . . . . . . . 12  |-  ( 0  =  if ( k  e.  (bits `  A
) ,  ( 2 ^ k ) ,  0 )  ->  ( B  x.  0 )  =  ( B  x.  if ( k  e.  (bits `  A ) ,  ( 2 ^ k ) ,  0 ) ) )
9897fveq2d 5869 . . . . . . . . . . 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 2469 . . . . . . . . . 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 13983 . . . . . . . . . . . 12  |-  ( ( B  e.  ZZ  /\  k  e.  NN0 )  ->  { n  e.  NN0  |  ( n  -  k
)  e.  (bits `  B ) }  =  (bits `  ( B  x.  ( 2 ^ k
) ) ) )
10154, 100sylan 471 . . . . . . . . . . 11  |-  ( (
ph  /\  k  e.  NN0 )  ->  { n  e.  NN0  |  ( n  -  k )  e.  (bits `  B ) }  =  (bits `  ( B  x.  ( 2 ^ k ) ) ) )
102 ibar 504 . . . . . . . . . . . 12  |-  ( k  e.  (bits `  A
)  ->  ( (
n  -  k )  e.  (bits `  B
)  <->  ( k  e.  (bits `  A )  /\  ( n  -  k
)  e.  (bits `  B ) ) ) )
103102rabbidv 3105 . . . . . . . . . . 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 2529 . . . . . . . . . 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 465 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  B  e.  CC )
106105mul01d 9777 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  ( B  x.  0 )  =  0 )
107106fveq2d 5869 . . . . . . . . . . 11  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  (bits `  ( B  x.  0 ) )  =  (bits `  0 ) )
108 simpr 461 . . . . . . . . . . . . . 14  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  -.  k  e.  (bits `  A
) )
109108intnanrd 915 . . . . . . . . . . . . 13  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  -.  ( k  e.  (bits `  A )  /\  (
n  -  k )  e.  (bits `  B
) ) )
110109ralrimivw 2879 . . . . . . . . . . . 12  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  A. n  e.  NN0  -.  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) )
111 rabeq0 3807 . . . . . . . . . . . 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 212 . . . . . . . . . . 11  |-  ( ( ( ph  /\  k  e.  NN0 )  /\  -.  k  e.  (bits `  A
) )  ->  { n  e.  NN0  |  ( k  e.  (bits `  A
)  /\  ( n  -  k )  e.  (bits `  B )
) }  =  (/) )
11359, 107, 1123eqtr4a 2534 . . . . . . . . . 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 3974 . . . . . . . . 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 6299 . . . . . . . 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 2514 . . . . . . 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 2489 . . . . . 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 221 . . . . 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 435 . . . 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 26 . . 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 10956 . 2  |-  ( N  e.  NN0  ->  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) ) )
1221, 121mpcom 36 1  |-  ( ph  ->  ( ( (bits `  A )  i^i  (
0..^ N ) ) smul  (bits `  B )
)  =  (bits `  ( ( A  mod  ( 2 ^ N
) )  x.  B
) ) )
Colors of variables: wff setvar class
Syntax hints:   -. wn 3    -> wi 4    /\ wa 369    = wceq 1379    e. wcel 1767   A.wral 2814   {crab 2818    i^i cin 3475    C_ wss 3476   (/)c0 3785   ifcif 3939   ` cfv 5587  (class class class)co 6283   CCcc 9489   0cc0 9491   1c1 9492    + caddc 9494    x. cmul 9496    - cmin 9804   NNcn 10535   2c2 10584   NN0cn0 10794   ZZcz 10863  ..^cfzo 11791    mod cmo 11963   ^cexp 12133  bitscbits 13927   sadd csad 13928   smul csmu 13929
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1601  ax-4 1612  ax-5 1680  ax-6 1719  ax-7 1739  ax-8 1769  ax-9 1771  ax-10 1786  ax-11 1791  ax-12 1803  ax-13 1968  ax-ext 2445  ax-rep 4558  ax-sep 4568  ax-nul 4576  ax-pow 4625  ax-pr 4686  ax-un 6575  ax-inf2 8057  ax-cnex 9547  ax-resscn 9548  ax-1cn 9549  ax-icn 9550  ax-addcl 9551  ax-addrcl 9552  ax-mulcl 9553  ax-mulrcl 9554  ax-mulcom 9555  ax-addass 9556  ax-mulass 9557  ax-distr 9558  ax-i2m1 9559  ax-1ne0 9560  ax-1rid 9561  ax-rnegex 9562  ax-rrecex 9563  ax-cnre 9564  ax-pre-lttri 9565  ax-pre-lttrn 9566  ax-pre-ltadd 9567  ax-pre-mulgt0 9568  ax-pre-sup 9569
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 974  df-3an 975  df-xor 1361  df-tru 1382  df-fal 1385  df-had 1431  df-cad 1432  df-ex 1597  df-nf 1600  df-sb 1712  df-eu 2279  df-mo 2280  df-clab 2453  df-cleq 2459  df-clel 2462  df-nfc 2617  df-ne 2664  df-nel 2665  df-ral 2819  df-rex 2820  df-reu 2821  df-rmo 2822  df-rab 2823  df-v 3115  df-sbc 3332  df-csb 3436  df-dif 3479  df-un 3481  df-in 3483  df-ss 3490  df-pss 3492  df-nul 3786  df-if 3940  df-pw 4012  df-sn 4028  df-pr 4030  df-tp 4032  df-op 4034  df-uni 4246  df-int 4283  df-iun 4327  df-disj 4418  df-br 4448  df-opab 4506  df-mpt 4507  df-tr 4541  df-eprel 4791  df-id 4795  df-po 4800  df-so 4801  df-fr 4838  df-se 4839  df-we 4840  df-ord 4881  df-on 4882  df-lim 4883  df-suc 4884  df-xp 5005  df-rel 5006  df-cnv 5007  df-co 5008  df-dm 5009  df-rn 5010  df-res 5011  df-ima 5012  df-iota 5550  df-fun 5589  df-fn 5590  df-f 5591  df-f1 5592  df-fo 5593  df-f1o 5594  df-fv 5595  df-isom 5596  df-riota 6244  df-ov 6286  df-oprab 6287  df-mpt2 6288  df-om 6680  df-1st 6784  df-2nd 6785  df-recs 7042  df-rdg 7076  df-1o 7130  df-2o 7131  df-oadd 7134  df-er 7311  df-map 7422  df-pm 7423  df-en 7517  df-dom 7518  df-sdom 7519  df-fin 7520  df-sup 7900  df-oi 7934  df-card 8319  df-cda 8547  df-pnf 9629  df-mnf 9630  df-xr 9631  df-ltxr 9632  df-le 9633  df-sub 9806  df-neg 9807  df-div 10206  df-nn 10536  df-2 10593  df-3 10594  df-n0 10795  df-z 10864  df-uz 11082  df-rp 11220  df-fz 11672  df-fzo 11792  df-fl 11896  df-mod 11964  df-seq 12075  df-exp 12134  df-hash 12373  df-cj 12894  df-re 12895  df-im 12896  df-sqrt 13030  df-abs 13031  df-clim 13273  df-sum 13471  df-dvds 13847  df-bits 13930  df-sad 13959  df-smu 13984
This theorem is referenced by:  smumul  14001
  Copyright terms: Public domain W3C validator