Metamath Proof Explorer


Theorem digval

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

Proof

Step Hyp Ref Expression
1 digfval B digit B = k , r 0 +∞ B k r mod B
2 1 3ad2ant1 B K R 0 +∞ digit B = k , r 0 +∞ B k r mod B
3 negeq k = K k = K
4 3 oveq2d k = K B k = B K
5 4 adantr k = K r = R B k = B K
6 simpr k = K r = R r = R
7 5 6 oveq12d k = K r = R B k r = B K R
8 7 fveq2d k = K r = R B k r = B K R
9 8 oveq1d k = K r = R B k r mod B = B K R mod B
10 9 adantl B K R 0 +∞ k = K r = R B k r mod B = B K R mod B
11 simp2 B K R 0 +∞ K
12 simp3 B K R 0 +∞ R 0 +∞
13 ovexd B K R 0 +∞ B K R mod B V
14 2 10 11 12 13 ovmpod B K R 0 +∞ K digit B R = B K R mod B