Metamath Proof Explorer


Theorem nn0digval

Description: The K th digit of a nonnegative real number R in the positional system with base B . (Contributed by AV, 23-May-2020)

Ref Expression
Assertion nn0digval BK0R0+∞KdigitBR=RBKmodB

Proof

Step Hyp Ref Expression
1 nn0z K0K
2 digval BKR0+∞KdigitBR=BKRmodB
3 1 2 syl3an2 BK0R0+∞KdigitBR=BKRmodB
4 nncn BB
5 4 anim1i BK0BK0
6 expneg BK0BK=1BK
7 5 6 syl BK0BK=1BK
8 7 3adant3 BK0R0+∞BK=1BK
9 8 oveq1d BK0R0+∞BKR=1BKR
10 elrege0 R0+∞R0R
11 recn RR
12 11 adantr R0RR
13 10 12 sylbi R0+∞R
14 13 3ad2ant3 BK0R0+∞R
15 5 3adant3 BK0R0+∞BK0
16 expcl BK0BK
17 15 16 syl BK0R0+∞BK
18 4 3ad2ant1 BK0R0+∞B
19 nnne0 BB0
20 19 3ad2ant1 BK0R0+∞B0
21 1 3ad2ant2 BK0R0+∞K
22 18 20 21 expne0d BK0R0+∞BK0
23 14 17 22 divrec2d BK0R0+∞RBK=1BKR
24 9 23 eqtr4d BK0R0+∞BKR=RBK
25 24 fveq2d BK0R0+∞BKR=RBK
26 25 oveq1d BK0R0+∞BKRmodB=RBKmodB
27 3 26 eqtrd BK0R0+∞KdigitBR=RBKmodB