Representation of reals in positional system #
This file defines Real.ofDigits and Real.digits functions which allows to work with the
representations of reals as sequences of digits in positional system.
Main Definitions #
ofDigits: takes a sequence of digits(d₀, d₁, ...)(as anℕ → Fin b), and returns the real number0.d₀d₁d₂....digits: takes a real number in [0,1) and returns the sequence of its digits.
Main Statements #
ofDigits_digitsstates thatofDigits (digits x b) = x.
ofDigits takes a sequence of digits (d₀, d₁, ...) in base b and returns the
real number 0.d₀d₁d₂... = ∑ᵢ(dᵢ/bⁱ). This auxiliary definition ofDigitsTerm sends the
sequence to the function sending i to dᵢ/bⁱ.
Equations
Instances For
ofDigits d is the real number 0.d₀d₁d₂... in base b.
We allow repeating representations like 0.999... here.
Equations
Instances For
Converts a real number x from the interval [0, 1) into sequence of
its digits in base b.
Equations
Instances For
theorem
Real.hasSum_ofDigitsTerm_digits
(x : ℝ)
{b : ℕ}
[NeZero b]
(hb : 1 < b)
(hx : x ∈ Set.Ico 0 1)
:
HasSum (ofDigitsTerm (x.digits b)) x
A generalization of the identity 0.(9) = 1 to arbitrary positional numeral systems.