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 B K 0 R 0 +∞ K digit B R = R B K mod B

Proof

Step Hyp Ref Expression
1 nn0z K 0 K
2 digval B K R 0 +∞ K digit B R = B K R mod B
3 1 2 syl3an2 B K 0 R 0 +∞ K digit B R = B K R mod B
4 nncn B B
5 4 anim1i B K 0 B K 0
6 expneg B K 0 B K = 1 B K
7 5 6 syl B K 0 B K = 1 B K
8 7 3adant3 B K 0 R 0 +∞ B K = 1 B K
9 8 oveq1d B K 0 R 0 +∞ B K R = 1 B K R
10 elrege0 R 0 +∞ R 0 R
11 recn R R
12 11 adantr R 0 R R
13 10 12 sylbi R 0 +∞ R
14 13 3ad2ant3 B K 0 R 0 +∞ R
15 5 3adant3 B K 0 R 0 +∞ B K 0
16 expcl B K 0 B K
17 15 16 syl B K 0 R 0 +∞ B K
18 4 3ad2ant1 B K 0 R 0 +∞ B
19 nnne0 B B 0
20 19 3ad2ant1 B K 0 R 0 +∞ B 0
21 1 3ad2ant2 B K 0 R 0 +∞ K
22 18 20 21 expne0d B K 0 R 0 +∞ B K 0
23 14 17 22 divrec2d B K 0 R 0 +∞ R B K = 1 B K R
24 9 23 eqtr4d B K 0 R 0 +∞ B K R = R B K
25 24 fveq2d B K 0 R 0 +∞ B K R = R B K
26 25 oveq1d B K 0 R 0 +∞ B K R mod B = R B K mod B
27 3 26 eqtrd B K 0 R 0 +∞ K digit B R = R B K mod B