Metamath Proof Explorer


Theorem digvalnn0

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

Ref Expression
Assertion digvalnn0 ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → K digit ⁡ B R ∈ ℕ 0

Proof

Step Hyp Ref Expression
1 digval ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → K digit ⁡ B R = B − K ⁢ R mod B
2 nnre ⊢ B ∈ ℕ → B ∈ ℝ
3 2 3ad2ant1 ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B ∈ ℝ
4 nnne0 ⊢ B ∈ ℕ → B ≠ 0
5 4 3ad2ant1 ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B ≠ 0
6 znegcl ⊢ K ∈ ℤ → − K ∈ ℤ
7 6 3ad2ant2 ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → − K ∈ ℤ
8 3 5 7 reexpclzd ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B − K ∈ ℝ
9 elrege0 ⊢ R ∈ 0 +∞ ↔ R ∈ ℝ ∧ 0 ≤ R
10 9 simplbi ⊢ R ∈ 0 +∞ → R ∈ ℝ
11 10 3ad2ant3 ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → R ∈ ℝ
12 8 11 remulcld ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B − K ⁢ R ∈ ℝ
13 12 flcld ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B − K ⁢ R ∈ ℤ
14 simp1 ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B ∈ ℕ
15 13 14 zmodcld ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → B − K ⁢ R mod B ∈ ℕ 0
16 1 15 eqeltrd ⊢ B ∈ ℕ ∧ K ∈ ℤ ∧ R ∈ 0 +∞ → K digit ⁡ B R ∈ ℕ 0