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

Theorem digit2 12084
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 10416 . . . . . . . 8  |-  ( B  e.  NN  ->  B  e.  RR )
2 nnnn0 10673 . . . . . . . 8  |-  ( K  e.  NN  ->  K  e.  NN0 )
3 reexpcl 11969 . . . . . . . 8  |-  ( ( B  e.  RR  /\  K  e.  NN0 )  -> 
( B ^ K
)  e.  RR )
41, 2, 3syl2an 477 . . . . . . 7  |-  ( ( B  e.  NN  /\  K  e.  NN )  ->  ( B ^ K
)  e.  RR )
5 remulcl 9454 . . . . . . 7  |-  ( ( ( B ^ K
)  e.  RR  /\  A  e.  RR )  ->  ( ( B ^ K )  x.  A
)  e.  RR )
64, 5sylan 471 . . . . . 6  |-  ( ( ( B  e.  NN  /\  K  e.  NN )  /\  A  e.  RR )  ->  ( ( B ^ K )  x.  A )  e.  RR )
763impa 1183 . . . . 5  |-  ( ( B  e.  NN  /\  K  e.  NN  /\  A  e.  RR )  ->  (
( B ^ K
)  x.  A )  e.  RR )
873comr 1196 . . . 4  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( B ^ K
)  x.  A )  e.  RR )
9 reflcl 11733 . . . 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 11087 . . . 4  |-  ( B  e.  NN  ->  B  e.  RR+ )
12113ad2ant2 1010 . . 3  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  B  e.  RR+ )
13 modval 11797 . . 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 661 . 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 989 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  B  e.  NN )
16 fldiv 11786 . . . . . 6  |-  ( ( ( ( B ^ K )  x.  A
)  e.  RR  /\  B  e.  NN )  ->  ( |_ `  (
( |_ `  (
( B ^ K
)  x.  A ) )  /  B ) )  =  ( |_
`  ( ( ( B ^ K )  x.  A )  /  B ) ) )
178, 15, 16syl2anc 661 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( |_
`  ( ( B ^ K )  x.  A ) )  /  B ) )  =  ( |_ `  (
( ( B ^ K )  x.  A
)  /  B ) ) )
18 nncn 10417 . . . . . . . . . 10  |-  ( B  e.  NN  ->  B  e.  CC )
19 expcl 11970 . . . . . . . . . 10  |-  ( ( B  e.  CC  /\  K  e.  NN0 )  -> 
( B ^ K
)  e.  CC )
2018, 2, 19syl2an 477 . . . . . . . . 9  |-  ( ( B  e.  NN  /\  K  e.  NN )  ->  ( B ^ K
)  e.  CC )
21203adant1 1006 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B ^ K )  e.  CC )
22 recn 9459 . . . . . . . . 9  |-  ( A  e.  RR  ->  A  e.  CC )
23223ad2ant1 1009 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  A  e.  CC )
24 nnne0 10441 . . . . . . . . . 10  |-  ( B  e.  NN  ->  B  =/=  0 )
2518, 24jca 532 . . . . . . . . 9  |-  ( B  e.  NN  ->  ( B  e.  CC  /\  B  =/=  0 ) )
26253ad2ant2 1010 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B  e.  CC  /\  B  =/=  0 ) )
27 div23 10100 . . . . . . . 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 1219 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( ( B ^ K )  x.  A
)  /  B )  =  ( ( ( B ^ K )  /  B )  x.  A ) )
29 nnz 10755 . . . . . . . . . 10  |-  ( K  e.  NN  ->  K  e.  ZZ )
30 expm1 12000 . . . . . . . . . . 11  |-  ( ( B  e.  CC  /\  B  =/=  0  /\  K  e.  ZZ )  ->  ( B ^ ( K  - 
1 ) )  =  ( ( B ^ K )  /  B
) )
31303expa 1188 . . . . . . . . . 10  |-  ( ( ( B  e.  CC  /\  B  =/=  0 )  /\  K  e.  ZZ )  ->  ( B ^
( K  -  1 ) )  =  ( ( B ^ K
)  /  B ) )
3225, 29, 31syl2an 477 . . . . . . . . 9  |-  ( ( B  e.  NN  /\  K  e.  NN )  ->  ( B ^ ( K  -  1 ) )  =  ( ( B ^ K )  /  B ) )
33323adant1 1006 . . . . . . . 8  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( B ^ ( K  - 
1 ) )  =  ( ( B ^ K )  /  B
) )
3433oveq1d 6191 . . . . . . 7  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( B ^ ( K  -  1 ) )  x.  A )  =  ( ( ( B ^ K )  /  B )  x.  A ) )
3528, 34eqtr4d 2493 . . . . . 6  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  (
( ( B ^ K )  x.  A
)  /  B )  =  ( ( B ^ ( K  - 
1 ) )  x.  A ) )
3635fveq2d 5779 . . . . 5  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( ( B ^ K )  x.  A )  /  B ) )  =  ( |_ `  (
( B ^ ( K  -  1 ) )  x.  A ) ) )
3717, 36eqtrd 2490 . . . 4  |-  ( ( A  e.  RR  /\  B  e.  NN  /\  K  e.  NN )  ->  ( |_ `  ( ( |_
`  ( ( B ^ K )  x.  A ) )  /  B ) )  =  ( |_ `  (
( B ^ ( K  -  1 ) )  x.  A ) ) )
3837oveq2d 6192 . . 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 6192 . 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 2490 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 setvar class
Syntax hints:    -> wi 4    /\ wa 369    /\ w3a 965    = wceq 1370    e. wcel 1757    =/= wne 2641   ` cfv 5502  (class class class)co 6176   CCcc 9367   RRcr 9368   0cc0 9369   1c1 9370    x. cmul 9374    - cmin 9682    / cdiv 10080   NNcn 10409   NN0cn0 10666   ZZcz 10733   RR+crp 11078   |_cfl 11727    mod cmo 11795   ^cexp 11952
This theorem was proved from axioms:  ax-mp 5  ax-1 6  ax-2 7  ax-3 8  ax-gen 1592  ax-4 1603  ax-5 1671  ax-6 1709  ax-7 1729  ax-8 1759  ax-9 1761  ax-10 1776  ax-11 1781  ax-12 1793  ax-13 1944  ax-ext 2429  ax-sep 4497  ax-nul 4505  ax-pow 4554  ax-pr 4615  ax-un 6458  ax-cnex 9425  ax-resscn 9426  ax-1cn 9427  ax-icn 9428  ax-addcl 9429  ax-addrcl 9430  ax-mulcl 9431  ax-mulrcl 9432  ax-mulcom 9433  ax-addass 9434  ax-mulass 9435  ax-distr 9436  ax-i2m1 9437  ax-1ne0 9438  ax-1rid 9439  ax-rnegex 9440  ax-rrecex 9441  ax-cnre 9442  ax-pre-lttri 9443  ax-pre-lttrn 9444  ax-pre-ltadd 9445  ax-pre-mulgt0 9446  ax-pre-sup 9447
This theorem depends on definitions:  df-bi 185  df-or 370  df-an 371  df-3or 966  df-3an 967  df-tru 1373  df-ex 1588  df-nf 1591  df-sb 1702  df-eu 2263  df-mo 2264  df-clab 2436  df-cleq 2442  df-clel 2445  df-nfc 2598  df-ne 2643  df-nel 2644  df-ral 2797  df-rex 2798  df-reu 2799  df-rmo 2800  df-rab 2801  df-v 3056  df-sbc 3271  df-csb 3373  df-dif 3415  df-un 3417  df-in 3419  df-ss 3426  df-pss 3428  df-nul 3722  df-if 3876  df-pw 3946  df-sn 3962  df-pr 3964  df-tp 3966  df-op 3968  df-uni 4176  df-iun 4257  df-br 4377  df-opab 4435  df-mpt 4436  df-tr 4470  df-eprel 4716  df-id 4720  df-po 4725  df-so 4726  df-fr 4763  df-we 4765  df-ord 4806  df-on 4807  df-lim 4808  df-suc 4809  df-xp 4930  df-rel 4931  df-cnv 4932  df-co 4933  df-dm 4934  df-rn 4935  df-res 4936  df-ima 4937  df-iota 5465  df-fun 5504  df-fn 5505  df-f 5506  df-f1 5507  df-fo 5508  df-f1o 5509  df-fv 5510  df-riota 6137  df-ov 6179  df-oprab 6180  df-mpt2 6181  df-om 6563  df-2nd 6664  df-recs 6918  df-rdg 6952  df-er 7187  df-en 7397  df-dom 7398  df-sdom 7399  df-sup 7778  df-pnf 9507  df-mnf 9508  df-xr 9509  df-ltxr 9510  df-le 9511  df-sub 9684  df-neg 9685  df-div 10081  df-nn 10410  df-n0 10667  df-z 10734  df-uz 10949  df-rp 11079  df-fl 11729  df-mod 11796  df-seq 11894  df-exp 11953
This theorem is referenced by:  digit1  12085
  Copyright terms: Public domain W3C validator