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

Theorem digit2 11441
Description: Two ways to express the  K th digit in the decimal (when base  B  =  10) expansion of a number  A.  K  =  1 corresponds to the first digit after the decimal point. (Contributed by NM, 25-Dec-2008.)
Assertion
Ref Expression
digit2  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( |_ `  (
( B ^ K
)  x.  A ) )  mod  B )  =  ( ( |_
`  ( ( B ^ K )  x.  A ) )  -  ( B  x.  ( |_ `  ( ( B ^ ( K  - 
1 ) )  x.  A ) ) ) ) )

Proof of Theorem digit2
StepHypRef Expression
1 nnre 9941 . . . . . . . 8  |-  ( B  e.  NN  ->  B  e.  RR )
2 nnnn0 10162 . . . . . . . 8  |-  ( K  e.  NN  ->  K  e.  NN0 )
3 reexpcl 11327 . . . . . . . 8  |-  ( ( B  e.  RR  /\  K  e.  NN0 )  -> 
( B ^ K
)  e.  RR )
41, 2, 3syl2an 464 . . . . . . 7  |-  ( ( B  e.  NN  /\  K  e.  NN )  ->  ( B ^ K
)  e.  RR )
5 remulcl 9010 . . . . . . 7  |-  ( ( ( B ^ K
)  e.  RR  /\  A  e.  RR )  ->  ( ( B ^ K )  x.  A
)  e.  RR )
64, 5sylan 458 . . . . . 6  |-  ( ( ( B  e.  NN  /\  K  e.  NN )  /\  A  e.  RR )  ->  ( ( B ^ K )  x.  A )  e.  RR )
763impa 1148 . . . . 5  |-  ( ( B  e.  NN  /\  K  e.  NN  /\  A  e.  RR )  ->  (
( B ^ K
)  x.  A )  e.  RR )
873comr 1161 . . . 4  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( B ^ K
)  x.  A )  e.  RR )
9 reflcl 11134 . . . 4  |-  ( ( ( B ^ K
)  x.  A )  e.  RR  ->  ( |_ `  ( ( B ^ K )  x.  A ) )  e.  RR )
108, 9syl 16 . . 3  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( B ^ K )  x.  A ) )  e.  RR )
11 nnrp 10555 . . . 4  |-  ( B  e.  NN  ->  B  e.  RR+ )
12113ad2ant2 979 . . 3  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  B  e.  RR+ )
13 modval 11181 . . 3  |-  ( ( ( |_ `  (
( B ^ K
)  x.  A ) )  e.  RR  /\  B  e.  RR+ )  -> 
( ( |_ `  ( ( B ^ K )  x.  A
) )  mod  B
)  =  ( ( |_ `  ( ( B ^ K )  x.  A ) )  -  ( B  x.  ( |_ `  ( ( |_ `  ( ( B ^ K )  x.  A ) )  /  B ) ) ) ) )
1410, 12, 13syl2anc 643 . 2  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( |_ `  (
( B ^ K
)  x.  A ) )  mod  B )  =  ( ( |_
`  ( ( B ^ K )  x.  A ) )  -  ( B  x.  ( |_ `  ( ( |_
`  ( ( B ^ K )  x.  A ) )  /  B ) ) ) ) )
15 simp2 958 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  B  e.  NN )
16 fldiv 11170 . . . . . 6  |-  ( ( ( ( B ^ K )  x.  A
)  e.  RR  /\  B  e.  NN )  ->  ( |_ `  (
( |_ `  (
( B ^ K
)  x.  A ) )  /  B ) )  =  ( |_
`  ( ( ( B ^ K )  x.  A )  /  B ) ) )
178, 15, 16syl2anc 643 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( |_
`  ( ( B ^ K )  x.  A ) )  /  B ) )  =  ( |_ `  (
( ( B ^ K )  x.  A
)  /  B ) ) )
18 nncn 9942 . . . . . . . . . 10  |-  ( B  e.  NN  ->  B  e.  CC )
19 expcl 11328 . . . . . . . . . 10  |-  ( ( B  e.  CC  /\  K  e.  NN0 )  -> 
( B ^ K
)  e.  CC )
2018, 2, 19syl2an 464 . . . . . . . . 9  |-  ( ( B  e.  NN  /\  K  e.  NN )  ->  ( B ^ K
)  e.  CC )
21203adant1 975 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B ^ K )  e.  CC )
22 recn 9015 . . . . . . . . 9  |-  ( A  e.  RR  ->  A  e.  CC )
23223ad2ant1 978 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  A  e.  CC )
24 nnne0 9966 . . . . . . . . . 10  |-  ( B  e.  NN  ->  B  =/=  0 )
2518, 24jca 519 . . . . . . . . 9  |-  ( B  e.  NN  ->  ( B  e.  CC  /\  B  =/=  0 ) )
26253ad2ant2 979 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B  e.  CC  /\  B  =/=  0 ) )
27 div23 9631 . . . . . . . 8  |-  ( ( ( B ^ K
)  e.  CC  /\  A  e.  CC  /\  ( B  e.  CC  /\  B  =/=  0 ) )  -> 
( ( ( B ^ K )  x.  A )  /  B
)  =  ( ( ( B ^ K
)  /  B )  x.  A ) )
2821, 23, 26, 27syl3anc 1184 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( ( B ^ K )  x.  A
)  /  B )  =  ( ( ( B ^ K )  /  B )  x.  A ) )
29 nnz 10237 . . . . . . . . . 10  |-  ( K  e.  NN  ->  K  e.  ZZ )
30 expm1 11358 . . . . . . . . . . 11  |-  ( ( B  e.  CC  /\  B  =/=  0  /\  K  e.  ZZ )  ->  ( B ^ ( K  - 
1 ) )  =  ( ( B ^ K )  /  B
) )
31303expa 1153 . . . . . . . . . 10  |-  ( ( ( B  e.  CC  /\  B  =/=  0 )  /\  K  e.  ZZ )  ->  ( B ^
( K  -  1 ) )  =  ( ( B ^ K
)  /  B ) )
3225, 29, 31syl2an 464 . . . . . . . . 9  |-  ( ( B  e.  NN  /\  K  e.  NN )  ->  ( B ^ ( K  -  1 ) )  =  ( ( B ^ K )  /  B ) )
33323adant1 975 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B ^ ( K  - 
1 ) )  =  ( ( B ^ K )  /  B
) )
3433oveq1d 6037 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( B ^ ( K  -  1 ) )  x.  A )  =  ( ( ( B ^ K )  /  B )  x.  A ) )
3528, 34eqtr4d 2424 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( ( B ^ K )  x.  A
)  /  B )  =  ( ( B ^ ( K  - 
1 ) )  x.  A ) )
3635fveq2d 5674 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( ( B ^ K )  x.  A )  /  B ) )  =  ( |_ `  (
( B ^ ( K  -  1 ) )  x.  A ) ) )
3717, 36eqtrd 2421 . . . 4  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( |_
`  ( ( B ^ K )  x.  A ) )  /  B ) )  =  ( |_ `  (
( B ^ ( K  -  1 ) )  x.  A ) ) )
3837oveq2d 6038 . . 3  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B  x.  ( |_ `  ( ( |_ `  ( ( B ^ K )  x.  A
) )  /  B
) ) )  =  ( B  x.  ( |_ `  ( ( B ^ ( K  - 
1 ) )  x.  A ) ) ) )
3938oveq2d 6038 . 2  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( |_ `  (
( B ^ K
)  x.  A ) )  -  ( B  x.  ( |_ `  ( ( |_ `  ( ( B ^ K )  x.  A
) )  /  B
) ) ) )  =  ( ( |_
`  ( ( B ^ K )  x.  A ) )  -  ( B  x.  ( |_ `  ( ( B ^ ( K  - 
1 ) )  x.  A ) ) ) ) )
4014, 39eqtrd 2421 1  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( |_ `  (
( B ^ K
)  x.  A ) )  mod  B )  =  ( ( |_
`  ( ( B ^ K )  x.  A ) )  -  ( B  x.  ( |_ `  ( ( B ^ ( K  - 
1 ) )  x.  A ) ) ) ) )
Colors of variables: wff set class
Syntax hints:    -> wi 4    /\ wa 359    /\ w3a 936    = wceq 1649    e. wcel 1717    =/= wne 2552   ` cfv 5396  (class class class)co 6022   CCcc 8923   RRcr 8924   0cc0 8925   1c1 8926    x. cmul 8930    - cmin 9225    / cdiv 9611   NNcn 9934   NN0cn0 10155   ZZcz 10216   RR+crp 10546   |_cfl 11130    mod cmo 11179   ^cexp 11311
This theorem is referenced by:  digit1  11442
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 2370  ax-sep 4273  ax-nul 4281  ax-pow 4320  ax-pr 4346  ax-un 4643  ax-cnex 8981  ax-resscn 8982  ax-1cn 8983  ax-icn 8984  ax-addcl 8985  ax-addrcl 8986  ax-mulcl 8987  ax-mulrcl 8988  ax-mulcom 8989  ax-addass 8990  ax-mulass 8991  ax-distr 8992  ax-i2m1 8993  ax-1ne0 8994  ax-1rid 8995  ax-rnegex 8996  ax-rrecex 8997  ax-cnre 8998  ax-pre-lttri 8999  ax-pre-lttrn 9000  ax-pre-ltadd 9001  ax-pre-mulgt0 9002  ax-pre-sup 9003
This theorem depends on definitions:  df-bi 178  df-or 360  df-an 361  df-3or 937  df-3an 938  df-tru 1325  df-ex 1548  df-nf 1551  df-sb 1656  df-eu 2244  df-mo 2245  df-clab 2376  df-cleq 2382  df-clel 2385  df-nfc 2514  df-ne 2554  df-nel 2555  df-ral 2656  df-rex 2657  df-reu 2658  df-rmo 2659  df-rab 2660  df-v 2903  df-sbc 3107  df-csb 3197  df-dif 3268  df-un 3270  df-in 3272  df-ss 3279  df-pss 3281  df-nul 3574  df-if 3685  df-pw 3746  df-sn 3765  df-pr 3766  df-tp 3767  df-op 3768  df-uni 3960  df-iun 4039  df-br 4156  df-opab 4210  df-mpt 4211  df-tr 4246  df-eprel 4437  df-id 4441  df-po 4446  df-so 4447  df-fr 4484  df-we 4486  df-ord 4527  df-on 4528  df-lim 4529  df-suc 4530  df-om 4788  df-xp 4826  df-rel 4827  df-cnv 4828  df-co 4829  df-dm 4830  df-rn 4831  df-res 4832  df-ima 4833  df-iota 5360  df-fun 5398  df-fn 5399  df-f 5400  df-f1 5401  df-fo 5402  df-f1o 5403  df-fv 5404  df-ov 6025  df-oprab 6026  df-mpt2 6027  df-2nd 6291  df-riota 6487  df-recs 6571  df-rdg 6606  df-er 6843  df-en 7048  df-dom 7049  df-sdom 7050  df-sup 7383  df-pnf 9057  df-mnf 9058  df-xr 9059  df-ltxr 9060  df-le 9061  df-sub 9227  df-neg 9228  df-div 9612  df-nn 9935  df-n0 10156  df-z 10217  df-uz 10423  df-rp 10547  df-fl 11131  df-mod 11180  df-seq 11253  df-exp 11312
  Copyright terms: Public domain W3C validator